// File: /workspace/github_c_makefile_star2_O3/buptlxb[P]xRay/disasm/instr_set/opcodes_A_M.c
// Function: loopne_
void __bea_callspec__ loopne_(PDISASM pMyDisasm)
{
    signed long MyNumber;
    UInt64 MyAddress;
    (*pMyDisasm).Instruction.Category = GENERAL_PURPOSE_INSTRUCTION+CONTROL_TRANSFER;
    (*pMyDisasm).Instruction.BranchType = JNE;
    #ifndef BEA_LIGHT_DISASSEMBLY
       (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "loopne ");
    #endif
    if (!Security(1, pMyDisasm)) return;
    if (GV.OperandSize >= 32) {
        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.AccessMode = READ;
        (*pMyDisasm).Argument1.ArgSize = GV.OperandSize;
        (*pMyDisasm).Argument1.ArgType = CONSTANT_TYPE+RELATIVE_;
        (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG1;
        (*pMyDisasm).Instruction.AddrValue = MyAddress;
        GV.EIP_+=2;
        FillFlags(pMyDisasm, 61);
    }
    else {
        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.AccessMode = READ;
        (*pMyDisasm).Argument1.ArgSize = GV.OperandSize;
        (*pMyDisasm).Argument1.ArgType = CONSTANT_TYPE+RELATIVE_;
        (*pMyDisasm).Instruction.ImplicitModifiedRegs = GENERAL_REG+REG1;
        (*pMyDisasm).Instruction.AddrValue = MyAddress;
        GV.EIP_+=2;
        FillFlags(pMyDisasm, 61);

    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x10006, 0x60(%rdi)    # imm = 0x10006
movl $0xfffffffd, 0x78(%rdi) # imm = 0xFFFFFFFD
movabsq $0x20656e706f6f6c, %rax # imm = 0x20656E706F6F6C
movq %rax, 0x68(%rdi)
movq 0x250(%rdi), %rax
testq %rax, %rax
je 0x16c19
movq 0x1f0(%rbx), %rcx
incq %rcx
cmpq %rax, %rcx
jae 0x16d06
cmpl $0x20, 0x20c(%rbx)
movq 0x1f0(%rbx), %rcx
movq 0x1f8(%rbx), %rax
movsbq 0x1(%rcx), %rcx
movslq 0x264(%rbx), %rdx
movl $0x1, 0x258(%rbx)
jl 0x16c82
testq %rax, %rax
jne 0x16c52
movq 0x200(%rbx), %rax
addq %rdx, %rcx
leaq (%rax,%rcx), %r14
addq $0x2, %r14
movq %r14, %rax
shrq $0x20, %rax
leaq 0x9c(%rbx), %rsi
testq %rax, %rax
leaq 0x16ddf(%rip), %rax     # 0x2da54
leaq 0x16de0(%rip), %rdx     # 0x2da5c
cmovneq %rax, %rdx
jmp 0x16ca9
movl %edx, %edx
testq %rax, %rax
jne 0x16c90
movq 0x200(%rbx), %rax
addl %ecx, %edx
addl %edx, %eax
addl $0x2, %eax
movzwl %ax, %r14d
leaq 0x9c(%rbx), %rsi
leaq 0x16dc9(%rip), %rdx     # 0x2da72
movq %rbx, %rdi
movq %r14, %rcx
callq 0x2a60b
movl $0x1, 0xe8(%rbx)
movl 0x20c(%rbx), %eax
movl %eax, 0xe0(%rbx)
movl $0x84000000, 0xdc(%rbx) # imm = 0x84000000
movl $0x20002, 0x98(%rbx)    # imm = 0x20002
movq %r14, 0x88(%rbx)
addq $0x2, 0x1f0(%rbx)
movq 0x21768(%rip), %rax     # 0x3845c
movq %rax, 0x7c(%rbx)
movl 0x21766(%rip), %eax     # 0x38464
movl %eax, 0x84(%rbx)
jmp 0x16d10
movl $0x1, 0x289(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq