// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekgun.c
// Function: tekexplodebody
int
tekexplodebody(int i)
{
     int  j,k,r,ext;

     ext=sprptr[i]->extra;
     if( (!validext(ext)) || (goreflag == 0) ) {
          return(0);
     }
     switch( sprXTptr[ext]->basepic ) {
     case RUBWALKPIC:
     case JAKEWALKPIC:
     case COP1WALKPIC:
     case ANTWALKPIC:
     case SARAHWALKPIC:
     case MAWALKPIC:
     case DIWALKPIC:
     case ERWALKPIC:
     case SAMWALKPIC:
     case FRGWALKPIC:
     case SUNGWALKPIC:
     case COWWALKPIC:
     case COPBWALKPIC:
     case NIKAWALKPIC:
     case REBRWALKPIC:
     case TRENWALKPIC:
     case WINGWALKPIC:
     case HALTWALKPIC:
     case REDHWALKPIC:
     case ORANWALKPIC:
     case BLKSWALKPIC:
     case SFROWALKPIC:
     case SSALWALKPIC:
     case SGOLWALKPIC:
     case SWATWALKPIC:
          break;
     default:
          return(0);
     }

     r=(krand_intercept(" GUN 787")%72)+8;
     for (k=0 ; k < r ; k++) {
          j=jsinsertsprite(sprptr[i]->sectnum,MOVEBODYPARTSSTAT);
          sprptr[j]->x=sprptr[i]->x;
          sprptr[j]->y=sprptr[i]->y;
          sprptr[j]->z=sprptr[i]->z+(8<<8);
          sprptr[j]->cstat=0;
          sprptr[j]->shade=0;
          sprptr[j]->pal=0;
          sprptr[j]->xrepeat=24;
          sprptr[j]->yrepeat=24;
          sprptr[j]->ang=sprptr[i]->ang;
          sprptr[j]->xvel=(krand_intercept(" GUN 799")&511)-256;
          sprptr[j]->yvel=(krand_intercept(" GUN 800")&511)-256;
          sprptr[j]->zvel=-((krand_intercept(" GUN 801")&8191)+4096);
          sprptr[j]->owner=sprptr[i]->owner;
          sprptr[j]->clipdist=32;
          sprptr[j]->lotag=360;
          sprptr[j]->hitag=0;
          switch (k) {
          case 0:
               sprptr[j]->picnum=GOREHEAD;
               break;
          case 1:
          case 10:
               sprptr[j]->picnum=GOREARM;
               break;
          case 5:
          case 15:
               sprptr[j]->picnum=GORELEG;
               break;
          default:
               sprptr[j]->picnum=GOREBLOOD;
               break;
          }
     }
     playsound(S_GORE1+(krand_intercept(" GUN 823")%2), sprptr[i]->x,sprptr[i]->y, 0, ST_NOUPDATE);

     return(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x8(%rbp)
movslq -0x8(%rbp), %rcx
leaq 0x165d3a(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswl 0x2a(%rax), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %edi
callq 0x2ae90
cmpl $0x0, %eax
je 0x144c7
cmpl $0x0, 0x163e5b(%rip)    # 0x178320
jne 0x144d3
movl $0x0, -0x4(%rbp)
jmp 0x148ec
movslq -0x18(%rbp), %rcx
leaq 0x20dd02(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rax
movzwl 0xa(%rax), %eax
movl %eax, -0x1c(%rbp)
subl $0x163, %eax            # imm = 0x163
je 0x1464a
jmp 0x144f6
movl -0x1c(%rbp), %eax
subl $0x3e7, %eax            # imm = 0x3E7
je 0x1464a
jmp 0x14506
movl -0x1c(%rbp), %eax
subl $0x45b, %eax            # imm = 0x45B
je 0x1464a
jmp 0x14516
movl -0x1c(%rbp), %eax
subl $0x6d7, %eax            # imm = 0x6D7
je 0x1464a
jmp 0x14526
movl -0x1c(%rbp), %eax
subl $0x709, %eax            # imm = 0x709
je 0x1464a
jmp 0x14536
movl -0x1c(%rbp), %eax
subl $0x72a, %eax            # imm = 0x72A
je 0x1464a
jmp 0x14546
movl -0x1c(%rbp), %eax
subl $0x75f, %eax            # imm = 0x75F
je 0x1464a
jmp 0x14556
movl -0x1c(%rbp), %eax
subl $0x79e, %eax            # imm = 0x79E
je 0x1464a
jmp 0x14566
movl -0x1c(%rbp), %eax
subl $0x7d3, %eax            # imm = 0x7D3
je 0x1464a
jmp 0x14576
movl -0x1c(%rbp), %eax
subl $0x811, %eax            # imm = 0x811
je 0x1464a
jmp 0x14586
movl -0x1c(%rbp), %eax
subl $0x84d, %eax            # imm = 0x84D
je 0x1464a
jmp 0x14596
movl -0x1c(%rbp), %eax
subl $0x889, %eax            # imm = 0x889
je 0x1464a
jmp 0x145a6
movl -0x1c(%rbp), %eax
subl $0x8d3, %eax            # imm = 0x8D3
je 0x1464a
jmp 0x145b6
movl -0x1c(%rbp), %eax
subl $0x92d, %eax            # imm = 0x92D
je 0x1464a
jmp 0x145c6
movl -0x1c(%rbp), %eax
subl $0x947, %eax            # imm = 0x947
je 0x1464a
jmp 0x145d2
movl -0x1c(%rbp), %eax
subl $0x983, %eax            # imm = 0x983
je 0x1464a
jmp 0x145de
movl -0x1c(%rbp), %eax
subl $0x9ca, %eax            # imm = 0x9CA
je 0x1464a
jmp 0x145ea
movl -0x1c(%rbp), %eax
subl $0xa05, %eax            # imm = 0xA05
je 0x1464a
jmp 0x145f6
movl -0x1c(%rbp), %eax
subl $0xa41, %eax            # imm = 0xA41
je 0x1464a
jmp 0x14602
movl -0x1c(%rbp), %eax
subl $0xa7d, %eax            # imm = 0xA7D
je 0x1464a
jmp 0x1460e
movl -0x1c(%rbp), %eax
subl $0xac0, %eax            # imm = 0xAC0
je 0x1464a
jmp 0x1461a
movl -0x1c(%rbp), %eax
subl $0xaff, %eax            # imm = 0xAFF
je 0x1464a
jmp 0x14626
movl -0x1c(%rbp), %eax
subl $0xb3b, %eax            # imm = 0xB3B
je 0x1464a
jmp 0x14632
movl -0x1c(%rbp), %eax
subl $0xb77, %eax            # imm = 0xB77
je 0x1464a
jmp 0x1463e
movl -0x1c(%rbp), %eax
subl $0xbb9, %eax            # imm = 0xBB9
jne 0x1464c
jmp 0x1464a
jmp 0x14658
movl $0x0, -0x4(%rbp)
jmp 0x148ec
leaq 0xc4da3(%rip), %rdi     # 0xd9402
callq 0x41510
movl $0x48, %ecx
cltd
idivl %ecx
addl $0x8, %edx
movl %edx, -0x14(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x1489c
movslq -0x8(%rbp), %rcx
leaq 0x165b50(%rip), %rax    # 0x17a1e0
movq %rax, -0x30(%rbp)
movq (%rax,%rcx,8), %rax
movswl 0x18(%rax), %edi
movl $0x384, %esi            # imm = 0x384
callq 0x2abd0
movw %ax, %cx
movq -0x30(%rbp), %rax
movswl %cx, %ecx
movl %ecx, -0xc(%rbp)
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movl (%rcx), %edx
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movl %edx, (%rcx)
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movl 0x4(%rcx), %edx
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movl %edx, 0x4(%rcx)
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movl 0x8(%rcx), %edx
addl $0x800, %edx            # imm = 0x800
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movl %edx, 0x8(%rcx)
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movw $0x0, 0xc(%rcx)
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movb $0x0, 0x10(%rcx)
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movb $0x0, 0x11(%rcx)
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movb $0x18, 0x14(%rcx)
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movb $0x18, 0x15(%rcx)
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movw 0x1c(%rcx), %cx
movslq -0xc(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movw %cx, 0x1c(%rax)
leaq 0xc4cb5(%rip), %rdi     # 0xd940b
callq 0x41510
movl %eax, %ecx
movq -0x30(%rbp), %rax
andl $0x1ff, %ecx            # imm = 0x1FF
addl $0xffffff00, %ecx       # imm = 0xFFFFFF00
movslq -0xc(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movw %cx, 0x20(%rax)
leaq 0xc4c94(%rip), %rdi     # 0xd9414
callq 0x41510
movl %eax, %ecx
movq -0x30(%rbp), %rax
andl $0x1ff, %ecx            # imm = 0x1FF
addl $0xffffff00, %ecx       # imm = 0xFFFFFF00
movslq -0xc(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movw %cx, 0x22(%rax)
leaq 0xc4c73(%rip), %rdi     # 0xd941d
callq 0x41510
movl %eax, %edx
movq -0x30(%rbp), %rax
andl $0x1fff, %edx           # imm = 0x1FFF
movl $0xfffff000, %ecx       # imm = 0xFFFFF000
subl %edx, %ecx
movw %cx, %dx
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movw %dx, 0x24(%rcx)
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movw 0x1e(%rcx), %dx
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movw %dx, 0x1e(%rcx)
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movb $0x20, 0x12(%rcx)
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movw $0x168, 0x26(%rcx)      # imm = 0x168
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movw $0x0, 0x28(%rax)
movl -0x10(%rbp), %eax
movq %rax, -0x28(%rbp)
subq $0xf, %rax
ja 0x14877
movq -0x28(%rbp), %rax
leaq 0xc4b47(%rip), %rcx     # 0xd9370
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movslq -0xc(%rbp), %rcx
leaq 0x1659a3(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw $0x52c, 0xe(%rax)       # imm = 0x52C
jmp 0x1488c
movslq -0xc(%rbp), %rcx
leaq 0x16598c(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw $0x528, 0xe(%rax)       # imm = 0x528
jmp 0x1488c
movslq -0xc(%rbp), %rcx
leaq 0x165975(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw $0x530, 0xe(%rax)       # imm = 0x530
jmp 0x1488c
movslq -0xc(%rbp), %rcx
leaq 0x16595e(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw $0x540, 0xe(%rax)       # imm = 0x540
jmp 0x1488e
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x14679
leaq 0xc4b83(%rip), %rdi     # 0xd9426
callq 0x41510
movl $0x2, %ecx
cltd
idivl %ecx
movl %edx, %edi
addl $0x76, %edi
movslq -0x8(%rbp), %rcx
leaq 0x165920(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl (%rax), %esi
movslq -0x8(%rbp), %rcx
leaq 0x16590f(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl 0x4(%rax), %edx
xorl %ecx, %ecx
movl $0x4, %r8d
callq 0x26af0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)