// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
movb %bl, 0x8c70(%rip)       # 0xb158
movb %bl, 0x8c6b(%rip)       # 0xb159
movb %bl, 0x8c66(%rip)       # 0xb15a
movb %bl, 0x8c61(%rip)       # 0xb15b
movb %bl, 0x8c5c(%rip)       # 0xb15c
movb %bl, 0x8c57(%rip)       # 0xb15d
movb %bl, 0x8c52(%rip)       # 0xb15e
movq $0x0, 0x8c49(%rip) # 0xb160
callq 0x285d
leaq 0x8c4d(%rip), %rdi      # 0xb170
leaq 0x4e7a(%rip), %rsi      # 0x73a4
callq 0x2140
movq %rax, 0x8cba(%rip)      # 0xb1f0
movl %ebx, 0x8cbc(%rip)      # 0xb1f8
movl %ebx, 0x8cba(%rip)      # 0xb1fc
movl %ebx, 0x8cb8(%rip)      # 0xb200
movl $0x6000, %edi           # imm = 0x6000
callq 0x2120
movq %rax, 0x8caf(%rip)      # 0xb208
testq %rax, %rax
je 0x2858
movq 0x8be7(%rip), %rcx      # 0xb150
movq %rcx, 0x10(%rax)
movups 0x8bcc(%rip), %xmm0     # 0xb140
movups %xmm0, (%rax)
movl %ebx, 0x8c93(%rip)      # 0xb210
movl %ebx, 0x8c91(%rip)      # 0xb214
addq $-0x18, %rax
movq %rax, 0x8c8a(%rip)      # 0xb218
leaq 0x7b5b(%rip), %r14      # 0xa0f0
leaq (%rbx,%r14), %rdi
addq $0x4, %rdi
movswl 0x8(%rdi), %esi
movl -0x4(%rdi), %edx
xorl %ecx, %ecx
callq 0x2b74
addq $0x18, %rbx
cmpq $0x270, %rbx            # imm = 0x270
jne 0x2595
xorl %ebx, %ebx
leaq 0x7d9f(%rip), %r14      # 0xa360
leaq (%rbx,%r14), %rdi
addq $0x4, %rdi
movswl 0x8(%rdi), %esi
movl -0x4(%rdi), %edx
orl $0x3, %edx
xorl %ecx, %ecx
callq 0x2b74
addq $0x18, %rbx
cmpq $0xba0, %rbx            # imm = 0xBA0
jne 0x25c1
movslq 0x8c22(%rip), %rax      # 0xb210
movl %eax, 0x8c20(%rip)      # 0xb214
movq 0x8c0d(%rip), %rcx      # 0xb208
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rax
addq $-0x18, %rax
movq %rax, 0x8c0a(%rip)      # 0xb218
movw $0x0, 0x8c09(%rip)      # 0xb220
movl $0x1, 0x8bdf(%rip)      # 0xb200
movl $0x37, 0x8bf9(%rip)     # 0xb224
callq 0x2c5b
movl 0x8bc2(%rip), %eax      # 0xb1f8
movl %eax, 0x8bec(%rip)      # 0xb228
movq 0x8bed(%rip), %rdi      # 0xb230
callq 0x20a0
leaq 0x8b21(%rip), %rdi      # 0xb170
leaq 0x4d4e(%rip), %rbx      # 0x73a4
movq %rbx, %rsi
callq 0x2140
movq %rax, 0x8b8b(%rip)      # 0xb1f0
leaq 0x8bd4(%rip), %rdi      # 0xb240
leaq 0x4f0e(%rip), %rsi      # 0x7581
callq 0x2140
movq %rax, 0x8c41(%rip)      # 0xb2c0
movq %rax, 0x8c42(%rip)      # 0xb2c8
leaq 0x8c43(%rip), %rdi      # 0xb2d0
movq %rbx, %rsi
callq 0x2140
movq %rax, 0x8cb4(%rip)      # 0xb350
movq $0x0, 0x8cb1(%rip) # 0xb358
cmpq $0x0, 0x8c11(%rip)      # 0xb2c0
je 0x26cb
movl $0xf0, %ebx
movq 0x8c03(%rip), %rsi      # 0xb2c0
movl $0x80, %edi
callq 0x20d0
decl %ebx
jne 0x26b6
movw $0x0, 0x8b4c(%rip)      # 0xb220
xorl %ebx, %ebx
movl %ebx, 0x8b1c(%rip)      # 0xb1f8
movl %ebx, 0x8b1a(%rip)      # 0xb1fc
movl $0x37, 0x8b38(%rip)     # 0xb224
cmpb $0x0, 0x8a6b(%rip)      # 0xb15e
je 0x2756
cmpl $0x0, 0x8b14(%rip)      # 0xb210
jle 0x272f
movq 0x8b03(%rip), %rax      # 0xb208
addq $0x14, %rax
xorl %ecx, %ecx
xorl %ebx, %ebx
movl %ebx, -0x4(%rax)
movl (%rax), %edx
addl %edx, %ebx
incl %ebx
movl $0x0, (%rax)
incq %rcx
movslq 0x8aea(%rip), %rdx      # 0xb210
addq $0x18, %rax
cmpq %rdx, %rcx
jl 0x270d
movslq %ebx, %r14
leaq (%r14,%r14), %rdi
callq 0x2120
movq %rax, 0x8c1e(%rip)      # 0xb360
testl %r14d, %r14d
jle 0x2756
addl %ebx, %ebx
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x20c0
movl $0x2, 0x8aa0(%rip)      # 0xb200
callq 0x2c5b
movq 0x8b5c(%rip), %rax      # 0xb2c8
movq %rax, 0x8b4d(%rip)      # 0xb2c0
callq 0x3062
movl $0x1, %edi
callq 0x302c
movq 0x8bc7(%rip), %rdi      # 0xb350
testq %rdi, %rdi
jne 0x279c
movq 0x8bc3(%rip), %rdi      # 0xb358
movq %rdi, 0x8bb4(%rip)      # 0xb350
movl 0x8a56(%rip), %eax      # 0xb1f8
testl %eax, %eax
jne 0x284c
leaq 0x4dd3(%rip), %rsi      # 0x7584
leaq 0x875e(%rip), %rdx      # 0xaf16
leaq 0x8741(%rip), %rcx      # 0xaf00
leaq 0x8749(%rip), %r8       # 0xaf0f
xorl %eax, %eax
callq 0x2110
cmpb $0x0, 0x8989(%rip)      # 0xb15d
je 0x27db
callq 0x3098
cmpb $0x0, 0x8979(%rip)      # 0xb15b
je 0x27e9
callq 0x323a
cmpb $0x0, 0x896e(%rip)      # 0xb15e
je 0x27f7
callq 0x33a8
movq 0x8ac2(%rip), %rdi      # 0xb2c0
callq 0x2080
movq 0x8b46(%rip), %rdi      # 0xb350
callq 0x2080
movq 0x89da(%rip), %rdi      # 0xb1f0
callq 0x2080
movl 0x89d7(%rip), %ecx      # 0xb1f8
movl 0x8a01(%rip), %eax      # 0xb228
orl %ecx, %eax
jne 0x283d
leaq 0x893e(%rip), %rdi      # 0xb170
callq 0x2050
movl 0x89bb(%rip), %ecx      # 0xb1f8
xorl %eax, %eax
testl %ecx, %ecx
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl %eax, %edi
callq 0x21a0
jmp 0x27cd
callq 0x223e