// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x3c, 0xae06(%rip)     # 0xe168
movl $0x0, 0xadf8(%rip)      # 0xe164
movl $0x0, -0x4(%rbp)
movq 0x89ce(%rip), %rax      # 0xbd48
movq %rax, -0x20(%rbp)
movl -0x4(%rbp), %eax
cmpl 0x89c9(%rip), %eax      # 0xbd50
jge 0x35aa
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x2, %eax
jne 0x33b5
movq 0x8b16(%rip), %rax      # 0xbeb8
movq -0x20(%rbp), %rcx
movslq 0x10(%rcx), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x33b5
jmp 0x3590
movl 0xada9(%rip), %eax      # 0xe164
addl $0x1, %eax
movl %eax, 0xada0(%rip)      # 0xe164
movl 0xad9e(%rip), %eax      # 0xe168
addl $0x1, %eax
movl %eax, 0xad95(%rip)      # 0xe168
cmpl $0x3c, 0xad8e(%rip)     # 0xe168
jl 0x33ef
leaq 0xaced(%rip), %rdi      # 0xe0d0
leaq 0x8676(%rip), %rsi      # 0xba60
callq 0x6380
movq 0x8aaa(%rip), %rdi      # 0xbea0
movl 0xad68(%rip), %edx      # 0xe164
leaq 0x558c(%rip), %rsi      # 0x898f
xorl %eax, %eax
callq 0x2110
movq -0x20(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0xc(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x11, %eax
movl %eax, -0x24(%rbp)
je 0x3438
jmp 0x342e
movl -0x24(%rbp), %eax
subl $0x11, %eax
je 0x344f
jmp 0x3474
movq 0x8a61(%rip), %rdi      # 0xbea0
leaq 0x5514(%rip), %rsi      # 0x895a
movb $0x0, %al
callq 0x2110
jmp 0x3497
movq 0x8a4a(%rip), %rdi      # 0xbea0
movq 0x8a5b(%rip), %rax      # 0xbeb8
movslq -0xc(%rbp), %rcx
movl (%rax,%rcx,4), %edx
leaq 0x54fb(%rip), %rsi      # 0x8966
movb $0x0, %al
callq 0x2110
jmp 0x3497
movq 0x8a25(%rip), %rdi      # 0xbea0
movq 0x8a36(%rip), %rax      # 0xbeb8
movslq -0xc(%rbp), %rcx
movl (%rax,%rcx,4), %edx
leaq 0x54e0(%rip), %rsi      # 0x8970
movb $0x0, %al
callq 0x2110
movq 0x8a02(%rip), %rdi      # 0xbea0
movq -0x20(%rbp), %rdx
addq $0x4, %rdx
leaq 0x54cd(%rip), %rsi      # 0x897a
movb $0x0, %al
callq 0x2110
movl $0x0, -0x14(%rbp)
movl $0x1, -0x8(%rbp)
movl -0x8(%rbp), %eax
movl -0x10(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x357b
cmpl $0x8, -0x14(%rbp)
jl 0x353c
movl $0x0, -0x14(%rbp)
movl 0xac82(%rip), %eax      # 0xe168
addl $0x1, %eax
movl %eax, 0xac79(%rip)      # 0xe168
cmpl $0x3c, 0xac72(%rip)     # 0xe168
jl 0x350b
leaq 0xabd1(%rip), %rdi      # 0xe0d0
leaq 0x855a(%rip), %rsi      # 0xba60
callq 0x6380
movl 0xac53(%rip), %eax      # 0xe164
addl $0x1, %eax
movl %eax, 0xac4a(%rip)      # 0xe164
movq 0x897f(%rip), %rdi      # 0xbea0
movl 0xac3d(%rip), %edx      # 0xe164
leaq 0x5455(%rip), %rsi      # 0x8983
leaq 0x52fd(%rip), %rcx      # 0x8832
movb $0x0, %al
callq 0x2110
movq 0x895d(%rip), %rdi      # 0xbea0
movq 0x896e(%rip), %rax      # 0xbeb8
movl -0xc(%rbp), %ecx
addl -0x8(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
leaq 0x5430(%rip), %rsi      # 0x898d
movb $0x0, %al
callq 0x2110
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x34c2
movq 0x891e(%rip), %rdi      # 0xbea0
leaq 0x5467(%rip), %rsi      # 0x89f0
movb $0x0, %al
callq 0x2110
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
movq -0x20(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x20(%rbp)
jmp 0x337e
addq $0x30, %rsp
popq %rbp
retq