	.file	"extr_nvme_ctrlr.c_nvme_ctrlr_destruct.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	nvme_ctrlr_destruct
	.type	nvme_ctrlr_destruct, @function
nvme_ctrlr_destruct:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	cmp	QWORD PTR 8[rdi], 0
	je	.L2
	mov	r12d, esi
	mov	esi, DWORD PTR csts[rip]
	call	nvme_mmio_read_4@PLT
	mov	rdi, rbx
	mov	r13d, eax
	cmp	eax, -1
	je	.L44
	call	nvme_notify_fail_consumers@PLT
.L7:
	mov	edx, DWORD PTR NVME_MAX_NAMESPACES[rip]
	xor	ebp, ebp
	test	edx, edx
	jle	.L8
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rax, QWORD PTR 104[rbx]
	lea	rdi, [rax+rbp*4]
	add	rbp, 1
	call	nvme_ns_destruct@PLT
	cmp	DWORD PTR NVME_MAX_NAMESPACES[rip], ebp
	jg	.L4
.L8:
	mov	rdi, QWORD PTR 96[rbx]
	test	rdi, rdi
	jne	.L45
.L6:
	cmp	QWORD PTR 88[rbx], 0
	je	.L9
	cmp	r13d, -1
	jne	.L46
.L10:
	mov	eax, DWORD PTR [rbx]
	xor	ebp, ebp
	test	eax, eax
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rax, QWORD PTR 80[rbx]
	lea	rdi, [rax+rbp*4]
	add	rbp, 1
	call	nvme_io_qpair_destroy@PLT
	cmp	DWORD PTR [rbx], ebp
	jg	.L11
.L12:
	mov	rdi, QWORD PTR 80[rbx]
	mov	esi, DWORD PTR M_NVME[rip]
	call	free@PLT
	lea	rdi, 72[rbx]
	call	nvme_admin_qpair_destroy@PLT
.L9:
	cmp	r13d, -1
	je	.L13
	mov	rdi, rbx
	call	nvme_ctrlr_shutdown@PLT
	mov	rdi, rbx
	call	nvme_ctrlr_disable@PLT
.L13:
	mov	rdi, QWORD PTR 64[rbx]
	test	rdi, rdi
	jne	.L47
.L14:
	mov	rdx, QWORD PTR 56[rbx]
	mov	r13, QWORD PTR 40[rbx]
	test	rdx, rdx
	jne	.L48
.L15:
	test	r13, r13
	je	.L16
	mov	rdi, r13
	call	rman_get_rid@PLT
	mov	edi, DWORD PTR 48[rbx]
	mov	esi, DWORD PTR SYS_RES_IRQ[rip]
	mov	rcx, r13
	mov	edx, eax
	call	bus_release_resource@PLT
.L16:
	mov	rcx, QWORD PTR 24[rbx]
	mov	esi, DWORD PTR SYS_RES_MEMORY[rip]
	test	rcx, rcx
	je	.L17
	mov	edx, DWORD PTR 32[rbx]
	mov	edi, r12d
	call	bus_release_resource@PLT
	mov	esi, DWORD PTR SYS_RES_MEMORY[rip]
.L17:
	mov	rcx, QWORD PTR 8[rbx]
	mov	edx, DWORD PTR 16[rbx]
	mov	edi, r12d
	call	bus_release_resource@PLT
.L2:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	lea	rdi, 4[rbx]
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	jmp	mtx_destroy@PLT
	.p2align 4,,10
	.p2align 3
.L44:
	.cfi_restore_state
	call	nvme_ctrlr_fail@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L48:
	mov	edi, DWORD PTR 48[rbx]
	mov	rsi, r13
	call	bus_teardown_intr@PLT
	mov	r13, QWORD PTR 40[rbx]
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L47:
	call	taskqueue_free@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L45:
	call	destroy_dev@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L46:
	mov	rdi, rbx
	call	nvme_ctrlr_delete_qpairs@PLT
	jmp	.L10
	.cfi_endproc
.LFE0:
	.size	nvme_ctrlr_destruct, .-nvme_ctrlr_destruct
	.comm	csts,4,4
	.comm	SYS_RES_MEMORY,4,4
	.comm	SYS_RES_IRQ,4,4
	.comm	NVME_MAX_NAMESPACES,4,4
	.comm	M_NVME,4,4
	.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_nvme_ctrlr.c_nvme_ctrlr_destruct.c"
	.text
	.align	2
	.global	nvme_ctrlr_destruct
	.syntax unified
	.arm
	.fpu softvfp
	.type	nvme_ctrlr_destruct, %function
nvme_ctrlr_destruct:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, [r0, #8]
	push	{r4, r5, r6, r7, r8, lr}
	cmp	r3, #0
	mov	r4, r0
	beq	.L2
	ldr	r3, .L53
	mov	r7, r1
	ldr	r1, [r3]
	bl	nvme_mmio_read_4
	mov	r8, r0
	cmn	r8, #1
	mov	r0, r4
	beq	.L48
	bl	nvme_notify_fail_consumers
.L7:
	ldr	r6, .L53+4
	ldr	r3, [r6]
	cmp	r3, #0
	movgt	r5, #0
	ble	.L8
.L4:
	ldr	r0, [r4, #56]
	add	r0, r0, r5, lsl #2
	bl	nvme_ns_destruct
	ldr	r3, [r6]
	add	r5, r5, #1
	cmp	r3, r5
	bgt	.L4
.L8:
	ldr	r0, [r4, #52]
	cmp	r0, #0
	bne	.L49
.L6:
	ldr	r3, [r4, #48]
	cmp	r3, #0
	beq	.L9
	cmn	r8, #1
	bne	.L50
.L10:
	ldr	r3, [r4]
	cmp	r3, #0
	movgt	r5, #0
	ble	.L12
.L11:
	ldr	r0, [r4, #44]
	add	r0, r0, r5, lsl #2
	bl	nvme_io_qpair_destroy
	ldr	r3, [r4]
	add	r5, r5, #1
	cmp	r3, r5
	bgt	.L11
.L12:
	ldr	r3, .L53+8
	ldr	r0, [r4, #44]
	ldr	r1, [r3]
	bl	free
	add	r0, r4, #40
	bl	nvme_admin_qpair_destroy
.L9:
	cmn	r8, #1
	beq	.L13
	mov	r0, r4
	bl	nvme_ctrlr_shutdown
	mov	r0, r4
	bl	nvme_ctrlr_disable
.L13:
	ldr	r0, [r4, #36]
	cmp	r0, #0
	bne	.L51
.L14:
	ldr	r2, [r4, #32]
	ldr	r0, [r4, #24]
	cmp	r2, #0
	bne	.L52
.L15:
	cmp	r0, #0
	beq	.L16
	ldr	r3, .L53+12
	ldr	r5, [r4, #28]
	ldr	r6, [r3]
	bl	rman_get_rid
	mov	r1, r6
	mov	r2, r0
	ldr	r3, [r4, #24]
	mov	r0, r5
	bl	bus_release_resource
.L16:
	ldr	r3, [r4, #16]
	ldr	r5, .L53+16
	cmp	r3, #0
	ldr	r1, [r5]
	beq	.L17
	mov	r0, r7
	ldr	r2, [r4, #20]
	bl	bus_release_resource
	ldr	r1, [r5]
.L17:
	mov	r0, r7
	ldr	r3, [r4, #8]
	ldr	r2, [r4, #12]
	bl	bus_release_resource
.L2:
	add	r0, r4, #4
	pop	{r4, r5, r6, r7, r8, lr}
	b	mtx_destroy
.L48:
	bl	nvme_ctrlr_fail
	b	.L7
.L52:
	mov	r1, r0
	ldr	r0, [r4, #28]
	bl	bus_teardown_intr
	ldr	r0, [r4, #24]
	b	.L15
.L51:
	bl	taskqueue_free
	b	.L14
.L49:
	bl	destroy_dev
	b	.L6
.L50:
	mov	r0, r4
	bl	nvme_ctrlr_delete_qpairs
	b	.L10
.L54:
	.align	2
.L53:
	.word	csts
	.word	NVME_MAX_NAMESPACES
	.word	M_NVME
	.word	SYS_RES_IRQ
	.word	SYS_RES_MEMORY
	.size	nvme_ctrlr_destruct, .-nvme_ctrlr_destruct
	.comm	csts,4,4
	.comm	SYS_RES_MEMORY,4,4
	.comm	SYS_RES_IRQ,4,4
	.comm	NVME_MAX_NAMESPACES,4,4
	.comm	M_NVME,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
