// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
leaq 0xfa36(%rip), %r12      # 0x1d088
movq (%r12), %rax
movl 0x38(%rax), %edx
cmpl $0x2, %edx
leaq 0x663d(%rip), %rcx      # 0x13ca0
leaq 0x663f(%rip), %rbx      # 0x13ca9
cmoveq %rcx, %rbx
leaq 0xf8f3(%rip), %r15      # 0x1cf68
cmpl $0x3, (%r15)
jne 0xd71f
movq 0x8(%rax), %rcx
leaq 0xf966(%rip), %rsi      # 0x1cff0
movq (%rsi), %rsi
movl 0x10(%rsi), %esi
subq %rsi, %rcx
jae 0xd6bd
addq $0x10, %rax
cmpl $0x1, %edx
je 0xd6fb
cmpl $0x2, %edx
jne 0xd717
leaq 0x6614(%rip), %rsi      # 0x13cbe
leaq 0x65ef(%rip), %rdx      # 0x13ca0
leaq 0x6a54(%rip), %rcx      # 0x1410c
movq %rax, %rdi
jmp 0xd6f4
jne 0xd6c7
movw $0x24, (%rsp)
jmp 0xd6db
leaq 0x65e5(%rip), %rsi      # 0x13cb3
movq %rsp, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x91b0
movq (%r12), %rdi
addq $0x10, %rdi
leaq 0x5f10(%rip), %rsi      # 0x135fa
leaq 0x6a1b(%rip), %rcx      # 0x1410c
movq %rsp, %rdx
callq 0xcad8
jmp 0xd71f
leaq 0x65c0(%rip), %rsi      # 0x13cc2
movq %rsp, %r14
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x91b0
movq %r14, %rdi
jmp 0xd71a
movq %rax, %rdi
callq 0xc982
movq (%r12), %rax
leaq 0xf966(%rip), %r14      # 0x1d090
movq %rax, (%r14)
leaq 0xf94c(%rip), %r13      # 0x1d080
movq (%r13), %rdi
movl $0x1, %esi
callq 0x127da
movq %rax, (%r13)
movq 0x20(%rax), %rcx
movq %rcx, (%r12)
movl (%rcx), %edx
movq (%r14), %rax
cmpl (%rax), %edx
jne 0xd799
movq 0x8(%rcx), %rcx
cmpq 0x8(%rax), %rcx
jne 0xd799
cmpl $0x3, (%r15)
jne 0xd794
cmpl $0x1, 0x38(%rax)
je 0xd78f
leaq 0x654a(%rip), %rdi      # 0x13cbe
callq 0xca9b
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9070
movq %r14, %rdi
callq 0xc9d9
callq 0xca3f
callq 0xd63e
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq