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

    // 385f5f394759525959595f34335af16015573d5ffd5b475952595ff3
    op_t program[] = {
        CODESIZE, PUSH0, PUSH0, CODECOPY,
        SELFBALANCE, MSIZE, MSTORE,
        MSIZE, MSIZE, MSIZE, PUSH0, CALLVALUE, CALLER, GAS, CALL,
        PUSH1, 0x15, JUMPI,
        RETURNDATASIZE, PUSH0, REVERT,
        JUMPDEST,
        SELFBALANCE, MSIZE, MSTORE,
        MSIZE, PUSH0, RETURN,
    };
    address_t from = AddressFromHex42("0x4a6f6B9fF1fc974096f9063a45Fd12bD5B928AD1");
    uint64_t gas = 92329;
    val_t value;
    value[0] = 0;
    value[1] = 0;
    value[2] = 0xff;

    evmMockBalance(from, 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 == 160);
    assert(memcmp(result.returnData.content, program, 28) == 0);
    for (int i = 28; i < 63; i++) {
        assert(result.returnData.content[i] == 0x00);
    }
    assert(result.returnData.content[63] == 0xff);
    for (int i = 64; i < 160; i++) {
        assert(result.returnData.content[i] == 0x00);
    }
    assert(result.gasRemaining == 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xb0, %rsp
xorl %eax, %eax
callq 0xaa8d
movups 0x10287(%rip), %xmm0    # 0x153ac
leaq 0x70(%rsp), %rbx
movups %xmm0, 0xc(%rbx)
movaps 0x1026b(%rip), %xmm0    # 0x153a0
movaps %xmm0, (%rbx)
leaq 0x98(%rsp), %r14
movq %r14, %rdi
callq 0x332c
leaq 0x64(%rsp), %r15
andq $0x0, (%r15)
movl $0xff, 0x8(%r15)
movl 0x10(%r14), %eax
movl %eax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
callq 0xada9
movl 0x10(%r14), %eax
movl %eax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
leaq 0x20(%rsp), %r14
pushq $0x1c
popq %rcx
movl $0x168a9, %esi          # imm = 0x168A9
movq %r14, %rdi
movq %r15, %rdx
movq %rbx, %r8
callq 0xb68f
xorl %eax, %eax
callq 0xada8
cmpq $0x0, 0x10(%r14)
jne 0x52a0
movl $0x80d9b122, %eax       # imm = 0x80D9B122
cmpq %rax, 0x38(%rsp)
jne 0x52bf
movabsq $-0x23c5e9023be06931, %rax # imm = 0xDC3A16FDC41F96CF
cmpq %rax, 0x40(%rsp)
jne 0x52de
movabsq $0x10ffe7e38d227c3, %rax # imm = 0x10FFE7E38D227C3
cmpq %rax, 0x48(%rsp)
jne 0x52fd
cmpq $0xa0, 0x20(%rsp)
jne 0x531c
movq 0x28(%rsp), %rbx
leaq 0x70(%rsp), %rsi
pushq $0x1c
popq %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x30d0
testl %eax, %eax
jne 0x533b
cmpq $0x3f, %r14
je 0x5248
cmpb $0x0, (%rbx,%r14)
leaq 0x1(%r14), %r14
je 0x5218
leaq 0xbffd(%rip), %rdi      # 0x1122d
leaq 0xbe19(%rip), %rsi      # 0x11050
leaq 0xc542(%rip), %rcx      # 0x11780
movl $0x3cd, %edx            # imm = 0x3CD
callq 0x3040
cmpb $-0x1, 0x3f(%rbx)
jne 0x535a
pushq $-0x60
popq %rax
testq %rax, %rax
je 0x5287
cmpb $0x0, 0xa0(%rbx,%rax)
leaq 0x1(%rax), %rax
je 0x5255
leaq 0xbfbe(%rip), %rdi      # 0x1122d
leaq 0xbdda(%rip), %rsi      # 0x11050
leaq 0xc503(%rip), %rcx      # 0x11780
movl $0x3d1, %edx            # imm = 0x3D1
callq 0x3040
cmpq $0x0, 0x50(%rsp)
jne 0x5379
addq $0xb0, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0xbd88(%rip), %rdi      # 0x1102f
leaq 0xbda2(%rip), %rsi      # 0x11050
leaq 0xc4cb(%rip), %rcx      # 0x11780
movl $0x3c6, %edx            # imm = 0x3C6
callq 0x3040
leaq 0xbda5(%rip), %rdi      # 0x1106b
leaq 0xbd83(%rip), %rsi      # 0x11050
leaq 0xc4ac(%rip), %rcx      # 0x11780
movl $0x3c7, %edx            # imm = 0x3C7
callq 0x3040
leaq 0xbdb0(%rip), %rdi      # 0x11095
leaq 0xbd64(%rip), %rsi      # 0x11050
leaq 0xc48d(%rip), %rcx      # 0x11780
movl $0x3c8, %edx            # imm = 0x3C8
callq 0x3040
leaq 0xbdc3(%rip), %rdi      # 0x110c7
leaq 0xbd45(%rip), %rsi      # 0x11050
leaq 0xc46e(%rip), %rcx      # 0x11780
movl $0x3c9, %edx            # imm = 0x3C9
callq 0x3040
leaq 0xc474(%rip), %rdi      # 0x11797
leaq 0xbd26(%rip), %rsi      # 0x11050
leaq 0xc44f(%rip), %rcx      # 0x11780
movl $0x3ca, %edx            # imm = 0x3CA
callq 0x3040
leaq 0xc473(%rip), %rdi      # 0x117b5
leaq 0xbd07(%rip), %rsi      # 0x11050
leaq 0xc430(%rip), %rcx      # 0x11780
movl $0x3cb, %edx            # imm = 0x3CB
callq 0x3040
leaq 0xc488(%rip), %rdi      # 0x117e9
leaq 0xbce8(%rip), %rsi      # 0x11050
leaq 0xc411(%rip), %rcx      # 0x11780
movl $0x3cf, %edx            # imm = 0x3CF
callq 0x3040
leaq 0xbd95(%rip), %rdi      # 0x11115
leaq 0xbcc9(%rip), %rsi      # 0x11050
leaq 0xc3f2(%rip), %rcx      # 0x11780
movl $0x3d3, %edx            # imm = 0x3D3
callq 0x3040