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

    // 5f5f5560015f555f5f5500
    op_t program[] = {
        PUSH0, PUSH0, SSTORE,
        PUSH1, 0x01, PUSH0, SSTORE,
        PUSH0, PUSH0, SSTORE,
        STOP,
    };
    address_t from = AddressFromHex42("0x4a6f6B9fF1fc974096f9063a45Fd12bD5B928AD1");
    uint64_t gas = 77680;
    val_t value;
    data_t input;
    input.content = program;
    input.size = sizeof(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 == 0);
    assert(result.gasRemaining == 17296);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
xorl %eax, %eax
callq 0xca7b
movabsq $0x5f555f0160555f5f, %rax # imm = 0x5F555F0160555F5F
movq %rax, 0x20(%rsp)
movl $0x555f5f, 0x27(%rsp)   # imm = 0x555F5F
movq $-0x2, %r14
leaq 0x30(%rsp), %r15
leaq 0xe4d8(%rip), %r12      # 0x14050
movq 0x18479(%rip), %r13     # 0x1dff8
leaq 0x11537(%rip), %rbx     # 0x170bd
movzbl 0x4(%r14,%r12), %ecx
leal -0x30(%rcx), %ebp
cmpb $0xa, %bpl
jb 0x5bad
leal -0x61(%rcx), %eax
cmpb $0x5, %al
ja 0x5ba1
addb $-0x57, %cl
jmp 0x5bab
leal -0x41(%rcx), %eax
cmpb $0x5, %al
ja 0x5beb
addb $-0x37, %cl
movl %ecx, %ebp
movzbl 0x5(%r14,%r12), %ecx
leal -0x30(%rcx), %eax
cmpb $0xa, %al
jb 0x5bd2
leal -0x61(%rcx), %eax
cmpb $0x5, %al
ja 0x5bc6
addb $-0x57, %cl
jmp 0x5bd0
leal -0x41(%rcx), %eax
cmpb $0x5, %al
ja 0x5c00
addb $-0x37, %cl
movl %ecx, %eax
shlb $0x4, %bpl
addb %al, %bpl
movb %bpl, (%r15)
addq $0x2, %r14
incq %r15
cmpq $0x26, %r14
jb 0x5b86
jmp 0x5c14
movq (%r13), %rdi
movq %rbx, %rsi
movl %ecx, %edx
xorl %eax, %eax
callq 0x30a0
movb $-0x1, %bpl
jmp 0x5bad
movq (%r13), %rdi
movq %rbx, %rsi
movl %ecx, %edx
xorl %eax, %eax
callq 0x30a0
movb $-0x1, %al
jmp 0x5bd2
movl 0x40(%rsp), %eax
movl %eax, 0x10(%rsp)
movups 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x48(%rsp), %rbx
leaq 0x8c(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl $0x12f70, %esi          # imm = 0x12F70
movl $0xb, %ecx
movq %rbx, %rdi
callq 0xd845
xorl %eax, %eax
callq 0xcf29
cmpq $0x0, 0x10(%rbx)
jne 0x5cba
movl $0x80d9b122, %eax       # imm = 0x80D9B122
cmpq %rax, 0x60(%rsp)
jne 0x5cd9
movabsq $-0x23c5e9023be06931, %rax # imm = 0xDC3A16FDC41F96CF
cmpq %rax, 0x68(%rsp)
jne 0x5cf8
movabsq $0x10ffe7e38d227c3, %rax # imm = 0x10FFE7E38D227C3
cmpq %rax, 0x70(%rsp)
jne 0x5d17
cmpq $0x0, 0x48(%rsp)
jne 0x5d36
cmpq $0x4390, 0x78(%rsp)     # imm = 0x4390
jne 0x5d55
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xe3ba(%rip), %rdi      # 0x1407b
leaq 0xe3d4(%rip), %rsi      # 0x1409c
leaq 0xe9f4(%rip), %rcx      # 0x146c3
movl $0x337, %edx            # imm = 0x337
callq 0x3040
leaq 0xe3d7(%rip), %rdi      # 0x140b7
leaq 0xe3b5(%rip), %rsi      # 0x1409c
leaq 0xe9d5(%rip), %rcx      # 0x146c3
movl $0x338, %edx            # imm = 0x338
callq 0x3040
leaq 0xe3e2(%rip), %rdi      # 0x140e1
leaq 0xe396(%rip), %rsi      # 0x1409c
leaq 0xe9b6(%rip), %rcx      # 0x146c3
movl $0x339, %edx            # imm = 0x339
callq 0x3040
leaq 0xe3f5(%rip), %rdi      # 0x14113
leaq 0xe377(%rip), %rsi      # 0x1409c
leaq 0xe997(%rip), %rcx      # 0x146c3
movl $0x33a, %edx            # imm = 0x33A
callq 0x3040
leaq 0xe408(%rip), %rdi      # 0x14145
leaq 0xe358(%rip), %rsi      # 0x1409c
leaq 0xe978(%rip), %rcx      # 0x146c3
movl $0x33b, %edx            # imm = 0x33B
callq 0x3040
leaq 0xe981(%rip), %rdi      # 0x146dd
leaq 0xe339(%rip), %rsi      # 0x1409c
leaq 0xe959(%rip), %rcx      # 0x146c3
movl $0x33c, %edx            # imm = 0x33C
callq 0x3040