// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
leaq 0x11dce(%rip), %rax     # 0x20360
movl (%rax), %ecx
leaq 0x11ccd(%rip), %rax     # 0x20268
movl %ecx, (%rax)
leaq 0x11dc4(%rip), %rax     # 0x20368
movq (%rax), %rcx
movl -0x8(%rbp), %eax
addq %rax, %rcx
leaq 0x11cb4(%rip), %rax     # 0x20268
movq %rcx, 0x8(%rax)
movl $0x1, -0xc(%rbp)
leaq 0x11c8a(%rip), %rax     # 0x20250
movq (%rax), %rcx
xorl %eax, %eax
leaq 0x11ba6(%rip), %rdx     # 0x20178
cmpq (%rdx), %rcx
movb %al, -0xd(%rbp)
je 0xe5fc
leaq 0x11c77(%rip), %rax     # 0x20258
movq (%rax), %rsi
leaq 0x11c7d(%rip), %rdi     # 0x20268
callq 0x15a10
movl %eax, -0xc(%rbp)
cmpl $0x0, %eax
sete %al
movb %al, -0xd(%rbp)
movb -0xd(%rbp), %al
testb $0x1, %al
jne 0xe605
jmp 0xe611
callq 0xe4b0
callq 0xe3f0
jmp 0xe5bf
cmpl $0x2, -0xc(%rbp)
jne 0xe623
movl $0x1, -0x4(%rbp)
jmp 0xe7e5
leaq 0x11d36(%rip), %rax     # 0x20360
movl (%rax), %ecx
leaq 0x11cbd(%rip), %rax     # 0x202f0
movl %ecx, (%rax)
leaq 0x13224(%rip), %rax     # 0x21860
movq (%rax), %rcx
leaq 0x11caa(%rip), %rax     # 0x202f0
movq %rcx, 0x8(%rax)
leaq 0x11d17(%rip), %rax     # 0x20368
movq (%rax), %rax
leaq 0x13205(%rip), %rcx     # 0x21860
subq (%rcx), %rax
movl %eax, %ecx
addl -0x8(%rbp), %ecx
leaq 0x11c86(%rip), %rax     # 0x202f0
movl %ecx, 0x10(%rax)
movl $0x1, -0xc(%rbp)
leaq 0x11c65(%rip), %rax     # 0x202e0
movq (%rax), %rcx
xorl %eax, %eax
leaq 0x11b19(%rip), %rdx     # 0x201a0
cmpq (%rdx), %rcx
movb %al, -0xe(%rbp)
je 0xe6b1
leaq 0x11c52(%rip), %rax     # 0x202e8
movq (%rax), %rsi
leaq 0x11c50(%rip), %rdi     # 0x202f0
callq 0x14a80
movl %eax, -0xc(%rbp)
cmpl $0x0, %eax
sete %al
movb %al, -0xe(%rbp)
movb -0xe(%rbp), %al
testb $0x1, %al
jne 0xe6ba
jmp 0xe6c1
callq 0xe430
jmp 0xe674
leaq 0x11c20(%rip), %rax     # 0x202e8
movq (%rax), %rax
movl (%rax), %eax
leaq 0x11c8c(%rip), %rcx     # 0x20360
cmpl (%rcx), %eax
jne 0xe718
leaq 0x11c09(%rip), %rax     # 0x202e8
movq (%rax), %rax
movq 0x8(%rax), %rax
leaq 0x11bfb(%rip), %rcx     # 0x202e8
movq (%rcx), %rcx
movslq 0x10(%rcx), %rcx
addq %rcx, %rax
leaq 0x11c6a(%rip), %rcx     # 0x20368
movq (%rcx), %rcx
movl -0x8(%rbp), %edx
addq %rdx, %rcx
cmpq %rcx, %rax
jne 0xe718
movl $0x2, -0x4(%rbp)
jmp 0xe7e5
leaq 0x11b31(%rip), %rax     # 0x20250
movq (%rax), %rax
leaq 0x11a4f(%rip), %rcx     # 0x20178
cmpq (%rcx), %rax
je 0xe770
leaq 0x11b23(%rip), %rax     # 0x20258
movq (%rax), %rax
movl (%rax), %eax
leaq 0x11b27(%rip), %rcx     # 0x20268
cmpl (%rcx), %eax
jne 0xe770
leaq 0x11b0c(%rip), %rax     # 0x20258
movq (%rax), %rax
movq 0x8(%rax), %rax
leaq 0x11b0e(%rip), %rcx     # 0x20268
movq 0x8(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jne 0xe770
movl $0x3, -0x4(%rbp)
jmp 0xe7e5
leaq 0x11b69(%rip), %rax     # 0x202e0
movq (%rax), %rax
leaq 0x11a1f(%rip), %rcx     # 0x201a0
cmpq (%rcx), %rax
je 0xe7de
leaq 0x11b5b(%rip), %rax     # 0x202e8
movq (%rax), %rax
movl (%rax), %eax
leaq 0x11bc7(%rip), %rcx     # 0x20360
cmpl (%rcx), %eax
jne 0xe7de
leaq 0x11b44(%rip), %rax     # 0x202e8
movq (%rax), %rax
movq 0x8(%rax), %rax
leaq 0x11b36(%rip), %rcx     # 0x202e8
movq (%rcx), %rcx
movslq 0x10(%rcx), %rcx
addq %rcx, %rax
leaq 0x11ba5(%rip), %rcx     # 0x20368
movq (%rcx), %rcx
movl -0x8(%rbp), %edx
addq %rdx, %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jne 0xe7de
movl $0x3, -0x4(%rbp)
jmp 0xe7e5
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nop