	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_enable_ptm                 ## -- Begin function pci_enable_ptm
	.p2align	4, 0x90
_pci_enable_ptm:                        ## @pci_enable_ptm
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_pci_is_pcie
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	_PCI_EXT_CAP_ID_PTM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_pci_find_ext_capability
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movslq	%eax, %r15
	movq	_PCI_PTM_CAP@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r15, %rsi
	leaq	-28(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_pci_read_config_dword
	movq	_PCI_PTM_CAP_REQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -28(%rbp)
	je	LBB0_1
## %bb.4:
	movq	%rbx, %rdi
	callq	_pci_pcie_type
	movq	_PCI_EXP_TYPE_ENDPOINT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.5:
	movq	%rbx, %rdi
	callq	_pci_upstream_bridge
	testq	%rax, %rax
	je	LBB0_1
## %bb.6:
	cmpl	$0, (%rax)
	je	LBB0_1
## %bb.7:
	movl	4(%rax), %edx
	movl	%edx, 4(%rbx)
	shll	$8, %edx
	jmp	LBB0_10
LBB0_8:
	movq	%rbx, %rdi
	callq	_pci_pcie_type
	movq	_PCI_EXP_TYPE_RC_END@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.9:
	movl	$0, 4(%rbx)
	xorl	%edx, %edx
LBB0_10:
	movq	_PCI_PTM_CTRL_ENABLE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_PCI_PTM_CTRL@GOTPCREL(%rip), %rax
	addq	(%rax), %r15
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_pci_write_config_dword
	movl	$1, (%rbx)
	movq	%rbx, %rdi
	callq	_pci_ptm_info
	xorl	%eax, %eax
	testq	%r14, %r14
	je	LBB0_12
## %bb.11:
	movl	4(%rbx), %ecx
	movl	%ecx, (%r14)
	jmp	LBB0_12
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PCI_EXT_CAP_ID_PTM,4,2         ## @PCI_EXT_CAP_ID_PTM
	.comm	_PCI_PTM_CAP,8,3                ## @PCI_PTM_CAP
	.comm	_PCI_PTM_CAP_REQ,4,2            ## @PCI_PTM_CAP_REQ
	.comm	_PCI_EXP_TYPE_ENDPOINT,8,3      ## @PCI_EXP_TYPE_ENDPOINT
	.comm	_PCI_EXP_TYPE_RC_END,8,3        ## @PCI_EXP_TYPE_RC_END
	.comm	_PCI_PTM_CTRL_ENABLE,4,2        ## @PCI_PTM_CTRL_ENABLE
	.comm	_PCI_PTM_CTRL,8,3               ## @PCI_PTM_CTRL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_enable_ptm                 ; -- Begin function pci_enable_ptm
	.p2align	2
_pci_enable_ptm:                        ; @pci_enable_ptm
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x1
	mov	x20, x0
	bl	_pci_is_pcie
	cbz	w0, LBB0_11
; %bb.1:
Lloh0:
	adrp	x8, _PCI_EXT_CAP_ID_PTM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_EXT_CAP_ID_PTM@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_pci_find_ext_capability
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_11
; %bb.2:
	sxtw	x21, w0
Lloh3:
	adrp	x8, _PCI_PTM_CAP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCI_PTM_CAP@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	add	x1, x8, x21
	add	x2, sp, #12
	mov	x0, x20
	bl	_pci_read_config_dword
	ldr	w8, [sp, #12]
Lloh6:
	adrp	x9, _PCI_PTM_CAP_REQ@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PCI_PTM_CAP_REQ@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.3:
	mov	x0, x20
	bl	_pci_pcie_type
Lloh9:
	adrp	x8, _PCI_EXP_TYPE_ENDPOINT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PCI_EXP_TYPE_ENDPOINT@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_7
; %bb.4:
	mov	x0, x20
	bl	_pci_upstream_bridge
	cbz	x0, LBB0_11
; %bb.5:
	ldr	w8, [x0]
	cbz	w8, LBB0_11
; %bb.6:
	ldr	w8, [x0, #4]
	str	w8, [x20, #4]
	lsl	w8, w8, #8
	b	LBB0_9
LBB0_7:
	mov	x0, x20
	bl	_pci_pcie_type
Lloh12:
	adrp	x8, _PCI_EXP_TYPE_RC_END@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PCI_EXP_TYPE_RC_END@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.8:
	mov	w8, #0
	str	wzr, [x20, #4]
LBB0_9:
Lloh15:
	adrp	x9, _PCI_PTM_CTRL_ENABLE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _PCI_PTM_CTRL_ENABLE@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w2, w8, w9
Lloh18:
	adrp	x8, _PCI_PTM_CTRL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PCI_PTM_CTRL@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	add	x1, x8, x21
	mov	x0, x20
	bl	_pci_write_config_dword
	mov	w8, #1
	str	w8, [x20]
	mov	x0, x20
	bl	_pci_ptm_info
	mov	w0, #0
	cbz	x19, LBB0_12
; %bb.10:
	ldr	w8, [x20, #4]
	str	w8, [x19]
	b	LBB0_12
LBB0_11:
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w0, w8
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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PCI_EXT_CAP_ID_PTM,4,2         ; @PCI_EXT_CAP_ID_PTM
	.comm	_PCI_PTM_CAP,8,3                ; @PCI_PTM_CAP
	.comm	_PCI_PTM_CAP_REQ,4,2            ; @PCI_PTM_CAP_REQ
	.comm	_PCI_EXP_TYPE_ENDPOINT,8,3      ; @PCI_EXP_TYPE_ENDPOINT
	.comm	_PCI_EXP_TYPE_RC_END,8,3        ; @PCI_EXP_TYPE_RC_END
	.comm	_PCI_PTM_CTRL_ENABLE,4,2        ; @PCI_PTM_CTRL_ENABLE
	.comm	_PCI_PTM_CTRL,8,3               ; @PCI_PTM_CTRL
.subsections_via_symbols
