// Autogenerated: 'src/ExtractionOCaml/word_by_word_montgomery' --lang Zig --internal-static --public-function-case camelCase --private-function-case camelCase --public-type-case UpperCamelCase --private-type-case UpperCamelCase --no-prefix-fiat --package-name p434 '' 64 '2^216 * 3^137 - 1' mul square add sub opp from_montgomery to_montgomery nonzero selectznz to_bytes from_bytes one msat divstep divstep_precomp
// curve description (via package name): p434
// machine_wordsize = 64 (from "64")
// requested operations: mul, square, add, sub, opp, from_montgomery, to_montgomery, nonzero, selectznz, to_bytes, from_bytes, one, msat, divstep, divstep_precomp
// m = 0x2341f271773446cfc5fd681c520567bc65c783158aea3fdc1767ae2ffffffffffffffffffffffffffffffffffffffffffffffffffffff (from "2^216 * 3^137 - 1")
//
// NOTE: In addition to the bounds specified above each function, all
//   functions synthesized for this Montgomery arithmetic require the
//   input to be strictly less than the prime modulus (m), and also
//   require the input to be in the unique saturated representation.
//   All functions also ensure that these two properties are true of
//   return values.
//
// Computed values:
//   eval z = z[0] + (z[1] << 64) + (z[2] << 128) + (z[3] << 192) + (z[4] << 256) + (z[5] << 0x140) + (z[6] << 0x180)
//   bytes_eval z = z[0] + (z[1] << 8) + (z[2] << 16) + (z[3] << 24) + (z[4] << 32) + (z[5] << 40) + (z[6] << 48) + (z[7] << 56) + (z[8] << 64) + (z[9] << 72) + (z[10] << 80) + (z[11] << 88) + (z[12] << 96) + (z[13] << 104) + (z[14] << 112) + (z[15] << 120) + (z[16] << 128) + (z[17] << 136) + (z[18] << 144) + (z[19] << 152) + (z[20] << 160) + (z[21] << 168) + (z[22] << 176) + (z[23] << 184) + (z[24] << 192) + (z[25] << 200) + (z[26] << 208) + (z[27] << 216) + (z[28] << 224) + (z[29] << 232) + (z[30] << 240) + (z[31] << 248) + (z[32] << 256) + (z[33] << 0x108) + (z[34] << 0x110) + (z[35] << 0x118) + (z[36] << 0x120) + (z[37] << 0x128) + (z[38] << 0x130) + (z[39] << 0x138) + (z[40] << 0x140) + (z[41] << 0x148) + (z[42] << 0x150) + (z[43] << 0x158) + (z[44] << 0x160) + (z[45] << 0x168) + (z[46] << 0x170) + (z[47] << 0x178) + (z[48] << 0x180) + (z[49] << 0x188) + (z[50] << 0x190) + (z[51] << 0x198) + (z[52] << 0x1a0) + (z[53] << 0x1a8) + (z[54] << 0x1b0)
//   twos_complement_eval z = let x1 := z[0] + (z[1] << 64) + (z[2] << 128) + (z[3] << 192) + (z[4] << 256) + (z[5] << 0x140) + (z[6] << 0x180) in
//                            if x1 & (2^448-1) < 2^447 then x1 & (2^448-1) else (x1 & (2^448-1)) - 2^448

const std = @import("std");
const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-debug modes to avoid side channels

inline fn cast(comptime DestType: type, target: anytype) DestType {
    @setEvalBranchQuota(10000);
    if (@typeInfo(@TypeOf(target)) == .int) {
        const dest = @typeInfo(DestType).int;
        const source = @typeInfo(@TypeOf(target)).int;
        if (dest.bits < source.bits) {
            const T = std.meta.Int(source.signedness, dest.bits);
            return @bitCast(@as(T, @truncate(target)));
        }
    }
    return target;
}

// The type MontgomeryDomainFieldElement is a field element in the Montgomery domain.
// Bounds: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
pub const MontgomeryDomainFieldElement = [7]u64;

// The type NonMontgomeryDomainFieldElement is a field element NOT in the Montgomery domain.
// Bounds: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
pub const NonMontgomeryDomainFieldElement = [7]u64;

/// The function addcarryxU64 is an addition with carry.
///
/// Postconditions:
///   out1 = (arg1 + arg2 + arg3) mod 2^64
///   out2 = ⌊(arg1 + arg2 + arg3) / 2^64⌋
///
/// Input Bounds:
///   arg1: [0x0 ~> 0x1]
///   arg2: [0x0 ~> 0xffffffffffffffff]
///   arg3: [0x0 ~> 0xffffffffffffffff]
/// Output Bounds:
///   out1: [0x0 ~> 0xffffffffffffffff]
///   out2: [0x0 ~> 0x1]
inline fn addcarryxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) void {
    @setRuntimeSafety(mode == .Debug);

    const x1 = ((cast(u128, arg1) + cast(u128, arg2)) + cast(u128, arg3));
    const x2 = cast(u64, (x1 & cast(u128, 0xffffffffffffffff)));
    const x3 = cast(u1, (x1 >> 64));
    out1.* = x2;
    out2.* = x3;
}

/// The function subborrowxU64 is a subtraction with borrow.
///
/// Postconditions:
///   out1 = (-arg1 + arg2 + -arg3) mod 2^64
///   out2 = -⌊(-arg1 + arg2 + -arg3) / 2^64⌋
///
/// Input Bounds:
///   arg1: [0x0 ~> 0x1]
///   arg2: [0x0 ~> 0xffffffffffffffff]
///   arg3: [0x0 ~> 0xffffffffffffffff]
/// Output Bounds:
///   out1: [0x0 ~> 0xffffffffffffffff]
///   out2: [0x0 ~> 0x1]
inline fn subborrowxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) void {
    @setRuntimeSafety(mode == .Debug);

    const x1 = ((cast(i128, arg2) - cast(i128, arg1)) - cast(i128, arg3));
    const x2 = cast(i1, (x1 >> 64));
    const x3 = cast(u64, (x1 & cast(i128, 0xffffffffffffffff)));
    out1.* = x3;
    out2.* = cast(u1, (cast(i2, 0x0) - cast(i2, x2)));
}

/// The function mulxU64 is a multiplication, returning the full double-width result.
///
/// Postconditions:
///   out1 = (arg1 * arg2) mod 2^64
///   out2 = ⌊arg1 * arg2 / 2^64⌋
///
/// Input Bounds:
///   arg1: [0x0 ~> 0xffffffffffffffff]
///   arg2: [0x0 ~> 0xffffffffffffffff]
/// Output Bounds:
///   out1: [0x0 ~> 0xffffffffffffffff]
///   out2: [0x0 ~> 0xffffffffffffffff]
inline fn mulxU64(out1: *u64, out2: *u64, arg1: u64, arg2: u64) void {
    @setRuntimeSafety(mode == .Debug);

    const x1 = (cast(u128, arg1) * cast(u128, arg2));
    const x2 = cast(u64, (x1 & cast(u128, 0xffffffffffffffff)));
    const x3 = cast(u64, (x1 >> 64));
    out1.* = x2;
    out2.* = x3;
}

/// The function cmovznzU64 is a single-word conditional move.
///
/// Postconditions:
///   out1 = (if arg1 = 0 then arg2 else arg3)
///
/// Input Bounds:
///   arg1: [0x0 ~> 0x1]
///   arg2: [0x0 ~> 0xffffffffffffffff]
///   arg3: [0x0 ~> 0xffffffffffffffff]
/// Output Bounds:
///   out1: [0x0 ~> 0xffffffffffffffff]
inline fn cmovznzU64(out1: *u64, arg1: u1, arg2: u64, arg3: u64) void {
    @setRuntimeSafety(mode == .Debug);

    const x1 = (~(~arg1));
    const x2 = cast(u64, (cast(i128, cast(i1, (cast(i2, 0x0) - cast(i2, x1)))) & cast(i128, 0xffffffffffffffff)));
    const x3 = ((x2 & arg3) | ((~x2) & arg2));
    out1.* = x3;
}

/// The function mul multiplies two field elements in the Montgomery domain.
///
/// Preconditions:
///   0 ≤ eval arg1 < m
///   0 ≤ eval arg2 < m
/// Postconditions:
///   eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg2)) mod m
///   0 ≤ eval out1 < m
///
pub fn mul(out1: *MontgomeryDomainFieldElement, arg1: MontgomeryDomainFieldElement, arg2: MontgomeryDomainFieldElement) void {
    @setRuntimeSafety(mode == .Debug);

    const x1 = (arg1[1]);
    const x2 = (arg1[2]);
    const x3 = (arg1[3]);
    const x4 = (arg1[4]);
    const x5 = (arg1[5]);
    const x6 = (arg1[6]);
    const x7 = (arg1[0]);
    var x8: u64 = undefined;
    var x9: u64 = undefined;
    mulxU64(&x8, &x9, x7, (arg2[6]));
    var x10: u64 = undefined;
    var x11: u64 = undefined;
    mulxU64(&x10, &x11, x7, (arg2[5]));
    var x12: u64 = undefined;
    var x13: u64 = undefined;
    mulxU64(&x12, &x13, x7, (arg2[4]));
    var x14: u64 = undefined;
    var x15: u64 = undefined;
    mulxU64(&x14, &x15, x7, (arg2[3]));
    var x16: u64 = undefined;
    var x17: u64 = undefined;
    mulxU64(&x16, &x17, x7, (arg2[2]));
    var x18: u64 = undefined;
    var x19: u64 = undefined;
    mulxU64(&x18, &x19, x7, (arg2[1]));
    var x20: u64 = undefined;
    var x21: u64 = undefined;
    mulxU64(&x20, &x21, x7, (arg2[0]));
    var x22: u64 = undefined;
    var x23: u1 = undefined;
    addcarryxU64(&x22, &x23, 0x0, x21, x18);
    var x24: u64 = undefined;
    var x25: u1 = undefined;
    addcarryxU64(&x24, &x25, x23, x19, x16);
    var x26: u64 = undefined;
    var x27: u1 = undefined;
    addcarryxU64(&x26, &x27, x25, x17, x14);
    var x28: u64 = undefined;
    var x29: u1 = undefined;
    addcarryxU64(&x28, &x29, x27, x15, x12);
    var x30: u64 = undefined;
    var x31: u1 = undefined;
    addcarryxU64(&x30, &x31, x29, x13, x10);
    var x32: u64 = undefined;
    var x33: u1 = undefined;
    addcarryxU64(&x32, &x33, x31, x11, x8);
    const x34 = (cast(u64, x33) + x9);
    var x35: u64 = undefined;
    var x36: u64 = undefined;
    mulxU64(&x35, &x36, x20, 0x2341f27177344);
    var x37: u64 = undefined;
    var x38: u64 = undefined;
    mulxU64(&x37, &x38, x20, 0x6cfc5fd681c52056);
    var x39: u64 = undefined;
    var x40: u64 = undefined;
    mulxU64(&x39, &x40, x20, 0x7bc65c783158aea3);
    var x41: u64 = undefined;
    var x42: u64 = undefined;
    mulxU64(&x41, &x42, x20, 0xfdc1767ae2ffffff);
    var x43: u64 = undefined;
    var x44: u64 = undefined;
    mulxU64(&x43, &x44, x20, 0xffffffffffffffff);
    var x45: u64 = undefined;
    var x46: u64 = undefined;
    mulxU64(&x45, &x46, x20, 0xffffffffffffffff);
    var x47: u64 = undefined;
    var x48: u64 = undefined;
    mulxU64(&x47, &x48, x20, 0xffffffffffffffff);
    var x49: u64 = undefined;
    var x50: u1 = undefined;
    addcarryxU64(&x49, &x50, 0x0, x48, x45);
    var x51: u64 = undefined;
    var x52: u1 = undefined;
    addcarryxU64(&x51, &x52, x50, x46, x43);
    var x53: u64 = undefined;
    var x54: u1 = undefined;
    addcarryxU64(&x53, &x54, x52, x44, x41);
    var x55: u64 = undefined;
    var x56: u1 = undefined;
    addcarryxU64(&x55, &x56, x54, x42, x39);
    var x57: u64 = undefined;
    var x58: u1 = undefined;
    addcarryxU64(&x57, &x58, x56, x40, x37);
    var x59: u64 = undefined;
    var x60: u1 = undefined;
    addcarryxU64(&x59, &x60, x58, x38, x35);
    const x61 = (cast(u64, x60) + x36);
    var x62: u64 = undefined;
    var x63: u1 = undefined;
    addcarryxU64(&x62, &x63, 0x0, x20, x47);
    var x64: u64 = undefined;
    var x65: u1 = undefined;
    addcarryxU64(&x64, &x65, x63, x22, x49);
    var x66: u64 = undefined;
    var x67: u1 = undefined;
    addcarryxU64(&x66, &x67, x65, x24, x51);
    var x68: u64 = undefined;
    var x69: u1 = undefined;
    addcarryxU64(&x68, &x69, x67, x26, x53);
    var x70: u64 = undefined;
    var x71: u1 = undefined;
    addcarryxU64(&x70, &x71, x69, x28, x55);
    var x72: u64 = undefined;
    var x73: u1 = undefined;
    addcarryxU64(&x72, &x73, x71, x30, x57);
    var x74: u64 = undefined;
    var x75: u1 = undefined;
    addcarryxU64(&x74, &x75, x73, x32, x59);
    var x76: u64 = undefined;
    var x77: u1 = undefined;
    addcarryxU64(&x76, &x77, x75, x34, x61);
    var x78: u64 = undefined;
    var x79: u64 = undefined;
    mulxU64(&x78, &x79, x1, (arg2[6]));
    var x80: u64 = undefined;
    var x81: u64 = undefined;
    mulxU64(&x80, &x81, x1, (arg2[5]));
    var x82: u64 = undefined;
    var x83: u64 = undefined;
    mulxU64(&x82, &x83, x1, (arg2[4]));
    var x84: u64 = undefined;
    var x85: u64 = undefined;
    mulxU64(&x84, &x85, x1, (arg2[3]));
    var x86: u64 = undefined;
    var x87: u64 = undefined;
    mulxU64(&x86, &x87, x1, (arg2[2]));
    var x88: u64 = undefined;
    var x89: u64 = undefined;
    mulxU64(&x88, &x89, x1, (arg2[1]));
    var x90: u64 = undefined;
    var x91: u64 = undefined;
    mulxU64(&x90, &x91, x1, (arg2[0]));
    var x92: u64 = undefined;
    var x93: u1 = undefined;
    addcarryxU64(&x92, &x93, 0x0, x91, x88);
    var x94: u64 = undefined;
    var x95: u1 = undefined;
    addcarryxU64(&x94, &x95, x93, x89, x86);
    var x96: u64 = undefined;
    var x97: u1 = undefined;
    addcarryxU64(&x96, &x97, x95, x87, x84);
    var x98: u64 = undefined;
    var x99: u1 = undefined;
    addcarryxU64(&x98, &x99, x97, x85, x82);
    var x100: u64 = undefined;
    var x101: u1 = undefined;
    addcarryxU64(&x100, &x101, x99, x83, x80);
    var x102: u64 = undefined;
    var x103: u1 = undefined;
    addcarryxU64(&x102, &x103, x101, x81, x78);
    const x104 = (cast(u64, x103) + x79);
    var x105: u64 = undefined;
    var x106: u1 = undefined;
    addcarryxU64(&x105, &x106, 0x0, x64, x90);
    var x107: u64 = undefined;
    var x108: u1 = undefined;
    addcarryxU64(&x107, &x108, x106, x66, x92);
    var x109: u64 = undefined;
    var x110: u1 = undefined;
    addcarryxU64(&x109, &x110, x108, x68, x94);
    var x111: u64 = undefined;
    var x112: u1 = undefined;
    addcarryxU64(&x111, &x112, x110, x70, x96);
    var x113: u64 = undefined;
    var x114: u1 = undefined;
    addcarryxU64(&x113, &x114, x112, x72, x98);
    var x115: u64 = undefined;
    var x116: u1 = undefined;
    addcarryxU64(&x115, &x116, x114, x74, x100);
    var x117: u64 = undefined;
    var x118: u1 = undefined;
    addcarryxU64(&x117, &x118, x116, x76, x102);
    var x119: u64 = undefined;
    var x120: u1 = undefined;
    addcarryxU64(&x119, &x120, x118, cast(u64, x77), x104);
    var x121: u64 = undefined;
    var x122: u64 = undefined;
    mulxU64(&x121, &x122, x105, 0x2341f27177344);
    var x123: u64 = undefined;
    var x124: u64 = undefined;
    mulxU64(&x123, &x124, x105, 0x6cfc5fd681c52056);
    var x125: u64 = undefined;
    var x126: u64 = undefined;
    mulxU64(&x125, &x126, x105, 0x7bc65c783158aea3);
    var x127: u64 = undefined;
    var x128: u64 = undefined;
    mulxU64(&x127, &x128, x105, 0xfdc1767ae2ffffff);
    var x129: u64 = undefined;
    var x130: u64 = undefined;
    mulxU64(&x129, &x130, x105, 0xffffffffffffffff);
    var x131: u64 = undefined;
    var x132: u64 = undefined;
    mulxU64(&x131, &x132, x105, 0xffffffffffffffff);
    var x133: u64 = undefined;
    var x134: u64 = undefined;
    mulxU64(&x133, &x134, x105, 0xffffffffffffffff);
    var x135: u64 = undefined;
    var x136: u1 = undefined;
    addcarryxU64(&x135, &x136, 0x0, x134, x131);
    var x137: u64 = undefined;
    var x138: u1 = undefined;
    addcarryxU64(&x137, &x138, x136, x132, x129);
    var x139: u64 = undefined;
    var x140: u1 = undefined;
    addcarryxU64(&x139, &x140, x138, x130, x127);
    var x141: u64 = undefined;
    var x142: u1 = undefined;
    addcarryxU64(&x141, &x142, x140, x128, x125);
    var x143: u64 = undefined;
    var x144: u1 = undefined;
    addcarryxU64(&x143, &x144, x142, x126, x123);
    var x145: u64 = undefined;
    var x146: u1 = undefined;
    addcarryxU64(&x145, &x146, x144, x124, x121);
    const x147 = (cast(u64, x146) + x122);
    var x148: u64 = undefined;
    var x149: u1 = undefined;
    addcarryxU64(&x148, &x149, 0x0, x105, x133);
    var x150: u64 = undefined;
    var x151: u1 = undefined;
    addcarryxU64(&x150, &x151, x149, x107, x135);
    var x152: u64 = undefined;
    var x153: u1 = undefined;
    addcarryxU64(&x152, &x153, x151, x109, x137);
    var x154: u64 = undefined;
    var x155: u1 = undefined;
    addcarryxU64(&x154, &x155, x153, x111, x139);
    var x156: u64 = undefined;
    var x157: u1 = undefined;
    addcarryxU64(&x156, &x157, x155, x113, x141);
    var x158: u64 = undefined;
    var x159: u1 = undefined;
    addcarryxU64(&x158, &x159, x157, x115, x143);
    var x160: u64 = undefined;
    var x161: u1 = undefined;
    addcarryxU64(&x160, &x161, x159, x117, x145);
    var x162: u64 = undefined;
    var x163: u1 = undefined;
    addcarryxU64(&x162, &x163, x161, x119, x147);
    const x164 = (cast(u64, x163) + cast(u64, x120));
    var x165: u64 = undefined;
    var x166: u64 = undefined;
    mulxU64(&x165, &x166, x2, (arg2[6]));
    var x167: u64 = undefined;
    var x168: u64 = undefined;
    mulxU64(&x167, &x168, x2, (arg2[5]));
    var x169: u64 = undefined;
    var x170: u64 = undefined;
    mulxU64(&x169, &x170, x2, (arg2[4]));
    var x171: u64 = undefined;
    var x172: u64 = undefined;
    mulxU64(&x171, &x172, x2, (arg2[3]));
    var x173: u64 = undefined;
    var x174: u64 = undefined;
    mulxU64(&x173, &x174, x2, (arg2[2]));
    var x175: u64 = undefined;
    var x176: u64 = undefined;
    mulxU64(&x175, &x176, x2, (arg2[1]));
    var x177: u64 = undefined;
    var x178: u64 = undefined;
    mulxU64(&x177, &x178, x2, (arg2[0]));
    var x179: u64 = undefined;
    var x180: u1 = undefined;
    addcarryxU64(&x179, &x180, 0x0, x178, x175);
    var x181: u64 = undefined;
    var x182: u1 = undefined;
    addcarryxU64(&x181, &x182, x180, x176, x173);
    var x183: u64 = undefined;
    var x184: u1 = undefined;
    addcarryxU64(&x183, &x184, x182, x174, x171);
    var x185: u64 = undefined;
    var x186: u1 = undefined;
    addcarryxU64(&x185, &x186, x184, x172, x169);
    var x187: u64 = undefined;
    var x188: u1 = undefined;
    addcarryxU64(&x187, &x188, x186, x170, x167);
    var x189: u64 = undefined;
    var x190: u1 = undefined;
    addcarryxU64(&x189, &x190, x188, x168, x165);
    const x191 = (cast(u64, x190) + x166);
    var x192: u64 = undefined;
    var x193: u1 = undefined;
    addcarryxU64(&x192, &x193, 0x0, x150, x177);
    var x194: u64 = undefined;
    var x195: u1 = undefined;
    addcarryxU64(&x194, &x195, x193, x152, x179);
    var x196: u64 = undefined;
    var x197: u1 = undefined;
    addcarryxU64(&x196, &x197, x195, x154, x181);
    var x198: u64 = undefined;
    var x199: u1 = undefined;
    addcarryxU64(&x198, &x199, x197, x156, x183);
    var x200: u64 = undefined;
    var x201: u1 = undefined;
    addcarryxU64(&x200, &x201, x199, x158, x185);
    var x202: u64 = undefined;
    var x203: u1 = undefined;
    addcarryxU64(&x202, &x203, x201, x160, x187);
    var x204: u64 = undefined;
    var x205: u1 = undefined;
    addcarryxU64(&x204, &x205, x203, x162, x189);
    var x206: u64 = undefined;
    var x207: u1 = undefined;
    addcarryxU64(&x206, &x207, x205, x164, x191);
    var x208: u64 = undefined;
    var x209: u64 = undefined;
    mulxU64(&x208, &x209, x192, 0x2341f27177344);
    var x210: u64 = undefined;
    var x211: u64 = undefined;
    mulxU64(&x210, &x211, x192, 0x6cfc5fd681c52056);
    var x212: u64 = undefined;
    var x213: u64 = undefined;
    mulxU64(&x212, &x213, x192, 0x7bc65c783158aea3);
    var x214: u64 = undefined;
    var x215: u64 = undefined;
    mulxU64(&x214, &x215, x192, 0xfdc1767ae2ffffff);
    var x216: u64 = undefined;
    var x217: u64 = undefined;
    mulxU64(&x216, &x217, x192, 0xffffffffffffffff);
    var x218: u64 = undefined;
    var x219: u64 = undefined;
    mulxU64(&x218, &x219, x192, 0xffffffffffffffff);
    var x220: u64 = undefined;
    var x221: u64 = undefined;
    mulxU64(&x220, &x221, x192, 0xffffffffffffffff);
    var x222: u64 = undefined;
    var x223: u1 = undefined;
    addcarryxU64(&x222, &x223, 0x0, x221, x218);
    var x224: u64 = undefined;
    var x225: u1 = undefined;
    addcarryxU64(&x224, &x225, x223, x219, x216);
    var x226: u64 = undefined;
    var x227: u1 = undefined;
    addcarryxU64(&x226, &x227, x225, x217, x214);
    var x228: u64 = undefined;
    var x229: u1 = undefined;
    addcarryxU64(&x228, &x229, x227, x215, x212);
    var x230: u64 = undefined;
    var x231: u1 = undefined;
    addcarryxU64(&x230, &x231, x229, x213, x210);
    var x232: u64 = undefined;
    var x233: u1 = undefined;
    addcarryxU64(&x232, &x233, x231, x211, x208);
    const x234 = (cast(u64, x233) + x209);
    var x235: u64 = undefined;
    var x236: u1 = undefined;
    addcarryxU64(&x235, &x236, 0x0, x192, x220);
    var x237: u64 = undefined;
    var x238: u1 = undefined;
    addcarryxU64(&x237, &x238, x236, x194, x222);
    var x239: u64 = undefined;
    var x240: u1 = undefined;
    addcarryxU64(&x239, &x240, x238, x196, x224);
    var x241: u64 = undefined;
    var x242: u1 = undefined;
    addcarryxU64(&x241, &x242, x240, x198, x226);
    var x243: u64 = undefined;
    var x244: u1 = undefined;
    addcarryxU64(&x243, &x244, x242, x200, x228);
    var x245: u64 = undefined;
    var x246: u1 = undefined;
    addcarryxU64(&x245, &x246, x244, x202, x230);
    var x247: u64 = undefined;
    var x248: u1 = undefined;
    addcarryxU64(&x247, &x248, x246, x204, x232);
    var x249: u64 = undefined;
    var x250: u1 = undefined;
    addcarryxU64(&x249, &x250, x248, x206, x234);
    const x251 = (cast(u64, x250) + cast(u64, x207));
    var x252: u64 = undefined;
    var x253: u64 = undefined;
    mulxU64(&x252, &x253, x3, (arg2[6]));
    var x254: u64 = undefined;
    var x255: u64 = undefined;
    mulxU64(&x254, &x255, x3, (arg2[5]));
    var x256: u64 = undefined;
    var x257: u64 = undefined;
    mulxU64(&x256, &x257, x3, (arg2[4]));
    var x258: u64 = undefined;
    var x259: u64 = undefined;
    mulxU64(&x258, &x259, x3, (arg2[3]));
    var x260: u64 = undefined;
    var x261: u64 = undefined;
    mulxU64(&x260, &x261, x3, (arg2[2]));
    var x262: u64 = undefined;
    var x263: u64 = undefined;
    mulxU64(&x262, &x263, x3, (arg2[1]));
    var x264: u64 = undefined;
    var x265: u64 = undefined;
    mulxU64(&x264, &x265, x3, (arg2[0]));
    var x266: u64 = undefined;
    var x267: u1 = undefined;
    addcarryxU64(&x266, &x267, 0x0, x265, x262);
    var x268: u64 = undefined;
    var x269: u1 = undefined;
    addcarryxU64(&x268, &x269, x267, x263, x260);
    var x270: u64 = undefined;
    var x271: u1 = undefined;
    addcarryxU64(&x270, &x271, x269, x261, x258);
    var x272: u64 = undefined;
    var x273: u1 = undefined;
    addcarryxU64(&x272, &x273, x271, x259, x256);
    var x274: u64 = undefined;
    var x275: u1 = undefined;
    addcarryxU64(&x274, &x275, x273, x257, x254);
    var x276: u64 = undefined;
    var x277: u1 = undefined;
    addcarryxU64(&x276, &x277, x275, x255, x252);
    const x278 = (cast(u64, x277) + x253);
    var x279: u64 = undefined;
    var x280: u1 = undefined;
    addcarryxU64(&x279, &x280, 0x0, x237, x264);
    var x281: u64 = undefined;
    var x282: u1 = undefined;
    addcarryxU64(&x281, &x282, x280, x239, x266);
    var x283: u64 = undefined;
    var x284: u1 = undefined;
    addcarryxU64(&x283, &x284, x282, x241, x268);
    var x285: u64 = undefined;
    var x286: u1 = undefined;
    addcarryxU64(&x285, &x286, x284, x243, x270);
    var x287: u64 = undefined;
    var x288: u1 = undefined;
    addcarryxU64(&x287, &x288, x286, x245, x272);
    var x289: u64 = undefined;
    var x290: u1 = undefined;
    addcarryxU64(&x289, &x290, x288, x247, x274);
    var x291: u64 = undefined;
    var x292: u1 = undefined;
    addcarryxU64(&x291, &x292, x290, x249, x276);
    var x293: u64 = undefined;
    var x294: u1 = undefined;
    addcarryxU64(&x293, &x294, x292, x251, x278);
    var x295: u64 = undefined;
    var x296: u64 = undefined;
    mulxU64(&x295, &x296, x279, 0x2341f27177344);
    var x297: u64 = undefined;
    var x298: u64 = undefined;
    mulxU64(&x297, &x298, x279, 0x6cfc5fd681c52056);
    var x299: u64 = undefined;
    var x300: u64 = undefined;
    mulxU64(&x299, &x300, x279, 0x7bc65c783158aea3);
    var x301: u64 = undefined;
    var x302: u64 = undefined;
    mulxU64(&x301, &x302, x279, 0xfdc1767ae2ffffff);
    var x303: u64 = undefined;
    var x304: u64 = undefined;
    mulxU64(&x303, &x304, x279, 0xffffffffffffffff);
    var x305: u64 = undefined;
    var x306: u64 = undefined;
    mulxU64(&x305, &x306, x279, 0xffffffffffffffff);
    var x307: u64 = undefined;
    var x308: u64 = undefined;
    mulxU64(&x307, &x308, x279, 0xffffffffffffffff);
    var x309: u64 = undefined;
    var x310: u1 = undefined;
    addcarryxU64(&x309, &x310, 0x0, x308, x305);
    var x311: u64 = undefined;
    var x312: u1 = undefined;
    addcarryxU64(&x311, &x312, x310, x306, x303);
    var x313: u64 = undefined;
    var x314: u1 = undefined;
    addcarryxU64(&x313, &x314, x312, x304, x301);
    var x315: u64 = undefined;
    var x316: u1 = undefined;
    addcarryxU64(&x315, &x316, x314, x302, x299);
    var x317: u64 = undefined;
    var x318: u1 = undefined;
    addcarryxU64(&x317, &x318, x316, x300, x297);
    var x319: u64 = undefined;
    var x320: u1 = undefined;
    addcarryxU64(&x319, &x320, x318, x298, x295);
    const x321 = (cast(u64, x320) + x296);
    var x322: u64 = undefined;
    var x323: u1 = undefined;
    addcarryxU64(&x322, &x323, 0x0, x279, x307);
    var x324: u64 = undefined;
    var x325: u1 = undefined;
    addcarryxU64(&x324, &x325, x323, x281, x309);
    var x326: u64 = undefined;
    var x327: u1 = undefined;
    addcarryxU64(&x326, &x327, x325, x283, x311);
    var x328: u64 = undefined;
    var x329: u1 = undefined;
    addcarryxU64(&x328, &x329, x327, x285, x313);
    var x330: u64 = undefined;
    var x331: u1 = undefined;
    addcarryxU64(&x330, &x331, x329, x287, x315);
    var x332: u64 = undefined;
    var x333: u1 = undefined;
    addcarryxU64(&x332, &x333, x331, x289, x317);
    var x334: u64 = undefined;
    var x335: u1 = undefined;
    addcarryxU64(&x334, &x335, x333, x291, x319);
    var x336: u64 = undefined;
    var x337: u1 = undefined;
    addcarryxU64(&x336, &x337, x335, x293, x321);
    const x338 = (cast(u64, x337) + cast(u64, x294));
    var x339: u64 = undefined;
    var x340: u64 = undefined;
    mulxU64(&x339, &x340, x4, (arg2[6]));
    var x341: u64 = undefined;
    var x342: u64 = undefined;
    mulxU64(&x341, &x342, x4, (arg2[5]));
    var x343: u64 = undefined;
    var x344: u64 = undefined;
    mulxU64(&x343, &x344, x4, (arg2[4]));
    var x345: u64 = undefined;
    var x346: u64 = undefined;
    mulxU64(&x345, &x346, x4, (arg2[3]));
    var x347: u64 = undefined;
    var x348: u64 = undefined;
    mulxU64(&x347, &x348, x4, (arg2[2]));
    var x349: u64 = undefined;
    var x350: u64 = undefined;
    mulxU64(&x349, &x350, x4, (arg2[1]));
    var x351: u64 = undefined;
    var x352: u64 = undefined;
    mulxU64(&x351, &x352, x4, (arg2[0]));
    var x353: u64 = undefined;
    var x354: u1 = undefined;
    addcarryxU64(&x353, &x354, 0x0, x352, x349);
    var x355: u64 = undefined;
    var x356: u1 = undefined;
    addcarryxU64(&x355, &x356, x354, x350, x347);
    var x357: u64 = undefined;
    var x358: u1 = undefined;
    addcarryxU64(&x357, &x358, x356, x348, x345);
    var x359: u64 = undefined;
    var x360: u1 = undefined;
    addcarryxU64(&x359, &x360, x358, x346, x343);
    var x361: u64 = undefined;
    var x362: u1 = undefined;
    addcarryxU64(&x361, &x362, x360, x344, x341);
    var x363: u64 = undefined;
    var x364: u1 = undefined;
    addcarryxU64(&x363, &x364, x362, x342, x339);
    const x365 = (cast(u64, x364) + x340);
    var x366: u64 = undefined;
    var x367: u1 = undefined;
    addcarryxU64(&x366, &x367, 0x0, x324, x351);
    var x368: u64 = undefined;
    var x369: u1 = undefined;
    addcarryxU64(&x368, &x369, x367, x326, x353);
    var x370: u64 = undefined;
    var x371: u1 = undefined;
    addcarryxU64(&x370, &x371, x369, x328, x355);
    var x372: u64 = undefined;
    var x373: u1 = undefined;
    addcarryxU64(&x372, &x373, x371, x330, x357);
    var x374: u64 = undefined;
    var x375: u1 = undefined;
    addcarryxU64(&x374, &x375, x373, x332, x359);
    var x376: u64 = undefined;
    var x377: u1 = undefined;
    addcarryxU64(&x376, &x377, x375, x334, x361);
    var x378: u64 = undefined;
    var x379: u1 = undefined;
    addcarryxU64(&x378, &x379, x377, x336, x363);
    var x380: u64 = undefined;
    var x381: u1 = undefined;
    addcarryxU64(&x380, &x381, x379, x338, x365);
    var x382: u64 = undefined;
    var x383: u64 = undefined;
    mulxU64(&x382, &x383, x366, 0x2341f27177344);
    var x384: u64 = undefined;
    var x385: u64 = undefined;
    mulxU64(&x384, &x385, x366, 0x6cfc5fd681c52056);
    var x386: u64 = undefined;
    var x387: u64 = undefined;
    mulxU64(&x386, &x387, x366, 0x7bc65c783158aea3);
    var x388: u64 = undefined;
    var x389: u64 = undefined;
    mulxU64(&x388, &x389, x366, 0xfdc1767ae2ffffff);
    var x390: u64 = undefined;
    var x391: u64 = undefined;
    mulxU64(&x390, &x391, x366, 0xffffffffffffffff);
    var x392: u64 = undefined;
    var x393: u64 = undefined;
    mulxU64(&x392, &x393, x366, 0xffffffffffffffff);
    var x394: u64 = undefined;
    var x395: u64 = undefined;
    mulxU64(&x394, &x395, x366, 0xffffffffffffffff);
    var x396: u64 = undefined;
    var x397: u1 = undefined;
    addcarryxU64(&x396, &x397, 0x0, x395, x392);
    var x398: u64 = undefined;
    var x399: u1 = undefined;
    addcarryxU64(&x398, &x399, x397, x393, x390);
    var x400: u64 = undefined;
    var x401: u1 = undefined;
    addcarryxU64(&x400, &x401, x399, x391, x388);
    var x402: u64 = undefined;
    var x403: u1 = undefined;
    addcarryxU64(&x402, &x403, x401, x389, x386);
    var x404: u64 = undefined;
    var x405: u1 = undefined;
    addcarryxU64(&x404, &x405, x403, x387, x384);
    var x406: u64 = undefined;
    var x407: u1 = undefined;
    addcarryxU64(&x406, &x407, x405, x385, x382);
    const x408 = (cast(u64, x407) + x383);
    var x409: u64 = undefined;
    var x410: u1 = undefined;
    addcarryxU64(&x409, &x410, 0x0, x366, x394);
    var x411: u64 = undefined;
    var x412: u1 = undefined;
    addcarryxU64(&x411, &x412, x410, x368, x396);
    var x413: u64 = undefined;
    var x414: u1 = undefined;
    addcarryxU64(&x413, &x414, x412, x370, x398);
    var x415: u64 = undefined;
    var x416: u1 = undefined;
    addcarryxU64(&x415, &x416, x414, x372, x400);
    var x417: u64 = undefined;
    var x418: u1 = undefined;
    addcarryxU64(&x417, &x418, x416, x374, x402);
    var x419: u64 = undefined;
    var x420: u1 = undefined;
    addcarryxU64(&x419, &x420, x418, x376, x404);
    var x421: u64 = undefined;
    var x422: u1 = undefined;
    addcarryxU64(&x421, &x422, x420, x378, x406);
    var x423: u64 = undefined;
    var x424: u1 = undefined;
    addcarryxU64(&x423, &x424, x422, x380, x408);
    const x425 = (cast(u64, x424) + cast(u64, x381));
    var x426: u64 = undefined;
    var x427: u64 = undefined;
    mulxU64(&x426, &x427, x5, (arg2[6]));
    var x428: u64 = undefined;
    var x429: u64 = undefined;
    mulxU64(&x428, &x429, x5, (arg2[5]));
    var x430: u64 = undefined;
    var x431: u64 = undefined;
    mulxU64(&x430, &x431, x5, (arg2[4]));
    var x432: u64 = undefined;
    var x433: u64 = undefined;
    mulxU64(&x432, &x433, x5, (arg2[3]));
    var x434: u64 = undefined;
    var x435: u64 = undefined;
    mulxU64(&x434, &x435, x5, (arg2[2]));
    var x436: u64 = undefined;
    var x437: u64 = undefined;
    mulxU64(&x436, &x437, x5, (arg2[1]));
    var x438: u64 = undefined;
    var x439: u64 = undefined;
    mulxU64(&x438, &x439, x5, (arg2[0]));
    var x440: u64 = undefined;
    var x441: u1 = undefined;
    addcarryxU64(&x440, &x441, 0x0, x439, x436);
    var x442: u64 = undefined;
    var x443: u1 = undefined;
    addcarryxU64(&x442, &x443, x441, x437, x434);
    var x444: u64 = undefined;
    var x445: u1 = undefined;
    addcarryxU64(&x444, &x445, x443, x435, x432);
    var x446: u64 = undefined;
    var x447: u1 = undefined;
    addcarryxU64(&x446, &x447, x445, x433, x430);
    var x448: u64 = undefined;
    var x449: u1 = undefined;
    addcarryxU64(&x448, &x449, x447, x431, x428);
    var x450: u64 = undefined;
    var x451: u1 = undefined;
    addcarryxU64(&x450, &x451, x449, x429, x426);
    const x452 = (cast(u64, x451) + x427);
    var x453: u64 = undefined;
    var x454: u1 = undefined;
    addcarryxU64(&x453, &x454, 0x0, x411, x438);
    var x455: u64 = undefined;
    var x456: u1 = undefined;
    addcarryxU64(&x455, &x456, x454, x413, x440);
    var x457: u64 = undefined;
    var x458: u1 = undefined;
    addcarryxU64(&x457, &x458, x456, x415, x442);
    var x459: u64 = undefined;
    var x460: u1 = undefined;
    addcarryxU64(&x459, &x460, x458, x417, x444);
    var x461: u64 = undefined;
    var x462: u1 = undefined;
    addcarryxU64(&x461, &x462, x460, x419, x446);
    var x463: u64 = undefined;
    var x464: u1 = undefined;
    addcarryxU64(&x463, &x464, x462, x421, x448);
    var x465: u64 = undefined;
    var x466: u1 = undefined;
    addcarryxU64(&x465, &x466, x464, x423, x450);
    var x467: u64 = undefined;
    var x468: u1 = undefined;
    addcarryxU64(&x467, &x468, x466, x425, x452);
    var x469: u64 = undefined;
    var x470: u64 = undefined;
    mulxU64(&x469, &x470, x453, 0x2341f27177344);
    var x471: u64 = undefined;
    var x472: u64 = undefined;
    mulxU64(&x471, &x472, x453, 0x6cfc5fd681c52056);
    var x473: u64 = undefined;
    var x474: u64 = undefined;
    mulxU64(&x473, &x474, x453, 0x7bc65c783158aea3);
    var x475: u64 = undefined;
    var x476: u64 = undefined;
    mulxU64(&x475, &x476, x453, 0xfdc1767ae2ffffff);
    var x477: u64 = undefined;
    var x478: u64 = undefined;
    mulxU64(&x477, &x478, x453, 0xffffffffffffffff);
    var x479: u64 = undefined;
    var x480: u64 = undefined;
    mulxU64(&x479, &x480, x453, 0xffffffffffffffff);
    var x481: u64 = undefined;
    var x482: u64 = undefined;
    mulxU64(&x481, &x482, x453, 0xffffffffffffffff);
    var x483: u64 = undefined;
    var x484: u1 = undefined;
    addcarryxU64(&x483, &x484, 0x0, x482, x479);
    var x485: u64 = undefined;
    var x486: u1 = undefined;
    addcarryxU64(&x485, &x486, x484, x480, x477);
    var x487: u64 = undefined;
    var x488: u1 = undefined;
    addcarryxU64(&x487, &x488, x486, x478, x475);
    var x489: u64 = undefined;
    var x490: u1 = undefined;
    addcarryxU64(&x489, &x490, x488, x476, x473);
    var x491: u64 = undefined;
    var x492: u1 = undefined;
    addcarryxU64(&x491, &x492, x490, x474, x471);
    var x493: u64 = undefined;
    var x494: u1 = undefined;
    addcarryxU64(&x493, &x494, x492, x472, x469);
    const x495 = (cast(u64, x494) + x470);
    var x496: u64 = undefined;
    var x497: u1 = undefined;
    addcarryxU64(&x496, &x497, 0x0, x453, x481);
    var x498: u64 = undefined;
    var x499: u1 = undefined;
    addcarryxU64(&x498, &x499, x497, x455, x483);
    var x500: u64 = undefined;
    var x501: u1 = undefined;
    addcarryxU64(&x500, &x501, x499, x457, x485);
    var x502: u64 = undefined;
    var x503: u1 = undefined;
    addcarryxU64(&x502, &x503, x501, x459, x487);
    var x504: u64 = undefined;
    var x505: u1 = undefined;
    addcarryxU64(&x504, &x505, x503, x461, x489);
    var x506: u64 = undefined;
    var x507: u1 = undefined;
    addcarryxU64(&x506, &x507, x505, x463, x491);
    var x508: u64 = undefined;
    var x509: u1 = undefined;
    addcarryxU64(&x508, &x509, x507, x465, x493);
    var x510: u64 = undefined;
    var x511: u1 = undefined;
    addcarryxU64(&x510, &x511, x509, x467, x495);
    const x512 = (cast(u64, x511) + cast(u64, x468));
    var x513: u64 = undefined;
    var x514: u64 = undefined;
    mulxU64(&x513, &x514, x6, (arg2[6]));
    var x515: u64 = undefined;
    var x516: u64 = undefined;
    mulxU64(&x515, &x516, x6, (arg2[5]));
    var x517: u64 = undefined;
    var x518: u64 = undefined;
    mulxU64(&x517, &x518, x6, (arg2[4]));
    var x519: u64 = undefined;
    var x520: u64 = undefined;
    mulxU64(&x519, &x520, x6, (arg2[3]));
    var x521: u64 = undefined;
    var x522: u64 = undefined;
    mulxU64(&x521, &x522, x6, (arg2[2]));
    var x523: u64 = undefined;
    var x524: u64 = undefined;
    mulxU64(&x523, &x524, x6, (arg2[1]));
    var x525: u64 = undefined;
    var x526: u64 = undefined;
    mulxU64(&x525, &x526, x6, (arg2[0]));
    var x527: u64 = undefined;
    var x528: u1 = undefined;
    addcarryxU64(&x527, &x528, 0x0, x526, x523);
    var x529: u64 = undefined;
    var x530: u1 = undefined;
    addcarryxU64(&x529, &x530, x528, x524, x521);
    var x531: u64 = undefined;
    var x532: u1 = undefined;
    addcarryxU64(&x531, &x532, x530, x522, x519);
    var x533: u64 = undefined;
    var x534: u1 = undefined;
    addcarryxU64(&x533, &x534, x532, x520, x517);
    var x535: u64 = undefined;
    var x536: u1 = undefined;
    addcarryxU64(&x535, &x536, x534, x518, x515);
    var x537: u64 = undefined;
    var x538: u1 = undefined;
    addcarryxU64(&x537, &x538, x536, x516, x513);
    const x539 = (cast(u64, x538) + x514);
    var x540: u64 = undefined;
    var x541: u1 = undefined;
    addcarryxU64(&x540, &x541, 0x0, x498, x525);
    var x542: u64 = undefined;
    var x543: u1 = undefined;
    addcarryxU64(&x542, &x543, x541, x500, x527);
    var x544: u64 = undefined;
    var x545: u1 = undefined;
    addcarryxU64(&x544, &x545, x543, x502, x529);
    var x546: u64 = undefined;
    var x547: u1 = undefined;
    addcarryxU64(&x546, &x547, x545, x504, x531);
    var x548: u64 = undefined;
    var x549: u1 = undefined;
    addcarryxU64(&x548, &x549, x547, x506, x533);
    var x550: u64 = undefined;
    var x551: u1 = undefined;
    addcarryxU64(&x550, &x551, x549, x508, x535);
    var x552: u64 = undefined;
    var x553: u1 = undefined;
    addcarryxU64(&x552, &x553, x551, x510, x537);
    var x554: u64 = undefined;
    var x555: u1 = undefined;
    addcarryxU64(&x554, &x555, x553, x512, x539);
    var x556: u64 = undefined;
    var x557: u64 = undefined;
    mulxU64(&x556, &x557, x540, 0x2341f27177344);
    var x558: u64 = undefined;
    var x559: u64 = undefined;
    mulxU64(&x558, &x559, x540, 0x6cfc5fd681c52056);
    var x560: u64 = undefined;
    var x561: u64 = undefined;
    mulxU64(&x560, &x561, x540, 0x7bc65c783158aea3);
    var x562: u64 = undefined;
    var x563: u64 = undefined;
    mulxU64(&x562, &x563, x540, 0xfdc1767ae2ffffff);
    var x564: u64 = undefined;
    var x565: u64 = undefined;
    mulxU64(&x564, &x565, x540, 0xffffffffffffffff);
    var x566: u64 = undefined;
    var x567: u64 = undefined;
    mulxU64(&x566, &x567, x540, 0xffffffffffffffff);
    var x568: u64 = undefined;
    var x569: u64 = undefined;
    mulxU64(&x568, &x569, x540, 0xffffffffffffffff);
    var x570: u64 = undefined;
    var x571: u1 = undefined;
    addcarryxU64(&x570, &x571, 0x0, x569, x566);
    var x572: u64 = undefined;
    var x573: u1 = undefined;
    addcarryxU64(&x572, &x573, x571, x567, x564);
    var x574: u64 = undefined;
    var x575: u1 = undefined;
    addcarryxU64(&x574, &x575, x573, x565, x562);
    var x576: u64 = undefined;
    var x577: u1 = undefined;
    addcarryxU64(&x576, &x577, x575, x563, x560);
    var x578: u64 = undefined;
    var x579: u1 = undefined;
    addcarryxU64(&x578, &x579, x577, x561, x558);
    var x580: u64 = undefined;
    var x581: u1 = undefined;
    addcarryxU64(&x580, &x581, x579, x559, x556);
    const x582 = (cast(u64, x581) + x557);
    var x583: u64 = undefined;
    var x584: u1 = undefined;
    addcarryxU64(&x583, &x584, 0x0, x540, x568);
    var x585: u64 = undefined;
    var x586: u1 = undefined;
    addcarryxU64(&x585, &x586, x584, x542, x570);
    var x587: u64 = undefined;
    var x588: u1 = undefined;
    addcarryxU64(&x587, &x588, x586, x544, x572);
    var x589: u64 = undefined;
    var x590: u1 = undefined;
    addcarryxU64(&x589, &x590, x588, x546, x574);
    var x591: u64 = undefined;
    var x592: u1 = undefined;
    addcarryxU64(&x591, &x592, x590, x548, x576);
    var x593: u64 = undefined;
    var x594: u1 = undefined;
    addcarryxU64(&x593, &x594, x592, x550, x578);
    var x595: u64 = undefined;
    var x596: u1 = undefined;
    addcarryxU64(&x595, &x596, x594, x552, x580);
    var x597: u64 = undefined;
    var x598: u1 = undefined;
    addcarryxU64(&x597, &x598, x596, x554, x582);
    const x599 = (cast(u64, x598) + cast(u64, x555));
    var x600: u64 = undefined;
    var x601: u1 = undefined;
    subborrowxU64(&x600, &x601, 0x0, x585, 0xffffffffffffffff);
    var x602: u64 = undefined;
    var x603: u1 = undefined;
    subborrowxU64(&x602, &x603, x601, x587, 0xffffffffffffffff);
    var x604: u64 = undefined;
    var x605: u1 = undefined;
    subborrowxU64(&x604, &x605, x603, x589, 0xffffffffffffffff);
    var x606: u64 = undefined;
    var x607: u1 = undefined;
    subborrowxU64(&x606, &x607, x605, x591, 0xfdc1767ae2ffffff);
    var x608: u64 = undefined;
    var x609: u1 = undefined;
    subborrowxU64(&x608, &x609, x607, x593, 0x7bc65c783158aea3);
    var x610: u64 = undefined;
    var x611: u1 = undefined;
    subborrowxU64(&x610, &x611, x609, x595, 0x6cfc5fd681c52056);
    var x612: u64 = undefined;
    var x613: u1 = undefined;
    subborrowxU64(&x612, &x613, x611, x597, 0x2341f27177344);
    var x614: u64 = undefined;
    var x615: u1 = undefined;
    subborrowxU64(&x614, &x615, x613, x599, cast(u64, 0x0));
    var x616: u64 = undefined;
    cmovznzU64(&x616, x615, x600, x585);
    var x617: u64 = undefined;
    cmovznzU64(&x617, x615, x602, x587);
    var x618: u64 = undefined;
    cmovznzU64(&x618, x615, x604, x589);
    var x619: u64 = undefined;
    cmovznzU64(&x619, x615, x606, x591);
    var x620: u64 = undefined;
    cmovznzU64(&x620, x615, x608, x593);
    var x621: u64 = undefined;
    cmovznzU64(&x621, x615, x610, x595);
    var x622: u64 = undefined;
    cmovznzU64(&x622, x615, x612, x597);
    out1[0] = x616;
    out1[1] = x617;
    out1[2] = x618;
    out1[3] = x619;
    out1[4] = x620;
    out1[5] = x621;
    out1[6] = x622;
}

/// The function square squares a field element in the Montgomery domain.
///
/// Preconditions:
///   0 ≤ eval arg1 < m
/// Postconditions:
///   eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg1)) mod m
///   0 ≤ eval out1 < m
///
pub fn square(out1: *MontgomeryDomainFieldElement, arg1: MontgomeryDomainFieldElement) void {
    @setRuntimeSafety(mode == .Debug);

    const x1 = (arg1[1]);
    const x2 = (arg1[2]);
    const x3 = (arg1[3]);
    const x4 = (arg1[4]);
    const x5 = (arg1[5]);
    const x6 = (arg1[6]);
    const x7 = (arg1[0]);
    var x8: u64 = undefined;
    var x9: u64 = undefined;
    mulxU64(&x8, &x9, x7, (arg1[6]));
    var x10: u64 = undefined;
    var x11: u64 = undefined;
    mulxU64(&x10, &x11, x7, (arg1[5]));
    var x12: u64 = undefined;
    var x13: u64 = undefined;
    mulxU64(&x12, &x13, x7, (arg1[4]));
    var x14: u64 = undefined;
    var x15: u64 = undefined;
    mulxU64(&x14, &x15, x7, (arg1[3]));
    var x16: u64 = undefined;
    var x17: u64 = undefined;
    mulxU64(&x16, &x17, x7, (arg1[2]));
    var x18: u64 = undefined;
    var x19: u64 = undefined;
    mulxU64(&x18, &x19, x7, (arg1[1]));
    var x20: u64 = undefined;
    var x21: u64 = undefined;
    mulxU64(&x20, &x21, x7, (arg1[0]));
    var x22: u64 = undefined;
    var x23: u1 = undefined;
    addcarryxU64(&x22, &x23, 0x0, x21, x18);
    var x24: u64 = undefined;
    var x25: u1 = undefined;
    addcarryxU64(&x24, &x25, x23, x19, x16);
    var x26: u64 = undefined;
    var x27: u1 = undefined;
    addcarryxU64(&x26, &x27, x25, x17, x14);
    var x28: u64 = undefined;
    var x29: u1 = undefined;
    addcarryxU64(&x28, &x29, x27, x15, x12);
    var x30: u64 = undefined;
    var x31: u1 = undefined;
    addcarryxU64(&x30, &x31, x29, x13, x10);
    var x32: u64 = undefined;
    var x33: u1 = undefined;
    addcarryxU64(&x32, &x33, x31, x11, x8);
    const x34 = (cast(u64, x33) + x9);
    var x35: u64 = undefined;
    var x36: u64 = undefined;
    mulxU64(&x35, &x36, x20, 0x2341f27177344);
    var x37: u64 = undefined;
    var x38: u64 = undefined;
    mulxU64(&x37, &x38, x20, 0x6cfc5fd681c52056);
    var x39: u64 = undefined;
    var x40: u64 = undefined;
    mulxU64(&x39, &x40, x20, 0x7bc65c783158aea3);
    var x41: u64 = undefined;
    var x42: u64 = undefined;
    mulxU64(&x41, &x42, x20, 0xfdc1767ae2ffffff);
    var x43: u64 = undefined;
    var x44: u64 = undefined;
    mulxU64(&x43, &x44, x20, 0xffffffffffffffff);
    var x45: u64 = undefined;
    var x46: u64 = undefined;
    mulxU64(&x45, &x46, x20, 0xffffffffffffffff);
    var x47: u64 = undefined;
    var x48: u64 = undefined;
    mulxU64(&x47, &x48, x20, 0xffffffffffffffff);
    var x49: u64 = undefined;
    var x50: u1 = undefined;
    addcarryxU64(&x49, &x50, 0x0, x48, x45);
    var x51: u64 = undefined;
    var x52: u1 = undefined;
    addcarryxU64(&x51, &x52, x50, x46, x43);
    var x53: u64 = undefined;
    var x54: u1 = undefined;
    addcarryxU64(&x53, &x54, x52, x44, x41);
    var x55: u64 = undefined;
    var x56: u1 = undefined;
    addcarryxU64(&x55, &x56, x54, x42, x39);
    var x57: u64 = undefined;
    var x58: u1 = undefined;
    addcarryxU64(&x57, &x58, x56, x40, x37);
    var x59: u64 = undefined;
    var x60: u1 = undefined;
    addcarryxU64(&x59, &x60, x58, x38, x35);
    const x61 = (cast(u64, x60) + x36);
    var x62: u64 = undefined;
    var x63: u1 = undefined;
    addcarryxU64(&x62, &x63, 0x0, x20, x47);
    var x64: u64 = undefined;
    var x65: u1 = undefined;
    addcarryxU64(&x64, &x65, x63, x22, x49);
    var x66: u64 = undefined;
    var x67: u1 = undefined;
    addcarryxU64(&x66, &x67, x65, x24, x51);
    var x68: u64 = undefined;
    var x69: u1 = undefined;
    addcarryxU64(&x68, &x69, x67, x26, x53);
    var x70: u64 = undefined;
    var x71: u1 = undefined;
    addcarryxU64(&x70, &x71, x69, x28, x55);
    var x72: u64 = undefined;
    var x73: u1 = undefined;
    addcarryxU64(&x72, &x73, x71, x30, x57);
    var x74: u64 = undefined;
    var x75: u1 = undefined;
    addcarryxU64(&x74, &x75, x73, x32, x59);
    var x76: u64 = undefined;
    var x77: u1 = undefined;
    addcarryxU64(&x76, &x77, x75, x34, x61);
    var x78: u64 = undefined;
    var x79: u64 = undefined;
    mulxU64(&x78, &x79, x1, (arg1[6]));
    var x80: u64 = undefined;
    var x81: u64 = undefined;
    mulxU64(&x80, &x81, x1, (arg1[5]));
    var x82: u64 = undefined;
    var x83: u64 = undefined;
    mulxU64(&x82, &x83, x1, (arg1[4]));
    var x84: u64 = undefined;
    var x85: u64 = undefined;
    mulxU64(&x84, &x85, x1, (arg1[3]));
    var x86: u64 = undefined;
    var x87: u64 = undefined;
    mulxU64(&x86, &x87, x1, (arg1[2]));
    var x88: u64 = undefined;
    var x89: u64 = undefined;
    mulxU64(&x88, &x89, x1, (arg1[1]));
    var x90: u64 = undefined;
    var x91: u64 = undefined;
    mulxU64(&x90, &x91, x1, (arg1[0]));
    var x92: u64 = undefined;
    var x93: u1 = undefined;
    addcarryxU64(&x92, &x93, 0x0, x91, x88);
    var x94: u64 = undefined;
    var x95: u1 = undefined;
    addcarryxU64(&x94, &x95, x93, x89, x86);
    var x96: u64 = undefined;
    var x97: u1 = undefined;
    addcarryxU64(&x96, &x97, x95, x87, x84);
    var x98: u64 = undefined;
    var x99: u1 = undefined;
    addcarryxU64(&x98, &x99, x97, x85, x82);
    var x100: u64 = undefined;
    var x101: u1 = undefined;
    addcarryxU64(&x100, &x101, x99, x83, x80);
    var x102: u64 = undefined;
    var x103: u1 = undefined;
    addcarryxU64(&x102, &x103, x101, x81, x78);
    const x104 = (cast(u64, x103) + x79);
    var x105: u64 = undefined;
    var x106: u1 = undefined;
    addcarryxU64(&x105, &x106, 0x0, x64, x90);
    var x107: u64 = undefined;
    var x108: u1 = undefined;
    addcarryxU64(&x107, &x108, x106, x66, x92);
    var x109: u64 = undefined;
    var x110: u1 = undefined;
    addcarryxU64(&x109, &x110, x108, x68, x94);
    var x111: u64 = undefined;
    var x112: u1 = undefined;
    addcarryxU64(&x111, &x112, x110, x70, x96);
    var x113: u64 = undefined;
    var x114: u1 = undefined;
    addcarryxU64(&x113, &x114, x112, x72, x98);
    var x115: u64 = undefined;
    var x116: u1 = undefined;
    addcarryxU64(&x115, &x116, x114, x74, x100);
    var x117: u64 = undefined;
    var x118: u1 = undefined;
    addcarryxU64(&x117, &x118, x116, x76, x102);
    var x119: u64 = undefined;
    var x120: u1 = undefined;
    addcarryxU64(&x119, &x120, x118, cast(u64, x77), x104);
    var x121: u64 = undefined;
    var x122: u64 = undefined;
    mulxU64(&x121, &x122, x105, 0x2341f27177344);
    var x123: u64 = undefined;
    var x124: u64 = undefined;
    mulxU64(&x123, &x124, x105, 0x6cfc5fd681c52056);
    var x125: u64 = undefined;
    var x126: u64 = undefined;
    mulxU64(&x125, &x126, x105, 0x7bc65c783158aea3);
    var x127: u64 = undefined;
    var x128: u64 = undefined;
    mulxU64(&x127, &x128, x105, 0xfdc1767ae2ffffff);
    var x129: u64 = undefined;
    var x130: u64 = undefined;
    mulxU64(&x129, &x130, x105, 0xffffffffffffffff);
    var x131: u64 = undefined;
    var x132: u64 = undefined;
    mulxU64(&x131, &x132, x105, 0xffffffffffffffff);
    var x133: u64 = undefined;
    var x134: u64 = undefined;
    mulxU64(&x133, &x134, x105, 0xffffffffffffffff);
    var x135: u64 = undefined;
    var x136: u1 = undefined;
    addcarryxU64(&x135, &x136, 0x0, x134, x131);
    var x137: u64 = undefined;
    var x138: u1 = undefined;
    addcarryxU64(&x137, &x138, x136, x132, x129);
    var x139: u64 = undefined;
    var x140: u1 = undefined;
    addcarryxU64(&x139, &x140, x138, x130, x127);
    var x141: u64 = undefined;
    var x142: u1 = undefined;
    addcarryxU64(&x141, &x142, x140, x128, x125);
    var x143: u64 = undefined;
    var x144: u1 = undefined;
    addcarryxU64(&x143, &x144, x142, x126, x123);
    var x145: u64 = undefined;
    var x146: u1 = undefined;
    addcarryxU64(&x145, &x146, x144, x124, x121);
    const x147 = (cast(u64, x146) + x122);
    var x148: u64 = undefined;
    var x149: u1 = undefined;
    addcarryxU64(&x148, &x149, 0x0, x105, x133);
    var x150: u64 = undefined;
    var x151: u1 = undefined;
    addcarryxU64(&x150, &x151, x149, x107, x135);
    var x152: u64 = undefined;
    var x153: u1 = undefined;
    addcarryxU64(&x152, &x153, x151, x109, x137);
    var x154: u64 = undefined;
    var x155: u1 = undefined;
    addcarryxU64(&x154, &x155, x153, x111, x139);
    var x156: u64 = undefined;
    var x157: u1 = undefined;
    addcarryxU64(&x156, &x157, x155, x113, x141);
    var x158: u64 = undefined;
    var x159: u1 = undefined;
    addcarryxU64(&x158, &x159, x157, x115, x143);
    var x160: u64 = undefined;
    var x161: u1 = undefined;
    addcarryxU64(&x160, &x161, x159, x117, x145);
    var x162: u64 = undefined;
    var x163: u1 = undefined;
    addcarryxU64(&x162, &x163, x161, x119, x147);
    const x164 = (cast(u64, x163) + cast(u64, x120));
    var x165: u64 = undefined;
    var x166: u64 = undefined;
    mulxU64(&x165, &x166, x2, (arg1[6]));
    var x167: u64 = undefined;
    var x168: u64 = undefined;
    mulxU64(&x167, &x168, x2, (arg1[5]));
    var x169: u64 = undefined;
    var x170: u64 = undefined;
    mulxU64(&x169, &x170, x2, (arg1[4]));
    var x171: u64 = undefined;
    var x172: u64 = undefined;
    mulxU64(&x171, &x172, x2, (arg1[3]));
    var x173: u64 = undefined;
    var x174: u64 = undefined;
    mulxU64(&x173, &x174, x2, (arg1[2]));
    var x175: u64 = undefined;
    var x176: u64 = undefined;
    mulxU64(&x175, &x176, x2, (arg1[1]));
    var x177: u64 = undefined;
    var x178: u64 = undefined;
    mulxU64(&x177, &x178, x2, (arg1[0]));
    var x179: u64 = undefined;
    var x180: u1 = undefined;
    addcarryxU64(&x179, &x180, 0x0, x178, x175);
    var x181: u64 = undefined;
    var x182: u1 = undefined;
    addcarryxU64(&x181, &x182, x180, x176, x173);
    var x183: u64 = undefined;
    var x184: u1 = undefined;
    addcarryxU64(&x183, &x184, x182, x174, x171);
    var x185: u64 = undefined;
    var x186: u1 = undefined;
    addcarryxU64(&x185, &x186, x184, x172, x169);
    var x187: u64 = undefined;
    var x188: u1 = undefined;
    addcarryxU64(&x187, &x188, x186, x170, x167);
    var x189: u64 = undefined;
    var x190: u1 = undefined;
    addcarryxU64(&x189, &x190, x188, x168, x165);
    const x191 = (cast(u64, x190) + x166);
    var x192: u64 = undefined;
    var x193: u1 = undefined;
    addcarryxU64(&x192, &x193, 0x0, x150, x177);
    var x194: u64 = undefined;
    var x195: u1 = undefined;
    addcarryxU64(&x194, &x195, x193, x152, x179);
    var x196: u64 = undefined;
    var x197: u1 = undefined;
    addcarryxU64(&x196, &x197, x195, x154, x181);
    var x198: u64 = undefined;
    var x199: u1 = undefined;
    addcarryxU64(&x198, &x199, x197, x156, x183);
    var x200: u64 = undefined;
    var x201: u1 = undefined;
    addcarryxU64(&x200, &x201, x199, x158, x185);
    var x202: u64 = undefined;
    var x203: u1 = undefined;
    addcarryxU64(&x202, &x203, x201, x160, x187);
    var x204: u64 = undefined;
    var x205: u1 = undefined;
    addcarryxU64(&x204, &x205, x203, x162, x189);
    var x206: u64 = undefined;
    var x207: u1 = undefined;
    addcarryxU64(&x206, &x207, x205, x164, x191);
    var x208: u64 = undefined;
    var x209: u64 = undefined;
    mulxU64(&x208, &x209, x192, 0x2341f27177344);
    var x210: u64 = undefined;
    var x211: u64 = undefined;
    mulxU64(&x210, &x211, x192, 0x6cfc5fd681c52056);
    var x212: u64 = undefined;
    var x213: u64 = undefined;
    mulxU64(&x212, &x213, x192, 0x7bc65c783158aea3);
    var x214: u64 = undefined;
    var x215: u64 = undefined;
    mulxU64(&x214, &x215, x192, 0xfdc1767ae2ffffff);
    var x216: u64 = undefined;
    var x217: u64 = undefined;
    mulxU64(&x216, &x217, x192, 0xffffffffffffffff);
    var x218: u64 = undefined;
    var x219: u64 = undefined;
    mulxU64(&x218, &x219, x192, 0xffffffffffffffff);
    var x220: u64 = undefined;
    var x221: u64 = undefined;
    mulxU64(&x220, &x221, x192, 0xffffffffffffffff);
    var x222: u64 = undefined;
    var x223: u1 = undefined;
    addcarryxU64(&x222, &x223, 0x0, x221, x218);
    var x224: u64 = undefined;
    var x225: u1 = undefined;
    addcarryxU64(&x224, &x225, x223, x219, x216);
    var x226: u64 = undefined;
    var x227: u1 = undefined;
    addcarryxU64(&x226, &x227, x225, x217, x214);
    var x228: u64 = undefined;
    var x229: u1 = undefined;
    addcarryxU64(&x228, &x229, x227, x215, x212);
    var x230: u64 = undefined;
    var x231: u1 = undefined;
    addcarryxU64(&x230, &x231, x229, x213, x210);
    var x232: u64 = undefined;
    var x233: u1 = undefined;
    addcarryxU64(&x232, &x233, x231, x211, x208);
    const x234 = (cast(u64, x233) + x209);
    var x235: u64 = undefined;
    var x236: u1 = undefined;
    addcarryxU64(&x235, &x236, 0x0, x192, x220);
    var x237: u64 = undefined;
    var x238: u1 = undefined;
    addcarryxU64(&x237, &x238, x236, x194, x222);
    var x239: u64 = undefined;
    var x240: u1 = undefined;
    addcarryxU64(&x239, &x240, x238, x196, x224);
    var x241: u64 = undefined;
    var x242: u1 = undefined;
    addcarryxU64(&x241, &x242, x240, x198, x226);
    var x243: u64 = undefined;
    var x244: u1 = undefined;
    addcarryxU64(&x243, &x244, x242, x200, x228);
    var x245: u64 = undefined;
    var x246: u1 = undefined;
    addcarryxU64(&x245, &x246, x244, x202, x230);
    var x247: u64 = undefined;
    var x248: u1 = undefined;
    addcarryxU64(&x247, &x248, x246, x204, x232);
    var x249: u64 = undefined;
    var x250: u1 = undefined;
    addcarryxU64(&x249, &x250, x248, x206, x234);
    const x251 = (cast(u64, x250) + cast(u64, x207));
    var x252: u64 = undefined;
    var x253: u64 = undefined;
    mulxU64(&x252, &x253, x3, (arg1[6]));
    var x254: u64 = undefined;
    var x255: u64 = undefined;
    mulxU64(&x254, &x255, x3, (arg1[5]));
    var x256: u64 = undefined;
    var x257: u64 = undefined;
    mulxU64(&x256, &x257, x3, (arg1[4]));
    var x258: u64 = undefined;
    var x259: u64 = undefined;
    mulxU64(&x258, &x259, x3, (arg1[3]));
    var x260: u64 = undefined;
    var x261: u64 = undefined;
    mulxU64(&x260, &x261, x3, (arg1[2]));
    var x262: u64 = undefined;
    var x263: u64 = undefined;
    mulxU64(&x262, &x263, x3, (arg1[1]));
    var x264: u64 = undefined;
    var x265: u64 = undefined;
    mulxU64(&x264, &x265, x3, (arg1[0]));
    var x266: u64 = undefined;
    var x267: u1 = undefined;
    addcarryxU64(&x266, &x267, 0x0, x265, x262);
    var x268: u64 = undefined;
    var x269: u1 = undefined;
    addcarryxU64(&x268, &x269, x267, x263, x260);
    var x270: u64 = undefined;
    var x271: u1 = undefined;
    addcarryxU64(&x270, &x271, x269, x261, x258);
    var x272: u64 = undefined;
    var x273: u1 = undefined;
    addcarryxU64(&x272, &x273, x271, x259, x256);
    var x274: u64 = undefined;
    var x275: u1 = undefined;
    addcarryxU64(&x274, &x275, x273, x257, x254);
    var x276: u64 = undefined;
    var x277: u1 = undefined;
    addcarryxU64(&x276, &x277, x275, x255, x252);
    const x278 = (cast(u64, x277) + x253);
    var x279: u64 = undefined;
    var x280: u1 = undefined;
    addcarryxU64(&x279, &x280, 0x0, x237, x264);
    var x281: u64 = undefined;
    var x282: u1 = undefined;
    addcarryxU64(&x281, &x282, x280, x239, x266);
    var x283: u64 = undefined;
    var x284: u1 = undefined;
    addcarryxU64(&x283, &x284, x282, x241, x268);
    var x285: u64 = undefined;
    var x286: u1 = undefined;
    addcarryxU64(&x285, &x286, x284, x243, x270);
    var x287: u64 = undefined;
    var x288: u1 = undefined;
    addcarryxU64(&x287, &x288, x286, x245, x272);
    var x289: u64 = undefined;
    var x290: u1 = undefined;
    addcarryxU64(&x289, &x290, x288, x247, x274);
    var x291: u64 = undefined;
    var x292: u1 = undefined;
    addcarryxU64(&x291, &x292, x290, x249, x276);
    var x293: u64 = undefined;
    var x294: u1 = undefined;
    addcarryxU64(&x293, &x294, x292, x251, x278);
    var x295: u64 = undefined;
    var x296: u64 = undefined;
    mulxU64(&x295, &x296, x279, 0x2341f27177344);
    var x297: u64 = undefined;
    var x298: u64 = undefined;
    mulxU64(&x297, &x298, x279, 0x6cfc5fd681c52056);
    var x299: u64 = undefined;
    var x300: u64 = undefined;
    mulxU64(&x299, &x300, x279, 0x7bc65c783158aea3);
    var x301: u64 = undefined;
    var x302: u64 = undefined;
    mulxU64(&x301, &x302, x279, 0xfdc1767ae2ffffff);
    var x303: u64 = undefined;
    var x304: u64 = undefined;
    mulxU64(&x303, &x304, x279, 0xffffffffffffffff);
    var x305: u64 = undefined;
    var x306: u64 = undefined;
    mulxU64(&x305, &x306, x279, 0xffffffffffffffff);
    var x307: u64 = undefined;
    var x308: u64 = undefined;
    mulxU64(&x307, &x308, x279, 0xffffffffffffffff);
    var x309: u64 = undefined;
    var x310: u1 = undefined;
    addcarryxU64(&x309, &x310, 0x0, x308, x305);
    var x311: u64 = undefined;
    var x312: u1 = undefined;
    addcarryxU64(&x311, &x312, x310, x306, x303);
    var x313: u64 = undefined;
    var x314: u1 = undefined;
    addcarryxU64(&x313, &x314, x312, x304, x301);
    var x315: u64 = undefined;
    var x316: u1 = undefined;
    addcarryxU64(&x315, &x316, x314, x302, x299);
    var x317: u64 = undefined;
    var x318: u1 = undefined;
    addcarryxU64(&x317, &x318, x316, x300, x297);
    var x319: u64 = undefined;
    var x320: u1 = undefined;
    addcarryxU64(&x319, &x320, x318, x298, x295);
    const x321 = (cast(u64, x320) + x296);
    var x322: u64 = undefined;
    var x323: u1 = undefined;
    addcarryxU64(&x322, &x323, 0x0, x279, x307);
    var x324: u64 = undefined;
    var x325: u1 = undefined;
    addcarryxU64(&x324, &x325, x323, x281, x309);
    var x326: u64 = undefined;
    var x327: u1 = undefined;
    addcarryxU64(&x326, &x327, x325, x283, x311);
    var x328: u64 = undefined;
    var x329: u1 = undefined;
    addcarryxU64(&x328, &x329, x327, x285, x313);
    var x330: u64 = undefined;
    var x331: u1 = undefined;
    addcarryxU64(&x330, &x331, x329, x287, x315);
    var x332: u64 = undefined;
    var x333: u1 = undefined;
    addcarryxU64(&x332, &x333, x331, x289, x317);
    var x334: u64 = undefined;
    var x335: u1 = undefined;
    addcarryxU64(&x334, &x335, x333, x291, x319);
    var x336: u64 = undefined;
    var x337: u1 = undefined;
    addcarryxU64(&x336, &x337, x335, x293, x321);
    const x338 = (cast(u64, x337) + cast(u64, x294));
    var x339: u64 = undefined;
    var x340: u64 = undefined;
    mulxU64(&x339, &x340, x4, (arg1[6]));
    var x341: u64 = undefined;
    var x342: u64 = undefined;
    mulxU64(&x341, &x342, x4, (arg1[5]));
    var x343: u64 = undefined;
    var x344: u64 = undefined;
    mulxU64(&x343, &x344, x4, (arg1[4]));
    var x345: u64 = undefined;
    var x346: u64 = undefined;
    mulxU64(&x345, &x346, x4, (arg1[3]));
    var x347: u64 = undefined;
    var x348: u64 = undefined;
    mulxU64(&x347, &x348, x4, (arg1[2]));
    var x349: u64 = undefined;
    var x350: u64 = undefined;
    mulxU64(&x349, &x350, x4, (arg1[1]));
    var x351: u64 = undefined;
    var x352: u64 = undefined;
    mulxU64(&x351, &x352, x4, (arg1[0]));
    var x353: u64 = undefined;
    var x354: u1 = undefined;
    addcarryxU64(&x353, &x354, 0x0, x352, x349);
    var x355: u64 = undefined;
    var x356: u1 = undefined;
    addcarryxU64(&x355, &x356, x354, x350, x347);
    var x357: u64 = undefined;
    var x358: u1 = undefined;
    addcarryxU64(&x357, &x358, x356, x348, x345);
    var x359: u64 = undefined;
    var x360: u1 = undefined;
    addcarryxU64(&x359, &x360, x358, x346, x343);
    var x361: u64 = undefined;
    var x362: u1 = undefined;
    addcarryxU64(&x361, &x362, x360, x344, x341);
    var x363: u64 = undefined;
    var x364: u1 = undefined;
    addcarryxU64(&x363, &x364, x362, x342, x339);
    const x365 = (cast(u64, x364) + x340);
    var x366: u64 = undefined;
    var x367: u1 = undefined;
    addcarryxU64(&x366, &x367, 0x0, x324, x351);
    var x368: u64 = undefined;
    var x369: u1 = undefined;
    addcarryxU64(&x368, &x369, x367, x326, x353);
    var x370: u64 = undefined;
    var x371: u1 = undefined;
    addcarryxU64(&x370, &x371, x369, x328, x355);
    var x372: u64 = undefined;
    var x373: u1 = undefined;
    addcarryxU64(&x372, &x373, x371, x330, x357);
    var x374: u64 = undefined;
    var x375: u1 = undefined;
    addcarryxU64(&x374, &x375, x373, x332, x359);
    var x376: u64 = undefined;
    var x377: u1 = undefined;
    addcarryxU64(&x376, &x377, x375, x334, x361);
    var x378: u64 = undefined;
    var x379: u1 = undefined;
    addcarryxU64(&x378, &x379, x377, x336, x363);
    var x380: u64 = undefined;
    var x381: u1 = undefined;
    addcarryxU64(&x380, &x381, x379, x338, x365);
    var x382: u64 = undefined;
    var x383: u64 = undefined;
    mulxU64(&x382, &x383, x366, 0x2341f27177344);
    var x384: u64 = undefined;
    var x385: u64 = undefined;
    mulxU64(&x384, &x385, x366, 0x6cfc5fd681c52056);
    var x386: u64 = undefined;
    var x387: u64 = undefined;
    mulxU64(&x386, &x387, x366, 0x7bc65c783158aea3);
    var x388: u64 = undefined;
    var x389: u64 = undefined;
    mulxU64(&x388, &x389, x366, 0xfdc1767ae2ffffff);
    var x390: u64 = undefined;
    var x391: u64 = undefined;
    mulxU64(&x390, &x391, x366, 0xffffffffffffffff);
    var x392: u64 = undefined;
    var x393: u64 = undefined;
    mulxU64(&x392, &x393, x366, 0xffffffffffffffff);
    var x394: u64 = undefined;
    var x395: u64 = undefined;
    mulxU64(&x394, &x395, x366, 0xffffffffffffffff);
    var x396: u64 = undefined;
    var x397: u1 = undefined;
    addcarryxU64(&x396, &x397, 0x0, x395, x392);
    var x398: u64 = undefined;
    var x399: u1 = undefined;
    addcarryxU64(&x398, &x399, x397, x393, x390);
    var x400: u64 = undefined;
    var x401: u1 = undefined;
    addcarryxU64(&x400, &x401, x399, x391, x388);
    var x402: u64 = undefined;
    var x403: u1 = undefined;
    addcarryxU64(&x402, &x403, x401, x389, x386);
    var x404: u64 = undefined;
    var x405: u1 = undefined;
    addcarryxU64(&x404, &x405, x403, x387, x384);
    var x406: u64 = undefined;
    var x407: u1 = undefined;
    addcarryxU64(&x406, &x407, x405, x385, x382);
    const x408 = (cast(u64, x407) + x383);
    var x409: u64 = undefined;
    var x410: u1 = undefined;
    addcarryxU64(&x409, &x410, 0x0, x366, x394);
    var x411: u64 = undefined;
    var x412: u1 = undefined;
    addcarryxU64(&x411, &x412, x410, x368, x396);
    var x413: u64 = undefined;
    var x414: u1 = undefined;
    addcarryxU64(&x413, &x414, x412, x370, x398);
    var x415: u64 = undefined;
    var x416: u1 = undefined;
    addcarryxU64(&x415, &x416, x414, x372, x400);
    var x417: u64 = undefined;
    var x418: u1 = undefined;
    addcarryxU64(&x417, &x418, x416, x374, x402);
    var x419: u64 = undefined;
    var x420: u1 = undefined;
    addcarryxU64(&x419, &x420, x418, x376, x404);
    var x421: u64 = undefined;
    var x422: u1 = undefined;
    addcarryxU64(&x421, &x422, x420, x378, x406);
    var x423: u64 = undefined;
    var x424: u1 = undefined;
    addcarryxU64(&x423, &x424, x422, x380, x408);
    const x425 = (cast(u64, x424) + cast(u64, x381));
    var x426: u64 = undefined;
    var x427: u64 = undefined;
    mulxU64(&x426, &x427, x5, (arg1[6]));
    var x428: u64 = undefined;
    var x429: u64 = undefined;
    mulxU64(&x428, &x429, x5, (arg1[5]));
    var x430: u64 = undefined;
    var x431: u64 = undefined;
    mulxU64(&x430, &x431, x5, (arg1[4]));
    var x432: u64 = undefined;
    var x433: u64 = undefined;
    mulxU64(&x432, &x433, x5, (arg1[3]));
    var x434: u64 = undefined;
    var x435: u64 = undefined;
    mulxU64(&x434, &x435, x5, (arg1[2]));
    var x436: u64 = undefined;
    var x437: u64 = undefined;
    mulxU64(&x436, &x437, x5, (arg1[1]));
    var x438: u64 = undefined;
    var x439: u64 = undefined;
    mulxU64(&x438, &x439, x5, (arg1[0]));
    var x440: u64 = undefined;
    var x441: u1 = undefined;
    addcarryxU64(&x440, &x441, 0x0, x439, x436);
    var x442: u64 = undefined;
    var x443: u1 = undefined;
    addcarryxU64(&x442, &x443, x441, x437, x434);
    var x444: u64 = undefined;
    var x445: u1 = undefined;
    addcarryxU64(&x444, &x445, x443, x435, x432);
    var x446: u64 = undefined;
    var x447: u1 = undefined;
    addcarryxU64(&x446, &x447, x445, x433, x430);
    var x448: u64 = undefined;
    var x449: u1 = undefined;
    addcarryxU64(&x448, &x449, x447, x431, x428);
    var x450: u64 = undefined;
    var x451: u1 = undefined;
    addcarryxU64(&x450, &x451, x449, x429, x426);
    const x452 = (cast(u64, x451) + x427);
    var x453: u64 = undefined;
    var x454: u1 = undefined;
    addcarryxU64(&x453, &x454, 0x0, x411, x438);
    var x455: u64 = undefined;
    var x456: u1 = undefined;
    addcarryxU64(&x455, &x456, x454, x413, x440);
    var x457: u64 = undefined;
    var x458: u1 = undefined;
    addcarryxU64(&x457, &x458, x456, x415, x442);
    var x459: u64 = undefined;
    var x460: u1 = undefined;
    addcarryxU64(&x459, &x460, x458, x417, x444);
    var x461: u64 = undefined;
    var x462: u1 = undefined;
    addcarryxU64(&x461, &x462, x460, x419, x446);
    var x463: u64 = undefined;
    var x464: u1 = undefined;
    addcarryxU64(&x463, &x464, x462, x421, x448);
    var x465: u64 = undefined;
    var x466: u1 = undefined;
    addcarryxU64(&x465, &x466, x464, x423, x450);
    var x467: u64 = undefined;
    var x468: u1 = undefined;
    addcarryxU64(&x467, &x468, x466, x425, x452);
    var x469: u64 = undefined;
    var x470: u64 = undefined;
    mulxU64(&x469, &x470, x453, 0x2341f27177344);
    var x471: u64 = undefined;
    var x472: u64 = undefined;
    mulxU64(&x471, &x472, x453, 0x6cfc5fd681c52056);
    var x473: u64 = undefined;
    var x474: u64 = undefined;
    mulxU64(&x473, &x474, x453, 0x7bc65c783158aea3);
    var x475: u64 = undefined;
    var x476: u64 = undefined;
    mulxU64(&x475, &x476, x453, 0xfdc1767ae2ffffff);
    var x477: u64 = undefined;
    var x478: u64 = undefined;
    mulxU64(&x477, &x478, x453, 0xffffffffffffffff);
    var x479: u64 = undefined;
    var x480: u64 = undefined;
    mulxU64(&x479, &x480, x453, 0xffffffffffffffff);
    var x481: u64 = undefined;
    var x482: u64 = undefined;
    mulxU64(&x481, &x482, x453, 0xffffffffffffffff);
    var x483: u64 = undefined;
    var x484: u1 = undefined;
    addcarryxU64(&x483, &x484, 0x0, x482, x479);
    var x485: u64 = undefined;
    var x486: u1 = undefined;
    addcarryxU64(&x485, &x486, x484, x480, x477);
    var x487: u64 = undefined;
    var x488: u1 = undefined;
    addcarryxU64(&x487, &x488, x486, x478, x475);
    var x489: u64 = undefined;
    var x490: u1 = undefined;
    addcarryxU64(&x489, &x490, x488, x476, x473);
    var x491: u64 = undefined;
    var x492: u1 = undefined;
    addcarryxU64(&x491, &x492, x490, x474, x471);
    var x493: u64 = undefined;
    var x494: u1 = undefined;
    addcarryxU64(&x493, &x494, x492, x472, x469);
    const x495 = (cast(u64, x494) + x470);
    var x496: u64 = undefined;
    var x497: u1 = undefined;
    addcarryxU64(&x496, &x497, 0x0, x453, x481);
    var x498: u64 = undefined;
    var x499: u1 = undefined;
    addcarryxU64(&x498, &x499, x497, x455, x483);
    var x500: u64 = undefined;
    var x501: u1 = undefined;
    addcarryxU64(&x500, &x501, x499, x457, x485);
    var x502: u64 = undefined;
    var x503: u1 = undefined;
    addcarryxU64(&x502, &x503, x501, x459, x487);
    var x504: u64 = undefined;
    var x505: u1 = undefined;
    addcarryxU64(&x504, &x505, x503, x461, x489);
    var x506: u64 = undefined;
    var x507: u1 = undefined;
    addcarryxU64(&x506, &x507, x505, x463, x491);
    var x508: u64 = undefined;
    var x509: u1 = undefined;
    addcarryxU64(&x508, &x509, x507, x465, x493);
    var x510: u64 = undefined;
    var x511: u1 = undefined;
    addcarryxU64(&x510, &x511, x509, x467, x495);
    const x512 = (cast(u64, x511) + cast(u64, x468));
    var x513: u64 = undefined;
    var x514: u64 = undefined;
    mulxU64(&x513, &x514, x6, (arg1[6]));
    var x515: u64 = undefined;
    var x516: u64 = undefined;
    mulxU64(&x515, &x516, x6, (arg1[5]));
    var x517: u64 = undefined;
    var x518: u64 = undefined;
    mulxU64(&x517, &x518, x6, (arg1[4]));
    var x519: u64 = undefined;
    var x520: u64 = undefined;
    mulxU64(&x519, &x520, x6, (arg1[3]));
    var x521: u64 = undefined;
    var x522: u64 = undefined;
    mulxU64(&x521, &x522, x6, (arg1[2]));
    var x523: u64 = undefined;
    var x524: u64 = undefined;
    mulxU64(&x523, &x524, x6, (arg1[1]));
    var x525: u64 = undefined;
    var x526: u64 = undefined;
    mulxU64(&x525, &x526, x6, (arg1[0]));
    var x527: u64 = undefined;
    var x528: u1 = undefined;
    addcarryxU64(&x527, &x528, 0x0, x526, x523);
    var x529: u64 = undefined;
    var x530: u1 = undefined;
    addcarryxU64(&x529, &x530, x528, x524, x521);
    var x531: u64 = undefined;
    var x532: u1 = undefined;
    addcarryxU64(&x531, &x532, x530, x522, x519);
    var x533: u64 = undefined;
    var x534: u1 = undefined;
    addcarryxU64(&x533, &x534, x532, x520, x517);
    var x535: u64 = undefined;
    var x536: u1 = undefined;
    addcarryxU64(&x535, &x536, x534, x518, x515);
    var x537: u64 = undefined;
    var x538: u1 = undefined;
    addcarryxU64(&x537, &x538, x536, x516, x513);
    const x539 = (cast(u64, x538) + x514);
    var x540: u64 = undefined;
    var x541: u1 = undefined;
    addcarryxU64(&x540, &x541, 0x0, x498, x525);
    var x542: u64 = undefined;
    var x543: u1 = undefined;
    addcarryxU64(&x542, &x543, x541, x500, x527);
    var x544: u64 = undefined;
    var x545: u1 = undefined;
    addcarryxU64(&x544, &x545, x543, x502, x529);
    var x546: u64 = undefined;
    var x547: u1 = undefined;
    addcarryxU64(&x546, &x547, x545, x504, x531);
    var x548: u64 = undefined;
    var x549: u1 = undefined;
    addcarryxU64(&x548, &x549, x547, x506, x533);
    var x550: u64 = undefined;
    var x551: u1 = undefined;
    addcarryxU64(&x550, &x551, x549, x508, x535);
    var x552: u64 = undefined;
    var x553: u1 = undefined;
    addcarryxU64(&x552, &x553, x551, x510, x537);
    var x554: u64 = undefined;
    var x555: u1 = undefined;
    addcarryxU64(&x554, &x555, x553, x512, x539);
    var x556: u64 = undefined;
    var x557: u64 = undefined;
    mulxU64(&x556, &x557, x540, 0x2341f27177344);
    var x558: u64 = undefined;
    var x559: u64 = undefined;
    mulxU64(&x558, &x559, x540, 0x6cfc5fd681c52056);
    var x560: u64 = undefined;
    var x561: u64 = undefined;
    mulxU64(&x560, &x561, x540, 0x7bc65c783158aea3);
    var x562: u64 = undefined;
    var x563: u64 = undefined;
    mulxU64(&x562, &x563, x540, 0xfdc1767ae2ffffff);
    var x564: u64 = undefined;
    var x565: u64 = undefined;
    mulxU64(&x564, &x565, x540, 0xffffffffffffffff);
    var x566: u64 = undefined;
    var x567: u64 = undefined;
    mulxU64(&x566, &x567, x540, 0xffffffffffffffff);
    var x568: u64 = undefined;
    var x569: u64 = undefined;
    mulxU64(&x568, &x569, x540, 0xffffffffffffffff);
    var x570: u64 = undefined;
    var x571: u1 = undefined;
    addcarryxU64(&x570, &x571, 0x0, x569, x566);
    var x572: u64 = undefined;
    var x573: u1 = undefined;
    addcarryxU64(&x572, &x573, x571, x567, x564);
    var x574: u64 = undefined;
    var x575: u1 = undefined;
    addcarryxU64(&x574, &x575, x573, x565, x562);
    var x576: u64 = undefined;
    var x577: u1 = undefined;
    addcarryxU64(&x576, &x577, x575, x563, x560);
    var x578: u64 = undefined;
    var x579: u1 = undefined;
    addcarryxU64(&x578, &x579, x577, x561, x558);
    var x580: u64 = undefined;
    var x581: u1 = undefined;
    addcarryxU64(&x580, &x581, x579, x559, x556);
    const x582 = (cast(u64, x581) + x557);
    var x583: u64 = undefined;
    var x584: u1 = undefined;
    addcarryxU64(&x583, &x584, 0x0, x540, x568);
    var x585: u64 = undefined;
    var x586: u1 = undefined;
    addcarryxU64(&x585, &x586, x584, x542, x570);
    var x587: u64 = undefined;
    var x588: u1 = undefined;
    addcarryxU64(&x587, &x588, x586, x544, x572);
    var x589: u64 = undefined;
    var x590: u1 = undefined;
    addcarryxU64(&x589, &x590, x588, x546, x574);
    var x591: u64 = undefined;
    var x592: u1 = undefined;
    addcarryxU64(&x591, &x592, x590, x548, x576);
    var x593: u64 = undefined;
    var x594: u1 = undefined;
    addcarryxU64(&x593, &x594, x592, x550, x578);
    var x595: u64 = undefined;
    var x596: u1 = undefined;
    addcarryxU64(&x595, &x596, x594, x552, x580);
    var x597: u64 = undefined;
    var x598: u1 = undefined;
    addcarryxU64(&x597, &x598, x596, x554, x582);
    const x599 = (cast(u64, x598) + cast(u64, x555));
    var x600: u64 = undefined;
    var x601: u1 = undefined;
    subborrowxU64(&x600, &x601, 0x0, x585, 0xffffffffffffffff);
    var x602: u64 = undefined;
    var x603: u1 = undefined;
    subborrowxU64(&x602, &x603, x601, x587, 0xffffffffffffffff);
    var x604: u64 = undefined;
    var x605: u1 = undefined;
    subborrowxU64(&x604, &x605, x603, x589, 0xffffffffffffffff);
    var x606: u64 = undefined;
    var x607: u1 = undefined;
    subborrowxU64(&x606, &x607, x605, x591, 0xfdc1767ae2ffffff);
    var x608: u64 = undefined;
    var x609: u1 = undefined;
    subborrowxU64(&x608, &x609, x607, x593, 0x7bc65c783158aea3);
    var x610: u64 = undefined;
    var x611: u1 = undefined;
    subborrowxU64(&x610, &x611, x609, x595, 0x6cfc5fd681c52056);
    var x612: u64 = undefined;
    var x613: u1 = undefined;
    subborrowxU64(&x612, &x613, x611, x597, 0x2341f27177344);
    var x614: u64 = undefined;
    var x615: u1 = undefined;
    subborrowxU64(&x614, &x615, x613, x599, cast(u64, 0x0));
    var x616: u64 = undefined;
    cmovznzU64(&x616, x615, x600, x585);
    var x617: u64 = undefined;
    cmovznzU64(&x617, x615, x602, x587);
    var x618: u64 = undefined;
    cmovznzU64(&x618, x615, x604, x589);
    var x619: u64 = undefined;
    cmovznzU64(&x619, x615, x606, x591);
    var x620: u64 = undefined;
    cmovznzU64(&x620, x615, x608, x593);
    var x621: u64 = undefined;
    cmovznzU64(&x621, x615, x610, x595);
    var x622: u64 = undefined;
    cmovznzU64(&x622, x615, x612, x597);
    out1[0] = x616;
    out1[1] = x617;
    out1[2] = x618;
    out1[3] = x619;
    out1[4] = x620;
    out1[5] = x621;
    out1[6] = x622;
}

