// File: /workspace/github_c_makefile_star2_O1/buptlxb[P]xRay/disasm/instr_set/opcodes_A_M.c
// Function: jecxz_
void __bea_callspec__ jecxz_(PDISASM pMyDisasm)
{
    UInt64 MyAddress;
    Int64 MyNumber;
    if ((*pMyDisasm).Prefix.CSPrefix == InUsePrefix) {
        (*pMyDisasm).Prefix.CSPrefix = NotUsedPrefix;
        (*pMyDisasm).Prefix.BranchNotTaken = InUsePrefix;
    }
    if ((*pMyDisasm).Prefix.DSPrefix == InUsePrefix) {
        (*pMyDisasm).Prefix.DSPrefix = NotUsedPrefix;
        (*pMyDisasm).Prefix.BranchTaken = InUsePrefix;
    }
    (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER;
    (*pMyDisasm).Instruction.BranchType = JECXZ;
    (*pMyDisasm).Argument1.ArgSize = GV.OperandSize;
    if (GV.AddressSize == 64) {
        #ifndef BEA_LIGHT_DISASSEMBLY
           (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "jrcxz ");
        #endif
    }
    else if (GV.AddressSize == 32) {
        #ifndef BEA_LIGHT_DISASSEMBLY
           (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "jecxz ");
        #endif
    }
    else {
        #ifndef BEA_LIGHT_DISASSEMBLY
           (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "jcxz ");
        #endif
    }
    if (GV.OperandSize >= 32) {
        if (!Security(5, pMyDisasm)) return;
        MyNumber = *((Int8*)(UIntPtr) (GV.EIP_+1));
        CalculateRelativeAddress(&MyAddress,(Int64) GV.NB_PREFIX+2+MyNumber, pMyDisasm);
        if (MyAddress >= W64LIT (0x100000000)) {
            #ifndef BEA_LIGHT_DISASSEMBLY
               (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument1.ArgMnemonic, "%.16llX",(Int64) MyAddress);
            #endif
        }
        else {
            #ifndef BEA_LIGHT_DISASSEMBLY
               (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument1.ArgMnemonic, "%.8X",(Int64) MyAddress);
            #endif
        }
        (*pMyDisasm).Argument1.ArgType = CONSTANT_TYPE+RELATIVE_;
        (*pMyDisasm).Argument1.AccessMode = READ;
        (*pMyDisasm).Instruction.AddrValue = MyAddress;
        GV.EIP_+=2;
        FillFlags(pMyDisasm,49);
    }
    else {
        if (!Security(3, pMyDisasm)) return;
        MyNumber = *((Int8*)(UIntPtr) (GV.EIP_+1));
        CalculateRelativeAddress(&MyAddress,(Int64) GV.NB_PREFIX+2+MyNumber, pMyDisasm);
        MyAddress = MyAddress & 0xffff;
        #ifndef BEA_LIGHT_DISASSEMBLY
           (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument1.ArgMnemonic, "%.4X",(Int64) MyAddress);
        #endif
        (*pMyDisasm).Argument1.ArgType = CONSTANT_TYPE+RELATIVE_;
        (*pMyDisasm).Argument1.AccessMode = READ;
        (*pMyDisasm).Instruction.AddrValue = MyAddress;
        GV.EIP_+=2;
        FillFlags(pMyDisasm,49);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x1, 0x1e5(%rdi)
jne 0x1749d
movb $0x0, 0x1e5(%rbx)
movb $0x1, 0x1e8(%rbx)
cmpb $0x1, 0x1e6(%rbx)
jne 0x174af
movw $0x100, 0x1e6(%rbx)     # imm = 0x100
movl $0x10006, 0x60(%rbx)    # imm = 0x10006
movl $0xa, 0x78(%rbx)
movl 0x20c(%rbx), %eax
movl 0x214(%rbx), %edx
movl %eax, 0xe0(%rbx)
leaq 0x68(%rbx), %rcx
cmpl $0x20, %edx
je 0x174ec
cmpl $0x40, %edx
jne 0x174fb
movl $0x207a78, 0x3(%rcx)    # imm = 0x207A78
movl $0x7863726a, (%rcx)     # imm = 0x7863726A
jmp 0x17507
movl $0x207a78, 0x3(%rcx)    # imm = 0x207A78
movl $0x7863656a, (%rcx)     # imm = 0x7863656A
jmp 0x17507
movw $0x20, 0x4(%rcx)
movl $0x7a78636a, (%rcx)     # imm = 0x7A78636A
leaq 0x9c(%rbx), %rsi
movq 0x250(%rbx), %rcx
cmpl $0x20, %eax
jl 0x17589
testq %rcx, %rcx
je 0x17533
movq 0x1f0(%rbx), %rax
addq $0x5, %rax
cmpq %rcx, %rax
jae 0x1762a
movq 0x1f0(%rbx), %rax
movq 0x1f8(%rbx), %rcx
movsbq 0x1(%rax), %rax
movslq 0x264(%rbx), %rdx
movl $0x1, 0x258(%rbx)
testq %rcx, %rcx
jne 0x17563
movq 0x200(%rbx), %rcx
addq %rdx, %rax
leaq (%rcx,%rax), %r14
addq $0x2, %r14
movq %r14, %rax
shrq $0x20, %rax
leaq 0x164d8(%rip), %rax     # 0x2da54
leaq 0x164d9(%rip), %rdx     # 0x2da5c
cmovneq %rax, %rdx
jmp 0x175e3
testq %rcx, %rcx
je 0x175a2
movq 0x1f0(%rbx), %rax
addq $0x3, %rax
cmpq %rcx, %rax
jae 0x1762a
movq 0x1f0(%rbx), %rcx
movq 0x1f8(%rbx), %rax
movsbq 0x1(%rcx), %rdx
movl 0x264(%rbx), %ecx
movl $0x1, 0x258(%rbx)
testq %rax, %rax
jne 0x175d1
movq 0x200(%rbx), %rax
addl %edx, %ecx
addl %ecx, %eax
addl $0x2, %eax
movzwl %ax, %r14d
leaq 0x1648f(%rip), %rdx     # 0x2da72
movq %rbx, %rdi
movq %r14, %rcx
callq 0x2acdf
movl $0x84000000, 0xdc(%rbx) # imm = 0x84000000
movl $0x1, 0xe8(%rbx)
movq %r14, 0x88(%rbx)
addq $0x2, 0x1f0(%rbx)
movq 0x20db4(%rip), %rax     # 0x383cc
movq %rax, 0x7c(%rbx)
movl 0x20db2(%rip), %eax     # 0x383d4
movl %eax, 0x84(%rbx)
jmp 0x17634
movl $0x1, 0x289(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq