	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vlapic_set_x2apic_state        ## -- Begin function vlapic_set_x2apic_state
	.p2align	4, 0x90
_vlapic_set_x2apic_state:               ## @vlapic_set_x2apic_state
	.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, %r14d
	callq	_vm_lapic
	movq	%rax, %rbx
	movq	_X2APIC_DISABLED@GOTPCREL(%rip), %rcx
	movq	_APICBASE_X2APIC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%r14d, (%rcx)
	jne	LBB0_2
## %bb.1:
	notl	%eax
	andl	%eax, 16(%rbx)
	jmp	LBB0_3
LBB0_2:
	orl	%eax, 16(%rbx)
LBB0_3:
	movq	8(%rbx), %r15
	movq	%rbx, %rdi
	callq	_vlapic_get_id
	movl	%eax, 16(%r15)
	movq	%rbx, %rdi
	callq	_x2apic
	xorl	%r12d, %r12d
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rbx, %rdi
	callq	_x2apic_ldr
	jmp	LBB0_6
LBB0_4:
	movl	$-1, %r12d
	xorl	%eax, %eax
LBB0_6:
	movq	%rax, 8(%r15)
	movl	%r12d, (%r15)
	movq	_X2APIC_ENABLED@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_8
## %bb.7:
	movq	(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
LBB0_8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_X2APIC_DISABLED,4,2            ## @X2APIC_DISABLED
	.comm	_APICBASE_X2APIC,4,2            ## @APICBASE_X2APIC
	.comm	_X2APIC_ENABLED,4,2             ## @X2APIC_ENABLED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vlapic_set_x2apic_state        ; -- Begin function vlapic_set_x2apic_state
	.p2align	2
_vlapic_set_x2apic_state:               ; @vlapic_set_x2apic_state
	.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	x20, x2
	bl	_vm_lapic
	mov	x19, x0
Lloh0:
	adrp	x8, _X2APIC_DISABLED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _X2APIC_DISABLED@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
Lloh3:
	adrp	x8, _APICBASE_X2APIC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _APICBASE_X2APIC@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w9, w20
	b.ne	LBB0_2
; %bb.1:
	ldr	w9, [x19, #16]
	bic	w8, w9, w8
	b	LBB0_3
LBB0_2:
	ldr	w9, [x19, #16]
	orr	w8, w9, w8
LBB0_3:
	str	w8, [x19, #16]
	ldr	x21, [x19, #8]
	mov	x0, x19
	bl	_vlapic_get_id
	str	w0, [x21, #16]
	mov	x0, x19
	bl	_x2apic
	cbz	x0, LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_x2apic_ldr
	mov	w8, #0
	b	LBB0_6
LBB0_5:
	mov	w8, #-1
LBB0_6:
	str	x0, [x21, #8]
	str	w8, [x21]
Lloh6:
	adrp	x8, _X2APIC_ENABLED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _X2APIC_ENABLED@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_9
; %bb.7:
	ldr	x1, [x19]
	cbz	x1, LBB0_9
; %bb.8:
	mov	x0, x19
	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
	br	x1
LBB0_9:
	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
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_X2APIC_DISABLED,4,2            ; @X2APIC_DISABLED
	.comm	_APICBASE_X2APIC,4,2            ; @APICBASE_X2APIC
	.comm	_X2APIC_ENABLED,4,2             ; @X2APIC_ENABLED
.subsections_via_symbols
