	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_emu10k1_free
_snd_emu10k1_free:                      ## @snd_emu10k1_free
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	cmpq	$0, 24(%rdi)
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_snd_emu10k1_fx8010_tram_setup
	movq	%rbx, %rdi
	callq	_snd_emu10k1_done
	movq	%rbx, %rdi
	callq	_snd_emu10k1_free_efx
LBB0_2:
	movq	16(%rbx), %rax
	movq	(%rax), %rax
	movq	_EMU_MODEL_EMU1010@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	movq	_EMU_HANA_DOCK_PWR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_snd_emu1010_fpga_write
LBB0_4:
	movq	72(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.5:
	callq	_kthread_stop
LBB0_6:
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	js	LBB0_8
## %bb.7:
	movq	%rbx, %rsi
	callq	_free_irq
LBB0_8:
	movq	64(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_10
## %bb.9:
	movq	%rbx, %rdi
	callq	_snd_emu10k1_synth_free
	movq	$0, 64(%rbx)
LBB0_10:
	movq	56(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.11:
	callq	_snd_util_memhdr_free
LBB0_12:
	cmpq	$0, 48(%rbx)
	je	LBB0_14
## %bb.13:
	leaq	48(%rbx), %rdi
	callq	_snd_dma_free_pages
LBB0_14:
	cmpq	$0, 40(%rbx)
	je	LBB0_16
## %bb.15:
	leaq	40(%rbx), %rdi
	callq	_snd_dma_free_pages
LBB0_16:
	movl	36(%rbx), %edi
	callq	_vfree
	movl	32(%rbx), %edi
	callq	_vfree
	cmpq	$0, 24(%rbx)
	je	LBB0_18
## %bb.17:
	movl	8(%rbx), %edi
	callq	_pci_release_regions
LBB0_18:
	movq	16(%rbx), %rax
	cmpq	$0, 8(%rax)
	je	LBB0_20
## %bb.19:
	movq	%rbx, %rdi
	callq	_snd_p16v_free
LBB0_20:
	movl	8(%rbx), %edi
	callq	_pci_disable_device
	movq	%rbx, %rdi
	callq	_kfree
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EMU_MODEL_EMU1010,8,3          ## @EMU_MODEL_EMU1010
	.comm	_EMU_HANA_DOCK_PWR,4,2          ## @EMU_HANA_DOCK_PWR
	.no_dead_strip	_snd_emu10k1_free
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_emu10k1_free
_snd_emu10k1_free:                      ; @snd_emu10k1_free
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0, #24]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x19
	mov	w1, #0
	bl	_snd_emu10k1_fx8010_tram_setup
	mov	x0, x19
	bl	_snd_emu10k1_done
	mov	x0, x19
	bl	_snd_emu10k1_free_efx
LBB0_2:
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _EMU_MODEL_EMU1010@GOTPAGE
Lloh1:
	ldr	x9, [x9, _EMU_MODEL_EMU1010@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
Lloh3:
	adrp	x8, _EMU_HANA_DOCK_PWR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EMU_HANA_DOCK_PWR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_snd_emu1010_fpga_write
LBB0_4:
	ldr	x0, [x19, #72]
	cbz	x0, LBB0_6
; %bb.5:
	bl	_kthread_stop
LBB0_6:
	ldr	x0, [x19]
	tbnz	x0, #63, LBB0_8
; %bb.7:
	mov	x1, x19
	bl	_free_irq
LBB0_8:
	ldr	x1, [x19, #64]
	cbz	x1, LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_snd_emu10k1_synth_free
	str	xzr, [x19, #64]
LBB0_10:
	ldr	x0, [x19, #56]
	cbz	x0, LBB0_12
; %bb.11:
	bl	_snd_util_memhdr_free
LBB0_12:
	mov	x0, x19
	ldr	x8, [x0, #48]!
	cbz	x8, LBB0_14
; %bb.13:
	bl	_snd_dma_free_pages
LBB0_14:
	mov	x0, x19
	ldr	x8, [x0, #40]!
	cbz	x8, LBB0_16
; %bb.15:
	bl	_snd_dma_free_pages
LBB0_16:
	ldr	w0, [x19, #36]
	bl	_vfree
	ldr	w0, [x19, #32]
	bl	_vfree
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_18
; %bb.17:
	ldr	w0, [x19, #8]
	bl	_pci_release_regions
LBB0_18:
	ldr	x8, [x19, #16]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_20
; %bb.19:
	mov	x0, x19
	bl	_snd_p16v_free
LBB0_20:
	ldr	w0, [x19, #8]
	bl	_pci_disable_device
	mov	x0, x19
	bl	_kfree
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EMU_MODEL_EMU1010,8,3          ; @EMU_MODEL_EMU1010
	.comm	_EMU_HANA_DOCK_PWR,4,2          ; @EMU_HANA_DOCK_PWR
	.no_dead_strip	_snd_emu10k1_free
.subsections_via_symbols
