	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function azx_free
_azx_free:                              ## @azx_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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_azx_del_card_list
	movq	%r15, %rdi
	callq	_azx_notifier_unregister
	movl	$1, (%r15)
	leaq	120(%r15), %rdi
	callq	_complete_all
	movq	%r15, %rdi
	callq	_use_vga_switcheroo
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	cmpq	$0, 112(%r15)
	je	LBB0_4
## %bb.2:
	movq	104(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.3:
	callq	_snd_hda_unlock_devices
LBB0_4:
	cmpq	$0, 96(%r15)
	je	LBB0_6
## %bb.5:
	movl	32(%r15), %edi
	callq	_vga_switcheroo_unregister_client
LBB0_6:
	cmpq	$0, 88(%r15)
	je	LBB0_11
## %bb.7:
	movq	%r15, %rdi
	callq	_azx_clear_irq_pending
	cmpl	$0, 4(%r15)
	jle	LBB0_10
## %bb.8:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%r15), %rsi
	addq	%r14, %rsi
	movq	%r15, %rdi
	callq	_azx_stream_stop
	incq	%rbx
	movslq	4(%r15), %rax
	subq	$-128, %r14
	cmpq	%rax, %rbx
	jl	LBB0_9
LBB0_10:
	movq	%r15, %rdi
	callq	_azx_stop_chip
LBB0_11:
	movq	8(%r15), %rdi
	testq	%rdi, %rdi
	js	LBB0_13
## %bb.12:
	movq	%r15, %rsi
	callq	_free_irq
LBB0_13:
	cmpq	$0, 80(%r15)
	je	LBB0_15
## %bb.14:
	movl	32(%r15), %edi
	callq	_pci_disable_msi
LBB0_15:
	movq	72(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_17
## %bb.16:
	callq	_iounmap
LBB0_17:
	movq	24(%r15), %rsi
	testq	%rsi, %rsi
	je	LBB0_24
## %bb.18:
	movl	4(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_24
## %bb.19:
	movl	$64, %ebx
	movl	$1, %r14d
	cmpq	$0, (%rsi,%rbx)
	je	LBB0_22
	.p2align	4, 0x90
LBB0_21:
	addq	%rbx, %rsi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_mark_pages_wc
	movq	24(%r15), %rdi
	addq	%rbx, %rdi
	callq	_snd_dma_free_pages
	movl	4(%r15), %eax
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movslq	%eax, %rcx
	cmpq	%rcx, %r14
	jge	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_22 Depth=1
	movq	24(%r15), %rsi
	subq	$-128, %rbx
	incq	%r14
	cmpq	$0, (%rsi,%rbx)
	jne	LBB0_21
	jmp	LBB0_22
LBB0_24:
	cmpq	$0, 56(%r15)
	je	LBB0_26
## %bb.25:
	leaq	56(%r15), %r14
	movq	%r15, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_mark_pages_wc
	movq	%r14, %rdi
	callq	_snd_dma_free_pages
LBB0_26:
	cmpq	$0, 48(%r15)
	je	LBB0_28
## %bb.27:
	leaq	48(%r15), %r14
	movq	%r15, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_mark_pages_wc
	movq	%r14, %rdi
	callq	_snd_dma_free_pages
LBB0_28:
	cmpq	$0, 40(%r15)
	je	LBB0_30
## %bb.29:
	movl	32(%r15), %edi
	callq	_pci_release_regions
LBB0_30:
	movl	32(%r15), %edi
	callq	_pci_disable_device
	movq	24(%r15), %rdi
	callq	_kfree
	movq	%r15, %rdi
	callq	_kfree
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_azx_free
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function azx_free
_azx_free:                              ; @azx_free
	.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
	bl	_azx_del_card_list
	mov	x0, x19
	bl	_azx_notifier_unregister
	mov	w8, #1
	mov	x0, x19
	str	w8, [x0], #120
	bl	_complete_all
	mov	x0, x19
	bl	_use_vga_switcheroo
	cbz	x0, LBB0_6
; %bb.1:
	ldr	x8, [x19, #112]
	cbz	x8, LBB0_4
; %bb.2:
	ldr	x0, [x19, #104]
	cbz	x0, LBB0_4
; %bb.3:
	bl	_snd_hda_unlock_devices
LBB0_4:
	ldr	x8, [x19, #96]
	cbz	x8, LBB0_6
; %bb.5:
	ldr	w0, [x19, #32]
	bl	_vga_switcheroo_unregister_client
LBB0_6:
	ldr	x8, [x19, #88]
	cbz	x8, LBB0_11
; %bb.7:
	mov	x0, x19
	bl	_azx_clear_irq_pending
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.8:
	mov	x20, #0
	mov	x21, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #24]
	add	x1, x8, x20
	mov	x0, x19
	bl	_azx_stream_stop
	add	x21, x21, #1
	ldrsw	x8, [x19, #4]
	add	x20, x20, #128
	cmp	x21, x8
	b.lt	LBB0_9
LBB0_10:
	mov	x0, x19
	bl	_azx_stop_chip
LBB0_11:
	ldr	x0, [x19, #8]
	tbnz	x0, #63, LBB0_13
; %bb.12:
	mov	x1, x19
	bl	_free_irq
LBB0_13:
	ldr	x8, [x19, #80]
	cbz	x8, LBB0_15
; %bb.14:
	ldr	w0, [x19, #32]
	bl	_pci_disable_msi
LBB0_15:
	ldr	x0, [x19, #72]
	cbz	x0, LBB0_17
; %bb.16:
	bl	_iounmap
LBB0_17:
	ldr	x9, [x19, #24]
	cbz	x9, LBB0_24
; %bb.18:
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_24
; %bb.19:
	mov	w20, #64
	mov	w21, #1
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	add	x1, x9, x20
	ldr	x9, [x1]
	cbz	x9, LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_20 Depth=1
	mov	x0, x19
	mov	w2, #0
	bl	_mark_pages_wc
	ldr	x8, [x19, #24]
	add	x0, x8, x20
	bl	_snd_dma_free_pages
	ldr	w8, [x19, #4]
LBB0_22:                                ;   in Loop: Header=BB0_20 Depth=1
	cmp	x21, w8, sxtw
	b.ge	LBB0_24
; %bb.23:                               ;   in Loop: Header=BB0_20 Depth=1
	ldr	x9, [x19, #24]
	add	x20, x20, #128
	add	x21, x21, #1
	b	LBB0_20
LBB0_24:
	mov	x20, x19
	ldr	x8, [x20, #56]!
	cbz	x8, LBB0_26
; %bb.25:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_mark_pages_wc
	mov	x0, x20
	bl	_snd_dma_free_pages
LBB0_26:
	mov	x20, x19
	ldr	x8, [x20, #48]!
	cbz	x8, LBB0_28
; %bb.27:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_mark_pages_wc
	mov	x0, x20
	bl	_snd_dma_free_pages
LBB0_28:
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_30
; %bb.29:
	ldr	w0, [x19, #32]
	bl	_pci_release_regions
LBB0_30:
	ldr	w0, [x19, #32]
	bl	_pci_disable_device
	ldr	x0, [x19, #24]
	bl	_kfree
	mov	x0, x19
	bl	_kfree
	mov	w0, #0
	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
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_azx_free
.subsections_via_symbols
