	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_psb_mmu_pt_alloc_map_lock      ## -- Begin function psb_mmu_pt_alloc_map_lock
	.p2align	4, 0x90
_psb_mmu_pt_alloc_map_lock:             ## @psb_mmu_pt_alloc_map_lock
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	_psb_mmu_pd_index
	movq	%rax, %r15
	movq	8(%r14), %r12
	addq	$4, %r12
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_spin_lock
	movq	16(%r14), %rax
	movq	(%rax,%r15,8), %rbx
	testq	%rbx, %rbx
	jne	LBB0_8
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r12, %rdi
	callq	_spin_unlock
	movq	%r14, %rdi
	callq	_psb_mmu_alloc_pt
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_spin_lock
	movq	16(%r14), %rax
	cmpq	$0, (%rax,%r15,8)
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r12, %rdi
	callq	_spin_unlock
	movq	%rbx, %rdi
	callq	_psb_mmu_free_pt
	jmp	LBB0_1
LBB0_3:
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_6:
	movl	24(%r14), %edi
	callq	_kmap_atomic
	movq	%rax, %r12
	movq	16(%r14), %rax
	movq	%rbx, (%rax,%r15,8)
	movl	8(%rbx), %edi
	callq	_page_to_pfn
	shll	$12, %eax
	orl	(%r14), %eax
	cltq
	movq	%rax, (%r12,%r15,8)
	movq	%r15, (%rbx)
	movq	%r12, %rdi
	callq	_kunmap_atomic
	cmpl	$-1, 4(%r14)
	je	LBB0_8
## %bb.7:
	leaq	(%r12,%r15,8), %rsi
	movq	8(%r14), %rdi
	callq	_psb_mmu_clflush
	movq	8(%r14), %rdi
	movl	$1, %esi
	callq	_atomic_set
LBB0_8:
	movl	8(%rbx), %edi
	callq	_kmap_atomic
	movq	%rax, 16(%rbx)
LBB0_9:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_psb_mmu_pt_alloc_map_lock      ; -- Begin function psb_mmu_pt_alloc_map_lock
	.p2align	2
_psb_mmu_pt_alloc_map_lock:             ; @psb_mmu_pt_alloc_map_lock
	.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	x19, x0
	mov	x0, x1
	bl	_psb_mmu_pd_index
	mov	x21, x0
	ldr	x8, [x19, #8]
	add	x22, x8, #4
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_spin_lock
	ldr	x8, [x19, #16]
	ldr	x20, [x8, x21, lsl #3]
	cbnz	x20, LBB0_7
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x22
	bl	_spin_unlock
	mov	x0, x19
	bl	_psb_mmu_alloc_pt
	mov	x20, x0
	cbz	x0, LBB0_8
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x22
	bl	_spin_lock
	ldr	x8, [x19, #16]
	ldr	x8, [x8, x21, lsl #3]
	cbz	x8, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x22
	bl	_spin_unlock
	mov	x0, x20
	bl	_psb_mmu_free_pt
	b	LBB0_1
LBB0_5:
	ldr	w0, [x19, #24]
	bl	_kmap_atomic
	mov	x23, x0
	ldr	x8, [x19, #16]
	lsl	x22, x21, #3
	str	x20, [x8, x22]
	ldr	w0, [x20, #8]
	bl	_page_to_pfn
	ldr	w8, [x19]
	orr	w8, w8, w0, lsl #12
	sxtw	x8, w8
	add	x22, x23, x22
	str	x8, [x22]
	str	x21, [x20]
	mov	x0, x23
	bl	_kunmap_atomic
	ldr	w8, [x19, #4]
	cmn	w8, #1
	b.eq	LBB0_7
; %bb.6:
	ldr	x0, [x19, #8]
	mov	x1, x22
	bl	_psb_mmu_clflush
	ldr	x0, [x19, #8]
	mov	w1, #1
	bl	_atomic_set
LBB0_7:
	ldr	w0, [x20, #8]
	bl	_kmap_atomic
	str	x0, [x20, #16]
LBB0_8:
	mov	x0, x20
	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
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
