// File: /workspace/github_c_makefile_star2_O0/Nico01[P]obj2asm/oprocess.c
// Function: proc_normal
int proc_normal(int inst_proc)
{
    int      data_size;
    int      data;
    int      inst_length;
    int      zeros;
    int      string_limit;
    int      dcheck;
    char     temp[3];
    int      this_size;
    int      data_type;
    int      direct;
    LINE_T   Line, *pLine;
    SCOPE_T  Scope, *pEndScope, *pArgScope, *pLocScope, *pScope;
    NODE_T  *pNode;
    LOCAL_VAR *pVar;

    data_type = UNKNOWN;
    /*
    ** Step 0, determine if there is a hint record at this position
    */
    hint_search.seg_idx    = segment;
    hint_search.offset     = inst_offset;
    direct = RIGHT;
    while ( hint_node != hint_tree
            && (direct = hint_compare( &hint_search, hint_rec )) == LEFT ) {
        hint_advance();
        direct = RIGHT;
    }
    if ( direct == EQUAL ) {
        data_type = hint_rec->hint_type;
    }

    if ( data_type == UNKNOWN ) {       /* Default, search for string */
        /*
        ** Step 1, Is it a string?
        */
        data_size = 0;
        zeros = TRUE;
        do {
            data = buff_getc();
            if ( data == EOF ) {
                break;
            }
            if ( data != 0 && data != 0x0A && data != 0x0D && data != 0x1B
                  && (data < ' ' || data > '~') ) {
                break;
            }
            if ( data != 0 ) {
                zeros = FALSE;
            }
            data_size++;
            inst_offset++;
            dcheck = data_check( 0 );
        } while ( dcheck == NORMAL || dcheck == BAD );

        if ( inst_proc ) {
            string_limit = code_string;
        } else {
            string_limit = data_string;
        }
        if ( data_size >= string_limit || (zeros && data_size > 1) ) {
            if ( last_pub_rec && last_pub_rec->type > FAR ) {
                this_size = type_to_size(last_pub_rec->type);
                if ( data_size < this_size ) {
                    last_pub_rec->type = BYTE_PTR;
                }
                data_byte( this_size );
                buff_reseek();
                inst_offset -= data_size;
                inst_offset += this_size;
                last_pub_rec = NULL;
                return( this_size );
            } else {
                /*
                ** Either near, far, or unknown
                */
                if ( last_pub_rec && pass == 3 ) {
                    if ( last_pub_rec->type == FAR ) {
                        out_directive("=");
                        out_operand("$");
                    }
                    if ( last_pub_rec->type == NEAR ) {
                        out_endline();
                    }
                }
                empty_string( data_size );
                buff_reseek();
                last_pub_rec = NULL;
                return( data_size );
            }
        }
        buff_reseek();
        inst_offset -= data_size;
    }

    if ( data_type == NEAR || (inst_proc && data_type == UNKNOWN) ) {
        data = (uchar)buff_getc();
#ifdef DEBUG
        printf("Disassembly instruction lookup [%02X]\n", data );
#endif
        hex_finish = TRUE;

        inst_length = (*instr[data].rtn)
                        ((uchar)data,
                        instr[data].text,
                        instr[data].special );
        if ( inst_length == 0 ) {       /* Wrong, it wasn't an instruction */
            data_type = UNKNOWN;
        }
    } else {
        inst_length = 0;
    }

    if ( inst_length ) {
        /*
        ** Check for instruction routine returning the proper number
        ** of bytes eaten from buffer.
        */
        if ( buff_cur - buff_beg != inst_length ) {
#ifdef DEBUG
            printf("PN: Buffer remaining: %04d Length remaining: %04d\n",
                                        buff_cur - buff_beg, inst_length );
#endif
            fmt_error("Disassembly Internal Instruction Processing" );
        }

        /*
        ** Yes, instruction, throw away buffer
        */
        if ( !*hex_comment ) {
            Line.hex_offset = inst_offset;
            pLine = find(&Line, line_tree, TC linnum_compare, NULL);
            Scope.hex_offset = inst_offset+inst_length;
            if (pass==3) {
              pScope = pEndScope = find(&Scope, end_scope_tree, TC scope_compare, &pNode);
              pArgScope = find(&Scope, arg_scope_tree, TC scope_compare, NULL);
              pLocScope = find(&Scope, loc_scope_tree, TC scope_compare, NULL);
              while (pScope && pEndScope->hex_offset == pScope->hex_offset) {
                out_comment("End of scope");
                pScope = pNode->ptr[LEFT]->data;
                pNode = pNode->ptr[LEFT];
              }
              if (pLocScope) {
                out_line("; Start of scope (locals)","","","");
                pVar = pLocScope->head;
                while (pVar) {
                  out_var(pVar);
                  pVar = pVar->next;
                }
              }
              if (pArgScope) {
                out_line("; Start of scope (arguments)","","","");
                pVar = pArgScope->head;
                while (pVar) {
                  out_var(pVar);
                  pVar = pVar->next;
                }
              }
            }
            if (pLine)
              sprintf(hex_comment, "[%05d] %04X: ", pLine->line_number, inst_offset);
            else
              sprintf(hex_comment, "        %04X: ", inst_offset );
        }
        this_size = inst_length;
        while ( this_size-- ) {
            sprintf( temp, "%02X", (uchar)buff_regetc() );
            strcat( hex_comment, temp );
        }
        if ( hex_finish ) {
            if ( pass == 3 ) {
                if ( hex_output ) {
                    out_comment( hex_comment );
                }
                out_endline();
            }
            *hex_comment = 0;
        }
        inst_offset += inst_length;
        if ( last_pub_rec ) {
            if ( last_pub_rec->type != FAR ) {
                last_pub_rec->type = NEAR;
            }
            last_pub_rec = NULL;
        }
        return( inst_length );
    }

    /*
    ** Ingore any assumes that might have been pending
    */
    abort_assumes();

    /*
    ** Nope, not instruction.  Leave byte
    */
    buff_reseek();      /* Back to start, instruction */
                        /* look may have moved ptr    */
    if ( last_pub_rec && last_pub_rec->type > FAR ) {
        if ( last_pub_rec->type == UNKNOWN ) {
            last_pub_rec->type = BYTE_PTR;      /* Default if not known */
        }
        if ( data_type == UNKNOWN ) {           /* Default if no hint */
            data_type = last_pub_rec->type;
        }
        last_pub_rec->type = data_type;         /* Assign actual type */
    } else {
        if ( data_type == UNKNOWN ) {
            data_type = BYTE_PTR;
        }
    }
    data_size = type_to_size( data_type );
    data_byte( data_size );
    last_pub_rec = NULL;
    inst_offset += data_size;
    return( data_size );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movl %edi, -0x8(%rbp)
movl $0x0, -0x2c(%rbp)
leaq 0x10e24(%rip), %rax     # 0x20360
movl (%rax), %ecx
leaq 0x10d83(%rip), %rax     # 0x202c8
movl %ecx, (%rax)
leaq 0x10e1a(%rip), %rax     # 0x20368
movq (%rax), %rcx
leaq 0x10d70(%rip), %rax     # 0x202c8
movq %rcx, 0x8(%rax)
movl $0x1, -0x30(%rbp)
leaq 0x10d4e(%rip), %rax     # 0x202b8
movq (%rax), %rcx
xorl %eax, %eax
leaq 0x10c32(%rip), %rdx     # 0x201a8
cmpq (%rdx), %rcx
movb %al, -0x89(%rbp)
je 0xf5a6
leaq 0x10d38(%rip), %rax     # 0x202c0
movq (%rax), %rsi
leaq 0x10d36(%rip), %rdi     # 0x202c8
callq 0xca90
movl %eax, -0x30(%rbp)
cmpl $0x0, %eax
sete %al
movb %al, -0x89(%rbp)
movb -0x89(%rbp), %al
testb $0x1, %al
jne 0xf5b2
jmp 0xf5c0
callq 0xe470
movl $0x1, -0x30(%rbp)
jmp 0xf563
cmpl $0x2, -0x30(%rbp)
jne 0xf5d6
leaq 0x10cf3(%rip), %rax     # 0x202c0
movq (%rax), %rax
movl 0x4(%rax), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0xf80e
movl $0x0, -0xc(%rbp)
movl $0x1, -0x18(%rbp)
callq 0x11a60
movl %eax, -0x10(%rbp)
cmpl $-0x1, -0x10(%rbp)
jne 0xf601
jmp 0xf688
cmpl $0x0, -0x10(%rbp)
je 0xf627
cmpl $0xa, -0x10(%rbp)
je 0xf627
cmpl $0xd, -0x10(%rbp)
je 0xf627
cmpl $0x1b, -0x10(%rbp)
je 0xf627
cmpl $0x20, -0x10(%rbp)
jl 0xf625
cmpl $0x7e, -0x10(%rbp)
jle 0xf627
jmp 0xf688
cmpl $0x0, -0x10(%rbp)
je 0xf634
movl $0x0, -0x18(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
leaq 0x10d24(%rip), %rax     # 0x20368
movq (%rax), %rcx
addq $0x1, %rcx
leaq 0x10d16(%rip), %rax     # 0x20368
movq %rcx, (%rax)
xorl %edi, %edi
callq 0xe580
movl %eax, -0x20(%rbp)
movb $0x1, %al
cmpl $0x0, -0x20(%rbp)
movb %al, -0x8a(%rbp)
je 0xf67a
cmpl $0x3, -0x20(%rbp)
sete %al
movb %al, -0x8a(%rbp)
movb -0x8a(%rbp), %al
testb $0x1, %al
jne 0xf5ee
cmpl $0x0, -0x8(%rbp)
je 0xf69c
leaq 0xd59f(%rip), %rax      # 0x1cc34
movl (%rax), %eax
movl %eax, -0x1c(%rbp)
jmp 0xf6a8
leaq 0xd595(%rip), %rax      # 0x1cc38
movl (%rax), %eax
movl %eax, -0x1c(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0xf6c4
cmpl $0x0, -0x18(%rbp)
je 0xf7ee
cmpl $0x1, -0xc(%rbp)
jle 0xf7ee
leaq 0x10b95(%rip), %rax     # 0x20260
cmpq $0x0, (%rax)
je 0xf770
leaq 0x10b84(%rip), %rax     # 0x20260
movq (%rax), %rax
cmpl $0x2, 0x38(%rax)
jle 0xf770
leaq 0x10b70(%rip), %rax     # 0x20260
movq (%rax), %rax
movl 0x38(%rax), %edi
callq 0x11eb0
movl %eax, -0x28(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0xf717
leaq 0x10b53(%rip), %rax     # 0x20260
movq (%rax), %rax
movl $0x3, 0x38(%rax)
movl -0x28(%rbp), %edi
callq 0xe7f0
callq 0x118f0
movslq -0xc(%rbp), %rax
leaq 0x10c39(%rip), %rcx     # 0x20368
movq (%rcx), %rcx
subq %rax, %rcx
leaq 0x10c2c(%rip), %rax     # 0x20368
movq %rcx, (%rax)
movslq -0x28(%rbp), %rcx
leaq 0x10c1e(%rip), %rax     # 0x20368
addq (%rax), %rcx
leaq 0x10c14(%rip), %rax     # 0x20368
movq %rcx, (%rax)
leaq 0x10b02(%rip), %rax     # 0x20260
movq $0x0, (%rax)
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xfca8
leaq 0x10ae9(%rip), %rax     # 0x20260
cmpq $0x0, (%rax)
je 0xf7c8
leaq 0x109b4(%rip), %rax     # 0x20138
cmpl $0x3, (%rax)
jne 0xf7c8
leaq 0x10ad0(%rip), %rax     # 0x20260
movq (%rax), %rax
cmpl $0x2, 0x38(%rax)
jne 0xf7b1
leaq 0x7e01(%rip), %rdi      # 0x175a1
callq 0xe290
leaq 0x856c(%rip), %rdi      # 0x17d18
callq 0xe190
leaq 0x10aa8(%rip), %rax     # 0x20260
movq (%rax), %rax
cmpl $0x1, 0x38(%rax)
jne 0xf7c6
callq 0xe240
jmp 0xf7c8
movl -0xc(%rbp), %edi
callq 0x11650
callq 0x118f0
leaq 0x10a84(%rip), %rax     # 0x20260
movq $0x0, (%rax)
movl -0xc(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xfca8
callq 0x118f0
movslq -0xc(%rbp), %rax
leaq 0x10b6a(%rip), %rcx     # 0x20368
movq (%rcx), %rcx
subq %rax, %rcx
leaq 0x10b5d(%rip), %rax     # 0x20368
movq %rcx, (%rax)
cmpl $0x1, -0x2c(%rbp)
je 0xf820
cmpl $0x0, -0x8(%rbp)
je 0xf892
cmpl $0x0, -0x2c(%rbp)
jne 0xf892
callq 0x11a60
movzbl %al, %eax
movl %eax, -0x10(%rbp)
leaq 0x10b4e(%rip), %rax     # 0x20380
movl $0x1, (%rax)
movslq -0x10(%rbp), %rcx
leaq 0xd44d(%rip), %rax      # 0x1cc90
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl -0x10(%rbp), %ecx
movslq -0x10(%rbp), %rsi
leaq 0xd435(%rip), %rdx      # 0x1cc90
imulq $0x18, %rsi, %rsi
addq %rsi, %rdx
movq 0x10(%rdx), %rsi
movslq -0x10(%rbp), %rdi
leaq 0xd41f(%rip), %rdx      # 0x1cc90
imulq $0x18, %rdi, %rdi
addq %rdi, %rdx
movl 0x8(%rdx), %edx
movzbl %cl, %edi
callq *%rax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0xf890
movl $0x0, -0x2c(%rbp)
jmp 0xf899
movl $0x0, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0xfbea
leaq 0x11efe(%rip), %rax     # 0x217a8
movq (%rax), %rax
leaq 0x11eec(%rip), %rcx     # 0x217a0
movq (%rcx), %rcx
subq %rcx, %rax
movslq -0x14(%rbp), %rcx
cmpq %rcx, %rax
je 0xf8cf
leaq 0x849d(%rip), %rdi      # 0x17d67
callq 0x16e00
cmpb $0x0, 0x10dba(%rip)     # 0x20690
jne 0xfaff
leaq 0x10a85(%rip), %rax     # 0x20368
movq (%rax), %rax
movq %rax, -0x40(%rbp)
leaq 0x1084f(%rip), %rax     # 0x20140
movq (%rax), %rsi
leaq -0x40(%rbp), %rdi
leaq 0x5e11(%rip), %rdx      # 0x15710
xorl %eax, %eax
movl %eax, %ecx
callq 0x16c50
movq %rax, -0x48(%rbp)
leaq 0x10a55(%rip), %rax     # 0x20368
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
leaq 0x10810(%rip), %rax     # 0x20138
cmpl $0x3, (%rax)
jne 0xfaaf
leaq 0x10820(%rip), %rax     # 0x20158
movq (%rax), %rsi
leaq -0x58(%rbp), %rdi
leaq 0x3c5a(%rip), %rdx      # 0x135a0
leaq -0x80(%rbp), %rcx
callq 0x16c50
movq %rax, -0x60(%rbp)
movq %rax, -0x78(%rbp)
leaq 0x107ea(%rip), %rax     # 0x20148
movq (%rax), %rsi
leaq -0x58(%rbp), %rdi
leaq 0x3c34(%rip), %rdx      # 0x135a0
xorl %eax, %eax
movl %eax, %ecx
callq 0x16c50
movq %rax, -0x68(%rbp)
leaq 0x107d0(%rip), %rax     # 0x20150
movq (%rax), %rsi
leaq -0x58(%rbp), %rdi
leaq 0x3c12(%rip), %rdx      # 0x135a0
xorl %eax, %eax
movl %eax, %ecx
callq 0x16c50
movq %rax, -0x70(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x78(%rbp)
movb %al, -0x8b(%rbp)
je 0xf9c1
movq -0x60(%rbp), %rax
movq (%rax), %rax
movq -0x78(%rbp), %rcx
cmpq (%rcx), %rax
sete %al
movb %al, -0x8b(%rbp)
movb -0x8b(%rbp), %al
testb $0x1, %al
jne 0xf9cd
jmp 0xf9f7
leaq 0x83bf(%rip), %rdi      # 0x17d93
callq 0xe1e0
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x80(%rbp)
jmp 0xf99b
cmpq $0x0, -0x70(%rbp)
je 0xfa52
leaq 0x839b(%rip), %rdi      # 0x17da0
leaq 0x87b4(%rip), %rcx      # 0x181c0
movq %rcx, %rsi
movq %rcx, %rdx
callq 0xe2d0
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0xfa50
movq -0x88(%rbp), %rdi
callq 0xfcc0
movq -0x88(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x88(%rbp)
jmp 0xfa26
jmp 0xfa52
cmpq $0x0, -0x68(%rbp)
je 0xfaad
leaq 0x835a(%rip), %rdi      # 0x17dba
leaq 0x8759(%rip), %rcx      # 0x181c0
movq %rcx, %rsi
movq %rcx, %rdx
callq 0xe2d0
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0xfaab
movq -0x88(%rbp), %rdi
callq 0xfcc0
movq -0x88(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x88(%rbp)
jmp 0xfa81
jmp 0xfaad
jmp 0xfaaf
cmpq $0x0, -0x48(%rbp)
je 0xfade
movq -0x48(%rbp), %rax
movl 0x8(%rax), %edx
leaq 0x108a4(%rip), %rax     # 0x20368
movq (%rax), %rcx
leaq 0x10bc2(%rip), %rdi     # 0x20690
leaq 0x8302(%rip), %rsi      # 0x17dd7
movb $0x0, %al
callq 0x9190
jmp 0xfafd
leaq 0x10883(%rip), %rax     # 0x20368
movq (%rax), %rdx
leaq 0x10ba1(%rip), %rdi     # 0x20690
leaq 0x82ef(%rip), %rsi      # 0x17de5
movb $0x0, %al
callq 0x9190
jmp 0xfaff
movl -0x14(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x28(%rbp)
cmpl $0x0, %eax
je 0xfb4f
leaq -0x23(%rbp), %rax
movq %rax, -0x98(%rbp)
callq 0x11910
movq -0x98(%rbp), %rdi
movzbl %al, %edx
leaq 0x8d89(%rip), %rsi      # 0x188bf
movb $0x0, %al
callq 0x9190
leaq -0x23(%rbp), %rsi
leaq 0x10b48(%rip), %rdi     # 0x20690
callq 0x9180
jmp 0xfb05
leaq 0x1082a(%rip), %rax     # 0x20380
cmpl $0x0, (%rax)
je 0xfb8b
leaq 0x105d6(%rip), %rax     # 0x20138
cmpl $0x3, (%rax)
jne 0xfb84
leaq 0x10562(%rip), %rax     # 0x200d0
cmpl $0x0, (%rax)
je 0xfb7f
leaq 0x10b16(%rip), %rdi     # 0x20690
callq 0xe1e0
callq 0xe240
movb $0x0, 0x10b05(%rip)     # 0x20690
movslq -0x14(%rbp), %rcx
leaq 0x107d2(%rip), %rax     # 0x20368
addq (%rax), %rcx
leaq 0x107c8(%rip), %rax     # 0x20368
movq %rcx, (%rax)
leaq 0x106b6(%rip), %rax     # 0x20260
cmpq $0x0, (%rax)
je 0xfbdf
leaq 0x106a9(%rip), %rax     # 0x20260
movq (%rax), %rax
cmpl $0x2, 0x38(%rax)
je 0xfbd1
leaq 0x10699(%rip), %rax     # 0x20260
movq (%rax), %rax
movl $0x1, 0x38(%rax)
leaq 0x10688(%rip), %rax     # 0x20260
movq $0x0, (%rax)
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xfca8
callq 0x124b0
callq 0x118f0
leaq 0x10665(%rip), %rax     # 0x20260
cmpq $0x0, (%rax)
je 0xfc5a
leaq 0x10658(%rip), %rax     # 0x20260
movq (%rax), %rax
cmpl $0x2, 0x38(%rax)
jle 0xfc5a
leaq 0x10648(%rip), %rax     # 0x20260
movq (%rax), %rax
cmpl $0x0, 0x38(%rax)
jne 0xfc32
leaq 0x10638(%rip), %rax     # 0x20260
movq (%rax), %rax
movl $0x3, 0x38(%rax)
cmpl $0x0, -0x2c(%rbp)
jne 0xfc48
leaq 0x10621(%rip), %rax     # 0x20260
movq (%rax), %rax
movl 0x38(%rax), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %ecx
leaq 0x1060e(%rip), %rax     # 0x20260
movq (%rax), %rax
movl %ecx, 0x38(%rax)
jmp 0xfc69
cmpl $0x0, -0x2c(%rbp)
jne 0xfc67
movl $0x3, -0x2c(%rbp)
jmp 0xfc69
movl -0x2c(%rbp), %edi
callq 0x11eb0
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %edi
callq 0xe7f0
leaq 0x105dd(%rip), %rax     # 0x20260
movq $0x0, (%rax)
movslq -0xc(%rbp), %rcx
leaq 0x106d3(%rip), %rax     # 0x20368
addq (%rax), %rcx
leaq 0x106c9(%rip), %rax     # 0x20368
movq %rcx, (%rax)
movl -0xc(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)