// File: /workspace/github_c_makefile_star2_O2/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 $0x78, %rsp
leaq 0xdd67(%rip), %rax      # 0x1bfa8
movq (%rax), %rdi
pushq $0x1
popq %rbx
movl %ebx, %esi
callq 0x11e9b
leaq 0xde2b(%rip), %rcx      # 0x1c080
movq %rax, (%rcx)
movq 0x20(%rax), %rax
leaq 0xde25(%rip), %r14      # 0x1c088
movq %rax, (%r14)
leaq 0xdd63(%rip), %r12      # 0x1bfd0
movq (%r12), %rdi
movl %ebx, %esi
callq 0x11e9b
leaq 0xde91(%rip), %rcx      # 0x1c110
movq %rax, (%rcx)
movq 0x20(%rax), %rax
leaq 0xde8b(%rip), %rcx      # 0x1c118
movq %rax, (%rcx)
leaq 0xdd29(%rip), %rax      # 0x1bfc0
movq (%rax), %rdi
movl %ebx, %esi
callq 0x11e9b
movq %rax, 0xe308(%rip)      # 0x1c5b0
movq 0x20(%rax), %rax
movq %rax, 0xe305(%rip)      # 0x1c5b8
leaq 0xdd1e(%rip), %rax      # 0x1bfd8
movq (%rax), %rdi
movl %ebx, %esi
callq 0x11e9b
leaq 0xde1d(%rip), %rcx      # 0x1c0e8
movq %rax, (%rcx)
movq 0x20(%rax), %rax
leaq 0xde17(%rip), %rcx      # 0x1c0f0
movq %rax, (%rcx)
leaq 0xdcd5(%rip), %rax      # 0x1bfb8
movq (%rax), %rdi
movl %ebx, %esi
callq 0x11e9b
movq %rax, 0xe2b4(%rip)      # 0x1c5a8
leaq 0xdc6d(%rip), %r13      # 0x1bf68
movl (%r13), %eax
cmpl $0x3, %eax
jne 0xe352
leaq 0xdbe5(%rip), %rcx      # 0x1bef0
cmpl $0x0, (%rcx)
jne 0xe352
leaq 0x4b34(%rip), %rsi      # 0x12e4b
leaq 0x4dee(%rip), %rbx      # 0x1310c
movq %rbx, %rdi
movq %rbx, %rdx
movq %rbx, %rcx
callq 0xc585
leaq 0x4b1e(%rip), %rsi      # 0x12e51
movq %rbx, %rdi
movq %rbx, %rdx
movq %rbx, %rcx
callq 0xc585
leaq 0xdb9c(%rip), %rax      # 0x1bee4
movl $0x11e, (%rax)          # imm = 0x11E
movl (%r13), %eax
leaq 0xde37(%rip), %rbx      # 0x1c190
andl $0x0, (%rbx)
cmpl $0x3, %eax
jne 0xe37a
movq (%r14), %rax
cmpl $0x0, (%rax)
jne 0xe37a
callq 0xc54f
jmp 0xe37a
callq 0xc6c6
callq 0xc654
movq (%r14), %rax
movl (%rax), %eax
cmpl (%rbx), %eax
je 0xe370
leaq 0xdb5a(%rip), %rax      # 0x1bee4
movl (%rax), %eax
leaq 0xde0d(%rip), %rcx      # 0x1c1a0
movl %eax, (%rcx)
leaq 0xdbfc(%rip), %rbp      # 0x1bf98
movq (%rbp), %rdi
pushq $0x1
popq %rbx
movl %ebx, %esi
callq 0x11e9b
movq %rax, %r14
leaq 0xdc3c(%rip), %r15      # 0x1bff0
cmpq (%rbp), %r14
je 0xe3d5
movq 0x20(%r14), %rax
movq %rax, (%r15)
callq 0xde35
movq %r14, %rdi
movl %ebx, %esi
callq 0x11ebc
movq %rax, %r14
jmp 0xe3b4
leaq 0xdd44(%rip), %rdi      # 0x1c120
andl $0x0, (%rdi)
andq $0x0, 0x8(%rdi)
movl $0x1, 0x10(%rdi)
movq (%r12), %rsi
leaq 0x25fa(%rip), %rdx      # 0x109f0
xorl %ecx, %ecx
callq 0x11e3b
leaq 0xdd14(%rip), %rcx      # 0x1c118
movq %rax, (%rcx)
testq %rax, %rax
je 0xe466
leaq 0x1c(%rsp), %rcx
movq %rcx, 0x8(%rsp)
andl $0x0, (%rsp)
movl $0x12, 0x10(%rsp)
leaq 0x20(%rsp), %rdi
movq %rax, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xf723
cmpl $0x3, (%r13)
jne 0xe491
callq 0xc54f
leaq 0x4cc0(%rip), %rdi      # 0x1310c
leaq 0x4a03(%rip), %rsi      # 0x12e56
leaq 0x4a00(%rip), %rcx      # 0x12e5a
leaq 0x20(%rsp), %rdx
callq 0xc585
jmp 0xe491
cmpl $0x3, (%r13)
jne 0xe491
callq 0xc54f
leaq 0x49dd(%rip), %rdi      # 0x12e56
callq 0xc497
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc54f
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq