// File: /workspace/github_c_makefile_star2_O1/Nico01[P]obj2asm/odisfp.c
// Function: esc_special
void esc_special( opcode, operand, esc_byte, reg )
    char            *opcode;
    char            *operand;
    int             esc_byte;
    int             reg;
{
    int             element;

    strcpy( opcode, "" );
    strcpy( operand, "" );
    
    /*
    ** This routine is bad, but it would make no more sense if it listed
    ** out all of the possible esc_byte and register combinations!
    */
    if ( esc_byte == 0x0A ) {
        if ( reg == 0x00 ) {
            strcpy( opcode, "fnop" );
        }
        return;
    }
    if ( esc_byte == 0x0B ) {
        return;
    }
    if ( esc_byte >= 0x0C && esc_byte <= 0x0F ) {
        element = (esc_byte - 0x0C) * 8 + reg;
        strcpy( opcode, esc_0x0X[element] );
        return;
    }
    if ( esc_byte >= 0x10 && esc_byte <= 0x1F ) {
        if ( esc_byte == 0x15 && reg == 0x01 ) {
            strcpy( opcode, "fucompp" );
        }
        if ( esc_byte == 0x1C ) {
            strcpy( opcode, esc_0x1C[reg] );
        }
        return;
    }
    if ( esc_byte == 0x22 || esc_byte == 0x23 || esc_byte == 0x29 
         || (esc_byte >= 0x2C && esc_byte <= 0x2F) ) {
        return;
    }
    if ( esc_byte == 0x33 ) {
        if ( reg == 0x01 ) {
            strcpy( opcode, "fcompp" );
        }
        return;
    }   
    if ( esc_byte == 0x32 ) {
        return;
    }
    if ( esc_byte == 0x38 || esc_byte == 0x39
      || esc_byte == 0x3A || esc_byte == 0x3B ) {
        return;
    }
    if ( esc_byte == 0x3C ) {
        if ( reg == 0x00 ) {
            strcpy( opcode, "fstsw" );
            strcpy( operand, "ax" );
        }
        return;
    }
    if ( esc_byte == 0x3D || esc_byte == 0x3E || esc_byte == 0x3F ) {
        return;
    }
    element = esc_byte & 0x0F;
    if (    element == 0x02 || element == 0x03 || element == 0x08
         || element == 0x09 || element == 0x0A || element == 0x0B ) {
        sprintf( operand, "st(%d)", reg );
    } else {
        if ( esc_byte >= 0x10 ) {
            sprintf( operand, "st(%d),st", reg );
        } else {
            sprintf( operand, "st,st(%d)", reg );
        }
    }
    if (    esc_byte == 0x24 || esc_byte == 0x34
         || esc_byte == 0x26 || esc_byte == 0x36 ) {
        element++;
    }
    if (    esc_byte == 0x25 || esc_byte == 0x35
         || esc_byte == 0x27 || esc_byte == 0x37 ) {
        --element;
    }
    if ( esc_byte == 0x09 ) {
        strcpy( opcode, "fxch" );
    } else {
        strcpy( opcode, esc_inst[element] );
    }
    if ( esc_byte >= 0x30 ) {
        strcat( opcode, "p" );
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
xorl %eax, %eax
movb %al, (%rdi)
movb %al, (%rsi)
cmpl $0xb, %edx
je 0xb96d
movl %edx, %r14d
movq %rdi, %rbx
cmpl $0xa, %edx
jne 0xb8ed
testl %ecx, %ecx
jne 0xb96d
movb $0x0, 0x4(%rbx)
movl $0x706f6e66, (%rbx)     # imm = 0x706F6E66
jmp 0xb96d
movl %r14d, %eax
andl $-0x4, %eax
cmpl $0xc, %eax
jne 0xb91b
leal (%rcx,%r14,8), %eax
addl $-0x60, %eax
cltq
leaq 0x7a98(%rip), %rcx      # 0x133a0
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x9070
movl %r14d, %edx
andl $-0x10, %edx
cmpl $0x10, %edx
jne 0xb954
movl %r14d, %eax
xorl $0x15, %eax
movl %ecx, %edx
xorl $0x1, %edx
orl %eax, %edx
jne 0xb942
movabsq $0x70706d6f637566, %rax # imm = 0x70706D6F637566
movq %rax, (%rbx)
cmpl $0x1c, %r14d
jne 0xb96d
movslq %ecx, %rax
leaq 0x7ace(%rip), %rcx      # 0x13420
jmp 0xb908
cmpl $0x29, %r14d
ja 0xb972
movl %r14d, %edx
movabsq $0x20c00000000, %rdi    # imm = 0x20C00000000
btq %rdx, %rdi
jae 0xb972
popq %rbx
popq %r14
popq %rbp
retq
cmpl $0x2c, %eax
je 0xb96d
leal -0x32(%r14), %eax
cmpl $0xa, %eax
ja 0xb9a4
leaq 0x79ed(%rip), %rdx      # 0x13374
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
cmpl $0x1, %ecx
jne 0xb96d
movl $0x70706d, 0x3(%rbx)    # imm = 0x70706D
movl $0x6d6f6366, (%rbx)     # imm = 0x6D6F6366
jmp 0xb96d
leal -0x3d(%r14), %eax
cmpl $0x3, %eax
jb 0xb96d
movl %r14d, %eax
andl $0xe, %eax
cmpl $0xa, %eax
ja 0xb9e6
movl $0x504, %edx            # imm = 0x504
btl %eax, %edx
jae 0xb9e6
leaq 0x7a96(%rip), %rax      # 0x1345f
jmp 0xb9fc
testl %ecx, %ecx
jne 0xb96d
movw $0x77, 0x4(%rbx)
movl $0x73747366, (%rbx)     # imm = 0x73747366
movb $0x0, 0x2(%rsi)
movw $0x7861, (%rsi)         # imm = 0x7861
jmp 0xb96d
cmpl $0x10, %r14d
leaq 0x7a61(%rip), %rdx      # 0x13452
leaq 0x7a64(%rip), %rax      # 0x1345c
cmovgeq %rdx, %rax
movl %r14d, %ebp
andl $0xf, %ebp
movq %rsi, %rdi
movq %rax, %rsi
movl %ecx, %edx
xorl %eax, %eax
callq 0x91b0
leal -0x24(%r14), %eax
rorl %eax
cmpl $0x9, %eax
ja 0xba29
movl $0x303, %ecx            # imm = 0x303
btl %eax, %ecx
jae 0xba29
orl $0x1, %ebp
leal -0x25(%r14), %eax
rorl %eax
cmpl $0x9, %eax
ja 0xba40
movl $0x303, %ecx            # imm = 0x303
btl %eax, %ecx
jae 0xba40
decl %ebp
cmpl $0x9, %r14d
jne 0xba52
movb $0x0, 0x4(%rbx)
movl $0x68637866, (%rbx)     # imm = 0x68637866
jmp 0xba68
movslq %ebp, %rax
leaq 0xf904(%rip), %rcx      # 0x1b360
movq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x9070
cmpl $0x30, %r14d
jl 0xb96d
movq %rbx, %rdi
callq 0x90b0
movw $0x70, (%rbx,%rax)
jmp 0xb96d
nopl (%rax)