// File: /workspace/github_c_makefile_star2_O2/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 0xa8b16(%rip), %rax     # 0xc7978
xorl %r14d, %r14d
cmpb $0x0, 0x4(%rax)
jne 0x1f03f
movl %edi, %ebp
movslq %edi, %r12
leaq 0x1083b5(%rip), %r15    # 0x127230
movq (%r15,%r12,8), %rax
movzwl 0x2a(%rax), %r13d
cmpw $0x3fff, %r13w          # imm = 0x3FFF
ja 0x1f03f
movl %esi, %ebx
movl %ebp, %edi
callq 0x1f051
testl %eax, %eax
jne 0x1f03f
movl %ebp, %edi
callq 0x1f09c
testl %eax, %eax
jne 0x1f03f
movzwl %r13w, %eax
leaq 0x1b0375(%rip), %rcx    # 0x1cf230
movq (%rcx,%rax,8), %rax
movzwl 0xa(%rax), %eax
cmpl $0x163, %eax            # imm = 0x163
je 0x1ef06
cmpl $0x45b, %eax            # imm = 0x45B
je 0x1ef06
cmpl $0x6d7, %eax            # imm = 0x6D7
je 0x1ef06
cmpl $0x709, %eax            # imm = 0x709
je 0x1ef06
cmpl $0x72a, %eax            # imm = 0x72A
je 0x1ef06
cmpl $0x75f, %eax            # imm = 0x75F
je 0x1ef06
cmpl $0x79e, %eax            # imm = 0x79E
je 0x1ef06
cmpl $0x811, %eax            # imm = 0x811
je 0x1ef06
cmpl $0x7d3, %eax            # imm = 0x7D3
jne 0x1f03f
movq (%r15,%r12,8), %rax
movswl 0x18(%rax), %edi
movl $0x197, %esi            # imm = 0x197
callq 0x1cf0c
cmpw $-0x1, %ax
je 0x1f03f
movswq %ax, %r14
imulq $0x2c, %r14, %rax
leaq 0x404bff(%rip), %rcx    # 0x423b30
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), %rdi
leaq 0x589710(%rip), %r8     # 0x5a8660
movswl (%r8,%rdi,2), %edi
shll $0x6, %edi
subl %edi, %esi
movl %esi, 0x8(%rcx,%rax)
movl $0x1470080, 0xc(%rcx,%rax) # imm = 0x1470080
andw $0x0, 0x10(%rcx,%rax)
leaq (%rcx,%rax), %rdi
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 0x556c35(%rip), %r9     # 0x575bd0
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)
imulq $0xc, %r14, %rsi
addq 0xa7fd7(%rip), %rsi     # 0xc6fb8
pushq $0x3
popq %rdx
callq 0x56a36
movq (%r15,%r14,8), %rax
movl %ebx, 0x8(%rax)
movl $0x147, %edi            # imm = 0x147
callq 0x1d783
movq 0xa97ef(%rip), %rax     # 0xc87f0
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 0x1f028
movw $0x8, 0x26(%rax)
movq (%r15,%r14,8), %rax
movzwl 0x26(%rax), %ecx
testw %cx, %cx
jns 0x1f036
andw $0x0, 0x26(%rax)
movq (%r15,%r14,8), %rax
andw $0x0, 0x28(%rax)
pushq $0x1
popq %r14
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq