// File: /workspace/github_c_makefile_star2_O1/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
movq %rdx, %rbx
xorl %eax, %eax
movq %rax, 0x40(%rsp)
movq (%rdi), %rcx
movq %rcx, 0x48(%rsp)
movq %rax, 0x50(%rsp)
movq 0x8(%rdi), %rcx
movq %rcx, 0x58(%rsp)
movq %rax, 0x60(%rsp)
movq 0x10(%rdi), %rcx
movq %rcx, 0x68(%rsp)
movq %rax, 0x70(%rsp)
movq 0x18(%rdi), %rcx
movq %rcx, 0x78(%rsp)
movq %rax, (%rsp)
movq (%rsi), %rcx
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movq 0x8(%rsi), %rcx
movq %rcx, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movq 0x10(%rsi), %rcx
movq %rcx, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movq 0x18(%rsi), %rax
movq %rax, 0x38(%rsp)
movl $0x3, %r12d
leaq 0x170(%rsp), %r13
movq %r12, %rax
shlq $0x4, %rax
leaq (%rsp,%rax), %r14
movl $0x30, %ebp
movq %r13, %r15
leaq (%rsp,%rbp), %rdi
addq $0x40, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4132
addq $-0x10, %rbp
addq $-0x40, %r15
cmpq $-0x10, %rbp
jne 0x42eb
addq $-0x10, %r13
subq $0x1, %r12
jae 0x42d8
movq 0x158(%rsp), %rax
movq 0x160(%rsp), %rcx
leaq (%rax,%rcx), %r12
xorl %edx, %edx
addq 0x128(%rsp), %r12
setb %dl
addq %rcx, %rax
movq 0x168(%rsp), %rdi
movq 0x170(%rsp), %r8
adcq $0x0, %rdx
leaq (%rdi,%r8), %rax
xorl %ecx, %ecx
addq 0x138(%rsp), %rax
movq 0x150(%rsp), %rsi
setb %cl
addq %r8, %rdi
movq 0x178(%rsp), %r13
adcq $0x0, %rcx
addq 0x148(%rsp), %rsi
xorl %ebp, %ebp
addq 0x130(%rsp), %r12
setb %bpl
addq 0x118(%rsp), %rsi
addq 0x120(%rsp), %rsi
addq 0xf8(%rsp), %r12
adcq %rdx, %rbp
addq 0xe8(%rsp), %rsi
addq 0xf0(%rsp), %rsi
addq 0xb8(%rsp), %rsi
xorps %xmm0, %xmm0
leaq 0x1a0(%rsp), %r14
movaps %xmm0, (%r14)
movaps %xmm0, 0x10(%r14)
movq %rsi, (%r14)
leaq 0x180(%rsp), %r15
movaps %xmm0, (%r15)
movaps %xmm0, 0x10(%r15)
movq %rcx, 0x8(%r15)
movq %rax, 0x10(%r15)
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x3862
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
movaps %xmm0, 0x10(%r14)
movq %rbp, (%r14)
movq %r12, 0x8(%r14)
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x3862
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
movq %r13, 0x18(%r14)
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x3862
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq