// File: /workspace/github_c_makefile_star2_O0/Nico01[P]obj2asm/odisasm.c
// Function: mod1
int mod1( ref_mode, sib_offset, sib_text, text, r_m )
    int             ref_mode;
    int             sib_offset;
    char            *sib_text;
    char            *text;
    uchar   r_m;
{
    char            temp[50];
    dword   offset;
    int             result;
    uchar   zero_rm;

    if ( check_getc( &offset ) ) {
        result = -1;
    } else {
        if ( addr_large ) {
            /*
            ** Assembler should have optimized
            */
            zero_rm = 5;
            strcpy( text, addr_386m[r_m] );
        } else {
            /*
            ** Assembler should have optimized
            */
            zero_rm = 6;
            strcpy( text, addr_mode[r_m] );
        }
        if ( strlen(sib_text) ) {
            strcat( text, "+" );
            strcat( text, sib_text );
        }
        if ( offset >= 0x80 ) {
            sprintf( temp, "-0%02lXh", 0x0100L-offset );
        } else {
            if ( offset == 0L ) {
                if ( r_m == zero_rm ) {
                    temp[0] = '\0';
                } else {
                    return( -1 );
                }
            } else {
                sprintf( temp, "+0%02lXh", offset );
            }
        }
        if ( compatibility == 2 ) {
            strcat( text, "]" );
            strcat( text, temp );
        } else {
            strcat( text, temp );
            strcat( text, "]" );
        }
        result = 1 + sib_offset;
    }
    return( result );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movb %r8b, %al
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movb %al, -0x21(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x9460
cmpl $0x0, %eax
je 0xb306
movl $0xffffffff, -0x6c(%rbp) # imm = 0xFFFFFFFF
jmp 0xb42d
cmpl $0x0, 0x14d53(%rip)     # 0x20060
je 0xb32f
movb $0x5, -0x6d(%rbp)
movq -0x20(%rbp), %rdi
movzbl -0x21(%rbp), %eax
movl %eax, %ecx
leaq 0x1103c(%rip), %rax     # 0x1c360
movq (%rax,%rcx,8), %rsi
callq 0x9060
jmp 0xb34d
movb $0x6, -0x6d(%rbp)
movq -0x20(%rbp), %rdi
movzbl -0x21(%rbp), %eax
movl %eax, %ecx
leaq 0x10fdc(%rip), %rax     # 0x1c320
movq (%rax,%rcx,8), %rsi
callq 0x9060
movq -0x18(%rbp), %rdi
callq 0x90a0
cmpq $0x0, %rax
je 0xb379
movq -0x20(%rbp), %rdi
leaq 0xc066(%rip), %rsi      # 0x173cd
callq 0x9180
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9180
cmpq $0x80, -0x68(%rbp)
jb 0xb3a0
leaq -0x60(%rbp), %rdi
movl $0x100, %edx            # imm = 0x100
subq -0x68(%rbp), %rdx
leaq 0xbf42(%rip), %rsi      # 0x172d9
movb $0x0, %al
callq 0x9190
jmp 0xb3dc
cmpq $0x0, -0x68(%rbp)
jne 0xb3c4
movzbl -0x21(%rbp), %eax
movzbl -0x6d(%rbp), %ecx
cmpl %ecx, %eax
jne 0xb3b9
movb $0x0, -0x60(%rbp)
jmp 0xb3c2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xb433
jmp 0xb3da
leaq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rdx
leaq 0xbefb(%rip), %rsi      # 0x172ce
movb $0x0, %al
callq 0x9190
jmp 0xb3dc
leaq 0x14ce5(%rip), %rax     # 0x200c8
cmpl $0x2, (%rax)
jne 0xb407
movq -0x20(%rbp), %rdi
leaq 0xd10d(%rip), %rsi      # 0x18500
callq 0x9180
movq -0x20(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x9180
jmp 0xb424
movq -0x20(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x9180
movq -0x20(%rbp), %rdi
leaq 0xd0e1(%rip), %rsi      # 0x18500
callq 0x9180
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)