// File: /workspace/github_c_makefile_star2_O1/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 0x1dda15(%rip), %r12    # 0x1fe210
movq (%r12,%r15,8), %rax
cmpw $0x0, 0x1a(%rax)
jne 0x20859
movl %r8d, %ebp
movl %edi, %ebx
movzwl 0x10(%rax), %edi
cmpl $0x92, %edi
jg 0x20838
leal -0x47(%rdi), %r8d
cmpl $0x37, %r8d
ja 0x20831
movabsq $0xa000001d610003, %r10 # imm = 0xA000001D610003
btq %r8, %r10
jb 0x20859
cmpl $0xf, %edi
je 0x20859
jmp 0x20892
cmpl $0x27b, %edi            # imm = 0x27B
jg 0x20868
leal -0xd6(%rdi), %r8d
cmpl $0x16, %r8d
ja 0x20882
movl $0x600003, %r10d        # imm = 0x600003
btl %r8d, %r10d
jae 0x20882
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x27c, %edi            # imm = 0x27C
je 0x20859
cmpl $0x357, %edi            # imm = 0x357
je 0x20859
cmpl $0x5b1, %edi            # imm = 0x5B1
je 0x20859
jmp 0x20892
cmpl $0x93, %edi
je 0x20859
cmpl $0x98, %edi
je 0x20859
movw $0x1, 0x1a(%rax)
subq $0x8, %rsp
leaq 0xc2095(%rip), %rax     # 0xe2938
leaq 0xc208a(%rip), %r10     # 0xe2934
leaq 0xc207f(%rip), %r13     # 0xe2930
movswl %bp, %r14d
movswl %r9w, %r8d
leaq 0xc2072(%rip), %r9      # 0xe2932
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 0x487a8
addq $0x30, %rsp
cmpw $-0x1, (%r13)
je 0x209d5
movl %r14d, %edi
movl $0x198, %esi            # imm = 0x198
callq 0x1e94c
cmpw $-0x1, %ax
je 0x209d5
movl 0x50(%rsp), %ecx
movl 0x48(%rsp), %edx
movl 0x40(%rsp), %esi
movswq %ax, %r14
leaq 0x10d8f8(%rip), %r13    # 0x12e210
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 0x1d58c0(%rip), %rdx    # 0x1f6210
movq (%rdx,%rcx,8), %rcx
movl 0x8(%rcx), %ecx
cmpl %ecx, 0x8(%rax)
jle 0x20965
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
xorl %ebp, %ebp
movw %bp, 0x20(%rax)
movq (%r13,%r14,8), %rax
movw %bp, 0x22(%rax)
movq (%r13,%r14,8), %rax
movw %bp, 0x24(%rax)
movq (%r13,%r14,8), %rax
movw $0x90, 0xc(%rax)
movl %ebx, %edi
callq 0x1f27e
movq (%r13,%r14,8), %rcx
movw %ax, 0x1c(%rcx)
movq (%r13,%r14,8), %rax
movb $0x0, 0x10(%rax)
movq (%r13,%r14,8), %rax
movw $0xffff, 0x2a(%rax)     # imm = 0xFFFF
movq (%r13,%r14,8), %rax
movw %bp, 0x26(%rax)
movq (%r13,%r14,8), %rax
movw %bp, 0x28(%rax)
movq (%r12,%r15,8), %rax
movw $0x0, 0x1a(%rax)
jmp 0x20859