// File: /workspace/github_c_makefile_star2_O3/wjmelements[P]evm/tst/evm.c
// Function: test_addmod
void test_addmod() {
    evmInit();

    address_t from = AddressFromHex42("0x4a6f6B9fF1fc974096f9063a45Fd12bD5B928AD1");
    uint64_t gas = 0x18a78;
    val_t value;
    data_t input;

    op_t program[] = {
        PUSH32,
        0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab,
        PUSH32,
        0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73,
        PUSH32,
        0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
        PUSH32,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        PUSH32,
        0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
        DUP3, DUP3, DUP3, ADDMOD, MSIZE, MSTORE,
        DUP4, DUP4, DUP3, ADDMOD, MSIZE, MSTORE,
        DUP2, DUP4, DUP3, ADDMOD, MSIZE, MSTORE,
        DUP4, DUP4, DUP4, ADDMOD, MSIZE, MSTORE,
        DUP5, DUP5, DUP5, ADDMOD, MSIZE, MSTORE,
        DUP3, DUP5, DUP6, ADDMOD, MSIZE, MSTORE,
        DUP3, DUP5, DUP5, ADDMOD, MSIZE, MSTORE,
        MSIZE, PUSH0, RETURN
    };
    input.content = program;
    input.size = sizeof(program);

    op_t expected[] = {
        0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
        0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19,
        0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
        0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6, 0xe6,
        0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73,
    };
    result_t result = txCreate(from, gas, value, input);
    assert(result.gasRemaining == 0);
    assert(result.returnData.size == sizeof(expected));
    assert(memcmp(result.returnData.content, expected, sizeof(expected)) == 0);

    evmFinalize();

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
xorl %eax, %eax
callq 0xca4d
movq $-0x2, %r14
leaq 0x20(%rsp), %r15
leaq 0xf189(%rip), %r12      # 0x14070
movq 0x1910a(%rip), %r13     # 0x1dff8
leaq 0x121e8(%rip), %rbx     # 0x170dd
movzbl 0x4(%r14,%r12), %ecx
leal -0x30(%rcx), %ebp
cmpb $0xa, %bpl
jb 0x4f1c
leal -0x61(%rcx), %eax
cmpb $0x5, %al
ja 0x4f10
addb $-0x57, %cl
jmp 0x4f1a
leal -0x41(%rcx), %eax
cmpb $0x5, %al
ja 0x4f5a
addb $-0x37, %cl
movl %ecx, %ebp
movzbl 0x5(%r14,%r12), %ecx
leal -0x30(%rcx), %eax
cmpb $0xa, %al
jb 0x4f41
leal -0x61(%rcx), %eax
cmpb $0x5, %al
ja 0x4f35
addb $-0x57, %cl
jmp 0x4f3f
leal -0x41(%rcx), %eax
cmpb $0x5, %al
ja 0x4f6f
addb $-0x37, %cl
movl %ecx, %eax
shlb $0x4, %bpl
addb %al, %bpl
movb %bpl, (%r15)
addq $0x2, %r14
incq %r15
cmpq $0x26, %r14
jb 0x4ef5
jmp 0x4f83
movq (%r13), %rdi
movq %rbx, %rsi
movl %ecx, %edx
xorl %eax, %eax
callq 0x30a0
movb $-0x1, %bpl
jmp 0x4f1c
movq (%r13), %rdi
movq %rbx, %rsi
movl %ecx, %edx
xorl %eax, %eax
callq 0x30a0
movb $-0x1, %al
jmp 0x4f41
leaq 0x12b26(%rip), %rsi     # 0x17ab0
leaq 0x80(%rsp), %rbx
movl $0xd2, %edx
movq %rbx, %rdi
callq 0x30b0
movl 0x30(%rsp), %eax
movl %eax, 0x10(%rsp)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x40(%rsp), %r14
leaq 0x34(%rsp), %rdx
movl $0x18a78, %esi          # imm = 0x18A78
movl $0xd2, %ecx
movq %r14, %rdi
movq %rbx, %r8
callq 0xd683
cmpq $0x0, 0x30(%r14)
jne 0x5014
cmpq $0xe0, 0x40(%rsp)
jne 0x5033
movq 0x48(%rsp), %rdi
leaq 0x12ba3(%rip), %rsi     # 0x17b90
movl $0xe0, %edx
callq 0x30d0
testl %eax, %eax
jne 0x5052
xorl %eax, %eax
callq 0xcd49
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf166(%rip), %rdi      # 0x14181
leaq 0xf09a(%rip), %rsi      # 0x140bc
leaq 0xf4dd(%rip), %rcx      # 0x14506
movl $0x21e, %edx            # imm = 0x21E
callq 0x3040
leaq 0xf35b(%rip), %rdi      # 0x14395
leaq 0xf07b(%rip), %rsi      # 0x140bc
leaq 0xf4be(%rip), %rcx      # 0x14506
movl $0x21f, %edx            # imm = 0x21F
callq 0x3040
leaq 0xf377(%rip), %rdi      # 0x143d0
leaq 0xf05c(%rip), %rsi      # 0x140bc
leaq 0xf49f(%rip), %rcx      # 0x14506
movl $0x220, %edx            # imm = 0x220
callq 0x3040