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

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

    op_t program[] = {
        PUSH32, // b
        0x10, 0x32, 0x54, 0x76, 0x98, 0xba, 0xdc, 0xfe,
        0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01,
        0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10,
        0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
        PUSH32, // a
        0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
        0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01,
        0x10, 0x32, 0x54, 0x76, 0x98, 0xba, 0xdc, 0xfe,
        0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10,
        DUP2, XOR, // a ^= b
        SWAP1, DUP2, XOR, SWAP1, // b ^= a
        DUP2, XOR, // a ^= b
        MSIZE, MSTORE,
        MSIZE, MSTORE,
        MSIZE, 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 == 64);
    assert(0 == memcmp(result.returnData.content, program + 1, 32));
    assert(0 == memcmp(result.returnData.content + 32, program + 34, 32));
    assert(result.gasRemaining == 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
xorl %eax, %eax
callq 0xca4d
movq $-0x2, %r14
leaq 0x18(%rsp), %r15
leaq 0xfbcd(%rip), %r12      # 0x14070
movq 0x19b4e(%rip), %r13     # 0x1dff8
leaq 0x12c2c(%rip), %rbx     # 0x170dd
movzbl 0x4(%r14,%r12), %ecx
leal -0x30(%rcx), %ebp
cmpb $0xa, %bpl
jb 0x44d8
leal -0x61(%rcx), %eax
cmpb $0x5, %al
ja 0x44cc
addb $-0x57, %cl
jmp 0x44d6
leal -0x41(%rcx), %eax
cmpb $0x5, %al
ja 0x4516
addb $-0x37, %cl
movl %ecx, %ebp
movzbl 0x5(%r14,%r12), %ecx
leal -0x30(%rcx), %eax
cmpb $0xa, %al
jb 0x44fd
leal -0x61(%rcx), %eax
cmpb $0x5, %al
ja 0x44f1
addb $-0x57, %cl
jmp 0x44fb
leal -0x41(%rcx), %eax
cmpb $0x5, %al
ja 0x452b
addb $-0x37, %cl
movl %ecx, %eax
shlb $0x4, %bpl
addb %al, %bpl
movb %bpl, (%r15)
addq $0x2, %r14
incq %r15
cmpq $0x26, %r14
jb 0x44b1
jmp 0x453f
movq (%r13), %rdi
movq %rbx, %rsi
movl %ecx, %edx
xorl %eax, %eax
callq 0x30a0
movb $-0x1, %bpl
jmp 0x44d8
movq (%r13), %rdi
movq %rbx, %rsi
movl %ecx, %edx
xorl %eax, %eax
callq 0x30a0
movb $-0x1, %al
jmp 0x44fd
leaq 0x12c4a(%rip), %rsi     # 0x17190
leaq 0x80(%rsp), %r8
movl $0xa, %ecx
movq %r8, %rdi
rep  movsq (%rsi), %es:(%rdi)
movb $-0xd, 0x50(%r8)
movl 0x28(%rsp), %eax
movl %eax, 0x10(%rsp)
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x30(%rsp), %rbx
leaq 0x74(%rsp), %rdx
movl $0x10650, %esi          # imm = 0x10650
movl $0x51, %ecx
movq %rbx, %rdi
callq 0xd683
xorl %eax, %eax
callq 0xcd49
cmpq $0x0, 0x10(%rbx)
jne 0x4674
movl $0x80d9b122, %eax       # imm = 0x80D9B122
cmpq %rax, 0x48(%rsp)
jne 0x4693
movabsq $-0x23c5e9023be06931, %rax # imm = 0xDC3A16FDC41F96CF
cmpq %rax, 0x50(%rsp)
jne 0x46b2
movabsq $0x10ffe7e38d227c3, %rax # imm = 0x10FFE7E38D227C3
cmpq %rax, 0x58(%rsp)
jne 0x46d1
cmpq $0x40, 0x30(%rsp)
jne 0x46f0
movq 0x38(%rsp), %rax
movdqu (%rax), %xmm0
movdqu 0x10(%rax), %xmm1
movdqu 0x81(%rsp), %xmm2
pcmpeqb %xmm0, %xmm2
movdqu 0x91(%rsp), %xmm0
pcmpeqb %xmm1, %xmm0
pand %xmm2, %xmm0
pmovmskb %xmm0, %ecx
cmpl $0xffff, %ecx           # imm = 0xFFFF
jne 0x470f
movdqu 0x20(%rax), %xmm0
movdqu 0x30(%rax), %xmm1
movdqu 0xa2(%rsp), %xmm2
pcmpeqb %xmm0, %xmm2
movdqu 0xb2(%rsp), %xmm0
pcmpeqb %xmm1, %xmm0
pand %xmm2, %xmm0
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0x472e
cmpq $0x0, 0x60(%rsp)
jne 0x474d
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xfa20(%rip), %rdi      # 0x1409b
leaq 0xfa3a(%rip), %rsi      # 0x140bc
leaq 0xfd8a(%rip), %rcx      # 0x14413
movl $0xc1, %edx
callq 0x3040
leaq 0xfa3d(%rip), %rdi      # 0x140d7
leaq 0xfa1b(%rip), %rsi      # 0x140bc
leaq 0xfd6b(%rip), %rcx      # 0x14413
movl $0xc2, %edx
callq 0x3040
leaq 0xfa48(%rip), %rdi      # 0x14101
leaq 0xf9fc(%rip), %rsi      # 0x140bc
leaq 0xfd4c(%rip), %rcx      # 0x14413
movl $0xc3, %edx
callq 0x3040
leaq 0xfa5b(%rip), %rdi      # 0x14133
leaq 0xf9dd(%rip), %rsi      # 0x140bc
leaq 0xfd2d(%rip), %rcx      # 0x14413
movl $0xc4, %edx
callq 0x3040
leaq 0xfd30(%rip), %rdi      # 0x14427
leaq 0xf9be(%rip), %rsi      # 0x140bc
leaq 0xfd0e(%rip), %rcx      # 0x14413
movl $0xc5, %edx
callq 0x3040
leaq 0xfaba(%rip), %rdi      # 0x141d0
leaq 0xf99f(%rip), %rsi      # 0x140bc
leaq 0xfcef(%rip), %rcx      # 0x14413
movl $0xc6, %edx
callq 0x3040
leaq 0xfd0f(%rip), %rdi      # 0x14444
leaq 0xf980(%rip), %rsi      # 0x140bc
leaq 0xfcd0(%rip), %rcx      # 0x14413
movl $0xc7, %edx
callq 0x3040
leaq 0xfa2d(%rip), %rdi      # 0x14181
leaq 0xf961(%rip), %rsi      # 0x140bc
leaq 0xfcb1(%rip), %rcx      # 0x14413
movl $0xc8, %edx
callq 0x3040