	.file	"extr_ofw_pcibus.c_ofw_pcibus_enum_bus.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ofw_pcibus_enum_bus, @function
ofw_pcibus_enum_bus:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, esi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, edx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	DWORD PTR [rsp], edi
	call	device_get_parent@PLT
	mov	edi, eax
	mov	r14d, eax
	call	PCIB_MAXSLOTS@PLT
	test	eax, eax
	js	.L1
	add	eax, 1
	xor	ebp, ebp
	mov	DWORD PTR 4[rsp], eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L3:
	add	ebp, 1
	cmp	DWORD PTR 4[rsp], ebp
	je	.L1
.L10:
	mov	edi, 1
	call	DELAY@PLT
	mov	r8d, DWORD PTR PCIR_HDRTYPE[rip]
	xor	ecx, ecx
	mov	edx, ebp
	mov	r9d, 1
	mov	esi, r12d
	mov	edi, r14d
	call	PCIB_READ_CONFIG@PLT
	mov	ebx, eax
	mov	eax, DWORD PTR PCIM_HDRTYPE[rip]
	and	eax, ebx
	cmp	eax, DWORD PTR PCI_MAXHDRTYPE[rip]
	jg	.L3
	and	ebx, DWORD PTR PCIM_MFDEV[rip]
	je	.L4
	mov	ebx, DWORD PTR PCI_FUNCMAX[rip]
	test	ebx, ebx
	js	.L3
.L4:
	xor	r15d, r15d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L6:
	add	r15d, 1
	cmp	ebx, r15d
	jl	.L3
.L9:
	mov	ecx, r15d
	mov	edx, ebp
	mov	esi, r12d
	mov	edi, r13d
	call	pci_find_dbsf@PLT
	test	rax, rax
	jne	.L6
	mov	esi, DWORD PTR [rsp]
	mov	r9d, r15d
	mov	r8d, ebp
	mov	ecx, r12d
	mov	edx, r13d
	mov	edi, r14d
	call	pci_read_device@PLT
	mov	r11, rax
	test	rax, rax
	je	.L6
	cmp	QWORD PTR [rax], 0
	mov	QWORD PTR 48[rax], 0
	mov	DWORD PTR 8[rax], -1
	mov	QWORD PTR 40[rax], 0
	mov	QWORD PTR 32[rax], 0
	mov	QWORD PTR 24[rax], 0
	mov	QWORD PTR 16[rax], 0
	je	.L21
.L8:
	mov	edi, DWORD PTR [rsp]
	mov	rsi, r11
	call	pci_add_child@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L21:
	mov	r9, QWORD PTR PCI_INVALID_IRQ[rip]
	sub	rsp, 8
	.cfi_def_cfa_offset 88
	mov	edx, ebp
	mov	ecx, r15d
	mov	QWORD PTR 16[rsp], rax
	mov	r8d, DWORD PTR PCIR_INTLINE[rip]
	mov	esi, r12d
	mov	edi, r14d
	mov	QWORD PTR [rax], r9
	push	1
	.cfi_def_cfa_offset 96
	call	PCIB_WRITE_CONFIG@PLT
	pop	rax
	.cfi_def_cfa_offset 88
	pop	rdx
	.cfi_def_cfa_offset 80
	mov	r11, QWORD PTR 8[rsp]
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L1:
	add	rsp, 24
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	ofw_pcibus_enum_bus, .-ofw_pcibus_enum_bus
	.comm	PCI_MAXHDRTYPE,4,4
	.comm	PCI_INVALID_IRQ,8,8
	.comm	PCI_FUNCMAX,4,4
	.comm	PCIR_INTLINE,4,4
	.comm	PCIR_HDRTYPE,4,4
	.comm	PCIM_MFDEV,4,4
	.comm	PCIM_HDRTYPE,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_ofw_pcibus.c_ofw_pcibus_enum_bus.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ofw_pcibus_enum_bus, %function
ofw_pcibus_enum_bus:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #28
	mov	r10, r1
	mov	r9, r2
	str	r0, [sp, #16]
	bl	device_get_parent
	mov	fp, r0
	bl	PCIB_MAXSLOTS
	cmp	r0, #0
	blt	.L1
	add	r3, r0, #1
	mov	r8, #0
	str	r3, [sp, #20]
	b	.L10
.L3:
	ldr	r3, [sp, #20]
	add	r8, r8, #1
	cmp	r3, r8
	beq	.L1
.L10:
	mov	r0, #1
	bl	DELAY
	mov	r2, #1
	ldr	r3, .L22
	mov	r1, r9
	ldr	r3, [r3]
	mov	r0, fp
	str	r2, [sp, #4]
	str	r3, [sp]
	mov	r2, r8
	mov	r3, #0
	bl	PCIB_READ_CONFIG
	ldr	r3, .L22+4
	ldr	r2, .L22+8
	ldr	r3, [r3]
	ldr	r2, [r2]
	and	r3, r3, r0
	cmp	r3, r2
	bgt	.L3
	ldr	r3, .L22+12
	ldr	r7, [r3]
	ands	r7, r0, r7
	beq	.L4
	ldr	r3, .L22+16
	ldr	r7, [r3]
	cmp	r7, #0
	blt	.L3
.L4:
	mov	r5, #0
	b	.L9
.L6:
	add	r5, r5, #1
	cmp	r7, r5
	blt	.L3
.L9:
	mov	r3, r5
	mov	r2, r8
	mov	r1, r9
	mov	r0, r10
	bl	pci_find_dbsf
	subs	r4, r0, #0
	bne	.L6
	mov	r3, r9
	mov	r2, r10
	mov	r0, fp
	ldr	r1, [sp, #16]
	str	r5, [sp, #4]
	str	r8, [sp]
	bl	pci_read_device
	subs	r6, r0, #0
	beq	.L6
	ldr	r3, [r6]
	str	r4, [r6, #24]
	cmp	r3, #0
	mvn	r3, #0
	str	r4, [r6, #20]
	str	r3, [r6, #4]
	str	r4, [r6, #16]
	str	r4, [r6, #12]
	str	r4, [r6, #8]
	beq	.L21
.L8:
	mov	r1, r6
	ldr	r0, [sp, #16]
	bl	pci_add_child
	b	.L6
.L21:
	mov	r0, #1
	ldr	r3, .L22+20
	ldr	r2, [r3]
	ldr	r3, .L22+24
	ldr	r1, [r3]
	str	r2, [r6]
	mov	r3, r5
	str	r2, [sp, #4]
	str	r0, [sp, #8]
	str	r1, [sp]
	mov	r2, r8
	mov	r1, r9
	mov	r0, fp
	bl	PCIB_WRITE_CONFIG
	b	.L8
.L1:
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L23:
	.align	2
.L22:
	.word	PCIR_HDRTYPE
	.word	PCIM_HDRTYPE
	.word	PCI_MAXHDRTYPE
	.word	PCIM_MFDEV
	.word	PCI_FUNCMAX
	.word	PCI_INVALID_IRQ
	.word	PCIR_INTLINE
	.size	ofw_pcibus_enum_bus, .-ofw_pcibus_enum_bus
	.comm	PCI_MAXHDRTYPE,4,4
	.comm	PCI_INVALID_IRQ,4,4
	.comm	PCI_FUNCMAX,4,4
	.comm	PCIR_INTLINE,4,4
	.comm	PCIR_HDRTYPE,4,4
	.comm	PCIM_MFDEV,4,4
	.comm	PCIM_HDRTYPE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
