// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/src/bstub.c
// Function: ExtShowSectorData
void ExtShowSectorData(short sectnum)   //F5
{
    int  i,effect;
    int  delay=0,rotating=0,switches=0,totsprites=0;
    char lighting[16],flooreffect[16],walleffect[16],ceileffect[16];
    char *secttype;

     switch (sector[sectnum].lotag) {
     case 0:
          secttype="NORMAL";
          break;
     case 1:
          secttype="ACTIVATE SECTOR";
          break;
     case 6:
          secttype="RISING DOOR";
          break;
     case 7:
          secttype="DROP DOOR";
          break;
     case 8:
          secttype="HOR SPLIT DOOR";
          break;
     case 9:
          secttype="VER SPLIT DOOR";
          break;
     case 14:
          secttype="ROTATING";
          break;
     case 1000:
          secttype="PLATFORM ELEVATOR";
          break;
     case 1003:
          secttype="BOX ELEVATOR";
          break;
     default:
          secttype="UNDEFINED";
          break;
     }
     memset(lighting,0,sizeof(lighting));
     memset(flooreffect,0,sizeof(flooreffect));
     memset(ceileffect,0,sizeof(ceileffect));
     memset(walleffect,0,sizeof(walleffect));
     i=headspritesect[sectnum];
     while (i != -1) {
          if (sprite[i].picnum == 104) {
               effect=sprite[i].lotag-1000;
               switch (effect) {
               case PULSELIGHT:
                    strcat(lighting,"Pulsing ");
                    break;
               case FLICKERLIGHT:
                    strcat(lighting,"Flickering ");
                    break;
               case DELAYEFFECT:
                    delay=sprite[i].hitag;
                    break;
               case WPANNING:
                    sprintf(walleffect,"Panning (A=%d)",sprite[i].ang);
                    break;
               case FPANNING:
                    sprintf(flooreffect,"Panning (A=%d)",sprite[i].ang);
                    break;
               case CPANNING:
                    sprintf(ceileffect,"Panning (A=%d)",sprite[i].ang);
                    break;
               }
          }
          else if (sprite[i].lotag == 3) {
               rotating++;
          }
          else if (sprite[i].lotag == 4) {
               switches++;
          }
          else {
               totsprites++;
          }
          i=nextspritesect[i];
     }
     clearmidstatbar16();
     sprintf(tempbuf,"Effects for Sector %d (type=%s)",sectnum,secttype);
     printext16(1*8,4*8,11,-1,tempbuf,0);
     PrintStatusStr("Lighting Effect =",lighting,2,6,11);
     PrintStatus("Tic Delay       =",delay,2,7,11);
     PrintStatusStr("Wall Effects    =",walleffect,2,8,11);
     PrintStatusStr("Floor Effects   =",flooreffect,2,9,11);
     PrintStatusStr("Ceiling Effects =",ceileffect,2,10,11);
     PrintStatus("Rotating Sprites=",rotating,2,11,11);
     PrintStatus("Switches        =",switches,2,12,11);
     PrintStatus("Total Sprites   =",totsprites,2,13,11);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movslq %edi, %rdx
leaq (%rdx,%rdx,4), %rax
leaq 0x2392fe(%rip), %rcx    # 0x243a60
movzwl 0x22(%rcx,%rax,8), %eax
cmpq $0xe, %rax
ja 0xa786
leaq 0x68a1c(%rip), %rcx     # 0x73190
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x697b2(%rip), %rax     # 0x73f36
jmp 0xa7e3
cmpl $0x3e8, %eax            # imm = 0x3E8
je 0xa7dc
cmpl $0x3eb, %eax            # imm = 0x3EB
jne 0xa79d
leaq 0x696c3(%rip), %rax     # 0x73e5e
jmp 0xa7e3
leaq 0x697a2(%rip), %rax     # 0x73f46
jmp 0xa7e3
leaq 0x69677(%rip), %rax     # 0x73e24
jmp 0xa7e3
leaq 0x69662(%rip), %rax     # 0x73e18
jmp 0xa7e3
leaq 0x69649(%rip), %rax     # 0x73e08
jmp 0xa7e3
leaq 0x69775(%rip), %rax     # 0x73f3d
jmp 0xa7e3
leaq 0x6966c(%rip), %rax     # 0x73e3d
jmp 0xa7e3
leaq 0x69654(%rip), %rax     # 0x73e2e
jmp 0xa7e3
leaq 0x69669(%rip), %rax     # 0x73e4c
movq %rax, (%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x40(%rsp)
leaq 0x3a1d0b(%rip), %rax    # 0x3ac510
movzwl (%rax,%rdx,2), %eax
cmpw $-0x1, %ax
movq %rdx, 0x28(%rsp)
je 0xa918
leaq 0x272491(%rip), %r13    # 0x27ccb0
leaq 0x689a6(%rip), %r15     # 0x731cc
leaq 0x3abcf3(%rip), %r12    # 0x3b6520
movl $0x0, 0xc(%rsp)
xorl %ebp, %ebp
xorl %r14d, %r14d
movl $0x0, 0x8(%rsp)
movswq %ax, %rbx
imulq $0x2c, %rbx, %rax
cmpw $0x68, 0xe(%r13,%rax)
movzwl 0x26(%r13,%rax), %ecx
jne 0xa894
addl $0xfffffc18, %ecx       # imm = 0xFFFFFC18
cmpl $0x5, %ecx
ja 0xa907
addq %r13, %rax
movslq (%r15,%rcx,4), %rcx
addq %r15, %rcx
jmpq *%rcx
leaq 0x10(%rsp), %rdi
callq 0x6420
movabsq $0x20676e69736c7550, %rcx # imm = 0x20676E69736C7550
movq %rcx, 0x10(%rsp,%rax)
movb $0x0, 0x18(%rsp,%rax)
jmp 0xa907
cmpl $0x4, %ecx
je 0xa8a3
cmpl $0x3, %ecx
jne 0xa8a7
incl %r14d
jmp 0xa907
incl %ebp
jmp 0xa907
incl 0xc(%rsp)
jmp 0xa907
movswl 0x1c(%rax), %edx
leaq 0x50(%rsp), %rdi
jmp 0xa8f9
movswl 0x28(%rax), %eax
movl %eax, 0x8(%rsp)
jmp 0xa907
movswl 0x1c(%rax), %edx
leaq 0x40(%rsp), %rdi
jmp 0xa8f9
leaq 0x10(%rsp), %rdi
callq 0x6420
movabsq $0x6972656b63696c46, %rcx # imm = 0x6972656B63696C46
movq %rcx, 0x10(%rsp,%rax)
movl $0x20676e, 0x18(%rsp,%rax) # imm = 0x20676E
jmp 0xa907
movswl 0x1c(%rax), %edx
leaq 0x30(%rsp), %rdi
leaq 0x69665(%rip), %rsi     # 0x73f65
xorl %eax, %eax
callq 0x6b00
movzwl (%r12,%rbx,2), %eax
cmpw $-0x1, %ax
jne 0xa842
jmp 0xa92d
movl $0x0, 0x8(%rsp)
xorl %r14d, %r14d
xorl %ebp, %ebp
movl $0x0, 0xc(%rsp)
callq 0x1adf6
movswl 0x28(%rsp), %edx
leaq 0x9ada2(%rip), %r13     # 0xa56e0
leaq 0x6962f(%rip), %rsi     # 0x73f74
movq %r13, %rdi
movq (%rsp), %rcx
xorl %eax, %eax
callq 0x6b00
movl $0x8, %edi
movl $0x20, %esi
movl $0xb, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %r13, %r8
xorl %r9d, %r9d
callq 0x1915d
leaq 0x688c8(%rip), %r12     # 0x73241
leaq 0x69614(%rip), %rdx     # 0x73f94
leaq 0x10(%rsp), %rcx
movq %r13, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x6b00
movl $0x10, %edi
movl $0x30, %esi
movl $0xb, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %r13, %r8
xorl %r9d, %r9d
callq 0x1915d
leaq 0x68883(%rip), %r15     # 0x7323b
leaq 0x695e7(%rip), %rdx     # 0x73fa6
movq %r13, %rdi
movq %r15, %rsi
movl 0x8(%rsp), %ecx
xorl %eax, %eax
callq 0x6b00
movl $0x10, %edi
movl $0x38, %esi
movl $0xb, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %r13, %r8
xorl %r9d, %r9d
callq 0x1915d
leaq 0x695c2(%rip), %rdx     # 0x73fb8
leaq 0x40(%rsp), %rcx
movq %r13, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x6b00
movl $0x10, %edi
movl $0x40, %esi
movl $0xb, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %r13, %r8
xorl %r9d, %r9d
callq 0x1915d
leaq 0x6959c(%rip), %rdx     # 0x73fca
leaq 0x50(%rsp), %rcx
movq %r13, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x6b00
movl $0x10, %edi
movl $0x48, %esi
movl $0xb, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %r13, %r8
xorl %r9d, %r9d
callq 0x1915d
leaq 0x69576(%rip), %rdx     # 0x73fdc
leaq 0x30(%rsp), %rcx
movq %r13, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x6b00
movl $0x10, %edi
movl $0x50, %esi
movl $0xb, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %r13, %r8
xorl %r9d, %r9d
callq 0x1915d
leaq 0x69550(%rip), %rdx     # 0x73fee
movq %r13, %rdi
movq %r15, %rsi
movl %r14d, %ecx
xorl %eax, %eax
callq 0x6b00
movl $0x10, %edi
movl $0x58, %esi
movl $0xb, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %r13, %r8
xorl %r9d, %r9d
callq 0x1915d
leaq 0x6952c(%rip), %rdx     # 0x74000
movq %r13, %rdi
movq %r15, %rsi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x6b00
movl $0x10, %edi
movl $0x60, %esi
movl $0xb, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %r13, %r8
xorl %r9d, %r9d
callq 0x1915d
leaq 0x69509(%rip), %rdx     # 0x74012
movq %r13, %rdi
movq %r15, %rsi
movl 0xc(%rsp), %ecx
xorl %eax, %eax
callq 0x6b00
movl $0x10, %edi
movl $0x68, %esi
movl $0xb, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %r13, %r8
xorl %r9d, %r9d
callq 0x1915d
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq