// File: /workspace/github_c_makefile_star2_O3/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 0x14808
leaq 0xce5d4(%rip), %r15     # 0xe445e
movswl (%r15), %edi
callq 0x1c717
cmpl $0x0, 0x11966e(%rip)    # 0x12f508
jne 0x15eba
cmpb $0x0, 0x11b0f9(%rip)    # 0x130f9c
je 0x15eba
leaq 0x79b52(%rip), %rdi     # 0x8f9fe
xorl %eax, %eax
callq 0x14be7
movb $0x0, 0x11b0e2(%rip)    # 0x130f9c
cmpb $0x0, 0x11afa4(%rip)    # 0x130e65
movzwl 0x11aea8(%rip), %edi    # 0x130d70
je 0x15edb
testw %di, %di
js 0x15f2f
movzwl 0x11b0c2(%rip), %eax    # 0x130f98
jmp 0x15f90
movl %edi, %eax
negw %ax
cmovsw %di, %ax
movzwl %ax, %eax
leaq 0x5aafb2(%rip), %rcx    # 0x5c0ea0
movswl 0xc24(%rcx), %ecx
cmpl %ecx, %eax
jge 0x1603f
addl $-0xc, %edi
movw %di, 0x11ae69(%rip)     # 0x130d70
movl %edi, %edx
negw %dx
cmovsw %di, %dx
movzwl %dx, %eax
cmpl %ecx, %eax
jbe 0x15fe6
negl %ecx
movw %cx, 0x11ae4c(%rip)     # 0x130d70
movw $0x612, %ax             # imm = 0x612
movl %ecx, %edi
jmp 0x15ff7
leal 0xc(%rdi), %ecx
movw %cx, 0x11ae37(%rip)     # 0x130d70
cmpw $-0xc, %di
jb 0x15f59
movw $0x0, 0x11ae28(%rip)    # 0x130d70
movw $0x616, 0x11b047(%rip)  # imm = 0x616
movw $0x616, %ax             # imm = 0x616
xorl %edi, %edi
jmp 0x15f90
movzwl %di, %eax
leaq 0x5aaf3d(%rip), %rdx    # 0x5c0ea0
movswl 0xc24(%rdx), %edx
leal 0x3(%rdx), %esi
testl %edx, %edx
cmovnsl %edx, %esi
movswl %si, %esi
sarl $0x2, %esi
addl %edx, %eax
addl $0xffff000c, %eax       # imm = 0xFFFF000C
cltd
idivl %esi
addl $0x612, %eax            # imm = 0x612
movw %ax, 0x11b00a(%rip)     # 0x130f98
movl %ecx, %edi
shll $0x10, %edi
leaq 0x5a2ed2(%rip), %rcx    # 0x5b8e6c
movl (%rcx), %r10d
decl %r10d
leaq 0x5a2ec9(%rip), %rcx    # 0x5b8e70
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 0x4dcbd
addq $0x30, %rsp
cmpw $0x0, 0x11ad97(%rip)    # 0x130d70
jne 0x1603f
movswl (%r15), %edi
callq 0x16833
jmp 0x1603f
movl %ecx, %eax
subl %edx, %eax
cwtd
shrl $0x2, %ecx
idivw %cx
addl $0x612, %eax            # imm = 0x612
movw %ax, 0x11af9a(%rip)     # 0x130f98
shll $0x10, %edi
leaq 0x5a2e64(%rip), %rcx    # 0x5b8e6c
movl (%rcx), %r10d
decl %r10d
leaq 0x5a2e5b(%rip), %rcx    # 0x5b8e70
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 0x4dcbd
addq $0x30, %rsp
cmpb $0x0, 0x11ae20(%rip)    # 0x130e66
movzwl 0x11ad21(%rip), %ecx    # 0x130d6e
je 0x1605c
testw %cx, %cx
js 0x160b3
jne 0x1610b
jmp 0x160cc
movl %ecx, %eax
negw %ax
cmovsw %cx, %ax
movzwl %ax, %eax
leaq 0x5aae31(%rip), %rdx    # 0x5c0ea0
movswl 0xc2e(%rdx), %edi
cmpl %edi, %eax
jge 0x16194
movzwl %di, %esi
addl $-0xc, %ecx
movw %cx, 0x11ace3(%rip)     # 0x130d6e
movl %ecx, %edx
negw %dx
cmovsw %cx, %dx
movzwl %dx, %eax
cmpl %edi, %eax
jbe 0x1612f
movl %esi, %ecx
negl %ecx
movw %cx, 0x11acc4(%rip)     # 0x130d6e
movw $0x617, %ax             # imm = 0x617
jmp 0x16140
leal 0xc(%rcx), %esi
movw %si, 0x11acb1(%rip)     # 0x130d6e
cmpw $-0xc, %cx
jb 0x160d4
movw $0x0, 0x11aca2(%rip)    # 0x130d6e
movw $0x61b, %ax             # imm = 0x61B
xorl %esi, %esi
jmp 0x16102
movzwl %cx, %eax
leaq 0x5aadc2(%rip), %rcx    # 0x5c0ea0
movswl 0xc2e(%rcx), %ecx
leal 0x3(%rcx), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
movswl %dx, %edi
sarl $0x2, %edi
addl %ecx, %eax
addl $0xffff000c, %eax       # imm = 0xFFFF000C
cltd
idivl %edi
addl $0x617, %eax            # imm = 0x617
movw %ax, 0x11ae91(%rip)     # 0x130f9a
movl %esi, %ecx
leaq 0x5a2d5a(%rip), %rax    # 0x5b8e6c
movl (%rax), %eax
decl %eax
leaq 0x5aad83(%rip), %rdx    # 0x5c0ea0
movzwl 0xc2e(%rdx), %edx
movzwl %cx, %ecx
addl %edx, %ecx
movl %eax, %edi
subl %ecx, %edi
jmp 0x1615b
movl %esi, %eax
subl %edx, %eax
cwtd
shrl $0x2, %edi
idivw %di
addl $0x617, %eax            # imm = 0x617
movw %ax, 0x11ae53(%rip)     # 0x130f9a
leaq 0x5a2d1e(%rip), %rax    # 0x5b8e6c
movl (%rax), %eax
decl %eax
movzwl %cx, %ecx
addl %ecx, %esi
movl %eax, %edi
subl %esi, %edi
shll $0x10, %edi
leaq 0x5a2d0b(%rip), %rcx    # 0x5b8e70
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 0x4dcbd
addq $0x30, %rsp
cmpw $0x61b, 0x11adfd(%rip)  # imm = 0x61B
sete %cl
movl 0x11934e(%rip), %eax    # 0x12f4f4
testl %eax, %eax
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x16249
movl 0x119348(%rip), %edx    # 0x12f504
movl 0x11933e(%rip), %ecx    # 0x12f500
movl 0x119333(%rip), %r8d    # 0x12f4fc
leaq 0x11aca0(%rip), %rbx    # 0x130e70
leaq 0x79779(%rip), %rsi     # 0x8f950
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8f20
leaq 0x5a2c84(%rip), %r14    # 0x5b8e6c
movl (%r14), %edi
addl $-0x4a, %edi
movl $0x8, %esi
movq %rbx, %rdx
movl $0x15c, %ecx            # imm = 0x15C
movl $0xff, %r8d
callq 0xa15f
movswq (%r15), %rax
leaq 0x11746f(%rip), %rcx    # 0x12d680
movl (%rcx,%rax,4), %edx
leaq 0x79744(%rip), %rsi     # 0x8f95f
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 0xa15f
movl 0x1192ab(%rip), %eax    # 0x12f4f4
testl %eax, %eax
jne 0x16256
movswl (%r15), %edi
callq 0x155cd
leaq 0xbb803(%rip), %rax     # 0xd1a60
cmpl $0x0, 0x1c(%rax)
je 0x1629b
leaq 0xcf938(%rip), %rax     # 0xe5ba2
movswl (%rax), %eax
leaq 0x5a2bf8(%rip), %rcx    # 0x5b8e6c
movl (%rcx), %edi
cmpl %eax, %edi
jge 0x1629b
sarl %edi
addl $-0x10, %edi
leaq 0x796c5(%rip), %rdx     # 0x8f94b
movl $0x4, %esi
movl $0x15d, %ecx            # imm = 0x15D
movl $0xff, %r8d
callq 0xa15f
cmpb $0x0, 0x11abc6(%rip)    # 0x130e68
movzwl 0x11aac3(%rip), %edi    # 0x130d6c
je 0x162bc
testw %di, %di
js 0x16310
movzwl 0x11acdf(%rip), %eax    # 0x130f96
jmp 0x16371
movl %edi, %eax
negw %ax
cmovsw %di, %ax
movzwl %ax, %eax
leaq 0x5aabd1(%rip), %rcx    # 0x5c0ea0
movswl 0xc38(%rcx), %ecx
cmpl %ecx, %eax
jge 0x1669c
addl $-0xc, %edi
movw %di, 0x11aa84(%rip)     # 0x130d6c
movl %edi, %edx
negw %dx
cmovsw %di, %dx
movzwl %dx, %eax
cmpl %ecx, %eax
jbe 0x1662e
negl %ecx
movw %cx, 0x11aa67(%rip)     # 0x130d6c
movw $0x61c, %ax             # imm = 0x61C
movl %ecx, %edi
jmp 0x1663f
leal 0xc(%rdi), %ecx
movw %cx, 0x11aa52(%rip)     # 0x130d6c
cmpw $-0xc, %di
jb 0x1633a
movw $0x0, 0x11aa43(%rip)    # 0x130d6c
movw $0x620, 0x11ac64(%rip)  # imm = 0x620
movw $0x620, %ax             # imm = 0x620
xorl %edi, %edi
jmp 0x16371
movzwl %di, %eax
leaq 0x5aab5c(%rip), %rdx    # 0x5c0ea0
movswl 0xc38(%rdx), %edx
leal 0x3(%rdx), %esi
testl %edx, %edx
cmovnsl %edx, %esi
movswl %si, %esi
sarl $0x2, %esi
addl %edx, %eax
addl $0xffff000c, %eax       # imm = 0xFFFF000C
cltd
idivl %esi
addl $0x61c, %eax            # imm = 0x61C
movw %ax, 0x11ac27(%rip)     # 0x130f96
movl %ecx, %edi
shll $0x10, %edi
leaq 0x5a2af5(%rip), %r14    # 0x5b8e70
movl (%r14), %r10d
movswq %ax, %rax
leaq 0x59c2d7(%rip), %r12    # 0x5b2660
movzwl (%r12,%rax,2), %ecx
movl %r10d, %esi
subl %ecx, %esi
shll $0x10, %esi
leaq 0x5a2acf(%rip), %r15    # 0x5b8e6c
movl (%r15), %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 0x4dcbd
addq $0x30, %rsp
cmpw $0x620, 0x11abc5(%rip)  # imm = 0x620
jne 0x1669c
leaq 0xce080(%rip), %rax     # 0xe445e
movswq (%rax), %rax
leaq 0xce1a7(%rip), %rsi     # 0xe4590
movl (%rsi,%rax,4), %ecx
cmpl $0x64, %ecx
movq %r14, %rdx
jl 0x164ae
movl %ecx, %eax
imulq $0x51eb851f, %rax, %rcx # imm = 0x51EB851F
shrq $0x25, %rcx
movl $0x22, %r14d
xorl %ebp, %ebp
xorl %ebx, %ebx
movzwl 0x11a956(%rip), %edi    # 0x130d6c
addl %r14d, %edi
shll $0x10, %edi
movl (%rdx), %eax
movswq 0x11ab70(%rip), %rdx    # 0x130f96
movzwl (%r12,%rdx,2), %edx
movq %r12, %r13
movq %rsi, %r12
movl %eax, %esi
subl %edx, %esi
shll $0x10, %esi
addl $0x70000, %esi          # imm = 0x70000
addb %bpl, %cl
movl (%r15), %r10d
decl %r10d
decl %eax
movsbl %cl, %r9d
movl $0x10000, %edx          # imm = 0x10000
xorl %ecx, %ecx
movl $0x622, %r8d            # imm = 0x622
pushq %rax
pushq %r10
xorl %eax, %eax
pushq %rax
pushq %rax
pushq $0x18
pushq %rax
callq 0x4dcbd
movq %r12, %rsi
movq %r13, %r12
addq $0x30, %rsp
incl %ebx
leaq 0xcdfe2(%rip), %rax     # 0xe445e
movswq (%rax), %rax
movslq (%rsi,%rax,4), %rcx
imulq $0x51eb851f, %rcx, %rcx # imm = 0x51EB851F
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rcx
addl %edx, %ecx
leaq 0x5a29d1(%rip), %rdx    # 0x5b8e70
decb %bpl
addl $0x5, %r14d
cmpl %ecx, %ebx
jl 0x1640f
leaq 0xcdedb(%rip), %r13     # 0xe4390
movl (%r13,%rax,4), %ecx
cmpl $0x64, %ecx
movq %r15, %r8
jl 0x16577
movl %ecx, %eax
imulq $0x51eb851f, %rax, %rcx # imm = 0x51EB851F
shrq $0x25, %rcx
movl $0x22, %r14d
xorl %ebp, %ebp
xorl %ebx, %ebx
movzwl 0x11a888(%rip), %edi    # 0x130d6c
addl %r14d, %edi
shll $0x10, %edi
movl (%rdx), %eax
movswq 0x11aaa2(%rip), %rdx    # 0x130f96
movzwl (%r12,%rdx,2), %edx
movl %eax, %esi
subl %edx, %esi
shll $0x10, %esi
addl $0xd0000, %esi          # imm = 0xD0000
addb %bpl, %cl
movl (%r8), %r10d
decl %r10d
decl %eax
movsbl %cl, %r9d
movl $0x10000, %edx          # imm = 0x10000
xorl %ecx, %ecx
movq %r8, %r15
movl $0x624, %r8d            # imm = 0x624
pushq %rax
pushq %r10
xorl %eax, %eax
pushq %rax
pushq %rax
pushq $0x18
pushq %rax
callq 0x4dcbd
movq %r15, %r8
addq $0x30, %rsp
incl %ebx
leaq 0xcdf1a(%rip), %rax     # 0xe445e
movswq (%rax), %rax
movslq (%r13,%rax,4), %rcx
imulq $0x51eb851f, %rcx, %rcx # imm = 0x51EB851F
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rcx
addl %edx, %ecx
leaq 0x5a2908(%rip), %rdx    # 0x5b8e70
decb %bpl
addl $0x5, %r14d
cmpl %ecx, %ebx
jl 0x164dd
movq %rdx, %r15
leaq 0x1146df(%rip), %rcx    # 0x12ac60
movl (%rcx), %ecx
movl $0xa, %ebp
cmpq $0x7, %rcx
movq %r8, %r13
ja 0x165c6
leaq 0xb9d28(%rip), %rdx     # 0xd02c0
movq (%rdx,%rcx,8), %rcx
movzwl (%rcx,%rax,2), %eax
movl $0x9, %ebp
cmpw $0x64, %ax
jg 0x165c6
cmpw $0xa, %ax
jl 0x1669c
cwtl
imull $0x6667, %eax, %ebp     # imm = 0x6667
movl %ebp, %eax
shrl $0x1f, %eax
sarl $0x12, %ebp
addl %eax, %ebp
movl $0x22, %ebx
xorl %r14d, %r14d
movzwl 0x11a797(%rip), %edi    # 0x130d6c
addl %ebx, %edi
shll $0x10, %edi
movl (%r15), %eax
movswq 0x11a9b1(%rip), %rcx    # 0x130f96
movzwl (%r12,%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 %bpl, %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 0x4dcbd
addq $0x30, %rsp
addl $0x5, %ebx
decl %ebp
jne 0x165ce
jmp 0x1669c
movl %ecx, %eax
subl %edx, %eax
cwtd
shrl $0x2, %ecx
idivw %cx
addl $0x61c, %eax            # imm = 0x61C
movw %ax, 0x11a950(%rip)     # 0x130f96
shll $0x10, %edi
leaq 0x5a2820(%rip), %rcx    # 0x5b8e70
movl (%rcx), %r10d
movswq %ax, %rax
leaq 0x59c002(%rip), %rcx    # 0x5b2660
movzwl (%rcx,%rax,2), %ecx
movl %r10d, %esi
subl %ecx, %esi
shll $0x10, %esi
leaq 0x5a27fb(%rip), %rcx    # 0x5b8e6c
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 0x4dcbd
addq $0x30, %rsp
leaq 0xcddbb(%rip), %r14     # 0xe445e
cmpl $0x0, 0x118e4a(%rip)    # 0x12f4f4
jne 0x166be
leaq 0xbb2c5(%rip), %rax     # 0xd1978
cmpb $0x0, 0x4(%rax)
je 0x166be
callq 0x15d87
leaq 0xcdd8b(%rip), %r15     # 0xe4450
cmpb $0x0, (%r15)
je 0x167ec
leaq 0xbb28c(%rip), %rax     # 0xd1962
movswl (%rax), %edx
leaq 0xcdf10(%rip), %rbx     # 0xe45f0
leaq 0x79328(%rip), %rsi     # 0x8fa0f
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8f20
leaq 0x5a2774(%rip), %rax    # 0x5b8e6c
movl (%rax), %edi
sarl %edi
addl $-0x60, %edi
leaq 0x5a275e(%rip), %rax    # 0x5b8e64
movl (%rax), %esi
addl $-0xa, %esi
movq %rbx, %rdx
movl $0x15d, %ecx            # imm = 0x15D
movl $0xff, %r8d
callq 0xa15f
movl 0x118dd0(%rip), %eax    # 0x12f4f4
leaq 0xbb335(%rip), %rcx     # 0xd1a60
movl 0x20(%rcx), %ecx
orl %eax, %ecx
jne 0x167d2
movswl 0x11a62f(%rip), %eax    # 0x130d6c
leaq 0x5aa75c(%rip), %rcx    # 0x5c0ea0
movswl 0xc38(%rcx), %ecx
addl %eax, %ecx
jne 0x167db
leaq 0xcf448(%rip), %rax     # 0xe5ba2
movswl (%rax), %eax
cmpl $0x8d, %eax
jl 0x167db
cmpb $0x0, (%r15)
jne 0x167db
movswq (%r14), %rax
leaq 0xcde1b(%rip), %rcx     # 0xe4590
movl (%rcx,%rax,4), %eax
movl $0x3e8, %edx            # imm = 0x3E8
cmpl %edx, %eax
cmovbl %eax, %edx
xorl %ecx, %ecx
testl %eax, %eax
cmovsl %ecx, %edx
leaq 0x11a6e0(%rip), %rbx    # 0x130e70
leaq 0x79290(%rip), %rsi     # 0x8fa27
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8f20
leaq 0x56c448(%rip), %rax    # 0x582bf0
movl (%rax), %edi
addl $0x6, %edi
leaq 0x5a26b0(%rip), %rax    # 0x5b8e64
movl (%rax), %esi
addl $-0xa, %esi
movq %rbx, %rdx
movl $0x15d, %ecx            # imm = 0x15D
movl $0xff, %r8d
callq 0xa15f
movl 0x118d22(%rip), %eax    # 0x12f4f4
testl %eax, %eax
je 0x167db
callq 0x169af
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x118d01(%rip)    # 0x12f4f4
jne 0x1671e
cmpl $0x0, 0x118d08(%rip)    # 0x12f508
je 0x1671e
movl 0x11a55c(%rip), %edi    # 0x130d68
leaq 0x56c3dd(%rip), %rax    # 0x582bf0
cmpl (%rax), %edi
jle 0x1671e
leaq 0x5a2642(%rip), %rax    # 0x5b8e64
movl (%rax), %esi
addl $-0x20, %esi
leaq 0x11a512(%rip), %rdx    # 0x130d40
jmp 0x1670e