// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekgame.c
// Function: drawscreen
void
drawscreen(short snum, int dasmoothratio)
{
     int      i, j, charsperline, tempint;
     int      x1, y1, x2, y2, ox1, oy1, ox2, oy2;
     int      cposx, cposy, cposz, choriz, czoom;
     short     cang;

     smoothratio = max(min(dasmoothratio,65536),0);

     cposx = oposx[snum]+mulscale(posx[snum]-oposx[snum],smoothratio,16);
     cposy = oposy[snum]+mulscale(posy[snum]-oposy[snum],smoothratio,16);
     cposz = oposz[snum]+mulscale(posz[snum]-oposz[snum],smoothratio,16);
     if( frameinterpolate == 0 ) {
          cposx = posx[snum]; cposy = posy[snum]; cposz = posz[snum];
     }
     cposz+=headbob;
     choriz = ohoriz[snum]+mulscale(horiz[snum]-ohoriz[snum],smoothratio,16);
     czoom = ozoom[snum]+mulscale(zoom[snum]-ozoom[snum],smoothratio,16);
     cang = oang[snum]+mulscale(((ang[snum]+1024-oang[snum])&2047)-1024,smoothratio,16);

     if( dimensionmode[snum] != 2 ) {
          if( (numplayers > 1) && (option[4] == 0) ) {
               for( i=connecthead; i>=0; i=connectpoint2[i] ) {
                    frame2draw[i] = 1;
               }
               redrawbackfx();
               for( i=connecthead,j=0; i>=0; i=connectpoint2[i],j++ ) {
                    if( frame2draw[i] != 0 ) {
                         if( numplayers <= 4 ) {
                              switch( j ) {
                                   case 0: setview(0,0,(xdim>>1)-1,(ydim>>1)-1); break;
                                   case 1: setview((xdim>>1),0,xdim-1,(ydim>>1)-1); break;
                                   case 2: setview(0,(ydim>>1),(xdim>>1)-1,ydim-1); break;
                                   case 3: setview((xdim>>1),(ydim>>1),xdim-1,ydim-1); break;
                              }
                         }
                         else {
                              switch( j ) {
                                   case 0: setview(0,0,(xdim>>2)-1,(ydim>>2)-1); break;
                                   case 1: setview(xdim>>2,0,(xdim>>1)-1,(ydim>>2)-1); break;
                                   case 2: setview(xdim>>1,0,xdim-(xdim>>2)-1,(ydim>>2)-1); break;
                                   case 3: setview(xdim-(xdim>>2),0,xdim-1,(ydim>>2)-1); break;
                                   case 4: setview(0,ydim>>2,(xdim>>2)-1,(ydim>>1)-1); break;
                                   case 5: setview(xdim>>2,ydim>>2,(xdim>>1)-1,(ydim>>1)-1); break;
                                   case 6: setview(xdim>>1,ydim>>2,xdim-(xdim>>2)-1,(ydim>>1)-1); break;
                                   case 7: setview(xdim-(xdim>>2),ydim>>2,xdim-1,(ydim>>1)-1); break;
                                   case 8: setview(0,ydim>>1,(xdim>>2)-1,ydim-(ydim>>2)-1); break;
                                   case 9: setview(xdim>>2,ydim>>1,(xdim>>1)-1,ydim-(ydim>>2)-1); break;
                                   case 10: setview(xdim>>1,ydim>>1,xdim-(xdim>>2)-1,ydim-(ydim>>2)-1); break;
                                   case 11: setview(xdim-(xdim>>2),ydim>>1,xdim-1,ydim-(ydim>>2)-1); break;
                                   case 12: setview(0,ydim-(ydim>>2),(xdim>>2)-1,ydim-1); break;
                                   case 13: setview(xdim>>2,ydim-(ydim>>2),(xdim>>1)-1,ydim-1); break;
                                   case 14: setview(xdim>>1,ydim-(ydim>>2),xdim-(xdim>>2)-1,ydim-1); break;
                                   case 15: setview(xdim-(xdim>>2),ydim-(ydim>>2),xdim-1,ydim-1); break;
                              }
                         }
                         if( i == snum ) {
                              drawrooms(cposx,cposy,cposz,cang,choriz,cursectnum[i]);
                         }
                         else {
                              drawrooms(posx[i],posy[i],posz[i],ang[i],horiz[i],cursectnum[i]);
                         }
                         analyzesprites(posx[i],posy[i]);
                         drawmasks();
                         tekdrawgun((syncbits[i]>>13)&15,i);
                    }
               }
          }
          else {
               redrawbackfx();
               drawrooms(cposx,cposy,cposz,cang,choriz,cursectnum[snum]);
               analyzesprites(posx[snum],posy[snum]);
               drawmasks();
               tekdrawgun((syncbits[screenpeek]>>13)&15,screenpeek);
          }
     }

     // move back pivot point for map
     if( dimensionmode[snum] != 3 ) {
          cposx += (sintable[(cang+512)&2047]<<6) / czoom;
          cposy += (sintable[cang&2047]<<6) / czoom;
          if( dimensionmode[snum] == 2 ) {
               clearview(0L);  //Clear screen to specified color
               drawmapview(cposx,cposy,czoom,cang);
          }
          drawoverheadmap(cposx,cposy,czoom,cang);
     }

     if( typemode != 0 ) {
          charsperline = 40;
          for( i=0; i<=typemessageleng; i+=charsperline ) {
               for( j=0; j<charsperline; j++ ) {
                    tempbuf[j] = typemessage[i+j];
               }
               if( typemessageleng < i+charsperline ) {
                    tempbuf[(typemessageleng-i)] = '_';
                    tempbuf[(typemessageleng-i)+1] = 0;
               }
               else {
                    tempbuf[charsperline] = 0;
               }
          }
     }
     else {
          if( dimensionmode[myconnectindex] == 3 ) {
               tempint = screensize;
               if( ((locbits&32) > (screensizeflag&32)) && (screensize > 64) ) {
                    ox1 = (xdim>>1)-(screensize>>1);
                    ox2 = ox1+screensize-1;
                    oy1 = ((ydim-32)>>1)-(((screensize*(ydim-32))/xdim)>>1);
                    oy2 = oy1+((screensize*(ydim-32))/xdim)-1;
                    tekview(&ox1,&oy1, &ox2,&oy2);
                    screensize -= (screensize>>3);
                    if( tempint > xdim ) {
                         screensize = xdim;
                         permanentwritesprite((xdim-320)>>1,ydim-32,STATUSBAR,0,0,0,xdim-1,ydim-1,0);
                         i = ((xdim-320)>>1);
                         while( i >= 8 ) {
                              i -= 8, permanentwritesprite(i,ydim-32,STATUSBARFILL8,0,0,0,xdim-1,ydim-1,0);
                         }
                         if( i >= 4 ) {
                              i -= 4, permanentwritesprite(i,ydim-32,STATUSBARFILL4,0,0,0,xdim-1,ydim-1,0);
                         }
                         i = ((xdim-320)>>1)+320;
                         while( i <= xdim-8 ) {
                              permanentwritesprite(i,ydim-32,STATUSBARFILL8,0,0,0,xdim-1,ydim-1,0), i += 8;
                         }
                         if( i <= xdim-4 ) {
                              permanentwritesprite(i,ydim-32,STATUSBARFILL4,0,0,0,xdim-1,ydim-1,0), i += 4;
                         }
                    }
                    x1 = (xdim>>1)-(screensize>>1);
                    x2 = x1+screensize-1;
                    y1 = ((ydim-32)>>1)-(((screensize*(ydim-32))/xdim)>>1);
                    y2 = y1+((screensize*(ydim-32))/xdim)-1;
                    tekview(&x1,&y1,&x2,&y2);
                    setview(x1,y1>>detailmode,x2,y2>>detailmode);
                    permanentwritespritetile(0L,0L,BACKGROUND,0,ox1,oy1,x1-1,oy2,0);
                    permanentwritespritetile(0L,0L,BACKGROUND,0,x2+1,oy1,ox2,oy2,0);
                    permanentwritespritetile(0L,0L,BACKGROUND,0,x1,oy1,x2,y1-1,0);
                    permanentwritespritetile(0L,0L,BACKGROUND,0,x1,y2+1,x2,oy2,0);
               }
               if( ((locbits&16) > (screensizeflag&16)) && (screensize <= xdim) ) {
                    screensize += (screensize>>3);
                    if( (screensize > xdim) && (tempint == xdim) ) {
                         screensize = xdim+1;
                         x1 = 0; y1 = 0;
                         x2 = xdim-1; y2 = ydim-1;
                    }
                    else {
                         if (screensize > xdim) screensize = xdim;
                         x1 = (xdim>>1)-(screensize>>1);
                         x2 = x1+screensize-1;
                         y1 = ((ydim-32)>>1)-(((screensize*(ydim-32))/xdim)>>1);
                         y2 = y1+((screensize*(ydim-32))/xdim)-1;
                    }
                    tekview(&x1,&y1,&x2,&y2);
                    setview(x1,y1>>detailmode,x2,y2>>detailmode);
               }
               screensizeflag = locbits;
          }
     }

     if( getmessageleng > 0 ) {
          charsperline = 40;
          for( i=0; i<=getmessageleng; i+=charsperline ) {
               for( j=0; j<charsperline; j++ ) {
                    tempbuf[j] = getmessage[i+j];
               }
               if( getmessageleng < i+charsperline ) {
                    tempbuf[(getmessageleng-i)] = 0;
               }
               else {
                    tempbuf[charsperline] = 0;
               }
               printext256(0L,((i/charsperline)<<3)+(200-32-8)-(((getmessageleng-1)/charsperline)<<3),151,-1,(char *)tempbuf,0);
          }
          if( totalclock > getmessagetimeoff ) {
               getmessageleng = 0;
          }
     }

     // you are looking thru an opponent plaeyer's eyes
     if( (numplayers >= 2) && (screenpeek != myconnectindex) ) {
          strcpy((char *)tempbuf,"Other");
     }

    #ifdef OUTOFSYNCMESSAGE
     if( syncstat != 0 ) {
          printext256(68L,84L,31,0,"OUT OF SYNC!",0);
     }
     if( syncstate != 0 ) {
          printext256(68L,92L,31,0,"Missed Network packet!",0);
     }
    #endif

     tekscreenfx();

    #ifdef  NETWORKDIAGNOSTICS
     if( (option[4] > 0) ) {
          for( i=connecthead ; i >= 0 ; i=connectpoint2[i] ) {
               sprintf(tektempbuf,"%2d %5d %5d %5d %5d %3d %4d", i,posx[i],posy[i],posz[i],ang[i],horiz[i],health[i]);
               printext(2,i*8+2,tektempbuf,ALPHABET,255);
          }
          if( myconnectindex == connecthead ) {
               sprintf(tektempbuf,"%2d %s",myconnectindex,"M");
          }
          else {
               sprintf(tektempbuf,"%2d %s",myconnectindex,"S");
          }
          printext(windowx2-48,windowy2-64,tektempbuf,ALPHABET2,255);
     }
    #endif

     nextpage();
     if( dofadein != 0 ) {
          fadein(0,255,dofadein);
     }

    #ifdef OOGIE
     // F5 key
     if( keystatus[0x3f] > 0 ) {
          keystatus[0x3f] = 0;
          detailmode ^= 1;
          if( detailmode == 0 ) {
               setview(windowx1,windowy1<<1,windowx2,(windowy2<<1)+1);
               outp(0x3d4,0x9); outp(0x3d5,(inp(0x3d5)&~31)|1);
          }
          else {
               setview(windowx1,windowy1>>detailmode,windowx2,windowy2>>detailmode);
               setaspect(yxaspect>>1);
               outp(0x3d4,0x9); outp(0x3d5,(inp(0x3d5)&~31)|3);
          }
     }
    #endif

     // F12 key
     if( keystatus[0x58] > 0 ) {
          keystatus[0x58] = 0;
          screencapture("captxxxx.pcx",keystatus[0x2a]|keystatus[0x36]);
     }

    #ifdef STEREOMODE_ADJUSTMENT_ACTIVE
     if( stereofps != 0 ) {
          if( (keystatus[0x2a]|keystatus[0x36]) > 0 ) {
               if (keystatus[0x1a] > 0) stereopixelwidth--;   //Shift [
               if (keystatus[0x1b] > 0) stereopixelwidth++;   //Shift ]
          }
          else {
               if (keystatus[0x1a] > 0) stereowidth -= 512;   //[
               if (keystatus[0x1b] > 0) stereowidth += 512;   //]
          }
     }
    #endif

    #ifdef FAKEMULTIPLAYER_ACTIVE
     if( option[4] == 0 ) {
          if( keystatus[0xd2] > 0 ) {
               keystatus[0xd2] = 0;
               if( numplayers < MAXPLAYERS ) {
                    connectpoint2[numplayers-1] = numplayers;
                    connectpoint2[numplayers] = -1;
                    initplayersprite(numplayers);
                    clearallviews(0L);
                    numplayers++;
               }
          }
          if( keystatus[0xd3] > 0 ) {
               keystatus[0xd3] = 0;
               if( numplayers > 1 ) {
                    numplayers--;
                    connectpoint2[numplayers-1] = -1;
                    deletesprite(playersprite[numplayers]);
                    playersprite[numplayers] = -1;
                    if( myconnectindex >= numplayers ) {
                         myconnectindex = 0;
                    }
                    if( screenpeek >= numplayers ) {
                         screenpeek = 0;
                    }
                    if( numplayers < 2 ) {
                         setup3dscreen();
                    }
                    else {
                         clearallviews(0L);
                    }
               }
          }
          // scroll lock
          if( keystatus[0x46] > 0 ) {
               keystatus[0x46] = 0;
               myconnectindex = connectpoint2[myconnectindex];
               if( myconnectindex < 0 ) {
                    myconnectindex = connecthead;
               }
               screenpeek = myconnectindex;
          }
     }
    #endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %edi, %ebp
movl $0x10000, %eax          # imm = 0x10000
cmpl %eax, %esi
cmovll %esi, %eax
xorl %r9d, %r9d
testl %eax, %eax
cmovgl %eax, %r9d
movl %r9d, 0xd113c(%rip)     # 0xdb980
movslq %edi, %r13
leaq 0xd1142(%rip), %rax     # 0xdb990
movl (%rax,%r13,4), %ecx
leaq 0xcfc77(%rip), %rbx     # 0xda4d0
movl (%rbx,%r13,4), %eax
movl %eax, %edx
subl %ecx, %edx
movslq %edx, %r8
imulq %r9, %r8
shrq $0x10, %r8
addl %ecx, %r8d
leaq 0xd115a(%rip), %rcx     # 0xdb9d0
movl (%rcx,%r13,4), %ecx
leaq 0xcfc8f(%rip), %r14     # 0xda510
movl (%r14,%r13,4), %edx
movl %edx, %esi
subl %ecx, %esi
movslq %esi, %r10
imulq %r9, %r10
shrq $0x10, %r10
addl %ecx, %r10d
leaq 0xd1172(%rip), %rcx     # 0xdba10
movl (%rcx,%r13,4), %ecx
leaq 0xcfca7(%rip), %rsi     # 0xda550
movl (%rsi,%r13,4), %esi
movl %esi, %edi
subl %ecx, %edi
movslq %edi, %r12
imulq %r9, %r12
shrq $0x10, %r12
addl %ecx, %r12d
cmpb $0x0, 0xbd23a(%rip)     # 0xc7b00
cmovel %eax, %r8d
movq %r8, 0x38(%rsp)
cmovel %edx, %r10d
movq %r10, 0x30(%rsp)
cmovel %esi, %r12d
leaq 0xd11ad(%rip), %rax     # 0xdba90
movslq (%rax,%r13,4), %rax
movq %rax, 0x60(%rsp)
leaq 0xd0fdd(%rip), %rax     # 0xdb8d0
movslq (%rax,%r13,4), %rax
movq %rax, 0x68(%rsp)
leaq 0xd11cd(%rip), %rax     # 0xdbad0
movzwl (%rax,%r13,2), %eax
leaq 0xcfba1(%rip), %rcx     # 0xda4b0
movzwl (%rcx,%r13,2), %r15d
xorl $0x400, %r15d           # imm = 0x400
subl %eax, %r15d
andl $0x7ff, %r15d           # imm = 0x7FF
addl $0xfffffc00, %r15d      # imm = 0xFFFFFC00
imull %r9d, %r15d
shrl $0x10, %r15d
addl %eax, %r15d
leaq 0xd0f82(%rip), %rax     # 0xdb8c0
movb $0x2, %cl
cmpb $0x2, (%r13,%rax)
movswl %r15w, %eax
movl %eax, 0x18(%rsp)
je 0xaa40
leaq 0x31a205(%rip), %rax    # 0x324b60
leaq 0xd10ee(%rip), %rcx     # 0xdba50
movslq (%rcx,%r13,4), %rcx
leaq 0xd0ef3(%rip), %rdx     # 0xdb860
movslq (%rdx,%r13,4), %rdx
subq %rcx, %rdx
imulq %r9, %rdx
shrq $0x10, %rdx
addl %ecx, %edx
movq %rdx, 0x50(%rsp)
leaq 0x7911a2(%rip), %rcx    # 0x79bb2c
addl (%rax), %r12d
cmpl $0x2, (%rcx)
movq %r9, 0x58(%rsp)
jl 0xa9cb
cmpb $0x0, 0xbcfde(%rip)     # 0xc797c
jne 0xa9cb
leaq 0x791189(%rip), %rax    # 0x79bb30
leaq 0xd1142(%rip), %rcx     # 0xdbaf0
movslq (%rax), %rax
testq %rax, %rax
js 0xac87
movb $0x1, (%rax,%rcx)
shlq $0x2, %rax
addq 0xbc617(%rip), %rax     # 0xc6fe0
jmp 0xa9ae
callq 0x13c82
leaq 0xd0d49(%rip), %rax     # 0xdb720
movswl (%rax,%r13,2), %r9d
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl %r12d, %edx
movl 0x18(%rsp), %ecx
movq 0x50(%rsp), %r8
callq 0x33b95
movl (%rbx,%r13,4), %edi
movl (%r14,%r13,4), %esi
callq 0x1bbe9
callq 0x3709d
movswl 0xcfa4e(%rip), %eax     # 0xda45e
movslq %eax, %rsi
leaq 0xcfa76(%rip), %rax     # 0xda490
movzwl (%rax,%rsi,2), %edi
shrl $0xd, %edi
callq 0x10742
leaq 0xd0e93(%rip), %rax     # 0xdb8c0
movb (%r13,%rax), %cl
cmpb $0x3, %cl
movq 0x58(%rsp), %r9
je 0xaac2
movq 0x68(%rsp), %r12
movq 0x60(%rsp), %rax
subq %rax, %r12
imulq %r9, %r12
shrq $0x10, %r12
addl %eax, %r12d
movzwl %r15w, %esi
leal 0x200(%rsi), %eax
movl $0x7ff, %edi            # imm = 0x7FF
andl %edi, %eax
leaq 0x56b160(%rip), %r8     # 0x575bd0
movswl (%r8,%rax,2), %eax
shll $0x6, %eax
cltd
idivl %r12d
movl %eax, %ebp
addl 0x38(%rsp), %ebp
andl %edi, %esi
movswl (%r8,%rsi,2), %eax
shll $0x6, %eax
cltd
idivl %r12d
movl %eax, %ebx
addl 0x30(%rsp), %ebx
cmpb $0x2, %cl
jne 0xaab2
xorl %edi, %edi
callq 0x4974f
movl %ebp, %edi
movl %ebx, %esi
movl %r12d, %edx
movl 0x18(%rsp), %ecx
callq 0x3ba7f
movl %ebp, %edi
movl %ebx, %esi
movl %r12d, %edx
movl 0x18(%rsp), %ecx
callq 0x12404
cmpl $0x0, 0xcf9a3(%rip)     # 0xda46c
je 0xab2d
movslq 0xcf996(%rip), %rax     # 0xda468
xorl %ecx, %ecx
leaq 0xcfb3d(%rip), %rdx     # 0xda618
leaq 0xcfb0e(%rip), %rsi     # 0xda5f0
leaq 0xd1017(%rip), %rdi     # 0xdbb00
movq %rax, %r8
subq %rcx, %r8
jl 0xb37f
xorl %r9d, %r9d
cmpq $0x28, %r9
je 0xab0f
leaq (%rcx,%r9), %r10
movb (%rdi,%r10), %r10b
movb %r10b, (%r9,%rsi)
incq %r9
jmp 0xaaf8
addq $0x28, %rcx
movq %rdx, %r9
cmpq %rax, %rcx
jle 0xab27
leaq (%r8,%rsi), %r9
incq %r9
movb $0x5f, -0x1(%r9)
movb $0x0, (%r9)
jmp 0xaae9
leaq 0x790ff0(%rip), %rax    # 0x79bb24
movslq (%rax), %rax
leaq 0xd0d82(%rip), %rcx     # 0xdb8c0
cmpb $0x3, (%rax,%rcx)
jne 0xb37f
movzwl 0xd1053(%rip), %eax     # 0xdbba2
movswl %ax, %r13d
movzwl 0xd104a(%rip), %eax     # 0xdbba4
movl %eax, %edx
andl $0x20, %edx
movzwl 0xcf8fe(%rip), %ecx     # 0xda464
movl %ecx, %esi
andl $0x20, %esi
cmpw %si, %dx
seta %dl
cmpw $0x41, %r13w
setge %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0xb26b
leaq 0x5a42de(%rip), %r14    # 0x5aee6c
movl (%r14), %ecx
movl %ecx, %eax
sarl %eax
movl %r13d, %edx
shrl %edx
subl %edx, %eax
leaq 0x48(%rsp), %rdi
movl %eax, (%rdi)
addl %r13d, %eax
decl %eax
leaq 0x44(%rsp), %r8
movl %eax, (%r8)
leaq 0x5a42b9(%rip), %r15    # 0x5aee70
movl (%r15), %eax
addl $-0x20, %eax
movl %eax, %r9d
sarl %r9d
imull %r13d, %eax
cltd
idivl %ecx
movl %eax, %ecx
sarl %ecx
subl %ecx, %r9d
leaq 0x20(%rsp), %rsi
movl %r9d, (%rsi)
addl %r9d, %eax
decl %eax
leaq 0x1c(%rsp), %rcx
movl %eax, (%rcx)
movq %r8, %rdx
callq 0x19eda
movswl 0xd0fae(%rip), %eax     # 0xdbba2
movl %eax, %ecx
sarl $0x3, %ecx
subl %ecx, %eax
movw %ax, 0xd0fa0(%rip)      # 0xdbba2
movl (%r14), %ecx
cmpl %r13d, %ecx
jge 0xb12a
movw %cx, 0xd0f8d(%rip)      # 0xdbba2
movl $0xfffffec0, %ebx       # imm = 0xFFFFFEC0
leal (%rcx,%rbx), %edi
sarl %edi
movl (%r15), %eax
leal -0x20(%rax), %esi
decl %ecx
decl %eax
andl $0x0, 0x10(%rsp)
movl %eax, 0x8(%rsp)
movl %ecx, (%rsp)
movl $0x19e, %edx            # imm = 0x19E
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x935c
addl (%r14), %ebx
sarl %ebx
cmpl $0x8, %ebx
jl 0xb077
addl $-0x8, %ebx
movl (%r15), %eax
leal -0x20(%rax), %esi
movl (%r14), %ecx
decl %ecx
decl %eax
andl $0x0, 0x10(%rsp)
movl %eax, 0x8(%rsp)
movl %ecx, (%rsp)
movl %ebx, %edi
movl $0x1b7, %edx            # imm = 0x1B7
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x935c
jmp 0xac4c
movq %r12, 0x70(%rsp)
callq 0x13c82
movswl %bp, %eax
movl %eax, 0x40(%rsp)
leaq 0x790e91(%rip), %rbp    # 0x79bb30
xorl %ebx, %ebx
movslq (%rbp), %rbp
testq %rbp, %rbp
js 0xaa26
leaq 0xd0e3b(%rip), %rax     # 0xdbaf0
cmpb $0x0, (%rbp,%rax)
je 0xb011
leaq 0x790e65(%rip), %rax    # 0x79bb2c
cmpl $0x4, (%rax)
movl %ebx, %eax
jg 0xad01
cmpl $0x3, %ebx
ja 0xaf6b
leaq 0x76122(%rip), %rcx     # 0x80e00
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x5a417e(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
sarl %edx
decl %edx
leaq 0x5a4175(%rip), %rax    # 0x5aee70
movl (%rax), %ecx
sarl %ecx
jmp 0xad34
cmpl $0xf, %ebx
ja 0xaf6b
leaq 0x760af(%rip), %rcx     # 0x80dc0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x5a414b(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
sarl $0x2, %edx
decl %edx
leaq 0x5a4141(%rip), %rax    # 0x5aee70
movl (%rax), %ecx
sarl $0x2, %ecx
decl %ecx
xorl %edi, %edi
jmp 0xaef4
leaq 0x5a412c(%rip), %rax    # 0x5aee70
movl (%rax), %ecx
movl %ecx, %esi
sarl %esi
leaq 0x5a411b(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
sarl %edx
jmp 0xae29
leaq 0x5a410b(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
movl %edx, %edi
sarl %edi
leaq 0x5a4102(%rip), %rax    # 0x5aee70
movl (%rax), %ecx
movl %ecx, %esi
sarl %esi
jmp 0xaf3c
leaq 0x5a40ec(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
movl %edx, %edi
sarl %edi
decl %edx
leaq 0x5a40e1(%rip), %rax    # 0x5aee70
movl (%rax), %ecx
sarl %ecx
jmp 0xaef2
leaq 0x5a40cd(%rip), %rax    # 0x5aee6c
movl (%rax), %edi
movl %edi, %edx
sarl $0x2, %edx
notl %edx
addl %edi, %edx
sarl %edi
leaq 0x5a40bd(%rip), %rax    # 0x5aee70
movl (%rax), %ecx
movl %ecx, %eax
sarl $0x2, %eax
movl %ecx, %esi
subl %eax, %esi
jmp 0xaf64
leaq 0x5a40a2(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
movl %edx, %eax
sarl $0x2, %eax
movl %edx, %edi
subl %eax, %edi
leaq 0x5a4094(%rip), %rax    # 0x5aee70
movl (%rax), %esi
movl %esi, %ecx
sarl $0x2, %ecx
notl %ecx
addl %esi, %ecx
sarl %esi
jmp 0xae58
leaq 0x5a407e(%rip), %rax    # 0x5aee70
movl (%rax), %ecx
movl %ecx, %esi
sarl $0x2, %esi
leaq 0x5a406c(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
sarl $0x2, %edx
decl %edx
sarl %ecx
jmp 0xae2b
leaq 0x5a405e(%rip), %rax    # 0x5aee70
movl (%rax), %ecx
movl %ecx, %eax
sarl $0x2, %eax
movl %ecx, %esi
subl %eax, %esi
leaq 0x5a4048(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
sarl $0x2, %edx
decl %edx
decl %ecx
xorl %edi, %edi
jmp 0xaf66
leaq 0x5a4031(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
movl %edx, %edi
sarl $0x2, %edi
leaq 0x5a4027(%rip), %rax    # 0x5aee70
movl (%rax), %esi
movl %esi, %ecx
sarl $0x2, %ecx
notl %ecx
addl %esi, %ecx
sarl %esi
sarl %edx
decl %edx
jmp 0xaf66
leaq 0x5a4006(%rip), %rax    # 0x5aee6c
movl (%rax), %edi
movl %edi, %edx
sarl $0x2, %edx
notl %edx
addl %edi, %edx
sarl %edi
jmp 0xaee6
leaq 0x5a3ff0(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
movl %edx, %eax
sarl $0x2, %eax
movl %edx, %edi
subl %eax, %edi
leaq 0x5a3fe2(%rip), %rax    # 0x5aee70
movl (%rax), %ecx
movl %ecx, %eax
sarl $0x2, %eax
movl %ecx, %esi
subl %eax, %esi
jmp 0xaf3c
leaq 0x5a3fc7(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
movl %edx, %eax
sarl $0x2, %eax
movl %edx, %edi
subl %eax, %edi
jmp 0xaee4
leaq 0x5a3fb3(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
movl %edx, %eax
sarl $0x2, %eax
movl %edx, %edi
subl %eax, %edi
leaq 0x5a3fa5(%rip), %rax    # 0x5aee70
movl (%rax), %ecx
movl %ecx, %esi
sarl $0x2, %esi
jmp 0xaf16
leaq 0x5a3f91(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
movl %edx, %edi
sarl $0x2, %edi
sarl %edx
decl %edx
leaq 0x5a3f83(%rip), %rax    # 0x5aee70
movl (%rax), %ecx
sarl $0x2, %ecx
decl %ecx
xorl %esi, %esi
jmp 0xaf66
leaq 0x5a3f6d(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
movl %edx, %edi
sarl $0x2, %edi
leaq 0x5a3f63(%rip), %rax    # 0x5aee70
movl (%rax), %ecx
movl %ecx, %esi
sarl $0x2, %esi
sarl %edx
decl %edx
jmp 0xaf62
leaq 0x5a3f4b(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
movl %edx, %edi
sarl $0x2, %edi
leaq 0x5a3f41(%rip), %rax    # 0x5aee70
movl (%rax), %ecx
movl %ecx, %eax
sarl $0x2, %eax
movl %ecx, %esi
subl %eax, %esi
sarl %edx
decl %edx
jmp 0xaf64
leaq 0x5a3f25(%rip), %rax    # 0x5aee6c
movl (%rax), %edi
movl %edi, %edx
sarl $0x2, %edx
notl %edx
addl %edi, %edx
sarl %edi
leaq 0x5a3f15(%rip), %rax    # 0x5aee70
movl (%rax), %ecx
movl %ecx, %esi
sarl $0x2, %esi
sarl %ecx
decl %ecx
callq 0x41e1e
movq %r14, %r12
cmpl 0x40(%rsp), %ebp
jne 0xafa6
leaq 0xd07a5(%rip), %rax     # 0xdb720
movswl (%rax,%rbp,2), %r9d
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x70(%rsp), %rdx
movl 0x18(%rsp), %ecx
movq 0x50(%rsp), %r8
callq 0x33b95
leaq 0xcf52c(%rip), %r14     # 0xda4d0
jmp 0xafe6
leaq 0xcf523(%rip), %r14     # 0xda4d0
movl (%r14,%rbp,4), %edi
movl (%r12,%rbp,4), %esi
leaq 0xcf594(%rip), %rax     # 0xda550
movl (%rax,%rbp,4), %edx
leaq 0xcf4ea(%rip), %rax     # 0xda4b0
movswl (%rax,%rbp,2), %ecx
leaq 0xd088f(%rip), %rax     # 0xdb860
movl (%rax,%rbp,4), %r8d
leaq 0xd0744(%rip), %rax     # 0xdb720
movswl (%rax,%rbp,2), %r9d
callq 0x33b95
movl (%r14,%rbp,4), %edi
movl (%r12,%rbp,4), %esi
callq 0x1bbe9
callq 0x3709d
leaq 0xcf491(%rip), %rax     # 0xda490
movzwl (%rax,%rbp,2), %edi
shrl $0xd, %edi
movswl %bp, %esi
callq 0x10742
movq %r12, %r14
shlq $0x2, %rbp
addq 0xbbfc4(%rip), %rbp     # 0xc6fe0
incl %ebx
jmp 0xaca1
leaq 0x5a3e42(%rip), %rax    # 0x5aee6c
movl (%rax), %edi
movl %edi, %edx
sarl $0x2, %edx
notl %edx
addl %edi, %edx
sarl %edi
leaq 0x5a3e32(%rip), %rax    # 0x5aee70
movl (%rax), %esi
movl %esi, %ecx
sarl $0x2, %ecx
notl %ecx
addl %esi, %ecx
sarl %esi
jmp 0xaf66
leaq 0x5a3e19(%rip), %rax    # 0x5aee70
movl (%rax), %esi
movl %esi, %ecx
sarl $0x2, %ecx
notl %ecx
addl %esi, %ecx
sarl %esi
leaq 0x5a3e01(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
sarl $0x2, %edx
decl %edx
jmp 0xae2d
movl (%r14), %ecx
cmpl $0x4, %ebx
jl 0xb0af
addl $-0x4, %ebx
movl (%r15), %eax
leal -0x20(%rax), %esi
decl %ecx
decl %eax
andl $0x0, 0x10(%rsp)
movl %eax, 0x8(%rsp)
movl %ecx, (%rsp)
movl %ebx, %edi
movl $0x1b9, %edx            # imm = 0x1B9
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x935c
movl (%r14), %ecx
leal -0x140(%rcx), %ebx
sarl %ebx
addl $0x140, %ebx            # imm = 0x140
leal -0x8(%rcx), %eax
cmpl %eax, %ebx
jg 0xb0f6
movl (%r15), %eax
leal -0x20(%rax), %esi
decl %ecx
decl %eax
andl $0x0, 0x10(%rsp)
movl %eax, 0x8(%rsp)
movl %ecx, (%rsp)
movl %ebx, %edi
movl $0x1b7, %edx            # imm = 0x1B7
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x935c
addl $0x8, %ebx
movl (%r14), %ecx
jmp 0xb0bd
leal -0x4(%rcx), %eax
cmpl %eax, %ebx
jg 0xb12a
movl (%r15), %eax
leal -0x20(%rax), %esi
decl %ecx
decl %eax
andl $0x0, 0x10(%rsp)
movl %eax, 0x8(%rsp)
movl %ecx, (%rsp)
movl %ebx, %edi
movl $0x1b9, %edx            # imm = 0x1B9
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x935c
movl (%r14), %ecx
movl %ecx, %eax
sarl %eax
movswl 0xd0a6d(%rip), %edx     # 0xdbba2
movl %edx, %esi
sarl %esi
subl %esi, %eax
leaq 0x2c(%rsp), %rbx
movl %eax, (%rbx)
addl %edx, %eax
decl %eax
leaq 0x24(%rsp), %r14
movl %eax, (%r14)
movl (%r15), %eax
addl $-0x20, %eax
movl %eax, %esi
sarl %esi
imull %edx, %eax
cltd
idivl %ecx
movl %eax, %ecx
sarl %ecx
subl %ecx, %esi
leaq 0x28(%rsp), %r12
movl %esi, (%r12)
addl %esi, %eax
decl %eax
leaq 0x4c(%rsp), %r15
movl %eax, (%r15)
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x19eda
movl (%r12), %esi
movb 0xcf2be(%rip), %cl      # 0xda452
sarl %cl, %esi
movl (%rbx), %edi
movl (%r14), %edx
movl (%r15), %eax
sarl %cl, %eax
movl %eax, %ecx
callq 0x41e1e
movl 0x48(%rsp), %r8d
movl 0x20(%rsp), %r9d
movl (%rbx), %eax
decl %eax
movl 0x1c(%rsp), %ecx
andl $0x0, 0x10(%rsp)
movl %ecx, 0x8(%rsp)
movl %eax, (%rsp)
xorl %edi, %edi
xorl %esi, %esi
movl $0x196, %edx            # imm = 0x196
xorl %ecx, %ecx
callq 0x939f
movl (%r14), %r8d
incl %r8d
movl 0x20(%rsp), %r9d
movl 0x44(%rsp), %eax
movl 0x1c(%rsp), %ecx
andl $0x0, 0x10(%rsp)
movl %ecx, 0x8(%rsp)
movl %eax, (%rsp)
xorl %edi, %edi
xorl %esi, %esi
movl $0x196, %edx            # imm = 0x196
xorl %ecx, %ecx
callq 0x939f
movl (%rbx), %r8d
movl 0x20(%rsp), %r9d
movl (%r14), %eax
movl (%r12), %ecx
decl %ecx
andl $0x0, 0x10(%rsp)
movl %ecx, 0x8(%rsp)
movl %eax, (%rsp)
xorl %edi, %edi
xorl %esi, %esi
movl $0x196, %edx            # imm = 0x196
xorl %ecx, %ecx
callq 0x939f
movl (%rbx), %r8d
movl (%r15), %r9d
incl %r9d
movl (%r14), %eax
movl 0x1c(%rsp), %ecx
andl $0x0, 0x10(%rsp)
movl %ecx, 0x8(%rsp)
movl %eax, (%rsp)
xorl %edi, %edi
xorl %esi, %esi
movl $0x196, %edx            # imm = 0x196
xorl %ecx, %ecx
callq 0x939f
movzwl 0xd0940(%rip), %eax     # 0xdbba4
movzwl 0xcf1f9(%rip), %ecx     # 0xda464
movl %eax, %edx
andl $0x10, %edx
andl $0x10, %ecx
cmpw %cx, %dx
jbe 0xb378
movswl 0xd091f(%rip), %edx     # 0xdbba2
leaq 0x5a3be2(%rip), %rcx    # 0x5aee6c
movl (%rcx), %ecx
cmpl %edx, %ecx
jl 0xb378
movswl %dx, %eax
sarl $0x3, %eax
addl %edx, %eax
movw %ax, 0xd08ff(%rip)      # 0xdbba2
movswl %ax, %edx
cmpl %edx, %ecx
setl %sil
cmpl %r13d, %ecx
sete %dil
andb %sil, %dil
cmpb $0x1, %dil
jne 0xb2e4
leal 0x1(%r13), %eax
andl $0x0, 0x2c(%rsp)
movw %ax, 0xd08d6(%rip)      # 0xdbba2
andl $0x0, 0x28(%rsp)
decl %r13d
movl %r13d, 0x24(%rsp)
leaq 0x5a3b90(%rip), %rax    # 0x5aee70
movl (%rax), %esi
jmp 0xb32b
cmpl %edx, %ecx
jge 0xb2f3
movw %cx, 0xd08b3(%rip)      # 0xdbba2
movl %ecx, %edx
movl %ecx, %eax
movl %ecx, %esi
sarl %esi
cwtl
sarl %eax
subl %eax, %esi
movl %esi, 0x2c(%rsp)
leal (%rdx,%rsi), %eax
decl %eax
movl %eax, 0x24(%rsp)
leaq 0x5a3b60(%rip), %rax    # 0x5aee70
movl (%rax), %eax
addl $-0x20, %eax
movl %eax, %esi
sarl %esi
imull %edx, %eax
cltd
idivl %ecx
movl %eax, %ecx
sarl %ecx
subl %ecx, %esi
movl %esi, 0x28(%rsp)
addl %eax, %esi
decl %esi
leaq 0x4c(%rsp), %rbx
movl %esi, (%rbx)
leaq 0x2c(%rsp), %r14
leaq 0x28(%rsp), %r15
leaq 0x24(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x19eda
movl (%r15), %esi
movb 0xcf0f5(%rip), %cl      # 0xda452
sarl %cl, %esi
movl (%r14), %edi
movl (%r12), %edx
movl (%rbx), %eax
sarl %cl, %eax
movl %eax, %ecx
callq 0x41e1e
movzwl 0xd082c(%rip), %eax     # 0xdbba4
movw %ax, 0xcf0e5(%rip)      # 0xda464
movb 0xd0821(%rip), %cl      # 0xdbba6
testb %cl, %cl
jle 0xb433
xorl %eax, %eax
leaq 0xcf25a(%rip), %rbx     # 0xda5f0
pushq $0x28
popq %r14
pushq $-0x28
popq %r15
pushq $-0x1
popq %rbp
leaq 0xd0808(%rip), %r12     # 0xdbbb0
movsbq %cl, %rdx
cmpq %rdx, %rax
jg 0xb41b
movsbl %cl, %ecx
xorl %esi, %esi
cmpq $0x28, %rsi
je 0xb3cd
leaq (%rax,%rsi), %rdi
movb (%r12,%rdi), %dil
movb %dil, (%rsi,%rbx)
incq %rsi
jmp 0xb3b6
leaq 0x28(%rax), %r13
movl %ecx, %esi
subl %eax, %esi
cmpq %rdx, %r13
movslq %esi, %rdx
cmovleq %r14, %rdx
movb $0x0, (%rdx,%rbx)
xorl %edx, %edx
divq %r14
movq %rax, %rsi
decl %ecx
movl %ecx, %eax
cltd
idivl %r15d
addl %eax, %esi
leal 0xa0(,%rsi,8), %esi
xorl %edi, %edi
movl $0x97, %edx
movl %ebp, %ecx
movq %rbx, %r8
xorl %r9d, %r9d
callq 0x4a7ab
movb 0xd0790(%rip), %cl      # 0xdbba6
movq %r13, %rax
jmp 0xb3a8
leaq 0x547f46(%rip), %rax    # 0x553368
movl (%rax), %eax
cmpl 0xd082a(%rip), %eax     # 0xdbc54
jle 0xb433
movb $0x0, 0xd0773(%rip)     # 0xdbba6
leaq 0x7906f2(%rip), %rax    # 0x79bb2c
cmpl $0x2, (%rax)
jl 0xb464
movswl 0xcf018(%rip), %eax     # 0xda45e
leaq 0x7906d7(%rip), %rcx    # 0x79bb24
cmpl %eax, (%rcx)
je 0xb464
movw $0x72, 0xcf19a(%rip)    # 0xda5f4
movl $0x6568744f, 0xcf18c(%rip) # imm = 0x6568744F
callq 0x14a22
callq 0x422ff
leaq 0x11a083(%rip), %rax    # 0x1254f8
movsbl (%rax), %edx
testl %edx, %edx
je 0xb488
xorl %edi, %edi
movl $0xff, %esi
callq 0x131f8
leaq 0x319c91(%rip), %rax    # 0x325120
cmpb $0x0, 0x58(%rax)
jle 0xb4ae
movb $0x0, 0x58(%rax)
movb 0x36(%rax), %cl
orb 0x2a(%rax), %cl
movsbl %cl, %esi
leaq 0x75e7b(%rip), %rdi     # 0x81324
callq 0x42fad
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq