// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x8135f(%rip), %rdi     # 0x8bf21
callq 0x3256b
movl $0x1, %edi
callq 0x34a29
movq %rax, %r14
callq 0x3499d
testq %rax, %rax
je 0xabf1
movq %rax, %r15
movq %rax, %rdi
callq 0x3256b
movq %r15, %rdi
callq 0x8270
testq %r14, %r14
je 0xac24
leaq 0x81344(%rip), %rdx     # 0x8bf41
leaq 0x10(%rsp), %r15
movl $0x401, %esi            # imm = 0x401
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x8710
movq %r15, %rdi
callq 0x3256b
movq %r14, %rdi
callq 0x8270
movl %ebp, %edi
movq %rbx, %rsi
callq 0x18091
leaq 0x81318(%rip), %rdi     # 0x8bf4d
xorl %esi, %esi
callq 0x8190
testl %eax, %eax
jne 0xac64
leaq 0x10(%rsp), %rdi
movl $0x401, %esi            # imm = 0x401
callq 0x8540
testq %rax, %rax
je 0xacdf
leaq 0x10(%rsp), %rdi
callq 0x3256b
jmp 0xacdf
xorl %edi, %edi
callq 0x34a29
testq %rax, %rax
je 0xacdf
movq %rax, %rbx
leaq 0x812f4(%rip), %rdx     # 0x8bf6e
leaq 0x812e3(%rip), %r8      # 0x8bf64
leaq 0x10(%rsp), %r14
movl $0x401, %esi            # imm = 0x401
movq %r14, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x8710
movq %r14, %rdi
callq 0x3256b
cmpl $-0x2, %eax
jne 0xacc9
leaq 0x10(%rsp), %rdi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x8380
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0xacc9
leaq 0x10(%rsp), %rdi
callq 0x3256b
testl %eax, %eax
jne 0xacd7
leaq 0x10(%rsp), %rdi
callq 0x9190
movq %rbx, %rdi
callq 0x8270
leaq 0x8128e(%rip), %rdi     # 0x8bf74
callq 0x4da2b
leaq 0x81252(%rip), %rdi     # 0x8bf44
callq 0x7eacd
leaq 0xd552a(%rip), %rax     # 0xe0228
movq (%rax), %rdx
leaq 0xd5528(%rip), %rax     # 0xe0230
movq (%rax), %rcx
leaq 0xd5526(%rip), %rax     # 0xe0238
movq (%rax), %r8
leaq 0x81263(%rip), %rdi     # 0x8bf7f
leaq 0x812b6(%rip), %rsi     # 0x8bfd9
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x36050
callq 0x35fad
testl %eax, %eax
jne 0xb23d
leaq 0x812f7(%rip), %rdi     # 0x8c037
leaq 0x812f8(%rip), %rsi     # 0x8c03f
xorl %eax, %eax
callq 0x80b0
xorl %eax, %eax
callq 0x1b4c4
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
leaq 0x3211a6(%rip), %r14    # 0x32bf18
movl (%r14), %eax
movl %eax, 0x10(%rsp)
movl 0xc3be9(%rip), %eax     # 0xce968
movl %eax, 0x14(%rsp)
movl 0xc3be3(%rip), %eax     # 0xce96c
movl %eax, 0x18(%rsp)
movl 0xc3bdd(%rip), %eax     # 0xce970
movl %eax, 0x1c(%rsp)
movl 0xc3bd7(%rip), %eax     # 0xce974
movl %eax, 0x20(%rsp)
movzbl 0xc3bd3(%rip), %ecx     # 0xce97b
movl %ecx, %edx
andl $0x1, %edx
movl %edx, 0x24(%rsp)
shrl %ecx
andl $0x1, %ecx
movl %ecx, 0x28(%rsp)
movzbl 0xc3bbe(%rip), %edx     # 0xce97f
movl %edx, %esi
shrl $0x4, %esi
leaq 0xc3d13(%rip), %rbx     # 0xceae0
btl $0x1, %edx
movl $0x0, %ecx
adcb $0x3, %cl
movl $0x1, %edi
shll %cl, %edi
movl (%rbx,%rsi,4), %ecx
movl %ecx, 0x2c(%rsp)
movl %edi, 0x30(%rsp)
btl $0x2, %edx
adcl $0x1, %ebp
movl %ebp, 0x34(%rsp)
testl %eax, %eax
je 0xae12
leaq 0x10(%rsp), %rdi
callq 0x30d0c
testl %eax, %eax
jne 0xae12
callq 0x36925
jmp 0xb236
movl 0x10(%rsp), %eax
movl 0x14(%rsp), %ecx
movl %eax, (%r14)
movl %ecx, 0xc3b45(%rip)     # 0xce968
movl 0x18(%rsp), %eax
movl %eax, 0xc3b3f(%rip)     # 0xce96c
movl 0x1c(%rsp), %eax
movl %eax, 0xc3b39(%rip)     # 0xce970
movl 0x20(%rsp), %eax
movl %eax, 0xc3b33(%rip)     # 0xce974
movb 0xc3b34(%rip), %al      # 0xce97b
andb $-0x4, %al
orb 0x24(%rsp), %al
andb $-0x3, %al
movb 0x28(%rsp), %cl
addb %cl, %cl
orb %al, %cl
movb %cl, 0xc3b1e(%rip)      # 0xce97b
movb $0x0, 0xc3b1b(%rip)     # 0xce97f
movl 0x2c(%rsp), %eax
xorl %ecx, %ecx
cmpl %eax, (%rbx)
jg 0xae74
movb %cl, 0xc3b0b(%rip)      # 0xce97f
addq $0x10, %rcx
addq $0x4, %rbx
cmpq $0x80, %rcx
jne 0xae6a
cmpl $0x10, 0x30(%rsp)
sete %al
addb %al, %al
orb 0xc3aea(%rip), %al      # 0xce97f
cmpl $0x2, 0x34(%rsp)
sete %cl
shlb $0x2, %cl
orb %al, %cl
movb %cl, 0xc3ad7(%rip)      # 0xce97f
leaq 0x81188(%rip), %rdi     # 0x8c037
leaq 0x81196(%rip), %rsi     # 0x8c04c
xorl %eax, %eax
callq 0x80b0
leaq 0x81196(%rip), %rdi     # 0x8c05a
callq 0x328d7
callq 0x36173
testl %eax, %eax
jne 0xb23d
leaq 0x8115a(%rip), %rbx     # 0x8c037
leaq 0x81180(%rip), %rsi     # 0x8c064
movq %rbx, %rdi
xorl %eax, %eax
callq 0x80b0
movl $0x78, %edi
xorl %esi, %esi
callq 0x7f4b6
leaq 0x8116d(%rip), %rsi     # 0x8c06e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x80b0
xorl %edi, %edi
xorl %esi, %esi
callq 0x1b42d
leaq 0x81167(%rip), %rsi     # 0x8c082
movq %rbx, %rdi
xorl %eax, %eax
callq 0x80b0
leaq 0x8115f(%rip), %rdi     # 0x8c08b
movl $0x800000, %esi         # imm = 0x800000
callq 0x46034
leaq 0x8115b(%rip), %rsi     # 0x8c098
movq %rbx, %rdi
xorl %eax, %eax
callq 0x80b0
callq 0x1b27c
leaq 0x81150(%rip), %rsi     # 0x8c0a3
movq %rbx, %rdi
xorl %eax, %eax
callq 0x80b0
callq 0x14c6f
leaq 0x81149(%rip), %rsi     # 0x8c0b2
movq %rbx, %rdi
xorl %eax, %eax
callq 0x80b0
callq 0x7f198
leaq 0x8113d(%rip), %rsi     # 0x8c0bc
movq %rbx, %rdi
xorl %eax, %eax
callq 0x80b0
cmpb $0x0, 0xc39eb(%rip)     # 0xce97b
je 0xaf97
callq 0x7f3d9
cmpl $0x0, 0xd6646(%rip)     # 0xe15e4
je 0xb036
leaq 0x8108c(%rip), %rdi     # 0x8c037
leaq 0x81114(%rip), %rsi     # 0x8c0c6
xorl %eax, %eax
callq 0x80b0
movl 0xd6621(%rip), %edx     # 0xe15e0
leal 0x1(%rdx), %eax
movl %eax, 0xd6618(%rip)     # 0xe15e0
leaq 0xd6601(%rip), %rbx     # 0xe15d0
leaq 0x80ecc(%rip), %rsi     # 0x8bea2
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8f20
leaq 0x8007d(%rip), %rsi     # 0x8b064
movq %rbx, %rdi
callq 0x91d0
movq %rax, 0xd648a(%rip)     # 0xe1480
leaq 0x80eb0(%rip), %rdi     # 0x8bead
movl $0x37, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x8ff0
movq 0xd646a(%rip), %rcx     # 0xe1480
leaq 0x80ec8(%rip), %rdi     # 0x8bee5
movl $0x3b, %esi
movl $0x1, %edx
callq 0x8ff0
movl $0x0, 0xd6442(%rip)     # 0xe1478
movsbl (%r14), %edi
movl 0xc3928(%rip), %esi     # 0xce968
movl 0xc3926(%rip), %edx     # 0xce96c
movl 0xc3924(%rip), %ecx     # 0xce970
callq 0x4468c
leaq 0x80fdf(%rip), %rdi     # 0x8c037
leaq 0x81076(%rip), %rsi     # 0x8c0d5
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x80b0
movsbl 0xc390a(%rip), %edi     # 0xce979
movzbl 0xc3909(%rip), %eax     # 0xce97f
movl %eax, %ecx
shrl $0x4, %ecx
leaq 0xc3a5e(%rip), %rdx     # 0xceae0
movl (%rdx,%rcx,4), %edx
btl $0x2, %eax
movl $0x0, %ecx
adcb $0x1, %cl
movsbl 0xc38e2(%rip), %esi     # 0xce97a
btl $0x1, %eax
adcb $0x1, %bl
movl $0x0, (%rsp)
movzbl %cl, %ecx
movzbl %bl, %r8d
xorl %r9d, %r9d
callq 0x1bec0
cmpb $0x0, 0xc38c0(%rip)     # 0xce97c
je 0xb27e
leaq 0x80f6e(%rip), %rdi     # 0x8c037
leaq 0x8100c(%rip), %rsi     # 0x8c0dc
xorl %eax, %eax
callq 0x80b0
callq 0x1b432
callq 0x5a85e
movzbl 0xc3894(%rip), %eax     # 0xce97c
leal -0x3(%rax), %ecx
cmpl $0x5, %eax
movl $0x2, %ebx
cmovael %ecx, %ebx
leaq 0x797a0f(%rip), %r13    # 0x7a2b0c
leaq 0x5aad48(%rip), %rbp    # 0x5b5e4c
leaq 0xd64e5(%rip), %r14     # 0xe15f0
leaq 0x5aad3e(%rip), %r15    # 0x5b5e50
leaq 0x320fe7(%rip), %r12    # 0x32c100
cmpl %ebx, (%r13)
jge 0xb266
xorl %edi, %edi
callq 0x4c5d5
movl (%rbp), %edi
sarl %edi
addl $0xffffff60, %edi       # imm = 0xFFFFFF60
xorl %esi, %esi
movl $0x198, %edx            # imm = 0x198
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xa09d
movabsq $0x202045444f4d20, %rax # imm = 0x202045444F4D20
movq %rax, 0xd64a3(%rip)     # 0xe15fd
movups 0x80f8c(%rip), %xmm0    # 0x8c0ed
movaps %xmm0, 0xd6488(%rip)    # 0xe15f0
movl (%rbp), %edi
sarl %edi
addl $-0x50, %edi
movl (%r15), %esi
sarl %esi
addl $-0x18, %esi
movq %r14, %rdx
movl $0x15d, %ecx            # imm = 0x15D
xorl %r8d, %r8d
callq 0xa13f
movl (%r13), %edx
movq %r14, %rdi
leaq 0x80f6c(%rip), %rsi     # 0x8c102
movl %ebx, %ecx
xorl %eax, %eax
callq 0x8f20
movl (%rbp), %edi
sarl %edi
addl $-0x50, %edi
movl (%r15), %esi
sarl %esi
movq %r14, %rdx
movl $0x15d, %ecx            # imm = 0x15D
xorl %r8d, %r8d
callq 0xa13f
callq 0x44e75
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x5b437
testl %eax, %eax
jle 0xb1e1
cmpb $-0x1, 0xd6417(%rip)    # 0xe15f0
jne 0xb1e1
movb $0x1, 0x1(%r12)
cmpb $0x0, 0x1(%r12)
jle 0xb119
xorl %eax, %eax
callq 0x19353
callq 0x5a85f
callq 0x5a860
callq 0x1c152
callq 0xa5d7
callq 0x7f095
callq 0x7f057
callq 0x36925
callq 0x32d19
callq 0x1b4d7
cmpl $0x0, 0xd63bc(%rip)     # 0xe15e4
je 0xb236
movq 0xd624f(%rip), %rdi     # 0xe1480
callq 0x8640
xorl %edi, %edi
callq 0x8950
leaq 0x35b63c(%rip), %rax    # 0x366880
movq (%rax), %rdx
leaq 0x80d91(%rip), %rdi     # 0x8bfdf
leaq 0x80dac(%rip), %rsi     # 0x8c001
xorl %eax, %eax
callq 0x7e7d4
movl $0x1, %edi
callq 0x8950
leaq 0x797897(%rip), %rax    # 0x7a2b04
movzwl (%rax), %eax
movw %ax, 0xd61e7(%rip)      # 0xe145e
xorl %edi, %edi
callq 0x4c5d5
leaq 0x79788b(%rip), %rax    # 0x7a2b10
movl (%rax), %ebx
testl %ebx, %ebx
js 0xb2a4
leaq 0x79788e(%rip), %r14    # 0x7a2b20
movswl %bx, %edi
callq 0x1b0cd
movl %ebx, %eax
movl (%r14,%rax,4), %ebx
testl %ebx, %ebx
jns 0xb292
cmpb $0x0, 0xc36d1(%rip)     # 0xce97c
jne 0xb2e5
leaq 0x80e64(%rip), %rdi     # 0x8c118
callq 0x1b508
testl %eax, %eax
jg 0xb2d9
leaq 0x80e5b(%rip), %rdi     # 0x8c11f
callq 0x1b508
testl %eax, %eax
jg 0xb2d9
leaq 0x80e53(%rip), %rdi     # 0x8c127
callq 0x1b508
leaq 0x80e4a(%rip), %rdi     # 0x8c12a
callq 0x1b508
xorl %r15d, %r15d
leaq 0x797815(%rip), %r12    # 0x7a2b04
leaq 0x121203(%rip), %r13    # 0x12c4f9
leaq 0x54f04b(%rip), %r14    # 0x55a348
leaq 0x79781c(%rip), %rbx    # 0x7a2b20
cmpb $0x0, 0xc3671(%rip)     # 0xce97c
jne 0xb31c
xorl %eax, %eax
callq 0x18829
testl %eax, %eax
je 0xb1ed
movl %r15d, 0xd71cd(%rip)    # 0xe24f0
movl %r15d, 0xd6162(%rip)    # 0xe148c
movl %r15d, 0xd71c3(%rip)    # 0xe24f4
movl %r15d, 0xd71c0(%rip)    # 0xe24f8
movl %r15d, 0xd71bd(%rip)    # 0xe24fc
movl %r15d, 0xd71ba(%rip)    # 0xe2500
movl %r15d, 0xd71b7(%rip)    # 0xe2504
movl %r15d, 0xd71b4(%rip)    # 0xe2508
movl %r15d, 0xd71b1(%rip)    # 0xe250c
movb %r15b, 0xd71ae(%rip)    # 0xe2510
movb %r15b, 0xd71a8(%rip)    # 0xe2511
movw %r15w, 0xd71a1(%rip)    # 0xe2512
movw %r15w, 0xd719b(%rip)    # 0xe2514
movw %r15w, 0xd7195(%rip)    # 0xe2516
movw %r15w, 0xd718f(%rip)    # 0xe2518
movw %r15w, 0xd7189(%rip)    # 0xe251a
movw %r15w, 0xd7183(%rip)    # 0xe251c
movl %r15d, 0xd60e8(%rip)    # 0xe1488
movl %r15d, 0xd60ad(%rip)    # 0xe1454
movl %r15d, 0xd60aa(%rip)    # 0xe1458
movl %r15d, 0xd716b(%rip)    # 0xe2520
xorps %xmm0, %xmm0
movaps %xmm0, 0xd7171(%rip)    # 0xe2530
movaps %xmm0, 0xd717a(%rip)    # 0xe2540
movaps %xmm0, 0xd7183(%rip)    # 0xe2550
movaps %xmm0, 0xd718c(%rip)    # 0xe2560
movaps %xmm0, 0xd7195(%rip)    # 0xe2570
movaps %xmm0, 0xd719e(%rip)    # 0xe2580
movaps %xmm0, 0xd71a7(%rip)    # 0xe2590
movaps %xmm0, 0xd71b0(%rip)    # 0xe25a0
movaps %xmm0, 0xd71b9(%rip)    # 0xe25b0
movaps %xmm0, 0xd71c2(%rip)    # 0xe25c0
movaps %xmm0, 0xd71cb(%rip)    # 0xe25d0
movaps %xmm0, 0xd71d4(%rip)    # 0xe25e0
movaps %xmm0, 0xd71dd(%rip)    # 0xe25f0
movaps %xmm0, 0xd71f6(%rip)    # 0xe2610
movaps %xmm0, 0xd71df(%rip)    # 0xe2600
movaps %xmm0, 0xd7208(%rip)    # 0xe2630
movaps %xmm0, 0xd71f1(%rip)    # 0xe2620
movaps %xmm0, 0xd606a(%rip)    # 0xe14a0
movaps %xmm0, 0xd6053(%rip)    # 0xe1490
movaps %xmm0, 0xd720c(%rip)    # 0xe2650
movaps %xmm0, 0xd71f5(%rip)    # 0xe2640
xorl %eax, %eax
callq 0xa1d7
movb $0x1, 0xd5ffa(%rip)     # 0xe1453
cmpb %r15b, 0xc351c(%rip)    # 0xce97c
je 0xb4f6
movb $0x8, 0xd6183(%rip)     # 0xe15f0
movb (%r12), %al
movb %al, 0xd617a(%rip)      # 0xe15f1
movq 0xd71e2(%rip), %rax     # 0xe2660
movq %rax, 0xd616d(%rip)     # 0xe15f2
movzwl 0xd71dc(%rip), %eax     # 0xe2668
movw %ax, 0xd6167(%rip)      # 0xe15fa
movb $0x0, 0xd6162(%rip)     # 0xe15fc
leaq 0x79766f(%rip), %rax    # 0x7a2b10
movl (%rax), %ebp
testl %ebp, %ebp
js 0xb4c7
cmpl (%r12), %ebp
je 0xb4c0
movl %ebp, %edi
leaq 0xd613a(%rip), %rsi     # 0xe15f0
movl $0xc, %edx
callq 0x5bcf2
movl %ebp, %eax
movl (%rbx,%rax,4), %ebp
jmp 0xb4a3
movslq (%r12), %rax
leaq (%rax,%rax,4), %rcx
leaq (%rax,%rcx,2), %rax
movzwl 0xd718e(%rip), %ecx     # 0xe2668
leaq 0xd718f(%rip), %rdx     # 0xe2670
movw %cx, 0x8(%rdx,%rax)
movq 0xd7173(%rip), %rcx     # 0xe2660
movq %rcx, (%rdx,%rax)
movb $0x0, 0xa(%rdx,%rax)
movzwl (%r12), %eax
movw %ax, 0xd5f5c(%rip)      # 0xe145e
cmpb $0x0, (%r13)
jne 0xb540
callq 0x803d6
movl 0xd5f78(%rip), %eax     # 0xe148c
cmpl 0xd6fda(%rip), %eax     # 0xe24f4
je 0xb523
callq 0xd2b2
jmp 0xb50e
movswl 0xd5f34(%rip), %edi     # 0xe145e
movl (%r14), %eax
subl 0xd5f25(%rip), %eax     # 0xe1458
imull $0x5555, %eax, %esi     # imm = 0x5555
callq 0xb563
jmp 0xb502
movb $0x0, 0xd5f0c(%rip)     # 0xe1453
cmpb $0x0, 0xc342e(%rip)     # 0xce97c
jne 0xb1ed
leaq 0x122acd(%rip), %rax    # 0x12e028
movb $0x1, (%rax)
jmp 0xb304