	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kern_mlock                     ## -- Begin function kern_mlock
	.p2align	4, 0x90
_kern_mlock:                            ## @kern_mlock
	.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	%rcx, %r12
	movq	%rdx, %rbx
	movq	%rsi, %rax
	movq	%rdi, %r13
	movq	_PRIV_VM_MLOCK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rax, %rdi
	callq	_priv_check_cred
	testl	%eax, %eax
	jne	LBB0_10
## %bb.1:
	leaq	(%r12,%rbx), %r15
	movq	%rbx, %rdi
	callq	_trunc_page
	movq	%rax, %r14
	movq	%r15, %rdi
	callq	_round_page
	testq	%r12, %r12
	js	LBB0_3
## %bb.2:
	movq	%rax, %r15
	cmpq	%rbx, %rax
	jl	LBB0_3
## %bb.4:
	movq	%r15, %rdi
	subq	%r14, %rdi
	callq	_atop
	movq	%rax, %rbx
	movq	_vm_page_max_user_wired@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jg	LBB0_8
## %bb.5:
	movq	(%r13), %r12
	movq	%r13, %rdi
	callq	_PROC_LOCK
	movl	(%r12), %edi
	callq	_pmap_wired_count
	addq	%rax, %rbx
	movq	%rbx, %rdi
	callq	_ptoa
	movq	%rax, %rbx
	movq	_RLIMIT_MEMLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_lim_cur_proc
	movq	%r13, %rdi
	cmpq	%rax, %rbx
	jbe	LBB0_7
## %bb.6:
	callq	_PROC_UNLOCK
	jmp	LBB0_8
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_7:
	callq	_PROC_UNLOCK
	movq	_VM_MAP_WIRE_USER@GOTPCREL(%rip), %rax
	movq	_VM_MAP_WIRE_NOHOLES@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	%r12, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_vm_map_wire
	movl	%eax, %ecx
	movq	_KERN_SUCCESS@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	cmpl	(%rdx), %ecx
	je	LBB0_10
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PRIV_VM_MLOCK,4,2              ## @PRIV_VM_MLOCK
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_vm_page_max_user_wired,8,3     ## @vm_page_max_user_wired
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_RLIMIT_MEMLOCK,4,2             ## @RLIMIT_MEMLOCK
	.comm	_VM_MAP_WIRE_USER,4,2           ## @VM_MAP_WIRE_USER
	.comm	_VM_MAP_WIRE_NOHOLES,4,2        ## @VM_MAP_WIRE_NOHOLES
	.comm	_KERN_SUCCESS,4,2               ## @KERN_SUCCESS
	.comm	_RACCT_MEMLOCK,4,2              ## @RACCT_MEMLOCK
	.comm	_racct_enable,8,3               ## @racct_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kern_mlock                     ; -- Begin function kern_mlock
	.p2align	2
_kern_mlock:                            ; @kern_mlock
	.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	x23, x3
	mov	x22, x2
	mov	x8, x1
	mov	x19, x0
Lloh0:
	adrp	x9, _PRIV_VM_MLOCK@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PRIV_VM_MLOCK@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x9]
	mov	x0, x8
	bl	_priv_check_cred
	cbnz	w0, LBB0_9
; %bb.1:
	add	x21, x23, x22
	mov	x0, x22
	bl	_trunc_page
	mov	x20, x0
	mov	x0, x21
	bl	_round_page
	tbnz	x23, #63, LBB0_7
; %bb.2:
	mov	x21, x0
	cmp	x0, x22
	b.lt	LBB0_7
; %bb.3:
	sub	x0, x21, x20
	bl	_atop
Lloh3:
	adrp	x8, _vm_page_max_user_wired@GOTPAGE
Lloh4:
	ldr	x8, [x8, _vm_page_max_user_wired@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x0, x8
	b.gt	LBB0_6
; %bb.4:
	mov	x23, x0
	ldr	x22, [x19]
	mov	x0, x19
	bl	_PROC_LOCK
	ldr	w0, [x22]
	bl	_pmap_wired_count
	add	x0, x0, x23
	bl	_ptoa
	mov	x23, x0
Lloh6:
	adrp	x8, _RLIMIT_MEMLOCK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RLIMIT_MEMLOCK@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_lim_cur_proc
	cmp	x23, x0
	b.ls	LBB0_8
; %bb.5:
	mov	x0, x19
	bl	_PROC_UNLOCK
LBB0_6:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	b	LBB0_9
LBB0_7:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	b	LBB0_9
LBB0_8:
	mov	x0, x19
	bl	_PROC_UNLOCK
Lloh15:
	adrp	x8, _VM_MAP_WIRE_USER@GOTPAGE
Lloh16:
	ldr	x8, [x8, _VM_MAP_WIRE_USER@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _VM_MAP_WIRE_NOHOLES@GOTPAGE
Lloh19:
	ldr	x9, [x9, _VM_MAP_WIRE_NOHOLES@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	x0, x22
	mov	x1, x20
	mov	x2, x21
	bl	_vm_map_wire
Lloh21:
	adrp	x8, _KERN_SUCCESS@GOTPAGE
Lloh22:
	ldr	x8, [x8, _KERN_SUCCESS@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _ENOMEM@GOTPAGE
Lloh25:
	ldr	x9, [x9, _ENOMEM@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	cmp	w0, w8
	csel	w0, wzr, w9, eq
LBB0_9:
	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	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_PRIV_VM_MLOCK,4,2              ; @PRIV_VM_MLOCK
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_vm_page_max_user_wired,8,3     ; @vm_page_max_user_wired
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_RLIMIT_MEMLOCK,4,2             ; @RLIMIT_MEMLOCK
	.comm	_VM_MAP_WIRE_USER,4,2           ; @VM_MAP_WIRE_USER
	.comm	_VM_MAP_WIRE_NOHOLES,4,2        ; @VM_MAP_WIRE_NOHOLES
	.comm	_KERN_SUCCESS,4,2               ; @KERN_SUCCESS
	.comm	_RACCT_MEMLOCK,4,2              ; @RACCT_MEMLOCK
	.comm	_racct_enable,8,3               ; @racct_enable
.subsections_via_symbols
