// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekmap.c
// Function: drawoverheadmap
void
drawoverheadmap(int cposx, int cposy, int czoom, short cang)
{
     int i, j, k, l, x1, y1, x2, y2, x3, y3, x4, y4, ox, oy, xoff, yoff;
     int dax, day, cosang, sinang, xspan, yspan, sprx, spry;
     int xrepeat, yrepeat, z1, z2, startwall, endwall, tilenum, daang;
     int xvect, yvect, xvect2, yvect2;
     unsigned char col;
     walltype *wal, *wal2;
     spritetype *spr;

     xvect = sintable[(2048-cang)&2047] * czoom;
     yvect = sintable[(1536-cang)&2047] * czoom;
     xvect2 = mulscale(xvect,yxaspect,16);
     yvect2 = mulscale(yvect,yxaspect,16);

          //Draw red lines
     for(i=0;i<numsectors;i++)
     {
          startwall = sector[i].wallptr;
          endwall = sector[i].wallptr + sector[i].wallnum - 1;

          z1 = sector[i].ceilingz; z2 = sector[i].floorz;

          for(j=startwall,wal=&wall[startwall];j<=endwall;j++,wal++)
          {
               k = wal->nextwall; if (k < 0) continue;

               if ((show2dwall[j>>3]&(1<<(j&7))) == 0) continue;
               if ((k > j) && ((show2dwall[k>>3]&(1<<(k&7))) > 0)) continue;

               if (sector[wal->nextsector].ceilingz == z1)
                    if (sector[wal->nextsector].floorz == z2)
                         if (((wal->cstat|wall[wal->nextwall].cstat)&(16+32)) == 0) continue;

               col = 232;

               if (dimensionmode[screenpeek] == 2)
               {
                    if (sector[i].floorz != sector[i].ceilingz)
                         if (sector[wal->nextsector].floorz != sector[wal->nextsector].ceilingz)
                              if (((wal->cstat|wall[wal->nextwall].cstat)&(16+32)) == 0)
                                   if (sector[i].floorz == sector[wal->nextsector].floorz) continue;
                    if (sector[i].floorpicnum != sector[wal->nextsector].floorpicnum) continue;
                    if (sector[i].floorshade != sector[wal->nextsector].floorshade) continue;
                    col = 232;
               }

               ox = wal->x-cposx; oy = wal->y-cposy;
               x1 = mulscale(ox,xvect,16) - mulscale(oy,yvect,16);
               y1 = mulscale(oy,xvect2,16) + mulscale(ox,yvect2,16);

               wal2 = &wall[wal->point2];
               ox = wal2->x-cposx; oy = wal2->y-cposy;
               x2 = mulscale(ox,xvect,16) - mulscale(oy,yvect,16);
               y2 = mulscale(oy,xvect2,16) + mulscale(ox,yvect2,16);

               drawline256(x1+(xdim<<11),y1+(ydim<<11),x2+(xdim<<11),y2+(ydim<<11),col);
          }
     }

          //Draw sprites
     k = playersprite[screenpeek];
     show2dsprite[k>>3] |= (1<<(k&7));
     for(i=0;i<numsectors;i++)
          for(j=headspritesect[i];j>=0;j=nextspritesect[j])
               if ((show2dsprite[j>>3]&(1<<(j&7))) > 0)
               {
                    spr = &sprite[j];
                    col = 56;
                    if ((spr->cstat&1) > 0) col = 248;
                    if (j == k) col = 31;

                    sprx = spr->x;
                    spry = spr->y;

                    k = spr->statnum;
                    if ((k >= 1) && (k <= 8) && (k != 2))  //Interpolate moving sprite
                    {
                         sprx = osprite[j].x+mulscale(sprx-osprite[j].x,smoothratio,16);
                         spry = osprite[j].y+mulscale(spry-osprite[j].y,smoothratio,16);
                    }

                    switch (spr->cstat&48)
                    {
                         case 0:
                              ox = sprx-cposx; oy = spry-cposy;
                              x1 = mulscale(ox,xvect,16) - mulscale(oy,yvect,16);
                              y1 = mulscale(oy,xvect2,16) + mulscale(ox,yvect2,16);

                              if (dimensionmode[screenpeek] == 1)
                              {
                                   ox = (sintable[(spr->ang+512)&2047]>>7);
                                   oy = (sintable[(spr->ang)&2047]>>7);
                                   x2 = mulscale(ox,xvect,16) - mulscale(oy,yvect,16);
                                   y2 = mulscale(oy,xvect,16) + mulscale(ox,yvect,16);

                                   if (j == playersprite[screenpeek])
                                   {
                                        x2 = 0L;
                                        y2 = -(czoom<<5);
                                   }

                                   x3 = mulscale(x2,yxaspect,16);
                                   y3 = mulscale(y2,yxaspect,16);

                                   drawline256(x1-x2+(xdim<<11),y1-y3+(ydim<<11),
                                                       x1+x2+(xdim<<11),y1+y3+(ydim<<11),col);
                                   drawline256(x1-y2+(xdim<<11),y1+x3+(ydim<<11),
                                                       x1+x2+(xdim<<11),y1+y3+(ydim<<11),col);
                                   drawline256(x1+y2+(xdim<<11),y1-x3+(ydim<<11),
                                                       x1+x2+(xdim<<11),y1+y3+(ydim<<11),col);
                              }
                              else
                              {
                                   if (((gotsector[i>>3]&(1<<(i&7))) > 0) && (czoom > 192))
                                   {
                                        daang = (spr->ang-cang)&2047;
                                        if (j == playersprite[screenpeek])
                                             { x1 = 0; y1 = (yxaspect<<2); daang = 0; }
                                        rotatesprite((x1<<4)+(xdim<<15),(y1<<4)+(ydim<<15),mulscale(czoom*spr->yrepeat,yxaspect,16),daang,spr->picnum,spr->shade,spr->pal,(spr->cstat&2)>>1, windowx1, windowy1, windowx2, windowy2);
                                   }
                              }
                              break;
                         case 16:
                              x1 = sprx; y1 = spry;
                              tilenum = spr->picnum;
                              xoff = (int)((signed char)((picanm[tilenum]>>8)&255))+((int)spr->xoffset);
                              if ((spr->cstat&4) > 0) xoff = -xoff;
                              k = spr->ang; l = spr->xrepeat;
                              dax = sintable[k&2047]*l; day = sintable[(k+1536)&2047]*l;
                              l = tilesizx[tilenum]; k = (l>>1)+xoff;
                              x1 -= mulscale(dax,k,16); x2 = x1+mulscale(dax,l,16);
                              y1 -= mulscale(day,k,16); y2 = y1+mulscale(day,l,16);

                              ox = x1-cposx; oy = y1-cposy;
                              x1 = mulscale(ox,xvect,16) - mulscale(oy,yvect,16);
                              y1 = mulscale(oy,xvect2,16) + mulscale(ox,yvect2,16);

                              ox = x2-cposx; oy = y2-cposy;
                              x2 = mulscale(ox,xvect,16) - mulscale(oy,yvect,16);
                              y2 = mulscale(oy,xvect2,16) + mulscale(ox,yvect2,16);

                              drawline256(x1+(xdim<<11),y1+(ydim<<11),
                                                  x2+(xdim<<11),y2+(ydim<<11),col);

                              break;
                         case 32:
                              if (dimensionmode[screenpeek] == 1)
                              {
                                   tilenum = spr->picnum;
                                   xoff = (int)((signed char)((picanm[tilenum]>>8)&255))+((int)spr->xoffset);
                                   yoff = (int)((signed char)((picanm[tilenum]>>16)&255))+((int)spr->yoffset);
                                   if ((spr->cstat&4) > 0) xoff = -xoff;
                                   if ((spr->cstat&8) > 0) yoff = -yoff;

                                   k = spr->ang;
                                   cosang = sintable[(k+512)&2047]; sinang = sintable[k];
                                   xspan = tilesizx[tilenum]; xrepeat = spr->xrepeat;
                                   yspan = tilesizy[tilenum]; yrepeat = spr->yrepeat;

                                   dax = ((xspan>>1)+xoff)*xrepeat; day = ((yspan>>1)+yoff)*yrepeat;
                                   x1 = sprx + mulscale(sinang,dax,16) + mulscale(cosang,day,16);
                                   y1 = spry + mulscale(sinang,day,16) - mulscale(cosang,dax,16);
                                   l = xspan*xrepeat;
                                   x2 = x1 - mulscale(sinang,l,16);
                                   y2 = y1 + mulscale(cosang,l,16);
                                   l = yspan*yrepeat;
                                   k = -mulscale(cosang,l,16); x3 = x2+k; x4 = x1+k;
                                   k = -mulscale(sinang,l,16); y3 = y2+k; y4 = y1+k;

                                   ox = x1-cposx; oy = y1-cposy;
                                   x1 = mulscale(ox,xvect,16) - mulscale(oy,yvect,16);
                                   y1 = mulscale(oy,xvect2,16) + mulscale(ox,yvect2,16);

                                   ox = x2-cposx; oy = y2-cposy;
                                   x2 = mulscale(ox,xvect,16) - mulscale(oy,yvect,16);
                                   y2 = mulscale(oy,xvect2,16) + mulscale(ox,yvect2,16);

                                   ox = x3-cposx; oy = y3-cposy;
                                   x3 = mulscale(ox,xvect,16) - mulscale(oy,yvect,16);
                                   y3 = mulscale(oy,xvect2,16) + mulscale(ox,yvect2,16);

                                   ox = x4-cposx; oy = y4-cposy;
                                   x4 = mulscale(ox,xvect,16) - mulscale(oy,yvect,16);
                                   y4 = mulscale(oy,xvect2,16) + mulscale(ox,yvect2,16);

                                   drawline256(x1+(xdim<<11),y1+(ydim<<11),
                                                       x2+(xdim<<11),y2+(ydim<<11),col);

                                   drawline256(x2+(xdim<<11),y2+(ydim<<11),
                                                       x3+(xdim<<11),y3+(ydim<<11),col);

                                   drawline256(x3+(xdim<<11),y3+(ydim<<11),
                                                       x4+(xdim<<11),y4+(ydim<<11),col);

                                   drawline256(x4+(xdim<<11),y4+(ydim<<11),
                                                       x1+(xdim<<11),y1+(ydim<<11),col);

                              }
                              break;
                    }
               }

          //Draw white lines
     for(i=0;i<numsectors;i++)
     {
          startwall = sector[i].wallptr;
          endwall = sector[i].wallptr + sector[i].wallnum - 1;

          for(j=startwall,wal=&wall[startwall];j<=endwall;j++,wal++)
          {
               if (wal->nextwall >= 0) continue;

               if ((show2dwall[j>>3]&(1<<(j&7))) == 0) continue;

               if (tilesizx[wal->picnum] == 0) continue;
               if (tilesizy[wal->picnum] == 0) continue;

               ox = wal->x-cposx; oy = wal->y-cposy;
               x1 = mulscale(ox,xvect,16) - mulscale(oy,yvect,16);
               y1 = mulscale(oy,xvect2,16) + mulscale(ox,yvect2,16);

               wal2 = &wall[wal->point2];
               ox = wal2->x-cposx; oy = wal2->y-cposy;
               x2 = mulscale(ox,xvect,16) - mulscale(oy,yvect,16);
               y2 = mulscale(oy,xvect2,16) + mulscale(ox,yvect2,16);

               drawline256(x1+(xdim<<11),y1+(ydim<<11),x2+(xdim<<11),y2+(ydim<<11),239);
          }
     }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %esi, 0xc(%rsp)
movl %edi, 0x8(%rsp)
movl %ecx, %eax
negl %eax
movl $0x7ff, %esi            # imm = 0x7FF
andl %esi, %eax
leaq 0x5637a1(%rip), %rdi    # 0x575bd0
movswq (%rdi,%rax,2), %r8
movl %edx, 0x3c(%rsp)
movslq %edx, %rax
imulq %rax, %r8
movl $0x600, %edx            # imm = 0x600
movl %ecx, 0x54(%rsp)
subl %ecx, %edx
andl %esi, %edx
movswq (%rdi,%rdx,2), %rdx
imulq %rax, %rdx
leaq 0x59ca0c(%rip), %rax    # 0x5aee68
movslq (%rax), %rax
movq %rdx, %rcx
imulq %rax, %rcx
imulq %r8, %rax
shrq $0x10, %rax
cltq
movq %rax, 0x48(%rsp)
shrq $0x10, %rcx
movslq %ecx, %rax
movq %rax, 0x30(%rsp)
xorl %esi, %esi
movq %r8, 0x40(%rsp)
movq %rdx, 0x20(%rsp)
leaq 0x56494c(%rip), %rax    # 0x576de0
movswq (%rax), %rax
movslq 0x8(%rsp), %rcx
movq %rcx, 0x78(%rsp)
movslq 0xc(%rsp), %rcx
movq %rcx, 0x70(%rsp)
cmpq %rax, %rsi
jge 0x126f9
movq %rsi, 0x28(%rsp)
imulq $0x28, %rsi, %rax
leaq 0x3d841b(%rip), %rcx    # 0x3ea8e0
leaq (%rcx,%rax), %r9
movswq (%rcx,%rax), %r15
movswl 0x2(%rcx,%rax), %ebp
addl %r15d, %ebp
movl 0x4(%rcx,%rax), %r14d
movl 0x8(%rcx,%rax), %eax
movl %eax, 0x10(%rsp)
movq %r15, %rax
shlq $0x5, %rax
leaq 0x34d3df(%rip), %rcx    # 0x35f8d0
leaq (%rcx,%rax), %rbx
addq $0xe, %rbx
movq %r9, 0x18(%rsp)
cmpl %ebp, %r15d
jge 0x126ec
movswl -0x4(%rbx), %eax
testl %eax, %eax
js 0x126b9
movl %r15d, %ecx
sarl $0x3, %ecx
movslq %ecx, %rcx
leaq 0x54063d(%rip), %rdx    # 0x552b60
movzbl (%rdx,%rcx), %ecx
movl %r15d, %edx
andl $0x7, %edx
btl %edx, %ecx
jae 0x126b9
cmpl %eax, %r15d
jge 0x12559
movl %eax, %ecx
shrl $0x3, %ecx
leaq 0x540619(%rip), %rdx    # 0x552b60
movzbl (%rdx,%rcx), %ecx
movl %eax, %edx
andl $0x7, %edx
btl %edx, %ecx
jb 0x126b9
movswq -0x2(%rbx), %rcx
imulq $0x28, %rcx, %rdx
leaq 0x3d8377(%rip), %rsi    # 0x3ea8e0
leaq (%rsi,%rdx), %rcx
movl 0x4(%rsi,%rdx), %edx
cmpl %r14d, %edx
jne 0x1259f
movl 0x10(%rsp), %esi
cmpl %esi, 0x8(%rcx)
jne 0x1259f
movslq %eax, %rsi
shlq $0x5, %rsi
leaq 0x34d343(%rip), %rdi    # 0x35f8d0
movzwl 0xe(%rdi,%rsi), %esi
orw (%rbx), %si
testb $0x30, %sil
je 0x126b9
leaq 0xc7eb8(%rip), %rsi     # 0xda45e
movswq (%rsi), %rsi
leaq 0xc930f(%rip), %rdi     # 0xdb8c0
cmpb $0x2, (%rdi,%rsi)
jne 0x125e8
movl 0x8(%r9), %esi
cmpl 0x4(%r9), %esi
je 0x125cc
movl 0x8(%rcx), %edi
cmpl %edx, %edi
jne 0x126c5
movzwl 0x18(%r9), %eax
cmpw 0x18(%rcx), %ax
jne 0x126b9
movb 0x1c(%r9), %al
cmpb 0x1c(%rcx), %al
jne 0x126b9
movslq -0xe(%rbx), %rdi
movq 0x78(%rsp), %r13
subq %r13, %rdi
movslq -0xa(%rbx), %rax
movq 0x70(%rsp), %r12
subq %r12, %rax
movq 0x30(%rsp), %r11
movq %r11, %rsi
imulq %rdi, %rsi
movq 0x40(%rsp), %rdx
imulq %rdx, %rdi
shrq $0x10, %rdi
movq 0x48(%rsp), %r10
movq %r10, %rcx
imulq %rax, %rcx
movq 0x20(%rsp), %r9
imulq %r9, %rax
shrq $0x10, %rax
subl %eax, %edi
shrq $0x10, %rcx
shrq $0x10, %rsi
addl %ecx, %esi
movswq -0x6(%rbx), %rax
shlq $0x5, %rax
leaq 0x34d282(%rip), %rcx    # 0x35f8d0
movslq (%rcx,%rax), %r8
subq %r13, %r8
movslq 0x4(%rcx,%rax), %rcx
subq %r12, %rcx
movq %r11, %rax
imulq %r8, %rax
imulq %rdx, %r8
shrq $0x10, %r8
leaq 0x59c7f9(%rip), %rdx    # 0x5aee6c
movl (%rdx), %edx
shll $0xb, %edx
addl %edx, %edi
addl %r8d, %edx
movq %r10, %r8
imulq %rcx, %r8
imulq %r9, %rcx
shrq $0x10, %rcx
shrq $0x10, %rax
subl %ecx, %edx
leaq 0x59c7d7(%rip), %rcx    # 0x5aee70
movl (%rcx), %ecx
shll $0xb, %ecx
addl %ecx, %esi
addl %eax, %ecx
shrq $0x10, %r8
addl %r8d, %ecx
movl $0xe8, %r8d
callq 0x4a43b
movq 0x18(%rsp), %r9
incl %r15d
addq $0x20, %rbx
jmp 0x124fe
cmpl %edi, %esi
jne 0x125cc
movzwl %ax, %eax
shll $0x5, %eax
leaq 0x34d1f6(%rip), %rdx    # 0x35f8d0
movzwl 0xe(%rdx,%rax), %eax
orw (%rbx), %ax
andl $0x30, %eax
je 0x126b9
jmp 0x125cc
movq 0x28(%rsp), %rsi
incq %rsi
jmp 0x1248d
leaq 0xc7d5e(%rip), %rcx     # 0xda45e
movswq (%rcx), %rcx
leaq 0xc9045(%rip), %rdx     # 0xdb750
movswl (%rdx,%rcx,2), %ebp
movl %ebp, %ecx
andb $0x7, %cl
pushq $0x1
popq %rdx
shll %cl, %edx
movl %ebp, %ecx
sarl $0x3, %ecx
movslq %ecx, %rcx
leaq 0x53fc38(%rip), %r12    # 0x552360
orb %dl, (%r12,%rcx)
movl 0x3c(%rsp), %ecx
shll $0x5, %ecx
negl %ecx
movl %ecx, 0x58(%rsp)
leaq 0x54ac60(%rip), %rbx    # 0x55d3a0
leaq 0x4113e9(%rip), %r15    # 0x423b30
xorl %edx, %edx
movswq %ax, %rcx
cmpq %rcx, %rdx
jge 0x1300e
leaq (%rdx,%rdx), %r14
addq 0xb483f(%rip), %r14     # 0xc6fa0
movl %edx, %eax
shrl $0x3, %eax
movq %rax, 0x88(%rsp)
movq %rdx, 0x80(%rsp)
movl %edx, %ecx
andb $0x7, %cl
pushq $0x1
popq %rax
shll %cl, %eax
movl %eax, 0x5c(%rsp)
movswl (%r14), %edx
testl %edx, %edx
js 0x12ff4
movl %edx, %r14d
movl %edx, %eax
shrl $0x3, %eax
movzbl (%r12,%rax), %eax
movl %edx, %ecx
andl $0x7, %ecx
btl %ecx, %eax
jae 0x12fe9
imulq $0x2c, %r14, %r10
movzwl 0xc(%r15,%r10), %r11d
testb $0x1, %r11b
sete %al
shlb $0x6, %al
addb $-0x8, %al
cmpl %edx, %ebp
movzbl %al, %esi
pushq $0x1f
popq %rax
cmovel %eax, %esi
movl (%r15,%r10), %ecx
movl 0x4(%r15,%r10), %eax
movswl 0x1a(%r15,%r10), %ebp
cmpl $0x2, %ebp
sete %dil
leal -0x1(%rbp), %r8d
cmpw $0x8, %r8w
setae %r8b
orb %dil, %r8b
jne 0x12831
imulq $0xc, %r14, %rdi
leaq 0xd0461(%rip), %r9      # 0xe2c60
movl (%r9,%rdi), %r8d
movl 0x4(%r9,%rdi), %edi
subl %r8d, %ecx
leaq 0xc916e(%rip), %r9      # 0xdb980
movslq (%r9), %r9
movslq %ecx, %rcx
imulq %r9, %rcx
shrq $0x10, %rcx
addl %r8d, %ecx
subl %edi, %eax
cltq
imulq %r9, %rax
shrq $0x10, %rax
addl %edi, %eax
addq %r15, %r10
movl %r11d, %edi
shrl $0x4, %edi
andl $0x3, %edi
leaq 0x6ec94(%rip), %r8      # 0x814d8
movslq (%r8,%rdi,4), %rdi
addq %r8, %rdi
movzbl %sil, %r8d
jmpq *%rdi
movq %rbp, 0x10(%rsp)
subl 0x8(%rsp), %ecx
subl 0xc(%rsp), %eax
movslq %ecx, %rbx
movq 0x30(%rsp), %r13
imulq %rbx, %r13
movq 0x40(%rsp), %r9
imulq %r9, %rbx
shrq $0x10, %rbx
cltq
movq 0x48(%rsp), %rcx
imulq %rax, %rcx
movq 0x20(%rsp), %r12
imulq %r12, %rax
shrq $0x10, %rax
subl %eax, %ebx
shrq $0x10, %rcx
shrq $0x10, %r13
addl %ecx, %r13d
leaq 0xc7bbb(%rip), %rax     # 0xda45e
movswq (%rax), %rax
leaq 0xc9012(%rip), %rcx     # 0xdb8c0
cmpb $0x1, (%rcx,%rax)
jne 0x12edf
movzwl 0x1c(%r10), %ecx
leal 0x200(%rcx), %esi
movl %r8d, 0x18(%rsp)
movl $0x7ff, %r10d           # imm = 0x7FF
andl %r10d, %esi
leaq 0x5632f8(%rip), %rdi    # 0x575bd0
movswl (%rdi,%rsi,2), %esi
shrl $0x7, %esi
andl %r10d, %ecx
movswl (%rdi,%rcx,2), %edi
shrl $0x7, %edi
movswq %si, %rcx
movq %rcx, %rsi
imulq %r9, %rsi
shrq $0x10, %rsi
movswq %di, %rdi
movq %rdi, %r10
imulq %r12, %r10
shrq $0x10, %r10
subl %r10d, %esi
imulq %r9, %rdi
shrq $0x10, %rdi
imulq %r12, %rcx
shrq $0x10, %rcx
addl %edi, %ecx
leaq 0xc8e2d(%rip), %rdi     # 0xdb750
cmpw (%rdi,%rax,2), %dx
cmovel 0x58(%rsp), %ecx
movl $0x0, %eax
cmovel %eax, %esi
leaq 0x59c52d(%rip), %rax    # 0x5aee68
movslq (%rax), %r15
movslq %esi, %r12
movq %r12, %rbp
imulq %r15, %rbp
shrq $0x10, %rbp
movslq %ecx, %rax
movq %rax, 0x28(%rsp)
imulq %rax, %r15
shrq $0x10, %r15
leaq 0x59c509(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
shll $0xb, %edx
leal (%rdx,%rbx), %edi
subl %r12d, %edi
leaq 0x59c4fb(%rip), %rax    # 0x5aee70
movl (%rax), %ecx
shll $0xb, %ecx
leal (%rcx,%r13), %esi
subl %r15d, %esi
addl %ebx, %r12d
addl %r12d, %edx
addl %r13d, %r15d
addl %r15d, %ecx
callq 0x4a43b
movl %ebx, %edi
subl 0x28(%rsp), %edi
leaq 0x59c4cd(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
shll $0xb, %edx
addl %edx, %edi
leaq 0x59c4c3(%rip), %rax    # 0x5aee70
movl (%rax), %ecx
shll $0xb, %ecx
leal (%rcx,%r13), %esi
addl %ebp, %esi
addl %r12d, %edx
addl %r15d, %ecx
movl 0x18(%rsp), %r8d
callq 0x4a43b
leaq 0x59c49d(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
shll $0xb, %edx
addl %edx, %ebx
addl 0x28(%rsp), %ebx
subl %ebp, %r13d
leaq 0x59c48c(%rip), %rax    # 0x5aee70
movl (%rax), %ecx
shll $0xb, %ecx
addl %ecx, %r13d
addl %r12d, %edx
addl %r15d, %ecx
leaq 0x411137(%rip), %r15    # 0x423b30
movl %ebx, %edi
movl %r13d, %esi
movl 0x18(%rsp), %r8d
callq 0x4a43b
jmp 0x12fd6
movswq 0xe(%r10), %rdx
leaq 0x3ceec7(%rip), %rsi    # 0x3e18e0
movsbl 0x1(%rsi,%rdx,4), %esi
movsbl 0x16(%r10), %edi
addl %esi, %edi
movl %edi, %esi
negl %esi
testb $0x4, %r11b
cmovel %edi, %esi
movzwl 0x1c(%r10), %edi
movzbl 0x14(%r10), %r10d
movl %r8d, 0x18(%rsp)
movl %edi, %r8d
movl $0x7ff, %r11d           # imm = 0x7FF
andl %r11d, %r8d
leaq 0x56317e(%rip), %r9     # 0x575bd0
movswq (%r9,%r8,2), %r8
imulq %r10, %r8
addl $0x600, %edi            # imm = 0x600
andl %r11d, %edi
movswq (%r9,%rdi,2), %r9
imulq %r10, %r9
leaq 0x5a442c(%rip), %rdi    # 0x5b6ea0
movswq (%rdi,%rdx,2), %rdx
movl %edx, %ebp
sarl %ebp
addl %esi, %ebp
movslq %ebp, %rsi
movq %rsi, %rdi
imulq %r8, %rdi
shrq $0x10, %rdi
subl %edi, %ecx
imulq %rdx, %r8
shrq $0x10, %r8
imulq %r9, %rsi
shrq $0x10, %rsi
subl %esi, %eax
imulq %rdx, %r9
shrq $0x10, %r9
movl %ecx, %edx
movl 0x8(%rsp), %r15d
subl %r15d, %edx
movl %eax, %esi
movl 0xc(%rsp), %edi
subl %edi, %esi
movslq %edx, %r10
movslq %esi, %rsi
movq 0x48(%rsp), %rbx
movq %rbx, %r11
imulq %rsi, %r11
movq 0x20(%rsp), %r12
imulq %r12, %rsi
shrq $0x10, %rsi
subl %r15d, %r8d
addl %ecx, %r8d
subl %edi, %r9d
addl %eax, %r9d
leaq 0x59c37f(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
shll $0xb, %edx
movl %edx, %edi
subl %esi, %edi
movq 0x30(%rsp), %r15
movq %r15, %rsi
imulq %r10, %rsi
movq 0x40(%rsp), %r13
imulq %r13, %r10
shrq $0x10, %r10
shrq $0x10, %r11
shrq $0x10, %rsi
movslq %r8d, %rax
movslq %r9d, %r8
addl %r10d, %edi
leaq 0x59c349(%rip), %rcx    # 0x5aee70
movl (%rcx), %ecx
shll $0xb, %ecx
addl %ecx, %esi
addl %r11d, %esi
movq %rbx, %r9
leaq 0x54a865(%rip), %rbx    # 0x55d3a0
imulq %r8, %r9
imulq %r12, %r8
shrq $0x10, %r8
subl %r8d, %edx
movq %r15, %r8
leaq 0x410fdc(%rip), %r15    # 0x423b30
imulq %rax, %r8
imulq %r13, %rax
leaq 0x53f7fd(%rip), %r12    # 0x552360
shrq $0x10, %rax
addl %eax, %edx
shrq $0x10, %r8
addl %r8d, %ecx
shrq $0x10, %r9
addl %r9d, %ecx
movl 0x18(%rsp), %r8d
jmp 0x12ed5
leaq 0xc78d6(%rip), %rdx     # 0xda45e
movswq (%rdx), %rdx
leaq 0xc8d2d(%rip), %rsi     # 0xdb8c0
cmpb $0x1, (%rsi,%rdx)
jne 0x12fe9
movswq 0xe(%r10), %rsi
leaq 0x3ced37(%rip), %rdx    # 0x3e18e0
movl (%rdx,%rsi,4), %edx
movl %edx, %edi
shrl $0x8, %edi
movsbl %dil, %edi
movl %r8d, 0x18(%rsp)
movsbl 0x16(%r10), %r8d
addl %edi, %r8d
shrl $0x10, %edx
movsbl %dl, %edx
movsbl 0x17(%r10), %edi
addl %edx, %edi
movl %r8d, %ebp
negl %ebp
testb $0x4, %r11b
cmovel %r8d, %ebp
movl %edi, %r8d
negl %r8d
testb $0x8, %r11b
cmovel %edi, %r8d
movswq 0x1c(%r10), %rdi
leal 0x200(%rdi), %edx
andl $0x7ff, %edx            # imm = 0x7FF
leaq 0x562fce(%rip), %r9     # 0x575bd0
movswq (%r9,%rdx,2), %r12
movswq (%r9,%rdi,2), %r9
leaq 0x5a428d(%rip), %rdi    # 0x5b6ea0
movswq (%rdi,%rsi,2), %rbx
movzbl 0x14(%r10), %edi
leaq 0x595a3c(%rip), %r11    # 0x5a8660
movswq (%r11,%rsi,2), %rdx
movzbl 0x15(%r10), %esi
movl %ebx, %r10d
sarl %r10d
addl %ebp, %r10d
movslq %r10d, %r10
imulq %rdi, %r10
movl %edx, %ebp
sarl %ebp
addl %r8d, %ebp
movslq %ebp, %r15
imulq %rsi, %r15
movq %r10, %r8
imulq %r9, %r8
shrq $0x10, %r8
addl %r8d, %ecx
movq %r15, %r8
imulq %r12, %r8
shrq $0x10, %r8
addl %ecx, %r8d
imulq %r9, %r15
shrq $0x10, %r15
imulq %r12, %r10
shrq $0x10, %r10
subl %r10d, %eax
addl %r15d, %eax
imulq %rbx, %rdi
movq %rdi, %r10
imulq %r9, %r10
shrq $0x10, %r10
movl %r8d, %r11d
subl %r10d, %r11d
imulq %r12, %rdi
shrq $0x10, %rdi
addl %eax, %edi
imulq %rdx, %rsi
imulq %rsi, %r12
shrq $0x10, %r12
imulq %r9, %rsi
shrq $0x10, %rsi
movl %esi, %ecx
negl %ecx
movq %rcx, 0x10(%rsp)
movl %r8d, %r9d
subl 0x8(%rsp), %r9d
movl %eax, %r10d
movl 0xc(%rsp), %ebp
subl %ebp, %r10d
movslq %r9d, %r9
movq 0x30(%rsp), %rbx
imulq %r9, %rbx
movq 0x40(%rsp), %r13
imulq %r13, %r9
shrq $0x10, %r9
movq %r9, %rcx
movslq %r10d, %r9
movq 0x48(%rsp), %r15
movq %r15, %r10
imulq %r9, %r10
imulq 0x20(%rsp), %r9
shrq $0x10, %r9
subl %r9d, %ecx
movq %rcx, 0x28(%rsp)
shrq $0x10, %r10
shrq $0x10, %rbx
addl %r10d, %ebx
movq %rbx, 0x68(%rsp)
movl %r11d, %r9d
movl 0x8(%rsp), %edx
subl %edx, %r9d
movl %edi, %r10d
subl %ebp, %r10d
movslq %r9d, %rbx
movq 0x30(%rsp), %rcx
imulq %rbx, %rcx
imulq %r13, %rbx
shrq $0x10, %rbx
movslq %r10d, %r9
movq %r15, %r10
imulq %r9, %r10
imulq 0x20(%rsp), %r9
shrq $0x10, %r9
subl %r9d, %ebx
shrq $0x10, %r10
shrq $0x10, %rcx
addl %r10d, %ecx
movq %rcx, %r9
movq %rcx, 0x90(%rsp)
addl %edx, %r12d
subl %r12d, %r11d
addl %ebp, %esi
subl %esi, %edi
movslq %r11d, %rbp
movq 0x30(%rsp), %r11
movq %r11, %rdx
imulq %rbp, %rdx
imulq %r13, %rbp
shrq $0x10, %rbp
movslq %edi, %rcx
movq %r15, %r10
movq %r15, %rdi
imulq %rcx, %rdi
imulq 0x20(%rsp), %rcx
shrq $0x10, %rcx
subl %ecx, %ebp
shrq $0x10, %rdi
shrq $0x10, %rdx
addl %edi, %edx
movq %rdx, 0x60(%rsp)
subl %r12d, %r8d
subl %esi, %eax
movslq %r8d, %r15
movq %r11, %r12
imulq %r15, %r12
imulq 0x40(%rsp), %r15
shrq $0x10, %r15
cltq
movq %r10, %rcx
imulq %rax, %rcx
imulq 0x20(%rsp), %rax
shrq $0x10, %rax
subl %eax, %r15d
shrq $0x10, %rcx
shrq $0x10, %r12
addl %ecx, %r12d
leaq 0x59c078(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
shll $0xb, %edx
movq 0x28(%rsp), %rax
leal (%rax,%rdx), %edi
leaq 0x59c068(%rip), %rax    # 0x5aee70
movl (%rax), %ecx
shll $0xb, %ecx
movq 0x68(%rsp), %rax
leal (%rax,%rcx), %esi
addl %ebx, %edx
addl %r9d, %ecx
movl 0x18(%rsp), %r13d
movl %r13d, %r8d
callq 0x4a43b
leaq 0x59c03e(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
shll $0xb, %edx
addl %edx, %ebx
leaq 0x59c034(%rip), %rax    # 0x5aee70
movl (%rax), %ecx
shll $0xb, %ecx
movq 0x90(%rsp), %rsi
addl %ecx, %esi
addl %ebp, %edx
addl 0x60(%rsp), %ecx
movl %ebx, %edi
leaq 0x54a546(%rip), %rbx    # 0x55d3a0
movl %r13d, %r8d
callq 0x4a43b
leaq 0x59c003(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
shll $0xb, %edx
addl %edx, %ebp
leaq 0x59bff9(%rip), %rax    # 0x5aee70
movl (%rax), %ecx
shll $0xb, %ecx
movq 0x60(%rsp), %rsi
addl %ecx, %esi
addl %r15d, %edx
addl %r12d, %ecx
movl %ebp, %edi
movq 0x10(%rsp), %rbp
movl %r13d, %r8d
callq 0x4a43b
leaq 0x59bfcd(%rip), %rax    # 0x5aee6c
movl (%rax), %edx
shll $0xb, %edx
addl %edx, %r15d
leaq 0x59bfc2(%rip), %rax    # 0x5aee70
movl (%rax), %ecx
shll $0xb, %ecx
addl %ecx, %r12d
addl 0x28(%rsp), %edx
addl 0x68(%rsp), %ecx
movl %r15d, %edi
leaq 0x410c68(%rip), %r15    # 0x423b30
movl %r12d, %esi
leaq 0x53f48e(%rip), %r12    # 0x552360
movl %r13d, %r8d
callq 0x4a43b
jmp 0x12fe9
cmpl $0xc1, 0x3c(%rsp)
jl 0x12fd6
leaq 0x563cec(%rip), %rcx    # 0x576be0
movq 0x88(%rsp), %rsi
movzbl (%rcx,%rsi), %ecx
andl 0x5c(%rsp), %ecx
je 0x12fd6
movl 0x1c(%r10), %ecx
subl 0x54(%rsp), %ecx
andl $0x7ff, %ecx            # imm = 0x7FF
leaq 0x59bf49(%rip), %rsi    # 0x5aee68
movslq (%rsi), %r8
leal (,%r8,4), %esi
shll $0x4, %ebx
leaq 0xc881c(%rip), %rdi     # 0xdb750
cmpw (%rdi,%rax,2), %dx
cmovel %esi, %r13d
movl $0x0, %eax
cmovel %eax, %ecx
cmovel %eax, %ebx
leaq 0x59bf1e(%rip), %rax    # 0x5aee6c
movl (%rax), %edi
shll $0xf, %edi
addl %ebx, %edi
shll $0x4, %r13d
leaq 0x59bf10(%rip), %rax    # 0x5aee70
movl (%rax), %esi
shll $0xf, %esi
addl %r13d, %esi
movzbl 0x15(%r10), %edx
imull 0x3c(%rsp), %edx
imulq %r8, %rdx
shrq $0x10, %rdx
movswl 0xe(%r10), %r8d
movsbl 0x10(%r10), %r9d
movzbl 0x11(%r10), %eax
shrb %r11b
andb $0x1, %r11b
leaq 0x565c59(%rip), %r10    # 0x578bf0
movl (%r10), %r10d
leaq 0x567a5f(%rip), %rbx    # 0x57aa00
movl (%rbx), %ebx
leaq 0x59beb6(%rip), %r15    # 0x5aee60
movl (%r15), %r15d
leaq 0x59beb0(%rip), %r12    # 0x5aee64
movl (%r12), %r12d
movzbl %r11b, %r11d
pushq %r12
pushq %r15
leaq 0x410b69(%rip), %r15    # 0x423b30
pushq %rbx
pushq %r10
pushq %r11
pushq %rax
callq 0x48ebe
addq $0x30, %rsp
leaq 0x53f383(%rip), %r12    # 0x552360
leaq 0x54a3bc(%rip), %rbx    # 0x55d3a0
movq 0x10(%rsp), %rbp
addq %r14, %r14
addq %rbx, %r14
jmp 0x12784
movq 0x80(%rsp), %rdx
incq %rdx
leaq 0x563dda(%rip), %rax    # 0x576de0
movzwl (%rax), %eax
jmp 0x12749
xorl %r13d, %r13d
movq 0x70(%rsp), %r12
movq 0x40(%rsp), %rbx
movswq %ax, %rax
cmpq %rax, %r13
jge 0x13187
imulq $0x28, %r13, %rax
leaq 0x3d78ad(%rip), %rcx    # 0x3ea8e0
movswq (%rcx,%rax), %r14
movswl 0x2(%rcx,%rax), %ebp
addl %r14d, %ebp
movq %r14, %rax
shlq $0x5, %rax
leaq 0x34c882(%rip), %rcx    # 0x35f8d0
leaq (%rcx,%rax), %r15
addq $0x10, %r15
cmpl %ebp, %r14d
jge 0x13175
cmpw $0x0, -0x6(%r15)
js 0x13070
incl %r14d
addq $0x20, %r15
jmp 0x13056
movl %r14d, %eax
sarl $0x3, %eax
cltq
leaq 0x53fae1(%rip), %rcx    # 0x552b60
movzbl (%rcx,%rax), %eax
movl %r14d, %ecx
andl $0x7, %ecx
btl %ecx, %eax
jae 0x13067
movswq (%r15), %rax
leaq 0x5a3e07(%rip), %rcx    # 0x5b6ea0
cmpw $0x0, (%rcx,%rax,2)
je 0x13067
leaq 0x5955b9(%rip), %rcx    # 0x5a8660
cmpw $0x0, (%rcx,%rax,2)
je 0x13067
movslq -0x10(%r15), %rdi
movq 0x78(%rsp), %r11
subq %r11, %rdi
movslq -0xc(%r15), %rax
subq %r12, %rax
movq 0x30(%rsp), %rdx
movq %rdx, %rsi
imulq %rdi, %rsi
imulq %rbx, %rdi
shrq $0x10, %rdi
movq 0x48(%rsp), %r10
movq %r10, %rcx
imulq %rax, %rcx
movq 0x20(%rsp), %r9
imulq %r9, %rax
shrq $0x10, %rax
subl %eax, %edi
shrq $0x10, %rcx
shrq $0x10, %rsi
addl %ecx, %esi
movswq -0x8(%r15), %rax
shlq $0x5, %rax
leaq 0x34c7c6(%rip), %rcx    # 0x35f8d0
movslq (%rcx,%rax), %r8
subq %r11, %r8
movslq 0x4(%rcx,%rax), %rcx
subq %r12, %rcx
movq %rdx, %rax
imulq %r8, %rax
imulq %rbx, %r8
shrq $0x10, %r8
leaq 0x59bd3d(%rip), %rdx    # 0x5aee6c
movl (%rdx), %edx
shll $0xb, %edx
addl %edx, %edi
addl %r8d, %edx
movq %r10, %r8
imulq %rcx, %r8
imulq %r9, %rcx
shrq $0x10, %rcx
shrq $0x10, %rax
subl %ecx, %edx
leaq 0x59bd1b(%rip), %rcx    # 0x5aee70
movl (%rcx), %ecx
shll $0xb, %ecx
addl %ecx, %esi
addl %eax, %ecx
shrq $0x10, %r8
addl %r8d, %ecx
movl $0xef, %r8d
callq 0x4a43b
jmp 0x13067
incq %r13
leaq 0x563c61(%rip), %rax    # 0x576de0
movzwl (%rax), %eax
jmp 0x1301b
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)