/// The function add adds two field elements in the Montgomery domain.
///
/// Preconditions:
///   0 ≤ eval arg1 < m
///   0 ≤ eval arg2 < m
/// Postconditions:
///   eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) + eval (from_montgomery arg2)) mod m
///   0 ≤ eval out1 < m
///
pub fn add(out1: *MontgomeryDomainFieldElement, arg1: MontgomeryDomainFieldElement, arg2: MontgomeryDomainFieldElement) void {
    @setRuntimeSafety(mode == .Debug);

    var x1: u64 = undefined;
    var x2: u1 = undefined;
    addcarryxU64(&x1, &x2, 0x0, (arg1[0]), (arg2[0]));
    var x3: u64 = undefined;
    var x4: u1 = undefined;
    addcarryxU64(&x3, &x4, x2, (arg1[1]), (arg2[1]));
    var x5: u64 = undefined;
    var x6: u1 = undefined;
    addcarryxU64(&x5, &x6, x4, (arg1[2]), (arg2[2]));
    var x7: u64 = undefined;
    var x8: u1 = undefined;
    addcarryxU64(&x7, &x8, x6, (arg1[3]), (arg2[3]));
    var x9: u64 = undefined;
    var x10: u1 = undefined;
    addcarryxU64(&x9, &x10, x8, (arg1[4]), (arg2[4]));
    var x11: u64 = undefined;
    var x12: u1 = undefined;
    addcarryxU64(&x11, &x12, x10, (arg1[5]), (arg2[5]));
    var x13: u64 = undefined;
    var x14: u1 = undefined;
    addcarryxU64(&x13, &x14, x12, (arg1[6]), (arg2[6]));
    var x15: u64 = undefined;
    var x16: u1 = undefined;
    subborrowxU64(&x15, &x16, 0x0, x1, 0xffffffffffffffff);
    var x17: u64 = undefined;
    var x18: u1 = undefined;
    subborrowxU64(&x17, &x18, x16, x3, 0xffffffffffffffff);
    var x19: u64 = undefined;
    var x20: u1 = undefined;
    subborrowxU64(&x19, &x20, x18, x5, 0xffffffffffffffff);
    var x21: u64 = undefined;
    var x22: u1 = undefined;
    subborrowxU64(&x21, &x22, x20, x7, 0xfdc1767ae2ffffff);
    var x23: u64 = undefined;
    var x24: u1 = undefined;
    subborrowxU64(&x23, &x24, x22, x9, 0x7bc65c783158aea3);
    var x25: u64 = undefined;
    var x26: u1 = undefined;
    subborrowxU64(&x25, &x26, x24, x11, 0x6cfc5fd681c52056);
    var x27: u64 = undefined;
    var x28: u1 = undefined;
    subborrowxU64(&x27, &x28, x26, x13, 0x2341f27177344);
    var x29: u64 = undefined;
    var x30: u1 = undefined;
    subborrowxU64(&x29, &x30, x28, cast(u64, x14), cast(u64, 0x0));
    var x31: u64 = undefined;
    cmovznzU64(&x31, x30, x15, x1);
    var x32: u64 = undefined;
    cmovznzU64(&x32, x30, x17, x3);
    var x33: u64 = undefined;
    cmovznzU64(&x33, x30, x19, x5);
    var x34: u64 = undefined;
    cmovznzU64(&x34, x30, x21, x7);
    var x35: u64 = undefined;
    cmovznzU64(&x35, x30, x23, x9);
    var x36: u64 = undefined;
    cmovznzU64(&x36, x30, x25, x11);
    var x37: u64 = undefined;
    cmovznzU64(&x37, x30, x27, x13);
    out1[0] = x31;
    out1[1] = x32;
    out1[2] = x33;
    out1[3] = x34;
    out1[4] = x35;
    out1[5] = x36;
    out1[6] = x37;
}

/// The function sub subtracts two field elements in the Montgomery domain.
///
/// Preconditions:
///   0 ≤ eval arg1 < m
///   0 ≤ eval arg2 < m
/// Postconditions:
///   eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) - eval (from_montgomery arg2)) mod m
///   0 ≤ eval out1 < m
///
pub fn sub(out1: *MontgomeryDomainFieldElement, arg1: MontgomeryDomainFieldElement, arg2: MontgomeryDomainFieldElement) void {
    @setRuntimeSafety(mode == .Debug);

    var x1: u64 = undefined;
    var x2: u1 = undefined;
    subborrowxU64(&x1, &x2, 0x0, (arg1[0]), (arg2[0]));
    var x3: u64 = undefined;
    var x4: u1 = undefined;
    subborrowxU64(&x3, &x4, x2, (arg1[1]), (arg2[1]));
    var x5: u64 = undefined;
    var x6: u1 = undefined;
    subborrowxU64(&x5, &x6, x4, (arg1[2]), (arg2[2]));
    var x7: u64 = undefined;
    var x8: u1 = undefined;
    subborrowxU64(&x7, &x8, x6, (arg1[3]), (arg2[3]));
    var x9: u64 = undefined;
    var x10: u1 = undefined;
    subborrowxU64(&x9, &x10, x8, (arg1[4]), (arg2[4]));
    var x11: u64 = undefined;
    var x12: u1 = undefined;
    subborrowxU64(&x11, &x12, x10, (arg1[5]), (arg2[5]));
    var x13: u64 = undefined;
    var x14: u1 = undefined;
    subborrowxU64(&x13, &x14, x12, (arg1[6]), (arg2[6]));
    var x15: u64 = undefined;
    cmovznzU64(&x15, x14, cast(u64, 0x0), 0xffffffffffffffff);
    var x16: u64 = undefined;
    var x17: u1 = undefined;
    addcarryxU64(&x16, &x17, 0x0, x1, x15);
    var x18: u64 = undefined;
    var x19: u1 = undefined;
    addcarryxU64(&x18, &x19, x17, x3, x15);
    var x20: u64 = undefined;
    var x21: u1 = undefined;
    addcarryxU64(&x20, &x21, x19, x5, x15);
    var x22: u64 = undefined;
    var x23: u1 = undefined;
    addcarryxU64(&x22, &x23, x21, x7, (x15 & 0xfdc1767ae2ffffff));
    var x24: u64 = undefined;
    var x25: u1 = undefined;
    addcarryxU64(&x24, &x25, x23, x9, (x15 & 0x7bc65c783158aea3));
    var x26: u64 = undefined;
    var x27: u1 = undefined;
    addcarryxU64(&x26, &x27, x25, x11, (x15 & 0x6cfc5fd681c52056));
    var x28: u64 = undefined;
    var x29: u1 = undefined;
    addcarryxU64(&x28, &x29, x27, x13, (x15 & 0x2341f27177344));
    out1[0] = x16;
    out1[1] = x18;
    out1[2] = x20;
    out1[3] = x22;
    out1[4] = x24;
    out1[5] = x26;
    out1[6] = x28;
}

/// The function opp negates a field element in the Montgomery domain.
///
/// Preconditions:
///   0 ≤ eval arg1 < m
/// Postconditions:
///   eval (from_montgomery out1) mod m = -eval (from_montgomery arg1) mod m
///   0 ≤ eval out1 < m
///
pub fn opp(out1: *MontgomeryDomainFieldElement, arg1: MontgomeryDomainFieldElement) void {
    @setRuntimeSafety(mode == .Debug);

    var x1: u64 = undefined;
    var x2: u1 = undefined;
    subborrowxU64(&x1, &x2, 0x0, cast(u64, 0x0), (arg1[0]));
    var x3: u64 = undefined;
    var x4: u1 = undefined;
    subborrowxU64(&x3, &x4, x2, cast(u64, 0x0), (arg1[1]));
    var x5: u64 = undefined;
    var x6: u1 = undefined;
    subborrowxU64(&x5, &x6, x4, cast(u64, 0x0), (arg1[2]));
    var x7: u64 = undefined;
    var x8: u1 = undefined;
    subborrowxU64(&x7, &x8, x6, cast(u64, 0x0), (arg1[3]));
    var x9: u64 = undefined;
    var x10: u1 = undefined;
    subborrowxU64(&x9, &x10, x8, cast(u64, 0x0), (arg1[4]));
    var x11: u64 = undefined;
    var x12: u1 = undefined;
    subborrowxU64(&x11, &x12, x10, cast(u64, 0x0), (arg1[5]));
    var x13: u64 = undefined;
    var x14: u1 = undefined;
    subborrowxU64(&x13, &x14, x12, cast(u64, 0x0), (arg1[6]));
    var x15: u64 = undefined;
    cmovznzU64(&x15, x14, cast(u64, 0x0), 0xffffffffffffffff);
    var x16: u64 = undefined;
    var x17: u1 = undefined;
    addcarryxU64(&x16, &x17, 0x0, x1, x15);
    var x18: u64 = undefined;
    var x19: u1 = undefined;
    addcarryxU64(&x18, &x19, x17, x3, x15);
    var x20: u64 = undefined;
    var x21: u1 = undefined;
    addcarryxU64(&x20, &x21, x19, x5, x15);
    var x22: u64 = undefined;
    var x23: u1 = undefined;
    addcarryxU64(&x22, &x23, x21, x7, (x15 & 0xfdc1767ae2ffffff));
    var x24: u64 = undefined;
    var x25: u1 = undefined;
    addcarryxU64(&x24, &x25, x23, x9, (x15 & 0x7bc65c783158aea3));
    var x26: u64 = undefined;
    var x27: u1 = undefined;
    addcarryxU64(&x26, &x27, x25, x11, (x15 & 0x6cfc5fd681c52056));
    var x28: u64 = undefined;
    var x29: u1 = undefined;
    addcarryxU64(&x28, &x29, x27, x13, (x15 & 0x2341f27177344));
    out1[0] = x16;
    out1[1] = x18;
    out1[2] = x20;
    out1[3] = x22;
    out1[4] = x24;
    out1[5] = x26;
    out1[6] = x28;
}

/// The function fromMontgomery translates a field element out of the Montgomery domain.
///
/// Preconditions:
///   0 ≤ eval arg1 < m
/// Postconditions:
///   eval out1 mod m = (eval arg1 * ((2^64)⁻¹ mod m)^7) mod m
///   0 ≤ eval out1 < m
///
pub fn fromMontgomery(out1: *NonMontgomeryDomainFieldElement, arg1: MontgomeryDomainFieldElement) void {
    @setRuntimeSafety(mode == .Debug);

    const x1 = (arg1[0]);
    var x2: u64 = undefined;
    var x3: u64 = undefined;
    mulxU64(&x2, &x3, x1, 0x2341f27177344);
    var x4: u64 = undefined;
    var x5: u64 = undefined;
    mulxU64(&x4, &x5, x1, 0x6cfc5fd681c52056);
    var x6: u64 = undefined;
    var x7: u64 = undefined;
    mulxU64(&x6, &x7, x1, 0x7bc65c783158aea3);
    var x8: u64 = undefined;
    var x9: u64 = undefined;
    mulxU64(&x8, &x9, x1, 0xfdc1767ae2ffffff);
    var x10: u64 = undefined;
    var x11: u64 = undefined;
    mulxU64(&x10, &x11, x1, 0xffffffffffffffff);
    var x12: u64 = undefined;
    var x13: u64 = undefined;
    mulxU64(&x12, &x13, x1, 0xffffffffffffffff);
    var x14: u64 = undefined;
    var x15: u64 = undefined;
    mulxU64(&x14, &x15, x1, 0xffffffffffffffff);
    var x16: u64 = undefined;
    var x17: u1 = undefined;
    addcarryxU64(&x16, &x17, 0x0, x15, x12);
    var x18: u64 = undefined;
    var x19: u1 = undefined;
    addcarryxU64(&x18, &x19, x17, x13, x10);
    var x20: u64 = undefined;
    var x21: u1 = undefined;
    addcarryxU64(&x20, &x21, x19, x11, x8);
    var x22: u64 = undefined;
    var x23: u1 = undefined;
    addcarryxU64(&x22, &x23, x21, x9, x6);
    var x24: u64 = undefined;
    var x25: u1 = undefined;
    addcarryxU64(&x24, &x25, x23, x7, x4);
    var x26: u64 = undefined;
    var x27: u1 = undefined;
    addcarryxU64(&x26, &x27, x25, x5, x2);
    var x28: u64 = undefined;
    var x29: u1 = undefined;
    addcarryxU64(&x28, &x29, 0x0, x1, x14);
    var x30: u64 = undefined;
    var x31: u1 = undefined;
    addcarryxU64(&x30, &x31, x29, cast(u64, 0x0), x16);
    var x32: u64 = undefined;
    var x33: u1 = undefined;
    addcarryxU64(&x32, &x33, x31, cast(u64, 0x0), x18);
    var x34: u64 = undefined;
    var x35: u1 = undefined;
    addcarryxU64(&x34, &x35, x33, cast(u64, 0x0), x20);
    var x36: u64 = undefined;
    var x37: u1 = undefined;
    addcarryxU64(&x36, &x37, x35, cast(u64, 0x0), x22);
    var x38: u64 = undefined;
    var x39: u1 = undefined;
    addcarryxU64(&x38, &x39, x37, cast(u64, 0x0), x24);
    var x40: u64 = undefined;
    var x41: u1 = undefined;
    addcarryxU64(&x40, &x41, x39, cast(u64, 0x0), x26);
    var x42: u64 = undefined;
    var x43: u1 = undefined;
    addcarryxU64(&x42, &x43, 0x0, x30, (arg1[1]));
    var x44: u64 = undefined;
    var x45: u1 = undefined;
    addcarryxU64(&x44, &x45, x43, x32, cast(u64, 0x0));
    var x46: u64 = undefined;
    var x47: u1 = undefined;
    addcarryxU64(&x46, &x47, x45, x34, cast(u64, 0x0));
    var x48: u64 = undefined;
    var x49: u1 = undefined;
    addcarryxU64(&x48, &x49, x47, x36, cast(u64, 0x0));
    var x50: u64 = undefined;
    var x51: u1 = undefined;
    addcarryxU64(&x50, &x51, x49, x38, cast(u64, 0x0));
    var x52: u64 = undefined;
    var x53: u1 = undefined;
    addcarryxU64(&x52, &x53, x51, x40, cast(u64, 0x0));
    var x54: u64 = undefined;
    var x55: u64 = undefined;
    mulxU64(&x54, &x55, x42, 0x2341f27177344);
    var x56: u64 = undefined;
    var x57: u64 = undefined;
    mulxU64(&x56, &x57, x42, 0x6cfc5fd681c52056);
    var x58: u64 = undefined;
    var x59: u64 = undefined;
    mulxU64(&x58, &x59, x42, 0x7bc65c783158aea3);
    var x60: u64 = undefined;
    var x61: u64 = undefined;
    mulxU64(&x60, &x61, x42, 0xfdc1767ae2ffffff);
    var x62: u64 = undefined;
    var x63: u64 = undefined;
    mulxU64(&x62, &x63, x42, 0xffffffffffffffff);
    var x64: u64 = undefined;
    var x65: u64 = undefined;
    mulxU64(&x64, &x65, x42, 0xffffffffffffffff);
    var x66: u64 = undefined;
    var x67: u64 = undefined;
    mulxU64(&x66, &x67, x42, 0xffffffffffffffff);
    var x68: u64 = undefined;
    var x69: u1 = undefined;
    addcarryxU64(&x68, &x69, 0x0, x67, x64);
    var x70: u64 = undefined;
    var x71: u1 = undefined;
    addcarryxU64(&x70, &x71, x69, x65, x62);
    var x72: u64 = undefined;
    var x73: u1 = undefined;
    addcarryxU64(&x72, &x73, x71, x63, x60);
    var x74: u64 = undefined;
    var x75: u1 = undefined;
    addcarryxU64(&x74, &x75, x73, x61, x58);
    var x76: u64 = undefined;
    var x77: u1 = undefined;
    addcarryxU64(&x76, &x77, x75, x59, x56);
    var x78: u64 = undefined;
    var x79: u1 = undefined;
    addcarryxU64(&x78, &x79, x77, x57, x54);
    var x80: u64 = undefined;
    var x81: u1 = undefined;
    addcarryxU64(&x80, &x81, 0x0, x42, x66);
    var x82: u64 = undefined;
    var x83: u1 = undefined;
    addcarryxU64(&x82, &x83, x81, x44, x68);
    var x84: u64 = undefined;
    var x85: u1 = undefined;
    addcarryxU64(&x84, &x85, x83, x46, x70);
    var x86: u64 = undefined;
    var x87: u1 = undefined;
    addcarryxU64(&x86, &x87, x85, x48, x72);
    var x88: u64 = undefined;
    var x89: u1 = undefined;
    addcarryxU64(&x88, &x89, x87, x50, x74);
    var x90: u64 = undefined;
    var x91: u1 = undefined;
    addcarryxU64(&x90, &x91, x89, x52, x76);
    var x92: u64 = undefined;
    var x93: u1 = undefined;
    addcarryxU64(&x92, &x93, x91, (cast(u64, x53) + (cast(u64, x41) + (cast(u64, x27) + x3))), x78);
    var x94: u64 = undefined;
    var x95: u1 = undefined;
    addcarryxU64(&x94, &x95, 0x0, x82, (arg1[2]));
    var x96: u64 = undefined;
    var x97: u1 = undefined;
    addcarryxU64(&x96, &x97, x95, x84, cast(u64, 0x0));
    var x98: u64 = undefined;
    var x99: u1 = undefined;
    addcarryxU64(&x98, &x99, x97, x86, cast(u64, 0x0));
    var x100: u64 = undefined;
    var x101: u1 = undefined;
    addcarryxU64(&x100, &x101, x99, x88, cast(u64, 0x0));
    var x102: u64 = undefined;
    var x103: u1 = undefined;
    addcarryxU64(&x102, &x103, x101, x90, cast(u64, 0x0));
    var x104: u64 = undefined;
    var x105: u1 = undefined;
    addcarryxU64(&x104, &x105, x103, x92, cast(u64, 0x0));
    var x106: u64 = undefined;
    var x107: u64 = undefined;
    mulxU64(&x106, &x107, x94, 0x2341f27177344);
    var x108: u64 = undefined;
    var x109: u64 = undefined;
    mulxU64(&x108, &x109, x94, 0x6cfc5fd681c52056);
    var x110: u64 = undefined;
    var x111: u64 = undefined;
    mulxU64(&x110, &x111, x94, 0x7bc65c783158aea3);
    var x112: u64 = undefined;
    var x113: u64 = undefined;
    mulxU64(&x112, &x113, x94, 0xfdc1767ae2ffffff);
    var x114: u64 = undefined;
    var x115: u64 = undefined;
    mulxU64(&x114, &x115, x94, 0xffffffffffffffff);
    var x116: u64 = undefined;
    var x117: u64 = undefined;
    mulxU64(&x116, &x117, x94, 0xffffffffffffffff);
    var x118: u64 = undefined;
    var x119: u64 = undefined;
    mulxU64(&x118, &x119, x94, 0xffffffffffffffff);
    var x120: u64 = undefined;
    var x121: u1 = undefined;
    addcarryxU64(&x120, &x121, 0x0, x119, x116);
    var x122: u64 = undefined;
    var x123: u1 = undefined;
    addcarryxU64(&x122, &x123, x121, x117, x114);
    var x124: u64 = undefined;
    var x125: u1 = undefined;
    addcarryxU64(&x124, &x125, x123, x115, x112);
    var x126: u64 = undefined;
    var x127: u1 = undefined;
    addcarryxU64(&x126, &x127, x125, x113, x110);
    var x128: u64 = undefined;
    var x129: u1 = undefined;
    addcarryxU64(&x128, &x129, x127, x111, x108);
    var x130: u64 = undefined;
    var x131: u1 = undefined;
    addcarryxU64(&x130, &x131, x129, x109, x106);
    var x132: u64 = undefined;
    var x133: u1 = undefined;
    addcarryxU64(&x132, &x133, 0x0, x94, x118);
    var x134: u64 = undefined;
    var x135: u1 = undefined;
    addcarryxU64(&x134, &x135, x133, x96, x120);
    var x136: u64 = undefined;
    var x137: u1 = undefined;
    addcarryxU64(&x136, &x137, x135, x98, x122);
    var x138: u64 = undefined;
    var x139: u1 = undefined;
    addcarryxU64(&x138, &x139, x137, x100, x124);
    var x140: u64 = undefined;
    var x141: u1 = undefined;
    addcarryxU64(&x140, &x141, x139, x102, x126);
    var x142: u64 = undefined;
    var x143: u1 = undefined;
    addcarryxU64(&x142, &x143, x141, x104, x128);
    var x144: u64 = undefined;
    var x145: u1 = undefined;
    addcarryxU64(&x144, &x145, x143, (cast(u64, x105) + (cast(u64, x93) + (cast(u64, x79) + x55))), x130);
    var x146: u64 = undefined;
    var x147: u1 = undefined;
    addcarryxU64(&x146, &x147, 0x0, x134, (arg1[3]));
    var x148: u64 = undefined;
    var x149: u1 = undefined;
    addcarryxU64(&x148, &x149, x147, x136, cast(u64, 0x0));
    var x150: u64 = undefined;
    var x151: u1 = undefined;
    addcarryxU64(&x150, &x151, x149, x138, cast(u64, 0x0));
    var x152: u64 = undefined;
    var x153: u1 = undefined;
    addcarryxU64(&x152, &x153, x151, x140, cast(u64, 0x0));
    var x154: u64 = undefined;
    var x155: u1 = undefined;
    addcarryxU64(&x154, &x155, x153, x142, cast(u64, 0x0));
    var x156: u64 = undefined;
    var x157: u1 = undefined;
    addcarryxU64(&x156, &x157, x155, x144, cast(u64, 0x0));
    var x158: u64 = undefined;
    var x159: u64 = undefined;
    mulxU64(&x158, &x159, x146, 0x2341f27177344);
    var x160: u64 = undefined;
    var x161: u64 = undefined;
    mulxU64(&x160, &x161, x146, 0x6cfc5fd681c52056);
    var x162: u64 = undefined;
    var x163: u64 = undefined;
    mulxU64(&x162, &x163, x146, 0x7bc65c783158aea3);
    var x164: u64 = undefined;
    var x165: u64 = undefined;
    mulxU64(&x164, &x165, x146, 0xfdc1767ae2ffffff);
    var x166: u64 = undefined;
    var x167: u64 = undefined;
    mulxU64(&x166, &x167, x146, 0xffffffffffffffff);
    var x168: u64 = undefined;
    var x169: u64 = undefined;
    mulxU64(&x168, &x169, x146, 0xffffffffffffffff);
    var x170: u64 = undefined;
    var x171: u64 = undefined;
    mulxU64(&x170, &x171, x146, 0xffffffffffffffff);
    var x172: u64 = undefined;
    var x173: u1 = undefined;
    addcarryxU64(&x172, &x173, 0x0, x171, x168);
    var x174: u64 = undefined;
    var x175: u1 = undefined;
    addcarryxU64(&x174, &x175, x173, x169, x166);
    var x176: u64 = undefined;
    var x177: u1 = undefined;
    addcarryxU64(&x176, &x177, x175, x167, x164);
    var x178: u64 = undefined;
    var x179: u1 = undefined;
    addcarryxU64(&x178, &x179, x177, x165, x162);
    var x180: u64 = undefined;
    var x181: u1 = undefined;
    addcarryxU64(&x180, &x181, x179, x163, x160);
    var x182: u64 = undefined;
    var x183: u1 = undefined;
    addcarryxU64(&x182, &x183, x181, x161, x158);
    var x184: u64 = undefined;
    var x185: u1 = undefined;
    addcarryxU64(&x184, &x185, 0x0, x146, x170);
    var x186: u64 = undefined;
    var x187: u1 = undefined;
    addcarryxU64(&x186, &x187, x185, x148, x172);
    var x188: u64 = undefined;
    var x189: u1 = undefined;
    addcarryxU64(&x188, &x189, x187, x150, x174);
    var x190: u64 = undefined;
    var x191: u1 = undefined;
    addcarryxU64(&x190, &x191, x189, x152, x176);
    var x192: u64 = undefined;
    var x193: u1 = undefined;
    addcarryxU64(&x192, &x193, x191, x154, x178);
    var x194: u64 = undefined;
    var x195: u1 = undefined;
    addcarryxU64(&x194, &x195, x193, x156, x180);
    var x196: u64 = undefined;
    var x197: u1 = undefined;
    addcarryxU64(&x196, &x197, x195, (cast(u64, x157) + (cast(u64, x145) + (cast(u64, x131) + x107))), x182);
    var x198: u64 = undefined;
    var x199: u1 = undefined;
    addcarryxU64(&x198, &x199, 0x0, x186, (arg1[4]));
    var x200: u64 = undefined;
    var x201: u1 = undefined;
    addcarryxU64(&x200, &x201, x199, x188, cast(u64, 0x0));
    var x202: u64 = undefined;
    var x203: u1 = undefined;
    addcarryxU64(&x202, &x203, x201, x190, cast(u64, 0x0));
    var x204: u64 = undefined;
    var x205: u1 = undefined;
    addcarryxU64(&x204, &x205, x203, x192, cast(u64, 0x0));
    var x206: u64 = undefined;
    var x207: u1 = undefined;
    addcarryxU64(&x206, &x207, x205, x194, cast(u64, 0x0));
    var x208: u64 = undefined;
    var x209: u1 = undefined;
    addcarryxU64(&x208, &x209, x207, x196, cast(u64, 0x0));
    var x210: u64 = undefined;
    var x211: u64 = undefined;
    mulxU64(&x210, &x211, x198, 0x2341f27177344);
    var x212: u64 = undefined;
    var x213: u64 = undefined;
    mulxU64(&x212, &x213, x198, 0x6cfc5fd681c52056);
    var x214: u64 = undefined;
    var x215: u64 = undefined;
    mulxU64(&x214, &x215, x198, 0x7bc65c783158aea3);
    var x216: u64 = undefined;
    var x217: u64 = undefined;
    mulxU64(&x216, &x217, x198, 0xfdc1767ae2ffffff);
    var x218: u64 = undefined;
    var x219: u64 = undefined;
    mulxU64(&x218, &x219, x198, 0xffffffffffffffff);
    var x220: u64 = undefined;
    var x221: u64 = undefined;
    mulxU64(&x220, &x221, x198, 0xffffffffffffffff);
    var x222: u64 = undefined;
    var x223: u64 = undefined;
    mulxU64(&x222, &x223, x198, 0xffffffffffffffff);
    var x224: u64 = undefined;
    var x225: u1 = undefined;
    addcarryxU64(&x224, &x225, 0x0, x223, x220);
    var x226: u64 = undefined;
    var x227: u1 = undefined;
    addcarryxU64(&x226, &x227, x225, x221, x218);
    var x228: u64 = undefined;
    var x229: u1 = undefined;
    addcarryxU64(&x228, &x229, x227, x219, x216);
    var x230: u64 = undefined;
    var x231: u1 = undefined;
    addcarryxU64(&x230, &x231, x229, x217, x214);
    var x232: u64 = undefined;
    var x233: u1 = undefined;
    addcarryxU64(&x232, &x233, x231, x215, x212);
    var x234: u64 = undefined;
    var x235: u1 = undefined;
    addcarryxU64(&x234, &x235, x233, x213, x210);
    var x236: u64 = undefined;
    var x237: u1 = undefined;
    addcarryxU64(&x236, &x237, 0x0, x198, x222);
    var x238: u64 = undefined;
    var x239: u1 = undefined;
    addcarryxU64(&x238, &x239, x237, x200, x224);
    var x240: u64 = undefined;
    var x241: u1 = undefined;
    addcarryxU64(&x240, &x241, x239, x202, x226);
    var x242: u64 = undefined;
    var x243: u1 = undefined;
    addcarryxU64(&x242, &x243, x241, x204, x228);
    var x244: u64 = undefined;
    var x245: u1 = undefined;
    addcarryxU64(&x244, &x245, x243, x206, x230);
    var x246: u64 = undefined;
    var x247: u1 = undefined;
    addcarryxU64(&x246, &x247, x245, x208, x232);
    var x248: u64 = undefined;
    var x249: u1 = undefined;
    addcarryxU64(&x248, &x249, x247, (cast(u64, x209) + (cast(u64, x197) + (cast(u64, x183) + x159))), x234);
    var x250: u64 = undefined;
    var x251: u1 = undefined;
    addcarryxU64(&x250, &x251, 0x0, x238, (arg1[5]));
    var x252: u64 = undefined;
    var x253: u1 = undefined;
    addcarryxU64(&x252, &x253, x251, x240, cast(u64, 0x0));
    var x254: u64 = undefined;
    var x255: u1 = undefined;
    addcarryxU64(&x254, &x255, x253, x242, cast(u64, 0x0));
    var x256: u64 = undefined;
    var x257: u1 = undefined;
    addcarryxU64(&x256, &x257, x255, x244, cast(u64, 0x0));
    var x258: u64 = undefined;
    var x259: u1 = undefined;
    addcarryxU64(&x258, &x259, x257, x246, cast(u64, 0x0));
    var x260: u64 = undefined;
    var x261: u1 = undefined;
    addcarryxU64(&x260, &x261, x259, x248, cast(u64, 0x0));
    var x262: u64 = undefined;
    var x263: u64 = undefined;
    mulxU64(&x262, &x263, x250, 0x2341f27177344);
    var x264: u64 = undefined;
    var x265: u64 = undefined;
    mulxU64(&x264, &x265, x250, 0x6cfc5fd681c52056);
    var x266: u64 = undefined;
    var x267: u64 = undefined;
    mulxU64(&x266, &x267, x250, 0x7bc65c783158aea3);
    var x268: u64 = undefined;
    var x269: u64 = undefined;
    mulxU64(&x268, &x269, x250, 0xfdc1767ae2ffffff);
    var x270: u64 = undefined;
    var x271: u64 = undefined;
    mulxU64(&x270, &x271, x250, 0xffffffffffffffff);
    var x272: u64 = undefined;
    var x273: u64 = undefined;
    mulxU64(&x272, &x273, x250, 0xffffffffffffffff);
    var x274: u64 = undefined;
    var x275: u64 = undefined;
    mulxU64(&x274, &x275, x250, 0xffffffffffffffff);
    var x276: u64 = undefined;
    var x277: u1 = undefined;
    addcarryxU64(&x276, &x277, 0x0, x275, x272);
    var x278: u64 = undefined;
    var x279: u1 = undefined;
    addcarryxU64(&x278, &x279, x277, x273, x270);
    var x280: u64 = undefined;
    var x281: u1 = undefined;
    addcarryxU64(&x280, &x281, x279, x271, x268);
    var x282: u64 = undefined;
    var x283: u1 = undefined;
    addcarryxU64(&x282, &x283, x281, x269, x266);
    var x284: u64 = undefined;
    var x285: u1 = undefined;
    addcarryxU64(&x284, &x285, x283, x267, x264);
    var x286: u64 = undefined;
    var x287: u1 = undefined;
    addcarryxU64(&x286, &x287, x285, x265, x262);
    var x288: u64 = undefined;
    var x289: u1 = undefined;
    addcarryxU64(&x288, &x289, 0x0, x250, x274);
    var x290: u64 = undefined;
    var x291: u1 = undefined;
    addcarryxU64(&x290, &x291, x289, x252, x276);
    var x292: u64 = undefined;
    var x293: u1 = undefined;
    addcarryxU64(&x292, &x293, x291, x254, x278);
    var x294: u64 = undefined;
    var x295: u1 = undefined;
    addcarryxU64(&x294, &x295, x293, x256, x280);
    var x296: u64 = undefined;
    var x297: u1 = undefined;
    addcarryxU64(&x296, &x297, x295, x258, x282);
    var x298: u64 = undefined;
    var x299: u1 = undefined;
    addcarryxU64(&x298, &x299, x297, x260, x284);
    var x300: u64 = undefined;
    var x301: u1 = undefined;
    addcarryxU64(&x300, &x301, x299, (cast(u64, x261) + (cast(u64, x249) + (cast(u64, x235) + x211))), x286);
    var x302: u64 = undefined;
    var x303: u1 = undefined;
    addcarryxU64(&x302, &x303, 0x0, x290, (arg1[6]));
    var x304: u64 = undefined;
    var x305: u1 = undefined;
    addcarryxU64(&x304, &x305, x303, x292, cast(u64, 0x0));
    var x306: u64 = undefined;
    var x307: u1 = undefined;
    addcarryxU64(&x306, &x307, x305, x294, cast(u64, 0x0));
    var x308: u64 = undefined;
    var x309: u1 = undefined;
    addcarryxU64(&x308, &x309, x307, x296, cast(u64, 0x0));
    var x310: u64 = undefined;
    var x311: u1 = undefined;
    addcarryxU64(&x310, &x311, x309, x298, cast(u64, 0x0));
    var x312: u64 = undefined;
    var x313: u1 = undefined;
    addcarryxU64(&x312, &x313, x311, x300, cast(u64, 0x0));
    var x314: u64 = undefined;
    var x315: u64 = undefined;
    mulxU64(&x314, &x315, x302, 0x2341f27177344);
    var x316: u64 = undefined;
    var x317: u64 = undefined;
    mulxU64(&x316, &x317, x302, 0x6cfc5fd681c52056);
    var x318: u64 = undefined;
    var x319: u64 = undefined;
    mulxU64(&x318, &x319, x302, 0x7bc65c783158aea3);
    var x320: u64 = undefined;
    var x321: u64 = undefined;
    mulxU64(&x320, &x321, x302, 0xfdc1767ae2ffffff);
    var x322: u64 = undefined;
    var x323: u64 = undefined;
    mulxU64(&x322, &x323, x302, 0xffffffffffffffff);
    var x324: u64 = undefined;
    var x325: u64 = undefined;
    mulxU64(&x324, &x325, x302, 0xffffffffffffffff);
    var x326: u64 = undefined;
    var x327: u64 = undefined;
    mulxU64(&x326, &x327, x302, 0xffffffffffffffff);
    var x328: u64 = undefined;
    var x329: u1 = undefined;
    addcarryxU64(&x328, &x329, 0x0, x327, x324);
    var x330: u64 = undefined;
    var x331: u1 = undefined;
    addcarryxU64(&x330, &x331, x329, x325, x322);
    var x332: u64 = undefined;
    var x333: u1 = undefined;
    addcarryxU64(&x332, &x333, x331, x323, x320);
    var x334: u64 = undefined;
    var x335: u1 = undefined;
    addcarryxU64(&x334, &x335, x333, x321, x318);
    var x336: u64 = undefined;
    var x337: u1 = undefined;
    addcarryxU64(&x336, &x337, x335, x319, x316);
    var x338: u64 = undefined;
    var x339: u1 = undefined;
    addcarryxU64(&x338, &x339, x337, x317, x314);
    var x340: u64 = undefined;
    var x341: u1 = undefined;
    addcarryxU64(&x340, &x341, 0x0, x302, x326);
    var x342: u64 = undefined;
    var x343: u1 = undefined;
    addcarryxU64(&x342, &x343, x341, x304, x328);
    var x344: u64 = undefined;
    var x345: u1 = undefined;
    addcarryxU64(&x344, &x345, x343, x306, x330);
    var x346: u64 = undefined;
    var x347: u1 = undefined;
    addcarryxU64(&x346, &x347, x345, x308, x332);
    var x348: u64 = undefined;
    var x349: u1 = undefined;
    addcarryxU64(&x348, &x349, x347, x310, x334);
    var x350: u64 = undefined;
    var x351: u1 = undefined;
    addcarryxU64(&x350, &x351, x349, x312, x336);
    var x352: u64 = undefined;
    var x353: u1 = undefined;
    addcarryxU64(&x352, &x353, x351, (cast(u64, x313) + (cast(u64, x301) + (cast(u64, x287) + x263))), x338);
    const x354 = (cast(u64, x353) + (cast(u64, x339) + x315));
    var x355: u64 = undefined;
    var x356: u1 = undefined;
    subborrowxU64(&x355, &x356, 0x0, x342, 0xffffffffffffffff);
    var x357: u64 = undefined;
    var x358: u1 = undefined;
    subborrowxU64(&x357, &x358, x356, x344, 0xffffffffffffffff);
    var x359: u64 = undefined;
    var x360: u1 = undefined;
    subborrowxU64(&x359, &x360, x358, x346, 0xffffffffffffffff);
    var x361: u64 = undefined;
    var x362: u1 = undefined;
    subborrowxU64(&x361, &x362, x360, x348, 0xfdc1767ae2ffffff);
    var x363: u64 = undefined;
    var x364: u1 = undefined;
    subborrowxU64(&x363, &x364, x362, x350, 0x7bc65c783158aea3);
    var x365: u64 = undefined;
    var x366: u1 = undefined;
    subborrowxU64(&x365, &x366, x364, x352, 0x6cfc5fd681c52056);
    var x367: u64 = undefined;
    var x368: u1 = undefined;
    subborrowxU64(&x367, &x368, x366, x354, 0x2341f27177344);
    var x369: u64 = undefined;
    var x370: u1 = undefined;
    subborrowxU64(&x369, &x370, x368, cast(u64, 0x0), cast(u64, 0x0));
    var x371: u64 = undefined;
    cmovznzU64(&x371, x370, x355, x342);
    var x372: u64 = undefined;
    cmovznzU64(&x372, x370, x357, x344);
    var x373: u64 = undefined;
    cmovznzU64(&x373, x370, x359, x346);
    var x374: u64 = undefined;
    cmovznzU64(&x374, x370, x361, x348);
    var x375: u64 = undefined;
    cmovznzU64(&x375, x370, x363, x350);
    var x376: u64 = undefined;
    cmovznzU64(&x376, x370, x365, x352);
    var x377: u64 = undefined;
    cmovznzU64(&x377, x370, x367, x354);
    out1[0] = x371;
    out1[1] = x372;
    out1[2] = x373;
    out1[3] = x374;
    out1[4] = x375;
    out1[5] = x376;
    out1[6] = x377;
}

