	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_alpine_mp_start_ap             ## -- Begin function alpine_mp_start_ap
	.p2align	4, 0x90
_alpine_mp_start_ap:                    ## @alpine_mp_start_ap
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	leaq	-88(%rbp), %rdi
	leaq	-72(%rbp), %rsi
	callq	_alpine_get_cpu_resume_base
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_panic
LBB0_2:
	leaq	-80(%rbp), %rdi
	leaq	-56(%rbp), %rsi
	callq	_alpine_get_nb_base
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	callq	_panic
LBB0_4:
	movq	_fdtbus_bs_tag@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	_al_devmap_pa@GOTPCREL(%rip), %rbx
	movq	-88(%rbp), %rsi
	addq	(%rbx), %rsi
	movq	-72(%rbp), %rdx
	leaq	-48(%rbp), %r8
	xorl	%ecx, %ecx
	callq	_bus_space_map
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.2(%rip), %rdi
	callq	_panic
LBB0_6:
	movl	(%r12), %edi
	movq	-80(%rbp), %rsi
	addq	(%rbx), %rsi
	movq	-56(%rbp), %rdx
	leaq	-44(%rbp), %r8
	xorl	%ecx, %ecx
	callq	_bus_space_map
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	leaq	L_.str.3(%rip), %rdi
	callq	_panic
LBB0_8:
	movl	(%r12), %edi
	movl	-48(%rbp), %esi
	movq	_AL_CPU_RESUME_WATERMARK_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_bus_space_read_4
	movq	_AL_CPU_RESUME_MAGIC_NUM_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	movq	_AL_CPU_RESUME_MAGIC_NUM@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_10
## %bb.9:
	movq	_AL_CPU_RESUME_MIN_VER_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_AL_CPU_RESUME_MIN_VER@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_11
LBB0_10:
	leaq	L_.str.4(%rip), %rdi
	callq	_panic
LBB0_11:
	movq	_mpentry@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_pmap_kextract
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_platform_mp_get_core_cnt
	cmpl	$2, %eax
	jl	LBB0_14
## %bb.12:
	movl	$1, %r13d
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %r15d
	movq	%r12, %r14
	movl	-44(%rbp), %r12d
	movl	%r13d, %edi
	callq	_AL_NB_CONFIG_STATUS_PWR_CTRL
	movl	%r15d, %edi
	movl	%r12d, %esi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	callq	_bus_space_write_4
	xorl	%eax, %eax
	callq	_mb
	movl	(%r14), %r15d
	movl	-48(%rbp), %r12d
	movl	%r13d, %edi
	callq	_AL_CPU_RESUME_PCPU_FLAGS
	movl	%r15d, %edi
	movl	%r12d, %esi
	movl	%eax, %edx
	callq	_bus_space_read_4
	movq	_AL_CPU_RESUME_FLG_PERCPU_DONT_RESUME@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	notl	%ebx
	andl	%eax, %ebx
	movl	(%r14), %r15d
	movl	-48(%rbp), %r12d
	movl	%r13d, %edi
	callq	_AL_CPU_RESUME_PCPU_FLAGS
	movl	%r15d, %edi
	movl	%r12d, %esi
	movq	%r14, %r12
	movl	%eax, %edx
	movl	%ebx, %ecx
	callq	_bus_space_write_4
	xorl	%eax, %eax
	callq	_mb
	movl	(%r14), %ebx
	movl	-48(%rbp), %r15d
	movl	%r13d, %edi
	callq	_AL_CPU_RESUME_PCPU_RADDR_REG
	movl	%ebx, %edi
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_bus_space_write_4
	xorl	%eax, %eax
	callq	_mb
	incl	%r13d
	xorl	%eax, %eax
	callq	_platform_mp_get_core_cnt
	cmpl	%eax, %r13d
	jl	LBB0_13
LBB0_14:
	movl	(%r12), %edi
	movq	-80(%rbp), %rsi
	movq	_al_devmap_pa@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	movq	-56(%rbp), %rdx
	leaq	-44(%rbp), %r8
	xorl	%ecx, %ecx
	callq	_bus_space_map
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	leaq	L_.str.3(%rip), %rdi
	callq	_panic
LBB0_16:
	xorl	%eax, %eax
	callq	_platform_mp_get_core_cnt
	movl	$-1, %ebx
	movl	%eax, %ecx
	shll	%cl, %ebx
	notl	%ebx
	movl	(%r12), %edi
	movl	-44(%rbp), %esi
	movq	_AL_NB_INIT_CONTROL@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	callq	_bus_space_read_4
	orl	%eax, %ebx
	movl	(%r12), %edi
	movl	-44(%rbp), %esi
	movl	(%r14), %edx
	movl	%ebx, %ecx
	callq	_bus_space_write_4
	xorl	%eax, %eax
	callq	_dsb
	movl	(%r12), %edi
	movl	-44(%rbp), %esi
	movq	-56(%rbp), %rdx
	callq	_bus_space_unmap
	movl	(%r12), %edi
	movl	-48(%rbp), %esi
	movq	-72(%rbp), %rdx
	callq	_bus_space_unmap
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't resolve cpu_resume_base address\n"

