// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tektag.c
// Function: teknewsector
void
teknewsector(short p)
{
     int           i,n,nexti,s;
     int           sn;
     struct    sectoreffect   *septr;

     s=cursectnum[p];
     septr=septrlist[s];

     #define NEWMAPLOTAG 25
     if( (sector[s].lotag == NEWMAPLOTAG) && (option[4] == 0) ) {
          newmap(sector[s].hitag);
          return;
     }

     if( sectptr[cursectnum[p]]->lotag == 4 ) {
          playsound(S_SPLASH,posx[p],posy[p],0,ST_UPDATE);
     }

     if( septr != NULL ) {
          if( septr->warpto >= 0 ) {
               sn=playersprite[p];
               tekwarp(&sprite[sn].x,&sprite[sn].y,&sprite[sn].z,( short *)&(septr->warpto));
               copybuf(&sprite[sn].x,&osprite[sn].x,3);
               changespritesect(sn,septr->warpto);
               posx[p] = sprite[playersprite[p]].x;
               posy[p] = sprite[playersprite[p]].y;
               posz[p] = sprite[playersprite[p]].z;
               ang[p] = sprite[playersprite[p]].ang;
               cursectnum[p] = sprite[playersprite[p]].sectnum;
               sprite[playersprite[p]].z += (KENSPLAYERHEIGHT<<8);
          }
     }

     for( n=connecthead; n >= 0; n=connectpoint2[n] ) {
          if( (sectptr[cursectnum[n]]->lotag == 1) || (sectptr[cursectnum[n]]->lotag == 2) ) {
               for( i=0; i < numsectors; i++ ) {
                    if( sectptr[i]->hitag == sectptr[cursectnum[n]]->hitag ) {
                         if( (sectptr[i]->lotag != 1) && (sectptr[i]->lotag != 2) ) {
                              operatesector(i);
                          }
                   }
               }
               i=headspritestat[0];
               while( i != -1 ) {
                    nexti=nextspritestat[i];
                    if( sprptr[i]->hitag == sectptr[cursectnum[n]]->hitag ) {
                         operatesprite(i);
                    }
               i=nexti;
               }
          }
     }

     checkmapsndfx(p);
     sectortriggersprites(p);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %di, %ax
movw %ax, -0x2(%rbp)
movswq -0x2(%rbp), %rcx
leaq 0xef225(%rip), %rax     # 0x12e6e0
movswl (%rax,%rcx,2), %eax
movl %eax, -0x14(%rbp)
movslq -0x14(%rbp), %rcx
leaq 0x309fe3(%rip), %rax    # 0x3494b0
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movslq -0x14(%rbp), %rcx
leaq 0x3fe3b0(%rip), %rax    # 0x43d890
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movswl 0x22(%rax), %eax
cmpl $0x19, %eax
jne 0x3f520
leaq 0xdaa21(%rip), %rax     # 0x119f18
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
jne 0x3f520
movslq -0x14(%rbp), %rcx
leaq 0x3fe385(%rip), %rax    # 0x43d890
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movswl 0x24(%rax), %edi
callq 0x1dcb0
jmp 0x3f8f2
movswq -0x2(%rbp), %rcx
leaq 0xef1b4(%rip), %rax     # 0x12e6e0
movswq (%rax,%rcx,2), %rcx
leaq 0x202ca8(%rip), %rax    # 0x2421e0
movq (%rax,%rcx,8), %rax
movswl 0x22(%rax), %eax
cmpl $0x4, %eax
jne 0x3f575
movswq -0x2(%rbp), %rcx
leaq 0xee2ff(%rip), %rax     # 0x12d850
movl (%rax,%rcx,4), %esi
movswq -0x2(%rbp), %rcx
leaq 0xee330(%rip), %rax     # 0x12d890
movl (%rax,%rcx,4), %edx
movl $0xb, %edi
xorl %ecx, %ecx
movl $0x2, %r8d
callq 0x26af0
cmpq $0x0, -0x20(%rbp)
je 0x3f757
movq -0x20(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jl 0x3f755
movswq -0x2(%rbp), %rcx
leaq 0xef176(%rip), %rax     # 0x12e710
movswl (%rax,%rcx,2), %eax
movl %eax, -0x18(%rbp)
movslq -0x18(%rbp), %rax
leaq 0x437534(%rip), %rdi    # 0x476ae0
imulq $0x2c, %rax, %rax
addq %rax, %rdi
movslq -0x18(%rbp), %rax
leaq 0x437522(%rip), %rsi    # 0x476ae0
imulq $0x2c, %rax, %rax
addq %rax, %rsi
addq $0x4, %rsi
movslq -0x18(%rbp), %rax
leaq 0x43750c(%rip), %rdx    # 0x476ae0
imulq $0x2c, %rax, %rax
addq %rax, %rdx
addq $0x8, %rdx
movq -0x20(%rbp), %rcx
addq $0x20, %rcx
callq 0x3f340
movslq -0x18(%rbp), %rax
leaq 0x4374e9(%rip), %rdi    # 0x476ae0
imulq $0x2c, %rax, %rax
addq %rax, %rdi
movslq -0x18(%rbp), %rax
leaq 0xf6617(%rip), %rsi     # 0x135c20
imulq $0xc, %rax, %rax
addq %rax, %rsi
movl $0x3, %edx
callq 0x8c070
movl -0x18(%rbp), %eax
movw %ax, %cx
movq -0x20(%rbp), %rax
movl 0x20(%rax), %eax
movswl %cx, %edi
movswl %ax, %esi
callq 0x69bd0
movswq -0x2(%rbp), %rcx
leaq 0xef0d2(%rip), %rax     # 0x12e710
movswq (%rax,%rcx,2), %rcx
leaq 0x437496(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edx
movswq -0x2(%rbp), %rcx
leaq 0xee1f1(%rip), %rax     # 0x12d850
movl %edx, (%rax,%rcx,4)
movswq -0x2(%rbp), %rcx
leaq 0xef0a2(%rip), %rax     # 0x12e710
movswq (%rax,%rcx,2), %rcx
leaq 0x437466(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %edx
movswq -0x2(%rbp), %rcx
leaq 0xee200(%rip), %rax     # 0x12d890
movl %edx, (%rax,%rcx,4)
movswq -0x2(%rbp), %rcx
leaq 0xef071(%rip), %rax     # 0x12e710
movswq (%rax,%rcx,2), %rcx
leaq 0x437435(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %edx
movswq -0x2(%rbp), %rcx
leaq 0xee20f(%rip), %rax     # 0x12d8d0
movl %edx, (%rax,%rcx,4)
movswq -0x2(%rbp), %rcx
leaq 0xef040(%rip), %rax     # 0x12e710
movswq (%rax,%rcx,2), %rcx
leaq 0x437404(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movw 0x1c(%rax), %dx
movswq -0x2(%rbp), %rcx
leaq 0xee13d(%rip), %rax     # 0x12d830
movw %dx, (%rax,%rcx,2)
movswq -0x2(%rbp), %rcx
leaq 0xef00d(%rip), %rax     # 0x12e710
movswq (%rax,%rcx,2), %rcx
leaq 0x4373d1(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movw 0x18(%rax), %dx
movswq -0x2(%rbp), %rcx
leaq 0xeefba(%rip), %rax     # 0x12e6e0
movw %dx, (%rax,%rcx,2)
movswq -0x2(%rbp), %rcx
leaq 0xeefda(%rip), %rax     # 0x12e710
movswq (%rax,%rcx,2), %rcx
leaq 0x43739e(%rip), %rax    # 0x476ae0
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
addl $0x2200, %ecx           # imm = 0x2200
movl %ecx, 0x8(%rax)
jmp 0x3f757
leaq 0x7657f2(%rip), %rax    # 0x7a4f50
movl (%rax), %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x3f8e0
movslq -0xc(%rbp), %rcx
leaq 0xeef68(%rip), %rax     # 0x12e6e0
movswq (%rax,%rcx,2), %rcx
leaq 0x202a5c(%rip), %rax    # 0x2421e0
movq (%rax,%rcx,8), %rax
movswl 0x22(%rax), %eax
cmpl $0x1, %eax
je 0x3f7b9
movslq -0xc(%rbp), %rcx
leaq 0xeef44(%rip), %rax     # 0x12e6e0
movswq (%rax,%rcx,2), %rcx
leaq 0x202a38(%rip), %rax    # 0x2421e0
movq (%rax,%rcx,8), %rax
movswl 0x22(%rax), %eax
cmpl $0x2, %eax
jne 0x3f8c8
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
leaq 0x58a5c6(%rip), %rcx    # 0x5c9d90
movswl (%rcx), %ecx
cmpl %ecx, %eax
jge 0x3f858
movslq -0x8(%rbp), %rcx
leaq 0x202a00(%rip), %rax    # 0x2421e0
movq (%rax,%rcx,8), %rax
movswl 0x24(%rax), %eax
movslq -0xc(%rbp), %rdx
leaq 0xeeeed(%rip), %rcx     # 0x12e6e0
movswq (%rcx,%rdx,2), %rdx
leaq 0x2029e1(%rip), %rcx    # 0x2421e0
movq (%rcx,%rdx,8), %rcx
movswl 0x24(%rcx), %ecx
cmpl %ecx, %eax
jne 0x3f848
movslq -0x8(%rbp), %rcx
leaq 0x2029ca(%rip), %rax    # 0x2421e0
movq (%rax,%rcx,8), %rax
movswl 0x22(%rax), %eax
cmpl $0x1, %eax
je 0x3f846
movslq -0x8(%rbp), %rcx
leaq 0x2029b2(%rip), %rax    # 0x2421e0
movq (%rax,%rcx,8), %rax
movswl 0x22(%rax), %eax
cmpl $0x2, %eax
je 0x3f846
movl -0x8(%rbp), %eax
movswl %ax, %edi
callq 0x39e20
jmp 0x3f848
jmp 0x3f84a
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x3f7c0
leaq 0x578af1(%rip), %rax    # 0x5b8350
movswl (%rax), %eax
movl %eax, -0x8(%rbp)
cmpl $-0x1, -0x8(%rbp)
je 0x3f8c6
movslq -0x8(%rbp), %rcx
leaq 0x5812ea(%rip), %rax    # 0x5c0b60
movswl (%rax,%rcx,2), %eax
movl %eax, -0x10(%rbp)
movslq -0x8(%rbp), %rcx
leaq 0x13a958(%rip), %rax    # 0x17a1e0
movq (%rax,%rcx,8), %rax
movswl 0x28(%rax), %eax
movslq -0xc(%rbp), %rdx
leaq 0xeee45(%rip), %rcx     # 0x12e6e0
movswq (%rcx,%rdx,2), %rdx
leaq 0x202939(%rip), %rcx    # 0x2421e0
movq (%rcx,%rdx,8), %rcx
movswl 0x24(%rcx), %ecx
cmpl %ecx, %eax
jne 0x3f8be
movl -0x8(%rbp), %eax
movswl %ax, %edi
callq 0x2a350
movl -0x10(%rbp), %eax
movl %eax, -0x8(%rbp)
jmp 0x3f865
jmp 0x3f8c8
jmp 0x3f8ca
movslq -0xc(%rbp), %rcx
leaq 0x76568b(%rip), %rax    # 0x7a4f60
movl (%rax,%rcx,4), %eax
movl %eax, -0xc(%rbp)
jmp 0x3f763
movswl -0x2(%rbp), %edi
callq 0x3f900
movswl -0x2(%rbp), %edi
callq 0x2ddc0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)