	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function svm_set_segment
_svm_set_segment:                       ## @svm_set_segment
	.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	%edx, %r15d
	movq	%rsi, %r12
	movq	%rdi, %rbx
	callq	_to_svm
	movq	%rax, %r14
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_svm_seg
	movl	48(%r12), %ecx
	movl	%ecx, 12(%rax)
	movl	44(%r12), %ecx
	movl	%ecx, 8(%rax)
	movl	40(%r12), %ecx
	movl	%ecx, 4(%rax)
	cmpq	$0, 32(%r12)
	je	LBB0_2
## %bb.1:
	movl	$0, (%rax)
	jmp	LBB0_3
LBB0_2:
	movq	_SVM_SELECTOR_TYPE_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	andl	(%r12), %edx
	movl	%edx, (%rax)
	movl	4(%r12), %esi
	andl	$1, %esi
	movq	_SVM_SELECTOR_S_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %esi
	orl	%edx, %esi
	movl	%esi, (%rax)
	movl	8(%r12), %edx
	andl	$3, %edx
	movq	_SVM_SELECTOR_DPL_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	%esi, %edx
	movl	%edx, (%rax)
	movl	12(%r12), %esi
	andl	$1, %esi
	movq	_SVM_SELECTOR_P_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %esi
	orl	%edx, %esi
	movl	%esi, (%rax)
	movl	16(%r12), %edx
	andl	$1, %edx
	movq	_SVM_SELECTOR_AVL_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	%esi, %edx
	movl	%edx, (%rax)
	movl	20(%r12), %esi
	andl	$1, %esi
	movq	_SVM_SELECTOR_L_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %esi
	orl	%edx, %esi
	movl	%esi, (%rax)
	movl	24(%r12), %edx
	andl	$1, %edx
	movq	_SVM_SELECTOR_DB_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	%esi, %edx
	movl	%edx, (%rax)
	movl	28(%r12), %esi
	andl	$1, %esi
	movq	_SVM_SELECTOR_G_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %esi
	orl	%edx, %esi
	movl	%esi, (%rax)
LBB0_3:
	movq	_VCPU_SREG_CS@GOTPCREL(%rip), %rax
	movq	(%r14), %rdi
	cmpl	%r15d, (%rax)
	jne	LBB0_5
## %bb.4:
	movl	4(%rdi), %eax
	movq	_SVM_SELECTOR_DPL_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	andl	$3, %eax
	movl	%eax, (%rdi)
LBB0_5:
	movq	_VMCB_SEG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mark_dirty                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SVM_SELECTOR_TYPE_MASK,4,2     ## @SVM_SELECTOR_TYPE_MASK
	.comm	_SVM_SELECTOR_S_SHIFT,4,2       ## @SVM_SELECTOR_S_SHIFT
	.comm	_SVM_SELECTOR_DPL_SHIFT,4,2     ## @SVM_SELECTOR_DPL_SHIFT
	.comm	_SVM_SELECTOR_P_SHIFT,4,2       ## @SVM_SELECTOR_P_SHIFT
	.comm	_SVM_SELECTOR_AVL_SHIFT,4,2     ## @SVM_SELECTOR_AVL_SHIFT
	.comm	_SVM_SELECTOR_L_SHIFT,4,2       ## @SVM_SELECTOR_L_SHIFT
	.comm	_SVM_SELECTOR_DB_SHIFT,4,2      ## @SVM_SELECTOR_DB_SHIFT
	.comm	_SVM_SELECTOR_G_SHIFT,4,2       ## @SVM_SELECTOR_G_SHIFT
	.comm	_VCPU_SREG_CS,4,2               ## @VCPU_SREG_CS
	.comm	_VMCB_SEG,4,2                   ## @VMCB_SEG
	.no_dead_strip	_svm_set_segment
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function svm_set_segment
_svm_set_segment:                       ; @svm_set_segment
	.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, x2
	mov	x21, x1
	mov	x22, x0
	bl	_to_svm
	mov	x20, x0
	mov	x0, x22
	mov	x1, x19
	bl	_svm_seg
	ldr	w8, [x21, #48]
	str	w8, [x0, #12]
	ldr	d0, [x21, #40]
	stur	d0, [x0, #4]
	ldr	x8, [x21, #32]
	cbz	x8, LBB0_2
; %bb.1:
	str	wzr, [x0]
	b	LBB0_3
LBB0_2:
Lloh0:
	adrp	x8, _SVM_SELECTOR_TYPE_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SVM_SELECTOR_TYPE_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldp	w9, w10, [x21]
	and	w8, w8, w9
	str	w8, [x0]
	and	w9, w10, #0x1
Lloh3:
	adrp	x10, _SVM_SELECTOR_S_SHIFT@GOTPAGE
Lloh4:
	ldr	x10, [x10, _SVM_SELECTOR_S_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w9, w8
	str	w8, [x0]
	ldp	w9, w10, [x21, #8]
	and	w9, w9, #0x3
Lloh6:
	adrp	x11, _SVM_SELECTOR_DPL_SHIFT@GOTPAGE
Lloh7:
	ldr	x11, [x11, _SVM_SELECTOR_DPL_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w11, [x11]
	lsl	w9, w9, w11
	orr	w8, w9, w8
	str	w8, [x0]
	and	w9, w10, #0x1
Lloh9:
	adrp	x10, _SVM_SELECTOR_P_SHIFT@GOTPAGE
Lloh10:
	ldr	x10, [x10, _SVM_SELECTOR_P_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w9, w8
	str	w8, [x0]
	ldp	w9, w10, [x21, #16]
	and	w9, w9, #0x1
Lloh12:
	adrp	x11, _SVM_SELECTOR_AVL_SHIFT@GOTPAGE
Lloh13:
	ldr	x11, [x11, _SVM_SELECTOR_AVL_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w11, [x11]
	lsl	w9, w9, w11
	orr	w8, w9, w8
	str	w8, [x0]
	and	w9, w10, #0x1
Lloh15:
	adrp	x10, _SVM_SELECTOR_L_SHIFT@GOTPAGE
Lloh16:
	ldr	x10, [x10, _SVM_SELECTOR_L_SHIFT@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w9, w8
	str	w8, [x0]
Lloh18:
	adrp	x9, _SVM_SELECTOR_DB_SHIFT@GOTPAGE
Lloh19:
	ldr	x9, [x9, _SVM_SELECTOR_DB_SHIFT@GOTPAGEOFF]
	ldp	w10, w11, [x21, #24]
	and	w10, w10, #0x1
Lloh20:
	ldr	w9, [x9]
	lsl	w9, w10, w9
	orr	w8, w9, w8
	str	w8, [x0]
	and	w9, w11, #0x1
Lloh21:
	adrp	x10, _SVM_SELECTOR_G_SHIFT@GOTPAGE
Lloh22:
	ldr	x10, [x10, _SVM_SELECTOR_G_SHIFT@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w9, w8
	str	w8, [x0]
LBB0_3:
Lloh24:
	adrp	x8, _VCPU_SREG_CS@GOTPAGE
Lloh25:
	ldr	x8, [x8, _VCPU_SREG_CS@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	ldr	x0, [x20]
	cmp	w8, w19
	b.ne	LBB0_5
; %bb.4:
	ldr	w8, [x0, #4]
Lloh27:
	adrp	x9, _SVM_SELECTOR_DPL_SHIFT@GOTPAGE
Lloh28:
	ldr	x9, [x9, _SVM_SELECTOR_DPL_SHIFT@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	asr	w8, w8, w9
	and	w8, w8, #0x3
	str	w8, [x0]
LBB0_5:
Lloh30:
	adrp	x8, _VMCB_SEG@GOTPAGE
Lloh31:
	ldr	x8, [x8, _VMCB_SEG@GOTPAGEOFF]
Lloh32:
	ldr	w1, [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
	b	_mark_dirty
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_SVM_SELECTOR_TYPE_MASK,4,2     ; @SVM_SELECTOR_TYPE_MASK
	.comm	_SVM_SELECTOR_S_SHIFT,4,2       ; @SVM_SELECTOR_S_SHIFT
	.comm	_SVM_SELECTOR_DPL_SHIFT,4,2     ; @SVM_SELECTOR_DPL_SHIFT
	.comm	_SVM_SELECTOR_P_SHIFT,4,2       ; @SVM_SELECTOR_P_SHIFT
	.comm	_SVM_SELECTOR_AVL_SHIFT,4,2     ; @SVM_SELECTOR_AVL_SHIFT
	.comm	_SVM_SELECTOR_L_SHIFT,4,2       ; @SVM_SELECTOR_L_SHIFT
	.comm	_SVM_SELECTOR_DB_SHIFT,4,2      ; @SVM_SELECTOR_DB_SHIFT
	.comm	_SVM_SELECTOR_G_SHIFT,4,2       ; @SVM_SELECTOR_G_SHIFT
	.comm	_VCPU_SREG_CS,4,2               ; @VCPU_SREG_CS
	.comm	_VMCB_SEG,4,2                   ; @VMCB_SEG
	.no_dead_strip	_svm_set_segment
.subsections_via_symbols
