// File: /workspace/github_c_makefile_star2_O3/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 $0x68, %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, 0xda415(%rip)     # 0xe5980
movslq %edi, %r15
leaq 0xda41b(%rip), %rax     # 0xe5990
movl (%rax,%r15,4), %ecx
leaq 0xd8f50(%rip), %rbx     # 0xe44d0
movl (%rbx,%r15,4), %eax
movl %eax, %edx
subl %ecx, %edx
movslq %edx, %r8
imulq %r9, %r8
shrq $0x10, %r8
addl %ecx, %r8d
leaq 0xda433(%rip), %rcx     # 0xe59d0
movl (%rcx,%r15,4), %ecx
leaq 0xd8f68(%rip), %r14     # 0xe4510
movl (%r14,%r15,4), %edx
movl %edx, %esi
subl %ecx, %esi
movslq %esi, %r10
imulq %r9, %r10
shrq $0x10, %r10
addl %ecx, %r10d
leaq 0xda44b(%rip), %rcx     # 0xe5a10
movl (%rcx,%r15,4), %ecx
leaq 0xd8f80(%rip), %rsi     # 0xe4550
movl (%rsi,%r15,4), %esi
movl %esi, %edi
subl %ecx, %edi
movslq %edi, %r12
imulq %r9, %r12
shrq $0x10, %r12
addl %ecx, %r12d
cmpb $0x0, 0xc6513(%rip)     # 0xd1b00
cmovel %eax, %r8d
movq %r8, 0x20(%rsp)
cmovel %edx, %r10d
movq %r10, 0x18(%rsp)
cmovel %esi, %r12d
leaq 0xda486(%rip), %rax     # 0xe5a90
movslq (%rax,%r15,4), %rax
movq %rax, 0x50(%rsp)
leaq 0xda2b6(%rip), %rax     # 0xe58d0
movslq (%rax,%r15,4), %rax
movq %rax, 0x58(%rsp)
leaq 0xda4a6(%rip), %rax     # 0xe5ad0
movzwl (%rax,%r15,2), %eax
leaq 0xd8e7a(%rip), %rcx     # 0xe44b0
movzwl (%rcx,%r15,2), %edx
xorl $0x400, %edx            # imm = 0x400
subl %eax, %edx
andl $0x7ff, %edx            # imm = 0x7FF
addl $0xfffffc00, %edx       # imm = 0xFFFFFC00
imull %r9d, %edx
shrl $0x10, %edx
addl %eax, %edx
leaq 0xda261(%rip), %rax     # 0xe58c0
movb $0x2, %cl
cmpb $0x2, (%r15,%rax)
movl %edx, 0x2c(%rsp)
movswl %dx, %eax
movl %eax, (%rsp)
je 0xbb53
leaq 0x3234e3(%rip), %rax    # 0x32eb60
leaq 0xda3cc(%rip), %rcx     # 0xe5a50
movslq (%rcx,%r15,4), %rcx
leaq 0xda1d1(%rip), %rdx     # 0xe5860
movslq (%rdx,%r15,4), %rdx
subq %rcx, %rdx
movq %r9, 0x48(%rsp)
imulq %r9, %rdx
shrq $0x10, %rdx
addl %ecx, %edx
movq %rdx, 0x40(%rsp)
leaq 0x79a47b(%rip), %rcx    # 0x7a5b2c
addl (%rax), %r12d
cmpl $0x2, (%rcx)
jl 0xbae0
cmpb $0x0, 0xc62b8(%rip)     # 0xd197c
jne 0xbae0
movq %r12, 0x60(%rsp)
leaq 0x79a45a(%rip), %rbx    # 0x7a5b30
movl (%rbx), %eax
leaq 0xda411(%rip), %r12     # 0xe5af0
testl %eax, %eax
js 0xb6f8
leaq 0x79a456(%rip), %rcx    # 0x7a5b40
movl %eax, %eax
movb $0x1, (%rax,%r12)
movl (%rcx,%rax,4), %eax
testl %eax, %eax
jns 0xb6ea
callq 0x1514f
movl (%rbx), %eax
testl %eax, %eax
js 0xbb3a
movswl %bp, %ecx
movl %ecx, 0x30(%rsp)
xorl %ebp, %ebp
movl %eax, %ebx
cmpb $0x0, (%rbx,%r12)
je 0xba73
leaq 0x79a408(%rip), %rax    # 0x7a5b2c
cmpl $0x4, (%rax)
movl %ebp, %eax
jg 0xb75e
cmpl $0x3, %ebp
ja 0xb9c8
leaq 0x836c5(%rip), %rcx     # 0x8ee00
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x5ad721(%rip), %rax    # 0x5b8e6c
movl (%rax), %edx
sarl %edx
decl %edx
leaq 0x5ad718(%rip), %rax    # 0x5b8e70
movl (%rax), %ecx
sarl %ecx
jmp 0xb791
cmpl $0xf, %ebp
ja 0xb9c8
leaq 0x83652(%rip), %rcx     # 0x8edc0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x5ad6ee(%rip), %rax    # 0x5b8e6c
movl (%rax), %edx
sarl $0x2, %edx
decl %edx
leaq 0x5ad6e4(%rip), %rax    # 0x5b8e70
movl (%rax), %ecx
sarl $0x2, %ecx
decl %ecx
xorl %edi, %edi
jmp 0xb951
leaq 0x5ad6cf(%rip), %rax    # 0x5b8e70
movl (%rax), %ecx
movl %ecx, %esi
sarl %esi
leaq 0x5ad6be(%rip), %rax    # 0x5b8e6c
movl (%rax), %edx
sarl %edx
jmp 0xb886
leaq 0x5ad6ae(%rip), %rax    # 0x5b8e6c
movl (%rax), %edx
movl %edx, %edi
sarl %edi
leaq 0x5ad6a5(%rip), %rax    # 0x5b8e70
movl (%rax), %ecx
movl %ecx, %esi
sarl %esi
jmp 0xb999
leaq 0x5ad68f(%rip), %rax    # 0x5b8e6c
movl (%rax), %edx
movl %edx, %edi
sarl %edi
decl %edx
leaq 0x5ad684(%rip), %rax    # 0x5b8e70
movl (%rax), %ecx
sarl %ecx
jmp 0xb94f
leaq 0x5ad670(%rip), %rax    # 0x5b8e6c
movl (%rax), %edi
movl %edi, %edx
sarl $0x2, %edx
notl %edx
addl %edi, %edx
sarl %edi
leaq 0x5ad660(%rip), %rax    # 0x5b8e70
movl (%rax), %ecx
movl %ecx, %eax
sarl $0x2, %eax
movl %ecx, %esi
subl %eax, %esi
jmp 0xb9c1
leaq 0x5ad645(%rip), %rax    # 0x5b8e6c
movl (%rax), %edx
movl %edx, %eax
sarl $0x2, %eax
movl %edx, %edi
subl %eax, %edi
leaq 0x5ad637(%rip), %rax    # 0x5b8e70
movl (%rax), %esi
movl %esi, %ecx
sarl $0x2, %ecx
notl %ecx
addl %esi, %ecx
sarl %esi
jmp 0xb8b5
leaq 0x5ad621(%rip), %rax    # 0x5b8e70
movl (%rax), %ecx
movl %ecx, %esi
sarl $0x2, %esi
leaq 0x5ad60f(%rip), %rax    # 0x5b8e6c
movl (%rax), %edx
sarl $0x2, %edx
decl %edx
sarl %ecx
jmp 0xb888
leaq 0x5ad601(%rip), %rax    # 0x5b8e70
movl (%rax), %ecx
movl %ecx, %eax
sarl $0x2, %eax
movl %ecx, %esi
subl %eax, %esi
leaq 0x5ad5eb(%rip), %rax    # 0x5b8e6c
movl (%rax), %edx
sarl $0x2, %edx
decl %edx
decl %ecx
xorl %edi, %edi
jmp 0xb9c3
leaq 0x5ad5d4(%rip), %rax    # 0x5b8e6c
movl (%rax), %edx
movl %edx, %edi
sarl $0x2, %edi
leaq 0x5ad5ca(%rip), %rax    # 0x5b8e70
movl (%rax), %esi
movl %esi, %ecx
sarl $0x2, %ecx
notl %ecx
addl %esi, %ecx
sarl %esi
sarl %edx
decl %edx
jmp 0xb9c3
leaq 0x5ad5a9(%rip), %rax    # 0x5b8e6c
movl (%rax), %edi
movl %edi, %edx
sarl $0x2, %edx
notl %edx
addl %edi, %edx
sarl %edi
jmp 0xb943
leaq 0x5ad593(%rip), %rax    # 0x5b8e6c
movl (%rax), %edx
movl %edx, %eax
sarl $0x2, %eax
movl %edx, %edi
subl %eax, %edi
leaq 0x5ad585(%rip), %rax    # 0x5b8e70
movl (%rax), %ecx
movl %ecx, %eax
sarl $0x2, %eax
movl %ecx, %esi
subl %eax, %esi
jmp 0xb999
leaq 0x5ad56a(%rip), %rax    # 0x5b8e6c
movl (%rax), %edx
movl %edx, %eax
sarl $0x2, %eax
movl %edx, %edi
subl %eax, %edi
jmp 0xb941
leaq 0x5ad556(%rip), %rax    # 0x5b8e6c
movl (%rax), %edx
movl %edx, %eax
sarl $0x2, %eax
movl %edx, %edi
subl %eax, %edi
leaq 0x5ad548(%rip), %rax    # 0x5b8e70
movl (%rax), %ecx
movl %ecx, %esi
sarl $0x2, %esi
jmp 0xb973
leaq 0x5ad534(%rip), %rax    # 0x5b8e6c
movl (%rax), %edx
movl %edx, %edi
sarl $0x2, %edi
sarl %edx
decl %edx
leaq 0x5ad526(%rip), %rax    # 0x5b8e70
movl (%rax), %ecx
sarl $0x2, %ecx
decl %ecx
xorl %esi, %esi
jmp 0xb9c3
leaq 0x5ad510(%rip), %rax    # 0x5b8e6c
movl (%rax), %edx
movl %edx, %edi
sarl $0x2, %edi
leaq 0x5ad506(%rip), %rax    # 0x5b8e70
movl (%rax), %ecx
movl %ecx, %esi
sarl $0x2, %esi
sarl %edx
decl %edx
jmp 0xb9bf
leaq 0x5ad4ee(%rip), %rax    # 0x5b8e6c
movl (%rax), %edx
movl %edx, %edi
sarl $0x2, %edi
leaq 0x5ad4e4(%rip), %rax    # 0x5b8e70
movl (%rax), %ecx
movl %ecx, %eax
sarl $0x2, %eax
movl %ecx, %esi
subl %eax, %esi
sarl %edx
decl %edx
jmp 0xb9c1
leaq 0x5ad4c8(%rip), %rax    # 0x5b8e6c
movl (%rax), %edi
movl %edi, %edx
sarl $0x2, %edx
notl %edx
addl %edi, %edx
sarl %edi
leaq 0x5ad4b8(%rip), %rax    # 0x5b8e70
movl (%rax), %ecx
movl %ecx, %esi
sarl $0x2, %esi
sarl %ecx
decl %ecx
callq 0x4624e
movq %r12, %r13
movq %r14, %r12
cmpl 0x30(%rsp), %ebx
jne 0xba05
leaq 0xd9d45(%rip), %rax     # 0xe5720
movswl (%rax,%rbx,2), %r9d
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x60(%rsp), %rdx
movl (%rsp), %ecx
movq 0x40(%rsp), %r8
callq 0x37f0d
leaq 0xd8acd(%rip), %r14     # 0xe44d0
jmp 0xba45
leaq 0xd8ac4(%rip), %r14     # 0xe44d0
movl (%r14,%rbx,4), %edi
movl (%r12,%rbx,4), %esi
leaq 0xd8b35(%rip), %rax     # 0xe4550
movl (%rax,%rbx,4), %edx
leaq 0xd8a8b(%rip), %rax     # 0xe44b0
movswl (%rax,%rbx,2), %ecx
leaq 0xd9e30(%rip), %rax     # 0xe5860
movl (%rax,%rbx,4), %r8d
leaq 0xd9ce5(%rip), %rax     # 0xe5720
movswl (%rax,%rbx,2), %r9d
callq 0x37f0d
movl (%r14,%rbx,4), %edi
movl (%r12,%rbx,4), %esi
callq 0x1d484
callq 0x3bc88
leaq 0xd8a32(%rip), %rax     # 0xe4490
movzwl (%rax,%rbx,2), %edi
shrl $0xd, %edi
movswl %bx, %esi
callq 0x11917
movq %r12, %r14
movq %r13, %r12
incl %ebp
leaq 0x79a0c4(%rip), %rax    # 0x7a5b40
movl (%rax,%rbx,4), %eax
testl %eax, %eax
jns 0xb710
jmp 0xbb3a
leaq 0x5ad3d9(%rip), %rax    # 0x5b8e6c
movl (%rax), %edi
movl %edi, %edx
sarl $0x2, %edx
notl %edx
addl %edi, %edx
sarl %edi
leaq 0x5ad3c9(%rip), %rax    # 0x5b8e70
movl (%rax), %esi
movl %esi, %ecx
sarl $0x2, %ecx
notl %ecx
addl %esi, %ecx
sarl %esi
jmp 0xb9c3
leaq 0x5ad3b0(%rip), %rax    # 0x5b8e70
movl (%rax), %esi
movl %esi, %ecx
sarl $0x2, %ecx
notl %ecx
addl %esi, %ecx
sarl %esi
leaq 0x5ad398(%rip), %rax    # 0x5b8e6c
movl (%rax), %edx
sarl $0x2, %edx
decl %edx
jmp 0xb88a
callq 0x1514f
leaq 0xd9c34(%rip), %rax     # 0xe5720
movswl (%rax,%r15,2), %r9d
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl %r12d, %edx
movl (%rsp), %ecx
movq 0x40(%rsp), %r8
callq 0x37f0d
movl (%rbx,%r15,4), %edi
movl (%r14,%r15,4), %esi
callq 0x1d484
callq 0x3bc88
movswl 0xd893a(%rip), %eax     # 0xe445e
movslq %eax, %rsi
leaq 0xd8962(%rip), %rax     # 0xe4490
movzwl (%rax,%rsi,2), %edi
shrl $0xd, %edi
callq 0x11917
leaq 0xd9d7f(%rip), %rax     # 0xe58c0
movb (%r15,%rax), %cl
cmpb $0x3, %cl
movq 0x48(%rsp), %r9
je 0xbbd4
movq 0x58(%rsp), %r12
movq 0x50(%rsp), %rax
subq %rax, %r12
imulq %r9, %r12
shrq $0x10, %r12
addl %eax, %r12d
movzwl 0x2c(%rsp), %esi
leal 0x200(%rsi), %eax
movl $0x7ff, %edi            # imm = 0x7FF
andl %edi, %eax
leaq 0x57404c(%rip), %r8     # 0x57fbd0
movswl (%r8,%rax,2), %eax
shll $0x6, %eax
cltd
idivl %r12d
movl %eax, %ebp
addl 0x20(%rsp), %ebp
andl %edi, %esi
movswl (%r8,%rsi,2), %eax
shll $0x6, %eax
cltd
idivl %r12d
movl %eax, %ebx
addl 0x18(%rsp), %ebx
cmpb $0x2, %cl
jne 0xbbc5
xorl %edi, %edi
callq 0x4e5af
movl %ebp, %edi
movl %ebx, %esi
movl %r12d, %edx
movl (%rsp), %ecx
callq 0x3fc33
movl %ebp, %edi
movl %ebx, %esi
movl %r12d, %edx
movl (%rsp), %ecx
callq 0x13788
cmpl $0x0, 0xd8891(%rip)     # 0xe446c
je 0xbc77
movslq 0xd8880(%rip), %rcx     # 0xe4468
testq %rcx, %rcx
js 0xc0f8
leaq 0xd89f8(%rip), %rsi     # 0xe45f0
movabsq $-0x3333333333333333, %rdx # imm = 0xCCCCCCCCCCCCCCCD
movq %rcx, %rax
mulq %rdx
leaq (%rcx,%rsi), %rax
incq %rax
shrq $0x5, %rdx
leaq (%rdx,%rdx,4), %rdx
leaq 0x28(,%rdx,8), %rdx
xorl %esi, %esi
leaq 0xd9ed8(%rip), %rdi     # 0xe5b00
leaq 0xd89e9(%rip), %r8      # 0xe4618
movq 0x20(%rsi,%rdi), %r9
movq %r9, 0xd89d5(%rip)      # 0xe4610
movups (%rsi,%rdi), %xmm0
movups 0x10(%rsi,%rdi), %xmm1
movaps %xmm1, 0xd89b5(%rip)    # 0xe4600
movaps %xmm0, 0xd899e(%rip)    # 0xe45f0
addq $0x28, %rsi
movq %r8, %r9
cmpq %rcx, %rsi
jbe 0xbc65
movb $0x5f, -0x1(%rax)
movq %rax, %r9
movb $0x0, (%r9)
addq $-0x28, %rax
cmpq %rsi, %rdx
jne 0xbc2f
jmp 0xc0f8
leaq 0x799ea6(%rip), %rax    # 0x7a5b24
movslq (%rax), %rax
leaq 0xd9c38(%rip), %rcx     # 0xe58c0
cmpb $0x3, (%rax,%rcx)
jne 0xc0f8
movzwl 0xd9f09(%rip), %eax     # 0xe5ba2
movswl %ax, %r13d
movzwl 0xd9f00(%rip), %eax     # 0xe5ba4
movl %eax, %edx
andl $0x20, %edx
movzwl 0xd87b4(%rip), %ecx     # 0xe4464
movl %ecx, %esi
andl $0x20, %esi
cmpw %si, %dx
seta %dl
cmpw $0x41, %r13w
setge %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0xbfe4
leaq 0x5ad194(%rip), %r14    # 0x5b8e6c
movl (%r14), %ecx
movl %ecx, %eax
sarl %eax
movl %r13d, %edx
shrl %edx
subl %edx, %eax
leaq 0x38(%rsp), %rdi
movl %eax, (%rdi)
addl %r13d, %eax
decl %eax
leaq 0x34(%rsp), %r8
movl %eax, (%r8)
leaq 0x5ad16f(%rip), %r15    # 0x5b8e70
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 0x8(%rsp), %rsi
movl %r9d, (%rsi)
addl %r9d, %eax
decl %eax
leaq 0x4(%rsp), %rcx
movl %eax, (%rcx)
movq %r8, %rdx
callq 0x1b6c0
movswl 0xd9e64(%rip), %eax     # 0xe5ba2
movl %eax, %ecx
sarl $0x3, %ecx
subl %ecx, %eax
movw %ax, 0xd9e56(%rip)      # 0xe5ba2
movl (%r14), %r10d
cmpl %r13d, %r10d
jge 0xbe9b
movw %r10w, 0xd9e42(%rip)    # 0xe5ba2
movl $0xfffffec0, %ebx       # imm = 0xFFFFFEC0
leal (%r10,%rbx), %edi
sarl %edi
movl (%r15), %eax
leal -0x20(%rax), %esi
decl %r10d
decl %eax
subq $0x8, %rsp
movl $0x19e, %edx            # imm = 0x19E
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq $0x0
pushq %rax
pushq %r10
callq 0x9f1c
addq $0x20, %rsp
movl (%r14), %r10d
addl %r10d, %ebx
sarl %ebx
cmpl $0x8, %ebx
jl 0xbde2
movl %ebx, %r12d
leal -0x8(%r12), %ebx
movl (%r15), %eax
leal -0x20(%rax), %esi
movl (%r14), %r10d
decl %r10d
decl %eax
subq $0x8, %rsp
movl %ebx, %edi
movl $0x1b7, %edx            # imm = 0x1B7
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq $0x0
pushq %rax
pushq %r10
callq 0x9f1c
addq $0x20, %rsp
cmpl $0xf, %r12d
ja 0xbda2
movl (%r14), %r10d
cmpl $0x4, %ebx
jl 0xbe19
addl $-0x4, %ebx
movl (%r15), %eax
leal -0x20(%rax), %esi
decl %r10d
decl %eax
subq $0x8, %rsp
movl %ebx, %edi
movl $0x1b9, %edx            # imm = 0x1B9
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq $0x0
pushq %rax
pushq %r10
callq 0x9f1c
addq $0x20, %rsp
movl (%r14), %r10d
leal -0x140(%r10), %ebx
sarl %ebx
addl $0x140, %ebx            # imm = 0x140
leal -0x8(%r10), %eax
cmpl %eax, %ebx
jg 0xbe64
movl (%r15), %eax
leal -0x20(%rax), %esi
decl %r10d
decl %eax
subq $0x8, %rsp
movl %ebx, %edi
movl $0x1b7, %edx            # imm = 0x1B7
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq $0x0
pushq %rax
pushq %r10
callq 0x9f1c
addq $0x20, %rsp
addl $0x8, %ebx
movl (%r14), %r10d
jmp 0xbe28
leal -0x4(%r10), %eax
cmpl %eax, %ebx
jg 0xbe9b
movl (%r15), %eax
leal -0x20(%rax), %esi
decl %r10d
decl %eax
subq $0x8, %rsp
movl %ebx, %edi
movl $0x1b9, %edx            # imm = 0x1B9
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq $0x0
pushq %rax
pushq %r10
callq 0x9f1c
addq $0x20, %rsp
movl (%r14), %r10d
movl %r10d, %eax
sarl %eax
movswl 0xd9cfb(%rip), %ecx     # 0xe5ba2
movl %ecx, %edx
sarl %edx
subl %edx, %eax
leaq 0x14(%rsp), %rbx
movl %eax, (%rbx)
addl %ecx, %eax
decl %eax
leaq 0xc(%rsp), %r14
movl %eax, (%r14)
movl (%r15), %eax
addl $-0x20, %eax
movl %eax, %esi
sarl %esi
imull %ecx, %eax
cltd
idivl %r10d
movl %eax, %ecx
sarl %ecx
subl %ecx, %esi
leaq 0x10(%rsp), %r12
movl %esi, (%r12)
addl %esi, %eax
decl %eax
leaq 0x3c(%rsp), %r15
movl %eax, (%r15)
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x1b6c0
movl (%r12), %esi
movb 0xd854b(%rip), %cl      # 0xe4452
sarl %cl, %esi
movl (%rbx), %edi
movl (%r14), %edx
movl (%r15), %eax
sarl %cl, %eax
movl %eax, %ecx
callq 0x4624e
movl 0x38(%rsp), %r8d
movl 0x8(%rsp), %r9d
movl (%rbx), %eax
decl %eax
movl 0x4(%rsp), %r10d
subq $0x8, %rsp
xorl %ebp, %ebp
xorl %edi, %edi
xorl %esi, %esi
movl $0x196, %edx            # imm = 0x196
xorl %ecx, %ecx
pushq %rbp
pushq %r10
pushq %rax
callq 0x9f5f
addq $0x20, %rsp
movl (%r14), %r8d
incl %r8d
movl 0x8(%rsp), %r9d
movl 0x34(%rsp), %eax
movl 0x4(%rsp), %r10d
subq $0x8, %rsp
xorl %edi, %edi
xorl %esi, %esi
movl $0x196, %edx            # imm = 0x196
xorl %ecx, %ecx
pushq %rbp
pushq %r10
pushq %rax
callq 0x9f5f
addq $0x20, %rsp
movl (%rbx), %r8d
movl 0x8(%rsp), %r9d
movl (%r14), %eax
movl (%r12), %r10d
decl %r10d
subq $0x8, %rsp
xorl %edi, %edi
xorl %esi, %esi
movl $0x196, %edx            # imm = 0x196
xorl %ecx, %ecx
pushq %rbp
pushq %r10
pushq %rax
callq 0x9f5f
addq $0x20, %rsp
movl (%rbx), %r8d
movl (%r15), %r9d
incl %r9d
movl (%r14), %eax
movl 0x4(%rsp), %r10d
subq $0x8, %rsp
xorl %edi, %edi
xorl %esi, %esi
movl $0x196, %edx            # imm = 0x196
xorl %ecx, %ecx
pushq %rbp
pushq %r10
pushq %rax
callq 0x9f5f
addq $0x20, %rsp
movzwl 0xd9bc7(%rip), %eax     # 0xe5ba4
movzwl 0xd8480(%rip), %ecx     # 0xe4464
movl %eax, %edx
andl $0x10, %edx
andl $0x10, %ecx
cmpw %cx, %dx
jbe 0xc0f1
movswl 0xd9ba6(%rip), %edx     # 0xe5ba2
leaq 0x5ace69(%rip), %rcx    # 0x5b8e6c
movl (%rcx), %ecx
cmpl %edx, %ecx
jl 0xc0f1
movswl %dx, %eax
sarl $0x3, %eax
addl %edx, %eax
movw %ax, 0xd9b86(%rip)      # 0xe5ba2
movswl %ax, %edx
cmpl %edx, %ecx
setl %sil
cmpl %r13d, %ecx
sete %dil
andb %sil, %dil
cmpb $0x1, %dil
jne 0xc05d
leal 0x1(%r13), %eax
movw %ax, 0xd9b62(%rip)      # 0xe5ba2
xorl %eax, %eax
movl %eax, 0x14(%rsp)
movl %eax, 0x10(%rsp)
decl %r13d
movl %r13d, 0xc(%rsp)
leaq 0x5ace17(%rip), %rax    # 0x5b8e70
movl (%rax), %esi
jmp 0xc0a4
cmpl %edx, %ecx
jge 0xc06c
movw %cx, 0xd9b3a(%rip)      # 0xe5ba2
movl %ecx, %edx
movl %ecx, %eax
movl %ecx, %esi
sarl %esi
cwtl
sarl %eax
subl %eax, %esi
movl %esi, 0x14(%rsp)
leal (%rdx,%rsi), %eax
decl %eax
movl %eax, 0xc(%rsp)
leaq 0x5acde7(%rip), %rax    # 0x5b8e70
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, 0x10(%rsp)
addl %eax, %esi
decl %esi
leaq 0x3c(%rsp), %rbx
movl %esi, (%rbx)
leaq 0x14(%rsp), %r14
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x1b6c0
movl (%r15), %esi
movb 0xd837c(%rip), %cl      # 0xe4452
sarl %cl, %esi
movl (%r14), %edi
movl (%r12), %edx
movl (%rbx), %eax
sarl %cl, %eax
movl %eax, %ecx
callq 0x4624e
movzwl 0xd9ab3(%rip), %eax     # 0xe5ba4
movw %ax, 0xd836c(%rip)      # 0xe4464
movsbl 0xd9aa7(%rip), %eax     # 0xe5ba6
testl %eax, %eax
jle 0xc1c5
leaq 0xd84e2(%rip), %rbx     # 0xe45f0
movl $0x28, %r14d
xorl %r15d, %r15d
leaq 0xd9a92(%rip), %r12     # 0xe5bb0
movq %rbx, %r13
xorl %ebp, %ebp
movq 0x20(%rbp,%r12), %rcx
movq %rcx, 0xd84e1(%rip)     # 0xe4610
movups (%rbp,%r12), %xmm0
movups 0x10(%rbp,%r12), %xmm1
movaps %xmm1, 0xd84be(%rip)    # 0xe4600
movaps %xmm0, 0xd84a7(%rip)    # 0xe45f0
cltq
cmpq %rax, %r14
movq %rax, %rcx
cmovlq %r14, %rcx
movb $0x0, (%r13,%rcx)
decl %eax
cwtl
imull $0xffff9999, %eax, %eax # imm = 0xFFFF9999
movl %eax, %ecx
shrl $0x1f, %ecx
sarl $0x14, %eax
addl %ecx, %eax
addl %r15d, %eax
leal 0xa0(,%rax,8), %esi
xorl %edi, %edi
movl $0x97, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rbx, %r8
xorl %r9d, %r9d
callq 0x4f963
movsbl 0xd9a10(%rip), %eax     # 0xe5ba6
addq $0x28, %rbp
addq $-0x28, %r13
addq $0x28, %r14
incl %r15d
cmpl %eax, %ebp
jle 0xc123
leaq 0x5511b4(%rip), %rax    # 0x55d368
movl (%rax), %eax
cmpl 0xd9a98(%rip), %eax     # 0xe5c54
jle 0xc1c5
movb $0x0, 0xd99e1(%rip)     # 0xe5ba6
leaq 0x799960(%rip), %rax    # 0x7a5b2c
cmpl $0x2, (%rax)
jl 0xc1f6
movswl 0xd8286(%rip), %eax     # 0xe445e
leaq 0x799945(%rip), %rcx    # 0x7a5b24
cmpl %eax, (%rcx)
je 0xc1f6
movw $0x72, 0xd8408(%rip)    # 0xe45f4
movl $0x6568744f, 0xd83fa(%rip) # imm = 0x6568744F
callq 0x15e73
callq 0x46cdb
leaq 0x1232f1(%rip), %rax    # 0x12f4f8
movsbl (%rax), %edx
testl %edx, %edx
je 0xc21a
xorl %edi, %edi
movl $0xff, %esi
callq 0x14614
leaq 0x322eff(%rip), %rax    # 0x32f120
cmpb $0x0, 0x58(%rax)
jle 0xc240
movb $0x0, 0x58(%rax)
movb 0x36(%rax), %cl
orb 0x2a(%rax), %cl
movsbl %cl, %esi
leaq 0x830e9(%rip), %rdi     # 0x8f324
callq 0x47a07
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq