// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/src/tekgun.c
// Function: shootgun
void
shootgun(short snum,int x,int y,int z,short daang,int dahoriz,
     short dasectnum,char guntype)
{
     short hitsect,hitwall,hitsprite,daang2;
     short bloodhitsect,bloodhitwall,bloodhitsprite;
     int  bloodhitx,bloodhity,bloodhitz;
     int  cx,cy,i,j,daz2,hitx,hity,hitz,xydist,zdist;
     int   rv,pnum;

     if( health[snum] <= 0 ) {
          return;
     }

     guntype+=1;
     switch (guntype) {
     case GUN1FLAG:
          cx=x+(sintable[(daang+2560+128)&2047]>>6);
          cy=y+(sintable[(daang+2048+128)&2047]>>6);
          j=jsinsertsprite(dasectnum, FORCEPROJECTILESTAT);
          if( j != -1 ) {
               fillsprite(j,cx,cy,z,128+2,-16,0,12,16,16,0,0,FORCEBALLPIC,daang,
                          sintable[(daang+2560-11)&2047]>>5, // -17 = travel 3 degrees left
                          sintable[(daang+2048-11)&2047]>>5, // -17 = travel 3 degrees left
                          100-dahoriz,snum+MAXSPRITES,dasectnum,FORCEPROJECTILESTAT,0,0,-1);
          }
          break;
     case GUN2FLAG:
          ammo2[snum]--;
          if( ammo2[snum] < 0 ) {
               ammo2[snum]=0;
               break;
          }
          daang2=daang;
          daz2=(100-dahoriz)*2000;
          hitscan(x,y,z,dasectnum,sintable[(daang2+2560)&2047],
                  sintable[(daang2+2048)&2047],daz2,
                  &hitsect,&hitwall,&hitsprite,&hitx,&hity,&hitz,CLIPMASK1);
          if( (hitsprite >= 0) && (sprptr[hitsprite]->statnum < MAXSTATUS)) {
               if( playerhit(hitsprite, &pnum) ) {
                    playerpainsound(pnum);
                    playerwoundplayer(pnum,snum,2);
               }
               else {
                    switch( sprptr[hitsprite]->picnum ) {
                    default:
                         rv=damagesprite(hitsprite,tekgundamage(guntype,x,y,z,hitsprite));
                         if( (rv == 1) && (goreflag) ) {
                              if( spewblood(hitsprite, hitz, daang) != 0 ) {
                                   sprptr[hitsprite]->cstat&=0xFEFE;  // non hitscan and non block
                                   // must preserve values from previous hitscan call,
                                   // thus the bloodxhitx, bloodwall, etc...
                                   hitscan(x,y,z,dasectnum,sintable[(daang2+2560)&2047],
                                           sintable[(daang2+2048)&2047],daz2,
                                           &bloodhitsect,&bloodhitwall,&bloodhitsprite,&bloodhitx,&bloodhity,&bloodhitz,CLIPMASK1);
                                   if( bloodhitwall != -1 ) {
                                        bloodonwall(bloodhitwall,sprptr[hitsprite]->x,sprptr[hitsprite]->y,sprptr[hitsprite]->z,
                                                    sprptr[hitsprite]->sectnum,daang2,bloodhitx,bloodhity,bloodhitz);
                                   }
                              }
                         }
                         if( rv == 1 ) {
                              killscore(hitsprite,snum,guntype);
                         }
                    break;
               }
               }
          }
          if( hitwall >= 0 ) {
               j=jsinsertsprite(hitsect, 3);
               if( j != -1 ) {
                    fillsprite(j,hitx,hity,hitz+(8<<8),2,0,0,32,22,22,0,0,
                               EXPLOSION,daang,0,0,0,snum+MAXSPRITES,hitsect,3,63,0,-1);
                    movesprite((short)j,
                               -(((int)sintable[(512+daang)&2047]*TICSPERFRAME)<<4),
                               -(((int)sintable[daang]*TICSPERFRAME)<<4),0L,4L<<8,4L<<8,1);
                    playsound(S_RIC1,hitx,hity,0,ST_NOUPDATE);
               }
          }
          break;
     case GUN3FLAG:
          ammo3[snum]--;
          if( ammo3[snum] < 0 ) {
               ammo3[snum]=0;
               break;
          }
          cx=x+(sintable[(daang+2560+256)&2047]>>6);
          cy=y+(sintable[(daang+2048+256)&2047]>>6);
          if( invaccutrak[snum] > 0 ) {
               j=jsinsertsprite(dasectnum, BOMBPROJECTILESTAT);
               if( j != -1 ) {
                    fillsprite(j,cx,cy,z+(4<<8),128,-16,0,32,16,16,0,0,BOMBPIC,daang,
                         sintable[(daang+2560-11)&2047]>>5, // -17 = travel 3 degrees left
                         sintable[(daang+2048-11)&2047]>>5, // -17 = travel 3 degrees left
                         100-dahoriz,snum,dasectnum,BOMBPROJECTILESTAT,0,0,-1);
                    sprptr[j]->owner=snum;
               }
          }
          else {
               j=jsinsertsprite(dasectnum, BOMBPROJECTILESTAT2);
               if( j != -1 ) {
                    fillsprite(j,cx,cy,z+(4<<8),128,-16,0,32,16,16,0,0,BOMBPIC,daang,
                         sintable[(daang+2560-11)&2047]>>5, // -17 = travel 3 degrees left
                         sintable[(daang+2048-11)&2047]>>5, // -17 = travel 3 degrees left
                         100-dahoriz,snum,dasectnum,BOMBPROJECTILESTAT2,0,0,-1);
                    sprptr[j]->owner=snum;
               }
          }
          break;
     case GUN4FLAG:
          ammo4[snum]--;
          if( ammo4[snum] < 0 ) {
               ammo4[snum]=0;
               break;
          }
          cx=x+(sintable[(daang+2560+128)&2047]>>6);
          cy=y+(sintable[(daang+2048+128)&2047]>>6);
          j=jsinsertsprite(dasectnum, DARTPROJECTILESTAT);
          if( j != -1 ) {
               fillsprite(j,cx,cy,z+(5<<8),128,-35,0,12,16,16,0,0, 338 ,daang,
                    sintable[(daang+2560-6)&2047]>>5, // -17 = travel 3 degrees left
                    sintable[(daang+2048-6)&2047]>>5, // -17 = travel 3 degrees left
                    100-dahoriz,snum,dasectnum,DARTPROJECTILESTAT,0,0,-1);
               sprptr[j]->owner=snum;
               playsound(S_RIC1,cx,cy,0,ST_NOUPDATE);

          }
          break;
     case GUN5FLAG:
          daang2=daang;
          daz2=(100-dahoriz)*2000;
          hitscan(x,y,z,dasectnum,sintable[(daang2+2560)&2047],
                  sintable[(daang2+2048)&2047],daz2,
                  &hitsect,&hitwall,&hitsprite,&hitx,&hity,&hitz,CLIPMASK1);
          if( (hitsprite >= 0) && (sprptr[hitsprite]->statnum < MAXSTATUS)) {
               xydist=klabs(posx[snum]-sprptr[hitsprite]->x)+klabs(posy[snum]-sprptr[hitsprite]->y);
               zdist=klabs( (posz[snum]>>8)-((sprptr[hitsprite]->z>>8)-(tilesizy[sprptr[hitsprite]->picnum]>>1)) );
               if( (xydist > 768) || (zdist > 50) ) {
                    break;
               }
               if( playerhit(hitsprite, &pnum) ) {
                    playerpainsound(pnum);
                    playerwoundplayer(pnum,snum,5);
               }
               else {
                    rv=damagesprite(hitsprite,tekgundamage(guntype,x,y,z,hitsprite));
                    if( rv == 1 ) {
                         killscore(hitsprite, snum, guntype);
                    }
               }
          }
          break;
     case GUN6FLAG:
          ammo6[snum]--;
          if( ammo6[snum] < 0 ) {
               ammo6[snum]=0;
               break;
          }
          daang2=daang;
          daz2=(100-dahoriz)*2000;
          hitscan(x,y,z,dasectnum,sintable[(daang2+2560)&2047],
                  sintable[(daang2+2048)&2047],daz2,
                  &hitsect,&hitwall,&hitsprite,&hitx,&hity,&hitz,CLIPMASK1);
          if( (hitsprite >= 0) && (sprptr[hitsprite]->statnum < MAXSTATUS)) {
               xydist=klabs(posx[snum]-sprptr[hitsprite]->x)+klabs(posy[snum]-sprptr[hitsprite]->y);
               zdist=klabs( (posz[snum]>>8)-((sprptr[hitsprite]->z>>8)-(tilesizy[sprptr[hitsprite]->picnum]>>1)) );
               if( (xydist > 2560) || (zdist > 576) ) {
                    break;
               }
               if( playerhit(hitsprite, &pnum) ) {
                    if( playervirus(pnum, FIREPIC) ) {
                         playerwoundplayer(pnum,snum,6);
                    }
               }
               else {
                    attachvirus(hitsprite, FIREPIC);
               }
          }
          break;
     case GUN7FLAG:
          ammo7[snum]--;
          if( ammo7[snum] < 0 ) {
               ammo7[snum]=0;
               break;
          }
          for (i=0 ; i < 3 ; i++) {
               cx=x+(sintable[(daang+2560+256)&2047]>>6);
               cy=y+(sintable[(daang+2048+256)&2047]>>6);
               j=jsinsertsprite(dasectnum,ROCKETPROJECTILESTAT);
               if (j != -1) {
                    fillsprite(j,cx,cy,z+(4<<8),128,-24,0,12,16,16,0,0,335,daang,
                         sintable[(daang+2560-11)&2047]>>(2+i),
                         sintable[(daang+2048-11)&2047]>>(2+i),
                         (100-dahoriz)-(i<<2),
                         snum,dasectnum,ROCKETPROJECTILESTAT,0,0,-1);
               sprptr[j]->owner=snum;
               }
          }
          break;
     case GUN8FLAG:
          ammo8[snum]--;
          if( ammo8[snum] < 0 ) {
               ammo8[snum]=0;
               break;
          }
          cx=x+(sintable[(daang+2560)&2047]>>6);
          cy=y+(sintable[(daang+2048)&2047]>>6);
          j=jsinsertsprite(dasectnum, MATRIXPROJECTILESTAT);
          if( j != -1 ) {
               fillsprite(j,cx,cy,z+(5<<8),128,-35,0,12,16,16,0,0,3765,daang,
                    sintable[(daang+2560)&2047]>>5,
                    sintable[(daang+2048)&2047]>>5,
                    100-dahoriz,snum,dasectnum,MATRIXPROJECTILESTAT,0,0,-1);
               sprptr[j]->owner=snum;
          }
          break;
     default:
          break;
    }

    if( guntype != GUN1FLAG )
          playergunshot(snum);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %ecx, 0x14(%rsp)
movl %edx, 0x18(%rsp)
movl %esi, 0x1c(%rsp)
movq %rdi, 0x28(%rsp)
movslq %edi, %rbp
leaq 0xd1f83(%rip), %rax     # 0xe1590
cmpl $0x0, (%rax,%rbp,4)
jle 0x102b6
movsbl 0xb8(%rsp), %ecx
cmpl $0x7, %ecx
ja 0x102ac
movl %r9d, %r13d
movzwl 0xb0(%rsp), %eax
leal 0x1(%rcx), %esi
leaq 0x7cd43(%rip), %rdx     # 0x8c380
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl %r8d, 0x10(%rsp)
movzwl %r8w, %ebx
leal 0x280(%rbx), %ecx
movl $0x7ff, %ebp            # imm = 0x7FF
andl %ebp, %ecx
leaq 0x56d54d(%rip), %r14    # 0x57cbb0
movzwl (%r14,%rcx,2), %r15d
leal 0x80(%rbx), %ecx
andl %ebp, %ecx
movzwl (%r14,%rcx,2), %r12d
movswl %ax, %edi
movl $0x2c6, %esi            # imm = 0x2C6
callq 0x1e94c
cmpw $-0x1, %ax
je 0x102a2
movswl %r12w, %esi
sarl $0x6, %esi
addl 0x18(%rsp), %esi
movswl %r15w, %r8d
sarl $0x6, %r8d
addl 0x1c(%rsp), %r8d
movswq %ax, %rax
imulq $0x2c, %rax, %rcx
leaq 0x41b45d(%rip), %rdx    # 0x42ab10
leaq (%rdx,%rcx), %rdi
movl %r8d, (%rdx,%rcx)
movl %esi, 0x4(%rdx,%rcx)
movl 0x14(%rsp), %esi
movl %esi, 0x8(%rdx,%rcx)
movl $0x5340082, 0xc(%rdx,%rcx) # imm = 0x5340082
movw $0xf0, 0x10(%rdx,%rcx)
movb $0xc, 0x12(%rdx,%rcx)
movl $0x1010, 0x14(%rdx,%rcx) # imm = 0x1010
movl 0x10(%rsp), %esi
movw %si, 0x1c(%rdx,%rcx)
leal 0x1f5(%rbx), %esi
andl %ebp, %esi
movswl (%r14,%rsi,2), %esi
shrl $0x5, %esi
movw %si, 0x20(%rdx,%rcx)
addl $0x7f5, %ebx            # imm = 0x7F5
andl %ebp, %ebx
movswl (%r14,%rbx,2), %esi
shrl $0x5, %esi
movw %si, 0x22(%rdx,%rcx)
movl $0x64, %esi
subl %r13d, %esi
movw %si, 0x24(%rdx,%rcx)
movq 0x28(%rsp), %rsi
addl $0x4000, %esi           # imm = 0x4000
movw %si, 0x1e(%rdx,%rcx)
movl $0x0, 0x26(%rdx,%rcx)
movw $0xffff, 0x2a(%rdx,%rcx) # imm = 0xFFFF
leaq (%rax,%rax,2), %rsi
shlq $0x2, %rsi
addq 0xbe867(%rip), %rsi     # 0xcdfb8
movl $0x3, %edx
callq 0x5da55
jmp 0x102a2
movl %esi, 0x40(%rsp)
movl $0x64, %ecx
subl %r13d, %ecx
imull $0x7d0, %ecx, %r10d     # imm = 0x7D0
movzwl %r8w, %ecx
leal 0x200(%rcx), %edx
movl $0x7ff, %esi            # imm = 0x7FF
andl %esi, %edx
leaq 0x56d425(%rip), %rdi    # 0x57cbb0
movswl (%rdi,%rdx,2), %r8d
andl %esi, %ecx
movswl (%rdi,%rcx,2), %r9d
leaq 0x30(%rsp), %r11
leaq 0x34(%rsp), %rbx
leaq 0x38(%rsp), %r14
leaq 0xe(%rsp), %r15
leaq 0x24(%rsp), %r12
leaq 0x26(%rsp), %r13
movswl %ax, %ecx
movl 0x1c(%rsp), %edi
movl 0x18(%rsp), %esi
movl 0x14(%rsp), %edx
pushq $0x1000040              # imm = 0x1000040
pushq %r11
pushq %rbx
pushq %r14
pushq %r15
pushq %r12
pushq %r13
pushq %r10
callq 0x473e4
addq $0x40, %rsp
movswq (%r15), %rdi
testq %rdi, %rdi
js 0x102a2
leaq 0x11ea1d(%rip), %rax    # 0x12e210
movq (%rax,%rdi,8), %rcx
cmpw $0x3ff, 0x1a(%rcx)      # imm = 0x3FF
jg 0x102a2
leaq 0xd1cc6(%rip), %rdx     # 0xe14d0
movl (%rdx,%rbp,4), %edx
subl (%rcx), %edx
movl %edx, %ecx
negl %ecx
cmovsl %edx, %ecx
leaq 0xd1cf3(%rip), %rdx     # 0xe1510
movl (%rdx,%rbp,4), %edx
movq (%rax,%rdi,8), %rax
subl 0x4(%rax), %edx
movl %edx, %esi
negl %esi
cmovsl %edx, %esi
addl %ecx, %esi
leaq 0xd1d19(%rip), %rcx     # 0xe1550
movl (%rcx,%rbp,4), %ecx
sarl $0x8, %ecx
movl 0x8(%rax), %edx
sarl $0x8, %edx
subl %edx, %ecx
movswq 0xe(%rax), %rax
leaq 0x59fdef(%rip), %rdx    # 0x5af640
movswl (%rdx,%rax,2), %edx
sarl %edx
addl %ecx, %edx
movl %edx, %eax
negl %eax
cmovsl %edx, %eax
cmpl $0x300, %esi            # imm = 0x300
ja 0x102a2
cmpl $0x32, %eax
ja 0x102a2
leaq 0x20(%rsp), %rsi
callq 0x22b8d
testl %eax, %eax
je 0x102c5
movl 0x20(%rsp), %edi
callq 0xf566
movswl 0x20(%rsp), %edi
movswl 0x28(%rsp), %esi
movl $0x5, %edx
jmp 0xfdcd
leaq 0x11c975(%rip), %rcx    # 0x12c220
decw (%rcx,%rbp,2)
js 0xff64
movl %r8d, 0x10(%rsp)
movzwl %r8w, %ebx
leal 0x300(%rbx), %ecx
movl $0x7ff, %edx            # imm = 0x7FF
andl %edx, %ecx
leaq 0x56d2de(%rip), %r15    # 0x57cbb0
movswl (%r15,%rcx,2), %r12d
sarl $0x6, %r12d
addl 0x1c(%rsp), %r12d
leal 0x100(%rbx), %ecx
andl %edx, %ecx
movswl (%r15,%rcx,2), %r14d
sarl $0x6, %r14d
addl 0x18(%rsp), %r14d
leaq 0x11e503(%rip), %rcx    # 0x12de00
cmpl $0x0, (%rcx,%rbp,4)
jle 0xff6f
movswl %ax, %edi
movl $0x2ca, %esi            # imm = 0x2CA
jmp 0xff77
leaq 0x11c925(%rip), %rcx    # 0x12c240
decw (%rcx,%rbp,2)
js 0xff64
movl %r8d, 0x10(%rsp)
movzwl %r8w, %ebx
leal 0x280(%rbx), %ecx
movl $0x7ff, %edx            # imm = 0x7FF
andl %edx, %ecx
leaq 0x56d26e(%rip), %r15    # 0x57cbb0
movzwl (%r15,%rcx,2), %r14d
leal 0x80(%rbx), %ecx
andl %edx, %ecx
movzwl (%r15,%rcx,2), %ebp
movswl %ax, %edi
movl $0x2c8, %esi            # imm = 0x2C8
callq 0x1e94c
cmpw $-0x1, %ax
je 0x102a2
movswl %bp, %ebp
sarl $0x6, %ebp
addl 0x18(%rsp), %ebp
movl $0x7ff, %esi            # imm = 0x7FF
movswl %r14w, %r12d
sarl $0x6, %r12d
addl 0x1c(%rsp), %r12d
movswq %ax, %r14
imulq $0x2c, %r14, %rax
leaq 0x41b17a(%rip), %rcx    # 0x42ab10
leaq (%rcx,%rax), %rdi
movl %r12d, (%rcx,%rax)
movl %ebp, 0x4(%rcx,%rax)
movl 0x14(%rsp), %edx
addl $0x500, %edx            # imm = 0x500
movl %edx, 0x8(%rcx,%rax)
movl $0x1520080, 0xc(%rcx,%rax) # imm = 0x1520080
movw $0xdd, 0x10(%rcx,%rax)
movb $0xc, 0x12(%rcx,%rax)
movl $0x1010, 0x14(%rcx,%rax) # imm = 0x1010
movl 0x10(%rsp), %edx
movw %dx, 0x1c(%rcx,%rax)
leal 0x1fa(%rbx), %edx
andl %esi, %edx
movswl (%r15,%rdx,2), %edx
shrl $0x5, %edx
movw %dx, 0x20(%rcx,%rax)
addl $0x7fa, %ebx            # imm = 0x7FA
andl %esi, %ebx
movswl (%r15,%rbx,2), %edx
shrl $0x5, %edx
movw %dx, 0x22(%rcx,%rax)
movl $0x64, %edx
subl %r13d, %edx
movw %dx, 0x24(%rcx,%rax)
movq 0x28(%rsp), %rbx
movw %bx, 0x1e(%rcx,%rax)
movl $0x0, 0x26(%rcx,%rax)
movw $0xffff, 0x2a(%rcx,%rax) # imm = 0xFFFF
leaq (%r14,%r14,2), %rsi
shlq $0x2, %rsi
addq 0xbe584(%rip), %rsi     # 0xcdfb8
movl $0x3, %edx
callq 0x5da55
leaq 0x11e7cb(%rip), %rax    # 0x12e210
movq (%rax,%r14,8), %rax
movw %bx, 0x1e(%rax)
movl $0x55, %edi
movl %r12d, %esi
movl %ebp, %edx
jmp 0x10295
leaq 0x11c85d(%rip), %rcx    # 0x12c2c0
decw (%rcx,%rbp,2)
js 0xff64
movl %r8d, 0x10(%rsp)
movzwl %r8w, %ebx
leal 0x200(%rbx), %r14d
movl $0x7ff, %ecx            # imm = 0x7FF
andl %ecx, %r14d
leaq 0x56d124(%rip), %r15    # 0x57cbb0
movzwl (%r15,%r14,2), %ebp
andl %ecx, %ebx
movzwl (%r15,%rbx,2), %r12d
movswl %ax, %edi
movl $0x2d0, %esi            # imm = 0x2D0
callq 0x1e94c
cmpw $-0x1, %ax
je 0x102a2
movswl %r12w, %ecx
sarl $0x6, %ecx
addl 0x18(%rsp), %ecx
movswl %bp, %edx
sarl $0x6, %edx
addl 0x1c(%rsp), %edx
movswq %ax, %r12
imulq $0x2c, %r12, %rax
leaq 0x41b03d(%rip), %rsi    # 0x42ab10
leaq (%rsi,%rax), %rdi
movl %edx, (%rsi,%rax)
movl %ecx, 0x4(%rsi,%rax)
movl 0x14(%rsp), %ecx
addl $0x500, %ecx            # imm = 0x500
movl %ecx, 0x8(%rsi,%rax)
movl $0xeb50080, 0xc(%rsi,%rax) # imm = 0xEB50080
movw $0xdd, 0x10(%rsi,%rax)
movb $0xc, 0x12(%rsi,%rax)
movl $0x1010, 0x14(%rsi,%rax) # imm = 0x1010
movl 0x10(%rsp), %ecx
movw %cx, 0x1c(%rsi,%rax)
movswl (%r15,%r14,2), %ecx
shrl $0x5, %ecx
movw %cx, 0x20(%rsi,%rax)
movswl (%r15,%rbx,2), %ecx
shrl $0x5, %ecx
movw %cx, 0x22(%rsi,%rax)
movl $0x64, %ecx
subl %r13d, %ecx
movw %cx, 0x24(%rsi,%rax)
movq 0x28(%rsp), %rbx
movw %bx, 0x1e(%rsi,%rax)
movl $0x0, 0x26(%rsi,%rax)
movw $0xffff, 0x2a(%rsi,%rax) # imm = 0xFFFF
leaq (%r12,%r12,2), %rsi
shlq $0x2, %rsi
addq 0xbe458(%rip), %rsi     # 0xcdfb8
movl $0x3, %edx
callq 0x5da55
leaq 0x11e69f(%rip), %rax    # 0x12e210
movq (%rax,%r12,8), %rax
jmp 0x10051
leaq 0x11c67f(%rip), %rcx    # 0x12c200
decw (%rcx,%rbp,2)
js 0xff64
movl %esi, 0x40(%rsp)
movl $0x64, %ecx
subl %r13d, %ecx
imull $0x7d0, %ecx, %ebp      # imm = 0x7D0
movl %r8d, 0x10(%rsp)
movzwl %r8w, %ebx
leal 0x200(%rbx), %esi
movl $0x7ff, %ecx            # imm = 0x7FF
andl %ecx, %esi
leaq 0x56cff6(%rip), %rdx    # 0x57cbb0
movq %rsi, 0x48(%rsp)
movswl (%rdx,%rsi,2), %r8d
andl %ecx, %ebx
movswl (%rdx,%rbx,2), %r9d
leaq 0x30(%rsp), %r10
leaq 0x34(%rsp), %r11
leaq 0x38(%rsp), %r14
leaq 0xe(%rsp), %r15
leaq 0x24(%rsp), %r12
leaq 0x26(%rsp), %r13
movswl %ax, %ecx
movl 0x1c(%rsp), %edi
movl 0x18(%rsp), %esi
movl 0x14(%rsp), %edx
movl %ecx, 0x3c(%rsp)
pushq $0x1000040              # imm = 0x1000040
pushq %r10
pushq %r11
pushq %r14
pushq %r15
pushq %r12
pushq %r13
pushq %rbp
callq 0x473e4
addq $0x40, %rsp
movswl (%r15), %edi
testl %edi, %edi
js 0x10180
movzwl %di, %eax
leaq 0x11e5e3(%rip), %r14    # 0x12e210
movq (%r14,%rax,8), %rax
cmpw $0x3ff, 0x1a(%rax)      # imm = 0x3FF
jg 0x10180
leaq 0x20(%rsp), %rsi
callq 0x22b8d
testl %eax, %eax
je 0x1005a
movl 0x20(%rsp), %edi
callq 0xf566
movswl 0x20(%rsp), %edi
movswl 0x28(%rsp), %esi
movl $0x2, %edx
callq 0xf3b7
jmp 0x10180
leaq 0x11c608(%rip), %rcx    # 0x12c280
decw (%rcx,%rbp,2)
js 0xff64
movl $0x64, %ecx
subl %r13d, %ecx
imull $0x7d0, %ecx, %r10d     # imm = 0x7D0
movzwl %r8w, %ecx
leal 0x200(%rcx), %edx
movl $0x7ff, %esi            # imm = 0x7FF
andl %esi, %edx
leaq 0x56cf07(%rip), %rdi    # 0x57cbb0
movswl (%rdi,%rdx,2), %r8d
andl %esi, %ecx
movswl (%rdi,%rcx,2), %r9d
leaq 0x30(%rsp), %r11
leaq 0x34(%rsp), %rbx
leaq 0x38(%rsp), %r14
leaq 0xe(%rsp), %r15
leaq 0x24(%rsp), %r12
leaq 0x26(%rsp), %r13
movswl %ax, %ecx
movl 0x1c(%rsp), %edi
movl 0x18(%rsp), %esi
movl 0x14(%rsp), %edx
pushq $0x1000040              # imm = 0x1000040
pushq %r11
pushq %rbx
pushq %r14
pushq %r15
pushq %r12
pushq %r13
pushq %r10
callq 0x473e4
addq $0x40, %rsp
movswq (%r15), %rdi
testq %rdi, %rdi
js 0x102a2
leaq 0x11e4ff(%rip), %rax    # 0x12e210
movq (%rax,%rdi,8), %rcx
cmpw $0x3ff, 0x1a(%rcx)      # imm = 0x3FF
jg 0x102a2
leaq 0xd17a8(%rip), %rdx     # 0xe14d0
movl (%rdx,%rbp,4), %edx
subl (%rcx), %edx
movl %edx, %ecx
negl %ecx
cmovsl %edx, %ecx
leaq 0xd17d5(%rip), %rdx     # 0xe1510
movl (%rdx,%rbp,4), %edx
movq (%rax,%rdi,8), %rax
subl 0x4(%rax), %edx
movl %edx, %esi
negl %esi
cmovsl %edx, %esi
addl %ecx, %esi
leaq 0xd17fb(%rip), %rcx     # 0xe1550
movl (%rcx,%rbp,4), %ecx
sarl $0x8, %ecx
movl 0x8(%rax), %edx
sarl $0x8, %edx
subl %edx, %ecx
movswq 0xe(%rax), %rax
leaq 0x59f8d1(%rip), %rdx    # 0x5af640
movswl (%rdx,%rax,2), %edx
sarl %edx
addl %ecx, %edx
movl %edx, %eax
negl %eax
cmovsl %edx, %eax
cmpl $0xa00, %esi            # imm = 0xA00
ja 0x102a2
cmpl $0x240, %eax            # imm = 0x240
ja 0x102a2
leaq 0x20(%rsp), %rsi
callq 0x22b8d
testl %eax, %eax
je 0x10301
movswl 0x20(%rsp), %edi
movl $0x1c2, %esi            # imm = 0x1C2
callq 0x20cb0
testl %eax, %eax
je 0x102a2
movswl 0x20(%rsp), %edi
movswl 0x28(%rsp), %esi
movl $0x6, %edx
callq 0xf3b7
jmp 0x102a2
leaq 0x11c4c2(%rip), %rcx    # 0x12c2a0
decw (%rcx,%rbp,2)
js 0xff64
movl %r8d, 0x10(%rsp)
movzwl %r8w, %edx
leal 0x300(%rdx), %esi
movl $0x7ff, %ecx            # imm = 0x7FF
andl %ecx, %esi
movq %rsi, 0x40(%rsp)
leal 0x100(%rdx), %esi
andl %ecx, %esi
movq %rsi, 0x48(%rsp)
addl $0x400, 0x14(%rsp)      # imm = 0x400
leal 0x1f5(%rdx), %esi
andl %ecx, %esi
movq %rsi, 0x68(%rsp)
addl $0x7f5, %edx            # imm = 0x7F5
andl %ecx, %edx
movq %rdx, 0x70(%rsp)
movl $0x64, %r12d
subl %r13d, %r12d
movl $0x2, %r13d
leaq 0x56cd68(%rip), %rbx    # 0x57cbb0
cwtl
movl %eax, 0x3c(%rsp)
leaq 0x41acbc(%rip), %r14    # 0x42ab10
movq 0x40(%rsp), %rax
movzwl (%rbx,%rax,2), %r15d
movq 0x48(%rsp), %rax
movzwl (%rbx,%rax,2), %ebp
movl 0x3c(%rsp), %edi
movl $0x2ce, %esi            # imm = 0x2CE
callq 0x1e94c
cmpw $-0x1, %ax
je 0xff4e
movswl %r15w, %ecx
sarl $0x6, %ecx
addl 0x1c(%rsp), %ecx
movswq %ax, %r15
imulq $0x2c, %r15, %rax
movl %ecx, (%r14,%rax)
movswl %bp, %ecx
sarl $0x6, %ecx
addl 0x18(%rsp), %ecx
movl %ecx, 0x4(%r14,%rax)
movl 0x14(%rsp), %ecx
movl %ecx, 0x8(%r14,%rax)
movl $0x14f0080, 0xc(%r14,%rax) # imm = 0x14F0080
movw $0xe8, 0x10(%r14,%rax)
movb $0xc, 0x12(%r14,%rax)
movl $0x1010, 0x14(%r14,%rax) # imm = 0x1010
movq 0x68(%rsp), %rcx
movswl (%rbx,%rcx,2), %edx
movl %r13d, %ecx
sarl %cl, %edx
movl 0x10(%rsp), %ecx
movw %cx, 0x1c(%r14,%rax)
movw %dx, 0x20(%r14,%rax)
movq 0x70(%rsp), %rcx
movswl (%rbx,%rcx,2), %edx
movl %r13d, %ecx
sarl %cl, %edx
movw %dx, 0x22(%r14,%rax)
leaq (%r14,%rax), %rdi
movw %r12w, 0x24(%r14,%rax)
movq 0x28(%rsp), %rbp
movw %bp, 0x1e(%r14,%rax)
movl $0x0, 0x26(%r14,%rax)
movw $0xffff, 0x2a(%r14,%rax) # imm = 0xFFFF
leaq (%r15,%r15,2), %rsi
shlq $0x2, %rsi
addq 0xbe083(%rip), %rsi     # 0xcdfb8
movl $0x3, %edx
callq 0x5da55
leaq 0x11e2ca(%rip), %rax    # 0x12e210
movq (%rax,%r15,8), %rax
movw %bp, 0x1e(%rax)
addl $-0x4, %r12d
incl %r13d
cmpl $0x5, %r13d
jne 0xfe54
jmp 0x102a2
movw $0x0, (%rcx,%rbp,2)
jmp 0x102a2
movswl %ax, %edi
movl $0x2cc, %esi            # imm = 0x2CC
callq 0x1e94c
cmpw $-0x1, %ax
je 0x102a2
movq %r15, %r8
movswq %ax, %r15
imulq $0x2c, %r15, %rax
leaq 0x41ab78(%rip), %rcx    # 0x42ab10
leaq (%rcx,%rax), %rdi
movl %r12d, (%rcx,%rax)
movl %r14d, 0x4(%rcx,%rax)
movl 0x14(%rsp), %edx
addl $0x400, %edx            # imm = 0x400
movl %edx, 0x8(%rcx,%rax)
movl $0x13a0080, 0xc(%rcx,%rax) # imm = 0x13A0080
movw $0xf0, 0x10(%rcx,%rax)
movb $0x20, 0x12(%rcx,%rax)
movl $0x1010, 0x14(%rcx,%rax) # imm = 0x1010
movl 0x10(%rsp), %edx
movw %dx, 0x1c(%rcx,%rax)
leal 0x1f5(%rbx), %edx
movl $0x7ff, %esi            # imm = 0x7FF
andl %esi, %edx
movswl (%r8,%rdx,2), %edx
shrl $0x5, %edx
movw %dx, 0x20(%rcx,%rax)
addl $0x7f5, %ebx            # imm = 0x7F5
andl %esi, %ebx
movswl (%r8,%rbx,2), %edx
shrl $0x5, %edx
movw %dx, 0x22(%rcx,%rax)
movl $0x64, %edx
subl %r13d, %edx
movw %dx, 0x24(%rcx,%rax)
movq 0x28(%rsp), %rbx
movw %bx, 0x1e(%rcx,%rax)
movl $0x0, 0x26(%rcx,%rax)
movw $0xffff, 0x2a(%rcx,%rax) # imm = 0xFFFF
leaq (%r15,%r15,2), %rsi
shlq $0x2, %rsi
addq 0xbdf7c(%rip), %rsi     # 0xcdfb8
movl $0x3, %edx
callq 0x5da55
leaq 0x11e1c3(%rip), %rax    # 0x12e210
movq (%rax,%r15,8), %rax
movw %bx, 0x1e(%rax)
jmp 0x102a2
movswl 0xe(%rsp), %edi
leaq 0x11df9e(%rip), %rax    # 0x12e004
cmpl $0x3, (%rax)
movl $0x6, %eax
movl $0xc, %esi
cmovbl %eax, %esi
callq 0x21942
movl %eax, %r13d
cmpl $0x1, %eax
jne 0x10166
cmpl $0x0, 0x11c2d2(%rip)    # 0x12c360
je 0x10166
movswl 0xe(%rsp), %edi
movl 0x30(%rsp), %esi
movswl 0x10(%rsp), %r15d
movl %r15d, %edx
callq 0x209e4
testl %eax, %eax
je 0x10166
movswq 0xe(%rsp), %rax
movq (%r14,%rax,8), %rax
andw $0xfefe, 0xc(%rax)      # imm = 0xFEFE
leaq 0x56cae6(%rip), %rax    # 0x57cbb0
movq 0x48(%rsp), %rcx
movswl (%rax,%rcx,2), %r8d
movswl (%rax,%rbx,2), %r9d
leaq 0x54(%rsp), %rax
leaq 0x58(%rsp), %r10
leaq 0x5c(%rsp), %r11
leaq 0x62(%rsp), %rbx
leaq 0x64(%rsp), %r12
movl 0x1c(%rsp), %edi
movl 0x18(%rsp), %esi
movl 0x14(%rsp), %edx
movl 0x3c(%rsp), %ecx
pushq $0x1000040              # imm = 0x1000040
pushq %rax
pushq %r10
pushq %r11
pushq %rbx
pushq %r12
leaq 0x96(%rsp), %rax
pushq %rax
pushq %rbp
callq 0x473e4
addq $0x40, %rsp
movswl (%r12), %edi
cmpl $-0x1, %edi
je 0x10166
movswq 0xe(%rsp), %rax
movq (%r14,%rax,8), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
movl 0x8(%rax), %ecx
movswl 0x18(%rax), %r8d
movl 0x5c(%rsp), %eax
movl 0x58(%rsp), %r10d
movl 0x54(%rsp), %r11d
subq $0x8, %rsp
movl %r15d, %r9d
pushq %r11
pushq %r10
pushq %rax
callq 0x207e6
addq $0x20, %rsp
cmpl $0x1, %r13d
jne 0x10180
movswl 0xe(%rsp), %edi
movswl 0x28(%rsp), %esi
movsbl 0x40(%rsp), %edx
callq 0xf44e
cmpw $0x0, 0x24(%rsp)
js 0x102a2
movswl 0x26(%rsp), %edi
movl $0x3, %esi
callq 0x1e94c
cmpw $-0x1, %ax
je 0x102a2
movl %eax, %ebp
movswq %ax, %rax
imulq $0x2c, %rax, %rcx
leaq 0x41a95a(%rip), %rdx    # 0x42ab10
leaq (%rdx,%rcx), %rdi
movl 0x38(%rsp), %esi
movl %esi, (%rdx,%rcx)
movl 0x34(%rsp), %esi
movl %esi, 0x4(%rdx,%rcx)
movl $0x800, %esi            # imm = 0x800
addl 0x30(%rsp), %esi
movl %esi, 0x8(%rdx,%rcx)
movl $0x1ab0002, 0xc(%rdx,%rcx) # imm = 0x1AB0002
xorl %esi, %esi
movw %si, 0x10(%rdx,%rcx)
movb $0x20, 0x12(%rdx,%rcx)
movl $0x1616, 0x14(%rdx,%rcx) # imm = 0x1616
movl 0x10(%rsp), %ebx
movw %bx, 0x1c(%rdx,%rcx)
movl $0x0, 0x20(%rdx,%rcx)
movw %si, 0x24(%rdx,%rcx)
movq 0x28(%rsp), %rsi
addl $0x4000, %esi           # imm = 0x4000
movw %si, 0x1e(%rdx,%rcx)
movl $0x3f, 0x26(%rdx,%rcx)
movw $0xffff, 0x2a(%rdx,%rcx) # imm = 0xFFFF
leaq (%rax,%rax,2), %rsi
shlq $0x2, %rsi
addq 0xbdd82(%rip), %rsi     # 0xcdfb8
movl $0x3, %edx
callq 0x5da55
leaq 0x56c969(%rip), %rcx    # 0x57cbb0
movq 0x48(%rsp), %rax
movswl (%rcx,%rax,2), %eax
shll $0x4, %eax
leal (%rax,%rax,2), %esi
negl %esi
movswq %bx, %rax
movswl (%rcx,%rax,2), %eax
shll $0x4, %eax
leal (%rax,%rax,2), %edx
negl %edx
subq $0x8, %rsp
movswl %bp, %edi
xorl %ecx, %ecx
movl $0x400, %r8d            # imm = 0x400
movl $0x400, %r9d            # imm = 0x400
pushq $0x1
callq 0x1cfc1
addq $0x10, %rsp
movl 0x38(%rsp), %esi
movl 0x34(%rsp), %edx
movl $0x55, %edi
xorl %ecx, %ecx
movl $0x4, %r8d
callq 0x1c1f1
cmpb $0x0, 0xb8(%rsp)
je 0x102b6
movswl 0x28(%rsp), %edi
callq 0x220a7
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movswl 0xe(%rsp), %edi
leaq 0x11dd33(%rip), %rax    # 0x12e004
cmpl $0x3, (%rax)
movl $0x6, %eax
movl $0xc, %esi
cmovbl %eax, %esi
callq 0x21942
cmpl $0x1, %eax
jne 0x102a2
movswl 0xe(%rsp), %edi
movswl 0x28(%rsp), %esi
movsbl 0x40(%rsp), %edx
callq 0xf44e
jmp 0x102a2
movswl 0xe(%rsp), %edi
movl $0x1c2, %esi            # imm = 0x1C2
callq 0x20e02
jmp 0x102a2