// File: /workspace/github_c_makefile_star2_O1/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 0x238484(%rip), %rcx    # 0x242a60
movzwl 0x22(%rcx,%rax,8), %eax
cmpq $0xe, %rax
ja 0xa600
leaq 0x67ba2(%rip), %rcx     # 0x72190
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x688ec(%rip), %rax     # 0x72eea
jmp 0xa65d
cmpl $0x3e8, %eax            # imm = 0x3E8
je 0xa656
cmpl $0x3eb, %eax            # imm = 0x3EB
jne 0xa617
leaq 0x687fd(%rip), %rax     # 0x72e12
jmp 0xa65d
leaq 0x688dc(%rip), %rax     # 0x72efa
jmp 0xa65d
leaq 0x687b1(%rip), %rax     # 0x72dd8
jmp 0xa65d
leaq 0x6879c(%rip), %rax     # 0x72dcc
jmp 0xa65d
leaq 0x68783(%rip), %rax     # 0x72dbc
jmp 0xa65d
leaq 0x688af(%rip), %rax     # 0x72ef1
jmp 0xa65d
leaq 0x687a6(%rip), %rax     # 0x72df1
jmp 0xa65d
leaq 0x6878e(%rip), %rax     # 0x72de2
jmp 0xa65d
leaq 0x687a3(%rip), %rax     # 0x72e00
movq %rax, (%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x40(%rsp)
leaq 0x3a0e91(%rip), %rax    # 0x3ab510
movzwl (%rax,%rdx,2), %eax
cmpw $-0x1, %ax
movq %rdx, 0x28(%rsp)
je 0xa792
leaq 0x271617(%rip), %r13    # 0x27bcb0
leaq 0x67b2c(%rip), %r15     # 0x721cc
leaq 0x3aae79(%rip), %r12    # 0x3b5520
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 0xa70e
addl $0xfffffc18, %ecx       # imm = 0xFFFFFC18
cmpl $0x5, %ecx
ja 0xa781
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 0xa781
cmpl $0x4, %ecx
je 0xa71d
cmpl $0x3, %ecx
jne 0xa721
incl %r14d
jmp 0xa781
incl %ebp
jmp 0xa781
incl 0xc(%rsp)
jmp 0xa781
movswl 0x1c(%rax), %edx
leaq 0x50(%rsp), %rdi
jmp 0xa773
movswl 0x28(%rax), %eax
movl %eax, 0x8(%rsp)
jmp 0xa781
movswl 0x1c(%rax), %edx
leaq 0x40(%rsp), %rdi
jmp 0xa773
leaq 0x10(%rsp), %rdi
callq 0x6420
movabsq $0x6972656b63696c46, %rcx # imm = 0x6972656B63696C46
movq %rcx, 0x10(%rsp,%rax)
movl $0x20676e, 0x18(%rsp,%rax) # imm = 0x20676E
jmp 0xa781
movswl 0x1c(%rax), %edx
leaq 0x30(%rsp), %rdi
leaq 0x6879f(%rip), %rsi     # 0x72f19
xorl %eax, %eax
callq 0x6b00
movzwl (%r12,%rbx,2), %eax
cmpw $-0x1, %ax
jne 0xa6bc
jmp 0xa7a7
movl $0x0, 0x8(%rsp)
xorl %r14d, %r14d
xorl %ebp, %ebp
movl $0x0, 0xc(%rsp)
callq 0x1ad03
movswl 0x28(%rsp), %edx
leaq 0x99f28(%rip), %r13     # 0xa46e0
leaq 0x68769(%rip), %rsi     # 0x72f28
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 0x19108
leaq 0x67a02(%rip), %r12     # 0x721f5
leaq 0x6874e(%rip), %rdx     # 0x72f48
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 0x19108
leaq 0x679bd(%rip), %r15     # 0x721ef
leaq 0x68721(%rip), %rdx     # 0x72f5a
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 0x19108
leaq 0x686fc(%rip), %rdx     # 0x72f6c
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 0x19108
leaq 0x686d6(%rip), %rdx     # 0x72f7e
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 0x19108
leaq 0x686b0(%rip), %rdx     # 0x72f90
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 0x19108
leaq 0x6868a(%rip), %rdx     # 0x72fa2
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 0x19108
leaq 0x68666(%rip), %rdx     # 0x72fb4
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 0x19108
leaq 0x68643(%rip), %rdx     # 0x72fc6
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 0x19108
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq