	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_psb_mmu_virtual_to_pfn         ## -- Begin function psb_mmu_virtual_to_pfn
	.p2align	4, 0x90
_psb_mmu_virtual_to_pfn:                ## @psb_mmu_virtual_to_pfn
	.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
	movq	%rdx, %r14
	movq	%rsi, %r13
	movq	%rdi, %r15
	movq	16(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_down_read
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_psb_mmu_pt_map_lock
	testq	%rax, %rax
	je	LBB0_1
## %bb.6:
	movq	%rax, %r12
	movq	(%rax), %rbx
	movq	%r13, %rdi
	callq	_psb_mmu_pt_index
	movq	(%rbx,%rax,8), %rax
	movq	_PSB_PTE_VALID@GOTPCREL(%rip), %rcx
	testq	%rax, (%rcx)
	je	LBB0_7
## %bb.8:
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shrq	%cl, %rax
	movq	%rax, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_1:
	addq	$4, %rbx
	movq	%rbx, %rdi
	callq	_spin_lock
	movl	24(%r15), %edi
	callq	_kmap_atomic
	movq	%rax, %r12
	movq	%r13, %rdi
	callq	_psb_mmu_pd_index
	movq	(%r12,%rax,8), %r13
	movq	%r12, %rdi
	callq	_kunmap_atomic
	movq	%rbx, %rdi
	callq	_spin_unlock
	cmpq	(%r15), %r13
	jne	LBB0_4
## %bb.2:
	movq	_PSB_PTE_VALID@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	testq	%r13, %rcx
	je	LBB0_4
## %bb.3:
	movq	8(%r15), %rax
	testq	%rcx, %rax
	je	LBB0_4
## %bb.5:
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shrq	%cl, %rax
	movq	%rax, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movq	%r12, %rdi
	callq	_psb_mmu_pt_unmap_unlock
LBB0_10:
	movq	16(%r15), %rdi
	callq	_up_read
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PSB_PTE_VALID,8,3              ## @PSB_PTE_VALID
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_psb_mmu_virtual_to_pfn         ; -- Begin function psb_mmu_virtual_to_pfn
	.p2align	2
_psb_mmu_virtual_to_pfn:                ; @psb_mmu_virtual_to_pfn
	.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, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x23, [x0, #16]
	mov	x0, x23
	bl	_down_read
	mov	x0, x19
	mov	x1, x21
	bl	_psb_mmu_pt_map_lock
	cbz	x0, LBB0_3
; %bb.1:
	mov	x22, x0
	ldr	x23, [x0]
	mov	x0, x21
	bl	_psb_mmu_pt_index
	ldr	x8, [x23, x0, lsl #3]
Lloh0:
	adrp	x9, _PSB_PTE_VALID@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PSB_PTE_VALID@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	tst	x9, x8
	b.eq	LBB0_8
; %bb.2:
	mov	w21, #0
Lloh3:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	lsr	x8, x8, x9
	str	x8, [x20]
	b	LBB0_9
LBB0_3:
	add	x22, x23, #4
	mov	x0, x22
	bl	_spin_lock
	ldr	w0, [x19, #24]
	bl	_kmap_atomic
	mov	x23, x0
	mov	x0, x21
	bl	_psb_mmu_pd_index
	ldr	x21, [x23, x0, lsl #3]
	mov	x0, x23
	bl	_kunmap_atomic
	mov	x0, x22
	bl	_spin_unlock
	ldr	x8, [x19]
	cmp	x21, x8
	b.ne	LBB0_7
; %bb.4:
Lloh6:
	adrp	x8, _PSB_PTE_VALID@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PSB_PTE_VALID@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x8]
	tst	x9, x21
	b.eq	LBB0_7
; %bb.5:
	ldr	x8, [x19, #8]
	tst	x8, x9
	b.eq	LBB0_7
; %bb.6:
	mov	w21, #0
Lloh9:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	lsr	x8, x8, x9
	str	x8, [x20]
	b	LBB0_10
LBB0_7:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_10
LBB0_8:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_9:
	mov	x0, x22
	bl	_psb_mmu_pt_unmap_unlock
LBB0_10:
	ldr	x0, [x19, #16]
	bl	_up_read
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_PSB_PTE_VALID,8,3              ; @PSB_PTE_VALID
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
.subsections_via_symbols
