// File: /workspace/github_c_makefile_star2_O1/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, 0x135bf(%rip)     # 0x1ce84
movl $0x2, %ebx
cmovel %eax, %ebx
testb $0x1, %dil
cmovel %eax, %ebx
leal 0x56(%rdi), %eax
cmpb $0x5, %al
ja 0x98f5
leaq 0x97a6(%rip), %rcx      # 0x13088
movzbl %al, %eax
movl (%rcx,%rax,4), %ebp
leaq 0xf4a9(%rip), %rcx      # 0x18d98
movq (%rcx,%rax,8), %r14
jmp 0x98fe
leaq 0x9930(%rip), %r14      # 0x1322c
xorl %ebp, %ebp
leaq 0x6(%rsp), %rdi
callq 0x9070
movslq 0x10179(%rip), %rax     # 0x19a88
cmpq $-0x1, %rax
je 0x9948
cmpl $0x2, %ebp
je 0x997c
movl %ebx, %ecx
leaq 0xfd2d(%rip), %rdx      # 0x19650
cmpl $0x1, %ebp
jne 0x9980
movq (%rdx,%rcx,8), %rdx
leaq 0xf90d(%rip), %rcx      # 0x19240
movq (%rcx,%rax,8), %rcx
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x91b0
jmp 0x99a1
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 0x97c1
movl $0x1, %ebx
jmp 0x99c6
xorl %ebx, %ebx
jmp 0x99c6
movq (%rdx,%rcx,8), %rcx
leaq 0xf8b5(%rip), %rdx      # 0x19240
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 0x97c1
leaq 0x135b6(%rip), %rax     # 0x1cf68
movl $0x1, %ebx
cmpl $0x3, (%rax)
jne 0x99c6
leaq 0x10(%rsp), %rdi
callq 0xc9d9
movl %ebx, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq