	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mmsp2_finish                   ## -- Begin function mmsp2_finish
	.p2align	4, 0x90
_mmsp2_finish:                          ## @mmsp2_finish
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movl	$1, %edi
	movl	$3, %esi
	callq	_reset940
	movl	$1, %edi
	callq	_pause940
	xorl	%eax, %eax
	callq	_unset_lcd_custom_rate_
	movq	_gamma_was_changed@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movl	$100, %edi
	xorl	%esi, %esi
	callq	_set_lcd_gamma_
LBB0_2:
	xorl	%eax, %eax
	callq	_unset_ram_timings_
	movq	_cpuclk_was_changed@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_3
## %bb.4:
	movq	_reg0910@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_memregs@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	movl	%eax, 4640(%rdi)
	jmp	LBB0_5
LBB0_3:
	movq	_memregs@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
LBB0_5:
	movl	$65536, %esi                    ## imm = 0x10000
	callq	_munmap
	movq	_memdev@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_close
	movq	_touchdev@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	js	LBB0_7
## %bb.6:
	callq	_close
LBB0_7:
	movq	_mixerdev@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	js	LBB0_8
## %bb.9:
	popq	%rbp
	jmp	_close                          ## TAILCALL
LBB0_8:
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_gamma_was_changed,8,3          ## @gamma_was_changed
	.comm	_cpuclk_was_changed,8,3         ## @cpuclk_was_changed
	.comm	_reg0910,4,2                    ## @reg0910
	.comm	_memregs,8,3                    ## @memregs
	.comm	_memdev,8,3                     ## @memdev
	.comm	_touchdev,8,3                   ## @touchdev
	.comm	_mixerdev,8,3                   ## @mixerdev
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mmsp2_finish                   ; -- Begin function mmsp2_finish
	.p2align	2
_mmsp2_finish:                          ; @mmsp2_finish
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	mov	w0, #1
	mov	w1, #3
	bl	_reset940
	mov	w0, #1
	bl	_pause940
	bl	_unset_lcd_custom_rate_
Lloh0:
	adrp	x8, _gamma_was_changed@GOTPAGE
Lloh1:
	ldr	x8, [x8, _gamma_was_changed@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
	mov	w0, #100
	mov	w1, #0
	bl	_set_lcd_gamma_
LBB0_2:
	bl	_unset_ram_timings_
Lloh3:
	adrp	x8, _cpuclk_was_changed@GOTPAGE
Lloh4:
	ldr	x8, [x8, _cpuclk_was_changed@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.3:
Lloh6:
	adrp	x8, _reg0910@GOTPAGE
Lloh7:
	ldr	x8, [x8, _reg0910@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _memregs@GOTPAGE
Lloh10:
	ldr	x9, [x9, _memregs@GOTPAGEOFF]
Lloh11:
	ldr	x0, [x9]
	str	w8, [x0, #4640]
	b	LBB0_5
LBB0_4:
Lloh12:
	adrp	x8, _memregs@GOTPAGE
Lloh13:
	ldr	x8, [x8, _memregs@GOTPAGEOFF]
Lloh14:
	ldr	x0, [x8]
LBB0_5:
	mov	w1, #65536
	bl	_munmap
Lloh15:
	adrp	x8, _memdev@GOTPAGE
Lloh16:
	ldr	x8, [x8, _memdev@GOTPAGEOFF]
Lloh17:
	ldr	x0, [x8]
	bl	_close
Lloh18:
	adrp	x8, _touchdev@GOTPAGE
Lloh19:
	ldr	x8, [x8, _touchdev@GOTPAGEOFF]
Lloh20:
	ldr	x0, [x8]
	tbnz	x0, #63, LBB0_7
; %bb.6:
	bl	_close
LBB0_7:
Lloh21:
	adrp	x8, _mixerdev@GOTPAGE
Lloh22:
	ldr	x8, [x8, _mixerdev@GOTPAGEOFF]
Lloh23:
	ldr	x0, [x8]
	tbnz	x0, #63, LBB0_9
; %bb.8:
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	b	_close
LBB0_9:
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_gamma_was_changed,8,3          ; @gamma_was_changed
	.comm	_cpuclk_was_changed,8,3         ; @cpuclk_was_changed
	.comm	_reg0910,4,2                    ; @reg0910
	.comm	_memregs,8,3                    ; @memregs
	.comm	_memdev,8,3                     ; @memdev
	.comm	_touchdev,8,3                   ; @touchdev
	.comm	_mixerdev,8,3                   ; @mixerdev
.subsections_via_symbols
