	.reference	___bb_blitz_blitz
	.reference	___bb_imports_aspect
	.reference	___bb_imports_constants
	.reference	___bb_imports_gamemode
	.reference	_bbAppTitle
	.reference	_bbGCFree
	.reference	_bbMilliSecs
	.reference	_bbStringClass
	.reference	_bb_TGameMode
	.reference	_brl_graphics_EndGraphics
	.reference	_brl_random_SeedRnd
	.globl	__bb_main
	.globl	_bb_gContinue
	.globl	_bb_gFpsCountTargetTime
	.globl	_bb_gLastNumTicks
	.globl	_bb_gLastTime
	.globl	_bb_gLogicFPS
	.globl	_bb_gLogicFrames
	.globl	_bb_gNumTicks
	.globl	_bb_gRenderFPS
	.globl	_bb_gRenderFrames
	.globl	_bb_gTempMS
	.text	
__bb_main:
	push	%ebp
	mov	%esp,%ebp
	push	%ebx
	push	%esi
	sub	$16,%esp
	cmpl	$0,_32
	je	_33
	mov	$0,%eax
	add	$16,%esp
	pop	%esi
	pop	%ebx
	mov	%ebp,%esp
	pop	%ebp
	ret
_33:
	movl	$1,_32
	call	___bb_blitz_blitz
	call	___bb_imports_aspect
	call	___bb_imports_constants
	call	___bb_imports_gamemode
	mov	$_7,%ebx
	incl	4(%ebx)
	movl	_bbAppTitle,%eax
	decl	4(%eax)
	jnz	_22
	movl	%eax,(%esp)
	call	_bbGCFree
_22:
	movl	%ebx,_bbAppTitle
	calll	*_bb_TGameMode+52
	call	_bbMilliSecs
	movl	%eax,(%esp)
	call	_brl_random_SeedRnd
	movl	_23,%eax
	and	$1,%eax
	cmp	$0,%eax
	jne	_24
	call	_bbMilliSecs
	add	$1000,%eax
	movl	%eax,_bb_gFpsCountTargetTime
	orl	$1,_23
_24:
	movl	_23,%eax
	and	$2,%eax
	cmp	$0,%eax
	jne	_25
	mov	$5,%ebx
	call	_bbMilliSecs
	cdq
	idiv	%ebx
	movl	%eax,_bb_gLastTime
	orl	$2,_23
_25:
	movl	$1,_bb_gContinue
	calll	*_bb_TGameMode+48
	jmp	_8
_10:
_13:
	mov	$5,%ebx
	call	_bbMilliSecs
	cdq
	idiv	%ebx
	movl	%eax,_bb_gTempMS
	movl	_bb_gLastTime,%eax
	cmpl	%eax,_bb_gTempMS
	jge	_26
	movl	_bb_gTempMS,%eax
	subl	_bb_gLastNumTicks,%eax
	movl	%eax,_bb_gLastTime
_26:
	movl	_bb_gTempMS,%eax
	subl	_bb_gLastTime,%eax
	movl	%eax,_bb_gNumTicks
_11:
	cmpl	$0,_bb_gNumTicks
	jle	_13
_12:
	movl	_bb_gTempMS,%eax
	movl	%eax,_bb_gLastTime
	cmpl	$20,_bb_gNumTicks
	jle	_27
	movl	_bb_gLastNumTicks,%eax
	movl	%eax,_bb_gNumTicks
_27:
	movl	_bb_gNumTicks,%eax
	movl	%eax,_bb_gLastNumTicks
	mov	$1,%esi
	movl	_bb_gNumTicks,%ebx
	jmp	_29
_16:
	calll	*_bb_TGameMode+100
	movl	%eax,_bb_gContinue
	cmpl	$0,_bb_gContinue
	jne	_31
	movl	_bb_gNumTicks,%esi
_31:
	addl	$1,_bb_gLogicFrames
_14:
	add	$1,%esi
_29:
	cmp	%ebx,%esi
	jle	_16
_15:
	calll	*_bb_TGameMode+120
_8:
	cmpl	$0,_bb_gContinue
	jne	_10
_9:
	call	_brl_graphics_EndGraphics
	mov	$0,%eax
	jmp	_17
_17:
	add	$16,%esp
	pop	%esi
	pop	%ebx
	mov	%ebp,%esp
	pop	%ebp
	ret
	.data	
	.align	4
_32:
	.long	0
	.align	4
_7:
	.long	_bbStringClass
	.long	2147483647
	.long	10
	.short	71,114,97,110,100,32,80,114,105,120
	.align	4
_23:
	.long	0
	.align	4
_bb_gFpsCountTargetTime:
	.long	0
	.align	4
_bb_gRenderFrames:
	.long	0
	.align	4
_bb_gRenderFPS:
	.long	0
	.align	4
_bb_gLogicFrames:
	.long	0
	.align	4
_bb_gLogicFPS:
	.long	0
	.align	4
_bb_gLastTime:
	.long	0
	.align	4
_bb_gNumTicks:
	.long	0
	.align	4
_bb_gTempMS:
	.long	0
	.align	4
_bb_gLastNumTicks:
	.long	1
	.align	4
_bb_gContinue:
	.long	0
