// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/src/uint256.c
// Function: mul512
void mul512(const uint512_t *number1, const uint512_t *number2, uint512_t *target) {
    uint256_t top[4];
    uint256_t bottom[4];
    clear128(&UPPER(top[0]));
    copy128(&LOWER(top[0]), &UPPER(UPPER_P(number1)));
    clear128(&UPPER(top[1]));
    copy128(&LOWER(top[1]), &LOWER(UPPER_P(number1)));
    clear128(&UPPER(top[2]));
    copy128(&LOWER(top[2]), &UPPER(LOWER_P(number1)));
    clear128(&UPPER(top[3]));
    copy128(&LOWER(top[3]), &LOWER(LOWER_P(number1)));
    clear128(&UPPER(bottom[0]));
    copy128(&LOWER(bottom[0]), &UPPER(UPPER_P(number2)));
    clear128(&UPPER(bottom[1]));
    copy128(&LOWER(bottom[1]), &LOWER(UPPER_P(number2)));
    clear128(&UPPER(bottom[2]));
    copy128(&LOWER(bottom[2]), &UPPER(LOWER_P(number2)));
    clear128(&UPPER(bottom[3]));
    copy128(&LOWER(bottom[3]), &LOWER(LOWER_P(number2)));

    uint256_t products[4][4];
    for (uint8_t y = 4; y --> 0;) {
        for (uint8_t x = 4; x --> 0;) {
            mul256(&top[x], &bottom[y], &products[x][y]);
        }
    }

    uint256_t tmp, tmp2, fourth64, third64, second64, first64;
    clear128(&UPPER(fourth64));
    copy128(&LOWER(fourth64), &LOWER(products[3][3]));
    clear128(&UPPER(tmp));
    copy128(&LOWER(tmp), &LOWER(products[3][2]));
    clear128(&UPPER(tmp2));
    copy128(&LOWER(tmp2), &UPPER(products[3][3]));
    add256(&tmp, &tmp2, &third64);
    clear128(&UPPER(tmp));
    copy128(&LOWER(tmp), &LOWER(products[3][1]));
    clear128(&UPPER(tmp2));
    copy128(&LOWER(tmp2), &UPPER(products[3][2]));
    add256(&tmp, &tmp2, &second64);
    clear128(&UPPER(tmp));
    copy128(&LOWER(tmp), &LOWER(products[3][0]));
    clear128(&UPPER(tmp2));
    copy128(&LOWER(tmp2), &UPPER(products[3][1]));
    add256(&tmp, &tmp2, &first64);

    clear128(&UPPER(tmp));
    copy128(&LOWER(tmp), &LOWER(products[2][3]));
    add256(&tmp, &third64, &third64);
    clear128(&UPPER(tmp));
    copy128(&LOWER(tmp), &LOWER(products[2][2]));
    add256(&tmp, &second64, &tmp2);
    clear128(&UPPER(tmp));
    copy128(&LOWER(tmp), &UPPER(products[2][3]));
    add256(&tmp, &tmp2, &second64);
    clear128(&UPPER(tmp));
    copy128(&LOWER(tmp), &LOWER(products[2][1]));
    add256(&tmp, &first64, &tmp2);
    clear128(&UPPER(tmp));
    copy128(&LOWER(tmp), &UPPER(products[2][2]));
    add256(&tmp, &tmp2, &first64);

    clear128(&UPPER(tmp));
    copy128(&LOWER(tmp), &LOWER(products[1][3]));
    add256(&tmp, &second64, &second64);
    clear128(&UPPER(tmp));
    copy128(&LOWER(tmp), &LOWER(products[1][2]));
    add256(&tmp, &first64, &tmp2);
    clear128(&UPPER(tmp));
    copy128(&LOWER(tmp), &UPPER(products[1][3]));
    add256(&tmp, &tmp2, &first64);

    clear128(&UPPER(tmp));
    copy128(&LOWER(tmp), &LOWER(products[0][3]));
    add256(&tmp, &first64, &first64);

    uint512_t target1, target2;
    clear512(&target1);
    copy128(&UPPER(UPPER(target1)), &LOWER(first64));
    clear512(&target2);
    copy128(&LOWER(UPPER(target2)), &UPPER(third64));
    copy128(&UPPER(LOWER(target2)), &LOWER(third64));
    add512(&target1, &target2, target);
    clear512(&target1);
    copy256(&UPPER(target1), &second64);
    add512(&target1, target, &target2);
    clear512(&target1);
    copy256(&LOWER(target1), &fourth64);
    add512(&target1, &target2, target);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x470, %rsp            # imm = 0x470
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x35c0
leaq -0xa0(%rbp), %rdi
addq $0x10, %rdi
movq -0x8(%rbp), %rsi
callq 0x3510
leaq -0xa0(%rbp), %rdi
addq $0x20, %rdi
callq 0x35c0
leaq -0xa0(%rbp), %rdi
addq $0x20, %rdi
addq $0x10, %rdi
movq -0x8(%rbp), %rsi
addq $0x10, %rsi
callq 0x3510
leaq -0xa0(%rbp), %rdi
addq $0x40, %rdi
callq 0x35c0
leaq -0xa0(%rbp), %rdi
addq $0x40, %rdi
addq $0x10, %rdi
movq -0x8(%rbp), %rsi
addq $0x20, %rsi
callq 0x3510
leaq -0xa0(%rbp), %rdi
addq $0x60, %rdi
callq 0x35c0
leaq -0xa0(%rbp), %rdi
addq $0x60, %rdi
addq $0x10, %rdi
movq -0x8(%rbp), %rsi
addq $0x20, %rsi
addq $0x10, %rsi
callq 0x3510
leaq -0x120(%rbp), %rdi
callq 0x35c0
leaq -0x120(%rbp), %rdi
addq $0x10, %rdi
movq -0x10(%rbp), %rsi
callq 0x3510
leaq -0x120(%rbp), %rdi
addq $0x20, %rdi
callq 0x35c0
leaq -0x120(%rbp), %rdi
addq $0x20, %rdi
addq $0x10, %rdi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
callq 0x3510
leaq -0x120(%rbp), %rdi
addq $0x40, %rdi
callq 0x35c0
leaq -0x120(%rbp), %rdi
addq $0x40, %rdi
addq $0x10, %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
callq 0x3510
leaq -0x120(%rbp), %rdi
addq $0x60, %rdi
callq 0x35c0
leaq -0x120(%rbp), %rdi
addq $0x60, %rdi
addq $0x10, %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
addq $0x10, %rsi
callq 0x3510
movb $0x4, -0x321(%rbp)
movb -0x321(%rbp), %al
movb %al, %cl
addb $-0x1, %cl
movb %cl, -0x321(%rbp)
movzbl %al, %eax
cmpl $0x0, %eax
jle 0x53a0
movb $0x4, -0x322(%rbp)
movb -0x322(%rbp), %al
movb %al, %cl
addb $-0x1, %cl
movb %cl, -0x322(%rbp)
movzbl %al, %eax
cmpl $0x0, %eax
jle 0x539b
movzbl -0x322(%rbp), %eax
leaq -0xa0(%rbp), %rdi
shlq $0x5, %rax
addq %rax, %rdi
movzbl -0x321(%rbp), %eax
leaq -0x120(%rbp), %rsi
shlq $0x5, %rax
addq %rax, %rsi
movzbl -0x322(%rbp), %eax
leaq -0x320(%rbp), %rdx
shlq $0x7, %rax
addq %rax, %rdx
movzbl -0x321(%rbp), %eax
shlq $0x5, %rax
addq %rax, %rdx
callq 0x4cb0
jmp 0x532e
jmp 0x530e
leaq -0x382(%rbp), %rdi
callq 0x35c0
leaq -0x382(%rbp), %rdi
addq $0x10, %rdi
leaq -0x320(%rbp), %rsi
addq $0x180, %rsi            # imm = 0x180
addq $0x60, %rsi
addq $0x10, %rsi
callq 0x3510
leaq -0x342(%rbp), %rdi
callq 0x35c0
leaq -0x342(%rbp), %rdi
addq $0x10, %rdi
leaq -0x320(%rbp), %rsi
addq $0x180, %rsi            # imm = 0x180
addq $0x40, %rsi
addq $0x10, %rsi
callq 0x3510
leaq -0x362(%rbp), %rdi
callq 0x35c0
leaq -0x362(%rbp), %rdi
addq $0x10, %rdi
leaq -0x320(%rbp), %rsi
addq $0x180, %rsi            # imm = 0x180
addq $0x60, %rsi
callq 0x3510
leaq -0x342(%rbp), %rdi
leaq -0x362(%rbp), %rsi
leaq -0x3a2(%rbp), %rdx
callq 0x3c70
leaq -0x342(%rbp), %rdi
callq 0x35c0
leaq -0x342(%rbp), %rdi
addq $0x10, %rdi
leaq -0x320(%rbp), %rsi
addq $0x180, %rsi            # imm = 0x180
addq $0x20, %rsi
addq $0x10, %rsi
callq 0x3510
leaq -0x362(%rbp), %rdi
callq 0x35c0
leaq -0x362(%rbp), %rdi
addq $0x10, %rdi
leaq -0x320(%rbp), %rsi
addq $0x180, %rsi            # imm = 0x180
addq $0x40, %rsi
callq 0x3510
leaq -0x342(%rbp), %rdi
leaq -0x362(%rbp), %rsi
leaq -0x3c2(%rbp), %rdx
callq 0x3c70
leaq -0x342(%rbp), %rdi
callq 0x35c0
leaq -0x342(%rbp), %rdi
addq $0x10, %rdi
leaq -0x320(%rbp), %rsi
addq $0x180, %rsi            # imm = 0x180
addq $0x10, %rsi
callq 0x3510
leaq -0x362(%rbp), %rdi
callq 0x35c0
leaq -0x362(%rbp), %rdi
addq $0x10, %rdi
leaq -0x320(%rbp), %rsi
addq $0x180, %rsi            # imm = 0x180
addq $0x20, %rsi
callq 0x3510
leaq -0x342(%rbp), %rdi
leaq -0x362(%rbp), %rsi
leaq -0x3e2(%rbp), %rdx
callq 0x3c70
leaq -0x342(%rbp), %rdi
callq 0x35c0
leaq -0x342(%rbp), %rdi
addq $0x10, %rdi
leaq -0x320(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
addq $0x60, %rsi
addq $0x10, %rsi
callq 0x3510
leaq -0x342(%rbp), %rdi
leaq -0x3a2(%rbp), %rdx
movq %rdx, %rsi
callq 0x3c70
leaq -0x342(%rbp), %rdi
callq 0x35c0
leaq -0x342(%rbp), %rdi
addq $0x10, %rdi
leaq -0x320(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
addq $0x40, %rsi
addq $0x10, %rsi
callq 0x3510
leaq -0x342(%rbp), %rdi
leaq -0x3c2(%rbp), %rsi
leaq -0x362(%rbp), %rdx
callq 0x3c70
leaq -0x342(%rbp), %rdi
callq 0x35c0
leaq -0x342(%rbp), %rdi
addq $0x10, %rdi
leaq -0x320(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
addq $0x60, %rsi
callq 0x3510
leaq -0x342(%rbp), %rdi
leaq -0x362(%rbp), %rsi
leaq -0x3c2(%rbp), %rdx
callq 0x3c70
leaq -0x342(%rbp), %rdi
callq 0x35c0
leaq -0x342(%rbp), %rdi
addq $0x10, %rdi
leaq -0x320(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
addq $0x20, %rsi
addq $0x10, %rsi
callq 0x3510
leaq -0x342(%rbp), %rdi
leaq -0x3e2(%rbp), %rsi
leaq -0x362(%rbp), %rdx
callq 0x3c70
leaq -0x342(%rbp), %rdi
callq 0x35c0
leaq -0x342(%rbp), %rdi
addq $0x10, %rdi
leaq -0x320(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
addq $0x40, %rsi
callq 0x3510
leaq -0x342(%rbp), %rdi
leaq -0x362(%rbp), %rsi
leaq -0x3e2(%rbp), %rdx
callq 0x3c70
leaq -0x342(%rbp), %rdi
callq 0x35c0
leaq -0x342(%rbp), %rdi
addq $0x10, %rdi
leaq -0x320(%rbp), %rsi
addq $0x80, %rsi
addq $0x60, %rsi
addq $0x10, %rsi
callq 0x3510
leaq -0x342(%rbp), %rdi
leaq -0x3c2(%rbp), %rdx
movq %rdx, %rsi
callq 0x3c70
leaq -0x342(%rbp), %rdi
callq 0x35c0
leaq -0x342(%rbp), %rdi
addq $0x10, %rdi
leaq -0x320(%rbp), %rsi
addq $0x80, %rsi
addq $0x40, %rsi
addq $0x10, %rsi
callq 0x3510
leaq -0x342(%rbp), %rdi
leaq -0x3e2(%rbp), %rsi
leaq -0x362(%rbp), %rdx
callq 0x3c70
leaq -0x342(%rbp), %rdi
callq 0x35c0
leaq -0x342(%rbp), %rdi
addq $0x10, %rdi
leaq -0x320(%rbp), %rsi
addq $0x80, %rsi
addq $0x60, %rsi
callq 0x3510
leaq -0x342(%rbp), %rdi
leaq -0x362(%rbp), %rsi
leaq -0x3e2(%rbp), %rdx
callq 0x3c70
leaq -0x342(%rbp), %rdi
callq 0x35c0
leaq -0x342(%rbp), %rdi
addq $0x10, %rdi
leaq -0x320(%rbp), %rsi
addq $0x60, %rsi
addq $0x10, %rsi
callq 0x3510
leaq -0x342(%rbp), %rdi
leaq -0x3e2(%rbp), %rdx
movq %rdx, %rsi
callq 0x3c70
leaq -0x422(%rbp), %rdi
callq 0x3620
leaq -0x422(%rbp), %rdi
leaq -0x3e2(%rbp), %rsi
addq $0x10, %rsi
callq 0x3510
leaq -0x462(%rbp), %rdi
callq 0x3620
leaq -0x462(%rbp), %rdi
addq $0x10, %rdi
leaq -0x3a2(%rbp), %rsi
callq 0x3510
leaq -0x462(%rbp), %rdi
addq $0x20, %rdi
leaq -0x3a2(%rbp), %rsi
addq $0x10, %rsi
callq 0x3510
movq -0x18(%rbp), %rdx
leaq -0x422(%rbp), %rdi
leaq -0x462(%rbp), %rsi
callq 0x4470
leaq -0x422(%rbp), %rdi
callq 0x3620
leaq -0x422(%rbp), %rdi
leaq -0x3c2(%rbp), %rsi
callq 0x3540
movq -0x18(%rbp), %rsi
leaq -0x422(%rbp), %rdi
leaq -0x462(%rbp), %rdx
callq 0x4470
leaq -0x422(%rbp), %rdi
callq 0x3620
leaq -0x422(%rbp), %rdi
addq $0x20, %rdi
leaq -0x382(%rbp), %rsi
callq 0x3540
movq -0x18(%rbp), %rdx
leaq -0x422(%rbp), %rdi
leaq -0x462(%rbp), %rsi
callq 0x4470
addq $0x470, %rsp            # imm = 0x470
popq %rbp
retq
nopw (%rax,%rax)