	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vlapic_dfr_write_handler       ## -- Begin function vlapic_dfr_write_handler
	.p2align	4, 0x90
_vlapic_dfr_write_handler:              ## @vlapic_dfr_write_handler
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	8(%rdi), %rbx
	callq	_x2apic
	testq	%rax, %rax
	je	LBB0_1
## %bb.7:
	movl	(%r14), %edi
	movl	(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	callq	_VM_CTR1
	movl	$0, (%rbx)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_1:
	movq	_APIC_DFR_MODEL_MASK@GOTPCREL(%rip), %rax
	movl	(%rbx), %edx
	andl	(%rax), %edx
	movl	%edx, (%rbx)
	movq	_APIC_DFR_RESERVED@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movl	%edx, (%rbx)
	movl	(%rax), %eax
	andl	%edx, %eax
	movq	_APIC_DFR_MODEL_FLAT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_4
## %bb.2:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_3
LBB0_4:
	movq	_APIC_DFR_MODEL_CLUSTER@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_6
## %bb.5:
	leaq	L_.str.2(%rip), %rsi
LBB0_3:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_VLAPIC_CTR0                    ## TAILCALL
LBB0_6:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_VLAPIC_CTR1                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ignoring write to DFR in x2apic mode: %#x"

	.comm	_APIC_DFR_MODEL_MASK,4,2        ## @APIC_DFR_MODEL_MASK
	.comm	_APIC_DFR_RESERVED,4,2          ## @APIC_DFR_RESERVED
	.comm	_APIC_DFR_MODEL_FLAT,4,2        ## @APIC_DFR_MODEL_FLAT
L_.str.1:                               ## @.str.1
	.asciz	"vlapic DFR in Flat Model"

	.comm	_APIC_DFR_MODEL_CLUSTER,4,2     ## @APIC_DFR_MODEL_CLUSTER
L_.str.2:                               ## @.str.2
	.asciz	"vlapic DFR in Cluster Model"

L_.str.3:                               ## @.str.3
	.asciz	"DFR in Unknown Model %#x"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vlapic_dfr_write_handler       ; -- Begin function vlapic_dfr_write_handler
	.p2align	2
_vlapic_dfr_write_handler:              ; @vlapic_dfr_write_handler
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.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	x20, [x0, #8]
	bl	_x2apic
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w0, [x19]
	ldr	w2, [x20]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_VM_CTR1
	str	wzr, [x20]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_2:
Lloh2:
	adrp	x8, _APIC_DFR_MODEL_MASK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _APIC_DFR_MODEL_MASK@GOTPAGEOFF]
	ldr	w9, [x8]
	ldr	w10, [x20]
	and	w9, w10, w9
	str	w9, [x20]
Lloh4:
	adrp	x10, _APIC_DFR_RESERVED@GOTPAGE
Lloh5:
	ldr	x10, [x10, _APIC_DFR_RESERVED@GOTPAGEOFF]
Lloh6:
	ldr	w10, [x10]
	orr	w2, w10, w9
	str	w2, [x20]
	ldr	w8, [x8]
	and	w8, w8, w2
Lloh7:
	adrp	x9, _APIC_DFR_MODEL_FLAT@GOTPAGE
Lloh8:
	ldr	x9, [x9, _APIC_DFR_MODEL_FLAT@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_4
; %bb.3:
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_4:
Lloh12:
	adrp	x9, _APIC_DFR_MODEL_CLUSTER@GOTPAGE
Lloh13:
	ldr	x9, [x9, _APIC_DFR_MODEL_CLUSTER@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_7
; %bb.5:
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_6:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_VLAPIC_CTR0
LBB0_7:
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_VLAPIC_CTR1
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ignoring write to DFR in x2apic mode: %#x"

	.comm	_APIC_DFR_MODEL_MASK,4,2        ; @APIC_DFR_MODEL_MASK
	.comm	_APIC_DFR_RESERVED,4,2          ; @APIC_DFR_RESERVED
	.comm	_APIC_DFR_MODEL_FLAT,4,2        ; @APIC_DFR_MODEL_FLAT
l_.str.1:                               ; @.str.1
	.asciz	"vlapic DFR in Flat Model"

	.comm	_APIC_DFR_MODEL_CLUSTER,4,2     ; @APIC_DFR_MODEL_CLUSTER
l_.str.2:                               ; @.str.2
	.asciz	"vlapic DFR in Cluster Model"

l_.str.3:                               ; @.str.3
	.asciz	"DFR in Unknown Model %#x"

.subsections_via_symbols
