// File: /workspace/github_c_makefile_star2_O3/wjmelements[P]evm/src/uint256.c
// Function: mul256
void mul256(const uint256_t *number1, const uint256_t *number2, uint256_t *target) {
    uint128_t top[4];
    uint128_t bottom[4];
    UPPER(top[0]) = 0;
    LOWER(top[0]) = UPPER(UPPER_P(number1));
    UPPER(top[1]) = 0;
    LOWER(top[1]) = LOWER(UPPER_P(number1));
    UPPER(top[2]) = 0;
    LOWER(top[2]) = UPPER(LOWER_P(number1));
    UPPER(top[3]) = 0;
    LOWER(top[3]) = LOWER(LOWER_P(number1));
    UPPER(bottom[0]) = 0;
    LOWER(bottom[0]) = UPPER(UPPER_P(number2));
    UPPER(bottom[1]) = 0;
    LOWER(bottom[1]) = LOWER(UPPER_P(number2));
    UPPER(bottom[2]) = 0;
    LOWER(bottom[2]) = UPPER(LOWER_P(number2));
    UPPER(bottom[3]) = 0;
    LOWER(bottom[3]) = LOWER(LOWER_P(number2));

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

    uint128_t tmp, tmp2, fourth64, third64, second64, first64;
    UPPER(fourth64) = 0;
    LOWER(fourth64) = LOWER(products[3][3]);
    UPPER(tmp) = 0;
    LOWER(tmp) = LOWER(products[3][2]);
    UPPER(tmp2) = 0;
    LOWER(tmp2) = UPPER(products[3][3]);
    add128(&tmp, &tmp2, &third64);
    UPPER(tmp) = 0;
    LOWER(tmp) = LOWER(products[3][1]);
    UPPER(tmp2) = 0;
    LOWER(tmp2) = UPPER(products[3][2]);
    add128(&tmp, &tmp2, &second64);
    UPPER(tmp) = 0;
    LOWER(tmp) = LOWER(products[3][0]);
    UPPER(tmp2) = 0;
    LOWER(tmp2) = UPPER(products[3][1]);
    add128(&tmp, &tmp2, &first64);

    UPPER(tmp) = 0;
    LOWER(tmp) = LOWER(products[2][3]);
    add128(&tmp, &third64, &third64);
    UPPER(tmp) = 0;
    LOWER(tmp) = LOWER(products[2][2]);
    add128(&tmp, &second64, &tmp2);
    UPPER(tmp) = 0;
    LOWER(tmp) = UPPER(products[2][3]);
    add128(&tmp, &tmp2, &second64);
    UPPER(tmp) = 0;
    LOWER(tmp) = LOWER(products[2][1]);
    add128(&tmp, &first64, &tmp2);
    UPPER(tmp) = 0;
    LOWER(tmp) = UPPER(products[2][2]);
    add128(&tmp, &tmp2, &first64);

    UPPER(tmp) = 0;
    LOWER(tmp) = LOWER(products[1][3]);
    add128(&tmp, &second64, &second64);
    UPPER(tmp) = 0;
    LOWER(tmp) = LOWER(products[1][2]);
    add128(&tmp, &first64, &tmp2);
    UPPER(tmp) = 0;
    LOWER(tmp) = UPPER(products[1][3]);
    add128(&tmp, &tmp2, &first64);

    UPPER(tmp) = 0;
    LOWER(tmp) = LOWER(products[0][3]);
    add128(&tmp, &first64, &first64);

    uint256_t target1, target2;
    clear256(&target1);
    UPPER(UPPER(target1)) = LOWER(first64);
    clear256(&target2);
    LOWER(UPPER(target2)) = UPPER(third64);
    UPPER(LOWER(target2)) = LOWER(third64);
    add256(&target1, &target2, target);
    clear256(&target1);
    copy128(&UPPER(target1), &second64);
    add256(&target1, target, &target2);
    clear256(&target1);
    copy128(&LOWER(target1), &fourth64);
    add256(&target1, &target2, target);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdx, 0x8(%rsp)
xorl %eax, %eax
movq %rax, 0x50(%rsp)
movq (%rdi), %rcx
movq %rcx, 0x58(%rsp)
movq %rax, 0x60(%rsp)
movq 0x8(%rdi), %rcx
movq %rcx, 0x68(%rsp)
movq %rax, 0x70(%rsp)
movq 0x10(%rdi), %rcx
movq %rcx, 0x78(%rsp)
movq %rax, 0x80(%rsp)
movq 0x18(%rdi), %rcx
movq %rcx, 0x88(%rsp)
movq %rax, 0x10(%rsp)
movq (%rsi), %rcx
movq %rcx, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movq 0x8(%rsi), %rcx
movq %rcx, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movq 0x10(%rsi), %rcx
movq %rcx, 0x38(%rsp)
movq %rax, 0x40(%rsp)
movq 0x18(%rsi), %rax
movq %rax, 0x48(%rsp)
movl $0x3, %r12d
leaq 0x180(%rsp), %r13
movq %r12, %rax
shlq $0x4, %rax
leaq (%rsp,%rax), %r14
addq $0x10, %r14
movl $0x30, %ebx
movq %r13, %r15
leaq (%rsp,%rbx), %rdi
addq $0x50, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x409f
addq $-0x10, %rbx
addq $-0x40, %r15
cmpq $-0x10, %rbx
jne 0x4265
addq $-0x10, %r13
subq $0x1, %r12
jae 0x424e
movq 0x168(%rsp), %rax
movq 0x170(%rsp), %rdx
leaq (%rax,%rdx), %r13
xorl %ecx, %ecx
addq 0x138(%rsp), %r13
setb %cl
xorl %r12d, %r12d
addq %rdx, %rax
movq 0x178(%rsp), %rdi
movq 0x180(%rsp), %r8
adcq %r12, %rcx
leaq (%rdi,%r8), %rax
xorl %edx, %edx
addq 0x148(%rsp), %rax
movq 0x160(%rsp), %rsi
setb %dl
addq %r8, %rdi
movq 0x188(%rsp), %rdi
movq %rdi, (%rsp)
adcq %r12, %rdx
addq 0x158(%rsp), %rsi
xorl %ebx, %ebx
addq 0x140(%rsp), %r13
setb %bl
addq 0x128(%rsp), %rsi
addq 0x130(%rsp), %rsi
addq 0x108(%rsp), %r13
adcq %rcx, %rbx
addq 0xf8(%rsp), %rsi
addq 0x100(%rsp), %rsi
addq 0xc8(%rsp), %rsi
xorps %xmm0, %xmm0
leaq 0x1b0(%rsp), %r14
movups %xmm0, 0x8(%r14)
movq %r12, 0x18(%r14)
movq %rsi, (%r14)
leaq 0x190(%rsp), %r15
movaps %xmm0, (%r15)
movaps %xmm0, 0x10(%r15)
movq %rdx, 0x8(%r15)
movq %rax, 0x10(%r15)
movq %r14, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %rbp
movq %rbp, %rdx
callq 0x3822
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%r14)
movq %rbx, (%r14)
movq %r13, 0x8(%r14)
movq %r14, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x3822
movq %r12, 0x10(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
movq (%rsp), %rax
movq %rax, 0x18(%r14)
movq %r14, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x3822
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq