	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_restore_rebar_state
_pci_restore_rebar_state:               ## @pci_restore_rebar_state
	.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
	movq	%rdi, %r14
	movq	_PCI_EXT_CAP_ID_REBAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_pci_find_ext_capability
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movl	%eax, %r12d
	movl	%eax, %esi
	movq	_PCI_REBAR_CTRL@GOTPCREL(%rip), %r13
	addq	(%r13), %rsi
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	callq	_pci_read_config_dword
	movq	_PCI_REBAR_CTRL_NBAR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	andl	-44(%rbp), %r15d
	movq	_PCI_REBAR_CTRL_NBAR_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %r15d
	testl	%r15d, %r15d
	je	LBB0_3
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %ebx
	movq	(%r13), %rsi
	addq	%rbx, %rsi
	movq	%r14, %rdi
	leaq	-44(%rbp), %rdx
	callq	_pci_read_config_dword
	movq	_PCI_REBAR_CTRL_BAR_IDX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	-44(%rbp), %eax
	movslq	%eax, %rdi
	shlq	$2, %rdi
	addq	(%r14), %rdi
	callq	_resource_size
	movl	%eax, %edi
	callq	_ilog2
                                        ## kill: def $eax killed $eax def $rax
	leal	-20(%rax), %edx
	movq	_PCI_REBAR_CTRL_BAR_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	-44(%rbp), %eax
	movq	_PCI_REBAR_CTRL_BAR_SHIFT@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	shll	%cl, %edx
	orl	%eax, %edx
	movl	%edx, -44(%rbp)
	addq	(%r13), %rbx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_pci_write_config_dword
	addl	$8, %r12d
	decl	%r15d
	jne	LBB0_2
LBB0_3:
	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	_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	_PCI_REBAR_CTRL_BAR_SIZE,4,2    ## @PCI_REBAR_CTRL_BAR_SIZE
	.comm	_PCI_REBAR_CTRL_BAR_SHIFT,4,2   ## @PCI_REBAR_CTRL_BAR_SHIFT
	.no_dead_strip	_pci_restore_rebar_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pci_restore_rebar_state
_pci_restore_rebar_state:               ; @pci_restore_rebar_state
	.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
	mov	x19, 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_4
; %bb.1:
	mov	x20, x0
Lloh3:
	adrp	x21, _PCI_REBAR_CTRL@GOTPAGE
Lloh4:
	ldr	x21, [x21, _PCI_REBAR_CTRL@GOTPAGEOFF]
	ldr	x8, [x21]
	add	x1, x8, w0, uxtw
	add	x2, sp, #12
	mov	x0, x19
	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	w22, w8, w9
	cbz	w22, LBB0_4
; %bb.2:
Lloh11:
	adrp	x23, _PCI_REBAR_CTRL_BAR_IDX@GOTPAGE
Lloh12:
	ldr	x23, [x23, _PCI_REBAR_CTRL_BAR_IDX@GOTPAGEOFF]
Lloh13:
	adrp	x24, _PCI_REBAR_CTRL_BAR_SIZE@GOTPAGE
Lloh14:
	ldr	x24, [x24, _PCI_REBAR_CTRL_BAR_SIZE@GOTPAGEOFF]
Lloh15:
	adrp	x25, _PCI_REBAR_CTRL_BAR_SHIFT@GOTPAGE
Lloh16:
	ldr	x25, [x25, _PCI_REBAR_CTRL_BAR_SHIFT@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	w26, w20
	ldr	x8, [x21]
	add	x1, x8, x26
	add	x2, sp, #12
	mov	x0, x19
	bl	_pci_read_config_dword
	ldr	w8, [sp, #12]
	ldr	w9, [x23]
	and	w8, w9, w8
	ldr	x9, [x19]
	add	x0, x9, w8, sxtw #2
	bl	_resource_size
	bl	_ilog2
	sub	w8, w0, #20
	ldr	w9, [x24]
	ldr	w10, [sp, #12]
	bic	w9, w10, w9
	ldr	w10, [x25]
	lsl	w8, w8, w10
	orr	w2, w8, w9
	str	w2, [sp, #12]
	ldr	x8, [x21]
	add	x1, x8, x26
	mov	x0, x19
	bl	_pci_write_config_dword
	add	w20, w20, #8
	subs	w22, w22, #1
	b.ne	LBB0_3
LBB0_4:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_EXT_CAP_ID_REBAR,4,2       ; @PCI_EXT_CAP_ID_REBAR
	.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	_PCI_REBAR_CTRL_BAR_SIZE,4,2    ; @PCI_REBAR_CTRL_BAR_SIZE
	.comm	_PCI_REBAR_CTRL_BAR_SHIFT,4,2   ; @PCI_REBAR_CTRL_BAR_SHIFT
	.no_dead_strip	_pci_restore_rebar_state
.subsections_via_symbols
