	.file	"extr_t4_main.c_t4_detach_common.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"failed to detach child devices: %d\n"
	.text
	.p2align 4
	.globl	t4_detach_common
	.type	t4_detach_common, @function
t4_detach_common:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13d, edi
	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
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	device_get_softc@PLT
	mov	rdi, QWORD PTR 280[rax]
	mov	rbp, rax
	test	rdi, rdi
	je	.L2
	call	destroy_dev@PLT
	mov	QWORD PTR 280[rbp], 0
.L2:
	lea	rdi, t4_list_lock[rip]
	call	sx_xlock@PLT
	mov	ecx, DWORD PTR link[rip]
	mov	rsi, rbp
	mov	edx, DWORD PTR adapter[rip]
	lea	rdi, t4_list[rip]
	call	SLIST_REMOVE@PLT
	lea	rdi, t4_list_lock[rip]
	call	sx_xunlock@PLT
	mov	eax, DWORD PTR CHK_MBOX_ACCESS[rip]
	not	eax
	and	eax, DWORD PTR 0[rbp]
	mov	DWORD PTR 0[rbp], eax
	test	DWORD PTR FULL_INIT_DONE[rip], eax
	je	.L3
	test	DWORD PTR IS_VF[rip], eax
	je	.L90
.L3:
	mov	edi, r13d
	call	device_is_attached@PLT
	test	rax, rax
	jne	.L4
.L8:
	mov	ecx, DWORD PTR 4[rbp]
	xor	ebx, ebx
	test	ecx, ecx
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rsi, rbx
	mov	rdi, rbp
	add	rbx, 1
	sal	rsi, 5
	add	rsi, QWORD PTR 184[rbp]
	call	t4_free_irq@PLT
	cmp	DWORD PTR 4[rbp], ebx
	jg	.L5
.L6:
	mov	edx, DWORD PTR FW_OK[rip]
	mov	eax, DWORD PTR IS_VF[rip]
	or	eax, edx
	and	eax, DWORD PTR 0[rbp]
	cmp	edx, eax
	je	.L91
.L10:
	mov	edx, DWORD PTR MAX_NPORTS[rip]
	xor	ebx, ebx
	test	edx, edx
	jg	.L12
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L16:
	lea	rdi, 8[r12]
	call	mtx_destroy@PLT
	mov	esi, DWORD PTR M_CXGBE[rip]
	mov	rdi, QWORD PTR [r12]
	call	free@PLT
	mov	esi, DWORD PTR M_CXGBE[rip]
	mov	rdi, r12
	call	free@PLT
.L15:
	add	rbx, 1
	cmp	DWORD PTR MAX_NPORTS[rip], ebx
	jle	.L17
.L12:
	mov	rax, QWORD PTR 272[rbp]
	mov	r12, QWORD PTR [rax+rbx*8]
	test	r12, r12
	je	.L15
	mov	rax, QWORD PTR [r12]
	mov	esi, DWORD PTR 260[rbp]
	xor	ecx, ecx
	mov	rdi, rbp
	mov	edx, DWORD PTR 264[rbp]
	mov	r8d, DWORD PTR 24[rax]
	call	t4_free_vi@PLT
	mov	rsi, QWORD PTR 16[r12]
	test	rsi, rsi
	je	.L16
	mov	edi, r13d
	call	device_delete_child@PLT
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L17:
	mov	edi, r13d
	call	device_delete_children@PLT
	mov	edx, DWORD PTR 0[rbp]
	test	DWORD PTR FULL_INIT_DONE[rip], edx
	jne	.L92
.L14:
	mov	ecx, DWORD PTR FW_OK[rip]
	mov	eax, DWORD PTR IS_VF[rip]
	or	eax, ecx
	and	eax, edx
	cmp	ecx, eax
	je	.L93
.L18:
	mov	rax, QWORD PTR 8[rbp]
	cmp	rax, QWORD PTR INTR_MSI[rip]
	je	.L19
	cmp	rax, QWORD PTR INTR_MSIX[rip]
	je	.L19
	mov	rcx, QWORD PTR 248[rbp]
	test	rcx, rcx
	jne	.L94
.L21:
	mov	rcx, QWORD PTR 232[rbp]
	test	rcx, rcx
	jne	.L95
.L22:
	mov	rcx, QWORD PTR 216[rbp]
	test	rcx, rcx
	jne	.L96
.L23:
	mov	rdi, QWORD PTR 208[rbp]
	test	rdi, rdi
	jne	.L97
.L24:
	mov	rdi, QWORD PTR 200[rbp]
	test	rdi, rdi
	jne	.L98
.L25:
	mov	rdi, rbp
	call	t4_free_atid_table@PLT
	mov	rdi, QWORD PTR 192[rbp]
	test	rdi, rdi
	jne	.L99
.L26:
	mov	rdi, QWORD PTR 184[rbp]
	mov	esi, DWORD PTR M_CXGBE[rip]
	lea	r12, 56[rbp]
	lea	r13, 64[rbp]
	call	free@PLT
	mov	rdi, QWORD PTR 144[rbp]
	mov	esi, DWORD PTR M_CXGBE[rip]
	call	free@PLT
	mov	rdi, QWORD PTR 136[rbp]
	mov	esi, DWORD PTR M_CXGBE[rip]
	call	free@PLT
	mov	rdi, QWORD PTR 128[rbp]
	mov	esi, DWORD PTR M_CXGBE[rip]
	call	free@PLT
	mov	rdi, QWORD PTR 120[rbp]
	mov	esi, DWORD PTR M_CXGBE[rip]
	call	free@PLT
	mov	rdi, QWORD PTR 112[rbp]
	mov	esi, DWORD PTR M_CXGBE[rip]
	call	free@PLT
	mov	rdi, QWORD PTR 88[rbp]
	mov	esi, DWORD PTR M_CXGBE[rip]
	call	free@PLT
	mov	esi, DWORD PTR M_CXGBE[rip]
	mov	rdi, QWORD PTR 80[rbp]
	call	free@PLT
	mov	rdi, r12
	call	free_hftid_hash@PLT
	mov	rdi, QWORD PTR 72[rbp]
	mov	esi, DWORD PTR M_CXGBE[rip]
	call	free@PLT
	mov	esi, DWORD PTR M_CXGBE[rip]
	mov	rdi, QWORD PTR 104[rbp]
	call	free@PLT
	mov	rdi, rbp
	call	t4_destroy_dma_tag@PLT
	lea	rdi, 96[rbp]
	call	callout_drain@PLT
	mov	rdi, r13
	call	mtx_initialized@PLT
	test	rax, rax
	jne	.L100
.L27:
	mov	rdi, r12
	call	mtx_initialized@PLT
	test	rax, rax
	jne	.L101
.L28:
	lea	r12, 52[rbp]
	mov	rdi, r12
	call	mtx_initialized@PLT
	test	rax, rax
	jne	.L102
.L29:
	lea	r12, 48[rbp]
	mov	rdi, r12
	call	rw_initialized@PLT
	test	rax, rax
	jne	.L103
.L30:
	mov	eax, DWORD PTR NUM_MEMWIN[rip]
	xor	r12d, r12d
	test	eax, eax
	jg	.L31
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L32:
	add	r12, 1
	cmp	DWORD PTR NUM_MEMWIN[rip], r12d
	jle	.L33
.L31:
	mov	rax, QWORD PTR 32[rbp]
	lea	r13, [rax+r12*4]
	mov	rdi, r13
	call	rw_initialized@PLT
	test	rax, rax
	je	.L32
	mov	rdi, r13
	add	r12, 1
	call	rw_destroy@PLT
	cmp	DWORD PTR NUM_MEMWIN[rip], r12d
	jg	.L31
.L33:
	lea	rdi, 24[rbp]
	xor	r12d, r12d
	call	mtx_destroy@PLT
	lea	rdi, 20[rbp]
	call	mtx_destroy@PLT
	lea	rdi, 16[rbp]
	call	mtx_destroy@PLT
	mov	esi, 288
	mov	rdi, rbp
	call	bzero@PLT
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	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
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	mov	edi, r13d
	call	pci_release_msi@PLT
	mov	rcx, QWORD PTR 248[rbp]
	test	rcx, rcx
	je	.L21
.L94:
	mov	edx, DWORD PTR 256[rbp]
	mov	esi, DWORD PTR SYS_RES_MEMORY[rip]
	mov	edi, r13d
	call	bus_release_resource@PLT
	mov	rcx, QWORD PTR 232[rbp]
	test	rcx, rcx
	je	.L22
