// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/tekgame.c
// Function: getinput
void
getinput()
{
     int      ch, keystate;
     int      i, j;
     int     mousx, mousy, bstatus;
     short     moving,strafing,turning;

     if( activemenu != 0 ) {
          domenuinput();
     }

     // normal game keys active
     if( typemode == 0 ) {
          // shift+shift+R
          if( (keystatus[0x2a]&keystatus[0x36]&keystatus[0x13]) > 0 ) {
               keystatus[0x13] = 0;
               playback();
          }
         #ifdef SWITCHINGACTIVE
          if( keystatus[keys[15]] > 0 ) {
               keystatus[keys[15]] = 0;
               screenpeek = connectpoint2[screenpeek];
               if( screenpeek < 0 ) {
                    screenpeek = connecthead;
               }
          }
         #endif
          for( i=7; i>=0; i-- ) {
               if( (keystatus[i+2] > 0) && tekhasweapon(i,screenpeek) ) {
                    keystatus[i+2] = 0;
                    locselectedgun = i;
                    break;
               }
          }
     }

//** Les  - moved from below to apply button movements to vel, svel and angvel
//**        if needed

     mousx=mousy=bstatus=0;
     if( moreoptions[0] != 0 ) {
          getmousevalues(&mousx,&mousy,&bstatus);
          if( biasthreshholdon && (bstatus&6) ) {
               adjustbiasthreshhold(mousy);
               bstatus=0;
          }
          // if horizon key down
          if( keystatus[58] == 0 ) {
               if( mousy > (biasthreshhold) ) {
                    mousebias=-1;
               }
               else if( mousy < -(biasthreshhold) ) {
                    mousebias=+1;
               }
          }
     }
//** Les START - 09/26/95
     locbits=(locselectedgun<<13);                          // Les 09/28/95 moved from below
     if (jstickenabled) {
//          showmessage("X: %05d Y: %05d B:%04X",joyx,joyy,joyb);
          if (joyaxis[0] < jlowx) {
               angvel=max(min(angvel-joyaxis[0],127),-128);
          }
          else if (joyaxis[0] > jhighx) {
               angvel=min(max(angvel+joyaxis[0],-128),127);
          }
          if (joyaxis[1] < jlowy) {
               vel=min(max(vel+joyaxis[1],-128),127);
          }
          else if (joyaxis[1] > jhighy) {
               vel=max(min(vel-joyaxis[1],127),-128);
          }
          for (i=0 ; i < 4 ; i++) {
               if ((joyb&(0x10<<i)) == 0) {
                    if (moreoptions[i+4] == 0) {
                         moving=1;
                    }
                    else if (moreoptions[i+4] == 1) {
                         moving=-1;
                    }
                    else if (moreoptions[i+4] == 2) {
                         turning=1;
                    }
                    else if (moreoptions[i+4] == 3) {
                         turning=-1;
                    }
                    else if (moreoptions[i+4] == 5) {
                         strafing=2;
                    }
                    else if (moreoptions[i+4] == 12) {
                         strafing=-1;
                    }
                    else if (moreoptions[i+4] == 13) {
                         strafing=1;
                    }
                    else if (moreoptionbits[moreoptions[i+4]] >= 0) {
                         locbits|=(1<<moreoptionbits[moreoptions[i+4]]);
                    }
               }
          }
          oldjoyb=joyb;
     }
//** Les END   - 09/26/95

//** Les START - 09/28/95
     moving=strafing=turning=0;
     if (moreoptions[0] != 0) {
          for (i=0 ; i < 3 ; i++) {
               if (bstatus&(1<<i)) {
                    switch (i) {
                    case 0:
                         j=1;
                         break;
                    case 1:
                         j=20;
                         break;
                    case 2:
                         j=2;
                         break;
                    }
                    if (moreoptions[j] == 0) {
                         moving=1;
                    }
                    else if (moreoptions[j] == 1) {
                         moving=-1;
                    }
                    else if (moreoptions[j] == 2) {
                         turning=1;
                    }
                    else if (moreoptions[j] == 3) {
                         turning=-1;
                    }
                    else if (moreoptions[j] == 5) {
                         strafing=2;
                    }
                    else if (moreoptions[j] == 12) {
                         strafing=-1;
                    }
                    else if (moreoptions[j] == 13) {
                         strafing=1;
                    }
                    else {
                         locbits|=(1<<moreoptionbits[moreoptions[j]]);
                    }
               }
          }
     }
//** Les END   - 09/28/95

     // keyboard survey - use to be keytimerstuff() called from keyhandler
     if( keystatus[keys[5]] == 0 && strafing == 0 ) {    // Les 09/28/95
          if( keystatus[keys[2]] > 0 || turning == 1) angvel = max(angvel-16*TICSPERFRAME,-128); // Les 09/28/95
          if( keystatus[keys[3]] > 0 || turning == -1) angvel = min(angvel+16*TICSPERFRAME,127); // Les 09/28/95
     }
     else {
          if (strafing == 0) {                                                                   // Les 09/28/95
               strafing=2;                                                                       // Les 09/28/95
          }                                                                                      // Les 09/28/95
          if( keystatus[keys[2]] > 0 || turning == 1 ) svel = min(svel+8*TICSPERFRAME,127);      // Les 09/28/95
          if( keystatus[keys[3]] > 0 || turning == -1 ) svel = max(svel-8*TICSPERFRAME,-128);    // Les 09/28/95
     }
     if( keystatus[keys[0]]  > 0 || moving == 1 ) vel  = min(vel+8*TICSPERFRAME,127);           // Les 09/28/95
     if( keystatus[keys[1]]  > 0 || moving == -1 ) vel  = max(vel-8*TICSPERFRAME,-128);         // Les 09/28/95
     if( keystatus[keys[12]] > 0 || strafing == 1 ) svel = min(svel+8*TICSPERFRAME,127);        // Les 09/28/95
     if( keystatus[keys[13]] > 0 || strafing == -1 ) svel = max(svel-8*TICSPERFRAME,-128);      // Les 09/28/95
     if( angvel < 0 ) angvel = min(angvel+12*TICSPERFRAME,0);
     if( angvel > 0 ) angvel = max(angvel-12*TICSPERFRAME,0);
     if( svel < 0 )   svel   = min(svel+2*TICSPERFRAME,0);
     if( svel > 0 )   svel   = max(svel-2*TICSPERFRAME,0);
     if( vel  < 0 )   vel    = min(vel+2*TICSPERFRAME,0);
     if( vel  > 0 )   vel    = max(vel-2*TICSPERFRAME,0);

     if( (option[4] == 0) && (numplayers == 2) ) {
          if( keystatus[0x4f] == 0 ) {
               if( keystatus[0x4b] > 0 ) angvel2 = max(angvel2-16*TICSPERFRAME,-128);
               if( keystatus[0x4d] > 0 ) angvel2 = min(angvel2+16*TICSPERFRAME,127);
          }
          else {
               if( keystatus[0x4b] > 0 ) svel2 = min(svel2+8*TICSPERFRAME,127);
               if( keystatus[0x4d] > 0 ) svel2 = max(svel2-8*TICSPERFRAME,-128);
          }
          if( keystatus[0x48] > 0 ) vel2 = min(vel2+8*TICSPERFRAME,127);
          if( keystatus[0x4c] > 0 ) vel2 = max(vel2-8*TICSPERFRAME,-128);
          if( angvel2 < 0 ) angvel2 = min(angvel2+12*TICSPERFRAME,0);
          if( angvel2 > 0 ) angvel2 = max(angvel2-12*TICSPERFRAME,0);
          if( svel2 < 0 )   svel2   = min(svel2+2*TICSPERFRAME,0);
          if( svel2 > 0 )   svel2   = max(svel2-2*TICSPERFRAME,0);
          if( vel2  < 0 )   vel2    = min(vel2+2*TICSPERFRAME,0);
          if( vel2  > 0 )   vel2    = max(vel2-2*TICSPERFRAME,0);
     }
     if( keystatus[keys[28]] ) {
          i=horiz[myconnectindex]+((( int)mousy)>>3);
          if( i > 200 ) i=200;
          if( i < 0   ) i=0;
          horiz[myconnectindex]=i;
          keyedhorizon=1;
          mousy=0;
     }
     else {
          if( (keyedhorizon) && (horiz[myconnectindex] != 100) )
               autocenter[myconnectindex]=1;
          keyedhorizon=0;
          mousx*=mousesensitivity;
     }
//     if( (bstatus&6) != 0 ) {
//          vel=min(vel+(1<<(8+mousesensitivity)),127);
//          vel*=mousebias;
//     }
     locvel = min(max(vel,-128+8),127-8);
     locsvel = min(max(svel,-128+8),127-8);
     locangvel = min(max(angvel,-512+16),511-16);            // Les 09/27/95

     if (strafing == 2) {                                   // Les 09/28/95
          locsvel=max(min(svel-mousx,511-16),-512+16);      // Les 09/28/95
     }                                                      // Les 09/28/95
     else {                                                 // Les 09/28/95
          locangvel=min(max(locangvel+mousx,-512),511);     // Les 09/27/95
     }                                                      // Les 09/28/95
//** Les START - 09/28/95
     if (mousy < 0) {
          mousy-=(1<<mousesensitivity);
     }
     else if (mousy > 0) {
          mousy+=(1<<mousesensitivity);
     }
//** Les END   - 09/28/95

     locvel=min(max(locvel-mousy,-128),127);
//    locbits = (locselectedgun<<13); moved up to joystick section


     if( typemode == 0 ) {
         #ifdef MASTERSWITCHING
          locbits |= (keystatus[0x32]<<9);                  //M (be master)
         #endif
          locbits |= ((keystatus[keys[14]]==1)<<12);        //Map mode
     }
     locbits |= keystatus[keys[8]];                         //Stand high
     locbits |= (keystatus[keys[9]] <<1);                   //Stand low
     locbits |= (keystatus[keys[10]]<<2);                   //Look up
     locbits |= (keystatus[keys[11]]<<3);                   //Look down
     locbits |= (keystatus[keys[16]]<<4);                   //Zoom in
     locbits |= (keystatus[keys[17]]<<5);                   //Zoom out
     locbits |= (keystatus[keys[19]]<<6);                   //AutoCenter     TekWar
     locbits |= (keystatus[keys[27]]<<7);                   //Conceal Weapin TekWar
     locbits |= (keystatus[keys[4]]<<8);                    //Run
     locbits |= ((keystatus[keys[7]]==1)<<10);              //Space
     locbits |= ((keystatus[keys[6]]==1)<<11);              //Shoot Kbd
//    locbits |= (((bstatus&6)>(oldmousebstatus&6))<<10);    //Space
//    locbits |= (((bstatus&1)>(oldmousebstatus&1))<<11);    //Shoot Mse

     if( typemode != 0 ) {
         #ifdef MASTERSWITCHING
          locbits &= ~(keystatus[0x32]<<9);
         #endif
          locbits &= ~((keystatus[keys[14]]==1)<<12);
     }

     if( (joyb == 236) || (joyb == 220) || (joyb == 124) || (joyb == 188) ) {
          keystatus[keys[moreoptions[4]]]=0;
          keystatus[keys[moreoptions[5]]]=0;
          keystatus[keys[moreoptions[6]]]=0;
          keystatus[keys[moreoptions[7]]]=0;
     }

     oldmousebstatus = bstatus;
     if( (locbits&2048) > 0 ) {
          oldmousebstatus &= ~1;
     }

     // trap print scrn key
     if( keystatus[0xb7] > 0 ) {
          keystatus[0xb7] = 0;
          //printscreeninterrupt();
     }

     // F9 brightness
     if( keystatus[67] > 0 ) {
          keystatus[67] = 0;
          brightness++;
          if( brightness > 8 ) brightness = 0;
          setbrightness(brightness,palette,0);
     }

    #ifdef OOGIE
     // F10 adjust bias threshhold
     if (keystatus[68] != 0) {
          keystatus[68]=0;
          if (dimensionmode[screenpeek] != 3) {
               setup3dscreen();
          }
          else {
               dimensionmode[screenpeek]=2;
               setview(0L,0L,xdim-1,(ydim-1)>>detailmode);
          }
     }
    #endif

     if( typemode == 0 ) {
         #ifdef PARALLAX_SETTING_ACTIVE
          if( keystatus[0x19] > 0 ) {
               keystatus[0x19] = 0;
               parallaxtype++;
               if (parallaxtype > 2) parallaxtype = 0;
          }
         #endif
         #ifdef VISIBILITY_SETTING_ACTIVE
          if( (keystatus[0x38]|keystatus[0xb8]) > 0 ) {
               if (keystatus[0x4a] > 0)  // Keypad -
                    visibility = min(visibility+(visibility>>3),16384);
               if (keystatus[0x4e] > 0)  // Keypad +
                    visibility = max(visibility-(visibility>>3),128);
          }
         #endif
          // if typing mode reset kbrd fifo
          if( (keystatus[keys[18]]) > 0 ) {
               keystatus[keys[18]] = 0;
               typemode = 1;
               keyfifoplc = keyfifoend;
          }
     }
     else {
          while( keyfifoplc != keyfifoend ) {
               ch = keyfifo[keyfifoplc];
               keystate = keyfifo[(keyfifoplc+1)&(KEYFIFOSIZ-1)];
               keyfifoplc = ((keyfifoplc+2)&(KEYFIFOSIZ-1));
               if( keystate != 0 ) {
                    // backspace key
                    if( ch == 0xe ) {
                         if( typemessageleng == 0 ) {
                              typemode = 0;
                              break;
                         }
                         typemessageleng--;
                    }
                    if( ch == 0xf ) {
                         keystatus[0xf] = 0;
                         typemode = 0;
                         break;
                    }
                    // either enter key
                    if( (ch == 0x1c) || (ch == 0x9c) ) {
                         keystatus[0x1c] = 0; keystatus[0x9c] = 0;
                         if( typemessageleng > 0 ) {
                              tempbuf[0] = 2;
                              // sending text is message type 4
                              for( j=typemessageleng-1; j>=0; j-- ) {
                                   tempbuf[j+1] = typemessage[j];
                              }
                              for( i=connecthead; i>=0; i=connectpoint2[i] ) {
                                   if( i != myconnectindex ) {
                                        sendpacket(i,tempbuf,typemessageleng+1);
                                   }
                              }
                              typemessageleng = 0;
                         }
                         typemode = 0;
                         break;
                    }
                    if( (typemessageleng < 159) && (ch < 128) ) {
                         if( (keystatus[0x2a]|keystatus[0x36]) != 0 ) {
                              ch = scantoascwithshift[ch];
                         }
                         else {
                              ch = scantoasc[ch];
                         }
                         if( ch != 0 ) {
                              typemessage[typemessageleng++] = ch;
                         }
                    }
               }
          }
          // here's a trick of making key repeat after a 1/2 second
          if( keystatus[0xe] > 0 ) {
               if( keystatus[0xe] < 30 ) {
                    keystatus[0xe] += TICSPERFRAME;
               }
               else {
                    if( typemessageleng == 0 ) {
                         typemode = 0;
                    }
                    else {
                         typemessageleng--;
                    }
               }
          }
     }

     tekprivatekeys();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x121df3(%rip), %rax    # 0x12f4f4
cmpl $0x0, (%rax)
je 0xd70b
callq 0x179b8
cmpl $0x0, 0xd6d5a(%rip)     # 0xe446c
jne 0xd766
leaq 0x321a05(%rip), %rbx    # 0x32f120
movb 0x36(%rbx), %al
andb 0x2a(%rbx), %al
testb %al, 0x13(%rbx)
jg 0xe3a3
movl $0x9, %r14d
cmpb $0x0, (%rbx,%r14)
jle 0xd74b
movswl 0xd6d20(%rip), %esi     # 0xe445e
leal -0x2(%r14), %edi
callq 0x11c29
testl %eax, %eax
jne 0xd756
decq %r14
cmpq $0x1, %r14
jne 0xd730
jmp 0xd766
movb $0x0, (%rbx,%r14)
addl $-0x2, %r14d
movl %r14d, 0x11d4fa(%rip)   # 0x12ac60
xorl %eax, %eax
movl %eax, 0x10(%rsp)
movl %eax, 0xc(%rsp)
movl %eax, 0x14(%rsp)
cmpl %eax, 0xc4286(%rip)     # 0xd1a00
je 0xd809
leaq 0x14(%rsp), %rdi
leaq 0xc(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x4d1d6
cmpb $0x0, 0xd6cb5(%rip)     # 0xe4450
je 0xd7d8
testb $0x6, 0x10(%rsp)
je 0xd7d8
movzwl 0xc41b7(%rip), %eax     # 0xd1962
subw 0xc(%rsp), %ax
cmpw $0x9, %ax
movl $0x8, %ecx
cmovgel %eax, %ecx
movswl %cx, %eax
movl $0x200, %edx            # imm = 0x200
cmpl %edx, %eax
cmovgel %edx, %ecx
movw %cx, 0xc4192(%rip)      # 0xd1962
movl $0x0, 0x10(%rsp)
leaq 0x321941(%rip), %rax    # 0x32f120
cmpb $0x0, 0x3a(%rax)
jne 0xd809
movl 0xc(%rsp), %ecx
movswl 0xc4172(%rip), %edx     # 0xd1962
movw $0xffff, %ax            # imm = 0xFFFF
cmpl %edx, %ecx
jg 0xd802
negl %edx
movw $0x1, %ax
cmpl %edx, %ecx
jge 0xd809
movw %ax, 0xc4157(%rip)      # 0xd1960
movl 0x11d451(%rip), %eax    # 0x12ac60
shll $0xd, %eax
movw %ax, 0xd838b(%rip)      # 0xe5ba4
cmpb $0x0, 0xd6c31(%rip)     # 0xe4451
je 0xd93a
leaq 0x3219f3(%rip), %rcx    # 0x32f220
movl (%rcx), %edx
cmpl 0x11d42f(%rip), %edx    # 0x12ac64
jge 0xd857
movl 0xd7fab(%rip), %esi     # 0xe57e8
subl %edx, %esi
cmpl $0x7f, %esi
movl $0x7f, %edi
cmovll %esi, %edi
cmpl $-0x7f, %edi
movl $0xffffff80, %edx       # imm = 0xFFFFFF80
cmovgel %edi, %edx
jmp 0xd87b
cmpl 0x11d40b(%rip), %edx    # 0x12ac68
jle 0xd881
addl 0xd7f83(%rip), %edx     # 0xe57e8
cmpl $-0x7f, %edx
movl $0xffffff80, %esi       # imm = 0xFFFFFF80
cmovgel %edx, %esi
cmpl $0x7f, %esi
movl $0x7f, %edx
cmovll %esi, %edx
movl %edx, 0xd7f67(%rip)     # 0xe57e8
movl 0x4(%rcx), %ecx
cmpl 0x11d3e2(%rip), %ecx    # 0x12ac6c
jge 0xd8aa
addl 0xd7f4e(%rip), %ecx     # 0xe57e0
cmpl $-0x7f, %ecx
movl $0xffffff80, %edx       # imm = 0xFFFFFF80
cmovgel %ecx, %edx
cmpl $0x7f, %edx
movl $0x7f, %ecx
cmovll %edx, %ecx
jmp 0xd8d0
cmpl 0x11d3c0(%rip), %ecx    # 0x12ac70
jle 0xd8d6
movl 0xd7f28(%rip), %edx     # 0xe57e0
subl %ecx, %edx
cmpl $0x7f, %edx
movl $0x7f, %esi
cmovll %edx, %esi
cmpl $-0x7f, %esi
movl $0xffffff80, %ecx       # imm = 0xFFFFFF80
cmovgel %esi, %ecx
movl %ecx, 0xd7f0a(%rip)     # 0xe57e0
leaq 0x321693(%rip), %rcx    # 0x32ef70
movl (%rcx), %edx
xorl %ecx, %ecx
leaq 0xc4118(%rip), %rsi     # 0xd1a00
leaq 0xc4321(%rip), %rdi     # 0xd1c10
movl $0x302f, %r8d           # imm = 0x302F
movl %edx, %r9d
shrl %cl, %r9d
testb $0x10, %r9b
jne 0xd912
movslq 0x10(%rsi,%rcx,4), %r9
cmpq $0xd, %r9
ja 0xd91d
btl %r9d, %r8d
jae 0xd91d
incq %rcx
cmpq $0x4, %rcx
jne 0xd8f5
jmp 0xd934
movswl (%rdi,%r9,2), %r9d
testl %r9d, %r9d
js 0xd912
btsl %r9d, %eax
movw %ax, 0xd8272(%rip)      # 0xe5ba4
jmp 0xd912
movb %dl, 0x11d33a(%rip)     # 0x12ac74
xorl %ecx, %ecx
cmpl $0x0, 0xc40bd(%rip)     # 0xd1a00
je 0xd9d5
leaq 0x81520(%rip), %r8      # 0x8ee70
movl 0x10(%rsp), %r9d
leaq 0xc40a4(%rip), %r10     # 0xd1a00
leaq 0xc42ad(%rip), %r11     # 0xd1c10
leaq 0x814a6(%rip), %rbx     # 0x8ee10
xorl %esi, %esi
xorl %edi, %edi
xorl %edx, %edx
btl %ecx, %r9d
jae 0xd9c8
movq (%r8), %r14
movl (%r10,%r14,4), %r14d
cmpq $0xd, %r14
ja 0xd993
movslq (%rbx,%r14,4), %r15
addq %rbx, %r15
jmpq *%r15
movw $0x1, %dx
jmp 0xd9c8
movslq %r14d, %r14
movb (%r11,%r14,2), %bpl
btsl %ebp, %eax
movw %ax, 0xd8200(%rip)      # 0xe5ba4
jmp 0xd9c8
movw $0xffff, %di            # imm = 0xFFFF
jmp 0xd9c8
movw $0xffff, %dx            # imm = 0xFFFF
jmp 0xd9c8
movw $0x1, %di
jmp 0xd9c8
movw $0x1, %si
jmp 0xd9c8
movw $0xffff, %si            # imm = 0xFFFF
jmp 0xd9c8
movw $0x2, %di
incl %ecx
addq $0x8, %r8
cmpl $0x3, %ecx
jne 0xd970
jmp 0xd9db
xorl %edx, %edx
xorl %edi, %edi
xorl %esi, %esi
movslq 0xc3fb2(%rip), %rcx     # 0xd1994
leaq 0x321737(%rip), %r15    # 0x32f120
cmpb $0x0, (%r15,%rcx)
sete %cl
testw %di, %di
sete %r8b
andb %cl, %r8b
cmpb $0x1, %r8b
jne 0xda7c
movslq 0xc3f80(%rip), %rcx     # 0xd1988
cmpb $0x0, (%r15,%rcx)
setg %cl
cmpw $0x1, %si
sete %dil
orb %cl, %dil
cmpb $0x1, %dil
jne 0xda3b
movl 0xd7dc1(%rip), %ecx     # 0xe57e8
cmpl $-0x4f, %ecx
movl $0xffffffb0, %edi       # imm = 0xFFFFFFB0
cmovgel %ecx, %edi
addl $-0x30, %edi
movl %edi, 0xd7dad(%rip)     # 0xe57e8
movslq 0xc3f4a(%rip), %rcx     # 0xd198c
cmpb $0x0, (%r15,%rcx)
setg %cl
cmpw $-0x1, %si
sete %sil
orb %cl, %sil
cmpb $0x1, %sil
jne 0xda75
movl 0xd7d87(%rip), %ecx     # 0xe57e8
cmpl $0x4f, %ecx
movl $0x4f, %esi
cmovll %ecx, %esi
addl $0x30, %esi
movl %esi, 0xd7d73(%rip)     # 0xe57e8
xorl %ecx, %ecx
jmp 0xdb01
testw %di, %di
movl $0x2, %ecx
cmovnel %edi, %ecx
movslq 0xc3efa(%rip), %rdi     # 0xd1988
cmpb $0x0, (%r15,%rdi)
setg %dil
cmpw $0x1, %si
sete %r8b
orb %dil, %r8b
cmpb $0x1, %r8b
jne 0xdac6
movl 0xd7d36(%rip), %edi     # 0xe57e4
cmpl $0x67, %edi
movl $0x67, %r8d
cmovll %edi, %r8d
addl $0x18, %r8d
movl %r8d, 0xd7d1e(%rip)     # 0xe57e4
movslq 0xc3ebf(%rip), %rdi     # 0xd198c
cmpb $0x0, (%r15,%rdi)
setg %dil
cmpw $-0x1, %si
sete %sil
orb %dil, %sil
cmpb $0x1, %sil
jne 0xdb01
movl 0xd7cf7(%rip), %esi     # 0xe57e4
cmpl $-0x67, %esi
movl $0xffffff98, %edi       # imm = 0xFFFFFF98
cmovgel %esi, %edi
addl $-0x18, %edi
movl %edi, 0xd7ce3(%rip)     # 0xe57e4
movslq 0xc3e78(%rip), %rsi     # 0xd1980
cmpb $0x0, (%r15,%rsi)
setg %sil
cmpw $0x1, %dx
sete %dil
orb %sil, %dil
cmpb $0x1, %dil
jne 0xdb3c
movl 0xd7cb8(%rip), %esi     # 0xe57e0
cmpl $0x67, %esi
movl $0x67, %edi
cmovll %esi, %edi
addl $0x18, %edi
movl %edi, 0xd7ca4(%rip)     # 0xe57e0
movslq 0xc3e41(%rip), %rsi     # 0xd1984
cmpb $0x0, (%r15,%rsi)
setg %sil
cmpw $-0x1, %dx
sete %dl
orb %sil, %dl
cmpb $0x1, %dl
jne 0xdb75
movl 0xd7c7f(%rip), %edx     # 0xe57e0
cmpl $-0x67, %edx
movl $0xffffff98, %esi       # imm = 0xFFFFFF98
cmovgel %edx, %esi
addl $-0x18, %esi
movl %esi, 0xd7c6b(%rip)     # 0xe57e0
movslq 0xc3e34(%rip), %rdx     # 0xd19b0
cmpb $0x0, (%r15,%rdx)
jg 0xdb89
cmpw $0x1, %cx
jne 0xdba3
movl 0xd7c55(%rip), %edx     # 0xe57e4
cmpl $0x67, %edx
movl $0x67, %esi
cmovll %edx, %esi
addl $0x18, %esi
movl %esi, 0xd7c41(%rip)     # 0xe57e4
movslq 0xc3e0a(%rip), %rdx     # 0xd19b4
cmpb $0x0, (%r15,%rdx)
jg 0xdbb7
cmpw $-0x1, %cx
jne 0xdbd1
movl 0xd7c27(%rip), %edx     # 0xe57e4
cmpl $-0x67, %edx
movl $0xffffff98, %esi       # imm = 0xFFFFFF98
cmovgel %edx, %esi
addl $-0x18, %esi
movl %esi, 0xd7c13(%rip)     # 0xe57e4
movl 0xd7c11(%rip), %edx     # 0xe57e8
testl %edx, %edx
js 0xdbed
je 0xdc03
cmpl $0x25, %edx
movl $0x24, %esi
cmovael %edx, %esi
addl $-0x24, %esi
jmp 0xdbfb
cmpl $-0x24, %edx
movl $0xffffffdc, %esi       # imm = 0xFFFFFFDC
cmovbl %edx, %esi
addl $0x24, %esi
movl %esi, 0xd7be7(%rip)     # 0xe57e8
jmp 0xdc05
xorl %esi, %esi
movl 0xd7bd9(%rip), %edx     # 0xe57e4
testl %edx, %edx
js 0xdc21
je 0xdc37
cmpl $0x7, %edx
movl $0x6, %edi
cmovael %edx, %edi
addl $-0x6, %edi
jmp 0xdc2f
cmpl $-0x6, %edx
movl $0xfffffffa, %edi       # imm = 0xFFFFFFFA
cmovbl %edx, %edi
addl $0x6, %edi
movl %edi, 0xd7baf(%rip)     # 0xe57e4
jmp 0xdc39
xorl %edi, %edi
movl 0xd7ba0(%rip), %r8d     # 0xe57e0
testl %r8d, %r8d
js 0xdc59
je 0xdc71
cmpl $0x7, %r8d
movl $0x6, %edx
cmovael %r8d, %edx
addl $-0x6, %edx
jmp 0xdc69
cmpl $-0x6, %r8d
movl $0xfffffffa, %edx       # imm = 0xFFFFFFFA
cmovbl %r8d, %edx
addl $0x6, %edx
movl %edx, 0xd7b71(%rip)     # 0xe57e0
jmp 0xdc73
xorl %edx, %edx
cmpb $0x0, 0xc3d02(%rip)     # 0xd197c
jne 0xde35
leaq 0x797ea5(%rip), %r8     # 0x7a5b2c
cmpl $0x2, (%r8)
jne 0xde35
cmpb $0x0, 0x4f(%r15)
movb 0x4b(%r15), %r8b
je 0xdcea
testb %r8b, %r8b
jle 0xdcc1
movl 0x11cfd4(%rip), %r8d    # 0x12ac7c
cmpl $0x67, %r8d
movl $0x67, %r9d
cmovll %r8d, %r9d
addl $0x18, %r9d
movl %r9d, 0x11cfbb(%rip)    # 0x12ac7c
cmpb $0x0, 0x4d(%r15)
jle 0xdd36
movl 0x11cfad(%rip), %r8d    # 0x12ac7c
cmpl $-0x67, %r8d
movl $0xffffff98, %r9d       # imm = 0xFFFFFF98
cmovgel %r8d, %r9d
addl $-0x18, %r9d
movl %r9d, 0x11cf94(%rip)    # 0x12ac7c
jmp 0xdd36
testb %r8b, %r8b
jle 0xdd0f
movl 0x11cf82(%rip), %r8d    # 0x12ac78
cmpl $-0x4f, %r8d
movl $0xffffffb0, %r9d       # imm = 0xFFFFFFB0
cmovgel %r8d, %r9d
addl $-0x30, %r9d
movl %r9d, 0x11cf69(%rip)    # 0x12ac78
cmpb $0x0, 0x4d(%r15)
jle 0xdd36
movl 0x11cf5b(%rip), %r8d    # 0x12ac78
cmpl $0x4f, %r8d
movl $0x4f, %r9d
cmovll %r8d, %r9d
addl $0x30, %r9d
movl %r9d, 0x11cf42(%rip)    # 0x12ac78
cmpb $0x0, 0x48(%r15)
jle 0xdd5d
movl 0x11cf3c(%rip), %r8d    # 0x12ac80
cmpl $0x67, %r8d
movl $0x67, %r9d
cmovll %r8d, %r9d
addl $0x18, %r9d
movl %r9d, 0x11cf23(%rip)    # 0x12ac80
cmpb $0x0, 0x4c(%r15)
jle 0xdd84
movl 0x11cf15(%rip), %r8d    # 0x12ac80
cmpl $-0x67, %r8d
movl $0xffffff98, %r9d       # imm = 0xFFFFFF98
cmovgel %r8d, %r9d
addl $-0x18, %r9d
movl %r9d, 0x11cefc(%rip)    # 0x12ac80
movl 0x11ceed(%rip), %r8d    # 0x12ac78
testl %r8d, %r8d
js 0xdda6
je 0xddbf
cmpl $0x25, %r8d
movl $0x24, %r9d
cmovael %r8d, %r9d
addl $-0x24, %r9d
jmp 0xddb8
cmpl $-0x24, %r8d
movl $0xffffffdc, %r9d       # imm = 0xFFFFFFDC
cmovbl %r8d, %r9d
addl $0x24, %r9d
movl %r9d, 0x11ceb9(%rip)    # 0x12ac78
movl 0x11ceb6(%rip), %r8d    # 0x12ac7c
testl %r8d, %r8d
js 0xdde1
je 0xddfa
cmpl $0x7, %r8d
movl $0x6, %r9d
cmovael %r8d, %r9d
addl $-0x6, %r9d
jmp 0xddf3
cmpl $-0x6, %r8d
movl $0xfffffffa, %r9d       # imm = 0xFFFFFFFA
cmovbl %r8d, %r9d
addl $0x6, %r9d
movl %r9d, 0x11ce82(%rip)    # 0x12ac7c
movl 0x11ce7f(%rip), %r8d    # 0x12ac80
testl %r8d, %r8d
js 0xde1c
je 0xde35
cmpl $0x7, %r8d
movl $0x6, %r9d
cmovael %r8d, %r9d
addl $-0x6, %r9d
jmp 0xde2e
cmpl $-0x6, %r8d
movl $0xfffffffa, %r9d       # imm = 0xFFFFFFFA
cmovbl %r8d, %r9d
addl $0x6, %r9d
movl %r9d, 0x11ce4b(%rip)    # 0x12ac80
movslq 0xc3bb4(%rip), %r8      # 0xd19f0
cmpb $0x0, (%r15,%r8)
je 0xde8a
leaq 0x797cda(%rip), %r8     # 0x7a5b24
movslq (%r8), %r8
leaq 0xd7a0c(%rip), %r9      # 0xe5860
movl 0xc(%rsp), %r10d
sarl $0x3, %r10d
addl (%r9,%r8,4), %r10d
movl $0xc8, %r11d
cmpl %r11d, %r10d
cmovgel %r11d, %r10d
xorl %r11d, %r11d
testl %r10d, %r10d
cmovlel %r11d, %r10d
movl %r10d, (%r9,%r8,4)
movb $0x1, 0x11ce01(%rip)    # 0x12ac84
movl %r11d, 0xc(%rsp)
jmp 0xded6
cmpb $0x0, 0x11cdf3(%rip)    # 0x12ac84
je 0xdeba
leaq 0x797c8a(%rip), %r8     # 0x7a5b24
movslq (%r8), %r8
leaq 0xd79bc(%rip), %r9      # 0xe5860
cmpl $0x64, (%r9,%r8,4)
je 0xdeba
leaq 0x1231ee(%rip), %r9     # 0x1310a0
movl $0x1, (%r9,%r8,4)
movb $0x0, 0x11cdc3(%rip)    # 0x12ac84
leaq 0x123154(%rip), %r8     # 0x13101c
movl 0x14(%rsp), %r9d
imull (%r8), %r9d
movl %r9d, 0x14(%rsp)
cmpl $-0x77, %edx
movl $0xffffff88, %r10d      # imm = 0xFFFFFF88
cmovll %r10d, %edx
movl $0x77, %r8d
cmpl %r8d, %edx
cmovgel %r8d, %edx
cmpl $-0x77, %edi
cmovgel %edi, %r10d
cmpl %r8d, %r10d
cmovgel %r8d, %r10d
cmpl $0xfffffe11, %esi       # imm = 0xFFFFFE11
movl $0xfffffe10, %r8d       # imm = 0xFFFFFE10
cmovll %r8d, %esi
movl $0x1ef, %r9d            # imm = 0x1EF
cmpl %r9d, %esi
cmovgel %r9d, %esi
movw %r10w, 0x11cd63(%rip)   # 0x12ac86
movw %si, 0x11cd5e(%rip)     # 0x12ac88
movl 0x14(%rsp), %r10d
cmpw $0x2, %cx
jne 0xdf52
subl %r10d, %edi
cmpl %r9d, %edi
cmovgel %r9d, %edi
cmpl $0xfffffe11, %edi       # imm = 0xFFFFFE11
cmovgel %edi, %r8d
leaq 0x11cd36(%rip), %rcx    # 0x12ac86
jmp 0xdf79
addl %esi, %r10d
cmpl $0xfffffe01, %r10d      # imm = 0xFFFFFE01
movl $0xfffffe00, %r8d       # imm = 0xFFFFFE00
cmovgel %r10d, %r8d
movl $0x1ff, %ecx            # imm = 0x1FF
cmpl %ecx, %r8d
cmovgel %ecx, %r8d
leaq 0x11cd0f(%rip), %rcx    # 0x12ac88
movw %r8w, (%rcx)
movl 0xc(%rsp), %edi
testl %edi, %edi
js 0xdf97
je 0xdfaf
leaq 0x12308e(%rip), %rcx    # 0x13101c
movb (%rcx), %cl
movl $0x1, %esi
jmp 0xdfa5
leaq 0x12307e(%rip), %rcx    # 0x13101c
movb (%rcx), %cl
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
shll %cl, %esi
addl %edi, %esi
movl %esi, 0xc(%rsp)
jmp 0xdfb1
xorl %esi, %esi
subl %esi, %edx
cmpl $-0x7f, %edx
movl $0xffffff80, %ecx       # imm = 0xFFFFFF80
cmovgel %edx, %ecx
cmpl $0x7f, %ecx
movl $0x7f, %edx
cmovll %ecx, %edx
movb %dl, 0x11ccb6(%rip)     # 0x12ac85
movl 0xd6497(%rip), %ecx     # 0xe446c
testl %ecx, %ecx
jne 0xdff0
movslq 0xc39d8(%rip), %rdx     # 0xd19b8
xorl %esi, %esi
cmpb $0x1, (%r15,%rdx)
sete %sil
shll $0xc, %esi
orl %esi, %eax
movslq 0xc39a9(%rip), %rdx     # 0xd19a0
movsbl (%r15,%rdx), %edx
orl %edx, %eax
movslq 0xc399f(%rip), %rdx     # 0xd19a4
movsbl (%r15,%rdx), %edx
addl %edx, %edx
orl %eax, %edx
movslq 0xc3993(%rip), %rax     # 0xd19a8
movsbl (%r15,%rax), %eax
shll $0x2, %eax
movslq 0xc3988(%rip), %rsi     # 0xd19ac
movsbl (%r15,%rsi), %esi
shll $0x3, %esi
orl %eax, %esi
orl %edx, %esi
movslq 0xc3989(%rip), %rax     # 0xd19c0
movsbl (%r15,%rax), %eax
shll $0x4, %eax
movslq 0xc397e(%rip), %rdx     # 0xd19c4
movsbl (%r15,%rdx), %edx
shll $0x5, %edx
orl %eax, %edx
movslq 0xc3975(%rip), %rax     # 0xd19cc
movsbl (%r15,%rax), %eax
shll $0x6, %eax
orl %edx, %eax
orl %esi, %eax
movslq 0xc3982(%rip), %rdx     # 0xd19ec
movsbl (%r15,%rdx), %edx
shll $0x7, %edx
movslq 0xc3917(%rip), %rsi     # 0xd1990
movzbl (%r15,%rsi), %esi
shll $0x8, %esi
orl %edx, %esi
orl %eax, %esi
movslq 0xc3910(%rip), %rax     # 0xd199c
xorl %edx, %edx
cmpb $0x1, (%r15,%rax)
sete %dl
shll $0xa, %edx
movslq 0xc38f8(%rip), %rdi     # 0xd1998
xorl %eax, %eax
cmpb $0x1, (%r15,%rdi)
sete %al
shll $0xb, %eax
orl %edx, %eax
orl %esi, %eax
movw %ax, 0xd7aec(%rip)      # 0xe5ba4
testl %ecx, %ecx
je 0xe0df
movslq 0xc38f5(%rip), %rdx     # 0xd19b8
xorl %esi, %esi
cmpb $0x1, (%r15,%rdx)
setne %sil
negl %esi
orl $0xffffefff, %esi       # imm = 0xFFFFEFFF
andl %esi, %eax
movw %ax, 0xd7ac5(%rip)      # 0xe5ba4
leaq 0x320e8a(%rip), %rdx    # 0x32ef70
movl (%rdx), %edx
addl $-0x7c, %edx
roll $0x1c, %edx
cmpl $0x7, %edx
ja 0xe142
movl $0xd1, %esi
btl %edx, %esi
jae 0xe142
movslq 0xc390c(%rip), %rdx     # 0xd1a10
leaq 0xc3875(%rip), %rsi     # 0xd1980
movslq (%rsi,%rdx,4), %rdx
xorl %edi, %edi
movb %dil, (%r15,%rdx)
movslq 0xc38f8(%rip), %rdx     # 0xd1a14
movslq (%rsi,%rdx,4), %rdx
movb %dil, (%r15,%rdx)
movslq 0xc38ed(%rip), %rdx     # 0xd1a18
movslq (%rsi,%rdx,4), %rdx
movb %dil, (%r15,%rdx)
movslq 0xc38e2(%rip), %rdx     # 0xd1a1c
movslq (%rsi,%rdx,4), %rdx
movb %dil, (%r15,%rdx)
movl 0x10(%rsp), %edx
movl %edx, %esi
andl $-0x2, %esi
btl $0xb, %eax
cmovael %edx, %esi
movw %si, 0xd6307(%rip)      # 0xe4460
cmpb $0x0, 0xb7(%r15)
jle 0xe16b
movb $0x0, 0xb7(%r15)
cmpb $0x0, 0x43(%r15)
jle 0xe1a7
movb $0x0, 0x43(%r15)
movzwl 0xd62e4(%rip), %eax     # 0xe4462
incl %eax
xorl %ecx, %ecx
cmpw $0x9, %ax
cmovgel %ecx, %eax
movw %ax, 0xd62d2(%rip)      # 0xe4462
movswl %ax, %edi
leaq 0x41f296(%rip), %rsi    # 0x42d430
xorl %edx, %edx
callq 0x46954
movl 0xd62c5(%rip), %ecx     # 0xe446c
testl %ecx, %ecx
je 0xe279
leaq 0x320e1e(%rip), %rax    # 0x32efd4
movl (%rax), %edx
leaq 0x320e11(%rip), %rcx    # 0x32efd0
movl (%rcx), %esi
cmpl %edx, %esi
je 0xe35d
movl 0xd6299(%rip), %eax     # 0xe4468
movb 0x36(%r15), %dil
orb 0x2a(%r15), %dil
leaq 0x320e02(%rip), %r8     # 0x32efe0
leaq 0xc39ab(%rip), %r9      # 0xd1b90
leaq 0xc3924(%rip), %r10     # 0xd1b10
leaq 0xd790d(%rip), %r11     # 0xe5b00
movl %esi, %ebx
leal 0x1(%rbx), %r14d
andl $0x3f, %r14d
leal 0x2(%rbx), %esi
andl $0x3f, %esi
cmpl $0x0, (%r8,%r14,4)
je 0xe26e
movslq %ebx, %rbx
movslq (%r8,%rbx,4), %rbx
cmpl $0xe, %ebx
je 0xe231
cmpl $0xf, %ebx
je 0xe2b1
movl %ebx, %ebp
andl $0xffffff7f, %ebp       # imm = 0xFFFFFF7F
cmpl $0x1c, %ebp
jne 0xe241
jmp 0xe2c4
testl %eax, %eax
je 0xe2bd
decl %eax
movl %eax, 0xd6227(%rip)     # 0xe4468
cmpl $0x9e, %eax
jg 0xe26e
cmpl $0x7f, %ebx
jg 0xe26e
testb %dil, %dil
movq %r9, %r14
cmoveq %r10, %r14
movb (%r14,%rbx), %bl
testb %bl, %bl
je 0xe26e
movslq %eax, %r14
incl %eax
movl %eax, 0xd61fe(%rip)     # 0xe4468
movb %bl, (%r14,%r11)
cmpl %edx, %esi
jne 0xe1f3
movl %edx, (%rcx)
jmp 0xe35d
movslq 0xc3748(%rip), %rax     # 0xd19c8
cmpb $0x0, (%r15,%rax)
jle 0xe38f
movb $0x0, (%r15,%rax)
movl $0x1, 0xd61d2(%rip)     # 0xe446c
leaq 0x320d33(%rip), %rax    # 0x32efd4
movl (%rax), %eax
leaq 0x320d26(%rip), %rcx    # 0x32efd0
movl %eax, (%rcx)
jmp 0xe38f
movl %esi, (%rcx)
movb $0x0, 0xf(%r15)
jmp 0xe353
movl %esi, (%rcx)
jmp 0xe353
movl %esi, (%rcx)
xorl %ecx, %ecx
movb %cl, 0x1c(%r15)
movb %cl, 0x9c(%r15)
testl %eax, %eax
jle 0xe353
movb $0x2, 0xd6312(%rip)     # 0xe45f0
leaq 0xd630b(%rip), %rcx     # 0xe45f0
movl %eax, %edx
decl %eax
movq %rdx, %rdi
subq %rax, %rdi
addq %rcx, %rdi
leaq 0xd7807(%rip), %rsi     # 0xe5b00
callq 0x80e0
leaq 0x79782b(%rip), %rax    # 0x7a5b30
movl (%rax), %ebx
testl %ebx, %ebx
js 0xe349
leaq 0x797812(%rip), %r12    # 0x7a5b24
movl (%r12), %eax
leaq 0x797823(%rip), %r13    # 0x7a5b40
leaq 0xd62cc(%rip), %r14     # 0xe45f0
cmpl %eax, %ebx
je 0xe33e
movl 0xd613a(%rip), %edx     # 0xe4468
incl %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x5f092
movl (%r12), %eax
movl %ebx, %ecx
movl (%r13,%rcx,4), %ebx
testl %ebx, %ebx
jns 0xe324
movl $0x0, 0xd6115(%rip)     # 0xe4468
movl $0x0, 0xd610f(%rip)     # 0xe446c
movb 0xe(%r15), %al
testb %al, %al
jle 0xe38f
cmpb $0x1d, %al
ja 0xe371
addb $0x3, %al
movb %al, 0xe(%r15)
jmp 0xe38f
movl 0xd60f1(%rip), %eax     # 0xe4468
testl %eax, %eax
je 0xe385
decl %eax
movl %eax, 0xd60e5(%rip)     # 0xe4468
jmp 0xe38f
movl $0x0, 0xd60dd(%rip)     # 0xe446c
callq 0x14d93
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x0, 0x13(%rbx)
callq 0xe3ac