// File: /workspace/github_c_makefile_star2_O2/42Bastian[P]lyxass/lyxass.c
// Function: CommandLine
void CommandLine(int *_argc, char **_argv)
{

  int argc = *_argc;
  char **argv = _argv;
  int c_arg = 0;

  if ( argc < 2 ){
    usage();
    exit(1);
  }

  while ( c_arg++,argv++,--argc ){
    char *s = *argv;
    if ( s[0] != '-' ) break;
    switch ( argv[0][1] ){
    case 'n':
      if ( argv[0][2] == 'c' ){
        noCcomment = 1;
      } else {
        Error(-CMD_ERR,"");
      }
      break;
    case 'o':
      --argc;
      ++argv;
      c_arg++;
      outfile = my_malloc((long)strlen(*argv)+1);
      strcpy(outfile,*argv);
      break;
    case 'v':
      if ( verbose < 3 ) ++verbose;
      break;
    case 'w':
      warning = 1;
      break;
    case 'd':
      data = 1;
      break;
    case 'D':
      {
        label_t label;
        int solved;

        --argc;
        ++argv;
        ++c_arg;
        srcLinePtr = *argv;

        atom = ' ';

        if ( GetLabel( &label ) ) Error(-CMD_ERR,"");
        label.value = 1;
        label.type = NORMAL;
        if ( TestAtom('=') ){
          int64_t l;
          if ( uni(&l) ) Error(-CMD_ERR,"");
          label.value = (int32_t)l;
        }
        DefineLabel(&label, &solved);
      }
      break;
    case 'x':
      {
        int64_t l;

        --argc;
        ++argv;
        ++c_arg;
        srcLinePtr = *argv;
        atom = ' ';
        if ( uni(&l) ) Error(-CMD_ERR,"");
        Global.run = (uint32_t)l;
        Global.mainMode = sourceMode;
        Global.genesis = 1;
        Global.pc =  (uint32_t)l;
      }
      break;
    case 't':
        if ( argv[0][2] == 'l' || argv[0][2] == 'L' ){
          sourceMode = LYNX;
          jaguar_mode = -1;
        } else if ( argv[0][2] == 'g' || argv[0][2] == 'G' ){
          sourceMode = JAGUAR_GPU;
          jaguar_mode = 0;
        } else if ( argv[0][2] == 'D' || argv[0][2] == 'D' ){
          sourceMode = JAGUAR_DSP;
          jaguar_mode = 1;
        } else {
          Error(-SYNTAX_ERR,"Need l,g or d\n");
        }
        Global.mainMode = sourceMode;
        break;
    case 'h':
      help();
      exit(1);
    case 'r':
      dumpGlobals = 1;
      break;
    case 's':
      if (argv[0][2] == 'h' ){
        hexsymbols=1;
      }
      symbols = 1;
      break;
    default:
      Error(-CMD_ERR,"");
    }
  }
  if ( argc != 1 ) Error(-CMD_ERR,"");

  if ( !outfile ){
    char *p;
    outfile = my_malloc((long)strlen(*argv)+2);
    strcpy(outfile,*argv);
    p = outfile+strlen(outfile);
    while ( *p != '.' && p != outfile )
      --p;

    if ( p == outfile ){
      p += strlen(outfile);
      p[0] = '.';
    }
    p[1] = 'o';
    p[2] = 0;
  }

  *_argc = c_arg;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, 0x10(%rsp)
movl (%rdi), %r15d
cmpl $0x2, %r15d
jl 0x3e03
movq %rsi, %r13
xorl %r14d, %r14d
leaq 0x757b(%rip), %rsi      # 0xb010
leal 0x1(%r14), %ebx
leaq 0x8(%r13), %rbp
movl %r15d, %r12d
decl %r12d
je 0x3d65
movq (%rbp), %rax
cmpb $0x2d, (%rax)
jne 0x3d5f
movzbl 0x1(%rax), %ecx
leal -0x64(%rcx), %edx
cmpl $0x14, %edx
ja 0x3ada
movslq (%rsi,%rdx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
movl $0x1, 0x108ab(%rip)     # 0x14380
jmp 0x3c46
cmpl $0x44, %ecx
je 0x3cc3
jmp 0x3b09
movl $0x1, 0x10889(%rip)     # 0x14378
jmp 0x3c46
cmpb $0x63, 0x2(%rax)
jne 0x3b09
movl $0x1, 0x1089c(%rip)     # 0x143a0
jmp 0x3c46
pushq $-0x28
popq %rdi
leaq 0x847f(%rip), %rsi      # 0xbf92
callq 0x96cc
leaq 0x74f1(%rip), %rsi      # 0xb010
jmp 0x3c46
movl 0x10852(%rip), %eax     # 0x1437c
movq %rbp, %r13
movl %ebx, %r14d
movl %r12d, %r15d
cmpl $0x2, %eax
jg 0x3a95
incl %eax
movl %eax, 0x10838(%rip)     # 0x1437c
jmp 0x3c46
movzbl 0x2(%rax), %eax
cmpl $0x44, %eax
je 0x3c29
cmpl $0x47, %eax
je 0x3bf6
cmpl $0x6c, %eax
je 0x3b76
cmpl $0x67, %eax
je 0x3bf6
cmpl $0x4c, %eax
jne 0x3c0b
movl $0x1, 0x10a70(%rip)     # 0x145f0
orl $-0x1, 0x10a6d(%rip)    # 0x145f4
pushq $0x1
jmp 0x3c3f
addl $-0x2, %r15d
leaq 0x10(%r13), %rbx
addl $0x2, %r14d
movq 0x10(%r13), %rdi
callq 0x30b0
leaq 0x1(%rax), %rdi
callq 0x32ec
movq %rax, 0x107bd(%rip)     # 0x14370
movq 0x10(%r13), %rsi
movq %rax, %rdi
callq 0x3070
leaq 0x744a(%rip), %rsi      # 0xb010
movq %rbx, %r13
jmp 0x3a95
movl $0x1, 0x107ac(%rip)     # 0x14384
jmp 0x3c46
cmpb $0x68, 0x2(%rax)
jne 0x3bea
movl $0x1, 0x107a2(%rip)     # 0x1438c
movl $0x1, 0x10794(%rip)     # 0x14388
jmp 0x3c46
movl $0x2, 0x109f0(%rip)     # 0x145f0
andl $0x0, 0x109ed(%rip)     # 0x145f4
pushq $0x2
jmp 0x3c3f
pushq $-0x12
popq %rdi
leaq 0x8349(%rip), %rsi      # 0xbf5e
callq 0x96cc
leaq 0x73ef(%rip), %rsi      # 0xb010
movl 0x109c9(%rip), %eax     # 0x145f0
jmp 0x3c40
movl $0x3, 0x109bd(%rip)     # 0x145f0
movl $0x1, 0x109b7(%rip)     # 0x145f4
pushq $0x3
popq %rax
movl %eax, 0x10786(%rip)     # 0x143cc
movq %rbp, %r13
movl %ebx, %r14d
movl %r12d, %r15d
jmp 0x3a95
movq 0x10(%r13), %rax
leaq 0x192c1(%rip), %rcx     # 0x1cf20
movq %rax, (%rcx)
leaq 0x192c7(%rip), %rax     # 0x1cf30
movl $0x20, (%rax)
leaq 0x18(%rsp), %rdi
callq 0x8d2b
testl %eax, %eax
je 0x3c8c
pushq $-0x28
popq %rdi
leaq 0x830b(%rip), %rsi      # 0xbf92
callq 0x96cc
addl $-0x2, %r15d
addq $0x10, %r13
addl $0x2, %r14d
movl 0x18(%rsp), %eax
movl %eax, 0x1071e(%rip)     # 0x143c0
movl 0x10948(%rip), %ecx     # 0x145f0
movl %ecx, 0x1071e(%rip)     # 0x143cc
movl $0x1, 0x1070c(%rip)     # 0x143c4
movl %eax, 0x106f2(%rip)     # 0x143b0
jmp 0x3a8e
movq 0x10(%r13), %rax
leaq 0x19252(%rip), %rcx     # 0x1cf20
movq %rax, (%rcx)
leaq 0x19258(%rip), %rax     # 0x1cf30
movl $0x20, (%rax)
leaq 0x18(%rsp), %rdi
callq 0x4fa0
testl %eax, %eax
je 0x3cfb
pushq $-0x28
popq %rdi
leaq 0x829c(%rip), %rsi      # 0xbf92
callq 0x96cc
movq $0x1, 0x20(%rsp)
movl $0x1, 0x1c(%rsp)
pushq $0x3d
popq %rdi
callq 0x4da7
testl %eax, %eax
je 0x3d3f
leaq 0x8(%rsp), %rdi
callq 0x8d2b
testl %eax, %eax
je 0x3d35
pushq $-0x28
popq %rdi
leaq 0x8262(%rip), %rsi      # 0xbf92
callq 0x96cc
movslq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
addl $-0x2, %r15d
addq $0x10, %r13
addl $0x2, %r14d
leaq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x55fd
jmp 0x3a8e
cmpl $0x1, %r12d
je 0x3d74
leaq 0x8226(%rip), %rsi      # 0xbf92
pushq $-0x28
popq %rdi
callq 0x96cc
cmpq $0x0, 0x105f4(%rip)     # 0x14370
jne 0x3de6
movq (%rbp), %rdi
callq 0x30b0
leaq 0x2(%rax), %rdi
callq 0x32ec
movq %rax, %r14
movq %rax, 0x105d6(%rip)     # 0x14370
movq (%rbp), %rsi
movq %rax, %rdi
callq 0x3070
movq %r14, %rdi
callq 0x30b0
leaq (%r14,%rax), %rcx
incq %rcx
addq %rax, %r14
negq %rax
movq %rax, %rsi
leaq -0x1(%rcx), %rdx
incq %rax
testq %rsi, %rsi
je 0x3dd3
cmpb $0x2e, -0x1(%rcx)
movq %rdx, %rcx
jne 0x3dbb
cmpq $0x1, %rax
jne 0x3de0
movb $0x2e, (%r14)
movq %r14, %rdx
movw $0x6f, 0x1(%rdx)
movq 0x10(%rsp), %rax
movl %ebx, (%rax)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3a4c
jmp 0x3e08
callq 0x3a29
pushq $0x1
popq %rdi
callq 0x31c0