// File: /workspace/github_c_makefile_star2_O1/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), %r13d
cmpl $0x2, %r13d
jl 0x3ebd
movq %rsi, %rbp
leaq 0x8506(%rip), %rsi      # 0xc010
xorl %r15d, %r15d
movl %r13d, %r14d
leal 0x1(%r15), %r12d
leaq 0x8(%rbp), %rbx
decl %r14d
je 0x3e0f
movq (%rbx), %rax
movb (%rax), %dil
cmpb $0x2d, %dil
jne 0x3dfa
movzbl 0x1(%rax), %ecx
leal -0x64(%rcx), %edx
cmpl $0x14, %edx
ja 0x3b55
movslq (%rsi,%rdx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
movl $0x1, 0x10830(%rip)     # 0x14380
jmp 0x3dfa
cmpl $0x44, %ecx
jne 0x3cb1
movb %dil, 0x7(%rsp)
movq 0x10(%rbp), %rax
leaq 0x193b2(%rip), %rcx     # 0x1cf20
movq %rax, (%rcx)
leaq 0x193b8(%rip), %rax     # 0x1cf30
movl $0x20, (%rax)
leaq 0x18(%rsp), %rdi
callq 0x53a9
testl %eax, %eax
je 0x3b9d
movl $0xffffffd8, %edi       # imm = 0xFFFFFFD8
leaq 0x93fa(%rip), %rsi      # 0xcf92
callq 0xa2c8
movq $0x1, 0x20(%rsp)
movl $0x1, 0x1c(%rsp)
movl $0x3d, %edi
callq 0x4fa3
testl %eax, %eax
je 0x3be5
leaq 0x8(%rsp), %rdi
callq 0x9850
testl %eax, %eax
je 0x3bdb
movl $0xffffffd8, %edi       # imm = 0xFFFFFFD8
leaq 0x93bc(%rip), %rsi      # 0xcf92
callq 0xa2c8
movslq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
addl $-0x2, %r13d
addq $0x10, %rbp
addl $0x2, %r15d
leaq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x5d4f
jmp 0x3c73
movb %dil, 0x7(%rsp)
movq 0x10(%rbp), %rax
leaq 0x1930e(%rip), %rcx     # 0x1cf20
movq %rax, (%rcx)
leaq 0x19314(%rip), %rax     # 0x1cf30
movl $0x20, (%rax)
leaq 0x18(%rsp), %rdi
callq 0x9850
testl %eax, %eax
je 0x3c41
movl $0xffffffd8, %edi       # imm = 0xFFFFFFD8
leaq 0x9356(%rip), %rsi      # 0xcf92
callq 0xa2c8
addl $-0x2, %r13d
addq $0x10, %rbp
addl $0x2, %r15d
movl 0x18(%rsp), %eax
movl %eax, 0x10769(%rip)     # 0x143c0
movl 0x10993(%rip), %ecx     # 0x145f0
movl %ecx, 0x10769(%rip)     # 0x143cc
movl $0x1, 0x10757(%rip)     # 0x143c4
movl %eax, 0x1073d(%rip)     # 0x143b0
movq %rbp, %rbx
movl %r15d, %r12d
movl %r13d, %r14d
leaq 0x838d(%rip), %rsi      # 0xc010
movb 0x7(%rsp), %dil
jmp 0x3dfa
movl $0x1, 0x106e1(%rip)     # 0x14378
jmp 0x3dfa
cmpb $0x63, 0x2(%rax)
jne 0x3cb1
movl $0x1, 0x106f4(%rip)     # 0x143a0
jmp 0x3dfa
movl %edi, %ebp
movl $0xffffffd8, %edi       # imm = 0xFFFFFFD8
leaq 0x92d3(%rip), %rsi      # 0xcf92
callq 0xa2c8
movl %ebp, %edi
leaq 0x8343(%rip), %rsi      # 0xc010
jmp 0x3dfa
movl 0x106a4(%rip), %eax     # 0x1437c
cmpl $0x2, %eax
jg 0x3dfa
incl %eax
movl %eax, 0x10693(%rip)     # 0x1437c
jmp 0x3dfa
movzbl 0x2(%rax), %eax
cmpl $0x4b, %eax
jle 0x3d9c
cmpl $0x6c, %eax
je 0x3d12
cmpl $0x67, %eax
je 0x3da6
cmpl $0x4c, %eax
jne 0x3dd2
movl $0x1, 0x108d4(%rip)     # 0x145f0
movl $0xffffffff, 0x108ce(%rip) # imm = 0xFFFFFFFF
jmp 0x3dee
addl $-0x2, %r13d
leaq 0x10(%rbp), %rbx
addl $0x2, %r15d
movl %edi, %r14d
movq 0x10(%rbp), %rdi
callq 0x30b0
leaq 0x1(%rax), %rdi
callq 0x331c
movq %rax, 0x1061d(%rip)     # 0x14370
movq 0x10(%rbp), %rsi
movq %rax, %rdi
callq 0x3070
movl %r14d, %edi
leaq 0x82a7(%rip), %rsi      # 0xc010
movl %r15d, %r12d
movl %r13d, %r14d
jmp 0x3dfa
movl $0x1, 0x10606(%rip)     # 0x14384
jmp 0x3dfa
cmpb $0x68, 0x2(%rax)
jne 0x3d90
movl $0x1, 0x105fc(%rip)     # 0x1438c
movl $0x1, 0x105ee(%rip)     # 0x14388
jmp 0x3dfa
cmpl $0x44, %eax
je 0x3dbc
cmpl $0x47, %eax
jne 0x3dd2
movl $0x2, 0x10840(%rip)     # 0x145f0
movl $0x0, 0x1083a(%rip)     # 0x145f4
jmp 0x3dee
movl $0x3, 0x1082a(%rip)     # 0x145f0
movl $0x1, 0x10824(%rip)     # 0x145f4
jmp 0x3dee
movl %edi, %ebp
movl $0xffffffee, %edi       # imm = 0xFFFFFFEE
leaq 0x917e(%rip), %rsi      # 0xcf5e
callq 0xa2c8
movl %ebp, %edi
leaq 0x8222(%rip), %rsi      # 0xc010
movl 0x107fc(%rip), %eax     # 0x145f0
movl %eax, 0x105d2(%rip)     # 0x143cc
movq %rbx, %rbp
movl %r12d, %r15d
movl %r14d, %r13d
cmpb $0x2d, %dil
je 0x3b10
jmp 0x3e12
xorl %r14d, %r14d
cmpl $0x1, %r14d
je 0x3e29
leaq 0x9173(%rip), %rsi      # 0xcf92
movl $0xffffffd8, %edi       # imm = 0xFFFFFFD8
callq 0xa2c8
cmpq $0x0, 0x1053f(%rip)     # 0x14370
jne 0x3ea6
movq (%rbx), %rdi
callq 0x30b0
leaq 0x2(%rax), %rdi
callq 0x331c
movq %rax, %r14
movq %rax, 0x10522(%rip)     # 0x14370
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x3070
movq %r14, %rdi
callq 0x30b0
leaq (%r14,%rax), %rcx
movq %rax, %rsi
negq %rsi
xorl %edi, %edi
leaq -0x1(%rdi), %rdx
cmpq %rdi, %rsi
je 0x3e7f
cmpb $0x2e, (%rcx,%rdi)
movq %rdx, %rdi
jne 0x3e6d
movq %rax, %rsi
notq %rsi
cmpq %rdx, %rsi
je 0x3e93
leaq (%rcx,%rdx), %rax
incq %rax
jmp 0x3ea0
leaq (%r14,%rax,2), %rax
addq %rdx, %rax
incq %rax
movb $0x2e, (%rax)
movw $0x6f, 0x1(%rax)
movq 0x10(%rsp), %rax
movl %r12d, (%rax)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3aa1
jmp 0x3ec9
callq 0x3ac4
movl $0x1, %edi
callq 0x31c0