// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/src/bstub.c
// Function: ExtCheckKeys
void ExtCheckKeys(void)
{
	int i, j;

	if (qsetmode == 200)    //In 3D mode
	{
         if( somethingintab == 3 )   // prevent extra value copy
              somethingintab = 254;

		i = frameval[framecnt&(AVERAGEFRAMES-1)];
		j = frameval[framecnt&(AVERAGEFRAMES-1)] = getticks(); framecnt++;
		if (i != j) averagefps = ((mul3(averagefps)+((AVERAGEFRAMES*1000)/(j-i)) )>>2);
		Bsprintf(tempbuf,"%d",averagefps);
		printext256(0L,0L,31,-1,tempbuf,1);

		editinput();
	}
	else
	{
         if( keystatus[39] == 1 ) {  // ';' to clear all exts 
              keystatus[39]=0;
              JS_ClearAllExts();
         }
         if( keystatus[26] == 1 ) {  // '[' to clear all exts 
              keystatus[26]=0;
              JS_ClearAllSprites();
         }
         if( keystatus[47] == 1 ) {  // 'V' to edit velocity
              keystatus[47]=0;
              editvelocity=1;
              keystatus[66]=1;
         }
         if( keystatus[40] == 1 ) {  // ''' to cleanup from old versions
              keystatus[40]=0;
              docleanup=1;
              keystatus[66]=1;
         }
         if( keystatus[27] == 1 ) {  // ']' match cstats
              keystatus[27]=0;
              JS_MatchCstats();
         }
         if( keystatus[45] == 1 ) {  // XT Copy
              keystatus[45]=0;
              copyext=1;
              keystatus[64]=1;
         }
         if( keystatus[19] == 1 ) {  // XT Record
              keystatus[19]=0;
              recordext=1;
              keystatus[64]=1;
         }
         if( keystatus[50] == 1 ) {  // 'M' for Manual on sprites
              keystatus[50]=0;
              liststates=1;
              JS_SpriteXTManual();
         }
	}
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
leaq 0x1a84df(%rip), %rax    # 0x1b1a28
cmpl $0xc8, (%rax)
jne 0x95f0
leaq 0x93ab2(%rip), %rax     # 0x9d00e
cmpb $0x3, (%rax)
jne 0x9564
movb $-0x2, (%rax)
movl 0x11d356(%rip), %eax    # 0x1268c0
andl $0xf, %eax
leaq 0x11d30c(%rip), %rbx    # 0x126880
movl (%rbx,%rax,4), %ebp
callq 0x62cd4
movl %eax, %ecx
movl 0x11d33c(%rip), %eax    # 0x1268c0
movl %eax, %edx
andl $0xf, %edx
movl %ecx, (%rbx,%rdx,4)
incl %eax
movl %eax, 0x11d32c(%rip)    # 0x1268c0
movl 0x11d32a(%rip), %edx    # 0x1268c4
subl %ebp, %ecx
je 0x95b7
leal (%rdx,%rdx,2), %esi
movl $0x3e80, %eax           # imm = 0x3E80
xorl %edx, %edx
idivl %ecx
movl %eax, %edx
addl %esi, %edx
sarl $0x2, %edx
movl %edx, 0x11d30d(%rip)    # 0x1268c4
leaq 0x95122(%rip), %rbx     # 0x9e6e0
leaq 0x607b8(%rip), %rsi     # 0x69d7d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6b00
pushq $0x1f
popq %rdx
pushq $-0x1
popq %rcx
pushq $0x1
popq %r9
xorl %edi, %edi
xorl %esi, %esi
movq %rbx, %r8
callq 0x39aab
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x122fe
leaq 0x16dc99(%rip), %rbx    # 0x177290
cmpb $0x1, 0x27(%rbx)
jne 0x9606
movb $0x0, 0x27(%rbx)
callq 0x8517
cmpb $0x1, 0x1a(%rbx)
jne 0x9615
movb $0x0, 0x1a(%rbx)
callq 0x85e6
cmpb $0x1, 0x2f(%rbx)
jne 0x962a
movb $0x0, 0x2f(%rbx)
movb $0x1, %al
movb %al, 0x950ad(%rip)      # 0x9e6d4
movb %al, 0x42(%rbx)
cmpb $0x1, 0x28(%rbx)
jne 0x963f
movb $0x0, 0x28(%rbx)
movb $0x1, %al
movb %al, 0x9509e(%rip)      # 0x9e6da
movb %al, 0x42(%rbx)
cmpb $0x1, 0x1b(%rbx)
jne 0x964e
movb $0x0, 0x1b(%rbx)
callq 0x6f0b
cmpb $0x1, 0x2d(%rbx)
jne 0x9663
movb $0x0, 0x2d(%rbx)
movb $0x1, %al
movb %al, 0x95076(%rip)      # 0x9e6d6
movb %al, 0x40(%rbx)
cmpb $0x1, 0x13(%rbx)
jne 0x9678
movb $0x0, 0x13(%rbx)
movb $0x1, %al
movb %al, 0x95062(%rip)      # 0x9e6d7
movb %al, 0x40(%rbx)
cmpb $0x1, 0x32(%rbx)
jne 0x9694
movb $0x0, 0x32(%rbx)
movb $0x1, 0x9504f(%rip)     # 0x9e6d8
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x89ca
addq $0x8, %rsp
popq %rbx
popq %rbp
retq