// File: /workspace/github_c_makefile_star2_O2/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 $0x1c8, %rsp            # imm = 0x1C8
andq $0x0, 0x40(%rsp)
movq (%rdi), %rax
movq %rax, 0x48(%rsp)
andq $0x0, 0x50(%rsp)
movq 0x8(%rdi), %rax
movq %rax, 0x58(%rsp)
andq $0x0, 0x60(%rsp)
movq 0x10(%rdi), %rax
movq %rax, 0x68(%rsp)
andq $0x0, 0x70(%rsp)
movq 0x18(%rdi), %rax
movq %rax, 0x78(%rsp)
andq $0x0, (%rsp)
movq (%rsi), %rax
movq %rax, 0x8(%rsp)
andq $0x0, 0x10(%rsp)
movq %rdx, %rbx
movq 0x8(%rsi), %rax
movq %rax, 0x18(%rsp)
andq $0x0, 0x20(%rsp)
movq 0x10(%rsi), %rax
movq %rax, 0x28(%rsp)
andq $0x0, 0x30(%rsp)
movq 0x18(%rsi), %rax
movq %rax, 0x38(%rsp)
pushq $0x4
popq %r15
pushq $0x3
popq %r12
subq $0x1, %r15
jb 0x4013
movzbl %r15b, %r13d
movl %r13d, %eax
shll $0x4, %eax
leaq (%rsp,%rax), %r14
movq %r12, %rbp
cmpq $-0x1, %rbp
je 0x3fc3
movzbl %bpl, %eax
movl %eax, %ecx
shll $0x4, %ecx
leaq (%rsp,%rcx), %rdi
addq $0x40, %rdi
movl %r13d, %edx
shll $0x4, %edx
shll $0x6, %eax
addq %rsp, %rax
addq $0x80, %rax
addq %rax, %rdx
movq %r14, %rsi
callq 0x3dfc
decq %rbp
jmp 0x3fda
movq 0x150(%rsp), %rax
movq 0x158(%rsp), %rcx
movq 0x160(%rsp), %rdx
leaq (%rcx,%rdx), %r12
xorl %esi, %esi
addq 0x128(%rsp), %r12
setb %sil
addq %rdx, %rcx
movq 0x168(%rsp), %rdi
movq 0x170(%rsp), %r8
adcq $0x0, %rsi
leaq (%rdi,%r8), %rcx
xorl %edx, %edx
addq 0x138(%rsp), %rcx
setb %dl
addq %r8, %rdi
adcq $0x0, %rdx
addq 0x148(%rsp), %rax
xorl %ebp, %ebp
addq 0x130(%rsp), %r12
movq 0x178(%rsp), %r13
setb %bpl
addq 0x118(%rsp), %rax
addq 0x120(%rsp), %rax
addq 0xf8(%rsp), %r12
adcq %rsi, %rbp
addq 0xe8(%rsp), %rax
addq 0xf0(%rsp), %rax
addq 0xb8(%rsp), %rax
leaq 0x1a0(%rsp), %r14
andq $0x0, 0x18(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
movq %rax, (%r14)
leaq 0x180(%rsp), %r15
movaps %xmm0, (%r15)
movaps %xmm0, 0x10(%r15)
movq %rdx, 0x8(%r15)
movq %rcx, 0x10(%r15)
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x36e3
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%r14)
movq %rbp, (%r14)
movq %r12, 0x8(%r14)
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x36e3
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
andq $0x0, 0x10(%r14)
movq %r13, 0x18(%r14)
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x36e3
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq