// File: /workspace/github_c_makefile_star2_O3/Nico01[P]obj2asm/oprocess.c
// Function: process
void process()
{
    NODE_T *seg_node;
    char            text[80];
    int             dummy;

    pub_node  = start( public_tree, RIGHT );    /* Start at beginning of */
    pub_rec   = (PUB_T *)pub_node->data;        /* Public symbols list   */

    fix_node  = start( fix_tree, RIGHT );       /* Start at beginning of */
    fix_rec   = (FIX_T *)fix_node->data;        /* Fixup records list    */

    data_node = start( data_tree, RIGHT );      /* Start at beginning of */
    data_rec = (DAT_T *)data_node->data;        /* Data record list      */

    hint_node  = start( hint_tree, RIGHT );     /* Start at beginning of */
    hint_rec   = (HINT_T *)hint_node->data;     /* Hints list            */

    sex_node = start( sex_tree, RIGHT );        /* Start at beginning of */

    if ( pass == 3 && !processor_type_comment_occurred ) {
        out_line( "", ".286p", "", "" );
        out_line( "", ".287", "", "" );
        processor_mode = 286;
    }

    /*
    ** Display all defined public values ( segment == 0 )
    */
    segment = 0;
    if ( pass == 3 && pub_rec->seg_idx == segment ) {
        out_newline();                  /* Blank line before trailings */
    }
    while ( pub_rec->seg_idx == segment ) {
        lone_public();                  /* Finish off any trailing */
        pub_advance();                  /* lone public labels      */
    }

    /*
    ** Loop through all segments
    */
    segment_mode = processor_mode;
    seg_node = start( segment_tree, RIGHT );
    while ( seg_node != segment_tree ) {
        seg_rec = (SEG_T *)seg_node->data;
        process_segment();
        seg_node = traverse( seg_node, RIGHT );
    }

    /*
    ** Finish off this module
    */
    fix_search.seg_idx    = 0;
    fix_search.dat_offset = 0;
    fix_search.offset     = 1;          /* Look for MODEND record */

    fix_rec = (FIX_T *)find( (char *)&fix_search, fix_tree, TC fix_compare, NULL );
    if ( fix_rec == NULL ) {
        if ( pass == 3 ) {
            out_newline();
            out_opcode("END");
            out_newline();
        }
    } else {
        get_target( text, fix_rec, 0, 0L, FALSE, 0, FALSE, &dummy, CS );
        if ( pass == 3 ) {
            out_newline();
            out_line( "", "END", text, "Module starting address" );
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
leaq 0xe687(%rip), %rax      # 0x1cfa8
movq (%rax), %rdi
movl $0x1, %esi
callq 0x1286f
leaq 0xe74b(%rip), %r13      # 0x1d080
movq %rax, (%r13)
movq 0x20(%rax), %rax
leaq 0xe744(%rip), %rbp      # 0x1d088
movq %rax, (%rbp)
leaq 0xe681(%rip), %r15      # 0x1cfd0
movq (%r15), %rdi
movl $0x1, %esi
callq 0x1286f
leaq 0xe7ad(%rip), %rcx      # 0x1d110
movq %rax, (%rcx)
movq 0x20(%rax), %rax
leaq 0xe7a7(%rip), %r14      # 0x1d118
movq %rax, (%r14)
leaq 0xe645(%rip), %rax      # 0x1cfc0
movq (%rax), %rdi
movl $0x1, %esi
callq 0x1286f
movq %rax, 0xec21(%rip)      # 0x1d5b0
movq 0x20(%rax), %rax
movq %rax, 0xec1e(%rip)      # 0x1d5b8
leaq 0xe637(%rip), %rax      # 0x1cfd8
movq (%rax), %rdi
movl $0x1, %esi
callq 0x1286f
leaq 0xe733(%rip), %rcx      # 0x1d0e8
movq %rax, (%rcx)
movq 0x20(%rax), %rax
leaq 0xe72d(%rip), %rcx      # 0x1d0f0
movq %rax, (%rcx)
leaq 0xe5eb(%rip), %rax      # 0x1cfb8
movq (%rax), %rdi
movl $0x1, %esi
callq 0x1286f
movq %rax, 0xebc7(%rip)      # 0x1d5a8
leaq 0xe580(%rip), %r12      # 0x1cf68
movl (%r12), %eax
cmpl $0x3, %eax
jne 0xea3f
leaq 0xe4f8(%rip), %rcx      # 0x1cef0
cmpl $0x0, (%rcx)
jne 0xea3f
leaq 0x5447(%rip), %rsi      # 0x13e4b
leaq 0x5701(%rip), %rbx      # 0x1410c
movq %rbx, %rdi
movq %rbx, %rdx
movq %rbx, %rcx
callq 0xcb44
leaq 0x5431(%rip), %rsi      # 0x13e51
movq %rbx, %rdi
movq %rbx, %rdx
movq %rbx, %rcx
callq 0xcb44
leaq 0xe4af(%rip), %rax      # 0x1cee4
movl $0x11e, (%rax)          # imm = 0x11E
movl (%r12), %eax
leaq 0xe74a(%rip), %rbx      # 0x1d190
movl $0x0, (%rbx)
xorl %ecx, %ecx
movq (%rbp), %rdx
cmpl $0x3, %eax
jne 0xea67
cmpl $0x0, (%rdx)
jne 0xea67
callq 0xcad9
movq (%rbp), %rdx
movl (%rbx), %ecx
cmpl %ecx, (%rdx)
jne 0xea90
callq 0xcc8c
movq (%r13), %rdi
movl $0x1, %esi
callq 0x1288c
movq %rax, (%r13)
movq 0x20(%rax), %rax
movq %rax, (%rbp)
movl (%rax), %eax
cmpl (%rbx), %eax
je 0xea6b
leaq 0xe44d(%rip), %rax      # 0x1cee4
movl (%rax), %eax
leaq 0xe700(%rip), %rcx      # 0x1d1a0
movl %eax, (%rcx)
leaq 0xe4ef(%rip), %r13      # 0x1cf98
movq (%r13), %rdi
movl $0x1, %esi
callq 0x1286f
cmpq (%r13), %rax
je 0xeaea
movq %rax, %rbx
leaq 0xe529(%rip), %rbp      # 0x1cff0
movq 0x20(%rbx), %rax
movq %rax, (%rbp)
callq 0xe51d
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1288c
movq %rax, %rbx
cmpq (%r13), %rax
jne 0xeac7
leaq 0xe62f(%rip), %rdi      # 0x1d120
movl $0x0, (%rdi)
movq $0x0, 0x8(%rdi)
movl $0x1, 0x10(%rdi)
movq (%r15), %rsi
leaq 0x26f4(%rip), %rdx      # 0x11204
xorl %ecx, %ecx
callq 0x1280f
movq %rax, (%r14)
testq %rax, %rax
je 0xeb76
subq $0x8, %rsp
leaq 0x14(%rsp), %r10
leaq 0x18(%rsp), %rdi
movq %rax, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq $0x12
pushq %r10
pushq $0x0
callq 0xfec1
addq $0x20, %rsp
cmpl $0x3, (%r12)
jne 0xeba1
callq 0xcad9
leaq 0x55b0(%rip), %rdi      # 0x1410c
leaq 0x52f3(%rip), %rsi      # 0x13e56
leaq 0x52f0(%rip), %rcx      # 0x13e5a
leaq 0x10(%rsp), %rdx
callq 0xcb44
jmp 0xeba1
cmpl $0x3, (%r12)
jne 0xeba1
callq 0xcad9
leaq 0x52cd(%rip), %rdi      # 0x13e56
callq 0xca16
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xcad9
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq