// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekmsc.c
// Function: tekargv
void
tekargv(int argc, char const * const argv[])
{
     int       p;
     char      argmatch=0;

     if( (argc >= 2) ) {
          if( strchr(argv[1],'.') != 0 ) {
               strcpy(boardfilename,argv[1]);
               if( (strcmp(boardfilename,"matrix.map") == 0) || (strcmp(boardfilename,"MATRIX.MAP") == 0) ) {
                    mission=7;
               }
               singlemapmode=1;
               nobriefflag=1;
          }
     }
     else {
          strcpy(boardfilename,"subway0.map");
     }

     goreflag=1;

     for( p=1 ; p < argc ; p++ ) {
          if (Bstrcasecmp(argv[p],"PRACTICE") == 0) {
               generalplay=1;
               argmatch++;
          }
          if (Bstrcasecmp(argv[p],"NOVIDEOID") == 0) {
               novideoid=1;
               argmatch++;
          }
          if (Bstrcasecmp(argv[p],"NETNAME") == 0) {
               bypasscdcheck=1;
               if( (p+1) < argc ) {
                    memset(localname,0,sizeof(localname));
                    strncpy(localname,argv[p+1],sizeof(localname)-1);
                    Bstrupr(localname);
               }
               argmatch++;
          }
          if (Bstrcasecmp(argv[p],"NOGORE") == 0) {
               argmatch++;
               goreflag=0;
          }
          if (Bstrcasecmp(argv[p],"NOENEMIES") == 0) {
               argmatch++;
               noenemiesflag=1;
          }
          if (Bstrcasecmp(argv[p],"NOGUARD") == 0) {
               argmatch++;
               noguardflag=1;
          }
          if (Bstrcasecmp(argv[p],"NOSTALK") == 0) {
               argmatch++;
               nostalkflag=1;
          }
          if (Bstrcasecmp(argv[p],"NOCHASE") == 0) {
               argmatch++;
               nochaseflag=1;
          }
          if (Bstrcasecmp(argv[p],"NOSTROLL") == 0) {
               argmatch++;
               nostrollflag=1;
          }
          if (Bstrcasecmp(argv[p],"DIGILOOPS") == 0) {
               argmatch++;
               //digiloopflag=1;
          }
          if (Bstrcasecmp(argv[p],"NOBRIEFS") == 0) {
               argmatch++;
               nobriefflag=1;
          }
          if (Bstrcasecmp(argv[p],"DEBUG") == 0) {
               argmatch++;
               dbgflag=1;
          }
          if (Bstrcasecmp(argv[p],"COOP") == 0) {
               argmatch++;
               coopmode=1;
          }
          if (Bstrcasecmp(argv[p],"SWITCHLEVELS") == 0) {
               argmatch++;
               switchlevelsflag=1;
          }
     }

     if( singlemapmode ) {
          if( access(boardfilename, F_OK) != 0 ) {
               printf("\ncant find %s\n", boardfilename);
               exit(-1);
          }
     }

     if( (argmatch == 0) && (singlemapmode != 1) && (argc > 1) ) {
          usage();
          exit(-1);
     }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, 0x4(%rsp)
cmpl $0x2, %edi
jl 0x16d62
movq 0x8(%r14), %rbx
pushq $0x2e
popq %rsi
movq %rbx, %rdi
callq 0x8760
testq %rax, %rax
je 0x16d7d
leaq 0xc4b06(%rip), %r15     # 0xdb810
movq %r15, %rdi
movq %rbx, %rsi
callq 0x85b0
leaq 0x6ae5b(%rip), %rsi     # 0x81b77
pushq $0xb
popq %rdx
movq %r15, %rdi
callq 0x89f0
testl %eax, %eax
je 0x16d45
leaq 0xc4ade(%rip), %rdi     # 0xdb810
leaq 0x6ae49(%rip), %rsi     # 0x81b82
pushq $0xb
popq %rdx
callq 0x89f0
testl %eax, %eax
jne 0x16d4f
movl $0x7, 0x10e7c1(%rip)    # 0x125510
movb $0x1, 0x1102d3(%rip)    # 0x127029
movl $0x1, 0x1102cc(%rip)    # 0x12702c
jmp 0x16d7d
leaq 0xc4aa7(%rip), %rax     # 0xdb810
movabsq $0x2e30796177627573, %rcx # imm = 0x2E30796177627573
movq %rcx, (%rax)
movl $0x70616d, 0x8(%rax)    # imm = 0x70616D
leaq 0x10e5dc(%rip), %rax    # 0x125360
movl $0x1, (%rax)
movslq 0x4(%rsp), %r12
pushq $0x1
popq %r13
xorl %r15d, %r15d
leaq 0x6ae5b(%rip), %rbp     # 0x81bf8
cmpq %r12, %r13
jge 0x16fa8
movq (%r14,%r13,8), %rbx
movq %rbx, %rdi
leaq 0x6add9(%rip), %rsi     # 0x81b8d
callq 0x8bc0
testl %eax, %eax
jne 0x16dc7
movb $0x1, 0x11026c(%rip)    # 0x127030
incb %r15b
movq %rbx, %rdi
leaq 0x6adc5(%rip), %rsi     # 0x81b96
callq 0x8bc0
testl %eax, %eax
jne 0x16de4
movb $0x1, 0x110250(%rip)    # 0x127031
incb %r15b
movq %rbx, %rdi
leaq 0x6adb2(%rip), %rsi     # 0x81ba0
callq 0x8bc0
testl %eax, %eax
jne 0x16e39
leaq 0x30dd66(%rip), %rax    # 0x324b64
movb $0x1, (%rax)
leal 0x1(%r13), %eax
cmpl 0x4(%rsp), %eax
jge 0x16e32
leaq 0xc484e(%rip), %rbx     # 0xdb660
andl $0x0, 0x7(%rbx)
andq $0x0, (%rbx)
movq 0x8(%r14,%r13,8), %rsi
movq %rbx, %rdi
pushq $0xa
popq %rdx
callq 0x8210
movq %rbx, %rdi
callq 0x31b92
incb %r15b
movq (%r14,%r13,8), %rbx
movq %rbx, %rdi
leaq 0x6ad65(%rip), %rsi     # 0x81ba8
callq 0x8bc0
testl %eax, %eax
jne 0x16e5d
incb %r15b
leaq 0x10e50a(%rip), %rax    # 0x125360
andl $0x0, (%rax)
movq (%r14,%r13,8), %rbx
movq %rbx, %rdi
leaq 0x6ad48(%rip), %rsi     # 0x81baf
callq 0x8bc0
testl %eax, %eax
jne 0x16e7d
incb %r15b
movl $0x1, 0x1101b7(%rip)    # 0x127034
movq %rbx, %rdi
leaq 0x6ad32(%rip), %rsi     # 0x81bb9
callq 0x8bc0
testl %eax, %eax
jne 0x16e9d
incb %r15b
movl $0x1, 0x11019b(%rip)    # 0x127038
movq %rbx, %rdi
leaq 0x6ad1a(%rip), %rsi     # 0x81bc1
callq 0x8bc0
testl %eax, %eax
jne 0x16ebd
incb %r15b
movl $0x1, 0x11017f(%rip)    # 0x12703c
movq %rbx, %rdi
leaq 0x6ad02(%rip), %rsi     # 0x81bc9
callq 0x8bc0
testl %eax, %eax
jne 0x16edd
incb %r15b
movl $0x1, 0x110163(%rip)    # 0x127040
movq %rbx, %rdi
leaq 0x6acea(%rip), %rsi     # 0x81bd1
callq 0x8bc0
testl %eax, %eax
jne 0x16efd
incb %r15b
movl $0x1, 0x110147(%rip)    # 0x127044
movq %rbx, %rdi
leaq 0x6acd3(%rip), %rsi     # 0x81bda
callq 0x8bc0
cmpl $0x1, %eax
adcb $0x0, %r15b
movq %rbx, %rdi
leaq 0x6acc7(%rip), %rsi     # 0x81be4
callq 0x8bc0
testl %eax, %eax
jne 0x16f33
incb %r15b
movl $0x1, 0x1100f9(%rip)    # 0x12702c
movq %rbx, %rdi
leaq 0x6acb0(%rip), %rsi     # 0x81bed
callq 0x8bc0
testl %eax, %eax
jne 0x16f5a
incb %r15b
leaq 0xc3694(%rip), %rax     # 0xda5e4
movl $0x1, (%rax)
movq (%r14,%r13,8), %rbx
movq %rbx, %rdi
leaq 0x6ac8f(%rip), %rsi     # 0x81bf3
callq 0x8bc0
testl %eax, %eax
jne 0x16f81
incb %r15b
leaq 0x2002b9(%rip), %rax    # 0x217230
movl $0x1, (%rax)
movq (%r14,%r13,8), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x8bc0
testl %eax, %eax
jne 0x16fa0
incb %r15b
leaq 0x20029a(%rip), %rax    # 0x217234
movl $0x1, (%rax)
incq %r13
jmp 0x16d9d
cmpb $0x0, 0x11007a(%rip)    # 0x127029
je 0x16fcf
leaq 0xc4858(%rip), %rdi     # 0xdb810
xorl %esi, %esi
callq 0x8190
testl %eax, %eax
jne 0x16ff7
cmpb $0x1, 0x11005f(%rip)    # 0x127029
setne %al
jmp 0x16fd1
movb $0x1, %al
cmpl $0x2, 0x4(%rsp)
jl 0x16fe1
testb %r15b, %r15b
jne 0x16fe1
testb %al, %al
jne 0x16ff0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x16c8e
jmp 0x1700c
leaq 0x6ac07(%rip), %rdi     # 0x81c05
leaq 0xc480b(%rip), %rsi     # 0xdb810
xorl %eax, %eax
callq 0x80b0
pushq $-0x1
popq %rdi
callq 0x8950