	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm3510_download_firmware
_bcm3510_download_firmware:             ## @bcm3510_download_firmware
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %r12
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_deb_info
	movq	(%r12), %rax
	movq	_BCM3510_DEFAULT_FIRMWARE@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	callq	*(%rax)
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	-48(%rbp), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_deb_info
	movq	-48(%rbp), %rdi
	cmpl	$0, (%rdi)
	jle	LBB0_7
## %bb.3:
	movq	8(%rdi), %r14
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movslq	%r15d, %r15
	movl	(%r14,%r15,4), %edi
	callq	_le16_to_cpu
	movq	%rax, %r13
	movl	8(%r14,%r15,4), %edi
	callq	_le16_to_cpu
	movq	%rax, %rbx
	movq	-48(%rbp), %rax
	movl	(%rax), %ecx
	leaq	L_.str.3(%rip), %rdi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_deb_info
	addl	$4, %r15d
	movslq	%r15d, %rax
	leaq	(%r14,%rax,4), %rdx
	movq	%r12, %rdi
	movq	%r13, %rsi
	movq	%rbx, %rcx
	callq	_bcm3510_write_ram
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	addl	%ebx, %r15d
	movq	-48(%rbp), %rdi
	cmpl	(%rdi), %r15d
	jl	LBB0_4
LBB0_7:
	callq	_release_firmware
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_deb_info
	xorl	%r13d, %r13d
	jmp	LBB0_8
LBB0_1:
	movl	%eax, %r13d
	movl	(%r14), %esi
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_err
	jmp	LBB0_8
LBB0_5:
	movl	%eax, %r13d
	leaq	L_.str.4(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_err
LBB0_8:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"requesting firmware\n"

	.comm	_BCM3510_DEFAULT_FIRMWARE,4,2   ## @BCM3510_DEFAULT_FIRMWARE
L_.str.1:                               ## @.str.1
	.asciz	"could not load firmware (%s): %d"

L_.str.2:                               ## @.str.2
	.asciz	"got firmware: %zu\n"

L_.str.3:                               ## @.str.3
	.asciz	"firmware chunk, addr: 0x%04x, len: 0x%04x, total length: 0x%04zx\n"

L_.str.4:                               ## @.str.4
	.asciz	"firmware download failed: %d\n"

L_.str.5:                               ## @.str.5
	.asciz	"firmware download successfully completed\n"

	.no_dead_strip	_bcm3510_download_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm3510_download_firmware
_bcm3510_download_firmware:             ; @bcm3510_download_firmware
	.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
	mov	x20, x0
	ldr	x19, [x0]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_deb_info
	ldr	x8, [x19]
	ldr	x8, [x8]
Lloh2:
	adrp	x22, _BCM3510_DEFAULT_FIRMWARE@GOTPAGE
Lloh3:
	ldr	x22, [x22, _BCM3510_DEFAULT_FIRMWARE@GOTPAGEOFF]
	ldr	w2, [x22]
	add	x1, sp, #24
	mov	x0, x20
	blr	x8
	tbnz	w0, #31, LBB0_6
; %bb.1:
	ldr	x8, [sp, #24]
	ldr	w8, [x8]
	str	x8, [sp]
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_deb_info
	ldr	x0, [sp, #24]
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.2:
	mov	w24, #0
	ldr	x23, [x0, #8]
Lloh6:
	adrp	x20, l_.str.3@PAGE
Lloh7:
	add	x20, x20, l_.str.3@PAGEOFF
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	x22, x23, w24, sxtw #2
	ldr	w0, [x22]
	bl	_le16_to_cpu
	mov	x21, x0
	ldr	w0, [x22, #8]
	bl	_le16_to_cpu
	mov	x22, x0
	ldr	x8, [sp, #24]
	ldr	w8, [x8]
	stp	x0, x8, [sp, #8]
	str	x21, [sp]
	mov	x0, x20
	bl	_deb_info
	add	w24, w24, #4
	add	x2, x23, w24, sxtw #2
	mov	x0, x19
	mov	x1, x21
	mov	x3, x22
	bl	_bcm3510_write_ram
	tbnz	w0, #31, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [sp, #24]
	ldr	w8, [x0]
	add	w24, w24, w22
	cmp	w24, w8
	b.lt	LBB0_3
LBB0_5:
	bl	_release_firmware
Lloh8:
	adrp	x0, l_.str.5@PAGE
Lloh9:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_deb_info
	mov	w21, #0
	b	LBB0_9
LBB0_6:
	mov	x21, x0
	ldr	w1, [x22]
	str	x21, [sp]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_7:
	mov	x21, x0
Lloh12:
	adrp	x0, l_.str.4@PAGE
Lloh13:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x21
LBB0_8:
	bl	_err
LBB0_9:
	mov	x0, x21
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"requesting firmware\n"

	.comm	_BCM3510_DEFAULT_FIRMWARE,4,2   ; @BCM3510_DEFAULT_FIRMWARE
l_.str.1:                               ; @.str.1
	.asciz	"could not load firmware (%s): %d"

l_.str.2:                               ; @.str.2
	.asciz	"got firmware: %zu\n"

l_.str.3:                               ; @.str.3
	.asciz	"firmware chunk, addr: 0x%04x, len: 0x%04x, total length: 0x%04zx\n"

l_.str.4:                               ; @.str.4
	.asciz	"firmware download failed: %d\n"

l_.str.5:                               ; @.str.5
	.asciz	"firmware download successfully completed\n"

	.no_dead_strip	_bcm3510_download_firmware
.subsections_via_symbols
