// File: /workspace/github_c_makefile_star2_O3/AK6DN[P]dec-utilities-for-pdp/palbart/palbart.c
// Function: printSymbolTable
void printSymbolTable()
{
  int    col;
  int    cx;
  char  *fmt;
  int    ix;
  char   mark;
  int    page;
  int    row;
  int    symbol_base;
  int    symbol_lines;

  symbol_base = number_of_fixed_symbols;

  for( page=0, list_lineno=0, col=0, ix=symbol_base; ix < symbol_top; page++ )
  {
    topOfForm( list_title, s_symtable );
    symbol_lines = LIST_LINES_PER_PAGE - page_lineno;

    for( row = 0; page_lineno < LIST_LINES_PER_PAGE && ix < symbol_top; row++)
    {
      list_lineno++;
      page_lineno++;
      fprintf( listfile, "%5d", list_lineno );

      for( col = 0; col < SYMBOL_COLUMNS && ix < symbol_top; col++ )
      {
        /* Get index of symbol for the current line and column                         */
        cx = symbol_lines * ( SYMBOL_COLUMNS * page + col ) + row;
        cx += symbol_base;

        /* Make sure that there is a symbol to be printed.                    */
        if( number_of_fixed_symbols <= cx && cx < symbol_top )
        {
          switch( symtab[cx].type & LABEL )
          {
          case LABEL:
            fmt = " %c%-6.6s %5.5o ";
            break;

          default:
            fmt = " %c%-6.6s  %4.4o ";
            break;
          }

          switch( symtab[cx].type & ( DEFINED | REDEFINED ))
          {
          case UNDEFINED:
            mark = '?';
            break;

          case REDEFINED:
            mark = '#';
            break;

          default:
            mark = ' ';
            break;
          }
          fprintf( listfile, fmt, mark, symtab[cx].name, symtab[cx].val );
          ix++;
        }
      }
      fprintf( listfile, "\n" );
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x7ea4(%rip), %eax      # 0xb404
movl $0x0, 0xa20a(%rip)      # 0xd774
movl %eax, (%rsp)
cmpl 0x7e8d(%rip), %eax      # 0xb400
jge 0x36e2
leaq 0x43eb(%rip), %r13      # 0x796b
xorl %r12d, %r12d
movl (%rsp), %ebp
leaq 0xa2c3(%rip), %rdi      # 0xd850
leaq 0x7b42(%rip), %rsi      # 0xb0d6
callq 0x680d
movl 0x7e75(%rip), %eax      # 0xb414
movl 0x7e5b(%rip), %ecx      # 0xb400
cmpl $0x36, %eax
movl %r12d, 0x4(%rsp)
jg 0x36d1
cmpl %ecx, %ebp
jge 0x36d1
movl $0x37, %r14d
subl %eax, %r14d
imull %r14d, %r12d
addl (%rsp), %r12d
movl 0xa1a2(%rip), %edx      # 0xd774
incl %edx
movl %edx, 0xa19a(%rip)      # 0xd774
incl %eax
movl %eax, 0x7e32(%rip)      # 0xb414
movq 0x7f57(%rip), %rdi      # 0xb540
leaq 0x4419(%rip), %rsi      # 0x7a09
xorl %eax, %eax
callq 0x2120
movl 0x7e03(%rip), %eax      # 0xb400
cmpl %eax, %ebp
jge 0x36a4
movl 0x7df9(%rip), %ecx      # 0xb404
movl %r12d, %r15d
xorl %ebx, %ebx
cmpl %r15d, %ecx
setle %dl
cmpl %eax, %r15d
setl %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x3690
movq 0x7dcb(%rip), %rax      # 0xb3f8
movslq %r15d, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rcx
addq $0x4, %rcx
movl -0x4(%rcx), %eax
movl %eax, %edx
notl %edx
testb $0x9, %dl
movq %r13, %rsi
leaq 0x430a(%rip), %rdx      # 0x795a
cmoveq %rdx, %rsi
andl $0x11, %eax
xorl %edx, %edx
cmpl $0x11, %eax
sete %dl
leal (%rdx,%rdx,2), %edx
addl $0x20, %edx
testl %eax, %eax
movl $0x3f, %eax
cmovel %eax, %edx
movq 0x7eca(%rip), %rdi      # 0xb540
movswl 0x8(%rcx), %r8d
xorl %eax, %eax
callq 0x2120
incl %ebp
movl 0x7d7a(%rip), %ecx      # 0xb404
movl 0x7d70(%rip), %eax      # 0xb400
cmpq $0x3, %rbx
ja 0x36a4
incq %rbx
addl %r14d, %r15d
cmpl %eax, %ebp
jl 0x3610
movq 0x7e95(%rip), %rsi      # 0xb540
movl $0xa, %edi
callq 0x20e0
movl 0x7d59(%rip), %eax      # 0xb414
movl 0x7d3f(%rip), %ecx      # 0xb400
cmpl $0x36, %eax
jg 0x36d1
incl %r12d
cmpl %ecx, %ebp
jl 0x35cc
movl 0x4(%rsp), %r12d
addl $0x5, %r12d
cmpl %ecx, %ebp
jl 0x3586
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq