	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ad714x_touchpad_state_machine
_ad714x_touchpad_state_machine:         ## @ad714x_touchpad_state_machine
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r13
	movq	16(%rdi), %rax
	movq	(%rax), %r8
	movslq	%esi, %rcx
	movq	8(%rdi), %rdx
	movq	(%rdx), %r15
	leaq	(%rcx,%rcx,2), %r12
	movq	%rcx, %rsi
	shlq	$4, %rsi
	movb	(%r8,%rsi), %cl
	incb	%cl
	movl	$1, %edi
	shll	%cl, %edi
	movb	4(%r8,%rsi), %cl
	movl	$1, %ebx
	movl	$-1, %edx
	movl	$-1, %eax
	shll	%cl, %eax
	movb	8(%r8,%rsi), %cl
	incb	%cl
	shll	%cl, %ebx
	movb	12(%r8,%rsi), %cl
	shll	%cl, %edx
	addl	%edi, %eax
	addl	%eax, %edx
	addl	%ebx, %edx
	movzwl	2(%r13), %ecx
	andw	%dx, %cx
	leaq	(%r15,%r12,8), %rbx
	movl	(%r15,%r12,8), %esi
	cmpl	$128, %esi
	je	LBB0_5
## %bb.1:
	movzwl	(%r13), %eax
	cmpl	$130, %esi
	je	LBB0_10
## %bb.2:
	cmpl	$129, %esi
	jne	LBB0_9
## %bb.3:
	testw	%dx, %ax
	je	LBB0_9
## %bb.4:
	movl	$128, (%rbx)
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_touchpad_use_com_int
	movl	4(%r13), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_dbg                        ## TAILCALL
LBB0_5:
	cmpw	%dx, %cx
	jne	LBB0_9
## %bb.6:
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_touchpad_cal_sensor_val
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_touchpad_cal_highest_stage
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_touchpad_check_second_peak
	testl	%eax, %eax
	jne	LBB0_9
## %bb.7:
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_touchpad_check_endpoint
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:
	movl	4(%r13), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edx
	callq	_dev_dbg
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_touchpad_cal_abs_pos
	movq	16(%r15,%r12,8), %rax
	movq	%rax, 8(%r15,%r12,8)
	movl	$130, (%rbx)
	jmp	LBB0_9
LBB0_10:
	cmpw	%dx, %cx
	jne	LBB0_9
## %bb.11:
	movq	%r13, %rdi
	movl	%r14d, %esi
	testw	%dx, %ax
	je	LBB0_15
## %bb.12:
	callq	_touchpad_cal_sensor_val
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_touchpad_cal_highest_stage
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_touchpad_check_second_peak
	testl	%eax, %eax
	jne	LBB0_16
## %bb.13:
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_touchpad_check_endpoint
	testl	%eax, %eax
	jne	LBB0_16
## %bb.14:
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_touchpad_cal_abs_pos
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_touchpad_cal_flt_pos
	movq	_ABS_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r15,%r12,8), %edi
	movl	12(%r15,%r12,8), %edx
	callq	_input_report_abs
	movq	_ABS_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r15,%r12,8), %edi
	movl	8(%r15,%r12,8), %edx
	callq	_input_report_abs
	movl	4(%r15,%r12,8), %edi
	movq	_BTN_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	callq	_input_report_key
	jmp	LBB0_16
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	_touchpad_use_thr_int
	movl	$129, (%rbx)
	movl	4(%r15,%r12,8), %edi
	movq	_BTN_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_input_report_key
	movl	4(%r13), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%r14d, %edx
	callq	_dev_dbg
LBB0_16:
	movl	4(%r15,%r12,8), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_input_sync                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"touchpad %d touched\n"

L_.str.1:                               ## @.str.1
	.asciz	"touchpad%d, 2 fingers or endpoint\n"

	.comm	_ABS_X,4,2                      ## @ABS_X
	.comm	_ABS_Y,4,2                      ## @ABS_Y
	.comm	_BTN_TOUCH,4,2                  ## @BTN_TOUCH
L_.str.2:                               ## @.str.2
	.asciz	"touchpad %d released\n"

	.no_dead_strip	_ad714x_touchpad_state_machine
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ad714x_touchpad_state_machine
_ad714x_touchpad_state_machine:         ; @ad714x_touchpad_state_machine
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	mov	x20, x0
	ldp	x9, x8, [x0, #8]
	ldr	x8, [x8]
	sxtw	x21, w19
	ldr	x22, [x9]
	add	x8, x8, w1, sxtw #4
	ldp	w9, w10, [x8]
	add	w9, w9, #1
	mov	w11, #1
	lsl	w9, w11, w9
	mov	w12, #-1
	lsl	w10, w12, w10
	ldp	w13, w8, [x8, #8]
	add	w13, w13, #1
	lsl	w11, w11, w13
	lsl	w8, w12, w8
	add	w9, w9, w10
	add	w8, w9, w8
	ldrh	w9, [x0, #2]
	add	w10, w8, w11
	and	w9, w9, w10
	and	w8, w10, #0xffff
	and	w9, w9, #0xffff
	mov	w11, #24
	smaddl	x23, w1, w11, x22
	ldr	w11, [x23]
	cmp	w11, #128
	b.eq	LBB0_4
; %bb.1:
	ldrh	w12, [x20]
	and	w10, w12, w10
	and	w10, w10, #0xffff
	cmp	w11, #130
	b.eq	LBB0_8
; %bb.2:
	cmp	w11, #129
	ccmp	w10, #0, #4, eq
	b.eq	LBB0_13
; %bb.3:
	mov	w8, #128
	str	w8, [x23]
	mov	x0, x20
	mov	x1, x19
	bl	_touchpad_use_com_int
	ldr	w0, [x20, #4]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_dev_dbg
LBB0_4:
	cmp	w9, w8
	b.ne	LBB0_13
; %bb.5:
	mov	x0, x20
	mov	x1, x19
	bl	_touchpad_cal_sensor_val
	mov	x0, x20
	mov	x1, x19
	bl	_touchpad_cal_highest_stage
	mov	x0, x20
	mov	x1, x19
	bl	_touchpad_check_second_peak
	cbnz	w0, LBB0_13
; %bb.6:
	mov	x0, x20
	mov	x1, x19
	bl	_touchpad_check_endpoint
	cbnz	w0, LBB0_13
; %bb.7:
	ldr	w0, [x20, #4]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x19
	bl	_dev_dbg
	mov	x0, x20
	mov	x1, x19
	bl	_touchpad_cal_abs_pos
	mov	w8, #24
	madd	x8, x21, x8, x22
	ldr	d0, [x8, #16]
	str	d0, [x8, #8]
	mov	w8, #130
	str	w8, [x23]
	b	LBB0_13
LBB0_8:
	cmp	w9, w8
	b.ne	LBB0_13
; %bb.9:
	mov	x0, x20
	mov	x1, x19
	cbz	w10, LBB0_14
; %bb.10:
	bl	_touchpad_cal_sensor_val
	mov	x0, x20
	mov	x1, x19
	bl	_touchpad_cal_highest_stage
	mov	x0, x20
	mov	x1, x19
	bl	_touchpad_check_second_peak
	cbnz	w0, LBB0_15
; %bb.11:
	mov	x0, x20
	mov	x1, x19
	bl	_touchpad_check_endpoint
	cbnz	w0, LBB0_15
; %bb.12:
	mov	x0, x20
	mov	x1, x19
	bl	_touchpad_cal_abs_pos
	mov	x0, x20
	mov	x1, x19
	bl	_touchpad_cal_flt_pos
	mov	w8, #24
	madd	x19, x21, x8, x22
	ldr	w0, [x19, #4]
Lloh4:
	adrp	x8, _ABS_X@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ABS_X@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	ldr	w2, [x19, #12]
	bl	_input_report_abs
Lloh7:
	adrp	x8, _ABS_Y@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ABS_Y@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	ldp	w0, w2, [x19, #4]
	bl	_input_report_abs
	ldr	w0, [x19, #4]
Lloh10:
	adrp	x8, _BTN_TOUCH@GOTPAGE
Lloh11:
	ldr	x8, [x8, _BTN_TOUCH@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	w2, #1
	bl	_input_report_key
	b	LBB0_15
LBB0_13:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_14:
	bl	_touchpad_use_thr_int
	mov	w8, #129
	str	w8, [x23]
	mov	w8, #24
	madd	x8, x21, x8, x22
	ldr	w0, [x8, #4]
Lloh13:
	adrp	x8, _BTN_TOUCH@GOTPAGE
Lloh14:
	ldr	x8, [x8, _BTN_TOUCH@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_input_report_key
	ldr	w0, [x20, #4]
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x19
	bl	_dev_dbg
LBB0_15:
	mov	w8, #24
	madd	x8, x21, x8, x22
	ldr	w0, [x8, #4]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_input_sync
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"touchpad %d touched\n"

l_.str.1:                               ; @.str.1
	.asciz	"touchpad%d, 2 fingers or endpoint\n"

	.comm	_ABS_X,4,2                      ; @ABS_X
	.comm	_ABS_Y,4,2                      ; @ABS_Y
	.comm	_BTN_TOUCH,4,2                  ; @BTN_TOUCH
l_.str.2:                               ; @.str.2
	.asciz	"touchpad %d released\n"

	.no_dead_strip	_ad714x_touchpad_state_machine
.subsections_via_symbols
