// File: /workspace/github_c_makefile_star2_O1/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 0x7ee9(%rip), %eax      # 0xb404
movl $0x0, 0xa24f(%rip)      # 0xd774
movl %eax, (%rsp)
cmpl 0x7ed2(%rip), %eax      # 0xb400
jge 0x3691
leaq 0x4430(%rip), %r13      # 0x796b
xorl %r12d, %r12d
movl (%rsp), %ebp
leaq 0xa308(%rip), %rdi      # 0xd850
leaq 0x7b87(%rip), %rsi      # 0xb0d6
callq 0x681a
movl 0x7eba(%rip), %eax      # 0xb414
cmpl $0x36, %eax
movl %r12d, 0x4(%rsp)
jg 0x367c
cmpl 0x7e92(%rip), %ebp      # 0xb400
jge 0x367c
movl $0x37, %r14d
subl %eax, %r14d
imull %r14d, %r12d
addl (%rsp), %r12d
movl 0xa1e9(%rip), %edx      # 0xd774
incl %edx
movl %edx, 0xa1e1(%rip)      # 0xd774
incl %eax
movl %eax, 0x7e79(%rip)      # 0xb414
movq 0x7f9e(%rip), %rdi      # 0xb540
leaq 0x4460(%rip), %rsi      # 0x7a09
xorl %eax, %eax
callq 0x2120
movl 0x7e4a(%rip), %eax      # 0xb400
cmpl %eax, %ebp
jge 0x3651
movl %r12d, %r15d
xorl %ebx, %ebx
cmpl %r15d, 0x7e3a(%rip)     # 0xb404
setle %cl
cmpl %eax, %r15d
setl %al
andb %cl, %al
cmpb $0x1, %al
jne 0x3637
movq 0x7e18(%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 0x4357(%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 0x7f17(%rip), %rdi      # 0xb540
movswl 0x8(%rcx), %r8d
xorl %eax, %eax
callq 0x2120
incl %ebp
cmpq $0x3, %rbx
ja 0x3651
incq %rbx
addl %r14d, %r15d
movl 0x7db7(%rip), %eax      # 0xb400
cmpl %eax, %ebp
jl 0x35c3
movq 0x7ee8(%rip), %rsi      # 0xb540
movl $0xa, %edi
callq 0x20e0
movl 0x7dac(%rip), %eax      # 0xb414
cmpl $0x36, %eax
jg 0x367c
incl %r12d
cmpl 0x7d8a(%rip), %ebp      # 0xb400
jl 0x3585
movl 0x4(%rsp), %r12d
addl $0x5, %r12d
cmpl 0x7d75(%rip), %ebp      # 0xb400
jl 0x3541
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq