	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function emulate_sysenter
_emulate_sysenter:                      ## @emulate_sysenter
	.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	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	(%rdi), %eax
	movq	_X86EMUL_MODE_REAL@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_2
## %bb.1:
	movl	8(%rbx), %edi
	xorl	%esi, %esi
	callq	_kvm_inject_gp
	movq	_X86EMUL_UNHANDLEABLE@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_2:
	cmpl	$128, %eax
	jne	LBB0_4
## %bb.3:
	movq	_X86EMUL_UNHANDLEABLE@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_4:
	leaq	-48(%rbp), %rsi
	leaq	-64(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_setup_syscalls_segments
	movq	_kvm_x86_ops@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movl	8(%rbx), %edi
	movq	_MSR_IA32_SYSENTER_CS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	-28(%rbp), %rdx
	callq	*(%rax)
	movl	(%rbx), %eax
	cmpl	$128, %eax
	je	LBB0_9
## %bb.5:
	cmpl	$129, %eax
	jne	LBB0_6
## %bb.7:
	movl	-28(%rbp), %ecx
	testl	$65532, %ecx                    ## imm = 0xFFFC
	jne	LBB0_10
	jmp	LBB0_8
LBB0_9:
	movl	-28(%rbp), %ecx
	testl	%ecx, %ecx
	jne	LBB0_10
LBB0_8:
	movl	8(%rbx), %edi
	xorl	%esi, %esi
	callq	_kvm_inject_gp
	movq	_X86EMUL_PROPAGATE_FAULT@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_6:
	movl	-28(%rbp), %ecx
LBB0_10:
	movq	_EFLG_VM@GOTPCREL(%rip), %rdx
	movq	_EFLG_IF@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	(%rdx), %esi
	movq	_EFLG_RF@GOTPCREL(%rip), %rdx
	orl	(%rdx), %esi
	notl	%esi
	andl	%esi, 4(%rbx)
	movq	_SELECTOR_RPL_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	notl	%edx
	andl	%edx, %ecx
	movl	%ecx, -48(%rbp)
	addl	$8, %ecx
	andl	%edx, %ecx
	movl	%ecx, -64(%rbp)
	cmpl	$128, %eax
	je	LBB0_12
## %bb.11:
	movl	8(%rbx), %edi
	callq	_is_long_mode
	testq	%rax, %rax
	je	LBB0_13
LBB0_12:
	movq	$0, -40(%rbp)
	movl	$1, -44(%rbp)
LBB0_13:
	movq	(%r15), %rax
	movl	8(%rbx), %edi
	movq	_VCPU_SREG_CS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leaq	-48(%rbp), %rsi
	callq	*8(%rax)
	movq	(%r15), %rax
	movl	8(%rbx), %edi
	movq	_VCPU_SREG_SS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leaq	-64(%rbp), %rsi
	callq	*8(%rax)
	movq	(%r15), %rax
	movl	8(%rbx), %edi
	movq	_MSR_IA32_SYSENTER_EIP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	-28(%rbp), %r14
	movq	%r14, %rdx
	callq	*(%rax)
	movl	-28(%rbp), %eax
	movl	%eax, 16(%rbx)
	movq	(%r15), %rax
	movl	8(%rbx), %edi
	movq	_MSR_IA32_SYSENTER_ESP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%r14, %rdx
	callq	*(%rax)
	movl	-28(%rbp), %eax
	movq	24(%rbx), %rcx
	movq	_VCPU_REGS_RSP@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	%eax, (%rcx,%rdx,4)
	movq	_X86EMUL_CONTINUE@GOTPCREL(%rip), %rax
LBB0_14:
	movl	(%rax), %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_X86EMUL_MODE_REAL,4,2          ## @X86EMUL_MODE_REAL
	.comm	_X86EMUL_UNHANDLEABLE,4,2       ## @X86EMUL_UNHANDLEABLE
	.comm	_kvm_x86_ops,8,3                ## @kvm_x86_ops
	.comm	_MSR_IA32_SYSENTER_CS,4,2       ## @MSR_IA32_SYSENTER_CS
	.comm	_X86EMUL_PROPAGATE_FAULT,4,2    ## @X86EMUL_PROPAGATE_FAULT
	.comm	_EFLG_VM,4,2                    ## @EFLG_VM
	.comm	_EFLG_IF,4,2                    ## @EFLG_IF
	.comm	_EFLG_RF,4,2                    ## @EFLG_RF
	.comm	_SELECTOR_RPL_MASK,4,2          ## @SELECTOR_RPL_MASK
	.comm	_VCPU_SREG_CS,4,2               ## @VCPU_SREG_CS
	.comm	_VCPU_SREG_SS,4,2               ## @VCPU_SREG_SS
	.comm	_MSR_IA32_SYSENTER_EIP,4,2      ## @MSR_IA32_SYSENTER_EIP
	.comm	_MSR_IA32_SYSENTER_ESP,4,2      ## @MSR_IA32_SYSENTER_ESP
	.comm	_VCPU_REGS_RSP,8,3              ## @VCPU_REGS_RSP
	.comm	_X86EMUL_CONTINUE,4,2           ## @X86EMUL_CONTINUE
	.no_dead_strip	_emulate_sysenter
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function emulate_sysenter
_emulate_sysenter:                      ; @emulate_sysenter
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _X86EMUL_MODE_REAL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _X86EMUL_MODE_REAL@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	ldr	w0, [x19, #8]
	mov	w1, #0
	bl	_kvm_inject_gp
	b	LBB0_3
LBB0_2:
	cmp	w8, #128
	b.ne	LBB0_4
LBB0_3:
Lloh3:
	adrp	x8, _X86EMUL_UNHANDLEABLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _X86EMUL_UNHANDLEABLE@GOTPAGEOFF]
	b	LBB0_14
LBB0_4:
	add	x1, sp, #32
	add	x2, sp, #16
	mov	x0, x19
	bl	_setup_syscalls_segments
Lloh5:
	adrp	x20, _kvm_x86_ops@GOTPAGE
Lloh6:
	ldr	x20, [x20, _kvm_x86_ops@GOTPAGEOFF]
	ldr	x8, [x20]
	ldr	x8, [x8]
	ldr	w0, [x19, #8]
Lloh7:
	adrp	x9, _MSR_IA32_SYSENTER_CS@GOTPAGE
Lloh8:
	ldr	x9, [x9, _MSR_IA32_SYSENTER_CS@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x9]
	add	x2, sp, #12
	blr	x8
	ldr	w8, [x19]
	cmp	w8, #128
	b.eq	LBB0_7
; %bb.5:
	cmp	w8, #129
	b.ne	LBB0_9
; %bb.6:
	ldr	w9, [sp, #12]
	tst	w9, #0xfffc
	b.ne	LBB0_10
	b	LBB0_8
LBB0_7:
	ldr	w9, [sp, #12]
	cbnz	w9, LBB0_10
LBB0_8:
	ldr	w0, [x19, #8]
	mov	w1, #0
	bl	_kvm_inject_gp
Lloh10:
	adrp	x8, _X86EMUL_PROPAGATE_FAULT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _X86EMUL_PROPAGATE_FAULT@GOTPAGEOFF]
	b	LBB0_14
LBB0_9:
	ldr	w9, [sp, #12]
LBB0_10:
Lloh12:
	adrp	x10, _EFLG_VM@GOTPAGE
Lloh13:
	ldr	x10, [x10, _EFLG_VM@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
Lloh15:
	adrp	x11, _EFLG_IF@GOTPAGE
Lloh16:
	ldr	x11, [x11, _EFLG_IF@GOTPAGEOFF]
Lloh17:
	ldr	w11, [x11]
	orr	w10, w11, w10
Lloh18:
	adrp	x11, _EFLG_RF@GOTPAGE
Lloh19:
	ldr	x11, [x11, _EFLG_RF@GOTPAGEOFF]
Lloh20:
	ldr	w11, [x11]
	orr	w10, w10, w11
	ldr	w11, [x19, #4]
	bic	w10, w11, w10
	str	w10, [x19, #4]
Lloh21:
	adrp	x10, _SELECTOR_RPL_MASK@GOTPAGE
Lloh22:
	ldr	x10, [x10, _SELECTOR_RPL_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	bic	w9, w9, w10
	str	w9, [sp, #32]
	add	w9, w9, #8
	bic	w9, w9, w10
	str	w9, [sp, #16]
	cmp	w8, #128
	b.eq	LBB0_12
; %bb.11:
	ldr	w0, [x19, #8]
	bl	_is_long_mode
	cbz	x0, LBB0_13
LBB0_12:
	str	xzr, [sp, #40]
	mov	w8, #1
	str	w8, [sp, #36]
LBB0_13:
	ldr	x8, [x20]
	ldr	x8, [x8, #8]
	ldr	w0, [x19, #8]
Lloh24:
	adrp	x9, _VCPU_SREG_CS@GOTPAGE
Lloh25:
	ldr	x9, [x9, _VCPU_SREG_CS@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x9]
	add	x1, sp, #32
	blr	x8
	ldr	x8, [x20]
	ldr	x8, [x8, #8]
	ldr	w0, [x19, #8]
Lloh27:
	adrp	x9, _VCPU_SREG_SS@GOTPAGE
Lloh28:
	ldr	x9, [x9, _VCPU_SREG_SS@GOTPAGEOFF]
Lloh29:
	ldr	w2, [x9]
	add	x1, sp, #16
	blr	x8
	ldr	x8, [x20]
	ldr	x8, [x8]
	ldr	w0, [x19, #8]
Lloh30:
	adrp	x9, _MSR_IA32_SYSENTER_EIP@GOTPAGE
Lloh31:
	ldr	x9, [x9, _MSR_IA32_SYSENTER_EIP@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x9]
	add	x2, sp, #12
	blr	x8
	ldr	w8, [sp, #12]
	str	w8, [x19, #16]
	ldr	x8, [x20]
	ldr	x8, [x8]
	ldr	w0, [x19, #8]
Lloh33:
	adrp	x9, _MSR_IA32_SYSENTER_ESP@GOTPAGE
Lloh34:
	ldr	x9, [x9, _MSR_IA32_SYSENTER_ESP@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x9]
	add	x2, sp, #12
	blr	x8
	ldr	w8, [sp, #12]
Lloh36:
	adrp	x9, _VCPU_REGS_RSP@GOTPAGE
Lloh37:
	ldr	x9, [x9, _VCPU_REGS_RSP@GOTPAGEOFF]
	ldr	x10, [x19, #24]
Lloh38:
	ldr	x9, [x9]
	str	w8, [x10, x9, lsl #2]
Lloh39:
	adrp	x8, _X86EMUL_CONTINUE@GOTPAGE
Lloh40:
	ldr	x8, [x8, _X86EMUL_CONTINUE@GOTPAGEOFF]
LBB0_14:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_X86EMUL_MODE_REAL,4,2          ; @X86EMUL_MODE_REAL
	.comm	_X86EMUL_UNHANDLEABLE,4,2       ; @X86EMUL_UNHANDLEABLE
	.comm	_kvm_x86_ops,8,3                ; @kvm_x86_ops
	.comm	_MSR_IA32_SYSENTER_CS,4,2       ; @MSR_IA32_SYSENTER_CS
	.comm	_X86EMUL_PROPAGATE_FAULT,4,2    ; @X86EMUL_PROPAGATE_FAULT
	.comm	_EFLG_VM,4,2                    ; @EFLG_VM
	.comm	_EFLG_IF,4,2                    ; @EFLG_IF
	.comm	_EFLG_RF,4,2                    ; @EFLG_RF
	.comm	_SELECTOR_RPL_MASK,4,2          ; @SELECTOR_RPL_MASK
	.comm	_VCPU_SREG_CS,4,2               ; @VCPU_SREG_CS
	.comm	_VCPU_SREG_SS,4,2               ; @VCPU_SREG_SS
	.comm	_MSR_IA32_SYSENTER_EIP,4,2      ; @MSR_IA32_SYSENTER_EIP
	.comm	_MSR_IA32_SYSENTER_ESP,4,2      ; @MSR_IA32_SYSENTER_ESP
	.comm	_VCPU_REGS_RSP,8,3              ; @VCPU_REGS_RSP
	.comm	_X86EMUL_CONTINUE,4,2           ; @X86EMUL_CONTINUE
	.no_dead_strip	_emulate_sysenter
.subsections_via_symbols
