// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/src/tekmsc.c
// Function: tekscreenfx
int
tekscreenfx(void)
{
     int  ammo,n;
     static short hcpic,rvpic,wppic;

     updatepaletteshifts();
     updatesounds(screenpeek);

    //#define COMMITTEE
    #ifdef  COMMITTEE
     printext((xdim>>1)-25,windowy1+24,"THURS 6PM",ALPHABET,255);
    #endif

    #ifdef MATRIXTIMELIMIT
     if( mission == 7 ) {
          switch( minutes ) {
          case 1:
               if( (seconds == 0) && (fortieth < 10) ) {
                    showmessage("1 MINUTE LEFT");
                    playsound(S_BEEP,0,0,0,ST_IMMEDIATE);
               }
               break;
          case 2:
               if( (seconds == 0) && (fortieth < 10) ) {
                    showmessage("MATRIX TIMED OUT"); break;
                    playsound(S_ALARM3,0,0,0,ST_IMMEDIATE);
               }
               else if( seconds == 3 ) {
                    gameover=1;
               }
               break;
          }
     }
    #endif

     if( (messageon == 0) && notininventory ) {
          showmessage("NOT IN INVENTORY");
          notininventory=0;
     }
     if( otoggles[TOGGLE_REARVIEW] ) {
          if (rvpos < 0) {
               rvpos+=(TICSPERFRAME<<2);
               if (rvpos >= 0) {
                    rvpos=0;
                    rvpic=RVDEVICEON;
               }
               else {
                    n=tilesizx[RVDEVICE]/(RVDEVICEON-RVDEVICE);
                    n=(tilesizx[RVDEVICE]-abs(rvpos))/n;
                    rvpic=RVDEVICE+n;
               }
          }
          rotatesprite(rvpos<<16, 0<<16, 65536l, 0, rvpic,
               0, 0, 8+16, 0, 0, xdim-1, ydim-1);
          if (rvpos == 0) {
               rearview(screenpeek);
          }
     }
     else if (abs(rvpos) < tilesizx[RVDEVICE]) {
          rvpos-=(TICSPERFRAME<<2);
          if (abs(rvpos) > tilesizx[RVDEVICE]) {
               rvpos=-tilesizx[RVDEVICE];
               rvpic=RVDEVICE;
          }
          else {
               n=tilesizx[RVDEVICE]/(RVDEVICEON-RVDEVICE);
               n=(tilesizx[RVDEVICE]-abs(rvpos))/n;
               rvpic=RVDEVICE+n;
          }
          rotatesprite(rvpos<<16, 0<<16, 65536l, 0, rvpic,
               0, 0, 8+16, 0, 0, xdim-1, ydim-1);
     }
     if( otoggles[TOGGLE_UPRT] ) {
          if (wppos < 0) {
               wppos+=(TICSPERFRAME<<2);
               if (wppos >= 0) {
                    wppos=0;
                    wppic=WPDEVICEON;
               }
               else {
                    n=tilesizx[WPDEVICE]/(WPDEVICEON-WPDEVICE);
                    n=(tilesizx[WPDEVICE]-abs(wppos))/n;
                    wppic=WPDEVICE+n;
               }
          }
          if (wppos == 0) {
               switch (locselectedgun+1) {
              #ifdef GUNINWPDEV
               case GUN1FLAG:
                    wppic=WPDEVICEGUN2;
                    break;
               case GUN2FLAG:
                    wppic=WPDEVICEGUN4;
                    break;
               case GUN3FLAG:
                    wppic=WPDEVICEGUN6;
                    break;
              #endif
               default:
                    wppic=WPDEVICEON;
                    break;
               }
          }
          rotatesprite((xdim-1-(tilesizx[WPDEVICE]+wppos))<<16, 0<<16, 65536l, 0, WPDEVICE,
               0, 0, 8+16, 0, 0, xdim-1, ydim-1);
     }
     else if (abs(wppos) < tilesizx[WPDEVICE]) {
          wppos-=(TICSPERFRAME<<2);
          if (abs(wppos) > tilesizx[WPDEVICE]) {
               wppos=-tilesizx[WPDEVICE];
               wppic=WPDEVICE;
          }
          else {
               n=tilesizx[WPDEVICE]/(WPDEVICEON-WPDEVICE);
               n=(tilesizx[WPDEVICE]-abs(wppos))/n;
               wppic=WPDEVICE+n;
          }
          //overwritesprite(wppos,0,wppic,0,0,0);
          rotatesprite((xdim-1-(tilesizx[WPDEVICE]+wppos))<<16, 0<<16, 65536l, 0, WPDEVICE,
               0, 0, 8+16, 0, 0, xdim-1, ydim-1);
     }
    #define  SCOREANDTIMEONWPDEVICE
    #ifdef   SCOREANDTIMEONWPDEVICE
     if( (wppic == WPDEVICEON) && (activemenu == 0) ) {
          sprintf(tektempbuf,"%02d:%02d:%02d", hours,minutes,seconds);
          printext(xdim-74,8,tektempbuf,ALPHABET,255);
          sprintf(tektempbuf,"%08d", score[screenpeek]);
          printext(xdim-74,18,tektempbuf,ALPHABET,255);
     }
    #endif
    #ifdef SCOREANDTIMEATBOTTOM
     if ((activemenu == 0) && !(biasthreshholdon)) {
          showtime();
          showscore();
     }
    #endif
     if( activemenu == 0 ) {
          showinv(screenpeek);
     }
     if( toggles[TOGGLE_GODMODE] && (screensize > xdim) ) {
           printext((xdim>>1)-16,4,"HOLY",ALPHABET2,255);
     }
     if (otoggles[TOGGLE_HEALTH]) {
          if (hcpos < 0) {
               hcpos+=(TICSPERFRAME<<2);
               if (hcpos >= 0) {
                    hcpos=0;
                    hcpic=HCDEVICEON;
               }
               else {
                    n=tilesizx[HCDEVICE]/(HCDEVICEON-HCDEVICE);
                    n=(tilesizx[HCDEVICE]-abs(hcpos))/n;
                    hcpic=HCDEVICE+n;
               }
          }
          rotatesprite(hcpos<<16, (ydim-tilesizy[hcpic])<<16, 65536l, 0, hcpic,
               0, 0, 8+16, 0, 0, xdim-1, ydim-1);
          if (hcpic == HCDEVICEON) {
               for (n=0 ; n < health[screenpeek]/HCSCALE ; n++) {
                    rotatesprite((hcpos+34+(n*5))<<16, (ydim-tilesizy[hcpic]+7)<<16, 65536l, 0, GREENLIGHTPIC,
                         (health[screenpeek]/HCSCALE)-n, 0, 8+16, 0, 0, xdim-1, ydim-1);
               }
               for (n=0 ; n < stun[screenpeek]/HCSCALE ; n++) {
                    rotatesprite((hcpos+34+(n*5))<<16, (ydim-tilesizy[hcpic]+13)<<16, 65536l, 0, YELLOWLIGHTPIC,
                         (stun[screenpeek]/HCSCALE)-n, 0, 8+16, 0, 0, xdim-1, ydim-1);
               }
               switch (locselectedgun) {
               case 0:
                    ammo=ammo1[screenpeek];
                    break;
               case 1:
                    ammo=ammo2[screenpeek];
                    break;
               case 2:
                    ammo=ammo3[screenpeek];
                    break;
               case 3:
                    ammo=ammo4[screenpeek];
                    break;
               case 4:
                    ammo=ammo5[screenpeek];
                    break;
               case 5:
                    ammo=ammo6[screenpeek];
                    break;
               case 6:
                    ammo=ammo7[screenpeek];
                    break;
               case 7:
                    ammo=ammo8[screenpeek];
                    break;
               default:
                    ammo=MAXAMMO;
                    break;
               }
               if( ammo > MAXAMMO ) {
                    ammo =MAXAMMO-1;
               }
               for (n=0 ; n < ammo/AMMOSCALE ; n++) {
                    rotatesprite((hcpos+34+(n*5))<<16, (ydim-tilesizy[hcpic]+19)<<16, 65536l, 0, BLUELIGHTPIC,
                         (ammo/AMMOSCALE)-n, 0, 8+16, 0, 0, xdim-1, ydim-1);
               }
          }
     }
     else if (abs(hcpos) < tilesizx[HCDEVICE]) {
          hcpos-=(TICSPERFRAME<<2);
          if (abs(hcpos) > tilesizx[HCDEVICE]) {
               hcpos=-tilesizx[HCDEVICE];
               hcpic=HCDEVICE;
          }
          else {
               n=tilesizx[HCDEVICE]/(HCDEVICEON-HCDEVICE);
               n=(tilesizx[HCDEVICE]-abs(hcpos))/n;
               hcpic=HCDEVICE+n;
          }
          rotatesprite(hcpos<<16, (ydim-tilesizy[hcpic])<<16, 65536l, 0, hcpic,
               0, 0, 8+16, 0, 0, xdim-1, ydim-1);
     }

    #ifdef FRAMECNT
     i=totalclock;
     if (i != frameval[framecnt]) {
          sprintf(tempbuf,"%ld",(CLKIPS*AVERAGEFRAMES)/(i-frameval[framecnt]));
          printext256(windowx1,windowy1,31,-1,tempbuf,1);
          frameval[framecnt]=i;
     }
     framecnt=((framecnt+1)&(AVERAGEFRAMES-1));
    #endif

     if( (activemenu == 0) && (option[4] != 0) ) {
          netstats();
     }

     if( biasthreshholdon ) {
          sprintf((char *)tempbuf,"SET BIAS THRESHHOLD %3d", biasthreshhold);
          printext((xdim>>1)-96,windowy2-10,(char *)tempbuf,ALPHABET2,255);
     }
     else if( (activemenu == 0) && messageon ) {
          if( messagex > windowx1 )
                printext(messagex,windowy2-32,messagebuf,ALPHABET2,255);
     }
     if( (activemenu == 0) && (toggles[TOGGLE_HEALTH] == 0) && (hcpos == -tilesizx[HCDEVICE]) && (screensize > 140) ) {
          if (!(biasthreshholdon)) {
               if( health[screenpeek] < 0 ) {
                    sprintf(tektempbuf,"%4d", 0);
               }
               else if( health[screenpeek] > MAXHEALTH ) {
                    sprintf(tektempbuf,"%4d", 1000);
               }
               else {
                    sprintf(tektempbuf,"%4d", health[screenpeek]);
               }
               printext(windowx1+6,windowy2-10,tektempbuf,ALPHABET2,255);
          }
     }
     if (activemenu) {
          domenu();
     }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x14788
leaq 0xcb695(%rip), %r15     # 0xe145e
movswl (%r15), %edi
callq 0x1c5b3
cmpl $0x0, 0x11672f(%rip)    # 0x12c508
jne 0x15df9
cmpb $0x0, 0x1181a6(%rip)    # 0x12df88
je 0x15df9
leaq 0x76b8f(%rip), %rdi     # 0x8c97a
xorl %eax, %eax
callq 0x14b61
movb $0x0, 0x11818f(%rip)    # 0x12df88
cmpb $0x0, 0x118055(%rip)    # 0x12de55
movzwl 0x117f69(%rip), %eax    # 0x12dd70
je 0x15e34
testw %ax, %ax
jns 0x15ebe
leal 0xc(%rax), %ecx
movw %cx, 0x117f54(%rip)     # 0x12dd70
cmpw $-0xc, %ax
jl 0x15e88
movw $0x0, 0x117f45(%rip)    # 0x12dd70
movw $0x616, %ax             # imm = 0x616
jmp 0x15eb7
movl %eax, %ecx
negw %cx
cmovsw %ax, %cx
movzwl %cx, %edx
leaq 0x5a8039(%rip), %rcx    # 0x5bde80
movswl 0xc24(%rcx), %ecx
cmpl %ecx, %edx
jge 0x15f7a
addl $-0xc, %eax
movl %eax, %edx
negw %dx
cmovsw %ax, %dx
movw %ax, 0x117f07(%rip)     # 0x12dd70
movzwl %dx, %edx
movl %ecx, %eax
subl %edx, %eax
jge 0x15f20
negl %ecx
movw %cx, 0x117ef1(%rip)     # 0x12dd70
movw $0x612, %ax             # imm = 0x612
jmp 0x15f2b
leaq 0x5a7ff1(%rip), %rax    # 0x5bde80
movswl 0xc24(%rax), %eax
leal 0x3(%rax), %esi
testl %eax, %eax
cmovnsl %eax, %esi
sarl $0x2, %esi
movl %ecx, %edx
negw %dx
cmovsw %cx, %dx
movzwl %dx, %ecx
subl %ecx, %eax
cltd
idivl %esi
addl $0x612, %eax            # imm = 0x612
movw %ax, 0x1180c6(%rip)     # 0x12df84
movzwl 0x117eab(%rip), %edi    # 0x12dd70
shll $0x10, %edi
movswl 0x1180b4(%rip), %r8d    # 0x12df84
leaq 0x59ff75(%rip), %rax    # 0x5b5e4c
movl (%rax), %eax
decl %eax
leaq 0x59ff6e(%rip), %rcx    # 0x5b5e50
movl (%rcx), %r10d
decl %r10d
xorl %r11d, %r11d
xorl %esi, %esi
movl $0x10000, %edx          # imm = 0x10000
xorl %ecx, %ecx
xorl %r9d, %r9d
pushq %r10
pushq %rax
pushq %r11
pushq %r11
pushq $0x18
pushq %r11
callq 0x4bca3
addq $0x30, %rsp
cmpw $0x0, 0x117e5d(%rip)    # 0x12dd70
jne 0x15f7a
movswl (%r15), %edi
callq 0x16777
jmp 0x15f7a
shrl $0x2, %ecx
cltd
idivl %ecx
addl $0x612, %eax            # imm = 0x612
movw %ax, 0x118052(%rip)     # 0x12df84
movzwl 0x117e37(%rip), %edi    # 0x12dd70
shll $0x10, %edi
leaq 0x59ff09(%rip), %rcx    # 0x5b5e4c
movl (%rcx), %r10d
decl %r10d
leaq 0x59ff00(%rip), %rcx    # 0x5b5e50
movl (%rcx), %r11d
decl %r11d
xorl %ebx, %ebx
movswl %ax, %r8d
xorl %esi, %esi
movl $0x10000, %edx          # imm = 0x10000
xorl %ecx, %ecx
xorl %r9d, %r9d
pushq %r11
pushq %r10
pushq %rbx
pushq %rbx
pushq $0x18
pushq %rbx
callq 0x4bca3
addq $0x30, %rsp
cmpb $0x0, 0x117ed5(%rip)    # 0x12de56
movzwl 0x117de6(%rip), %eax    # 0x12dd6e
je 0x15fb2
testw %ax, %ax
jns 0x16037
leal 0xc(%rax), %ecx
movw %cx, 0x117dd1(%rip)     # 0x12dd6e
cmpw $-0xc, %ax
jl 0x16001
movw $0x0, 0x117dc2(%rip)    # 0x12dd6e
movw $0x61b, %ax             # imm = 0x61B
jmp 0x16030
movl %eax, %ecx
negw %cx
cmovsw %ax, %cx
movzwl %cx, %edx
leaq 0x5a7ebb(%rip), %rcx    # 0x5bde80
movswl 0xc2e(%rcx), %ecx
cmpl %ecx, %edx
jge 0x160d4
addl $-0xc, %eax
movl %eax, %edx
negw %dx
cmovsw %ax, %dx
movw %ax, 0x117d87(%rip)     # 0x12dd6e
movzwl %dx, %edx
movl %ecx, %eax
subl %edx, %eax
jge 0x1606c
movl %ecx, %eax
negl %eax
movw %ax, 0x117d73(%rip)     # 0x12dd6e
movw $0x617, %ax             # imm = 0x617
jmp 0x16079
leaq 0x5a7e78(%rip), %rax    # 0x5bde80
movswl 0xc2e(%rax), %eax
leal 0x3(%rax), %esi
testl %eax, %eax
cmovnsl %eax, %esi
sarl $0x2, %esi
movl %ecx, %edx
negw %dx
cmovsw %cx, %dx
movzwl %dx, %ecx
subl %ecx, %eax
cltd
idivl %esi
addl $0x617, %eax            # imm = 0x617
movw %ax, 0x117f4f(%rip)     # 0x12df86
movzwl 0x117d30(%rip), %ecx    # 0x12dd6e
testl %ecx, %ecx
jne 0x1604b
movw $0x61b, 0x117f3b(%rip)  # imm = 0x61B
leaq 0x59fdfa(%rip), %rax    # 0x5b5e4c
movl (%rax), %eax
decl %eax
leaq 0x5a7e23(%rip), %rdx    # 0x5bde80
movzwl 0xc2e(%rdx), %edx
addl %edx, %ecx
movl %eax, %edi
subl %ecx, %edi
jmp 0x1609b
movl %ecx, %esi
shrl $0x2, %esi
cltd
idivl %esi
addl $0x617, %eax            # imm = 0x617
movw %ax, 0x117f06(%rip)     # 0x12df86
leaq 0x59fdc5(%rip), %rax    # 0x5b5e4c
movl (%rax), %eax
decl %eax
movzwl %cx, %ecx
movzwl 0x117cd9(%rip), %edx    # 0x12dd6e
addl %ecx, %edx
movl %eax, %edi
subl %edx, %edi
shll $0x10, %edi
leaq 0x59fdab(%rip), %rcx    # 0x5b5e50
movl (%rcx), %r10d
decl %r10d
xorl %r11d, %r11d
xorl %esi, %esi
movl $0x10000, %edx          # imm = 0x10000
xorl %ecx, %ecx
movl $0x617, %r8d            # imm = 0x617
xorl %r9d, %r9d
pushq %r10
pushq %rax
pushq %r11
pushq %r11
pushq $0x18
pushq %r11
callq 0x4bca3
addq $0x30, %rsp
cmpw $0x61b, 0x117ea9(%rip)  # imm = 0x61B
jne 0x1617d
cmpl $0x0, 0x11640a(%rip)    # 0x12c4f4
jne 0x1617d
movl 0x11640e(%rip), %edx    # 0x12c504
movl 0x116404(%rip), %ecx    # 0x12c500
movl 0x1163f9(%rip), %r8d    # 0x12c4fc
leaq 0x117d56(%rip), %rbx    # 0x12de60
leaq 0x767bb(%rip), %rsi     # 0x8c8cc
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8f20
leaq 0x59fd2a(%rip), %r14    # 0x5b5e4c
movl (%r14), %edi
addl $-0x4a, %edi
movl $0x8, %esi
movq %rbx, %rdx
movl $0x15c, %ecx            # imm = 0x15C
movl $0xff, %r8d
callq 0xa13f
movswq (%r15), %rax
leaq 0x114535(%rip), %rcx    # 0x12a680
movl (%rcx,%rax,4), %edx
leaq 0x76786(%rip), %rsi     # 0x8c8db
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8f20
movl (%r14), %edi
addl $-0x4a, %edi
movl $0x12, %esi
movq %rbx, %rdx
movl $0x15c, %ecx            # imm = 0x15C
movl $0xff, %r8d
callq 0xa13f
cmpl $0x0, 0x116370(%rip)    # 0x12c4f4
jne 0x1618f
movswl (%r15), %edi
callq 0x15537
leaq 0xb88ca(%rip), %rax     # 0xcea60
cmpl $0x0, 0x1c(%rax)
je 0x161d4
leaq 0xcc9ff(%rip), %rax     # 0xe2ba2
movswl (%rax), %eax
leaq 0x59fc9f(%rip), %rcx    # 0x5b5e4c
movl (%rcx), %edi
cmpl %eax, %edi
jge 0x161d4
sarl %edi
addl $-0x10, %edi
leaq 0x76708(%rip), %rdx     # 0x8c8c7
movl $0x4, %esi
movl $0x15d, %ecx            # imm = 0x15D
movl $0xff, %r8d
callq 0xa13f
cmpb $0x0, 0x117c7d(%rip)    # 0x12de58
movzwl 0x117b8a(%rip), %eax    # 0x12dd6c
je 0x1620f
testw %ax, %ax
jns 0x16299
leal 0xc(%rax), %ecx
movw %cx, 0x117b75(%rip)     # 0x12dd6c
cmpw $-0xc, %ax
jl 0x16263
movw $0x0, 0x117b66(%rip)    # 0x12dd6c
movw $0x620, %ax             # imm = 0x620
jmp 0x16292
movl %eax, %ecx
negw %cx
cmovsw %ax, %cx
movzwl %cx, %edx
leaq 0x5a7c5e(%rip), %rcx    # 0x5bde80
movswl 0xc38(%rcx), %ecx
cmpl %ecx, %edx
jge 0x165e3
addl $-0xc, %eax
movl %eax, %edx
negw %dx
cmovsw %ax, %dx
movw %ax, 0x117b28(%rip)     # 0x12dd6c
movzwl %dx, %edx
movl %ecx, %eax
subl %edx, %eax
jge 0x16574
negl %ecx
movw %cx, 0x117b12(%rip)     # 0x12dd6c
movw $0x61c, %ax             # imm = 0x61C
jmp 0x1657f
leaq 0x5a7c16(%rip), %rax    # 0x5bde80
movswl 0xc38(%rax), %eax
leal 0x3(%rax), %esi
testl %eax, %eax
cmovnsl %eax, %esi
sarl $0x2, %esi
movl %ecx, %edx
negw %dx
cmovsw %cx, %dx
movzwl %dx, %ecx
subl %ecx, %eax
cltd
idivl %esi
addl $0x61c, %eax            # imm = 0x61C
movw %ax, 0x117ce9(%rip)     # 0x12df82
movzwl 0x117acc(%rip), %edi    # 0x12dd6c
shll $0x10, %edi
leaq 0x59fba6(%rip), %rbx    # 0x5b5e50
movl (%rbx), %eax
movswl 0x117ccf(%rip), %ecx    # 0x12df82
movslq %ecx, %r8
leaq 0x599383(%rip), %r14    # 0x5af640
movzwl (%r14,%r8,2), %ecx
movl %eax, %esi
subl %ecx, %esi
shll $0x10, %esi
leaq 0x59fb7c(%rip), %r15    # 0x5b5e4c
movl (%r15), %r10d
decl %r10d
decl %eax
xorl %r11d, %r11d
movl $0x10000, %edx          # imm = 0x10000
xorl %ecx, %ecx
xorl %r9d, %r9d
pushq %rax
pushq %r10
pushq %r11
pushq %r11
pushq $0x18
pushq %r11
callq 0x4bca3
addq $0x30, %rsp
cmpw $0x620, 0x117c80(%rip)  # imm = 0x620
jne 0x165e3
leaq 0xcb14f(%rip), %r12     # 0xe145e
movswq (%r12), %rax
leaq 0xcb275(%rip), %r13     # 0xe1590
movl (%r13,%rax,4), %eax
cmpl $0x64, %eax
movq %rbx, %rsi
movq %r14, %rdx
jl 0x163de
movl %eax, %eax
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
shrq $0x25, %rax
movl $0x22, %r14d
xorl %ebp, %ebp
xorl %ebx, %ebx
movzwl 0x117a1f(%rip), %edi    # 0x12dd6c
addl %r14d, %edi
shll $0x10, %edi
movl (%rsi), %r10d
movswq 0x117c24(%rip), %rcx    # 0x12df82
movzwl (%rdx,%rcx,2), %ecx
movl %r10d, %esi
subl %ecx, %esi
shll $0x10, %esi
addl $0x70000, %esi          # imm = 0x70000
addb %bpl, %al
movl (%r15), %r11d
decl %r11d
decl %r10d
movsbl %al, %r9d
movl $0x10000, %edx          # imm = 0x10000
xorl %ecx, %ecx
movl $0x622, %r8d            # imm = 0x622
pushq %r10
pushq %r11
xorl %eax, %eax
pushq %rax
pushq %rax
pushq $0x18
pushq %rax
callq 0x4bca3
leaq 0x59929c(%rip), %rdx    # 0x5af640
leaq 0x59faa5(%rip), %rsi    # 0x5b5e50
addq $0x30, %rsp
incl %ebx
movswq (%r12), %rax
movslq (%r13,%rax,4), %rax
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x25, %rax
addl %ecx, %eax
decb %bpl
addl $0x5, %r14d
cmpl %eax, %ebx
jl 0x16346
movswq (%r12), %rcx
movq %r15, %r8
leaq 0xcafa3(%rip), %r13     # 0xe1390
movl (%r13,%rcx,4), %eax
cmpl $0x64, %eax
jl 0x164b5
movl %eax, %eax
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
shrq $0x25, %rax
movl $0x22, %r14d
xorl %ebp, %ebp
xorl %ebx, %ebx
movzwl 0x117953(%rip), %edi    # 0x12dd6c
addl %r14d, %edi
shll $0x10, %edi
movl (%rsi), %r10d
movswq 0x117b58(%rip), %rcx    # 0x12df82
movzwl (%rdx,%rcx,2), %ecx
movl %r10d, %esi
subl %ecx, %esi
shll $0x10, %esi
addl $0xd0000, %esi          # imm = 0xD0000
addb %bpl, %al
movl (%r8), %r11d
decl %r11d
decl %r10d
movsbl %al, %r9d
movl $0x10000, %edx          # imm = 0x10000
xorl %ecx, %ecx
movq %r12, %r15
movq %r8, %r12
movl $0x624, %r8d            # imm = 0x624
pushq %r10
pushq %r11
xorl %eax, %eax
pushq %rax
pushq %rax
pushq $0x18
pushq %rax
callq 0x4bca3
movq %r12, %r8
movq %r15, %r12
leaq 0x59f9d4(%rip), %rsi    # 0x5b5e50
addq $0x30, %rsp
incl %ebx
movswq (%r15), %rcx
movslq (%r13,%rcx,4), %rax
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
movq %rax, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rax
addl %edx, %eax
leaq 0x59919a(%rip), %rdx    # 0x5af640
decb %bpl
addl $0x5, %r14d
cmpl %eax, %ebx
jl 0x16412
movq %r8, %r13
movq %rdx, %r15
movq %rsi, %r12
leaq 0x11179b(%rip), %rax    # 0x127c60
movl (%rax), %eax
movl $0x64, %edx
cmpq $0x7, %rax
ja 0x164e1
leaq 0xb6d77(%rip), %rdx     # 0xcd250
movq (%rdx,%rax,8), %rax
movswl (%rax,%rcx,2), %edx
movslq %edx, %rax
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x22, %rcx
addl %edx, %ecx
cmpl $0x65, %eax
movl $0x9, %ebx
cmovll %ecx, %ebx
testl %ebx, %ebx
jle 0x165e3
movl $0x22, %ebp
xorl %r14d, %r14d
movzwl 0x117852(%rip), %edi    # 0x12dd6c
addl %ebp, %edi
shll $0x10, %edi
movl (%r12), %eax
movswq 0x117a57(%rip), %rcx    # 0x12df82
movzwl (%r15,%rcx,2), %ecx
movl %eax, %esi
subl %ecx, %esi
shll $0x10, %esi
addl $0x130000, %esi         # imm = 0x130000
movl (%r13), %r10d
decl %r10d
decl %eax
movsbl %bl, %r9d
movl $0x10000, %edx          # imm = 0x10000
xorl %ecx, %ecx
movl $0x625, %r8d            # imm = 0x625
pushq %rax
pushq %r10
pushq %r14
pushq %r14
pushq $0x18
pushq %r14
callq 0x4bca3
addq $0x30, %rsp
addl $0x5, %ebp
decl %ebx
jne 0x16513
jmp 0x165e3
shrl $0x2, %ecx
cltd
idivl %ecx
addl $0x61c, %eax            # imm = 0x61C
movw %ax, 0x1179fc(%rip)     # 0x12df82
movzwl 0x1177df(%rip), %edi    # 0x12dd6c
shll $0x10, %edi
leaq 0x59f8b9(%rip), %rcx    # 0x5b5e50
movl (%rcx), %r10d
movswq %ax, %rax
leaq 0x59909b(%rip), %rcx    # 0x5af640
movzwl (%rcx,%rax,2), %ecx
movl %r10d, %esi
subl %ecx, %esi
shll $0x10, %esi
leaq 0x59f894(%rip), %rcx    # 0x5b5e4c
movl (%rcx), %r11d
decl %r11d
decl %r10d
xorl %ebx, %ebx
movswl %ax, %r8d
movl $0x10000, %edx          # imm = 0x10000
xorl %ecx, %ecx
xorl %r9d, %r9d
pushq %r10
pushq %r11
pushq %rbx
pushq %rbx
pushq $0x18
pushq %rbx
callq 0x4bca3
addq $0x30, %rsp
cmpl $0x0, 0x115f0a(%rip)    # 0x12c4f4
jne 0x165fe
leaq 0xb8385(%rip), %rax     # 0xce978
cmpb $0x0, 0x4(%rax)
je 0x165fe
callq 0x15cc7
leaq 0xcae4b(%rip), %r14     # 0xe1450
cmpb $0x0, (%r14)
je 0x16730
leaq 0xb834c(%rip), %rax     # 0xce962
movswl (%rax), %edx
leaq 0xcafd0(%rip), %rbx     # 0xe15f0
leaq 0x76364(%rip), %rsi     # 0x8c98b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8f20
leaq 0x59f814(%rip), %rax    # 0x5b5e4c
movl (%rax), %edi
sarl %edi
addl $-0x60, %edi
leaq 0x59f7fe(%rip), %rax    # 0x5b5e44
movl (%rax), %esi
addl $-0xa, %esi
movq %rbx, %rdx
movl $0x15d, %ecx            # imm = 0x15D
movl $0xff, %r8d
callq 0xa13f
leaq 0xb83fb(%rip), %rax     # 0xcea60
movl 0x20(%rax), %eax
orl 0x115e86(%rip), %eax    # 0x12c4f4
jne 0x16711
movswl 0x1176f1(%rip), %eax    # 0x12dd6c
leaq 0x5a77fe(%rip), %rcx    # 0x5bde80
movswl 0xc38(%rcx), %ecx
addl %eax, %ecx
jne 0x16711
leaq 0xcc50a(%rip), %rax     # 0xe2ba2
movswl (%rax), %eax
cmpl $0x8d, %eax
jl 0x16711
cmpb $0x0, (%r14)
jne 0x16711
leaq 0xcadaf(%rip), %rax     # 0xe145e
movswq (%rax), %rax
leaq 0xcaed6(%rip), %rcx     # 0xe1590
movl (%rcx,%rax,4), %eax
movl $0x3e8, %edx            # imm = 0x3E8
cmpl %edx, %eax
cmovll %eax, %edx
xorl %eax, %eax
testl %edx, %edx
cmovlel %eax, %edx
leaq 0x11778b(%rip), %rbx    # 0x12de60
leaq 0x762c7(%rip), %rsi     # 0x8c9a3
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8f20
leaq 0x5694e3(%rip), %rax    # 0x57fbd0
movl (%rax), %edi
addl $0x6, %edi
leaq 0x59f74b(%rip), %rax    # 0x5b5e44
movl (%rax), %esi
addl $-0xa, %esi
movq %rbx, %rdx
movl $0x15d, %ecx            # imm = 0x15D
movl $0xff, %r8d
callq 0xa13f
cmpl $0x0, 0x115ddc(%rip)    # 0x12c4f4
je 0x1671f
callq 0x168f3
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x115dbd(%rip)    # 0x12c4f4
jne 0x1665e
cmpl $0x0, 0x115dc4(%rip)    # 0x12c508
je 0x1665e
movl 0x117618(%rip), %edi    # 0x12dd68
leaq 0x569479(%rip), %rax    # 0x57fbd0
cmpl (%rax), %edi
jle 0x1665e
leaq 0x59f6de(%rip), %rax    # 0x5b5e44
movl (%rax), %esi
addl $-0x20, %esi
leaq 0x1175ce(%rip), %rdx    # 0x12dd40
jmp 0x1664e