	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tegra124_mp_start_ap           ## -- Begin function tegra124_mp_start_ap
	.p2align	4, 0x90
_tegra124_mp_start_ap:                  ## @tegra124_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_fdtbus_bs_tag@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	_PMC_PHYSBASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PMC_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-44(%rbp), %r8
	xorl	%ecx, %ecx
	callq	_bus_space_map
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_panic
LBB0_2:
	movl	(%r12), %edi
	movq	_TEGRA_EXCEPTION_VECTORS_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TEGRA_EXCEPTION_VECTORS_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %r8
	xorl	%ecx, %ecx
	callq	_bus_space_map
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	callq	_panic
LBB0_4:
	movl	(%r12), %r15d
	movl	-48(%rbp), %r14d
	movq	_TEGRA_EXCEPTION_VECTOR_ENTRY@GOTPCREL(%rip), %r13
	movl	(%r13), %ebx
	movq	_mpentry@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_pmap_kextract
	movl	%r15d, %edi
	movl	%r14d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_bus_space_write_4
	movl	(%r12), %edi
	movl	-48(%rbp), %esi
	movl	(%r13), %edx
	callq	_bus_space_read_4
	movq	_PMC_PWRGATE_TOGGLE@GOTPCREL(%rip), %r14
	movq	_PCM_PWRGATE_TOGGLE_START@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edi
	movl	-44(%rbp), %esi
	movl	(%r14), %edx
	callq	_bus_space_read_4
	testl	%eax, (%rbx)
	jne	LBB0_5
## %bb.6:
	movq	_mp_ncpus@GOTPCREL(%rip), %rax
	cmpl	$2, (%rax)
	jl	LBB0_14
## %bb.7:
	movl	$1, %ebx
	movq	_PMC_PWRGATE_STATUS@GOTPCREL(%rip), %r13
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_8 Depth=1
	incl	%ebx
	movq	_mp_ncpus@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jge	LBB0_14
LBB0_8:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
                                        ##     Child Loop BB0_12 Depth 2
	movl	(%r12), %edi
	movl	-44(%rbp), %esi
	movl	(%r13), %edx
	callq	_bus_space_read_4
	movl	$256, %r15d                     ## imm = 0x100
	movl	%ebx, %ecx
	shll	%cl, %r15d
	testl	%r15d, %eax
	jne	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	leal	8(%rbx), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%r12, %r13
	movq	%r14, %r12
	movq	_PCM_PWRGATE_TOGGLE_START@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r13), %edi
	movl	-44(%rbp), %esi
	movl	(%r12), %edx
	callq	_bus_space_read_4
	movl	(%r14), %ecx
	testl	%eax, %ecx
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	(%r13), %edi
	movl	-44(%rbp), %esi
	movl	(%r12), %edx
	orl	-52(%rbp), %ecx                 ## 4-byte Folded Reload
	callq	_bus_space_write_4
	movq	%r12, %r14
	movq	%r13, %r12
	movq	_PMC_PWRGATE_STATUS@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_12:                                ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r12), %edi
	movl	-44(%rbp), %esi
	movl	(%r13), %edx
	callq	_bus_space_read_4
	testl	%r15d, %eax
	je	LBB0_12
	jmp	LBB0_13
LBB0_14:
	xorl	%eax, %eax
	callq	_dsb
	xorl	%eax, %eax
	callq	_sev
	movl	(%r12), %edi
	movl	-44(%rbp), %esi
	movq	_PMC_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_bus_space_unmap
	movl	(%r12), %edi
	movl	-48(%rbp), %esi
	movq	_TEGRA_EXCEPTION_VECTORS_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_bus_space_unmap
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_fdtbus_bs_tag,4,2              ## @fdtbus_bs_tag
	.comm	_PMC_PHYSBASE,4,2               ## @PMC_PHYSBASE
	.comm	_PMC_SIZE,4,2                   ## @PMC_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't map the PMC\n"

	.comm	_TEGRA_EXCEPTION_VECTORS_BASE,4,2 ## @TEGRA_EXCEPTION_VECTORS_BASE
	.comm	_TEGRA_EXCEPTION_VECTORS_SIZE,4,2 ## @TEGRA_EXCEPTION_VECTORS_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"Couldn't map the exception vectors\n"

	.comm	_TEGRA_EXCEPTION_VECTOR_ENTRY,4,2 ## @TEGRA_EXCEPTION_VECTOR_ENTRY
	.comm	_mpentry,8,3                    ## @mpentry
	.comm	_PMC_PWRGATE_TOGGLE,4,2         ## @PMC_PWRGATE_TOGGLE
	.comm	_PCM_PWRGATE_TOGGLE_START,4,2   ## @PCM_PWRGATE_TOGGLE_START
	.comm	_mp_ncpus,4,2                   ## @mp_ncpus
	.comm	_PMC_PWRGATE_STATUS,4,2         ## @PMC_PWRGATE_STATUS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tegra124_mp_start_ap           ; -- Begin function tegra124_mp_start_ap
	.p2align	2
