	.file	"extr_generic_ehci.c_generic_ehci_attach.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Could not map memory\n"
.LC1:
	.string	"Could not allocate irq\n"
.LC2:
	.string	"usbus"
.LC3:
	.string	"Could not add USB device\n"
.LC4:
	.string	"Generic"
.LC5:
	.string	"Could not setup irq, %d\n"
	.text
	.p2align 4
	.globl	generic_ehci_attach
	.type	generic_ehci_attach, @function
generic_ehci_attach:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	ebp, edi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	sub	rsp, 16
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	device_get_softc@PLT
	mov	edi, ebp
	mov	DWORD PTR 20[rax], ebp
	mov	rbx, rax
	mov	eax, DWORD PTR 76[rax]
	mov	DWORD PTR 16[rbx], eax
	mov	eax, DWORD PTR EHCI_MAX_DEVICES[rip]
	mov	DWORD PTR [rbx], 32
	mov	DWORD PTR 12[rbx], eax
	call	USB_GET_DMA_TAG@PLT
	lea	rdx, ehci_iterate_hw_softc[rip]
	mov	rdi, rbx
	mov	esi, eax
	call	usb_bus_mem_alloc_all@PLT
	test	rax, rax
	je	.L2
	mov	eax, DWORD PTR ENOMEM[rip]
