	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kvm_set_cr4                    ## -- Begin function kvm_set_cr4
	.p2align	4, 0x90
_kvm_set_cr4:                           ## @kvm_set_cr4
	.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	%rsi, %r15
	movq	%rdi, %rbx
	callq	_kvm_read_cr4
	movq	_CR4_RESERVED_BITS@GOTPCREL(%rip), %rcx
	movl	$1, %r14d
	testq	%r15, (%rcx)
	je	LBB0_1
LBB0_21:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_X86_CR4_PGE@GOTPCREL(%rip), %rcx
	movq	_X86_CR4_PSE@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	orq	(%rcx), %r13
	movq	_X86_CR4_PAE@GOTPCREL(%rip), %rax
	orq	(%rax), %r13
	movq	_X86_CR4_SMEP@GOTPCREL(%rip), %r12
	orq	(%r12), %r13
	movq	%rbx, %rdi
	callq	_guest_cpuid_has_xsave
	testl	%eax, %eax
	je	LBB0_2
LBB0_3:
	movq	%rbx, %rdi
	callq	_guest_cpuid_has_smep
	testl	%eax, %eax
	je	LBB0_4
LBB0_5:
	movq	%rbx, %rdi
	callq	_guest_cpuid_has_fsgsbase
	testl	%eax, %eax
	je	LBB0_6
LBB0_7:
	movq	%rbx, %rdi
	callq	_is_long_mode
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	_X86_CR4_PAE@GOTPCREL(%rip), %rax
	testq	%r15, (%rax)
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	jne	LBB0_13
	jmp	LBB0_21
LBB0_2:
	movq	_X86_CR4_OSXSAVE@GOTPCREL(%rip), %rax
	testq	%r15, (%rax)
	jne	LBB0_21
	jmp	LBB0_3
LBB0_4:
	testq	%r15, (%r12)
	jne	LBB0_21
	jmp	LBB0_5
LBB0_6:
	movq	_X86_CR4_RDWRGSFS@GOTPCREL(%rip), %rax
	testq	%r15, (%rax)
	jne	LBB0_21
	jmp	LBB0_7
LBB0_9:
	movq	%rbx, %rdi
	callq	_is_paging
	testq	%rax, %rax
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	je	LBB0_13
## %bb.10:
	movq	_X86_CR4_PAE@GOTPCREL(%rip), %rax
	testq	%r15, (%rax)
	je	LBB0_13
## %bb.11:
	movq	%r12, %rax
	xorq	%r15, %rax
	testq	%rax, %r13
	je	LBB0_13
## %bb.12:
	movl	(%rbx), %esi
	movq	%rbx, %rdi
	callq	_load_pdptrs
	testl	%eax, %eax
	je	LBB0_21
LBB0_13:
	movq	_X86_CR4_PCIDE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%r15, %rax
	je	LBB0_18
## %bb.14:
	andq	%r12, %rax
	jne	LBB0_18
## %bb.15:
	movq	%rbx, %rdi
	callq	_guest_cpuid_has_pcid
	testl	%eax, %eax
	je	LBB0_21
## %bb.16:
	movq	_X86_CR3_PCID_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	jne	LBB0_21
## %bb.17:
	movq	%rbx, %rdi
	callq	_is_long_mode
	testq	%rax, %rax
	je	LBB0_21
LBB0_18:
	movq	_X86_CR4_VMXE@GOTPCREL(%rip), %rax
	testq	%r15, (%rax)
	jne	LBB0_21
## %bb.19:
	movq	_kvm_x86_ops@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	*(%rax)
	movq	%r15, 8(%rbx)
	movq	_X86_CR4_PGE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	andq	%r15, %rax
	setne	%al
	movq	_tdp_enabled@GOTPCREL(%rip), %rcx
	cmpl	$0, (%rcx)
	sete	%cl
	andb	%al, %cl
	movzbl	%cl, %eax
	movl	%eax, 16(%rbx)
	movq	%rbx, %rdi
	callq	_kvm_mmu_reset_context
	xorq	%r15, %r12
	movq	_X86_CR4_OSXSAVE@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	testq	%r12, (%rax)
	je	LBB0_21
## %bb.20:
	movq	%rbx, %rdi
	callq	_update_cpuid
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_X86_CR4_PGE,8,3                ## @X86_CR4_PGE
	.comm	_X86_CR4_PSE,8,3                ## @X86_CR4_PSE
	.comm	_X86_CR4_PAE,8,3                ## @X86_CR4_PAE
	.comm	_X86_CR4_SMEP,8,3               ## @X86_CR4_SMEP
	.comm	_CR4_RESERVED_BITS,8,3          ## @CR4_RESERVED_BITS
	.comm	_X86_CR4_OSXSAVE,8,3            ## @X86_CR4_OSXSAVE
	.comm	_X86_CR4_RDWRGSFS,8,3           ## @X86_CR4_RDWRGSFS
	.comm	_X86_CR4_PCIDE,8,3              ## @X86_CR4_PCIDE
	.comm	_X86_CR3_PCID_MASK,4,2          ## @X86_CR3_PCID_MASK
	.comm	_X86_CR4_VMXE,8,3               ## @X86_CR4_VMXE
	.comm	_kvm_x86_ops,8,3                ## @kvm_x86_ops
	.comm	_tdp_enabled,4,2                ## @tdp_enabled
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kvm_set_cr4                    ; -- Begin function kvm_set_cr4
	.p2align	2
_kvm_set_cr4:                           ; @kvm_set_cr4
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x19, x0
	bl	_kvm_read_cr4
Lloh0:
	adrp	x8, _CR4_RESERVED_BITS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CR4_RESERVED_BITS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	tst	x8, x20
	b.eq	LBB0_3
LBB0_1:
	mov	w0, #1
LBB0_2:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_3:
	mov	x21, x0
Lloh3:
	adrp	x22, _X86_CR4_PGE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _X86_CR4_PGE@GOTPAGEOFF]
	ldr	x23, [x22]
Lloh5:
	adrp	x8, _X86_CR4_PSE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _X86_CR4_PSE@GOTPAGEOFF]
Lloh7:
	ldr	x24, [x8]
Lloh8:
	adrp	x27, _X86_CR4_PAE@GOTPAGE
Lloh9:
	ldr	x27, [x27, _X86_CR4_PAE@GOTPAGEOFF]
	ldr	x25, [x27]
Lloh10:
	adrp	x28, _X86_CR4_SMEP@GOTPAGE
Lloh11:
	ldr	x28, [x28, _X86_CR4_SMEP@GOTPAGEOFF]
	ldr	x26, [x28]
	mov	x0, x19
	bl	_guest_cpuid_has_xsave
	cbz	w0, LBB0_8
LBB0_4:
	mov	x0, x19
	bl	_guest_cpuid_has_smep
	cbz	w0, LBB0_9
LBB0_5:
	mov	x0, x19
	bl	_guest_cpuid_has_fsgsbase
	cbz	w0, LBB0_10
LBB0_6:
	mov	x0, x19
	bl	_is_long_mode
	cbz	x0, LBB0_11
; %bb.7:
	ldr	x8, [x27]
	tst	x8, x20
	b.ne	LBB0_15
	b	LBB0_1
LBB0_8:
Lloh12:
	adrp	x8, _X86_CR4_OSXSAVE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _X86_CR4_OSXSAVE@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	tst	x8, x20
	b.ne	LBB0_1
	b	LBB0_4
LBB0_9:
	ldr	x8, [x28]
	tst	x8, x20
	b.ne	LBB0_1
	b	LBB0_5
LBB0_10:
Lloh15:
	adrp	x8, _X86_CR4_RDWRGSFS@GOTPAGE
