// File: /workspace/github_c_makefile_star2_O1/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 0x1adab5(%rip), %rax    # 0x1b7a28
cmpl $0xc8, (%rax)
jne 0xa024
leaq 0x99088(%rip), %rax     # 0xa300e
cmpb $0x3, (%rax)
jne 0x9f8e
movb $-0x2, (%rax)
movl 0x12292c(%rip), %eax    # 0x12c8c0
andl $0xf, %eax
leaq 0x1228e2(%rip), %rbx    # 0x12c880
movl (%rbx,%rax,4), %ebp
callq 0x6c6fa
movl %eax, %ecx
movl 0x122912(%rip), %eax    # 0x12c8c0
movl %eax, %edx
andl $0xf, %edx
movl %ecx, (%rbx,%rdx,4)
incl %eax
movl %eax, 0x122902(%rip)    # 0x12c8c0
subl %ebp, %ecx
je 0x9fdf
movl 0x1228fc(%rip), %eax    # 0x12c8c4
leal (%rax,%rax,2), %esi
movl $0x3e80, %eax           # imm = 0x3E80
xorl %edx, %edx
idivl %ecx
addl %esi, %eax
sarl $0x2, %eax
movl %eax, 0x1228e5(%rip)    # 0x12c8c4
movl 0x1228df(%rip), %edx    # 0x12c8c4
leaq 0x9a6f4(%rip), %rbx     # 0xa46e0
leaq 0x69d08(%rip), %rsi     # 0x73cfb
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6b00
xorl %edi, %edi
xorl %esi, %esi
movl $0x1f, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rbx, %r8
movl $0x1, %r9d
callq 0x3c433
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x138e6
leaq 0x173265(%rip), %rbx    # 0x17d290
cmpb $0x1, 0x27(%rbx)
jne 0xa03a
movb $0x0, 0x27(%rbx)
callq 0x8b57
cmpb $0x1, 0x1a(%rbx)
jne 0xa049
movb $0x0, 0x1a(%rbx)
callq 0x8c15
cmpb $0x1, 0x2f(%rbx)
jne 0xa05e
movb $0x0, 0x2f(%rbx)
movb $0x1, %al
movb %al, 0x9a679(%rip)      # 0xa46d4
movb %al, 0x42(%rbx)
cmpb $0x1, 0x28(%rbx)
jne 0xa073
movb $0x0, 0x28(%rbx)
movb $0x1, %al
movb %al, 0x9a66a(%rip)      # 0xa46da
movb %al, 0x42(%rbx)
cmpb $0x1, 0x1b(%rbx)
jne 0xa082
movb $0x0, 0x1b(%rbx)
callq 0x6f13
cmpb $0x1, 0x2d(%rbx)
jne 0xa097
movb $0x0, 0x2d(%rbx)
movb $0x1, %al
movb %al, 0x9a642(%rip)      # 0xa46d6
movb %al, 0x40(%rbx)
cmpb $0x1, 0x13(%rbx)
jne 0xa0ac
movb $0x0, 0x13(%rbx)
movb $0x1, %al
movb %al, 0x9a62e(%rip)      # 0xa46d7
movb %al, 0x40(%rbx)
cmpb $0x1, 0x32(%rbx)
jne 0xa0c8
movb $0x0, 0x32(%rbx)
movb $0x1, 0x9a61b(%rip)     # 0xa46d8
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x907e
addq $0x8, %rsp
popq %rbx
popq %rbp
retq