	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function diva_bri_cleanup_adapter
_diva_bri_cleanup_adapter:              ## @diva_bri_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, 48(%rdi)
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_diva_bri_stop_adapter
LBB0_2:
	cmpq	$0, 32(%rbx)
	je	LBB0_4
## %bb.3:
	movl	40(%rbx), %esi
	movq	%rbx, %rdi
	callq	_diva_os_remove_irq
LBB0_4:
	movq	$0, 32(%rbx)
	movq	64(%rbx), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.5:
	movq	56(%rbx), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_7
## %bb.6:
	callq	_divasa_unmap_pci_bar
	movq	64(%rbx), %rax
	movq	$0, (%rax)
	movq	56(%rbx), %rax
	movq	$0, (%rax)
	movq	64(%rbx), %rax
LBB0_7:
	cmpq	$0, 8(%rax)
	je	LBB0_10
## %bb.8:
	movq	56(%rbx), %rcx
	movq	8(%rcx), %rdx
	testq	%rdx, %rdx
	je	LBB0_10
## %bb.9:
	movq	72(%rbx), %rax
	movq	80(%rbx), %r8
	movl	4(%rax), %ecx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$1, %r9d
	callq	_diva_os_register_io_port
	movq	64(%rbx), %rax
	movq	$0, 8(%rax)
	movq	56(%rbx), %rax
	movq	$0, 8(%rax)
	movq	64(%rbx), %rax
LBB0_10:
	cmpq	$0, 16(%rax)
	je	LBB0_13
## %bb.11:
	movq	56(%rbx), %rax
	movq	16(%rax), %rdx
	testq	%rdx, %rdx
	je	LBB0_13
## %bb.12:
	movq	72(%rbx), %rax
	movq	80(%rbx), %r8
	movl	8(%rax), %ecx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$2, %r9d
	callq	_diva_os_register_io_port
	movq	64(%rbx), %rax
	movq	$0, 16(%rax)
	movq	56(%rbx), %rax
	movq	$0, 16(%rax)
LBB0_13:
	leaq	24(%rbx), %r14
	movq	%r14, %rdi
	callq	_diva_os_cancel_soft_isr
	leaq	16(%rbx), %rdi
	callq	_diva_os_cancel_soft_isr
	movq	%r14, %rdi
	callq	_diva_os_remove_soft_isr
	movq	$0, 16(%rbx)
	leaq	12(%rbx), %rdi
	leaq	L_.str(%rip), %r14
	movq	%r14, %rsi
	callq	_diva_os_destroy_spin_lock
	leaq	8(%rbx), %rdi
	movq	%r14, %rsi
	callq	_diva_os_destroy_spin_lock
	movq	(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_15
## %bb.14:
	xorl	%edi, %edi
	callq	_diva_os_free
	movq	$0, (%rbx)
LBB0_15:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rm"

	.no_dead_strip	_diva_bri_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_bri_cleanup_adapter
_diva_bri_cleanup_adapter:              ; @diva_bri_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, #48]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_diva_bri_stop_adapter
LBB0_2:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_4
; %bb.3:
	ldr	w1, [x19, #40]
	mov	x0, x19
	bl	_diva_os_remove_irq
LBB0_4:
	str	xzr, [x19, #32]
	ldr	x8, [x19, #64]
	ldr	x0, [x8]
	cbz	x0, LBB0_7
; %bb.5:
	ldr	x9, [x19, #56]
	ldr	x9, [x9]
	cbz	x9, LBB0_7
; %bb.6:
	bl	_divasa_unmap_pci_bar
	ldr	x8, [x19, #64]
	str	xzr, [x8]
	ldp	x9, x8, [x19, #56]
	str	xzr, [x9]
LBB0_7:
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_10
; %bb.8:
	ldr	x9, [x19, #56]
	ldr	x2, [x9, #8]
	cbz	x2, LBB0_10
; %bb.9:
	ldp	x8, x4, [x19, #72]
	ldr	w3, [x8, #4]
	mov	x0, x19
	mov	w1, #0
	mov	w5, #1
	bl	_diva_os_register_io_port
	ldr	x8, [x19, #64]
	str	xzr, [x8, #8]
	ldp	x9, x8, [x19, #56]
	str	xzr, [x9, #8]
LBB0_10:
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_13
; %bb.11:
	ldr	x8, [x19, #56]
	ldr	x2, [x8, #16]
	cbz	x2, LBB0_13
; %bb.12:
	ldp	x8, x4, [x19, #72]
	ldr	w3, [x8, #8]
	mov	x0, x19
	mov	w1, #0
	mov	w5, #2
	bl	_diva_os_register_io_port
	ldr	x8, [x19, #64]
	str	xzr, [x8, #16]
	ldr	x8, [x19, #56]
	str	xzr, [x8, #16]
LBB0_13:
	add	x20, x19, #24
	mov	x0, x20
	bl	_diva_os_cancel_soft_isr
	add	x0, x19, #16
	bl	_diva_os_cancel_soft_isr
	mov	x0, x20
	bl	_diva_os_remove_soft_isr
	str	xzr, [x19, #16]
	add	x0, x19, #12
Lloh0:
	adrp	x20, l_.str@PAGE
Lloh1:
	add	x20, x20, l_.str@PAGEOFF
	mov	x1, x20
	bl	_diva_os_destroy_spin_lock
	add	x0, x19, #8
	mov	x1, x20
	bl	_diva_os_destroy_spin_lock
	ldr	x1, [x19]
	cbz	x1, LBB0_15
; %bb.14:
	mov	w0, #0
	bl	_diva_os_free
	str	xzr, [x19]
LBB0_15:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rm"

	.no_dead_strip	_diva_bri_cleanup_adapter
.subsections_via_symbols
