// File: /workspace/github_c_makefile_star2_O3/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 0x84393(%rip), %rdi     # 0x8ef35
callq 0x33926
movl $0x1, %edi
callq 0x35d09
movq %rax, %r14
callq 0x35c7d
testq %rax, %rax
je 0xabd1
movq %rax, %r15
movq %rax, %rdi
callq 0x33926
movq %r15, %rdi
callq 0x8270
testq %r14, %r14
je 0xac04
leaq 0x84378(%rip), %rdx     # 0x8ef55
leaq 0x10(%rsp), %r15
movl $0x401, %esi            # imm = 0x401
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x8710
movq %r15, %rdi
callq 0x33926
movq %r14, %rdi
callq 0x8270
movl %ebp, %edi
movq %rbx, %rsi
callq 0x18168
leaq 0x8434c(%rip), %rdi     # 0x8ef61
xorl %esi, %esi
callq 0x8190
testl %eax, %eax
jne 0xac44
leaq 0x10(%rsp), %rdi
movl $0x401, %esi            # imm = 0x401
callq 0x8540
testq %rax, %rax
je 0xacb8
leaq 0x10(%rsp), %rdi
callq 0x33926
jmp 0xacb8
xorl %edi, %edi
callq 0x35d09
testq %rax, %rax
je 0xacb8
movq %rax, %rbx
leaq 0x84328(%rip), %rdx     # 0x8ef82
leaq 0x84317(%rip), %r8      # 0x8ef78
leaq 0x10(%rsp), %r14
movl $0x401, %esi            # imm = 0x401
movq %r14, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x8710
movq %r14, %rdi
callq 0x33926
cmpl $-0x2, %eax
jne 0xaca2
leaq 0x10(%rsp), %rdi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x8380
testl %eax, %eax
jne 0xacb0
leaq 0x10(%rsp), %rdi
callq 0x33926
testl %eax, %eax
jne 0xacb0
leaq 0x10(%rsp), %rdi
callq 0x9190
movq %rbx, %rdi
callq 0x8270
leaq 0x842c9(%rip), %rdi     # 0x8ef88
callq 0x4fbb5
leaq 0x8428d(%rip), %rdi     # 0x8ef58
callq 0x816dd
leaq 0xd8551(%rip), %rax     # 0xe3228
movq (%rax), %rdx
leaq 0xd854f(%rip), %rax     # 0xe3230
movq (%rax), %rcx
leaq 0xd854d(%rip), %rax     # 0xe3238
movq (%rax), %r8
leaq 0x8429e(%rip), %rdi     # 0x8ef93
leaq 0x842f1(%rip), %rsi     # 0x8efed
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x372d1
callq 0x3722e
testl %eax, %eax
jne 0xb1d5
leaq 0x84332(%rip), %rdi     # 0x8f04b
leaq 0x84333(%rip), %rsi     # 0x8f053
xorl %eax, %eax
callq 0x80b0
xorl %eax, %eax
callq 0x1b69a
leaq 0x324203(%rip), %r14    # 0x32ef38
movl (%r14), %edx
movl %edx, 0x10(%rsp)
movl 0xc6c26(%rip), %esi     # 0xd1968
movl %esi, 0x14(%rsp)
movl 0xc6c1f(%rip), %r8d     # 0xd196c
movl %r8d, 0x18(%rsp)
movl 0xc6c17(%rip), %r9d     # 0xd1970
movl %r9d, 0x1c(%rsp)
movl 0xc6c10(%rip), %ebp     # 0xd1974
movl %ebp, 0x20(%rsp)
movzbl 0xc6c0c(%rip), %edi     # 0xd197b
movl %edi, %r11d
andl $0x1, %r11d
movl %r11d, 0x24(%rsp)
movl %edi, %r10d
shrl %r10d
andl $0x1, %r10d
movl %r10d, 0x28(%rsp)
movzbl 0xc6bed(%rip), %r12d    # 0xd197f
movl %r12d, %eax
shrl $0x4, %eax
leaq 0xc6d41(%rip), %r15     # 0xd1ae0
movl (%r15,%rax,4), %eax
btl $0x1, %r12d
movl $0x0, %ecx
adcb $0x3, %cl
movl $0x1, %r13d
shll %cl, %r13d
movl %eax, 0x2c(%rsp)
movl %r13d, 0x30(%rsp)
btl $0x2, %r12d
movl $0x0, %ecx
adcl $0x1, %ecx
movl %ecx, 0x34(%rsp)
testl %ebp, %ebp
je 0xae1e
leaq 0x10(%rsp), %rdi
callq 0x32048
testl %eax, %eax
jne 0xadef
callq 0x37bfa
jmp 0xb53a
movl 0x10(%rsp), %edx
movl 0x14(%rsp), %esi
movl 0x18(%rsp), %r8d
movl 0x1c(%rsp), %r9d
movl 0x20(%rsp), %ebx
movb 0xc6b6f(%rip), %dil     # 0xd197b
movb 0x24(%rsp), %r11b
movb 0x28(%rsp), %r10b
movl 0x2c(%rsp), %eax
andb $-0x3, %r11b
movl %edx, (%r14)
movl %esi, 0xc6b41(%rip)     # 0xd1968
movl %r8d, 0xc6b3e(%rip)     # 0xd196c
movl %r9d, 0xc6b3b(%rip)     # 0xd1970
movl %ebx, 0xc6b39(%rip)     # 0xd1974
andb $-0x4, %dil
orb %r11b, %dil
addb %r10b, %r10b
orb %dil, %r10b
movb %r10b, 0xc6b2c(%rip)    # 0xd197b
xorl %edx, %edx
xorl %ecx, %ecx
cmpl %eax, (%r15)
movzbl %cl, %ecx
cmovlel %edx, %ecx
addq $0x10, %rdx
addq $0x4, %r15
cmpq $0x80, %rdx
jne 0xae53
cmpl $0x10, 0x30(%rsp)
sete %al
addb %al, %al
cmpl $0x2, 0x34(%rsp)
sete %dl
shlb $0x2, %dl
orb %al, %dl
orb %cl, %dl
movb %dl, 0xc6af3(%rip)      # 0xd197f
leaq 0x841b8(%rip), %rdi     # 0x8f04b
leaq 0x841c6(%rip), %rsi     # 0x8f060
xorl %eax, %eax
callq 0x80b0
leaq 0x841c6(%rip), %rdi     # 0x8f06e
callq 0x33c39
callq 0x373f4
testl %eax, %eax
jne 0xb1d5
leaq 0x8418a(%rip), %rbx     # 0x8f04b
leaq 0x841b0(%rip), %rsi     # 0x8f078
movq %rbx, %rdi
xorl %eax, %eax
callq 0x80b0
movl $0x78, %edi
xorl %esi, %esi
callq 0x820bc
leaq 0x8419d(%rip), %rsi     # 0x8f082
movq %rbx, %rdi
xorl %eax, %eax
callq 0x80b0
xorl %edi, %edi
xorl %esi, %esi
callq 0x1b603
leaq 0x84197(%rip), %rsi     # 0x8f096
movq %rbx, %rdi
xorl %eax, %eax
callq 0x80b0
leaq 0x8418f(%rip), %rdi     # 0x8f09f
movl $0x800000, %esi         # imm = 0x800000
callq 0x47f84
leaq 0x8418b(%rip), %rsi     # 0x8f0ac
movq %rbx, %rdi
xorl %eax, %eax
callq 0x80b0
callq 0x1b452
leaq 0x84180(%rip), %rsi     # 0x8f0b7
movq %rbx, %rdi
xorl %eax, %eax
callq 0x80b0
callq 0x14cf5
leaq 0x84179(%rip), %rsi     # 0x8f0c6
movq %rbx, %rdi
xorl %eax, %eax
callq 0x80b0
callq 0x81da8
leaq 0x8416d(%rip), %rsi     # 0x8f0d0
movq %rbx, %rdi
xorl %eax, %eax
callq 0x80b0
cmpb $0x0, 0xc6a07(%rip)     # 0xd197b
je 0xaf7b
callq 0x81fdf
cmpl $0x0, 0xd9662(%rip)     # 0xe45e4
je 0xb01a
leaq 0x840bc(%rip), %rdi     # 0x8f04b
leaq 0x84144(%rip), %rsi     # 0x8f0da
xorl %eax, %eax
callq 0x80b0
movl 0xd963d(%rip), %edx     # 0xe45e0
leal 0x1(%rdx), %eax
movl %eax, 0xd9634(%rip)     # 0xe45e0
leaq 0xd961d(%rip), %rbx     # 0xe45d0
leaq 0x83efc(%rip), %rsi     # 0x8eeb6
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8f20
leaq 0x83099(%rip), %rsi     # 0x8e064
movq %rbx, %rdi
callq 0x91d0
movq %rax, 0xd94a6(%rip)     # 0xe4480
leaq 0x83ee0(%rip), %rdi     # 0x8eec1
movl $0x37, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x8ff0
movq 0xd9486(%rip), %rcx     # 0xe4480
leaq 0x83ef8(%rip), %rdi     # 0x8eef9
movl $0x3b, %esi
movl $0x1, %edx
callq 0x8ff0
movl $0x0, 0xd945e(%rip)     # 0xe4478
movsbl (%r14), %edi
movl 0xc6944(%rip), %esi     # 0xd1968
movl 0xc6942(%rip), %edx     # 0xd196c
movl 0xc6940(%rip), %ecx     # 0xd1970
callq 0x45eb8
leaq 0x8400f(%rip), %rdi     # 0x8f04b
leaq 0x840a6(%rip), %rsi     # 0x8f0e9
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x80b0
movsbl 0xc6926(%rip), %edi     # 0xd1979
movzbl 0xc6925(%rip), %eax     # 0xd197f
movl %eax, %ecx
shrl $0x4, %ecx
leaq 0xc6a7a(%rip), %rdx     # 0xd1ae0
movl (%rdx,%rcx,4), %edx
btl $0x2, %eax
movl $0x0, %ecx
adcb $0x1, %cl
movsbl 0xc68fe(%rip), %esi     # 0xd197a
btl $0x1, %eax
adcb $0x1, %bl
movl $0x0, (%rsp)
movzbl %cl, %ecx
movzbl %bl, %r8d
xorl %r9d, %r9d
callq 0x1c034
cmpb $0x0, 0xc68dc(%rip)     # 0xd197c
je 0xb216
leaq 0x83f9e(%rip), %rdi     # 0x8f04b
leaq 0x8403c(%rip), %rsi     # 0x8f0f0
xorl %eax, %eax
callq 0x80b0
callq 0x1b608
callq 0x5da41
movzbl 0xc68b0(%rip), %eax     # 0xd197c
leal -0x3(%rax), %ecx
cmpl $0x5, %eax
movl $0x2, %ebx
cmovael %ecx, %ebx
leaq 0x79aa4b(%rip), %r13    # 0x7a5b2c
leaq 0x5add84(%rip), %rbp    # 0x5b8e6c
leaq 0xd9501(%rip), %r14     # 0xe45f0
leaq 0x5add7a(%rip), %r15    # 0x5b8e70
leaq 0x10(%rsp), %r12
cmpl %ebx, (%r13)
jge 0xb1fe
xorl %edi, %edi
callq 0x4e5af
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 0xa0bd
movabsq $0x202045444f4d20, %rax # imm = 0x202045444F4D20
movq %rax, 0xd94c1(%rip)     # 0xe45fd
movups 0x83fbe(%rip), %xmm0    # 0x8f101
movaps %xmm0, 0xd94a6(%rip)    # 0xe45f0
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 0xa15f
movl (%r13), %edx
movq %r14, %rdi
leaq 0x83f9e(%rip), %rsi     # 0x8f116
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 0xa15f
callq 0x46cdb
movq %r12, %rdi
movq %r14, %rsi
callq 0x5e6cb
testl %eax, %eax
jle 0xb1bf
cmpb $-0x1, 0xd9437(%rip)    # 0xe45f0
je 0xb289
leaq 0x323f5a(%rip), %rax    # 0x32f120
cmpb $0x0, 0x1(%rax)
jle 0xb0fb
jmp 0xb4f1
leaq 0x35e6c4(%rip), %rax    # 0x3698a0
movq (%rax), %rdx
leaq 0x83e0d(%rip), %rdi     # 0x8eff3
leaq 0x83e28(%rip), %rsi     # 0x8f015
xorl %eax, %eax
callq 0x813f0
movl $0x1, %edi
callq 0x8950
leaq 0x79a91f(%rip), %rax    # 0x7a5b24
movzwl (%rax), %eax
movw %ax, 0xd924f(%rip)      # 0xe445e
xorl %edi, %edi
callq 0x4e5af
leaq 0x79a913(%rip), %r15    # 0x7a5b30
movl (%r15), %ebx
testl %ebx, %ebx
js 0xb23d
leaq 0x79a915(%rip), %r14    # 0x7a5b40
movswl %bx, %edi
callq 0x1b1e5
movl %ebx, %eax
movl (%r14,%rax,4), %ebx
testl %ebx, %ebx
jns 0xb22b
cmpb $0x0, 0xc6738(%rip)     # 0xd197c
jne 0xb2a8
leaq 0x83edf(%rip), %rdi     # 0x8f12c
callq 0x1b6dc
testl %eax, %eax
jg 0xb272
leaq 0x83ed6(%rip), %rdi     # 0x8f133
callq 0x1b6dc
testl %eax, %eax
jg 0xb272
leaq 0x83ece(%rip), %rdi     # 0x8f13b
callq 0x1b6dc
leaq 0x83ec5(%rip), %rdi     # 0x8f13e
callq 0x1b6dc
cmpb $0x0, 0xc66f7(%rip)     # 0xd197c
je 0xb299
jmp 0xb2a8
leaq 0x323e90(%rip), %rax    # 0x32f120
movb $0x1, 0x1(%rax)
jmp 0xb4f1
xorl %eax, %eax
callq 0x1878d
testl %eax, %eax
je 0xb4f1
xorl %ebx, %ebx
movl %ebx, 0xda240(%rip)     # 0xe54f0
movl %ebx, 0xd91d6(%rip)     # 0xe448c
movl %ebx, 0xda238(%rip)     # 0xe54f4
movl %ebx, 0xda236(%rip)     # 0xe54f8
movl %ebx, 0xda234(%rip)     # 0xe54fc
movl %ebx, 0xda232(%rip)     # 0xe5500
movl %ebx, 0xda230(%rip)     # 0xe5504
movl %ebx, 0xda22e(%rip)     # 0xe5508
movl %ebx, 0xda22c(%rip)     # 0xe550c
movb %bl, 0xda22a(%rip)      # 0xe5510
movb %bl, 0xda225(%rip)      # 0xe5511
movw %bx, 0xda21f(%rip)      # 0xe5512
movw %bx, 0xda21a(%rip)      # 0xe5514
movw %bx, 0xda215(%rip)      # 0xe5516
movw %bx, 0xda210(%rip)      # 0xe5518
movw %bx, 0xda20b(%rip)      # 0xe551a
movw %bx, 0xda206(%rip)      # 0xe551c
movl %ebx, 0xd916c(%rip)     # 0xe4488
movl %ebx, 0xd9132(%rip)     # 0xe4454
movl %ebx, 0xd9130(%rip)     # 0xe4458
movl %ebx, 0xda1f2(%rip)     # 0xe5520
xorps %xmm0, %xmm0
movaps %xmm0, 0xda1f8(%rip)    # 0xe5530
movaps %xmm0, 0xda201(%rip)    # 0xe5540
movaps %xmm0, 0xda20a(%rip)    # 0xe5550
movaps %xmm0, 0xda213(%rip)    # 0xe5560
movaps %xmm0, 0xda21c(%rip)    # 0xe5570
movaps %xmm0, 0xda225(%rip)    # 0xe5580
movaps %xmm0, 0xda22e(%rip)    # 0xe5590
movaps %xmm0, 0xda237(%rip)    # 0xe55a0
movaps %xmm0, 0xda240(%rip)    # 0xe55b0
movaps %xmm0, 0xda249(%rip)    # 0xe55c0
movaps %xmm0, 0xda252(%rip)    # 0xe55d0
movaps %xmm0, 0xda25b(%rip)    # 0xe55e0
movaps %xmm0, 0xda264(%rip)    # 0xe55f0
movaps %xmm0, 0xda27d(%rip)    # 0xe5610
movaps %xmm0, 0xda266(%rip)    # 0xe5600
movaps %xmm0, 0xda28f(%rip)    # 0xe5630
movaps %xmm0, 0xda278(%rip)    # 0xe5620
movaps %xmm0, 0xd90f1(%rip)    # 0xe44a0
movaps %xmm0, 0xd90da(%rip)    # 0xe4490
movaps %xmm0, 0xda293(%rip)    # 0xe5650
movaps %xmm0, 0xda27c(%rip)    # 0xe5640
xorl %eax, %eax
callq 0xa1f7
movb $0x1, 0xd9081(%rip)     # 0xe4453
leaq 0x79a74b(%rip), %r12    # 0x7a5b24
movl (%r12), %eax
cmpb %bl, 0xc6599(%rip)      # 0xd197c
je 0xb47e
movb $0x8, 0xd9200(%rip)     # 0xe45f0
movb %al, 0xd91fb(%rip)      # 0xe45f1
movq 0xda263(%rip), %rcx     # 0xe5660
movq %rcx, 0xd91ee(%rip)     # 0xe45f2
movzwl 0xda25d(%rip), %ecx     # 0xe5668
movw %cx, 0xd91e8(%rip)      # 0xe45fa
movb $0x0, 0xd91e3(%rip)     # 0xe45fc
movl (%r15), %ebx
testl %ebx, %ebx
js 0xb450
leaq 0x79a719(%rip), %r13    # 0x7a5b40
leaq 0xd91c2(%rip), %r14     # 0xe45f0
cmpl %eax, %ebx
je 0xb445
movl %ebx, %edi
movq %r14, %rsi
movl $0xc, %edx
callq 0x5f092
movl (%r12), %eax
movl %ebx, %ecx
movl (%r13,%rcx,4), %ebx
testl %ebx, %ebx
jns 0xb42e
movslq %eax, %rcx
leaq (%rcx,%rcx,4), %rdx
leaq (%rcx,%rdx,2), %rcx
leaq 0xda20e(%rip), %rdx     # 0xe5670
movzwl 0xda1ff(%rip), %esi     # 0xe5668
movw %si, 0x8(%rdx,%rcx)
movq 0xda1eb(%rip), %rsi     # 0xe5660
movq %rsi, (%rdx,%rcx)
movb $0x0, 0xa(%rdx,%rcx)
movw %ax, 0xd8fd9(%rip)      # 0xe445e
leaq 0x12406d(%rip), %rbx    # 0x12f4f9
cmpb $0x0, (%rbx)
jne 0xb4d2
leaq 0x551ed0(%rip), %r14    # 0x55d368
callq 0x83076
movl 0xd8fe9(%rip), %eax     # 0xe448c
cmpl 0xda04b(%rip), %eax     # 0xe54f4
je 0xb4b2
callq 0xd296
jmp 0xb49d
movswl 0xd8fa5(%rip), %edi     # 0xe445e
movl (%r14), %eax
subl 0xd8f96(%rip), %eax     # 0xe4458
imull $0x5555, %eax, %esi     # imm = 0x5555
callq 0xb541
cmpb $0x0, (%rbx)
je 0xb498
movb $0x0, 0xd8f7a(%rip)     # 0xe4453
cmpb $0x0, 0xc649c(%rip)     # 0xd197c
jne 0xb4f1
leaq 0x125b5f(%rip), %rax    # 0x131048
movb $0x1, (%rax)
jmp 0xb299
xorl %eax, %eax
callq 0x19450
callq 0x5da42
callq 0x5da43
callq 0x1c2d1
callq 0xa5e7
callq 0x81ca5
callq 0x81c67
callq 0x37bfa
callq 0x34053
callq 0x1b6ad
cmpl $0x0, 0xd90b8(%rip)     # 0xe45e4
je 0xb53a
movq 0xd8f4b(%rip), %rdi     # 0xe4480
callq 0x8640
xorl %edi, %edi
callq 0x8950