	.file	"extr_sbp2.c_sbp2_remove_device.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	sbp2_remove_device, @function
sbp2_remove_device:
.LFB0:
	.cfi_startproc
	endbr64
	test	rdi, rdi
	je	.L1
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, QWORD PTR 128[rdi]
	test	rbx, rbx
	je	.L3
	mov	rdi, QWORD PTR 120[rdi]
	test	rdi, rdi
	jne	.L40
.L4:
	xor	eax, eax
	xor	r12d, r12d
	call	flush_scheduled_work@PLT
	mov	rsi, QWORD PTR [rbx]
	mov	rdi, rbp
	call	sbp2util_remove_command_orb_pool@PLT
	mov	rsi, r12
	lea	rdi, sbp2_hi_logical_units_lock[rip]
	call	write_lock_irqsave@PLT
	lea	rdi, 112[rbp]
	call	list_del@PLT
	mov	rsi, r12
	lea	rdi, sbp2_hi_logical_units_lock[rip]
	call	write_unlock_irqrestore@PLT
	mov	rdx, QWORD PTR 104[rbp]
	test	rdx, rdx
	jne	.L41
	mov	rdx, QWORD PTR 88[rbp]
	test	rdx, rdx
	jne	.L42
.L6:
	mov	rdx, QWORD PTR 72[rbp]
	test	rdx, rdx
	jne	.L43
.L7:
	mov	rdx, QWORD PTR 56[rbp]
	test	rdx, rdx
	jne	.L44
.L8:
	mov	rdx, QWORD PTR 40[rbp]
	test	rdx, rdx
	jne	.L45
.L9:
	mov	rdx, QWORD PTR 24[rbp]
	test	rdx, rdx
	jne	.L46
.L10:
	mov	rdx, QWORD PTR 0[rbp]
	cmp	rdx, QWORD PTR CSR1212_INVALID_ADDR_SPACE[rip]
	jne	.L47
.L11:
	mov	rdi, QWORD PTR 8[rbp]
	xor	esi, esi
	call	dev_set_drvdata@PLT
	mov	rax, QWORD PTR [rbx]
	mov	rax, QWORD PTR [rax]
	mov	edi, DWORD PTR [rax]
	call	module_put@PLT
.L3:
	pop	rbx
	.cfi_remember_state
	.cfi_restore 3
	.cfi_def_cfa_offset 24
	mov	rdi, rbp
	pop	rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_restore 12
	.cfi_def_cfa_offset 8
	jmp	kfree@PLT
	.p2align 4,,10
	.p2align 3
.L47:
	.cfi_restore_state
	mov	rsi, QWORD PTR [rbx]
	lea	rdi, sbp2_highlevel[rip]
	call	hpsb_unregister_addrspace@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L46:
	mov	rax, QWORD PTR [rbx]
	mov	ecx, DWORD PTR 16[rbp]
	mov	esi, 4
	mov	edi, DWORD PTR 8[rax]
	call	dma_free_coherent@PLT
	mov	rdx, QWORD PTR 0[rbp]
	cmp	rdx, QWORD PTR CSR1212_INVALID_ADDR_SPACE[rip]
	je	.L11
	jmp	.L47
	.p2align 4,,10
	.p2align 3
.L45:
	mov	rax, QWORD PTR [rbx]
	mov	ecx, DWORD PTR 32[rbp]
	mov	esi, 4
	mov	edi, DWORD PTR 8[rax]
	call	dma_free_coherent@PLT
	mov	rdx, QWORD PTR 24[rbp]
	test	rdx, rdx
	je	.L10
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L44:
	mov	rax, QWORD PTR [rbx]
	mov	ecx, DWORD PTR 48[rbp]
	mov	esi, 4
	mov	edi, DWORD PTR 8[rax]
	call	dma_free_coherent@PLT
	mov	rdx, QWORD PTR 40[rbp]
	test	rdx, rdx
	je	.L9
	jmp	.L45
	.p2align 4,,10
	.p2align 3
.L43:
	mov	rax, QWORD PTR [rbx]
	mov	ecx, DWORD PTR 64[rbp]
	mov	esi, 4
	mov	edi, DWORD PTR 8[rax]
	call	dma_free_coherent@PLT
	mov	rdx, QWORD PTR 56[rbp]
	test	rdx, rdx
	je	.L8
	jmp	.L44
	.p2align 4,,10
	.p2align 3
.L42:
	mov	rax, QWORD PTR [rbx]
	mov	ecx, DWORD PTR 80[rbp]
	mov	esi, 4
	mov	edi, DWORD PTR 8[rax]
	call	dma_free_coherent@PLT
	mov	rdx, QWORD PTR 72[rbp]
	test	rdx, rdx
	je	.L7
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L41:
	mov	rax, QWORD PTR [rbx]
	mov	ecx, DWORD PTR 96[rbp]
	mov	esi, 4
	mov	edi, DWORD PTR 8[rax]
	call	dma_free_coherent@PLT
	mov	rdx, QWORD PTR 88[rbp]
	test	rdx, rdx
	je	.L6
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L40:
	call	scsi_remove_host@PLT
	mov	rdi, QWORD PTR 120[rbp]
	call	scsi_host_put@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L1:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	ret
	.cfi_endproc
