	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sbp2_remove_device
_sbp2_remove_device:                    ## @sbp2_remove_device
	.cfi_startproc
## %bb.0:
	testq	%rdi, %rdi
	je	LBB0_20
## %bb.1:
	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, %rbx
	movq	128(%rdi), %r15
	testq	%r15, %r15
	je	LBB0_19
## %bb.2:
	movq	120(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.3:
	callq	_scsi_remove_host
	movq	120(%rbx), %rdi
	callq	_scsi_host_put
LBB0_4:
	xorl	%eax, %eax
	callq	_flush_scheduled_work
	movq	(%r15), %rsi
	movq	%rbx, %rdi
	callq	_sbp2util_remove_command_orb_pool
	movq	_sbp2_hi_logical_units_lock@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	callq	_write_lock_irqsave
	leaq	112(%rbx), %rdi
	callq	_list_del
	movq	%r14, %rdi
	callq	_write_unlock_irqrestore
	movq	104(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_6
## %bb.5:
	movq	(%r15), %rax
	movl	8(%rax), %edi
	movl	96(%rbx), %ecx
	movl	$4, %esi
	callq	_dma_free_coherent
LBB0_6:
	movq	88(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_8
## %bb.7:
	movq	(%r15), %rax
	movl	8(%rax), %edi
	movl	80(%rbx), %ecx
	movl	$4, %esi
	callq	_dma_free_coherent
LBB0_8:
	movq	72(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_10
## %bb.9:
	movq	(%r15), %rax
	movl	8(%rax), %edi
	movl	64(%rbx), %ecx
	movl	$4, %esi
	callq	_dma_free_coherent
LBB0_10:
	movq	56(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_12
## %bb.11:
	movq	(%r15), %rax
	movl	8(%rax), %edi
	movl	48(%rbx), %ecx
	movl	$4, %esi
	callq	_dma_free_coherent
LBB0_12:
	movq	40(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_14
## %bb.13:
	movq	(%r15), %rax
	movl	8(%rax), %edi
	movl	32(%rbx), %ecx
	movl	$4, %esi
	callq	_dma_free_coherent
LBB0_14:
	movq	24(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_16
## %bb.15:
	movq	(%r15), %rax
	movl	8(%rax), %edi
	movl	16(%rbx), %ecx
	movl	$4, %esi
	callq	_dma_free_coherent
LBB0_16:
	movq	(%rbx), %rdx
	movq	_CSR1212_INVALID_ADDR_SPACE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	je	LBB0_18
## %bb.17:
	movq	(%r15), %rsi
	movq	_sbp2_highlevel@GOTPCREL(%rip), %rdi
	callq	_hpsb_unregister_addrspace
LBB0_18:
	movq	8(%rbx), %rdi
	xorl	%esi, %esi
	callq	_dev_set_drvdata
	movq	(%r15), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_module_put
LBB0_19:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
LBB0_20:
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_sbp2_hi_logical_units_lock,4,2 ## @sbp2_hi_logical_units_lock
	.comm	_CSR1212_INVALID_ADDR_SPACE,8,3 ## @CSR1212_INVALID_ADDR_SPACE
	.comm	_sbp2_highlevel,4,2             ## @sbp2_highlevel
	.no_dead_strip	_sbp2_remove_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sbp2_remove_device
_sbp2_remove_device:                    ; @sbp2_remove_device
	.cfi_startproc
; %bb.0:
	cbz	x0, LBB0_20
; %bb.1:
	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
	ldr	x21, [x0, #128]
	cbz	x21, LBB0_19
; %bb.2:
	ldr	x0, [x19, #120]
	cbz	x0, LBB0_4
; %bb.3:
	bl	_scsi_remove_host
	ldr	x0, [x19, #120]
	bl	_scsi_host_put
LBB0_4:
	bl	_flush_scheduled_work
	ldr	x1, [x21]
	mov	x0, x19
	bl	_sbp2util_remove_command_orb_pool
Lloh0:
	adrp	x20, _sbp2_hi_logical_units_lock@GOTPAGE
Lloh1:
	ldr	x20, [x20, _sbp2_hi_logical_units_lock@GOTPAGEOFF]
	mov	x0, x20
	bl	_write_lock_irqsave
	add	x0, x19, #112
	bl	_list_del
	mov	x0, x20
	bl	_write_unlock_irqrestore
	ldr	x2, [x19, #104]
	cbz	x2, LBB0_6
; %bb.5:
	ldr	x8, [x21]
	ldr	w0, [x8, #8]
	ldr	w3, [x19, #96]
	mov	w1, #4
	bl	_dma_free_coherent
LBB0_6:
	ldr	x2, [x19, #88]
	cbz	x2, LBB0_8
; %bb.7:
	ldr	x8, [x21]
	ldr	w0, [x8, #8]
	ldr	w3, [x19, #80]
	mov	w1, #4
	bl	_dma_free_coherent
LBB0_8:
	ldr	x2, [x19, #72]
	cbz	x2, LBB0_10
; %bb.9:
	ldr	x8, [x21]
	ldr	w0, [x8, #8]
	ldr	w3, [x19, #64]
	mov	w1, #4
	bl	_dma_free_coherent
LBB0_10:
	ldr	x2, [x19, #56]
	cbz	x2, LBB0_12
; %bb.11:
	ldr	x8, [x21]
	ldr	w0, [x8, #8]
	ldr	w3, [x19, #48]
	mov	w1, #4
	bl	_dma_free_coherent
LBB0_12:
	ldr	x2, [x19, #40]
	cbz	x2, LBB0_14
; %bb.13:
	ldr	x8, [x21]
	ldr	w0, [x8, #8]
	ldr	w3, [x19, #32]
	mov	w1, #4
	bl	_dma_free_coherent
LBB0_14:
	ldr	x2, [x19, #24]
	cbz	x2, LBB0_16
; %bb.15:
	ldr	x8, [x21]
	ldr	w0, [x8, #8]
	ldr	w3, [x19, #16]
	mov	w1, #4
	bl	_dma_free_coherent
LBB0_16:
	ldr	x2, [x19]
Lloh2:
	adrp	x8, _CSR1212_INVALID_ADDR_SPACE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CSR1212_INVALID_ADDR_SPACE@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x2, x8
	b.eq	LBB0_18
; %bb.17:
	ldr	x1, [x21]
Lloh5:
	adrp	x0, _sbp2_highlevel@GOTPAGE
Lloh6:
	ldr	x0, [x0, _sbp2_highlevel@GOTPAGEOFF]
	bl	_hpsb_unregister_addrspace
LBB0_18:
	ldr	x0, [x19, #8]
	mov	x1, #0
	bl	_dev_set_drvdata
	ldr	x8, [x21]
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_module_put
LBB0_19:
	mov	x0, x19
	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
	b	_kfree
LBB0_20:
	.cfi_def_cfa wsp, 0
	.cfi_same_value w30
	.cfi_same_value w29
	.cfi_same_value w19
	.cfi_same_value w20
	.cfi_same_value w21
	.cfi_same_value w22
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_sbp2_hi_logical_units_lock,4,2 ; @sbp2_hi_logical_units_lock
	.comm	_CSR1212_INVALID_ADDR_SPACE,8,3 ; @CSR1212_INVALID_ADDR_SPACE
	.comm	_sbp2_highlevel,4,2             ; @sbp2_highlevel
	.no_dead_strip	_sbp2_remove_device
.subsections_via_symbols