.L95:
	mov	edx, DWORD PTR 240[rbp]
	mov	esi, DWORD PTR SYS_RES_MEMORY[rip]
	mov	edi, r13d
	call	bus_release_resource@PLT
	mov	rcx, QWORD PTR 216[rbp]
	test	rcx, rcx
	je	.L23
.L96:
	mov	edx, DWORD PTR 224[rbp]
	mov	esi, DWORD PTR SYS_RES_MEMORY[rip]
	mov	edi, r13d
	call	bus_release_resource@PLT
	mov	rdi, QWORD PTR 208[rbp]
	test	rdi, rdi
	je	.L24
.L97:
	call	t4_free_l2t@PLT
	mov	rdi, QWORD PTR 200[rbp]
	test	rdi, rdi
	je	.L25
.L98:
	call	t4_free_smt@PLT
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L4:
	mov	edi, r13d
	call	bus_generic_detach@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L8
	mov	edx, eax
	lea	rsi, .LC0[rip]
	mov	edi, r13d
	call	device_printf@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L92:
	mov	rdi, rbp
	call	adapter_full_uninit@PLT
	mov	edx, DWORD PTR 0[rbp]
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L103:
	mov	rdi, r12
	call	rw_destroy@PLT
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L102:
	mov	rdi, r12
	call	mtx_destroy@PLT
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L101:
	mov	rdi, r12
	call	mtx_destroy@PLT
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L100:
	mov	rdi, r13
	call	mtx_destroy@PLT
	lea	rdi, 60[rbp]
	call	cv_destroy@PLT
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L99:
	call	vmem_destroy@PLT
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L90:
	mov	rdi, rbp
	call	t4_intr_disable@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L91:
	mov	rdi, rbp
	call	t4_free_tx_sched@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L93:
	mov	esi, DWORD PTR 260[rbp]
	mov	rdi, rbp
	call	t4_fw_bye@PLT
	jmp	.L18
	.cfi_endproc
.LFE0:
	.size	t4_detach_common, .-t4_detach_common
	.comm	t4_list_lock,4,4
	.comm	t4_list,4,4
	.comm	link,4,4
	.comm	adapter,4,4
	.comm	SYS_RES_MEMORY,4,4
	.comm	NUM_MEMWIN,4,4
	.comm	M_CXGBE,4,4
	.comm	MAX_NPORTS,4,4
	.comm	IS_VF,4,4
	.comm	INTR_MSIX,8,8
	.comm	INTR_MSI,8,8
	.comm	FW_OK,4,4
	.comm	FULL_INIT_DONE,4,4
	.comm	CHK_MBOX_ACCESS,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_t4_main.c_t4_detach_common.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"failed to detach child devices: %d\012\000"
	.text
	.align	2
	.global	t4_detach_common
	.syntax unified
	.arm
	.fpu softvfp
	.type	t4_detach_common, %function
t4_detach_common:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #12
	mov	r9, r0
	bl	device_get_softc
	mov	r4, r0
	ldr	r0, [r0, #160]
	cmp	r0, #0
	beq	.L2
	bl	destroy_dev
	mov	r3, #0
	str	r3, [r4, #160]
.L2:
	ldr	r0, .L102
	bl	sx_xlock
	ldr	r3, .L102+4
	ldr	r2, .L102+8
	mov	r1, r4
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r0, .L102+12
	bl	SLIST_REMOVE
	ldr	r0, .L102
	bl	sx_xunlock
	ldr	r3, .L102+16
	ldr	r10, .L102+20
	ldr	r1, [r3]
	ldr	r3, [r4]
	ldr	r2, [r10]
	bic	r3, r3, r1
	tst	r3, r2
	str	r3, [r4]
	beq	.L3
	ldr	r2, .L102+24
	ldr	r2, [r2]
	tst	r3, r2
	beq	.L87
.L3:
	mov	r0, r9
	bl	device_is_attached
	cmp	r0, #0
	bne	.L4
.L8:
	ldr	r3, [r4, #4]
	cmp	r3, #0
	movgt	r5, #0
	ble	.L6
.L5:
	ldr	r1, [r4, #108]
	mov	r0, r4
	add	r1, r1, r5, lsl #4
	bl	t4_free_irq
	ldr	r3, [r4, #4]
	add	r5, r5, #1
	cmp	r3, r5
	bgt	.L5
.L6:
	ldr	fp, .L102+28
	ldr	r3, .L102+24
	ldr	r2, [fp]
	ldr	r3, [r3]
	ldr	r1, [r4]
	orr	r3, r2, r3
	and	r3, r3, r1
	cmp	r2, r3
	beq	.L88
.L10:
	ldr	r8, .L102+32
	ldr	r3, [r8]
	cmp	r3, #0
	movgt	r6, #0
	ldrgt	r7, .L102+36
	bgt	.L12
	b	.L89
.L16:
	add	r0, r5, #4
	bl	mtx_destroy
	ldr	r1, [r7]
	ldr	r0, [r5]
	bl	free
	mov	r0, r5
	ldr	r1, [r7]
	bl	free
.L15:
	ldr	r3, [r8]
	cmp	r3, r6
	ble	.L17
.L12:
	ldr	r3, [r4, #156]
	ldr	r5, [r3, r6, lsl #2]
	add	r6, r6, #1
	cmp	r5, #0
	beq	.L15
	ldr	r3, [r5]
	ldr	r1, [r4, #148]
	ldr	r3, [r3, #12]
	ldr	r2, [r4, #152]
	mov	r0, r4
	str	r3, [sp]
	mov	r3, #0
	bl	t4_free_vi
	ldr	r1, [r5, #8]
	cmp	r1, #0
	beq	.L16
	mov	r0, r9
	bl	device_delete_child
	b	.L16
.L89:
	ldr	r7, .L102+36
.L17:
	mov	r0, r9
	bl	device_delete_children
	ldr	r3, [r10]
	ldr	r2, [r4]
	tst	r2, r3
	bne	.L90
.L14:
	ldr	r3, .L102+24
	ldr	r1, [fp]
	ldr	r3, [r3]
	orr	r3, r1, r3
	and	r3, r3, r2
	cmp	r1, r3
	beq	.L91
.L18:
	ldr	r2, .L102+40
	ldr	r3, [r4, #8]
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L19
	ldr	r2, .L102+44
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L19
	ldr	r3, [r4, #140]
	cmp	r3, #0
	bne	.L92
.L21:
	ldr	r3, [r4, #132]
	cmp	r3, #0
	bne	.L93
.L22:
	ldr	r3, [r4, #124]
	cmp	r3, #0
	bne	.L94
.L23:
	ldr	r0, [r4, #120]
	cmp	r0, #0
	bne	.L95
.L24:
	ldr	r0, [r4, #116]
	cmp	r0, #0
	bne	.L96
.L25:
	mov	r0, r4
	bl	t4_free_atid_table
	ldr	r0, [r4, #112]
	cmp	r0, #0
	bne	.L97
.L26:
	ldr	r1, [r7]
	ldr	r0, [r4, #108]
	bl	free
	ldr	r1, [r7]
	ldr	r0, [r4, #88]
	bl	free
	ldr	r1, [r7]
	ldr	r0, [r4, #84]
	bl	free
	ldr	r1, [r7]
	ldr	r0, [r4, #80]
	bl	free
	ldr	r1, [r7]
	ldr	r0, [r4, #76]
	bl	free
	ldr	r1, [r7]
	ldr	r0, [r4, #72]
	bl	free
	ldr	r1, [r7]
	ldr	r0, [r4, #60]
	bl	free
	add	r5, r4, #40
	ldr	r1, [r7]
	ldr	r0, [r4, #56]
	bl	free
	mov	r0, r5
	bl	free_hftid_hash
	ldr	r1, [r7]
	ldr	r0, [r4, #52]
	bl	free
	ldr	r1, [r7]
	ldr	r0, [r4, #68]
	bl	free
	mov	r0, r4
	bl	t4_destroy_dma_tag
	add	r6, r4, #48
	add	r0, r4, #64
	bl	callout_drain
	mov	r0, r6
	bl	mtx_initialized
	cmp	r0, #0
	bne	.L98
.L27:
	mov	r0, r5
	bl	mtx_initialized
	cmp	r0, #0
	bne	.L99
.L28:
	add	r5, r4, #36
	mov	r0, r5
	bl	mtx_initialized
	cmp	r0, #0
	bne	.L100
.L29:
	add	r5, r4, #32
	mov	r0, r5
	bl	rw_initialized
	cmp	r0, #0
	bne	.L101
.L30:
	ldr	r7, .L102+48
	ldr	r3, [r7]
	cmp	r3, #0
	movgt	r6, #0
	bgt	.L31
	b	.L33
.L32:
	ldr	r3, [r7]
	cmp	r3, r6
	ble	.L33
.L31:
	ldr	r5, [r4, #24]
	add	r5, r5, r6, lsl #2
	mov	r0, r5
	bl	rw_initialized
	cmp	r0, #0
	add	r6, r6, #1
	beq	.L32
	mov	r0, r5
	bl	rw_destroy
	ldr	r3, [r7]
	cmp	r3, r6
	bgt	.L31
.L33:
	add	r0, r4, #20
	bl	mtx_destroy
	add	r0, r4, #16
	bl	mtx_destroy
	add	r0, r4, #12
	bl	mtx_destroy
	mov	r0, r4
	mov	r1, #164
	bl	bzero
	mov	r5, #0
.L1:
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L19:
	mov	r0, r9
	bl	pci_release_msi
	ldr	r3, [r4, #140]
	cmp	r3, #0
	beq	.L21
.L92:
	ldr	r2, .L102+52
	mov	r0, r9
	ldr	r1, [r2]
	ldr	r2, [r4, #144]
	bl	bus_release_resource
	ldr	r3, [r4, #132]
	cmp	r3, #0
	beq	.L22
.L93:
	ldr	r2, .L102+52
	mov	r0, r9
	ldr	r1, [r2]
	ldr	r2, [r4, #136]
	bl	bus_release_resource
	ldr	r3, [r4, #124]
	cmp	r3, #0
	beq	.L23
.L94:
	ldr	r2, .L102+52
	mov	r0, r9
	ldr	r1, [r2]
	ldr	r2, [r4, #128]
	bl	bus_release_resource
	ldr	r0, [r4, #120]
	cmp	r0, #0
	beq	.L24
.L95:
	bl	t4_free_l2t
	ldr	r0, [r4, #116]
	cmp	r0, #0
	beq	.L25
.L96:
	bl	t4_free_smt
	b	.L25
.L4:
	mov	r0, r9
	bl	bus_generic_detach
	subs	r5, r0, #0
	beq	.L8
	mov	r0, r9
	mov	r2, r5
	ldr	r1, .L102+56
	bl	device_printf
	b	.L1
.L101:
	mov	r0, r5
	bl	rw_destroy
	b	.L30
.L100:
	mov	r0, r5
	bl	mtx_destroy
	b	.L29
.L90:
	mov	r0, r4
	bl	adapter_full_uninit
	ldr	r2, [r4]
	b	.L14
.L99:
	mov	r0, r5
	bl	mtx_destroy
	b	.L28
.L98:
	mov	r0, r6
	bl	mtx_destroy
	add	r0, r4, #44
	bl	cv_destroy
	b	.L27
.L97:
	bl	vmem_destroy
	b	.L26
.L87:
	mov	r0, r4
	bl	t4_intr_disable
	b	.L3
.L91:
	mov	r0, r4
	ldr	r1, [r4, #148]
	bl	t4_fw_bye
	b	.L18
.L88:
	mov	r0, r4
	bl	t4_free_tx_sched
	b	.L10
.L103:
	.align	2
.L102:
	.word	t4_list_lock
	.word	link
	.word	adapter
	.word	t4_list
	.word	CHK_MBOX_ACCESS
	.word	FULL_INIT_DONE
	.word	IS_VF
	.word	FW_OK
	.word	MAX_NPORTS
	.word	M_CXGBE
	.word	INTR_MSI
	.word	INTR_MSIX
	.word	NUM_MEMWIN
	.word	SYS_RES_MEMORY
	.word	.LC0
	.size	t4_detach_common, .-t4_detach_common
	.comm	t4_list_lock,4,4
	.comm	t4_list,4,4
	.comm	link,4,4
	.comm	adapter,4,4
	.comm	SYS_RES_MEMORY,4,4
	.comm	NUM_MEMWIN,4,4
	.comm	M_CXGBE,4,4
	.comm	MAX_NPORTS,4,4
	.comm	IS_VF,4,4
	.comm	INTR_MSIX,4,4
	.comm	INTR_MSI,4,4
	.comm	FW_OK,4,4
	.comm	FULL_INIT_DONE,4,4
	.comm	CHK_MBOX_ACCESS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
