// File: /workspace/github_c_makefile_star2_O2/radekh[P]palbart/palbart-2.5.c
// Function: main
int main( int argc, char *argv[] )
{
  int     ix;
  int     space;

  /* Set the default values for global symbols.                               */
  binary_data_output = FALSE;
  fltg_input = FALSE;
  literals_on = FALSE;
  print_permanent_symbols = FALSE;
  rim_mode = FALSE;
  symtab_print = FALSE;
  xref = FALSE;
  pathname = NULL;

  /* Get the options and pathnames                                            */
  getArgs( argc, argv );

  /* Setup the error file in case symbol table overflows while installing the */
  /* permanent symbols.                                                       */
  errorfile = fopen( errorpathname, "w" );
  errors = 0;
  save_error_count = 0;
  pass = 0;             /* This is required for symbol table initialization.  */
  symtab = (SYM_T *) malloc( sizeof( SYM_T ) * SYMBOL_TABLE_SIZE );

  if( symtab == NULL )
  {
    fprintf( stderr, "Could not allocate memory for symbol table.\n");
    exit( -1 );
  }

  /* Place end marker in symbol table.                                        */
  symtab[0] = sym_undefined;
  symbol_top = 0;
  number_of_fixed_symbols = symbol_top;
  fixed_symbols = &symtab[symbol_top - 1];

  /* Enter the pseudo-ops into the symbol table                               */
  for( ix = 0; ix < DIM( pseudo ); ix++ )
  {
    defineSymbol( pseudo[ix].name, pseudo[ix].val, pseudo[ix].type, 0 );
  }

  /* Enter the predefined symbols into the table.                             */
  /* Also make them part of the permanent symbol table.                       */
  for( ix = 0; ix < DIM( permanent_symbols ); ix++ )
  {
    defineSymbol( permanent_symbols[ix].name,
                  permanent_symbols[ix].val,
                  permanent_symbols[ix].type | DEFFIX , 0 );
  }

  number_of_fixed_symbols = symbol_top;
  fixed_symbols = &symtab[symbol_top - 1];

  /* Do pass one of the assembly                                              */
  checksum = 0;
  pass = 1;
  page_lineno = LIST_LINES_PER_PAGE;
  onePass();
  errors_pass_1 = errors;

  /* Set up for pass two                                                      */
  rewind( infile );
  errorfile = fopen( errorpathname, "w" );
  objectfile = fopen( objectpathname, "wb" );
  objectsave = objectfile;

  listfile = fopen( listpathname, "w" );
  listsave = NULL;

  punchLeader( 0 );
  checksum = 0;

  /* Do pass two of the assembly                                              */
  errors = 0;
  save_error_count = 0;
  page_lineno = LIST_LINES_PER_PAGE;

  if( xref )
  {
    /* Get the amount of space that will be required for the concordance.     */
    for( space = 0, ix = 0; ix < symbol_top; ix++ )
    {
      symtab[ix].xref_index = space;    /* Index into concordance table.      */
      space += symtab[ix].xref_count + 1;
      symtab[ix].xref_count = 0;        /* Clear the count for pass 2.        */

    }
    /* Allocate the necessary space.                                          */
    xreftab = (WORD16 *) malloc( sizeof( WORD16 ) * space );

    /* Clear the cross reference space.                                       */
    for( ix = 0; ix < space; ix++ )
    {
      xreftab[ix] = 0;
    }
  }
  pass = 2;
  onePass();

  /* Undo effects of NOPUNCH for any following checksum                       */
  objectfile = objectsave;
  punchChecksum();

  /* Works great for trailer.                                                 */
  punchLeader( 1 );

  /* undo effects of XLIST for any following output to listing file.          */
  if( listfile == NULL )
  {
    listfile = listsave;
  }

  /* Display value of error counter.                                          */
  if( errors == 0 )
  {
    fprintf( listfile, "\n      %s %s %s\n", s_no, s_detected, s_errors );
  }
  else
  {
    fprintf( errorfile, "\n      %d %s %s\n", errors, s_detected,
                                        ( errors == 1 ? s_error : s_errors ));
    fprintf( listfile, "\n      %d %s %s\n", errors, s_detected,
                                        ( errors == 1 ? s_error : s_errors ));
    fprintf( stderr,   "      %d %s %s\n", errors, s_detected,
                                        ( errors == 1 ? s_error : s_errors ));
  }

  if( symtab_print )
  {
    printSymbolTable();
  }

  if( print_permanent_symbols )
  {
    printPermanentSymbolTable();
  }

  if( xref )
  {
    printCrossReference();
  }

  fclose( objectfile );
  fclose( listfile );
  fclose( errorfile );
  if( errors == 0 && errors_pass_1 == 0 )
  {
    remove( errorpathname );
  }

  return( errors != 0 );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %eax, %eax
movb %al, 0x7ebc(%rip)       # 0xa148
movb %al, 0x7eb7(%rip)       # 0xa149
movb %al, 0x7eb2(%rip)       # 0xa14a
movb %al, 0x7ead(%rip)       # 0xa14b
movb %al, 0x7ea8(%rip)       # 0xa14c
movb %al, 0x7ea3(%rip)       # 0xa14d
movb %al, 0x7e9e(%rip)       # 0xa14e
andq $0x0, 0x7e98(%rip)      # 0xa150
callq 0x267a
leaq 0x7e9c(%rip), %rdi      # 0xa160
leaq 0x40d9(%rip), %rsi      # 0x63a4
callq 0x2130
andl $0x0, 0x7f11(%rip)      # 0xa1e8
andl $0x0, 0x7f0e(%rip)      # 0xa1ec
movq %rax, 0x7efb(%rip)      # 0xa1e0
andl $0x0, 0x7f04(%rip)      # 0xa1f0
movl $0x6000, %edi           # imm = 0x6000
callq 0x2110
movq %rax, 0x7efb(%rip)      # 0xa1f8
testq %rax, %rax
je 0x2656
movq 0x7e33(%rip), %rcx      # 0xa140
movq %rcx, 0x10(%rax)
movups 0x7e18(%rip), %xmm0     # 0xa130
andl $0x0, 0x7ee1(%rip)      # 0xa200
movups %xmm0, (%rax)
andl $0x0, 0x7edb(%rip)      # 0xa204
addq $-0x18, %rax
movq %rax, 0x7ed4(%rip)      # 0xa208
xorl %ebx, %ebx
leaq 0x6da3(%rip), %r14      # 0x90e0
cmpq $0x270, %rbx            # imm = 0x270
je 0x2362
leaq (%rbx,%r14), %rdi
addq $0x4, %rdi
movswl 0x8(%rdi), %esi
movl -0x4(%rdi), %edx
xorl %ecx, %ecx
callq 0x2a76
addq $0x18, %rbx
jmp 0x233d
xorl %ebx, %ebx
leaq 0x6fe5(%rip), %r14      # 0x9350
cmpq $0xba0, %rbx            # imm = 0xBA0
je 0x2393
leaq (%rbx,%r14), %rdi
addq $0x4, %rdi
movswl 0x8(%rdi), %esi
movl -0x4(%rdi), %edx
orl $0x3, %edx
xorl %ecx, %ecx
callq 0x2a76
addq $0x18, %rbx
jmp 0x236b
movslq 0x7e66(%rip), %rax      # 0xa200
movl %eax, 0x7e64(%rip)      # 0xa204
movq 0x7e51(%rip), %rcx      # 0xa1f8
imulq $0x18, %rax, %rax
addq %rcx, %rax
addq $-0x18, %rax
andw $0x0, 0x7e56(%rip)      # 0xa210
movq %rax, 0x7e47(%rip)      # 0xa208
movl $0x1, 0x7e25(%rip)      # 0xa1f0
pushq $0x37
popq %rbp
movl %ebp, 0x7e40(%rip)      # 0xa214
callq 0x2b61
movl 0x7e09(%rip), %eax      # 0xa1e8
movl %eax, 0x7e33(%rip)      # 0xa218
movq 0x7e34(%rip), %rdi      # 0xa220
callq 0x20a0
leaq 0x7d68(%rip), %rdi      # 0xa160
leaq 0x3fa5(%rip), %rbx      # 0x63a4
movq %rbx, %rsi
callq 0x2130
movq %rax, 0x7dd2(%rip)      # 0xa1e0
leaq 0x7e1b(%rip), %rdi      # 0xa230
leaq 0x4165(%rip), %rsi      # 0x6581
callq 0x2130
movq %rax, 0x7e88(%rip)      # 0xa2b0
movq %rax, 0x7e89(%rip)      # 0xa2b8
leaq 0x7e8a(%rip), %rdi      # 0xa2c0
movq %rbx, %rsi
callq 0x2130
movq %rax, 0x7efb(%rip)      # 0xa340
andq $0x0, 0x7efb(%rip)      # 0xa348
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x2e7c
andw $0x0, 0x7db2(%rip)      # 0xa210
andl $0x0, 0x7d83(%rip)      # 0xa1e8
andl $0x0, 0x7d80(%rip)      # 0xa1ec
movl %ebp, 0x7da2(%rip)      # 0xa214
cmpb $0x0, 0x7cd5(%rip)      # 0xa14e
je 0x24d3
movq 0x7d76(%rip), %rax      # 0xa1f8
addq $0x14, %rax
xorl %ecx, %ecx
movslq 0x7d71(%rip), %rdx      # 0xa200
cmpq %rdx, %rcx
jge 0x24a9
movl %ebx, -0x4(%rax)
movl (%rax), %edx
andl $0x0, (%rax)
addl %edx, %ebx
incl %ebx
incq %rcx
addq $0x18, %rax
jmp 0x2488
movslq %ebx, %r14
leaq (%r14,%r14), %rdi
callq 0x2110
movq %rax, 0x7e94(%rip)      # 0xa350
xorl %ecx, %ecx
testl %r14d, %r14d
cmovlel %ecx, %ebx
cmpq %rcx, %rbx
je 0x24d3
andw $0x0, (%rax,%rcx,2)
incq %rcx
jmp 0x24c4
movl $0x2, 0x7d13(%rip)      # 0xa1f0
callq 0x2b61
movq 0x7dcf(%rip), %rax      # 0xa2b8
movq %rax, 0x7dc0(%rip)      # 0xa2b0
callq 0x2eb0
pushq $0x1
popq %rdi
callq 0x2e7c
movq 0x7e3c(%rip), %rdi      # 0xa340
testq %rdi, %rdi
jne 0x2517
movq 0x7e38(%rip), %rdi      # 0xa348
movq %rdi, 0x7e29(%rip)      # 0xa340
movl 0x7ccb(%rip), %edx      # 0xa1e8
testl %edx, %edx
jne 0x25c8
leaq 0x4058(%rip), %rsi      # 0x6584
leaq 0x79d3(%rip), %rdx      # 0x9f06
leaq 0x79b6(%rip), %rcx      # 0x9ef0
leaq 0x79be(%rip), %r8       # 0x9eff
xorl %eax, %eax
callq 0x2100
cmpb $0x0, 0x7bfe(%rip)      # 0xa14d
je 0x2556
callq 0x2ee5
cmpb $0x0, 0x7bee(%rip)      # 0xa14b
je 0x2564
callq 0x306f
cmpb $0x0, 0x7be3(%rip)      # 0xa14e
je 0x2572
callq 0x31bd
movq 0x7d37(%rip), %rdi      # 0xa2b0
callq 0x2080
movq 0x7dbb(%rip), %rdi      # 0xa340
callq 0x2080
movq 0x7c4f(%rip), %rdi      # 0xa1e0
callq 0x2080
movl 0x7c4c(%rip), %ecx      # 0xa1e8
movl 0x7c76(%rip), %eax      # 0xa218
orl %ecx, %eax
jne 0x25b8
leaq 0x7bb3(%rip), %rdi      # 0xa160
callq 0x2050
movl 0x7c30(%rip), %ecx      # 0xa1e8
xorl %eax, %eax
testl %ecx, %ecx
setne %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x7c11(%rip), %rdi      # 0xa1e0
cmpl $0x1, %edx
leaq 0x7920(%rip), %r12      # 0x9ef9
leaq 0x791f(%rip), %rbx      # 0x9eff
movq %rbx, %r8
cmoveq %r12, %r8
leaq 0x3fa7(%rip), %r15      # 0x6595
leaq 0x78fb(%rip), %r14      # 0x9ef0
movq %r15, %rsi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2100
movq 0x7d37(%rip), %rdi      # 0xa340
movl 0x7bd9(%rip), %edx      # 0xa1e8
cmpl $0x1, %edx
movq %rbx, %r8
cmoveq %r12, %r8
movq %r15, %rsi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2100
movq 0x69cb(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
movl 0x7bb2(%rip), %edx      # 0xa1e8
cmpl $0x1, %edx
cmoveq %r12, %rbx
leaq 0x3f52(%rip), %rsi      # 0x6596
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x2100
jmp 0x2548
movq 0x699b(%rip), %rax      # 0x8ff8
movq (%rax), %rcx
leaq 0x3eed(%rip), %rdi      # 0x6554
pushq $0x2c
popq %rsi
pushq $0x1
popq %rdx
callq 0x2160
pushq $-0x1
popq %rdi
callq 0x2150