// File: /workspace/github_c_makefile_star2_O2/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 0x118c3d(%rip), %rax    # 0x1254f4
cmpl $0x0, (%rax)
je 0xc8c1
callq 0x16544
cmpl $0x0, 0xcdba4(%rip)     # 0xda46c
je 0xc9bb
andl $0x0, 0x10(%rsp)
andl $0x0, 0xc(%rsp)
andl $0x0, 0x14(%rsp)
xorl %eax, %eax
cmpl %eax, 0xbb11b(%rip)     # 0xc7a00
je 0xc96f
leaq 0x14(%rsp), %rdi
leaq 0xc(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x483f2
cmpb $0x0, 0xcdb4a(%rip)     # 0xda450
je 0xc93e
testb $0x6, 0x10(%rsp)
je 0xc93e
movzwl 0xbb04c(%rip), %eax     # 0xc7962
subw 0xc(%rsp), %ax
cmpw $0x9, %ax
pushq $0x8
popq %rcx
cmovgel %eax, %ecx
cmpw $0x200, %cx             # imm = 0x200
movl $0x200, %eax            # imm = 0x200
cmovll %ecx, %eax
movw %ax, 0xbb029(%rip)      # 0xc7962
andl $0x0, 0x10(%rsp)
leaq 0x3187db(%rip), %rax    # 0x325120
cmpb $0x0, 0x3a(%rax)
jne 0xc96f
movl 0xc(%rsp), %ecx
movswl 0xbb00c(%rip), %edx     # 0xc7962
movw $0xffff, %ax            # imm = 0xFFFF
cmpl %edx, %ecx
jg 0xc968
negl %edx
movw $0x1, %ax
cmpl %edx, %ecx
jge 0xc96f
movw %ax, 0xbaff1(%rip)      # 0xc7960
movl 0x1142eb(%rip), %eax    # 0x120c60
shll $0xd, %eax
movw %ax, 0xcf225(%rip)      # 0xdbba4
cmpb $0x0, 0xcdacb(%rip)     # 0xda451
pushq $-0x80
popq %rsi
pushq $0x7f
popq %r8
je 0xcacd
leaq 0x318886(%rip), %rcx    # 0x325220
movl (%rcx), %edx
cmpl 0x1142c2(%rip), %edx    # 0x120c64
jge 0xca01
movl 0xcee3e(%rip), %edi     # 0xdb7e8
subl %edx, %edi
cmpl $0x7f, %edi
cmovgel %r8d, %edi
cmpl $-0x7f, %edi
cmovll %esi, %edi
jmp 0xca1e
leaq 0x31875e(%rip), %rbx    # 0x325120
movb 0x36(%rbx), %al
andb 0x2a(%rbx), %al
testb %al, 0x13(%rbx)
jg 0xd4a3
pushq $0x9
popq %r14
leaq -0x2(%r14), %rdi
testl %edi, %edi
js 0xc8ce
cmpb $0x0, (%rbx,%r14)
jle 0xc9fc
movswl 0xcda6f(%rip), %esi     # 0xda45e
callq 0x10a58
testl %eax, %eax
jne 0xd3bc
decq %r14
jmp 0xc9d5
cmpl 0x114261(%rip), %edx    # 0x120c68
jle 0xca24
addl 0xcedd9(%rip), %edx     # 0xdb7e8
cmpl $-0x7f, %edx
cmovll %esi, %edx
cmpl $0x7f, %edx
cmovgel %r8d, %edx
movl %edx, %edi
movl %edi, 0xcedc4(%rip)     # 0xdb7e8
movl 0x4(%rcx), %ecx
cmpl 0x11423f(%rip), %ecx    # 0x120c6c
jge 0xca44
addl 0xcedab(%rip), %ecx     # 0xdb7e0
cmpl $-0x7f, %ecx
cmovll %esi, %ecx
cmpl $0x7f, %ecx
cmovgel %r8d, %ecx
jmp 0xca63
cmpl 0x114226(%rip), %ecx    # 0x120c70
jle 0xca69
movl 0xced8e(%rip), %edx     # 0xdb7e0
subl %ecx, %edx
cmpl $0x7f, %edx
cmovgel %r8d, %edx
cmpl $-0x7f, %edx
cmovll %esi, %edx
movl %edx, %ecx
movl %ecx, 0xced77(%rip)     # 0xdb7e0
leaq 0x318500(%rip), %rcx    # 0x324f70
movl (%rcx), %edx
xorl %ecx, %ecx
leaq 0xbaf85(%rip), %rdi     # 0xc7a00
leaq 0xbb18e(%rip), %r8      # 0xc7c10
movl $0x302f, %r9d           # imm = 0x302F
cmpq $0x4, %rcx
je 0xcac7
movl %edx, %r10d
shrl %cl, %r10d
testb $0x10, %r10b
jne 0xcaab
movslq 0x10(%rdi,%rcx,4), %r10
cmpq $0xd, %r10
ja 0xcab0
btl %r10d, %r9d
jae 0xcab0
incq %rcx
jmp 0xca88
movswl (%r8,%r10,2), %r10d
testl %r10d, %r10d
js 0xcaab
btsl %r10d, %eax
movw %ax, 0xcf0df(%rip)      # 0xdbba4
jmp 0xcaab
movb %dl, 0x1141a7(%rip)     # 0x120c74
xorl %ecx, %ecx
cmpl $0x0, 0xbaf2a(%rip)     # 0xc7a00
je 0xcb6f
leaq 0x7438d(%rip), %rdi     # 0x80e70
movl 0x10(%rsp), %r8d
leaq 0xbaf11(%rip), %r11     # 0xc7a00
leaq 0xbb11a(%rip), %rbx     # 0xc7c10
leaq 0x74313(%rip), %r14     # 0x80e10
xorl %r9d, %r9d
xorl %r10d, %r10d
xorl %edx, %edx
cmpl $0x3, %ecx
je 0xcb77
btl %ecx, %r8d
jae 0xcb67
movq (%rdi), %r15
movl (%r11,%r15,4), %r15d
cmpq $0xd, %r15
ja 0xcb2e
movslq (%r14,%r15,4), %r12
addq %r14, %r12
jmpq *%r12
movw $0x1, %r9w
jmp 0xcb67
movslq %r15d, %r15
movb (%rbx,%r15,2), %bpl
btsl %ebp, %eax
movw %ax, 0xcf065(%rip)      # 0xdbba4
jmp 0xcb67
movw $0xffff, %r10w          # imm = 0xFFFF
jmp 0xcb67
movw $0xffff, %r9w           # imm = 0xFFFF
jmp 0xcb67
movw $0x1, %r10w
jmp 0xcb67
movw $0x1, %dx
jmp 0xcb67
movw $0xffff, %dx            # imm = 0xFFFF
jmp 0xcb67
movw $0x2, %r10w
incl %ecx
addq $0x8, %rdi
jmp 0xcb05
xorl %r9d, %r9d
xorl %r10d, %r10d
xorl %edx, %edx
movslq 0xbae16(%rip), %rcx     # 0xc7994
leaq 0x31859b(%rip), %r15    # 0x325120
cmpb $0x0, (%r15,%rcx)
sete %cl
testw %r10w, %r10w
sete %r11b
andb %cl, %r11b
pushq $-0x68
popq %rdi
pushq $0x67
popq %r8
pushq $0x4f
popq %rbx
pushq $-0x50
popq %rsi
cmpb $0x1, %r11b
jne 0xcc16
movslq 0xbadd6(%rip), %rcx     # 0xc7988
cmpb $0x0, (%r15,%rcx)
setg %cl
cmpw $0x1, %dx
sete %r10b
orb %cl, %r10b
cmpb $0x1, %r10b
jne 0xcbe0
movl 0xcec17(%rip), %ecx     # 0xdb7e8
cmpl $-0x4f, %ecx
cmovll %esi, %ecx
addl $-0x30, %ecx
movl %ecx, 0xcec08(%rip)     # 0xdb7e8
movslq 0xbada5(%rip), %rcx     # 0xc798c
cmpb $0x0, (%r15,%rcx)
setg %cl
cmpw $-0x1, %dx
sete %dl
orb %cl, %dl
cmpb $0x1, %dl
jne 0xcc12
movl 0xcebe5(%rip), %ecx     # 0xdb7e8
cmpl $0x4f, %ecx
cmovgel %ebx, %ecx
addl $0x30, %ecx
movl %ecx, 0xcebd6(%rip)     # 0xdb7e8
xorl %ecx, %ecx
jmp 0xcc90
testw %r10w, %r10w
pushq $0x2
popq %rcx
cmovnel %r10d, %ecx
movslq 0xbad60(%rip), %r10     # 0xc7988
cmpb $0x0, (%r15,%r10)
setg %r10b
cmpw $0x1, %dx
sete %r11b
orb %r10b, %r11b
cmpb $0x1, %r11b
jne 0xcc5c
movl 0xceb9b(%rip), %r10d    # 0xdb7e4
cmpl $0x67, %r10d
cmovgel %r8d, %r10d
addl $0x18, %r10d
movl %r10d, 0xceb88(%rip)    # 0xdb7e4
movslq 0xbad29(%rip), %r10     # 0xc798c
cmpb $0x0, (%r15,%r10)
setg %r10b
cmpw $-0x1, %dx
sete %dl
orb %r10b, %dl
cmpb $0x1, %dl
jne 0xcc90
movl 0xceb63(%rip), %edx     # 0xdb7e4
cmpl $-0x67, %edx
cmovll %edi, %edx
addl $-0x18, %edx
movl %edx, 0xceb54(%rip)     # 0xdb7e4
movslq 0xbace9(%rip), %rdx     # 0xc7980
cmpb $0x0, (%r15,%rdx)
setg %dl
cmpw $0x1, %r9w
sete %r10b
orb %dl, %r10b
cmpb $0x1, %r10b
jne 0xccc7
movl 0xceb29(%rip), %edx     # 0xdb7e0
cmpl $0x67, %edx
cmovgel %r8d, %edx
addl $0x18, %edx
movl %edx, 0xceb19(%rip)     # 0xdb7e0
movslq 0xbacb6(%rip), %rdx     # 0xc7984
cmpb $0x0, (%r15,%rdx)
setg %dl
cmpw $-0x1, %r9w
sete %r9b
orb %dl, %r9b
cmpb $0x1, %r9b
jne 0xccfd
movl 0xceaf2(%rip), %edx     # 0xdb7e0
cmpl $-0x67, %edx
cmovll %edi, %edx
addl $-0x18, %edx
movl %edx, 0xceae3(%rip)     # 0xdb7e0
movslq 0xbacac(%rip), %rdx     # 0xc79b0
cmpb $0x0, (%r15,%rdx)
jg 0xcd11
cmpw $0x1, %cx
jne 0xcd27
movl 0xceacd(%rip), %edx     # 0xdb7e4
cmpl $0x67, %edx
cmovgel %r8d, %edx
addl $0x18, %edx
movl %edx, 0xceabd(%rip)     # 0xdb7e4
movslq 0xbac86(%rip), %rdx     # 0xc79b4
cmpb $0x0, (%r15,%rdx)
jg 0xcd3b
cmpw $-0x1, %cx
jne 0xcd50
movl 0xceaa3(%rip), %edx     # 0xdb7e4
cmpl $-0x67, %edx
cmovll %edi, %edx
addl $-0x18, %edx
movl %edx, 0xcea94(%rip)     # 0xdb7e4
movl 0xcea91(%rip), %r10d    # 0xdb7e8
pushq $0x24
popq %rdx
pushq $-0x24
popq %r13
testl %r10d, %r10d
js 0xcd73
je 0xcd88
cmpl $0x25, %r10d
cmovbl %edx, %r10d
addl $-0x24, %r10d
jmp 0xcd7f
cmpl $-0x24, %r10d
cmovael %r13d, %r10d
addl $0x24, %r10d
movl %r10d, 0xcea62(%rip)    # 0xdb7e8
jmp 0xcd8b
xorl %r10d, %r10d
movl 0xcea52(%rip), %r11d    # 0xdb7e4
pushq $0x6
popq %r12
pushq $-0x6
popq %r14
testl %r11d, %r11d
js 0xcdaf
je 0xcdc4
cmpl $0x7, %r11d
cmovbl %r12d, %r11d
addl $-0x6, %r11d
jmp 0xcdbb
cmpl $-0x6, %r11d
cmovael %r14d, %r11d
addl $0x6, %r11d
movl %r11d, 0xcea22(%rip)    # 0xdb7e4
jmp 0xcdc7
xorl %r11d, %r11d
movl 0xcea12(%rip), %r9d     # 0xdb7e0
testl %r9d, %r9d
js 0xcde3
je 0xcdfa
cmpl $0x7, %r9d
cmovbl %r12d, %r9d
addl $-0x6, %r9d
jmp 0xcdef
cmpl $-0x6, %r9d
cmovael %r14d, %r9d
addl $0x6, %r9d
movl %ebx, %ebp
movl %r9d, 0xce9e8(%rip)     # 0xdb7e0
jmp 0xcdff
movl %ebx, %ebp
xorl %r9d, %r9d
cmpb $0x0, 0xbab76(%rip)     # 0xc797c
jne 0xcf54
leaq 0x78ed19(%rip), %rbx    # 0x79bb2c
cmpl $0x2, (%rbx)
jne 0xcf54
cmpb $0x0, 0x4f(%r15)
movb 0x4b(%r15), %bl
je 0xce5f
testb %bl, %bl
jle 0xce41
movl 0x113e4b(%rip), %ebx    # 0x120c7c
cmpl $0x67, %ebx
cmovgel %r8d, %ebx
addl $0x18, %ebx
movl %ebx, 0x113e3b(%rip)    # 0x120c7c
cmpb $0x0, 0x4d(%r15)
jle 0xce94
movl 0x113e2e(%rip), %ebx    # 0x120c7c
cmpl $-0x67, %ebx
cmovll %edi, %ebx
addl $-0x18, %ebx
movl %ebx, 0x113e1f(%rip)    # 0x120c7c
jmp 0xce94
testb %bl, %bl
jle 0xce78
movl 0x113e0f(%rip), %ebx    # 0x120c78
cmpl $-0x4f, %ebx
cmovgel %ebx, %esi
addl $-0x30, %esi
movl %esi, 0x113e00(%rip)    # 0x120c78
cmpb $0x0, 0x4d(%r15)
jle 0xce94
movl 0x113df3(%rip), %ebx    # 0x120c78
cmpl $0x4f, %ebx
cmovll %ebx, %ebp
addl $0x30, %ebp
movl %ebp, 0x113de4(%rip)    # 0x120c78
cmpb $0x0, 0x48(%r15)
jle 0xceb3
movl 0x113ddf(%rip), %ebx    # 0x120c80
cmpl $0x67, %ebx
cmovll %ebx, %r8d
addl $0x18, %r8d
movl %r8d, 0x113dcd(%rip)    # 0x120c80
cmpb $0x0, 0x4c(%r15)
jle 0xced2
movl 0x113dbf(%rip), %r8d    # 0x120c80
cmpl $-0x67, %r8d
cmovgel %r8d, %edi
addl $-0x18, %edi
movl %edi, 0x113dae(%rip)    # 0x120c80
movl 0x113da0(%rip), %edi    # 0x120c78
testl %edi, %edi
js 0xceec
je 0xcefe
cmpl $0x25, %edi
cmovael %edi, %edx
addl $-0x24, %edx
movl %edx, %r13d
jmp 0xcef7
cmpl $-0x24, %edi
cmovbl %edi, %r13d
addl $0x24, %r13d
movl %r13d, 0x113d7a(%rip)   # 0x120c78
movl 0x113d78(%rip), %edx    # 0x120c7c
testl %edx, %edx
js 0xcf16
je 0xcf26
cmpl $0x7, %edx
cmovbl %r12d, %edx
addl $-0x6, %edx
jmp 0xcf20
cmpl $-0x6, %edx
cmovael %r14d, %edx
addl $0x6, %edx
movl %edx, 0x113d56(%rip)    # 0x120c7c
movl 0x113d54(%rip), %edx    # 0x120c80
testl %edx, %edx
js 0xcf42
je 0xcf54
cmpl $0x7, %edx
cmovael %edx, %r12d
addl $-0x6, %r12d
movl %r12d, %r14d
jmp 0xcf4d
cmpl $-0x6, %edx
cmovbl %edx, %r14d
addl $0x6, %r14d
movl %r14d, 0x113d2c(%rip)   # 0x120c80
movslq 0xbaa95(%rip), %rdx     # 0xc79f0
cmpb $0x0, (%r15,%rdx)
je 0xcfa6
leaq 0x78ebbb(%rip), %rdx    # 0x79bb24
movslq (%rdx), %rdx
leaq 0xce8ed(%rip), %rdi     # 0xdb860
movl 0xc(%rsp), %r8d
sarl $0x3, %r8d
addl (%rdi,%rdx,4), %r8d
movl $0xc8, %ebx
cmpl %ebx, %r8d
cmovgel %ebx, %r8d
xorl %ebx, %ebx
testl %r8d, %r8d
cmovgl %r8d, %ebx
movl %ebx, (%rdi,%rdx,4)
movb $0x1, 0x113ce5(%rip)    # 0x120c84
andl $0x0, 0xc(%rsp)
jmp 0xcfed
cmpb $0x0, 0x113cd7(%rip)    # 0x120c84
je 0xcfd4
leaq 0x78eb6e(%rip), %rdx    # 0x79bb24
movslq (%rdx), %rdx
leaq 0xce8a0(%rip), %rdi     # 0xdb860
cmpl $0x64, (%rdi,%rdx,4)
je 0xcfd4
leaq 0x11a0d3(%rip), %rdi    # 0x1270a0
movl $0x1, (%rdi,%rdx,4)
movb $0x0, 0x113ca9(%rip)    # 0x120c84
leaq 0x11a03a(%rip), %rdx    # 0x12701c
movl 0x14(%rsp), %edi
imull (%rdx), %edi
movl %edi, 0x14(%rsp)
cmpl $-0x77, %r9d
pushq $-0x78
popq %r8
cmovll %r8d, %r9d
pushq $0x77
popq %rdx
cmpl %edx, %r9d
cmovgel %edx, %r9d
cmpl $-0x77, %r11d
cmovgel %r11d, %r8d
cmpl %edx, %r8d
cmovgel %edx, %r8d
cmpl $0xfffffe11, %r10d      # imm = 0xFFFFFE11
movl $0xfffffe10, %edx       # imm = 0xFFFFFE10
cmovll %edx, %r10d
movl $0x1ef, %edi            # imm = 0x1EF
cmpl %edi, %r10d
cmovgel %edi, %r10d
movw %r8w, 0x113c50(%rip)    # 0x120c86
movw %r10w, 0x113c4a(%rip)   # 0x120c88
movl 0x14(%rsp), %r8d
cmpw $0x2, %cx
jne 0xd067
subl %r8d, %r11d
cmpl %edi, %r11d
cmovgel %edi, %r11d
cmpl $0xfffffe11, %r11d      # imm = 0xFFFFFE11
cmovgel %r11d, %edx
leaq 0x113c21(%rip), %rcx    # 0x120c86
jmp 0xd08b
addl %r10d, %r8d
cmpl $0xfffffe01, %r8d       # imm = 0xFFFFFE01
movl $0xfffffe00, %edx       # imm = 0xFFFFFE00
cmovgel %r8d, %edx
movl $0x1ff, %ecx            # imm = 0x1FF
cmpl %ecx, %edx
cmovgel %ecx, %edx
leaq 0x113bfd(%rip), %rcx    # 0x120c88
pushq $0x7f
popq %r8
pushq $-0x80
popq %rsi
movw %dx, (%rcx)
movl 0xc(%rsp), %edi
testl %edi, %edi
js 0xd0ac
je 0xd0c2
leaq 0x119f76(%rip), %rcx    # 0x12701c
movb (%rcx), %cl
pushq $0x1
jmp 0xd0b7
leaq 0x119f69(%rip), %rcx    # 0x12701c
movb (%rcx), %cl
pushq $-0x1
popq %rdx
shll %cl, %edx
addl %edi, %edx
movl %edx, 0xc(%rsp)
jmp 0xd0c4
xorl %edx, %edx
subl %edx, %r9d
cmpl $-0x7f, %r9d
cmovgel %r9d, %esi
cmpl $0x7f, %esi
cmovll %esi, %r8d
movb %r8b, 0x113ba8(%rip)    # 0x120c85
movl 0xcd389(%rip), %ecx     # 0xda46c
testl %ecx, %ecx
jne 0xd0fe
movslq 0xba8ca(%rip), %rdx     # 0xc79b8
xorl %esi, %esi
cmpb $0x1, (%r15,%rdx)
sete %sil
shll $0xc, %esi
orl %esi, %eax
movslq 0xba89b(%rip), %rdx     # 0xc79a0
movsbl (%r15,%rdx), %edx
orl %edx, %eax
movslq 0xba891(%rip), %rdx     # 0xc79a4
movsbl (%r15,%rdx), %edx
addl %edx, %edx
orl %eax, %edx
movslq 0xba885(%rip), %rax     # 0xc79a8
movsbl (%r15,%rax), %eax
shll $0x2, %eax
movslq 0xba87a(%rip), %rsi     # 0xc79ac
movsbl (%r15,%rsi), %esi
shll $0x3, %esi
orl %eax, %esi
orl %edx, %esi
movslq 0xba87b(%rip), %rax     # 0xc79c0
movsbl (%r15,%rax), %eax
shll $0x4, %eax
movslq 0xba870(%rip), %rdx     # 0xc79c4
movsbl (%r15,%rdx), %edx
shll $0x5, %edx
orl %eax, %edx
movslq 0xba867(%rip), %rax     # 0xc79cc
movsbl (%r15,%rax), %eax
shll $0x6, %eax
orl %edx, %eax
orl %esi, %eax
movslq 0xba874(%rip), %rdx     # 0xc79ec
movsbl (%r15,%rdx), %edx
shll $0x7, %edx
movslq 0xba809(%rip), %rsi     # 0xc7990
movzbl (%r15,%rsi), %esi
shll $0x8, %esi
orl %edx, %esi
orl %eax, %esi
movslq 0xba802(%rip), %rax     # 0xc799c
xorl %edx, %edx
cmpb $0x1, (%r15,%rax)
sete %dl
shll $0xa, %edx
movslq 0xba7ea(%rip), %rdi     # 0xc7998
xorl %eax, %eax
cmpb $0x1, (%r15,%rdi)
sete %al
shll $0xb, %eax
orl %edx, %eax
orl %esi, %eax
movw %ax, 0xce9de(%rip)      # 0xdbba4
testl %ecx, %ecx
je 0xd1ed
movslq 0xba7e7(%rip), %rdx     # 0xc79b8
xorl %esi, %esi
cmpb $0x1, (%r15,%rdx)
setne %sil
negl %esi
orl $0xffffefff, %esi       # imm = 0xFFFFEFFF
andl %esi, %eax
movw %ax, 0xce9b7(%rip)      # 0xdbba4
leaq 0x317d7c(%rip), %rdx    # 0x324f70
movl (%rdx), %edx
addl $-0x7c, %edx
roll $0x1c, %edx
cmpl $0x7, %edx
ja 0xd250
movl $0xd1, %esi
btl %edx, %esi
jae 0xd250
movslq 0xba7fe(%rip), %rdx     # 0xc7a10
leaq 0xba767(%rip), %rsi     # 0xc7980
movslq (%rsi,%rdx,4), %rdx
xorl %edi, %edi
movb %dil, (%r15,%rdx)
movslq 0xba7ea(%rip), %rdx     # 0xc7a14
movslq (%rsi,%rdx,4), %rdx
movb %dil, (%r15,%rdx)
movslq 0xba7df(%rip), %rdx     # 0xc7a18
movslq (%rsi,%rdx,4), %rdx
movb %dil, (%r15,%rdx)
movslq 0xba7d4(%rip), %rdx     # 0xc7a1c
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, 0xcd1f9(%rip)      # 0xda460
cmpb $0x0, 0xb7(%r15)
jle 0xd279
movb $0x0, 0xb7(%r15)
cmpb $0x0, 0x43(%r15)
jle 0xd2b5
movb $0x0, 0x43(%r15)
movzwl 0xcd1d6(%rip), %eax     # 0xda462
incl %eax
xorl %ecx, %ecx
cmpw $0x9, %ax
cmovgel %ecx, %eax
movw %ax, 0xcd1c4(%rip)      # 0xda462
movswl %ax, %edi
leaq 0x416188(%rip), %rsi    # 0x423430
xorl %edx, %edx
callq 0x41f79
movl 0xcd1b7(%rip), %ecx     # 0xda46c
testl %ecx, %ecx
je 0xd384
leaq 0x317d10(%rip), %rax    # 0x324fd4
movl (%rax), %edx
leaq 0x317d03(%rip), %rsi    # 0x324fd0
movl (%rsi), %edi
movl 0xcd193(%rip), %eax     # 0xda468
movb 0x36(%r15), %r8b
orb 0x2a(%r15), %r8b
leaq 0x317cfc(%rip), %r9     # 0x324fe0
leaq 0xba8a5(%rip), %r10     # 0xc7b90
leaq 0xba81e(%rip), %r11     # 0xc7b10
leaq 0xce807(%rip), %rcx     # 0xdbb00
cmpl %edx, %edi
je 0xd464
movslq %edi, %rbx
movslq (%r9,%rbx,4), %rbx
leal 0x1(%rdi), %r14d
andl $0x3f, %r14d
addl $0x2, %edi
andl $0x3f, %edi
movl %edi, (%rsi)
cmpl $0x0, (%r9,%r14,4)
je 0xd2f9
cmpl $0xe, %ebx
je 0xd33f
cmpl $0xf, %ebx
je 0xd3d1
movl %ebx, %ebp
andl $0xffffff7f, %ebp       # imm = 0xFFFFFF7F
cmpl $0x1c, %ebp
jne 0xd34f
jmp 0xd3db
testl %eax, %eax
je 0xd45b
decl %eax
movl %eax, 0xcd119(%rip)     # 0xda468
cmpl $0x9e, %eax
jg 0xd2f9
cmpl $0x80, %ebx
jge 0xd2f9
testb %r8b, %r8b
movq %r10, %r14
cmoveq %r11, %r14
movb (%r14,%rbx), %bl
testb %bl, %bl
je 0xd2f9
movslq %eax, %r14
incl %eax
movl %eax, 0xcd0ed(%rip)     # 0xda468
movb %bl, (%r14,%rcx)
jmp 0xd2f9
movslq 0xba63d(%rip), %rax     # 0xc79c8
cmpb $0x0, (%r15,%rax)
jle 0xd48f
movb $0x0, (%r15,%rax)
movl $0x1, 0xcd0c7(%rip)     # 0xda46c
leaq 0x317c28(%rip), %rax    # 0x324fd4
movl (%rax), %eax
leaq 0x317c1b(%rip), %rcx    # 0x324fd0
movl %eax, (%rcx)
jmp 0xd48f
movb $0x0, (%rbx,%r14)
addl $-0x2, %r14d
movl %r14d, 0x113894(%rip)   # 0x120c60
jmp 0xc8ce
movb $0x0, 0xf(%r15)
jmp 0xd45d
xorl %edx, %edx
movb %dl, 0x1c(%r15)
movb %dl, 0x9c(%r15)
testl %eax, %eax
jle 0xd45d
movb $0x2, 0xcd1fd(%rip)     # 0xda5f0
movl %eax, %eax
leaq 0xcd1f4(%rip), %rdx     # 0xda5f0
testq %rax, %rax
jle 0xd40f
movb -0x1(%rax,%rcx), %sil
movb %sil, (%rax,%rdx)
decq %rax
jmp 0xd3fc
leaq 0x78e71a(%rip), %rbx    # 0x79bb30
leaq 0x78e707(%rip), %r12    # 0x79bb24
leaq 0x78e71c(%rip), %r13    # 0x79bb40
leaq 0xcd1c5(%rip), %r14     # 0xda5f0
movslq (%rbx), %rbx
testq %rbx, %rbx
js 0xd454
cmpl (%r12), %ebx
je 0xd44b
movl 0xcd029(%rip), %edx     # 0xda468
incl %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x54ffd
shlq $0x2, %rbx
addq %r13, %rbx
jmp 0xd42b
andl $0x0, 0xcd00d(%rip)     # 0xda468
xorl %eax, %eax
andl $0x0, 0xcd008(%rip)     # 0xda46c
movb 0xe(%r15), %cl
testb %cl, %cl
jle 0xd48f
cmpb $0x1d, %cl
ja 0xd47a
addb $0x3, %cl
movb %cl, 0xe(%r15)
jmp 0xd48f
testl %eax, %eax
je 0xd488
decl %eax
movl %eax, 0xccfe2(%rip)     # 0xda468
jmp 0xd48f
andl $0x0, 0xccfdd(%rip)     # 0xda46c
callq 0x138dd
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x0, 0x13(%rbx)
callq 0xd4ac