	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function platform_cnt_cpus
_platform_cnt_cpus:                     ## @platform_cnt_cpus
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	L_.str(%rip), %rdi
	callq	_OF_finddevice
	movl	$1, %ecx
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.2:
	movl	%eax, %edi
	callq	_OF_child
	movl	$0, %r12d
	testl	%eax, %eax
	je	LBB0_7
## %bb.3:
	movl	%eax, %ebx
	xorl	%r12d, %r12d
	leaq	-64(%rbp), %r13
	leaq	L_.str.1(%rip), %r15
	leaq	L_.str.2(%rip), %r14
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	%ebx, %edi
	callq	_OF_peer
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movl	%ebx, %edi
	movq	%r15, %rsi
	movq	%r13, %rdx
	movl	$15, %ecx
	callq	_OF_getprop
	testl	%eax, %eax
	js	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_strcmp
	cmpq	$1, %rax
	adcl	$0, %r12d
	jmp	LBB0_6
LBB0_7:
	movq	_fdtbus_bs_tag@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movq	_MV_SCU_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MV_SCU_REGS_LEN@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	leaq	-68(%rbp), %r8
	xorl	%ecx, %ecx
	callq	_bus_space_map
	testl	%eax, %eax
	movl	$1, %ecx
	movl	$0, %eax
	jne	LBB0_9
## %bb.8:
	movl	(%r14), %edi
	movl	-68(%rbp), %esi
	movq	_MV_SCU_REG_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_bus_space_read_4
	movl	%eax, %ebx
	movl	(%r14), %edi
	movl	-68(%rbp), %esi
	movl	(%r15), %edx
	callq	_bus_space_unmap
	movq	_SCU_CFG_REG_NCPU_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	incl	%ebx
	movl	%ebx, %edi
	movl	%r12d, %esi
	callq	_min
	movq	_mp_ncpus@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	$1, %edi
	movl	%eax, %esi
	callq	_max
	movl	%eax, %ecx
	jmp	LBB0_9
LBB0_1:
	xorl	%eax, %eax
LBB0_9:
	movq	_mp_ncpus@GOTPCREL(%rip), %rdx
	movl	%ecx, (%rdx)
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_11
## %bb.10:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/cpus"

	.comm	_mp_ncpus,4,2                   ## @mp_ncpus
L_.str.1:                               ## @.str.1
	.asciz	"device_type"

L_.str.2:                               ## @.str.2
	.asciz	"cpu"

	.comm	_fdtbus_bs_tag,4,2              ## @fdtbus_bs_tag
	.comm	_MV_SCU_BASE,8,3                ## @MV_SCU_BASE
	.comm	_MV_SCU_REGS_LEN,4,2            ## @MV_SCU_REGS_LEN
	.comm	_MV_SCU_REG_CONFIG,4,2          ## @MV_SCU_REG_CONFIG
	.comm	_SCU_CFG_REG_NCPU_MASK,4,2      ## @SCU_CFG_REG_NCPU_MASK
	.no_dead_strip	_platform_cnt_cpus
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function platform_cnt_cpus
_platform_cnt_cpus:                     ; @platform_cnt_cpus
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_OF_finddevice
Lloh5:
	adrp	x23, _mp_ncpus@GOTPAGE
Lloh6:
	ldr	x23, [x23, _mp_ncpus@GOTPAGEOFF]
	cmn	w0, #1
	b.eq	LBB0_8
; %bb.1:
	bl	_OF_child
	cbz	w0, LBB0_6
; %bb.2:
	mov	x20, x0
	mov	w19, #0
Lloh7:
	adrp	x21, l_.str.1@PAGE
Lloh8:
	add	x21, x21, l_.str.1@PAGEOFF
Lloh9:
	adrp	x22, l_.str.2@PAGE
Lloh10:
	add	x22, x22, l_.str.2@PAGEOFF
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	bl	_OF_peer
	mov	x20, x0
	cbz	w0, LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x21
	mov	w3, #15
	bl	_OF_getprop
	tbnz	w0, #31, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x0, sp, #8
	mov	x1, x22
	bl	_strcmp
	cmp	x0, #0
	cinc	w19, w19, eq
	b	LBB0_3
LBB0_6:
	mov	w19, #0
LBB0_7:
Lloh11:
	adrp	x21, _fdtbus_bs_tag@GOTPAGE
Lloh12:
	ldr	x21, [x21, _fdtbus_bs_tag@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh13:
	adrp	x8, _MV_SCU_BASE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MV_SCU_BASE@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x22, _MV_SCU_REGS_LEN@GOTPAGE
Lloh17:
	ldr	x22, [x22, _MV_SCU_REGS_LEN@GOTPAGEOFF]
	ldr	w2, [x22]
	add	x4, sp, #4
	mov	w3, #0
	bl	_bus_space_map
	cbz	w0, LBB0_9
LBB0_8:
	mov	w0, #0
	mov	w8, #1
	b	LBB0_10
LBB0_9:
	ldr	w0, [x21]
	ldr	w1, [sp, #4]
Lloh18:
	adrp	x8, _MV_SCU_REG_CONFIG@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MV_SCU_REG_CONFIG@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	bl	_bus_space_read_4
	mov	x20, x0
	ldr	w0, [x21]
	ldr	w1, [sp, #4]
	ldr	w2, [x22]
	bl	_bus_space_unmap
Lloh21:
	adrp	x8, _SCU_CFG_REG_NCPU_MASK@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SCU_CFG_REG_NCPU_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	and	w8, w8, w20
	add	w0, w8, #1
	mov	x1, x19
	bl	_min
	mov	x1, x0
	str	w0, [x23]
	mov	w0, #1
	bl	_max
	mov	x8, x0
LBB0_10:
	str	w8, [x23]
	ldr	x8, [sp, #24]
Lloh24:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh25:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/cpus"

	.comm	_mp_ncpus,4,2                   ; @mp_ncpus
l_.str.1:                               ; @.str.1
	.asciz	"device_type"

l_.str.2:                               ; @.str.2
	.asciz	"cpu"

	.comm	_fdtbus_bs_tag,4,2              ; @fdtbus_bs_tag
	.comm	_MV_SCU_BASE,8,3                ; @MV_SCU_BASE
	.comm	_MV_SCU_REGS_LEN,4,2            ; @MV_SCU_REGS_LEN
	.comm	_MV_SCU_REG_CONFIG,4,2          ; @MV_SCU_REG_CONFIG
	.comm	_SCU_CFG_REG_NCPU_MASK,4,2      ; @SCU_CFG_REG_NCPU_MASK
	.no_dead_strip	_platform_cnt_cpus
.subsections_via_symbols
