	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_vc_enable
_pci_vc_enable:                         ## @pci_vc_enable
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movl	%esi, %ebx
	movq	%rdi, %r13
	callq	_pci_is_pcie
	testl	%eax, %eax
	je	LBB0_24
## %bb.1:
	movq	%r13, %rdi
	callq	_pcie_downstream_port
	testl	%eax, %eax
	je	LBB0_24
## %bb.2:
	movq	_PCI_VC_RES_CTRL@GOTPCREL(%rip), %rax
	movq	_PCI_CAP_VC_PER_VC_SIZEOF@GOTPCREL(%rip), %rcx
	imull	(%rcx), %r15d
	addl	%ebx, %r15d
	movl	(%rax), %r14d
	addl	%r15d, %r14d
	movq	_PCI_VC_RES_STATUS@GOTPCREL(%rip), %rax
	addl	(%rax), %r15d
	leaq	-68(%rbp), %rdx
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_pci_read_config_dword
	movq	_PCI_VC_RES_CTRL_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	andl	-68(%rbp), %r12d
	leaq	-88(%rbp), %rdx
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_pci_read_config_dword
	movl	-88(%rbp), %edi
	callq	_PCI_EXT_CAP_ID
	movq	_PCI_EXT_CAP_ID_VC9@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.4:
	movq	(%r13), %rdi
	callq	_pci_is_root_bus
	testq	%rax, %rax
	je	LBB0_5
LBB0_3:
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
                                        ## implicit-def: $ebx
LBB0_19:
	movq	_PCI_VC_RES_CTRL_ENABLE@GOTPCREL(%rip), %rax
	movl	-68(%rbp), %edx
	orl	(%rax), %edx
	movl	%edx, -68(%rbp)
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_pci_write_config_dword
	movq	_PCI_VC_RES_STATUS_NEGO@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_pci_wait_for_pending
	testl	%eax, %eax
	jne	LBB0_21
## %bb.20:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	movl	%r12d, %edx
	callq	_pci_err
LBB0_21:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	testq	%r15, %r15
	je	LBB0_24
## %bb.22:
	movl	(%r14), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_pci_wait_for_pending
	testl	%eax, %eax
	jne	LBB0_24
## %bb.23:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%r12d, %edx
	callq	_pci_err
LBB0_24:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	(%r13), %rax
	movq	(%rax), %rdi
	movq	_PCI_EXT_CAP_ID_VC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_pci_find_ext_capability
	testl	%eax, %eax
	je	LBB0_3
## %bb.6:
	movl	%eax, %ebx
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	(%r13), %rax
	movq	(%rax), %rdi
	movq	_PCI_VC_PORT_CAP1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addl	%ebx, %esi
	leaq	-84(%rbp), %rdx
	callq	_pci_read_config_dword
	movq	_PCI_VC_CAP1_EVCC@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	andl	-84(%rbp), %r13d
	jle	LBB0_7
## %bb.8:
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movl	%r14d, -56(%rbp)                ## 4-byte Spill
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	movl	%r15d, -64(%rbp)                ## 4-byte Spill
	negl	%r13d
	movl	$1, %r12d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	_PCI_CAP_VC_PER_VC_SIZEOF@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	imull	%r12d, %ebx
	addl	-48(%rbp), %ebx                 ## 4-byte Folded Reload
	movq	_PCI_VC_RES_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	addl	%ebx, %r15d
	movq	_PCI_VC_RES_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	(%rax), %rdi
	movl	%r15d, %esi
	leaq	-60(%rbp), %rdx
	callq	_pci_read_config_dword
	movl	-60(%rbp), %edx
	movq	_PCI_VC_RES_CTRL_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%edx, %eax
	cmpl	-52(%rbp), %eax                 ## 4-byte Folded Reload
	je	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_10 Depth=1
	leal	(%r12,%r13), %eax
	incl	%eax
	movl	%r12d, %ecx
	incl	%ecx
	movl	%ecx, %r12d
	cmpl	$1, %eax
	jne	LBB0_10
## %bb.17:
	addl	%r14d, %ebx
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	-64(%rbp), %r15d                ## 4-byte Reload
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	movl	-56(%rbp), %r14d                ## 4-byte Reload
	jmp	LBB0_18
LBB0_7:
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
                                        ## implicit-def: $ebx
LBB0_18:
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_19
LBB0_11:
	addl	%r14d, %ebx
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movq	(%r13), %rax
	movq	(%rax), %rcx
	movq	%rcx, %rax
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	testq	%rcx, %rcx
	je	LBB0_12
## %bb.13:
	movq	_PCI_VC_RES_CTRL_ENABLE@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	testl	%edx, %eax
	je	LBB0_14
## %bb.15:
	notl	%eax
	andl	%eax, %edx
	movl	%edx, -60(%rbp)
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_pci_write_config_dword
	movq	%r12, %rdi
	movl	(%r14), %eax
	movl	-60(%rbp), %edx
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	movl	-56(%rbp), %r14d                ## 4-byte Reload
	jmp	LBB0_16
LBB0_12:
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	-64(%rbp), %r15d                ## 4-byte Reload
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	movl	-56(%rbp), %r14d                ## 4-byte Reload
	jmp	LBB0_19
LBB0_14:
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	movl	-56(%rbp), %r14d                ## 4-byte Reload
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_16:
	orl	%eax, %edx
	movl	%edx, -60(%rbp)
	movl	%r15d, %esi
	callq	_pci_write_config_dword
	movl	-64(%rbp), %r15d                ## 4-byte Reload
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_VC_RES_CTRL,4,2            ## @PCI_VC_RES_CTRL
	.comm	_PCI_CAP_VC_PER_VC_SIZEOF,4,2   ## @PCI_CAP_VC_PER_VC_SIZEOF
	.comm	_PCI_VC_RES_STATUS,4,2          ## @PCI_VC_RES_STATUS
	.comm	_PCI_VC_RES_CTRL_ID,4,2         ## @PCI_VC_RES_CTRL_ID
	.comm	_PCI_EXT_CAP_ID_VC9,8,3         ## @PCI_EXT_CAP_ID_VC9
	.comm	_PCI_EXT_CAP_ID_VC,4,2          ## @PCI_EXT_CAP_ID_VC
	.comm	_PCI_VC_PORT_CAP1,4,2           ## @PCI_VC_PORT_CAP1
	.comm	_PCI_VC_CAP1_EVCC,4,2           ## @PCI_VC_CAP1_EVCC
	.comm	_PCI_VC_RES_CTRL_ENABLE,4,2     ## @PCI_VC_RES_CTRL_ENABLE
	.comm	_PCI_VC_RES_STATUS_NEGO,4,2     ## @PCI_VC_RES_STATUS_NEGO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"VC%d negotiation stuck pending\n"

	.no_dead_strip	_pci_vc_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pci_vc_enable
_pci_vc_enable:                         ; @pci_vc_enable
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x2
	mov	x23, x1
	mov	x19, x0
	bl	_pci_is_pcie
	cbz	w0, LBB0_10
; %bb.1:
	mov	x0, x19
	bl	_pcie_downstream_port
	cbz	w0, LBB0_10
; %bb.2:
Lloh0:
	adrp	x8, _PCI_VC_RES_CTRL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_VC_RES_CTRL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _PCI_CAP_VC_PER_VC_SIZEOF@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PCI_CAP_VC_PER_VC_SIZEOF@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	madd	w9, w9, w20, w23
	add	w22, w9, w8
Lloh6:
	adrp	x28, _PCI_VC_RES_STATUS@GOTPAGE
Lloh7:
	ldr	x28, [x28, _PCI_VC_RES_STATUS@GOTPAGEOFF]
	ldr	w8, [x28]
	add	w27, w9, w8
	add	x2, sp, #28
	mov	x0, x19
	mov	x1, x22
	bl	_pci_read_config_dword
	ldr	w8, [sp, #28]
Lloh8:
	adrp	x26, _PCI_VC_RES_CTRL_ID@GOTPAGE
Lloh9:
	ldr	x26, [x26, _PCI_VC_RES_CTRL_ID@GOTPAGEOFF]
	ldr	w9, [x26]
	and	w25, w9, w8
	add	x2, sp, #24
	mov	x0, x19
	mov	x1, x23
	bl	_pci_read_config_dword
	ldr	w0, [sp, #24]
	bl	_PCI_EXT_CAP_ID
Lloh10:
	adrp	x8, _PCI_EXT_CAP_ID_VC9@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PCI_EXT_CAP_ID_VC9@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
Lloh13:
	adrp	x20, _PCI_VC_RES_CTRL_ENABLE@GOTPAGE
Lloh14:
	ldr	x20, [x20, _PCI_VC_RES_CTRL_ENABLE@GOTPAGEOFF]
	cmp	x0, x8
	b.eq	LBB0_4
; %bb.3:
	ldr	x0, [x19]
	bl	_pci_is_root_bus
	cbz	x0, LBB0_11
LBB0_4:
	mov	x23, #0
                                        ; implicit-def: $w24
LBB0_5:
	ldr	w8, [x20]
	ldr	w9, [sp, #28]
	orr	w2, w9, w8
	str	w2, [sp, #28]
	mov	x0, x19
	mov	x1, x22
	bl	_pci_write_config_dword
Lloh15:
	adrp	x20, _PCI_VC_RES_STATUS_NEGO@GOTPAGE
Lloh16:
	ldr	x20, [x20, _PCI_VC_RES_STATUS_NEGO@GOTPAGEOFF]
	ldr	w2, [x20]
	mov	x0, x19
	mov	x1, x27
	bl	_pci_wait_for_pending
	cbnz	w0, LBB0_7
; %bb.6:
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x25
	bl	_pci_err
LBB0_7:
	cbz	x23, LBB0_10
; %bb.8:
	ldr	w2, [x20]
	mov	x0, x23
	mov	x1, x24
	bl	_pci_wait_for_pending
	cbnz	w0, LBB0_10
; %bb.9:
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x23
	mov	x2, x25
	bl	_pci_err
LBB0_10:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_11:
	ldr	x8, [x19]
	ldr	x0, [x8]
Lloh21:
	adrp	x8, _PCI_EXT_CAP_ID_VC@GOTPAGE
Lloh22:
	ldr	x8, [x8, _PCI_EXT_CAP_ID_VC@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	bl	_pci_find_ext_capability
	cbz	w0, LBB0_4
; %bb.12:
	mov	x23, x0
	ldr	x8, [x19]
	ldr	x0, [x8]
Lloh24:
	adrp	x8, _PCI_VC_PORT_CAP1@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PCI_VC_PORT_CAP1@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	add	w1, w8, w23
	add	x2, sp, #20
	bl	_pci_read_config_dword
	ldr	w8, [sp, #20]
Lloh27:
	adrp	x9, _PCI_VC_CAP1_EVCC@GOTPAGE
Lloh28:
	ldr	x9, [x9, _PCI_VC_CAP1_EVCC@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	and	w21, w9, w8
	cmp	w21, #1
	b.lt	LBB0_4
; %bb.13:
	stp	w27, w25, [sp, #8]              ; 8-byte Folded Spill
	mov	w20, #0
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
Lloh30:
	adrp	x8, _PCI_VC_RES_CTRL@GOTPAGE
Lloh31:
	ldr	x8, [x8, _PCI_VC_RES_CTRL@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
Lloh33:
	adrp	x9, _PCI_CAP_VC_PER_VC_SIZEOF@GOTPAGE
Lloh34:
	ldr	x9, [x9, _PCI_CAP_VC_PER_VC_SIZEOF@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	madd	w9, w9, w20, w9
	add	w24, w9, w23
	add	w25, w24, w8
	ldr	w27, [x28]
	ldr	x8, [x19]
	ldr	x0, [x8]
	add	x2, sp, #16
	mov	x1, x25
	bl	_pci_read_config_dword
	ldp	w10, w8, [sp, #12]              ; 4-byte Folded Reload
	ldr	w9, [x26]
	and	w9, w9, w8
	cmp	w9, w10
	b.eq	LBB0_17
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	add	w20, w20, #1
	cmp	w21, w20
	b.ne	LBB0_14
; %bb.16:
	mov	x23, #0
	add	w24, w24, w27
	b	LBB0_21
LBB0_17:
	add	w24, w24, w27
	ldr	x9, [x19]
	ldr	x23, [x9]
	cbz	x23, LBB0_21
; %bb.18:
Lloh36:
	adrp	x20, _PCI_VC_RES_CTRL_ENABLE@GOTPAGE
Lloh37:
	ldr	x20, [x20, _PCI_VC_RES_CTRL_ENABLE@GOTPAGEOFF]
	ldr	w9, [x20]
	tst	w9, w8
	b.eq	LBB0_20
; %bb.19:
	bic	w2, w8, w9
	str	w2, [sp, #16]
	mov	x0, x23
	mov	x1, x25
	bl	_pci_write_config_dword
	ldr	w9, [x20]
	ldr	w8, [sp, #16]
LBB0_20:
	ldr	w27, [sp, #8]                   ; 4-byte Folded Reload
	orr	w2, w8, w9
	str	w2, [sp, #16]
	mov	x0, x23
	mov	x1, x25
	bl	_pci_write_config_dword
	ldr	w25, [sp, #12]                  ; 4-byte Folded Reload
	b	LBB0_5
LBB0_21:
	ldp	w27, w25, [sp, #8]              ; 8-byte Folded Reload
Lloh38:
	adrp	x20, _PCI_VC_RES_CTRL_ENABLE@GOTPAGE
Lloh39:
	ldr	x20, [x20, _PCI_VC_RES_CTRL_ENABLE@GOTPAGEOFF]
	b	LBB0_5
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_VC_RES_CTRL,4,2            ; @PCI_VC_RES_CTRL
	.comm	_PCI_CAP_VC_PER_VC_SIZEOF,4,2   ; @PCI_CAP_VC_PER_VC_SIZEOF
	.comm	_PCI_VC_RES_STATUS,4,2          ; @PCI_VC_RES_STATUS
	.comm	_PCI_VC_RES_CTRL_ID,4,2         ; @PCI_VC_RES_CTRL_ID
	.comm	_PCI_EXT_CAP_ID_VC9,8,3         ; @PCI_EXT_CAP_ID_VC9
	.comm	_PCI_EXT_CAP_ID_VC,4,2          ; @PCI_EXT_CAP_ID_VC
	.comm	_PCI_VC_PORT_CAP1,4,2           ; @PCI_VC_PORT_CAP1
	.comm	_PCI_VC_CAP1_EVCC,4,2           ; @PCI_VC_CAP1_EVCC
	.comm	_PCI_VC_RES_CTRL_ENABLE,4,2     ; @PCI_VC_RES_CTRL_ENABLE
	.comm	_PCI_VC_RES_STATUS_NEGO,4,2     ; @PCI_VC_RES_STATUS_NEGO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"VC%d negotiation stuck pending\n"

	.no_dead_strip	_pci_vc_enable
.subsections_via_symbols
