	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amd_iommu_domain_enable_v2     ## -- Begin function amd_iommu_domain_enable_v2
	.p2align	4, 0x90
_amd_iommu_domain_enable_v2:            ## @amd_iommu_domain_enable_v2
	.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	%esi, %ebx
	callq	_to_pdomain
	testl	%ebx, %ebx
	jle	LBB0_6
## %bb.1:
	movq	%rax, %r15
	movq	_PASID_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	incl	%eax
	cmpl	%ebx, %eax
	jl	LBB0_6
## %bb.2:
	leal	-1(%rbx), %eax
	xorl	%r12d, %r12d
	cmpl	$512, %eax                      ## imm = 0x200
	jb	LBB0_5
## %bb.3:
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	incl	%r12d
	sarl	$9, %ebx
	leal	-1(%rbx), %eax
	cmpl	$511, %eax                      ## imm = 0x1FF
	ja	LBB0_4
LBB0_5:
	movq	_amd_iommu_max_glx_val@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jle	LBB0_7
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r15, %r14
	addq	$16, %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	cmpq	$0, (%r15)
	jg	LBB0_11
## %bb.8:
	movq	_PD_IOMMUV2_MASK@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	testl	%eax, 8(%r15)
	jne	LBB0_11
## %bb.9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_get_zeroed_page
	movq	%rax, 24(%r15)
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movl	%r12d, 12(%r15)
	movl	(%r13), %eax
	orl	%eax, 8(%r15)
	movq	%r15, %rdi
	callq	_update_domain
	xorl	%ebx, %ebx
LBB0_11:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_PASID_MASK,4,2                 ## @PASID_MASK
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_amd_iommu_max_glx_val,4,2      ## @amd_iommu_max_glx_val
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_PD_IOMMUV2_MASK,4,2            ## @PD_IOMMUV2_MASK
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amd_iommu_domain_enable_v2     ; -- Begin function amd_iommu_domain_enable_v2
	.p2align	2
_amd_iommu_domain_enable_v2:            ; @amd_iommu_domain_enable_v2
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	bl	_to_pdomain
	subs	w8, w20, #1
	b.lt	LBB0_7
; %bb.1:
Lloh0:
	adrp	x9, _PASID_MASK@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PASID_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	add	w9, w9, #1
	cmp	w9, w20
	b.lt	LBB0_7
; %bb.2:
	mov	x19, x0
	cmp	w8, #512
	b.hs	LBB0_4
; %bb.3:
	mov	w22, #0
	b	LBB0_6
LBB0_4:
	mov	w22, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	add	w22, w22, #1
	asr	w20, w20, #9
	sub	w8, w20, #1
	cmp	w8, #511
	b.hi	LBB0_5
LBB0_6:
Lloh3:
	adrp	x8, _amd_iommu_max_glx_val@GOTPAGE
Lloh4:
	ldr	x8, [x8, _amd_iommu_max_glx_val@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w22, w8
	b.le	LBB0_9
LBB0_7:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_8:
	mov	x0, x21
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_9:
	add	x20, x19, #16
	mov	x0, x20
	bl	_spin_lock_irqsave
Lloh9:
	adrp	x8, _EBUSY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w21, w8
	ldr	x8, [x19]
	cmp	x8, #0
	b.gt	LBB0_14
; %bb.10:
	ldr	w8, [x19, #8]
Lloh12:
	adrp	x23, _PD_IOMMUV2_MASK@GOTPAGE
Lloh13:
	ldr	x23, [x23, _PD_IOMMUV2_MASK@GOTPAGEOFF]
	ldr	w9, [x23]
	tst	w9, w8
	b.ne	LBB0_14
; %bb.11:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w21, [x8]
Lloh17:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh18:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	bl	_get_zeroed_page
	str	x0, [x19, #24]
	cbz	x0, LBB0_13
; %bb.12:
	ldr	w8, [x23]
	ldr	w9, [x19, #8]
	orr	w8, w9, w8
	stp	w8, w22, [x19, #8]
	mov	x0, x19
	bl	_update_domain
	mov	w21, #0
	b	LBB0_14
LBB0_13:
	neg	w21, w21
LBB0_14:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_PASID_MASK,4,2                 ; @PASID_MASK
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_amd_iommu_max_glx_val,4,2      ; @amd_iommu_max_glx_val
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_PD_IOMMUV2_MASK,4,2            ; @PD_IOMMUV2_MASK
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
.subsections_via_symbols
