// File: /workspace/github_c_makefile_star2_O0/buptlxb[P]xRay/disasm/instr_set/opcodes_N_Z.c
// Function: xchg_ebx
void __bea_callspec__ xchg_ebx(PDISASM pMyDisasm)
{
    if ((*pMyDisasm).Prefix.LockPrefix == InvalidPrefix) {
        (*pMyDisasm).Prefix.LockPrefix = InUsePrefix;
    }
    (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+DATA_TRANSFER;
    #ifndef BEA_LIGHT_DISASSEMBLY
       (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "xchg ");
    #endif
    (*pMyDisasm).Argument1.ArgType = REGISTER_TYPE+GENERAL_REG+REG0;
    (*pMyDisasm).Argument2.ArgType = REGISTER_TYPE+GENERAL_REG+REG3;
    if (GV.OperandSize == 64) {
        #ifndef BEA_LIGHT_DISASSEMBLY
           (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers64Bits[0]);
        #endif
        if (GV.REX.B_ == 1) {
            #ifndef BEA_LIGHT_DISASSEMBLY
               (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[3+8]);
            #endif
        }
        else {
            #ifndef BEA_LIGHT_DISASSEMBLY
               (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers64Bits[3]);
            #endif
        }
        GV.EIP_++;
        (*pMyDisasm).Argument2.AccessMode = WRITE;
        (*pMyDisasm).Argument1.ArgSize = 64;
        (*pMyDisasm).Argument2.ArgSize = 64;
    }
    else if (GV.OperandSize == 32) {
        #ifndef BEA_LIGHT_DISASSEMBLY
           (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers32Bits[0]);
        #endif
        if (GV.REX.B_ == 1) {
            #ifndef BEA_LIGHT_DISASSEMBLY
               (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[3+8]);
            #endif
        }
        else {
            #ifndef BEA_LIGHT_DISASSEMBLY
               (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers32Bits[3]);
            #endif
        }
        GV.EIP_++;
        (*pMyDisasm).Argument2.AccessMode = WRITE;
        (*pMyDisasm).Argument1.ArgSize = 32;
        (*pMyDisasm).Argument2.ArgSize = 32;
    }
    else {
        #ifndef BEA_LIGHT_DISASSEMBLY
           (void) strcpy ((*pMyDisasm).Argument1.ArgMnemonic, Registers16Bits[0]);
        #endif
        if (GV.REX.B_ == 1) {
            #ifndef BEA_LIGHT_DISASSEMBLY
               (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[3+8]);
            #endif
        }
        else {
            #ifndef BEA_LIGHT_DISASSEMBLY
               (void) strcpy ((*pMyDisasm).Argument2.ArgMnemonic, Registers16Bits[3]);
            #endif
        }
        GV.EIP_++;
        (*pMyDisasm).Argument2.AccessMode = WRITE;
        (*pMyDisasm).Argument1.ArgSize = 16;
        (*pMyDisasm).Argument2.ArgSize = 16;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x1dc(%rax), %eax
cmpl $0x4, %eax
jne 0x20067
movq -0x8(%rbp), %rax
movb $0x1, 0x1dc(%rax)
movq -0x8(%rbp), %rax
movl $0x10001, 0x60(%rax)    # imm = 0x10001
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
addq $0x8, %rdi
leaq 0x314cb(%rip), %rsi     # 0x51550
callq 0x81c0
movq -0x8(%rbp), %rax
movl $0x20020001, 0xdc(%rax) # imm = 0x20020001
movq -0x8(%rbp), %rax
movl $0x20020008, 0x144(%rax) # imm = 0x20020008
movq -0x8(%rbp), %rax
cmpl $0x40, 0x20c(%rax)
jne 0x20153
movq -0x8(%rbp), %rdi
addq $0x9c, %rdi
leaq 0x42b37(%rip), %rsi     # 0x62c00
callq 0x81c0
movq -0x8(%rbp), %rax
movzbl 0x287(%rax), %eax
cmpl $0x1, %eax
jne 0x200f7
movq -0x8(%rbp), %rdi
addq $0x104, %rdi            # imm = 0x104
leaq 0x42b3c(%rip), %rsi     # 0x62c2c
callq 0x81c0
jmp 0x2010e
movq -0x8(%rbp), %rdi
addq $0x104, %rdi            # imm = 0x104
leaq 0x42b03(%rip), %rsi     # 0x62c0c
callq 0x81c0
movq -0x8(%rbp), %rax
movq 0x1f0(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x1f0(%rax)
movq -0x8(%rbp), %rax
movl $0x2, 0x150(%rax)
movq -0x8(%rbp), %rax
movl $0x40, 0xe0(%rax)
movq -0x8(%rbp), %rax
movl $0x40, 0x148(%rax)
jmp 0x20299
movq -0x8(%rbp), %rax
cmpl $0x20, 0x20c(%rax)
jne 0x20200
movq -0x8(%rbp), %rdi
addq $0x9c, %rdi
leaq 0x42aca(%rip), %rsi     # 0x62c40
callq 0x81c0
movq -0x8(%rbp), %rax
movzbl 0x287(%rax), %eax
cmpl $0x1, %eax
jne 0x201a4
movq -0x8(%rbp), %rdi
addq $0x104, %rdi            # imm = 0x104
leaq 0x42afb(%rip), %rsi     # 0x62c98
callq 0x81c0
jmp 0x201bb
movq -0x8(%rbp), %rdi
addq $0x104, %rdi            # imm = 0x104
leaq 0x42aa2(%rip), %rsi     # 0x62c58
callq 0x81c0
movq -0x8(%rbp), %rax
movq 0x1f0(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x1f0(%rax)
movq -0x8(%rbp), %rax
movl $0x2, 0x150(%rax)
movq -0x8(%rbp), %rax
movl $0x20, 0xe0(%rax)
movq -0x8(%rbp), %rax
movl $0x20, 0x148(%rax)
jmp 0x20297
movq -0x8(%rbp), %rdi
addq $0x9c, %rdi
leaq 0x42aae(%rip), %rsi     # 0x62cc0
callq 0x81c0
movq -0x8(%rbp), %rax
movzbl 0x287(%rax), %eax
cmpl $0x1, %eax
jne 0x20240
movq -0x8(%rbp), %rdi
addq $0x104, %rdi            # imm = 0x104
leaq 0x42adf(%rip), %rsi     # 0x62d18
callq 0x81c0
jmp 0x20257
movq -0x8(%rbp), %rdi
addq $0x104, %rdi            # imm = 0x104
leaq 0x42a86(%rip), %rsi     # 0x62cd8
callq 0x81c0
movq -0x8(%rbp), %rax
movq 0x1f0(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x1f0(%rax)
movq -0x8(%rbp), %rax
movl $0x2, 0x150(%rax)
movq -0x8(%rbp), %rax
movl $0x10, 0xe0(%rax)
movq -0x8(%rbp), %rax
movl $0x10, 0x148(%rax)
jmp 0x20299
addq $0x10, %rsp
popq %rbp
retq
nop