	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_mmcfg_read
_pci_mmcfg_read:                        ## @pci_mmcfg_read
	.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, %eax
	orl	%esi, %eax
	cmpl	$255, %eax
	ja	LBB0_2
## %bb.1:
	movl	%ecx, %r12d
	cmpl	$4096, %ecx                     ## imm = 0x1000
	jge	LBB0_2
## %bb.3:
	movl	%r8d, %r15d
	movl	%edx, %r13d
	movl	%esi, %ebx
	movq	%r9, -48(%rbp)                  ## 8-byte Spill
	callq	_get_base_addr
	movq	-48(%rbp), %r9                  ## 8-byte Reload
	testl	%eax, %eax
	je	LBB0_2
## %bb.4:
	movl	%eax, %r14d
	movq	_pci_config_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irqsave
	movl	%r14d, %edi
	movl	%ebx, %esi
	movl	%r13d, %edx
	callq	_pci_exp_set_dev_base
	cmpl	$4, %r15d
	je	LBB0_9
## %bb.5:
	cmpl	$2, %r15d
	je	LBB0_8
## %bb.6:
	cmpl	$1, %r15d
	jne	LBB0_11
## %bb.7:
	movq	_mmcfg_virt_addr@GOTPCREL(%rip), %rax
	addl	(%rax), %r12d
	movl	%r12d, %edi
	callq	_mmio_config_readb
	jmp	LBB0_10
LBB0_2:
	movl	$-1, (%r9)
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_12
LBB0_9:
	movq	_mmcfg_virt_addr@GOTPCREL(%rip), %rax
	addl	(%rax), %r12d
	movl	%r12d, %edi
	callq	_mmio_config_readl
	jmp	LBB0_10
LBB0_8:
	movq	_mmcfg_virt_addr@GOTPCREL(%rip), %rax
	addl	(%rax), %r12d
	movl	%r12d, %edi
	callq	_mmio_config_readw
LBB0_10:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
LBB0_11:
	movq	_pci_config_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_pci_config_lock,4,2            ## @pci_config_lock
	.comm	_mmcfg_virt_addr,4,2            ## @mmcfg_virt_addr
	.no_dead_strip	_pci_mmcfg_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pci_mmcfg_read
_pci_mmcfg_read:                        ; @pci_mmcfg_read
	.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, x5
	orr	w8, w2, w1
	cmp	w8, #255
	b.hi	LBB0_7
; %bb.1:
	mov	x20, x3
	cmp	w3, #1, lsl #12                 ; =4096
	b.ge	LBB0_7
; %bb.2:
	mov	x21, x4
	mov	x22, x2
	mov	x23, x1
	bl	_get_base_addr
	cbz	w0, LBB0_7
; %bb.3:
	mov	x24, x0
Lloh0:
	adrp	x0, _pci_config_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _pci_config_lock@GOTPAGEOFF]
	bl	_spin_lock_irqsave
	mov	x0, x24
	mov	x1, x23
	mov	x2, x22
	bl	_pci_exp_set_dev_base
	cmp	w21, #4
	b.eq	LBB0_8
; %bb.4:
	cmp	w21, #2
	b.eq	LBB0_9
; %bb.5:
	cmp	w21, #1
	b.ne	LBB0_11
; %bb.6:
Lloh2:
	adrp	x8, _mmcfg_virt_addr@GOTPAGE
Lloh3:
	ldr	x8, [x8, _mmcfg_virt_addr@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	add	w0, w8, w20
	bl	_mmio_config_readb
	b	LBB0_10
LBB0_7:
	mov	w8, #-1
	str	w8, [x19]
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_8:
Lloh8:
	adrp	x8, _mmcfg_virt_addr@GOTPAGE
Lloh9:
	ldr	x8, [x8, _mmcfg_virt_addr@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	add	w0, w8, w20
	bl	_mmio_config_readl
	b	LBB0_10
LBB0_9:
Lloh11:
	adrp	x8, _mmcfg_virt_addr@GOTPAGE
Lloh12:
	ldr	x8, [x8, _mmcfg_virt_addr@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	add	w0, w8, w20
	bl	_mmio_config_readw
LBB0_10:
	str	w0, [x19]
LBB0_11:
Lloh14:
	adrp	x0, _pci_config_lock@GOTPAGE
Lloh15:
	ldr	x0, [x0, _pci_config_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
	mov	w0, #0
LBB0_12:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_pci_config_lock,4,2            ; @pci_config_lock
	.comm	_mmcfg_virt_addr,4,2            ; @mmcfg_virt_addr
	.no_dead_strip	_pci_mmcfg_read
.subsections_via_symbols
