// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekstat.c
// Function: triggersprite
void
triggersprite(short sn)
{
     int      datag;
     short     j;
     short     newext;

     if( option[4] != 0 ) {
          return;
     }

    #ifdef PLRSPRDEBUG
     if( isaplayersprite(sn) ) {
          crashgame("messing w plrsprite at 5");
     }
    #endif

     if( sprptr[sn]->extra == -1 ) {
          return;
     }

	datag = sprptr[sn]->lotag;

     switch( datag ) {

          case SPR_LOTAG_MORPH:
               break;
          case SPR_LOTAG_SPAWNCHASE:
	          j = jsinsertsprite(sprptr[sn]->sectnum,  sprXTptr[ sprptr[sn]->extra ]->basestat);
               if ( j == -1 ) {
                    break;
               }
               newext=mapXT(j);
               if( !validext(newext) ) {
                    jsdeletesprite(j);
                    break;
               }
		     sprptr[j]->x = sprptr[sn]->x+( sintable[(sprptr[sn]->ang+512)&2047]>>6 );
		     sprptr[j]->y = sprptr[sn]->y+( sintable[sprptr[sn]->ang&2047]>>6 );
		     sprptr[j]->z = sprptr[sn]->z;
		     sprptr[j]->cstat = 0x101;
               sprptr[j]->picnum = sprXTptr[ sprptr[sn]->extra ]->basepic;
		     sprptr[j]->shade = sprptr[sn]->shade;
		     sprptr[j]->sectnum = sprptr[sn]->sectnum;
		     sprptr[j]->xrepeat = sprptr[sn]->xrepeat;
		     sprptr[j]->yrepeat = sprptr[sn]->yrepeat;
		     sprptr[j]->ang = sprptr[sn]->ang;
		     sprptr[j]->xvel = sprptr[sn]->xvel;
		     sprptr[j]->yvel = sprptr[sn]->yvel;
		     sprptr[j]->zvel = sprptr[sn]->zvel;
		     sprptr[j]->owner = -1;
		     sprptr[j]->lotag = 0;
		     sprptr[j]->hitag = 0;
               sprXTptr[ sprptr[j]->extra ]->basestat  = sprXTptr[ sprptr[sn]->extra ]->basestat;
               sprXTptr[ sprptr[j]->extra ]->basepic   = sprXTptr[ sprptr[sn]->extra ]->basepic;
               sprXTptr[ sprptr[j]->extra ]->walkpic   = sprXTptr[ sprptr[sn]->extra ]->walkpic;
               sprXTptr[ sprptr[j]->extra ]->standpic  = sprXTptr[ sprptr[sn]->extra ]->standpic;
               sprXTptr[ sprptr[j]->extra ]->runpic    = sprXTptr[ sprptr[sn]->extra ]->runpic;
               sprXTptr[ sprptr[j]->extra ]->attackpic = sprXTptr[ sprptr[sn]->extra ]->attackpic;
               sprXTptr[ sprptr[j]->extra ]->deathpic  = sprXTptr[ sprptr[sn]->extra ]->deathpic;
               sprXTptr[ sprptr[j]->extra ]->morphpic  = sprXTptr[ sprptr[sn]->extra ]->morphpic;
               sprXTptr[ sprptr[j]->extra ]->specialpic = sprXTptr[ sprptr[sn]->extra ]->specialpic;
               // delete trigger tag from old sprites
               sprptr[sn]->lotag=0;
               sprptr[sn]->hitag=0;
               clearXTpics(sn);
			break;
          default:
               newstatus(sn, sprXTptr[ sprptr[sn]->extra ]->basestat);
               break;
      }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movw %di, %ax
movw %ax, -0x2(%rbp)
leaq 0xed4e2(%rip), %rax     # 0x119f18
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
je 0x2ca44
jmp 0x2d0ba
movswl -0x2(%rbp), %edi
callq 0x2aec0
cmpl $0x0, %eax
je 0x2ca60
leaq 0xad8f9(%rip), %rdi     # 0xda352
movb $0x0, %al
callq 0x44240
movswq -0x2(%rbp), %rcx
leaq 0x14d774(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswl 0x2a(%rax), %eax
cmpl $-0x1, %eax
jne 0x2ca7e
jmp 0x2d0ba
movswq -0x2(%rbp), %rcx
leaq 0x14d756(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswl 0x26(%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x10(%rbp)
subl $0x7d0, %eax            # imm = 0x7D0
je 0x2cab9
jmp 0x2caa4
movl -0x10(%rbp), %eax
subl $0x7d3, %eax            # imm = 0x7D3
jne 0x2d08a
jmp 0x2cab4
jmp 0x2d0ba
movswq -0x2(%rbp), %rcx
leaq 0x14d71b(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw 0x18(%rax), %cx
movswq -0x2(%rbp), %rdx
leaq 0x14d707(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movswq 0x2a(%rax), %rdx
leaq 0x1f56f7(%rip), %rax    # 0x2221e0
movq (%rax,%rdx,8), %rax
movswl %cx, %edi
movswl 0x8(%rax), %esi
callq 0x2abd0
movw %ax, -0xa(%rbp)
movswl -0xa(%rbp), %eax
cmpl $-0x1, %eax
jne 0x2cb0b
jmp 0x2d0ba
movswl -0xa(%rbp), %edi
callq 0x2b0a0
movw %ax, -0xc(%rbp)
movswl -0xc(%rbp), %edi
callq 0x2ae90
cmpl $0x0, %eax
jne 0x2cb34
movswl -0xa(%rbp), %edi
callq 0x2ae00
jmp 0x2d0ba
movswq -0x2(%rbp), %rcx
leaq 0x14d6a0(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl (%rax), %ecx
movswq -0x2(%rbp), %rdx
leaq 0x14d68e(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movswl 0x1c(%rax), %eax
addl $0x200, %eax            # imm = 0x200
andl $0x7ff, %eax            # imm = 0x7FF
movslq %eax, %rdx
leaq 0x59c012(%rip), %rax    # 0x5c8b80
movswl (%rax,%rdx,2), %eax
sarl $0x6, %eax
addl %eax, %ecx
movswq -0xa(%rbp), %rdx
leaq 0x14d65d(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movl %ecx, (%rax)
movswq -0x2(%rbp), %rcx
leaq 0x14d64b(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl 0x4(%rax), %ecx
movswq -0x2(%rbp), %rdx
leaq 0x14d638(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movswl 0x1c(%rax), %eax
andl $0x7ff, %eax            # imm = 0x7FF
movslq %eax, %rdx
leaq 0x59bfc1(%rip), %rax    # 0x5c8b80
movswl (%rax,%rdx,2), %eax
sarl $0x6, %eax
addl %eax, %ecx
movswq -0xa(%rbp), %rdx
leaq 0x14d60c(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movl %ecx, 0x4(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x14d5f9(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movl 0x8(%rax), %ecx
movswq -0xa(%rbp), %rdx
leaq 0x14d5e6(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movl %ecx, 0x8(%rax)
movswq -0xa(%rbp), %rcx
leaq 0x14d5d3(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw $0x101, 0xc(%rax)       # imm = 0x101
movswq -0x2(%rbp), %rcx
leaq 0x14d5bd(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswq 0x2a(%rax), %rcx
leaq 0x1f55ad(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rax
movw 0xa(%rax), %cx
movswq -0xa(%rbp), %rdx
leaq 0x14d599(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movw %cx, 0xe(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x14d585(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movb 0x10(%rax), %cl
movswq -0xa(%rbp), %rdx
leaq 0x14d572(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movb %cl, 0x10(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x14d55f(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw 0x18(%rax), %cx
movswq -0xa(%rbp), %rdx
leaq 0x14d54b(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movw %cx, 0x18(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x14d537(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movb 0x14(%rax), %cl
movswq -0xa(%rbp), %rdx
leaq 0x14d524(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movb %cl, 0x14(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x14d511(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movb 0x15(%rax), %cl
movswq -0xa(%rbp), %rdx
leaq 0x14d4fe(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movb %cl, 0x15(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x14d4eb(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw 0x1c(%rax), %cx
movswq -0xa(%rbp), %rdx
leaq 0x14d4d7(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movw %cx, 0x1c(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x14d4c3(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw 0x20(%rax), %cx
movswq -0xa(%rbp), %rdx
leaq 0x14d4af(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movw %cx, 0x20(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x14d49b(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw 0x22(%rax), %cx
movswq -0xa(%rbp), %rdx
leaq 0x14d487(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movw %cx, 0x22(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x14d473(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw 0x24(%rax), %cx
movswq -0xa(%rbp), %rdx
leaq 0x14d45f(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movw %cx, 0x24(%rax)
movswq -0xa(%rbp), %rcx
leaq 0x14d44b(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw $0xffff, 0x1e(%rax)     # imm = 0xFFFF
movswq -0xa(%rbp), %rcx
leaq 0x14d435(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw $0x0, 0x26(%rax)
movswq -0xa(%rbp), %rcx
leaq 0x14d41f(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw $0x0, 0x28(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x14d409(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswq 0x2a(%rax), %rcx
leaq 0x1f53f9(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rax
movw 0x8(%rax), %cx
movswq -0xa(%rbp), %rdx
leaq 0x14d3e5(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movswq 0x2a(%rax), %rdx
leaq 0x1f53d5(%rip), %rax    # 0x2221e0
movq (%rax,%rdx,8), %rax
movw %cx, 0x8(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x14d3c1(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswq 0x2a(%rax), %rcx
leaq 0x1f53b1(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rax
movw 0xa(%rax), %cx
movswq -0xa(%rbp), %rdx
leaq 0x14d39d(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movswq 0x2a(%rax), %rdx
leaq 0x1f538d(%rip), %rax    # 0x2221e0
movq (%rax,%rdx,8), %rax
movw %cx, 0xa(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x14d379(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswq 0x2a(%rax), %rcx
leaq 0x1f5369(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rax
movw 0xe(%rax), %cx
movswq -0xa(%rbp), %rdx
leaq 0x14d355(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movswq 0x2a(%rax), %rdx
leaq 0x1f5345(%rip), %rax    # 0x2221e0
movq (%rax,%rdx,8), %rax
movw %cx, 0xe(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x14d331(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswq 0x2a(%rax), %rcx
leaq 0x1f5321(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rax
movw 0xc(%rax), %cx
movswq -0xa(%rbp), %rdx
leaq 0x14d30d(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movswq 0x2a(%rax), %rdx
leaq 0x1f52fd(%rip), %rax    # 0x2221e0
movq (%rax,%rdx,8), %rax
movw %cx, 0xc(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x14d2e9(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswq 0x2a(%rax), %rcx
leaq 0x1f52d9(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rax
movw 0x10(%rax), %cx
movswq -0xa(%rbp), %rdx
leaq 0x14d2c5(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movswq 0x2a(%rax), %rdx
leaq 0x1f52b5(%rip), %rax    # 0x2221e0
movq (%rax,%rdx,8), %rax
movw %cx, 0x10(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x14d2a1(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswq 0x2a(%rax), %rcx
leaq 0x1f5291(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rax
movw 0x12(%rax), %cx
movswq -0xa(%rbp), %rdx
leaq 0x14d27d(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movswq 0x2a(%rax), %rdx
leaq 0x1f526d(%rip), %rax    # 0x2221e0
movq (%rax,%rdx,8), %rax
movw %cx, 0x12(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x14d259(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswq 0x2a(%rax), %rcx
leaq 0x1f5249(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rax
movw 0x14(%rax), %cx
movswq -0xa(%rbp), %rdx
leaq 0x14d235(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movswq 0x2a(%rax), %rdx
leaq 0x1f5225(%rip), %rax    # 0x2221e0
movq (%rax,%rdx,8), %rax
movw %cx, 0x14(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x14d211(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswq 0x2a(%rax), %rcx
leaq 0x1f5201(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rax
movw 0x1a(%rax), %cx
movswq -0xa(%rbp), %rdx
leaq 0x14d1ed(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movswq 0x2a(%rax), %rdx
leaq 0x1f51dd(%rip), %rax    # 0x2221e0
movq (%rax,%rdx,8), %rax
movw %cx, 0x1a(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x14d1c9(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswq 0x2a(%rax), %rcx
leaq 0x1f51b9(%rip), %rax    # 0x2221e0
movq (%rax,%rcx,8), %rax
movw 0x1c(%rax), %cx
movswq -0xa(%rbp), %rdx
leaq 0x14d1a5(%rip), %rax    # 0x17a1e0
movq (%rax,%rdx,8), %rax
movswq 0x2a(%rax), %rdx
leaq 0x1f5195(%rip), %rax    # 0x2221e0
movq (%rax,%rdx,8), %rax
movw %cx, 0x1c(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x14d181(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw $0x0, 0x26(%rax)
movswq -0x2(%rbp), %rcx
leaq 0x14d16b(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movw $0x0, 0x28(%rax)
movswl -0x2(%rbp), %edi
callq 0x2af50
jmp 0x2d0ba
movw -0x2(%rbp), %ax
movswq -0x2(%rbp), %rdx
leaq 0x14d146(%rip), %rcx    # 0x17a1e0
movq (%rcx,%rdx,8), %rcx
movswq 0x2a(%rcx), %rdx
leaq 0x1f5136(%rip), %rcx    # 0x2221e0
movq (%rcx,%rdx,8), %rcx
movswl 0x8(%rcx), %esi
movswl %ax, %edi
callq 0x2d0c0
addq $0x10, %rsp
popq %rbp
retq