// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xa0, %rsp
movb $0x0, %al
callq 0xcfc0
movq 0x165d3(%rip), %rax     # 0x1b66c
movq %rax, -0xb(%rbp)
movw 0x165d0(%rip), %ax      # 0x1b674
movw %ax, -0x3(%rbp)
movb 0x165c8(%rip), %al      # 0x1b676
movb %al, -0x1(%rbp)
leaq -0x20(%rbp), %rdi
leaq 0x15f48(%rip), %rsi     # 0x1b004
addq $0x2, %rsi
callq 0x3380
movq $0x12f70, -0x28(%rbp)   # imm = 0x12F70
leaq -0xb(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0xb, -0x48(%rbp)
movq -0x28(%rbp), %rsi
leaq -0x34(%rbp), %rdx
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %r8
leaq -0x88(%rbp), %rdi
leaq -0x20(%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, -0x78(%rbp)
jne 0x5124
jmp 0x5143
leaq 0x15f04(%rip), %rdi     # 0x1b02f
leaq 0x15f1e(%rip), %rsi     # 0x1b050
movl $0x337, %edx            # imm = 0x337
leaq 0x16539(%rip), %rcx     # 0x1b677
callq 0x3040
movl $0x80d9b122, %eax       # imm = 0x80D9B122
cmpq %rax, -0x70(%rbp)
jne 0x5150
jmp 0x516f
leaq 0x15f14(%rip), %rdi     # 0x1b06b
leaq 0x15ef2(%rip), %rsi     # 0x1b050
movl $0x338, %edx            # imm = 0x338
leaq 0x1650d(%rip), %rcx     # 0x1b677
callq 0x3040
movabsq $-0x23c5e9023be06931, %rax # imm = 0xDC3A16FDC41F96CF
cmpq %rax, -0x68(%rbp)
jne 0x5181
jmp 0x51a0
leaq 0x15f0d(%rip), %rdi     # 0x1b095
leaq 0x15ec1(%rip), %rsi     # 0x1b050
movl $0x339, %edx            # imm = 0x339
leaq 0x164dc(%rip), %rcx     # 0x1b677
callq 0x3040
movabsq $0x10ffe7e38d227c3, %rax # imm = 0x10FFE7E38D227C3
cmpq %rax, -0x60(%rbp)
jne 0x51b2
jmp 0x51d1
leaq 0x15f0e(%rip), %rdi     # 0x1b0c7
leaq 0x15e90(%rip), %rsi     # 0x1b050
movl $0x33a, %edx            # imm = 0x33A
leaq 0x164ab(%rip), %rcx     # 0x1b677
callq 0x3040
cmpq $0x0, -0x88(%rbp)
jne 0x51dd
jmp 0x51fc
leaq 0x15f15(%rip), %rdi     # 0x1b0f9
leaq 0x15e65(%rip), %rsi     # 0x1b050
movl $0x33b, %edx            # imm = 0x33B
leaq 0x16480(%rip), %rcx     # 0x1b677
callq 0x3040
cmpq $0x4390, -0x58(%rbp)    # imm = 0x4390
jne 0x5208
jmp 0x5227
leaq 0x16482(%rip), %rdi     # 0x1b691
leaq 0x15e3a(%rip), %rsi     # 0x1b050
movl $0x33c, %edx            # imm = 0x33C
leaq 0x16455(%rip), %rcx     # 0x1b677
callq 0x3040
addq $0xa0, %rsp
popq %rbp
retq