	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iommu_map_page
_iommu_map_page:                        ## @iommu_map_page
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -56(%rbp)                 ## 4-byte Spill
	movl	%r8d, %r12d
	movq	%rcx, %r14
	movq	%rdx, %r13
	movq	%rdi, %rbx
	movl	$0, -48(%rbp)
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rdi
	movq	%rcx, %rsi
	callq	_IS_ALIGNED
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_BUG_ON
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_IS_ALIGNED
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_BUG_ON
	xorl	%r15d, %r15d
	movq	_IOMMU_PROT_MASK@GOTPCREL(%rip), %rax
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	testl	%r12d, (%rax)
	je	LBB0_1
## %bb.2:
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_PAGE_SIZE_PTE_COUNT
	movl	%eax, %r13d
	leaq	-48(%rbp), %r9
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	%r14, %rdx
	xorl	%ecx, %ecx
	movl	-56(%rbp), %r8d                 ## 4-byte Reload
	callq	_alloc_pte
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r12
	movl	%r13d, %ebx
	testl	%r13d, %r13d
	jle	LBB0_5
## %bb.7:
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %r14
	movq	%r12, %rbx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %esi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	callq	_free_clear_pte
	movq	%rax, %r15
	addq	$4, %rbx
	decq	%r14
	jne	LBB0_8
## %bb.9:
	testq	%r15, %r15
	je	LBB0_10
## %bb.11:
	movl	$1, -48(%rbp)
	jmp	LBB0_12
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	cmpl	$0, -48(%rbp)
	jne	LBB0_33
	jmp	LBB0_34
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_31
LBB0_5:
	xorl	%r15d, %r15d
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	jmp	LBB0_6
LBB0_10:
	xorl	%r15d, %r15d
LBB0_12:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movl	%r13d, %eax
	cmpl	$2, %r13d
	jl	LBB0_6
## %bb.13:
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	___sme_set
	movl	%eax, %edi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_PAGE_SIZE_PTE
	movl	%eax, %ebx
	movl	$7, %edi
	callq	_PM_LEVEL_ENC
	movq	_IOMMU_PTE_PR@GOTPCREL(%rip), %rcx
	movq	_IOMMU_PTE_FC@GOTPCREL(%rip), %rdx
	orl	%ebx, %eax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	orl	(%rcx), %eax
	orl	(%rdx), %eax
	jmp	LBB0_14
LBB0_6:
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	___sme_set
	movq	_IOMMU_PTE_PR@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_IOMMU_PTE_FC@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
LBB0_14:
	movq	_IOMMU_PROT_IR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%r14d, %ecx
	je	LBB0_16
## %bb.15:
	movq	_IOMMU_PTE_IR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_16:
	movq	_IOMMU_PROT_IW@GOTPCREL(%rip), %rdx
	andl	(%rdx), %r14d
	je	LBB0_18
## %bb.17:
	movq	_IOMMU_PTE_IW@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r14d
LBB0_18:
	testl	%r13d, %r13d
	jle	LBB0_30
## %bb.19:
	orl	%eax, %ecx
	orl	%r14d, %ecx
	cmpl	$8, %r13d
	jae	LBB0_21
## %bb.20:
	xorl	%eax, %eax
	jmp	LBB0_29
LBB0_21:
	movl	%ebx, %eax
	andl	$-8, %eax
	movd	%ecx, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	leaq	-8(%rax), %rdi
	movq	%rdi, %rsi
	shrq	$3, %rsi
	incq	%rsi
	movl	%esi, %edx
	andl	$7, %edx
	cmpq	$56, %rdi
	jae	LBB0_23
## %bb.22:
	xorl	%edi, %edi
	jmp	LBB0_25
LBB0_23:
	andq	$-8, %rsi
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, (%r12,%rdi,4)
	movdqu	%xmm0, 16(%r12,%rdi,4)
	movdqu	%xmm0, 32(%r12,%rdi,4)
	movdqu	%xmm0, 48(%r12,%rdi,4)
	movdqu	%xmm0, 64(%r12,%rdi,4)
	movdqu	%xmm0, 80(%r12,%rdi,4)
	movdqu	%xmm0, 96(%r12,%rdi,4)
	movdqu	%xmm0, 112(%r12,%rdi,4)
	movdqu	%xmm0, 128(%r12,%rdi,4)
	movdqu	%xmm0, 144(%r12,%rdi,4)
	movdqu	%xmm0, 160(%r12,%rdi,4)
	movdqu	%xmm0, 176(%r12,%rdi,4)
	movdqu	%xmm0, 192(%r12,%rdi,4)
	movdqu	%xmm0, 208(%r12,%rdi,4)
	movdqu	%xmm0, 224(%r12,%rdi,4)
	movdqu	%xmm0, 240(%r12,%rdi,4)
	addq	$64, %rdi
	addq	$-8, %rsi
	jne	LBB0_24
LBB0_25:
	testq	%rdx, %rdx
	je	LBB0_28
## %bb.26:
	leaq	(%r12,%rdi,4), %rsi
	addq	$16, %rsi
	shlq	$5, %rdx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_27:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, -16(%rsi,%rdi)
	movdqu	%xmm0, (%rsi,%rdi)
	addq	$32, %rdi
	cmpq	%rdi, %rdx
	jne	LBB0_27
LBB0_28:
	xorl	%r14d, %r14d
	cmpq	%rbx, %rax
	je	LBB0_31
	.p2align	4, 0x90
LBB0_29:                                ## =>This Inner Loop Header: Depth=1
	movl	%ecx, (%r12,%rax,4)
	incq	%rax
	cmpq	%rax, %rbx
	jne	LBB0_29
LBB0_30:
	xorl	%r14d, %r14d
LBB0_31:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	cmpl	$0, -48(%rbp)
	je	LBB0_34
LBB0_33:
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	%rbx, %rdi
	callq	_update_domain
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
LBB0_34:
	movq	%r15, %rdi
	callq	_free_page_list
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IOMMU_PROT_MASK,4,2            ## @IOMMU_PROT_MASK
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_IOMMU_PTE_PR,4,2               ## @IOMMU_PTE_PR
	.comm	_IOMMU_PTE_FC,4,2               ## @IOMMU_PTE_FC
	.comm	_IOMMU_PROT_IR,4,2              ## @IOMMU_PROT_IR
	.comm	_IOMMU_PTE_IR,4,2               ## @IOMMU_PTE_IR
	.comm	_IOMMU_PROT_IW,4,2              ## @IOMMU_PROT_IW
	.comm	_IOMMU_PTE_IW,4,2               ## @IOMMU_PTE_IW
	.no_dead_strip	_iommu_map_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iommu_map_page
_iommu_map_page:                        ; @iommu_map_page
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x5
	mov	x21, x4
	mov	x25, x3
	mov	x24, x2
	mov	x22, x1
	mov	x19, x0
	str	wzr, [sp, #12]
	mov	x0, x1
	mov	x1, x3
	bl	_IS_ALIGNED
	cmp	w0, #0
	cset	w0, eq
	bl	_BUG_ON
	mov	x0, x24
	mov	x1, x25
	bl	_IS_ALIGNED
	cmp	w0, #0
	cset	w0, eq
	bl	_BUG_ON
Lloh0:
	adrp	x8, _IOMMU_PROT_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IOMMU_PROT_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_9
; %bb.1:
	mov	x0, x25
	bl	_PAGE_SIZE_PTE_COUNT
	mov	x23, x0
	add	x5, sp, #12
	mov	x0, x19
	mov	x1, x22
	mov	x2, x25
	mov	x3, #0
	mov	x4, x20
	bl	_alloc_pte
	cbz	x0, LBB0_10
; %bb.2:
	mov	x22, x0
	mov	w26, w23
	cmp	w23, #1
	b.lt	LBB0_14
; %bb.3:
	mov	x20, #0
	mov	x27, x26
	mov	x0, x22
	mov	x28, x22
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x28], #4
	mov	x2, x20
	bl	_free_clear_pte
	mov	x20, x0
	mov	x0, x28
	subs	x27, x27, #1
	b.ne	LBB0_4
; %bb.5:
	cbz	x20, LBB0_7
; %bb.6:
	mov	w8, #1
	str	w8, [sp, #12]
LBB0_7:
	cmp	w23, #2
	b.lt	LBB0_15
; %bb.8:
	mov	x0, x24
	bl	___sme_set
	mov	x1, x25
	bl	_PAGE_SIZE_PTE
	mov	x24, x0
	mov	w0, #7
	bl	_PM_LEVEL_ENC
Lloh3:
	adrp	x8, _IOMMU_PTE_PR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IOMMU_PTE_PR@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _IOMMU_PTE_FC@GOTPAGE
Lloh7:
	ldr	x9, [x9, _IOMMU_PTE_FC@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w10, w0, w24
	orr	w8, w10, w8
	b	LBB0_16
LBB0_9:
	mov	x20, #0
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
	mov	x20, #0
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w21, w8
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_13
LBB0_12:
	mov	x0, x19
	bl	_spin_lock_irqsave
	mov	x0, x19
	bl	_update_domain
	mov	x0, x19
	bl	_spin_unlock_irqrestore
LBB0_13:
	mov	x0, x20
	bl	_free_page_list
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_14:
	mov	x20, #0
LBB0_15:
	mov	x0, x24
	bl	___sme_set
Lloh13:
	adrp	x8, _IOMMU_PTE_PR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _IOMMU_PTE_PR@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	orr	w8, w8, w0
Lloh16:
	adrp	x9, _IOMMU_PTE_FC@GOTPAGE
Lloh17:
	ldr	x9, [x9, _IOMMU_PTE_FC@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
LBB0_16:
	orr	w8, w8, w9
Lloh19:
	adrp	x9, _IOMMU_PROT_IR@GOTPAGE
Lloh20:
	ldr	x9, [x9, _IOMMU_PROT_IR@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
Lloh22:
	adrp	x10, _IOMMU_PTE_IR@GOTPAGE
Lloh23:
	ldr	x10, [x10, _IOMMU_PTE_IR@GOTPAGEOFF]
Lloh24:
	ldr	w10, [x10]
	tst	w9, w21
	csel	w9, wzr, w10, eq
Lloh25:
	adrp	x10, _IOMMU_PROT_IW@GOTPAGE
Lloh26:
	ldr	x10, [x10, _IOMMU_PROT_IW@GOTPAGEOFF]
Lloh27:
	ldr	w10, [x10]
Lloh28:
	adrp	x11, _IOMMU_PTE_IW@GOTPAGE
Lloh29:
	ldr	x11, [x11, _IOMMU_PTE_IW@GOTPAGEOFF]
Lloh30:
	ldr	w11, [x11]
	tst	w10, w21
	csel	w10, wzr, w11, eq
	cmp	w23, #1
	b.lt	LBB0_24
; %bb.17:
	orr	w8, w9, w8
	orr	w8, w8, w10
	cmp	w23, #16
	b.hs	LBB0_19
; %bb.18:
	mov	x9, #0
	b	LBB0_22
LBB0_19:
	and	x9, x26, #0xfffffff0
	dup.4s	v0, w8
	add	x10, x22, #32
	mov	x11, x9
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	stp	q0, q0, [x10, #-32]
	stp	q0, q0, [x10], #64
	subs	x11, x11, #16
	b.ne	LBB0_20
; %bb.21:
	cmp	x9, x26
	b.eq	LBB0_24
LBB0_22:
	add	x10, x22, x9, lsl #2
	sub	x9, x26, x9
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	str	w8, [x10], #4
	subs	x9, x9, #1
	b.ne	LBB0_23
LBB0_24:
	mov	w21, #0
	ldr	w8, [sp, #12]
	cbnz	w8, LBB0_12
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IOMMU_PROT_MASK,4,2            ; @IOMMU_PROT_MASK
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_IOMMU_PTE_PR,4,2               ; @IOMMU_PTE_PR
	.comm	_IOMMU_PTE_FC,4,2               ; @IOMMU_PTE_FC
	.comm	_IOMMU_PROT_IR,4,2              ; @IOMMU_PROT_IR
	.comm	_IOMMU_PTE_IR,4,2               ; @IOMMU_PTE_IR
	.comm	_IOMMU_PROT_IW,4,2              ; @IOMMU_PROT_IW
	.comm	_IOMMU_PTE_IW,4,2               ; @IOMMU_PTE_IW
	.no_dead_strip	_iommu_map_page
.subsections_via_symbols
