	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_emu_loop                       ## -- Begin function emu_loop
	.p2align	4, 0x90
_emu_loop:                              ## @emu_loop
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movb	$0, -80(%rbp)
	xorl	%eax, %eax
	callq	_PicoLoopPrepare
	xorl	%eax, %eax
	callq	_plat_video_loop_prepare
	xorl	%eax, %eax
	callq	_emu_loop_prep
	xorl	%eax, %eax
	callq	_pemu_sound_start
	movq	_Pico@GOTPCREL(%rip), %rax
	movq	8(%rax), %rbx
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_ms_to_ticks
                                        ## kill: def $eax killed $eax def $rax
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.1:
	leal	(%rax,%rax,2), %eax
	cltq
	imulq	$1374389535, %rax, %r15         ## imm = 0x51EB851F
	movq	%r15, %rax
	shrq	$63, %rax
	sarq	$36, %r15
	jmp	LBB0_3
LBB0_2:
	cltq
	imulq	$1717986919, %rax, %r15         ## imm = 0x66666667
	movq	%r15, %rax
	shrq	$63, %rax
	sarq	$35, %r15
LBB0_3:
	addl	%eax, %r15d
	movq	_reset_timing@GOTPCREL(%rip), %r14
	movl	$1, (%r14)
	movq	_engineState@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_PGS_Running@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_43
## %bb.4:
	movl	%r15d, %eax
	negl	%eax
	movl	%eax, -116(%rbp)                ## 4-byte Spill
	leal	(%r15,%r15,2), %r12d
	negl	%r12d
	leal	(%r15,%r15), %eax
	negl	%eax
	movl	%eax, -120(%rbp)                ## 4-byte Spill
	movq	_main@GOTPCREL(%rip), %rbx
	xorl	%eax, %eax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movl	$0, -96(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -88(%rbp)                   ## 4-byte Folded Spill
	xorl	%eax, %eax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movl	$0, -92(%rbp)                   ## 4-byte Folded Spill
	xorl	%r13d, %r13d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_42:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	-104(%rbp), %rax                ## 8-byte Reload
	incl	%eax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movl	(%rbx), %edi
	callq	_pprof_end
	movq	_engineState@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_PGS_Running@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_43
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_27 Depth 2
	movl	(%rbx), %edi
	callq	_pprof_start
	cmpl	$0, (%r14)
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	$0, (%r14)
	movl	$0, -88(%rbp)                   ## 4-byte Folded Spill
	xorl	%eax, %eax
	callq	_plat_video_wait_vsync
	xorl	%eax, %eax
	callq	_get_ticks
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%rax,2), %r13d
	movl	%r13d, %r14d
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	_EOPT_NO_FRMLIMIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_currentConfig@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	xorl	%eax, %eax
	callq	_get_ticks
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%rax,2), %r13d
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	-92(%rbp), %r14d                ## 4-byte Reload
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	xorl	%eax, %eax
	callq	_get_ticks
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -128(%rbp)                ## 8-byte Spill
	leal	(%rax,%rax,2), %ecx
	movq	_notice_msg_time@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	testl	%edi, %edi
	movl	%ecx, -84(%rbp)                 ## 4-byte Spill
	je	LBB0_15
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	%ecx, %ebx
	callq	_ms_to_ticks
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%rax,2), %eax
	subl	%eax, %ebx
	movq	_STATUS_MSG_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ms_to_ticks
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%rax,2), %eax
	cmpl	%eax, %ebx
	jbe	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_notice_msg_time@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	xorl	%eax, %eax
	callq	_plat_status_msg_clear
	xorl	%eax, %eax
	callq	_plat_video_flip
	xorl	%eax, %eax
	callq	_plat_status_msg_clear
	xorl	%eax, %eax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movl	-84(%rbp), %ecx                 ## 4-byte Reload
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	_noticeMsg@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movl	4(%rcx), %ebx
	addl	(%rcx), %ebx
	movq	%rcx, %rax
	movq	%rcx, -112(%rbp)                ## 8-byte Spill
	addl	8(%rcx), %ebx
	cmpl	_emu_loop.noticeMsgSum(%rip), %ebx
	movl	-84(%rbp), %ecx                 ## 4-byte Reload
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_5 Depth=1
	xorl	%eax, %eax
	callq	_plat_status_msg_clear
	movl	-84(%rbp), %ecx                 ## 4-byte Reload
	movl	%ebx, _emu_loop.noticeMsgSum(%rip)
	movq	_noticeMsg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	%ecx, %ebx
	subl	%r14d, %ebx
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_ms_to_ticks
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%rax,2), %eax
	cmpl	%eax, %ebx
	jae	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	%r14d, -92(%rbp)                ## 4-byte Spill
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	_EOPT_SHOW_FPS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_currentConfig@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_5 Depth=1
	leaq	-80(%rbp), %rdi
	leaq	L_.str(%rip), %rsi
	movl	-96(%rbp), %edx                 ## 4-byte Reload
	movq	-104(%rbp), %rcx                ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	xorl	%eax, %eax
	callq	_sprintf
LBB0_19:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_ms_to_ticks
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%rax,2), %eax
	addl	%eax, %r14d
	movl	%r14d, -92(%rbp)                ## 4-byte Spill
	movl	$0, -96(%rbp)                   ## 4-byte Folded Spill
	xorl	%eax, %eax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
LBB0_20:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	-88(%rbp), %ecx                 ## 4-byte Reload
	movl	%r13d, %r14d
	subl	-84(%rbp), %r14d                ## 4-byte Folded Reload
	movq	_currentConfig@GOTPCREL(%rip), %rax
	movl	4(%rax), %eax
	testl	%eax, %eax
	js	LBB0_24
## %bb.21:                              ##   in Loop: Header=BB0_5 Depth=1
	cmpl	%eax, %ecx
	jge	LBB0_22
## %bb.23:                              ##   in Loop: Header=BB0_5 Depth=1
	incl	%ecx
	movl	%ecx, -88(%rbp)                 ## 4-byte Spill
	movb	$1, %bl
	movl	$0, -84(%rbp)                   ## 4-byte Folded Spill
	cmpl	%r12d, %r14d
	jl	LBB0_26
	jmp	LBB0_29
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_5 Depth=1
	cmpl	-116(%rbp), %r14d               ## 4-byte Folded Reload
	setge	%al
	movq	-104(%rbp), %rdx                ## 8-byte Reload
	leal	7(%rdx), %ecx
	testl	%edx, %edx
	cmovnsl	%edx, %ecx
	sarl	$3, %ecx
	cmpl	-96(%rbp), %ecx                 ## 4-byte Folded Reload
	setg	%bl
	orb	%al, %bl
	movl	%ebx, -84(%rbp)                 ## 4-byte Spill
                                        ## kill: def $bl killed $bl killed $ebx def $ebx
	xorb	$1, %bl
	cmpl	%r12d, %r14d
	jl	LBB0_26
	jmp	LBB0_29
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_5 Depth=1
	movb	$1, %al
	movl	%eax, -84(%rbp)                 ## 4-byte Spill
	movl	$0, -88(%rbp)                   ## 4-byte Folded Spill
	xorl	%ebx, %ebx
	cmpl	%r12d, %r14d
	jge	LBB0_29
LBB0_26:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	-128(%rbp), %rdx                ## 8-byte Reload
	leal	(%rdx,%rdx,2), %eax
	negl	%eax
	.p2align	4, 0x90
LBB0_27:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	addl	%r15d, %r13d
	leal	(%rax,%r13), %ecx
	cmpl	%r12d, %ecx
	jl	LBB0_27
## %bb.28:                              ##   in Loop: Header=BB0_5 Depth=1
	leal	(%rdx,%rdx,2), %eax
	movl	%r13d, %r14d
	subl	%eax, %r14d
