	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cyapa_gen3_do_fw_update
_cyapa_gen3_do_fw_update:               ## @cyapa_gen3_do_fw_update
	.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	%rsi, %r12
	movq	%rdi, %r15
	movq	(%rdi), %r14
	movq	_CYAPA_FW_DATA_BLOCK_START@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CYAPA_FW_DATA_BLOCK_COUNT@GOTPCREL(%rip), %rax
	movq	_CYAPA_FW_HDR_BLOCK_COUNT@GOTPCREL(%rip), %r13
	movq	_CYAPA_FW_BLOCK_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	imulq	(%r13), %rcx
	movq	(%rax), %rdx
	shlq	$2, %rcx
	addq	(%r12), %rcx
	callq	_cyapa_gen3_write_blocks
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_5
LBB0_2:
	movq	_CYAPA_FW_HDR_BLOCK_START@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r13), %rdx
	movq	(%r12), %rcx
	movq	%r15, %rdi
	callq	_cyapa_gen3_write_blocks
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
LBB0_5:
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_dev_err
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	xorl	%ebx, %ebx
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_CYAPA_FW_DATA_BLOCK_START,4,2  ## @CYAPA_FW_DATA_BLOCK_START
	.comm	_CYAPA_FW_DATA_BLOCK_COUNT,8,3  ## @CYAPA_FW_DATA_BLOCK_COUNT
	.comm	_CYAPA_FW_HDR_BLOCK_COUNT,8,3   ## @CYAPA_FW_HDR_BLOCK_COUNT
	.comm	_CYAPA_FW_BLOCK_SIZE,8,3        ## @CYAPA_FW_BLOCK_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"FW update aborted, write image: %d\n"

	.comm	_CYAPA_FW_HDR_BLOCK_START,4,2   ## @CYAPA_FW_HDR_BLOCK_START
L_.str.1:                               ## @.str.1
	.asciz	"FW update aborted, write checksum: %d\n"

	.no_dead_strip	_cyapa_gen3_do_fw_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cyapa_gen3_do_fw_update
_cyapa_gen3_do_fw_update:               ; @cyapa_gen3_do_fw_update
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x22, x1
	mov	x20, x0
	ldr	x19, [x0]
Lloh0:
	adrp	x8, _CYAPA_FW_DATA_BLOCK_START@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CYAPA_FW_DATA_BLOCK_START@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _CYAPA_FW_DATA_BLOCK_COUNT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CYAPA_FW_DATA_BLOCK_COUNT@GOTPAGEOFF]
Lloh5:
	ldr	x2, [x8]
	ldr	x8, [x22]
Lloh6:
	adrp	x23, _CYAPA_FW_HDR_BLOCK_COUNT@GOTPAGE
Lloh7:
	ldr	x23, [x23, _CYAPA_FW_HDR_BLOCK_COUNT@GOTPAGEOFF]
	ldr	x9, [x23]
Lloh8:
	adrp	x10, _CYAPA_FW_BLOCK_SIZE@GOTPAGE
Lloh9:
	ldr	x10, [x10, _CYAPA_FW_BLOCK_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	x10, [x10]
	mul	x9, x10, x9
	add	x3, x8, x9, lsl #2
	bl	_cyapa_gen3_write_blocks
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
Lloh13:
	adrp	x8, _CYAPA_FW_HDR_BLOCK_START@GOTPAGE
Lloh14:
	ldr	x8, [x8, _CYAPA_FW_HDR_BLOCK_START@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	ldr	x2, [x23]
	ldr	x3, [x22]
	mov	x0, x20
	bl	_cyapa_gen3_write_blocks
	mov	x21, x0
	cbz	w0, LBB0_5
; %bb.3:
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_4:
	mov	x0, x19
	mov	x2, x21
	bl	_dev_err
LBB0_5:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_CYAPA_FW_DATA_BLOCK_START,4,2  ; @CYAPA_FW_DATA_BLOCK_START
	.comm	_CYAPA_FW_DATA_BLOCK_COUNT,8,3  ; @CYAPA_FW_DATA_BLOCK_COUNT
	.comm	_CYAPA_FW_HDR_BLOCK_COUNT,8,3   ; @CYAPA_FW_HDR_BLOCK_COUNT
	.comm	_CYAPA_FW_BLOCK_SIZE,8,3        ; @CYAPA_FW_BLOCK_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"FW update aborted, write image: %d\n"

	.comm	_CYAPA_FW_HDR_BLOCK_START,4,2   ; @CYAPA_FW_HDR_BLOCK_START
l_.str.1:                               ; @.str.1
	.asciz	"FW update aborted, write checksum: %d\n"

	.no_dead_strip	_cyapa_gen3_do_fw_update
.subsections_via_symbols
