	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vmx_setreg
_vmx_setreg:                            ## @vmx_setreg
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movl	%edx, %r12d
	movl	%esi, %ebx
	movq	%rdi, %r15
	movl	16(%rdi), %edi
	leaq	-60(%rbp), %rdx
	callq	_vcpu_is_running
	movl	%eax, %r13d
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movl	-60(%rbp), %eax
	movq	_curcpu@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_3
## %bb.2:
	movl	16(%r15), %edi
	callq	_vm_name
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_panic
LBB0_3:
	movq	_VM_REG_GUEST_INTR_SHADOW@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_5
## %bb.4:
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%r13d, %edx
	movl	%r14d, %ecx
	callq	_vmx_modify_intr_shadow
	movl	%eax, %r13d
	jmp	LBB0_19
LBB0_5:
	movl	%ebx, -56(%rbp)                 ## 4-byte Spill
	movslq	%ebx, %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	%r12d, %ebx
	leaq	(,%rax,4), %r12
	movq	(%r15), %rdi
	addq	%r12, %rdi
	movl	%ebx, %esi
	movl	%r14d, %edx
	callq	_vmxctx_setreg
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	8(%r15), %rdi
	addq	%r12, %rdi
	movl	%r13d, %esi
	movl	%ebx, %edx
	movl	%r14d, %ecx
	callq	_vmcs_setreg
	movl	%r13d, %ecx
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_19
## %bb.8:
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	movq	_entry_ctls@GOTPCREL(%rip), %rax
	movq	_VM_ENTRY_LOAD_EFER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	movl	%ebx, %r12d
	je	LBB0_14
## %bb.9:
	movq	_VM_REG_GUEST_EFER@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_14
## %bb.10:
	movq	8(%r15), %r13
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	addq	%rbx, %r13
	movq	_VMCS_ENTRY_CTLS@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_VMCS_IDENT
	leaq	-48(%rbp), %rcx
	movq	%r13, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%eax, %edx
	callq	_vmcs_getreg
	movq	_EFER_LMA@GOTPCREL(%rip), %rcx
	movq	_VM_ENTRY_GUEST_LMA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	testl	%edx, (%rcx)
	je	LBB0_12
## %bb.11:
	orl	-48(%rbp), %eax
	jmp	LBB0_13
LBB0_6:
	xorl	%r13d, %r13d
	jmp	LBB0_19
LBB0_12:
	notl	%eax
	andl	-48(%rbp), %eax
LBB0_13:
	movl	%eax, -48(%rbp)
	movq	8(%r15), %r13
	addq	%rbx, %r13
	movl	(%r14), %edi
	callq	_VMCS_IDENT
	movl	-48(%rbp), %ecx
	movq	%r13, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%eax, %edx
	callq	_vmcs_setreg
LBB0_14:
	movl	%r12d, %edi
	callq	_vmx_shadow_reg
	testl	%eax, %eax
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	jle	LBB0_15
## %bb.16:
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	addq	8(%r15), %rbx
	movl	%eax, %edi
	callq	_VMCS_IDENT
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	callq	_vmcs_setreg
	movl	%eax, %r13d
	jmp	LBB0_17
LBB0_15:
	xorl	%r13d, %r13d
LBB0_17:
	movq	_VM_REG_GUEST_CR3@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_19
## %bb.18:
	movq	(%r15), %rax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rax,%rcx,4), %edx
	movq	%r15, %rdi
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_vmx_invvpid
LBB0_19:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_curcpu,4,2                     ## @curcpu
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vmx_setreg: %s%d is running"

	.comm	_VM_REG_GUEST_INTR_SHADOW,4,2   ## @VM_REG_GUEST_INTR_SHADOW
	.comm	_entry_ctls,4,2                 ## @entry_ctls
	.comm	_VM_ENTRY_LOAD_EFER,4,2         ## @VM_ENTRY_LOAD_EFER
	.comm	_VM_REG_GUEST_EFER,4,2          ## @VM_REG_GUEST_EFER
	.comm	_VMCS_ENTRY_CTLS,4,2            ## @VMCS_ENTRY_CTLS
	.comm	_EFER_LMA,4,2                   ## @EFER_LMA
	.comm	_VM_ENTRY_GUEST_LMA,4,2         ## @VM_ENTRY_GUEST_LMA
	.comm	_VM_REG_GUEST_CR3,4,2           ## @VM_REG_GUEST_CR3
	.no_dead_strip	_vmx_setreg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vmx_setreg
_vmx_setreg:                            ; @vmx_setreg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x23, x3
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
	ldr	w0, [x0, #16]
	add	x2, sp, #12
	bl	_vcpu_is_running
	mov	x21, x0
	cbz	w0, LBB0_3
; %bb.1:
	ldr	w8, [sp, #12]
Lloh0:
	adrp	x9, _curcpu@GOTPAGE
Lloh1:
	ldr	x9, [x9, _curcpu@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_3
; %bb.2:
	ldr	w0, [x20, #16]
	bl	_vm_name
	mov	x1, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x19
	bl	_panic
LBB0_3:
Lloh5:
	adrp	x8, _VM_REG_GUEST_INTR_SHADOW@GOTPAGE
Lloh6:
	ldr	x8, [x8, _VM_REG_GUEST_INTR_SHADOW@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	mov	x3, x23
	bl	_vmx_modify_intr_shadow
	mov	x24, x0
	b	LBB0_18
LBB0_5:
	ldr	x8, [x20]
	add	x0, x8, w19, sxtw #2
	mov	x1, x22
	mov	x2, x23
	bl	_vmxctx_setreg
	cbz	x0, LBB0_10
; %bb.6:
	sxtw	x25, w19
	ldr	x8, [x20, #8]
	add	x0, x8, x25, lsl #2
	mov	x1, x21
	mov	x2, x22
	mov	x3, x23
	bl	_vmcs_setreg
	mov	x24, x0
	cbnz	w0, LBB0_18
; %bb.7:
Lloh8:
	adrp	x8, _entry_ctls@GOTPAGE
Lloh9:
	ldr	x8, [x8, _entry_ctls@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _VM_ENTRY_LOAD_EFER@GOTPAGE
Lloh12:
	ldr	x9, [x9, _VM_ENTRY_LOAD_EFER@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh14:
	adrp	x9, _VM_REG_GUEST_EFER@GOTPAGE
Lloh15:
	ldr	x9, [x9, _VM_REG_GUEST_EFER@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	cmp	w8, #0
	ccmp	w9, w22, #0, ne
	b.ne	LBB0_13
; %bb.8:
	ldr	x8, [x20, #8]
	add	x24, x8, x25, lsl #2
Lloh17:
	adrp	x26, _VMCS_ENTRY_CTLS@GOTPAGE
Lloh18:
	ldr	x26, [x26, _VMCS_ENTRY_CTLS@GOTPAGEOFF]
	ldr	w0, [x26]
	bl	_VMCS_IDENT
	mov	x2, x0
	add	x3, sp, #8
	mov	x0, x24
	mov	x1, x21
	bl	_vmcs_getreg
Lloh19:
	adrp	x8, _EFER_LMA@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EFER_LMA@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x8]
Lloh22:
	adrp	x8, _VM_ENTRY_GUEST_LMA@GOTPAGE
Lloh23:
	ldr	x8, [x8, _VM_ENTRY_GUEST_LMA@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	tst	w9, w23
	b.eq	LBB0_11
; %bb.9:
	ldr	w9, [sp, #8]
	orr	w8, w9, w8
	b	LBB0_12
LBB0_10:
	mov	w24, #0
	b	LBB0_18
LBB0_11:
	ldr	w9, [sp, #8]
	bic	w8, w9, w8
LBB0_12:
	str	w8, [sp, #8]
	ldr	x8, [x20, #8]
	add	x24, x8, x25, lsl #2
	ldr	w0, [x26]
	bl	_VMCS_IDENT
	mov	x2, x0
	ldr	w3, [sp, #8]
	mov	x0, x24
	mov	x1, x21
	bl	_vmcs_setreg
LBB0_13:
	mov	x0, x22
	bl	_vmx_shadow_reg
	cmp	w0, #1
	b.lt	LBB0_15
; %bb.14:
	ldr	x8, [x20, #8]
	add	x24, x8, x25, lsl #2
	bl	_VMCS_IDENT
	mov	x2, x0
	mov	x0, x24
	mov	x1, x21
	mov	x3, x23
	bl	_vmcs_setreg
	mov	x24, x0
	b	LBB0_16
LBB0_15:
	mov	w24, #0
LBB0_16:
Lloh25:
	adrp	x8, _VM_REG_GUEST_CR3@GOTPAGE
Lloh26:
	ldr	x8, [x8, _VM_REG_GUEST_CR3@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_18
; %bb.17:
	ldr	x8, [x20]
	ldr	w2, [x8, x25, lsl #2]
	mov	x0, x20
	mov	x1, x19
	mov	x3, x21
	bl	_vmx_invvpid
LBB0_18:
	mov	x0, x24
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_curcpu,4,2                     ; @curcpu
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vmx_setreg: %s%d is running"

	.comm	_VM_REG_GUEST_INTR_SHADOW,4,2   ; @VM_REG_GUEST_INTR_SHADOW
	.comm	_entry_ctls,4,2                 ; @entry_ctls
	.comm	_VM_ENTRY_LOAD_EFER,4,2         ; @VM_ENTRY_LOAD_EFER
	.comm	_VM_REG_GUEST_EFER,4,2          ; @VM_REG_GUEST_EFER
	.comm	_VMCS_ENTRY_CTLS,4,2            ; @VMCS_ENTRY_CTLS
	.comm	_EFER_LMA,4,2                   ; @EFER_LMA
	.comm	_VM_ENTRY_GUEST_LMA,4,2         ; @VM_ENTRY_GUEST_LMA
	.comm	_VM_REG_GUEST_CR3,4,2           ; @VM_REG_GUEST_CR3
	.no_dead_strip	_vmx_setreg
.subsections_via_symbols
