// File: /workspace/github_c_makefile_star2_O0/Nico01[P]obj2asm/odisasm.c
// Function: disp16
int disp16( byte, text, class )
    uchar   byte;
    char            *text;
    int             class;
{
    dword   offset;
    dword   dest;
    int             dummy;
#if 0
    int             bad_size;
#endif
    char            line[60];
    char            *short_text;
    PUB_T           *pub_rec;
    int             data_size;

    byte = byte;               /* Prevent unused variable warnings */
    class=class;              /* Prevent unused variable warnings */

    data_size = addr_bytes;

    if ( over_seg != -1 )               /* No segment overide allowed */
        return( 0 );

    switch( data_check( 1 ) ) {
    case BAD:
         return( 0 );
    case LABEL:
         return( 0 );
    case FIXUP:
         if ( fix_rec->word_sized && fix_rec->extended == addr_large
                                  && fix_rec->relate == 0 ) {
             get_fix( line, 1, FALSE, size_bytes, NEAR, TRUE, &dummy, CS );
             adjust_assumes();
             instr_opcode( text );
             instr_operand( line );
             return( 1 + data_size );
         } else {
             return( 0 );
         }
    case NORMAL:
         if ( check_getv( &offset, addr_large ) ) {
             return( 0 );
         }
         /* note: the next if actually checks for 1 byte too far in
         ** the negative direction. but this is ok, because it would be
         ** replaced by a short jmp
         */
         if ( offset < 0x80 || offset >= 0xFFFFFF7FL ) {
#if 0
             bad_size = TRUE;
#endif
             short_text = "near ptr ";
         } else {
             short_text = "";
#if 0
             bad_size = FALSE;
#endif
         }

         dest = inst_offset + offset + addr_bytes + 1;
         pub_rec = check_public( 1, segment, dest, 'L' );

         if ( pub_rec ) {
             offset = dest - pub_rec->offset;
             if ( offset > 0L ) {
                 if ( addr_large ) {
                     sprintf( line, "%s%s + 0%08lXh", short_text,
                              pub_rec->name, offset );
                 } else {
                     sprintf( line, "%s%s + 0%04lXh", short_text,
                              pub_rec->name, offset );
                 }
             } else {
                 sprintf( line, "%s%s", short_text, pub_rec->name );
             }
         } else {
             if ( compatibility == 2 ) {
                 if ( addr_large ) {
                     sprintf( line, "%s .0%08lXh", short_text, offset );
                 } else {
                     sprintf( line, "%s .0%04lXh", short_text, offset );
                 }
             } else {
                 if ( addr_large ) {
                     sprintf( line, "%s[%s:0%08lXh]", short_text,
                              cseg_name, offset );
                 } else {
                     sprintf( line, "%s[%s:0%04lXh]", short_text,
                              cseg_name, offset );
                 }
             }
         }

         instr_opcode( text );
         instr_operand( line );
#if 0
         if ( bad_size ) {
             if ( pass == 3 ) {
                 out_comment( "Large jump translated into short" );
             }
             instr_opcode( "nop" );
             if ( pass == 3 ) {
                 out_comment( "Nop inserted to retain proper length" );
             }
         }
#endif
         return( 1 + data_size );
    }
    return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movb %dil, %al
movb %al, -0x5(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movb -0x5(%rbp), %al
movb %al, -0x5(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movl 0x11f16(%rip), %eax     # 0x1ca80
movl %eax, -0x84(%rbp)
cmpl $-0x1, 0x11f01(%rip)    # 0x1ca78
je 0xab85
movl $0x0, -0x4(%rbp)
jmp 0xae54
movl $0x1, %edi
callq 0xe580
movl %eax, %ecx
movq %rcx, -0x90(%rbp)
subl $0x3, %eax
ja 0xae4d
movq -0x90(%rbp), %rax
leaq 0xc4b5(%rip), %rcx      # 0x17064
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x0, -0x4(%rbp)
jmp 0xae54
movl $0x0, -0x4(%rbp)
jmp 0xae54
leaq 0x15711(%rip), %rax     # 0x202e8
movq (%rax), %rax
cmpl $0x0, 0x3c(%rax)
je 0xac5a
leaq 0x15701(%rip), %rax     # 0x202e8
movq (%rax), %rax
movl 0x38(%rax), %eax
cmpl 0x1546d(%rip), %eax     # 0x20060
jne 0xac5a
leaq 0x156ec(%rip), %rax     # 0x202e8
movq (%rax), %rax
cmpl $0x0, 0x14(%rax)
jne 0xac5a
leaq -0x70(%rbp), %rdi
movl 0x11e6d(%rip), %ecx     # 0x1ca7c
movl $0x1, %r9d
xorl %edx, %edx
leaq -0x2c(%rbp), %rax
movl %r9d, %esi
movl %r9d, %r8d
movq %rax, (%rsp)
movl $0x12, 0x8(%rsp)
callq 0x13210
callq 0x123f0
movq -0x10(%rbp), %rdi
callq 0x9670
leaq -0x70(%rbp), %rdi
callq 0x96b0
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xae54
movl $0x0, -0x4(%rbp)
jmp 0xae54
movl 0x153f4(%rip), %esi     # 0x20060
leaq -0x20(%rbp), %rdi
callq 0x95e0
cmpl $0x0, %eax
je 0xac86
movl $0x0, -0x4(%rbp)
jmp 0xae54
cmpq $0x80, -0x20(%rbp)
jb 0xac9b
movl $0xffffff7f, %eax       # imm = 0xFFFFFF7F
cmpq %rax, -0x20(%rbp)
jb 0xaca8
leaq 0xc6d8(%rip), %rax      # 0x1737a
movq %rax, -0x78(%rbp)
jmp 0xacb3
leaq 0xd511(%rip), %rax      # 0x181c0
movq %rax, -0x78(%rbp)
leaq 0x156ae(%rip), %rax     # 0x20368
movq (%rax), %rax
addq -0x20(%rbp), %rax
movslq 0x11db8(%rip), %rcx     # 0x1ca80
addq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
leaq 0x15686(%rip), %rax     # 0x20360
movl (%rax), %esi
movq -0x28(%rbp), %rdx
movl $0x1, %edi
movl $0x4c, %ecx
callq 0x12720
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x80(%rbp)
je 0xad89
movq -0x28(%rbp), %rax
movq -0x80(%rbp), %rcx
subq 0x8(%rcx), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jbe 0xad66
cmpl $0x0, 0x15344(%rip)     # 0x20060
je 0xad42
leaq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rdx
movq -0x80(%rbp), %rcx
addq $0x10, %rcx
movq -0x20(%rbp), %r8
leaq 0xc64b(%rip), %rsi      # 0x17384
movb $0x0, %al
callq 0x9190
jmp 0xad64
leaq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rdx
movq -0x80(%rbp), %rcx
addq $0x10, %rcx
movq -0x20(%rbp), %r8
leaq 0xc5f3(%rip), %rsi      # 0x17350
movb $0x0, %al
callq 0x9190
jmp 0xad84
leaq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rdx
movq -0x80(%rbp), %rcx
addq $0x10, %rcx
leaq 0xd79e(%rip), %rsi      # 0x1851b
movb $0x0, %al
callq 0x9190
jmp 0xae2d
leaq 0x15338(%rip), %rax     # 0x200c8
cmpl $0x2, (%rax)
jne 0xadd6
cmpl $0x0, 0x152c4(%rip)     # 0x20060
je 0xadba
leaq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq 0xc5e2(%rip), %rsi      # 0x17393
movb $0x0, %al
callq 0x9190
jmp 0xadd4
leaq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq 0xc5d2(%rip), %rsi      # 0x1739f
movb $0x0, %al
callq 0x9190
jmp 0xae2b
cmpl $0x0, 0x15283(%rip)     # 0x20060
je 0xae05
leaq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rdx
leaq 0x1558a(%rip), %rax     # 0x20378
movq (%rax), %rcx
movq -0x20(%rbp), %r8
leaq 0xc5af(%rip), %rsi      # 0x173ab
movb $0x0, %al
callq 0x9190
jmp 0xae29
leaq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rdx
leaq 0x15564(%rip), %rax     # 0x20378
movq (%rax), %rcx
movq -0x20(%rbp), %r8
leaq 0xc549(%rip), %rsi      # 0x1736b
movb $0x0, %al
callq 0x9190
jmp 0xae2b
jmp 0xae2d
movq -0x10(%rbp), %rdi
callq 0x9670
leaq -0x70(%rbp), %rdi
callq 0x96b0
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xae54
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq