// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x88, %rsp
movabsq $0x1111111111111111, %r14 # imm = 0x1111111111111111
movaps 0x2101(%rip), %xmm0     # 0x5020
leaq 0x40(%rsp), %rdi
movaps %xmm0, (%rdi)
movaps %xmm0, 0x10(%rdi)
leaq 0x20(%rsp), %rsi
movaps %xmm0, (%rsi)
movaps %xmm0, 0x10(%rsi)
movaps 0x20f2(%rip), %xmm0     # 0x5030
leaq 0x60(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
movq %rsp, %rbx
movq %rbx, %rcx
callq 0x4c1a
cmpq %r14, (%rbx)
jne 0x2fcc
cmpq %r14, 0x10(%rsp)
jne 0x2feb
cmpq %r14, 0x8(%rsp)
jne 0x300a
cmpq %r14, 0x18(%rsp)
jne 0x3029
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdi
movq %rsp, %rbx
movq %rdi, %rdx
movq %rbx, %rcx
callq 0x4c1a
cmpq $0x0, (%rbx)
jne 0x3048
cmpq $0x0, 0x10(%rsp)
jne 0x3067
cmpq $0x0, 0x8(%rsp)
jne 0x3086
cmpq $0x0, 0x18(%rsp)
jne 0x30a5
addq $0x88, %rsp
popq %rbx
popq %r14
retq
leaq 0x30d8(%rip), %rdi      # 0x60ab
leaq 0x209d(%rip), %rsi      # 0x5077
leaq 0x30f0(%rip), %rcx      # 0x60d1
movl $0x153, %edx            # imm = 0x153
callq 0x1030
leaq 0x30f2(%rip), %rdi      # 0x60e4
leaq 0x207e(%rip), %rsi      # 0x5077
leaq 0x30d1(%rip), %rcx      # 0x60d1
movl $0x154, %edx            # imm = 0x154
callq 0x1030
leaq 0x30f9(%rip), %rdi      # 0x610a
leaq 0x205f(%rip), %rsi      # 0x5077
leaq 0x30b2(%rip), %rcx      # 0x60d1
movl $0x155, %edx            # imm = 0x155
callq 0x1030
leaq 0x3100(%rip), %rdi      # 0x6130
leaq 0x2040(%rip), %rsi      # 0x5077
leaq 0x3093(%rip), %rcx      # 0x60d1
movl $0x156, %edx            # imm = 0x156
callq 0x1030
leaq 0x3107(%rip), %rdi      # 0x6156
leaq 0x2021(%rip), %rsi      # 0x5077
leaq 0x3074(%rip), %rcx      # 0x60d1
movl $0x159, %edx            # imm = 0x159
callq 0x1030
leaq 0x310e(%rip), %rdi      # 0x617c
leaq 0x2002(%rip), %rsi      # 0x5077
leaq 0x3055(%rip), %rcx      # 0x60d1
movl $0x15a, %edx            # imm = 0x15A
callq 0x1030
leaq 0x3115(%rip), %rdi      # 0x61a2
leaq 0x1fe3(%rip), %rsi      # 0x5077
leaq 0x3036(%rip), %rcx      # 0x60d1
movl $0x15b, %edx            # imm = 0x15B
callq 0x1030
leaq 0x311c(%rip), %rdi      # 0x61c8
leaq 0x1fc4(%rip), %rsi      # 0x5077
leaq 0x3017(%rip), %rcx      # 0x60d1
movl $0x15c, %edx            # imm = 0x15C
callq 0x1030