	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm3510_init
_bcm3510_init:                          ## @bcm3510_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	%r15
	pushq	%r14
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r14
	leaq	-40(%rbp), %rdx
	movq	%r14, %rdi
	movl	$202, %esi
	callq	_bcm3510_readB
	testl	%eax, %eax
	js	LBB0_7
## %bb.1:
	movl	-36(%rbp), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_deb_info
	movl	-40(%rbp), %eax
	cmpl	$129, %eax
	je	LBB0_4
## %bb.2:
	cmpl	$128, %eax
	jne	LBB0_6
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_deb_info
	movq	%r14, %rdi
	callq	_bcm3510_init_cold
	testl	%eax, %eax
	js	LBB0_7
LBB0_4:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_deb_info
	movq	%r14, %rdi
	callq	_bcm3510_check_firmware_version
	leaq	-32(%rbp), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$1, %edx
	callq	_memset
	movl	$1, -32(%rbp)
	movq	_CMD_AUTO_PARAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MSGID_SET_RF_AGC_SEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$0, (%rsp)
	movq	%r14, %rdi
	movq	%r15, %rcx
	movl	$4, %r8d
	xorl	%r9d, %r9d
	callq	_bcm3510_do_hab_cmd
	jmp	LBB0_8
LBB0_7:
	movl	%eax, %ebx
	jmp	LBB0_8
LBB0_6:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"JDEC: %02x\n"

L_.str.1:                               ## @.str.1
	.asciz	"attempting to download firmware\n"

L_.str.2:                               ## @.str.2
	.asciz	"firmware is loaded\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_CMD_AUTO_PARAM,4,2             ## @CMD_AUTO_PARAM
	.comm	_MSGID_SET_RF_AGC_SEL,4,2       ## @MSGID_SET_RF_AGC_SEL
	.no_dead_strip	_bcm3510_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm3510_init
_bcm3510_init:                          ; @bcm3510_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	ldr	x19, [x0]
	add	x2, sp, #24
	mov	x0, x19
	mov	w1, #202
	bl	_bcm3510_readB
	tbnz	w0, #31, LBB0_6
; %bb.1:
	ldr	w8, [sp, #28]
	str	x8, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_deb_info
	ldr	w8, [sp, #24]
	cmp	w8, #129
	b.eq	LBB0_4
; %bb.2:
	cmp	w8, #128
	b.ne	LBB0_5
; %bb.3:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_deb_info
	mov	x0, x19
	bl	_bcm3510_init_cold
	tbnz	w0, #31, LBB0_6
LBB0_4:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_deb_info
	mov	x0, x19
	bl	_bcm3510_check_firmware_version
	mov	w20, #1
	add	x0, sp, #16
	mov	w1, #0
	mov	w2, #1
	bl	_memset
	str	w20, [sp, #16]
Lloh6:
	adrp	x8, _CMD_AUTO_PARAM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CMD_AUTO_PARAM@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _MSGID_SET_RF_AGC_SEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MSGID_SET_RF_AGC_SEL@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	add	x3, sp, #16
	mov	x0, x19
	mov	w4, #4
	mov	x5, #0
	mov	w6, #0
	bl	_bcm3510_do_hab_cmd
	mov	w0, #0
	b	LBB0_6
LBB0_5:
Lloh12:
	adrp	x8, _ENODEV@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"JDEC: %02x\n"

l_.str.1:                               ; @.str.1
	.asciz	"attempting to download firmware\n"

l_.str.2:                               ; @.str.2
	.asciz	"firmware is loaded\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_CMD_AUTO_PARAM,4,2             ; @CMD_AUTO_PARAM
	.comm	_MSGID_SET_RF_AGC_SEL,4,2       ; @MSGID_SET_RF_AGC_SEL
	.no_dead_strip	_bcm3510_init
.subsections_via_symbols
