// File: /workspace/github_c_makefile_star2_O1/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 0x11ee1c(%rip), %rax    # 0x12c4f4
cmpl $0x0, (%rax)
je 0xd6e2
callq 0x178e3
cmpl $0x0, 0xd3d83(%rip)     # 0xe146c
jne 0xd73c
leaq 0x31ea0e(%rip), %rbx    # 0x32c100
movb 0x36(%rbx), %al
andb 0x2a(%rbx), %al
testb %al, 0x13(%rbx)
jg 0xe3a7
movl $0x9, %r14d
cmpb $0x0, (%rbx,%r14)
jle 0xd722
movswl 0xd3d49(%rip), %esi     # 0xe145e
leal -0x2(%r14), %edi
callq 0x11bc0
testl %eax, %eax
jne 0xd72d
decq %r14
cmpq $0x1, %r14
jne 0xd707
jmp 0xd73c
leal -0x2(%r14), %eax
movb $0x0, (%rbx,%r14)
movl %eax, 0x11a524(%rip)    # 0x127c60
xorl %eax, %eax
movl %eax, 0x10(%rsp)
movl %eax, 0xc(%rsp)
movl %eax, 0x14(%rsp)
cmpl %eax, 0xc12b0(%rip)     # 0xcea00
je 0xd7df
leaq 0x14(%rsp), %rdi
leaq 0xc(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x4b1aa
cmpb $0x0, 0xd3cdf(%rip)     # 0xe1450
je 0xd7ae
testb $0x6, 0x10(%rsp)
je 0xd7ae
movzwl 0xc11e1(%rip), %eax     # 0xce962
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, 0xc11bc(%rip)      # 0xce962
movl $0x0, 0x10(%rsp)
leaq 0x31e94b(%rip), %rax    # 0x32c100
cmpb $0x0, 0x3a(%rax)
jne 0xd7df
movl 0xc(%rsp), %ecx
movswl 0xc119c(%rip), %edx     # 0xce962
movw $0xffff, %ax            # imm = 0xFFFF
cmpl %edx, %ecx
jg 0xd7d8
negl %edx
movw $0x1, %ax
cmpl %edx, %ecx
jge 0xd7df
movw %ax, 0xc1181(%rip)      # 0xce960
movl 0x11a47b(%rip), %eax    # 0x127c60
shll $0xd, %eax
movw %ax, 0xd53b5(%rip)      # 0xe2ba4
cmpb $0x0, 0xd3c5b(%rip)     # 0xe1451
je 0xd919
leaq 0x31e9fd(%rip), %rax    # 0x32c200
movl (%rax), %ecx
cmpl 0x11a459(%rip), %ecx    # 0x127c64
jge 0xd82d
movl 0xd4fd5(%rip), %edx     # 0xe27e8
subl %ecx, %edx
cmpl $0x7f, %edx
movl $0x7f, %esi
cmovll %edx, %esi
cmpl $-0x7f, %esi
movl $0xffffff80, %ecx       # imm = 0xFFFFFF80
cmovgel %esi, %ecx
jmp 0xd851
cmpl 0x11a435(%rip), %ecx    # 0x127c68
jle 0xd857
addl 0xd4fad(%rip), %ecx     # 0xe27e8
cmpl $-0x7f, %ecx
movl $0xffffff80, %edx       # imm = 0xFFFFFF80
cmovgel %ecx, %edx
cmpl $0x7f, %edx
movl $0x7f, %ecx
cmovll %edx, %ecx
movl %ecx, 0xd4f91(%rip)     # 0xe27e8
movl 0x4(%rax), %eax
cmpl 0x11a40c(%rip), %eax    # 0x127c6c
jge 0xd880
addl 0xd4f78(%rip), %eax     # 0xe27e0
cmpl $-0x7f, %eax
movl $0xffffff80, %ecx       # imm = 0xFFFFFF80
cmovgel %eax, %ecx
cmpl $0x7f, %ecx
movl $0x7f, %eax
cmovll %ecx, %eax
jmp 0xd8a6
cmpl 0x11a3ea(%rip), %eax    # 0x127c70
jle 0xd8ac
movl 0xd4f52(%rip), %ecx     # 0xe27e0
subl %eax, %ecx
cmpl $0x7f, %ecx
movl $0x7f, %edx
cmovll %ecx, %edx
cmpl $-0x7f, %edx
movl $0xffffff80, %eax       # imm = 0xFFFFFF80
cmovgel %edx, %eax
movl %eax, 0xd4f34(%rip)     # 0xe27e0
leaq 0x31e69d(%rip), %rax    # 0x32bf50
movl (%rax), %edx
movzwl 0xd52e8(%rip), %esi     # 0xe2ba4
xorl %ecx, %ecx
leaq 0xc113b(%rip), %rdi     # 0xcea00
leaq 0xc1344(%rip), %r8      # 0xcec10
movl $0x302f, %r9d           # imm = 0x302F
movl %edx, %r10d
shrl %cl, %r10d
testb $0x10, %r10b
jne 0xd8ef
movslq 0x10(%rdi,%rcx,4), %r10
cmpq $0xd, %r10
ja 0xd8fa
btl %r10d, %r9d
jae 0xd8fa
incq %rcx
cmpq $0x4, %rcx
jne 0xd8d2
jmp 0xd911
movswl (%r8,%r10,2), %r10d
testl %r10d, %r10d
js 0xd8ef
btsl %r10d, %esi
movw %si, 0xd5295(%rip)      # 0xe2ba4
jmp 0xd8ef
movb (%rax), %al
movb %al, 0x11a35b(%rip)     # 0x127c74
xorl %esi, %esi
cmpl $0x0, 0xc10de(%rip)     # 0xcea00
je 0xd9c4
movl 0x10(%rsp), %edi
leaq 0x7e535(%rip), %r8      # 0x8be68
movzwl 0xd5269(%rip), %r9d     # 0xe2ba4
leaq 0xc10be(%rip), %r10     # 0xcea00
leaq 0xc12c7(%rip), %r11     # 0xcec10
leaq 0x7e4bc(%rip), %rbx     # 0x8be0c
xorl %edx, %edx
xorl %eax, %eax
xorl %ecx, %ecx
btl %esi, %edi
jae 0xd9b7
cmpl $0x2, %esi
ja 0xd963
movl (%r8), %ebp
movslq %ebp, %r14
movl (%r10,%r14,4), %r14d
cmpq $0xd, %r14
ja 0xd980
movslq (%rbx,%r14,4), %r15
addq %rbx, %r15
jmpq *%r15
movw $0x1, %cx
jmp 0xd9b7
movslq %r14d, %r14
movb (%r11,%r14,2), %r14b
btsl %r14d, %r9d
movw %r9w, 0xd5211(%rip)     # 0xe2ba4
jmp 0xd9b7
movw $0xffff, %ax            # imm = 0xFFFF
jmp 0xd9b7
movw $0xffff, %cx            # imm = 0xFFFF
jmp 0xd9b7
movw $0x1, %ax
jmp 0xd9b7
movw $0x1, %dx
jmp 0xd9b7
movw $0xffff, %dx            # imm = 0xFFFF
jmp 0xd9b7
movw $0x2, %ax
incl %esi
addq $0x4, %r8
cmpl $0x3, %esi
jne 0xd956
jmp 0xd9ca
xorl %ecx, %ecx
xorl %eax, %eax
xorl %edx, %edx
movslq 0xc0fc3(%rip), %rsi     # 0xce994
leaq 0x31e728(%rip), %r15    # 0x32c100
cmpb $0x0, (%r15,%rsi)
sete %sil
testw %ax, %ax
sete %dil
andb %sil, %dil
cmpb $0x1, %dil
jne 0xda6e
movslq 0xc0f90(%rip), %rsi     # 0xce988
cmpb $0x0, (%r15,%rsi)
setg %sil
cmpw $0x1, %dx
sete %dil
orb %sil, %dil
cmpb $0x1, %dil
jne 0xda2c
movl 0xd4dd0(%rip), %esi     # 0xe27e8
cmpl $-0x4f, %esi
movl $0xffffffb0, %edi       # imm = 0xFFFFFFB0
cmovgel %esi, %edi
addl $-0x30, %edi
movl %edi, 0xd4dbc(%rip)     # 0xe27e8
movslq 0xc0f59(%rip), %rsi     # 0xce98c
cmpb $0x0, (%r15,%rsi)
setg %sil
cmpw $-0x1, %dx
sete %dl
orb %sil, %dl
cmpb $0x1, %dl
jne 0xdaef
movl 0xd4d93(%rip), %edx     # 0xe27e8
cmpl $0x4f, %edx
movl $0x4f, %esi
cmovll %edx, %esi
addl $0x30, %esi
movl %esi, 0xd4d7f(%rip)     # 0xe27e8
jmp 0xdaef
testw %ax, %ax
movl %eax, %esi
movl $0x2, %eax
cmovnel %esi, %eax
movslq 0xc0f06(%rip), %rsi     # 0xce988
cmpb $0x0, (%r15,%rsi)
setg %sil
cmpw $0x1, %dx
sete %dil
orb %sil, %dil
cmpb $0x1, %dil
jne 0xdab6
movl 0xd4d42(%rip), %esi     # 0xe27e4
cmpl $0x67, %esi
movl $0x67, %edi
cmovll %esi, %edi
addl $0x18, %edi
movl %edi, 0xd4d2e(%rip)     # 0xe27e4
movslq 0xc0ecf(%rip), %rsi     # 0xce98c
cmpb $0x0, (%r15,%rsi)
setg %sil
cmpw $-0x1, %dx
sete %dl
orb %sil, %dl
cmpb $0x1, %dl
jne 0xdaef
movl 0xd4d09(%rip), %edx     # 0xe27e4
cmpl $-0x67, %edx
movl $0xffffff98, %esi       # imm = 0xFFFFFF98
cmovgel %edx, %esi
addl $-0x18, %esi
movl %esi, 0xd4cf5(%rip)     # 0xe27e4
movslq 0xc0e8a(%rip), %rdx     # 0xce980
cmpb $0x0, (%r15,%rdx)
setg %dl
cmpw $0x1, %cx
sete %sil
orb %dl, %sil
cmpb $0x1, %sil
jne 0xdb29
movl 0xd4ccb(%rip), %edx     # 0xe27e0
cmpl $0x67, %edx
movl $0x67, %esi
cmovll %edx, %esi
addl $0x18, %esi
movl %esi, 0xd4cb7(%rip)     # 0xe27e0
movslq 0xc0e54(%rip), %rdx     # 0xce984
cmpb $0x0, (%r15,%rdx)
setg %dl
cmpw $-0x1, %cx
sete %cl
orb %dl, %cl
cmpb $0x1, %cl
jne 0xdb60
movl 0xd4c94(%rip), %ecx     # 0xe27e0
cmpl $-0x67, %ecx
movl $0xffffff98, %edx       # imm = 0xFFFFFF98
cmovgel %ecx, %edx
addl $-0x18, %edx
movl %edx, 0xd4c80(%rip)     # 0xe27e0
movslq 0xc0e49(%rip), %rcx     # 0xce9b0
cmpb $0x0, (%r15,%rcx)
setg %cl
cmpw $0x1, %ax
sete %dl
orb %cl, %dl
cmpb $0x1, %dl
jne 0xdb97
movl 0xd4c61(%rip), %ecx     # 0xe27e4
cmpl $0x67, %ecx
movl $0x67, %edx
cmovll %ecx, %edx
addl $0x18, %edx
movl %edx, 0xd4c4d(%rip)     # 0xe27e4
movslq 0xc0e16(%rip), %rcx     # 0xce9b4
cmpb $0x0, (%r15,%rcx)
setg %cl
cmpw $-0x1, %ax
sete %dl
orb %cl, %dl
cmpb $0x1, %dl
jne 0xdbce
movl 0xd4c2a(%rip), %ecx     # 0xe27e4
cmpl $-0x67, %ecx
movl $0xffffff98, %edx       # imm = 0xFFFFFF98
cmovgel %ecx, %edx
addl $-0x18, %edx
movl %edx, 0xd4c16(%rip)     # 0xe27e4
movl 0xd4c14(%rip), %ecx     # 0xe27e8
testl %ecx, %ecx
jns 0xdbec
cmpl $-0x24, %ecx
movl $0xffffffdc, %edx       # imm = 0xFFFFFFDC
cmovll %ecx, %edx
addl $0x24, %edx
movl %edx, 0xd4bfc(%rip)     # 0xe27e8
movl 0xd4bf6(%rip), %ecx     # 0xe27e8
testl %ecx, %ecx
jle 0xdc0a
cmpl $0x25, %ecx
movl $0x24, %edx
cmovgel %ecx, %edx
addl $-0x24, %edx
movl %edx, 0xd4bde(%rip)     # 0xe27e8
movl 0xd4bd4(%rip), %ecx     # 0xe27e4
testl %ecx, %ecx
jns 0xdc28
cmpl $-0x6, %ecx
movl $0xfffffffa, %edx       # imm = 0xFFFFFFFA
cmovll %ecx, %edx
addl $0x6, %edx
movl %edx, 0xd4bbc(%rip)     # 0xe27e4
movl 0xd4bb6(%rip), %ecx     # 0xe27e4
testl %ecx, %ecx
jle 0xdc46
cmpl $0x7, %ecx
movl $0x6, %edx
cmovgel %ecx, %edx
addl $-0x6, %edx
movl %edx, 0xd4b9e(%rip)     # 0xe27e4
movl 0xd4b94(%rip), %ecx     # 0xe27e0
testl %ecx, %ecx
jns 0xdc64
cmpl $-0x6, %ecx
movl $0xfffffffa, %edx       # imm = 0xFFFFFFFA
cmovll %ecx, %edx
addl $0x6, %edx
movl %edx, 0xd4b7c(%rip)     # 0xe27e0
movl 0xd4b76(%rip), %ecx     # 0xe27e0
testl %ecx, %ecx
jle 0xdc82
cmpl $0x7, %ecx
movl $0x6, %edx
cmovgel %ecx, %edx
addl $-0x6, %edx
movl %edx, 0xd4b5e(%rip)     # 0xe27e0
cmpb $0x0, 0xc0cf3(%rip)     # 0xce97c
jne 0xde20
leaq 0x794e76(%rip), %rcx    # 0x7a2b0c
cmpl $0x2, (%rcx)
jne 0xde20
cmpb $0x0, 0x4f(%r15)
movb 0x4b(%r15), %cl
je 0xdceb
testb %cl, %cl
jle 0xdcc8
movl 0x119fc8(%rip), %ecx    # 0x127c7c
cmpl $0x67, %ecx
movl $0x67, %edx
cmovll %ecx, %edx
addl $0x18, %edx
movl %edx, 0x119fb4(%rip)    # 0x127c7c
cmpb $0x0, 0x4d(%r15)
jle 0xdd2a
movl 0x119fa7(%rip), %ecx    # 0x127c7c
cmpl $-0x67, %ecx
movl $0xffffff98, %edx       # imm = 0xFFFFFF98
cmovgel %ecx, %edx
addl $-0x18, %edx
movl %edx, 0x119f93(%rip)    # 0x127c7c
jmp 0xdd2a
testb %cl, %cl
jle 0xdd09
movl 0x119f83(%rip), %ecx    # 0x127c78
cmpl $-0x4f, %ecx
movl $0xffffffb0, %edx       # imm = 0xFFFFFFB0
cmovgel %ecx, %edx
addl $-0x30, %edx
movl %edx, 0x119f6f(%rip)    # 0x127c78
cmpb $0x0, 0x4d(%r15)
jle 0xdd2a
movl 0x119f62(%rip), %ecx    # 0x127c78
cmpl $0x4f, %ecx
movl $0x4f, %edx
cmovll %ecx, %edx
addl $0x30, %edx
movl %edx, 0x119f4e(%rip)    # 0x127c78
cmpb $0x0, 0x48(%r15)
jle 0xdd4b
movl 0x119f49(%rip), %ecx    # 0x127c80
cmpl $0x67, %ecx
movl $0x67, %edx
cmovll %ecx, %edx
addl $0x18, %edx
movl %edx, 0x119f35(%rip)    # 0x127c80
cmpb $0x0, 0x4c(%r15)
jle 0xdd6c
movl 0x119f28(%rip), %ecx    # 0x127c80
cmpl $-0x67, %ecx
movl $0xffffff98, %edx       # imm = 0xFFFFFF98
cmovgel %ecx, %edx
addl $-0x18, %edx
movl %edx, 0x119f14(%rip)    # 0x127c80
movl 0x119f06(%rip), %ecx    # 0x127c78
testl %ecx, %ecx
jns 0xdd8a
cmpl $-0x24, %ecx
movl $0xffffffdc, %edx       # imm = 0xFFFFFFDC
cmovll %ecx, %edx
addl $0x24, %edx
movl %edx, 0x119eee(%rip)    # 0x127c78
movl 0x119ee8(%rip), %ecx    # 0x127c78
testl %ecx, %ecx
jle 0xdda8
cmpl $0x25, %ecx
movl $0x24, %edx
cmovgel %ecx, %edx
addl $-0x24, %edx
movl %edx, 0x119ed0(%rip)    # 0x127c78
movl 0x119ece(%rip), %ecx    # 0x127c7c
testl %ecx, %ecx
jns 0xddc6
cmpl $-0x6, %ecx
movl $0xfffffffa, %edx       # imm = 0xFFFFFFFA
cmovll %ecx, %edx
addl $0x6, %edx
movl %edx, 0x119eb6(%rip)    # 0x127c7c
movl 0x119eb0(%rip), %ecx    # 0x127c7c
testl %ecx, %ecx
jle 0xdde4
cmpl $0x7, %ecx
movl $0x6, %edx
cmovgel %ecx, %edx
addl $-0x6, %edx
movl %edx, 0x119e98(%rip)    # 0x127c7c
movl 0x119e96(%rip), %ecx    # 0x127c80
testl %ecx, %ecx
jns 0xde02
cmpl $-0x6, %ecx
movl $0xfffffffa, %edx       # imm = 0xFFFFFFFA
cmovll %ecx, %edx
addl $0x6, %edx
movl %edx, 0x119e7e(%rip)    # 0x127c80
movl 0x119e78(%rip), %ecx    # 0x127c80
testl %ecx, %ecx
jle 0xde20
cmpl $0x7, %ecx
movl $0x6, %edx
cmovgel %ecx, %edx
addl $-0x6, %edx
movl %edx, 0x119e60(%rip)    # 0x127c80
movslq 0xc0bc9(%rip), %rcx     # 0xce9f0
cmpb $0x0, (%r15,%rcx)
je 0xde6a
leaq 0x794ccf(%rip), %rcx    # 0x7a2b04
movslq (%rcx), %rcx
leaq 0xd4a21(%rip), %rdx     # 0xe2860
movl 0xc(%rsp), %esi
sarl $0x3, %esi
addl (%rdx,%rcx,4), %esi
movl $0xc8, %edi
cmpl %edi, %esi
cmovgel %edi, %esi
xorl %edi, %edi
testl %esi, %esi
cmovlel %edi, %esi
movl %esi, (%rdx,%rcx,4)
movb $0x1, 0x119e20(%rip)    # 0x127c84
movl %edi, 0xc(%rsp)
jmp 0xdeb1
cmpb $0x0, 0x119e13(%rip)    # 0x127c84
je 0xde98
leaq 0x794c8a(%rip), %rcx    # 0x7a2b04
movslq (%rcx), %rcx
leaq 0xd49dc(%rip), %rdx     # 0xe2860
cmpl $0x64, (%rdx,%rcx,4)
je 0xde98
leaq 0x1201ef(%rip), %rdx    # 0x12e080
movl $0x1, (%rdx,%rcx,4)
movb $0x0, 0x119de5(%rip)    # 0x127c84
leaq 0x120156(%rip), %rcx    # 0x12dffc
movl 0x14(%rsp), %edx
imull (%rcx), %edx
movl %edx, 0x14(%rsp)
movl 0xd4929(%rip), %edx     # 0xe27e0
cmpl $-0x77, %edx
movl $0xffffff88, %r9d       # imm = 0xFFFFFF88
cmovll %r9d, %edx
movl $0x77, %ecx
cmpl %ecx, %edx
cmovgel %ecx, %edx
movb %dl, 0x119db1(%rip)     # 0x127c85
movl 0xd490a(%rip), %esi     # 0xe27e4
cmpl $-0x77, %esi
cmovgel %esi, %r9d
cmpl %ecx, %r9d
cmovgel %ecx, %r9d
movl 0xd48fa(%rip), %edi     # 0xe27e8
cmpl $0xfffffe11, %edi       # imm = 0xFFFFFE11
movl $0xfffffe10, %ecx       # imm = 0xFFFFFE10
cmovll %ecx, %edi
movl $0x1ef, %r8d            # imm = 0x1EF
cmpl %r8d, %edi
cmovgel %r8d, %edi
movw %r9w, 0x119d75(%rip)    # 0x127c86
movw %di, 0x119d70(%rip)     # 0x127c88
movl 0x14(%rsp), %r9d
cmpw $0x2, %ax
jne 0xdf3f
subl %r9d, %esi
cmpl %r8d, %esi
cmovgel %r8d, %esi
cmpl $0xfffffe11, %esi       # imm = 0xFFFFFE11
cmovgel %esi, %ecx
leaq 0x119d49(%rip), %rax    # 0x127c86
jmp 0xdf63
addl %edi, %r9d
cmpl $0xfffffe01, %r9d       # imm = 0xFFFFFE01
movl $0xfffffe00, %ecx       # imm = 0xFFFFFE00
cmovgel %r9d, %ecx
movl $0x1ff, %eax            # imm = 0x1FF
cmpl %eax, %ecx
cmovgel %eax, %ecx
leaq 0x119d25(%rip), %rax    # 0x127c88
movw %cx, (%rax)
movl 0xc(%rsp), %eax
testl %eax, %eax
js 0xdf80
je 0xdf96
leaq 0x120085(%rip), %rcx    # 0x12dffc
movb (%rcx), %cl
movl $0x1, %esi
jmp 0xdf8e
leaq 0x120075(%rip), %rcx    # 0x12dffc
movb (%rcx), %cl
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
shll %cl, %esi
addl %eax, %esi
movl %esi, 0xc(%rsp)
subl 0xc(%rsp), %edx
cmpl $-0x7f, %edx
movl $0xffffff80, %eax       # imm = 0xFFFFFF80
cmovgel %edx, %eax
cmpl $0x7f, %eax
movl $0x7f, %ecx
cmovll %eax, %ecx
movb %cl, 0x119ccf(%rip)     # 0x127c85
movl 0xd34b0(%rip), %eax     # 0xe146c
testl %eax, %eax
jne 0xdfdb
movslq 0xc09f1(%rip), %rcx     # 0xce9b8
xorl %edx, %edx
cmpb $0x1, (%r15,%rcx)
sete %dl
shll $0xc, %edx
orw %dx, 0xd4bc9(%rip)      # 0xe2ba4
movslq 0xc09be(%rip), %rcx     # 0xce9a0
movsbl (%r15,%rcx), %ecx
orw 0xd4bb6(%rip), %cx      # 0xe2ba4
movslq 0xc09af(%rip), %rdx     # 0xce9a4
movsbl (%r15,%rdx), %edx
addl %edx, %edx
movslq 0xc09a5(%rip), %rsi     # 0xce9a8
movsbl (%r15,%rsi), %esi
shll $0x2, %esi
orl %edx, %esi
movslq 0xc0998(%rip), %rdx     # 0xce9ac
movsbl (%r15,%rdx), %edx
shll $0x3, %edx
orl %esi, %edx
movslq 0xc099b(%rip), %rsi     # 0xce9c0
movsbl (%r15,%rsi), %esi
shll $0x4, %esi
orl %edx, %esi
movslq 0xc098e(%rip), %rdx     # 0xce9c4
movsbl (%r15,%rdx), %edx
shll $0x5, %edx
orl %esi, %edx
movslq 0xc0985(%rip), %rsi     # 0xce9cc
movsbl (%r15,%rsi), %esi
shll $0x6, %esi
orl %edx, %esi
orl %ecx, %esi
movslq 0xc0992(%rip), %rcx     # 0xce9ec
movsbl (%r15,%rcx), %ecx
shll $0x7, %ecx
orl %esi, %ecx
movw %cx, 0xd4b39(%rip)      # 0xe2ba4
movslq 0xc091e(%rip), %rdx     # 0xce990
movzbl (%r15,%rdx), %edx
shll $0x8, %edx
orl %ecx, %edx
movw %dx, 0xd4b21(%rip)      # 0xe2ba4
movslq 0xc0912(%rip), %rcx     # 0xce99c
xorl %esi, %esi
cmpb $0x1, (%r15,%rcx)
sete %sil
shll $0xa, %esi
orl %edx, %esi
movw %si, 0xd4b03(%rip)      # 0xe2ba4
movslq 0xc08f0(%rip), %rdx     # 0xce998
xorl %ecx, %ecx
cmpb $0x1, (%r15,%rdx)
sete %cl
shll $0xb, %ecx
orl %esi, %ecx
movw %cx, 0xd4ae6(%rip)      # 0xe2ba4
testl %eax, %eax
je 0xe0e4
movslq 0xc08ef(%rip), %rax     # 0xce9b8
xorl %edx, %edx
cmpb $0x1, (%r15,%rax)
setne %dl
negl %edx
orl $0xffffefff, %edx       # imm = 0xFFFFEFFF
andl %edx, %ecx
movw %cx, 0xd4ac0(%rip)      # 0xe2ba4
leaq 0x31de65(%rip), %rax    # 0x32bf50
movl (%rax), %eax
addl $-0x7c, %eax
roll $0x1c, %eax
cmpl $0x7, %eax
ja 0xe147
movl $0xd1, %ecx
btl %eax, %ecx
jae 0xe147
movslq 0xc0907(%rip), %rax     # 0xcea10
leaq 0xc0870(%rip), %rcx     # 0xce980
movslq (%rcx,%rax,4), %rax
xorl %edx, %edx
movb %dl, (%r15,%rax)
movslq 0xc08f3(%rip), %rax     # 0xcea14
movslq (%rcx,%rax,4), %rax
movb %dl, (%r15,%rax)
movslq 0xc08e8(%rip), %rax     # 0xcea18
movslq (%rcx,%rax,4), %rax
movb %dl, (%r15,%rax)
movslq 0xc08dd(%rip), %rax     # 0xcea1c
movslq (%rcx,%rax,4), %rax
movb %dl, (%r15,%rax)
movzwl 0x10(%rsp), %eax
movw %ax, 0xd330d(%rip)      # 0xe1460
testb $0x8, 0xd4a4b(%rip)     # 0xe2ba5
je 0xe168
andl $0xfffe, %eax           # imm = 0xFFFE
movw %ax, 0xd32f8(%rip)      # 0xe1460
cmpb $0x0, 0xb7(%r15)
jle 0xe17a
movb $0x0, 0xb7(%r15)
cmpb $0x0, 0x43(%r15)
jle 0xe1b0
movb $0x0, 0x43(%r15)
movzwl 0xd32d5(%rip), %eax     # 0xe1462
incl %eax
xorl %ecx, %ecx
cmpw $0x9, %ax
cmovgel %ecx, %eax
movw %ax, 0xd32c3(%rip)      # 0xe1462
movswl %ax, %edi
leaq 0x41c267(%rip), %rsi    # 0x42a410
xorl %edx, %edx
callq 0x44ae3
cmpl $0x0, 0xd32b5(%rip)     # 0xe146c
je 0xe27f
leaq 0x31ddf0(%rip), %rax    # 0x32bfb4
movl (%rax), %ecx
leaq 0x31dde3(%rip), %rax    # 0x32bfb0
movl (%rax), %edx
cmpl %ecx, %edx
je 0xe361
movl 0xd328b(%rip), %edi     # 0xe1468
movb 0x36(%r15), %sil
orb 0x2a(%r15), %sil
leaq 0x31ddd4(%rip), %r8     # 0x32bfc0
leaq 0xc099d(%rip), %r9      # 0xceb90
leaq 0xc0916(%rip), %r10     # 0xceb10
leaq 0xd48ff(%rip), %r11     # 0xe2b00
movl %edx, %ebx
leal 0x1(%rbx), %r14d
andl $0x3f, %r14d
leal 0x2(%rbx), %edx
andl $0x3f, %edx
cmpl $0x0, (%r8,%r14,4)
je 0xe274
movslq %ebx, %rbx
movslq (%r8,%rbx,4), %rbx
cmpl $0xe, %ebx
jne 0xe234
testl %edi, %edi
je 0xe355
decl %edi
movl %edi, 0xd3234(%rip)     # 0xe1468
cmpl $0xf, %ebx
je 0xe2b7
movl %ebx, %ebp
andl $0xffffff7f, %ebp       # imm = 0xFFFFFF7F
cmpl $0x1c, %ebp
je 0xe2c3
cmpl $0x9e, %edi
jg 0xe274
cmpl $0x7f, %ebx
jg 0xe274
testb %sil, %sil
movq %r9, %r14
cmoveq %r10, %r14
movb (%r14,%rbx), %bl
testb %bl, %bl
je 0xe274
movslq %edi, %r14
incl %edi
movl %edi, 0xd31f8(%rip)     # 0xe1468
movb %bl, (%r14,%r11)
cmpl %ecx, %edx
jne 0xe201
movl %edx, (%rax)
jmp 0xe361
movslq 0xc0742(%rip), %rax     # 0xce9c8
cmpb $0x0, (%r15,%rax)
jle 0xe393
movb $0x0, (%r15,%rax)
movl $0x1, 0xd31cc(%rip)     # 0xe146c
leaq 0x31dd0d(%rip), %rax    # 0x32bfb4
movl (%rax), %eax
leaq 0x31dd00(%rip), %rcx    # 0x32bfb0
movl %eax, (%rcx)
jmp 0xe393
movl %edx, (%rax)
movb $0x0, 0xf(%r15)
jmp 0xe357
movl %edx, (%rax)
xorl %eax, %eax
movb %al, 0x1c(%r15)
movb %al, 0x9c(%r15)
movslq 0xd318f(%rip), %rdx     # 0xe1468
testq %rdx, %rdx
jle 0xe357
movb $0x2, 0xd330b(%rip)     # 0xe15f0
leaq 0xd3304(%rip), %rax     # 0xe15f0
leal -0x1(%rdx), %ecx
movq %rdx, %rdi
subq %rcx, %rdi
addq %rax, %rdi
leaq 0xd4801(%rip), %rsi     # 0xe2b00
callq 0x80e0
leaq 0x794805(%rip), %rax    # 0x7a2b10
movl (%rax), %ebx
testl %ebx, %ebx
js 0xe349
leaq 0x7947ec(%rip), %r12    # 0x7a2b04
leaq 0x794801(%rip), %r13    # 0x7a2b20
leaq 0xd32ca(%rip), %r14     # 0xe15f0
cmpl (%r12), %ebx
je 0xe33e
movl 0xd3136(%rip), %edx     # 0xe1468
incl %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x5bcf2
movl %ebx, %eax
movl (%r13,%rax,4), %ebx
testl %ebx, %ebx
jns 0xe326
movl $0x0, 0xd3115(%rip)     # 0xe1468
jmp 0xe357
movl %edx, (%rax)
movl $0x0, 0xd310b(%rip)     # 0xe146c
movb 0xe(%r15), %al
testb %al, %al
jle 0xe393
cmpb $0x1d, %al
jg 0xe375
addb $0x3, %al
movb %al, 0xe(%r15)
jmp 0xe393
movl 0xd30ed(%rip), %eax     # 0xe1468
testl %eax, %eax
je 0xe389
decl %eax
movl %eax, 0xd30e1(%rip)     # 0xe1468
jmp 0xe393
movl $0x0, 0xd30d9(%rip)     # 0xe146c
callq 0x14d0d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x0, 0x13(%rbx)
callq 0xe3b0