	.file	"extr_eeh_pseries.c_pseries_eeh_find_ecap.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	pseries_eeh_find_ecap, @function
pseries_eeh_find_ecap:
.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
	mov	r13d, esi
	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
	mov	rbx, rdi
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	pdn_to_eeh_dev@PLT
	test	rax, rax
	je	.L4
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jne	.L13
.L4:
	xor	r12d, r12d
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L14
	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
.L13:
	.cfi_restore_state
	lea	r14, 4[rsp]
	mov	edx, 4
	mov	esi, 256
	mov	rdi, rbx
	mov	rcx, r14
	call	rtas_read_config@PLT
	cmp	rax, QWORD PTR PCIBIOS_SUCCESSFUL[rip]
	jne	.L4
	mov	edi, DWORD PTR 4[rsp]
	test	edi, edi
	je	.L4
	mov	ebp, 480
	mov	r12d, 256
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L15:
	mov	rcx, r14
	mov	edx, 4
	mov	esi, eax
	mov	rdi, rbx
	call	rtas_read_config@PLT
	cmp	rax, QWORD PTR PCIBIOS_SUCCESSFUL[rip]
	jne	.L4
	sub	ebp, 1
	je	.L4
	mov	edi, DWORD PTR 4[rsp]
.L5:
	call	PCI_EXT_CAP_ID@PLT
	cmp	eax, r13d
	je	.L1
	mov	edi, DWORD PTR 4[rsp]
	call	PCI_EXT_CAP_NEXT@PLT
	mov	r12d, eax
	cmp	eax, 255
	jg	.L15
	jmp	.L4
.L14:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	pseries_eeh_find_ecap, .-pseries_eeh_find_ecap
	.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_eeh_pseries.c_pseries_eeh_find_ecap.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	pseries_eeh_find_ecap, %function
pseries_eeh_find_ecap:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r3, .L19
	sub	sp, sp, #8
	mov	r7, r1
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	mov	r5, r0
	bl	pdn_to_eeh_dev
	cmp	r0, #0
	beq	.L4
	ldr	r3, [r0]
	cmp	r3, #0
	bne	.L16
.L4:
	mov	r4, #0
.L1:
	ldr	r3, .L19
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L17
	mov	r0, r4
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L16:
	mov	r3, sp
	mov	r2, #4
	mov	r1, #256
	mov	r0, r5
	bl	rtas_read_config
	ldr	r8, .L19+4
	ldr	r3, [r8]
	cmp	r0, r3
	bne	.L4
	ldr	r0, [sp]
	cmp	r0, #0
	beq	.L4
	mov	r6, #480
	mov	r4, #256
	b	.L5
.L18:
	mov	r3, sp
	mov	r1, r0
	mov	r2, #4
	mov	r0, r5
	bl	rtas_read_config
	ldr	r3, [r8]
	cmp	r0, r3
	bne	.L4
	subs	r6, r6, #1
	beq	.L4
	ldr	r0, [sp]
.L5:
	bl	PCI_EXT_CAP_ID
	cmp	r0, r7
	beq	.L1
	ldr	r0, [sp]
	bl	PCI_EXT_CAP_NEXT
	cmp	r0, #255
	mov	r4, r0
	bgt	.L18
	b	.L4
.L17:
	bl	__stack_chk_fail
.L20:
	.align	2
.L19:
	.word	.LC0
	.word	PCIBIOS_SUCCESSFUL
	.size	pseries_eeh_find_ecap, .-pseries_eeh_find_ecap
	.comm	PCIBIOS_SUCCESSFUL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
