// File: /workspace/github_c_makefile_star2_O2/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 %r8d, 0x10(%rsp)
movl %ecx, 0x14(%rsp)
movl %edx, 0x18(%rsp)
movl %esi, 0x1c(%rsp)
movslq %edi, %r14
leaq 0xcbf0d(%rip), %rax     # 0xda590
cmpl $0x0, (%rax,%r14,4)
jle 0xf2f3
movb 0xb8(%rsp), %al
movsbl %al, %ecx
movl %edi, 0x24(%rsp)
movswl %di, %eax
movl %eax, 0x2c(%rsp)
cmpl $0x7, %ecx
ja 0xf2ea
movl %r9d, %ebx
movzwl 0xb0(%rsp), %eax
leal 0x1(%rcx), %esi
leaq 0x72cd3(%rip), %rdx     # 0x81394
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movzwl 0x10(%rsp), %r14d
leal 0x280(%r14), %ecx
movl $0x7ff, %ebp            # imm = 0x7FF
andl %ebp, %ecx
leaq 0x5674eb(%rip), %r15    # 0x575bd0
movzwl (%r15,%rcx,2), %r12d
leal 0x80(%r14), %ecx
andl %ebp, %ecx
movzwl (%r15,%rcx,2), %r13d
movswl %ax, %edi
movl $0x2c6, %esi            # imm = 0x2C6
callq 0x1cf0c
cmpw $-0x1, %ax
movl 0x24(%rsp), %r8d
je 0xf2f3
movswl %r13w, %esi
sarl $0x6, %esi
addl 0x18(%rsp), %esi
movswl %r12w, %edi
sarl $0x6, %edi
addl 0x1c(%rsp), %edi
movswq %ax, %rax
imulq $0x2c, %rax, %rcx
leaq 0x4153f7(%rip), %rdx    # 0x423b30
movl %edi, (%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(%r14), %esi
andl %ebp, %esi
movswl (%r15,%rsi,2), %esi
shrl $0x5, %esi
movw %si, 0x20(%rdx,%rcx)
addl $0x7f5, %r14d           # imm = 0x7F5
andl %ebp, %r14d
movswl (%r15,%r14,2), %esi
shrl $0x5, %esi
movw %si, 0x22(%rdx,%rcx)
pushq $0x64
popq %rsi
subl %ebx, %esi
movw %si, 0x24(%rdx,%rcx)
addl $0x4000, %r8d           # imm = 0x4000
movw %r8w, 0x1e(%rdx,%rcx)
andl $0x0, 0x26(%rdx,%rcx)
orw $-0x1, 0x2a(%rdx,%rcx)
leaq (%rdx,%rcx), %rdi
imulq $0xc, %rax, %rsi
addq 0xb87ed(%rip), %rsi     # 0xc6fb8
pushq $0x3
popq %rdx
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x56a36
movl %esi, 0x40(%rsp)
pushq $0x64
popq %rcx
subl %ebx, %ecx
imull $0x7d0, %ecx, %r10d     # imm = 0x7D0
movzwl 0x10(%rsp), %ecx
leal 0x200(%rcx), %edx
movl $0x7ff, %esi            # imm = 0x7FF
andl %esi, %edx
leaq 0x5673c6(%rip), %rdi    # 0x575bd0
movswl (%rdi,%rdx,2), %r8d
andl %esi, %ecx
movswl (%rdi,%rcx,2), %r9d
leaq 0x30(%rsp), %r11
leaq 0x34(%rsp), %rbx
leaq 0x38(%rsp), %r15
leaq 0xe(%rsp), %r12
leaq 0x28(%rsp), %r13
leaq 0x2a(%rsp), %rbp
movswl %ax, %ecx
movl 0x1c(%rsp), %edi
movl 0x18(%rsp), %esi
movl 0x14(%rsp), %edx
pushq $0x1000040              # imm = 0x1000040
pushq %r11
pushq %rbx
pushq %r15
pushq %r12
pushq %r13
pushq %rbp
pushq %r10
callq 0x447c6
addq $0x40, %rsp
movswq (%r12), %rdi
testq %rdi, %rdi
js 0xf2ea
leaq 0x1189be(%rip), %rax    # 0x127230
movq (%rax,%rdi,8), %rax
cmpw $0x3ff, 0x1a(%rax)      # imm = 0x3FF
jg 0xf2ea
leaq 0xcbc47(%rip), %rcx     # 0xda4d0
movl (%rcx,%r14,4), %ecx
subl (%rax), %ecx
movl %ecx, %edx
negl %edx
cmovsl %ecx, %edx
leaq 0xcbc73(%rip), %rcx     # 0xda510
movl (%rcx,%r14,4), %ecx
subl 0x4(%rax), %ecx
movl %ecx, %esi
negl %esi
cmovsl %ecx, %esi
addl %edx, %esi
leaq 0xcbc9c(%rip), %rcx     # 0xda550
movl (%rcx,%r14,4), %ecx
sarl $0x8, %ecx
movl 0x8(%rax), %edx
sarl $0x8, %edx
subl %edx, %ecx
movswq 0xe(%rax), %rax
leaq 0x599d91(%rip), %rdx    # 0x5a8660
movswl (%rdx,%rax,2), %edx
sarl %edx
addl %ecx, %edx
movl %edx, %eax
negl %eax
cmovsl %edx, %eax
cmpl $0x300, %esi            # imm = 0x300
ja 0xf2ea
cmpl $0x32, %eax
ja 0xf2ea
leaq 0x20(%rsp), %rsi
callq 0x20d25
testl %eax, %eax
je 0xf191
movl 0x20(%rsp), %edi
callq 0xe5f6
movswl 0x20(%rsp), %edi
pushq $0x5
jmp 0xee1f
leaq 0x1168ff(%rip), %rcx    # 0x125220
decw (%rcx,%r14,2)
js 0xefa7
movzwl 0x10(%rsp), %r15d
leal 0x300(%r15), %ecx
movl $0x7ff, %edx            # imm = 0x7FF
andl %edx, %ecx
leaq 0x567289(%rip), %r12    # 0x575bd0
movswl (%r12,%rcx,2), %ebp
sarl $0x6, %ebp
addl 0x1c(%rsp), %ebp
leal 0x100(%r15), %ecx
andl %edx, %ecx
movswl (%r12,%rcx,2), %r13d
sarl $0x6, %r13d
addl 0x18(%rsp), %r13d
leaq 0x11849f(%rip), %rcx    # 0x126e10
cmpl $0x0, (%rcx,%r14,4)
jle 0xefb2
movswl %ax, %edi
movl $0x2ca, %esi            # imm = 0x2CA
jmp 0xefba
leaq 0x1168b0(%rip), %rcx    # 0x125240
decw (%rcx,%r14,2)
js 0xefa7
movzwl 0x10(%rsp), %r15d
leal 0x280(%r15), %ecx
movl $0x7ff, %edx            # imm = 0x7FF
andl %edx, %ecx
leaq 0x56721a(%rip), %r12    # 0x575bd0
movzwl (%r12,%rcx,2), %ebp
leal 0x80(%r15), %ecx
andl %edx, %ecx
movzwl (%r12,%rcx,2), %r14d
movswl %ax, %edi
movl $0x2c8, %esi            # imm = 0x2C8
callq 0x1cf0c
cmpw $-0x1, %ax
je 0xf2ea
movswl %r14w, %r14d
sarl $0x6, %r14d
addl 0x18(%rsp), %r14d
movl $0x7ff, %esi            # imm = 0x7FF
movswl %bp, %r13d
sarl $0x6, %r13d
addl 0x1c(%rsp), %r13d
movswq %ax, %rbp
imulq $0x2c, %rbp, %rax
leaq 0x415122(%rip), %rcx    # 0x423b30
movl %r13d, (%rcx,%rax)
movl %r14d, 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(%r15), %edx
andl %esi, %edx
movswl (%r12,%rdx,2), %edx
shrl $0x5, %edx
movw %dx, 0x20(%rcx,%rax)
addl $0x7fa, %r15d           # imm = 0x7FA
andl %esi, %r15d
movswl (%r12,%r15,2), %edx
shrl $0x5, %edx
movw %dx, 0x22(%rcx,%rax)
pushq $0x64
popq %rdx
subl %ebx, %edx
movw %dx, 0x24(%rcx,%rax)
movl 0x24(%rsp), %ebx
movw %bx, 0x1e(%rcx,%rax)
andl $0x0, 0x26(%rcx,%rax)
orw $-0x1, 0x2a(%rcx,%rax)
leaq (%rcx,%rax), %rdi
imulq $0xc, %rbp, %rsi
addq 0xb8514(%rip), %rsi     # 0xc6fb8
pushq $0x3
popq %rdx
callq 0x56a36
leaq 0x11877d(%rip), %rax    # 0x127230
movq (%rax,%rbp,8), %rax
movw %bx, 0x1e(%rax)
pushq $0x55
popq %rdi
pushq $0x4
popq %r8
movl %r13d, %esi
movl %r14d, %edx
jmp 0xf2e3
leaq 0x1167ec(%rip), %rcx    # 0x1252c0
decw (%rcx,%r14,2)
js 0xefa7
movzwl 0x10(%rsp), %r14d
leal 0x200(%r14), %r15d
movl $0x7ff, %ecx            # imm = 0x7FF
andl %ecx, %r15d
leaq 0x5670d5(%rip), %r12    # 0x575bd0
movzwl (%r12,%r15,2), %ebp
andl %ecx, %r14d
movzwl (%r12,%r14,2), %r13d
movswl %ax, %edi
movl $0x2d0, %esi            # imm = 0x2D0
callq 0x1cf0c
cmpw $-0x1, %ax
je 0xf2ea
movswl %r13w, %ecx
sarl $0x6, %ecx
addl 0x18(%rsp), %ecx
movswl %bp, %edx
sarl $0x6, %edx
addl 0x1c(%rsp), %edx
movswq %ax, %r13
imulq $0x2c, %r13, %rax
leaq 0x414fed(%rip), %rsi    # 0x423b30
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 (%r12,%r15,2), %ecx
shrl $0x5, %ecx
movw %cx, 0x20(%rsi,%rax)
movswl (%r12,%r14,2), %ecx
shrl $0x5, %ecx
movw %cx, 0x22(%rsi,%rax)
pushq $0x64
popq %rcx
subl %ebx, %ecx
movw %cx, 0x24(%rsi,%rax)
movl 0x24(%rsp), %ebx
movw %bx, 0x1e(%rsi,%rax)
andl $0x0, 0x26(%rsi,%rax)
orw $-0x1, 0x2a(%rsi,%rax)
leaq (%rsi,%rax), %rdi
imulq $0xc, %r13, %rsi
addq 0xb83f4(%rip), %rsi     # 0xc6fb8
pushq $0x3
popq %rdx
callq 0x56a36
leaq 0x11865d(%rip), %rax    # 0x127230
movq (%rax,%r13,8), %rax
jmp 0xf085
leaq 0x11661d(%rip), %rcx    # 0x125200
decw (%rcx,%r14,2)
js 0xefa7
movl %esi, 0x40(%rsp)
pushq $0x64
popq %rcx
subl %ebx, %ecx
imull $0x7d0, %ecx, %ebp      # imm = 0x7D0
movzwl 0x10(%rsp), %r15d
leal 0x200(%r15), %edx
movl $0x7ff, %ecx            # imm = 0x7FF
andl %ecx, %edx
leaq 0x566fb8(%rip), %rsi    # 0x575bd0
movq %rdx, 0x48(%rsp)
movswl (%rsi,%rdx,2), %r8d
andl %ecx, %r15d
movswl (%rsi,%r15,2), %r9d
leaq 0x30(%rsp), %r10
leaq 0x34(%rsp), %r11
leaq 0x38(%rsp), %r12
leaq 0xe(%rsp), %r13
leaq 0x28(%rsp), %rbx
leaq 0x2a(%rsp), %r14
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 %r12
pushq %r13
pushq %rbx
pushq %r14
pushq %rbp
callq 0x447c6
addq $0x40, %rsp
movswl (%r13), %edi
testl %edi, %edi
js 0xf1e7
movzwl %di, %eax
leaq 0x1185a4(%rip), %r12    # 0x127230
movq (%r12,%rax,8), %rax
cmpw $0x3ff, 0x1a(%rax)      # imm = 0x3FF
jg 0xf1e7
leaq 0x20(%rsp), %rsi
callq 0x20d25
testl %eax, %eax
je 0xf08e
movl 0x20(%rsp), %edi
callq 0xe5f6
movswl 0x20(%rsp), %edi
pushq $0x2
popq %rdx
movl 0x2c(%rsp), %esi
callq 0xe47f
jmp 0xf1e7
leaq 0x1165ac(%rip), %rcx    # 0x125280
decw (%rcx,%r14,2)
js 0xefa7
pushq $0x64
popq %rcx
subl %ebx, %ecx
imull $0x7d0, %ecx, %r10d     # imm = 0x7D0
movzwl 0x10(%rsp), %ecx
leal 0x200(%rcx), %edx
movl $0x7ff, %esi            # imm = 0x7FF
andl %esi, %edx
leaq 0x566ecc(%rip), %rdi    # 0x575bd0
movswl (%rdi,%rdx,2), %r8d
andl %esi, %ecx
movswl (%rdi,%rcx,2), %r9d
leaq 0x30(%rsp), %r11
leaq 0x34(%rsp), %rbx
leaq 0x38(%rsp), %r15
leaq 0xe(%rsp), %r12
leaq 0x28(%rsp), %r13
leaq 0x2a(%rsp), %rbp
movswl %ax, %ecx
movl 0x1c(%rsp), %edi
movl 0x18(%rsp), %esi
movl 0x14(%rsp), %edx
pushq $0x1000040              # imm = 0x1000040
pushq %r11
pushq %rbx
pushq %r15
pushq %r12
pushq %r13
pushq %rbp
pushq %r10
callq 0x447c6
addq $0x40, %rsp
movswq (%r12), %rdi
testq %rdi, %rdi
js 0xf2ea
leaq 0x1184c4(%rip), %rax    # 0x127230
movq (%rax,%rdi,8), %rax
cmpw $0x3ff, 0x1a(%rax)      # imm = 0x3FF
jg 0xf2ea
leaq 0xcb74d(%rip), %rcx     # 0xda4d0
movl (%rcx,%r14,4), %ecx
subl (%rax), %ecx
movl %ecx, %edx
negl %edx
cmovsl %ecx, %edx
leaq 0xcb779(%rip), %rcx     # 0xda510
movl (%rcx,%r14,4), %ecx
subl 0x4(%rax), %ecx
movl %ecx, %esi
negl %esi
cmovsl %ecx, %esi
addl %edx, %esi
leaq 0xcb7a2(%rip), %rcx     # 0xda550
movl (%rcx,%r14,4), %ecx
sarl $0x8, %ecx
movl 0x8(%rax), %edx
sarl $0x8, %edx
subl %edx, %ecx
movswq 0xe(%rax), %rax
leaq 0x599897(%rip), %rdx    # 0x5a8660
movswl (%rdx,%rax,2), %edx
sarl %edx
addl %ecx, %edx
movl %edx, %eax
negl %eax
cmovsl %edx, %eax
cmpl $0xa00, %esi            # imm = 0xA00
ja 0xf2ea
cmpl $0x240, %eax            # imm = 0x240
ja 0xf2ea
leaq 0x20(%rsp), %rsi
callq 0x20d25
testl %eax, %eax
je 0xf302
movswl 0x20(%rsp), %edi
movl $0x1c2, %esi            # imm = 0x1C2
callq 0x1f0e7
testl %eax, %eax
je 0xf2ea
movswl 0x20(%rsp), %edi
pushq $0x6
popq %rdx
movl 0x2c(%rsp), %esi
callq 0xe47f
jmp 0xf2ea
leaq 0x11646b(%rip), %rcx    # 0x1252a0
decw (%rcx,%r14,2)
js 0xefa7
movzwl 0x10(%rsp), %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)
pushq $0x64
popq %rbp
subl %ebx, %ebp
pushq $0x2
popq %rbx
leaq 0x566d3b(%rip), %r15    # 0x575bd0
cwtl
movl %eax, 0x3c(%rsp)
leaq 0x414c8f(%rip), %r12    # 0x423b30
cmpl $0x5, %ebx
je 0xf2ea
movq 0x40(%rsp), %rax
movzwl (%r15,%rax,2), %r13d
movq 0x48(%rsp), %rax
movzwl (%r15,%rax,2), %r14d
movl 0x3c(%rsp), %edi
movl $0x2ce, %esi            # imm = 0x2CE
callq 0x1cf0c
cmpw $-0x1, %ax
je 0xef9d
movswl %r14w, %ecx
sarl $0x6, %ecx
addl 0x18(%rsp), %ecx
movswl %r13w, %edx
sarl $0x6, %edx
addl 0x1c(%rsp), %edx
movswq %ax, %r13
imulq $0x2c, %r13, %rax
movl %edx, (%r12,%rax)
movl %ecx, 0x4(%r12,%rax)
movl 0x14(%rsp), %ecx
movl %ecx, 0x8(%r12,%rax)
movl $0x14f0080, 0xc(%r12,%rax) # imm = 0x14F0080
movw $0xe8, 0x10(%r12,%rax)
movb $0xc, 0x12(%r12,%rax)
movl $0x1010, 0x14(%r12,%rax) # imm = 0x1010
movq 0x68(%rsp), %rcx
movswl (%r15,%rcx,2), %edx
movl %ebx, %ecx
sarl %cl, %edx
movq 0x70(%rsp), %rcx
movswl (%r15,%rcx,2), %esi
movl %ebx, %ecx
sarl %cl, %esi
movl 0x10(%rsp), %ecx
movw %cx, 0x1c(%r12,%rax)
movw %dx, 0x20(%r12,%rax)
movw %si, 0x22(%r12,%rax)
movw %bp, 0x24(%r12,%rax)
movl 0x24(%rsp), %r14d
movw %r14w, 0x1e(%r12,%rax)
andl $0x0, 0x26(%r12,%rax)
orw $-0x1, 0x2a(%r12,%rax)
leaq (%r12,%rax), %rdi
imulq $0xc, %r13, %rsi
addq 0xb8033(%rip), %rsi     # 0xc6fb8
pushq $0x3
popq %rdx
callq 0x56a36
leaq 0x11829c(%rip), %rax    # 0x127230
movq (%rax,%r13,8), %rax
movw %r14w, 0x1e(%rax)
incl %ebx
addl $-0x4, %ebp
jmp 0xeea1
andw $0x0, (%rcx,%r14,2)
jmp 0xf2ea
movswl %ax, %edi
movl $0x2cc, %esi            # imm = 0x2CC
callq 0x1cf0c
cmpw $-0x1, %ax
je 0xf2ea
movswq %ax, %r14
imulq $0x2c, %r14, %rax
leaq 0x414b58(%rip), %rcx    # 0x423b30
movl %ebp, (%rcx,%rax)
movl %r13d, 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(%r15), %edx
movl $0x7ff, %esi            # imm = 0x7FF
andl %esi, %edx
movswl (%r12,%rdx,2), %edx
shrl $0x5, %edx
movw %dx, 0x20(%rcx,%rax)
addl $0x7f5, %r15d           # imm = 0x7F5
andl %esi, %r15d
movswl (%r12,%r15,2), %edx
shrl $0x5, %edx
movw %dx, 0x22(%rcx,%rax)
pushq $0x64
popq %rdx
subl %ebx, %edx
movw %dx, 0x24(%rcx,%rax)
movl 0x24(%rsp), %ebx
movw %bx, 0x1e(%rcx,%rax)
andl $0x0, 0x26(%rcx,%rax)
orw $-0x1, 0x2a(%rcx,%rax)
leaq (%rcx,%rax), %rdi
imulq $0xc, %r14, %rsi
addq 0xb7f46(%rip), %rsi     # 0xc6fb8
pushq $0x3
popq %rdx
callq 0x56a36
leaq 0x1181af(%rip), %rax    # 0x127230
movq (%rax,%r14,8), %rax
movw %bx, 0x1e(%rax)
jmp 0xf2ea
movswl 0xe(%rsp), %edi
leaq 0x117f8a(%rip), %rax    # 0x127024
cmpl $0x3, (%rax)
pushq $0x6
popq %rax
pushq $0xc
popq %rsi
cmovbl %eax, %esi
callq 0x1fc8e
cmpl $0x1, %eax
jne 0xf1cf
cmpl $0x0, 0x1162a5(%rip)    # 0x125360
je 0xf1cf
movswl 0xe(%rsp), %edi
movl 0x30(%rsp), %esi
movswl 0x10(%rsp), %ebx
movl %ebx, %edx
callq 0x1ee50
testl %eax, %eax
je 0xf1d4
movswq 0xe(%rsp), %rax
movq (%r12,%rax,8), %rax
andw $0xfefe, 0xc(%rax)      # imm = 0xFEFE
movq 0x48(%rsp), %rax
leaq 0x566ad6(%rip), %rcx    # 0x575bd0
movswl (%rcx,%rax,2), %r8d
movswl (%rcx,%r15,2), %r9d
leaq 0x54(%rsp), %rax
leaq 0x58(%rsp), %r10
leaq 0x5c(%rsp), %r11
leaq 0x62(%rsp), %r14
leaq 0x64(%rsp), %r15
leaq 0x66(%rsp), %r13
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 %r14
pushq %r15
pushq %r13
pushq %rbp
callq 0x447c6
addq $0x40, %rsp
movswl (%r15), %edi
cmpl $-0x1, %edi
je 0xf1d4
movswq 0xe(%rsp), %rax
movq (%r12,%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 %ebx, %r9d
pushq %r11
pushq %r10
pushq %rax
callq 0x1ec40
addq $0x20, %rsp
jmp 0xf1d4
movswl 0xe(%rsp), %edi
leaq 0x117e87(%rip), %rax    # 0x127024
cmpl $0x3, (%rax)
pushq $0x6
popq %rax
pushq $0xc
popq %rsi
cmovbl %eax, %esi
callq 0x1fc8e
cmpl $0x1, %eax
jne 0xf2ea
movswl 0xe(%rsp), %edi
movsbl 0x40(%rsp), %edx
movl 0x2c(%rsp), %esi
callq 0xe4fa
jmp 0xf2ea
cmpl $0x1, %eax
jne 0xf1e7
movswl 0xe(%rsp), %edi
movsbl 0x40(%rsp), %edx
movl 0x2c(%rsp), %esi
callq 0xe4fa
cmpw $0x0, 0x28(%rsp)
js 0xf2ea
movswl 0x2a(%rsp), %edi
pushq $0x3
popq %rsi
callq 0x1cf0c
cmpw $-0x1, %ax
je 0xf2ea
movl %eax, %ebx
movswq %ax, %rax
imulq $0x2c, %rax, %rcx
leaq 0x414915(%rip), %rdx    # 0x423b30
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
andw $0x0, 0x10(%rdx,%rcx)
leaq (%rdx,%rcx), %rdi
movb $0x20, 0x12(%rdx,%rcx)
movl $0x1616, 0x14(%rdx,%rcx) # imm = 0x1616
movl 0x10(%rsp), %ebp
movw %bp, 0x1c(%rdx,%rcx)
movl 0x24(%rsp), %esi
addl $0x4000, %esi           # imm = 0x4000
movw %si, 0x1e(%rdx,%rcx)
movabsq $0x3f000000000000, %rsi # imm = 0x3F000000000000
movq %rsi, 0x20(%rdx,%rcx)
movl $0xffff0000, 0x28(%rdx,%rcx) # imm = 0xFFFF0000
imulq $0xc, %rax, %rsi
addq 0xb7d28(%rip), %rsi     # 0xc6fb8
pushq $0x3
popq %rdx
callq 0x56a36
movq 0x48(%rsp), %rax
leaq 0x56692c(%rip), %rcx    # 0x575bd0
movswl (%rcx,%rax,2), %eax
imull $-0x30, %eax, %esi
movswq %bp, %rax
movswl (%rcx,%rax,2), %eax
imull $-0x30, %eax, %edx
subq $0x8, %rsp
movswl %bx, %edi
xorl %ecx, %ecx
movl $0x400, %r8d            # imm = 0x400
movl $0x400, %r9d            # imm = 0x400
pushq $0x1
callq 0x1b89a
popq %rcx
popq %rdx
movl 0x38(%rsp), %esi
movl 0x34(%rsp), %edx
pushq $0x55
popq %rdi
pushq $0x4
popq %r8
xorl %ecx, %ecx
callq 0x1ab2a
movl 0x2c(%rsp), %edi
callq 0x20319
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movswl 0xe(%rsp), %edi
movl $0x1c2, %esi            # imm = 0x1C2
callq 0x1f229
jmp 0xf2ea