// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/tekstat.c
// Function: bloodonwall
void
bloodonwall(int wn, int x,int y,int z, short sect, short daang, int hitx, int hity, int hitz)
{
     int  j;

     if( wallptr[wn]->lotag != 0 ) {
          return;
     }

     switch( wallptr[wn]->picnum ) {
     case 15:
     case 71:
     case 72:
     case 87:
     case 93:
     case 92:
     case 95:
     case 97:
     case 98:
     case 99:
     case 124:
     case 126:
     case 147:
     case 152:
     case 214:
     case 215:
     case 235:
     case 236:
     case 636:
     case 855:
     case 1457:
          return;
     default:
          break;
     }

     if( wallptr[wn]->lotag == 0 ) {
          wallptr[wn]->lotag=1;
		neartag(x,y,z,sect,daang,
                  &neartagsector,&neartagwall,&neartagsprite,&neartaghitdist,512L,1);
          if( neartagwall != -1 ) {
               j=jsinsertsprite(sect, BLOODFLOW);
               if( j != -1 ) {
                    sprptr[j]->picnum=WALLBLOOD;
                    sprptr[j]->x=hitx;
                    sprptr[j]->y=hity;
                    sprptr[j]->z=hitz+2048;
                    if( sprptr[j]->z > sectptr[sect]->floorz )
                         sprptr[j]->z=sectptr[sect]->floorz-2048;
                    sprptr[j]->xrepeat=16;
                    sprptr[j]->yrepeat=16;
                    sprptr[j]->xvel=0;
                    sprptr[j]->yvel=0;
                    sprptr[j]->zvel=0;
                    sprptr[j]->cstat=0x0090;
                    sprptr[j]->ang=wallnormal(wn);
                    sprptr[j]->shade=0;
                    sprptr[j]->extra=-1;
                    sprptr[j]->lotag=0;
                    sprptr[j]->hitag=0;
               }
          }
          wallptr[wn]->lotag=0;
     }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movslq %edi, %r15
leaq 0x1d85db(%rip), %r12    # 0x1f7230
movq (%r12,%r15,8), %rax
cmpw $0x0, 0x1a(%rax)
jne 0x1ee41
movl %r8d, %ebp
movl %edi, %ebx
movzwl 0x10(%rax), %edi
leal -0x47(%rdi), %r8d
cmpl $0x37, %r8d
ja 0x1ec8b
movabsq $0xa000001d610003, %r10 # imm = 0xA000001D610003
btq %r8, %r10
jb 0x1ee41
leal -0xd6(%rdi), %r8d
cmpl $0x16, %r8d
jbe 0x1ee31
cmpl $0xf, %edi
je 0x1ee41
cmpl $0x93, %edi
je 0x1ee41
cmpl $0x98, %edi
je 0x1ee41
cmpl $0x27c, %edi            # imm = 0x27C
je 0x1ee41
cmpl $0x357, %edi            # imm = 0x357
je 0x1ee41
cmpl $0x5b1, %edi            # imm = 0x5B1
je 0x1ee41
movw $0x1, 0x1a(%rax)
subq $0x8, %rsp
leaq 0xbcc46(%rip), %rax     # 0xdb938
leaq 0xbcc3b(%rip), %r10     # 0xdb934
leaq 0xbcc30(%rip), %r13     # 0xdb930
movswl %bp, %r14d
movswl %r9w, %r8d
leaq 0xbcc23(%rip), %r9      # 0xdb932
movl %esi, %edi
movl %edx, %esi
movl %ecx, %edx
movl %r14d, %ecx
pushq $0x1
pushq $0x200                  # imm = 0x200
pushq %rax
pushq %r10
pushq %r13
callq 0x459b5
addq $0x30, %rsp
cmpw $-0x1, (%r13)
je 0x1ee26
movl %r14d, %edi
movl $0x198, %esi            # imm = 0x198
callq 0x1cf0c
cmpw $-0x1, %ax
je 0x1ee26
movl 0x50(%rsp), %ecx
movl 0x48(%rsp), %edx
movl 0x40(%rsp), %esi
movswq %ax, %r14
leaq 0x1084c9(%rip), %r13    # 0x127230
movq (%r13,%r14,8), %rax
movw $0x154, 0xe(%rax)       # imm = 0x154
movq (%r13,%r14,8), %rax
movl %esi, (%rax)
movq (%r13,%r14,8), %rax
movl %edx, 0x4(%rax)
addl $0x800, %ecx            # imm = 0x800
movq (%r13,%r14,8), %rax
movl %ecx, 0x8(%rax)
movq (%r13,%r14,8), %rax
movswq %bp, %rcx
leaq 0x1d0491(%rip), %rdx    # 0x1ef230
movq (%rdx,%rcx,8), %rcx
movl 0x8(%rcx), %ecx
cmpl %ecx, 0x8(%rax)
jle 0x1edb9
addl $0xfffff800, %ecx       # imm = 0xFFFFF800
movl %ecx, 0x8(%rax)
movq (%r13,%r14,8), %rax
movb $0x10, %cl
movb %cl, 0x14(%rax)
movq (%r13,%r14,8), %rax
movb %cl, 0x15(%rax)
movq (%r13,%r14,8), %rax
andw $0x0, 0x20(%rax)
movq (%r13,%r14,8), %rax
andw $0x0, 0x22(%rax)
movq (%r13,%r14,8), %rax
andw $0x0, 0x24(%rax)
movq (%r13,%r14,8), %rax
movw $0x90, 0xc(%rax)
movl %ebx, %edi
callq 0x1d840
movq (%r13,%r14,8), %rcx
movw %ax, 0x1c(%rcx)
movq (%r13,%r14,8), %rax
movb $0x0, 0x10(%rax)
movq (%r13,%r14,8), %rax
orw $-0x1, 0x2a(%rax)
movq (%r13,%r14,8), %rax
andw $0x0, 0x26(%rax)
movq (%r13,%r14,8), %rax
andw $0x0, 0x28(%rax)
movq (%r12,%r15,8), %rax
andw $0x0, 0x1a(%rax)
jmp 0x1ee41
movl $0x600003, %r10d        # imm = 0x600003
btl %r8d, %r10d
jae 0x1ec9c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq