// 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 p224 '' 32 '2^224 - 2^96 + 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): p224
// machine_wordsize = 32 (from "32")
// requested operations: mul, square, add, sub, opp, from_montgomery, to_montgomery, nonzero, selectznz, to_bytes, from_bytes, one, msat, divstep, divstep_precomp
// m = 0xffffffffffffffffffffffffffffffff000000000000000000000001 (from "2^224 - 2^96 + 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] << 32) + (z[2] << 64) + (z[3] << 96) + (z[4] << 128) + (z[5] << 160) + (z[6] << 192)
//   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)
//   twos_complement_eval z = let x1 := z[0] + (z[1] << 32) + (z[2] << 64) + (z[3] << 96) + (z[4] << 128) + (z[5] << 160) + (z[6] << 192) in
//                            if x1 & (2^224-1) < 2^223 then x1 & (2^224-1) else (x1 & (2^224-1)) - 2^224

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 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]]
pub const MontgomeryDomainFieldElement = [7]u32;

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

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

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

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

    const x1 = ((cast(i64, arg2) - cast(i64, arg1)) - cast(i64, arg3));
    const x2 = cast(i1, (x1 >> 32));
    const x3 = cast(u32, (x1 & cast(i64, 0xffffffff)));
    out1.* = x3;
    out2.* = cast(u1, (cast(i2, 0x0) - cast(i2, x2)));
}

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

    const x1 = (cast(u64, arg1) * cast(u64, arg2));
    const x2 = cast(u32, (x1 & cast(u64, 0xffffffff)));
    const x3 = cast(u32, (x1 >> 32));
    out1.* = x2;
    out2.* = x3;
}

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

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

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

/// 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: u32 = undefined;
    var x2: u1 = undefined;
    addcarryxU32(&x1, &x2, 0x0, (arg1[0]), (arg2[0]));
    var x3: u32 = undefined;
    var x4: u1 = undefined;
    addcarryxU32(&x3, &x4, x2, (arg1[1]), (arg2[1]));
    var x5: u32 = undefined;
    var x6: u1 = undefined;
    addcarryxU32(&x5, &x6, x4, (arg1[2]), (arg2[2]));
    var x7: u32 = undefined;
    var x8: u1 = undefined;
    addcarryxU32(&x7, &x8, x6, (arg1[3]), (arg2[3]));
    var x9: u32 = undefined;
    var x10: u1 = undefined;
    addcarryxU32(&x9, &x10, x8, (arg1[4]), (arg2[4]));
    var x11: u32 = undefined;
    var x12: u1 = undefined;
    addcarryxU32(&x11, &x12, x10, (arg1[5]), (arg2[5]));
    var x13: u32 = undefined;
    var x14: u1 = undefined;
    addcarryxU32(&x13, &x14, x12, (arg1[6]), (arg2[6]));
    var x15: u32 = undefined;
    var x16: u1 = undefined;
    subborrowxU32(&x15, &x16, 0x0, x1, cast(u32, 0x1));
    var x17: u32 = undefined;
    var x18: u1 = undefined;
    subborrowxU32(&x17, &x18, x16, x3, cast(u32, 0x0));
    var x19: u32 = undefined;
    var x20: u1 = undefined;
    subborrowxU32(&x19, &x20, x18, x5, cast(u32, 0x0));
    var x21: u32 = undefined;
    var x22: u1 = undefined;
    subborrowxU32(&x21, &x22, x20, x7, 0xffffffff);
    var x23: u32 = undefined;
    var x24: u1 = undefined;
    subborrowxU32(&x23, &x24, x22, x9, 0xffffffff);
    var x25: u32 = undefined;
    var x26: u1 = undefined;
    subborrowxU32(&x25, &x26, x24, x11, 0xffffffff);
    var x27: u32 = undefined;
    var x28: u1 = undefined;
    subborrowxU32(&x27, &x28, x26, x13, 0xffffffff);
    var x29: u32 = undefined;
    var x30: u1 = undefined;
    subborrowxU32(&x29, &x30, x28, cast(u32, x14), cast(u32, 0x0));
    var x31: u32 = undefined;
    cmovznzU32(&x31, x30, x15, x1);
    var x32: u32 = undefined;
    cmovznzU32(&x32, x30, x17, x3);
    var x33: u32 = undefined;
    cmovznzU32(&x33, x30, x19, x5);
    var x34: u32 = undefined;
    cmovznzU32(&x34, x30, x21, x7);
    var x35: u32 = undefined;
    cmovznzU32(&x35, x30, x23, x9);
    var x36: u32 = undefined;
    cmovznzU32(&x36, x30, x25, x11);
    var x37: u32 = undefined;
    cmovznzU32(&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: u32 = undefined;
    var x2: u1 = undefined;
    subborrowxU32(&x1, &x2, 0x0, (arg1[0]), (arg2[0]));
    var x3: u32 = undefined;
    var x4: u1 = undefined;
    subborrowxU32(&x3, &x4, x2, (arg1[1]), (arg2[1]));
    var x5: u32 = undefined;
    var x6: u1 = undefined;
    subborrowxU32(&x5, &x6, x4, (arg1[2]), (arg2[2]));
    var x7: u32 = undefined;
    var x8: u1 = undefined;
    subborrowxU32(&x7, &x8, x6, (arg1[3]), (arg2[3]));
    var x9: u32 = undefined;
    var x10: u1 = undefined;
    subborrowxU32(&x9, &x10, x8, (arg1[4]), (arg2[4]));
    var x11: u32 = undefined;
    var x12: u1 = undefined;
    subborrowxU32(&x11, &x12, x10, (arg1[5]), (arg2[5]));
    var x13: u32 = undefined;
    var x14: u1 = undefined;
    subborrowxU32(&x13, &x14, x12, (arg1[6]), (arg2[6]));
    var x15: u32 = undefined;
    cmovznzU32(&x15, x14, cast(u32, 0x0), 0xffffffff);
    var x16: u32 = undefined;
    var x17: u1 = undefined;
    addcarryxU32(&x16, &x17, 0x0, x1, cast(u32, cast(u1, (x15 & cast(u32, 0x1)))));
    var x18: u32 = undefined;
    var x19: u1 = undefined;
    addcarryxU32(&x18, &x19, x17, x3, cast(u32, 0x0));
    var x20: u32 = undefined;
    var x21: u1 = undefined;
    addcarryxU32(&x20, &x21, x19, x5, cast(u32, 0x0));
    var x22: u32 = undefined;
    var x23: u1 = undefined;
    addcarryxU32(&x22, &x23, x21, x7, x15);
    var x24: u32 = undefined;
    var x25: u1 = undefined;
    addcarryxU32(&x24, &x25, x23, x9, x15);
    var x26: u32 = undefined;
    var x27: u1 = undefined;
    addcarryxU32(&x26, &x27, x25, x11, x15);
    var x28: u32 = undefined;
    var x29: u1 = undefined;
    addcarryxU32(&x28, &x29, x27, x13, x15);
    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: u32 = undefined;
    var x2: u1 = undefined;
    subborrowxU32(&x1, &x2, 0x0, cast(u32, 0x0), (arg1[0]));
    var x3: u32 = undefined;
    var x4: u1 = undefined;
    subborrowxU32(&x3, &x4, x2, cast(u32, 0x0), (arg1[1]));
    var x5: u32 = undefined;
    var x6: u1 = undefined;
    subborrowxU32(&x5, &x6, x4, cast(u32, 0x0), (arg1[2]));
    var x7: u32 = undefined;
    var x8: u1 = undefined;
    subborrowxU32(&x7, &x8, x6, cast(u32, 0x0), (arg1[3]));
    var x9: u32 = undefined;
    var x10: u1 = undefined;
    subborrowxU32(&x9, &x10, x8, cast(u32, 0x0), (arg1[4]));
    var x11: u32 = undefined;
    var x12: u1 = undefined;
    subborrowxU32(&x11, &x12, x10, cast(u32, 0x0), (arg1[5]));
    var x13: u32 = undefined;
    var x14: u1 = undefined;
    subborrowxU32(&x13, &x14, x12, cast(u32, 0x0), (arg1[6]));
    var x15: u32 = undefined;
    cmovznzU32(&x15, x14, cast(u32, 0x0), 0xffffffff);
    var x16: u32 = undefined;
    var x17: u1 = undefined;
    addcarryxU32(&x16, &x17, 0x0, x1, cast(u32, cast(u1, (x15 & cast(u32, 0x1)))));
    var x18: u32 = undefined;
    var x19: u1 = undefined;
    addcarryxU32(&x18, &x19, x17, x3, cast(u32, 0x0));
    var x20: u32 = undefined;
    var x21: u1 = undefined;
    addcarryxU32(&x20, &x21, x19, x5, cast(u32, 0x0));
    var x22: u32 = undefined;
    var x23: u1 = undefined;
    addcarryxU32(&x22, &x23, x21, x7, x15);
    var x24: u32 = undefined;
    var x25: u1 = undefined;
    addcarryxU32(&x24, &x25, x23, x9, x15);
    var x26: u32 = undefined;
    var x27: u1 = undefined;
    addcarryxU32(&x26, &x27, x25, x11, x15);
    var x28: u32 = undefined;
    var x29: u1 = undefined;
    addcarryxU32(&x28, &x29, x27, x13, x15);
    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^32)⁻¹ 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: u32 = undefined;
    var x3: u32 = undefined;
    mulxU32(&x2, &x3, x1, 0xffffffff);
    var x4: u32 = undefined;
    var x5: u32 = undefined;
    mulxU32(&x4, &x5, x2, 0xffffffff);
    var x6: u32 = undefined;
    var x7: u32 = undefined;
    mulxU32(&x6, &x7, x2, 0xffffffff);
    var x8: u32 = undefined;
    var x9: u32 = undefined;
    mulxU32(&x8, &x9, x2, 0xffffffff);
    var x10: u32 = undefined;
    var x11: u32 = undefined;
    mulxU32(&x10, &x11, x2, 0xffffffff);
    var x12: u32 = undefined;
    var x13: u1 = undefined;
    addcarryxU32(&x12, &x13, 0x0, x11, x8);
    var x14: u32 = undefined;
    var x15: u1 = undefined;
    addcarryxU32(&x14, &x15, x13, x9, x6);
    var x16: u32 = undefined;
    var x17: u1 = undefined;
    addcarryxU32(&x16, &x17, x15, x7, x4);
    var x18: u32 = undefined;
    var x19: u1 = undefined;
    addcarryxU32(&x18, &x19, 0x0, x1, x2);
    var x20: u32 = undefined;
    var x21: u1 = undefined;
    addcarryxU32(&x20, &x21, 0x0, cast(u32, x19), (arg1[1]));
    var x22: u32 = undefined;
    var x23: u32 = undefined;
    mulxU32(&x22, &x23, x20, 0xffffffff);
    var x24: u32 = undefined;
    var x25: u32 = undefined;
    mulxU32(&x24, &x25, x22, 0xffffffff);
    var x26: u32 = undefined;
    var x27: u32 = undefined;
    mulxU32(&x26, &x27, x22, 0xffffffff);
    var x28: u32 = undefined;
    var x29: u32 = undefined;
    mulxU32(&x28, &x29, x22, 0xffffffff);
    var x30: u32 = undefined;
    var x31: u32 = undefined;
    mulxU32(&x30, &x31, x22, 0xffffffff);
    var x32: u32 = undefined;
    var x33: u1 = undefined;
    addcarryxU32(&x32, &x33, 0x0, x31, x28);
    var x34: u32 = undefined;
    var x35: u1 = undefined;
    addcarryxU32(&x34, &x35, x33, x29, x26);
    var x36: u32 = undefined;
    var x37: u1 = undefined;
    addcarryxU32(&x36, &x37, x35, x27, x24);
    var x38: u32 = undefined;
    var x39: u1 = undefined;
    addcarryxU32(&x38, &x39, 0x0, x12, x30);
    var x40: u32 = undefined;
    var x41: u1 = undefined;
    addcarryxU32(&x40, &x41, x39, x14, x32);
    var x42: u32 = undefined;
    var x43: u1 = undefined;
    addcarryxU32(&x42, &x43, x41, x16, x34);
    var x44: u32 = undefined;
    var x45: u1 = undefined;
    addcarryxU32(&x44, &x45, x43, (cast(u32, x17) + x5), x36);
    var x46: u32 = undefined;
    var x47: u1 = undefined;
    addcarryxU32(&x46, &x47, x45, cast(u32, 0x0), (cast(u32, x37) + x25));
    var x48: u32 = undefined;
    var x49: u1 = undefined;
    addcarryxU32(&x48, &x49, 0x0, x20, x22);
    var x50: u32 = undefined;
    var x51: u1 = undefined;
    addcarryxU32(&x50, &x51, 0x0, (cast(u32, x49) + cast(u32, x21)), (arg1[2]));
    var x52: u32 = undefined;
    var x53: u1 = undefined;
    addcarryxU32(&x52, &x53, x51, x10, cast(u32, 0x0));
    var x54: u32 = undefined;
    var x55: u1 = undefined;
    addcarryxU32(&x54, &x55, x53, x38, cast(u32, 0x0));
    var x56: u32 = undefined;
    var x57: u1 = undefined;
    addcarryxU32(&x56, &x57, x55, x40, cast(u32, 0x0));
    var x58: u32 = undefined;
    var x59: u1 = undefined;
    addcarryxU32(&x58, &x59, x57, x42, cast(u32, 0x0));
    var x60: u32 = undefined;
    var x61: u1 = undefined;
    addcarryxU32(&x60, &x61, x59, x44, cast(u32, 0x0));
    var x62: u32 = undefined;
    var x63: u1 = undefined;
    addcarryxU32(&x62, &x63, x61, x46, cast(u32, 0x0));
    var x64: u32 = undefined;
    var x65: u32 = undefined;
    mulxU32(&x64, &x65, x50, 0xffffffff);
    var x66: u32 = undefined;
    var x67: u32 = undefined;
    mulxU32(&x66, &x67, x64, 0xffffffff);
    var x68: u32 = undefined;
    var x69: u32 = undefined;
    mulxU32(&x68, &x69, x64, 0xffffffff);
    var x70: u32 = undefined;
    var x71: u32 = undefined;
    mulxU32(&x70, &x71, x64, 0xffffffff);
    var x72: u32 = undefined;
    var x73: u32 = undefined;
    mulxU32(&x72, &x73, x64, 0xffffffff);
    var x74: u32 = undefined;
    var x75: u1 = undefined;
    addcarryxU32(&x74, &x75, 0x0, x73, x70);
    var x76: u32 = undefined;
    var x77: u1 = undefined;
    addcarryxU32(&x76, &x77, x75, x71, x68);
    var x78: u32 = undefined;
    var x79: u1 = undefined;
    addcarryxU32(&x78, &x79, x77, x69, x66);
    var x80: u32 = undefined;
    var x81: u1 = undefined;
    addcarryxU32(&x80, &x81, 0x0, x50, x64);
    var x82: u32 = undefined;
    var x83: u1 = undefined;
    addcarryxU32(&x82, &x83, x81, x52, cast(u32, 0x0));
    var x84: u32 = undefined;
    var x85: u1 = undefined;
    addcarryxU32(&x84, &x85, x83, x54, cast(u32, 0x0));
    var x86: u32 = undefined;
    var x87: u1 = undefined;
    addcarryxU32(&x86, &x87, x85, x56, x72);
    var x88: u32 = undefined;
    var x89: u1 = undefined;
    addcarryxU32(&x88, &x89, x87, x58, x74);
    var x90: u32 = undefined;
    var x91: u1 = undefined;
    addcarryxU32(&x90, &x91, x89, x60, x76);
    var x92: u32 = undefined;
    var x93: u1 = undefined;
    addcarryxU32(&x92, &x93, x91, x62, x78);
    var x94: u32 = undefined;
    var x95: u1 = undefined;
    addcarryxU32(&x94, &x95, x93, (cast(u32, x63) + cast(u32, x47)), (cast(u32, x79) + x67));
    var x96: u32 = undefined;
    var x97: u1 = undefined;
    addcarryxU32(&x96, &x97, 0x0, x82, (arg1[3]));
    var x98: u32 = undefined;
    var x99: u1 = undefined;
    addcarryxU32(&x98, &x99, x97, x84, cast(u32, 0x0));
    var x100: u32 = undefined;
    var x101: u1 = undefined;
    addcarryxU32(&x100, &x101, x99, x86, cast(u32, 0x0));
    var x102: u32 = undefined;
    var x103: u1 = undefined;
    addcarryxU32(&x102, &x103, x101, x88, cast(u32, 0x0));
    var x104: u32 = undefined;
    var x105: u1 = undefined;
    addcarryxU32(&x104, &x105, x103, x90, cast(u32, 0x0));
    var x106: u32 = undefined;
    var x107: u1 = undefined;
    addcarryxU32(&x106, &x107, x105, x92, cast(u32, 0x0));
    var x108: u32 = undefined;
    var x109: u1 = undefined;
    addcarryxU32(&x108, &x109, x107, x94, cast(u32, 0x0));
    var x110: u32 = undefined;
    var x111: u32 = undefined;
    mulxU32(&x110, &x111, x96, 0xffffffff);
    var x112: u32 = undefined;
    var x113: u32 = undefined;
    mulxU32(&x112, &x113, x110, 0xffffffff);
    var x114: u32 = undefined;
    var x115: u32 = undefined;
    mulxU32(&x114, &x115, x110, 0xffffffff);
    var x116: u32 = undefined;
    var x117: u32 = undefined;
    mulxU32(&x116, &x117, x110, 0xffffffff);
    var x118: u32 = undefined;
    var x119: u32 = undefined;
    mulxU32(&x118, &x119, x110, 0xffffffff);
    var x120: u32 = undefined;
    var x121: u1 = undefined;
    addcarryxU32(&x120, &x121, 0x0, x119, x116);
    var x122: u32 = undefined;
    var x123: u1 = undefined;
    addcarryxU32(&x122, &x123, x121, x117, x114);
    var x124: u32 = undefined;
    var x125: u1 = undefined;
    addcarryxU32(&x124, &x125, x123, x115, x112);
    var x126: u32 = undefined;
    var x127: u1 = undefined;
    addcarryxU32(&x126, &x127, 0x0, x96, x110);
    var x128: u32 = undefined;
    var x129: u1 = undefined;
    addcarryxU32(&x128, &x129, x127, x98, cast(u32, 0x0));
    var x130: u32 = undefined;
    var x131: u1 = undefined;
    addcarryxU32(&x130, &x131, x129, x100, cast(u32, 0x0));
    var x132: u32 = undefined;
    var x133: u1 = undefined;
    addcarryxU32(&x132, &x133, x131, x102, x118);
    var x134: u32 = undefined;
    var x135: u1 = undefined;
    addcarryxU32(&x134, &x135, x133, x104, x120);
    var x136: u32 = undefined;
    var x137: u1 = undefined;
    addcarryxU32(&x136, &x137, x135, x106, x122);
    var x138: u32 = undefined;
    var x139: u1 = undefined;
    addcarryxU32(&x138, &x139, x137, x108, x124);
    var x140: u32 = undefined;
    var x141: u1 = undefined;
    addcarryxU32(&x140, &x141, x139, (cast(u32, x109) + cast(u32, x95)), (cast(u32, x125) + x113));
    var x142: u32 = undefined;
    var x143: u1 = undefined;
    addcarryxU32(&x142, &x143, 0x0, x128, (arg1[4]));
    var x144: u32 = undefined;
    var x145: u1 = undefined;
    addcarryxU32(&x144, &x145, x143, x130, cast(u32, 0x0));
    var x146: u32 = undefined;
    var x147: u1 = undefined;
    addcarryxU32(&x146, &x147, x145, x132, cast(u32, 0x0));
    var x148: u32 = undefined;
    var x149: u1 = undefined;
    addcarryxU32(&x148, &x149, x147, x134, cast(u32, 0x0));
    var x150: u32 = undefined;
    var x151: u1 = undefined;
    addcarryxU32(&x150, &x151, x149, x136, cast(u32, 0x0));
    var x152: u32 = undefined;
    var x153: u1 = undefined;
    addcarryxU32(&x152, &x153, x151, x138, cast(u32, 0x0));
    var x154: u32 = undefined;
    var x155: u1 = undefined;
    addcarryxU32(&x154, &x155, x153, x140, cast(u32, 0x0));
    var x156: u32 = undefined;
    var x157: u32 = undefined;
    mulxU32(&x156, &x157, x142, 0xffffffff);
    var x158: u32 = undefined;
    var x159: u32 = undefined;
    mulxU32(&x158, &x159, x156, 0xffffffff);
    var x160: u32 = undefined;
    var x161: u32 = undefined;
    mulxU32(&x160, &x161, x156, 0xffffffff);
    var x162: u32 = undefined;
    var x163: u32 = undefined;
    mulxU32(&x162, &x163, x156, 0xffffffff);
    var x164: u32 = undefined;
    var x165: u32 = undefined;
    mulxU32(&x164, &x165, x156, 0xffffffff);
    var x166: u32 = undefined;
    var x167: u1 = undefined;
    addcarryxU32(&x166, &x167, 0x0, x165, x162);
    var x168: u32 = undefined;
    var x169: u1 = undefined;
    addcarryxU32(&x168, &x169, x167, x163, x160);
    var x170: u32 = undefined;
    var x171: u1 = undefined;
    addcarryxU32(&x170, &x171, x169, x161, x158);
    var x172: u32 = undefined;
    var x173: u1 = undefined;
    addcarryxU32(&x172, &x173, 0x0, x142, x156);
    var x174: u32 = undefined;
    var x175: u1 = undefined;
    addcarryxU32(&x174, &x175, x173, x144, cast(u32, 0x0));
    var x176: u32 = undefined;
    var x177: u1 = undefined;
    addcarryxU32(&x176, &x177, x175, x146, cast(u32, 0x0));
    var x178: u32 = undefined;
    var x179: u1 = undefined;
    addcarryxU32(&x178, &x179, x177, x148, x164);
    var x180: u32 = undefined;
    var x181: u1 = undefined;
    addcarryxU32(&x180, &x181, x179, x150, x166);
    var x182: u32 = undefined;
    var x183: u1 = undefined;
    addcarryxU32(&x182, &x183, x181, x152, x168);
    var x184: u32 = undefined;
    var x185: u1 = undefined;
    addcarryxU32(&x184, &x185, x183, x154, x170);
    var x186: u32 = undefined;
    var x187: u1 = undefined;
    addcarryxU32(&x186, &x187, x185, (cast(u32, x155) + cast(u32, x141)), (cast(u32, x171) + x159));
    var x188: u32 = undefined;
    var x189: u1 = undefined;
    addcarryxU32(&x188, &x189, 0x0, x174, (arg1[5]));
    var x190: u32 = undefined;
    var x191: u1 = undefined;
    addcarryxU32(&x190, &x191, x189, x176, cast(u32, 0x0));
    var x192: u32 = undefined;
    var x193: u1 = undefined;
    addcarryxU32(&x192, &x193, x191, x178, cast(u32, 0x0));
    var x194: u32 = undefined;
    var x195: u1 = undefined;
    addcarryxU32(&x194, &x195, x193, x180, cast(u32, 0x0));
    var x196: u32 = undefined;
    var x197: u1 = undefined;
    addcarryxU32(&x196, &x197, x195, x182, cast(u32, 0x0));
    var x198: u32 = undefined;
    var x199: u1 = undefined;
    addcarryxU32(&x198, &x199, x197, x184, cast(u32, 0x0));
    var x200: u32 = undefined;
    var x201: u1 = undefined;
    addcarryxU32(&x200, &x201, x199, x186, cast(u32, 0x0));
    var x202: u32 = undefined;
    var x203: u32 = undefined;
    mulxU32(&x202, &x203, x188, 0xffffffff);
    var x204: u32 = undefined;
    var x205: u32 = undefined;
    mulxU32(&x204, &x205, x202, 0xffffffff);
    var x206: u32 = undefined;
    var x207: u32 = undefined;
    mulxU32(&x206, &x207, x202, 0xffffffff);
    var x208: u32 = undefined;
    var x209: u32 = undefined;
    mulxU32(&x208, &x209, x202, 0xffffffff);
    var x210: u32 = undefined;
    var x211: u32 = undefined;
    mulxU32(&x210, &x211, x202, 0xffffffff);
    var x212: u32 = undefined;
    var x213: u1 = undefined;
    addcarryxU32(&x212, &x213, 0x0, x211, x208);
    var x214: u32 = undefined;
    var x215: u1 = undefined;
    addcarryxU32(&x214, &x215, x213, x209, x206);
    var x216: u32 = undefined;
    var x217: u1 = undefined;
    addcarryxU32(&x216, &x217, x215, x207, x204);
    var x218: u32 = undefined;
    var x219: u1 = undefined;
    addcarryxU32(&x218, &x219, 0x0, x188, x202);
    var x220: u32 = undefined;
    var x221: u1 = undefined;
    addcarryxU32(&x220, &x221, x219, x190, cast(u32, 0x0));
    var x222: u32 = undefined;
    var x223: u1 = undefined;
    addcarryxU32(&x222, &x223, x221, x192, cast(u32, 0x0));
    var x224: u32 = undefined;
    var x225: u1 = undefined;
    addcarryxU32(&x224, &x225, x223, x194, x210);
    var x226: u32 = undefined;
    var x227: u1 = undefined;
    addcarryxU32(&x226, &x227, x225, x196, x212);
    var x228: u32 = undefined;
    var x229: u1 = undefined;
    addcarryxU32(&x228, &x229, x227, x198, x214);
    var x230: u32 = undefined;
    var x231: u1 = undefined;
    addcarryxU32(&x230, &x231, x229, x200, x216);
    var x232: u32 = undefined;
    var x233: u1 = undefined;
    addcarryxU32(&x232, &x233, x231, (cast(u32, x201) + cast(u32, x187)), (cast(u32, x217) + x205));
    var x234: u32 = undefined;
    var x235: u1 = undefined;
    addcarryxU32(&x234, &x235, 0x0, x220, (arg1[6]));
    var x236: u32 = undefined;
    var x237: u1 = undefined;
    addcarryxU32(&x236, &x237, x235, x222, cast(u32, 0x0));
    var x238: u32 = undefined;
    var x239: u1 = undefined;
    addcarryxU32(&x238, &x239, x237, x224, cast(u32, 0x0));
    var x240: u32 = undefined;
    var x241: u1 = undefined;
    addcarryxU32(&x240, &x241, x239, x226, cast(u32, 0x0));
    var x242: u32 = undefined;
    var x243: u1 = undefined;
    addcarryxU32(&x242, &x243, x241, x228, cast(u32, 0x0));
    var x244: u32 = undefined;
    var x245: u1 = undefined;
    addcarryxU32(&x244, &x245, x243, x230, cast(u32, 0x0));
    var x246: u32 = undefined;
    var x247: u1 = undefined;
    addcarryxU32(&x246, &x247, x245, x232, cast(u32, 0x0));
    var x248: u32 = undefined;
    var x249: u32 = undefined;
    mulxU32(&x248, &x249, x234, 0xffffffff);
    var x250: u32 = undefined;
    var x251: u32 = undefined;
    mulxU32(&x250, &x251, x248, 0xffffffff);
    var x252: u32 = undefined;
    var x253: u32 = undefined;
    mulxU32(&x252, &x253, x248, 0xffffffff);
    var x254: u32 = undefined;
    var x255: u32 = undefined;
    mulxU32(&x254, &x255, x248, 0xffffffff);
    var x256: u32 = undefined;
    var x257: u32 = undefined;
    mulxU32(&x256, &x257, x248, 0xffffffff);
    var x258: u32 = undefined;
    var x259: u1 = undefined;
    addcarryxU32(&x258, &x259, 0x0, x257, x254);
    var x260: u32 = undefined;
    var x261: u1 = undefined;
    addcarryxU32(&x260, &x261, x259, x255, x252);
    var x262: u32 = undefined;
    var x263: u1 = undefined;
    addcarryxU32(&x262, &x263, x261, x253, x250);
    var x264: u32 = undefined;
    var x265: u1 = undefined;
    addcarryxU32(&x264, &x265, 0x0, x234, x248);
    var x266: u32 = undefined;
    var x267: u1 = undefined;
    addcarryxU32(&x266, &x267, x265, x236, cast(u32, 0x0));
    var x268: u32 = undefined;
    var x269: u1 = undefined;
    addcarryxU32(&x268, &x269, x267, x238, cast(u32, 0x0));
    var x270: u32 = undefined;
    var x271: u1 = undefined;
    addcarryxU32(&x270, &x271, x269, x240, x256);
    var x272: u32 = undefined;
    var x273: u1 = undefined;
    addcarryxU32(&x272, &x273, x271, x242, x258);
    var x274: u32 = undefined;
    var x275: u1 = undefined;
    addcarryxU32(&x274, &x275, x273, x244, x260);
    var x276: u32 = undefined;
    var x277: u1 = undefined;
    addcarryxU32(&x276, &x277, x275, x246, x262);
    var x278: u32 = undefined;
    var x279: u1 = undefined;
    addcarryxU32(&x278, &x279, x277, (cast(u32, x247) + cast(u32, x233)), (cast(u32, x263) + x251));
    var x280: u32 = undefined;
    var x281: u1 = undefined;
    subborrowxU32(&x280, &x281, 0x0, x266, cast(u32, 0x1));
    var x282: u32 = undefined;
    var x283: u1 = undefined;
    subborrowxU32(&x282, &x283, x281, x268, cast(u32, 0x0));
    var x284: u32 = undefined;
    var x285: u1 = undefined;
    subborrowxU32(&x284, &x285, x283, x270, cast(u32, 0x0));
    var x286: u32 = undefined;
    var x287: u1 = undefined;
    subborrowxU32(&x286, &x287, x285, x272, 0xffffffff);
    var x288: u32 = undefined;
    var x289: u1 = undefined;
    subborrowxU32(&x288, &x289, x287, x274, 0xffffffff);
    var x290: u32 = undefined;
    var x291: u1 = undefined;
    subborrowxU32(&x290, &x291, x289, x276, 0xffffffff);
    var x292: u32 = undefined;
    var x293: u1 = undefined;
    subborrowxU32(&x292, &x293, x291, x278, 0xffffffff);
    var x294: u32 = undefined;
    var x295: u1 = undefined;
    subborrowxU32(&x294, &x295, x293, cast(u32, x279), cast(u32, 0x0));
    var x296: u32 = undefined;
    cmovznzU32(&x296, x295, x280, x266);
    var x297: u32 = undefined;
    cmovznzU32(&x297, x295, x282, x268);
    var x298: u32 = undefined;
    cmovznzU32(&x298, x295, x284, x270);
    var x299: u32 = undefined;
    cmovznzU32(&x299, x295, x286, x272);
    var x300: u32 = undefined;
    cmovznzU32(&x300, x295, x288, x274);
    var x301: u32 = undefined;
    cmovznzU32(&x301, x295, x290, x276);
    var x302: u32 = undefined;
    cmovznzU32(&x302, x295, x292, x278);
    out1[0] = x296;
    out1[1] = x297;
    out1[2] = x298;
    out1[3] = x299;
    out1[4] = x300;
    out1[5] = x301;
    out1[6] = x302;
}

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

/// 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 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]]
/// Output Bounds:
///   out1: [0x0 ~> 0xffffffff]
pub fn nonzero(out1: *u32, arg1: [7]u32) 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 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]]
///   arg3: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]]
/// Output Bounds:
///   out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]]
pub fn selectznz(out1: *[7]u32, arg1: u1, arg2: [7]u32, arg3: [7]u32) void {
    @setRuntimeSafety(mode == .Debug);

    var x1: u32 = undefined;
    cmovznzU32(&x1, arg1, (arg2[0]), (arg3[0]));
    var x2: u32 = undefined;
    cmovznzU32(&x2, arg1, (arg2[1]), (arg3[1]));
    var x3: u32 = undefined;
    cmovznzU32(&x3, arg1, (arg2[2]), (arg3[2]));
    var x4: u32 = undefined;
    cmovznzU32(&x4, arg1, (arg2[3]), (arg3[3]));
    var x5: u32 = undefined;
    cmovznzU32(&x5, arg1, (arg2[4]), (arg3[4]));
    var x6: u32 = undefined;
    cmovznzU32(&x6, arg1, (arg2[5]), (arg3[5]));
    var x7: u32 = undefined;
    cmovznzU32(&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..27]
///
/// Input Bounds:
///   arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]]
/// 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]]
pub fn toBytes(out1: *[28]u8, arg1: [7]u32) 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(u32, 0xff)));
    const x9 = (x7 >> 8);
    const x10 = cast(u8, (x9 & cast(u32, 0xff)));
    const x11 = (x9 >> 8);
    const x12 = cast(u8, (x11 & cast(u32, 0xff)));
    const x13 = cast(u8, (x11 >> 8));
    const x14 = cast(u8, (x6 & cast(u32, 0xff)));
    const x15 = (x6 >> 8);
    const x16 = cast(u8, (x15 & cast(u32, 0xff)));
    const x17 = (x15 >> 8);
    const x18 = cast(u8, (x17 & cast(u32, 0xff)));
    const x19 = cast(u8, (x17 >> 8));
    const x20 = cast(u8, (x5 & cast(u32, 0xff)));
    const x21 = (x5 >> 8);
    const x22 = cast(u8, (x21 & cast(u32, 0xff)));
    const x23 = (x21 >> 8);
    const x24 = cast(u8, (x23 & cast(u32, 0xff)));
    const x25 = cast(u8, (x23 >> 8));
    const x26 = cast(u8, (x4 & cast(u32, 0xff)));
    const x27 = (x4 >> 8);
    const x28 = cast(u8, (x27 & cast(u32, 0xff)));
    const x29 = (x27 >> 8);
    const x30 = cast(u8, (x29 & cast(u32, 0xff)));
    const x31 = cast(u8, (x29 >> 8));
    const x32 = cast(u8, (x3 & cast(u32, 0xff)));
    const x33 = (x3 >> 8);
    const x34 = cast(u8, (x33 & cast(u32, 0xff)));
    const x35 = (x33 >> 8);
    const x36 = cast(u8, (x35 & cast(u32, 0xff)));
    const x37 = cast(u8, (x35 >> 8));
    const x38 = cast(u8, (x2 & cast(u32, 0xff)));
    const x39 = (x2 >> 8);
    const x40 = cast(u8, (x39 & cast(u32, 0xff)));
    const x41 = (x39 >> 8);
    const x42 = cast(u8, (x41 & cast(u32, 0xff)));
    const x43 = cast(u8, (x41 >> 8));
    const x44 = cast(u8, (x1 & cast(u32, 0xff)));
    const x45 = (x1 >> 8);
    const x46 = cast(u8, (x45 & cast(u32, 0xff)));
    const x47 = (x45 >> 8);
    const x48 = cast(u8, (x47 & cast(u32, 0xff)));
    const x49 = cast(u8, (x47 >> 8));
    out1[0] = x8;
    out1[1] = x10;
    out1[2] = x12;
    out1[3] = x13;
    out1[4] = x14;
    out1[5] = x16;
    out1[6] = x18;
    out1[7] = x19;
    out1[8] = x20;
    out1[9] = x22;
    out1[10] = x24;
    out1[11] = x25;
    out1[12] = x26;
    out1[13] = x28;
    out1[14] = x30;
    out1[15] = x31;
    out1[16] = x32;
    out1[17] = x34;
    out1[18] = x36;
    out1[19] = x37;
    out1[20] = x38;
    out1[21] = x40;
    out1[22] = x42;
    out1[23] = x43;
    out1[24] = x44;
    out1[25] = x46;
    out1[26] = x48;
    out1[27] = x49;
}

/// 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]]
/// Output Bounds:
///   out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]]
pub fn fromBytes(out1: *[7]u32, arg1: [28]u8) void {
    @setRuntimeSafety(mode == .Debug);

    const x1 = (cast(u32, (arg1[27])) << 24);
    const x2 = (cast(u32, (arg1[26])) << 16);
    const x3 = (cast(u32, (arg1[25])) << 8);
    const x4 = (arg1[24]);
    const x5 = (cast(u32, (arg1[23])) << 24);
    const x6 = (cast(u32, (arg1[22])) << 16);
    const x7 = (cast(u32, (arg1[21])) << 8);
    const x8 = (arg1[20]);
    const x9 = (cast(u32, (arg1[19])) << 24);
    const x10 = (cast(u32, (arg1[18])) << 16);
    const x11 = (cast(u32, (arg1[17])) << 8);
    const x12 = (arg1[16]);
    const x13 = (cast(u32, (arg1[15])) << 24);
    const x14 = (cast(u32, (arg1[14])) << 16);
    const x15 = (cast(u32, (arg1[13])) << 8);
    const x16 = (arg1[12]);
    const x17 = (cast(u32, (arg1[11])) << 24);
    const x18 = (cast(u32, (arg1[10])) << 16);
    const x19 = (cast(u32, (arg1[9])) << 8);
    const x20 = (arg1[8]);
    const x21 = (cast(u32, (arg1[7])) << 24);
    const x22 = (cast(u32, (arg1[6])) << 16);
    const x23 = (cast(u32, (arg1[5])) << 8);
    const x24 = (arg1[4]);
    const x25 = (cast(u32, (arg1[3])) << 24);
    const x26 = (cast(u32, (arg1[2])) << 16);
    const x27 = (cast(u32, (arg1[1])) << 8);
    const x28 = (arg1[0]);
    const x29 = (x27 + cast(u32, x28));
    const x30 = (x26 + x29);
    const x31 = (x25 + x30);
    const x32 = (x23 + cast(u32, x24));
    const x33 = (x22 + x32);
    const x34 = (x21 + x33);
    const x35 = (x19 + cast(u32, x20));
    const x36 = (x18 + x35);
    const x37 = (x17 + x36);
    const x38 = (x15 + cast(u32, x16));
    const x39 = (x14 + x38);
    const x40 = (x13 + x39);
    const x41 = (x11 + cast(u32, x12));
    const x42 = (x10 + x41);
    const x43 = (x9 + x42);
    const x44 = (x7 + cast(u32, x8));
    const x45 = (x6 + x44);
    const x46 = (x5 + x45);
    const x47 = (x3 + cast(u32, x4));
    const x48 = (x2 + x47);
    const x49 = (x1 + x48);
    out1[0] = x31;
    out1[1] = x34;
    out1[2] = x37;
    out1[3] = x40;
    out1[4] = x43;
    out1[5] = x46;
    out1[6] = x49;
}

