// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
movb $0x0, %al
callq 0xcfc0
leaq -0x18(%rbp), %rdi
leaq 0x16b17(%rip), %rsi     # 0x1b004
addq $0x2, %rsi
callq 0x3380
movq $0x18a78, -0x20(%rbp)   # imm = 0x18A78
leaq -0x120(%rbp), %rdi
leaq 0x1a544(%rip), %rsi     # 0x1ea50
movl $0xd2, %edx
callq 0x30c0
leaq -0x120(%rbp), %rax
movq %rax, -0x38(%rbp)
movq $0xd2, -0x40(%rbp)
leaq -0x200(%rbp), %rdi
leaq 0x1a5f9(%rip), %rsi     # 0x1eb30
movl $0xe0, %edx
callq 0x30c0
movq -0x20(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %r8
leaq -0x240(%rbp), %rdi
leaq -0x18(%rbp), %rax
movq (%rax), %r9
movq %r9, (%rsp)
movq 0x8(%rax), %r9
movq %r9, 0x8(%rsp)
movl 0x10(%rax), %eax
movl %eax, 0x10(%rsp)
callq 0xe270
cmpq $0x0, -0x210(%rbp)
jne 0x4584
jmp 0x45a3
leaq 0x16b8a(%rip), %rdi     # 0x1b115
leaq 0x16abe(%rip), %rsi     # 0x1b050
movl $0x21e, %edx            # imm = 0x21E
leaq 0x16efc(%rip), %rcx     # 0x1b49a
callq 0x3040
cmpq $0xe0, -0x240(%rbp)
jne 0x45b2
jmp 0x45d1
leaq 0x16d70(%rip), %rdi     # 0x1b329
leaq 0x16a90(%rip), %rsi     # 0x1b050
movl $0x21f, %edx            # imm = 0x21F
leaq 0x16ece(%rip), %rcx     # 0x1b49a
callq 0x3040
movq -0x238(%rbp), %rdi
leaq -0x200(%rbp), %rsi
movl $0xe0, %edx
callq 0x3090
cmpl $0x0, %eax
jne 0x45f0
jmp 0x460f
leaq 0x16d6d(%rip), %rdi     # 0x1b364
leaq 0x16a52(%rip), %rsi     # 0x1b050
movl $0x220, %edx            # imm = 0x220
leaq 0x16e90(%rip), %rcx     # 0x1b49a
callq 0x3040
movb $0x0, %al
callq 0xd4d0
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
nop