// File: /workspace/github_c_makefile_star2_O3/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 0xb0d13(%rip), %rax     # 0xd1978
xorl %r14d, %r14d
cmpb $0x0, 0x4(%rax)
jne 0x20e70
movl %edi, %ebp
movslq %edi, %r12
leaq 0x1105b2(%rip), %r15    # 0x131230
movq (%r15,%r12,8), %rax
movzwl 0x2a(%rax), %r13d
cmpl $0x3fff, %r13d          # imm = 0x3FFF
ja 0x20e70
movl %esi, %ebx
movl %ebp, %edi
callq 0x20e82
testl %eax, %eax
jne 0x20e70
movl %ebp, %edi
callq 0x20ece
testl %eax, %eax
jne 0x20e70
leaq 0x1b8575(%rip), %rax    # 0x1d9230
movq (%rax,%r13,8), %rax
movzwl 0xa(%rax), %eax
cmpl $0x729, %eax            # imm = 0x729
jle 0x20ceb
cmpl $0x79d, %eax            # imm = 0x79D
jle 0x20d18
cmpl $0x79e, %eax            # imm = 0x79E
je 0x20d2a
cmpl $0x811, %eax            # imm = 0x811
je 0x20d2a
cmpl $0x7d3, %eax            # imm = 0x7D3
je 0x20d2a
jmp 0x20e70
cmpl $0x6d6, %eax            # imm = 0x6D6
jg 0x20d05
cmpl $0x163, %eax            # imm = 0x163
je 0x20d2a
cmpl $0x45b, %eax            # imm = 0x45B
je 0x20d2a
jmp 0x20e70
cmpl $0x6d7, %eax            # imm = 0x6D7
je 0x20d2a
cmpl $0x709, %eax            # imm = 0x709
je 0x20d2a
jmp 0x20e70
cmpl $0x72a, %eax            # imm = 0x72A
je 0x20d2a
cmpl $0x75f, %eax            # imm = 0x75F
jne 0x20e70
movq (%r15,%r12,8), %rax
movswl 0x18(%rax), %edi
movl $0x197, %esi            # imm = 0x197
callq 0x1eac8
cmpw $-0x1, %ax
je 0x20e70
movswq %ax, %r14
imulq $0x2c, %r14, %rax
leaq 0x40cddb(%rip), %rcx    # 0x42db30
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 0x5918e8(%rip), %r9     # 0x5b2660
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
movl 0x1c(%rdx), %esi
movw %si, 0x1c(%rcx,%rax)
addl $0x200, %esi            # imm = 0x200
movl $0x7ff, %r8d            # imm = 0x7FF
andl %r8d, %esi
leaq 0x55ee0e(%rip), %r9     # 0x57fbd0
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)
addl $0x1000, %ebp           # imm = 0x1000
movw %bp, 0x1e(%rcx,%rax)
movabsq $-0xffffffffffe2, %rdx  # imm = 0xFFFF00000000001E
movq %rdx, 0x24(%rcx,%rax)
leaq (%r14,%r14,2), %rsi
shlq $0x2, %rsi
addq 0xb01a4(%rip), %rsi     # 0xd0fb0
movl $0x3, %edx
callq 0x6110e
movq (%r15,%r14,8), %rax
movl %ebx, 0x8(%rax)
movl $0x147, %edi            # imm = 0x147
callq 0x1f457
movq 0xb19c2(%rip), %rax     # 0xd27f0
movzbl (%rax), %eax
movq (%r15,%r14,8), %rcx
movw %ax, 0x26(%rcx)
movq (%r15,%r14,8), %rax
movzwl 0x26(%rax), %ecx
cmpw $0x9, %cx
jl 0x20e55
movw $0x8, 0x26(%rax)
movq (%r15,%r14,8), %rax
movzwl 0x26(%rax), %ecx
testw %cx, %cx
jns 0x20e64
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