// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro1/macro1.c
// Function: printCrossReference
void printCrossReference()
{
    int    ix;
    int    xc;
    int    xc_index;
    int    xc_refcount;
    int    xc_cols;
    SYM_T  *sym;

    /* Force top of form for first page. */
    page_lineno = LIST_LINES_PER_PAGE;

    list_lineno = 0;

    for( ix = 0, sym = symtab; ix < symbol_top; ix++, sym++ ) {
	if (M_FIXED(sym->type) && xreftab[sym->xref_index] == 0)
	    continue;
	list_lineno++;
	page_lineno++;
	if( page_lineno >= LIST_LINES_PER_PAGE )
	    topOfForm( list_title, s_xref );

	fprintf( listfile, "%5d", list_lineno );

	/* Get reference count & index into concordance table for this symbol */
	xc_refcount = sym->xref_count;
	xc_index = sym->xref_index;
	/* Determine how to label symbol on concordance. */
	/* XXX flag variables? */
	switch( sym->type & ( DEFINED | REDEFINED )) {
	case UNDEFINED:
	    fprintf( listfile, " U         ");
	    break;

	case REDEFINED:
	    fprintf( listfile, " M  %5d  ", xreftab[xc_index] );
	    break;

	default:
	    fprintf( listfile, " A  %5d  ", xreftab[xc_index] );
	    break;
	}
	fprintf( listfile, "%-6.6s  ", sym->name );

	/* Output the references, 8 numbers per line after symbol name. */
	for( xc_cols = 0, xc = 1; xc < xc_refcount + 1; xc++, xc_cols++ ) {
	    if( xc_cols >= XREF_COLUMNS ) {
		xc_cols = 0;
		page_lineno++;
		if( page_lineno >= LIST_LINES_PER_PAGE )
		    topOfForm( list_title, s_xref);
		list_lineno++;
		fprintf( listfile, "\n%5d%-19s", list_lineno, " " );
	    }
	    fprintf( listfile, "  %5d", xreftab[xc_index + xc] );
	}
	fprintf( listfile, "\n" );
    } /* for */
}

// Assembly:
movl $0x3c, 0x90a4(%rip)     # 0xc168
movl $0x0, 0x9096(%rip)      # 0xc164
cmpl $0x0, 0x6c7b(%rip)      # 0x9d50
jle 0x329b
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x6c5b(%rip), %r13      # 0x9d48
leaq 0x3775(%rip), %r15      # 0x6869
xorl %ebx, %ebx
testb $0x2, (%r13)
je 0x3112
movq 0x6db4(%rip), %rax      # 0x9eb8
movslq 0x10(%r13), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x327b
incl 0x904c(%rip)            # 0xc164
movl 0x904a(%rip), %eax      # 0xc168
leal 0x1(%rax), %ecx
movl %ecx, 0x9041(%rip)      # 0xc168
cmpl $0x3b, %eax
jl 0x313f
leaq 0x8f9d(%rip), %rdi      # 0xc0d0
leaq 0x6926(%rip), %rsi      # 0x9a60
callq 0x52ec
movq 0x6d5a(%rip), %rdi      # 0x9ea0
movl 0x9018(%rip), %edx      # 0xc164
leaq 0x3718(%rip), %rsi      # 0x686b
xorl %eax, %eax
callq 0x2110
movl (%r13), %eax
movl 0x14(%r13), %r14d
movslq 0x10(%r13), %rbp
andl $0x11, %eax
movq 0x6d30(%rip), %rcx      # 0x9ea0
cmpl $0x11, %eax
je 0x3191
testl %eax, %eax
jne 0x31a7
movl $0xb, %esi
movl $0x1, %edx
leaq 0x36ac(%rip), %rdi      # 0x6836
callq 0x2180
jmp 0x31c2
movq 0x6d20(%rip), %rax      # 0x9eb8
movl (%rax,%rbp,4), %edx
movq %rcx, %rdi
leaq 0x369d(%rip), %rsi      # 0x6842
jmp 0x31bb
movq 0x6d0a(%rip), %rax      # 0x9eb8
movl (%rax,%rbp,4), %edx
movq %rcx, %rdi
leaq 0x3691(%rip), %rsi      # 0x684c
xorl %eax, %eax
callq 0x2110
movq 0x6cd7(%rip), %rdi      # 0x9ea0
leaq 0x4(%r13), %rdx
leaq 0x3682(%rip), %rsi      # 0x6856
xorl %eax, %eax
callq 0x2110
testl %r14d, %r14d
jle 0x326a
incq %rbp
xorl %r12d, %r12d
cmpl $0x8, %r12d
jl 0x3244
movl 0x8f72(%rip), %eax      # 0xc168
leal 0x1(%rax), %ecx
movl %ecx, 0x8f69(%rip)      # 0xc168
cmpl $0x3b, %eax
jl 0x3217
leaq 0x8ec5(%rip), %rdi      # 0xc0d0
leaq 0x684e(%rip), %rsi      # 0x9a60
callq 0x52ec
movl 0x8f47(%rip), %edx      # 0xc164
incl %edx
movl %edx, 0x8f3f(%rip)      # 0xc164
movq 0x6c74(%rip), %rdi      # 0x9ea0
xorl %r12d, %r12d
leaq 0x3629(%rip), %rsi      # 0x685f
leaq 0x34d1(%rip), %rcx      # 0x670e
xorl %eax, %eax
callq 0x2110
movq 0x6c55(%rip), %rdi      # 0x9ea0
movq 0x6c66(%rip), %rax      # 0x9eb8
movl (%rax,%rbp,4), %edx
movq %r15, %rsi
xorl %eax, %eax
callq 0x2110
incl %r12d
incq %rbp
decq %r14
jne 0x31ea
movq 0x6c2f(%rip), %rsi      # 0x9ea0
movl $0xa, %edi
callq 0x20c0
incl %ebx
addq $0x18, %r13
cmpl 0x6ac9(%rip), %ebx      # 0x9d50
jl 0x30f6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq