// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
xorl %eax, %eax
callq 0xaa8d
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0x332c
leaq 0x109f1(%rip), %rsi     # 0x14a50
leaq 0x80(%rsp), %r14
movl $0xd2, %edx
movq %r14, %rdi
callq 0x30b0
movl 0x10(%rbx), %eax
movl %eax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
leaq 0x40(%rsp), %rbx
leaq 0x1c(%rsp), %rdx
movl $0x18a78, %esi          # imm = 0x18A78
movl $0xd2, %ecx
movq %rbx, %rdi
movq %r14, %r8
callq 0xb68f
cmpq $0x0, 0x30(%rbx)
jne 0x40df
cmpq $0xe0, 0x40(%rsp)
jne 0x40fe
movq 0x48(%rsp), %rdi
leaq 0x10a71(%rip), %rsi     # 0x14b30
movl $0xe0, %edx
callq 0x30d0
testl %eax, %eax
jne 0x411d
xorl %eax, %eax
callq 0xada8
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r14
retq
leaq 0xd02f(%rip), %rdi      # 0x11115
leaq 0xcf63(%rip), %rsi      # 0x11050
leaq 0xd3a6(%rip), %rcx      # 0x1149a
movl $0x21e, %edx            # imm = 0x21E
callq 0x3040
leaq 0xd224(%rip), %rdi      # 0x11329
leaq 0xcf44(%rip), %rsi      # 0x11050
leaq 0xd387(%rip), %rcx      # 0x1149a
movl $0x21f, %edx            # imm = 0x21F
callq 0x3040
leaq 0xd240(%rip), %rdi      # 0x11364
leaq 0xcf25(%rip), %rsi      # 0x11050
leaq 0xd368(%rip), %rcx      # 0x1149a
movl $0x220, %edx            # imm = 0x220
callq 0x3040