	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_find_cap                   ## -- Begin function pci_find_cap
	.p2align	4, 0x90
_pci_find_cap:                          ## @pci_find_cap
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %rbx
	movl	%edi, %r15d
	leaq	4(%rsi), %r13
	movq	_PCIR_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rsi
	movl	$2, %ecx
	callq	_read_config
	movq	_PCIM_STATUS_CAPPRESENT@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	testl	%eax, (%rcx)
	je	LBB0_9
## %bb.1:
	movq	_PCIM_HDRTYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%rbx), %eax
	addl	$-128, %eax
	cmpl	$2, %eax
	ja	LBB0_9
## %bb.2:
	cltq
	leaq	l_switch.table.pci_find_cap(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %edx
	movq	_PCICAP_ID@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %edi
	movq	%r13, %rsi
	movl	$1, %ecx
	callq	_read_config
	movq	%rax, %rbx
	testl	%ebx, %ebx
	je	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$255, %ebx
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r12), %edx
	addl	%ebx, %edx
	movl	%r15d, %edi
	movq	%r13, %rsi
	movl	$1, %ecx
	callq	_read_config
	cmpl	%r14d, %eax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_PCICAP_NEXTPTR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	addl	%ebx, %edx
	jmp	LBB0_3
LBB0_8:
	xorl	%edx, %edx
	jmp	LBB0_9
LBB0_7:
	movl	%ebx, %edx
LBB0_9:
	movl	%edx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCIR_STATUS,4,2                ## @PCIR_STATUS
	.comm	_PCIM_STATUS_CAPPRESENT,4,2     ## @PCIM_STATUS_CAPPRESENT
	.comm	_PCIM_HDRTYPE,4,2               ## @PCIM_HDRTYPE
	.comm	_PCIR_CAP_PTR,4,2               ## @PCIR_CAP_PTR
	.comm	_PCIR_CAP_PTR_2,4,2             ## @PCIR_CAP_PTR_2
	.comm	_PCICAP_ID,4,2                  ## @PCICAP_ID
	.comm	_PCICAP_NEXTPTR,4,2             ## @PCICAP_NEXTPTR
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.pci_find_cap
l_switch.table.pci_find_cap:
	.quad	_PCIR_CAP_PTR
	.quad	_PCIR_CAP_PTR_2
	.quad	_PCIR_CAP_PTR

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_find_cap                   ; -- Begin function pci_find_cap
	.p2align	2
_pci_find_cap:                          ; @pci_find_cap
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x2
	mov	x22, x1
	mov	x20, x0
	add	x21, x1, #4
Lloh0:
	adrp	x8, _PCIR_STATUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCIR_STATUS@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x1, x21
	mov	w3, #2
	bl	_read_config
Lloh3:
	adrp	x8, _PCIM_STATUS_CAPPRESENT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCIM_STATUS_CAPPRESENT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_7
; %bb.1:
	ldr	w8, [x22]
Lloh6:
	adrp	x9, _PCIM_HDRTYPE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PCIM_HDRTYPE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	and	w8, w9, w8
	sub	w8, w8, #128
	cmp	w8, #2
	b.hi	LBB0_7
; %bb.2:
Lloh9:
	adrp	x9, l_switch.table.pci_find_cap@PAGE
Lloh10:
	add	x9, x9, l_switch.table.pci_find_cap@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	ldr	w2, [x8]
Lloh11:
	adrp	x23, _PCICAP_ID@GOTPAGE
Lloh12:
	ldr	x23, [x23, _PCICAP_ID@GOTPAGEOFF]
Lloh13:
	adrp	x24, _PCICAP_NEXTPTR@GOTPAGE
Lloh14:
	ldr	x24, [x24, _PCICAP_NEXTPTR@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x21
	mov	w3, #1
	bl	_read_config
	mov	x22, x0
	cbz	w22, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w22, #255
	b.eq	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x23]
	add	w2, w8, w22
	mov	x0, x20
	mov	x1, x21
	mov	w3, #1
	bl	_read_config
	cmp	w0, w19
	b.eq	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x24]
	add	w2, w8, w22
	b	LBB0_3
LBB0_7:
	mov	w22, #0
LBB0_8:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_PCIR_STATUS,4,2                ; @PCIR_STATUS
	.comm	_PCIM_STATUS_CAPPRESENT,4,2     ; @PCIM_STATUS_CAPPRESENT
	.comm	_PCIM_HDRTYPE,4,2               ; @PCIM_HDRTYPE
	.comm	_PCIR_CAP_PTR,4,2               ; @PCIR_CAP_PTR
	.comm	_PCIR_CAP_PTR_2,4,2             ; @PCIR_CAP_PTR_2
	.comm	_PCICAP_ID,4,2                  ; @PCICAP_ID
	.comm	_PCICAP_NEXTPTR,4,2             ; @PCICAP_NEXTPTR
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.pci_find_cap
l_switch.table.pci_find_cap:
	.quad	_PCIR_CAP_PTR
	.quad	_PCIR_CAP_PTR_2
	.quad	_PCIR_CAP_PTR

.subsections_via_symbols
