// File: /workspace/github_c_makefile_star2_O0/AK6DN[P]dec-utilities-for-pdp/palbart/palbart.c
// Function: getArgs
void getArgs( int argc, char *argv[] )
{
  int  len;
  int  ix, jx;

  /* Set the defaults                                                         */
  errorfile = NULL;
  infile = NULL;
  listfile = NULL;
  listsave = NULL;
  objectfile = NULL;
  objectsave = NULL;
  tabstops = 8;

  for( ix = 1; ix < argc; ix++ )
  {
    if( argv[ix][0] == '-' )
    {
      for( jx = 1; argv[ix][jx] != 0; jx++ )
      {
        switch( argv[ix][jx] )
        {
        case '$':
          dollar_not_required = TRUE;
          break;

        case 'd':
          symtab_print = TRUE;
          break;

        case 'a':
          additional_enabled = TRUE;
          break;

        case 'r':
          rim_mode = TRUE;
          break;

        case 'e':
          literals_ok = FALSE;
          break;

        case 'l':
          literals_ok = TRUE;
          break;

        case 'n':
          perm_redef_error = TRUE;
          break;

        case 'p':
          print_permanent_symbols = TRUE;
          break;

        /* Added -tN; RK 20071029 */
        /* Damn, this is ugly, we should use getopt() */
        case 't':
          if (argv [ix][jx + 1]) {
            tabstops = atoi (argv [ix] + (jx + 1));
            /* advance past numbers */
            for (jx++; argv [ix][jx]; jx++) ;
            jx--;
          } else {
            ix++;
            if (ix >= argc) {
              fprintf( stderr, "%s: missing argument for -t, expected number of tabsopts\n", argv[0] );
              exit( -1 );
            }
            for (jx = 0; argv [ix][jx]; jx++) ;
            jx--;
            tabstops = atoi (argv [ix]);
          }
          break;

        case 'x':
          xref = TRUE;
          break;

        case 'v':
          fprintf( stderr, "%s\n", release );
          fflush( stderr );
          exit( -1 );
          break;

        default:
          fprintf( stderr, "%s: unknown flag: %s\n", argv[0], argv[ix] );
        case 'h':
          fprintf( stderr, " -$ -- allow file to not end with $\n" );
          fprintf( stderr, " -a -- enable additional function not in PAL8\n" );
          fprintf( stderr, " -d -- dump symbol table\n" );
          fprintf( stderr, " -e -- error if link generated\n" );
          fprintf( stderr, " -h -- show this help\n" );
          fprintf( stderr, " -l -- generate literal/link (default)\n" );
          fprintf( stderr, " -n -- no redefining with label permanent symbols\n" );
          fprintf( stderr, " -p -- output permanent symbols to file\n" );
          fprintf( stderr, " -r -- output rim format file\n" );
          fprintf( stderr, " -t N -- set tab stops to N\n" );
          fprintf( stderr, " -v -- display version\n" );
          fprintf( stderr, " -x -- output cross reference to file\n" );
          fflush( stderr );
          exit( -1 );
        } /* end switch                                                       */
      } /* end for                                                            */
    }
    else
    {
      if( pathname != NULL )
      {
        fprintf( stderr, "%s: too many input files\n", argv[0] );
        exit( -1 );
      }
      pathname = &argv[ix][0];
    }
  } /* end for                                                                */

  if( pathname == NULL )
  {
    fprintf( stderr, "%s:  no input file specified\n", argv[0] );
    exit( -1 );
  }

  len = strlen( pathname );
  if( len > NAMELEN - 5 )
  {
    fprintf( stderr, "%s: pathname \"%s\" too long\n", argv[0], pathname );
    exit( -1 );
  }

  /* Now open the input file.                                                 */
  if(( infile = fopen( pathname, "r" )) == NULL )
  {
    fprintf( stderr, "%s: cannot open \"%s\": %s\n", argv[0], pathname, strerror(errno) );
    exit( -1 );
  }

  /* Now make the pathnames                                                   */
  /* Find last '.', if it exists.                                             */
  jx = len - 1;
  while( pathname[jx] != '.'  && pathname[jx] != '/'
      && pathname[jx] != '\\' && jx >= 0 )
  {
    jx--;
  }

  switch( pathname[jx] )
  {
  case '.':
    break;

  case '/':
  case '\\':
    jx = len;
    break;

  default:
    break;
  }

  /* Add the pathname extensions.                                             */
  strncpy( objectpathname, pathname, jx );
  objectpathname[jx] = '\0';
  strcat( objectpathname, rim_mode ? ".rim" : ".bin" );

  strncpy( listpathname, pathname, jx );
  listpathname[jx] = '\0';
  strcat( listpathname, ".lst" );

  strncpy( errorpathname, pathname, jx );
  errorpathname[jx] = '\0';
  strcat( errorpathname, ".err" );

  strncpy( permpathname, pathname, jx );
  permpathname[jx] = '\0';
  strcat( permpathname, ".prm" );

  /* Extract the filename from the path.                                      */
  if( isalpha( pathname[0] ) && pathname[1] == ':' && pathname[2] != '\\' )
  {
    pathname[1] = '\\';         /* MS-DOS style pathname                      */
  }

  jx = len - 1;
  while( pathname[jx] != '/' && pathname[jx] != '\\' && jx >= 0 )
  {
    jx--;
  }
  strcpy( filename, &pathname[jx + 1] );

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, 0xa996(%rip) # 0xd440
movq $0x0, 0xa9cb(%rip) # 0xd480
movq $0x0, 0xaae0(%rip) # 0xd5a0
movq $0x0, 0xaadd(%rip) # 0xd5a8
movq $0x0, 0xaa3a(%rip) # 0xd510
movq $0x0, 0xaa37(%rip) # 0xd518
movl $0x8, 0xaad1(%rip)      # 0xd5bc
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x2ee4
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x2e8e
movl $0x1, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x2e8c
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $-0x24, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x54, %eax
ja 0x2d18
movq -0x28(%rbp), %rax
leaq 0x6499(%rip), %rcx      # 0x9004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x1, 0xa833(%rip)      # 0xd3ae
jmp 0x2e7c
movb $0x1, 0xa829(%rip)      # 0xd3b0
jmp 0x2e7c
movb $0x1, 0xa81c(%rip)      # 0xd3af
jmp 0x2e7c
movb $0x1, 0xa80e(%rip)      # 0xd3ad
jmp 0x2e7c
movb $0x0, 0xa7ff(%rip)      # 0xd3aa
jmp 0x2e7c
movb $0x1, 0xa7f3(%rip)      # 0xd3aa
jmp 0x2e7c
movb $0x1, 0xa7e8(%rip)      # 0xd3ab
jmp 0x2e7c
movb $0x1, 0xa7dd(%rip)      # 0xd3ac
jmp 0x2e7c
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
cmpb $0x0, (%rax,%rcx)
je 0x2c4b
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl -0x1c(%rbp), %eax
addl $0x1, %eax
cltq
addq %rax, %rdi
callq 0x2160
movl %eax, 0xa9ab(%rip)      # 0xd5bc
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x2c3d
jmp 0x2c32
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2c1a
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2ccf
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x4(%rbp), %eax
jl 0x2c85
movq 0x9395(%rip), %rax      # 0xbff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0x6b3a(%rip), %rsi      # 0x97ae
movb $0x0, %al
callq 0x2120
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2190
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x2caf
jmp 0x2ca4
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2c8c
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2160
movl %eax, 0xa8ed(%rip)      # 0xd5bc
jmp 0x2e7c
movb $0x1, 0xa6d6(%rip)      # 0xd3b1
jmp 0x2e7c
movq 0x9311(%rip), %rax      # 0xbff8
movq (%rax), %rdi
movq 0x93ff(%rip), %rdx      # 0xc0f0
leaq 0x6d14(%rip), %rsi      # 0x9a0c
movb $0x0, %al
callq 0x2120
movq 0x92f2(%rip), %rax      # 0xbff8
movq (%rax), %rdi
callq 0x2140
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2190
movq 0x92d9(%rip), %rax      # 0xbff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
leaq 0x6aac(%rip), %rsi      # 0x97e8
movb $0x0, %al
callq 0x2120
movq 0x92ae(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6aaa(%rip), %rsi      # 0x97fe
movb $0x0, %al
callq 0x2120
movq 0x9296(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6ab7(%rip), %rsi      # 0x9823
movb $0x0, %al
callq 0x2120
movq 0x927e(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6ace(%rip), %rsi      # 0x9852
movb $0x0, %al
callq 0x2120
movq 0x9266(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6ad0(%rip), %rsi      # 0x986c
movb $0x0, %al
callq 0x2120
movq 0x924e(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6ad8(%rip), %rsi      # 0x988c
movb $0x0, %al
callq 0x2120
movq 0x9236(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6ad7(%rip), %rsi      # 0x98a3
movb $0x0, %al
callq 0x2120
movq 0x921e(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6ae7(%rip), %rsi      # 0x98cb
movb $0x0, %al
callq 0x2120
movq 0x9206(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6b02(%rip), %rsi      # 0x98fe
movb $0x0, %al
callq 0x2120
movq 0x91ee(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6b13(%rip), %rsi      # 0x9927
movb $0x0, %al
callq 0x2120
movq 0x91d6(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6b1a(%rip), %rsi      # 0x9946
movb $0x0, %al
callq 0x2120
movq 0x91be(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6b1f(%rip), %rsi      # 0x9963
movb $0x0, %al
callq 0x2120
movq 0x91a6(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6b1f(%rip), %rsi      # 0x997b
movb $0x0, %al
callq 0x2120
movq 0x918e(%rip), %rax      # 0xbff8
movq (%rax), %rdi
callq 0x2140
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2190
jmp 0x2e7e
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2b1d
jmp 0x2ed4
cmpq $0x0, 0xa522(%rip)      # 0xd3b8
je 0x2ec1
movq 0x9159(%rip), %rax      # 0xbff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0x6af2(%rip), %rsi      # 0x99a2
movb $0x0, %al
callq 0x2120
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2190
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0xa4e4(%rip)      # 0xd3b8
jmp 0x2ed6
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x2af2
cmpq $0x0, 0xa4cc(%rip)      # 0xd3b8
jne 0x2f17
movq 0x9103(%rip), %rax      # 0xbff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0x6ab6(%rip), %rsi      # 0x99bc
movb $0x0, %al
callq 0x2120
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2190
movq 0xa49a(%rip), %rdi      # 0xd3b8
callq 0x20a0
movl %eax, -0x14(%rbp)
cmpl $0x7b, -0x14(%rbp)
jle 0x2f5c
movq 0x90c5(%rip), %rax      # 0xbff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
movq 0xa474(%rip), %rcx      # 0xd3b8
leaq 0x6a8f(%rip), %rsi      # 0x99da
movb $0x0, %al
callq 0x2120
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2190
movq 0xa455(%rip), %rdi      # 0xd3b8
leaq 0x63d8(%rip), %rsi      # 0x9342
callq 0x2150
movq %rax, 0xa50a(%rip)      # 0xd480
cmpq $0x0, %rax
jne 0x2fd3
movq 0x9075(%rip), %rax      # 0xbff8
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq 0xa41c(%rip), %rax      # 0xd3b8
movq %rax, -0x30(%rbp)
callq 0x2030
movl (%rax), %edi
callq 0x21a0
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq %rax, %r8
leaq 0x6a34(%rip), %rsi      # 0x99f6
movb $0x0, %al
callq 0x2120
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2190
movl -0x14(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq 0xa3d5(%rip), %rax      # 0xd3b8
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x2e, %ecx
movb %al, -0x41(%rbp)
je 0x3031
movq 0xa3bc(%rip), %rax      # 0xd3b8
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x2f, %ecx
movb %al, -0x41(%rbp)
je 0x3031
movq 0xa3a3(%rip), %rax      # 0xd3b8
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x5c, %ecx
movb %al, -0x41(%rbp)
je 0x3031
cmpl $0x0, -0x1c(%rbp)
setge %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
testb $0x1, %al
jne 0x303a
jmp 0x3045
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2fdc
movq 0xa36c(%rip), %rax      # 0xd3b8
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x48(%rbp)
subl $0x2e, %eax
je 0x3072
jmp 0x305e
movl -0x48(%rbp), %eax
subl $0x2f, %eax
je 0x3074
jmp 0x3068
movl -0x48(%rbp), %eax
subl $0x5c, %eax
je 0x3074
jmp 0x307c
jmp 0x307e
movl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x307e
jmp 0x307e
movq 0xa333(%rip), %rsi      # 0xd3b8
movslq -0x1c(%rbp), %rdx
leaq 0xa400(%rip), %rdi      # 0xd490
callq 0x2040
movslq -0x1c(%rbp), %rcx
leaq 0xa3f0(%rip), %rax      # 0xd490
movb $0x0, (%rax,%rcx)
movzbl 0xa302(%rip), %ecx      # 0xd3ad
leaq 0x6963(%rip), %rsi      # 0x9a15
leaq 0x6957(%rip), %rax      # 0x9a10
cmpl $0x0, %ecx
cmovneq %rax, %rsi
leaq 0xa3c9(%rip), %rdi      # 0xd490
callq 0x2170
movq 0xa2e5(%rip), %rsi      # 0xd3b8
movslq -0x1c(%rbp), %rdx
leaq 0xa442(%rip), %rdi      # 0xd520
callq 0x2040
movslq -0x1c(%rbp), %rcx
leaq 0xa432(%rip), %rax      # 0xd520
movb $0x0, (%rax,%rcx)
leaq 0xa427(%rip), %rdi      # 0xd520
leaq 0x691a(%rip), %rsi      # 0x9a1a
callq 0x2170
movq 0xa2ac(%rip), %rsi      # 0xd3b8
movslq -0x1c(%rbp), %rdx
leaq 0xa2a9(%rip), %rdi      # 0xd3c0
callq 0x2040
movslq -0x1c(%rbp), %rcx
leaq 0xa299(%rip), %rax      # 0xd3c0
movb $0x0, (%rax,%rcx)
leaq 0xa28e(%rip), %rdi      # 0xd3c0
leaq 0x68e6(%rip), %rsi      # 0x9a1f
callq 0x2170
movq 0xa273(%rip), %rsi      # 0xd3b8
movslq -0x1c(%rbp), %rdx
leaq 0xa470(%rip), %rdi      # 0xd5c0
callq 0x2040
movslq -0x1c(%rbp), %rcx
leaq 0xa460(%rip), %rax      # 0xd5c0
movb $0x0, (%rax,%rcx)
leaq 0xa455(%rip), %rdi      # 0xd5c0
leaq 0x68b2(%rip), %rsi      # 0x9a24
callq 0x2170
callq 0x21b0
movq (%rax), %rax
movq 0xa232(%rip), %rcx      # 0xd3b8
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x31c5
movq 0xa217(%rip), %rax      # 0xd3b8
movsbl 0x1(%rax), %eax
cmpl $0x3a, %eax
jne 0x31c5
movq 0xa207(%rip), %rax      # 0xd3b8
movsbl 0x2(%rax), %eax
cmpl $0x5c, %eax
je 0x31c5
movq 0xa1f7(%rip), %rax      # 0xd3b8
movb $0x5c, 0x1(%rax)
movl -0x14(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq 0xa1e3(%rip), %rax      # 0xd3b8
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x2f, %ecx
movb %al, -0x49(%rbp)
je 0x320a
movq 0xa1ca(%rip), %rax      # 0xd3b8
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x5c, %ecx
movb %al, -0x49(%rbp)
je 0x320a
cmpl $0x0, -0x1c(%rbp)
setge %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x3213
jmp 0x321e
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x31ce
movq 0xa193(%rip), %rsi      # 0xd3b8
movl -0x1c(%rbp), %eax
addl $0x1, %eax
cltq
addq %rax, %rsi
leaq 0xa409(%rip), %rdi      # 0xd640
callq 0x2060
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)