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

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

    op_t program[] = {
        PUSH32,
        0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
        0x10, 0x32, 0x54, 0x76, 0x98, 0xba, 0xdc, 0xfe,
        0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01,
        0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10,
        PUSH0,
        MSTORE,
        PUSH1, 0x20,
        PUSH0,
        RETURN,
    };

    input.size = sizeof(program);
    input.content = program;

    result_t result = txCreate(from, gas, value, input);
    evmFinalize();
    assert(UPPER(UPPER(result.status)) == 0);
    assert(LOWER(UPPER(result.status)) == 0x80d9b122);
    assert(UPPER(LOWER(result.status)) == 0xdc3a16fdc41f96cf);
    assert(LOWER(LOWER(result.status)) == 0x010ffe7e38d227c3);
    assert(result.returnData.size == 32);
    assert(0 == memcmp(result.returnData.content, program + 1, 32));
    assert(result.gasRemaining == 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movb $0x0, %al
callq 0xcfc0
leaq -0x18(%rbp), %rdi
leaq 0x17c07(%rip), %rsi     # 0x1b004
addq $0x2, %rsi
callq 0x3380
movq $0xea8c, -0x20(%rbp)    # imm = 0xEA8C
leaq -0x70(%rbp), %rdi
leaq 0x1ac97(%rip), %rsi     # 0x1e0b0
movl $0x27, %edx
callq 0x30c0
movq $0x27, -0x40(%rbp)
leaq -0x70(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %r8
leaq -0xb0(%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
movb $0x0, %al
callq 0xd4d0
cmpq $0x0, -0xa0(%rbp)
jne 0x347d
jmp 0x349c
leaq 0x17bab(%rip), %rdi     # 0x1b02f
leaq 0x17bc5(%rip), %rsi     # 0x1b050
movl $0x3d, %edx
leaq 0x17c97(%rip), %rcx     # 0x1b12e
callq 0x3040
movl $0x80d9b122, %eax       # imm = 0x80D9B122
cmpq %rax, -0x98(%rbp)
jne 0x34ac
jmp 0x34cb
leaq 0x17bb8(%rip), %rdi     # 0x1b06b
leaq 0x17b96(%rip), %rsi     # 0x1b050
movl $0x3e, %edx
leaq 0x17c68(%rip), %rcx     # 0x1b12e
callq 0x3040
movabsq $-0x23c5e9023be06931, %rax # imm = 0xDC3A16FDC41F96CF
cmpq %rax, -0x90(%rbp)
jne 0x34e0
jmp 0x34ff
leaq 0x17bae(%rip), %rdi     # 0x1b095
leaq 0x17b62(%rip), %rsi     # 0x1b050
movl $0x3f, %edx
leaq 0x17c34(%rip), %rcx     # 0x1b12e
callq 0x3040
movabsq $0x10ffe7e38d227c3, %rax # imm = 0x10FFE7E38D227C3
cmpq %rax, -0x88(%rbp)
jne 0x3514
jmp 0x3533
leaq 0x17bac(%rip), %rdi     # 0x1b0c7
leaq 0x17b2e(%rip), %rsi     # 0x1b050
movl $0x40, %edx
leaq 0x17c00(%rip), %rcx     # 0x1b12e
callq 0x3040
cmpq $0x20, -0xb0(%rbp)
jne 0x353f
jmp 0x355e
leaq 0x17c01(%rip), %rdi     # 0x1b147
leaq 0x17b03(%rip), %rsi     # 0x1b050
movl $0x41, %edx
leaq 0x17bd5(%rip), %rcx     # 0x1b12e
callq 0x3040
movq -0xa8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
addq $0x1, %rsi
movl $0x20, %edx
callq 0x3090
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x3581
jmp 0x35a0
leaq 0x17bdc(%rip), %rdi     # 0x1b164
leaq 0x17ac1(%rip), %rsi     # 0x1b050
movl $0x42, %edx
leaq 0x17b93(%rip), %rcx     # 0x1b12e
callq 0x3040
cmpq $0x0, -0x80(%rbp)
jne 0x35a9
jmp 0x35c8
leaq 0x17b65(%rip), %rdi     # 0x1b115
leaq 0x17a99(%rip), %rsi     # 0x1b050
movl $0x43, %edx
leaq 0x17b6b(%rip), %rcx     # 0x1b12e
callq 0x3040
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)