.L1:
	mov	rcx, QWORD PTR 8[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L14
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	eax, DWORD PTR USB_REV_2_0[rip]
	mov	ecx, DWORD PTR RF_ACTIVE[rip]
	lea	r12, 4[rsp]
	mov	edi, ebp
	mov	esi, DWORD PTR SYS_RES_MEMORY[rip]
	mov	rdx, r12
	mov	DWORD PTR 4[rsp], 0
	mov	DWORD PTR 8[rbx], eax
	call	bus_alloc_resource_any@PLT
	mov	QWORD PTR 56[rbx], rax
	mov	rdi, rax
	test	rax, rax
	je	.L15
	call	rman_get_bustag@PLT
	mov	rdi, QWORD PTR 56[rbx]
	mov	DWORD PTR 72[rbx], eax
	call	rman_get_bushandle@PLT
	mov	rdi, QWORD PTR 56[rbx]
	mov	DWORD PTR 68[rbx], eax
	call	rman_get_size@PLT
	mov	esi, DWORD PTR SYS_RES_IRQ[rip]
	mov	rdx, r12
	mov	edi, ebp
	mov	DWORD PTR 64[rbx], eax
	mov	ecx, DWORD PTR RF_SHAREABLE[rip]
	or	ecx, DWORD PTR RF_ACTIVE[rip]
	mov	DWORD PTR 4[rsp], 0
	call	bus_alloc_resource_any@PLT
	mov	QWORD PTR 40[rbx], rax
	test	rax, rax
	je	.L16
	mov	edi, ebp
	mov	edx, -1
	lea	rsi, .LC2[rip]
	call	device_add_child@PLT
	mov	DWORD PTR 4[rbx], eax
	mov	edi, eax
	test	eax, eax
	je	.L17
	mov	rsi, rbx
	call	device_set_ivars@PLT
	mov	edi, DWORD PTR 48[rbx]
	mov	edx, 4
	lea	rsi, .LC4[rip]
	call	strlcpy@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 56
	lea	rax, 32[rbx]
	xor	ecx, ecx
	mov	rsi, QWORD PTR 40[rbx]
	push	rax
	.cfi_def_cfa_offset 64
	mov	r9, rbx
	mov	edi, ebp
	mov	r8, QWORD PTR ehci_interrupt[rip]
	mov	edx, DWORD PTR INTR_TYPE_BIO[rip]
	or	edx, DWORD PTR INTR_MPSAFE[rip]
	call	bus_setup_intr@PLT
	pop	rdx
	.cfi_def_cfa_offset 56
	pop	rcx
	.cfi_def_cfa_offset 48
	test	eax, eax
	jne	.L18
	mov	eax, DWORD PTR EHCI_SCFLG_DONTRESET[rip]
	or	DWORD PTR 24[rbx], eax
	mov	rdi, rbx
	call	ehci_init@PLT
	test	eax, eax
	je	.L19
.L5:
	mov	edi, ebp
	call	generic_ehci_detach@PLT
	mov	eax, DWORD PTR ENXIO[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L18:
	mov	edx, eax
	lea	rsi, .LC5[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
	mov	QWORD PTR 32[rbx], 0
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L17:
	lea	rsi, .LC3[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L19:
	mov	edi, DWORD PTR 4[rbx]
	call	device_probe_and_attach@PLT
	test	eax, eax
	je	.L1
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L15:
	lea	rsi, .LC0[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L16:
	lea	rsi, .LC1[rip]
	mov	edi, ebp
	call	device_printf@PLT
	jmp	.L5
.L14:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	generic_ehci_attach, .-generic_ehci_attach
	.comm	ehci_iterate_hw_softc,4,4
	.comm	ehci_interrupt,8,8
	.comm	USB_REV_2_0,4,4
	.comm	SYS_RES_MEMORY,4,4
	.comm	SYS_RES_IRQ,4,4
	.comm	RF_SHAREABLE,4,4
	.comm	RF_ACTIVE,4,4
	.comm	INTR_TYPE_BIO,4,4
	.comm	INTR_MPSAFE,4,4
	.comm	ENXIO,4,4
	.comm	ENOMEM,4,4
	.comm	EHCI_SCFLG_DONTRESET,4,4
	.comm	EHCI_MAX_DEVICES,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_generic_ehci.c_generic_ehci_attach.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Could not map memory\012\000"
	.align	2
.LC1:
	.ascii	"Could not allocate irq\012\000"
	.align	2
.LC2:
	.ascii	"usbus\000"
	.align	2
.LC3:
	.ascii	"Could not add USB device\012\000"
	.align	2
.LC4:
	.ascii	"Generic\000"
	.align	2
.LC5:
	.ascii	"Could not setup irq, %d\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	generic_ehci_attach
	.syntax unified
	.arm
	.fpu softvfp
	.type	generic_ehci_attach, %function
generic_ehci_attach:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	ldr	r3, .L20
	sub	sp, sp, #28
	mov	r5, r0
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	bl	device_get_softc
	mov	r3, #32
	ldr	r2, .L20+4
	ldr	r1, [r0, #56]
	ldr	r2, [r2]
	str	r1, [r0, #16]
	str	r2, [r0, #12]
	str	r3, [r0]
	mov	r4, r0
	str	r5, [r0, #20]
	mov	r0, r5
	bl	USB_GET_DMA_TAG
	ldr	r2, .L20+8
	mov	r1, r0
	mov	r0, r4
	bl	usb_bus_mem_alloc_all
	subs	r6, r0, #0
	beq	.L2
	ldr	r3, .L20+12
	ldr	r0, [r3]
.L1:
	ldr	r3, .L20
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L14
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L2:
	ldr	r3, .L20+16
	ldr	r2, .L20+20
	ldr	r3, [r3]
	ldr	r7, .L20+24
	ldr	r1, [r2]
	str	r3, [r4, #8]
	mov	r0, r5
	ldr	r3, [r7]
	add	r2, sp, #16
	str	r6, [sp, #16]
	bl	bus_alloc_resource_any
	cmp	r0, #0
	str	r0, [r4, #40]
	beq	.L15
	bl	rman_get_bustag
	mov	r3, r0
	ldr	r0, [r4, #40]
	str	r3, [r4, #52]
	bl	rman_get_bushandle
	mov	r3, r0
	ldr	r0, [r4, #40]
	str	r3, [r4, #48]
	bl	rman_get_size
	ldr	r2, .L20+28
	ldr	r3, [r7]
	ldr	ip, [r2]
	ldr	r1, .L20+32
	str	r0, [r4, #44]
	ldr	r1, [r1]
	mov	r0, r5
	add	r2, sp, #16
	orr	r3, ip, r3
	str	r6, [sp, #16]
	bl	bus_alloc_resource_any
	cmp	r0, #0
	str	r0, [r4, #32]
	beq	.L16
	mvn	r2, #0
	mov	r0, r5
	ldr	r1, .L20+36
	bl	device_add_child
	cmp	r0, #0
	str	r0, [r4, #4]
	beq	.L17
	mov	r1, r4
	bl	device_set_ivars
	mov	r2, #4
	ldr	r1, .L20+40
	ldr	r0, [r4, #36]
	bl	strlcpy
	ldr	r1, .L20+44
	ldr	r3, .L20+48
	ldr	r2, .L20+52
	ldr	ip, [r1]
	ldr	r0, [r3]
	ldr	r2, [r2]
	add	r3, r4, #28
	ldr	r1, [r4, #32]
	orr	r2, ip, r2
	stm	sp, {r0, r4}
	str	r3, [sp, #8]
	mov	r0, r5
	mov	r3, r6
	bl	bus_setup_intr
	subs	r2, r0, #0
	bne	.L18
	ldr	r2, .L20+56
	ldr	r3, [r4, #24]
	ldr	r2, [r2]
	mov	r0, r4
	orr	r3, r3, r2
	str	r3, [r4, #24]
	bl	ehci_init
	cmp	r0, #0
	beq	.L19
.L5:
	mov	r0, r5
	bl	generic_ehci_detach
	ldr	r3, .L20+60
	ldr	r0, [r3]
	b	.L1
.L18:
	mov	r0, r5
	ldr	r1, .L20+64
	bl	device_printf
	str	r6, [r4, #28]
	b	.L5
.L17:
	mov	r0, r5
	ldr	r1, .L20+68
	bl	device_printf
	b	.L5
.L19:
	ldr	r0, [r4, #4]
	bl	device_probe_and_attach
	cmp	r0, #0
	beq	.L1
	b	.L5
.L15:
	mov	r0, r5
	ldr	r1, .L20+72
	bl	device_printf
	b	.L5
.L16:
	mov	r0, r5
	ldr	r1, .L20+76
	bl	device_printf
	b	.L5
.L14:
	bl	__stack_chk_fail
.L21:
	.align	2
.L20:
	.word	.LC6
	.word	EHCI_MAX_DEVICES
	.word	ehci_iterate_hw_softc
	.word	ENOMEM
	.word	USB_REV_2_0
	.word	SYS_RES_MEMORY
	.word	RF_ACTIVE
	.word	RF_SHAREABLE
	.word	SYS_RES_IRQ
	.word	.LC2
	.word	.LC4
	.word	INTR_TYPE_BIO
	.word	ehci_interrupt
	.word	INTR_MPSAFE
	.word	EHCI_SCFLG_DONTRESET
	.word	ENXIO
	.word	.LC5
	.word	.LC3
	.word	.LC0
	.word	.LC1
	.size	generic_ehci_attach, .-generic_ehci_attach
	.comm	ehci_iterate_hw_softc,4,4
	.comm	ehci_interrupt,4,4
	.comm	USB_REV_2_0,4,4
	.comm	SYS_RES_MEMORY,4,4
	.comm	SYS_RES_IRQ,4,4
	.comm	RF_SHAREABLE,4,4
	.comm	RF_ACTIVE,4,4
	.comm	INTR_TYPE_BIO,4,4
	.comm	INTR_MPSAFE,4,4
	.comm	ENXIO,4,4
	.comm	ENOMEM,4,4
	.comm	EHCI_SCFLG_DONTRESET,4,4
	.comm	EHCI_MAX_DEVICES,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
