	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pdev_iommuv2_enable
_pdev_iommuv2_enable:                   ## @pdev_iommuv2_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_AMD_PRI_DEV_ERRATUM_LIMIT_REQ_ONE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_pdev_pri_erratum
	testl	%eax, %eax
	movl	$32, %eax
	movl	$1, %r15d
	cmovel	%eax, %r15d
	movq	_AMD_PRI_DEV_ERRATUM_ENABLE_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_pdev_pri_erratum
	movl	%eax, %r12d
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_pci_enable_pasid
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.1:
	movq	%r14, %rdi
	callq	_pci_reset_pri
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.2:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_pci_enable_pri
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_3
LBB0_7:
	movq	%r14, %rdi
	callq	_pci_disable_pri
	movq	%r14, %rdi
	callq	_pci_disable_pasid
LBB0_8:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	testl	%r12d, %r12d
	je	LBB0_5
## %bb.4:
	movq	%r14, %rdi
	callq	_pri_reset_while_enabled
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
LBB0_5:
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_pci_enable_ats
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:
	xorl	%ebx, %ebx
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_AMD_PRI_DEV_ERRATUM_LIMIT_REQ_ONE,4,2 ## @AMD_PRI_DEV_ERRATUM_LIMIT_REQ_ONE
	.comm	_AMD_PRI_DEV_ERRATUM_ENABLE_RESET,4,2 ## @AMD_PRI_DEV_ERRATUM_ENABLE_RESET
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.no_dead_strip	_pdev_iommuv2_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pdev_iommuv2_enable
_pdev_iommuv2_enable:                   ; @pdev_iommuv2_enable
	.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, x0
Lloh0:
	adrp	x8, _AMD_PRI_DEV_ERRATUM_LIMIT_REQ_ONE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AMD_PRI_DEV_ERRATUM_LIMIT_REQ_ONE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_pdev_pri_erratum
	cmp	w0, #0
	mov	w8, #32
	csinc	w22, w8, wzr, eq
Lloh3:
	adrp	x8, _AMD_PRI_DEV_ERRATUM_ENABLE_RESET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AMD_PRI_DEV_ERRATUM_ENABLE_RESET@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_pdev_pri_erratum
	mov	x21, x0
	mov	x0, x19
	mov	w1, #0
	bl	_pci_enable_pasid
	mov	x20, x0
	cbnz	w0, LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_pci_reset_pri
	mov	x20, x0
	cbnz	w0, LBB0_3
; %bb.2:
	mov	x0, x19
	mov	x1, x22
	bl	_pci_enable_pri
	mov	x20, x0
	cbz	w0, LBB0_5
LBB0_3:
	mov	x0, x19
	bl	_pci_disable_pri
	mov	x0, x19
	bl	_pci_disable_pasid
LBB0_4:
	mov	x0, x20
	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_5:
	cbz	w21, LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_pri_reset_while_enabled
	mov	x20, x0
	cbnz	w0, LBB0_3
LBB0_7:
Lloh6:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_pci_enable_ats
	mov	x20, x0
	cbnz	w0, LBB0_3
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_AMD_PRI_DEV_ERRATUM_LIMIT_REQ_ONE,4,2 ; @AMD_PRI_DEV_ERRATUM_LIMIT_REQ_ONE
	.comm	_AMD_PRI_DEV_ERRATUM_ENABLE_RESET,4,2 ; @AMD_PRI_DEV_ERRATUM_ENABLE_RESET
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.no_dead_strip	_pdev_iommuv2_enable
.subsections_via_symbols
