	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_emu_finish                     ## -- Begin function emu_finish
	.p2align	4, 0x90
_emu_finish:                            ## @emu_finish
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$528, %rsp                      ## imm = 0x210
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	_currentConfig@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	movq	_EOPT_EN_SRAM@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_3
## %bb.1:
	movq	_SRam@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	je	LBB0_3
## %bb.2:
	xorl	%edi, %edi
	movl	$1, %esi
	callq	_emu_save_load_game
	movq	$0, (%r14)
	movl	(%rbx), %eax
LBB0_3:
	movq	_EOPT_NO_AUTOSVCFG@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_5
## %bb.4:
	leaq	-544(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_make_config_cfg
	movq	%rbx, %rdi
	callq	_config_writelrom
LBB0_5:
	xorl	%eax, %eax
	callq	_pprof_finish
	xorl	%eax, %eax
	callq	_PicoExit
	xorl	%eax, %eax
	callq	_sndout_exit
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-24(%rbp), %rax
	jne	LBB0_7
## %bb.6:
	addq	$528, %rsp                      ## imm = 0x210
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_7:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_currentConfig,4,2              ## @currentConfig
	.comm	_EOPT_EN_SRAM,4,2               ## @EOPT_EN_SRAM
	.comm	_SRam,8,3                       ## @SRam
	.comm	_EOPT_NO_AUTOSVCFG,4,2          ## @EOPT_NO_AUTOSVCFG
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_emu_finish                     ; -- Begin function emu_finish
	.p2align	2
_emu_finish:                            ; @emu_finish
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w27, -40
	.cfi_offset w28, -48
	sub	sp, sp, #528
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
Lloh3:
	adrp	x19, _currentConfig@GOTPAGE
Lloh4:
	ldr	x19, [x19, _currentConfig@GOTPAGEOFF]
	ldr	w8, [x19]
Lloh5:
	adrp	x9, _EOPT_EN_SRAM@GOTPAGE
Lloh6:
	ldr	x9, [x9, _EOPT_EN_SRAM@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	and	w9, w9, w8
Lloh8:
	adrp	x20, _SRam@GOTPAGE
Lloh9:
	ldr	x20, [x20, _SRam@GOTPAGEOFF]
	ldr	x10, [x20]
	cmp	w9, #0
	ccmp	x10, #0, #4, ne
	b.eq	LBB0_2
; %bb.1:
	mov	w0, #0
	mov	w1, #1
	bl	_emu_save_load_game
	str	xzr, [x20]
	ldr	w8, [x19]
LBB0_2:
Lloh10:
	adrp	x9, _EOPT_NO_AUTOSVCFG@GOTPAGE
Lloh11:
	ldr	x9, [x9, _EOPT_NO_AUTOSVCFG@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_4
; %bb.3:
	add	x0, sp, #8
	bl	_make_config_cfg
	add	x0, sp, #8
	bl	_config_writelrom
LBB0_4:
	bl	_pprof_finish
	bl	_PicoExit
	bl	_sndout_exit
	ldur	x8, [x29, #-40]
Lloh13:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh14:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.5:
	add	sp, sp, #528
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_currentConfig,4,2              ; @currentConfig
	.comm	_EOPT_EN_SRAM,4,2               ; @EOPT_EN_SRAM
	.comm	_SRam,8,3                       ; @SRam
	.comm	_EOPT_NO_AUTOSVCFG,4,2          ; @EOPT_NO_AUTOSVCFG
.subsections_via_symbols
