	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function elants_i2c_query_test_version
_elants_i2c_query_test_version:         ## @elants_i2c_query_test_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsp, -80(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %r15
	movq	_CMD_HEADER_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	movq	_E_ELAN_INFO_TEST_VER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)
	movabsq	$4294967296, %rax               ## imm = 0x100000000
	movq	%rax, -56(%rbp)
	movq	_HEADER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	(,%rbx,4), %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movq	_MAX_RETRIES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_5
## %bb.1:
	shll	$2, %ebx
	xorl	%r13d, %r13d
	leaq	L_.str(%rip), %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	leaq	-64(%rbp), %rsi
	movl	$16, %edx
	movq	%r12, %rcx
	movl	%ebx, %r8d
	callq	_elants_i2c_execute_command
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	movl	%ebx, %ecx
	movq	%r12, %r8
	callq	_dev_dbg
	incl	%r13d
	movq	_MAX_RETRIES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jl	LBB0_2
LBB0_5:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_3:
	movq	%r12, %rdi
	callq	_elants_i2c_parse_version
	movzbl	%al, %ecx
	sarl	$8, %eax
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, (%rdx)
	movl	%ecx, 4(%rdx)
	xorl	%eax, %eax
LBB0_6:
	movq	-80(%rbp), %rsp                 ## 8-byte Reload
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_8
## %bb.7:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_CMD_HEADER_READ,4,2            ## @CMD_HEADER_READ
	.comm	_E_ELAN_INFO_TEST_VER,4,2       ## @E_ELAN_INFO_TEST_VER
	.comm	_HEADER_SIZE,4,2                ## @HEADER_SIZE
	.comm	_MAX_RETRIES,4,2                ## @MAX_RETRIES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read test version error rc=%d, buf=%*phC\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to read test version\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_elants_i2c_query_test_version
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function elants_i2c_query_test_version
lCPI0_0:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_elants_i2c_query_test_version:         ; @elants_i2c_query_test_version
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	sub	sp, sp, #32
	mov	x19, x0
	mov	x24, sp
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	ldr	x20, [x0, #8]
Lloh3:
	adrp	x8, _CMD_HEADER_READ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CMD_HEADER_READ@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _E_ELAN_INFO_TEST_VER@GOTPAGE
Lloh7:
	ldr	x9, [x9, _E_ELAN_INFO_TEST_VER@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	stp	w8, w9, [x29, #-88]
Lloh9:
	adrp	x8, lCPI0_0@PAGE
Lloh10:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	stur	d0, [x29, #-80]
Lloh11:
	adrp	x8, _HEADER_SIZE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _HEADER_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	w12, [x8]
	lsl	x8, x12, #2
	mov	x9, x8
Lloh14:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh15:
	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
Lloh16:
	adrp	x25, _MAX_RETRIES@GOTPAGE
Lloh17:
	ldr	x25, [x25, _MAX_RETRIES@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	w26, #0
	lsl	w22, w12, #2
Lloh18:
	adrp	x23, l_.str@PAGE
Lloh19:
	add	x23, x23, l_.str@PAGEOFF
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	sub	x1, x29, #88
	mov	x0, x20
	mov	w2, #16
	mov	x3, x21
	mov	x4, x22
	bl	_elants_i2c_execute_command
	cbz	w0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x2, x0
	mov	x0, x20
	mov	x1, x23
	mov	x3, x22
	mov	x4, x21
	bl	_dev_dbg
	add	w26, w26, #1
	ldr	w8, [x25]
	cmp	w26, w8
	b.lt	LBB0_2
LBB0_4:
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh22:
	adrp	x8, _EINVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_5:
	mov	x0, x21
	bl	_elants_i2c_parse_version
	mov	x8, x0
	mov	w0, #0
	asr	w9, w8, #8
	and	w8, w8, #0xff
	stp	w9, w8, [x19]
LBB0_6:
	mov	sp, x24
	ldur	x8, [x29, #-72]
Lloh25:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh26:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	sub	sp, x29, #64
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdrp	Lloh9, Lloh11
	.loh AdrpLdr	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_CMD_HEADER_READ,4,2            ; @CMD_HEADER_READ
	.comm	_E_ELAN_INFO_TEST_VER,4,2       ; @E_ELAN_INFO_TEST_VER
	.comm	_HEADER_SIZE,4,2                ; @HEADER_SIZE
	.comm	_MAX_RETRIES,4,2                ; @MAX_RETRIES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read test version error rc=%d, buf=%*phC\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to read test version\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_elants_i2c_query_test_version
.subsections_via_symbols
