	.file	"extr_pci.c_pci_find_ext_capability.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	pci_find_ext_capability
	.type	pci_find_ext_capability, @function
pci_find_ext_capability:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	r12d, DWORD PTR PCI_CFG_SPACE_SIZE[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	cmp	DWORD PTR [rdi], r12d
	jg	.L2
.L4:
	xor	r12d, r12d
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L10
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	r14, rsp
	mov	r13d, esi
	mov	esi, r12d
	mov	ebp, DWORD PTR PCI_CFG_SPACE_EXP_SIZE[rip]
	mov	rdx, r14
	mov	rbx, rdi
	call	pci_read_config_dword@PLT
	cmp	rax, QWORD PTR PCIBIOS_SUCCESSFUL[rip]
	jne	.L4
	cmp	QWORD PTR [rsp], 0
	je	.L4
	sub	ebp, r12d
	lea	eax, 7[rbp]
	cmovs	ebp, eax
	sar	ebp, 3
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rdi, QWORD PTR [rsp]
	call	PCI_EXT_CAP_ID@PLT
	cmp	eax, r13d
	je	.L1
	mov	rdi, QWORD PTR [rsp]
	call	PCI_EXT_CAP_NEXT@PLT
	cmp	DWORD PTR PCI_CFG_SPACE_SIZE[rip], eax
	mov	r12d, eax
	jg	.L4
	mov	rdx, r14
	mov	esi, eax
	mov	rdi, rbx
	sub	ebp, 1
	call	pci_read_config_dword@PLT
	cmp	rax, QWORD PTR PCIBIOS_SUCCESSFUL[rip]
	jne	.L4
.L5:
	test	ebp, ebp
	jg	.L6
	jmp	.L4
.L10:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	pci_find_ext_capability, .-pci_find_ext_capability
	.comm	PCI_CFG_SPACE_SIZE,4,4
	.comm	PCI_CFG_SPACE_EXP_SIZE,4,4
	.comm	PCIBIOS_SUCCESSFUL,8,8
	.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_pci.c_pci_find_ext_capability.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	pci_find_ext_capability
	.syntax unified
	.arm
	.fpu softvfp
	.type	pci_find_ext_capability, %function
pci_find_ext_capability:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	ldr	r8, .L14
	ldr	r3, [r0]
	ldr	r4, [r8]
	sub	sp, sp, #12
	cmp	r3, r4
	ldr	r3, .L14+4
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	bgt	.L2
.L4:
	mov	r4, #0
.L1:
	ldr	r3, .L14+4
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L13
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L2:
	ldr	r3, .L14+8
	mov	r7, r1
	mov	r2, sp
	mov	r1, r4
	ldr	r5, [r3]
	mov	r6, r0
	bl	pci_read_config_dword
	ldr	r9, .L14+12
	ldr	r3, [r9]
	cmp	r0, r3
	bne	.L4
	ldr	r3, [sp]
	cmp	r3, #0
	beq	.L4
	sub	r5, r5, r4
	add	r3, r5, #7
	cmp	r5, #0
	movlt	r5, r3
	asr	r5, r5, #3
	b	.L5
.L6:
	ldr	r0, [sp]
	bl	PCI_EXT_CAP_ID
	cmp	r0, r7
	beq	.L1
	ldr	r0, [sp]
	bl	PCI_EXT_CAP_NEXT
	ldr	r3, [r8]
	mov	r4, r0
	cmp	r3, r0
	bgt	.L4
	mov	r1, r0
	mov	r2, sp
	mov	r0, r6
	bl	pci_read_config_dword
	ldr	r3, [r9]
	sub	r5, r5, #1
	cmp	r0, r3
	bne	.L4
.L5:
	cmp	r5, #0
	bgt	.L6
	b	.L4
.L13:
	bl	__stack_chk_fail
.L15:
	.align	2
.L14:
	.word	PCI_CFG_SPACE_SIZE
	.word	.LC0
	.word	PCI_CFG_SPACE_EXP_SIZE
	.word	PCIBIOS_SUCCESSFUL
	.size	pci_find_ext_capability, .-pci_find_ext_capability
	.comm	PCI_CFG_SPACE_SIZE,4,4
	.comm	PCI_CFG_SPACE_EXP_SIZE,4,4
	.comm	PCIBIOS_SUCCESSFUL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
