	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function emulate_rdmsr
_emulate_rdmsr:                         ## @emulate_rdmsr
	.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	%rcx, %r12
	movl	%edx, %ebx
	movl	%esi, %r15d
	movq	%rdi, %r14
	movl	%edx, %edi
	callq	_lapic_msr
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	8(%r14), %edi
	leaq	-36(%rbp), %rcx
	movl	%r15d, %esi
	movl	%ebx, %edx
	movq	%r12, %r8
	callq	_lapic_rdmsr
	jmp	LBB0_3
LBB0_2:
	leaq	-36(%rbp), %rcx
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%ebx, %edx
	movq	%r12, %r8
	callq	_vmx_rdmsr
LBB0_3:
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movl	-36(%rbp), %edx
	movslq	%r15d, %rbx
	shlq	$2, %rbx
	addq	(%r14), %rbx
	movq	_VM_REG_GUEST_RAX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_vmxctx_setreg
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	movslq	%eax, %rsi
	callq	_KASSERT
	movq	_VM_REG_GUEST_RDX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_vmxctx_setreg
	movl	%eax, %ebx
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	movslq	%eax, %rsi
	callq	_KASSERT
LBB0_5:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VM_REG_GUEST_RAX,4,2           ## @VM_REG_GUEST_RAX
	.comm	_VM_REG_GUEST_RDX,4,2           ## @VM_REG_GUEST_RDX
	.no_dead_strip	_emulate_rdmsr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function emulate_rdmsr
_emulate_rdmsr:                         ; @emulate_rdmsr
	.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	x21, x3
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
	mov	x0, x2
	bl	_lapic_msr
	cbz	x0, LBB0_4
; %bb.1:
	ldr	w0, [x20, #8]
	add	x3, sp, #12
	mov	x1, x19
	mov	x2, x22
	mov	x4, x21
	bl	_lapic_rdmsr
	mov	x21, x0
	cbnz	w0, LBB0_3
LBB0_2:
	ldr	w2, [sp, #12]
	ldr	x8, [x20]
	add	x19, x8, w19, sxtw #2
Lloh0:
	adrp	x8, _VM_REG_GUEST_RAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VM_REG_GUEST_RAX@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_vmxctx_setreg
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w0, #0
	cset	w8, eq
	sxtw	x1, w0
	mov	x0, x8
	bl	_KASSERT
Lloh3:
	adrp	x8, _VM_REG_GUEST_RDX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VM_REG_GUEST_RDX@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_vmxctx_setreg
	mov	x21, x0
	cmp	w0, #0
	cset	w0, eq
	sxtw	x1, w21
	bl	_KASSERT
LBB0_3:
	mov	x0, x21
	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
LBB0_4:
	add	x3, sp, #12
	mov	x0, x20
	mov	x1, x19
	mov	x2, x22
	mov	x4, x21
	bl	_vmx_rdmsr
	mov	x21, x0
	cbnz	w0, LBB0_3
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_VM_REG_GUEST_RAX,4,2           ; @VM_REG_GUEST_RAX
	.comm	_VM_REG_GUEST_RDX,4,2           ; @VM_REG_GUEST_RDX
	.no_dead_strip	_emulate_rdmsr
.subsections_via_symbols
