	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function af9035_download_firmware_old
_af9035_download_firmware_old:          ## @af9035_download_firmware_old
	.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
	subq	$152, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %rdi
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -96(%rbp)
	movaps	%xmm0, -112(%rbp)
	movaps	%xmm0, -128(%rbp)
	movq	$0, -80(%rbp)
	movups	%xmm0, -160(%rbp)
	movups	%xmm0, -144(%rbp)
	movups	%xmm0, -176(%rbp)
	movq	_CMD_FW_DL@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movq	%rax, -184(%rbp)
	leaq	-68(%rbp), %rax
	movl	%eax, -160(%rbp)
	movl	(%rsi), %eax
	cmpl	$8, %eax
	jl	LBB0_17
## %bb.1:
	movq	%rsi, %rbx
	leaq	L_.str(%rip), %rsi
	movl	%eax, %r15d
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_12 Depth 2
	movq	8(%rbx), %rdx
	subl	%r15d, %eax
	cltq
	movl	(%rdx,%rax,4), %r14d
	movl	4(%rdx,%rax,4), %ecx
	shll	$8, %ecx
	orl	8(%rdx,%rax,4), %ecx
	movl	12(%rdx,%rax,4), %r13d
	shll	$8, %r13d
	orl	16(%rdx,%rax,4), %r13d
	movl	20(%rdx,%rax,4), %r9d
	shll	$8, %r9d
	orl	24(%rdx,%rax,4), %r9d
	movq	%rdi, %r12
	movl	%r14d, %edx
	movl	%r13d, %r8d
	xorl	%eax, %eax
	callq	_dev_dbg
	addl	$-3, %r14d
	cmpl	$-2, %r14d
	jb	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	%r15d, %r13d
	jg	LBB0_4
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	_CMD_FW_DL_BEGIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -104(%rbp)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	leaq	-128(%rbp), %rsi
	callq	_af9035_ctrl_msg
	testl	%eax, %eax
	js	LBB0_7
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$-6, %r13d
	jl	LBB0_14
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	leal	65(%r13), %r12d
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	negl	%r15d
	.p2align	4, 0x90
LBB0_12:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	addl	$-58, %r12d
	cmpl	$58, %r12d
	movl	$58, %eax
	cmovll	%r12d, %eax
	movl	%eax, -176(%rbp)
	movl	(%rbx), %eax
	addl	%r15d, %eax
	cltq
	shlq	$2, %rax
	addq	8(%rbx), %rax
	movq	%rax, -168(%rbp)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	leaq	-184(%rbp), %rsi
	callq	_af9035_ctrl_msg
	testl	%eax, %eax
	js	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_12 Depth=2
	addl	$58, %r15d
	cmpl	$59, %r12d
	jge	LBB0_12
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_CMD_FW_DL_END@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -104(%rbp)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	leaq	-128(%rbp), %rsi
	callq	_af9035_ctrl_msg
	testl	%eax, %eax
	js	LBB0_13
## %bb.15:                              ##   in Loop: Header=BB0_2 Depth=1
	addl	$7, %r13d
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	subl	%r13d, %r15d
	movl	(%rbx), %edx
	subl	%r15d, %edx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rdi, %r14
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	cmpl	$8, %r15d
	jl	LBB0_16
## %bb.20:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rbx), %eax
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	jmp	LBB0_2
LBB0_13:
	movl	%eax, %r14d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
LBB0_8:
	leaq	L_.str.3(%rip), %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_19
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	%r12, %rdi
	jmp	LBB0_5
LBB0_7:
	movl	%eax, %r14d
	movq	%r12, %rdi
	jmp	LBB0_8
LBB0_16:
	movl	%r15d, %eax
	movq	%r14, %rdi
LBB0_17:
	testl	%eax, %eax
	je	LBB0_18
LBB0_5:
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_warn
LBB0_18:
	xorl	%r14d, %r14d
LBB0_19:
	movl	%r14d, %eax
	addq	$152, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CMD_FW_DL,4,2                  ## @CMD_FW_DL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"core=%d addr=%04x data_len=%d checksum=%04x\n"

L_.str.1:                               ## @.str.1
	.asciz	"bad firmware\n"

	.comm	_CMD_FW_DL_BEGIN,4,2            ## @CMD_FW_DL_BEGIN
	.comm	_CMD_FW_DL_END,4,2              ## @CMD_FW_DL_END
L_.str.2:                               ## @.str.2
	.asciz	"data uploaded=%zu\n"

L_.str.3:                               ## @.str.3
	.asciz	"failed=%d\n"

	.comm	_HDR_SIZE,4,2                   ## @HDR_SIZE
	.comm	_MAX_DATA,4,2                   ## @MAX_DATA
	.no_dead_strip	_af9035_download_firmware_old
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function af9035_download_firmware_old
_af9035_download_firmware_old:          ; @af9035_download_firmware_old
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #272
	.cfi_def_cfa_offset 272
	stp	x28, x27, [sp, #176]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #192]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #208]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #224]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #240]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #256]            ; 16-byte Folded Spill
	add	x29, sp, #256
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	x19, [x0]
	str	xzr, [sp, #144]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp, #112]
	stp	q0, q0, [sp, #80]
	stp	q0, q0, [sp, #48]
Lloh0:
	adrp	x8, _CMD_FW_DL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CMD_FW_DL@GOTPAGEOFF]
Lloh2:
	ldrsw	x8, [x8]
	str	x8, [sp, #40]
	sub	x8, x29, #92
	str	w8, [sp, #64]
	ldr	w8, [x1]
	cmp	w8, #8
	b.lt	LBB0_14
; %bb.1:
	mov	x20, x1
	mov	x21, x0
Lloh3:
	adrp	x22, l_.str@PAGE
Lloh4:
	add	x22, x22, l_.str@PAGEOFF
	mov	w26, #58
	mov	x28, x8
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	ldr	x9, [x20, #8]
	sub	w8, w8, w28
	add	x8, x9, w8, sxtw #2
	ldp	w23, w9, [x8]
	ldp	w10, w11, [x8, #8]
	orr	w9, w10, w9, lsl #8
	ldp	w10, w12, [x8, #16]
	orr	w27, w10, w11, lsl #8
	ldr	w8, [x8, #24]
	orr	w8, w8, w12, lsl #8
	stp	x27, x8, [sp, #16]
	stp	x23, x9, [sp]
	mov	x0, x19
	mov	x1, x22
	bl	_dev_dbg
	sub	w8, w23, #3
	cmn	w8, #2
	ccmp	w27, w28, #0, hs
	b.gt	LBB0_12
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh5:
	adrp	x8, _CMD_FW_DL_BEGIN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CMD_FW_DL_BEGIN@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [sp, #120]
	add	x1, sp, #96
	mov	x0, x21
	bl	_af9035_ctrl_msg
	tbnz	w0, #31, LBB0_11
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	cmn	w27, #6
	b.lt	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w23, w27, #65
	neg	w25, w28
LBB0_6:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	sub	w23, w23, #58
	cmp	w23, #58
	csel	w8, w23, w26, lt
	str	w8, [sp, #48]
	ldr	x8, [x20, #8]
	ldr	w9, [x20]
	add	w9, w25, w9
	add	x8, x8, w9, sxtw #2
	str	x8, [sp, #56]
	add	x1, sp, #40
	mov	x0, x21
	bl	_af9035_ctrl_msg
	tbnz	w0, #31, LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	add	w25, w25, #58
	cmp	w23, #59
	b.ge	LBB0_6
LBB0_8:                                 ;   in Loop: Header=BB0_2 Depth=1
Lloh8:
	adrp	x8, _CMD_FW_DL_END@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CMD_FW_DL_END@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [sp, #120]
	add	x1, sp, #96
	mov	x0, x21
	bl	_af9035_ctrl_msg
	tbnz	w0, #31, LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w8, w27, #7
	ldr	w9, [x20]
	sub	w28, w28, w8
	sub	w8, w9, w28
	str	x8, [sp]
	mov	x0, x19
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
	cmp	w28, #8
	b.lt	LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x20]
	b	LBB0_2
LBB0_11:
	mov	x24, x0
	str	x24, [sp]
Lloh13:
	adrp	x1, l_.str.3@PAGE
Lloh14:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	b	LBB0_17
LBB0_12:
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	b	LBB0_15
LBB0_13:
	mov	x8, x28
LBB0_14:
	cbz	w8, LBB0_16
LBB0_15:
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_warn
LBB0_16:
	mov	w24, #0
LBB0_17:
	mov	x0, x24
	ldp	x29, x30, [sp, #256]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #240]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #224]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #208]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #192]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #176]            ; 16-byte Folded Reload
	add	sp, sp, #272
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_CMD_FW_DL,4,2                  ; @CMD_FW_DL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"core=%d addr=%04x data_len=%d checksum=%04x\n"

l_.str.1:                               ; @.str.1
	.asciz	"bad firmware\n"

	.comm	_CMD_FW_DL_BEGIN,4,2            ; @CMD_FW_DL_BEGIN
	.comm	_CMD_FW_DL_END,4,2              ; @CMD_FW_DL_END
l_.str.2:                               ; @.str.2
	.asciz	"data uploaded=%zu\n"

l_.str.3:                               ; @.str.3
	.asciz	"failed=%d\n"

	.comm	_HDR_SIZE,4,2                   ; @HDR_SIZE
	.comm	_MAX_DATA,4,2                   ; @MAX_DATA
	.no_dead_strip	_af9035_download_firmware_old
.subsections_via_symbols
