	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cpu_mp_shutdown                ## -- Begin function cpu_mp_shutdown
	.p2align	4, 0x90
_cpu_mp_shutdown:                       ## @cpu_mp_shutdown
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	xorl	%eax, %eax
	callq	_critical_enter
	movq	_all_cpus@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_shutdown_cpus@GOTPCREL(%rip), %rbx
	movl	%eax, (%rbx)
	movq	_cpuid@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PCPU_GET
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_CPU_CLR
	movl	(%rbx), %eax
	movl	%eax, -20(%rbp)
	movq	_stopped_cpus@GOTPCREL(%rip), %rdi
	leaq	-20(%rbp), %rsi
	callq	_CPU_CMP
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_stopped_cpus@GOTPCREL(%rip), %rsi
	leaq	-20(%rbp), %rdi
	callq	_CPU_NAND
	movl	-20(%rbp), %edi
	callq	_stop_cpus
LBB0_2:
	movl	$100002, %ebx                   ## imm = 0x186A2
	movq	_shutdown_cpus@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_CPU_EMPTY
	testl	%eax, %eax
	jne	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	decl	%ebx
	jne	LBB0_3
## %bb.5:
	leaq	L_str(%rip), %rdi
	callq	_puts
LBB0_6:
	xorl	%eax, %eax
	callq	_critical_exit
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_all_cpus,4,2                   ## @all_cpus
	.comm	_shutdown_cpus,4,2              ## @shutdown_cpus
	.comm	_cpuid,4,2                      ## @cpuid
	.comm	_stopped_cpus,4,2               ## @stopped_cpus
	.section	__TEXT,__cstring,cstring_literals
L_str:                                  ## @str
	.asciz	"timeout shutting down CPUs."

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cpu_mp_shutdown                ; -- Begin function cpu_mp_shutdown
	.p2align	2
_cpu_mp_shutdown:                       ; @cpu_mp_shutdown
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	bl	_critical_enter
Lloh0:
	adrp	x8, _all_cpus@GOTPAGE
Lloh1:
	ldr	x8, [x8, _all_cpus@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x19, _shutdown_cpus@GOTPAGE
Lloh4:
	ldr	x19, [x19, _shutdown_cpus@GOTPAGEOFF]
	str	w8, [x19]
Lloh5:
	adrp	x8, _cpuid@GOTPAGE
Lloh6:
	ldr	x8, [x8, _cpuid@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_PCPU_GET
	mov	x1, x19
	bl	_CPU_CLR
	ldr	w8, [x19]
	str	w8, [sp, #12]
Lloh8:
	adrp	x0, _stopped_cpus@GOTPAGE
Lloh9:
	ldr	x0, [x0, _stopped_cpus@GOTPAGEOFF]
	add	x1, sp, #12
	bl	_CPU_CMP
	cbz	x0, LBB0_2
; %bb.1:
Lloh10:
	adrp	x1, _stopped_cpus@GOTPAGE
Lloh11:
	ldr	x1, [x1, _stopped_cpus@GOTPAGEOFF]
	add	x0, sp, #12
	bl	_CPU_NAND
	ldr	w0, [sp, #12]
	bl	_stop_cpus
LBB0_2:
	mov	w20, #34466
	movk	w20, #1, lsl #16
Lloh12:
	adrp	x19, _shutdown_cpus@GOTPAGE
Lloh13:
	ldr	x19, [x19, _shutdown_cpus@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_CPU_EMPTY
	cbnz	w0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	subs	w20, w20, #1
	b.ne	LBB0_3
; %bb.5:
Lloh14:
	adrp	x0, l_str@PAGE
Lloh15:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
LBB0_6:
	bl	_critical_exit
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_all_cpus,4,2                   ; @all_cpus
	.comm	_shutdown_cpus,4,2              ; @shutdown_cpus
	.comm	_cpuid,4,2                      ; @cpuid
	.comm	_stopped_cpus,4,2               ; @stopped_cpus
	.section	__TEXT,__cstring,cstring_literals
l_str:                                  ; @str
	.asciz	"timeout shutting down CPUs."

.subsections_via_symbols
