	.file	"extr_if_cpsw.c_cpsw_detach.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Unable to destroy DMA tag"
	.text
	.p2align 4
	.type	cpsw_detach, @function
cpsw_detach:
.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
	mov	r12d, edi
	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	bus_generic_detach@PLT
	mov	edi, r12d
	call	device_get_softc@PLT
	mov	rbp, rax
	mov	eax, DWORD PTR CPSW_PORTS[rip]
	test	eax, eax
	jle	.L2
	xor	ebx, ebx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	add	rbx, 1
	cmp	DWORD PTR CPSW_PORTS[rip], ebx
	jle	.L2
.L4:
	mov	rax, QWORD PTR 64[rbp]
	mov	rsi, QWORD PTR [rax+rbx*8]
	test	rsi, rsi
	je	.L3
	mov	edi, r12d
	add	rbx, 1
	call	device_delete_child@PLT
	cmp	DWORD PTR CPSW_PORTS[rip], ebx
	jg	.L4
.L2:
	mov	edi, r12d
	call	device_is_attached@PLT
	test	rax, rax
	jne	.L30
.L5:
	mov	rdi, rbp
	xor	ebx, ebx
	call	cpsw_intr_detach@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rax, QWORD PTR 48[rbp]
	mov	rdi, rbp
	lea	rsi, [rax+rbx*4]
	add	rbx, 1
	call	cpsw_free_slot@PLT
.L6:
	mov	rdi, QWORD PTR 48[rbp]
	call	nitems@PLT
	cmp	eax, ebx
	jg	.L7
	mov	rdi, QWORD PTR 40[rbp]
	test	rdi, rdi
	jne	.L31
.L8:
	mov	rdi, QWORD PTR 32[rbp]
	test	rdi, rdi
	jne	.L32
.L9:
	mov	rcx, QWORD PTR 16[rbp]
	test	rcx, rcx
	je	.L10
	mov	edx, DWORD PTR 24[rbp]
	mov	esi, DWORD PTR SYS_RES_MEMORY[rip]
	mov	edi, r12d
	call	bus_release_resource@PLT
.L10:
	mov	edx, DWORD PTR 8[rbp]
	mov	esi, DWORD PTR irq_res_spec[rip]
	mov	edi, r12d
	call	bus_release_resources@PLT
	lea	rdi, 4[rbp]
	call	mtx_destroy@PLT
	mov	rdi, rbp
	call	mtx_destroy@PLT
	mov	edi, r12d
	call	bus_generic_detach@PLT
	test	eax, eax
	je	.L33
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L33:
	.cfi_restore_state
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	edi, 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
	jmp	device_delete_children@PLT
	.p2align 4,,10
	.p2align 3
.L32:
	.cfi_restore_state
	call	bus_dma_tag_destroy@PLT
	xor	edi, edi
	lea	rsi, .LC0[rip]
	test	eax, eax
	sete	dil
	call	KASSERT@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L31:
	mov	esi, DWORD PTR M_DEVBUF[rip]
	call	free@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L30:
	lea	r13, 56[rbp]
	mov	rdi, r13
	call	callout_stop@PLT
	mov	rdi, r13
	call	callout_drain@PLT
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	cpsw_detach, .-cpsw_detach
	.comm	irq_res_spec,4,4
	.comm	SYS_RES_MEMORY,4,4
	.comm	M_DEVBUF,4,4
	.comm	CPSW_PORTS,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_if_cpsw.c_cpsw_detach.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Unable to destroy DMA tag\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	cpsw_detach, %function
cpsw_detach:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r6, r0
	bl	bus_generic_detach
	mov	r0, r6
	bl	device_get_softc
	ldr	r7, .L33
	mov	r4, r0
	ldr	r3, [r7]
	cmp	r3, #0
	ble	.L2
	mov	r5, #0
	b	.L4
.L3:
	ldr	r3, [r7]
	cmp	r3, r5
	ble	.L2
.L4:
	ldr	r3, [r4, #36]
	ldr	r1, [r3, r5, lsl #2]
	add	r5, r5, #1
	cmp	r1, #0
	beq	.L3
	mov	r0, r6
	bl	device_delete_child
	ldr	r3, [r7]
	cmp	r3, r5
	bgt	.L4
.L2:
	mov	r0, r6
	bl	device_is_attached
	cmp	r0, #0
	bne	.L30
.L5:
	mov	r0, r4
	bl	cpsw_intr_detach
	mov	r5, #0
	b	.L6
.L7:
	ldr	r1, [r4, #28]
	mov	r0, r4
	add	r1, r1, r5, lsl #2
	bl	cpsw_free_slot
	add	r5, r5, #1
.L6:
	ldr	r0, [r4, #28]
	bl	nitems
	cmp	r0, r5
	bgt	.L7
	ldr	r0, [r4, #24]
	cmp	r0, #0
	bne	.L31
.L8:
	ldr	r0, [r4, #20]
	cmp	r0, #0
	bne	.L32
.L9:
	ldr	r3, [r4, #12]
	cmp	r3, #0
	beq	.L10
	ldr	r2, .L33+4
	mov	r0, r6
	ldr	r1, [r2]
	ldr	r2, [r4, #16]
	bl	bus_release_resource
.L10:
	ldr	r3, .L33+8
	ldr	r2, [r4, #8]
	ldr	r1, [r3]
	mov	r0, r6
	bl	bus_release_resources
	add	r0, r4, #4
	bl	mtx_destroy
	mov	r0, r4
	bl	mtx_destroy
	mov	r0, r6
	bl	bus_generic_detach
	cmp	r0, #0
	popne	{r4, r5, r6, r7, r8, pc}
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, lr}
	b	device_delete_children
.L32:
	bl	bus_dma_tag_destroy
	clz	r0, r0
	ldr	r1, .L33+12
	lsr	r0, r0, #5
	bl	KASSERT
	b	.L9
.L31:
	ldr	r3, .L33+16
	ldr	r1, [r3]
	bl	free
	b	.L8
.L30:
	add	r5, r4, #32
	mov	r0, r5
	bl	callout_stop
	mov	r0, r5
	bl	callout_drain
	b	.L5
.L34:
	.align	2
.L33:
	.word	CPSW_PORTS
	.word	SYS_RES_MEMORY
	.word	irq_res_spec
	.word	.LC0
	.word	M_DEVBUF
	.size	cpsw_detach, .-cpsw_detach
	.comm	irq_res_spec,4,4
	.comm	SYS_RES_MEMORY,4,4
	.comm	M_DEVBUF,4,4
	.comm	CPSW_PORTS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
