// File: /workspace/github_c_makefile_star2_O0/simh[P]simtools/crossassemblers/macro1/macro1.c
// Function: getArgs
void getArgs( int argc, char *argv[] )
{
  WORD32  len;
  WORD32  ix, jx;

  /* Set the defaults */
  infile = NULL;
  listfile = NULL;
  listsave = NULL;
  objectfile = NULL;
  objectsave = NULL;

  for( ix = 1; ix < argc; )
  {
    if( argv[ix][0] == '-' )
    {
      char *switches = argv[ix++];
      for( jx = 1; switches[jx] != 0; jx++ )
      {
        switch( switches[jx] )
        {
        case 'd':
          symtab_print = TRUE;
          break;

        case 'r':
          rim_mode = TRUE;		/* punch pure rim-mode tapes */
          break;

	case 's':
	  sym_dump = TRUE;
	  break;

        case 'm':
          nomac_exp = FALSE;
          break;

        case 'p':
          print_permanent_symbols = TRUE;
          break;

        case 'x':
          xref = TRUE;
          break;

	case 'S':
	  if (ix <= argc)
	      read_symbols(argv[ix++]);
	  break;

        default:
          fprintf( stderr, "%s: unknown flag: %s\n", argv[0], argv[ix] );
          fprintf( stderr, " -d -- dump symbol table\n" );
          fprintf( stderr, " -m -- output macro expansions\n" );
          fprintf( stderr, " -p -- output permanent symbols to file\n" );
          fprintf( stderr, " -r -- output RIM format file\n" );
          fprintf( stderr, " -s -- output symbol punch tape to file\n" ); 
          fprintf( stderr, " -S file -- read symbol punch tape\n" );
	  fprintf( stderr, " -x -- output cross reference to file\n" );
          fflush( stderr );
          exit( -1 );
        } /* end switch */
      } /* end for */
    }
    else
    {
      filix_start = ix;
      pathname = argv[ix];
      break;
    }
  } /* 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 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");

  strncpy( listpathname, pathname, jx );
  listpathname[jx] = '\0';
  strcat( listpathname, ".lst" );

  strncpy( permpathname, pathname, jx );
  permpathname[jx] = '\0';
  strcat( permpathname, ".prm" );

  strncpy( sympathname, pathname, jx );
  sympathname[jx] = '\0';
  strcat( sympathname, ".sym" );

  /* 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 $0x40, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, 0x9616(%rip) # 0xbec0
movq $0x0, 0x95eb(%rip) # 0xbea0
movq $0x0, 0x95e8(%rip) # 0xbea8
movq $0x0, 0x9545(%rip) # 0xbe10
movq $0x0, 0x9542(%rip) # 0xbe18
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x2afa
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x2ad7
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x18(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movl $0x1, -0x1c(%rbp)
movq -0x28(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x2ad5
movq -0x28(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $-0x53, %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x25, %eax
ja 0x29d9
movq -0x30(%rbp), %rax
leaq 0x56a4(%rip), %rcx      # 0x8004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x1, 0x93f8(%rip)      # 0xbd68
jmp 0x2ac5
movb $0x1, 0x93e6(%rip)      # 0xbd62
jmp 0x2ac5
movb $0x1, 0x93db(%rip)      # 0xbd63
jmp 0x2ac5
movb $0x0, 0x93cd(%rip)      # 0xbd61
jmp 0x2ac5
movb $0x1, 0x93c0(%rip)      # 0xbd60
jmp 0x2ac5
movb $0x1, 0x93bd(%rip)      # 0xbd69
jmp 0x2ac5
movl -0x18(%rbp), %eax
cmpl -0x4(%rbp), %eax
jg 0x29d4
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x18(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x38a0
jmp 0x2ac5
movq 0x8618(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
leaq 0x5c72(%rip), %rsi      # 0x866f
movb $0x0, %al
callq 0x2110
movq 0x85ed(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x5c70(%rip), %rsi      # 0x8685
movb $0x0, %al
callq 0x2110
movq 0x85d5(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x5c72(%rip), %rsi      # 0x869f
movb $0x0, %al
callq 0x2110
movq 0x85bd(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x5c7a(%rip), %rsi      # 0x86bf
movb $0x0, %al
callq 0x2110
movq 0x85a5(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x5c8b(%rip), %rsi      # 0x86e8
movb $0x0, %al
callq 0x2110
movq 0x858d(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x5c92(%rip), %rsi      # 0x8707
movb $0x0, %al
callq 0x2110
movq 0x8575(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x5ca3(%rip), %rsi      # 0x8730
movb $0x0, %al
callq 0x2110
movq 0x855d(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x5caf(%rip), %rsi      # 0x8754
movb $0x0, %al
callq 0x2110
movq 0x8545(%rip), %rax      # 0xaff8
movq (%rax), %rdi
callq 0x2140
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2190
jmp 0x2ac7
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2922
jmp 0x2af5
movl -0x18(%rbp), %eax
movl %eax, 0x93e8(%rip)      # 0xbec8
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x927d(%rip)      # 0xbd70
jmp 0x2afa
jmp 0x28dd
cmpq $0x0, 0x926e(%rip)      # 0xbd70
jne 0x2b2d
movq 0x84ed(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0x5c5f(%rip), %rsi      # 0x877b
movb $0x0, %al
callq 0x2110
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2190
movq 0x923c(%rip), %rdi      # 0xbd70
callq 0x2090
movl %eax, -0x14(%rbp)
cmpl $0x7b, -0x14(%rbp)
jle 0x2b72
movq 0x84af(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
movq 0x9216(%rip), %rcx      # 0xbd70
leaq 0x5c38(%rip), %rsi      # 0x8799
movb $0x0, %al
callq 0x2110
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2190
movl -0x14(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq 0x91ee(%rip), %rax      # 0xbd70
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x2e, %ecx
movb %al, -0x31(%rbp)
je 0x2bd0
movq 0x91d5(%rip), %rax      # 0xbd70
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x2f, %ecx
movb %al, -0x31(%rbp)
je 0x2bd0
movq 0x91bc(%rip), %rax      # 0xbd70
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x5c, %ecx
movb %al, -0x31(%rbp)
je 0x2bd0
cmpl $0x0, -0x1c(%rbp)
setge %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x2bd9
jmp 0x2be4
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2b7b
movq 0x9185(%rip), %rax      # 0xbd70
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x38(%rbp)
subl $0x2e, %eax
je 0x2c11
jmp 0x2bfd
movl -0x38(%rbp), %eax
subl $0x2f, %eax
je 0x2c13
jmp 0x2c07
movl -0x38(%rbp), %eax
subl $0x5c, %eax
je 0x2c13
jmp 0x2c1b
jmp 0x2c1d
movl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x2c1d
jmp 0x2c1d
movq 0x914c(%rip), %rsi      # 0xbd70
movslq -0x1c(%rbp), %rdx
leaq 0x9161(%rip), %rdi      # 0xbd90
callq 0x2040
movslq -0x1c(%rbp), %rcx
leaq 0x9151(%rip), %rax      # 0xbd90
movb $0x0, (%rax,%rcx)
leaq 0x9146(%rip), %rdi      # 0xbd90
leaq 0x5b64(%rip), %rsi      # 0x87b5
callq 0x2170
movq 0x9113(%rip), %rsi      # 0xbd70
movslq -0x1c(%rbp), %rdx
leaq 0x91b8(%rip), %rdi      # 0xbe20
callq 0x2040
movslq -0x1c(%rbp), %rcx
leaq 0x91a8(%rip), %rax      # 0xbe20
movb $0x0, (%rax,%rcx)
leaq 0x919d(%rip), %rdi      # 0xbe20
leaq 0x5b30(%rip), %rsi      # 0x87ba
callq 0x2170
movq 0x90da(%rip), %rsi      # 0xbd70
movslq -0x1c(%rbp), %rdx
leaq 0x922f(%rip), %rdi      # 0xbed0
callq 0x2040
movslq -0x1c(%rbp), %rcx
leaq 0x921f(%rip), %rax      # 0xbed0
movb $0x0, (%rax,%rcx)
leaq 0x9214(%rip), %rdi      # 0xbed0
leaq 0x5afc(%rip), %rsi      # 0x87bf
callq 0x2170
movq 0x90a1(%rip), %rsi      # 0xbd70
movslq -0x1c(%rbp), %rdx
leaq 0x9276(%rip), %rdi      # 0xbf50
callq 0x2040
movslq -0x1c(%rbp), %rcx
leaq 0x9266(%rip), %rax      # 0xbf50
movb $0x0, (%rax,%rcx)
leaq 0x925b(%rip), %rdi      # 0xbf50
leaq 0x5ac8(%rip), %rsi      # 0x87c4
callq 0x2170
callq 0x21b0
movq (%rax), %rax
movq 0x9060(%rip), %rcx      # 0xbd70
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x2d4f
movq 0x9045(%rip), %rax      # 0xbd70
movsbl 0x1(%rax), %eax
cmpl $0x3a, %eax
jne 0x2d4f
movq 0x9035(%rip), %rax      # 0xbd70
movsbl 0x2(%rax), %eax
cmpl $0x5c, %eax
je 0x2d4f
movq 0x9025(%rip), %rax      # 0xbd70
movb $0x5c, 0x1(%rax)
movl -0x14(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq 0x9011(%rip), %rax      # 0xbd70
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x2f, %ecx
movb %al, -0x39(%rbp)
je 0x2d94
movq 0x8ff8(%rip), %rax      # 0xbd70
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x5c, %ecx
movb %al, -0x39(%rbp)
je 0x2d94
cmpl $0x0, -0x1c(%rbp)
setge %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
testb $0x1, %al
jne 0x2d9d
jmp 0x2da8
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2d58
movq 0x8fc1(%rip), %rsi      # 0xbd70
movl -0x1c(%rbp), %eax
addl $0x1, %eax
cltq
addq %rax, %rsi
leaq 0x920f(%rip), %rdi      # 0xbfd0
callq 0x2070
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)