/// 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] = 0xffffffff;
    out1[1] = 0xffffffff;
    out1[2] = 0xffffffff;
    out1[3] = cast(u32, 0x0);
    out1[4] = cast(u32, 0x0);
    out1[5] = cast(u32, 0x0);
    out1[6] = cast(u32, 0x0);
}

/// 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 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]]
pub fn msat(out1: *[8]u32) void {
    @setRuntimeSafety(mode == .Debug);

    out1[0] = cast(u32, 0x1);
    out1[1] = cast(u32, 0x0);
    out1[2] = cast(u32, 0x0);
    out1[3] = 0xffffffff;
    out1[4] = 0xffffffff;
    out1[5] = 0xffffffff;
    out1[6] = 0xffffffff;
    out1[7] = cast(u32, 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 ~> 0xffffffff]
///   arg2: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]]
///   arg3: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]]
///   arg4: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]]
///   arg5: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]]
/// Output Bounds:
///   out1: [0x0 ~> 0xffffffff]
///   out2: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]]
///   out3: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]]
///   out4: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]]
///   out5: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]]
pub fn divstep(out1: *u32, out2: *[8]u32, out3: *[8]u32, out4: *[7]u32, out5: *[7]u32, arg1: u32, arg2: [8]u32, arg3: [8]u32, arg4: [7]u32, arg5: [7]u32) void {
    @setRuntimeSafety(mode == .Debug);

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

    out1[0] = 0x800000;
    out1[1] = 0x800000;
    out1[2] = 0xfe000000;
    out1[3] = 0xffffff;
    out1[4] = cast(u32, 0x0);
    out1[5] = 0xff800000;
    out1[6] = 0x17fffff;
}