Lloh16:
	ldr	x8, [x8, _X86_CR4_RDWRGSFS@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	tst	x8, x20
	b.ne	LBB0_1
	b	LBB0_6
LBB0_11:
	mov	x0, x19
	bl	_is_paging
	cbz	x0, LBB0_15
; %bb.12:
	ldr	x8, [x27]
	tst	x8, x20
	b.eq	LBB0_15
; %bb.13:
	orr	x8, x24, x23
	orr	x8, x8, x25
	orr	x8, x8, x26
	eor	x9, x21, x20
	tst	x8, x9
	b.eq	LBB0_15
; %bb.14:
	ldr	w1, [x19]
	mov	x0, x19
	bl	_load_pdptrs
	cbz	w0, LBB0_1
LBB0_15:
Lloh18:
	adrp	x8, _X86_CR4_PCIDE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _X86_CR4_PCIDE@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	tst	x8, x20
	b.eq	LBB0_20
; %bb.16:
	and	x8, x8, x21
	cbnz	x8, LBB0_20
; %bb.17:
	mov	x0, x19
	bl	_guest_cpuid_has_pcid
	cbz	w0, LBB0_1
; %bb.18:
	ldr	w8, [x19]
Lloh21:
	adrp	x9, _X86_CR3_PCID_MASK@GOTPAGE
Lloh22:
	ldr	x9, [x9, _X86_CR3_PCID_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_1
; %bb.19:
	mov	x0, x19
	bl	_is_long_mode
	cbz	x0, LBB0_1
LBB0_20:
Lloh24:
	adrp	x8, _X86_CR4_VMXE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _X86_CR4_VMXE@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	tst	x8, x20
	b.ne	LBB0_1
; %bb.21:
Lloh27:
	adrp	x8, _kvm_x86_ops@GOTPAGE
Lloh28:
	ldr	x8, [x8, _kvm_x86_ops@GOTPAGEOFF]
Lloh29:
	ldr	x8, [x8]
	ldr	x8, [x8]
	mov	x0, x19
	mov	x1, x20
	blr	x8
	str	x20, [x19, #8]
	ldr	x8, [x22]
	tst	x8, x20
Lloh30:
	adrp	x8, _tdp_enabled@GOTPAGE
Lloh31:
	ldr	x8, [x8, _tdp_enabled@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	ccmp	w8, #0, #0, ne
	cset	w8, eq
	str	w8, [x19, #16]
	mov	x0, x19
	bl	_kvm_mmu_reset_context
	eor	x8, x21, x20
Lloh33:
	adrp	x9, _X86_CR4_OSXSAVE@GOTPAGE
Lloh34:
	ldr	x9, [x9, _X86_CR4_OSXSAVE@GOTPAGEOFF]
Lloh35:
	ldr	x9, [x9]
	tst	x9, x8
	b.eq	LBB0_23
; %bb.22:
	mov	x0, x19
	bl	_update_cpuid
LBB0_23:
	mov	w0, #0
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_X86_CR4_PGE,8,3                ; @X86_CR4_PGE
	.comm	_X86_CR4_PSE,8,3                ; @X86_CR4_PSE
	.comm	_X86_CR4_PAE,8,3                ; @X86_CR4_PAE
	.comm	_X86_CR4_SMEP,8,3               ; @X86_CR4_SMEP
	.comm	_CR4_RESERVED_BITS,8,3          ; @CR4_RESERVED_BITS
	.comm	_X86_CR4_OSXSAVE,8,3            ; @X86_CR4_OSXSAVE
	.comm	_X86_CR4_RDWRGSFS,8,3           ; @X86_CR4_RDWRGSFS
	.comm	_X86_CR4_PCIDE,8,3              ; @X86_CR4_PCIDE
	.comm	_X86_CR3_PCID_MASK,4,2          ; @X86_CR3_PCID_MASK
	.comm	_X86_CR4_VMXE,8,3               ; @X86_CR4_VMXE
	.comm	_kvm_x86_ops,8,3                ; @kvm_x86_ops
	.comm	_tdp_enabled,4,2                ; @tdp_enabled
.subsections_via_symbols