L_.str.1:                               ## @.str.1
	.asciz	"Couldn't resolve_nb_base address\n"

	.comm	_fdtbus_bs_tag,4,2              ## @fdtbus_bs_tag
	.comm	_al_devmap_pa,8,3               ## @al_devmap_pa
L_.str.2:                               ## @.str.2
	.asciz	"Couldn't map CPU-resume area"

L_.str.3:                               ## @.str.3
	.asciz	"Couldn't map NB-service area"

	.comm	_AL_CPU_RESUME_WATERMARK_REG,4,2 ## @AL_CPU_RESUME_WATERMARK_REG
	.comm	_AL_CPU_RESUME_MAGIC_NUM_MASK,4,2 ## @AL_CPU_RESUME_MAGIC_NUM_MASK
	.comm	_AL_CPU_RESUME_MAGIC_NUM,4,2    ## @AL_CPU_RESUME_MAGIC_NUM
	.comm	_AL_CPU_RESUME_MIN_VER_MASK,4,2 ## @AL_CPU_RESUME_MIN_VER_MASK
	.comm	_AL_CPU_RESUME_MIN_VER,4,2      ## @AL_CPU_RESUME_MIN_VER
L_.str.4:                               ## @.str.4
	.asciz	"CPU-resume device is not compatible"

	.comm	_mpentry,8,3                    ## @mpentry
	.comm	_AL_CPU_RESUME_FLG_PERCPU_DONT_RESUME,4,2 ## @AL_CPU_RESUME_FLG_PERCPU_DONT_RESUME
	.comm	_AL_NB_INIT_CONTROL,4,2         ## @AL_NB_INIT_CONTROL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_alpine_mp_start_ap             ; -- Begin function alpine_mp_start_ap
	.p2align	2
_alpine_mp_start_ap:                    ; @alpine_mp_start_ap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	add	x0, sp, #40
	add	x1, sp, #24
	bl	_alpine_get_cpu_resume_base
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_panic
LBB0_2:
	add	x0, sp, #32
	add	x1, sp, #16
	bl	_alpine_get_nb_base
	cbz	x0, LBB0_4
; %bb.3:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_panic
LBB0_4:
Lloh4:
	adrp	x24, _fdtbus_bs_tag@GOTPAGE
Lloh5:
	ldr	x24, [x24, _fdtbus_bs_tag@GOTPAGEOFF]
	ldr	w0, [x24]
Lloh6:
	adrp	x25, _al_devmap_pa@GOTPAGE
