	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_psb_mmu_alloc_pd               ## -- Begin function psb_mmu_alloc_pd
	.p2align	4, 0x90
_psb_mmu_alloc_pd:                      ## @psb_mmu_alloc_pd
	.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	%edx, %r15d
	movl	%esi, %r12d
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$64, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_47
## %bb.1:
	movq	%rax, %rbx
	movq	_GFP_DMA32@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_alloc_page
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_46
## %bb.2:
	movl	(%r13), %edi
	callq	_alloc_page
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_45
## %bb.3:
	movl	(%r13), %edi
	callq	_alloc_page
	movq	%rax, 24(%rbx)
	testq	%rax, %rax
	je	LBB0_44
## %bb.4:
	testl	%r12d, %r12d
	je	LBB0_6
## %bb.5:
	movq	$0, 48(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_6:
	movq	16(%rbx), %rdi
	callq	_page_to_pfn
	movl	%eax, %edi
	movl	%r15d, %esi
	callq	_psb_mmu_mask_pte
	movq	%rax, 48(%rbx)
	movq	24(%rbx), %rdi
	callq	_page_to_pfn
	movl	%eax, %edi
	movl	%r15d, %esi
	callq	_psb_mmu_mask_pte
LBB0_7:
	movq	%rax, 56(%rbx)
	movq	16(%rbx), %rdi
	callq	_kmap
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r15
	movslq	(%r15), %rdx
	cmpq	$8, %rdx
	jb	LBB0_24
## %bb.8:
	shrq	$3, %rdx
	cmpq	$2, %rdx
	movl	$1, %ecx
	cmovaeq	%rdx, %rcx
	cmpq	$4, %rcx
	jb	LBB0_9
## %bb.10:
	leaq	64(%rbx), %rdx
	cmpq	%rdx, %rax
	jae	LBB0_13
## %bb.11:
	leaq	(%rax,%rcx,8), %rdx
	leaq	56(%rbx), %rsi
	cmpq	%rdx, %rsi
	jae	LBB0_13
LBB0_9:
	xorl	%edx, %edx
LBB0_20:
	movq	%rdx, %r8
	notq	%r8
	addq	%rcx, %r8
	movq	%rcx, %rdi
	andq	$3, %rdi
	je	LBB0_22
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movq	56(%rbx), %rsi
	movq	%rsi, (%rax,%rdx,8)
	incq	%rdx
	decq	%rdi
	jne	LBB0_21
LBB0_22:
	cmpq	$3, %r8
	jb	LBB0_24
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movq	56(%rbx), %rsi
	movq	%rsi, (%rax,%rdx,8)
	movq	56(%rbx), %rsi
	movq	%rsi, 8(%rax,%rdx,8)
	movq	56(%rbx), %rsi
	movq	%rsi, 16(%rax,%rdx,8)
	movq	56(%rbx), %rsi
	movq	%rsi, 24(%rax,%rdx,8)
	addq	$4, %rdx
	cmpq	%rdx, %rcx
	jne	LBB0_23
	jmp	LBB0_24
LBB0_13:
	movq	%rcx, %rdx
	andq	$-4, %rdx
	leaq	-4(%rdx), %rsi
	movq	%rsi, %r8
	shrq	$2, %r8
	incq	%r8
	testq	%rsi, %rsi
	je	LBB0_16
## %bb.14:
	movq	%r8, %rsi
	andq	$-2, %rsi
	movq	56(%rbx), %xmm0                 ## xmm0 = mem[0],zero
	pshufd	$68, %xmm0, %xmm0               ## xmm0 = xmm0[0,1,0,1]
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, (%rax,%rdi,8)
	movdqu	%xmm0, 16(%rax,%rdi,8)
	movdqu	%xmm0, 32(%rax,%rdi,8)
	movdqu	%xmm0, 48(%rax,%rdi,8)
	addq	$8, %rdi
	addq	$-2, %rsi
	jne	LBB0_15
	jmp	LBB0_17
LBB0_16:
	xorl	%edi, %edi
LBB0_17:
	testb	$1, %r8b
	je	LBB0_19
## %bb.18:
	movq	56(%rbx), %xmm0                 ## xmm0 = mem[0],zero
	pshufd	$68, %xmm0, %xmm0               ## xmm0 = xmm0[0,1,0,1]
	movdqu	%xmm0, (%rax,%rdi,8)
	movdqu	%xmm0, 16(%rax,%rdi,8)
LBB0_19:
	cmpq	%rdx, %rcx
	jne	LBB0_20
LBB0_24:
	movq	16(%rbx), %rdi
	callq	_kunmap
	movq	8(%rbx), %rdi
	callq	_kmap
	movslq	(%r15), %rdx
	cmpq	$8, %rdx
	jb	LBB0_41
## %bb.25:
	shrq	$3, %rdx
	cmpq	$2, %rdx
	movl	$1, %ecx
	cmovaeq	%rdx, %rcx
	cmpq	$4, %rcx
	jb	LBB0_26
## %bb.27:
	leaq	56(%rbx), %rdx
	cmpq	%rdx, %rax
	jae	LBB0_30
## %bb.28:
	leaq	(%rax,%rcx,8), %rdx
	movq	%rbx, %rsi
	addq	$48, %rsi
	cmpq	%rdx, %rsi
	jae	LBB0_30
LBB0_26:
	xorl	%edx, %edx
LBB0_37:
	movq	%rdx, %r8
	notq	%r8
	addq	%rcx, %r8
	movq	%rcx, %rdi
	andq	$3, %rdi
	je	LBB0_39
	.p2align	4, 0x90
LBB0_38:                                ## =>This Inner Loop Header: Depth=1
	movq	48(%rbx), %rsi
	movq	%rsi, (%rax,%rdx,8)
	incq	%rdx
	decq	%rdi
	jne	LBB0_38
LBB0_39:
	cmpq	$3, %r8
	jb	LBB0_41
	.p2align	4, 0x90
LBB0_40:                                ## =>This Inner Loop Header: Depth=1
	movq	48(%rbx), %rsi
	movq	%rsi, (%rax,%rdx,8)
	movq	48(%rbx), %rsi
	movq	%rsi, 8(%rax,%rdx,8)
	movq	48(%rbx), %rsi
	movq	%rsi, 16(%rax,%rdx,8)
	movq	48(%rbx), %rsi
	movq	%rsi, 24(%rax,%rdx,8)
	addq	$4, %rdx
	cmpq	%rdx, %rcx
	jne	LBB0_40
	jmp	LBB0_41
LBB0_30:
	movq	%rcx, %rdx
	andq	$-4, %rdx
	leaq	-4(%rdx), %rsi
	movq	%rsi, %r8
	shrq	$2, %r8
	incq	%r8
	testq	%rsi, %rsi
	je	LBB0_33
## %bb.31:
	movq	%r8, %rsi
	andq	$-2, %rsi
	movq	48(%rbx), %xmm0                 ## xmm0 = mem[0],zero
	pshufd	$68, %xmm0, %xmm0               ## xmm0 = xmm0[0,1,0,1]
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_32:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, (%rax,%rdi,8)
	movdqu	%xmm0, 16(%rax,%rdi,8)
	movdqu	%xmm0, 32(%rax,%rdi,8)
	movdqu	%xmm0, 48(%rax,%rdi,8)
	addq	$8, %rdi
	addq	$-2, %rsi
	jne	LBB0_32
	jmp	LBB0_34
LBB0_33:
	xorl	%edi, %edi
LBB0_34:
	testb	$1, %r8b
	je	LBB0_36
## %bb.35:
	movq	48(%rbx), %xmm0                 ## xmm0 = mem[0],zero
	pshufd	$68, %xmm0, %xmm0               ## xmm0 = xmm0[0,1,0,1]
	movdqu	%xmm0, (%rax,%rdi,8)
	movdqu	%xmm0, 16(%rax,%rdi,8)
LBB0_36:
	cmpq	%rdx, %rcx
	jne	LBB0_37
LBB0_41:
	movq	8(%rbx), %rdi
	callq	_kunmap
	movq	24(%rbx), %rdi
	callq	_kmap
	movq	%rax, %rdi
	callq	_clear_page
	movq	24(%rbx), %rdi
	callq	_kunmap
	movl	$8192, %edi                     ## imm = 0x2000
	callq	_vmalloc_user
	movl	%eax, 44(%rbx)
	testl	%eax, %eax
	je	LBB0_43
## %bb.42:
	movl	$-1, (%rbx)
	movq	_PSB_PTE_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	movq	%r14, 32(%rbx)
	jmp	LBB0_48
LBB0_43:
	movq	24(%rbx), %rdi
	callq	___free_page
LBB0_44:
	movq	16(%rbx), %rdi
	callq	___free_page
LBB0_45:
	movq	8(%rbx), %rdi
	callq	___free_page
LBB0_46:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_47:
	xorl	%ebx, %ebx
LBB0_48:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_GFP_DMA32,4,2                  ## @GFP_DMA32
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_PSB_PTE_VALID,4,2              ## @PSB_PTE_VALID
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_psb_mmu_alloc_pd               ; -- Begin function psb_mmu_alloc_pd
	.p2align	2
_psb_mmu_alloc_pd:                      ; @psb_mmu_alloc_pd
	.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	x21, x2
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #64
	bl	_kmalloc
	mov	x19, x0
	cbz	x0, LBB0_29
; %bb.1:
Lloh3:
	adrp	x23, _GFP_DMA32@GOTPAGE
Lloh4:
	ldr	x23, [x23, _GFP_DMA32@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_alloc_page
	str	x0, [x19, #8]
	cbz	x0, LBB0_28
; %bb.2:
	ldr	w0, [x23]
	bl	_alloc_page
	str	x0, [x19, #16]
	cbz	x0, LBB0_27
; %bb.3:
	ldr	w0, [x23]
	bl	_alloc_page
	str	x0, [x19, #24]
	cbz	x0, LBB0_26
; %bb.4:
	cbz	w22, LBB0_6
; %bb.5:
	mov	x0, #0
	str	xzr, [x19, #48]
	b	LBB0_7
LBB0_6:
	ldr	x0, [x19, #16]
	bl	_page_to_pfn
	mov	x1, x21
	bl	_psb_mmu_mask_pte
	str	x0, [x19, #48]
	ldr	x0, [x19, #24]
	bl	_page_to_pfn
	mov	x1, x21
	bl	_psb_mmu_mask_pte
LBB0_7:
	str	x0, [x19, #56]
	ldr	x0, [x19, #16]
	bl	_kmap
Lloh5:
	adrp	x21, _PAGE_SIZE@GOTPAGE
Lloh6:
	ldr	x21, [x21, _PAGE_SIZE@GOTPAGEOFF]
	ldrsw	x8, [x21]
	cmp	w8, #8
	b.lo	LBB0_16
; %bb.8:
	lsr	x8, x8, #3
	cmp	x8, #1
	csinc	x8, x8, xzr, hi
	cmp	x8, #8
	b.lo	LBB0_13
; %bb.9:
	add	x9, x0, x8, lsl #3
	add	x10, x19, #56
	add	x11, x19, #64
	cmp	x0, x11
	ccmp	x10, x9, #2, lo
	b.lo	LBB0_13
; %bb.10:
	and	x9, x8, #0x1ffffffffffffff8
	ld1r.2d	{ v0 }, [x10]
	add	x10, x0, #32
	mov	x11, x9
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	stp	q0, q0, [x10, #-32]
	stp	q0, q0, [x10], #64
	subs	x11, x11, #8
	b.ne	LBB0_11
; %bb.12:
	cmp	x8, x9
	b.ne	LBB0_14
	b	LBB0_16
LBB0_13:
	mov	x9, #0
LBB0_14:
	add	x10, x0, x9, lsl #3
	sub	x8, x8, x9
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #56]
	str	x9, [x10], #8
	subs	x8, x8, #1
	b.ne	LBB0_15
LBB0_16:
	ldr	x0, [x19, #16]
	bl	_kunmap
	ldr	x0, [x19, #8]
	bl	_kmap
	ldrsw	x8, [x21]
	cmp	w8, #8
	b.lo	LBB0_23
; %bb.17:
	lsr	x8, x8, #3
	cmp	x8, #1
	csinc	x8, x8, xzr, hi
	cmp	x8, #8
	b.lo	LBB0_20
; %bb.18:
	add	x10, x19, #48
	add	x9, x19, #56
	cmp	x0, x9
	b.hs	LBB0_30
; %bb.19:
	add	x9, x0, x8, lsl #3
	cmp	x10, x9
	b.hs	LBB0_30
LBB0_20:
	mov	x9, #0
LBB0_21:
	add	x10, x0, x9, lsl #3
	sub	x8, x8, x9
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #48]
	str	x9, [x10], #8
	subs	x8, x8, #1
	b.ne	LBB0_22
LBB0_23:
	ldr	x0, [x19, #8]
	bl	_kunmap
	ldr	x0, [x19, #24]
	bl	_kmap
	bl	_clear_page
	ldr	x0, [x19, #24]
	bl	_kunmap
	mov	w0, #8192
	bl	_vmalloc_user
	str	w0, [x19, #44]
	cbz	w0, LBB0_25
; %bb.24:
	mov	w8, #-1
	str	w8, [x19]
Lloh7:
	adrp	x8, _PSB_PTE_VALID@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PSB_PTE_VALID@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	str	w8, [x19, #40]
	str	x20, [x19, #32]
	b	LBB0_29
LBB0_25:
	ldr	x0, [x19, #24]
	bl	___free_page
LBB0_26:
	ldr	x0, [x19, #16]
	bl	___free_page
LBB0_27:
	ldr	x0, [x19, #8]
	bl	___free_page
LBB0_28:
	mov	x0, x19
	bl	_kfree
	mov	x19, #0
LBB0_29:
	mov	x0, x19
	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_30:
	and	x9, x8, #0x1ffffffffffffff8
	ld1r.2d	{ v0 }, [x10]
	add	x10, x0, #32
	mov	x11, x9
LBB0_31:                                ; =>This Inner Loop Header: Depth=1
	stp	q0, q0, [x10, #-32]
	stp	q0, q0, [x10], #64
	subs	x11, x11, #8
	b.ne	LBB0_31
; %bb.32:
	cmp	x8, x9
	b.eq	LBB0_23
	b	LBB0_21
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_GFP_DMA32,4,2                  ; @GFP_DMA32
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_PSB_PTE_VALID,4,2              ; @PSB_PTE_VALID
.subsections_via_symbols
