// File: /workspace/github_c_makefile_star2_O3/Nico01[P]obj2asm/oprocess.c
// Function: data_check
int data_check( offset )
    word    offset;
{
    int             direct;

    /*
    ** Are we at a public symbol?
    */
    pub_search.seg_idx = segment;
    pub_search.offset  = inst_offset + offset;
    direct = RIGHT;
    while ( pub_node != public_tree
            && (direct = pub_compare( &pub_search, pub_rec )) == LEFT ) {
        lone_public();
        pub_advance();
    }
    if ( direct == EQUAL ) {
        return( LABEL );
    }

    /*
    ** Are we at a fix-up position?
    */
    fix_search.seg_idx    = segment;
    fix_search.dat_offset = data_offset;
    fix_search.offset     = (int)(inst_offset - data_offset) + offset;
    direct = RIGHT;
    while ( fix_node != fix_tree 
            && (direct = fix_compare( &fix_search, fix_rec )) == LEFT ) {
        fix_advance();
    }
    /* Are we on a fixup that is in the right position?  We can't just test
    ** whether the "direct==EQUAL" because we could have fixups from the
    ** next data record showing up.
    */
    if ( fix_rec->seg_idx == segment
      && fix_rec->dat_offset + fix_rec->offset == inst_offset + offset ) {
        return( FIXUP );
    }
    /*
    ** Are we close to a public symbol? (prevents 2 byte operands)
    */
    if ( pub_node != public_tree 
            && pub_rec->seg_idx == pub_search.seg_idx 
            && pub_rec->offset  == pub_search.offset + 1 ) {
        return( BAD );
    }
    /*
    ** Are we close to a fix-up? (prevents 2 byte operands)
    */
    if ( fix_node != fix_tree
      && fix_rec->seg_idx == segment
      && fix_rec->dat_offset + fix_rec->offset == inst_offset + offset + 1 ) {
        return( BAD );
    }
    return( 0 );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x10468(%rip), %rax     # 0x1d190
movl (%rax), %ecx
leaq 0x10367(%rip), %rsi     # 0x1d098
movl %ecx, (%rsi)
leaq 0x1045e(%rip), %r13     # 0x1d198
movq (%r13), %rax
movl %edi, %edx
movq %rdx, (%rsp)
addq %rax, %rdx
movq %rdx, 0x8(%rsi)
leaq 0x1032e(%rip), %rbp     # 0x1d080
movq (%rbp), %rdx
leaq 0x1024b(%rip), %r15     # 0x1cfa8
cmpq (%r15), %rdx
je 0xcdc2
leaq 0x1031f(%rip), %r12     # 0x1d088
movq (%r12), %rsi
leaq 0x10324(%rip), %r14     # 0x1d098
movq %r14, %rdi
callq 0x11bec
testl %eax, %eax
jne 0xcda6
callq 0xcc8c
movq (%rbp), %rdi
movl $0x1, %esi
callq 0x1288c
movq %rax, (%rbp)
movq 0x20(%rax), %rsi
movq %rsi, (%r12)
cmpq (%r15), %rax
jne 0xcd74
jmp 0xcdb5
cmpl $0x2, %eax
jne 0xcdb5
movl $0x1, %eax
jmp 0xced7
leaq 0x103d4(%rip), %rax     # 0x1d190
movl (%rax), %ecx
movq (%r13), %rax
leaq 0x10357(%rip), %rdx     # 0x1d120
movl %ecx, (%rdx)
leaq 0x118be(%rip), %rsi     # 0x1e690
movq (%rsi), %rsi
movq %rsi, 0x8(%rdx)
subl %esi, %eax
addl %ebx, %eax
movl %eax, 0x10(%rdx)
leaq 0x10329(%rip), %r14     # 0x1d110
movq (%r14), %rax
leaq 0x101df(%rip), %r13     # 0x1cfd0
leaq 0x10320(%rip), %r12     # 0x1d118
movq (%r12), %rsi
cmpq (%r13), %rax
je 0xce42
leaq 0x10317(%rip), %rbx     # 0x1d120
movq %rbx, %rdi
callq 0x11204
testl %eax, %eax
jne 0xce35
movq (%r14), %rdi
movl $0x1, %esi
callq 0x1288c
movq %rax, (%r14)
movq 0x20(%rax), %rsi
movq %rsi, (%r12)
cmpq (%r13), %rax
jne 0xce09
jmp 0xce39
movq (%r12), %rsi
leaq 0x10350(%rip), %rax     # 0x1d190
movl (%rax), %ecx
movl (%rsi), %edx
cmpl %ecx, %edx
jne 0xce68
movslq 0x10(%rsi), %rdi
addq 0x8(%rsi), %rdi
leaq 0x10341(%rip), %rax     # 0x1d198
movq (%rax), %r8
addq (%rsp), %r8
movl $0x2, %eax
cmpq %r8, %rdi
je 0xced7
movq (%rbp), %rax
cmpq (%r15), %rax
je 0xcea2
leaq 0x10210(%rip), %rax     # 0x1d088
movq (%rax), %rdi
movl (%rdi), %eax
leaq 0x10214(%rip), %r8      # 0x1d098
cmpl (%r8), %eax
jne 0xcea2
leaq 0x10208(%rip), %rax     # 0x1d098
movq 0x8(%rax), %r8
incq %r8
movl $0x3, %eax
cmpq %r8, 0x8(%rdi)
je 0xced7
cmpl %ecx, %edx
jne 0xced5
movq (%r13), %rax
cmpq %rax, (%r14)
je 0xced5
movslq 0x10(%rsi), %rcx
addq 0x8(%rsi), %rcx
leaq 0x102da(%rip), %rax     # 0x1d198
movq (%rax), %rax
movq (%rsp), %rdx
addq %rax, %rdx
incq %rdx
movl $0x3, %eax
cmpq %rdx, %rcx
je 0xced7
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq