	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_pte
_alloc_pte:                             ## @alloc_pte
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r15
	movl	%r8d, %r12d
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, %rdi
	callq	_is_power_of_2
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_BUG_ON
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movzbl	%cl, %eax
	movl	%eax, (%r15)
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %edi
	callq	_PM_LEVEL_SIZE
	cmpq	%r14, %rax
	jae	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%r12d, %edx
	callq	_increase_address_space
	movb	$1, %cl
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$0, (%r15)
	setne	%cl
	jmp	LBB0_4
LBB0_5:
	movl	%r12d, -60(%rbp)                ## 4-byte Spill
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %r13d
	decl	%r13d
	movq	8(%rbx), %rbx
	movl	%r13d, %edi
	movq	%r14, %rsi
	callq	_PM_LEVEL_INDEX
	leaq	(%rbx,%rax,8), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_PAGE_SIZE_ALIGN
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_PAGE_SIZE_LEVEL
	cmpl	%eax, %r13d
	jle	LBB0_27
## %bb.6:
	movl	%eax, %r15d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	movq	%r15, %r12
	movl	%r13d, %r15d
	movl	-56(%rbp), %r13d                ## 4-byte Reload
LBB0_26:                                ##   in Loop: Header=BB0_7 Depth=1
	cmpl	%r15d, %r13d
	jle	LBB0_27
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %r14
	movq	%r14, %rdi
	callq	_PM_PTE_LEVEL
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_IOMMU_PTE_PRESENT
	testq	%rax, %rax
	je	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	_PAGE_MODE_7_LEVEL@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	%r13d, -56(%rbp)                ## 4-byte Spill
	movl	%r15d, %r13d
	movq	%r12, %r15
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%esi, %esi
	leaq	-88(%rbp), %rdx
	callq	_first_pte_l7
	cmpq	$0, -88(%rbp)
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%rax, %rbx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_cmpxchg64
	incq	%r12
	addq	$8, %rbx
	cmpq	-88(%rbp), %r12
	jb	LBB0_11
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%r14, %rdi
	callq	_IOMMU_PTE_PRESENT
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	_PAGE_MODE_NONE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_15
## %bb.21:                              ##   in Loop: Header=BB0_7 Depth=1
	cmpl	%r13d, %ebx
	jne	LBB0_16
## %bb.22:                              ##   in Loop: Header=BB0_7 Depth=1
	decl	%r13d
	movq	%r14, %rdi
	callq	_IOMMU_PTE_PAGE
	movq	%rax, %rbx
	cmpq	$0, -72(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_25
## %bb.23:                              ##   in Loop: Header=BB0_7 Depth=1
	cmpl	%r15d, %r13d
	jne	LBB0_25
## %bb.24:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%rbx, (%rax)
LBB0_25:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	%r13d, %edi
	movq	%r12, %rsi
	callq	_PM_LEVEL_INDEX
	leaq	(%rbx,%rax,8), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_26
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	-60(%rbp), %edi                 ## 4-byte Reload
	callq	_get_zeroed_page
	testq	%rax, %rax
	je	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_iommu_virt_to_phys
	movl	%r13d, %edi
	movl	%eax, %esi
	callq	_PM_LEVEL_PDE
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_cmpxchg64
	cmpq	%r14, %rax
	jne	LBB0_18
## %bb.19:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%r14, %rdi
	callq	_IOMMU_PTE_PRESENT
	testq	%rax, %rax
	je	LBB0_26
## %bb.20:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	jmp	LBB0_26
LBB0_18:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%rbx, %rdi
	callq	_free_page
	jmp	LBB0_26
LBB0_16:
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
LBB0_27:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_MODE_7_LEVEL,4,2          ## @PAGE_MODE_7_LEVEL
	.comm	_PAGE_MODE_NONE,4,2             ## @PAGE_MODE_NONE
	.no_dead_strip	_alloc_pte
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_pte
_alloc_pte:                             ; @alloc_pte
	.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	x19, x5
	mov	x20, x4
	mov	x21, x3
	mov	x24, x2
	mov	x23, x1
	mov	x25, x0
	mov	x0, x2
	bl	_is_power_of_2
	cmp	w0, #0
	cset	w0, eq
	bl	_BUG_ON
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	w8, #1
	str	w8, [x19]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x25]
	bl	_PM_LEVEL_SIZE
	cmp	x0, x23
	b.hs	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x25
	mov	x1, x23
	mov	x2, x20
	bl	_increase_address_space
	cbnz	x0, LBB0_1
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x19]
	cmp	w8, #0
	cset	w8, ne
	str	w8, [x19]
	b	LBB0_2
