	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function elan_i2c_get_checksum
_elan_i2c_get_checksum:                 ## @elan_i2c_get_checksum
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %r12d
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	testl	%esi, %esi
	jne	LBB0_1
## %bb.2:
	movq	_ETP_I2C_FW_CHECKSUM_CMD@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_ETP_I2C_IAP_CHECKSUM_CMD@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %esi
	leaq	-52(%rbp), %rdx
	movq	%r15, %rdi
	callq	_elan_i2c_read_cmd
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	testl	%r12d, %r12d
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%ebx, %ecx
	callq	_dev_err
	jmp	LBB0_6
LBB0_5:
	leaq	-52(%rbp), %rdi
	callq	_le16_to_cpup
	movl	%eax, (%r14)
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ETP_I2C_IAP_CHECKSUM_CMD,4,2   ## @ETP_I2C_IAP_CHECKSUM_CMD
	.comm	_ETP_I2C_FW_CHECKSUM_CMD,4,2    ## @ETP_I2C_FW_CHECKSUM_CMD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to get %s checksum: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"IAP"

L_.str.2:                               ## @.str.2
	.asciz	"FW"

	.no_dead_strip	_elan_i2c_get_checksum
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function elan_i2c_get_checksum
_elan_i2c_get_checksum:                 ; @elan_i2c_get_checksum
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x2
	mov	x22, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _ETP_I2C_IAP_CHECKSUM_CMD@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ETP_I2C_IAP_CHECKSUM_CMD@GOTPAGEOFF]
	str	x8, [sp, #24]
Lloh5:
	adrp	x8, _ETP_I2C_FW_CHECKSUM_CMD@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ETP_I2C_FW_CHECKSUM_CMD@GOTPAGEOFF]
	cmp	w1, #0
	csel	x8, x8, x9, eq
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_elan_i2c_read_cmd
	mov	x19, x0
	cbz	w0, LBB0_2
; %bb.1:
Lloh7:
	adrp	x8, l_.str.1@PAGE
Lloh8:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh9:
	adrp	x9, l_.str.2@PAGE
Lloh10:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	w22, #0
	csel	x2, x9, x8, eq
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x3, x19
	bl	_dev_err
	b	LBB0_3
LBB0_2:
	add	x0, sp, #12
	bl	_le16_to_cpup
	str	w0, [x20]
LBB0_3:
	ldr	x8, [sp, #24]
Lloh13:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh14:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_5:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_ETP_I2C_IAP_CHECKSUM_CMD,4,2   ; @ETP_I2C_IAP_CHECKSUM_CMD
	.comm	_ETP_I2C_FW_CHECKSUM_CMD,4,2    ; @ETP_I2C_FW_CHECKSUM_CMD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to get %s checksum: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"IAP"

l_.str.2:                               ; @.str.2
	.asciz	"FW"

	.no_dead_strip	_elan_i2c_get_checksum
.subsections_via_symbols
