// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekgun.c
// Function: tekanimweap
void
tekanimweap(int gun,short p)
{
     int  ammo,firekey,fseq,seq,tics;
     int usegun;
     struct guntype *gunptr;

     if (gun < 0 || gun >= NUMWEAPONS) {
          crashgame("gun589: Invalid gun number (%d,p=%d)",gun,p);
     }
     if (option[4] != 0) {
          if (health[p] < 0 && dieframe[p] == 0) {
               dieframe[p]=TICSPERFRAME;
          }
          else if (dieframe[p] > 0) {
               sprptr[playersprite[p]]->picnum=
                    JAKEDEATHPIC+(dieframe[p]/DIEFRAMETIME);
               dieframe[p]+=TICSPERFRAME;
               return;
          }
          else {
               if ((syncbits[p]&2048) && firepicdelay[p] == 0) {
                    sprptr[playersprite[p]]->picnum=JAKEATTACKPIC;
                    firepicdelay[p]=16;
               }
               else if (firepicdelay[p] > 0) {
                    firepicdelay[p]--;
                    if (firepicdelay[p] <= 0) {
                         firepicdelay[p]=0;
                         sprptr[playersprite[p]]->picnum=JAKEWALKPIC;
                    }
               }
               if (firepicdelay[p] == 0 && syncvel[p] == 0 && syncsvel[p] == 0) {
                    sprptr[playersprite[p]]->picnum=JAKESTANDPIC;
               }
          }
     }
     if ((seq=fireseq[p]) == 0) {
          lastgun[p]=gun;
          return;
     }
     usegun=lastgun[p];
     if (usegun != gun) {
          gunptr=&guntype[usegun];
          fseq=gunptr->firepic-gunptr->pic;
          if (firedonetics[p] >= 0) {
               firedonetics[p]=2;
          }
          firekey=0;
     }
     else {
          firekey=(syncbits[p]&2048);
          if (firekey != 0) {
               drawweap[p]=1;
          }
     }
     if( (firekey == 0) && ((syncbits[p]&128) != 0) && firedonetics[p] == 1) {
//         ((firedonetics[p] == 1) || !hasammo(usegun,p)) ) {
          firedonetics[p]=2;
     }
     if (firedonetics[p] == 2) {
          firedonetics[p]=-1;
          drawweap[p]=0;
          if (firedonetics[p] <= 0) {
               gunptr=&guntype[usegun];
               fseq=gunptr->firepic-gunptr->pic;
               fireseq[p]=fseq;
          }
     }
     gunptr=&guntype[usegun];
     fseq=gunptr->firepic-gunptr->pic;
     if (seq-1 >= fseq) {
          tics=gunptr->tics;
     }
     else {
          tics=DRAWWEAPSPEED;
     }
     if (lockclock >= lastchaingun[p]+tics) {
          lastchaingun[p]=lockclock;
          ammo=hasammo(usegun,p);
          if (seq-1 >= fseq && ammo) {
               if (gunptr->action[seq-fseq-1]) {
                    switch( gun+1 ) {
//jsa friday
                         case 1:
                              if(option[4] != 0)
                                   playsound(S_WEAPON1 ,posx[p],posy[p],0,ST_NOUPDATE);
                              else
                                   playsound(S_WEAPON1 ,0,0,0,ST_IMMEDIATE);
                              break;
                         case 2:
                              if(option[4] != 0)
                                   playsound(S_WEAPON2 ,posx[p],posy[p],0,ST_NOUPDATE);
                              else
                                   playsound(S_WEAPON2 ,0,0,0,ST_IMMEDIATE);
                              break;
                         case 3:
                              if(option[4] != 0)
                                   playsound(S_WEAPON3 ,posx[p],posy[p],0,ST_NOUPDATE);
                              else
                                   playsound(S_WEAPON3 ,0,0,0,ST_IMMEDIATE);
                              break;
                         case 4:
                              if(option[4] != 0)
                                   playsound(S_WEAPON4 ,posx[p],posy[p],0,ST_NOUPDATE);
                              else
                                   playsound(S_WEAPON4 ,0,0,0,ST_IMMEDIATE);
                              break;
                         case 5:
                              if(option[4] != 0)
                                   playsound(S_WEAPON5 ,posx[p],posy[p],0,ST_NOUPDATE);
                              else
                                   playsound(S_WEAPON5 ,0,0,0,ST_IMMEDIATE);
                              break;
                         case 6:
                              if(option[4] != 0)
                                   playsound(S_WEAPON6 ,posx[p],posy[p],0,ST_NOUPDATE);
                              else
                                   playsound(S_WEAPON6 ,0,0,0,ST_IMMEDIATE);
                              break;
                         case 7:
                              if(option[4] != 0)
                                   playsound(S_WEAPON7 ,posx[p],posy[p],0,ST_NOUPDATE);
                              else
                                   playsound(S_WEAPON7 ,0,0,0,ST_IMMEDIATE);
                              break;
                         case 8:
                              playsound(S_WEAPON8 ,0,0,0,ST_IMMEDIATE);
                              break;
                         default:
                              break;

                    }
                    shootgun(p,posx[p],posy[p],posz[p],ang[p],horiz[p],
                              cursectnum[p],usegun);
                    if (option[4] != 0) {
                         sprptr[playersprite[p]]->picnum=JAKEATTACKPIC+1;
                         firepicdelay[p]=8;
                    }
               }
               if (seq-1 >= gunptr->endfirepic-gunptr->pic) {
                    fireseq[p]=fseq+1;
                    return;
               }
               if (firekey == 0) {
                    firedonetics[p]=1;
                    fireseq[p]=fseq;
                    return;
               }
               else {
                    firedonetics[p]=0;
               }
          }
          if (drawweap[p] != 0) {
               if (ammo || seq < fseq) {
                    seq++;
               }
               else {
                    if (firekey == 0) {
                         firedonetics[p]=1;
                    }
               }
          }
          else if (firedonetics[p] < 0) {
               seq--;
          }
          fireseq[p]=seq;
     }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movw %si, %ax
movl %edi, -0x4(%rbp)
movw %ax, -0x6(%rbp)
cmpl $0x0, -0x4(%rbp)
jl 0x13b6e
cmpl $0x8, -0x4(%rbp)
jl 0x13b83
movl -0x4(%rbp), %esi
movswl -0x6(%rbp), %edx
leaq 0xc5861(%rip), %rdi     # 0xd93dd
movb $0x0, %al
callq 0x44240
leaq 0x10638e(%rip), %rax    # 0x119f18
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
je 0x13da0
movswq -0x6(%rbp), %rcx
leaq 0x119d6d(%rip), %rax    # 0x12d910
cmpl $0x0, (%rax,%rcx,4)
jge 0x13bd5
movswq -0x6(%rbp), %rcx
leaq 0x16477b(%rip), %rax    # 0x178330
movswl (%rax,%rcx,2), %eax
cmpl $0x0, %eax
jne 0x13bd5
movswq -0x6(%rbp), %rcx
leaq 0x164766(%rip), %rax    # 0x178330
movw $0x3, (%rax,%rcx,2)
jmp 0x13d9e
movswq -0x6(%rbp), %rcx
leaq 0x16474f(%rip), %rax    # 0x178330
movswl (%rax,%rcx,2), %eax
cmpl $0x0, %eax
jle 0x13c50
movswq -0x6(%rbp), %rcx
leaq 0x16473a(%rip), %rax    # 0x178330
movswl (%rax,%rcx,2), %eax
movl $0x14, %ecx
cltd
idivl %ecx
addl $0x3fb, %eax            # imm = 0x3FB
movw %ax, %cx
movswq -0x6(%rbp), %rdx
leaq 0x11aafa(%rip), %rax    # 0x12e710
movswq (%rax,%rdx,2), %rdx
leaq 0x1665be(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movw %cx, 0xe(%rax)
movswq -0x6(%rbp), %rcx
leaq 0x1646fa(%rip), %rax    # 0x178330
movswl (%rax,%rcx,2), %eax
addl $0x3, %eax
movw %ax, %dx
leaq 0x1646e9(%rip), %rax    # 0x178330
movw %dx, (%rax,%rcx,2)
jmp 0x14483
movswq -0x6(%rbp), %rcx
leaq 0x119bb4(%rip), %rax    # 0x12d810
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x13cb8
movswq -0x6(%rbp), %rcx
leaq 0x1646da(%rip), %rax    # 0x178350
movswl (%rax,%rcx,2), %eax
cmpl $0x0, %eax
jne 0x13cb8
movswq -0x6(%rbp), %rcx
leaq 0x11aa85(%rip), %rax    # 0x12e710
movswq (%rax,%rcx,2), %rcx
leaq 0x166549(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw $0x4ae, 0xe(%rax)       # imm = 0x4AE
movswq -0x6(%rbp), %rcx
leaq 0x1646a3(%rip), %rax    # 0x178350
movw $0x10, (%rax,%rcx,2)
jmp 0x13d39
movswq -0x6(%rbp), %rcx
leaq 0x16468c(%rip), %rax    # 0x178350
movswl (%rax,%rcx,2), %eax
cmpl $0x0, %eax
jle 0x13d37
movswq -0x6(%rbp), %rcx
leaq 0x164677(%rip), %rax    # 0x178350
movw (%rax,%rcx,2), %dx
addw $-0x1, %dx
leaq 0x164668(%rip), %rax    # 0x178350
movw %dx, (%rax,%rcx,2)
movswq -0x6(%rbp), %rcx
leaq 0x164658(%rip), %rax    # 0x178350
movswl (%rax,%rcx,2), %eax
cmpl $0x0, %eax
jg 0x13d35
movswq -0x6(%rbp), %rcx
leaq 0x164643(%rip), %rax    # 0x178350
movw $0x0, (%rax,%rcx,2)
movswq -0x6(%rbp), %rcx
leaq 0x11a9f1(%rip), %rax    # 0x12e710
movswq (%rax,%rcx,2), %rcx
leaq 0x1664b5(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw $0x3e7, 0xe(%rax)       # imm = 0x3E7
jmp 0x13d37
jmp 0x13d39
movswq -0x6(%rbp), %rcx
leaq 0x16460b(%rip), %rax    # 0x178350
movswl (%rax,%rcx,2), %eax
cmpl $0x0, %eax
jne 0x13d9a
movswq -0x6(%rbp), %rcx
leaq 0x11a7a6(%rip), %rax    # 0x12e500
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x13d9a
movswq -0x6(%rbp), %rcx
leaq 0x11a7d1(%rip), %rax    # 0x12e540
movswl (%rax,%rcx,2), %eax
cmpl $0x0, %eax
jne 0x13d9a
movswq -0x6(%rbp), %rcx
leaq 0x11a98c(%rip), %rax    # 0x12e710
movswq (%rax,%rcx,2), %rcx
leaq 0x166450(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw $0x3e2, 0xe(%rax)       # imm = 0x3E2
jmp 0x13d9c
jmp 0x13d9e
jmp 0x13da0
movswq -0x6(%rbp), %rcx
leaq 0x1644f4(%rip), %rax    # 0x1782a0
movl (%rax,%rcx,4), %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, %eax
jne 0x13dce
movl -0x4(%rbp), %edx
movswq -0x6(%rbp), %rcx
leaq 0x1645aa(%rip), %rax    # 0x178370
movl %edx, (%rax,%rcx,4)
jmp 0x14483
movswq -0x6(%rbp), %rcx
leaq 0x164596(%rip), %rax    # 0x178370
movl (%rax,%rcx,4), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x4(%rbp), %eax
je 0x13e40
movslq -0x20(%rbp), %rcx
leaq 0x1063fd(%rip), %rax    # 0x11a1f0
imulq $0x12, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movswl 0x2(%rax), %eax
movq -0x28(%rbp), %rcx
movswl (%rcx), %ecx
subl %ecx, %eax
movl %eax, -0x14(%rbp)
movswq -0x6(%rbp), %rcx
leaq 0x164592(%rip), %rax    # 0x1783b0
cmpl $0x0, (%rax,%rcx,4)
jl 0x13e37
movswq -0x6(%rbp), %rcx
leaq 0x164580(%rip), %rax    # 0x1783b0
movl $0x2, (%rax,%rcx,4)
movl $0x0, -0x10(%rbp)
jmp 0x13e73
movswq -0x6(%rbp), %rcx
leaq 0x1199c4(%rip), %rax    # 0x12d810
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x13e71
movswq -0x6(%rbp), %rcx
leaq 0x164586(%rip), %rax    # 0x1783f0
movl $0x1, (%rax,%rcx,4)
jmp 0x13e73
cmpl $0x0, -0x10(%rbp)
jne 0x13eb8
movswq -0x6(%rbp), %rcx
leaq 0x11998b(%rip), %rax    # 0x12d810
movzwl (%rax,%rcx,2), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x13eb8
movswq -0x6(%rbp), %rcx
leaq 0x164511(%rip), %rax    # 0x1783b0
cmpl $0x1, (%rax,%rcx,4)
jne 0x13eb8
movswq -0x6(%rbp), %rcx
leaq 0x1644ff(%rip), %rax    # 0x1783b0
movl $0x2, (%rax,%rcx,4)
movswq -0x6(%rbp), %rcx
leaq 0x1644ec(%rip), %rax    # 0x1783b0
cmpl $0x2, (%rax,%rcx,4)
jne 0x13f40
movswq -0x6(%rbp), %rcx
leaq 0x1644da(%rip), %rax    # 0x1783b0
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
movswq -0x6(%rbp), %rcx
leaq 0x164507(%rip), %rax    # 0x1783f0
movl $0x0, (%rax,%rcx,4)
movswq -0x6(%rbp), %rcx
leaq 0x1644b4(%rip), %rax    # 0x1783b0
cmpl $0x0, (%rax,%rcx,4)
jg 0x13f3e
movslq -0x20(%rbp), %rcx
leaq 0x1062e3(%rip), %rax    # 0x11a1f0
imulq $0x12, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movswl 0x2(%rax), %eax
movq -0x28(%rbp), %rcx
movswl (%rcx), %ecx
subl %ecx, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %edx
movswq -0x6(%rbp), %rcx
leaq 0x164365(%rip), %rax    # 0x1782a0
movl %edx, (%rax,%rcx,4)
jmp 0x13f40
movslq -0x20(%rbp), %rcx
leaq 0x1062a5(%rip), %rax    # 0x11a1f0
imulq $0x12, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movswl 0x2(%rax), %eax
movq -0x28(%rbp), %rcx
movswl (%rcx), %ecx
subl %ecx, %eax
movl %eax, -0x14(%rbp)
movl -0x18(%rbp), %eax
subl $0x1, %eax
cmpl -0x14(%rbp), %eax
jl 0x13f82
movq -0x28(%rbp), %rax
movswl 0x10(%rax), %eax
movl %eax, -0x1c(%rbp)
jmp 0x13f89
movl $0x4, -0x1c(%rbp)
leaq 0x119878(%rip), %rax    # 0x12d808
movl (%rax), %eax
movswq -0x6(%rbp), %rdx
leaq 0x162662(%rip), %rcx    # 0x176600
movl (%rcx,%rdx,4), %ecx
addl -0x1c(%rbp), %ecx
cmpl %ecx, %eax
jl 0x14483
leaq 0x119855(%rip), %rax    # 0x12d808
movl (%rax), %edx
movswq -0x6(%rbp), %rcx
leaq 0x16263f(%rip), %rax    # 0x176600
movl %edx, (%rax,%rcx,4)
movl -0x20(%rbp), %edi
movswl -0x6(%rbp), %esi
callq 0x11e10
movl %eax, -0xc(%rbp)
movl -0x18(%rbp), %eax
subl $0x1, %eax
cmpl -0x14(%rbp), %eax
jl 0x1440c
cmpl $0x0, -0xc(%rbp)
je 0x1440c
movq -0x28(%rbp), %rax
movl -0x18(%rbp), %ecx
subl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpb $0x0, 0x7(%rax,%rcx)
je 0x14392
movl -0x4(%rbp), %eax
movq %rax, -0x30(%rbp)
subq $0x7, %rax
ja 0x142c9
movq -0x30(%rbp), %rax
leaq 0xc532d(%rip), %rcx     # 0xd9350
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x105ee5(%rip), %rax    # 0x119f18
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
je 0x1406e
movswq -0x6(%rbp), %rcx
leaq 0x119808(%rip), %rax    # 0x12d850
movl (%rax,%rcx,4), %esi
movswq -0x6(%rbp), %rcx
leaq 0x119839(%rip), %rax    # 0x12d890
movl (%rax,%rcx,4), %edx
movl $0x57, %edi
xorl %ecx, %ecx
movl $0x4, %r8d
callq 0x26af0
jmp 0x14084
movl $0x57, %edi
xorl %ecx, %ecx
movl $0x1, %r8d
movl %ecx, %esi
movl %ecx, %edx
callq 0x26af0
jmp 0x142cb
leaq 0x105e88(%rip), %rax    # 0x119f18
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
je 0x140cb
movswq -0x6(%rbp), %rcx
leaq 0x1197ab(%rip), %rax    # 0x12d850
movl (%rax,%rcx,4), %esi
movswq -0x6(%rbp), %rcx
leaq 0x1197dc(%rip), %rax    # 0x12d890
movl (%rax,%rcx,4), %edx
movl $0x58, %edi
xorl %ecx, %ecx
movl $0x4, %r8d
callq 0x26af0
jmp 0x140e1
movl $0x58, %edi
xorl %ecx, %ecx
movl $0x1, %r8d
movl %ecx, %esi
movl %ecx, %edx
callq 0x26af0
jmp 0x142cb
leaq 0x105e2b(%rip), %rax    # 0x119f18
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
je 0x14128
movswq -0x6(%rbp), %rcx
leaq 0x11974e(%rip), %rax    # 0x12d850
movl (%rax,%rcx,4), %esi
movswq -0x6(%rbp), %rcx
leaq 0x11977f(%rip), %rax    # 0x12d890
movl (%rax,%rcx,4), %edx
movl $0x59, %edi
xorl %ecx, %ecx
movl $0x4, %r8d
callq 0x26af0
jmp 0x1413e
movl $0x59, %edi
xorl %ecx, %ecx
movl $0x1, %r8d
movl %ecx, %esi
movl %ecx, %edx
callq 0x26af0
jmp 0x142cb
leaq 0x105dce(%rip), %rax    # 0x119f18
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
je 0x14185
movswq -0x6(%rbp), %rcx
leaq 0x1196f1(%rip), %rax    # 0x12d850
movl (%rax,%rcx,4), %esi
movswq -0x6(%rbp), %rcx
leaq 0x119722(%rip), %rax    # 0x12d890
movl (%rax,%rcx,4), %edx
movl $0x5a, %edi
xorl %ecx, %ecx
movl $0x4, %r8d
callq 0x26af0
jmp 0x1419b
movl $0x5a, %edi
xorl %ecx, %ecx
movl $0x1, %r8d
movl %ecx, %esi
movl %ecx, %edx
callq 0x26af0
jmp 0x142cb
leaq 0x105d71(%rip), %rax    # 0x119f18
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
je 0x141e2
movswq -0x6(%rbp), %rcx
leaq 0x119694(%rip), %rax    # 0x12d850
movl (%rax,%rcx,4), %esi
movswq -0x6(%rbp), %rcx
leaq 0x1196c5(%rip), %rax    # 0x12d890
movl (%rax,%rcx,4), %edx
movl $0x5b, %edi
xorl %ecx, %ecx
movl $0x4, %r8d
callq 0x26af0
jmp 0x141f8
movl $0x5b, %edi
xorl %ecx, %ecx
movl $0x1, %r8d
movl %ecx, %esi
movl %ecx, %edx
callq 0x26af0
jmp 0x142cb
leaq 0x105d14(%rip), %rax    # 0x119f18
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
je 0x1423f
movswq -0x6(%rbp), %rcx
leaq 0x119637(%rip), %rax    # 0x12d850
movl (%rax,%rcx,4), %esi
movswq -0x6(%rbp), %rcx
leaq 0x119668(%rip), %rax    # 0x12d890
movl (%rax,%rcx,4), %edx
movl $0x5c, %edi
xorl %ecx, %ecx
movl $0x4, %r8d
callq 0x26af0
jmp 0x14255
movl $0x5c, %edi
xorl %ecx, %ecx
movl $0x1, %r8d
movl %ecx, %esi
movl %ecx, %edx
callq 0x26af0
jmp 0x142cb
leaq 0x105cba(%rip), %rax    # 0x119f18
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
je 0x14299
movswq -0x6(%rbp), %rcx
leaq 0x1195dd(%rip), %rax    # 0x12d850
movl (%rax,%rcx,4), %esi
movswq -0x6(%rbp), %rcx
leaq 0x11960e(%rip), %rax    # 0x12d890
movl (%rax,%rcx,4), %edx
movl $0x5d, %edi
xorl %ecx, %ecx
movl $0x4, %r8d
callq 0x26af0
jmp 0x142af
movl $0x5d, %edi
xorl %ecx, %ecx
movl $0x1, %r8d
movl %ecx, %esi
movl %ecx, %edx
callq 0x26af0
jmp 0x142cb
movl $0x5e, %edi
xorl %ecx, %ecx
movl $0x1, %r8d
movl %ecx, %esi
movl %ecx, %edx
callq 0x26af0
jmp 0x142cb
jmp 0x142cb
movw -0x6(%rbp), %di
movswq -0x6(%rbp), %rcx
leaq 0x119575(%rip), %rax    # 0x12d850
movl (%rax,%rcx,4), %esi
movswq -0x6(%rbp), %rcx
leaq 0x1195a6(%rip), %rax    # 0x12d890
movl (%rax,%rcx,4), %edx
movswq -0x6(%rbp), %rcx
leaq 0x1195d7(%rip), %rax    # 0x12d8d0
movl (%rax,%rcx,4), %ecx
movswq -0x6(%rbp), %r8
leaq 0x119528(%rip), %rax    # 0x12d830
movw (%rax,%r8,2), %r8w
movswq -0x6(%rbp), %r9
leaq 0x11a507(%rip), %rax    # 0x12e820
movl (%rax,%r9,4), %r9d
movswq -0x6(%rbp), %r10
leaq 0x11a3b7(%rip), %rax    # 0x12e6e0
movw (%rax,%r10,2), %r10w
movl -0x20(%rbp), %eax
movswl %di, %edi
movswl %r8w, %r8d
movswl %r10w, %r10d
movl %r10d, (%rsp)
movsbl %al, %eax
movl %eax, 0x8(%rsp)
callq 0x12320
leaq 0x105bc5(%rip), %rax    # 0x119f18
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
je 0x14390
movswq -0x6(%rbp), %rcx
leaq 0x11a3a8(%rip), %rax    # 0x12e710
movswq (%rax,%rcx,2), %rcx
leaq 0x165e6c(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw $0x4af, 0xe(%rax)       # imm = 0x4AF
movswq -0x6(%rbp), %rcx
leaq 0x163fc6(%rip), %rax    # 0x178350
movw $0x8, (%rax,%rcx,2)
jmp 0x14392
movl -0x18(%rbp), %eax
subl $0x1, %eax
movq -0x28(%rbp), %rcx
movswl 0x4(%rcx), %ecx
movq -0x28(%rbp), %rdx
movswl (%rdx), %edx
subl %edx, %ecx
cmpl %ecx, %eax
jl 0x143c7
movl -0x14(%rbp), %edx
addl $0x1, %edx
movswq -0x6(%rbp), %rcx
leaq 0x163ee1(%rip), %rax    # 0x1782a0
movl %edx, (%rax,%rcx,4)
jmp 0x14483
cmpl $0x0, -0x10(%rbp)
jne 0x143f7
movswq -0x6(%rbp), %rcx
leaq 0x163fd7(%rip), %rax    # 0x1783b0
movl $0x1, (%rax,%rcx,4)
movl -0x14(%rbp), %edx
movswq -0x6(%rbp), %rcx
leaq 0x163eb1(%rip), %rax    # 0x1782a0
movl %edx, (%rax,%rcx,4)
jmp 0x14483
movswq -0x6(%rbp), %rcx
leaq 0x163fad(%rip), %rax    # 0x1783b0
movl $0x0, (%rax,%rcx,4)
jmp 0x1440c
movswq -0x6(%rbp), %rcx
leaq 0x163fd8(%rip), %rax    # 0x1783f0
cmpl $0x0, (%rax,%rcx,4)
je 0x14454
cmpl $0x0, -0xc(%rbp)
jne 0x1442c
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x14437
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x14452
cmpl $0x0, -0x10(%rbp)
jne 0x14450
movswq -0x6(%rbp), %rcx
leaq 0x163f67(%rip), %rax    # 0x1783b0
movl $0x1, (%rax,%rcx,4)
jmp 0x14452
jmp 0x14471
movswq -0x6(%rbp), %rcx
leaq 0x163f50(%rip), %rax    # 0x1783b0
cmpl $0x0, (%rax,%rcx,4)
jge 0x1446f
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x14471
movl -0x18(%rbp), %edx
movswq -0x6(%rbp), %rcx
leaq 0x163e20(%rip), %rax    # 0x1782a0
movl %edx, (%rax,%rcx,4)
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)