	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function diva_4bri_cleanup_adapter
_diva_4bri_cleanup_adapter:             ## @diva_4bri_cleanup_adapter
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	cmpq	$0, 56(%rdi)
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_diva_4bri_stop_adapter
LBB0_2:
	cmpq	$0, 40(%rbx)
	je	LBB0_4
## %bb.3:
	movl	48(%rbx), %esi
	movq	%rbx, %rdi
	callq	_diva_os_remove_irq
LBB0_4:
	movq	$0, 40(%rbx)
	movq	%rbx, %rdi
	callq	_diva_4bri_cleanup_slave_adapters
	movq	16(%rbx), %rax
	cmpq	$0, (%rax)
	je	LBB0_7
## %bb.5:
	movq	8(%rbx), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.6:
	callq	_divasa_unmap_pci_bar
	movq	16(%rbx), %rax
	movq	$0, (%rax)
	movq	8(%rbx), %rax
	movq	$0, (%rax)
LBB0_7:
	movq	16(%rbx), %rax
	cmpq	$0, 16(%rax)
	je	LBB0_10
## %bb.8:
	movq	8(%rbx), %rax
	movq	16(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.9:
	callq	_divasa_unmap_pci_bar
	movq	16(%rbx), %rax
	movq	$0, 16(%rax)
	movq	8(%rbx), %rax
	movq	$0, 16(%rax)
LBB0_10:
	movq	16(%rbx), %rax
	cmpq	$0, 24(%rax)
	je	LBB0_13
## %bb.11:
	movq	8(%rbx), %rax
	movq	24(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_13
## %bb.12:
	callq	_divasa_unmap_pci_bar
	movq	16(%rbx), %rax
	movq	$0, 24(%rax)
	movq	8(%rbx), %rax
	movq	$0, 24(%rax)
LBB0_13:
	movq	16(%rbx), %rax
	movq	8(%rax), %r14
	testq	%r14, %r14
	je	LBB0_19
## %bb.14:
	movq	8(%rbx), %rax
	cmpq	$0, 8(%rax)
	je	LBB0_19
## %bb.15:
	movl	32(%rbx), %edi
	callq	__4bri_is_rev_2_card
	testq	%rax, %rax
	jne	LBB0_16
## %bb.17:
	movq	__4bri_bar_length@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_16:
	movq	__4bri_v2_bar_length@GOTPCREL(%rip), %rax
LBB0_18:
	movq	(%rax), %rax
	movl	4(%rax), %ecx
	movq	24(%rbx), %r8
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movq	%r14, %rdx
	movl	$1, %r9d
	callq	_diva_os_register_io_port
	movq	16(%rbx), %rax
	movq	$0, 8(%rax)
	movq	8(%rbx), %rax
	movq	$0, 8(%rax)
LBB0_19:
	movq	(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_21
## %bb.20:
	xorl	%edi, %edi
	callq	_diva_os_free
	movq	$0, (%rbx)
LBB0_21:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	__4bri_v2_bar_length,8,3        ## @_4bri_v2_bar_length
	.comm	__4bri_bar_length,8,3           ## @_4bri_bar_length
	.no_dead_strip	_diva_4bri_cleanup_adapter
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function diva_4bri_cleanup_adapter
_diva_4bri_cleanup_adapter:             ; @diva_4bri_cleanup_adapter
	.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, #56]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_diva_4bri_stop_adapter
LBB0_2:
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_4
; %bb.3:
	ldr	w1, [x19, #48]
	mov	x0, x19
	bl	_diva_os_remove_irq
LBB0_4:
	str	xzr, [x19, #40]
	mov	x0, x19
	bl	_diva_4bri_cleanup_slave_adapters
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_7
; %bb.5:
	ldr	x8, [x19, #8]
	ldr	x0, [x8]
	cbz	x0, LBB0_7
; %bb.6:
	bl	_divasa_unmap_pci_bar
	ldp	x9, x8, [x19, #8]
	str	xzr, [x8]
	str	xzr, [x9]
LBB0_7:
	ldr	x8, [x19, #16]
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_10
; %bb.8:
	ldr	x8, [x19, #8]
	ldr	x0, [x8, #16]
	cbz	x0, LBB0_10
; %bb.9:
	bl	_divasa_unmap_pci_bar
	ldp	x9, x8, [x19, #8]
	str	xzr, [x8, #16]
	str	xzr, [x9, #16]
LBB0_10:
	ldr	x8, [x19, #16]
	ldr	x8, [x8, #24]
	cbz	x8, LBB0_13
; %bb.11:
	ldr	x8, [x19, #8]
	ldr	x0, [x8, #24]
	cbz	x0, LBB0_13
; %bb.12:
	bl	_divasa_unmap_pci_bar
	ldp	x9, x8, [x19, #8]
	str	xzr, [x8, #24]
	str	xzr, [x9, #24]
LBB0_13:
	ldr	x8, [x19, #16]
	ldr	x20, [x8, #8]
	cbz	x20, LBB0_16
; %bb.14:
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_16
; %bb.15:
	ldr	w0, [x19, #32]
	bl	__4bri_is_rev_2_card
Lloh0:
	adrp	x8, __4bri_bar_length@GOTPAGE
Lloh1:
	ldr	x8, [x8, __4bri_bar_length@GOTPAGEOFF]
Lloh2:
	adrp	x9, __4bri_v2_bar_length@GOTPAGE
Lloh3:
	ldr	x9, [x9, __4bri_v2_bar_length@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x8, x9, eq
	ldr	x8, [x8]
	ldr	w3, [x8, #4]
	ldr	x4, [x19, #24]
	mov	x0, x19
	mov	w1, #0
	mov	x2, x20
	mov	w5, #1
	bl	_diva_os_register_io_port
	ldp	x9, x8, [x19, #8]
	str	xzr, [x8, #8]
	str	xzr, [x9, #8]
LBB0_16:
	ldr	x1, [x19]
	cbz	x1, LBB0_18
; %bb.17:
	mov	w0, #0
	bl	_diva_os_free
	str	xzr, [x19]
LBB0_18:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	__4bri_v2_bar_length,8,3        ; @_4bri_v2_bar_length
	.comm	__4bri_bar_length,8,3           ; @_4bri_bar_length
	.no_dead_strip	_diva_4bri_cleanup_adapter
.subsections_via_symbols
