	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pemu_loop                      ## -- Begin function pemu_loop
	.p2align	4, 0x90
_pemu_loop:                             ## @pemu_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)
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_lprintf
	movb	$0, -80(%rbp)
	xorl	%eax, %eax
	callq	_vidResetMode
	movq	_currentConfig@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	cmpq	$0, 16(%rcx)
	setne	%al
	movq	_PicoOpt@GOTPCREL(%rip), %rdx
	movl	$-16385, %ecx                   ## imm = 0xBFFF
	andl	(%rdx), %ecx
	shll	$14, %eax
	orl	%ecx, %eax
	movl	%eax, (%rdx)
	movq	_Pico@GOTPCREL(%rip), %r15
	movl	$1, (%r15)
	movq	16(%r15), %rax
	cmpl	$0, 4(%r15)
	movl	$60, %ecx
	movl	$50, %edx
	cmovel	%ecx, %edx
	movl	%edx, -100(%rbp)                ## 4-byte Spill
	movl	$4267, %ecx                     ## imm = 0x10AB
	movl	$5120, %r13d                    ## imm = 0x1400
	cmovel	%ecx, %r13d
	movl	48(%rax), %r12d
	movq	_reset_timing@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	movq	_PicoAHW@GOTPCREL(%rip), %rcx
	movq	_PAHW_MCD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_PicoCDBufferInit
LBB0_2:
	movq	_PsndOut@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_currentConfig@GOTPCREL(%rip), %rax
	testb	$4, (%rax)
	je	LBB0_10
## %bb.3:
	movq	_PsndRate@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	cmpl	_pemu_loop.PsndRate_old(%rip), %esi
	jne	LBB0_6
## %bb.4:
	movq	_PicoOpt@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	_pemu_loop.PicoOpt_old(%rip), %eax
	xorl	%ebx, %eax
	testb	$11, %al
	jne	LBB0_6
## %bb.5:
	movl	4(%r15), %r9d
	cmpl	_pemu_loop.pal_old(%rip), %r9d
	je	LBB0_7
LBB0_6:
	xorl	%edi, %edi
	cmpl	$0, 8(%r15)
	setne	%dil
	callq	_PsndRerate
	movq	_PicoOpt@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	(%r14), %esi
	movl	4(%r15), %r9d
LBB0_7:
	shrl	$3, %ebx
	andl	$1, %ebx
	movq	_PsndLen@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	%r8d, %ecx
	movl	-100(%rbp), %edi                ## 4-byte Reload
	imull	%edi, %ecx
	movl	%esi, %eax
	subl	%ecx, %eax
	shll	$16, %eax
	cltd
	idivl	%edi
	movl	%eax, %r10d
	movl	%esi, %eax
	movl	%ebx, %ecx
	shll	%cl, %eax
	shll	$4, %eax
	cltd
	idivl	%edi
	movq	_snd_cbuf_samples@GOTPCREL(%rip), %r15
	movl	%eax, (%r15)
	leaq	L_.str.1(%rip), %rdi
	movl	%r8d, %edx
	movl	%r10d, %ecx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_lprintf
	movl	(%r14), %edi
	movl	(%r15), %esi
	movl	%ebx, %edx
	callq	_FrameworkAudio_Init
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_lprintf
	movq	_noticeMsg@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	leaq	L_.str.3(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_sprintf
	xorl	%eax, %eax
	callq	_GetTickCount
	movq	_noticeMsgTime@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	_currentConfig@GOTPCREL(%rip), %rax
	andb	$-5, (%rax)
	movq	_Pico@GOTPCREL(%rip), %r15
	jmp	LBB0_10
LBB0_9:
	movq	_currentConfig@GOTPCREL(%rip), %rax
	movl	8(%rax), %edi
	movl	%edi, %esi
	callq	_FrameworkAudio_SetVolume
	movq	_updateSound@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_PicoWriteSound@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	xorl	%eax, %eax
	callq	_FrameworkAudio_56448Buffer
	movq	_snd_cbuff@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movl	(%r15), %ecx
	movl	%ecx, %edx
	shrl	$31, %edx
	addl	%ecx, %edx
	sarl	%edx
	movslq	%edx, %rcx
	leaq	(%rax,%rcx,4), %rax
	movq	_PsndOut@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	_snd_all_samples@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movl	(%r14), %eax
	movl	%eax, _pemu_loop.PsndRate_old(%rip)
	movq	_PicoOpt@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, _pemu_loop.PicoOpt_old(%rip)
	movq	_Pico@GOTPCREL(%rip), %r15
	movl	4(%r15), %eax
	movl	%eax, _pemu_loop.pal_old(%rip)
LBB0_10:
	movq	_engineState@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_PGS_Running@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_65
## %bb.11:
	shll	$2, %r12d
	andl	$4, %r12d
	xorl	$12, %r12d
	movl	%r12d, -108(%rbp)               ## 4-byte Spill
	movl	$1000, -104(%rbp)               ## 4-byte Folded Spill
                                        ## imm = 0x3E8
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movl	$0, -84(%rbp)                   ## 4-byte Folded Spill
	xorl	%eax, %eax
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_55:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	_reset_timing@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
LBB0_63:                                ##   in Loop: Header=BB0_12 Depth=1
	incl	%ebx
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	incl	-84(%rbp)                       ## 4-byte Folded Spill
LBB0_64:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	-128(%rbp), %rbx                ## 8-byte Reload
	movq	_engineState@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_PGS_Running@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_65
LBB0_12:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_38 Depth 2
	xorl	%eax, %eax
	callq	_GetTickCount
	movq	%rax, %r12
	movq	_reset_timing@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	cmpq	%rbx, %r12
	jge	LBB0_15
LBB0_14:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	_reset_timing@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movl	$0, -84(%rbp)                   ## 4-byte Folded Spill
	xorl	%eax, %eax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	%r12, %r14
LBB0_15:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	_noticeMsgTime@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_21
## %bb.16:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	%r12, %rcx
	subq	%rax, %rcx
	cmpq	$2001, %rcx                     ## imm = 0x7D1
	jl	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	_noticeMsgTime@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	xorl	%edi, %edi
	callq	_clearArea
	xorl	%eax, %eax
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	_noticeMsg@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movsbl	(%rdx), %eax
	movsbl	1(%rdx), %ecx
	addl	%eax, %ecx
	movq	%rdx, %rax
	movq	%rdx, -120(%rbp)                ## 8-byte Spill
	movsbl	2(%rdx), %ebx
	addl	%ecx, %ebx
	cmpl	_pemu_loop.noticeMsgSum(%rip), %ebx
	je	LBB0_21
## %bb.19:                              ##   in Loop: Header=BB0_12 Depth=1
	xorl	%edi, %edi
	callq	_clearArea
	movl	%ebx, _pemu_loop.noticeMsgSum(%rip)
	movq	_noticeMsg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_20:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	%rax, -120(%rbp)                ## 8-byte Spill
LBB0_21:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	16(%r15), %rax
	movl	4(%rax), %ecx
	movl	48(%rax), %eax
	andl	$1, %eax
	andl	$8, %ecx
	leal	(%rcx,%rax,4), %ebx
	cmpl	-108(%rbp), %ebx                ## 4-byte Folded Reload
	je	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	$1, %edi
	callq	_clearArea
	movl	%ebx, -108(%rbp)                ## 4-byte Spill
LBB0_23:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	%r12, %rax
	subq	%r14, %rax
	movslq	-104(%rbp), %rbx                ## 4-byte Folded Reload
	cmpq	%rbx, %rax
	movq	%r12, -128(%rbp)                ## 8-byte Spill
	jge	LBB0_25
## %bb.24:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	jmp	LBB0_35
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	_currentConfig@GOTPCREL(%rip), %rax
	testb	$2, (%rax)
	je	LBB0_27
## %bb.26:                              ##   in Loop: Header=BB0_12 Depth=1
	leaq	-80(%rbp), %rdi
	leaq	L_.str.4(%rip), %rsi
	movl	-84(%rbp), %edx                 ## 4-byte Reload
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	xorl	%eax, %eax
	callq	_sprintf
LBB0_27:                                ##   in Loop: Header=BB0_12 Depth=1
	addq	%rbx, %r14
	movq	_PsndOut@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_32
## %bb.28:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	_snd_all_samples@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	addl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_FrameworkAudio_BufferPos
	movq	_PsndRate@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%edx, %edx
	cmpl	$22050, %ecx                    ## imm = 0x5622
	sete	%dl
	addl	$9, %edx
	cmpl	$22051, %ecx                    ## imm = 0x5623
	movl	$11, %ecx
	cmovgel	%ecx, %edx
	movq	_PicoOpt@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	andb	$8, %cl
	cmpb	$1, %cl
	movl	$8, %ecx
	sbbl	$0, %ecx
	subl	%eax, %ebx
	js	LBB0_29
## %bb.30:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	%ebx, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	shrl	%cl, %eax
	movl	$6, %esi
	movl	%edx, %ecx
	shll	%cl, %esi
	cmpl	%esi, %ebx
	setb	%cl
	shrl	%cl, %eax
	movl	$4, %esi
	movl	%edx, %ecx
	shll	%cl, %esi
	cmpl	%esi, %ebx
	setb	%cl
	shrl	%cl, %eax
	movl	$2, %esi
	movl	%edx, %ecx
	shll	%cl, %esi
	cmpl	%esi, %ebx
	setb	%cl
	shrl	%cl, %eax
	movl	%eax, %ecx
	shrl	$2, %ecx
	cmpl	_pemu_loop.audio_skew_prev(%rip), %ebx
	cmovgel	%eax, %ecx
	jmp	LBB0_31
LBB0_32:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	_currentConfig@GOTPCREL(%rip), %rax
	cmpl	$0, 4(%rax)
	jns	LBB0_33
## %bb.34:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	-100(%rbp), %eax                ## 4-byte Reload
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	subl	%eax, %esi
	testl	%esi, %esi
	movl	$0, %ecx
	cmovlel	%ecx, %esi
	movl	-84(%rbp), %edx                 ## 4-byte Reload
	subl	%eax, %edx
	testl	%edx, %edx
	cmovlel	%ecx, %edx
	cmpl	%esi, %edx
	cmovael	%esi, %edx
	movl	%edx, -84(%rbp)                 ## 4-byte Spill
	jmp	LBB0_35
LBB0_29:                                ##   in Loop: Header=BB0_12 Depth=1
	movl	%ebx, %eax
	negl	%eax
                                        ## kill: def $cl killed $cl killed $ecx
	shrl	%cl, %eax
	movl	$-6, %esi
	movl	%edx, %ecx
	shll	%cl, %esi
	negl	%eax
	cmpl	%esi, %ebx
	setg	%cl
	sarl	%cl, %eax
	movl	$-4, %esi
	movl	%edx, %ecx
	shll	%cl, %esi
	cmpl	%esi, %ebx
	setg	%cl
	sarl	%cl, %eax
	movl	$-2, %esi
	movl	%edx, %ecx
	shll	%cl, %esi
	cmpl	%esi, %ebx
	setg	%cl
	sarl	%cl, %eax
	movl	%eax, %ecx
	sarl	$2, %ecx
	cmpl	_pemu_loop.audio_skew_prev(%rip), %ebx
	cmovlel	%eax, %ecx
LBB0_31:                                ##   in Loop: Header=BB0_12 Depth=1
	movl	%ebx, _pemu_loop.audio_skew_prev(%rip)
	addl	%ecx, %r13d
	movl	%r13d, %eax
	imull	-100(%rbp), %eax                ## 4-byte Folded Reload
	sarl	$8, %eax
	movl	%eax, -104(%rbp)                ## 4-byte Spill
LBB0_33:                                ##   in Loop: Header=BB0_12 Depth=1
	movl	$0, -84(%rbp)                   ## 4-byte Folded Spill
	xorl	%esi, %esi
LBB0_35:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	%rsi, -96(%rbp)                 ## 8-byte Spill
	leal	1(%rsi), %ebx
	movl	%ebx, %r12d
	imull	%r13d, %r12d
	movq	_currentConfig@GOTPCREL(%rip), %rax
	cmpl	$0, 4(%rax)
	js	LBB0_56
## %bb.36:                              ##   in Loop: Header=BB0_12 Depth=1
	je	LBB0_43
## %bb.37:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	%r14d, %r15d
	shll	$8, %r15d
	xorl	%ebx, %ebx
	jmp	LBB0_38
	.p2align	4, 0x90
LBB0_41:                                ##   in Loop: Header=BB0_38 Depth=2
	addl	%r13d, %r12d
	incl	%ebx
	movq	_currentConfig@GOTPCREL(%rip), %rax
	cmpl	4(%rax), %ebx
	jge	LBB0_42
LBB0_38:                                ##   Parent Loop BB0_12 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	xorl	%eax, %eax
	callq	_updateKeys
	xorl	%eax, %eax
	callq	_SkipFrame
	movq	_PsndOut@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_41
## %bb.39:                              ##   in Loop: Header=BB0_38 Depth=2
	xorl	%eax, %eax
	callq	_GetTickCount
	movl	%eax, %ecx
	subl	%r14d, %ecx
	shll	$8, %ecx
	cmpl	%ecx, %r12d
	jle	LBB0_41
## %bb.40:                              ##   in Loop: Header=BB0_38 Depth=2
	leal	(%r15,%r12), %ecx
	movl	%eax, %edx
	shll	$8, %edx
	subl	%edx, %ecx
	sarl	$8, %ecx
	movslq	%ecx, %rdi
	addq	%rax, %rdi
	callq	_simpleWait
	jmp	LBB0_41
	.p2align	4, 0x90
LBB0_42:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	addl	%ebx, %eax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	_Pico@GOTPCREL(%rip), %r15
	jmp	LBB0_43
	.p2align	4, 0x90
LBB0_56:                                ##   in Loop: Header=BB0_12 Depth=1
	xorl	%eax, %eax
	callq	_GetTickCount
	subl	%r14d, %eax
	shll	$8, %eax
	subl	%r12d, %eax
	jle	LBB0_43
## %bb.57:                              ##   in Loop: Header=BB0_12 Depth=1
	cmpl	$76800, %eax                    ## imm = 0x12C00
	jl	LBB0_59
## %bb.58:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	_reset_timing@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	jmp	LBB0_64
	.p2align	4, 0x90
LBB0_43:                                ##   in Loop: Header=BB0_12 Depth=1
	xorl	%eax, %eax
	callq	_updateKeys
	movq	_currentConfig@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testb	$-128, %al
	movq	_giz_screen@GOTPCREL(%rip), %rbx
	je	LBB0_45
## %bb.44:                              ##   in Loop: Header=BB0_12 Depth=1
	xorl	%edi, %edi
	testl	$32768, %eax                    ## imm = 0x8000
	sete	%dil
	callq	_fb_lock
	movq	%rax, (%rbx)
LBB0_45:                                ##   in Loop: Header=BB0_12 Depth=1
	xorl	%eax, %eax
	callq	_PicoFrame
	cmpq	$0, (%rbx)
	jne	LBB0_47
## %bb.46:                              ##   in Loop: Header=BB0_12 Depth=1
	xorl	%edi, %edi
	movq	_currentConfig@GOTPCREL(%rip), %rax
	testl	$32768, (%rax)                  ## imm = 0x8000
	sete	%dil
	callq	_fb_lock
	movq	%rax, (%rbx)
LBB0_47:                                ##   in Loop: Header=BB0_12 Depth=1
	leaq	-80(%rbp), %rdi
	movq	-120(%rbp), %rsi                ## 8-byte Reload
	callq	_blit
	cmpq	$0, (%rbx)
	je	LBB0_49
## %bb.48:                              ##   in Loop: Header=BB0_12 Depth=1
	xorl	%eax, %eax
	callq	_fb_unlock
	movq	$0, (%rbx)
LBB0_49:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	_currentConfig@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	$8192, %eax                     ## imm = 0x2000
	je	LBB0_51
## %bb.50:                              ##   in Loop: Header=BB0_12 Depth=1
	xorl	%eax, %eax
	callq	_Framework2D_WaitVSync
	movq	_currentConfig@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_51:                                ##   in Loop: Header=BB0_12 Depth=1
	testl	$32768, %eax                    ## imm = 0x8000
	je	LBB0_53
## %bb.52:                              ##   in Loop: Header=BB0_12 Depth=1
	xorl	%eax, %eax
	callq	_fb_flip
LBB0_53:                                ##   in Loop: Header=BB0_12 Depth=1
	xorl	%eax, %eax
	callq	_GetTickCount
	movl	%eax, %ecx
	subl	%r14d, %ecx
	shll	$8, %ecx
	movq	_currentConfig@GOTPCREL(%rip), %rdx
	movl	4(%rdx), %edx
	testl	%edx, %edx
	jns	LBB0_60
## %bb.54:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	%ecx, %esi
	subl	%r12d, %esi
	cmpl	$76800, %esi                    ## imm = 0x12C00
	jge	LBB0_55
LBB0_60:                                ##   in Loop: Header=BB0_12 Depth=1
	testl	%edx, %edx
	sets	%dl
	movq	_PsndOut@GOTPCREL(%rip), %rsi
	cmpq	$0, (%rsi)
	setne	%bl
	orb	%dl, %bl
	cmpb	$1, %bl
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_63
## %bb.61:                              ##   in Loop: Header=BB0_12 Depth=1
	cmpl	%r12d, %ecx
	jge	LBB0_63
## %bb.62:                              ##   in Loop: Header=BB0_12 Depth=1
	subl	%ecx, %r12d
	sarl	$8, %r12d
	movslq	%r12d, %rcx
	addq	%rcx, %rax
	movq	%rax, %rdi
	callq	_simpleWait
	jmp	LBB0_63
LBB0_59:                                ##   in Loop: Header=BB0_12 Depth=1
	xorl	%eax, %eax
	callq	_updateKeys
	xorl	%eax, %eax
	callq	_SkipFrame
	movl	%ebx, %eax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	jmp	LBB0_64
LBB0_65:
	movq	_PAHW_MCD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_PicoAHW@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_67
## %bb.66:
	xorl	%eax, %eax
	callq	_PicoCDBufferFree
LBB0_67:
	movq	_PsndOut@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_69
## %bb.68:
	movq	_snd_cbuff@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	$0, (%rcx)
	xorl	%eax, %eax
	callq	_FrameworkAudio_Close
LBB0_69:
	movq	_currentConfig@GOTPCREL(%rip), %rax
	testb	$1, (%rax)
	je	LBB0_72
## %bb.70:
	movq	_SRam@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	je	LBB0_72
## %bb.71:
	leaq	L_.str.5(%rip), %rdi
	callq	_emu_stateCb
	xorl	%edi, %edi
	movl	$1, %esi
	callq	_emu_save_load_game
	movq	$0, (%rbx)
LBB0_72:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_74
## %bb.73:
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_74:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_pemu_loop.PsndRate_old,4,2 ## @pemu_loop.PsndRate_old
.zerofill __DATA,__bss,_pemu_loop.PicoOpt_old,4,2 ## @pemu_loop.PicoOpt_old
.zerofill __DATA,__bss,_pemu_loop.pal_old,4,2 ## @pemu_loop.pal_old
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"entered emu_Loop()\n"

	.comm	_currentConfig,24,3             ## @currentConfig
	.comm	_PicoOpt,4,2                    ## @PicoOpt
	.comm	_Pico,24,3                      ## @Pico
	.comm	_reset_timing,4,2               ## @reset_timing
	.comm	_PicoAHW,4,2                    ## @PicoAHW
	.comm	_PAHW_MCD,4,2                   ## @PAHW_MCD
	.comm	_PsndOut,8,3                    ## @PsndOut
	.comm	_PsndRate,4,2                   ## @PsndRate
	.comm	_PsndLen,4,2                    ## @PsndLen
	.comm	_snd_cbuf_samples,4,2           ## @snd_cbuf_samples
L_.str.1:                               ## @.str.1
	.asciz	"starting audio: %i len: %i (ex: %04x) stereo: %i, pal: %i\n"

L_.str.2:                               ## @.str.2
	.asciz	"FrameworkAudio_Init() failed: %i\n"

	.comm	_noticeMsg,8,3                  ## @noticeMsg
L_.str.3:                               ## @.str.3
	.asciz	"sound init failed (%i), snd disabled"

	.comm	_noticeMsgTime,8,3              ## @noticeMsgTime
	.comm	_updateSound,4,2                ## @updateSound
	.comm	_PicoWriteSound,4,2             ## @PicoWriteSound
	.comm	_snd_cbuff,8,3                  ## @snd_cbuff
	.comm	_snd_all_samples,4,2            ## @snd_all_samples
	.comm	_engineState,8,3                ## @engineState
	.comm	_PGS_Running,8,3                ## @PGS_Running
.zerofill __DATA,__bss,_pemu_loop.noticeMsgSum,4,2 ## @pemu_loop.noticeMsgSum
L_.str.4:                               ## @.str.4
	.asciz	"%02i/%02i"

.zerofill __DATA,__bss,_pemu_loop.audio_skew_prev,4,2 ## @pemu_loop.audio_skew_prev
	.comm	_giz_screen,8,3                 ## @giz_screen
	.comm	_SRam,8,3                       ## @SRam
L_.str.5:                               ## @.str.5
	.asciz	"Writing SRAM/BRAM.."

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pemu_loop                      ; -- Begin function pemu_loop
	.p2align	2
_pemu_loop:                             ; @pemu_loop
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #208
	.cfi_def_cfa_offset 208
	stp	x28, x27, [sp, #112]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #128]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #144]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #160]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #176]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #192]            ; 16-byte Folded Spill
	add	x29, sp, #192
	.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]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_lprintf
	strb	wzr, [sp, #80]
	bl	_vidResetMode
Lloh5:
	adrp	x23, _currentConfig@GOTPAGE
Lloh6:
	ldr	x23, [x23, _currentConfig@GOTPAGEOFF]
	ldr	x8, [x23, #16]
	cmp	x8, #0
	cset	w8, ne
Lloh7:
	adrp	x10, _PicoOpt@GOTPAGE
Lloh8:
	ldr	x10, [x10, _PicoOpt@GOTPAGEOFF]
	ldr	w9, [x10]
	bfi	w9, w8, #14, #1
	str	w9, [x10]
Lloh9:
	adrp	x25, _Pico@GOTPAGE
Lloh10:
	ldr	x25, [x25, _Pico@GOTPAGEOFF]
	mov	w8, #1
	str	w8, [x25]
	ldr	x9, [x25, #16]
	ldr	w21, [x9, #48]
	ldr	w9, [x25, #4]
	mov	w10, #50
	mov	w11, #60
	cmp	w9, #0
	csel	w9, w11, w10, eq
	str	w9, [sp, #44]                   ; 4-byte Folded Spill
	mov	w9, #5120
	mov	w10, #4267
	csel	w28, w10, w9, eq
Lloh11:
	adrp	x22, _reset_timing@GOTPAGE
Lloh12:
	ldr	x22, [x22, _reset_timing@GOTPAGEOFF]
Lloh13:
	adrp	x9, _PicoAHW@GOTPAGE
Lloh14:
	ldr	x9, [x9, _PicoAHW@GOTPAGEOFF]
	str	w8, [x22]
Lloh15:
	ldr	w8, [x9]
Lloh16:
	adrp	x9, _PAHW_MCD@GOTPAGE
Lloh17:
	ldr	x9, [x9, _PAHW_MCD@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	bl	_PicoCDBufferInit
LBB0_2:
Lloh19:
	adrp	x26, _PsndOut@GOTPAGE
Lloh20:
	ldr	x26, [x26, _PsndOut@GOTPAGEOFF]
	str	xzr, [x26]
	ldrb	w8, [x23]
Lloh21:
	adrp	x24, _PsndRate@GOTPAGE
Lloh22:
	ldr	x24, [x24, _PsndRate@GOTPAGEOFF]
	tbz	w8, #2, LBB0_11
; %bb.3:
	ldr	w8, [x24]
	adrp	x20, _pemu_loop.PsndRate_old@PAGE
	ldr	w9, [x20, _pemu_loop.PsndRate_old@PAGEOFF]
	cmp	w8, w9
	b.ne	LBB0_6
; %bb.4:
Lloh23:
	adrp	x9, _PicoOpt@GOTPAGE
Lloh24:
	ldr	x9, [x9, _PicoOpt@GOTPAGEOFF]
Lloh25:
	ldr	w10, [x9]
Lloh26:
	adrp	x9, _pemu_loop.PicoOpt_old@PAGE
Lloh27:
	ldr	w9, [x9, _pemu_loop.PicoOpt_old@PAGEOFF]
	eor	w9, w9, w10
	mov	w11, #11
	tst	w9, w11
	b.ne	LBB0_6
; %bb.5:
	ldr	w9, [x25, #4]
Lloh28:
	adrp	x11, _pemu_loop.pal_old@PAGE
Lloh29:
	ldr	w11, [x11, _pemu_loop.pal_old@PAGEOFF]
	cmp	w9, w11
	b.eq	LBB0_7
LBB0_6:
	ldr	w8, [x25, #8]
	cmp	w8, #0
	cset	w0, ne
	bl	_PsndRerate
Lloh30:
	adrp	x8, _PicoOpt@GOTPAGE
Lloh31:
	ldr	x8, [x8, _PicoOpt@GOTPAGEOFF]
Lloh32:
	ldr	w10, [x8]
	ldr	w8, [x24]
	ldr	w9, [x25, #4]
LBB0_7:
	ubfx	w19, w10, #3, #1
Lloh33:
	adrp	x10, _PsndLen@GOTPAGE
Lloh34:
	ldr	x10, [x10, _PsndLen@GOTPAGEOFF]
Lloh35:
	ldr	w10, [x10]
	ldr	w13, [sp, #44]                  ; 4-byte Folded Reload
	msub	w11, w10, w13, w8
	lsl	w11, w11, #16
	lsl	w12, w8, w19
	lsl	w12, w12, #4
	sdiv	w12, w12, w13
Lloh36:
	adrp	x22, _snd_cbuf_samples@GOTPAGE
Lloh37:
	ldr	x22, [x22, _snd_cbuf_samples@GOTPAGEOFF]
	str	w12, [x22]
	sdiv	w11, w11, w13
	stp	x19, x9, [sp, #24]
	stp	x8, x10, [sp]
	str	x11, [sp, #16]
Lloh38:
	adrp	x0, l_.str.1@PAGE
Lloh39:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_lprintf
	ldr	w0, [x24]
	ldr	w1, [x22]
	mov	x2, x19
	bl	_FrameworkAudio_Init
	cbz	w0, LBB0_9
; %bb.8:
	mov	x19, x0
	str	x19, [sp]
Lloh40:
	adrp	x0, l_.str.2@PAGE
Lloh41:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_lprintf
Lloh42:
	adrp	x8, _noticeMsg@GOTPAGE
Lloh43:
	ldr	x8, [x8, _noticeMsg@GOTPAGEOFF]
Lloh44:
	ldr	x0, [x8]
Lloh45:
	adrp	x1, l_.str.3@PAGE
Lloh46:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, x19
	bl	_sprintf
	bl	_GetTickCount
Lloh47:
	adrp	x8, _noticeMsgTime@GOTPAGE
Lloh48:
	ldr	x8, [x8, _noticeMsgTime@GOTPAGEOFF]
Lloh49:
	str	x0, [x8]
	ldr	w8, [x23]
	and	w8, w8, #0xfffffffb
	str	w8, [x23]
	b	LBB0_10
LBB0_9:
	ldr	w0, [x23, #8]
	mov	x1, x0
	bl	_FrameworkAudio_SetVolume
Lloh50:
	adrp	x8, _updateSound@GOTPAGE
Lloh51:
	ldr	x8, [x8, _updateSound@GOTPAGEOFF]
Lloh52:
	ldr	w8, [x8]
Lloh53:
	adrp	x9, _PicoWriteSound@GOTPAGE
Lloh54:
	ldr	x9, [x9, _PicoWriteSound@GOTPAGEOFF]
Lloh55:
	str	w8, [x9]
	bl	_FrameworkAudio_56448Buffer
Lloh56:
	adrp	x8, _snd_cbuff@GOTPAGE
Lloh57:
	ldr	x8, [x8, _snd_cbuff@GOTPAGEOFF]
Lloh58:
	str	x0, [x8]
	ldr	w8, [x22]
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	add	x8, x0, w8, sxtw #2
	str	x8, [x26]
Lloh59:
	adrp	x8, _snd_all_samples@GOTPAGE
Lloh60:
	ldr	x8, [x8, _snd_all_samples@GOTPAGEOFF]
Lloh61:
	str	wzr, [x8]
	ldr	w8, [x24]
	str	w8, [x20, _pemu_loop.PsndRate_old@PAGEOFF]
Lloh62:
	adrp	x8, _PicoOpt@GOTPAGE
Lloh63:
	ldr	x8, [x8, _PicoOpt@GOTPAGEOFF]
Lloh64:
	ldr	w8, [x8]
Lloh65:
	adrp	x9, _pemu_loop.PicoOpt_old@PAGE
	str	w8, [x9, _pemu_loop.PicoOpt_old@PAGEOFF]
	ldr	w8, [x25, #4]
Lloh66:
	adrp	x9, _pemu_loop.pal_old@PAGE
	str	w8, [x9, _pemu_loop.pal_old@PAGEOFF]
LBB0_10:
Lloh67:
	adrp	x22, _reset_timing@GOTPAGE
Lloh68:
	ldr	x22, [x22, _reset_timing@GOTPAGEOFF]
LBB0_11:
Lloh69:
	adrp	x8, _engineState@GOTPAGE
Lloh70:
	ldr	x8, [x8, _engineState@GOTPAGEOFF]
Lloh71:
	ldr	x8, [x8]
Lloh72:
	adrp	x9, _PGS_Running@GOTPAGE
Lloh73:
	ldr	x9, [x9, _PGS_Running@GOTPAGEOFF]
Lloh74:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_61
; %bb.12:
	mov	x24, #0
	mov	x19, #0
	mov	w27, #0
	str	wzr, [sp, #76]                  ; 4-byte Folded Spill
	str	xzr, [sp, #64]                  ; 8-byte Folded Spill
	ubfiz	w8, w21, #2, #1
	eor	w8, w8, #0xc
	str	w8, [sp, #60]                   ; 4-byte Folded Spill
	mov	w8, #1000
	str	x8, [sp, #48]                   ; 8-byte Folded Spill
	adrp	x21, _pemu_loop.audio_skew_prev@PAGE
	b	LBB0_16
LBB0_13:                                ;   in Loop: Header=BB0_16 Depth=1
	mov	w8, #1
	str	w8, [x22]
LBB0_14:                                ;   in Loop: Header=BB0_16 Depth=1
	add	w27, w27, #1
	ldr	w8, [sp, #76]                   ; 4-byte Folded Reload
	add	w8, w8, #1
	str	w8, [sp, #76]                   ; 4-byte Folded Spill
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	adrp	x21, _pemu_loop.audio_skew_prev@PAGE
Lloh75:
	adrp	x8, _engineState@GOTPAGE
Lloh76:
	ldr	x8, [x8, _engineState@GOTPAGEOFF]
Lloh77:
	ldr	x8, [x8]
Lloh78:
	adrp	x9, _PGS_Running@GOTPAGE
Lloh79:
	ldr	x9, [x9, _PGS_Running@GOTPAGEOFF]
Lloh80:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_61
LBB0_16:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_38 Depth 2
	mov	x20, x24
	bl	_GetTickCount
	mov	x24, x0
	ldr	w8, [x22]
	cmp	w8, #0
	ccmp	x0, x20, #8, eq
	b.ge	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	str	wzr, [sp, #76]                  ; 4-byte Folded Spill
	mov	w27, #0
	str	wzr, [x22]
	mov	x19, x24
LBB0_18:                                ;   in Loop: Header=BB0_16 Depth=1
Lloh81:
	adrp	x8, _noticeMsgTime@GOTPAGE
Lloh82:
	ldr	x8, [x8, _noticeMsgTime@GOTPAGEOFF]
Lloh83:
	ldr	x8, [x8]
	cbz	x8, LBB0_23
; %bb.19:                               ;   in Loop: Header=BB0_16 Depth=1
	sub	x8, x24, x8
	cmp	x8, #2001
	b.lt	LBB0_21
; %bb.20:                               ;   in Loop: Header=BB0_16 Depth=1
Lloh84:
	adrp	x8, _noticeMsgTime@GOTPAGE
Lloh85:
	ldr	x8, [x8, _noticeMsgTime@GOTPAGEOFF]
Lloh86:
	str	xzr, [x8]
	mov	w0, #0
	bl	_clearArea
	str	xzr, [sp, #64]                  ; 8-byte Folded Spill
	b	LBB0_23
LBB0_21:                                ;   in Loop: Header=BB0_16 Depth=1
Lloh87:
	adrp	x8, _noticeMsg@GOTPAGE
Lloh88:
	ldr	x8, [x8, _noticeMsg@GOTPAGEOFF]
Lloh89:
	ldr	x10, [x8]
	ldrsb	w8, [x10]
	ldrsb	w9, [x10, #1]
	str	x10, [sp, #64]                  ; 8-byte Folded Spill
	ldrsb	w10, [x10, #2]
	add	w8, w9, w8
	add	w20, w8, w10
Lloh90:
	adrp	x8, _pemu_loop.noticeMsgSum@PAGE
Lloh91:
	ldr	w8, [x8, _pemu_loop.noticeMsgSum@PAGEOFF]
	cmp	w20, w8
	b.eq	LBB0_23
; %bb.22:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	w0, #0
	bl	_clearArea
Lloh92:
	adrp	x8, _pemu_loop.noticeMsgSum@PAGE
	str	w20, [x8, _pemu_loop.noticeMsgSum@PAGEOFF]
Lloh93:
	adrp	x8, _noticeMsg@GOTPAGE
Lloh94:
	ldr	x8, [x8, _noticeMsg@GOTPAGEOFF]
Lloh95:
	ldr	x8, [x8]
	str	x8, [sp, #64]                   ; 8-byte Folded Spill
LBB0_23:                                ;   in Loop: Header=BB0_16 Depth=1
	ldr	x8, [x25, #16]
	ldr	w9, [x8, #48]
	ldr	w8, [x8, #4]
	and	w20, w8, #0x8
	bfi	w20, w9, #2, #1
	ldr	w8, [sp, #60]                   ; 4-byte Folded Reload
	cmp	w20, w8
	b.eq	LBB0_25
; %bb.24:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	w0, #1
	bl	_clearArea
	str	w20, [sp, #60]                  ; 4-byte Folded Spill
LBB0_25:                                ;   in Loop: Header=BB0_16 Depth=1
	ldr	x8, [sp, #48]                   ; 8-byte Folded Reload
	sxtw	x20, w8
	sub	x8, x24, x19
	cmp	x8, x20
	b.lt	LBB0_34
; %bb.26:                               ;   in Loop: Header=BB0_16 Depth=1
	ldrb	w8, [x23]
	tbz	w8, #1, LBB0_28
; %bb.27:                               ;   in Loop: Header=BB0_16 Depth=1
	str	x27, [sp]
	add	x0, sp, #80
Lloh96:
	adrp	x1, l_.str.4@PAGE
Lloh97:
	add	x1, x1, l_.str.4@PAGEOFF
	ldr	w2, [sp, #76]                   ; 4-byte Folded Reload
	bl	_sprintf
LBB0_28:                                ;   in Loop: Header=BB0_16 Depth=1
	add	x19, x19, x20
	ldr	x8, [x26]
	cbz	x8, LBB0_31
; %bb.29:                               ;   in Loop: Header=BB0_16 Depth=1
Lloh98:
	adrp	x8, _snd_all_samples@GOTPAGE
Lloh99:
	ldr	x8, [x8, _snd_all_samples@GOTPAGEOFF]
Lloh100:
	ldr	w8, [x8]
	lsl	w20, w8, #1
	bl	_FrameworkAudio_BufferPos
	sub	w8, w20, w0
Lloh101:
	adrp	x9, _PsndRate@GOTPAGE
Lloh102:
	ldr	x9, [x9, _PsndRate@GOTPAGEOFF]
Lloh103:
	ldr	w9, [x9]
	mov	w10, #22050
	cmp	w9, w10
	mov	w9, #9
	cinc	w9, w9, eq
	mov	w10, #11
	csel	w9, w10, w9, gt
Lloh104:
	adrp	x10, _PicoOpt@GOTPAGE
Lloh105:
	ldr	x10, [x10, _PicoOpt@GOTPAGEOFF]
	ldrb	w10, [x10]
	tst	w10, #0x8
	mov	w10, #7
	cinc	w10, w10, ne
	tbnz	w8, #31, LBB0_32
; %bb.30:                               ;   in Loop: Header=BB0_16 Depth=1
	lsr	w10, w8, w10
	mov	w11, #6
	lsl	w11, w11, w9
	cmp	w8, w11
	cset	w11, lo
	lsr	w10, w10, w11
	mov	w11, #4
	lsl	w11, w11, w9
	cmp	w8, w11
	cset	w11, lo
	lsr	w10, w10, w11
	mov	w11, #2
	lsl	w9, w11, w9
	cmp	w8, w9
	cset	w9, lo
	lsr	w9, w10, w9
	ldr	w10, [x21, _pemu_loop.audio_skew_prev@PAGEOFF]
	lsr	w11, w9, #2
	cmp	w8, w10
	csel	w9, w11, w9, lt
	b	LBB0_33
LBB0_31:                                ;   in Loop: Header=BB0_16 Depth=1
	ldr	w8, [x23, #4]
	ldr	w10, [sp, #44]                  ; 4-byte Folded Reload
	sub	w9, w27, w10
	cmp	w9, #0
	csel	w9, w9, wzr, gt
	ldr	w11, [sp, #76]                  ; 4-byte Folded Reload
	sub	w10, w11, w10
	cmp	w10, #0
	csel	w10, w10, wzr, gt
	cmp	w10, w9
	csel	w10, w10, w9, lo
	tst	w8, #0x80000000
	csel	w8, wzr, w10, eq
	str	w8, [sp, #76]                   ; 4-byte Folded Spill
	csel	w27, wzr, w9, eq
	b	LBB0_34
LBB0_32:                                ;   in Loop: Header=BB0_16 Depth=1
	neg	w11, w8
	lsr	w10, w11, w10
	neg	w10, w10
	mov	w11, #-6
	lsl	w11, w11, w9
	cmp	w8, w11
	cset	w11, gt
	asr	w10, w10, w11
	mov	w11, #-4
	lsl	w11, w11, w9
	cmp	w8, w11
	cset	w11, gt
	asr	w10, w10, w11
	mov	w11, #-2
	lsl	w9, w11, w9
	cmp	w8, w9
	cset	w9, gt
	asr	w9, w10, w9
	ldr	w10, [x21, _pemu_loop.audio_skew_prev@PAGEOFF]
	asr	w11, w9, #2
	cmp	w8, w10
	csel	w9, w11, w9, gt
LBB0_33:                                ;   in Loop: Header=BB0_16 Depth=1
	str	wzr, [sp, #76]                  ; 4-byte Folded Spill
	mov	w27, #0
	str	w8, [x21, _pemu_loop.audio_skew_prev@PAGEOFF]
	add	w28, w9, w28
	ldr	w8, [sp, #44]                   ; 4-byte Folded Reload
	mul	w8, w28, w8
	asr	w8, w8, #8
	str	x8, [sp, #48]                   ; 8-byte Folded Spill
LBB0_34:                                ;   in Loop: Header=BB0_16 Depth=1
	add	w20, w27, #1
	mul	w21, w20, w28
	ldr	w8, [x23, #4]
	tbnz	w8, #31, LBB0_42
; %bb.35:                               ;   in Loop: Header=BB0_16 Depth=1
	cbz	w8, LBB0_45
; %bb.36:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	x22, x25
	mov	w25, #0
	lsl	w20, w19, #8
	b	LBB0_38
LBB0_37:                                ;   in Loop: Header=BB0_38 Depth=2
	add	w21, w21, w28
	add	w25, w25, #1
	ldr	w8, [x23, #4]
	cmp	w25, w8
	b.ge	LBB0_41
LBB0_38:                                ;   Parent Loop BB0_16 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	bl	_updateKeys
	bl	_SkipFrame
	ldr	x8, [x26]
	cbz	x8, LBB0_37
; %bb.39:                               ;   in Loop: Header=BB0_38 Depth=2
	bl	_GetTickCount
	sub	w8, w0, w19
	cmp	w21, w8, lsl #8
	b.le	LBB0_37
; %bb.40:                               ;   in Loop: Header=BB0_38 Depth=2
	add	w8, w20, w21
	sub	w8, w8, w0, lsl #8
	asr	w8, w8, #8
	add	x0, x0, w8, sxtw
	bl	_simpleWait
	b	LBB0_37
LBB0_41:                                ;   in Loop: Header=BB0_16 Depth=1
	add	w27, w27, w25
	mov	x25, x22
Lloh106:
	adrp	x22, _reset_timing@GOTPAGE
Lloh107:
	ldr	x22, [x22, _reset_timing@GOTPAGEOFF]
	b	LBB0_45
LBB0_42:                                ;   in Loop: Header=BB0_16 Depth=1
	bl	_GetTickCount
	sub	w8, w0, w19
	lsl	w8, w8, #8
	subs	w8, w8, w21
	b.le	LBB0_45
; %bb.43:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	w9, #11263
	movk	w9, #1, lsl #16
	cmp	w8, w9
	b.le	LBB0_60
; %bb.44:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	w8, #1
	str	w8, [x22]
	b	LBB0_15
LBB0_45:                                ;   in Loop: Header=BB0_16 Depth=1
	bl	_updateKeys
	ldr	w8, [x23]
Lloh108:
	adrp	x20, _giz_screen@GOTPAGE
Lloh109:
	ldr	x20, [x20, _giz_screen@GOTPAGEOFF]
	tbz	w8, #7, LBB0_47
; %bb.46:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	w9, #1
	bic	w0, w9, w8, lsr #15
	bl	_fb_lock
	str	x0, [x20]
LBB0_47:                                ;   in Loop: Header=BB0_16 Depth=1
	bl	_PicoFrame
	ldr	x8, [x20]
	cbnz	x8, LBB0_49
; %bb.48:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	w8, [x23]
	mov	w9, #1
	bic	w0, w9, w8, lsr #15
	bl	_fb_lock
	str	x0, [x20]
LBB0_49:                                ;   in Loop: Header=BB0_16 Depth=1
	add	x0, sp, #80
	ldr	x1, [sp, #64]                   ; 8-byte Folded Reload
	bl	_blit
	ldr	x8, [x20]
	cbz	x8, LBB0_51
; %bb.50:                               ;   in Loop: Header=BB0_16 Depth=1
	bl	_fb_unlock
	str	xzr, [x20]
LBB0_51:                                ;   in Loop: Header=BB0_16 Depth=1
	ldr	w8, [x23]
	tbz	w8, #13, LBB0_53
; %bb.52:                               ;   in Loop: Header=BB0_16 Depth=1
	bl	_Framework2D_WaitVSync
	ldr	w8, [x23]
LBB0_53:                                ;   in Loop: Header=BB0_16 Depth=1
	tbz	w8, #15, LBB0_55
; %bb.54:                               ;   in Loop: Header=BB0_16 Depth=1
	bl	_fb_flip
LBB0_55:                                ;   in Loop: Header=BB0_16 Depth=1
	bl	_GetTickCount
	sub	w8, w0, w19
	lsl	w8, w8, #8
	ldr	w9, [x23, #4]
	tbz	w9, #31, LBB0_57
; %bb.56:                               ;   in Loop: Header=BB0_16 Depth=1
	sub	w10, w8, w21
	mov	w11, #11263
	movk	w11, #1, lsl #16
	cmp	w10, w11
	b.gt	LBB0_13
LBB0_57:                                ;   in Loop: Header=BB0_16 Depth=1
	cmp	w9, #0
	ldr	x9, [x26]
	ccmp	x9, #0, #0, ge
	b.eq	LBB0_14
; %bb.58:                               ;   in Loop: Header=BB0_16 Depth=1
	cmp	w8, w21
	b.ge	LBB0_14
; %bb.59:                               ;   in Loop: Header=BB0_16 Depth=1
	sub	w8, w21, w8
	asr	w8, w8, #8
	add	x0, x0, w8, sxtw
	bl	_simpleWait
	b	LBB0_14
LBB0_60:                                ;   in Loop: Header=BB0_16 Depth=1
	bl	_updateKeys
	bl	_SkipFrame
	mov	x27, x20
	b	LBB0_15
LBB0_61:
Lloh110:
	adrp	x8, _PicoAHW@GOTPAGE
Lloh111:
	ldr	x8, [x8, _PicoAHW@GOTPAGEOFF]
Lloh112:
	ldr	w8, [x8]
Lloh113:
	adrp	x9, _PAHW_MCD@GOTPAGE
Lloh114:
	ldr	x9, [x9, _PAHW_MCD@GOTPAGEOFF]
Lloh115:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_63
; %bb.62:
	bl	_PicoCDBufferFree
LBB0_63:
	ldr	x8, [x26]
	cbz	x8, LBB0_65
; %bb.64:
Lloh116:
	adrp	x8, _snd_cbuff@GOTPAGE
Lloh117:
	ldr	x8, [x8, _snd_cbuff@GOTPAGEOFF]
Lloh118:
	str	xzr, [x8]
	str	xzr, [x26]
	bl	_FrameworkAudio_Close
LBB0_65:
	ldrb	w8, [x23]
	tbz	w8, #0, LBB0_68
; %bb.66:
Lloh119:
	adrp	x19, _SRam@GOTPAGE
Lloh120:
	ldr	x19, [x19, _SRam@GOTPAGEOFF]
	ldr	x8, [x19]
	cbz	x8, LBB0_68
; %bb.67:
Lloh121:
	adrp	x0, l_.str.5@PAGE
Lloh122:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_emu_stateCb
	mov	w0, #0
	mov	w1, #1
	bl	_emu_save_load_game
	str	xzr, [x19]
LBB0_68:
	ldur	x8, [x29, #-88]
Lloh123:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh124:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh125:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_70
; %bb.69:
	ldp	x29, x30, [sp, #192]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #176]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #160]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #144]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #128]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #112]            ; 16-byte Folded Reload
	add	sp, sp, #208
	ret
LBB0_70:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdr	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdr	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotStr	Lloh47, Lloh48, Lloh49
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdrp	Lloh65, Lloh66
	.loh AdrpLdrGotLdr	Lloh62, Lloh63, Lloh64
	.loh AdrpLdrGotStr	Lloh59, Lloh60, Lloh61
	.loh AdrpLdrGotStr	Lloh56, Lloh57, Lloh58
	.loh AdrpLdrGotStr	Lloh53, Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGot	Lloh67, Lloh68
	.loh AdrpLdrGotLdr	Lloh72, Lloh73, Lloh74
	.loh AdrpLdrGotLdr	Lloh69, Lloh70, Lloh71
	.loh AdrpLdrGotLdr	Lloh78, Lloh79, Lloh80
	.loh AdrpLdrGotLdr	Lloh75, Lloh76, Lloh77
	.loh AdrpLdrGotLdr	Lloh81, Lloh82, Lloh83
	.loh AdrpLdrGotStr	Lloh84, Lloh85, Lloh86
	.loh AdrpLdr	Lloh90, Lloh91
	.loh AdrpLdrGotLdr	Lloh87, Lloh88, Lloh89
	.loh AdrpLdrGotLdr	Lloh93, Lloh94, Lloh95
	.loh AdrpAdrp	Lloh92, Lloh93
	.loh AdrpAdd	Lloh96, Lloh97
	.loh AdrpLdrGot	Lloh104, Lloh105
	.loh AdrpLdrGotLdr	Lloh101, Lloh102, Lloh103
	.loh AdrpLdrGotLdr	Lloh98, Lloh99, Lloh100
	.loh AdrpLdrGot	Lloh106, Lloh107
	.loh AdrpLdrGot	Lloh108, Lloh109
	.loh AdrpLdrGotLdr	Lloh113, Lloh114, Lloh115
	.loh AdrpLdrGotLdr	Lloh110, Lloh111, Lloh112
	.loh AdrpLdrGotStr	Lloh116, Lloh117, Lloh118
	.loh AdrpLdrGot	Lloh119, Lloh120
	.loh AdrpAdd	Lloh121, Lloh122
	.loh AdrpLdrGotLdr	Lloh123, Lloh124, Lloh125
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_pemu_loop.PsndRate_old,4,2 ; @pemu_loop.PsndRate_old
.zerofill __DATA,__bss,_pemu_loop.PicoOpt_old,4,2 ; @pemu_loop.PicoOpt_old
.zerofill __DATA,__bss,_pemu_loop.pal_old,4,2 ; @pemu_loop.pal_old
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"entered emu_Loop()\n"

	.comm	_currentConfig,24,3             ; @currentConfig
	.comm	_PicoOpt,4,2                    ; @PicoOpt
	.comm	_Pico,24,3                      ; @Pico
	.comm	_reset_timing,4,2               ; @reset_timing
	.comm	_PicoAHW,4,2                    ; @PicoAHW
	.comm	_PAHW_MCD,4,2                   ; @PAHW_MCD
	.comm	_PsndOut,8,3                    ; @PsndOut
	.comm	_PsndRate,4,2                   ; @PsndRate
	.comm	_PsndLen,4,2                    ; @PsndLen
	.comm	_snd_cbuf_samples,4,2           ; @snd_cbuf_samples
l_.str.1:                               ; @.str.1
	.asciz	"starting audio: %i len: %i (ex: %04x) stereo: %i, pal: %i\n"

l_.str.2:                               ; @.str.2
	.asciz	"FrameworkAudio_Init() failed: %i\n"

	.comm	_noticeMsg,8,3                  ; @noticeMsg
l_.str.3:                               ; @.str.3
	.asciz	"sound init failed (%i), snd disabled"

	.comm	_noticeMsgTime,8,3              ; @noticeMsgTime
	.comm	_updateSound,4,2                ; @updateSound
	.comm	_PicoWriteSound,4,2             ; @PicoWriteSound
	.comm	_snd_cbuff,8,3                  ; @snd_cbuff
	.comm	_snd_all_samples,4,2            ; @snd_all_samples
	.comm	_engineState,8,3                ; @engineState
	.comm	_PGS_Running,8,3                ; @PGS_Running
.zerofill __DATA,__bss,_pemu_loop.noticeMsgSum,4,2 ; @pemu_loop.noticeMsgSum
l_.str.4:                               ; @.str.4
	.asciz	"%02i/%02i"

.zerofill __DATA,__bss,_pemu_loop.audio_skew_prev,4,2 ; @pemu_loop.audio_skew_prev
	.comm	_giz_screen,8,3                 ; @giz_screen
	.comm	_SRam,8,3                       ; @SRam
l_.str.5:                               ; @.str.5
	.asciz	"Writing SRAM/BRAM.."

.subsections_via_symbols
