	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_psb_mmu_free_pagedir           ## -- Begin function psb_mmu_free_pagedir
	.p2align	4, 0x90
_psb_mmu_free_pagedir:                  ## @psb_mmu_free_pagedir
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	24(%rdi), %r14
	movq	%r14, %rdi
	callq	_down_write
	movslq	(%r15), %rsi
	cmpq	$-1, %rsi
	je	LBB0_2
## %bb.1:
	movq	_PSB_CR_BIF_DIR_LIST_BASE0@GOTPCREL(%rip), %rax
	shlq	$2, %rsi
	addq	(%rax), %rsi
	xorl	%edi, %edi
	callq	_PSB_WSGX32
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_psb_mmu_flush_pd_locked
LBB0_2:
	xorl	%ebx, %ebx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	cmpq	$1024, %rbx                     ## imm = 0x400
	je	LBB0_6
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r15), %rax
	movq	(%rax,%rbx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	callq	_psb_mmu_free_pt
	jmp	LBB0_5
LBB0_6:
	movq	16(%r15), %rdi
	callq	_vfree
	movl	12(%r15), %edi
	callq	___free_page
	movl	8(%r15), %edi
	callq	___free_page
	movl	4(%r15), %edi
	callq	___free_page
	movq	%r15, %rdi
	callq	_kfree
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_up_write                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PSB_CR_BIF_DIR_LIST_BASE0,8,3  ## @PSB_CR_BIF_DIR_LIST_BASE0
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_psb_mmu_free_pagedir           ; -- Begin function psb_mmu_free_pagedir
	.p2align	2
_psb_mmu_free_pagedir:                  ; @psb_mmu_free_pagedir
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x0
	ldr	x19, [x0, #24]
	mov	x0, x19
	bl	_down_write
	ldrsw	x8, [x20]
	cmn	w8, #1
	b.eq	LBB0_2
; %bb.1:
Lloh0:
	adrp	x9, _PSB_CR_BIF_DIR_LIST_BASE0@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PSB_CR_BIF_DIR_LIST_BASE0@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x1, x9, x8, lsl #2
	mov	w0, #0
	bl	_PSB_WSGX32
	mov	x0, x19
	mov	w1, #1
	bl	_psb_mmu_flush_pd_locked
LBB0_2:
	mov	x21, #0
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x21, x21, #8
	cmp	x21, #2, lsl #12                ; =8192
	b.eq	LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #16]
	ldr	x0, [x8, x21]
	cbz	x0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_psb_mmu_free_pt
	b	LBB0_3
LBB0_6:
	ldr	x0, [x20, #16]
	bl	_vfree
	ldr	w0, [x20, #12]
	bl	___free_page
	ldr	w0, [x20, #8]
	bl	___free_page
	ldr	w0, [x20, #4]
	bl	___free_page
	mov	x0, x20
	bl	_kfree
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_up_write
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PSB_CR_BIF_DIR_LIST_BASE0,8,3  ; @PSB_CR_BIF_DIR_LIST_BASE0
.subsections_via_symbols
