	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function elan_i2c_finish_fw_update
_elan_i2c_finish_fw_update:             ## @elan_i2c_finish_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
	subq	$24, %rsp
	.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, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	4(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_ETP_I2C_REPORT_LEN@GOTPCREL(%rip), %r14
	movl	(%r14), %ebx
	movq	%rbx, %rax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movq	%r13, %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_i2c_master_recv
	cmpl	(%r14), %eax
	je	LBB0_2
## %bb.1:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	subl	(%rcx), %edx
	testl	%eax, %eax
	cmovsl	%eax, %edx
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %ecx
	callq	_dev_warn
LBB0_2:
	movq	%r12, %rdi
	callq	_reinit_completion
	movl	(%r13), %edi
	callq	_enable_irq
	movq	_ETP_I2C_STAND_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ETP_I2C_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_elan_i2c_write_cmd
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movl	(%r13), %edi
	callq	_disable_irq
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	$300, %edi                      ## imm = 0x12C
	callq	_msecs_to_jiffies
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_8
## %bb.5:
	movl	(%r13), %edi
	callq	_disable_irq
LBB0_6:
	movq	_ETP_I2C_INF_LENGTH@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_i2c_master_recv
	xorl	%ebx, %ebx
	cmpl	(%r14), %eax
	je	LBB0_10
## %bb.7:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	subl	(%rcx), %ebx
	testl	%eax, %eax
	cmovsl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_10
LBB0_8:
	leaq	L_.str.2(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	(%r13), %edi
	callq	_disable_irq
	testl	%ebx, %ebx
	je	LBB0_6
## %bb.9:
	negl	%ebx
	jmp	LBB0_10
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ETP_I2C_REPORT_LEN,4,2         ## @ETP_I2C_REPORT_LEN
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read I2C data after FW WDT reset: %d (%d)\n"

	.comm	_ETP_I2C_STAND_CMD,4,2          ## @ETP_I2C_STAND_CMD
	.comm	_ETP_I2C_RESET,4,2              ## @ETP_I2C_RESET
L_.str.1:                               ## @.str.1
	.asciz	"device reset failed: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"timeout waiting for device reset\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_ETP_I2C_INF_LENGTH,4,2         ## @ETP_I2C_INF_LENGTH
L_.str.3:                               ## @.str.3
	.asciz	"failed to read INT signal: %d (%d)\n"

	.no_dead_strip	_elan_i2c_finish_fw_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function elan_i2c_finish_fw_update
_elan_i2c_finish_fw_update:             ; @elan_i2c_finish_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
	sub	sp, sp, #16
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	add	x19, x0, #4
Lloh3:
	adrp	x23, _ETP_I2C_REPORT_LEN@GOTPAGE
Lloh4:
	ldr	x23, [x23, _ETP_I2C_REPORT_LEN@GOTPAGEOFF]
	ldr	w2, [x23]
	lsl	x8, x2, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	mov	x1, x21
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_i2c_master_recv
	ldr	w8, [x23]
	cmp	w0, w8
	b.eq	LBB0_2
; %bb.1:
	mov	x3, x0
Lloh7:
	adrp	x8, _EIO@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cmp	w0, #0
	csneg	w2, w0, w8, lt
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_warn
LBB0_2:
	mov	x0, x22
	bl	_reinit_completion
	ldr	w0, [x20]
	bl	_enable_irq
Lloh12:
	adrp	x8, _ETP_I2C_STAND_CMD@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ETP_I2C_STAND_CMD@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x8, _ETP_I2C_RESET@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ETP_I2C_RESET@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_elan_i2c_write_cmd
	cbz	w0, LBB0_6
; %bb.3:
	mov	x23, x0
	str	x23, [sp, #-16]!
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	add	sp, sp, #16
	ldr	w0, [x20]
	bl	_disable_irq
LBB0_4:
	ldur	x8, [x29, #-56]
Lloh20:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh21:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.5:
	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_6:
	mov	w0, #300
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x22
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_11
; %bb.7:
	ldr	w0, [x20]
	bl	_disable_irq
LBB0_8:
Lloh23:
	adrp	x22, _ETP_I2C_INF_LENGTH@GOTPAGE
Lloh24:
	ldr	x22, [x22, _ETP_I2C_INF_LENGTH@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x20
	mov	x1, x21
	bl	_i2c_master_recv
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w8, [x22]
	cmp	w0, w8
	b.ne	LBB0_10
; %bb.9:
	mov	w23, #0
	b	LBB0_4
LBB0_10:
Lloh25:
	adrp	x8, _EIO@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	cmp	w0, #0
	csneg	w23, w0, w8, lt
	stp	x23, x0, [sp, #-16]!
Lloh28:
	adrp	x1, l_.str.3@PAGE
Lloh29:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	add	sp, sp, #16
                                        ; kill: def $w23 killed $w23 killed $x23 def $x23
	b	LBB0_4
LBB0_11:
Lloh30:
	adrp	x1, l_.str.2@PAGE
Lloh31:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh32:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh33:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh34:
	ldr	w22, [x8]
	ldr	w0, [x20]
	bl	_disable_irq
	cbz	w22, LBB0_8
; %bb.12:
	neg	w23, w22
	b	LBB0_4
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_ETP_I2C_REPORT_LEN,4,2         ; @ETP_I2C_REPORT_LEN
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read I2C data after FW WDT reset: %d (%d)\n"

	.comm	_ETP_I2C_STAND_CMD,4,2          ; @ETP_I2C_STAND_CMD
	.comm	_ETP_I2C_RESET,4,2              ; @ETP_I2C_RESET
l_.str.1:                               ; @.str.1
	.asciz	"device reset failed: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"timeout waiting for device reset\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_ETP_I2C_INF_LENGTH,4,2         ; @ETP_I2C_INF_LENGTH
l_.str.3:                               ; @.str.3
	.asciz	"failed to read INT signal: %d (%d)\n"

	.no_dead_strip	_elan_i2c_finish_fw_update
.subsections_via_symbols
