	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fbsdrun_set_capabilities       ## -- Begin function fbsdrun_set_capabilities
	.p2align	4, 0x90
_fbsdrun_set_capabilities:              ## @fbsdrun_set_capabilities
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	xorl	%eax, %eax
	callq	_fbsdrun_vmexit_on_hlt
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	_VM_CAP_HALT_EXIT@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	leaq	-28(%rbp), %rcx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_vm_get_capability
	testl	%eax, %eax
	js	LBB0_2
## %bb.4:
	movl	(%r15), %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	$1, %ecx
	callq	_vm_set_capability
	movq	_BSP@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_6
## %bb.5:
	movq	_vmexit_hlt@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_handler@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_VM_EXITCODE_HLT@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	%eax, (%rcx,%rdx,4)
LBB0_6:
	xorl	%eax, %eax
	callq	_fbsdrun_vmexit_on_pause
	testq	%rax, %rax
	je	LBB0_11
## %bb.7:
	movq	_VM_CAP_PAUSE_EXIT@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	leaq	-28(%rbp), %rcx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_vm_get_capability
	testl	%eax, %eax
	js	LBB0_8
## %bb.9:
	movl	(%r15), %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	$1, %ecx
	callq	_vm_set_capability
	movq	_BSP@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_11
## %bb.10:
	movq	_vmexit_pause@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_handler@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_VM_EXITCODE_PAUSE@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	%eax, (%rcx,%rdx,4)
LBB0_11:
	movq	_x2apic_mode@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_12
## %bb.13:
	movq	_X2APIC_DISABLED@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_12:
	movq	_X2APIC_ENABLED@GOTPCREL(%rip), %rax
LBB0_14:
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_vm_set_x2apic_state
	testl	%eax, %eax
	jne	LBB0_16
## %bb.15:
	movq	_VM_CAP_ENABLE_INVPCID@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	$1, %ecx
	callq	_vm_set_capability
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	_stderr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fprintf
	movl	$4, %edi
	callq	_exit
LBB0_2:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_3
LBB0_8:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_3:
	xorl	%eax, %eax
	callq	_fprintf
	movl	$4, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_VM_CAP_HALT_EXIT,4,2           ## @VM_CAP_HALT_EXIT
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"VM exit on HLT not supported\n"

	.comm	_BSP,4,2                        ## @BSP
	.comm	_vmexit_hlt,4,2                 ## @vmexit_hlt
	.comm	_handler,8,3                    ## @handler
	.comm	_VM_EXITCODE_HLT,8,3            ## @VM_EXITCODE_HLT
	.comm	_VM_CAP_PAUSE_EXIT,4,2          ## @VM_CAP_PAUSE_EXIT
L_.str.1:                               ## @.str.1
	.asciz	"SMP mux requested, no pause support\n"

	.comm	_vmexit_pause,4,2               ## @vmexit_pause
	.comm	_VM_EXITCODE_PAUSE,8,3          ## @VM_EXITCODE_PAUSE
	.comm	_x2apic_mode,8,3                ## @x2apic_mode
	.comm	_X2APIC_ENABLED,4,2             ## @X2APIC_ENABLED
	.comm	_X2APIC_DISABLED,4,2            ## @X2APIC_DISABLED
L_.str.2:                               ## @.str.2
	.asciz	"Unable to set x2apic state (%d)\n"

	.comm	_VM_CAP_ENABLE_INVPCID,4,2      ## @VM_CAP_ENABLE_INVPCID
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fbsdrun_set_capabilities       ; -- Begin function fbsdrun_set_capabilities
	.p2align	2
_fbsdrun_set_capabilities:              ; @fbsdrun_set_capabilities
	.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	x19, x1
	mov	x20, x0
	bl	_fbsdrun_vmexit_on_hlt
Lloh0:
	adrp	x21, _BSP@GOTPAGE
Lloh1:
	ldr	x21, [x21, _BSP@GOTPAGEOFF]
	cbz	x0, LBB0_4
; %bb.1:
Lloh2:
	adrp	x22, _VM_CAP_HALT_EXIT@GOTPAGE
Lloh3:
	ldr	x22, [x22, _VM_CAP_HALT_EXIT@GOTPAGEOFF]
	ldr	w2, [x22]
	add	x3, sp, #12
	mov	x0, x20
	mov	x1, x19
	bl	_vm_get_capability
	tbnz	w0, #31, LBB0_11
; %bb.2:
	ldr	w2, [x22]
	mov	x0, x20
	mov	x1, x19
	mov	w3, #1
	bl	_vm_set_capability
	ldr	w8, [x21]
	cmp	w8, w19
	b.ne	LBB0_4
; %bb.3:
Lloh4:
	adrp	x8, _vmexit_hlt@GOTPAGE
