	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __pci_disable_link_state
___pci_disable_link_state:              ## @__pci_disable_link_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
	movl	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	(%rax), %r12
	callq	_pci_is_pcie
	xorl	%r13d, %r13d
	testl	%eax, %eax
	je	LBB0_17
## %bb.1:
	movq	%rbx, %rdi
	callq	_pcie_downstream_port
	testq	%rax, %rax
	cmovneq	%rbx, %r12
	testq	%r12, %r12
	je	LBB0_3
## %bb.2:
	cmpq	$0, (%r12)
	je	LBB0_3
## %bb.5:
	movq	_aspm_disabled@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_pci_warn
	movq	_EPERM@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_17:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	testl	%r14d, %r14d
	je	LBB0_9
## %bb.8:
	movq	_pci_bus_sem@GOTPCREL(%rip), %rdi
	callq	_down_read
LBB0_9:
	movq	_aspm_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	(%r12), %r12
	movq	_PCIE_LINK_STATE_L0S@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_11
## %bb.10:
	movq	_ASPM_STATE_L0S@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 8(%r12)
LBB0_11:
	movq	_PCIE_LINK_STATE_L1@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_13
## %bb.12:
	movq	_ASPM_STATE_L1@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 8(%r12)
LBB0_13:
	movq	%r12, %rdi
	callq	_policy_to_aspm_state
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_pcie_config_aspm_link
	movq	_PCIE_LINK_STATE_CLKPM@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_15
## %bb.14:
	movq	$0, (%r12)
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_pcie_set_clkpm
LBB0_15:
	movq	_aspm_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	testl	%r14d, %r14d
	je	LBB0_17
## %bb.16:
	movq	_pci_bus_sem@GOTPCREL(%rip), %rdi
	callq	_up_read
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_aspm_disabled,8,3              ## @aspm_disabled
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"can't disable ASPM; OS doesn't have ASPM control\n"

	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_pci_bus_sem,4,2                ## @pci_bus_sem
	.comm	_aspm_lock,4,2                  ## @aspm_lock
	.comm	_PCIE_LINK_STATE_L0S,4,2        ## @PCIE_LINK_STATE_L0S
	.comm	_ASPM_STATE_L0S,4,2             ## @ASPM_STATE_L0S
	.comm	_PCIE_LINK_STATE_L1,4,2         ## @PCIE_LINK_STATE_L1
	.comm	_ASPM_STATE_L1,4,2              ## @ASPM_STATE_L1
	.comm	_PCIE_LINK_STATE_CLKPM,4,2      ## @PCIE_LINK_STATE_CLKPM
	.no_dead_strip	___pci_disable_link_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __pci_disable_link_state
___pci_disable_link_state:              ; @__pci_disable_link_state
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x8, [x0, #8]
	ldr	x22, [x8]
	bl	_pci_is_pcie
	cbz	w0, LBB0_7
; %bb.1:
	mov	x0, x21
	bl	_pcie_downstream_port
	cmp	x0, #0
	csel	x22, x22, x21, eq
	cbz	x22, LBB0_5
; %bb.2:
	ldr	x8, [x22]
	cbz	x8, LBB0_5
; %bb.3:
Lloh0:
	adrp	x8, _aspm_disabled@GOTPAGE
Lloh1:
	ldr	x8, [x8, _aspm_disabled@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_8
; %bb.4:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_pci_warn
Lloh5:
	adrp	x8, _EPERM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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
LBB0_8:
	cbz	w19, LBB0_10
; %bb.9:
Lloh9:
	adrp	x0, _pci_bus_sem@GOTPAGE
Lloh10:
	ldr	x0, [x0, _pci_bus_sem@GOTPAGEOFF]
	bl	_down_read
LBB0_10:
Lloh11:
	adrp	x0, _aspm_lock@GOTPAGE
Lloh12:
	ldr	x0, [x0, _aspm_lock@GOTPAGEOFF]
	bl	_mutex_lock
	ldr	x21, [x22]
Lloh13:
	adrp	x8, _PCIE_LINK_STATE_L0S@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PCIE_LINK_STATE_L0S@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_12
; %bb.11:
Lloh16:
	adrp	x8, _ASPM_STATE_L0S@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ASPM_STATE_L0S@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	ldr	w9, [x21, #8]
	orr	w8, w9, w8
	str	w8, [x21, #8]
LBB0_12:
Lloh19:
	adrp	x8, _PCIE_LINK_STATE_L1@GOTPAGE
Lloh20:
	ldr	x8, [x8, _PCIE_LINK_STATE_L1@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_14
; %bb.13:
Lloh22:
	adrp	x8, _ASPM_STATE_L1@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ASPM_STATE_L1@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	ldr	w9, [x21, #8]
	orr	w8, w9, w8
	str	w8, [x21, #8]
LBB0_14:
	mov	x0, x21
	bl	_policy_to_aspm_state
	mov	x1, x0
	mov	x0, x21
	bl	_pcie_config_aspm_link
Lloh25:
	adrp	x8, _PCIE_LINK_STATE_CLKPM@GOTPAGE
Lloh26:
	ldr	x8, [x8, _PCIE_LINK_STATE_CLKPM@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_16
; %bb.15:
	str	xzr, [x21]
	mov	x0, x21
	mov	w1, #0
	bl	_pcie_set_clkpm
LBB0_16:
Lloh28:
	adrp	x0, _aspm_lock@GOTPAGE
Lloh29:
	ldr	x0, [x0, _aspm_lock@GOTPAGEOFF]
	bl	_mutex_unlock
	cbz	w19, LBB0_18
; %bb.17:
Lloh30:
	adrp	x0, _pci_bus_sem@GOTPAGE
Lloh31:
	ldr	x0, [x0, _pci_bus_sem@GOTPAGEOFF]
	bl	_up_read
LBB0_18:
	mov	w0, #0
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_aspm_disabled,8,3              ; @aspm_disabled
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"can't disable ASPM; OS doesn't have ASPM control\n"

	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_pci_bus_sem,4,2                ; @pci_bus_sem
	.comm	_aspm_lock,4,2                  ; @aspm_lock
	.comm	_PCIE_LINK_STATE_L0S,4,2        ; @PCIE_LINK_STATE_L0S
	.comm	_ASPM_STATE_L0S,4,2             ; @ASPM_STATE_L0S
	.comm	_PCIE_LINK_STATE_L1,4,2         ; @PCIE_LINK_STATE_L1
	.comm	_ASPM_STATE_L1,4,2              ; @ASPM_STATE_L1
	.comm	_PCIE_LINK_STATE_CLKPM,4,2      ; @PCIE_LINK_STATE_CLKPM
	.no_dead_strip	___pci_disable_link_state
.subsections_via_symbols
