	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ai_doattach
_ai_doattach:                           ## @ai_doattach
	.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	%rdi, %rbx
	movq	%rsi, 8(%rdi)
	movl	32(%rsi), %eax
	movl	%eax, (%rdi)
	movq	24(%rsi), %r15
	movl	16(%rsi), %eax
	movl	%eax, 32(%rdi)
	movups	(%rsi), %xmm0
	movups	%xmm0, 16(%rdi)
	movq	%r15, %rsi
	callq	_ai_buscore_setup
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	leaq	16(%rbx), %r14
	movq	_gpiopullup@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_CHIPCREGOFFS
	movq	%r15, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_bcma_write32
	movq	_gpiopulldown@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_CHIPCREGOFFS
	movq	%r15, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_bcma_write32
	movq	%r14, %rdi
	callq	_ai_get_cccaps
	movq	_CC_CAP_PMU@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_si_pmu_measure_alpclk
	jmp	LBB0_4
LBB0_1:
	xorl	%ebx, %ebx
LBB0_4:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_gpiopullup,4,2                 ## @gpiopullup
	.comm	_gpiopulldown,4,2               ## @gpiopulldown
	.comm	_CC_CAP_PMU,4,2                 ## @CC_CAP_PMU
	.no_dead_strip	_ai_doattach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ai_doattach
_ai_doattach:                           ; @ai_doattach
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldr	w8, [x1, #32]
	str	w8, [x0]
	ldr	w8, [x1, #16]
	str	w8, [x0, #32]
	ldr	q0, [x1]
	mov	x20, x0
	str	q0, [x20, #16]!
	str	x1, [x0, #8]
	ldr	x21, [x1, #24]
	mov	x1, x21
	bl	_ai_buscore_setup
	cbz	w0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _gpiopullup@GOTPAGE
Lloh1:
	ldr	x8, [x8, _gpiopullup@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_CHIPCREGOFFS
	mov	x1, x0
	mov	x0, x21
	mov	w2, #0
	bl	_bcma_write32
Lloh3:
	adrp	x8, _gpiopulldown@GOTPAGE
Lloh4:
	ldr	x8, [x8, _gpiopulldown@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_CHIPCREGOFFS
	mov	x1, x0
	mov	x0, x21
	mov	w2, #0
	bl	_bcma_write32
	mov	x0, x20
	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_4
; %bb.2:
	mov	x0, x20
	bl	_si_pmu_measure_alpclk
	b	LBB0_4
LBB0_3:
	mov	x19, #0
LBB0_4:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_gpiopullup,4,2                 ; @gpiopullup
	.comm	_gpiopulldown,4,2               ; @gpiopulldown
	.comm	_CC_CAP_PMU,4,2                 ; @CC_CAP_PMU
	.no_dead_strip	_ai_doattach
.subsections_via_symbols
