// File: /workspace/github_c_makefile_star2_O3/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 0x1ae92e(%rip), %rax    # 0x1b8a28
cmpl $0xc8, (%rax)
jne 0xa1a7
leaq 0x99f01(%rip), %rax     # 0xa400e
cmpb $0x3, (%rax)
jne 0xa115
movb $-0x2, (%rax)
movl 0x1237a5(%rip), %eax    # 0x12d8c0
andl $0xf, %eax
leaq 0x12375b(%rip), %rbx    # 0x12d880
movl (%rbx,%rax,4), %ebp
callq 0x6e428
movl %eax, %ecx
movl 0x12378b(%rip), %eax    # 0x12d8c0
movl %eax, %edx
andl $0xf, %edx
movl %ecx, (%rbx,%rdx,4)
incl %eax
movl %eax, 0x12377b(%rip)    # 0x12d8c0
movl 0x123779(%rip), %edx    # 0x12d8c4
subl %ebp, %ecx
je 0xa168
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, 0x12375c(%rip)    # 0x12d8c4
leaq 0x9b571(%rip), %rbx     # 0xa56e0
leaq 0x6acc7(%rip), %rsi     # 0x74e3d
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 0x3d8b3
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x138d5
leaq 0x1740e2(%rip), %rbx    # 0x17e290
cmpb $0x1, 0x27(%rbx)
jne 0xa1bd
movb $0x0, 0x27(%rbx)
callq 0x8c6c
cmpb $0x1, 0x1a(%rbx)
jne 0xa1cc
movb $0x0, 0x1a(%rbx)
callq 0x8d2a
cmpb $0x1, 0x2f(%rbx)
jne 0xa1e1
movb $0x0, 0x2f(%rbx)
movb $0x1, %al
movb %al, 0x9b4f6(%rip)      # 0xa56d4
movb %al, 0x42(%rbx)
cmpb $0x1, 0x28(%rbx)
jne 0xa1f6
movb $0x0, 0x28(%rbx)
movb $0x1, %al
movb %al, 0x9b4e7(%rip)      # 0xa56da
movb %al, 0x42(%rbx)
cmpb $0x1, 0x1b(%rbx)
jne 0xa205
movb $0x0, 0x1b(%rbx)
callq 0x6f13
cmpb $0x1, 0x2d(%rbx)
jne 0xa21a
movb $0x0, 0x2d(%rbx)
movb $0x1, %al
movb %al, 0x9b4bf(%rip)      # 0xa56d6
movb %al, 0x40(%rbx)
cmpb $0x1, 0x13(%rbx)
jne 0xa22f
movb $0x0, 0x13(%rbx)
movb $0x1, %al
movb %al, 0x9b4ab(%rip)      # 0xa56d7
movb %al, 0x40(%rbx)
cmpb $0x1, 0x32(%rbx)
jne 0xa24b
movb $0x0, 0x32(%rbx)
movb $0x1, 0x9b498(%rip)     # 0xa56d8
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x9202
addq $0x8, %rsp
popq %rbx
popq %rbp
retq