	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cyapa_update_fw_store
_cyapa_update_fw_store:                 ## @cyapa_update_fw_store
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r13
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_dev_get_drvdata
	movq	%rax, %r12
	movq	_NAME_MAX@GOTPCREL(%rip), %rax
	movslq	(%rax), %r15
	movl	%r15d, %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	cmpq	%r13, %r15
	jbe	LBB0_1
## %bb.2:
	movq	%r14, %r15
	movq	%rbx, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%r13, %rdx
	callq	_memcpy
	leaq	(%rbx,%r13), %rax
	decq	%rax
	movq	%rbx, %rcx
	addq	%r13, %rcx
	cmpb	$10, -1(%rbx,%r13)
	cmoveq	%rax, %rcx
	movb	$0, (%rcx)
	movq	8(%r12), %rdi
	testq	%rdi, %rdi
	movq	%r12, %r14
	je	LBB0_4
## %bb.3:
	callq	_input_unregister_device
	movq	$0, 8(%r14)
LBB0_4:
	movq	%r14, %rdi
	callq	_mutex_lock_interruptible
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %r12d
	movq	%r14, %rdi
	callq	_cyapa_reinitialize
	movl	%r12d, %r13d
	jmp	LBB0_12
LBB0_1:
	leaq	L_.str(%rip), %rsi
	xorl	%r13d, %r13d
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_12
LBB0_6:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_cyapa_firmware
	movl	%eax, %r12d
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_9
LBB0_8:
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_dbg
LBB0_9:
	movq	%r14, %rdi
	callq	_cyapa_reinitialize
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	testl	%r12d, %r12d
	cmovel	%ebx, %r12d
LBB0_11:
	movq	%r14, %rdi
	callq	_mutex_unlock
	testl	%r12d, %r12d
	cmovnel	%r12d, %r13d
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_14
## %bb.13:
	movl	%r13d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_NAME_MAX,4,2                   ## @NAME_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"File name too long\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"firmware update failed: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"firmware update successfully done.\n"

L_.str.3:                               ## @.str.3
	.asciz	"failed to re-detect after updated: %d\n"

	.no_dead_strip	_cyapa_update_fw_store
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cyapa_update_fw_store
_cyapa_update_fw_store:                 ; @cyapa_update_fw_store
	.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
	sub	sp, sp, #16
	mov	x19, x3
	mov	x23, x2
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	bl	_dev_get_drvdata
	mov	x20, x0
Lloh3:
	adrp	x8, _NAME_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NAME_MAX@GOTPAGEOFF]
Lloh5:
	ldrsw	x12, [x8]
	and	x8, x12, #0xffffffff
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x22, x9, x8
	mov	sp, x22
	cmp	x12, x19
	b.ls	LBB0_5
; %bb.1:
	mov	x0, x22
	mov	x1, x23
	mov	x2, x19
	bl	_memcpy
	sub	x8, x19, #1
	ldrb	w9, [x22, x8]
	cmp	w9, #10
	csel	x8, x8, x19, eq
	strb	wzr, [x22, x8]
	ldr	x0, [x20, #8]
	cbz	x0, LBB0_3
; %bb.2:
	bl	_input_unregister_device
	str	xzr, [x20, #8]
LBB0_3:
	mov	x0, x20
	bl	_mutex_lock_interruptible
	cbz	w0, LBB0_6
; %bb.4:
	mov	x23, x0
	mov	x0, x20
	bl	_cyapa_reinitialize
	b	LBB0_12
LBB0_5:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_err
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_12
LBB0_6:
	mov	x0, x20
	mov	x1, x22
	bl	_cyapa_firmware
	mov	x22, x0
	cbz	w0, LBB0_8
; %bb.7:
	str	x22, [sp, #-16]!
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	add	sp, sp, #16
	b	LBB0_9
LBB0_8:
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_dev_dbg
LBB0_9:
	mov	x0, x20
	bl	_cyapa_reinitialize
	cbz	w0, LBB0_11
; %bb.10:
	mov	x23, x0
	str	x23, [sp, #-16]!
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	add	sp, sp, #16
	cmp	w22, #0
	csel	w22, w23, w22, eq
LBB0_11:
	mov	x0, x20
	bl	_mutex_unlock
	cmp	w22, #0
	csel	w23, w19, w22, eq
LBB0_12:
	ldur	x8, [x29, #-56]
Lloh19:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh20:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.13:
	mov	x0, x23
	sub	sp, x29, #48
	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
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_NAME_MAX,4,2                   ; @NAME_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"File name too long\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"firmware update failed: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"firmware update successfully done.\n"

l_.str.3:                               ; @.str.3
	.asciz	"failed to re-detect after updated: %d\n"

	.no_dead_strip	_cyapa_update_fw_store
.subsections_via_symbols