/// The function toMontgomery translates a field element into the Montgomery domain.
///
/// Preconditions:
///   0 ≤ eval arg1 < m
/// Postconditions:
///   eval (from_montgomery out1) mod m = eval arg1 mod m
///   0 ≤ eval out1 < m
///
pub fn toMontgomery(out1: *MontgomeryDomainFieldElement, arg1: NonMontgomeryDomainFieldElement) void {
    @setRuntimeSafety(mode == .Debug);

    const x1 = (arg1[1]);
    const x2 = (arg1[2]);
    const x3 = (arg1[3]);
    const x4 = (arg1[4]);
    const x5 = (arg1[5]);
    const x6 = (arg1[6]);
    const x7 = (arg1[0]);
    var x8: u64 = undefined;
    var x9: u64 = undefined;
    mulxU64(&x8, &x9, x7, 0x25a89bcdd12a);
    var x10: u64 = undefined;
    var x11: u64 = undefined;
    mulxU64(&x10, &x11, x7, 0x69e16a61c7686d9a);
    var x12: u64 = undefined;
    var x13: u64 = undefined;
    mulxU64(&x12, &x13, x7, 0xabcd92bf2dde347e);
    var x14: u64 = undefined;
    var x15: u64 = undefined;
    mulxU64(&x14, &x15, x7, 0x175cc6af8d6c7c0b);
    var x16: u64 = undefined;
    var x17: u64 = undefined;
    mulxU64(&x16, &x17, x7, 0xab27973f8311688d);
    var x18: u64 = undefined;
    var x19: u64 = undefined;
    mulxU64(&x18, &x19, x7, 0xacec7367768798c2);
    var x20: u64 = undefined;
    var x21: u64 = undefined;
    mulxU64(&x20, &x21, x7, 0x28e55b65dcd69b30);
    var x22: u64 = undefined;
    var x23: u1 = undefined;
    addcarryxU64(&x22, &x23, 0x0, x21, x18);
    var x24: u64 = undefined;
    var x25: u1 = undefined;
    addcarryxU64(&x24, &x25, x23, x19, x16);
    var x26: u64 = undefined;
    var x27: u1 = undefined;
    addcarryxU64(&x26, &x27, x25, x17, x14);
    var x28: u64 = undefined;
    var x29: u1 = undefined;
    addcarryxU64(&x28, &x29, x27, x15, x12);
    var x30: u64 = undefined;
    var x31: u1 = undefined;
    addcarryxU64(&x30, &x31, x29, x13, x10);
    var x32: u64 = undefined;
    var x33: u1 = undefined;
    addcarryxU64(&x32, &x33, x31, x11, x8);
    var x34: u64 = undefined;
    var x35: u64 = undefined;
    mulxU64(&x34, &x35, x20, 0x2341f27177344);
    var x36: u64 = undefined;
    var x37: u64 = undefined;
    mulxU64(&x36, &x37, x20, 0x6cfc5fd681c52056);
    var x38: u64 = undefined;
    var x39: u64 = undefined;
    mulxU64(&x38, &x39, x20, 0x7bc65c783158aea3);
    var x40: u64 = undefined;
    var x41: u64 = undefined;
    mulxU64(&x40, &x41, x20, 0xfdc1767ae2ffffff);
    var x42: u64 = undefined;
    var x43: u64 = undefined;
    mulxU64(&x42, &x43, x20, 0xffffffffffffffff);
    var x44: u64 = undefined;
    var x45: u64 = undefined;
    mulxU64(&x44, &x45, x20, 0xffffffffffffffff);
    var x46: u64 = undefined;
    var x47: u64 = undefined;
    mulxU64(&x46, &x47, x20, 0xffffffffffffffff);
    var x48: u64 = undefined;
    var x49: u1 = undefined;
    addcarryxU64(&x48, &x49, 0x0, x47, x44);
    var x50: u64 = undefined;
    var x51: u1 = undefined;
    addcarryxU64(&x50, &x51, x49, x45, x42);
    var x52: u64 = undefined;
    var x53: u1 = undefined;
    addcarryxU64(&x52, &x53, x51, x43, x40);
    var x54: u64 = undefined;
    var x55: u1 = undefined;
    addcarryxU64(&x54, &x55, x53, x41, x38);
    var x56: u64 = undefined;
    var x57: u1 = undefined;
    addcarryxU64(&x56, &x57, x55, x39, x36);
    var x58: u64 = undefined;
    var x59: u1 = undefined;
    addcarryxU64(&x58, &x59, x57, x37, x34);
    var x60: u64 = undefined;
    var x61: u1 = undefined;
    addcarryxU64(&x60, &x61, 0x0, x20, x46);
    var x62: u64 = undefined;
    var x63: u1 = undefined;
    addcarryxU64(&x62, &x63, x61, x22, x48);
    var x64: u64 = undefined;
    var x65: u1 = undefined;
    addcarryxU64(&x64, &x65, x63, x24, x50);
    var x66: u64 = undefined;
    var x67: u1 = undefined;
    addcarryxU64(&x66, &x67, x65, x26, x52);
    var x68: u64 = undefined;
    var x69: u1 = undefined;
    addcarryxU64(&x68, &x69, x67, x28, x54);
    var x70: u64 = undefined;
    var x71: u1 = undefined;
    addcarryxU64(&x70, &x71, x69, x30, x56);
    var x72: u64 = undefined;
    var x73: u1 = undefined;
    addcarryxU64(&x72, &x73, x71, x32, x58);
    var x74: u64 = undefined;
    var x75: u64 = undefined;
    mulxU64(&x74, &x75, x1, 0x25a89bcdd12a);
    var x76: u64 = undefined;
    var x77: u64 = undefined;
    mulxU64(&x76, &x77, x1, 0x69e16a61c7686d9a);
    var x78: u64 = undefined;
    var x79: u64 = undefined;
    mulxU64(&x78, &x79, x1, 0xabcd92bf2dde347e);
    var x80: u64 = undefined;
    var x81: u64 = undefined;
    mulxU64(&x80, &x81, x1, 0x175cc6af8d6c7c0b);
    var x82: u64 = undefined;
    var x83: u64 = undefined;
    mulxU64(&x82, &x83, x1, 0xab27973f8311688d);
    var x84: u64 = undefined;
    var x85: u64 = undefined;
    mulxU64(&x84, &x85, x1, 0xacec7367768798c2);
    var x86: u64 = undefined;
    var x87: u64 = undefined;
    mulxU64(&x86, &x87, x1, 0x28e55b65dcd69b30);
    var x88: u64 = undefined;
    var x89: u1 = undefined;
    addcarryxU64(&x88, &x89, 0x0, x87, x84);
    var x90: u64 = undefined;
    var x91: u1 = undefined;
    addcarryxU64(&x90, &x91, x89, x85, x82);
    var x92: u64 = undefined;
    var x93: u1 = undefined;
    addcarryxU64(&x92, &x93, x91, x83, x80);
    var x94: u64 = undefined;
    var x95: u1 = undefined;
    addcarryxU64(&x94, &x95, x93, x81, x78);
    var x96: u64 = undefined;
    var x97: u1 = undefined;
    addcarryxU64(&x96, &x97, x95, x79, x76);
    var x98: u64 = undefined;
    var x99: u1 = undefined;
    addcarryxU64(&x98, &x99, x97, x77, x74);
    var x100: u64 = undefined;
    var x101: u1 = undefined;
    addcarryxU64(&x100, &x101, 0x0, x62, x86);
    var x102: u64 = undefined;
    var x103: u1 = undefined;
    addcarryxU64(&x102, &x103, x101, x64, x88);
    var x104: u64 = undefined;
    var x105: u1 = undefined;
    addcarryxU64(&x104, &x105, x103, x66, x90);
    var x106: u64 = undefined;
    var x107: u1 = undefined;
    addcarryxU64(&x106, &x107, x105, x68, x92);
    var x108: u64 = undefined;
    var x109: u1 = undefined;
    addcarryxU64(&x108, &x109, x107, x70, x94);
    var x110: u64 = undefined;
    var x111: u1 = undefined;
    addcarryxU64(&x110, &x111, x109, x72, x96);
    var x112: u64 = undefined;
    var x113: u1 = undefined;
    addcarryxU64(&x112, &x113, x111, ((cast(u64, x73) + (cast(u64, x33) + x9)) + (cast(u64, x59) + x35)), x98);
    var x114: u64 = undefined;
    var x115: u64 = undefined;
    mulxU64(&x114, &x115, x100, 0x2341f27177344);
    var x116: u64 = undefined;
    var x117: u64 = undefined;
    mulxU64(&x116, &x117, x100, 0x6cfc5fd681c52056);
    var x118: u64 = undefined;
    var x119: u64 = undefined;
    mulxU64(&x118, &x119, x100, 0x7bc65c783158aea3);
    var x120: u64 = undefined;
    var x121: u64 = undefined;
    mulxU64(&x120, &x121, x100, 0xfdc1767ae2ffffff);
    var x122: u64 = undefined;
    var x123: u64 = undefined;
    mulxU64(&x122, &x123, x100, 0xffffffffffffffff);
    var x124: u64 = undefined;
    var x125: u64 = undefined;
    mulxU64(&x124, &x125, x100, 0xffffffffffffffff);
    var x126: u64 = undefined;
    var x127: u64 = undefined;
    mulxU64(&x126, &x127, x100, 0xffffffffffffffff);
    var x128: u64 = undefined;
    var x129: u1 = undefined;
    addcarryxU64(&x128, &x129, 0x0, x127, x124);
    var x130: u64 = undefined;
    var x131: u1 = undefined;
    addcarryxU64(&x130, &x131, x129, x125, x122);
    var x132: u64 = undefined;
    var x133: u1 = undefined;
    addcarryxU64(&x132, &x133, x131, x123, x120);
    var x134: u64 = undefined;
    var x135: u1 = undefined;
    addcarryxU64(&x134, &x135, x133, x121, x118);
    var x136: u64 = undefined;
    var x137: u1 = undefined;
    addcarryxU64(&x136, &x137, x135, x119, x116);
    var x138: u64 = undefined;
    var x139: u1 = undefined;
    addcarryxU64(&x138, &x139, x137, x117, x114);
    var x140: u64 = undefined;
    var x141: u1 = undefined;
    addcarryxU64(&x140, &x141, 0x0, x100, x126);
    var x142: u64 = undefined;
    var x143: u1 = undefined;
    addcarryxU64(&x142, &x143, x141, x102, x128);
    var x144: u64 = undefined;
    var x145: u1 = undefined;
    addcarryxU64(&x144, &x145, x143, x104, x130);
    var x146: u64 = undefined;
    var x147: u1 = undefined;
    addcarryxU64(&x146, &x147, x145, x106, x132);
    var x148: u64 = undefined;
    var x149: u1 = undefined;
    addcarryxU64(&x148, &x149, x147, x108, x134);
    var x150: u64 = undefined;
    var x151: u1 = undefined;
    addcarryxU64(&x150, &x151, x149, x110, x136);
    var x152: u64 = undefined;
    var x153: u1 = undefined;
    addcarryxU64(&x152, &x153, x151, x112, x138);
    var x154: u64 = undefined;
    var x155: u64 = undefined;
    mulxU64(&x154, &x155, x2, 0x25a89bcdd12a);
    var x156: u64 = undefined;
    var x157: u64 = undefined;
    mulxU64(&x156, &x157, x2, 0x69e16a61c7686d9a);
    var x158: u64 = undefined;
    var x159: u64 = undefined;
    mulxU64(&x158, &x159, x2, 0xabcd92bf2dde347e);
    var x160: u64 = undefined;
    var x161: u64 = undefined;
    mulxU64(&x160, &x161, x2, 0x175cc6af8d6c7c0b);
    var x162: u64 = undefined;
    var x163: u64 = undefined;
    mulxU64(&x162, &x163, x2, 0xab27973f8311688d);
    var x164: u64 = undefined;
    var x165: u64 = undefined;
    mulxU64(&x164, &x165, x2, 0xacec7367768798c2);
    var x166: u64 = undefined;
    var x167: u64 = undefined;
    mulxU64(&x166, &x167, x2, 0x28e55b65dcd69b30);
    var x168: u64 = undefined;
    var x169: u1 = undefined;
    addcarryxU64(&x168, &x169, 0x0, x167, x164);
    var x170: u64 = undefined;
    var x171: u1 = undefined;
    addcarryxU64(&x170, &x171, x169, x165, x162);
    var x172: u64 = undefined;
    var x173: u1 = undefined;
    addcarryxU64(&x172, &x173, x171, x163, x160);
    var x174: u64 = undefined;
    var x175: u1 = undefined;
    addcarryxU64(&x174, &x175, x173, x161, x158);
    var x176: u64 = undefined;
    var x177: u1 = undefined;
    addcarryxU64(&x176, &x177, x175, x159, x156);
    var x178: u64 = undefined;
    var x179: u1 = undefined;
    addcarryxU64(&x178, &x179, x177, x157, x154);
    var x180: u64 = undefined;
    var x181: u1 = undefined;
    addcarryxU64(&x180, &x181, 0x0, x142, x166);
    var x182: u64 = undefined;
    var x183: u1 = undefined;
    addcarryxU64(&x182, &x183, x181, x144, x168);
    var x184: u64 = undefined;
    var x185: u1 = undefined;
    addcarryxU64(&x184, &x185, x183, x146, x170);
    var x186: u64 = undefined;
    var x187: u1 = undefined;
    addcarryxU64(&x186, &x187, x185, x148, x172);
    var x188: u64 = undefined;
    var x189: u1 = undefined;
    addcarryxU64(&x188, &x189, x187, x150, x174);
    var x190: u64 = undefined;
    var x191: u1 = undefined;
    addcarryxU64(&x190, &x191, x189, x152, x176);
    var x192: u64 = undefined;
    var x193: u1 = undefined;
    addcarryxU64(&x192, &x193, x191, ((cast(u64, x153) + (cast(u64, x113) + (cast(u64, x99) + x75))) + (cast(u64, x139) + x115)), x178);
    var x194: u64 = undefined;
    var x195: u64 = undefined;
    mulxU64(&x194, &x195, x180, 0x2341f27177344);
    var x196: u64 = undefined;
    var x197: u64 = undefined;
    mulxU64(&x196, &x197, x180, 0x6cfc5fd681c52056);
    var x198: u64 = undefined;
    var x199: u64 = undefined;
    mulxU64(&x198, &x199, x180, 0x7bc65c783158aea3);
    var x200: u64 = undefined;
    var x201: u64 = undefined;
    mulxU64(&x200, &x201, x180, 0xfdc1767ae2ffffff);
    var x202: u64 = undefined;
    var x203: u64 = undefined;
    mulxU64(&x202, &x203, x180, 0xffffffffffffffff);
    var x204: u64 = undefined;
    var x205: u64 = undefined;
    mulxU64(&x204, &x205, x180, 0xffffffffffffffff);
    var x206: u64 = undefined;
    var x207: u64 = undefined;
    mulxU64(&x206, &x207, x180, 0xffffffffffffffff);
    var x208: u64 = undefined;
    var x209: u1 = undefined;
    addcarryxU64(&x208, &x209, 0x0, x207, x204);
    var x210: u64 = undefined;
    var x211: u1 = undefined;
    addcarryxU64(&x210, &x211, x209, x205, x202);
    var x212: u64 = undefined;
    var x213: u1 = undefined;
    addcarryxU64(&x212, &x213, x211, x203, x200);
    var x214: u64 = undefined;
    var x215: u1 = undefined;
    addcarryxU64(&x214, &x215, x213, x201, x198);
    var x216: u64 = undefined;
    var x217: u1 = undefined;
    addcarryxU64(&x216, &x217, x215, x199, x196);
    var x218: u64 = undefined;
    var x219: u1 = undefined;
    addcarryxU64(&x218, &x219, x217, x197, x194);
    var x220: u64 = undefined;
    var x221: u1 = undefined;
    addcarryxU64(&x220, &x221, 0x0, x180, x206);
    var x222: u64 = undefined;
    var x223: u1 = undefined;
    addcarryxU64(&x222, &x223, x221, x182, x208);
    var x224: u64 = undefined;
    var x225: u1 = undefined;
    addcarryxU64(&x224, &x225, x223, x184, x210);
    var x226: u64 = undefined;
    var x227: u1 = undefined;
    addcarryxU64(&x226, &x227, x225, x186, x212);
    var x228: u64 = undefined;
    var x229: u1 = undefined;
    addcarryxU64(&x228, &x229, x227, x188, x214);
    var x230: u64 = undefined;
    var x231: u1 = undefined;
    addcarryxU64(&x230, &x231, x229, x190, x216);
    var x232: u64 = undefined;
    var x233: u1 = undefined;
    addcarryxU64(&x232, &x233, x231, x192, x218);
    var x234: u64 = undefined;
    var x235: u64 = undefined;
    mulxU64(&x234, &x235, x3, 0x25a89bcdd12a);
    var x236: u64 = undefined;
    var x237: u64 = undefined;
    mulxU64(&x236, &x237, x3, 0x69e16a61c7686d9a);
    var x238: u64 = undefined;
    var x239: u64 = undefined;
    mulxU64(&x238, &x239, x3, 0xabcd92bf2dde347e);
    var x240: u64 = undefined;
    var x241: u64 = undefined;
    mulxU64(&x240, &x241, x3, 0x175cc6af8d6c7c0b);
    var x242: u64 = undefined;
    var x243: u64 = undefined;
    mulxU64(&x242, &x243, x3, 0xab27973f8311688d);
    var x244: u64 = undefined;
    var x245: u64 = undefined;
    mulxU64(&x244, &x245, x3, 0xacec7367768798c2);
    var x246: u64 = undefined;
    var x247: u64 = undefined;
    mulxU64(&x246, &x247, x3, 0x28e55b65dcd69b30);
    var x248: u64 = undefined;
    var x249: u1 = undefined;
    addcarryxU64(&x248, &x249, 0x0, x247, x244);
    var x250: u64 = undefined;
    var x251: u1 = undefined;
    addcarryxU64(&x250, &x251, x249, x245, x242);
    var x252: u64 = undefined;
    var x253: u1 = undefined;
    addcarryxU64(&x252, &x253, x251, x243, x240);
    var x254: u64 = undefined;
    var x255: u1 = undefined;
    addcarryxU64(&x254, &x255, x253, x241, x238);
    var x256: u64 = undefined;
    var x257: u1 = undefined;
    addcarryxU64(&x256, &x257, x255, x239, x236);
    var x258: u64 = undefined;
    var x259: u1 = undefined;
    addcarryxU64(&x258, &x259, x257, x237, x234);
    var x260: u64 = undefined;
    var x261: u1 = undefined;
    addcarryxU64(&x260, &x261, 0x0, x222, x246);
    var x262: u64 = undefined;
    var x263: u1 = undefined;
    addcarryxU64(&x262, &x263, x261, x224, x248);
    var x264: u64 = undefined;
    var x265: u1 = undefined;
    addcarryxU64(&x264, &x265, x263, x226, x250);
    var x266: u64 = undefined;
    var x267: u1 = undefined;
    addcarryxU64(&x266, &x267, x265, x228, x252);
    var x268: u64 = undefined;
    var x269: u1 = undefined;
    addcarryxU64(&x268, &x269, x267, x230, x254);
    var x270: u64 = undefined;
    var x271: u1 = undefined;
    addcarryxU64(&x270, &x271, x269, x232, x256);
    var x272: u64 = undefined;
    var x273: u1 = undefined;
    addcarryxU64(&x272, &x273, x271, ((cast(u64, x233) + (cast(u64, x193) + (cast(u64, x179) + x155))) + (cast(u64, x219) + x195)), x258);
    var x274: u64 = undefined;
    var x275: u64 = undefined;
    mulxU64(&x274, &x275, x260, 0x2341f27177344);
    var x276: u64 = undefined;
    var x277: u64 = undefined;
    mulxU64(&x276, &x277, x260, 0x6cfc5fd681c52056);
    var x278: u64 = undefined;
    var x279: u64 = undefined;
    mulxU64(&x278, &x279, x260, 0x7bc65c783158aea3);
    var x280: u64 = undefined;
    var x281: u64 = undefined;
    mulxU64(&x280, &x281, x260, 0xfdc1767ae2ffffff);
    var x282: u64 = undefined;
    var x283: u64 = undefined;
    mulxU64(&x282, &x283, x260, 0xffffffffffffffff);
    var x284: u64 = undefined;
    var x285: u64 = undefined;
    mulxU64(&x284, &x285, x260, 0xffffffffffffffff);
    var x286: u64 = undefined;
    var x287: u64 = undefined;
    mulxU64(&x286, &x287, x260, 0xffffffffffffffff);
    var x288: u64 = undefined;
    var x289: u1 = undefined;
    addcarryxU64(&x288, &x289, 0x0, x287, x284);
    var x290: u64 = undefined;
    var x291: u1 = undefined;
    addcarryxU64(&x290, &x291, x289, x285, x282);
    var x292: u64 = undefined;
    var x293: u1 = undefined;
    addcarryxU64(&x292, &x293, x291, x283, x280);
    var x294: u64 = undefined;
    var x295: u1 = undefined;
    addcarryxU64(&x294, &x295, x293, x281, x278);
    var x296: u64 = undefined;
    var x297: u1 = undefined;
    addcarryxU64(&x296, &x297, x295, x279, x276);
    var x298: u64 = undefined;
    var x299: u1 = undefined;
    addcarryxU64(&x298, &x299, x297, x277, x274);
    var x300: u64 = undefined;
    var x301: u1 = undefined;
    addcarryxU64(&x300, &x301, 0x0, x260, x286);
    var x302: u64 = undefined;
    var x303: u1 = undefined;
    addcarryxU64(&x302, &x303, x301, x262, x288);
    var x304: u64 = undefined;
    var x305: u1 = undefined;
    addcarryxU64(&x304, &x305, x303, x264, x290);
    var x306: u64 = undefined;
    var x307: u1 = undefined;
    addcarryxU64(&x306, &x307, x305, x266, x292);
    var x308: u64 = undefined;
    var x309: u1 = undefined;
    addcarryxU64(&x308, &x309, x307, x268, x294);
    var x310: u64 = undefined;
    var x311: u1 = undefined;
    addcarryxU64(&x310, &x311, x309, x270, x296);
    var x312: u64 = undefined;
    var x313: u1 = undefined;
    addcarryxU64(&x312, &x313, x311, x272, x298);
    var x314: u64 = undefined;
    var x315: u64 = undefined;
    mulxU64(&x314, &x315, x4, 0x25a89bcdd12a);
    var x316: u64 = undefined;
    var x317: u64 = undefined;
    mulxU64(&x316, &x317, x4, 0x69e16a61c7686d9a);
    var x318: u64 = undefined;
    var x319: u64 = undefined;
    mulxU64(&x318, &x319, x4, 0xabcd92bf2dde347e);
    var x320: u64 = undefined;
    var x321: u64 = undefined;
    mulxU64(&x320, &x321, x4, 0x175cc6af8d6c7c0b);
    var x322: u64 = undefined;
    var x323: u64 = undefined;
    mulxU64(&x322, &x323, x4, 0xab27973f8311688d);
    var x324: u64 = undefined;
    var x325: u64 = undefined;
    mulxU64(&x324, &x325, x4, 0xacec7367768798c2);
    var x326: u64 = undefined;
    var x327: u64 = undefined;
    mulxU64(&x326, &x327, x4, 0x28e55b65dcd69b30);
    var x328: u64 = undefined;
    var x329: u1 = undefined;
    addcarryxU64(&x328, &x329, 0x0, x327, x324);
    var x330: u64 = undefined;
    var x331: u1 = undefined;
    addcarryxU64(&x330, &x331, x329, x325, x322);
    var x332: u64 = undefined;
    var x333: u1 = undefined;
    addcarryxU64(&x332, &x333, x331, x323, x320);
    var x334: u64 = undefined;
    var x335: u1 = undefined;
    addcarryxU64(&x334, &x335, x333, x321, x318);
    var x336: u64 = undefined;
    var x337: u1 = undefined;
    addcarryxU64(&x336, &x337, x335, x319, x316);
    var x338: u64 = undefined;
    var x339: u1 = undefined;
    addcarryxU64(&x338, &x339, x337, x317, x314);
    var x340: u64 = undefined;
    var x341: u1 = undefined;
    addcarryxU64(&x340, &x341, 0x0, x302, x326);
    var x342: u64 = undefined;
    var x343: u1 = undefined;
    addcarryxU64(&x342, &x343, x341, x304, x328);
    var x344: u64 = undefined;
    var x345: u1 = undefined;
    addcarryxU64(&x344, &x345, x343, x306, x330);
    var x346: u64 = undefined;
    var x347: u1 = undefined;
    addcarryxU64(&x346, &x347, x345, x308, x332);
    var x348: u64 = undefined;
    var x349: u1 = undefined;
    addcarryxU64(&x348, &x349, x347, x310, x334);
    var x350: u64 = undefined;
    var x351: u1 = undefined;
    addcarryxU64(&x350, &x351, x349, x312, x336);
    var x352: u64 = undefined;
    var x353: u1 = undefined;
    addcarryxU64(&x352, &x353, x351, ((cast(u64, x313) + (cast(u64, x273) + (cast(u64, x259) + x235))) + (cast(u64, x299) + x275)), x338);
    var x354: u64 = undefined;
    var x355: u64 = undefined;
    mulxU64(&x354, &x355, x340, 0x2341f27177344);
    var x356: u64 = undefined;
    var x357: u64 = undefined;
    mulxU64(&x356, &x357, x340, 0x6cfc5fd681c52056);
    var x358: u64 = undefined;
    var x359: u64 = undefined;
    mulxU64(&x358, &x359, x340, 0x7bc65c783158aea3);
    var x360: u64 = undefined;
    var x361: u64 = undefined;
    mulxU64(&x360, &x361, x340, 0xfdc1767ae2ffffff);
    var x362: u64 = undefined;
    var x363: u64 = undefined;
    mulxU64(&x362, &x363, x340, 0xffffffffffffffff);
    var x364: u64 = undefined;
    var x365: u64 = undefined;
    mulxU64(&x364, &x365, x340, 0xffffffffffffffff);
    var x366: u64 = undefined;
    var x367: u64 = undefined;
    mulxU64(&x366, &x367, x340, 0xffffffffffffffff);
    var x368: u64 = undefined;
    var x369: u1 = undefined;
    addcarryxU64(&x368, &x369, 0x0, x367, x364);
    var x370: u64 = undefined;
    var x371: u1 = undefined;
    addcarryxU64(&x370, &x371, x369, x365, x362);
    var x372: u64 = undefined;
    var x373: u1 = undefined;
    addcarryxU64(&x372, &x373, x371, x363, x360);
    var x374: u64 = undefined;
    var x375: u1 = undefined;
    addcarryxU64(&x374, &x375, x373, x361, x358);
    var x376: u64 = undefined;
    var x377: u1 = undefined;
    addcarryxU64(&x376, &x377, x375, x359, x356);
    var x378: u64 = undefined;
    var x379: u1 = undefined;
    addcarryxU64(&x378, &x379, x377, x357, x354);
    var x380: u64 = undefined;
    var x381: u1 = undefined;
    addcarryxU64(&x380, &x381, 0x0, x340, x366);
    var x382: u64 = undefined;
    var x383: u1 = undefined;
    addcarryxU64(&x382, &x383, x381, x342, x368);
    var x384: u64 = undefined;
    var x385: u1 = undefined;
    addcarryxU64(&x384, &x385, x383, x344, x370);
    var x386: u64 = undefined;
    var x387: u1 = undefined;
    addcarryxU64(&x386, &x387, x385, x346, x372);
    var x388: u64 = undefined;
    var x389: u1 = undefined;
    addcarryxU64(&x388, &x389, x387, x348, x374);
    var x390: u64 = undefined;
    var x391: u1 = undefined;
    addcarryxU64(&x390, &x391, x389, x350, x376);
    var x392: u64 = undefined;
    var x393: u1 = undefined;
    addcarryxU64(&x392, &x393, x391, x352, x378);
    var x394: u64 = undefined;
    var x395: u64 = undefined;
    mulxU64(&x394, &x395, x5, 0x25a89bcdd12a);
    var x396: u64 = undefined;
    var x397: u64 = undefined;
    mulxU64(&x396, &x397, x5, 0x69e16a61c7686d9a);
    var x398: u64 = undefined;
    var x399: u64 = undefined;
    mulxU64(&x398, &x399, x5, 0xabcd92bf2dde347e);
    var x400: u64 = undefined;
    var x401: u64 = undefined;
    mulxU64(&x400, &x401, x5, 0x175cc6af8d6c7c0b);
    var x402: u64 = undefined;
    var x403: u64 = undefined;
    mulxU64(&x402, &x403, x5, 0xab27973f8311688d);
    var x404: u64 = undefined;
    var x405: u64 = undefined;
    mulxU64(&x404, &x405, x5, 0xacec7367768798c2);
    var x406: u64 = undefined;
    var x407: u64 = undefined;
    mulxU64(&x406, &x407, x5, 0x28e55b65dcd69b30);
    var x408: u64 = undefined;
    var x409: u1 = undefined;
    addcarryxU64(&x408, &x409, 0x0, x407, x404);
    var x410: u64 = undefined;
    var x411: u1 = undefined;
    addcarryxU64(&x410, &x411, x409, x405, x402);
    var x412: u64 = undefined;
    var x413: u1 = undefined;
    addcarryxU64(&x412, &x413, x411, x403, x400);
    var x414: u64 = undefined;
    var x415: u1 = undefined;
    addcarryxU64(&x414, &x415, x413, x401, x398);
    var x416: u64 = undefined;
    var x417: u1 = undefined;
    addcarryxU64(&x416, &x417, x415, x399, x396);
    var x418: u64 = undefined;
    var x419: u1 = undefined;
    addcarryxU64(&x418, &x419, x417, x397, x394);
    var x420: u64 = undefined;
    var x421: u1 = undefined;
    addcarryxU64(&x420, &x421, 0x0, x382, x406);
    var x422: u64 = undefined;
    var x423: u1 = undefined;
    addcarryxU64(&x422, &x423, x421, x384, x408);
    var x424: u64 = undefined;
    var x425: u1 = undefined;
    addcarryxU64(&x424, &x425, x423, x386, x410);
    var x426: u64 = undefined;
    var x427: u1 = undefined;
    addcarryxU64(&x426, &x427, x425, x388, x412);
    var x428: u64 = undefined;
    var x429: u1 = undefined;
    addcarryxU64(&x428, &x429, x427, x390, x414);
    var x430: u64 = undefined;
    var x431: u1 = undefined;
    addcarryxU64(&x430, &x431, x429, x392, x416);
    var x432: u64 = undefined;
    var x433: u1 = undefined;
    addcarryxU64(&x432, &x433, x431, ((cast(u64, x393) + (cast(u64, x353) + (cast(u64, x339) + x315))) + (cast(u64, x379) + x355)), x418);
    var x434: u64 = undefined;
    var x435: u64 = undefined;
    mulxU64(&x434, &x435, x420, 0x2341f27177344);
    var x436: u64 = undefined;
    var x437: u64 = undefined;
    mulxU64(&x436, &x437, x420, 0x6cfc5fd681c52056);
    var x438: u64 = undefined;
    var x439: u64 = undefined;
    mulxU64(&x438, &x439, x420, 0x7bc65c783158aea3);
    var x440: u64 = undefined;
    var x441: u64 = undefined;
    mulxU64(&x440, &x441, x420, 0xfdc1767ae2ffffff);
    var x442: u64 = undefined;
    var x443: u64 = undefined;
    mulxU64(&x442, &x443, x420, 0xffffffffffffffff);
    var x444: u64 = undefined;
    var x445: u64 = undefined;
    mulxU64(&x444, &x445, x420, 0xffffffffffffffff);
    var x446: u64 = undefined;
    var x447: u64 = undefined;
    mulxU64(&x446, &x447, x420, 0xffffffffffffffff);
    var x448: u64 = undefined;
    var x449: u1 = undefined;
    addcarryxU64(&x448, &x449, 0x0, x447, x444);
    var x450: u64 = undefined;
    var x451: u1 = undefined;
    addcarryxU64(&x450, &x451, x449, x445, x442);
    var x452: u64 = undefined;
    var x453: u1 = undefined;
    addcarryxU64(&x452, &x453, x451, x443, x440);
    var x454: u64 = undefined;
    var x455: u1 = undefined;
    addcarryxU64(&x454, &x455, x453, x441, x438);
    var x456: u64 = undefined;
    var x457: u1 = undefined;
    addcarryxU64(&x456, &x457, x455, x439, x436);
    var x458: u64 = undefined;
    var x459: u1 = undefined;
    addcarryxU64(&x458, &x459, x457, x437, x434);
    var x460: u64 = undefined;
    var x461: u1 = undefined;
    addcarryxU64(&x460, &x461, 0x0, x420, x446);
    var x462: u64 = undefined;
    var x463: u1 = undefined;
    addcarryxU64(&x462, &x463, x461, x422, x448);
    var x464: u64 = undefined;
    var x465: u1 = undefined;
    addcarryxU64(&x464, &x465, x463, x424, x450);
    var x466: u64 = undefined;
    var x467: u1 = undefined;
    addcarryxU64(&x466, &x467, x465, x426, x452);
    var x468: u64 = undefined;
    var x469: u1 = undefined;
    addcarryxU64(&x468, &x469, x467, x428, x454);
    var x470: u64 = undefined;
    var x471: u1 = undefined;
    addcarryxU64(&x470, &x471, x469, x430, x456);
    var x472: u64 = undefined;
    var x473: u1 = undefined;
    addcarryxU64(&x472, &x473, x471, x432, x458);
    var x474: u64 = undefined;
    var x475: u64 = undefined;
    mulxU64(&x474, &x475, x6, 0x25a89bcdd12a);
    var x476: u64 = undefined;
    var x477: u64 = undefined;
    mulxU64(&x476, &x477, x6, 0x69e16a61c7686d9a);
    var x478: u64 = undefined;
    var x479: u64 = undefined;
    mulxU64(&x478, &x479, x6, 0xabcd92bf2dde347e);
    var x480: u64 = undefined;
    var x481: u64 = undefined;
    mulxU64(&x480, &x481, x6, 0x175cc6af8d6c7c0b);
    var x482: u64 = undefined;
    var x483: u64 = undefined;
    mulxU64(&x482, &x483, x6, 0xab27973f8311688d);
    var x484: u64 = undefined;
    var x485: u64 = undefined;
    mulxU64(&x484, &x485, x6, 0xacec7367768798c2);
    var x486: u64 = undefined;
    var x487: u64 = undefined;
    mulxU64(&x486, &x487, x6, 0x28e55b65dcd69b30);
    var x488: u64 = undefined;
    var x489: u1 = undefined;
    addcarryxU64(&x488, &x489, 0x0, x487, x484);
    var x490: u64 = undefined;
    var x491: u1 = undefined;
    addcarryxU64(&x490, &x491, x489, x485, x482);
    var x492: u64 = undefined;
    var x493: u1 = undefined;
    addcarryxU64(&x492, &x493, x491, x483, x480);
    var x494: u64 = undefined;
    var x495: u1 = undefined;
    addcarryxU64(&x494, &x495, x493, x481, x478);
    var x496: u64 = undefined;
    var x497: u1 = undefined;
    addcarryxU64(&x496, &x497, x495, x479, x476);
    var x498: u64 = undefined;
    var x499: u1 = undefined;
    addcarryxU64(&x498, &x499, x497, x477, x474);
    var x500: u64 = undefined;
    var x501: u1 = undefined;
    addcarryxU64(&x500, &x501, 0x0, x462, x486);
    var x502: u64 = undefined;
    var x503: u1 = undefined;
    addcarryxU64(&x502, &x503, x501, x464, x488);
    var x504: u64 = undefined;
    var x505: u1 = undefined;
    addcarryxU64(&x504, &x505, x503, x466, x490);
    var x506: u64 = undefined;
    var x507: u1 = undefined;
    addcarryxU64(&x506, &x507, x505, x468, x492);
    var x508: u64 = undefined;
    var x509: u1 = undefined;
    addcarryxU64(&x508, &x509, x507, x470, x494);
    var x510: u64 = undefined;
    var x511: u1 = undefined;
    addcarryxU64(&x510, &x511, x509, x472, x496);
    var x512: u64 = undefined;
    var x513: u1 = undefined;
    addcarryxU64(&x512, &x513, x511, ((cast(u64, x473) + (cast(u64, x433) + (cast(u64, x419) + x395))) + (cast(u64, x459) + x435)), x498);
    var x514: u64 = undefined;
    var x515: u64 = undefined;
    mulxU64(&x514, &x515, x500, 0x2341f27177344);
    var x516: u64 = undefined;
    var x517: u64 = undefined;
    mulxU64(&x516, &x517, x500, 0x6cfc5fd681c52056);
    var x518: u64 = undefined;
    var x519: u64 = undefined;
    mulxU64(&x518, &x519, x500, 0x7bc65c783158aea3);
    var x520: u64 = undefined;
    var x521: u64 = undefined;
    mulxU64(&x520, &x521, x500, 0xfdc1767ae2ffffff);
    var x522: u64 = undefined;
    var x523: u64 = undefined;
    mulxU64(&x522, &x523, x500, 0xffffffffffffffff);
    var x524: u64 = undefined;
    var x525: u64 = undefined;
    mulxU64(&x524, &x525, x500, 0xffffffffffffffff);
    var x526: u64 = undefined;
    var x527: u64 = undefined;
    mulxU64(&x526, &x527, x500, 0xffffffffffffffff);
    var x528: u64 = undefined;
    var x529: u1 = undefined;
    addcarryxU64(&x528, &x529, 0x0, x527, x524);
    var x530: u64 = undefined;
    var x531: u1 = undefined;
    addcarryxU64(&x530, &x531, x529, x525, x522);
    var x532: u64 = undefined;
    var x533: u1 = undefined;
    addcarryxU64(&x532, &x533, x531, x523, x520);
    var x534: u64 = undefined;
    var x535: u1 = undefined;
    addcarryxU64(&x534, &x535, x533, x521, x518);
    var x536: u64 = undefined;
    var x537: u1 = undefined;
    addcarryxU64(&x536, &x537, x535, x519, x516);
    var x538: u64 = undefined;
    var x539: u1 = undefined;
    addcarryxU64(&x538, &x539, x537, x517, x514);
    var x540: u64 = undefined;
    var x541: u1 = undefined;
    addcarryxU64(&x540, &x541, 0x0, x500, x526);
    var x542: u64 = undefined;
    var x543: u1 = undefined;
    addcarryxU64(&x542, &x543, x541, x502, x528);
    var x544: u64 = undefined;
    var x545: u1 = undefined;
    addcarryxU64(&x544, &x545, x543, x504, x530);
    var x546: u64 = undefined;
    var x547: u1 = undefined;
    addcarryxU64(&x546, &x547, x545, x506, x532);
    var x548: u64 = undefined;
    var x549: u1 = undefined;
    addcarryxU64(&x548, &x549, x547, x508, x534);
    var x550: u64 = undefined;
    var x551: u1 = undefined;
    addcarryxU64(&x550, &x551, x549, x510, x536);
    var x552: u64 = undefined;
    var x553: u1 = undefined;
    addcarryxU64(&x552, &x553, x551, x512, x538);
    const x554 = ((cast(u64, x553) + (cast(u64, x513) + (cast(u64, x499) + x475))) + (cast(u64, x539) + x515));
    var x555: u64 = undefined;
    var x556: u1 = undefined;
    subborrowxU64(&x555, &x556, 0x0, x542, 0xffffffffffffffff);
    var x557: u64 = undefined;
    var x558: u1 = undefined;
    subborrowxU64(&x557, &x558, x556, x544, 0xffffffffffffffff);
    var x559: u64 = undefined;
    var x560: u1 = undefined;
    subborrowxU64(&x559, &x560, x558, x546, 0xffffffffffffffff);
    var x561: u64 = undefined;
    var x562: u1 = undefined;
    subborrowxU64(&x561, &x562, x560, x548, 0xfdc1767ae2ffffff);
    var x563: u64 = undefined;
    var x564: u1 = undefined;
    subborrowxU64(&x563, &x564, x562, x550, 0x7bc65c783158aea3);
    var x565: u64 = undefined;
    var x566: u1 = undefined;
    subborrowxU64(&x565, &x566, x564, x552, 0x6cfc5fd681c52056);
    var x567: u64 = undefined;
    var x568: u1 = undefined;
    subborrowxU64(&x567, &x568, x566, x554, 0x2341f27177344);
    var x569: u64 = undefined;
    var x570: u1 = undefined;
    subborrowxU64(&x569, &x570, x568, cast(u64, 0x0), cast(u64, 0x0));
    var x571: u64 = undefined;
    cmovznzU64(&x571, x570, x555, x542);
    var x572: u64 = undefined;
    cmovznzU64(&x572, x570, x557, x544);
    var x573: u64 = undefined;
    cmovznzU64(&x573, x570, x559, x546);
    var x574: u64 = undefined;
    cmovznzU64(&x574, x570, x561, x548);
    var x575: u64 = undefined;
    cmovznzU64(&x575, x570, x563, x550);
    var x576: u64 = undefined;
    cmovznzU64(&x576, x570, x565, x552);
    var x577: u64 = undefined;
    cmovznzU64(&x577, x570, x567, x554);
    out1[0] = x571;
    out1[1] = x572;
    out1[2] = x573;
    out1[3] = x574;
    out1[4] = x575;
    out1[5] = x576;
    out1[6] = x577;
}

