	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function legacy_pci_cfgregopen
_legacy_pci_cfgregopen:                 ## @legacy_pci_cfgregopen
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_cfgmech@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	_CFGMECH_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_12
## %bb.1:
	movq	_CFGMECH_PCIE@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	je	LBB0_12
## %bb.2:
	movl	%edi, %r14d
	movq	_PCIR_VENDOR@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%edi, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$2, %r8d
	callq	_pci_cfgregread
	movl	%eax, %ebx
	movq	_PCIR_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%edi, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$2, %r8d
	callq	_pci_cfgregread
                                        ## kill: def $eax killed $eax def $rax
	cmpl	$32902, %ebx                    ## imm = 0x8086
	jne	LBB0_10
## %bb.3:
	leal	-9600(%rax), %ecx
	cmpl	$16, %ecx
	ja	LBB0_4
## %bb.7:
	movl	$65553, %edx                    ## imm = 0x10011
	btl	%ecx, %edx
	jae	LBB0_4
## %bb.8:
	xorl	%edi, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$72, %ecx
	movl	$4, %r8d
	callq	_pci_cfgregread
	jmp	LBB0_9
LBB0_4:
	cmpl	$13714, %eax                    ## imm = 0x3592
	je	LBB0_6
## %bb.5:
	cmpl	$13712, %eax                    ## imm = 0x3590
	jne	LBB0_10
LBB0_6:
	xorl	%edi, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$206, %ecx
	movl	$2, %r8d
	callq	_pci_cfgregread
	shll	$16, %eax
LBB0_9:
	movl	%eax, %edi
	xorl	%esi, %esi
	movl	$255, %edx
	callq	_pcie_cfgregopen
LBB0_10:
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_12
## %bb.11:
	movq	(%r15), %rax
	cmpq	(%r12), %rax
	jne	LBB0_12
## %bb.13:
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_device_printf                  ## TAILCALL
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cfgmech,8,3                    ## @cfgmech
	.comm	_CFGMECH_NONE,8,3               ## @CFGMECH_NONE
	.comm	_CFGMECH_PCIE,8,3               ## @CFGMECH_PCIE
	.comm	_PCIR_VENDOR,4,2                ## @PCIR_VENDOR
	.comm	_PCIR_DEVICE,4,2                ## @PCIR_DEVICE
	.comm	_bootverbose,8,3                ## @bootverbose
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Enabled ECAM PCIe accesses\n"

	.no_dead_strip	_legacy_pci_cfgregopen
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function legacy_pci_cfgregopen
_legacy_pci_cfgregopen:                 ; @legacy_pci_cfgregopen
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x21, _cfgmech@GOTPAGE
Lloh1:
	ldr	x21, [x21, _cfgmech@GOTPAGEOFF]
	ldr	x8, [x21]
Lloh2:
	adrp	x9, _CFGMECH_NONE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _CFGMECH_NONE@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
Lloh5:
	adrp	x22, _CFGMECH_PCIE@GOTPAGE
Lloh6:
	ldr	x22, [x22, _CFGMECH_PCIE@GOTPAGEOFF]
	ldr	x10, [x22]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.eq	LBB0_10
; %bb.1:
	mov	x19, x0
Lloh7:
	adrp	x8, _PCIR_VENDOR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PCIR_VENDOR@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
	mov	w0, #0
	mov	w1, #0
	mov	w2, #0
	mov	w4, #2
	bl	_pci_cfgregread
	mov	x20, x0
Lloh10:
	adrp	x8, _PCIR_DEVICE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PCIR_DEVICE@GOTPAGEOFF]
Lloh12:
	ldr	w3, [x8]
	mov	w0, #0
	mov	w1, #0
	mov	w2, #0
	mov	w4, #2
	bl	_pci_cfgregread
	mov	w8, #32902
	cmp	w20, w8
	b.ne	LBB0_7
; %bb.2:
	mov	w8, #-9600
	add	w8, w0, w8
	cmp	w8, #16
	mov	w9, #1
	lsl	w8, w9, w8
	mov	w9, #17
	movk	w9, #1, lsl #16
	and	w8, w8, w9
	ccmp	w8, #0, #4, ls
	b.ne	LBB0_5
; %bb.3:
	mov	w8, #13714
	cmp	w0, w8
	mov	w8, #13712
	ccmp	w0, w8, #4, ne
	b.ne	LBB0_7
; %bb.4:
	mov	w0, #0
	mov	w1, #0
	mov	w2, #0
	mov	w3, #206
	mov	w4, #2
	bl	_pci_cfgregread
	lsl	w0, w0, #16
	b	LBB0_6
LBB0_5:
	mov	w0, #0
	mov	w1, #0
	mov	w2, #0
	mov	w3, #72
	mov	w4, #4
	bl	_pci_cfgregread
LBB0_6:
	mov	w1, #0
	mov	w2, #255
	bl	_pcie_cfgregopen
LBB0_7:
Lloh13:
	adrp	x8, _bootverbose@GOTPAGE
Lloh14:
	ldr	x8, [x8, _bootverbose@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	cbz	x8, LBB0_10
; %bb.8:
	ldr	x8, [x21]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.9:
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_device_printf
LBB0_10:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_cfgmech,8,3                    ; @cfgmech
	.comm	_CFGMECH_NONE,8,3               ; @CFGMECH_NONE
	.comm	_CFGMECH_PCIE,8,3               ; @CFGMECH_PCIE
	.comm	_PCIR_VENDOR,4,2                ; @PCIR_VENDOR
	.comm	_PCIR_DEVICE,4,2                ; @PCIR_DEVICE
	.comm	_bootverbose,8,3                ; @bootverbose
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Enabled ECAM PCIe accesses\n"

	.no_dead_strip	_legacy_pci_cfgregopen
.subsections_via_symbols
