// File: /workspace/github_c_makefile_star2_O0/Nico01[P]obj2asm/oprocess.c
// Function: proc_label
int proc_label()
{
    char            text[50];
    dword   past_seg;
    char            *size_text;

    if ( pub_rec->type == FAR ) { 
        size_text = "THIS FAR";
    } else {
        size_text = "THIS NEAR";
    }

    if ( pass == 3 ) {
        if ( pub_rec->offset >= seg_rec->length ) {
            past_seg = pub_rec->offset - seg_rec->length;
            if ( past_seg == 0 ) {
                strcpy( text, "$" );
            } else {
                sprintf( text, "$ + 0%04Xh", size_text, past_seg );
            }
            out_line( pub_rec->name, "=", text, "" );
        } else {
            if ( pub_rec->type == FAR ) {
                out_line( pub_rec->name, "equ", "THIS FAR", "" );
            } else {
                if ( pub_rec->type == NEAR ) {
                    /* Put a colon ':' on labels within code segments */
                    sprintf( text, "%s:", pub_rec->name );
                    out_label( text );
                } else {
                    out_label( pub_rec->name );
                }
            }
        }
    }
    last_pub_rec = pub_rec;
    pub_advance();
    if ( pub_rec->seg_idx == last_pub_rec->seg_idx 
            && pub_rec->offset == last_pub_rec->offset ) {
        if ( pass == 3 ) {
            if ( last_pub_rec->type != NEAR ) {
                out_directive( "equ" );
                sprintf( text, "%s", size_text );
                out_operand( text );
            }
            out_endline();
        }
        proc_label();
    }
    return( 0 );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
leaq 0x110c9(%rip), %rax     # 0x20258
movq (%rax), %rax
cmpl $0x2, 0x38(%rax)
jne 0xf1a5
leaq 0x8b9f(%rip), %rax      # 0x17d3e
movq %rax, -0x50(%rbp)
jmp 0xf1b0
leaq 0x8b9b(%rip), %rax      # 0x17d47
movq %rax, -0x50(%rbp)
leaq 0x10f81(%rip), %rax     # 0x20138
cmpl $0x3, (%rax)
jne 0xf2ed
leaq 0x11091(%rip), %rax     # 0x20258
movq (%rax), %rax
movq 0x8(%rax), %rax
leaq 0x10feb(%rip), %rcx     # 0x201c0
movq (%rcx), %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
jb 0xf25f
leaq 0x11071(%rip), %rax     # 0x20258
movq (%rax), %rax
movq 0x8(%rax), %rax
leaq 0x10fcb(%rip), %rcx     # 0x201c0
movq (%rcx), %rcx
movl 0x10(%rcx), %ecx
subq %rcx, %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0xf21b
leaq -0x40(%rbp), %rdi
leaq 0x8b04(%rip), %rsi      # 0x17d18
callq 0x9060
jmp 0xf235
leaq -0x40(%rbp), %rdi
movq -0x50(%rbp), %rdx
movq -0x48(%rbp), %rcx
leaq 0x8b23(%rip), %rsi      # 0x17d51
movb $0x0, %al
callq 0x9190
leaq 0x1101c(%rip), %rax     # 0x20258
movq (%rax), %rdi
addq $0x10, %rdi
leaq -0x40(%rbp), %rdx
leaq 0x8353(%rip), %rsi      # 0x175a1
leaq 0x8f6b(%rip), %rcx      # 0x181c0
callq 0xe2d0
jmp 0xf2eb
leaq 0x10ff2(%rip), %rax     # 0x20258
movq (%rax), %rax
cmpl $0x2, 0x38(%rax)
jne 0xf299
leaq 0x10fe2(%rip), %rax     # 0x20258
movq (%rax), %rdi
addq $0x10, %rdi
leaq 0x8ad8(%rip), %rsi      # 0x17d5c
leaq 0x8ab3(%rip), %rdx      # 0x17d3e
leaq 0x8f2e(%rip), %rcx      # 0x181c0
callq 0xe2d0
jmp 0xf2e9
leaq 0x10fb8(%rip), %rax     # 0x20258
movq (%rax), %rax
cmpl $0x1, 0x38(%rax)
jne 0xf2d4
leaq -0x40(%rbp), %rdi
leaq 0x10fa4(%rip), %rax     # 0x20258
movq (%rax), %rdx
addq $0x10, %rdx
leaq 0x8a9e(%rip), %rsi      # 0x17d60
movb $0x0, %al
callq 0x9190
leaq -0x40(%rbp), %rdi
callq 0xe110
jmp 0xf2e7
leaq 0x10f7d(%rip), %rax     # 0x20258
movq (%rax), %rdi
addq $0x10, %rdi
callq 0xe110
jmp 0xf2e9
jmp 0xf2eb
jmp 0xf2ed
leaq 0x10f64(%rip), %rax     # 0x20258
movq (%rax), %rcx
leaq 0x10f62(%rip), %rax     # 0x20260
movq %rcx, (%rax)
callq 0xe3f0
leaq 0x10f4b(%rip), %rax     # 0x20258
movq (%rax), %rax
movl (%rax), %eax
leaq 0x10f47(%rip), %rcx     # 0x20260
movq (%rcx), %rcx
cmpl (%rcx), %eax
jne 0xf38f
leaq 0x10f31(%rip), %rax     # 0x20258
movq (%rax), %rax
movq 0x8(%rax), %rax
leaq 0x10f2b(%rip), %rcx     # 0x20260
movq (%rcx), %rcx
cmpq 0x8(%rcx), %rax
jne 0xf38f
leaq 0x10df3(%rip), %rax     # 0x20138
cmpl $0x3, (%rax)
jne 0xf38a
leaq 0x10f0f(%rip), %rax     # 0x20260
movq (%rax), %rax
cmpl $0x1, 0x38(%rax)
je 0xf385
leaq 0x89fb(%rip), %rdi      # 0x17d5c
callq 0xe290
leaq -0x40(%rbp), %rdi
movq -0x50(%rbp), %rdx
leaq 0x7f49(%rip), %rsi      # 0x172be
movb $0x0, %al
callq 0x9190
leaq -0x40(%rbp), %rdi
callq 0xe190
callq 0xe240
callq 0xf180
xorl %eax, %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)