LBB0_5:
	ldr	w8, [x25]
	sub	w22, w8, #1
	ldr	x25, [x25, #8]
	mov	x0, x22
	mov	x1, x23
	bl	_PM_LEVEL_INDEX
	add	x25, x25, x0, lsl #3
	mov	x0, x23
	mov	x1, x24
	bl	_PAGE_SIZE_ALIGN
	mov	x23, x0
	mov	x0, x24
	bl	_PAGE_SIZE_LEVEL
	cmp	w22, w0
	b.le	LBB0_24
; %bb.6:
	mov	x24, x0
	str	x23, [sp]                       ; 8-byte Folded Spill
Lloh0:
	adrp	x28, _PAGE_MODE_7_LEVEL@GOTPAGE
Lloh1:
	ldr	x28, [x28, _PAGE_MODE_7_LEVEL@GOTPAGEOFF]
	b	LBB0_10
LBB0_7:                                 ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x26
	bl	_IOMMU_PTE_PRESENT
	cbz	x0, LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	mov	w8, #1
	str	w8, [x19]
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	cmp	w22, w24
	b.le	LBB0_24
LBB0_10:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_17 Depth 2
	ldr	x26, [x25]
	mov	x0, x26
	bl	_PM_PTE_LEVEL
	mov	x27, x0
	mov	x0, x26
	bl	_IOMMU_PTE_PRESENT
	ldr	w8, [x28]
	cmp	x0, #0
	ccmp	w27, w8, #0, ne
	b.eq	LBB0_15
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x26
	bl	_IOMMU_PTE_PRESENT
Lloh2:
	adrp	x8, _PAGE_MODE_NONE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PAGE_MODE_NONE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	x0, #0
	ccmp	w27, w8, #4, ne
	b.ne	LBB0_18
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x20
	bl	_get_zeroed_page
	cbz	x0, LBB0_23
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x27, x0
	bl	_iommu_virt_to_phys
	mov	x1, x0
	mov	x0, x22
	bl	_PM_LEVEL_PDE
	mov	x2, x0
	mov	x0, x25
	mov	x1, x26
	bl	_cmpxchg64
	cmp	x0, x26
	b.eq	LBB0_7
; %bb.14:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x27
	bl	_free_page
	b	LBB0_9
LBB0_15:                                ;   in Loop: Header=BB0_10 Depth=1
	add	x2, sp, #8
	mov	x0, x25
	mov	x1, #0
	bl	_first_pte_l7
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_8
; %bb.16:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x27, x0
	mov	x23, #0
LBB0_17:                                ;   Parent Loop BB0_10 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x27
	mov	x1, x26
	mov	x2, #0
	bl	_cmpxchg64
	add	x23, x23, #1
	ldr	x8, [sp, #8]
	add	x27, x27, #8
	cmp	x23, x8
	b.lo	LBB0_17
	b	LBB0_8
LBB0_18:                                ;   in Loop: Header=BB0_10 Depth=1
	cmp	w27, w22
	b.ne	LBB0_23
; %bb.19:                               ;   in Loop: Header=BB0_10 Depth=1
	sub	w22, w22, #1
	mov	x0, x26
	bl	_IOMMU_PTE_PAGE
	mov	x25, x0
	cbz	x21, LBB0_22
; %bb.20:                               ;   in Loop: Header=BB0_10 Depth=1
	cmp	w22, w24
	b.ne	LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_10 Depth=1
	str	x25, [x21]
LBB0_22:                                ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x22
	ldr	x1, [sp]                        ; 8-byte Folded Reload
	bl	_PM_LEVEL_INDEX
	add	x25, x25, x0, lsl #3
	b	LBB0_9
LBB0_23:
	mov	x25, #0
LBB0_24:
	mov	x0, x25
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_MODE_7_LEVEL,4,2          ; @PAGE_MODE_7_LEVEL
	.comm	_PAGE_MODE_NONE,4,2             ; @PAGE_MODE_NONE
	.no_dead_strip	_alloc_pte
.subsections_via_symbols
