// File: /workspace/github_c_makefile_star2_O3/buptlxb[P]xRay/disasm/Routines_Disasm.c
// Function: BuildCompleteInstructionATSyntax
void __bea_callspec__ BuildCompleteInstructionATSyntax(PDISASM pMyDisasm)
{
    size_t i = 0;
    /* =============== Copy Instruction Mnemonic */
    (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr, (char*) &(*pMyDisasm).Instruction.Mnemonic);
    i = strlen((char*) &(*pMyDisasm).CompleteInstr);

    /* =============== suffix the mnemonic */
    if (GV.MemDecoration != 0) {
        if (GV.MemDecoration > 99) GV.MemDecoration -= 100;
        (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i-1, ATSuffixes[GV.MemDecoration-1]);
        i = strlen((char*) &(*pMyDisasm).CompleteInstr);
    }
    else {
        if ((*pMyDisasm).Argument1.ArgType != NO_ARGUMENT) {
            if ((*pMyDisasm).Argument1.ArgSize == 8) {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i-1, ATSuffixes[0]);
            }
            else if ((*pMyDisasm).Argument1.ArgSize == 16) {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i-1, ATSuffixes[1]);
            }
            else if ((*pMyDisasm).Argument1.ArgSize == 32) {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i-1, ATSuffixes[2]);
            }
            else if ((*pMyDisasm).Argument1.ArgSize == 64) {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i-1, ATSuffixes[3]);
            }
            i = strlen((char*) &(*pMyDisasm).CompleteInstr);
        }
        else if ((*pMyDisasm).Argument1.ArgType != NO_ARGUMENT) {
            if ((*pMyDisasm).Argument1.ArgSize == 8) {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i-1, ATSuffixes[0]);
            }
            else if ((*pMyDisasm).Argument1.ArgSize == 16) {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i-1, ATSuffixes[1]);
            }
            else if ((*pMyDisasm).Argument1.ArgSize == 32) {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i-1, ATSuffixes[2]);
            }
            else if ((*pMyDisasm).Argument1.ArgSize == 64) {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i-1, ATSuffixes[3]);
            }
            i = strlen((char*) &(*pMyDisasm).CompleteInstr);
        }
    }
    /* =============== if TAB = 1, add tabulation */
    if (GV.TAB_ == 1) {
       (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, space_tab[i>10 ? 0 : 10-i]);
        i = strlen((char*) &(*pMyDisasm).CompleteInstr);
    }

    /* =============== if Arg3.Exists, display it */
    if (GV.third_arg != 0) {
        if ((*pMyDisasm).Argument3.ArgType & REGISTER_TYPE) {
            (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "%");
            i++;
        }
        else if ((*pMyDisasm).Argument3.ArgType & CONSTANT_TYPE) {
            (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "\x24");
            i++;
        }
        (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, (char*) &(*pMyDisasm).Argument3.ArgMnemonic);
        i = strlen((char*) &(*pMyDisasm).CompleteInstr);
    }

    /* =============== if Arg3.Exists and Arg2.Exists , display " , " */
    if ((GV.third_arg != 0) && (*((UInt8*) &(*pMyDisasm).Argument2.ArgMnemonic) != 0)) {
        (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, ", ");
        i += 2;
    }

    /* =============== if Arg2 exists, display it */
    if (*((UInt8*) &(*pMyDisasm).Argument2.ArgMnemonic) != 0) {
        if ((*pMyDisasm).Argument2.ArgType & CONSTANT_TYPE) {
            (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "\x24");
            i++;
        }
        else {
            if ((*pMyDisasm).Instruction.BranchType != 0) {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "*");
                i++;
            }
            if ((*pMyDisasm).Argument2.ArgType & REGISTER_TYPE) {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "%");
                i++;
            }
            else if ((*pMyDisasm).Argument2.ArgType & CONSTANT_TYPE) {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "\x24");
                i++;
            }
            else {
                if ((GV.SEGMENTREGS != 0) || (GV.SEGMENTFS != 0)){
                    (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "%");
                    i++;
                    if (GV.SEGMENTREGS != 0) {
                        (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, SegmentRegs[(*pMyDisasm).Argument2.SegmentReg]);
                    }
                    else {
                        (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, SegmentRegs[3]);
                    }
                    i = strlen((char*) &(*pMyDisasm).CompleteInstr);
                }
            }
        }
        (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, (char*) &(*pMyDisasm).Argument2.ArgMnemonic);
        i = strlen((char*) &(*pMyDisasm).CompleteInstr);
    }

    /* =============== if Arg2.Exists and Arg1.Exists , display " , " */
    if (((UInt8)*((UInt8*) &(*pMyDisasm).Argument1.ArgMnemonic) != 0) && ((UInt8)*((UInt8*) &(*pMyDisasm).Argument2.ArgMnemonic) != 0)) {
        (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, ", ");
        i += 2;
    }

    /* =============== if Arg1 exists, display it */
    if (*((UInt8*) &(*pMyDisasm).Argument1.ArgMnemonic) != 0) {
        if ((*pMyDisasm).Argument1.ArgType & CONSTANT_TYPE) {
            (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "\x24");
            i++;
        }
        else {
            if ((*pMyDisasm).Instruction.BranchType != 0) {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "*");
                i++;
            }
            if ((*pMyDisasm).Argument1.ArgType & REGISTER_TYPE) {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "%");
                i++;
            }
            else if ((*pMyDisasm).Argument1.ArgType & CONSTANT_TYPE) {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "\x24");
                i++;
            }
            else {
                if ((GV.SEGMENTREGS != 0) || (GV.SEGMENTFS != 0)){
                    (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "%");
                    i++;
                    if (GV.SEGMENTREGS != 0) {
                        (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, SegmentRegs[(*pMyDisasm).Argument1.SegmentReg]);
                    }
                    else {
                        (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, SegmentRegs[3]);
                    }
                    i = strlen((char*) &(*pMyDisasm).CompleteInstr);
                }
            }
        }
        (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, (char*) &(*pMyDisasm).Argument1.ArgMnemonic);
        i = strlen((char*) &(*pMyDisasm).CompleteInstr);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x14(%rdi), %rbx
leaq 0x68(%rdi), %rsi
movq %rbx, %rdi
callq 0x8150
movq %rbx, %rdi
callq 0x8090
movl 0x210(%r14), %ecx
testl %ecx, %ecx
je 0x2bacb
cmpl $0x64, %ecx
jl 0x2b96f
addl $-0x64, %ecx
movl %ecx, 0x210(%r14)
leaq (%rbx,%rax), %rdi
decq %rdi
movslq %ecx, %rax
leaq 0xcea0(%rip), %rcx      # 0x38820
leaq (%rcx,%rax,4), %rsi
addq $-0x4, %rsi
callq 0x8150
movq %rbx, %rdi
callq 0x8090
cmpl $0x1, 0x27c(%r14)
jne 0x2b9cb
xorl %ecx, %ecx
movl $0xa, %edx
subq %rax, %rdx
cmovaeq %rdx, %rcx
leaq (%rbx,%rax), %rdi
shll $0x4, %ecx
leaq 0xcd95(%rip), %rsi      # 0x38750
addq %rcx, %rsi
callq 0x8150
movq %rbx, %rdi
callq 0x8090
cmpl $0x0, 0x278(%r14)
je 0x2ba32
leaq 0x16c(%r14), %rsi
movl 0x1ac(%r14), %edx
movw $0x25, %cx
btl $0x1d, %edx
jb 0x2b9f5
testl %edx, %edx
jns 0x2b9fc
movw $0x24, %cx
movw %cx, (%rbx,%rax)
incq %rax
addq %rbx, %rax
movq %rax, %rdi
callq 0x8150
movq %rbx, %rdi
callq 0x8090
cmpl $0x0, 0x278(%r14)
je 0x2ba32
cmpb $0x0, 0x104(%r14)
je 0x2ba32
movb $0x0, 0x2(%rbx,%rax)
movw $0x202c, (%rbx,%rax)    # imm = 0x202C
addq $0x2, %rax
leaq 0x104(%r14), %r15
cmpb $0x0, 0x104(%r14)
je 0x2bb40
movl 0x144(%r14), %ecx
testl %ecx, %ecx
js 0x2bb19
cmpl $0x0, 0x78(%r14)
je 0x2ba6f
movw $0x2a, 0x14(%r14,%rax)
incq %rax
movl 0x144(%r14), %ecx
btl $0x1d, %ecx
jb 0x2bb21
testl %ecx, %ecx
js 0x2bb19
cmpl $0x0, 0x270(%r14)
jne 0x2ba99
cmpl $0x0, 0x274(%r14)
je 0x2bb2a
movw $0x25, 0x14(%r14,%rax)
cmpl $0x0, 0x270(%r14)
leaq 0x1(%rbx,%rax), %rdi
je 0x2bc14
movl 0x168(%r14), %eax
leaq 0xcd3e(%rip), %rcx      # 0x38800
leaq (%rcx,%rax,4), %rsi
jmp 0x2bc1b
cmpl $0x10000000, 0xdc(%r14) # imm = 0x10000000
je 0x2b995
movl 0xe0(%r14), %ecx
addl $-0x8, %ecx
roll $0x1d, %ecx
cmpl $0x7, %ecx
ja 0x2b98d
movl $0x8b, %edx
btl %ecx, %edx
jae 0x2b98d
movl %ecx, %ecx
leaq 0xc267(%rip), %rdx      # 0x37d70
movq (%rdx,%rcx,8), %rsi
leaq (%rbx,%rax), %rdi
decq %rdi
jmp 0x2b988
movw $0x24, (%rbx,%rax)
jmp 0x2bb27
movw $0x25, (%rbx,%rax)
incq %rax
addq %rbx, %rax
movq %rax, %rdi
movq %r15, %rsi
callq 0x8150
movq %rbx, %rdi
callq 0x8090
cmpb $0x0, 0x9c(%r14)
je 0x2bbde
leaq 0x9c(%r14), %r12
cmpb $0x0, (%r15)
je 0x2bb71
movb $0x0, 0x2(%rbx,%rax)
movw $0x202c, (%rbx,%rax)    # imm = 0x202C
cmpb $0x0, (%r12)
je 0x2bbde
addq $0x2, %rax
movl 0xdc(%r14), %ecx
testl %ecx, %ecx
js 0x2bbea
cmpl $0x0, 0x78(%r14)
je 0x2bb95
movw $0x2a, 0x14(%r14,%rax)
incq %rax
movl 0xdc(%r14), %ecx
btl $0x1d, %ecx
jb 0x2bbf2
testl %ecx, %ecx
js 0x2bbea
cmpl $0x0, 0x270(%r14)
jne 0x2bbb3
cmpl $0x0, 0x274(%r14)
je 0x2bbfb
movw $0x25, 0x14(%r14,%rax)
cmpl $0x0, 0x270(%r14)
leaq 0x1(%rbx,%rax), %rdi
je 0x2bc2d
movl 0x100(%r14), %eax
leaq 0xcc28(%rip), %rcx      # 0x38800
leaq (%rcx,%rax,4), %rsi
jmp 0x2bc34
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movw $0x24, (%rbx,%rax)
jmp 0x2bbf8
movw $0x25, (%rbx,%rax)
incq %rax
addq %rax, %rbx
movq %rbx, %rdi
movq %r12, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x8150
leaq 0xcbf1(%rip), %rsi      # 0x3880c
callq 0x8150
movq %rbx, %rdi
callq 0x8090
jmp 0x2bb2a
leaq 0xcbd8(%rip), %rsi      # 0x3880c
callq 0x8150
movq %rbx, %rdi
callq 0x8090
jmp 0x2bbfb