	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ai_buscore_setup
_ai_buscore_setup:                      ## @ai_buscore_setup
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	8(%rsi), %rax
	cmpq	$0, (%rax)
	je	LBB0_1
## %bb.2:
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	(%rsi), %eax
	movl	%eax, 16(%rdi)
	movq	_chipstatus@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_CHIPCREGOFFS
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_bcma_read32
	movq	%rax, 24(%r14)
	movq	_capabilities@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_CHIPCREGOFFS
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_bcma_read32
	movq	%rax, 8(%r14)
	movq	%r14, %rdi
	callq	_ai_get_cccaps
	movq	_CC_CAP_PMU@GOTPCREL(%rip), %rcx
	movl	$1, %r15d
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.3:
	movq	_pmucapabilities@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_CHIPCREGOFFS
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_bcma_read32
	movl	%eax, (%r14)
	movq	_PCAP_REV_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movl	%eax, 4(%r14)
	jmp	LBB0_4
LBB0_1:
	xorl	%r15d, %r15d
LBB0_4:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_chipstatus,4,2                 ## @chipstatus
	.comm	_capabilities,4,2               ## @capabilities
	.comm	_CC_CAP_PMU,4,2                 ## @CC_CAP_PMU
	.comm	_pmucapabilities,4,2            ## @pmucapabilities
	.comm	_PCAP_REV_MASK,4,2              ## @PCAP_REV_MASK
	.no_dead_strip	_ai_buscore_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ai_buscore_setup
_ai_buscore_setup:                      ; @ai_buscore_setup
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x8, [x1, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	ldr	w8, [x1]
	str	w8, [x0, #16]
Lloh0:
	adrp	x8, _chipstatus@GOTPAGE
Lloh1:
	ldr	x8, [x8, _chipstatus@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_CHIPCREGOFFS
	mov	x1, x0
	mov	x0, x20
	bl	_bcma_read32
	str	x0, [x19, #24]
Lloh3:
	adrp	x8, _capabilities@GOTPAGE
Lloh4:
	ldr	x8, [x8, _capabilities@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_CHIPCREGOFFS
	mov	x1, x0
	mov	x0, x20
	bl	_bcma_read32
	str	x0, [x19, #8]
	mov	x0, x19
	bl	_ai_get_cccaps
Lloh6:
	adrp	x8, _CC_CAP_PMU@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CC_CAP_PMU@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_3
; %bb.2:
Lloh9:
	adrp	x8, _pmucapabilities@GOTPAGE
Lloh10:
	ldr	x8, [x8, _pmucapabilities@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_CHIPCREGOFFS
	mov	x1, x0
	mov	x0, x20
	bl	_bcma_read32
	str	w0, [x19]
Lloh12:
	adrp	x8, _PCAP_REV_MASK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PCAP_REV_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	and	w8, w8, w0
	str	w8, [x19, #4]
LBB0_3:
	mov	w0, #1
	b	LBB0_5
LBB0_4:
	mov	w0, #0
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_chipstatus,4,2                 ; @chipstatus
	.comm	_capabilities,4,2               ; @capabilities
	.comm	_CC_CAP_PMU,4,2                 ; @CC_CAP_PMU
	.comm	_pmucapabilities,4,2            ; @pmucapabilities
	.comm	_PCAP_REV_MASK,4,2              ; @PCAP_REV_MASK
	.no_dead_strip	_ai_buscore_setup
.subsections_via_symbols