_tegra124_mp_start_ap:                  ; @tegra124_mp_start_ap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x22, _fdtbus_bs_tag@GOTPAGE
Lloh1:
	ldr	x22, [x22, _fdtbus_bs_tag@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh2:
	adrp	x8, _PMC_PHYSBASE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PMC_PHYSBASE@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x8, _PMC_SIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PMC_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	add	x4, sp, #12
	mov	w3, #0
	bl	_bus_space_map
	cbz	x0, LBB0_2
; %bb.1:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_panic
LBB0_2:
	ldr	w0, [x22]
Lloh10:
	adrp	x8, _TEGRA_EXCEPTION_VECTORS_BASE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _TEGRA_EXCEPTION_VECTORS_BASE@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x24, _TEGRA_EXCEPTION_VECTORS_SIZE@GOTPAGE
Lloh14:
	ldr	x24, [x24, _TEGRA_EXCEPTION_VECTORS_SIZE@GOTPAGEOFF]
	ldr	w2, [x24]
	add	x4, sp, #8
	mov	w3, #0
	bl	_bus_space_map
	cbz	x0, LBB0_4
; %bb.3:
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_panic
LBB0_4:
	ldr	w19, [x22]
	ldr	w20, [sp, #8]
Lloh17:
	adrp	x23, _TEGRA_EXCEPTION_VECTOR_ENTRY@GOTPAGE
Lloh18:
	ldr	x23, [x23, _TEGRA_EXCEPTION_VECTOR_ENTRY@GOTPAGEOFF]
	ldr	w21, [x23]
Lloh19:
	adrp	x8, _mpentry@GOTPAGE
Lloh20:
	ldr	x8, [x8, _mpentry@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	bl	_pmap_kextract
	mov	x3, x0
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_bus_space_write_4
	ldr	w0, [x22]
	ldr	w1, [sp, #8]
	ldr	w2, [x23]
	bl	_bus_space_read_4
Lloh22:
	adrp	x19, _PMC_PWRGATE_TOGGLE@GOTPAGE
Lloh23:
	ldr	x19, [x19, _PMC_PWRGATE_TOGGLE@GOTPAGEOFF]
Lloh24:
	adrp	x20, _PCM_PWRGATE_TOGGLE_START@GOTPAGE
Lloh25:
	ldr	x20, [x20, _PCM_PWRGATE_TOGGLE_START@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x22]
	ldr	w1, [sp, #12]
	ldr	w2, [x19]
	bl	_bus_space_read_4
	ldr	w8, [x20]
	tst	w8, w0
	b.ne	LBB0_5
; %bb.6:
Lloh26:
	adrp	x21, _mp_ncpus@GOTPAGE
Lloh27:
	ldr	x21, [x21, _mp_ncpus@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, #2
	b.lt	LBB0_14
; %bb.7:
	mov	w25, #1
Lloh28:
	adrp	x26, _PMC_PWRGATE_STATUS@GOTPAGE
Lloh29:
	ldr	x26, [x26, _PMC_PWRGATE_STATUS@GOTPAGEOFF]
	mov	w27, #256
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	w25, w25, #1
	ldr	w8, [x21]
	cmp	w25, w8
	b.ge	LBB0_14
LBB0_9:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
                                        ;     Child Loop BB0_13 Depth 2
	ldr	w0, [x22]
	ldr	w1, [sp, #12]
	ldr	w2, [x26]
	bl	_bus_space_read_4
	lsl	w28, w27, w25
	tst	w0, w28
	b.ne	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	add	w23, w25, #8
LBB0_11:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w0, [x22]
	ldr	w1, [sp, #12]
	ldr	w2, [x19]
	bl	_bus_space_read_4
	ldr	w8, [x20]
	tst	w8, w0
	b.ne	LBB0_11
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w0, [x22]
	ldr	w1, [sp, #12]
	orr	w3, w8, w23
	ldr	w2, [x19]
	bl	_bus_space_write_4
LBB0_13:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w0, [x22]
	ldr	w1, [sp, #12]
	ldr	w2, [x26]
	bl	_bus_space_read_4
	tst	w0, w28
	b.eq	LBB0_13
	b	LBB0_8
LBB0_14:
	bl	_dsb
	bl	_sev
	ldr	w0, [x22]
	ldr	w1, [sp, #12]
Lloh30:
	adrp	x8, _PMC_SIZE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _PMC_SIZE@GOTPAGEOFF]
Lloh32:
	ldr	w2, [x8]
	bl	_bus_space_unmap
	ldr	w0, [x22]
	ldr	w1, [sp, #8]
	ldr	w2, [x24]
	bl	_bus_space_unmap
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_fdtbus_bs_tag,4,2              ; @fdtbus_bs_tag
	.comm	_PMC_PHYSBASE,4,2               ; @PMC_PHYSBASE
	.comm	_PMC_SIZE,4,2                   ; @PMC_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't map the PMC\n"

	.comm	_TEGRA_EXCEPTION_VECTORS_BASE,4,2 ; @TEGRA_EXCEPTION_VECTORS_BASE
	.comm	_TEGRA_EXCEPTION_VECTORS_SIZE,4,2 ; @TEGRA_EXCEPTION_VECTORS_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"Couldn't map the exception vectors\n"

	.comm	_TEGRA_EXCEPTION_VECTOR_ENTRY,4,2 ; @TEGRA_EXCEPTION_VECTOR_ENTRY
	.comm	_mpentry,8,3                    ; @mpentry
	.comm	_PMC_PWRGATE_TOGGLE,4,2         ; @PMC_PWRGATE_TOGGLE
	.comm	_PCM_PWRGATE_TOGGLE_START,4,2   ; @PCM_PWRGATE_TOGGLE_START
	.comm	_mp_ncpus,4,2                   ; @mp_ncpus
	.comm	_PMC_PWRGATE_STATUS,4,2         ; @PMC_PWRGATE_STATUS
.subsections_via_symbols
