	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpu_procctl_kpti
_cpu_procctl_kpti:                      ## @cpu_procctl_kpti
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdx, %rbx
	movq	_PROC_KPTI_CTL@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jne	LBB0_6
## %bb.1:
	movq	_pti@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_4
## %bb.2:
	movl	(%rbx), %eax
	movq	_PROC_KPTI_CTL_ENABLE_ON_EXEC@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_4
## %bb.3:
	movq	_P_MD_KPTI@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%rdi)
LBB0_4:
	movl	(%rbx), %eax
	movq	_PROC_KPTI_CTL_DISABLE_ON_EXEC@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_11
## %bb.5:
	movq	_P_MD_KPTI@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 4(%rdi)
	jmp	LBB0_11
LBB0_6:
	movq	_P_MD_KPTI@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	4(%rdi), %eax
	jne	LBB0_7
## %bb.8:
	movq	_PROC_KPTI_CTL_DISABLE_ON_EXEC@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_7:
	movq	_PROC_KPTI_CTL_ENABLE_ON_EXEC@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movl	(%rdi), %edi
	callq	_vmspace_pmap
	movq	(%rax), %rax
	movq	_PMAP_NO_CR3@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_11
## %bb.10:
	movq	_PROC_KPTI_STATUS_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PROC_KPTI_CTL,4,2              ## @PROC_KPTI_CTL
	.comm	_pti,8,3                        ## @pti
	.comm	_PROC_KPTI_CTL_ENABLE_ON_EXEC,4,2 ## @PROC_KPTI_CTL_ENABLE_ON_EXEC
	.comm	_P_MD_KPTI,4,2                  ## @P_MD_KPTI
	.comm	_PROC_KPTI_CTL_DISABLE_ON_EXEC,4,2 ## @PROC_KPTI_CTL_DISABLE_ON_EXEC
	.comm	_PMAP_NO_CR3,8,3                ## @PMAP_NO_CR3
	.comm	_PROC_KPTI_STATUS_ACTIVE,4,2    ## @PROC_KPTI_STATUS_ACTIVE
	.no_dead_strip	_cpu_procctl_kpti
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpu_procctl_kpti
_cpu_procctl_kpti:                      ; @cpu_procctl_kpti
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x2
Lloh0:
	adrp	x8, _PROC_KPTI_CTL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PROC_KPTI_CTL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ne	LBB0_6
; %bb.1:
Lloh3:
	adrp	x8, _pti@GOTPAGE
Lloh4:
	ldr	x8, [x8, _pti@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.2:
	ldr	w8, [x19]
Lloh6:
	adrp	x9, _PROC_KPTI_CTL_ENABLE_ON_EXEC@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PROC_KPTI_CTL_ENABLE_ON_EXEC@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_4
; %bb.3:
Lloh9:
	adrp	x8, _P_MD_KPTI@GOTPAGE
Lloh10:
	ldr	x8, [x8, _P_MD_KPTI@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	ldr	w9, [x0, #4]
	orr	w8, w9, w8
	str	w8, [x0, #4]
LBB0_4:
	ldr	w8, [x19]
Lloh12:
	adrp	x9, _PROC_KPTI_CTL_DISABLE_ON_EXEC@GOTPAGE
Lloh13:
	ldr	x9, [x9, _PROC_KPTI_CTL_DISABLE_ON_EXEC@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_8
; %bb.5:
Lloh15:
	adrp	x8, _P_MD_KPTI@GOTPAGE
Lloh16:
	ldr	x8, [x8, _P_MD_KPTI@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	ldr	w9, [x0, #4]
	bic	w8, w9, w8
	str	w8, [x0, #4]
	b	LBB0_8
LBB0_6:
	ldr	w8, [x0, #4]
Lloh18:
	adrp	x9, _P_MD_KPTI@GOTPAGE
Lloh19:
	ldr	x9, [x9, _P_MD_KPTI@GOTPAGEOFF]
Lloh20:
	adrp	x10, _PROC_KPTI_CTL_ENABLE_ON_EXEC@GOTPAGE
Lloh21:
	ldr	x10, [x10, _PROC_KPTI_CTL_ENABLE_ON_EXEC@GOTPAGEOFF]
Lloh22:
	adrp	x11, _PROC_KPTI_CTL_DISABLE_ON_EXEC@GOTPAGE
Lloh23:
	ldr	x11, [x11, _PROC_KPTI_CTL_DISABLE_ON_EXEC@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	tst	w9, w8
	csel	x8, x11, x10, eq
	ldr	w8, [x8]
	str	w8, [x19]
	ldr	w0, [x0]
	bl	_vmspace_pmap
	ldr	x8, [x0]
Lloh25:
	adrp	x9, _PMAP_NO_CR3@GOTPAGE
Lloh26:
	ldr	x9, [x9, _PMAP_NO_CR3@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_8
; %bb.7:
Lloh28:
	adrp	x8, _PROC_KPTI_STATUS_ACTIVE@GOTPAGE
Lloh29:
	ldr	x8, [x8, _PROC_KPTI_STATUS_ACTIVE@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 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
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_PROC_KPTI_CTL,4,2              ; @PROC_KPTI_CTL
	.comm	_pti,8,3                        ; @pti
	.comm	_PROC_KPTI_CTL_ENABLE_ON_EXEC,4,2 ; @PROC_KPTI_CTL_ENABLE_ON_EXEC
	.comm	_P_MD_KPTI,4,2                  ; @P_MD_KPTI
	.comm	_PROC_KPTI_CTL_DISABLE_ON_EXEC,4,2 ; @PROC_KPTI_CTL_DISABLE_ON_EXEC
	.comm	_PMAP_NO_CR3,8,3                ; @PMAP_NO_CR3
	.comm	_PROC_KPTI_STATUS_ACTIVE,4,2    ; @PROC_KPTI_STATUS_ACTIVE
	.no_dead_strip	_cpu_procctl_kpti
.subsections_via_symbols
