	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_platform_mp_setmaxid           ## -- Begin function platform_mp_setmaxid
	.p2align	4, 0x90
_platform_mp_setmaxid:                  ## @platform_mp_setmaxid
	.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
	movq	_mp_ncpus@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jne	LBB0_18
## %bb.1:
	movq	_scu_compatible@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	callq	_find_node_for_device
	movl	$1, %ebx
	testl	%eax, %eax
	je	LBB0_17
## %bb.2:
	movl	%eax, %r14d
	movq	_cpucfg_compatible@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_find_node_for_device
	testl	%eax, %eax
	je	LBB0_17
## %bb.3:
	movl	%eax, %r15d
	movq	_aml8726_smp@GOTPCREL(%rip), %r13
	leaq	52(%r13), %rsi
	leaq	48(%r13), %rdx
	movl	%r14d, %edi
	callq	_alloc_resource_for_node
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str.2(%rip), %rdi
	callq	_panic
LBB0_5:
	leaq	44(%r13), %rsi
	leaq	40(%r13), %rdx
	movl	%r15d, %edi
	callq	_alloc_resource_for_node
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	leaq	L_.str.3(%rip), %rdi
	callq	_panic
LBB0_7:
	movq	_fdtbus_bs_tag@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	movq	%rdi, 32(%r13)
	leaq	24(%r13), %r8
	movq	_AML_SOC_AOBUS_BASE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1048576, %edx                  ## imm = 0x100000
	xorl	%ecx, %ecx
	callq	_bus_space_map
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	leaq	L_.str.4(%rip), %rdi
	callq	_panic
LBB0_9:
	movq	(%rbx), %rdi
	movq	%rdi, 16(%r13)
	leaq	8(%r13), %r8
	movq	_AML_SOC_CBUS_BASE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1048576, %edx                  ## imm = 0x100000
	xorl	%ecx, %ecx
	callq	_bus_space_map
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	leaq	L_.str.5(%rip), %rdi
	callq	_panic
LBB0_11:
	movl	$0, (%r13)
	movq	_scu_errata_764369@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_16
## %bb.12:
	movl	$8, %ebx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movl	%r14d, %edi
	callq	_fdt_is_compatible_strict
	testq	%rax, %rax
	jne	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	(%r15), %rax
	movq	(%rax,%rbx), %rsi
	addq	$8, %rbx
	testq	%rsi, %rsi
	jne	LBB0_14
	jmp	LBB0_16
LBB0_15:
	movl	$1, (%r13)
LBB0_16:
	movq	_AML_SCU_CONFIG_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SCU_READ_4
	movl	%eax, %ebx
	movq	_AML_SCU_CONFIG_NCPU_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	incl	%ebx
LBB0_17:
	movl	%ebx, (%r12)
	decl	%ebx
	movq	_mp_maxid@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mp_ncpus,4,2                   ## @mp_ncpus
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"scu"

	.comm	_scu_compatible,4,2             ## @scu_compatible
L_.str.1:                               ## @.str.1
	.asciz	"cpuconfig"

	.comm	_cpucfg_compatible,4,2          ## @cpucfg_compatible
	.comm	_aml8726_smp,56,3               ## @aml8726_smp
L_.str.2:                               ## @.str.2
	.asciz	"Could not allocate resource for SCU"

L_.str.3:                               ## @.str.3
	.asciz	"Could not allocate resource for CPUCONFIG"

	.comm	_fdtbus_bs_tag,8,3              ## @fdtbus_bs_tag
	.comm	_AML_SOC_AOBUS_BASE_ADDR,4,2    ## @AML_SOC_AOBUS_BASE_ADDR
L_.str.4:                               ## @.str.4
	.asciz	"Could not allocate resource for AOBUS"

	.comm	_AML_SOC_CBUS_BASE_ADDR,4,2     ## @AML_SOC_CBUS_BASE_ADDR
L_.str.5:                               ## @.str.5
	.asciz	"Could not allocate resource for CBUS"

	.comm	_scu_errata_764369,8,3          ## @scu_errata_764369
	.comm	_AML_SCU_CONFIG_REG,4,2         ## @AML_SCU_CONFIG_REG
	.comm	_AML_SCU_CONFIG_NCPU_MASK,4,2   ## @AML_SCU_CONFIG_NCPU_MASK
	.comm	_mp_maxid,4,2                   ## @mp_maxid
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_platform_mp_setmaxid           ; -- Begin function platform_mp_setmaxid
	.p2align	2
_platform_mp_setmaxid:                  ; @platform_mp_setmaxid
	.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
Lloh0:
	adrp	x21, _mp_ncpus@GOTPAGE
Lloh1:
	ldr	x21, [x21, _mp_ncpus@GOTPAGEOFF]
	ldr	w8, [x21]
	cbnz	w8, LBB0_19
; %bb.1:
Lloh2:
	adrp	x8, _scu_compatible@GOTPAGE
