	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_acpi_cpu_idle_mwait            ## -- Begin function acpi_cpu_idle_mwait
	.p2align	4, 0x90
_acpi_cpu_idle_mwait:                   ## @acpi_cpu_idle_mwait
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	movq	_monitorbuf@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PCPU_PTR
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_atomic_load_int
	movq	_STATE_SLEEPING@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movq	_STATE_MWAIT@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	movq	%rbx, %rdi
	callq	_atomic_store_int
	movq	_ibpb_set@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PCPU_GET
	movq	_hw_ssb_active@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	orq	(%rcx), %rax
	je	LBB0_2
## %bb.1:
	movq	_MSR_IA32_SPEC_CTRL@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_rdmsr
	movl	%eax, %r15d
	movl	(%r13), %edi
	movq	_IA32_SPEC_CTRL_IBRS@GOTPCREL(%rip), %rax
	movq	_IA32_SPEC_CTRL_STIBP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_IA32_SPEC_CTRL_SSBD@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	notl	%esi
	andl	%r15d, %esi
	callq	_wrmsr
LBB0_2:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_cpu_monitor
	movq	%rbx, %rdi
	callq	_atomic_load_int
	cmpq	(%r12), %rax
	jne	LBB0_4
## %bb.3:
	movq	_MWAIT_INTRBREAK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r14d, %esi
	callq	_cpu_mwait
LBB0_4:
	testl	%r15d, %r15d
	je	LBB0_6
## %bb.5:
	movq	_MSR_IA32_SPEC_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r15d, %esi
	callq	_wrmsr
LBB0_6:
	movq	_STATE_RUNNING@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_atomic_store_int               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_monitorbuf,4,2                 ## @monitorbuf
	.comm	_STATE_SLEEPING,8,3             ## @STATE_SLEEPING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cpu_mwait_cx: wrong monitorbuf state"

	.comm	_STATE_MWAIT,8,3                ## @STATE_MWAIT
	.comm	_ibpb_set,4,2                   ## @ibpb_set
	.comm	_hw_ssb_active,8,3              ## @hw_ssb_active
	.comm	_MSR_IA32_SPEC_CTRL,4,2         ## @MSR_IA32_SPEC_CTRL
	.comm	_IA32_SPEC_CTRL_IBRS,4,2        ## @IA32_SPEC_CTRL_IBRS
	.comm	_IA32_SPEC_CTRL_STIBP,4,2       ## @IA32_SPEC_CTRL_STIBP
	.comm	_IA32_SPEC_CTRL_SSBD,4,2        ## @IA32_SPEC_CTRL_SSBD
	.comm	_MWAIT_INTRBREAK,4,2            ## @MWAIT_INTRBREAK
	.comm	_STATE_RUNNING,8,3              ## @STATE_RUNNING
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_acpi_cpu_idle_mwait            ; -- Begin function acpi_cpu_idle_mwait
	.p2align	2
_acpi_cpu_idle_mwait:                   ; @acpi_cpu_idle_mwait
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x0
Lloh0:
	adrp	x8, _monitorbuf@GOTPAGE
Lloh1:
	ldr	x8, [x8, _monitorbuf@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_PCPU_PTR
	mov	x19, x0
	bl	_atomic_load_int
Lloh3:
	adrp	x8, _STATE_SLEEPING@GOTPAGE
Lloh4:
	ldr	x8, [x8, _STATE_SLEEPING@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x0, x8
	cset	w0, eq
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
Lloh8:
	adrp	x22, _STATE_MWAIT@GOTPAGE
Lloh9:
	ldr	x22, [x22, _STATE_MWAIT@GOTPAGEOFF]
	ldr	x1, [x22]
	mov	x0, x19
	bl	_atomic_store_int
Lloh10:
	adrp	x8, _ibpb_set@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ibpb_set@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	bl	_PCPU_GET
Lloh13:
	adrp	x8, _hw_ssb_active@GOTPAGE
Lloh14:
	ldr	x8, [x8, _hw_ssb_active@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
Lloh16:
	adrp	x23, _MSR_IA32_SPEC_CTRL@GOTPAGE
Lloh17:
	ldr	x23, [x23, _MSR_IA32_SPEC_CTRL@GOTPAGEOFF]
	orr	x8, x0, x8
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w0, [x23]
	bl	_rdmsr
	mov	x21, x0
	ldr	w0, [x23]
Lloh18:
	adrp	x8, _IA32_SPEC_CTRL_IBRS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _IA32_SPEC_CTRL_IBRS@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	adrp	x9, _IA32_SPEC_CTRL_STIBP@GOTPAGE
Lloh22:
	ldr	x9, [x9, _IA32_SPEC_CTRL_STIBP@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh24:
	adrp	x9, _IA32_SPEC_CTRL_SSBD@GOTPAGE
Lloh25:
	ldr	x9, [x9, _IA32_SPEC_CTRL_SSBD@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w8, w8, w9
	bic	w1, w21, w8
	bl	_wrmsr
	b	LBB0_3
LBB0_2:
	mov	w21, #0
LBB0_3:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	bl	_cpu_monitor
	mov	x0, x19
	bl	_atomic_load_int
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_5
; %bb.4:
Lloh27:
	adrp	x8, _MWAIT_INTRBREAK@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MWAIT_INTRBREAK@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_cpu_mwait
LBB0_5:
	cbz	w21, LBB0_7
; %bb.6:
	ldr	w0, [x23]
	mov	x1, x21
	bl	_wrmsr
LBB0_7:
Lloh30:
	adrp	x8, _STATE_RUNNING@GOTPAGE
Lloh31:
	ldr	x8, [x8, _STATE_RUNNING@GOTPAGEOFF]
Lloh32:
	ldr	x1, [x8]
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_atomic_store_int
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_monitorbuf,4,2                 ; @monitorbuf
	.comm	_STATE_SLEEPING,8,3             ; @STATE_SLEEPING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cpu_mwait_cx: wrong monitorbuf state"

	.comm	_STATE_MWAIT,8,3                ; @STATE_MWAIT
	.comm	_ibpb_set,4,2                   ; @ibpb_set
	.comm	_hw_ssb_active,8,3              ; @hw_ssb_active
	.comm	_MSR_IA32_SPEC_CTRL,4,2         ; @MSR_IA32_SPEC_CTRL
	.comm	_IA32_SPEC_CTRL_IBRS,4,2        ; @IA32_SPEC_CTRL_IBRS
	.comm	_IA32_SPEC_CTRL_STIBP,4,2       ; @IA32_SPEC_CTRL_STIBP
	.comm	_IA32_SPEC_CTRL_SSBD,4,2        ; @IA32_SPEC_CTRL_SSBD
	.comm	_MWAIT_INTRBREAK,4,2            ; @MWAIT_INTRBREAK
	.comm	_STATE_RUNNING,8,3              ; @STATE_RUNNING
.subsections_via_symbols
