// File: /workspace/github_c_makefile_star2_O1/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
movq %rsi, %r14
movl %edi, %ebp
cmpl $0x2, %edi
jl 0x18136
movq 0x8(%r14), %r15
movq %r15, %rdi
movl $0x2e, %esi
callq 0x8760
testq %rax, %rax
je 0x18151
leaq 0xca742(%rip), %rbx     # 0xe2810
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 0x18119
movabsq $0x4d2e58495254414d, %rax # imm = 0x4D2E58495254414D
xorq (%rbx), %rax
movabsq $0x50414d2e584952, %rcx # imm = 0x50414D2E584952
xorq 0x3(%rbx), %rcx
orq %rax, %rcx
jne 0x18123
movl $0x7, 0x1143ed(%rip)    # 0x12c510
movb $0x1, 0x115edf(%rip)    # 0x12e009
movl $0x1, 0x115ed8(%rip)    # 0x12e00c
jmp 0x18151
leaq 0xca6d3(%rip), %rax     # 0xe2810
movabsq $0x2e30796177627573, %rcx # imm = 0x2E30796177627573
movq %rcx, (%rax)
movl $0x70616d, 0x8(%rax)    # imm = 0x70616D
leaq 0x114208(%rip), %rax    # 0x12c360
movl $0x1, (%rax)
movb $0x1, %bl
cmpl $0x2, %ebp
jl 0x183b6
movl %ebp, 0xc(%rsp)
movl %ebp, %eax
movl $0x1, %r15d
movq %rax, 0x10(%rsp)
subq %rax, %r15
movl $0x2, %r13d
xorl %r12d, %r12d
leaq 0x749e7(%rip), %rbx     # 0x8cb74
movq -0x8(%r14,%r13,8), %rdi
leaq 0x74970(%rip), %rsi     # 0x8cb09
callq 0x8bc0
testl %eax, %eax
jne 0x181ac
movb $0x1, 0x115e67(%rip)    # 0x12e010
incb %r12b
movq -0x8(%r14,%r13,8), %rdi
leaq 0x7495a(%rip), %rsi     # 0x8cb12
callq 0x8bc0
testl %eax, %eax
jne 0x181cb
movb $0x1, 0x115e49(%rip)    # 0x12e011
incb %r12b
movq -0x8(%r14,%r13,8), %rdi
leaq 0x74945(%rip), %rsi     # 0x8cb1c
callq 0x8bc0
testl %eax, %eax
jne 0x18223
leaq 0x31395d(%rip), %rax    # 0x32bb44
movb $0x1, (%rax)
cmpq 0x10(%rsp), %r13
jae 0x18220
leaq 0xca468(%rip), %rbp     # 0xe2660
movl $0x0, 0x7(%rbp)
movq $0x0, (%rbp)
movq (%r14,%r13,8), %rsi
movl $0xa, %edx
movq %rbp, %rdi
callq 0x8210
movq %rbp, %rdi
callq 0x348be
incb %r12b
movq -0x8(%r14,%r13,8), %rdi
leaq 0x748f5(%rip), %rsi     # 0x8cb24
callq 0x8bc0
testl %eax, %eax
jne 0x18248
incb %r12b
leaq 0x11411e(%rip), %rax    # 0x12c360
movl $0x0, (%rax)
movq -0x8(%r14,%r13,8), %rdi
leaq 0x748d7(%rip), %rsi     # 0x8cb2b
callq 0x8bc0
testl %eax, %eax
jne 0x1826a
incb %r12b
movl $0x1, 0x115daa(%rip)    # 0x12e014
movq -0x8(%r14,%r13,8), %rdi
leaq 0x748bf(%rip), %rsi     # 0x8cb35
callq 0x8bc0
testl %eax, %eax
jne 0x1828c
incb %r12b
movl $0x1, 0x115d8c(%rip)    # 0x12e018
movq -0x8(%r14,%r13,8), %rdi
leaq 0x748a5(%rip), %rsi     # 0x8cb3d
callq 0x8bc0
testl %eax, %eax
jne 0x182ae
incb %r12b
movl $0x1, 0x115d6e(%rip)    # 0x12e01c
movq -0x8(%r14,%r13,8), %rdi
leaq 0x7488b(%rip), %rsi     # 0x8cb45
callq 0x8bc0
testl %eax, %eax
jne 0x182d0
incb %r12b
movl $0x1, 0x115d50(%rip)    # 0x12e020
movq -0x8(%r14,%r13,8), %rdi
leaq 0x74871(%rip), %rsi     # 0x8cb4d
callq 0x8bc0
testl %eax, %eax
jne 0x182f2
incb %r12b
movl $0x1, 0x115d32(%rip)    # 0x12e024
movq -0x8(%r14,%r13,8), %rbp
movq %rbp, %rdi
leaq 0x74855(%rip), %rsi     # 0x8cb56
callq 0x8bc0
cmpl $0x1, %eax
adcb $0x0, %r12b
movq %rbp, %rdi
leaq 0x74849(%rip), %rsi     # 0x8cb60
callq 0x8bc0
testl %eax, %eax
jne 0x1832d
incb %r12b
movl $0x1, 0x115cdf(%rip)    # 0x12e00c
movq -0x8(%r14,%r13,8), %rdi
leaq 0x74830(%rip), %rsi     # 0x8cb69
callq 0x8bc0
testl %eax, %eax
jne 0x18352
incb %r12b
leaq 0xc9298(%rip), %rax     # 0xe15e4
movl $0x1, (%rax)
movq -0x8(%r14,%r13,8), %rdi
leaq 0x74811(%rip), %rsi     # 0x8cb6f
callq 0x8bc0
testl %eax, %eax
jne 0x18377
incb %r12b
leaq 0x205e9f(%rip), %rax    # 0x21e210
movl $0x1, (%rax)
movq -0x8(%r14,%r13,8), %rdi
movq %rbx, %rsi
callq 0x8bc0
testl %eax, %eax
jne 0x18398
incb %r12b
leaq 0x205e82(%rip), %rax    # 0x21e214
movl $0x1, (%rax)
leaq (%r15,%r13), %rax
incq %rax
incq %r13
cmpq $0x2, %rax
jne 0x1818d
testb %r12b, %r12b
sete %bl
movl 0xc(%rsp), %ebp
cmpb $0x0, 0x115c4c(%rip)    # 0x12e009
je 0x183d1
leaq 0xca44a(%rip), %rdi     # 0xe2810
xorl %esi, %esi
callq 0x8190
testl %eax, %eax
jne 0x183fa
cmpb $0x1, 0x115c31(%rip)    # 0x12e009
setne %al
cmpl $0x2, %ebp
jl 0x183e4
andb %al, %bl
jne 0x183f3
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x18047
jmp 0x1840f
leaq 0x74780(%rip), %rdi     # 0x8cb81
leaq 0xca408(%rip), %rsi     # 0xe2810
xorl %eax, %eax
callq 0x80b0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x8950