.LFE0:
	.size	sbp2_remove_device, .-sbp2_remove_device
	.comm	sbp2_highlevel,4,4
	.comm	sbp2_hi_logical_units_lock,4,4
	.comm	CSR1212_INVALID_ADDR_SPACE,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_sbp2.c_sbp2_remove_device.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sbp2_remove_device, %function
sbp2_remove_device:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	subs	r4, r0, #0
	popeq	{r4, r5, r6, pc}
	ldr	r5, [r4, #64]
	cmp	r5, #0
	beq	.L3
	ldr	r0, [r4, #60]
	cmp	r0, #0
	bne	.L38
.L4:
	mov	r6, #0
	bl	flush_scheduled_work
	ldr	r1, [r5]
	mov	r0, r4
	bl	sbp2util_remove_command_orb_pool
	mov	r1, r6
	ldr	r0, .L46
	bl	write_lock_irqsave
	add	r0, r4, #56
	bl	list_del
	mov	r1, r6
	ldr	r0, .L46
	bl	write_unlock_irqrestore
	ldr	r2, [r4, #52]
	cmp	r2, r6
	bne	.L39
	ldr	r2, [r4, #44]
	cmp	r2, #0
	bne	.L40
.L6:
	ldr	r2, [r4, #36]
	cmp	r2, #0
	bne	.L41
.L7:
	ldr	r2, [r4, #28]
	cmp	r2, #0
	bne	.L42
.L8:
	ldr	r2, [r4, #20]
	cmp	r2, #0
	bne	.L43
.L9:
	ldr	r2, [r4, #12]
	cmp	r2, #0
	bne	.L44
.L10:
	ldr	r3, .L46+4
	ldr	r2, [r4]
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L45
.L11:
	mov	r1, #0
	ldr	r0, [r4, #4]
	bl	dev_set_drvdata
	ldr	r3, [r5]
	ldr	r3, [r3]
	ldr	r0, [r3]
	bl	module_put
.L3:
	mov	r0, r4
	pop	{r4, r5, r6, lr}
	b	kfree
.L45:
	ldr	r1, [r5]
	ldr	r0, .L46+8
	bl	hpsb_unregister_addrspace
	b	.L11
.L44:
	ldr	r3, [r5]
	mov	r1, #4
	ldr	r0, [r3, #4]
	ldr	r3, [r4, #8]
	bl	dma_free_coherent
	b	.L10
.L43:
	ldr	r3, [r5]
	mov	r1, #4
	ldr	r0, [r3, #4]
	ldr	r3, [r4, #16]
	bl	dma_free_coherent
	ldr	r2, [r4, #12]
	cmp	r2, #0
	beq	.L10
	b	.L44
.L42:
	ldr	r3, [r5]
	mov	r1, #4
	ldr	r0, [r3, #4]
	ldr	r3, [r4, #24]
	bl	dma_free_coherent
	ldr	r2, [r4, #20]
	cmp	r2, #0
	beq	.L9
	b	.L43
.L41:
	ldr	r3, [r5]
	mov	r1, #4
	ldr	r0, [r3, #4]
	ldr	r3, [r4, #32]
	bl	dma_free_coherent
	ldr	r2, [r4, #28]
	cmp	r2, #0
	beq	.L8
	b	.L42
.L40:
	ldr	r3, [r5]
	mov	r1, #4
	ldr	r0, [r3, #4]
	ldr	r3, [r4, #40]
	bl	dma_free_coherent
	ldr	r2, [r4, #36]
	cmp	r2, #0
	beq	.L7
	b	.L41
.L39:
	ldr	r3, [r5]
	mov	r1, #4
	ldr	r0, [r3, #4]
	ldr	r3, [r4, #48]
	bl	dma_free_coherent
	ldr	r2, [r4, #44]
	cmp	r2, #0
	beq	.L6
	b	.L40
.L38:
	bl	scsi_remove_host
	ldr	r0, [r4, #60]
	bl	scsi_host_put
	b	.L4
.L47:
	.align	2
.L46:
	.word	sbp2_hi_logical_units_lock
	.word	CSR1212_INVALID_ADDR_SPACE
	.word	sbp2_highlevel
	.size	sbp2_remove_device, .-sbp2_remove_device
	.comm	sbp2_highlevel,4,4
	.comm	sbp2_hi_logical_units_lock,4,4
	.comm	CSR1212_INVALID_ADDR_SPACE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