Lloh3:
	ldr	x8, [x8, _scu_compatible@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_find_node_for_device
	cbz	w0, LBB0_15
; %bb.2:
	mov	x19, x0
Lloh7:
	adrp	x8, _cpucfg_compatible@GOTPAGE
Lloh8:
	ldr	x8, [x8, _cpucfg_compatible@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_find_node_for_device
	cbz	w0, LBB0_15
; %bb.3:
	mov	x20, x0
Lloh12:
	adrp	x22, _aml8726_smp@GOTPAGE
Lloh13:
	ldr	x22, [x22, _aml8726_smp@GOTPAGEOFF]
	add	x1, x22, #52
	add	x2, x22, #48
	mov	x0, x19
	bl	_alloc_resource_for_node
	cbz	x0, LBB0_5
; %bb.4:
Lloh14:
	adrp	x0, l_.str.2@PAGE
Lloh15:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_panic
LBB0_5:
	add	x1, x22, #44
	add	x2, x22, #40
	mov	x0, x20
	bl	_alloc_resource_for_node
	cbz	x0, LBB0_7
; %bb.6:
Lloh16:
	adrp	x0, l_.str.3@PAGE
Lloh17:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_panic
LBB0_7:
Lloh18:
	adrp	x20, _fdtbus_bs_tag@GOTPAGE
Lloh19:
	ldr	x20, [x20, _fdtbus_bs_tag@GOTPAGEOFF]
	ldr	x0, [x20]
	str	x0, [x22, #32]
	add	x4, x22, #24
Lloh20:
	adrp	x8, _AML_SOC_AOBUS_BASE_ADDR@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AML_SOC_AOBUS_BASE_ADDR@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	w2, #1048576
	mov	w3, #0
	bl	_bus_space_map
	cbz	w0, LBB0_9
; %bb.8:
Lloh23:
	adrp	x0, l_.str.4@PAGE
Lloh24:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_panic
LBB0_9:
	ldr	x0, [x20]
	str	x0, [x22, #16]
	add	x4, x22, #8
Lloh25:
	adrp	x8, _AML_SOC_CBUS_BASE_ADDR@GOTPAGE
Lloh26:
	ldr	x8, [x8, _AML_SOC_CBUS_BASE_ADDR@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	w2, #1048576
	mov	w3, #0
	bl	_bus_space_map
	cbz	w0, LBB0_11
; %bb.10:
Lloh28:
	adrp	x0, l_.str.5@PAGE
Lloh29:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_panic
LBB0_11:
	str	wzr, [x22]
Lloh30:
	adrp	x20, _scu_errata_764369@GOTPAGE
Lloh31:
	ldr	x20, [x20, _scu_errata_764369@GOTPAGEOFF]
	ldr	x8, [x20]
	ldr	x1, [x8]
	cbz	x1, LBB0_17
; %bb.12:
	mov	w23, #8
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_fdt_is_compatible_strict
	cbnz	x0, LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	x8, [x20]
	ldr	x1, [x8, x23]
	add	x23, x23, #8
	cbnz	x1, LBB0_13
	b	LBB0_17
LBB0_15:
	mov	w8, #1
	b	LBB0_18
LBB0_16:
	mov	w8, #1
	str	w8, [x22]
LBB0_17:
Lloh32:
	adrp	x8, _AML_SCU_CONFIG_REG@GOTPAGE
Lloh33:
	ldr	x8, [x8, _AML_SCU_CONFIG_REG@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
	bl	_SCU_READ_4
Lloh35:
	adrp	x8, _AML_SCU_CONFIG_NCPU_MASK@GOTPAGE
Lloh36:
	ldr	x8, [x8, _AML_SCU_CONFIG_NCPU_MASK@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	and	w8, w8, w0
	add	w8, w8, #1
LBB0_18:
	str	w8, [x21]
	sub	w8, w8, #1
Lloh38:
	adrp	x9, _mp_maxid@GOTPAGE
Lloh39:
	ldr	x9, [x9, _mp_maxid@GOTPAGEOFF]
Lloh40:
	str	w8, [x9]
LBB0_19:
	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
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotStr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_mp_ncpus,4,2                   ; @mp_ncpus
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"scu"

	.comm	_scu_compatible,4,2             ; @scu_compatible
l_.str.1:                               ; @.str.1
	.asciz	"cpuconfig"

	.comm	_cpucfg_compatible,4,2          ; @cpucfg_compatible
	.comm	_aml8726_smp,56,3               ; @aml8726_smp
l_.str.2:                               ; @.str.2
	.asciz	"Could not allocate resource for SCU"

l_.str.3:                               ; @.str.3
	.asciz	"Could not allocate resource for CPUCONFIG"

	.comm	_fdtbus_bs_tag,8,3              ; @fdtbus_bs_tag
	.comm	_AML_SOC_AOBUS_BASE_ADDR,4,2    ; @AML_SOC_AOBUS_BASE_ADDR
l_.str.4:                               ; @.str.4
	.asciz	"Could not allocate resource for AOBUS"

	.comm	_AML_SOC_CBUS_BASE_ADDR,4,2     ; @AML_SOC_CBUS_BASE_ADDR
l_.str.5:                               ; @.str.5
	.asciz	"Could not allocate resource for CBUS"

	.comm	_scu_errata_764369,8,3          ; @scu_errata_764369
	.comm	_AML_SCU_CONFIG_REG,4,2         ; @AML_SCU_CONFIG_REG
	.comm	_AML_SCU_CONFIG_NCPU_MASK,4,2   ; @AML_SCU_CONFIG_NCPU_MASK
	.comm	_mp_maxid,4,2                   ; @mp_maxid
.subsections_via_symbols
