	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bcma_core_chipcommon_init      ## -- Begin function bcma_core_chipcommon_init
	.p2align	4, 0x90
_bcma_core_chipcommon_init:             ## @bcma_core_chipcommon_init
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	cmpl	$0, (%rdi)
	jne	LBB0_13
## %bb.1:
	movq	%rdi, %rbx
	callq	_bcma_core_chipcommon_early_init
	movq	16(%rbx), %rax
	cmpl	$20, 8(%rax)
	jl	LBB0_3
## %bb.2:
	movq	_BCMA_CC_GPIOPULLUP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_bcma_cc_write32
	movq	_BCMA_CC_GPIOPULLDOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_bcma_cc_write32
LBB0_3:
	movl	4(%rbx), %eax
	movq	_BCMA_CC_CAP_PMU@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_bcma_pmu_init
	movl	4(%rbx), %eax
LBB0_5:
	movq	_BCMA_CC_CAP_PCTL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
## %bb.6:
	movq	16(%rbx), %rax
	movq	(%rax), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_bcma_err
LBB0_7:
	movq	16(%rbx), %rax
	cmpl	$16, 8(%rax)
	jl	LBB0_12
## %bb.8:
	movq	(%rax), %rcx
	movl	(%rcx), %eax
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:
	movl	4(%rcx), %ecx
	testl	%ecx, %ecx
	movl	$10, %edx
	cmovel	%edx, %eax
	movl	$90, %edx
	cmovnel	%ecx, %edx
	jmp	LBB0_11
LBB0_9:
	movl	$90, %edx
	movl	$10, %eax
LBB0_11:
	movq	_BCMA_CC_GPIOTIMER_ONTIME_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movq	_BCMA_CC_GPIOTIMER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_BCMA_CC_GPIOTIMER_OFFTIME_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	%eax, %edx
	movq	%rbx, %rdi
	callq	_bcma_cc_write32
LBB0_12:
	movq	%rbx, %rdi
	callq	_bcma_chipco_watchdog_ticks_per_ms
	movl	%eax, 8(%rbx)
	movl	$1, (%rbx)
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BCMA_CC_GPIOPULLUP,4,2         ## @BCMA_CC_GPIOPULLUP
	.comm	_BCMA_CC_GPIOPULLDOWN,4,2       ## @BCMA_CC_GPIOPULLDOWN
	.comm	_BCMA_CC_CAP_PMU,4,2            ## @BCMA_CC_CAP_PMU
	.comm	_BCMA_CC_CAP_PCTL,4,2           ## @BCMA_CC_CAP_PCTL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Power control not implemented!\n"

	.comm	_BCMA_CC_GPIOTIMER,4,2          ## @BCMA_CC_GPIOTIMER
	.comm	_BCMA_CC_GPIOTIMER_ONTIME_SHIFT,4,2 ## @BCMA_CC_GPIOTIMER_ONTIME_SHIFT
	.comm	_BCMA_CC_GPIOTIMER_OFFTIME_SHIFT,4,2 ## @BCMA_CC_GPIOTIMER_OFFTIME_SHIFT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bcma_core_chipcommon_init      ; -- Begin function bcma_core_chipcommon_init
	.p2align	2
_bcma_core_chipcommon_init:             ; @bcma_core_chipcommon_init
	.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	w8, [x0]
	cbnz	w8, LBB0_12
; %bb.1:
	mov	x19, x0
	bl	_bcma_core_chipcommon_early_init
	ldr	x8, [x19, #16]
	ldr	w8, [x8, #8]
	cmp	w8, #20
	b.lt	LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _BCMA_CC_GPIOPULLUP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BCMA_CC_GPIOPULLUP@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_bcma_cc_write32
Lloh3:
	adrp	x8, _BCMA_CC_GPIOPULLDOWN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BCMA_CC_GPIOPULLDOWN@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_bcma_cc_write32
LBB0_3:
	ldr	w8, [x19, #4]
Lloh6:
	adrp	x9, _BCMA_CC_CAP_PMU@GOTPAGE
Lloh7:
	ldr	x9, [x9, _BCMA_CC_CAP_PMU@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_bcma_pmu_init
	ldr	w8, [x19, #4]
LBB0_5:
Lloh9:
	adrp	x9, _BCMA_CC_CAP_PCTL@GOTPAGE
Lloh10:
	ldr	x9, [x9, _BCMA_CC_CAP_PCTL@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
	ldr	x8, [x19, #16]
	ldr	x0, [x8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_bcma_err
LBB0_7:
	ldr	x8, [x19, #16]
	ldr	w9, [x8, #8]
	cmp	w9, #16
	b.lt	LBB0_11
; %bb.8:
	ldr	x11, [x8]
	ldr	w10, [x11]
	mov	w8, #90
	mov	w9, #10
	cbz	w10, LBB0_10
; %bb.9:
	ldr	w11, [x11, #4]
	cmp	w11, #0
	csel	w9, w9, w10, eq
	csel	w8, w8, w11, eq
LBB0_10:
Lloh14:
	adrp	x10, _BCMA_CC_GPIOTIMER@GOTPAGE
Lloh15:
	ldr	x10, [x10, _BCMA_CC_GPIOTIMER@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x10]
Lloh17:
	adrp	x10, _BCMA_CC_GPIOTIMER_ONTIME_SHIFT@GOTPAGE
Lloh18:
	ldr	x10, [x10, _BCMA_CC_GPIOTIMER_ONTIME_SHIFT@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	lsl	w9, w9, w10
Lloh20:
	adrp	x10, _BCMA_CC_GPIOTIMER_OFFTIME_SHIFT@GOTPAGE
Lloh21:
	ldr	x10, [x10, _BCMA_CC_GPIOTIMER_OFFTIME_SHIFT@GOTPAGEOFF]
Lloh22:
	ldr	w10, [x10]
	lsl	w8, w8, w10
	orr	w2, w8, w9
	mov	x0, x19
	bl	_bcma_cc_write32
LBB0_11:
	mov	x0, x19
	bl	_bcma_chipco_watchdog_ticks_per_ms
	str	w0, [x19, #8]
	mov	w8, #1
	str	w8, [x19]
LBB0_12:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_BCMA_CC_GPIOPULLUP,4,2         ; @BCMA_CC_GPIOPULLUP
	.comm	_BCMA_CC_GPIOPULLDOWN,4,2       ; @BCMA_CC_GPIOPULLDOWN
	.comm	_BCMA_CC_CAP_PMU,4,2            ; @BCMA_CC_CAP_PMU
	.comm	_BCMA_CC_CAP_PCTL,4,2           ; @BCMA_CC_CAP_PCTL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Power control not implemented!\n"

	.comm	_BCMA_CC_GPIOTIMER,4,2          ; @BCMA_CC_GPIOTIMER
	.comm	_BCMA_CC_GPIOTIMER_ONTIME_SHIFT,4,2 ; @BCMA_CC_GPIOTIMER_ONTIME_SHIFT
	.comm	_BCMA_CC_GPIOTIMER_OFFTIME_SHIFT,4,2 ; @BCMA_CC_GPIOTIMER_OFFTIME_SHIFT
.subsections_via_symbols