LBB0_29:                                ##   in Loop: Header=BB0_5 Depth=1
	xorl	%eax, %eax
	callq	_emu_update_input
	testb	%bl, %bl
	je	LBB0_31
## %bb.30:                              ##   in Loop: Header=BB0_5 Depth=1
	xorl	%eax, %eax
	cmpl	-120(%rbp), %r14d               ## 4-byte Folded Reload
	setg	%al
	movl	$2, %ecx
	subl	%eax, %ecx
	movq	_PicoSkipFrame@GOTPCREL(%rip), %rbx
	movl	%ecx, (%rbx)
	xorl	%eax, %eax
	callq	_PicoFrame
	movl	$0, (%rbx)
	addl	%r15d, %r13d
	movq	_reset_timing@GOTPCREL(%rip), %r14
	movq	_main@GOTPCREL(%rip), %rbx
	jmp	LBB0_40
	.p2align	4, 0x90
LBB0_31:                                ##   in Loop: Header=BB0_5 Depth=1
	xorl	%eax, %eax
	callq	_PicoFrame
	leaq	-80(%rbp), %rdi
	movq	-112(%rbp), %rsi                ## 8-byte Reload
	callq	_pemu_finalize_frame
	movq	_flip_after_sync@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	movq	_reset_timing@GOTPCREL(%rip), %r14
	jne	LBB0_33
## %bb.32:                              ##   in Loop: Header=BB0_5 Depth=1
	xorl	%eax, %eax
	callq	_plat_video_flip
LBB0_33:                                ##   in Loop: Header=BB0_5 Depth=1
	incl	-96(%rbp)                       ## 4-byte Folded Spill
	addl	%r15d, %r13d
	cmpl	$0, (%r14)
	movq	_main@GOTPCREL(%rip), %rbx
	jne	LBB0_40
## %bb.34:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_EOPT_EXT_FRMLIMIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_EOPT_NO_FRMLIMIT@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_currentConfig@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_40
## %bb.35:                              ##   in Loop: Header=BB0_5 Depth=1
	xorl	%eax, %eax
	callq	_get_ticks
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%rax,2), %edx
	movl	%r13d, %ecx
	subl	%edx, %ecx
	cmpl	%r15d, %ecx
	jle	LBB0_38
## %bb.36:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_EOPT_VSYNC@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movq	_currentConfig@GOTPCREL(%rip), %rsi
	testl	%edx, (%rsi)
	je	LBB0_38
## %bb.37:                              ##   in Loop: Header=BB0_5 Depth=1
	xorl	%eax, %eax
	callq	_plat_video_wait_vsync
	xorl	%eax, %eax
	callq	_get_ticks
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%rax,2), %ecx
	subl	%r13d, %ecx
LBB0_38:                                ##   in Loop: Header=BB0_5 Depth=1
	subl	%r15d, %ecx
	jle	LBB0_40
## %bb.39:                              ##   in Loop: Header=BB0_5 Depth=1
	movslq	%ecx, %rcx
	imulq	$1431655766, %rcx, %rdi         ## imm = 0x55555556
	movq	%rdi, %rcx
	shrq	$63, %rcx
	shrq	$32, %rdi
	addl	%ecx, %edi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_plat_wait_till_us
	.p2align	4, 0x90
LBB0_40:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	_flip_after_sync@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	setne	%al
	movl	-84(%rbp), %ecx                 ## 4-byte Reload
	andb	%al, %cl
	cmpb	$1, %cl
	jne	LBB0_42
## %bb.41:                              ##   in Loop: Header=BB0_5 Depth=1
	xorl	%eax, %eax
	callq	_plat_video_flip
	jmp	LBB0_42
LBB0_43:
	xorl	%edi, %edi
	callq	_emu_set_fastforward
	movq	_currentConfig@GOTPCREL(%rip), %rax
	movq	_EOPT_EN_SRAM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_46
## %bb.44:
	movq	_SRam@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	je	LBB0_46
## %bb.45:
	leaq	L_.str.1(%rip), %rdi
	callq	_plat_status_msg_busy_first
	xorl	%edi, %edi
	movl	$1, %esi
	callq	_emu_save_load_game
	movq	$0, (%rbx)
LBB0_46:
	xorl	%eax, %eax
	callq	_pemu_loop_end
	xorl	%eax, %eax
	callq	_emu_sound_stop
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_48
## %bb.47:
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_48:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_Pico,16,3                      ## @Pico
	.comm	_reset_timing,4,2               ## @reset_timing
	.comm	_engineState,8,3                ## @engineState
	.comm	_PGS_Running,8,3                ## @PGS_Running
	.comm	_main,4,2                       ## @main
	.comm	_currentConfig,8,2              ## @currentConfig
	.comm	_EOPT_NO_FRMLIMIT,4,2           ## @EOPT_NO_FRMLIMIT
	.comm	_notice_msg_time,4,2            ## @notice_msg_time
.zerofill __DATA,__bss,_emu_loop.noticeMsgSum,4,2 ## @emu_loop.noticeMsgSum
	.comm	_STATUS_MSG_TIMEOUT,4,2         ## @STATUS_MSG_TIMEOUT
	.comm	_noticeMsg,8,3                  ## @noticeMsg
	.comm	_EOPT_SHOW_FPS,4,2              ## @EOPT_SHOW_FPS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%02i/%02i  "

	.comm	_PicoSkipFrame,4,2              ## @PicoSkipFrame
	.comm	_flip_after_sync,8,3            ## @flip_after_sync
	.comm	_EOPT_EXT_FRMLIMIT,4,2          ## @EOPT_EXT_FRMLIMIT
	.comm	_EOPT_VSYNC,4,2                 ## @EOPT_VSYNC
	.comm	_EOPT_EN_SRAM,4,2               ## @EOPT_EN_SRAM
	.comm	_SRam,8,3                       ## @SRam
L_.str.1:                               ## @.str.1
	.asciz	"Writing SRAM/BRAM..."

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_emu_loop                       ; -- Begin function emu_loop
	.p2align	2
_emu_loop:                              ; @emu_loop
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #56]
	strb	wzr, [sp, #32]
	bl	_PicoLoopPrepare
	bl	_plat_video_loop_prepare
	bl	_emu_loop_prep
	bl	_pemu_sound_start
Lloh3:
	adrp	x8, _Pico@GOTPAGE
Lloh4:
	ldr	x8, [x8, _Pico@GOTPAGEOFF]
Lloh5:
	ldr	x19, [x8, #8]
	mov	w0, #1000
	bl	_ms_to_ticks
	mov	w8, #26215
	movk	w8, #26214, lsl #16
	smull	x8, w0, w8
	lsr	x9, x8, #63
	asr	x8, x8, #35
	add	w8, w8, w9
	add	w9, w0, w0, lsl #1
	mov	w10, #34079
	movk	w10, #20971, lsl #16
	smull	x9, w9, w10
	lsr	x10, x9, #63
	asr	x9, x9, #36
	add	w9, w9, w10
	cmp	x19, #0
Lloh6:
	adrp	x19, _reset_timing@GOTPAGE
Lloh7:
	ldr	x19, [x19, _reset_timing@GOTPAGEOFF]
	csel	w24, w8, w9, eq
	mov	w8, #1
	str	w8, [x19]
Lloh8:
	adrp	x8, _engineState@GOTPAGE
Lloh9:
	ldr	x8, [x8, _engineState@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
Lloh11:
	adrp	x9, _PGS_Running@GOTPAGE
Lloh12:
	ldr	x9, [x9, _PGS_Running@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_36
; %bb.1:
	mov	w28, #0
	str	xzr, [sp, #24]                  ; 8-byte Folded Spill
	mov	x21, #0
	mov	w26, #0
	mov	w25, #0
	neg	w8, w24
	str	w8, [sp, #16]                   ; 4-byte Folded Spill
Lloh14:
	adrp	x22, _main@GOTPAGE
Lloh15:
	ldr	x22, [x22, _main@GOTPAGEOFF]
	sub	w20, w24, w24, lsl #2
	neg	w8, w24, lsl #1
	str	w8, [sp, #20]                   ; 4-byte Folded Spill
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w28, w28, #1
	ldr	w0, [x22]
	bl	_pprof_end
Lloh16:
	adrp	x8, _engineState@GOTPAGE
Lloh17:
	ldr	x8, [x8, _engineState@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
Lloh19:
	adrp	x9, _PGS_Running@GOTPAGE
Lloh20:
	ldr	x9, [x9, _PGS_Running@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_36
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_22 Depth 2
	ldr	w0, [x22]
	bl	_pprof_start
	ldr	w8, [x19]
	cbz	w8, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	str	wzr, [x19]
	bl	_plat_video_wait_vsync
	bl	_get_ticks
	str	wzr, [sp, #28]                  ; 4-byte Folded Spill
	add	w25, w0, w0, lsl #1
	mov	x26, x25
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
Lloh22:
	adrp	x8, _currentConfig@GOTPAGE
Lloh23:
	ldr	x8, [x8, _currentConfig@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _EOPT_NO_FRMLIMIT@GOTPAGE
Lloh26:
	ldr	x9, [x9, _EOPT_NO_FRMLIMIT@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_get_ticks
	add	w25, w0, w0, lsl #1
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	bl	_get_ticks
	mov	x22, x0
	add	w23, w0, w0, lsl #1
Lloh28:
	adrp	x8, _notice_msg_time@GOTPAGE
Lloh29:
	ldr	x8, [x8, _notice_msg_time@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	cbz	w0, LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_ms_to_ticks
	sub	w8, w0, w0, lsl #2
	add	w19, w8, w23
Lloh31:
	adrp	x8, _STATUS_MSG_TIMEOUT@GOTPAGE
Lloh32:
	ldr	x8, [x8, _STATUS_MSG_TIMEOUT@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
	bl	_ms_to_ticks
	add	w8, w0, w0, lsl #1
	cmp	w19, w8
	b.ls	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh34:
	adrp	x8, _notice_msg_time@GOTPAGE
Lloh35:
	ldr	x8, [x8, _notice_msg_time@GOTPAGEOFF]
Lloh36:
	str	wzr, [x8]
	bl	_plat_status_msg_clear
	bl	_plat_video_flip
	bl	_plat_status_msg_clear
	mov	x21, #0
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh37:
	adrp	x8, _noticeMsg@GOTPAGE
Lloh38:
	ldr	x8, [x8, _noticeMsg@GOTPAGEOFF]
Lloh39:
	ldr	x21, [x8]
	ldp	w8, w9, [x21]
	ldr	w10, [x21, #8]
	add	w8, w9, w8
	add	w19, w8, w10
Lloh40:
	adrp	x8, _emu_loop.noticeMsgSum@PAGE
Lloh41:
	ldr	w8, [x8, _emu_loop.noticeMsgSum@PAGEOFF]
	cmp	w19, w8
	b.eq	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_3 Depth=1
	bl	_plat_status_msg_clear
Lloh42:
	adrp	x8, _emu_loop.noticeMsgSum@PAGE
	str	w19, [x8, _emu_loop.noticeMsgSum@PAGEOFF]
Lloh43:
	adrp	x8, _noticeMsg@GOTPAGE
Lloh44:
	ldr	x8, [x8, _noticeMsg@GOTPAGEOFF]
Lloh45:
	ldr	x21, [x8]
LBB0_12:                                ;   in Loop: Header=BB0_3 Depth=1
	sub	w19, w23, w26
	mov	w0, #1000
	bl	_ms_to_ticks
	add	w8, w0, w0, lsl #1
	cmp	w19, w8
	b.lo	LBB0_16
; %bb.13:                               ;   in Loop: Header=BB0_3 Depth=1
Lloh46:
	adrp	x8, _currentConfig@GOTPAGE
Lloh47:
	ldr	x8, [x8, _currentConfig@GOTPAGEOFF]
Lloh48:
	ldr	w8, [x8]
Lloh49:
	adrp	x9, _EOPT_SHOW_FPS@GOTPAGE
Lloh50:
	ldr	x9, [x9, _EOPT_SHOW_FPS@GOTPAGEOFF]
Lloh51:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_3 Depth=1
	str	x28, [sp]
	add	x0, sp, #32
Lloh52:
	adrp	x1, l_.str@PAGE
Lloh53:
	add	x1, x1, l_.str@PAGEOFF
	ldr	w2, [sp, #24]                   ; 4-byte Folded Reload
	bl	_sprintf
LBB0_15:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #1000
	bl	_ms_to_ticks
	str	wzr, [sp, #24]                  ; 4-byte Folded Spill
	mov	w28, #0
	add	w8, w0, w0, lsl #1
	add	w26, w8, w26
LBB0_16:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [sp, #28]                   ; 4-byte Folded Reload
	sub	w27, w25, w23
Lloh54:
	adrp	x8, _currentConfig@GOTPAGE
Lloh55:
	ldr	x8, [x8, _currentConfig@GOTPAGEOFF]
Lloh56:
	ldr	w8, [x8, #4]
	tbnz	w8, #31, LBB0_19
; %bb.17:                               ;   in Loop: Header=BB0_3 Depth=1
	cmp	w9, w8
	b.ge	LBB0_20
; %bb.18:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	w23, #0
	add	w9, w9, #1
	str	w9, [sp, #28]                   ; 4-byte Folded Spill
	mov	w19, #1
	cmp	w27, w20
	b.lt	LBB0_21
	b	LBB0_23
LBB0_19:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w8, w28, #7
	cmp	w28, #0
	csel	w8, w8, w28, lt
	ldr	w9, [sp, #16]                   ; 4-byte Folded Reload
	cmp	w27, w9
	asr	w8, w8, #3
	ldr	w9, [sp, #24]                   ; 4-byte Folded Reload
	ccmp	w9, w8, #8, lt
	cset	w23, lt
	eor	w19, w23, #0x1
	cmp	w27, w20
	b.lt	LBB0_21
	b	LBB0_23
LBB0_20:                                ;   in Loop: Header=BB0_3 Depth=1
	str	wzr, [sp, #28]                  ; 4-byte Folded Spill
	mov	w19, #0
	mov	w23, #1
	cmp	w27, w20
	b.ge	LBB0_23
LBB0_21:                                ;   in Loop: Header=BB0_3 Depth=1
	sub	w8, w22, w22, lsl #2
LBB0_22:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	w25, w25, w24
	add	w27, w8, w25
	cmp	w27, w20
	b.lt	LBB0_22
LBB0_23:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh57:
	adrp	x22, _main@GOTPAGE
Lloh58:
	ldr	x22, [x22, _main@GOTPAGEOFF]
	bl	_emu_update_input
	cbz	w19, LBB0_25
; %bb.24:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [sp, #20]                   ; 4-byte Folded Reload
	cmp	w27, w8
	mov	w8, #1
	cinc	w8, w8, le
Lloh59:
	adrp	x19, _PicoSkipFrame@GOTPAGE
Lloh60:
	ldr	x19, [x19, _PicoSkipFrame@GOTPAGEOFF]
	str	w8, [x19]
	bl	_PicoFrame
	str	wzr, [x19]
	add	w25, w25, w24
Lloh61:
	adrp	x19, _reset_timing@GOTPAGE
Lloh62:
	ldr	x19, [x19, _reset_timing@GOTPAGEOFF]
	b	LBB0_34
LBB0_25:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_PicoFrame
	add	x0, sp, #32
	mov	x1, x21
	bl	_pemu_finalize_frame
Lloh63:
	adrp	x8, _flip_after_sync@GOTPAGE
Lloh64:
	ldr	x8, [x8, _flip_after_sync@GOTPAGEOFF]
Lloh65:
	ldr	x8, [x8]
	cbnz	x8, LBB0_27
; %bb.26:                               ;   in Loop: Header=BB0_3 Depth=1
	bl	_plat_video_flip
LBB0_27:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [sp, #24]                   ; 4-byte Folded Reload
	add	w8, w8, #1
	str	w8, [sp, #24]                   ; 4-byte Folded Spill
	add	w25, w25, w24
Lloh66:
	adrp	x19, _reset_timing@GOTPAGE
Lloh67:
	ldr	x19, [x19, _reset_timing@GOTPAGEOFF]
	ldr	w8, [x19]
	cbnz	w8, LBB0_34
; %bb.28:                               ;   in Loop: Header=BB0_3 Depth=1
Lloh68:
	adrp	x8, _currentConfig@GOTPAGE
Lloh69:
	ldr	x8, [x8, _currentConfig@GOTPAGEOFF]
Lloh70:
	ldr	w8, [x8]
Lloh71:
	adrp	x9, _EOPT_NO_FRMLIMIT@GOTPAGE
Lloh72:
	ldr	x9, [x9, _EOPT_NO_FRMLIMIT@GOTPAGEOFF]
Lloh73:
	ldr	w9, [x9]
Lloh74:
	adrp	x10, _EOPT_EXT_FRMLIMIT@GOTPAGE
Lloh75:
	ldr	x10, [x10, _EOPT_EXT_FRMLIMIT@GOTPAGEOFF]
Lloh76:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	b.ne	LBB0_34
; %bb.29:                               ;   in Loop: Header=BB0_3 Depth=1
	bl	_get_ticks
	sub	w8, w0, w0, lsl #2
	add	w8, w8, w25
	cmp	w8, w24
	b.le	LBB0_32
; %bb.30:                               ;   in Loop: Header=BB0_3 Depth=1
Lloh77:
	adrp	x9, _currentConfig@GOTPAGE
Lloh78:
	ldr	x9, [x9, _currentConfig@GOTPAGEOFF]
Lloh79:
	ldr	w9, [x9]
Lloh80:
	adrp	x10, _EOPT_VSYNC@GOTPAGE
Lloh81:
	ldr	x10, [x10, _EOPT_VSYNC@GOTPAGEOFF]
Lloh82:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_32
; %bb.31:                               ;   in Loop: Header=BB0_3 Depth=1
	bl	_plat_video_wait_vsync
	bl	_get_ticks
	add	w8, w0, w0, lsl #1
	sub	w8, w8, w25
LBB0_32:                                ;   in Loop: Header=BB0_3 Depth=1
	subs	w8, w8, w24
	b.le	LBB0_34
; %bb.33:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	w9, #21846
	movk	w9, #21845, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	lsr	x8, x8, #32
	add	w8, w8, w9
	add	w0, w8, w0
	bl	_plat_wait_till_us
LBB0_34:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh83:
	adrp	x8, _flip_after_sync@GOTPAGE
Lloh84:
	ldr	x8, [x8, _flip_after_sync@GOTPAGEOFF]
Lloh85:
	ldr	x8, [x8]
	cmp	x8, #0
	cset	w8, ne
	and	w8, w23, w8
	cmp	w8, #1
	b.ne	LBB0_2
; %bb.35:                               ;   in Loop: Header=BB0_3 Depth=1
	bl	_plat_video_flip
	b	LBB0_2
LBB0_36:
	mov	w0, #0
	bl	_emu_set_fastforward
Lloh86:
	adrp	x8, _currentConfig@GOTPAGE
Lloh87:
	ldr	x8, [x8, _currentConfig@GOTPAGEOFF]
Lloh88:
	ldr	w8, [x8]
Lloh89:
	adrp	x9, _EOPT_EN_SRAM@GOTPAGE
Lloh90:
	ldr	x9, [x9, _EOPT_EN_SRAM@GOTPAGEOFF]
Lloh91:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh92:
	adrp	x19, _SRam@GOTPAGE
Lloh93:
	ldr	x19, [x19, _SRam@GOTPAGEOFF]
	ldr	x9, [x19]
	cmp	w8, #0
	ccmp	x9, #0, #4, ne
	b.eq	LBB0_38
; %bb.37:
Lloh94:
	adrp	x0, l_.str.1@PAGE
Lloh95:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_plat_status_msg_busy_first
	mov	w0, #0
	mov	w1, #1
	bl	_emu_save_load_game
	str	xzr, [x19]
LBB0_38:
	bl	_pemu_loop_end
	bl	_emu_sound_stop
	ldr	x8, [sp, #56]
Lloh96:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh97:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh98:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_40
; %bb.39:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_40:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotStr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdr	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpAdrp	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpAdd	Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGot	Lloh57, Lloh58
	.loh AdrpLdrGot	Lloh61, Lloh62
	.loh AdrpLdrGot	Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh63, Lloh64, Lloh65
	.loh AdrpLdrGot	Lloh66, Lloh67
	.loh AdrpLdrGotLdr	Lloh74, Lloh75, Lloh76
	.loh AdrpLdrGotLdr	Lloh71, Lloh72, Lloh73
	.loh AdrpLdrGotLdr	Lloh68, Lloh69, Lloh70
	.loh AdrpLdrGotLdr	Lloh80, Lloh81, Lloh82
	.loh AdrpLdrGotLdr	Lloh77, Lloh78, Lloh79
	.loh AdrpLdrGotLdr	Lloh83, Lloh84, Lloh85
	.loh AdrpLdrGot	Lloh92, Lloh93
	.loh AdrpLdrGotLdr	Lloh89, Lloh90, Lloh91
	.loh AdrpLdrGotLdr	Lloh86, Lloh87, Lloh88
	.loh AdrpAdd	Lloh94, Lloh95
	.loh AdrpLdrGotLdr	Lloh96, Lloh97, Lloh98
	.cfi_endproc
                                        ; -- End function
	.comm	_Pico,16,3                      ; @Pico
	.comm	_reset_timing,4,2               ; @reset_timing
	.comm	_engineState,8,3                ; @engineState
	.comm	_PGS_Running,8,3                ; @PGS_Running
	.comm	_main,4,2                       ; @main
	.comm	_currentConfig,8,2              ; @currentConfig
	.comm	_EOPT_NO_FRMLIMIT,4,2           ; @EOPT_NO_FRMLIMIT
	.comm	_notice_msg_time,4,2            ; @notice_msg_time
.zerofill __DATA,__bss,_emu_loop.noticeMsgSum,4,2 ; @emu_loop.noticeMsgSum
	.comm	_STATUS_MSG_TIMEOUT,4,2         ; @STATUS_MSG_TIMEOUT
	.comm	_noticeMsg,8,3                  ; @noticeMsg
	.comm	_EOPT_SHOW_FPS,4,2              ; @EOPT_SHOW_FPS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%02i/%02i  "

	.comm	_PicoSkipFrame,4,2              ; @PicoSkipFrame
	.comm	_flip_after_sync,8,3            ; @flip_after_sync
	.comm	_EOPT_EXT_FRMLIMIT,4,2          ; @EOPT_EXT_FRMLIMIT
	.comm	_EOPT_VSYNC,4,2                 ; @EOPT_VSYNC
	.comm	_EOPT_EN_SRAM,4,2               ; @EOPT_EN_SRAM
	.comm	_SRam,8,3                       ; @SRam
l_.str.1:                               ; @.str.1
	.asciz	"Writing SRAM/BRAM..."

.subsections_via_symbols