Lloh5:
	ldr	x8, [x8, _vmexit_hlt@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _handler@GOTPAGE
Lloh8:
	ldr	x9, [x9, _handler@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
Lloh10:
	adrp	x10, _VM_EXITCODE_HLT@GOTPAGE
Lloh11:
	ldr	x10, [x10, _VM_EXITCODE_HLT@GOTPAGEOFF]
Lloh12:
	ldr	x10, [x10]
	str	w8, [x9, x10, lsl #2]
LBB0_4:
	bl	_fbsdrun_vmexit_on_pause
	cbz	x0, LBB0_8
; %bb.5:
Lloh13:
	adrp	x22, _VM_CAP_PAUSE_EXIT@GOTPAGE
Lloh14:
	ldr	x22, [x22, _VM_CAP_PAUSE_EXIT@GOTPAGEOFF]
	ldr	w2, [x22]
	add	x3, sp, #12
	mov	x0, x20
	mov	x1, x19
	bl	_vm_get_capability
	tbnz	w0, #31, LBB0_12
; %bb.6:
	ldr	w2, [x22]
	mov	x0, x20
	mov	x1, x19
	mov	w3, #1
	bl	_vm_set_capability
	ldr	w8, [x21]
	cmp	w8, w19
	b.ne	LBB0_8
; %bb.7:
Lloh15:
	adrp	x8, _vmexit_pause@GOTPAGE
Lloh16:
	ldr	x8, [x8, _vmexit_pause@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _handler@GOTPAGE
Lloh19:
	ldr	x9, [x9, _handler@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
Lloh21:
	adrp	x10, _VM_EXITCODE_PAUSE@GOTPAGE
Lloh22:
	ldr	x10, [x10, _VM_EXITCODE_PAUSE@GOTPAGEOFF]
Lloh23:
	ldr	x10, [x10]
	str	w8, [x9, x10, lsl #2]
LBB0_8:
Lloh24:
	adrp	x8, _x2apic_mode@GOTPAGE
Lloh25:
	ldr	x8, [x8, _x2apic_mode@GOTPAGEOFF]
Lloh26:
	adrp	x9, _X2APIC_DISABLED@GOTPAGE
Lloh27:
	ldr	x9, [x9, _X2APIC_DISABLED@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
Lloh29:
	adrp	x10, _X2APIC_ENABLED@GOTPAGE
Lloh30:
	ldr	x10, [x10, _X2APIC_ENABLED@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x9, x10, eq
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x19
	bl	_vm_set_x2apic_state
                                        ; kill: def $w0 killed $w0 def $x0
	cbnz	w0, LBB0_10
; %bb.9:
Lloh31:
	adrp	x8, _VM_CAP_ENABLE_INVPCID@GOTPAGE
Lloh32:
	ldr	x8, [x8, _VM_CAP_ENABLE_INVPCID@GOTPAGEOFF]
Lloh33:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x19
	mov	w3, #1
	bl	_vm_set_capability
	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_10:
Lloh34:
	adrp	x8, _stderr@GOTPAGE
Lloh35:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	str	x0, [sp]
Lloh37:
	adrp	x1, l_.str.2@PAGE
Lloh38:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x8
	b	LBB0_13
LBB0_11:
Lloh39:
	adrp	x8, _stderr@GOTPAGE
Lloh40:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh41:
	ldr	w0, [x8]
Lloh42:
	adrp	x1, l_.str@PAGE
Lloh43:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_13
LBB0_12:
Lloh44:
	adrp	x8, _stderr@GOTPAGE
Lloh45:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh46:
	ldr	w0, [x8]
Lloh47:
	adrp	x1, l_.str.1@PAGE
Lloh48:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_13:
	bl	_fprintf
	mov	w0, #4
	bl	_exit
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh28
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.comm	_VM_CAP_HALT_EXIT,4,2           ; @VM_CAP_HALT_EXIT
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"VM exit on HLT not supported\n"

	.comm	_BSP,4,2                        ; @BSP
	.comm	_vmexit_hlt,4,2                 ; @vmexit_hlt
	.comm	_handler,8,3                    ; @handler
	.comm	_VM_EXITCODE_HLT,8,3            ; @VM_EXITCODE_HLT
	.comm	_VM_CAP_PAUSE_EXIT,4,2          ; @VM_CAP_PAUSE_EXIT
l_.str.1:                               ; @.str.1
	.asciz	"SMP mux requested, no pause support\n"

	.comm	_vmexit_pause,4,2               ; @vmexit_pause
	.comm	_VM_EXITCODE_PAUSE,8,3          ; @VM_EXITCODE_PAUSE
	.comm	_x2apic_mode,8,3                ; @x2apic_mode
	.comm	_X2APIC_ENABLED,4,2             ; @X2APIC_ENABLED
	.comm	_X2APIC_DISABLED,4,2            ; @X2APIC_DISABLED
l_.str.2:                               ; @.str.2
	.asciz	"Unable to set x2apic state (%d)\n"

	.comm	_VM_CAP_ENABLE_INVPCID,4,2      ; @VM_CAP_ENABLE_INVPCID
.subsections_via_symbols