/// The function nonzero outputs a single non-zero word if the input is non-zero and zero otherwise.
///
/// Preconditions:
///   0 ≤ eval arg1 < m
/// Postconditions:
///   out1 = 0 ↔ eval (from_montgomery arg1) mod m = 0
///
/// Input Bounds:
///   arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
/// Output Bounds:
///   out1: [0x0 ~> 0xffffffffffffffff]
pub fn nonzero(out1: *u64, arg1: [7]u64) void {
    @setRuntimeSafety(mode == .Debug);

    const x1 = ((arg1[0]) | ((arg1[1]) | ((arg1[2]) | ((arg1[3]) | ((arg1[4]) | ((arg1[5]) | (arg1[6])))))));
    out1.* = x1;
}

/// The function selectznz is a multi-limb conditional select.
///
/// Postconditions:
///   out1 = (if arg1 = 0 then arg2 else arg3)
///
/// Input Bounds:
///   arg1: [0x0 ~> 0x1]
///   arg2: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
///   arg3: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
/// Output Bounds:
///   out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
pub fn selectznz(out1: *[7]u64, arg1: u1, arg2: [7]u64, arg3: [7]u64) void {
    @setRuntimeSafety(mode == .Debug);

    var x1: u64 = undefined;
    cmovznzU64(&x1, arg1, (arg2[0]), (arg3[0]));
    var x2: u64 = undefined;
    cmovznzU64(&x2, arg1, (arg2[1]), (arg3[1]));
    var x3: u64 = undefined;
    cmovznzU64(&x3, arg1, (arg2[2]), (arg3[2]));
    var x4: u64 = undefined;
    cmovznzU64(&x4, arg1, (arg2[3]), (arg3[3]));
    var x5: u64 = undefined;
    cmovznzU64(&x5, arg1, (arg2[4]), (arg3[4]));
    var x6: u64 = undefined;
    cmovznzU64(&x6, arg1, (arg2[5]), (arg3[5]));
    var x7: u64 = undefined;
    cmovznzU64(&x7, arg1, (arg2[6]), (arg3[6]));
    out1[0] = x1;
    out1[1] = x2;
    out1[2] = x3;
    out1[3] = x4;
    out1[4] = x5;
    out1[5] = x6;
    out1[6] = x7;
}

/// The function toBytes serializes a field element NOT in the Montgomery domain to bytes in little-endian order.
///
/// Preconditions:
///   0 ≤ eval arg1 < m
/// Postconditions:
///   out1 = map (λ x, ⌊((eval arg1 mod m) mod 2^(8 * (x + 1))) / 2^(8 * x)⌋) [0..54]
///
/// Input Bounds:
///   arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0x3ffffffffffff]]
/// Output Bounds:
///   out1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0x3]]
pub fn toBytes(out1: *[55]u8, arg1: [7]u64) void {
    @setRuntimeSafety(mode == .Debug);

    const x1 = (arg1[6]);
    const x2 = (arg1[5]);
    const x3 = (arg1[4]);
    const x4 = (arg1[3]);
    const x5 = (arg1[2]);
    const x6 = (arg1[1]);
    const x7 = (arg1[0]);
    const x8 = cast(u8, (x7 & cast(u64, 0xff)));
    const x9 = (x7 >> 8);
    const x10 = cast(u8, (x9 & cast(u64, 0xff)));
    const x11 = (x9 >> 8);
    const x12 = cast(u8, (x11 & cast(u64, 0xff)));
    const x13 = (x11 >> 8);
    const x14 = cast(u8, (x13 & cast(u64, 0xff)));
    const x15 = (x13 >> 8);
    const x16 = cast(u8, (x15 & cast(u64, 0xff)));
    const x17 = (x15 >> 8);
    const x18 = cast(u8, (x17 & cast(u64, 0xff)));
    const x19 = (x17 >> 8);
    const x20 = cast(u8, (x19 & cast(u64, 0xff)));
    const x21 = cast(u8, (x19 >> 8));
    const x22 = cast(u8, (x6 & cast(u64, 0xff)));
    const x23 = (x6 >> 8);
    const x24 = cast(u8, (x23 & cast(u64, 0xff)));
    const x25 = (x23 >> 8);
    const x26 = cast(u8, (x25 & cast(u64, 0xff)));
    const x27 = (x25 >> 8);
    const x28 = cast(u8, (x27 & cast(u64, 0xff)));
    const x29 = (x27 >> 8);
    const x30 = cast(u8, (x29 & cast(u64, 0xff)));
    const x31 = (x29 >> 8);
    const x32 = cast(u8, (x31 & cast(u64, 0xff)));
    const x33 = (x31 >> 8);
    const x34 = cast(u8, (x33 & cast(u64, 0xff)));
    const x35 = cast(u8, (x33 >> 8));
    const x36 = cast(u8, (x5 & cast(u64, 0xff)));
    const x37 = (x5 >> 8);
    const x38 = cast(u8, (x37 & cast(u64, 0xff)));
    const x39 = (x37 >> 8);
    const x40 = cast(u8, (x39 & cast(u64, 0xff)));
    const x41 = (x39 >> 8);
    const x42 = cast(u8, (x41 & cast(u64, 0xff)));
    const x43 = (x41 >> 8);
    const x44 = cast(u8, (x43 & cast(u64, 0xff)));
    const x45 = (x43 >> 8);
    const x46 = cast(u8, (x45 & cast(u64, 0xff)));
    const x47 = (x45 >> 8);
    const x48 = cast(u8, (x47 & cast(u64, 0xff)));
    const x49 = cast(u8, (x47 >> 8));
    const x50 = cast(u8, (x4 & cast(u64, 0xff)));
    const x51 = (x4 >> 8);
    const x52 = cast(u8, (x51 & cast(u64, 0xff)));
    const x53 = (x51 >> 8);
    const x54 = cast(u8, (x53 & cast(u64, 0xff)));
    const x55 = (x53 >> 8);
    const x56 = cast(u8, (x55 & cast(u64, 0xff)));
    const x57 = (x55 >> 8);
    const x58 = cast(u8, (x57 & cast(u64, 0xff)));
    const x59 = (x57 >> 8);
    const x60 = cast(u8, (x59 & cast(u64, 0xff)));
    const x61 = (x59 >> 8);
    const x62 = cast(u8, (x61 & cast(u64, 0xff)));
    const x63 = cast(u8, (x61 >> 8));
    const x64 = cast(u8, (x3 & cast(u64, 0xff)));
    const x65 = (x3 >> 8);
    const x66 = cast(u8, (x65 & cast(u64, 0xff)));
    const x67 = (x65 >> 8);
    const x68 = cast(u8, (x67 & cast(u64, 0xff)));
    const x69 = (x67 >> 8);
    const x70 = cast(u8, (x69 & cast(u64, 0xff)));
    const x71 = (x69 >> 8);
    const x72 = cast(u8, (x71 & cast(u64, 0xff)));
    const x73 = (x71 >> 8);
    const x74 = cast(u8, (x73 & cast(u64, 0xff)));
    const x75 = (x73 >> 8);
    const x76 = cast(u8, (x75 & cast(u64, 0xff)));
    const x77 = cast(u8, (x75 >> 8));
    const x78 = cast(u8, (x2 & cast(u64, 0xff)));
    const x79 = (x2 >> 8);
    const x80 = cast(u8, (x79 & cast(u64, 0xff)));
    const x81 = (x79 >> 8);
    const x82 = cast(u8, (x81 & cast(u64, 0xff)));
    const x83 = (x81 >> 8);
    const x84 = cast(u8, (x83 & cast(u64, 0xff)));
    const x85 = (x83 >> 8);
    const x86 = cast(u8, (x85 & cast(u64, 0xff)));
    const x87 = (x85 >> 8);
    const x88 = cast(u8, (x87 & cast(u64, 0xff)));
    const x89 = (x87 >> 8);
    const x90 = cast(u8, (x89 & cast(u64, 0xff)));
    const x91 = cast(u8, (x89 >> 8));
    const x92 = cast(u8, (x1 & cast(u64, 0xff)));
    const x93 = (x1 >> 8);
    const x94 = cast(u8, (x93 & cast(u64, 0xff)));
    const x95 = (x93 >> 8);
    const x96 = cast(u8, (x95 & cast(u64, 0xff)));
    const x97 = (x95 >> 8);
    const x98 = cast(u8, (x97 & cast(u64, 0xff)));
    const x99 = (x97 >> 8);
    const x100 = cast(u8, (x99 & cast(u64, 0xff)));
    const x101 = (x99 >> 8);
    const x102 = cast(u8, (x101 & cast(u64, 0xff)));
    const x103 = cast(u8, (x101 >> 8));
    out1[0] = x8;
    out1[1] = x10;
    out1[2] = x12;
    out1[3] = x14;
    out1[4] = x16;
    out1[5] = x18;
    out1[6] = x20;
    out1[7] = x21;
    out1[8] = x22;
    out1[9] = x24;
    out1[10] = x26;
    out1[11] = x28;
    out1[12] = x30;
    out1[13] = x32;
    out1[14] = x34;
    out1[15] = x35;
    out1[16] = x36;
    out1[17] = x38;
    out1[18] = x40;
    out1[19] = x42;
    out1[20] = x44;
    out1[21] = x46;
    out1[22] = x48;
    out1[23] = x49;
    out1[24] = x50;
    out1[25] = x52;
    out1[26] = x54;
    out1[27] = x56;
    out1[28] = x58;
    out1[29] = x60;
    out1[30] = x62;
    out1[31] = x63;
    out1[32] = x64;
    out1[33] = x66;
    out1[34] = x68;
    out1[35] = x70;
    out1[36] = x72;
    out1[37] = x74;
    out1[38] = x76;
    out1[39] = x77;
    out1[40] = x78;
    out1[41] = x80;
    out1[42] = x82;
    out1[43] = x84;
    out1[44] = x86;
    out1[45] = x88;
    out1[46] = x90;
    out1[47] = x91;
    out1[48] = x92;
    out1[49] = x94;
    out1[50] = x96;
    out1[51] = x98;
    out1[52] = x100;
    out1[53] = x102;
    out1[54] = x103;
}

