// File: /workspace/github_c_makefile_star2_O3/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
subq $0x18, %rsp
movl %edi, %ebp
cmpl $0x2, %edi
jl 0x1845f
movq %rsi, %r14
movq 0x8(%rsi), %r15
movq %r15, %rdi
movl $0x2e, %esi
callq 0x8760
testq %rax, %rax
je 0x18207
leaq 0xcd66f(%rip), %rbx     # 0xe5810
movq %rbx, %rdi
movq %r15, %rsi
callq 0x85b0
movabsq $0x6d2e78697274616d, %rax # imm = 0x6D2E78697274616D
xorq (%rbx), %rax
movabsq $0x70616d2e786972, %rcx # imm = 0x70616D2E786972
xorq 0x3(%rbx), %rcx
orq %rax, %rcx
je 0x181ec
movabsq $0x4d2e58495254414d, %rax # imm = 0x4D2E58495254414D
xorq (%rbx), %rax
movabsq $0x50414d2e584952, %rcx # imm = 0x50414D2E584952
xorq 0x3(%rbx), %rcx
orq %rax, %rcx
jne 0x181f6
movl $0x7, 0x11731a(%rip)    # 0x12f510
movb $0x1, 0x118e2c(%rip)    # 0x131029
movl $0x1, 0x118e25(%rip)    # 0x13102c
leaq 0x117152(%rip), %rax    # 0x12f360
movl $0x1, (%rax)
movl %ebp, 0xc(%rsp)
movl %ebp, %eax
movl $0x1, %r15d
movq %rax, 0x10(%rsp)
subq %rax, %r15
movl $0x2, %r13d
xorl %r12d, %r12d
leaq 0x779c0(%rip), %rbx     # 0x8fbf8
movq -0x8(%r14,%r13,8), %rbp
movq %rbp, %rdi
leaq 0x77946(%rip), %rsi     # 0x8fb8d
callq 0x8bc0
testl %eax, %eax
jne 0x1825a
movb $0x1, 0x118dd9(%rip)    # 0x131030
incb %r12b
movq %rbp, %rdi
leaq 0x77932(%rip), %rsi     # 0x8fb96
callq 0x8bc0
testl %eax, %eax
jne 0x18277
movb $0x1, 0x118dbd(%rip)    # 0x131031
incb %r12b
movq %rbp, %rdi
leaq 0x7791f(%rip), %rsi     # 0x8fba0
callq 0x8bc0
testl %eax, %eax
jne 0x182d2
leaq 0x3168d3(%rip), %rax    # 0x32eb64
movb $0x1, (%rax)
cmpq 0x10(%rsp), %r13
jae 0x182ca
leaq 0xcd3be(%rip), %rbp     # 0xe5660
movl $0x0, 0x7(%rbp)
movq $0x0, (%rbp)
movq (%r14,%r13,8), %rsi
movl $0xa, %edx
movq %rbp, %rdi
callq 0x8210
movq %rbp, %rdi
callq 0x35b9e
incb %r12b
movq -0x8(%r14,%r13,8), %rbp
movq %rbp, %rdi
leaq 0x778cc(%rip), %rsi     # 0x8fba8
callq 0x8bc0
testl %eax, %eax
jne 0x182fa
incb %r12b
leaq 0x117071(%rip), %rax    # 0x12f360
movl $0x0, (%rax)
movq -0x8(%r14,%r13,8), %rbp
movq %rbp, %rdi
leaq 0x778ab(%rip), %rsi     # 0x8fbaf
callq 0x8bc0
testl %eax, %eax
jne 0x1831a
incb %r12b
movl $0x1, 0x118d1a(%rip)    # 0x131034
movq %rbp, %rdi
leaq 0x77895(%rip), %rsi     # 0x8fbb9
callq 0x8bc0
testl %eax, %eax
jne 0x1833a
incb %r12b
movl $0x1, 0x118cfe(%rip)    # 0x131038
movq %rbp, %rdi
leaq 0x7787d(%rip), %rsi     # 0x8fbc1
callq 0x8bc0
testl %eax, %eax
jne 0x1835a
incb %r12b
movl $0x1, 0x118ce2(%rip)    # 0x13103c
movq %rbp, %rdi
leaq 0x77865(%rip), %rsi     # 0x8fbc9
callq 0x8bc0
testl %eax, %eax
jne 0x1837a
incb %r12b
movl $0x1, 0x118cc6(%rip)    # 0x131040
movq %rbp, %rdi
leaq 0x7784d(%rip), %rsi     # 0x8fbd1
callq 0x8bc0
testl %eax, %eax
jne 0x1839a
incb %r12b
movl $0x1, 0x118caa(%rip)    # 0x131044
movq %rbp, %rdi
leaq 0x77836(%rip), %rsi     # 0x8fbda
callq 0x8bc0
cmpl $0x1, %eax
adcb $0x0, %r12b
movq %rbp, %rdi
leaq 0x7782a(%rip), %rsi     # 0x8fbe4
callq 0x8bc0
testl %eax, %eax
jne 0x183d0
incb %r12b
movl $0x1, 0x118c5c(%rip)    # 0x13102c
movq %rbp, %rdi
leaq 0x77813(%rip), %rsi     # 0x8fbed
callq 0x8bc0
testl %eax, %eax
jne 0x183f8
incb %r12b
leaq 0xcc1f7(%rip), %rax     # 0xe45e4
movl $0x1, (%rax)
movq -0x8(%r14,%r13,8), %rbp
movq %rbp, %rdi
leaq 0x777f1(%rip), %rsi     # 0x8fbf3
callq 0x8bc0
testl %eax, %eax
jne 0x18420
incb %r12b
leaq 0x208e1b(%rip), %rax    # 0x221230
movl $0x1, (%rax)
movq -0x8(%r14,%r13,8), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x8bc0
testl %eax, %eax
jne 0x1843f
incb %r12b
leaq 0x208dfb(%rip), %rax    # 0x221234
movl $0x1, (%rax)
leaq (%r15,%r13), %rax
incq %rax
incq %r13
cmpq $0x2, %rax
jne 0x18238
testb %r12b, %r12b
sete %bl
movl 0xc(%rsp), %ebp
jmp 0x18489
leaq 0xcd3aa(%rip), %rax     # 0xe5810
movabsq $0x2e30796177627573, %rcx # imm = 0x2E30796177627573
movq %rcx, (%rax)
movl $0x70616d, 0x8(%rax)    # imm = 0x70616D
leaq 0x116edf(%rip), %rax    # 0x12f360
movl $0x1, (%rax)
movb $0x1, %bl
cmpb $0x0, 0x118b99(%rip)    # 0x131029
je 0x184b0
leaq 0xcd377(%rip), %rdi     # 0xe5810
xorl %esi, %esi
callq 0x8190
testl %eax, %eax
jne 0x184d1
cmpb $0x1, 0x118b7e(%rip)    # 0x131029
setne %al
jmp 0x184b2
movb $0x1, %al
cmpl $0x2, %ebp
jl 0x184bb
andb %al, %bl
jne 0x184ca
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1811e
jmp 0x184e6
leaq 0x7772d(%rip), %rdi     # 0x8fc05
leaq 0xcd331(%rip), %rsi     # 0xe5810
xorl %eax, %eax
callq 0x80b0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x8950