// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekgame.c
// Function: app_main
int
app_main(int argc, char const * const argv[])
{
     int      i, waitplayers;
     int     other;

#if defined(DATADIR)
     {
          const char *datadir = DATADIR;
          if (datadir && datadir[0]) {
               addsearchpath(datadir);
          }
     }
#endif

     {
          char *supportdir = Bgetsupportdir(1);
          char *appdir = Bgetappdir();
          char dirpath[BMAX_PATH+1];

          // the OSX app bundle, or on Windows the directory where the EXE was launched
          if (appdir) {
               addsearchpath(appdir);
               free(appdir);
          }

          // the global support files directory
          if (supportdir) {
               Bsnprintf(dirpath, sizeof(dirpath), "%s/JFTekWar", supportdir);
               addsearchpath(dirpath);
               free(supportdir);
          }
     }

     tekargv(argc, argv);

     // default behaviour is to write to the user profile directory, but
     // creating a 'user_profiles_disabled' file in the current working
     // directory where the game was launched makes the installation
     // "portable" by writing into the working directory
     if (access("user_profiles_disabled", F_OK) == 0) {
          char cwd[BMAX_PATH+1];
          if (getcwd(cwd, sizeof(cwd))) {
               addsearchpath(cwd);
          }
     } else {
          char *supportdir;
          char dirpath[BMAX_PATH+1];
          int asperr;

          if ((supportdir = Bgetsupportdir(0))) {
#if defined(_WIN32) || defined(__APPLE__)
               const char *confdir = "JFTekWar";
#else
               const char *confdir = ".jftekwar";
#endif
               Bsnprintf(dirpath, sizeof(dirpath), "%s/%s", supportdir, confdir);
               asperr = addsearchpath(dirpath);
               if (asperr == -2) {
                    if (Bmkdir(dirpath, S_IRWXU) == 0) {
                         asperr = addsearchpath(dirpath);
                    } else {
                         asperr = -1;
                    }
               }
               if (asperr == 0) {
                    chdir(dirpath);
               }
               free(supportdir);
          }
     }

     buildsetlogfile("tekwar.log");

     wm_setapptitle("JFTekWar");
     buildprintf("\nJFTekWar\n"
          "Based on " TITLE "\n"
          "Version %s.\nBuilt %s %s.\n",
        VERS, game_version, game_date, game_time);

     if (preinitengine()) {
          wm_msgbox("Build Engine Initialisation Error",
               "There was a problem initialising the Build engine: %s", engineerrstr);
          exit(1);
     }

     lm("tekloadsetup");
     tekloadsetup();

#ifdef HAVE_STARTWIN
    {
        struct startwin_settings settings;

        memset(&settings, 0, sizeof(settings));
        settings.fullscreen = fullscreen;
        settings.xdim3d = xdimgame;
        settings.ydim3d = ydimgame;
        settings.bpp3d = bppgame;
        settings.forcesetup = forcesetup;
        settings.usemouse = !!(option[3]&1);
        settings.usejoy = !!(option[3]&2);
        settings.samplerate = digihz[option[7]>>4];
        settings.bitspersample = 1<<(((option[7]&2)>0)+3);
        settings.channels = ((option[7]&4)>0)+1;

        if (forcesetup) {
            if (startwin_run(&settings) == STARTWIN_CANCEL) {
                uninitengine();
                exit(0);
            }
        }

        fullscreen = settings.fullscreen;
        xdimgame = settings.xdim3d;
        ydimgame = settings.ydim3d;
        bppgame = settings.bpp3d;
        forcesetup = settings.forcesetup;
        option[3] = (option[3]&~1)|(settings.usemouse);
        option[3] = (option[3]&~2)|(settings.usejoy<<1);
        option[7] = 0;
        for (i=0;i<8;i++) if (digihz[i] <= settings.samplerate) option[7] = i<<4;
        option[7] |= (settings.bitspersample == 16)<<1;
        option[7] |= (settings.channels == 2)<<2;
    }
#endif

     lm("initgroupfile");
     initgroupfile("stuff.dat");

     if (initengine()) {
          wm_msgbox("Build Engine Initialisation Error",
               "There was a problem initialising the Build engine: %s", engineerrstr);
          exit(1);
     }

     lm("inittimer");
     inittimer(CLKIPS, NULL);
     lm("tekinitmultiplayers");
     tekinitmultiplayers(0, NULL);
     lm("loadpics");
     loadpics("tiles000.art", 8*1048576);
     lm("tekpreinit");
     tekpreinit();
     lm("tekgamestarted");
     tekgamestarted();
     lm("initinput");
     initinput();
     lm("initmouse");
     if( option[3] != 0 ) initmouse();

     if (dbgflag) {
          lm("debug mode: ON");
          sprintf(dbgfname,"DEBUG.%03d",dbgfilen++);
          dbgfp=fopen(dbgfname,"wt");
          fprintf(dbgfp," P  CLOCK PLC BITS  ANG   X     Y     Z   HEALTH RSEED\n");
          fprintf(dbgfp,"== ====== === ==== ==== ===== ===== ===== ====== =========\n");
          dbgcolumn=0;
     }

     setgamemode(fullscreen, xdimgame, ydimgame, bppgame);

     lm("initsb");
     initsb(option[1],option[2],digihz[option[7]>>4],((option[7]&4)>0)+1,((option[7]&2)>0)+1,0,0);

     if( option[4] > 0 ) {
        lm("multiplayer init");
        teknetpickmap();
          sendlogon();
          if( option[4] < 5 ) {
               waitplayers=2;
          }
          else {
               waitplayers=option[4]-3;
          }
          while( numplayers < waitplayers ) {
               clearview(0);
               overwritesprite((xdim>>1)-160,0,408,0,0,0);
               sprintf((char *)tempbuf,"  MULTIPLAYER MODE  ");
               printext((xdim>>1)-80,(ydim>>1)-24,(char *)tempbuf,ALPHABET2,0);
               sprintf((char *)tempbuf,"%2d OF %2d PLAYERS IN",numplayers,waitplayers);
               printext((xdim>>1)-80,ydim>>1,(char *)tempbuf,ALPHABET2,0);
               nextpage();
               if( getpacket(&other,tempbuf) > 0 ) {
                    if( tempbuf[0] == 255 ) {
                         keystatus[1] = 1;
                    }
               }
               if( keystatus[1] > 0 ) {
                    goto gameends;
               }
          }
          screenpeek = myconnectindex;
          clearview(0);
     }
     for( i=connecthead ; i >= 0 ; i=connectpoint2[i] ) {
          initplayersprite((short)i);
     }

     if( option[4] == 0 ) {
          i = smkplayseq("tvopen");
          if (i < 1) i = smkplayseq("tekndie");
          if (i < 1) i = smkplayseq("tekintro");
          smkplayseq("intro");
     }

missionselection:
     if( option[4] == 0 ) {
          if( choosemission() == 0 ) {
               goto gameends;
          }
     }

     reccnt=0;
     movefifoplc = 0; movefifoend = 0;
     syncvalplc = 0; othersyncvalplc = 0;
     syncvalend = 0; othersyncvalend = 0;
     syncvalcnt = 0L; othersyncvalcnt = 0L;
     olocvel = 0; olocvel2 = 0;
     olocsvel = 0; olocsvel2 = 0;
     olocangvel = 0; olocangvel2 = 0;
     olocbits = 0; olocbits2 = 0;
     lockclock = 0;
     ototalclock = 0;
     gotlastpacketclock = 0;
     masterslavetexttime = 0;
     for( i=0; i<MAXPLAYERS; i++ ) {
          fsyncvel[i] = syncvel[i] = osyncvel[i] = 0;
          fsyncsvel[i] = syncsvel[i] = osyncsvel[i] = 0;
          fsyncangvel[i] = syncangvel[i] = osyncangvel[i] = 0;
          fsyncbits[i] = syncbits[i] = osyncbits[i] = 0;
     }
     resettiming();

     ready2send = 1;
    #ifdef NETNAMES
     if( option[4] != 0 ) {
          tempbuf[0]=8;
          tempbuf[1]=myconnectindex;
          memcpy(&tempbuf[2],localname,10);
          tempbuf[12]=0;
          for( i=connecthead; i>=0; i=connectpoint2[i] ) {
               if( i != myconnectindex ) {
                    sendpacket(i,tempbuf,12);
               }
          }
          memcpy(netnames[myconnectindex],localname,10);
          netnames[myconnectindex][10]=0;
     }
    #endif
     screenpeek=myconnectindex;
     while( !gameover ) {
        handleevents();
          while( movefifoplc != movefifoend ) {
               domovethings();
          }
          drawscreen(screenpeek,(totalclock-gotlastpacketclock)*(65536/TICSPERFRAME));
     }
     ready2send = 0;

     if( option[4] == 0 ) {
          debrief=1;
          goto missionselection;
     }

gameends:

     copyrightscreen();

     sendlogoff();
     uninitmultiplayers();
     uninitsb();
     cduninit();
     uninittimer();
     uninitinput();
     uninitengine();
     uninitgroupfile();

     teksavesetup();

     if (dbgflag) {
          fclose(dbgfp);
     }

     exit(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xca0, %rsp            # imm = 0xCA0
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0xce990(%rip), %rax     # 0xd8eb9
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xa549
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0xa549
movq -0x28(%rbp), %rdi
callq 0x4c640
movl $0x1, %edi
callq 0x4fe30
movq %rax, -0x30(%rbp)
callq 0x4fd70
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0xa579
movq -0x38(%rbp), %rdi
callq 0x4c640
movq -0x38(%rbp), %rdi
callq 0x8260
cmpq $0x0, -0x30(%rbp)
je 0xa5b3
leaq -0x440(%rbp), %rdi
movq -0x30(%rbp), %rcx
movl $0x401, %esi            # imm = 0x401
leaq 0xce942(%rip), %rdx     # 0xd8ed9
movb $0x0, %al
callq 0x86a0
leaq -0x440(%rbp), %rdi
callq 0x4c640
movq -0x30(%rbp), %rdi
callq 0x8260
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x1f400
leaq 0xce91f(%rip), %rdi     # 0xd8ee5
xorl %esi, %esi
callq 0x8180
cmpl $0x0, %eax
jne 0xa5fa
leaq -0x850(%rbp), %rdi
movl $0x401, %esi            # imm = 0x401
callq 0x8500
cmpq $0x0, %rax
je 0xa5f5
leaq -0x850(%rbp), %rdi
callq 0x4c640
jmp 0xa6bc
xorl %edi, %edi
callq 0x4fe30
movq %rax, -0x858(%rbp)
cmpq $0x0, %rax
je 0xa6ba
leaq 0xce8e3(%rip), %rax     # 0xd8efc
movq %rax, -0xc70(%rbp)
leaq -0xc60(%rbp), %rdi
movq -0x858(%rbp), %rcx
movq -0xc70(%rbp), %r8
movl $0x401, %esi            # imm = 0x401
leaq 0xce8c5(%rip), %rdx     # 0xd8f06
movb $0x0, %al
callq 0x86a0
leaq -0xc60(%rbp), %rdi
callq 0x4c640
movl %eax, -0xc64(%rbp)
cmpl $-0x2, -0xc64(%rbp)
jne 0xa699
leaq -0xc60(%rbp), %rdi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x8360
cmpl $0x0, %eax
jne 0xa68d
leaq -0xc60(%rbp), %rdi
callq 0x4c640
movl %eax, -0xc64(%rbp)
jmp 0xa697
movl $0xffffffff, -0xc64(%rbp) # imm = 0xFFFFFFFF
jmp 0xa699
cmpl $0x0, -0xc64(%rbp)
jne 0xa6ae
leaq -0xc60(%rbp), %rdi
callq 0x90c0
movq -0x858(%rbp), %rdi
callq 0x8260
jmp 0xa6bc
leaq 0xce849(%rip), %rdi     # 0xd8f0c
callq 0x75240
leaq 0xce80d(%rip), %rdi     # 0xd8edc
callq 0xc1ae0
leaq 0x12119d(%rip), %rax    # 0x12b878
movq (%rax), %rdx
leaq 0x12119b(%rip), %rax    # 0x12b880
movq (%rax), %rcx
leaq 0x121199(%rip), %rax    # 0x12b888
movq (%rax), %r8
leaq 0xce81e(%rip), %rdi     # 0xd8f17
leaq 0xce871(%rip), %rsi     # 0xd8f71
movb $0x0, %al
callq 0x52630
callq 0x52480
cmpl $0x0, %eax
je 0xa73a
leaq 0x3a8138(%rip), %rax    # 0x3b2850
movq (%rax), %rdx
leaq 0xce855(%rip), %rdi     # 0xd8f77
leaq 0xce870(%rip), %rsi     # 0xd8f99
movb $0x0, %al
callq 0xc1730
movl $0x1, %edi
callq 0x88d0
leaq 0xce88e(%rip), %rdi     # 0xd8fcf
leaq 0xce88f(%rip), %rsi     # 0xd8fd7
movb $0x0, %al
callq 0x80b0
movb $0x0, %al
callq 0x25670
leaq -0xc98(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x8410
leaq 0x36d778(%rip), %rax    # 0x377ee8
movl (%rax), %eax
movl %eax, -0xc98(%rbp)
movl 0x10f78a(%rip), %eax    # 0x119f08
movl %eax, -0xc94(%rbp)
movl 0x10f782(%rip), %eax    # 0x119f0c
movl %eax, -0xc90(%rbp)
movl 0x10f77a(%rip), %eax    # 0x119f10
movl %eax, -0xc8c(%rbp)
movl 0x10f772(%rip), %eax    # 0x119f14
movl %eax, -0xc88(%rbp)
movzbl 0x10f76c(%rip), %eax    # 0x119f1b
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0xc84(%rbp)
movzbl 0x10f74d(%rip), %eax    # 0x119f1b
andl $0x2, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0xc80(%rbp)
movzbl 0x10f732(%rip), %eax    # 0x119f1f
sarl $0x4, %eax
movslq %eax, %rcx
leaq 0x10f886(%rip), %rax    # 0x11a080
movl (%rax,%rcx,4), %eax
movl %eax, -0xc7c(%rbp)
movzbl 0x10f715(%rip), %eax    # 0x119f1f
andl $0x2, %eax
cmpl $0x0, %eax
setg %al
andb $0x1, %al
movzbl %al, %ecx
addl $0x3, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0xc78(%rbp)
movzbl 0x10f6f0(%rip), %eax    # 0x119f1f
andl $0x4, %eax
cmpl $0x0, %eax
setg %al
andb $0x1, %al
movzbl %al, %eax
addl $0x1, %eax
movl %eax, -0xc74(%rbp)
cmpl $0x0, 0x10f6c7(%rip)    # 0x119f14
je 0xa86e
leaq -0xc98(%rbp), %rdi
callq 0x4a030
cmpl $0x0, %eax
jne 0xa86c
callq 0x52e50
xorl %edi, %edi
callq 0x88d0
jmp 0xa86e
movl -0xc98(%rbp), %ecx
leaq 0x36d66d(%rip), %rax    # 0x377ee8
movl %ecx, (%rax)
movl -0xc94(%rbp), %eax
movl %eax, 0x10f67f(%rip)    # 0x119f08
movl -0xc90(%rbp), %eax
movl %eax, 0x10f677(%rip)    # 0x119f0c
movl -0xc8c(%rbp), %eax
movl %eax, 0x10f66f(%rip)    # 0x119f10
movl -0xc88(%rbp), %eax
movl %eax, 0x10f667(%rip)    # 0x119f14
movzbl 0x10f667(%rip), %eax    # 0x119f1b
andl $-0x2, %eax
orl -0xc84(%rbp), %eax
movb %al, 0x10f658(%rip)     # 0x119f1b
movzbl 0x10f651(%rip), %eax    # 0x119f1b
andl $-0x3, %eax
movl -0xc80(%rbp), %ecx
shll %ecx
orl %ecx, %eax
movb %al, 0x10f63e(%rip)     # 0x119f1b
movb $0x0, 0x10f63b(%rip)    # 0x119f1f
movl $0x0, -0x14(%rbp)
cmpl $0x8, -0x14(%rbp)
jge 0xa920
movslq -0x14(%rbp), %rcx
leaq 0x10f784(%rip), %rax    # 0x11a080
movl (%rax,%rcx,4), %eax
cmpl -0xc7c(%rbp), %eax
jg 0xa913
movl -0x14(%rbp), %eax
shll $0x4, %eax
movb %al, 0x10f60c(%rip)     # 0x119f1f
jmp 0xa915
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xa8eb
cmpl $0x10, -0xc78(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %ecx
shll %ecx
movzbl 0x10f5e7(%rip), %eax    # 0x119f1f
orl %ecx, %eax
movb %al, 0x10f5df(%rip)     # 0x119f1f
cmpl $0x2, -0xc74(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %ecx
shll $0x2, %ecx
movzbl 0x10f5c6(%rip), %eax    # 0x119f1f
orl %ecx, %eax
movb %al, 0x10f5be(%rip)     # 0x119f1f
leaq 0xce667(%rip), %rdi     # 0xd8fcf
leaq 0xce675(%rip), %rsi     # 0xd8fe4
movb $0x0, %al
callq 0x80b0
leaq 0xce675(%rip), %rdi     # 0xd8ff2
callq 0x4ccb0
callq 0x527b0
cmpl $0x0, %eax
je 0xa9b5
leaq 0x3a7ebd(%rip), %rax    # 0x3b2850
movq (%rax), %rdx
leaq 0xce5da(%rip), %rdi     # 0xd8f77
leaq 0xce5f5(%rip), %rsi     # 0xd8f99
movb $0x0, %al
callq 0xc1730
movl $0x1, %edi
callq 0x88d0
leaq 0xce613(%rip), %rdi     # 0xd8fcf
leaq 0xce639(%rip), %rsi     # 0xd8ffc
movb $0x0, %al
callq 0x80b0
movl $0x78, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0xc28b0
leaq 0xce5f0(%rip), %rdi     # 0xd8fcf
leaq 0xce620(%rip), %rsi     # 0xd9006
movb $0x0, %al
callq 0x80b0
xorl %edi, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x255a0
leaq 0xce5d0(%rip), %rdi     # 0xd8fcf
leaq 0xce614(%rip), %rsi     # 0xd901a
movb $0x0, %al
callq 0x80b0
leaq 0xce60f(%rip), %rdi     # 0xd9023
movl $0x800000, %esi         # imm = 0x800000
callq 0x68a40
leaq 0xce5aa(%rip), %rdi     # 0xd8fcf
leaq 0xce604(%rip), %rsi     # 0xd9030
movb $0x0, %al
callq 0x80b0
callq 0x25370
leaq 0xce590(%rip), %rdi     # 0xd8fcf
leaq 0xce5f5(%rip), %rsi     # 0xd903b
movb $0x0, %al
callq 0x80b0
callq 0x1a280
leaq 0xce576(%rip), %rdi     # 0xd8fcf
leaq 0xce5ea(%rip), %rsi     # 0xd904a
movb $0x0, %al
callq 0x80b0
callq 0xc2400
leaq 0xce55c(%rip), %rdi     # 0xd8fcf
leaq 0xce5da(%rip), %rsi     # 0xd9054
movb $0x0, %al
callq 0x80b0
movzbl 0x10f493(%rip), %eax    # 0x119f1b
cmpl $0x0, %eax
je 0xaa92
callq 0xc2720
cmpl $0x0, 0x122ecb(%rip)    # 0x12d964
je 0xab28
leaq 0xce529(%rip), %rdi     # 0xd8fcf
leaq 0xce5b1(%rip), %rsi     # 0xd905e
movb $0x0, %al
callq 0x80b0
movl 0x122ea6(%rip), %edx    # 0x12d960
movl %edx, %eax
addl $0x1, %eax
movl %eax, 0x122e9b(%rip)    # 0x12d960
leaq 0x122e84(%rip), %rdi    # 0x12d950
leaq 0xce367(%rip), %rsi     # 0xd8e3a
movb $0x0, %al
callq 0x8e50
leaq 0x122e6f(%rip), %rdi    # 0x12d950
leaq 0xcd57c(%rip), %rsi     # 0xd8064
callq 0x9100
movq %rax, 0x122d0c(%rip)    # 0x12d800
movq 0x122d05(%rip), %rdi    # 0x12d800
leaq 0xce343(%rip), %rsi     # 0xd8e45
movb $0x0, %al
callq 0x8280
movq 0x122cf0(%rip), %rdi    # 0x12d800
leaq 0xce366(%rip), %rsi     # 0xd8e7d
movb $0x0, %al
callq 0x8280
movl $0x0, 0x122cd0(%rip)    # 0x12d7f8
leaq 0x36d3b9(%rip), %rax    # 0x377ee8
movl (%rax), %eax
movl 0x10f3d1(%rip), %esi    # 0x119f08
movl 0x10f3cf(%rip), %edx    # 0x119f0c
movl 0x10f3cd(%rip), %ecx    # 0x119f10
movsbl %al, %edi
callq 0x66df0
leaq 0xce47d(%rip), %rdi     # 0xd8fcf
leaq 0xce514(%rip), %rsi     # 0xd906d
movb $0x0, %al
callq 0x80b0
movb 0x10f3b2(%rip), %dil    # 0x119f19
movb 0x10f3ac(%rip), %sil    # 0x119f1a
movzbl 0x10f3aa(%rip), %eax    # 0x119f1f
sarl $0x4, %eax
movslq %eax, %rcx
leaq 0x10f4fe(%rip), %rax    # 0x11a080
movl (%rax,%rcx,4), %edx
movzbl 0x10f393(%rip), %eax    # 0x119f1f
andl $0x4, %eax
cmpl $0x0, %eax
setg %al
andb $0x1, %al
movzbl %al, %eax
addl $0x1, %eax
movb %al, %cl
movzbl 0x10f379(%rip), %eax    # 0x119f1f
andl $0x2, %eax
cmpl $0x0, %eax
setg %al
andb $0x1, %al
movzbl %al, %eax
addl $0x1, %eax
xorl %r9d, %r9d
movsbl %dil, %edi
movsbl %sil, %esi
movsbl %cl, %ecx
movsbl %al, %r8d
movl $0x0, (%rsp)
callq 0x264b0
movzbl 0x10f340(%rip), %eax    # 0x119f1c
cmpl $0x0, %eax
jle 0xad61
leaq 0xce3e3(%rip), %rdi     # 0xd8fcf
leaq 0xce481(%rip), %rsi     # 0xd9074
movb $0x0, %al
callq 0x80b0
callq 0x255c0
callq 0x875a0
movzbl 0x10f311(%rip), %eax    # 0x119f1c
cmpl $0x5, %eax
jge 0xac19
movl $0x2, -0x18(%rbp)
jmp 0xac26
movzbl 0x10f2fc(%rip), %eax    # 0x119f1c
subl $0x3, %eax
movl %eax, -0x18(%rbp)
jmp 0xac28
leaq 0x79a31d(%rip), %rax    # 0x7a4f4c
movl (%rax), %eax
cmpl -0x18(%rbp), %eax
jge 0xad4a
xorl %edi, %edi
callq 0x72830
leaq 0x5f53d4(%rip), %rax    # 0x60001c
movl (%rax), %edi
sarl %edi
subl $0xa0, %edi
xorl %r9d, %r9d
movl $0x198, %edx            # imm = 0x198
movl %r9d, %esi
movl %r9d, %ecx
movl %r9d, %r8d
callq 0x9460
leaq 0x122d01(%rip), %rdi    # 0x12d970
leaq 0xce40f(%rip), %rsi     # 0xd9085
movb $0x0, %al
callq 0x8e50
leaq 0x5f5398(%rip), %rax    # 0x60001c
movl (%rax), %edi
sarl %edi
subl $0x50, %edi
leaq 0x5f538e(%rip), %rax    # 0x600020
movl (%rax), %esi
sarl %esi
subl $0x18, %esi
leaq 0x122cd0(%rip), %rdx    # 0x12d970
movl $0x15d, %ecx            # imm = 0x15D
xorl %r8d, %r8d
callq 0x9580
leaq 0x79a298(%rip), %rax    # 0x7a4f4c
movl (%rax), %edx
movl -0x18(%rbp), %ecx
leaq 0x122cb0(%rip), %rdi    # 0x12d970
leaq 0xce3d3(%rip), %rsi     # 0xd909a
movb $0x0, %al
callq 0x8e50
leaq 0x5f5347(%rip), %rax    # 0x60001c
movl (%rax), %edi
sarl %edi
subl $0x50, %edi
leaq 0x5f533d(%rip), %rax    # 0x600020
movl (%rax), %esi
sarl %esi
leaq 0x122c82(%rip), %rdx    # 0x12d970
movl $0x15d, %ecx            # imm = 0x15D
xorl %r8d, %r8d
callq 0x9580
callq 0x67810
leaq -0x1c(%rbp), %rdi
leaq 0x122c65(%rip), %rsi    # 0x12d970
callq 0x88500
cmpl $0x0, %eax
jle 0xad30
movzbl 0x122c54(%rip), %eax    # 0x12d970
cmpl $0xff, %eax
jne 0xad2e
leaq 0x36d3a6(%rip), %rax    # 0x3780d0
movb $0x1, 0x1(%rax)
jmp 0xad30
leaq 0x36d399(%rip), %rax    # 0x3780d0
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jle 0xad45
jmp 0xb120
jmp 0xac28
leaq 0x79a1f3(%rip), %rax    # 0x7a4f44
movl (%rax), %eax
movw %ax, 0x122a84(%rip)     # 0x12d7de
xorl %edi, %edi
callq 0x72830
leaq 0x79a1e8(%rip), %rax    # 0x7a4f50
movl (%rax), %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0xad91
movl -0x14(%rbp), %eax
movswl %ax, %edi
callq 0x24f80
movslq -0x14(%rbp), %rcx
leaq 0x79a1d7(%rip), %rax    # 0x7a4f60
movl (%rax,%rcx,4), %eax
movl %eax, -0x14(%rbp)
jmp 0xad6d
movzbl 0x10f184(%rip), %eax    # 0x119f1c
cmpl $0x0, %eax
jne 0xade2
leaq 0xce30c(%rip), %rdi     # 0xd90b0
callq 0x25700
movl %eax, -0x14(%rbp)
cmpl $0x1, -0x14(%rbp)
jge 0xadc1
leaq 0xce2fe(%rip), %rdi     # 0xd90b7
callq 0x25700
movl %eax, -0x14(%rbp)
cmpl $0x1, -0x14(%rbp)
jge 0xadd6
leaq 0xce2f1(%rip), %rdi     # 0xd90bf
callq 0x25700
movl %eax, -0x14(%rbp)
leaq 0xce2e5(%rip), %rdi     # 0xd90c2
callq 0x25700
jmp 0xade4
movzbl 0x10f131(%rip), %eax    # 0x119f1c
cmpl $0x0, %eax
jne 0xae03
movb $0x0, %al
callq 0x1fe20
cmpl $0x0, %eax
jne 0xae01
jmp 0xb120
jmp 0xae03
movl $0x0, 0x1236a3(%rip)    # 0x12e4b0
movl $0x0, 0x1229f5(%rip)    # 0x12d80c
movl $0x0, 0x123693(%rip)    # 0x12e4b4
movl $0x0, 0x12368d(%rip)    # 0x12e4b8
movl $0x0, 0x123687(%rip)    # 0x12e4bc
movl $0x0, 0x123681(%rip)    # 0x12e4c0
movl $0x0, 0x12367b(%rip)    # 0x12e4c4
movl $0x0, 0x123675(%rip)    # 0x12e4c8
movl $0x0, 0x12366f(%rip)    # 0x12e4cc
movb $0x0, 0x12366c(%rip)    # 0x12e4d0
movb $0x0, 0x123666(%rip)    # 0x12e4d1
movw $0x0, 0x12365e(%rip)    # 0x12e4d2
movw $0x0, 0x123657(%rip)    # 0x12e4d4
movw $0x0, 0x123650(%rip)    # 0x12e4d6
movw $0x0, 0x123649(%rip)    # 0x12e4d8
movw $0x0, 0x123642(%rip)    # 0x12e4da
movw $0x0, 0x12363b(%rip)    # 0x12e4dc
movl $0x0, 0x12295d(%rip)    # 0x12d808
movl $0x0, 0x12291f(%rip)    # 0x12d7d4
movl $0x0, 0x122919(%rip)    # 0x12d7d8
movl $0x0, 0x123617(%rip)    # 0x12e4e0
movl $0x0, -0x14(%rbp)
cmpl $0x10, -0x14(%rbp)
jge 0xafae
movslq -0x14(%rbp), %rcx
leaq 0x12360b(%rip), %rax    # 0x12e4f0
movb $0x0, (%rax,%rcx)
movslq -0x14(%rbp), %rcx
leaq 0x12360c(%rip), %rax    # 0x12e500
movb $0x0, (%rax,%rcx)
movslq -0x14(%rbp), %rcx
leaq 0x12360d(%rip), %rax    # 0x12e510
movb $0x0, (%rax,%rcx)
movslq -0x14(%rbp), %rcx
leaq 0x12360e(%rip), %rax    # 0x12e520
movw $0x0, (%rax,%rcx,2)
movslq -0x14(%rbp), %rcx
leaq 0x12361d(%rip), %rax    # 0x12e540
movw $0x0, (%rax,%rcx,2)
movslq -0x14(%rbp), %rcx
leaq 0x12362c(%rip), %rax    # 0x12e560
movw $0x0, (%rax,%rcx,2)
movslq -0x14(%rbp), %rcx
leaq 0x12363b(%rip), %rax    # 0x12e580
movw $0x0, (%rax,%rcx,2)
movslq -0x14(%rbp), %rcx
leaq 0x12364a(%rip), %rax    # 0x12e5a0
movw $0x0, (%rax,%rcx,2)
movslq -0x14(%rbp), %rcx
leaq 0x123659(%rip), %rax    # 0x12e5c0
movw $0x0, (%rax,%rcx,2)
movslq -0x14(%rbp), %rcx
leaq 0x123668(%rip), %rax    # 0x12e5e0
movw $0x0, (%rax,%rcx,2)
movslq -0x14(%rbp), %rcx
leaq 0x122887(%rip), %rax    # 0x12d810
movw $0x0, (%rax,%rcx,2)
movslq -0x14(%rbp), %rcx
leaq 0x123666(%rip), %rax    # 0x12e600
movw $0x0, (%rax,%rcx,2)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xaed0
movb $0x0, %al
callq 0x9660
movb $0x1, 0x122817(%rip)    # 0x12d7d3
movzbl 0x10ef59(%rip), %eax    # 0x119f1c
cmpl $0x0, %eax
je 0xb097
movb $0x8, 0x12299d(%rip)    # 0x12d970
leaq 0x799f6a(%rip), %rax    # 0x7a4f44
movl (%rax), %eax
movb %al, 0x12298f(%rip)     # 0x12d971
movq 0x123637(%rip), %rax    # 0x12e620
movq %rax, 0x122982(%rip)    # 0x12d972
movw 0x123631(%rip), %ax     # 0x12e628
movw %ax, 0x12297c(%rip)     # 0x12d97a
movb $0x0, 0x122977(%rip)    # 0x12d97c
leaq 0x799f44(%rip), %rax    # 0x7a4f50
movl (%rax), %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0xb04e
movl -0x14(%rbp), %eax
leaq 0x799f23(%rip), %rcx    # 0x7a4f44
cmpl (%rcx), %eax
je 0xb039
movl -0x14(%rbp), %edi
leaq 0x122941(%rip), %rsi    # 0x12d970
movl $0xc, %edx
callq 0x89280
jmp 0xb03b
movslq -0x14(%rbp), %rcx
leaq 0x799f1a(%rip), %rax    # 0x7a4f60
movl (%rax,%rcx,4), %eax
movl %eax, -0x14(%rbp)
jmp 0xb011
leaq 0x799eef(%rip), %rax    # 0x7a4f44
movslq (%rax), %rcx
leaq 0x1235d1(%rip), %rax    # 0x12e630
imulq $0xb, %rcx, %rcx
addq %rcx, %rax
movq 0x1235b3(%rip), %rcx    # 0x12e620
movq %rcx, (%rax)
movw 0x1235b1(%rip), %cx     # 0x12e628
movw %cx, 0x8(%rax)
leaq 0x799ec2(%rip), %rax    # 0x7a4f44
movslq (%rax), %rcx
leaq 0x1235a4(%rip), %rax    # 0x12e630
imulq $0xb, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0xa(%rax)
leaq 0x799ea6(%rip), %rax    # 0x7a4f44
movl (%rax), %eax
movw %ax, 0x122737(%rip)     # 0x12d7de
leaq 0x16d40b(%rip), %rax    # 0x1784b9
cmpb $0x0, (%rax)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xb0bc
jmp 0xb0fc
callq 0xc3d90
movl 0x122745(%rip), %eax    # 0x12d80c
cmpl 0x1233e7(%rip), %eax    # 0x12e4b4
je 0xb0d6
callq 0xe330
jmp 0xb0c1
movw 0x122701(%rip), %ax     # 0x12d7de
leaq 0x59b234(%rip), %rcx    # 0x5a6318
movl (%rcx), %ecx
subl 0x1226ec(%rip), %ecx    # 0x12d7d8
imull $0x5555, %ecx, %esi     # imm = 0x5555
movswl %ax, %edi
callq 0xb170
jmp 0xb0a7
movb $0x0, 0x1226d0(%rip)    # 0x12d7d3
movzbl 0x10ee12(%rip), %eax    # 0x119f1c
cmpl $0x0, %eax
jne 0xb11e
leaq 0x16eed6(%rip), %rax    # 0x179fec
movb $0x1, (%rax)
jmp 0xade4
jmp 0xb120
movb $0x0, %al
callq 0x20f70
callq 0x875b0
callq 0x875c0
callq 0x26a00
callq 0x9d30
callq 0xc22e0
callq 0xc2290
callq 0x52e50
callq 0x4d390
callq 0x25690
cmpl $0x0, 0x122809(%rip)    # 0x12d964
je 0xb169
movq 0x12269c(%rip), %rdi    # 0x12d800
callq 0x85d0
xorl %edi, %edi
callq 0x88d0