	.file	"extr_ehci_pci.c_ehci_pci_detach.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Could not tear down irq, %d\n"
	.text
	.p2align 4
	.type	ehci_pci_detach, @function
ehci_pci_detach:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12d, edi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	device_get_softc@PLT
	mov	edi, r12d
	mov	rbp, rax
	call	device_delete_children@PLT
	mov	edi, r12d
	call	pci_disable_busmaster@PLT
	mov	rcx, QWORD PTR 16[rbp]
	test	rcx, rcx
	je	.L3
	cmp	QWORD PTR 24[rbp], 0
	je	.L4
	mov	rdi, rbp
	call	ehci_detach@PLT
	mov	rdx, QWORD PTR 24[rbp]
	mov	rsi, QWORD PTR 16[rbp]
	mov	edi, r12d
	call	bus_teardown_intr@PLT
	test	eax, eax
	jne	.L19
.L5:
	mov	rcx, QWORD PTR 16[rbp]
	mov	QWORD PTR 24[rbp], 0
	test	rcx, rcx
	je	.L3
.L4:
	mov	esi, DWORD PTR SYS_RES_IRQ[rip]
	xor	edx, edx
	mov	edi, r12d
	call	bus_release_resource@PLT
	mov	QWORD PTR 16[rbp], 0
.L3:
	mov	rcx, QWORD PTR 8[rbp]
	test	rcx, rcx
	je	.L7
	mov	edx, DWORD PTR PCI_CBMEM[rip]
	mov	esi, DWORD PTR SYS_RES_MEMORY[rip]
	mov	edi, r12d
	call	bus_release_resource@PLT
	mov	QWORD PTR 8[rbp], 0
.L7:
	mov	rdi, rbp
	lea	rsi, ehci_iterate_hw_softc[rip]
	call	usb_bus_mem_free_all@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	mov	edx, eax
	lea	rsi, .LC0[rip]
	mov	edi, r12d
	call	device_printf@PLT
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	ehci_pci_detach, .-ehci_pci_detach
	.comm	ehci_iterate_hw_softc,4,4
	.comm	SYS_RES_MEMORY,4,4
	.comm	SYS_RES_IRQ,4,4
	.comm	PCI_CBMEM,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_ehci_pci.c_ehci_pci_detach.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Could not tear down irq, %d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ehci_pci_detach, %function
ehci_pci_detach:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r5, r0
	bl	device_get_softc
	mov	r4, r0
	mov	r0, r5
	bl	device_delete_children
	mov	r0, r5
	bl	pci_disable_busmaster
	ldr	r3, [r4, #8]
	cmp	r3, #0
	beq	.L3
	ldr	r2, [r4, #12]
	cmp	r2, #0
	beq	.L4
	mov	r0, r4
	bl	ehci_detach
	ldr	r2, [r4, #12]
	mov	r0, r5
	ldr	r1, [r4, #8]
	bl	bus_teardown_intr
	subs	r2, r0, #0
	bne	.L22
.L5:
	mov	r2, #0
	ldr	r3, [r4, #8]
	str	r2, [r4, #12]
	cmp	r3, r2
	beq	.L3
.L4:
	ldr	r2, .L23
	mov	r0, r5
	ldr	r1, [r2]
	mov	r2, #0
	bl	bus_release_resource
	mov	r3, #0
	str	r3, [r4, #8]
.L3:
	ldr	r3, [r4, #4]
	cmp	r3, #0
	beq	.L7
	ldr	r2, .L23+4
	ldr	r1, .L23+8
	mov	r0, r5
	ldr	r2, [r2]
	ldr	r1, [r1]
	bl	bus_release_resource
	mov	r3, #0
	str	r3, [r4, #4]
.L7:
	mov	r0, r4
	ldr	r1, .L23+12
	bl	usb_bus_mem_free_all
	mov	r0, #0
	pop	{r4, r5, r6, pc}
.L22:
	mov	r0, r5
	ldr	r1, .L23+16
	bl	device_printf
	b	.L5
.L24:
	.align	2
.L23:
	.word	SYS_RES_IRQ
	.word	PCI_CBMEM
	.word	SYS_RES_MEMORY
	.word	ehci_iterate_hw_softc
	.word	.LC0
	.size	ehci_pci_detach, .-ehci_pci_detach
	.comm	ehci_iterate_hw_softc,4,4
	.comm	SYS_RES_MEMORY,4,4
	.comm	SYS_RES_IRQ,4,4
	.comm	PCI_CBMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
