	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function goodix_read_version
_goodix_read_version:                   ## @goodix_read_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	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	8(%rdi), %rdi
	movq	_GOODIX_REG_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-64(%rbp), %rdx
	movl	$24, %ecx
	callq	_goodix_i2c_read
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	8(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	callq	_dev_err
	jmp	LBB0_5
LBB0_2:
	leaq	-69(%rbp), %r15
	leaq	-64(%rbp), %rsi
	movq	%r15, %rdi
	movl	$4, %edx
	callq	_memcpy
	movb	$0, -65(%rbp)
	movq	%r15, %rdi
	movl	$10, %esi
	movq	%rbx, %rdx
	callq	_kstrtou16
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movl	$4097, (%rbx)                   ## imm = 0x1001
LBB0_4:
	leaq	-48(%rbp), %rdi
	callq	_get_unaligned_le16
	movl	%eax, 4(%rbx)
	movq	8(%rbx), %rdi
	movl	(%rbx), %edx
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %ecx
	callq	_dev_info
LBB0_5:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_7
## %bb.6:
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_GOODIX_REG_ID,4,2              ## @GOODIX_REG_ID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read version failed: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"ID %d, version: %04x\n"

	.no_dead_strip	_goodix_read_version
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function goodix_read_version
_goodix_read_version:                   ; @goodix_read_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	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]
	ldr	x0, [x0, #8]
Lloh3:
	adrp	x8, _GOODIX_REG_ID@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GOODIX_REG_ID@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #16
	mov	w3, #24
	bl	_goodix_i2c_read
	mov	x19, x0
	cbz	w0, LBB0_2
; %bb.1:
	ldr	x0, [x20, #8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_dev_err
	b	LBB0_5
LBB0_2:
	add	x21, sp, #16
	add	x0, sp, #11
	add	x1, sp, #16
	mov	w2, #4
	bl	_memcpy
	strb	wzr, [sp, #15]
	add	x0, sp, #11
	mov	w1, #10
	mov	x2, x20
	bl	_kstrtou16
	cbz	x0, LBB0_4
; %bb.3:
	mov	w8, #4097
	str	w8, [x20]
LBB0_4:
	add	x0, x21, #16
	bl	_get_unaligned_le16
	mov	x3, x0
	str	w0, [x20, #4]
	ldr	x0, [x20, #8]
	ldr	w2, [x20]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_info
LBB0_5:
	ldr	x8, [sp, #40]
Lloh10:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh11:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_7
; %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:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_GOODIX_REG_ID,4,2              ; @GOODIX_REG_ID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read version failed: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"ID %d, version: %04x\n"

	.no_dead_strip	_goodix_read_version
.subsections_via_symbols