/// The function fromBytes deserializes a field element NOT in the Montgomery domain from bytes in little-endian order.
///
/// Preconditions:
///   0 ≤ bytes_eval arg1 < m
/// Postconditions:
///   eval out1 mod m = bytes_eval arg1 mod m
///   0 ≤ eval out1 < m
///
/// Input Bounds:
///   arg1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0x3]]
/// Output Bounds:
///   out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0x3ffffffffffff]]
pub fn fromBytes(out1: *[7]u64, arg1: [55]u8) void {
    @setRuntimeSafety(mode == .Debug);

    const x1 = (cast(u64, (arg1[54])) << 48);
    const x2 = (cast(u64, (arg1[53])) << 40);
    const x3 = (cast(u64, (arg1[52])) << 32);
    const x4 = (cast(u64, (arg1[51])) << 24);
    const x5 = (cast(u64, (arg1[50])) << 16);
    const x6 = (cast(u64, (arg1[49])) << 8);
    const x7 = (arg1[48]);
    const x8 = (cast(u64, (arg1[47])) << 56);
    const x9 = (cast(u64, (arg1[46])) << 48);
    const x10 = (cast(u64, (arg1[45])) << 40);
    const x11 = (cast(u64, (arg1[44])) << 32);
    const x12 = (cast(u64, (arg1[43])) << 24);
    const x13 = (cast(u64, (arg1[42])) << 16);
    const x14 = (cast(u64, (arg1[41])) << 8);
    const x15 = (arg1[40]);
    const x16 = (cast(u64, (arg1[39])) << 56);
    const x17 = (cast(u64, (arg1[38])) << 48);
    const x18 = (cast(u64, (arg1[37])) << 40);
    const x19 = (cast(u64, (arg1[36])) << 32);
    const x20 = (cast(u64, (arg1[35])) << 24);
    const x21 = (cast(u64, (arg1[34])) << 16);
    const x22 = (cast(u64, (arg1[33])) << 8);
    const x23 = (arg1[32]);
    const x24 = (cast(u64, (arg1[31])) << 56);
    const x25 = (cast(u64, (arg1[30])) << 48);
    const x26 = (cast(u64, (arg1[29])) << 40);
    const x27 = (cast(u64, (arg1[28])) << 32);
    const x28 = (cast(u64, (arg1[27])) << 24);
    const x29 = (cast(u64, (arg1[26])) << 16);
    const x30 = (cast(u64, (arg1[25])) << 8);
    const x31 = (arg1[24]);
    const x32 = (cast(u64, (arg1[23])) << 56);
    const x33 = (cast(u64, (arg1[22])) << 48);
    const x34 = (cast(u64, (arg1[21])) << 40);
    const x35 = (cast(u64, (arg1[20])) << 32);
    const x36 = (cast(u64, (arg1[19])) << 24);
    const x37 = (cast(u64, (arg1[18])) << 16);
    const x38 = (cast(u64, (arg1[17])) << 8);
    const x39 = (arg1[16]);
    const x40 = (cast(u64, (arg1[15])) << 56);
    const x41 = (cast(u64, (arg1[14])) << 48);
    const x42 = (cast(u64, (arg1[13])) << 40);
    const x43 = (cast(u64, (arg1[12])) << 32);
    const x44 = (cast(u64, (arg1[11])) << 24);
    const x45 = (cast(u64, (arg1[10])) << 16);
    const x46 = (cast(u64, (arg1[9])) << 8);
    const x47 = (arg1[8]);
    const x48 = (cast(u64, (arg1[7])) << 56);
    const x49 = (cast(u64, (arg1[6])) << 48);
    const x50 = (cast(u64, (arg1[5])) << 40);
    const x51 = (cast(u64, (arg1[4])) << 32);
    const x52 = (cast(u64, (arg1[3])) << 24);
    const x53 = (cast(u64, (arg1[2])) << 16);
    const x54 = (cast(u64, (arg1[1])) << 8);
    const x55 = (arg1[0]);
    const x56 = (x54 + cast(u64, x55));
    const x57 = (x53 + x56);
    const x58 = (x52 + x57);
    const x59 = (x51 + x58);
    const x60 = (x50 + x59);
    const x61 = (x49 + x60);
    const x62 = (x48 + x61);
    const x63 = (x46 + cast(u64, x47));
    const x64 = (x45 + x63);
    const x65 = (x44 + x64);
    const x66 = (x43 + x65);
    const x67 = (x42 + x66);
    const x68 = (x41 + x67);
    const x69 = (x40 + x68);
    const x70 = (x38 + cast(u64, x39));
    const x71 = (x37 + x70);
    const x72 = (x36 + x71);
    const x73 = (x35 + x72);
    const x74 = (x34 + x73);
    const x75 = (x33 + x74);
    const x76 = (x32 + x75);
    const x77 = (x30 + cast(u64, x31));
    const x78 = (x29 + x77);
    const x79 = (x28 + x78);
    const x80 = (x27 + x79);
    const x81 = (x26 + x80);
    const x82 = (x25 + x81);
    const x83 = (x24 + x82);
    const x84 = (x22 + cast(u64, x23));
    const x85 = (x21 + x84);
    const x86 = (x20 + x85);
    const x87 = (x19 + x86);
    const x88 = (x18 + x87);
    const x89 = (x17 + x88);
    const x90 = (x16 + x89);
    const x91 = (x14 + cast(u64, x15));
    const x92 = (x13 + x91);
    const x93 = (x12 + x92);
    const x94 = (x11 + x93);
    const x95 = (x10 + x94);
    const x96 = (x9 + x95);
    const x97 = (x8 + x96);
    const x98 = (x6 + cast(u64, x7));
    const x99 = (x5 + x98);
    const x100 = (x4 + x99);
    const x101 = (x3 + x100);
    const x102 = (x2 + x101);
    const x103 = (x1 + x102);
    out1[0] = x62;
    out1[1] = x69;
    out1[2] = x76;
    out1[3] = x83;
    out1[4] = x90;
    out1[5] = x97;
    out1[6] = x103;
}

/// The function setOne returns the field element one in the Montgomery domain.
///
/// Postconditions:
///   eval (from_montgomery out1) mod m = 1 mod m
///   0 ≤ eval out1 < m
///
pub fn setOne(out1: *MontgomeryDomainFieldElement) void {
    @setRuntimeSafety(mode == .Debug);

    out1[0] = 0x742c;
    out1[1] = cast(u64, 0x0);
    out1[2] = cast(u64, 0x0);
    out1[3] = 0xb90ff404fc000000;
    out1[4] = 0xd801a4fb559facd4;
    out1[5] = 0xe93254545f77410c;
    out1[6] = 0xeceea7bd2eda;
}

/// The function msat returns the saturated representation of the prime modulus.
///
/// Postconditions:
///   twos_complement_eval out1 = m
///   0 ≤ eval out1 < m
///
/// Output Bounds:
///   out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
pub fn msat(out1: *[8]u64) void {
    @setRuntimeSafety(mode == .Debug);

    out1[0] = 0xffffffffffffffff;
    out1[1] = 0xffffffffffffffff;
    out1[2] = 0xffffffffffffffff;
    out1[3] = 0xfdc1767ae2ffffff;
    out1[4] = 0x7bc65c783158aea3;
    out1[5] = 0x6cfc5fd681c52056;
    out1[6] = 0x2341f27177344;
    out1[7] = cast(u64, 0x0);
}

/// The function divstep computes a divstep.
///
/// Preconditions:
///   0 ≤ eval arg4 < m
///   0 ≤ eval arg5 < m
/// Postconditions:
///   out1 = (if 0 < arg1 ∧ (twos_complement_eval arg3) is odd then 1 - arg1 else 1 + arg1)
///   twos_complement_eval out2 = (if 0 < arg1 ∧ (twos_complement_eval arg3) is odd then twos_complement_eval arg3 else twos_complement_eval arg2)
///   twos_complement_eval out3 = (if 0 < arg1 ∧ (twos_complement_eval arg3) is odd then ⌊(twos_complement_eval arg3 - twos_complement_eval arg2) / 2⌋ else ⌊(twos_complement_eval arg3 + (twos_complement_eval arg3 mod 2) * twos_complement_eval arg2) / 2⌋)
///   eval (from_montgomery out4) mod m = (if 0 < arg1 ∧ (twos_complement_eval arg3) is odd then (2 * eval (from_montgomery arg5)) mod m else (2 * eval (from_montgomery arg4)) mod m)
///   eval (from_montgomery out5) mod m = (if 0 < arg1 ∧ (twos_complement_eval arg3) is odd then (eval (from_montgomery arg4) - eval (from_montgomery arg4)) mod m else (eval (from_montgomery arg5) + (twos_complement_eval arg3 mod 2) * eval (from_montgomery arg4)) mod m)
///   0 ≤ eval out5 < m
///   0 ≤ eval out5 < m
///   0 ≤ eval out2 < m
///   0 ≤ eval out3 < m
///
/// Input Bounds:
///   arg1: [0x0 ~> 0xffffffffffffffff]
///   arg2: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
///   arg3: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
///   arg4: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
///   arg5: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
/// Output Bounds:
///   out1: [0x0 ~> 0xffffffffffffffff]
///   out2: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
///   out3: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
///   out4: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
///   out5: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
pub fn divstep(out1: *u64, out2: *[8]u64, out3: *[8]u64, out4: *[7]u64, out5: *[7]u64, arg1: u64, arg2: [8]u64, arg3: [8]u64, arg4: [7]u64, arg5: [7]u64) void {
    @setRuntimeSafety(mode == .Debug);

    var x1: u64 = undefined;
    var x2: u1 = undefined;
    addcarryxU64(&x1, &x2, 0x0, (~arg1), cast(u64, 0x1));
    const x3 = (cast(u1, (x1 >> 63)) & cast(u1, ((arg3[0]) & cast(u64, 0x1))));
    var x4: u64 = undefined;
    var x5: u1 = undefined;
    addcarryxU64(&x4, &x5, 0x0, (~arg1), cast(u64, 0x1));
    var x6: u64 = undefined;
    cmovznzU64(&x6, x3, arg1, x4);
    var x7: u64 = undefined;
    cmovznzU64(&x7, x3, (arg2[0]), (arg3[0]));
    var x8: u64 = undefined;
    cmovznzU64(&x8, x3, (arg2[1]), (arg3[1]));
    var x9: u64 = undefined;
    cmovznzU64(&x9, x3, (arg2[2]), (arg3[2]));
    var x10: u64 = undefined;
    cmovznzU64(&x10, x3, (arg2[3]), (arg3[3]));
    var x11: u64 = undefined;
    cmovznzU64(&x11, x3, (arg2[4]), (arg3[4]));
    var x12: u64 = undefined;
    cmovznzU64(&x12, x3, (arg2[5]), (arg3[5]));
    var x13: u64 = undefined;
    cmovznzU64(&x13, x3, (arg2[6]), (arg3[6]));
    var x14: u64 = undefined;
    cmovznzU64(&x14, x3, (arg2[7]), (arg3[7]));
    var x15: u64 = undefined;
    var x16: u1 = undefined;
    addcarryxU64(&x15, &x16, 0x0, cast(u64, 0x1), (~(arg2[0])));
    var x17: u64 = undefined;
    var x18: u1 = undefined;
    addcarryxU64(&x17, &x18, x16, cast(u64, 0x0), (~(arg2[1])));
    var x19: u64 = undefined;
    var x20: u1 = undefined;
    addcarryxU64(&x19, &x20, x18, cast(u64, 0x0), (~(arg2[2])));
    var x21: u64 = undefined;
    var x22: u1 = undefined;
    addcarryxU64(&x21, &x22, x20, cast(u64, 0x0), (~(arg2[3])));
    var x23: u64 = undefined;
    var x24: u1 = undefined;
    addcarryxU64(&x23, &x24, x22, cast(u64, 0x0), (~(arg2[4])));
    var x25: u64 = undefined;
    var x26: u1 = undefined;
    addcarryxU64(&x25, &x26, x24, cast(u64, 0x0), (~(arg2[5])));
    var x27: u64 = undefined;
    var x28: u1 = undefined;
    addcarryxU64(&x27, &x28, x26, cast(u64, 0x0), (~(arg2[6])));
    var x29: u64 = undefined;
    var x30: u1 = undefined;
    addcarryxU64(&x29, &x30, x28, cast(u64, 0x0), (~(arg2[7])));
    var x31: u64 = undefined;
    cmovznzU64(&x31, x3, (arg3[0]), x15);
    var x32: u64 = undefined;
    cmovznzU64(&x32, x3, (arg3[1]), x17);
    var x33: u64 = undefined;
    cmovznzU64(&x33, x3, (arg3[2]), x19);
    var x34: u64 = undefined;
    cmovznzU64(&x34, x3, (arg3[3]), x21);
    var x35: u64 = undefined;
    cmovznzU64(&x35, x3, (arg3[4]), x23);
    var x36: u64 = undefined;
    cmovznzU64(&x36, x3, (arg3[5]), x25);
    var x37: u64 = undefined;
    cmovznzU64(&x37, x3, (arg3[6]), x27);
    var x38: u64 = undefined;
    cmovznzU64(&x38, x3, (arg3[7]), x29);
    var x39: u64 = undefined;
    cmovznzU64(&x39, x3, (arg4[0]), (arg5[0]));
    var x40: u64 = undefined;
    cmovznzU64(&x40, x3, (arg4[1]), (arg5[1]));
    var x41: u64 = undefined;
    cmovznzU64(&x41, x3, (arg4[2]), (arg5[2]));
    var x42: u64 = undefined;
    cmovznzU64(&x42, x3, (arg4[3]), (arg5[3]));
    var x43: u64 = undefined;
    cmovznzU64(&x43, x3, (arg4[4]), (arg5[4]));
    var x44: u64 = undefined;
    cmovznzU64(&x44, x3, (arg4[5]), (arg5[5]));
    var x45: u64 = undefined;
    cmovznzU64(&x45, x3, (arg4[6]), (arg5[6]));
    var x46: u64 = undefined;
    var x47: u1 = undefined;
    addcarryxU64(&x46, &x47, 0x0, x39, x39);
    var x48: u64 = undefined;
    var x49: u1 = undefined;
    addcarryxU64(&x48, &x49, x47, x40, x40);
    var x50: u64 = undefined;
    var x51: u1 = undefined;
    addcarryxU64(&x50, &x51, x49, x41, x41);
    var x52: u64 = undefined;
    var x53: u1 = undefined;
    addcarryxU64(&x52, &x53, x51, x42, x42);
    var x54: u64 = undefined;
    var x55: u1 = undefined;
    addcarryxU64(&x54, &x55, x53, x43, x43);
    var x56: u64 = undefined;
    var x57: u1 = undefined;
    addcarryxU64(&x56, &x57, x55, x44, x44);
    var x58: u64 = undefined;
    var x59: u1 = undefined;
    addcarryxU64(&x58, &x59, x57, x45, x45);
    var x60: u64 = undefined;
    var x61: u1 = undefined;
    subborrowxU64(&x60, &x61, 0x0, x46, 0xffffffffffffffff);
    var x62: u64 = undefined;
    var x63: u1 = undefined;
    subborrowxU64(&x62, &x63, x61, x48, 0xffffffffffffffff);
    var x64: u64 = undefined;
    var x65: u1 = undefined;
    subborrowxU64(&x64, &x65, x63, x50, 0xffffffffffffffff);
    var x66: u64 = undefined;
    var x67: u1 = undefined;
    subborrowxU64(&x66, &x67, x65, x52, 0xfdc1767ae2ffffff);
    var x68: u64 = undefined;
    var x69: u1 = undefined;
    subborrowxU64(&x68, &x69, x67, x54, 0x7bc65c783158aea3);
    var x70: u64 = undefined;
    var x71: u1 = undefined;
    subborrowxU64(&x70, &x71, x69, x56, 0x6cfc5fd681c52056);
    var x72: u64 = undefined;
    var x73: u1 = undefined;
    subborrowxU64(&x72, &x73, x71, x58, 0x2341f27177344);
    var x74: u64 = undefined;
    var x75: u1 = undefined;
    subborrowxU64(&x74, &x75, x73, cast(u64, x59), cast(u64, 0x0));
    const x76 = (arg4[6]);
    const x77 = (arg4[5]);
    const x78 = (arg4[4]);
    const x79 = (arg4[3]);
    const x80 = (arg4[2]);
    const x81 = (arg4[1]);
    const x82 = (arg4[0]);
    var x83: u64 = undefined;
    var x84: u1 = undefined;
    subborrowxU64(&x83, &x84, 0x0, cast(u64, 0x0), x82);
    var x85: u64 = undefined;
    var x86: u1 = undefined;
    subborrowxU64(&x85, &x86, x84, cast(u64, 0x0), x81);
    var x87: u64 = undefined;
    var x88: u1 = undefined;
    subborrowxU64(&x87, &x88, x86, cast(u64, 0x0), x80);
    var x89: u64 = undefined;
    var x90: u1 = undefined;
    subborrowxU64(&x89, &x90, x88, cast(u64, 0x0), x79);
    var x91: u64 = undefined;
    var x92: u1 = undefined;
    subborrowxU64(&x91, &x92, x90, cast(u64, 0x0), x78);
    var x93: u64 = undefined;
    var x94: u1 = undefined;
    subborrowxU64(&x93, &x94, x92, cast(u64, 0x0), x77);
    var x95: u64 = undefined;
    var x96: u1 = undefined;
    subborrowxU64(&x95, &x96, x94, cast(u64, 0x0), x76);
    var x97: u64 = undefined;
    cmovznzU64(&x97, x96, cast(u64, 0x0), 0xffffffffffffffff);
    var x98: u64 = undefined;
    var x99: u1 = undefined;
    addcarryxU64(&x98, &x99, 0x0, x83, x97);
    var x100: u64 = undefined;
    var x101: u1 = undefined;
    addcarryxU64(&x100, &x101, x99, x85, x97);
    var x102: u64 = undefined;
    var x103: u1 = undefined;
    addcarryxU64(&x102, &x103, x101, x87, x97);
    var x104: u64 = undefined;
    var x105: u1 = undefined;
    addcarryxU64(&x104, &x105, x103, x89, (x97 & 0xfdc1767ae2ffffff));
    var x106: u64 = undefined;
    var x107: u1 = undefined;
    addcarryxU64(&x106, &x107, x105, x91, (x97 & 0x7bc65c783158aea3));
    var x108: u64 = undefined;
    var x109: u1 = undefined;
    addcarryxU64(&x108, &x109, x107, x93, (x97 & 0x6cfc5fd681c52056));
    var x110: u64 = undefined;
    var x111: u1 = undefined;
    addcarryxU64(&x110, &x111, x109, x95, (x97 & 0x2341f27177344));
    var x112: u64 = undefined;
    cmovznzU64(&x112, x3, (arg5[0]), x98);
    var x113: u64 = undefined;
    cmovznzU64(&x113, x3, (arg5[1]), x100);
    var x114: u64 = undefined;
    cmovznzU64(&x114, x3, (arg5[2]), x102);
    var x115: u64 = undefined;
    cmovznzU64(&x115, x3, (arg5[3]), x104);
    var x116: u64 = undefined;
    cmovznzU64(&x116, x3, (arg5[4]), x106);
    var x117: u64 = undefined;
    cmovznzU64(&x117, x3, (arg5[5]), x108);
    var x118: u64 = undefined;
    cmovznzU64(&x118, x3, (arg5[6]), x110);
    const x119 = cast(u1, (x31 & cast(u64, 0x1)));
    var x120: u64 = undefined;
    cmovznzU64(&x120, x119, cast(u64, 0x0), x7);
    var x121: u64 = undefined;
    cmovznzU64(&x121, x119, cast(u64, 0x0), x8);
    var x122: u64 = undefined;
    cmovznzU64(&x122, x119, cast(u64, 0x0), x9);
    var x123: u64 = undefined;
    cmovznzU64(&x123, x119, cast(u64, 0x0), x10);
    var x124: u64 = undefined;
    cmovznzU64(&x124, x119, cast(u64, 0x0), x11);
    var x125: u64 = undefined;
    cmovznzU64(&x125, x119, cast(u64, 0x0), x12);
    var x126: u64 = undefined;
    cmovznzU64(&x126, x119, cast(u64, 0x0), x13);
    var x127: u64 = undefined;
    cmovznzU64(&x127, x119, cast(u64, 0x0), x14);
    var x128: u64 = undefined;
    var x129: u1 = undefined;
    addcarryxU64(&x128, &x129, 0x0, x31, x120);
    var x130: u64 = undefined;
    var x131: u1 = undefined;
    addcarryxU64(&x130, &x131, x129, x32, x121);
    var x132: u64 = undefined;
    var x133: u1 = undefined;
    addcarryxU64(&x132, &x133, x131, x33, x122);
    var x134: u64 = undefined;
    var x135: u1 = undefined;
    addcarryxU64(&x134, &x135, x133, x34, x123);
    var x136: u64 = undefined;
    var x137: u1 = undefined;
    addcarryxU64(&x136, &x137, x135, x35, x124);
    var x138: u64 = undefined;
    var x139: u1 = undefined;
    addcarryxU64(&x138, &x139, x137, x36, x125);
    var x140: u64 = undefined;
    var x141: u1 = undefined;
    addcarryxU64(&x140, &x141, x139, x37, x126);
    var x142: u64 = undefined;
    var x143: u1 = undefined;
    addcarryxU64(&x142, &x143, x141, x38, x127);
    var x144: u64 = undefined;
    cmovznzU64(&x144, x119, cast(u64, 0x0), x39);
    var x145: u64 = undefined;
    cmovznzU64(&x145, x119, cast(u64, 0x0), x40);
    var x146: u64 = undefined;
    cmovznzU64(&x146, x119, cast(u64, 0x0), x41);
    var x147: u64 = undefined;
    cmovznzU64(&x147, x119, cast(u64, 0x0), x42);
    var x148: u64 = undefined;
    cmovznzU64(&x148, x119, cast(u64, 0x0), x43);
    var x149: u64 = undefined;
    cmovznzU64(&x149, x119, cast(u64, 0x0), x44);
    var x150: u64 = undefined;
    cmovznzU64(&x150, x119, cast(u64, 0x0), x45);
    var x151: u64 = undefined;
    var x152: u1 = undefined;
    addcarryxU64(&x151, &x152, 0x0, x112, x144);
    var x153: u64 = undefined;
    var x154: u1 = undefined;
    addcarryxU64(&x153, &x154, x152, x113, x145);
    var x155: u64 = undefined;
    var x156: u1 = undefined;
    addcarryxU64(&x155, &x156, x154, x114, x146);
    var x157: u64 = undefined;
    var x158: u1 = undefined;
    addcarryxU64(&x157, &x158, x156, x115, x147);
    var x159: u64 = undefined;
    var x160: u1 = undefined;
    addcarryxU64(&x159, &x160, x158, x116, x148);
    var x161: u64 = undefined;
    var x162: u1 = undefined;
    addcarryxU64(&x161, &x162, x160, x117, x149);
    var x163: u64 = undefined;
    var x164: u1 = undefined;
    addcarryxU64(&x163, &x164, x162, x118, x150);
    var x165: u64 = undefined;
    var x166: u1 = undefined;
    subborrowxU64(&x165, &x166, 0x0, x151, 0xffffffffffffffff);
    var x167: u64 = undefined;
    var x168: u1 = undefined;
    subborrowxU64(&x167, &x168, x166, x153, 0xffffffffffffffff);
    var x169: u64 = undefined;
    var x170: u1 = undefined;
    subborrowxU64(&x169, &x170, x168, x155, 0xffffffffffffffff);
    var x171: u64 = undefined;
    var x172: u1 = undefined;
    subborrowxU64(&x171, &x172, x170, x157, 0xfdc1767ae2ffffff);
    var x173: u64 = undefined;
    var x174: u1 = undefined;
    subborrowxU64(&x173, &x174, x172, x159, 0x7bc65c783158aea3);
    var x175: u64 = undefined;
    var x176: u1 = undefined;
    subborrowxU64(&x175, &x176, x174, x161, 0x6cfc5fd681c52056);
    var x177: u64 = undefined;
    var x178: u1 = undefined;
    subborrowxU64(&x177, &x178, x176, x163, 0x2341f27177344);
    var x179: u64 = undefined;
    var x180: u1 = undefined;
    subborrowxU64(&x179, &x180, x178, cast(u64, x164), cast(u64, 0x0));
    var x181: u64 = undefined;
    var x182: u1 = undefined;
    addcarryxU64(&x181, &x182, 0x0, x6, cast(u64, 0x1));
    const x183 = ((x128 >> 1) | ((x130 << 63) & 0xffffffffffffffff));
    const x184 = ((x130 >> 1) | ((x132 << 63) & 0xffffffffffffffff));
    const x185 = ((x132 >> 1) | ((x134 << 63) & 0xffffffffffffffff));
    const x186 = ((x134 >> 1) | ((x136 << 63) & 0xffffffffffffffff));
    const x187 = ((x136 >> 1) | ((x138 << 63) & 0xffffffffffffffff));
    const x188 = ((x138 >> 1) | ((x140 << 63) & 0xffffffffffffffff));
    const x189 = ((x140 >> 1) | ((x142 << 63) & 0xffffffffffffffff));
    const x190 = ((x142 & 0x8000000000000000) | (x142 >> 1));
    var x191: u64 = undefined;
    cmovznzU64(&x191, x75, x60, x46);
    var x192: u64 = undefined;
    cmovznzU64(&x192, x75, x62, x48);
    var x193: u64 = undefined;
    cmovznzU64(&x193, x75, x64, x50);
    var x194: u64 = undefined;
    cmovznzU64(&x194, x75, x66, x52);
    var x195: u64 = undefined;
    cmovznzU64(&x195, x75, x68, x54);
    var x196: u64 = undefined;
    cmovznzU64(&x196, x75, x70, x56);
    var x197: u64 = undefined;
    cmovznzU64(&x197, x75, x72, x58);
    var x198: u64 = undefined;
    cmovznzU64(&x198, x180, x165, x151);
    var x199: u64 = undefined;
    cmovznzU64(&x199, x180, x167, x153);
    var x200: u64 = undefined;
    cmovznzU64(&x200, x180, x169, x155);
    var x201: u64 = undefined;
    cmovznzU64(&x201, x180, x171, x157);
    var x202: u64 = undefined;
    cmovznzU64(&x202, x180, x173, x159);
    var x203: u64 = undefined;
    cmovznzU64(&x203, x180, x175, x161);
    var x204: u64 = undefined;
    cmovznzU64(&x204, x180, x177, x163);
    out1.* = x181;
    out2[0] = x7;
    out2[1] = x8;
    out2[2] = x9;
    out2[3] = x10;
    out2[4] = x11;
    out2[5] = x12;
    out2[6] = x13;
    out2[7] = x14;
    out3[0] = x183;
    out3[1] = x184;
    out3[2] = x185;
    out3[3] = x186;
    out3[4] = x187;
    out3[5] = x188;
    out3[6] = x189;
    out3[7] = x190;
    out4[0] = x191;
    out4[1] = x192;
    out4[2] = x193;
    out4[3] = x194;
    out4[4] = x195;
    out4[5] = x196;
    out4[6] = x197;
    out5[0] = x198;
    out5[1] = x199;
    out5[2] = x200;
    out5[3] = x201;
    out5[4] = x202;
    out5[5] = x203;
    out5[6] = x204;
}

/// The function divstepPrecomp returns the precomputed value for Bernstein-Yang-inversion (in montgomery form).
///
/// Postconditions:
///   eval (from_montgomery out1) = ⌊(m - 1) / 2⌋^(if ⌊log2 m⌋ + 1 < 46 then ⌊(49 * (⌊log2 m⌋ + 1) + 80) / 17⌋ else ⌊(49 * (⌊log2 m⌋ + 1) + 57) / 17⌋)
///   0 ≤ eval out1 < m
///
/// Output Bounds:
///   out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
pub fn divstepPrecomp(out1: *[7]u64) void {
    @setRuntimeSafety(mode == .Debug);

    out1[0] = 0x9f9776e27e1a2b72;
    out1[1] = 0x28b59f067e2393d0;
    out1[2] = 0xcf316ce1572add54;
    out1[3] = 0x312c8965f9032c2f;
    out1[4] = 0x9d9cab29ad90d34c;
    out1[5] = 0x6e1ddae1d9609ae1;
    out1[6] = 0x6df82285eec6;
}
