	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mark_screen_rdonly
_mark_screen_rdonly:                    ## @mark_screen_rdonly
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_down_write
	movq	%r14, %rdi
	movl	$655360, %esi                   ## imm = 0xA0000
	callq	_pgd_offset
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_pgd_none_or_clear_bad
	testq	%rax, %rax
	jne	LBB0_8
## %bb.1:
	movq	%rbx, %rdi
	movl	$655360, %esi                   ## imm = 0xA0000
	callq	_pud_offset
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_pud_none_or_clear_bad
	testq	%rax, %rax
	jne	LBB0_8
## %bb.2:
	movq	%rbx, %rdi
	movl	$655360, %esi                   ## imm = 0xA0000
	callq	_pmd_offset
	movq	%rax, %rbx
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_split_huge_page_pmd
	movq	%rbx, %rdi
	callq	_pmd_none_or_clear_bad
	testq	%rax, %rax
	jne	LBB0_8
## %bb.3:
	leaq	-40(%rbp), %rcx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movl	$655360, %edx                   ## imm = 0xA0000
	callq	_pte_offset_map_lock
	movq	%rax, %r15
	xorl	%ebx, %ebx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	addq	$4, %rbx
	cmpl	$128, %ebx
	je	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15,%rbx), %edi
	callq	_pte_present
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	leaq	(%r15,%rbx), %r12
	movl	(%r12), %edi
	callq	_pte_wrprotect
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_set_pte
	jmp	LBB0_6
LBB0_7:
	movq	-40(%rbp), %rsi
	addq	%rbx, %r15
	movq	%r15, %rdi
	callq	_pte_unmap_unlock
LBB0_8:
	movq	%r14, %rdi
	callq	_up_write
	xorl	%eax, %eax
	callq	_flush_tlb
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_mark_screen_rdonly
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mark_screen_rdonly
_mark_screen_rdonly:                    ; @mark_screen_rdonly
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	bl	_down_write
	mov	x0, x19
	mov	w1, #655360
	bl	_pgd_offset
	mov	x20, x0
	bl	_pgd_none_or_clear_bad
	cbnz	x0, LBB0_8
; %bb.1:
	mov	x0, x20
	mov	w1, #655360
	bl	_pud_offset
	mov	x20, x0
	bl	_pud_none_or_clear_bad
	cbnz	x0, LBB0_8
; %bb.2:
	mov	x0, x20
	mov	w1, #655360
	bl	_pmd_offset
	mov	x20, x0
	mov	x0, x19
	mov	x1, x20
	bl	_split_huge_page_pmd
	mov	x0, x20
	bl	_pmd_none_or_clear_bad
	cbnz	x0, LBB0_8
; %bb.3:
	add	x3, sp, #8
	mov	x0, x19
	mov	x1, x20
	mov	w2, #655360
	bl	_pte_offset_map_lock
	mov	x20, x0
	mov	x22, #0
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x22, x22, #4
	cmp	w22, #128
	b.eq	LBB0_7
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	add	x21, x20, x22
	ldr	w0, [x21]
	bl	_pte_present
	cbz	x0, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x21]
	bl	_pte_wrprotect
	mov	x1, x0
	mov	x0, x21
	bl	_set_pte
	b	LBB0_4
LBB0_7:
	ldr	x1, [sp, #8]
	add	x0, x20, x22
	bl	_pte_unmap_unlock
LBB0_8:
	mov	x0, x19
	bl	_up_write
	bl	_flush_tlb
	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
	add	sp, sp, #64
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_mark_screen_rdonly
.subsections_via_symbols
