// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xb9af(%rip), %rsi      # 0x181c0
callq 0x9060
movq -0x10(%rbp), %rdi
leaq 0xb99f(%rip), %rsi      # 0x181c0
callq 0x9060
cmpl $0xa, -0x14(%rbp)
jne 0xc847
cmpl $0x0, -0x18(%rbp)
jne 0xc842
movq -0x8(%rbp), %rdi
leaq 0xaba2(%rip), %rsi      # 0x173df
callq 0x9060
jmp 0xca89
cmpl $0xb, -0x14(%rbp)
jne 0xc852
jmp 0xca89
cmpl $0xc, -0x14(%rbp)
jl 0xc88a
cmpl $0xf, -0x14(%rbp)
jg 0xc88a
movl -0x14(%rbp), %eax
subl $0xc, %eax
shll $0x3, %eax
addl -0x18(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movslq -0x1c(%rbp), %rcx
leaq 0x10214(%rip), %rax     # 0x1ca90
movq (%rax,%rcx,8), %rsi
callq 0x9060
jmp 0xca89
cmpl $0x10, -0x14(%rbp)
jl 0xc8d5
cmpl $0x1f, -0x14(%rbp)
jg 0xc8d5
cmpl $0x15, -0x14(%rbp)
jne 0xc8b2
cmpl $0x1, -0x18(%rbp)
jne 0xc8b2
movq -0x8(%rbp), %rdi
leaq 0xab37(%rip), %rsi      # 0x173e4
callq 0x9060
cmpl $0x1c, -0x14(%rbp)
jne 0xc8d0
movq -0x8(%rbp), %rdi
movslq -0x18(%rbp), %rcx
leaq 0x102c9(%rip), %rax     # 0x1cb90
movq (%rax,%rcx,8), %rsi
callq 0x9060
jmp 0xca89
cmpl $0x22, -0x14(%rbp)
je 0xc8f3
cmpl $0x23, -0x14(%rbp)
je 0xc8f3
cmpl $0x29, -0x14(%rbp)
je 0xc8f3
cmpl $0x2c, -0x14(%rbp)
jl 0xc8f8
cmpl $0x2f, -0x14(%rbp)
jg 0xc8f8
jmp 0xca89
cmpl $0x33, -0x14(%rbp)
jne 0xc919
cmpl $0x1, -0x18(%rbp)
jne 0xc914
movq -0x8(%rbp), %rdi
leaq 0xaadd(%rip), %rsi      # 0x173ec
callq 0x9060
jmp 0xca89
cmpl $0x32, -0x14(%rbp)
jne 0xc924
jmp 0xca89
cmpl $0x38, -0x14(%rbp)
je 0xc93c
cmpl $0x39, -0x14(%rbp)
je 0xc93c
cmpl $0x3a, -0x14(%rbp)
je 0xc93c
cmpl $0x3b, -0x14(%rbp)
jne 0xc941
jmp 0xca89
cmpl $0x3c, -0x14(%rbp)
jne 0xc972
cmpl $0x0, -0x18(%rbp)
jne 0xc96d
movq -0x8(%rbp), %rdi
leaq 0xaa9b(%rip), %rsi      # 0x173f3
callq 0x9060
movq -0x10(%rbp), %rdi
leaq 0xa999(%rip), %rsi      # 0x17301
callq 0x9060
jmp 0xca89
cmpl $0x3d, -0x14(%rbp)
je 0xc984
cmpl $0x3e, -0x14(%rbp)
je 0xc984
cmpl $0x3f, -0x14(%rbp)
jne 0xc989
jmp 0xca89
movl -0x14(%rbp), %eax
andl $0xf, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x2, -0x1c(%rbp)
je 0xc9b6
cmpl $0x3, -0x1c(%rbp)
je 0xc9b6
cmpl $0x8, -0x1c(%rbp)
je 0xc9b6
cmpl $0x9, -0x1c(%rbp)
je 0xc9b6
cmpl $0xa, -0x1c(%rbp)
je 0xc9b6
cmpl $0xb, -0x1c(%rbp)
jne 0xc9cd
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %edx
leaq 0xaa42(%rip), %rsi      # 0x17406
movb $0x0, %al
callq 0x9190
jmp 0xca01
cmpl $0x10, -0x14(%rbp)
jl 0xc9ea
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %edx
leaq 0xaa18(%rip), %rsi      # 0x173f9
movb $0x0, %al
callq 0x9190
jmp 0xc9ff
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %edx
leaq 0xaa0b(%rip), %rsi      # 0x17403
movb $0x0, %al
callq 0x9190
jmp 0xca01
cmpl $0x24, -0x14(%rbp)
je 0xca19
cmpl $0x34, -0x14(%rbp)
je 0xca19
cmpl $0x26, -0x14(%rbp)
je 0xca19
cmpl $0x36, -0x14(%rbp)
jne 0xca22
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x25, -0x14(%rbp)
je 0xca3a
cmpl $0x35, -0x14(%rbp)
je 0xca3a
cmpl $0x27, -0x14(%rbp)
je 0xca3a
cmpl $0x37, -0x14(%rbp)
jne 0xca43
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x9, -0x14(%rbp)
jne 0xca5b
movq -0x8(%rbp), %rdi
leaq 0xa9b9(%rip), %rsi      # 0x1740d
callq 0x9060
jmp 0xca73
movq -0x8(%rbp), %rdi
movslq -0x1c(%rbp), %rcx
leaq 0x11a26(%rip), %rax     # 0x1e490
movq (%rax,%rcx,8), %rsi
callq 0x9060
cmpl $0x30, -0x14(%rbp)
jl 0xca89
movq -0x8(%rbp), %rdi
leaq 0xb46d(%rip), %rsi      # 0x17ef1
callq 0x9180
addq $0x20, %rsp
popq %rbp
retq
nop