	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function elan_i2c_get_version
_elan_i2c_get_version:                  ## @elan_i2c_get_version
	.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)
	leaq	-56(%rbp), %rsi
	callq	_elan_i2c_get_pattern
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_10
LBB0_2:
	testl	%r12d, %r12d
	jne	LBB0_3
## %bb.4:
	movq	_ETP_I2C_FW_VERSION_CMD@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_3:
	movq	_ETP_I2C_IAP_VERSION_CMD@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %esi
	leaq	-52(%rbp), %rdx
	movq	%r15, %rdi
	callq	_elan_i2c_read_cmd
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %ebx
	testl	%r12d, %r12d
	leaq	L_.str.3(%rip), %rax
	leaq	L_.str.2(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_10
LBB0_7:
	movl	-56(%rbp), %ecx
	movl	-52(%rbp), %eax
	movl	%eax, %edx
	testl	%r12d, %r12d
	je	LBB0_9
## %bb.8:
	movl	-48(%rbp), %edx
LBB0_9:
	cmpl	$1, %ecx
	cmovel	%edx, %eax
	movl	%eax, (%r14)
	xorl	%ebx, %ebx
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to get pattern version\n"

	.comm	_ETP_I2C_IAP_VERSION_CMD,4,2    ## @ETP_I2C_IAP_VERSION_CMD
	.comm	_ETP_I2C_FW_VERSION_CMD,4,2     ## @ETP_I2C_FW_VERSION_CMD
L_.str.1:                               ## @.str.1
	.asciz	"failed to get %s version: %d\n"

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

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

	.no_dead_strip	_elan_i2c_get_version
.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_version
_elan_i2c_get_version:                  ; @elan_i2c_get_version
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x21, x2
	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]
	str	x8, [sp, #40]
	add	x1, sp, #24
	bl	_elan_i2c_get_pattern
	cbz	w0, LBB0_2
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
Lloh5:
	adrp	x8, _ETP_I2C_IAP_VERSION_CMD@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ETP_I2C_IAP_VERSION_CMD@GOTPAGEOFF]
Lloh7:
	adrp	x9, _ETP_I2C_FW_VERSION_CMD@GOTPAGE
Lloh8:
	ldr	x9, [x9, _ETP_I2C_FW_VERSION_CMD@GOTPAGEOFF]
	cmp	w22, #0
	csel	x8, x9, x8, eq
	ldr	w1, [x8]
	add	x2, sp, #28
	mov	x0, x20
	bl	_elan_i2c_read_cmd
	mov	x19, x0
	cbz	w0, LBB0_7
; %bb.3:
Lloh9:
	adrp	x8, l_.str.2@PAGE
Lloh10:
	add	x8, x8, l_.str.2@PAGEOFF
Lloh11:
	adrp	x9, l_.str.3@PAGE
Lloh12:
	add	x9, x9, l_.str.3@PAGEOFF
	cmp	w22, #0
	csel	x8, x9, x8, eq
	stp	x8, x19, [sp]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_4:
	mov	x0, x20
	bl	_dev_err
LBB0_5:
	ldr	x8, [sp, #40]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.6:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_7:
	ldp	w8, w9, [sp, #24]
	ldr	w10, [sp, #32]
	cmp	w22, #0
	csel	w10, w9, w10, eq
	cmp	w8, #1
	csel	w8, w10, w9, eq
	str	w8, [x21]
	b	LBB0_5
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to get pattern version\n"

	.comm	_ETP_I2C_IAP_VERSION_CMD,4,2    ; @ETP_I2C_IAP_VERSION_CMD
	.comm	_ETP_I2C_FW_VERSION_CMD,4,2     ; @ETP_I2C_FW_VERSION_CMD
l_.str.1:                               ; @.str.1
	.asciz	"failed to get %s version: %d\n"

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

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

	.no_dead_strip	_elan_i2c_get_version
.subsections_via_symbols
