	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_rebar_find_pos
_pci_rebar_find_pos:                    ## @pci_rebar_find_pos
	.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	%esi, %r14d
	movq	%rdi, %r15
	movq	_PCI_EXT_CAP_ID_REBAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_pci_find_ext_capability
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	%eax, %ebx
	movl	%eax, %esi
	movq	_PCI_REBAR_CTRL@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_dword
	movq	_PCI_REBAR_CTRL_NBAR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	andl	-44(%rbp), %r13d
	movq	_PCI_REBAR_CTRL_NBAR_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %r13d
	testl	%r13d, %r13d
	je	LBB0_6
## %bb.3:
	movq	_PCI_REBAR_CTRL_BAR_IDX@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %esi
	movq	_PCI_REBAR_CTRL@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	movq	%r15, %rdi
	leaq	-44(%rbp), %rdx
	callq	_pci_read_config_dword
	movl	(%r12), %eax
	andl	-44(%rbp), %eax
	cmpl	%r14d, %eax
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	addl	$8, %ebx
	decl	%r13d
	jne	LBB0_4
LBB0_6:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_1:
	movq	_ENOTSUPP@GOTPCREL(%rip), %rax
LBB0_7:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_EXT_CAP_ID_REBAR,4,2       ## @PCI_EXT_CAP_ID_REBAR
	.comm	_ENOTSUPP,4,2                   ## @ENOTSUPP
	.comm	_PCI_REBAR_CTRL,8,3             ## @PCI_REBAR_CTRL
	.comm	_PCI_REBAR_CTRL_NBAR_MASK,4,2   ## @PCI_REBAR_CTRL_NBAR_MASK
	.comm	_PCI_REBAR_CTRL_NBAR_SHIFT,4,2  ## @PCI_REBAR_CTRL_NBAR_SHIFT
	.comm	_PCI_REBAR_CTRL_BAR_IDX,4,2     ## @PCI_REBAR_CTRL_BAR_IDX
	.comm	_ENOENT,4,2                     ## @ENOENT
	.no_dead_strip	_pci_rebar_find_pos
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pci_rebar_find_pos
_pci_rebar_find_pos:                    ; @pci_rebar_find_pos
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _PCI_EXT_CAP_ID_REBAR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_EXT_CAP_ID_REBAR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_pci_find_ext_capability
	cbz	w0, LBB0_6
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x22, _PCI_REBAR_CTRL@GOTPAGE
Lloh4:
	ldr	x22, [x22, _PCI_REBAR_CTRL@GOTPAGEOFF]
	ldr	x8, [x22]
	add	x1, x8, w0, uxtw
	add	x2, sp, #12
	mov	x0, x21
	bl	_pci_read_config_dword
	ldr	w8, [sp, #12]
Lloh5:
	adrp	x9, _PCI_REBAR_CTRL_NBAR_MASK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PCI_REBAR_CTRL_NBAR_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh8:
	adrp	x9, _PCI_REBAR_CTRL_NBAR_SHIFT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PCI_REBAR_CTRL_NBAR_SHIFT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	asr	w23, w8, w9
	cbz	w23, LBB0_5
; %bb.2:
Lloh11:
	adrp	x24, _PCI_REBAR_CTRL_BAR_IDX@GOTPAGE
Lloh12:
	ldr	x24, [x24, _PCI_REBAR_CTRL_BAR_IDX@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22]
	add	x1, x8, w19, uxtw
	add	x2, sp, #12
	mov	x0, x21
	bl	_pci_read_config_dword
	ldr	w8, [sp, #12]
	ldr	w9, [x24]
	and	w8, w9, w8
	cmp	w8, w20
	b.eq	LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w19, w19, #8
	subs	w23, w23, #1
	b.ne	LBB0_3
LBB0_5:
Lloh13:
	adrp	x8, _ENOENT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh15:
	adrp	x8, _ENOTSUPP@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOTSUPP@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_EXT_CAP_ID_REBAR,4,2       ; @PCI_EXT_CAP_ID_REBAR
	.comm	_ENOTSUPP,4,2                   ; @ENOTSUPP
	.comm	_PCI_REBAR_CTRL,8,3             ; @PCI_REBAR_CTRL
	.comm	_PCI_REBAR_CTRL_NBAR_MASK,4,2   ; @PCI_REBAR_CTRL_NBAR_MASK
	.comm	_PCI_REBAR_CTRL_NBAR_SHIFT,4,2  ; @PCI_REBAR_CTRL_NBAR_SHIFT
	.comm	_PCI_REBAR_CTRL_BAR_IDX,4,2     ; @PCI_REBAR_CTRL_BAR_IDX
	.comm	_ENOENT,4,2                     ; @ENOENT
	.no_dead_strip	_pci_rebar_find_pos
.subsections_via_symbols
