// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/src/uint256.c
// Function: mul128
void mul128(const uint128_t *number1, const uint128_t *number2, uint128_t *target) {
    uint64_t top[4] = {UPPER_P(number1) >> 32, UPPER_P(number1) & 0xffffffff,
                       LOWER_P(number1) >> 32, LOWER_P(number1) & 0xffffffff};
    uint64_t bottom[4] = {UPPER_P(number2) >> 32, UPPER_P(number2) & 0xffffffff,
                          LOWER_P(number2) >> 32,
                          LOWER_P(number2) & 0xffffffff};
    uint64_t products[4][4];
    uint128_t tmp, tmp2;

    for (uint8_t y = 4; y --> 0;) {
        for (uint8_t x = 4; x --> 0;) {
            products[3 - x][y] = top[x] * bottom[y];
        }
    }

    uint64_t fourth32 = products[0][3] & 0xffffffff;
    uint64_t third32 = (products[0][2] & 0xffffffff) + (products[0][3] >> 32);
    uint64_t second32 = (products[0][1] & 0xffffffff) + (products[0][2] >> 32);
    uint64_t first32 = (products[0][0] & 0xffffffff) + (products[0][1] >> 32);

    third32 += products[1][3] & 0xffffffff;
    second32 += (products[1][2] & 0xffffffff) + (products[1][3] >> 32);
    first32 += (products[1][1] & 0xffffffff) + (products[1][2] >> 32);

    second32 += products[2][3] & 0xffffffff;
    first32 += (products[2][2] & 0xffffffff) + (products[2][3] >> 32);

    first32 += products[3][3] & 0xffffffff;

    UPPER(tmp) = first32 << 32;
    LOWER(tmp) = 0;
    UPPER(tmp2) = third32 >> 32;
    LOWER(tmp2) = third32 << 32;
    add128(&tmp, &tmp2, target);
    UPPER(tmp) = second32;
    LOWER(tmp) = 0;
    add128(&tmp, target, &tmp2);
    UPPER(tmp) = 0;
    LOWER(tmp) = fourth32;
    add128(&tmp, &tmp2, target);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
shrq $0x20, %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rcx
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq (%rcx), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rcx
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq 0x8(%rcx), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
shrq $0x20, %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rcx
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq (%rcx), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rcx
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq 0x8(%rcx), %rax
movq %rax, -0x48(%rbp)
movb $0x4, -0x101(%rbp)
movb -0x101(%rbp), %al
movb %al, %cl
addb $-0x1, %cl
movb %cl, -0x101(%rbp)
movzbl %al, %eax
cmpl $0x0, %eax
jle 0x4a82
movb $0x4, -0x102(%rbp)
movb -0x102(%rbp), %al
movb %al, %cl
addb $-0x1, %cl
movb %cl, -0x102(%rbp)
movzbl %al, %eax
cmpl $0x0, %eax
jle 0x4a80
movzbl -0x102(%rbp), %eax
movq -0x40(%rbp,%rax,8), %rdx
movzbl -0x101(%rbp), %eax
imulq -0x60(%rbp,%rax,8), %rdx
movzbl -0x102(%rbp), %ecx
movl $0x3, %eax
subl %ecx, %eax
movslq %eax, %rcx
leaq -0xe0(%rbp), %rax
shlq $0x5, %rcx
addq %rcx, %rax
movzbl -0x101(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
jmp 0x4a22
jmp 0x4a02
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq -0xc8(%rbp), %rax
movq %rax, -0x110(%rbp)
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq -0xd0(%rbp), %rax
movq -0xc8(%rbp), %rcx
shrq $0x20, %rcx
addq %rcx, %rax
movq %rax, -0x118(%rbp)
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq -0xd8(%rbp), %rax
movq -0xd0(%rbp), %rcx
shrq $0x20, %rcx
addq %rcx, %rax
movq %rax, -0x120(%rbp)
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq -0xe0(%rbp), %rax
movq -0xd8(%rbp), %rcx
shrq $0x20, %rcx
addq %rcx, %rax
movq %rax, -0x128(%rbp)
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq -0xa8(%rbp), %rax
addq -0x118(%rbp), %rax
movq %rax, -0x118(%rbp)
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq -0xb0(%rbp), %rax
movq -0xa8(%rbp), %rcx
shrq $0x20, %rcx
addq %rcx, %rax
addq -0x120(%rbp), %rax
movq %rax, -0x120(%rbp)
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq -0xb8(%rbp), %rax
movq -0xb0(%rbp), %rcx
shrq $0x20, %rcx
addq %rcx, %rax
addq -0x128(%rbp), %rax
movq %rax, -0x128(%rbp)
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq -0x88(%rbp), %rax
addq -0x120(%rbp), %rax
movq %rax, -0x120(%rbp)
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq -0x90(%rbp), %rax
movq -0x88(%rbp), %rcx
shrq $0x20, %rcx
addq %rcx, %rax
addq -0x128(%rbp), %rax
movq %rax, -0x128(%rbp)
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq -0x68(%rbp), %rax
addq -0x128(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0xf0(%rbp)
movq $0x0, -0xe8(%rbp)
movq -0x118(%rbp), %rax
shrq $0x20, %rax
movq %rax, -0x100(%rbp)
movq -0x118(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0xf8(%rbp)
movq -0x18(%rbp), %rdx
leaq -0xf0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x39a0
movq -0x120(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq $0x0, -0xe8(%rbp)
movq -0x18(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
leaq -0x100(%rbp), %rdx
callq 0x39a0
movq $0x0, -0xf0(%rbp)
movq -0x110(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x18(%rbp), %rdx
leaq -0xf0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x39a0
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nop