// File: /workspace/github_c_makefile_star2_O1/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 0x2c271
cmpl $0x64, %ecx
jl 0x2c114
addl $-0x64, %ecx
movl %ecx, 0x210(%r14)
leaq (%rbx,%rax), %rdi
decq %rdi
movslq 0x210(%r14), %rax
leaq 0xc6f7(%rip), %rcx      # 0x38820
leaq (%rcx,%rax,4), %rsi
addq $-0x4, %rsi
callq 0x8150
movq %rbx, %rdi
callq 0x8090
cmpl $0x1, 0x27c(%r14)
jne 0x2c174
xorl %ecx, %ecx
movl $0xa, %edx
subq %rax, %rdx
cmovaeq %rdx, %rcx
leaq (%rbx,%rax), %rdi
shll $0x4, %ecx
leaq 0xc5ec(%rip), %rsi      # 0x38750
addq %rcx, %rsi
callq 0x8150
movq %rbx, %rdi
callq 0x8090
cmpl $0x0, 0x278(%r14)
je 0x2c1b8
leaq 0x16c(%r14), %rsi
movl 0x1ac(%r14), %edx
movw $0x25, %cx
btl $0x1d, %edx
jb 0x2c19e
testl %edx, %edx
jns 0x2c1a5
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 0x2c1db
cmpb $0x0, 0x104(%r14)
je 0x2c1db
movb $0x0, 0x2(%rbx,%rax)
movw $0x202c, (%rbx,%rax)    # imm = 0x202C
addq $0x2, %rax
leaq 0x104(%r14), %r15
cmpb $0x0, 0x104(%r14)
je 0x2c2e6
cmpl $0x0, 0x144(%r14)
js 0x2c2bf
cmpl $0x0, 0x78(%r14)
je 0x2c20e
movw $0x2a, (%rbx,%rax)
incq %rax
movl 0x144(%r14), %ecx
btl $0x1d, %ecx
jb 0x2c2c7
testl %ecx, %ecx
js 0x2c2bf
cmpl $0x0, 0x270(%r14)
jne 0x2c23f
cmpl $0x0, 0x274(%r14)
je 0x2c2d0
movw $0x25, 0x14(%r14,%rax)
cmpl $0x0, 0x270(%r14)
leaq 0x1(%rbx,%rax), %rdi
je 0x2c3b3
movl 0x168(%r14), %eax
leaq 0xc598(%rip), %rcx      # 0x38800
leaq (%rcx,%rax,4), %rsi
jmp 0x2c3ba
cmpl $0x10000000, 0xdc(%r14) # imm = 0x10000000
je 0x2c13e
movl 0xe0(%r14), %ecx
addl $-0x8, %ecx
roll $0x1d, %ecx
cmpl $0x7, %ecx
ja 0x2c136
movl $0x8b, %edx
btl %ecx, %edx
jae 0x2c136
movl %ecx, %ecx
leaq 0xbac1(%rip), %rdx      # 0x37d70
movq (%rdx,%rcx,8), %rsi
leaq (%rbx,%rax), %rdi
decq %rdi
jmp 0x2c131
movw $0x24, (%rbx,%rax)
jmp 0x2c2cd
movw $0x25, (%rbx,%rax)
incq %rax
addq %rbx, %rax
movq %rax, %rdi
movq %r15, %rsi
callq 0x8150
movq %rbx, %rdi
callq 0x8090
leaq 0x9c(%r14), %r12
cmpb $0x0, 0x9c(%r14)
je 0x2c30c
cmpb $0x0, (%r15)
je 0x2c30c
movb $0x0, 0x2(%rbx,%rax)
movw $0x202c, (%rbx,%rax)    # imm = 0x202C
addq $0x2, %rax
cmpb $0x0, (%r12)
je 0x2c37d
cmpl $0x0, 0xdc(%r14)
js 0x2c389
cmpl $0x0, 0x78(%r14)
je 0x2c32d
movw $0x2a, (%rbx,%rax)
incq %rax
movl 0xdc(%r14), %ecx
btl $0x1d, %ecx
jb 0x2c391
testl %ecx, %ecx
js 0x2c389
cmpl $0x0, 0x270(%r14)
jne 0x2c352
cmpl $0x0, 0x274(%r14)
je 0x2c39a
movw $0x25, 0x14(%r14,%rax)
cmpl $0x0, 0x270(%r14)
leaq 0x1(%rbx,%rax), %rdi
je 0x2c3cc
movl 0x100(%r14), %eax
leaq 0xc489(%rip), %rcx      # 0x38800
leaq (%rcx,%rax,4), %rsi
jmp 0x2c3d3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movw $0x24, (%rbx,%rax)
jmp 0x2c397
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 0xc452(%rip), %rsi      # 0x3880c
callq 0x8150
movq %rbx, %rdi
callq 0x8090
jmp 0x2c2d0
leaq 0xc439(%rip), %rsi      # 0x3880c
callq 0x8150
movq %rbx, %rdi
callq 0x8090
jmp 0x2c39a