	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vmx_emulate_xsetbv
_vmx_emulate_xsetbv:                    ## @vmx_emulate_xsetbv
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	8(%rdi), %r12
	movslq	%esi, %rbx
	xorl	%eax, %eax
	callq	_vmm_get_xsave_limits
	shlq	$4, %rbx
	cmpq	$0, (%r12,%rbx)
	je	LBB0_1
LBB0_4:
	movl	(%r15), %edi
	movl	%r14d, %esi
	callq	_vm_inject_gp
	jmp	LBB0_5
LBB0_1:
	cmpl	$0, 4(%rax)
	je	LBB0_3
## %bb.2:
	movq	_VMCS_GUEST_CR4@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_vmcs_read
	movq	_CR4_XSAVE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_4
LBB0_3:
	movl	(%r15), %edi
	movl	%r14d, %esi
	callq	_vm_inject_ud
LBB0_5:
	movq	_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HANDLED,4,2                    ## @HANDLED
	.comm	_VMCS_GUEST_CR4,4,2             ## @VMCS_GUEST_CR4
	.comm	_CR4_XSAVE,4,2                  ## @CR4_XSAVE
	.comm	_XFEATURE_ENABLED_X87,4,2       ## @XFEATURE_ENABLED_X87
	.comm	_XFEATURE_ENABLED_AVX,4,2       ## @XFEATURE_ENABLED_AVX
	.comm	_XFEATURE_AVX,4,2               ## @XFEATURE_AVX
	.comm	_XFEATURE_AVX512,4,2            ## @XFEATURE_AVX512
	.comm	_XFEATURE_ENABLED_BNDREGS,4,2   ## @XFEATURE_ENABLED_BNDREGS
	.comm	_XFEATURE_ENABLED_BNDCSR,4,2    ## @XFEATURE_ENABLED_BNDCSR
	.no_dead_strip	_vmx_emulate_xsetbv
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vmx_emulate_xsetbv
_vmx_emulate_xsetbv:                    ; @vmx_emulate_xsetbv
	.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	x19, x1
	mov	x20, x0
	ldr	x21, [x0, #8]
	bl	_vmm_get_xsave_limits
	sbfiz	x8, x19, #4, #32
	ldr	x8, [x21, x8]
	cbz	x8, LBB0_2
LBB0_1:
	ldr	w0, [x20]
	mov	x1, x19
	bl	_vm_inject_gp
	b	LBB0_5
LBB0_2:
	ldr	w8, [x0, #4]
	cbz	w8, LBB0_4
; %bb.3:
Lloh0:
	adrp	x8, _VMCS_GUEST_CR4@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VMCS_GUEST_CR4@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_vmcs_read
Lloh3:
	adrp	x8, _CR4_XSAVE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CR4_XSAVE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_1
LBB0_4:
	ldr	w0, [x20]
	mov	x1, x19
	bl	_vm_inject_ud
LBB0_5:
Lloh6:
	adrp	x8, _HANDLED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _HANDLED@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	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
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_HANDLED,4,2                    ; @HANDLED
	.comm	_VMCS_GUEST_CR4,4,2             ; @VMCS_GUEST_CR4
	.comm	_CR4_XSAVE,4,2                  ; @CR4_XSAVE
	.comm	_XFEATURE_ENABLED_X87,4,2       ; @XFEATURE_ENABLED_X87
	.comm	_XFEATURE_ENABLED_AVX,4,2       ; @XFEATURE_ENABLED_AVX
	.comm	_XFEATURE_AVX,4,2               ; @XFEATURE_AVX
	.comm	_XFEATURE_AVX512,4,2            ; @XFEATURE_AVX512
	.comm	_XFEATURE_ENABLED_BNDREGS,4,2   ; @XFEATURE_ENABLED_BNDREGS
	.comm	_XFEATURE_ENABLED_BNDCSR,4,2    ; @XFEATURE_ENABLED_BNDCSR
	.no_dead_strip	_vmx_emulate_xsetbv
.subsections_via_symbols