Lloh7:
	ldr	x25, [x25, _al_devmap_pa@GOTPAGEOFF]
	ldr	x8, [x25]
	ldr	x9, [sp, #40]
	add	x1, x9, x8
	ldr	x2, [sp, #24]
	add	x4, sp, #12
	mov	w3, #0
	bl	_bus_space_map
	cbz	x0, LBB0_6
; %bb.5:
Lloh8:
	adrp	x0, l_.str.2@PAGE
Lloh9:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_panic
LBB0_6:
	ldr	w0, [x24]
	ldr	x8, [x25]
	ldr	x9, [sp, #32]
	add	x1, x9, x8
	ldr	x2, [sp, #16]
	add	x4, sp, #8
	mov	w3, #0
	bl	_bus_space_map
	cbz	x0, LBB0_8
; %bb.7:
Lloh10:
	adrp	x0, l_.str.3@PAGE
Lloh11:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_panic
LBB0_8:
	ldr	w0, [x24]
	ldr	w1, [sp, #12]
Lloh12:
	adrp	x8, _AL_CPU_RESUME_WATERMARK_REG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AL_CPU_RESUME_WATERMARK_REG@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	bl	_bus_space_read_4
Lloh15:
	adrp	x8, _AL_CPU_RESUME_MAGIC_NUM_MASK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AL_CPU_RESUME_MAGIC_NUM_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh18:
	adrp	x9, _AL_CPU_RESUME_MAGIC_NUM@GOTPAGE
Lloh19:
	ldr	x9, [x9, _AL_CPU_RESUME_MAGIC_NUM@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_10
; %bb.9:
Lloh21:
	adrp	x8, _AL_CPU_RESUME_MIN_VER_MASK@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AL_CPU_RESUME_MIN_VER_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh24:
	adrp	x9, _AL_CPU_RESUME_MIN_VER@GOTPAGE
Lloh25:
	ldr	x9, [x9, _AL_CPU_RESUME_MIN_VER@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ge	LBB0_11
LBB0_10:
Lloh27:
	adrp	x0, l_.str.4@PAGE
Lloh28:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_panic
LBB0_11:
Lloh29:
	adrp	x8, _mpentry@GOTPAGE
Lloh30:
	ldr	x8, [x8, _mpentry@GOTPAGEOFF]
Lloh31:
	ldr	x0, [x8]
	bl	_pmap_kextract
	mov	x19, x0
	bl	_platform_mp_get_core_cnt
	cmp	w0, #2
	b.lt	LBB0_14
; %bb.12:
	mov	w20, #1
Lloh32:
	adrp	x26, _AL_CPU_RESUME_FLG_PERCPU_DONT_RESUME@GOTPAGE
Lloh33:
	ldr	x26, [x26, _AL_CPU_RESUME_FLG_PERCPU_DONT_RESUME@GOTPAGEOFF]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	w21, [x24]
	ldr	w22, [sp, #8]
	mov	x0, x20
	bl	_AL_NB_CONFIG_STATUS_PWR_CTRL
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	mov	w3, #0
	bl	_bus_space_write_4
	bl	_mb
	ldr	w21, [x24]
	ldr	w22, [sp, #12]
	mov	x0, x20
	bl	_AL_CPU_RESUME_PCPU_FLAGS
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_bus_space_read_4
	ldr	w8, [x26]
	bic	w21, w0, w8
	ldr	w22, [x24]
	ldr	w23, [sp, #12]
	mov	x0, x20
	bl	_AL_CPU_RESUME_PCPU_FLAGS
	mov	x2, x0
	mov	x0, x22
	mov	x1, x23
	mov	x3, x21
	bl	_bus_space_write_4
	bl	_mb
	ldr	w21, [x24]
	ldr	w22, [sp, #12]
	mov	x0, x20
	bl	_AL_CPU_RESUME_PCPU_RADDR_REG
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	mov	x3, x19
	bl	_bus_space_write_4
	bl	_mb
	add	w20, w20, #1
	bl	_platform_mp_get_core_cnt
	cmp	w20, w0
	b.lt	LBB0_13
LBB0_14:
	ldr	w0, [x24]
	ldr	x8, [x25]
	ldr	x9, [sp, #32]
	add	x1, x9, x8
	ldr	x2, [sp, #16]
	add	x4, sp, #8
	mov	w3, #0
	bl	_bus_space_map
	cbz	x0, LBB0_16
; %bb.15:
Lloh34:
	adrp	x0, l_.str.3@PAGE
Lloh35:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_panic
LBB0_16:
	bl	_platform_mp_get_core_cnt
	mov	w8, #-1
	lsl	w19, w8, w0
	ldr	w0, [x24]
	ldr	w1, [sp, #8]
Lloh36:
	adrp	x20, _AL_NB_INIT_CONTROL@GOTPAGE
Lloh37:
	ldr	x20, [x20, _AL_NB_INIT_CONTROL@GOTPAGEOFF]
	ldr	w2, [x20]
	bl	_bus_space_read_4
	orn	w3, w0, w19
	ldr	w0, [x24]
	ldr	w1, [sp, #8]
	ldr	w2, [x20]
	bl	_bus_space_write_4
	bl	_dsb
	ldr	w0, [x24]
	ldr	w1, [sp, #8]
	ldr	x2, [sp, #16]
	bl	_bus_space_unmap
	ldr	w0, [x24]
	ldr	w1, [sp, #12]
	ldr	x2, [sp, #24]
	bl	_bus_space_unmap
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't resolve cpu_resume_base address\n"

l_.str.1:                               ; @.str.1
	.asciz	"Couldn't resolve_nb_base address\n"

	.comm	_fdtbus_bs_tag,4,2              ; @fdtbus_bs_tag
	.comm	_al_devmap_pa,8,3               ; @al_devmap_pa
l_.str.2:                               ; @.str.2
	.asciz	"Couldn't map CPU-resume area"

l_.str.3:                               ; @.str.3
	.asciz	"Couldn't map NB-service area"

	.comm	_AL_CPU_RESUME_WATERMARK_REG,4,2 ; @AL_CPU_RESUME_WATERMARK_REG
	.comm	_AL_CPU_RESUME_MAGIC_NUM_MASK,4,2 ; @AL_CPU_RESUME_MAGIC_NUM_MASK
	.comm	_AL_CPU_RESUME_MAGIC_NUM,4,2    ; @AL_CPU_RESUME_MAGIC_NUM
	.comm	_AL_CPU_RESUME_MIN_VER_MASK,4,2 ; @AL_CPU_RESUME_MIN_VER_MASK
	.comm	_AL_CPU_RESUME_MIN_VER,4,2      ; @AL_CPU_RESUME_MIN_VER
l_.str.4:                               ; @.str.4
	.asciz	"CPU-resume device is not compatible"

	.comm	_mpentry,8,3                    ; @mpentry
	.comm	_AL_CPU_RESUME_FLG_PERCPU_DONT_RESUME,4,2 ; @AL_CPU_RESUME_FLG_PERCPU_DONT_RESUME
	.comm	_AL_NB_INIT_CONTROL,4,2         ; @AL_NB_INIT_CONTROL
.subsections_via_symbols
