// File: /workspace/github_c_makefile_star2_O2/Nico01[P]obj2asm/odisasm.c
// Function: string_byte
int string_byte( byte, text, class )
    uchar   byte;
    char            *text;
    int             class;
{
    char            opcode[10];
    char            operand[50];
    int             size;
    int             mode;
    char            *format;

    class = class;                  /* Prevent unused variable warnings */

    size = byte & 0x01;
    if ( size == 1 && size_large ) {
        size = 2;
    }

    switch( byte ) {
        case 0xA4:
        case 0xA5:
            format = "%ses:[di],%s%s[si]";
            mode = 0;
            break;
        case 0xA6:
        case 0xA7:
            format = "%ses:[di],%s%s[si]";
            mode = 0;
            break;
        case 0xAA:
        case 0xAB:
            mode = 2;
            break;
        case 0xAC:
        case 0xAD:
            format = "%s%s[si]";
            mode = 1;
            break;
        case 0xAE:
        case 0xAF:
            mode = 2;
            break;
    }

    strcpy( opcode, text );

    if ( over_seg == -1 ) {
        switch( size ) {
            case 0:     strcat(opcode,"b");     break;
            case 1:     strcat(opcode,"w");     break;
            case 2:     strcat(opcode,"d");     break;
        }
        instr_opcode(opcode);
        return(1);
    } else {
        switch( mode ) {
            case 0:
                sprintf( operand, format, sz_text[size],
                                            sz_text[size], sregsc[over_seg] );
                break;
            case 1:
                sprintf( operand, format, sz_text[size], sregsc[over_seg] );
                break;
            case 2:                 /* No segment overide on */
                return( 0 );        /* SCAS instructions     */
        }
        instr_opcode( opcode );
        instr_operand( operand );
        return(1);
    }

}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movl %edi, %eax
andl $0x1, %eax
cmpl $0x0, 0x12938(%rip)     # 0x1be84
pushq $0x2
popq %rbx
cmovel %eax, %ebx
testb $0x1, %dil
cmovel %eax, %ebx
leal 0x56(%rdi), %eax
cmpb $0x5, %al
ja 0x957a
leaq 0x8b21(%rip), %rcx      # 0x12088
movzbl %al, %eax
movl (%rcx,%rax,4), %ebp
leaq 0xe824(%rip), %rcx      # 0x17d98
movq (%rcx,%rax,8), %r14
jmp 0x9583
leaq 0x8cab(%rip), %r14      # 0x1222c
xorl %ebp, %ebp
leaq 0x6(%rsp), %rdi
callq 0x9070
movslq 0xf4f4(%rip), %rax      # 0x18a88
cmpq $-0x1, %rax
je 0x95cd
cmpl $0x2, %ebp
je 0x95fc
movl %ebx, %ecx
leaq 0xf0a8(%rip), %rdx      # 0x18650
cmpl $0x1, %ebp
jne 0x9600
movq (%rdx,%rcx,8), %rdx
leaq 0xec88(%rip), %rcx      # 0x18240
movq (%rcx,%rax,8), %rcx
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x91b0
jmp 0x9621
shll $0x4, %ebx
movabsq $0x6400770062, %r14     # imm = 0x6400770062
movl %ebx, %ecx
shrq %cl, %r14
leaq 0x6(%rsp), %rbx
movq %rbx, %rdi
callq 0x90b0
movw %r14w, 0x6(%rsp,%rax)
movq %rbx, %rdi
callq 0x9491
jmp 0x9635
xorl %eax, %eax
jmp 0x9638
movq (%rdx,%rcx,8), %rcx
leaq 0xec35(%rip), %rdx      # 0x18240
movq (%rdx,%rax,8), %r8
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
movq %rcx, %rdx
xorl %eax, %eax
callq 0x91b0
leaq 0x6(%rsp), %rdi
callq 0x9491
leaq 0x10(%rsp), %rdi
callq 0x94b3
pushq $0x1
popq %rax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq