	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function goodix_read_config
_goodix_read_config:                    ## @goodix_read_config
	.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	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	_GOODIX_CONFIG_MAX_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	movq	16(%r14), %rdi
	movq	24(%r14), %rax
	movl	(%rax), %ecx
	movl	4(%rax), %esi
	movq	%rbx, %rdx
	callq	_goodix_i2c_read
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	16(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_warn
	movq	_GOODIX_INT_TRIGGER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movq	_GOODIX_MAX_CONTACTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r14)
	jmp	LBB0_5
LBB0_2:
	movq	_TRIGGER_LOC@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rbx,%rax,4), %eax
	andl	$3, %eax
	movl	%eax, (%r14)
	movq	_MAX_CONTACTS_LOC@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rbx,%rax,4), %eax
	andl	$15, %eax
	movl	%eax, 4(%r14)
	movq	_RESOLUTION_LOC@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	leaq	(%rbx,%rax,4), %rdi
	callq	_get_unaligned_le16
	movl	%eax, %r15d
	movq	(%r12), %rax
	leaq	(%rbx,%rax,4), %rdi
	addq	$8, %rdi
	callq	_get_unaligned_le16
	testl	%r15d, %r15d
	je	LBB0_5
## %bb.3:
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	8(%r14), %edi
	movq	_ABS_MT_POSITION_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	decl	%r15d
	movl	%r15d, %edx
	callq	_input_abs_set_max
	movl	8(%r14), %edi
	movq	_ABS_MT_POSITION_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	decl	%ebx
	movl	%ebx, %edx
	callq	_input_abs_set_max
LBB0_5:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_7
## %bb.6:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_GOODIX_CONFIG_MAX_LENGTH,4,2   ## @GOODIX_CONFIG_MAX_LENGTH
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error reading config: %d\n"

	.comm	_GOODIX_INT_TRIGGER,4,2         ## @GOODIX_INT_TRIGGER
	.comm	_GOODIX_MAX_CONTACTS,4,2        ## @GOODIX_MAX_CONTACTS
	.comm	_TRIGGER_LOC,8,3                ## @TRIGGER_LOC
	.comm	_MAX_CONTACTS_LOC,8,3           ## @MAX_CONTACTS_LOC
	.comm	_RESOLUTION_LOC,8,3             ## @RESOLUTION_LOC
	.comm	_ABS_MT_POSITION_X,4,2          ## @ABS_MT_POSITION_X
	.comm	_ABS_MT_POSITION_Y,4,2          ## @ABS_MT_POSITION_Y
	.no_dead_strip	_goodix_read_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function goodix_read_config
_goodix_read_config:                    ; @goodix_read_config
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	sub	sp, sp, #16
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
Lloh3:
	adrp	x8, _GOODIX_CONFIG_MAX_LENGTH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GOODIX_CONFIG_MAX_LENGTH@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x20, x9, x8
	mov	sp, x20
	ldr	x0, [x0, #16]
	ldr	x8, [x19, #24]
	ldp	w3, w1, [x8]
	mov	x2, x20
	bl	_goodix_i2c_read
	cbz	w0, LBB0_2
; %bb.1:
	mov	x2, x0
	ldr	x0, [x19, #16]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
Lloh10:
	adrp	x8, _GOODIX_INT_TRIGGER@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GOODIX_INT_TRIGGER@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w8, [x19]
Lloh13:
	adrp	x8, _GOODIX_MAX_CONTACTS@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GOODIX_MAX_CONTACTS@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	str	w8, [x19, #4]
	b	LBB0_4
LBB0_2:
Lloh16:
	adrp	x8, _TRIGGER_LOC@GOTPAGE
Lloh17:
	ldr	x8, [x8, _TRIGGER_LOC@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	ldr	w8, [x20, x8, lsl #2]
	and	w8, w8, #0x3
Lloh19:
	adrp	x9, _MAX_CONTACTS_LOC@GOTPAGE
Lloh20:
	ldr	x9, [x9, _MAX_CONTACTS_LOC@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	ldr	w9, [x20, x9, lsl #2]
	and	w9, w9, #0xf
	stp	w8, w9, [x19]
Lloh22:
	adrp	x22, _RESOLUTION_LOC@GOTPAGE
Lloh23:
	ldr	x22, [x22, _RESOLUTION_LOC@GOTPAGEOFF]
	ldr	x8, [x22]
	add	x0, x20, x8, lsl #2
	bl	_get_unaligned_le16
	mov	x21, x0
	ldr	x8, [x22]
	add	x8, x20, x8, lsl #2
	add	x0, x8, #8
	bl	_get_unaligned_le16
	cmp	w21, #0
	ccmp	w0, #0, #4, ne
	b.eq	LBB0_4
; %bb.3:
	mov	x20, x0
	ldr	w0, [x19, #8]
Lloh24:
	adrp	x8, _ABS_MT_POSITION_X@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ABS_MT_POSITION_X@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	sub	w2, w21, #1
	bl	_input_abs_set_max
	ldr	w0, [x19, #8]
Lloh27:
	adrp	x8, _ABS_MT_POSITION_Y@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ABS_MT_POSITION_Y@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	sub	w2, w20, #1
	bl	_input_abs_set_max
LBB0_4:
	ldur	x8, [x29, #-40]
Lloh30:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh31:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.5:
	sub	sp, x29, #32
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_GOODIX_CONFIG_MAX_LENGTH,4,2   ; @GOODIX_CONFIG_MAX_LENGTH
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error reading config: %d\n"

	.comm	_GOODIX_INT_TRIGGER,4,2         ; @GOODIX_INT_TRIGGER
	.comm	_GOODIX_MAX_CONTACTS,4,2        ; @GOODIX_MAX_CONTACTS
	.comm	_TRIGGER_LOC,8,3                ; @TRIGGER_LOC
	.comm	_MAX_CONTACTS_LOC,8,3           ; @MAX_CONTACTS_LOC
	.comm	_RESOLUTION_LOC,8,3             ; @RESOLUTION_LOC
	.comm	_ABS_MT_POSITION_X,4,2          ; @ABS_MT_POSITION_X
	.comm	_ABS_MT_POSITION_Y,4,2          ; @ABS_MT_POSITION_Y
	.no_dead_strip	_goodix_read_config
.subsections_via_symbols
