// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/src/tekstat.c
// Function: spewblood
int
spewblood(int sprnum, int hitz, short daang)
{
     int       j,ext=sprptr[sprnum]->extra;

     (void)daang;

     if( option[4] != 0 ) {
          return(0);
     }
     if( !validext(ext) ) {
          return(0);
     }
     if( isanandroid(sprnum) || isahologram(sprnum) ) {
          return(0);
     }

     switch( sprXTptr[ext]->basepic ) {
     case RUBWALKPIC:
     case FRGWALKPIC:
     case COP1WALKPIC:
     case ANTWALKPIC:
     case SARAHWALKPIC:
     case MAWALKPIC:
     case DIWALKPIC:
     case ERWALKPIC:
     case SAMWALKPIC:
          j=jsinsertsprite(sprptr[sprnum]->sectnum, RUNTHRU);
          if( j != -1 ) {
     	     fillsprite(j,sprptr[sprnum]->x,sprptr[sprnum]->y,sprptr[sprnum]->z-(tilesizy[sprptr[sprnum]->picnum]<<6),128,
                          0,0,12,16,16,0,0, BLOODSPLAT,sprptr[sprnum]->ang,
		                sintable[(sprptr[sprnum]->ang+2560)&2047]>>6,sintable[(sprptr[sprnum]->ang+2048)&2047]>>6,
		                30L,sprnum+4096,sprptr[sprnum]->sectnum, RUNTHRU,0,0,0);
               sprptr[j]->z=hitz;
               getpicinfo(BLOODSPLAT);
               sprptr[j]->lotag=picinfoptr->numframes;
               if( sprptr[j]->lotag > MAXFRAMES ) {
                    sprptr[j]->lotag=MAXFRAMES;
               }
               if( sprptr[j]->lotag < 0 ) {
                    sprptr[j]->lotag=0;
               }
               sprptr[j]->hitag=0;
               return(1);
          }
          break;
     default:
          break;
     }

     return(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xadf82(%rip), %rax     # 0xce978
xorl %r14d, %r14d
cmpb $0x0, 0x4(%rax)
jne 0x20c06
movl %edi, %ebp
movslq %edi, %r12
leaq 0x10d801(%rip), %r15    # 0x12e210
movq (%r15,%r12,8), %rax
movzwl 0x2a(%rax), %r13d
cmpl $0x3fff, %r13d          # imm = 0x3FFF
ja 0x20c06
movl %esi, %ebx
movl %ebp, %edi
callq 0x20c18
testl %eax, %eax
jne 0x20c06
movl %ebp, %edi
callq 0x20c64
testl %eax, %eax
jne 0x20c06
leaq 0x1b57c4(%rip), %rax    # 0x1d6210
movq (%rax,%r13,8), %rax
movzwl 0xa(%rax), %eax
cmpl $0x729, %eax            # imm = 0x729
jle 0x20a7c
cmpl $0x79d, %eax            # imm = 0x79D
jle 0x20aa9
cmpl $0x79e, %eax            # imm = 0x79E
je 0x20abb
cmpl $0x811, %eax            # imm = 0x811
je 0x20abb
cmpl $0x7d3, %eax            # imm = 0x7D3
je 0x20abb
jmp 0x20c06
cmpl $0x6d6, %eax            # imm = 0x6D6
jg 0x20a96
cmpl $0x163, %eax            # imm = 0x163
je 0x20abb
cmpl $0x45b, %eax            # imm = 0x45B
je 0x20abb
jmp 0x20c06
cmpl $0x6d7, %eax            # imm = 0x6D7
je 0x20abb
cmpl $0x709, %eax            # imm = 0x709
je 0x20abb
jmp 0x20c06
cmpl $0x72a, %eax            # imm = 0x72A
je 0x20abb
cmpl $0x75f, %eax            # imm = 0x75F
jne 0x20c06
movq (%r15,%r12,8), %rax
movswl 0x18(%rax), %edi
movl $0x197, %esi            # imm = 0x197
callq 0x1e94c
cmpw $-0x1, %ax
je 0x20c06
movswq %ax, %r14
imulq $0x2c, %r14, %rax
leaq 0x40a02a(%rip), %rcx    # 0x42ab10
leaq (%rcx,%rax), %rdi
movq (%r15,%r12,8), %rdx
movl (%rdx), %esi
movl %esi, (%rcx,%rax)
movl 0x4(%rdx), %esi
movl %esi, 0x4(%rcx,%rax)
movl 0x8(%rdx), %esi
movswq 0xe(%rdx), %r8
leaq 0x58eb37(%rip), %r9     # 0x5af640
movswl (%r9,%r8,2), %r8d
shll $0x6, %r8d
subl %r8d, %esi
movl %esi, 0x8(%rcx,%rax)
movl $0x1470080, 0xc(%rcx,%rax) # imm = 0x1470080
movw $0x0, 0x10(%rcx,%rax)
movb $0xc, 0x12(%rcx,%rax)
movl $0x1010, 0x14(%rcx,%rax) # imm = 0x1010
movzwl 0x1c(%rdx), %esi
movw %si, 0x1c(%rcx,%rax)
movl $0x200, %esi            # imm = 0x200
addl 0x1c(%rdx), %esi
movl $0x7ff, %r8d            # imm = 0x7FF
andl %r8d, %esi
leaq 0x55c05a(%rip), %r9     # 0x57cbb0
movswl (%r9,%rsi,2), %esi
shrl $0x6, %esi
movw %si, 0x20(%rcx,%rax)
movzwl 0x1c(%rdx), %edx
andl %r8d, %edx
movswl (%r9,%rdx,2), %edx
shrl $0x6, %edx
movw %dx, 0x22(%rcx,%rax)
movw $0x1e, 0x24(%rcx,%rax)
addl $0x1000, %ebp           # imm = 0x1000
movw %bp, 0x1e(%rcx,%rax)
movl $0x0, 0x26(%rcx,%rax)
movw $0xffff, 0x2a(%rcx,%rax) # imm = 0xFFFF
leaq (%r14,%r14,2), %rsi
shlq $0x2, %rsi
addq 0xad411(%rip), %rsi     # 0xcdfb8
movl $0x3, %edx
callq 0x5da55
movq (%r15,%r14,8), %rax
movl %ebx, 0x8(%rax)
movl $0x147, %edi            # imm = 0x147
callq 0x1f1c1
movq 0xaec27(%rip), %rax     # 0xcf7f0
movzbl (%rax), %eax
movq (%r15,%r14,8), %rcx
movw %ax, 0x26(%rcx)
movq (%r15,%r14,8), %rax
cmpw $0x9, 0x26(%rax)
jl 0x20be5
movw $0x8, 0x26(%rax)
movq (%r15,%r14,8), %rax
cmpw $0x0, 0x26(%rax)
jns 0x20bf6
movw $0x0, 0x26(%rax)
movq (%r15,%r14,8), %rax
movw $0x0, 0x28(%rax)
movl $0x1, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq