	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_find_next_ext_capability   ## -- Begin function pci_find_next_ext_capability
	.p2align	4, 0x90
_pci_find_next_ext_capability:          ## @pci_find_next_ext_capability
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_PCI_CFG_SPACE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	cmpl	%r13d, (%rdi)
	jle	LBB0_9
## %bb.1:
	movl	%esi, %r15d
	movq	%rdi, %r12
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movq	_PCI_CFG_SPACE_EXP_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	testl	%esi, %esi
	movl	%esi, %ebx
	cmovel	%r13d, %ebx
	leaq	-48(%rbp), %rdx
	movl	%ebx, %esi
	callq	_pci_read_config_dword
	movq	_PCIBIOS_SUCCESSFUL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.2:
	cmpq	$0, -48(%rbp)
	je	LBB0_9
## %bb.3:
	subl	%r13d, %r14d
	leal	7(%r14), %r13d
	testl	%r14d, %r14d
	cmovnsl	%r14d, %r13d
	sarl	$3, %r13d
	incl	%r13d
	movl	-52(%rbp), %r14d                ## 4-byte Reload
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	decl	%r13d
	jle	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rdi
	callq	_PCI_EXT_CAP_ID
	cmpl	%r14d, %eax
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	%r15d, %ebx
	jne	LBB0_10
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rdi
	callq	_PCI_EXT_CAP_NEXT
	movl	%eax, %ebx
	movq	_PCI_CFG_SPACE_SIZE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jl	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %rdi
	movl	%ebx, %esi
	leaq	-48(%rbp), %rdx
	callq	_pci_read_config_dword
	movq	_PCIBIOS_SUCCESSFUL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_4
LBB0_9:
	xorl	%ebx, %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_CFG_SPACE_SIZE,4,2         ## @PCI_CFG_SPACE_SIZE
	.comm	_PCI_CFG_SPACE_EXP_SIZE,4,2     ## @PCI_CFG_SPACE_EXP_SIZE
	.comm	_PCIBIOS_SUCCESSFUL,8,3         ## @PCIBIOS_SUCCESSFUL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_find_next_ext_capability   ; -- Begin function pci_find_next_ext_capability
	.p2align	2
_pci_find_next_ext_capability:          ; @pci_find_next_ext_capability
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
Lloh0:
	adrp	x23, _PCI_CFG_SPACE_SIZE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _PCI_CFG_SPACE_SIZE@GOTPAGEOFF]
	ldr	w25, [x23]
	ldr	w8, [x0]
	cmp	w8, w25
	b.le	LBB0_2
; %bb.1:
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh2:
	adrp	x8, _PCI_CFG_SPACE_EXP_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PCI_CFG_SPACE_EXP_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w26, [x8]
	cmp	w1, #0
	csel	w22, w25, w1, eq
	add	x2, sp, #8
	mov	x1, x22
	bl	_pci_read_config_dword
Lloh5:
	adrp	x24, _PCIBIOS_SUCCESSFUL@GOTPAGE
Lloh6:
	ldr	x24, [x24, _PCIBIOS_SUCCESSFUL@GOTPAGEOFF]
	ldr	x8, [x24]
	ldr	x9, [sp, #8]
	cmp	x0, x8
	ccmp	x9, #0, #4, eq
	b.ne	LBB0_4
LBB0_2:
	mov	w22, #0
LBB0_3:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_4:
	sub	w8, w26, w25
	add	w9, w8, #7
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #3
	add	w25, w8, #1
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	sub	w25, w25, #1
	cmp	w25, #1
	b.lt	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [sp, #8]
	bl	_PCI_EXT_CAP_ID
	cmp	w0, w19
	ccmp	w22, w20, #4, eq
	b.ne	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [sp, #8]
	bl	_PCI_EXT_CAP_NEXT
	ldr	w8, [x23]
	cmp	w0, w8
	b.lt	LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x22, x0
	add	x2, sp, #8
	mov	x0, x21
	mov	x1, x22
	bl	_pci_read_config_dword
	ldr	x8, [x24]
	cmp	x0, x8
	b.eq	LBB0_5
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_CFG_SPACE_SIZE,4,2         ; @PCI_CFG_SPACE_SIZE
	.comm	_PCI_CFG_SPACE_EXP_SIZE,4,2     ; @PCI_CFG_SPACE_EXP_SIZE
	.comm	_PCIBIOS_SUCCESSFUL,8,3         ; @PCIBIOS_SUCCESSFUL
.subsections_via_symbols
