	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main_exit                      ## -- Begin function main_exit
	.p2align	4, 0x90
_main_exit:                             ## @main_exit
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	_configuration_settings@GOTPCREL(%rip), %r14
	movq	(%r14), %rbx
	movq	_cached_video_driver@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	cmpq	$0, (%rsi)
	je	LBB0_2
## %bb.1:
	movl	8(%rbx), %edi
	callq	_strcpy
	movq	(%r12), %rax
	movq	$0, (%rax)
	movl	8(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	callq	_RARCH_LOG
LBB0_2:
	cmpq	$0, (%rbx)
	je	LBB0_4
## %bb.3:
	movq	_CMD_EVENT_MENU_SAVE_CURRENT_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_command_event
LBB0_4:
	movq	_RARCH_CTL_MAIN_DEINIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_rarch_ctl
	xorl	%eax, %eax
	callq	_rarch_perf_log
	movq	%r15, %rdi
	callq	_frontend_driver_deinit
	movq	_RARCH_PATH_CORE@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_path_get_ptr
	movl	%eax, %ebx
	movl	(%r15), %edi
	callq	_path_get_realsize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_frontend_driver_exitspawn
	movq	_has_set_username@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movq	_rarch_is_inited@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movq	_rarch_error_on_init@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movq	_rarch_block_config_read@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	xorl	%eax, %eax
	callq	_retroarch_msg_queue_deinit
	movq	_DRIVERS_CMD_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_driver_uninit
	movq	_CMD_EVENT_LOG_FILE_DEINIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_command_event
	movq	_RARCH_CTL_STATE_FREE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_rarch_ctl
	xorl	%eax, %eax
	callq	_global_free
	movq	_RARCH_CTL_DATA_DEINIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_rarch_ctl
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.5:
	callq	_free
LBB0_6:
	movq	$0, (%r14)
	xorl	%eax, %eax
	callq	_ui_companion_driver_deinit
	xorl	%edi, %edi
	callq	_frontend_driver_shutdown
	movq	_RARCH_DRIVER_CTL_DEINIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_driver_ctl
	xorl	%eax, %eax
	callq	_ui_companion_driver_free
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_frontend_driver_free           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_configuration_settings,8,3     ## @configuration_settings
	.comm	_cached_video_driver,8,3        ## @cached_video_driver
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[Video]: Restored video driver to \"%s\".\n"

	.comm	_CMD_EVENT_MENU_SAVE_CURRENT_CONFIG,4,2 ## @CMD_EVENT_MENU_SAVE_CURRENT_CONFIG
	.comm	_RARCH_CTL_MAIN_DEINIT,4,2      ## @RARCH_CTL_MAIN_DEINIT
	.comm	_RARCH_PATH_CORE,4,2            ## @RARCH_PATH_CORE
	.comm	_has_set_username,4,2           ## @has_set_username
	.comm	_rarch_is_inited,4,2            ## @rarch_is_inited
	.comm	_rarch_error_on_init,4,2        ## @rarch_error_on_init
	.comm	_rarch_block_config_read,4,2    ## @rarch_block_config_read
	.comm	_DRIVERS_CMD_ALL,4,2            ## @DRIVERS_CMD_ALL
	.comm	_CMD_EVENT_LOG_FILE_DEINIT,4,2  ## @CMD_EVENT_LOG_FILE_DEINIT
	.comm	_RARCH_CTL_STATE_FREE,4,2       ## @RARCH_CTL_STATE_FREE
	.comm	_RARCH_CTL_DATA_DEINIT,4,2      ## @RARCH_CTL_DATA_DEINIT
	.comm	_RARCH_DRIVER_CTL_DEINIT,4,2    ## @RARCH_DRIVER_CTL_DEINIT
	.comm	_RARCH_MENU_CTL_UNSET_OWN_DRIVER,4,2 ## @RARCH_MENU_CTL_UNSET_OWN_DRIVER
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main_exit                      ; -- Begin function main_exit
	.p2align	2
_main_exit:                             ; @main_exit
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [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 w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
Lloh0:
	adrp	x20, _configuration_settings@GOTPAGE
Lloh1:
	ldr	x20, [x20, _configuration_settings@GOTPAGEOFF]
	ldr	x21, [x20]
Lloh2:
	adrp	x22, _cached_video_driver@GOTPAGE
Lloh3:
	ldr	x22, [x22, _cached_video_driver@GOTPAGEOFF]
	ldr	x1, [x22]
	ldr	x8, [x1]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w0, [x21, #8]
	bl	_strcpy
	ldr	x8, [x22]
	str	xzr, [x8]
	ldr	w1, [x21, #8]
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_LOG
LBB0_2:
	ldr	x8, [x21]
	cbz	x8, LBB0_4
; %bb.3:
Lloh6:
	adrp	x8, _CMD_EVENT_MENU_SAVE_CURRENT_CONFIG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CMD_EVENT_MENU_SAVE_CURRENT_CONFIG@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	mov	x1, #0
	bl	_command_event
LBB0_4:
Lloh9:
	adrp	x8, _RARCH_CTL_MAIN_DEINIT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RARCH_CTL_MAIN_DEINIT@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	mov	x1, #0
	bl	_rarch_ctl
	bl	_rarch_perf_log
	mov	x0, x19
	bl	_frontend_driver_deinit
Lloh12:
	adrp	x21, _RARCH_PATH_CORE@GOTPAGE
Lloh13:
	ldr	x21, [x21, _RARCH_PATH_CORE@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_path_get_ptr
	mov	x19, x0
	ldr	w0, [x21]
	bl	_path_get_realsize
	mov	x1, x0
	mov	x0, x19
	bl	_frontend_driver_exitspawn
Lloh14:
	adrp	x8, _has_set_username@GOTPAGE
Lloh15:
	ldr	x8, [x8, _has_set_username@GOTPAGEOFF]
Lloh16:
	str	wzr, [x8]
Lloh17:
	adrp	x8, _rarch_is_inited@GOTPAGE
Lloh18:
	ldr	x8, [x8, _rarch_is_inited@GOTPAGEOFF]
Lloh19:
	str	wzr, [x8]
Lloh20:
	adrp	x8, _rarch_error_on_init@GOTPAGE
Lloh21:
	ldr	x8, [x8, _rarch_error_on_init@GOTPAGEOFF]
Lloh22:
	str	wzr, [x8]
Lloh23:
	adrp	x8, _rarch_block_config_read@GOTPAGE
Lloh24:
	ldr	x8, [x8, _rarch_block_config_read@GOTPAGEOFF]
Lloh25:
	str	wzr, [x8]
	bl	_retroarch_msg_queue_deinit
Lloh26:
	adrp	x8, _DRIVERS_CMD_ALL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _DRIVERS_CMD_ALL@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	bl	_driver_uninit
Lloh29:
	adrp	x8, _CMD_EVENT_LOG_FILE_DEINIT@GOTPAGE
Lloh30:
	ldr	x8, [x8, _CMD_EVENT_LOG_FILE_DEINIT@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
	mov	x1, #0
	bl	_command_event
Lloh32:
	adrp	x8, _RARCH_CTL_STATE_FREE@GOTPAGE
Lloh33:
	ldr	x8, [x8, _RARCH_CTL_STATE_FREE@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
	mov	x1, #0
	bl	_rarch_ctl
	bl	_global_free
Lloh35:
	adrp	x8, _RARCH_CTL_DATA_DEINIT@GOTPAGE
Lloh36:
	ldr	x8, [x8, _RARCH_CTL_DATA_DEINIT@GOTPAGEOFF]
Lloh37:
	ldr	w0, [x8]
	mov	x1, #0
	bl	_rarch_ctl
	ldr	x0, [x20]
	cbz	x0, LBB0_6
; %bb.5:
	bl	_free
LBB0_6:
	str	xzr, [x20]
	bl	_ui_companion_driver_deinit
	mov	w0, #0
	bl	_frontend_driver_shutdown
Lloh38:
	adrp	x8, _RARCH_DRIVER_CTL_DEINIT@GOTPAGE
Lloh39:
	ldr	x8, [x8, _RARCH_DRIVER_CTL_DEINIT@GOTPAGEOFF]
Lloh40:
	ldr	w0, [x8]
	mov	x1, #0
	bl	_driver_ctl
	bl	_ui_companion_driver_free
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_frontend_driver_free
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotStr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotStr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotStr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotStr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_configuration_settings,8,3     ; @configuration_settings
	.comm	_cached_video_driver,8,3        ; @cached_video_driver
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[Video]: Restored video driver to \"%s\".\n"

	.comm	_CMD_EVENT_MENU_SAVE_CURRENT_CONFIG,4,2 ; @CMD_EVENT_MENU_SAVE_CURRENT_CONFIG
	.comm	_RARCH_CTL_MAIN_DEINIT,4,2      ; @RARCH_CTL_MAIN_DEINIT
	.comm	_RARCH_PATH_CORE,4,2            ; @RARCH_PATH_CORE
	.comm	_has_set_username,4,2           ; @has_set_username
	.comm	_rarch_is_inited,4,2            ; @rarch_is_inited
	.comm	_rarch_error_on_init,4,2        ; @rarch_error_on_init
	.comm	_rarch_block_config_read,4,2    ; @rarch_block_config_read
	.comm	_DRIVERS_CMD_ALL,4,2            ; @DRIVERS_CMD_ALL
	.comm	_CMD_EVENT_LOG_FILE_DEINIT,4,2  ; @CMD_EVENT_LOG_FILE_DEINIT
	.comm	_RARCH_CTL_STATE_FREE,4,2       ; @RARCH_CTL_STATE_FREE
	.comm	_RARCH_CTL_DATA_DEINIT,4,2      ; @RARCH_CTL_DATA_DEINIT
	.comm	_RARCH_DRIVER_CTL_DEINIT,4,2    ; @RARCH_DRIVER_CTL_DEINIT
	.comm	_RARCH_MENU_CTL_UNSET_OWN_DRIVER,4,2 ; @RARCH_MENU_CTL_UNSET_OWN_DRIVER
.subsections_via_symbols
