	.file	"extr_pci.c_pci_rebar_find_pos.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	pci_rebar_find_pos, @function
pci_rebar_find_pos:
.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	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	esi, DWORD PTR PCI_EXT_CAP_ID_REBAR[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	pci_find_ext_capability@PLT
	test	eax, eax
	jne	.L2
	mov	eax, DWORD PTR ENOTSUPP[rip]
	neg	eax
.L1:
	mov	rcx, QWORD PTR 24[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L14
	add	rsp, 40
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rsi, QWORD PTR PCI_REBAR_CTRL[rip]
	mov	ebp, eax
	lea	r15, 20[rsp]
	mov	ebx, eax
	mov	rdx, r15
	mov	rdi, r12
	add	rsi, rbp
	call	pci_read_config_dword@PLT
	mov	ecx, DWORD PTR PCI_REBAR_CTRL_NBAR_SHIFT[rip]
	mov	r14d, DWORD PTR 20[rsp]
	and	r14d, DWORD PTR PCI_REBAR_CTRL_NBAR_MASK[rip]
	sar	r14d, cl
	mov	DWORD PTR 12[rsp], r14d
	test	r14d, r14d
	je	.L4
	xor	r14d, r14d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	add	r14d, 1
	add	ebx, 8
	cmp	DWORD PTR 12[rsp], r14d
	je	.L4
	mov	ebp, ebx
.L6:
	mov	rsi, QWORD PTR PCI_REBAR_CTRL[rip]
	mov	rdx, r15
	mov	rdi, r12
	add	rsi, rbp
	call	pci_read_config_dword@PLT
	mov	eax, DWORD PTR 20[rsp]
	and	eax, DWORD PTR PCI_REBAR_CTRL_BAR_IDX[rip]
	cmp	eax, r13d
	jne	.L5
	mov	eax, ebx
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	mov	eax, DWORD PTR ENOENT[rip]
	neg	eax
	jmp	.L1
.L14:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	pci_rebar_find_pos, .-pci_rebar_find_pos
	.comm	PCI_REBAR_CTRL_NBAR_SHIFT,4,4
	.comm	PCI_REBAR_CTRL_NBAR_MASK,4,4
	.comm	PCI_REBAR_CTRL_BAR_IDX,4,4
	.comm	PCI_REBAR_CTRL,8,8
	.comm	PCI_EXT_CAP_ID_REBAR,4,4
	.comm	ENOTSUPP,4,4
	.comm	ENOENT,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_pci.c_pci_rebar_find_pos.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	pci_rebar_find_pos, %function
pci_rebar_find_pos:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r3, .L15
	mov	r7, r1
	ldr	r1, [r3]
	ldr	r3, .L15+4
	sub	sp, sp, #8
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	mov	r6, r0
	bl	pci_find_ext_capability
	subs	r4, r0, #0
	bne	.L2
	ldr	r3, .L15+8
	ldr	r0, [r3]
	rsb	r0, r0, #0
.L1:
	ldr	r3, .L15+4
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L14
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L2:
	ldr	r9, .L15+12
	mov	r2, sp
	ldr	r1, [r9]
	mov	r0, r6
	add	r1, r4, r1
	bl	pci_read_config_dword
	ldr	r2, .L15+16
	ldr	r3, .L15+20
	ldr	r2, [r2]
	ldr	r8, [sp]
	ldr	r3, [r3]
	and	r8, r8, r2
	asrs	r8, r8, r3
	beq	.L4
	mov	r5, #0
	ldr	r10, .L15+24
	b	.L6
.L5:
	add	r5, r5, #1
	cmp	r8, r5
	add	r4, r4, #8
	beq	.L4
.L6:
	ldr	r1, [r9]
	mov	r2, sp
	mov	r0, r6
	add	r1, r4, r1
	bl	pci_read_config_dword
	ldr	r3, [sp]
	ldr	r2, [r10]
	and	r3, r3, r2
	cmp	r3, r7
	bne	.L5
	mov	r0, r4
	b	.L1
.L4:
	ldr	r3, .L15+28
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L1
.L14:
	bl	__stack_chk_fail
.L16:
	.align	2
.L15:
	.word	PCI_EXT_CAP_ID_REBAR
	.word	.LC0
	.word	ENOTSUPP
	.word	PCI_REBAR_CTRL
	.word	PCI_REBAR_CTRL_NBAR_MASK
	.word	PCI_REBAR_CTRL_NBAR_SHIFT
	.word	PCI_REBAR_CTRL_BAR_IDX
	.word	ENOENT
	.size	pci_rebar_find_pos, .-pci_rebar_find_pos
	.comm	PCI_REBAR_CTRL_NBAR_SHIFT,4,4
	.comm	PCI_REBAR_CTRL_NBAR_MASK,4,4
	.comm	PCI_REBAR_CTRL_BAR_IDX,4,4
	.comm	PCI_REBAR_CTRL,4,4
	.comm	PCI_EXT_CAP_ID_REBAR,4,4
	.comm	ENOTSUPP,4,4
	.comm	ENOENT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
