// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/tst/uint256.c
// Function: test_mulmod
void test_mulmod() {
    uint256_t a, b, c, d;

    UPPER(UPPER(a)) = 0xeeeeeeeeeeeeeeee;
    LOWER(UPPER(a)) = 0xeeeeeeeeeeeeeeee;
    UPPER(LOWER(a)) = 0xeeeeeeeeeeeeeeee;
    LOWER(LOWER(a)) = 0xeeeeeeeeeeeeeeee;
    UPPER(UPPER(b)) = 0xeeeeeeeeeeeeeeee;
    LOWER(UPPER(b)) = 0xeeeeeeeeeeeeeeee;
    UPPER(LOWER(b)) = 0xeeeeeeeeeeeeeeee;
    LOWER(LOWER(b)) = 0xeeeeeeeeeeeeeeee;
    UPPER(UPPER(c)) = 0xdddddddddddddddd;
    LOWER(UPPER(c)) = 0xdddddddddddddddd;
    UPPER(LOWER(c)) = 0xdddddddddddddddd;
    LOWER(LOWER(c)) = 0xdddddddddddddddd;

    mulmod256(&a, &b, &c, &d);
    assert(UPPER(UPPER(d)) == 0x1111111111111111);
    assert(UPPER(LOWER(d)) == 0x1111111111111111);
    assert(LOWER(UPPER(d)) == 0x1111111111111111);
    assert(LOWER(LOWER(d)) == 0x1111111111111111);

    mulmod256(&a, &b, &a, &d);
    assert(UPPER(UPPER(d)) == 0x0000000000000000);
    assert(UPPER(LOWER(d)) == 0x0000000000000000);
    assert(LOWER(UPPER(d)) == 0x0000000000000000);
    assert(LOWER(LOWER(d)) == 0x0000000000000000);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movabsq $-0x1111111111111112, %rax # imm = 0xEEEEEEEEEEEEEEEE
movq %rax, -0x20(%rbp)
movabsq $-0x1111111111111112, %rax # imm = 0xEEEEEEEEEEEEEEEE
movq %rax, -0x18(%rbp)
movabsq $-0x1111111111111112, %rax # imm = 0xEEEEEEEEEEEEEEEE
movq %rax, -0x10(%rbp)
movabsq $-0x1111111111111112, %rax # imm = 0xEEEEEEEEEEEEEEEE
movq %rax, -0x8(%rbp)
movabsq $-0x1111111111111112, %rax # imm = 0xEEEEEEEEEEEEEEEE
movq %rax, -0x40(%rbp)
movabsq $-0x1111111111111112, %rax # imm = 0xEEEEEEEEEEEEEEEE
movq %rax, -0x38(%rbp)
movabsq $-0x1111111111111112, %rax # imm = 0xEEEEEEEEEEEEEEEE
movq %rax, -0x30(%rbp)
movabsq $-0x1111111111111112, %rax # imm = 0xEEEEEEEEEEEEEEEE
movq %rax, -0x28(%rbp)
movabsq $-0x2222222222222223, %rax # imm = 0xDDDDDDDDDDDDDDDD
movq %rax, -0x60(%rbp)
movabsq $-0x2222222222222223, %rax # imm = 0xDDDDDDDDDDDDDDDD
movq %rax, -0x58(%rbp)
movabsq $-0x2222222222222223, %rax # imm = 0xDDDDDDDDDDDDDDDD
movq %rax, -0x50(%rbp)
movabsq $-0x2222222222222223, %rax # imm = 0xDDDDDDDDDDDDDDDD
movq %rax, -0x48(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x60(%rbp), %rdx
leaq -0x80(%rbp), %rcx
callq 0x5fb0
movabsq $0x1111111111111111, %rax # imm = 0x1111111111111111
cmpq %rax, -0x80(%rbp)
jne 0x2fea
jmp 0x3009
leaq 0x507e(%rip), %rdi      # 0x806f
leaq 0x4043(%rip), %rsi      # 0x703b
movl $0x153, %edx            # imm = 0x153
leaq 0x5091(%rip), %rcx      # 0x8095
callq 0x1030
movabsq $0x1111111111111111, %rax # imm = 0x1111111111111111
cmpq %rax, -0x70(%rbp)
jne 0x301b
jmp 0x303a
leaq 0x5086(%rip), %rdi      # 0x80a8
leaq 0x4012(%rip), %rsi      # 0x703b
movl $0x154, %edx            # imm = 0x154
leaq 0x5060(%rip), %rcx      # 0x8095
callq 0x1030
movabsq $0x1111111111111111, %rax # imm = 0x1111111111111111
cmpq %rax, -0x78(%rbp)
jne 0x304c
jmp 0x306b
leaq 0x507b(%rip), %rdi      # 0x80ce
leaq 0x3fe1(%rip), %rsi      # 0x703b
movl $0x155, %edx            # imm = 0x155
leaq 0x502f(%rip), %rcx      # 0x8095
callq 0x1030
movabsq $0x1111111111111111, %rax # imm = 0x1111111111111111
cmpq %rax, -0x68(%rbp)
jne 0x307d
jmp 0x309c
leaq 0x5070(%rip), %rdi      # 0x80f4
leaq 0x3fb0(%rip), %rsi      # 0x703b
movl $0x156, %edx            # imm = 0x156
leaq 0x4ffe(%rip), %rcx      # 0x8095
callq 0x1030
leaq -0x20(%rbp), %rdx
leaq -0x40(%rbp), %rsi
leaq -0x80(%rbp), %rcx
movq %rdx, %rdi
callq 0x5fb0
cmpq $0x0, -0x80(%rbp)
jne 0x30b9
jmp 0x30d8
leaq 0x505a(%rip), %rdi      # 0x811a
leaq 0x3f74(%rip), %rsi      # 0x703b
movl $0x159, %edx            # imm = 0x159
leaq 0x4fc2(%rip), %rcx      # 0x8095
callq 0x1030
cmpq $0x0, -0x70(%rbp)
jne 0x30e1
jmp 0x3100
leaq 0x5058(%rip), %rdi      # 0x8140
leaq 0x3f4c(%rip), %rsi      # 0x703b
movl $0x15a, %edx            # imm = 0x15A
leaq 0x4f9a(%rip), %rcx      # 0x8095
callq 0x1030
cmpq $0x0, -0x78(%rbp)
jne 0x3109
jmp 0x3128
leaq 0x5056(%rip), %rdi      # 0x8166
leaq 0x3f24(%rip), %rsi      # 0x703b
movl $0x15b, %edx            # imm = 0x15B
leaq 0x4f72(%rip), %rcx      # 0x8095
callq 0x1030
cmpq $0x0, -0x68(%rbp)
jne 0x3131
jmp 0x3150
leaq 0x5054(%rip), %rdi      # 0x818c
leaq 0x3efc(%rip), %rsi      # 0x703b
movl $0x15c, %edx            # imm = 0x15C
leaq 0x4f4a(%rip), %rcx      # 0x8095
callq 0x1030
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)