// File: /workspace/github_c_makefile_star2_O2/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 %rbx
subq $0xb0, %rsp
xorl %eax, %eax
callq 0xaa8d
leaq 0x98(%rsp), %rbx
movq %rbx, %rdi
callq 0x332c
movaps 0x10d15(%rip), %xmm0    # 0x140c0
leaq 0x70(%rsp), %r8
movaps %xmm0, 0x10(%r8)
movaps 0x10cf4(%rip), %xmm0    # 0x140b0
movaps %xmm0, (%r8)
movabsq $-0xca0df9fada0efce, %rax # imm = 0xF35F2060525F1032
movq %rax, 0x1f(%r8)
movl 0x10(%rbx), %eax
movl %eax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
leaq 0x20(%rsp), %rbx
leaq 0x64(%rsp), %rdx
pushq $0x27
popq %rcx
movl $0xea8c, %esi           # imm = 0xEA8C
movq %rbx, %rdi
callq 0xb68f
xorl %eax, %eax
callq 0xada8
cmpq $0x0, 0x10(%rbx)
jne 0x3479
movl $0x80d9b122, %eax       # imm = 0x80D9B122
cmpq %rax, 0x38(%rsp)
jne 0x3495
movabsq $-0x23c5e9023be06931, %rax # imm = 0xDC3A16FDC41F96CF
cmpq %rax, 0x40(%rsp)
jne 0x34ae
movabsq $0x10ffe7e38d227c3, %rax # imm = 0x10FFE7E38D227C3
cmpq %rax, 0x48(%rsp)
jne 0x34c7
cmpq $0x20, 0x20(%rsp)
jne 0x34e0
movq 0x28(%rsp), %rdi
leaq 0x71(%rsp), %rsi
pushq $0x20
popq %rdx
callq 0x30d0
testl %eax, %eax
jne 0x34f9
cmpq $0x0, 0x50(%rsp)
jne 0x3512
addq $0xb0, %rsp
popq %rbx
retq
leaq 0xdbaf(%rip), %rdi      # 0x1102f
leaq 0xdbc9(%rip), %rsi      # 0x11050
leaq 0xdca0(%rip), %rcx      # 0x1112e
pushq $0x3d
jmp 0x3529
leaq 0xdbcf(%rip), %rdi      # 0x1106b
leaq 0xdbad(%rip), %rsi      # 0x11050
leaq 0xdc84(%rip), %rcx      # 0x1112e
pushq $0x3e
jmp 0x3529
leaq 0xdbe0(%rip), %rdi      # 0x11095
leaq 0xdb94(%rip), %rsi      # 0x11050
leaq 0xdc6b(%rip), %rcx      # 0x1112e
pushq $0x3f
jmp 0x3529
leaq 0xdbf9(%rip), %rdi      # 0x110c7
leaq 0xdb7b(%rip), %rsi      # 0x11050
leaq 0xdc52(%rip), %rcx      # 0x1112e
pushq $0x40
jmp 0x3529
leaq 0xdc60(%rip), %rdi      # 0x11147
leaq 0xdb62(%rip), %rsi      # 0x11050
leaq 0xdc39(%rip), %rcx      # 0x1112e
pushq $0x41
jmp 0x3529
leaq 0xdc64(%rip), %rdi      # 0x11164
leaq 0xdb49(%rip), %rsi      # 0x11050
leaq 0xdc20(%rip), %rcx      # 0x1112e
pushq $0x42
jmp 0x3529
leaq 0xdbfc(%rip), %rdi      # 0x11115
leaq 0xdb30(%rip), %rsi      # 0x11050
leaq 0xdc07(%rip), %rcx      # 0x1112e
pushq $0x43
popq %rdx
callq 0x3040