	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ad714x_wheel_state_machine
_ad714x_wheel_state_machine:            ## @ad714x_wheel_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, %r15
	movq	16(%rdi), %rax
	movq	(%rax), %rax
	movslq	%esi, %rbx
	movq	8(%rdi), %rsi
	movb	(%rax,%rbx,8), %cl
	movb	4(%rax,%rbx,8), %al
	incb	%cl
	movl	$1, %edi
	shll	%cl, %edi
	movl	$-1, %edx
	movl	%eax, %ecx
	shll	%cl, %edx
	movq	(%rsi), %r12
	addl	%edi, %edx
	movzwl	2(%r15), %eax
	andw	%dx, %ax
	shlq	$4, %rbx
	leaq	(%r12,%rbx), %r13
	movl	(%r12,%rbx), %esi
	cmpl	$128, %esi
	je	LBB0_5
## %bb.1:
	movzwl	(%r15), %ecx
	cmpl	$130, %esi
	je	LBB0_8
## %bb.2:
	cmpl	$129, %esi
	jne	LBB0_7
## %bb.3:
	testw	%dx, %cx
	je	LBB0_7
## %bb.4:
	movl	$128, (%r13)
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_ad714x_wheel_use_com_int
	movl	4(%r15), %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, %ax
	jne	LBB0_7
## %bb.6:
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_ad714x_wheel_cal_sensor_val
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_ad714x_wheel_cal_highest_stage
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_ad714x_wheel_cal_abs_pos
	movl	12(%r12,%rbx), %eax
	movl	%eax, 8(%r12,%rbx)
	movl	$130, (%r13)
	jmp	LBB0_7
LBB0_8:
	cmpw	%dx, %ax
	jne	LBB0_7
## %bb.9:
	movq	%r15, %rdi
	movl	%r14d, %esi
	testw	%dx, %cx
	je	LBB0_11
## %bb.10:
	callq	_ad714x_wheel_cal_sensor_val
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_ad714x_wheel_cal_highest_stage
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_ad714x_wheel_cal_abs_pos
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_ad714x_wheel_cal_flt_pos
	movq	_ABS_WHEEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r12,%rbx), %edi
	movl	8(%r12,%rbx), %edx
	callq	_input_report_abs
	movl	4(%r12,%rbx), %edi
	movq	_BTN_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	callq	_input_report_key
	jmp	LBB0_12
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	_ad714x_wheel_use_thr_int
	movl	$129, (%r13)
	movl	4(%r12,%rbx), %edi
	movq	_BTN_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_input_report_key
	movl	4(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edx
	callq	_dev_dbg
LBB0_12:
	movl	4(%r12,%rbx), %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	"wheel %d touched\n"

	.comm	_ABS_WHEEL,4,2                  ## @ABS_WHEEL
	.comm	_BTN_TOUCH,4,2                  ## @BTN_TOUCH
L_.str.1:                               ## @.str.1
	.asciz	"wheel %d released\n"

	.no_dead_strip	_ad714x_wheel_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_wheel_state_machine
_ad714x_wheel_state_machine:            ; @ad714x_wheel_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 #3
	ldp	w9, w8, [x8]
	add	w9, w9, #1
	mov	w10, #1
	lsl	w9, w10, w9
	mov	w10, #-1
	lsl	w8, w10, w8
	ldrh	w11, [x0, #2]
	add	w10, w9, w8
	and	w9, w11, w10
	and	w8, w10, #0xffff
	and	w9, w9, #0xffff
	add	x23, x22, w1, sxtw #4
	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_6
; %bb.2:
	cmp	w11, #129
	ccmp	w10, #0, #4, eq
	b.eq	LBB0_9
; %bb.3:
	mov	w8, #128
	str	w8, [x23]
	mov	x0, x20
	mov	x1, x19
	bl	_ad714x_wheel_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_9
; %bb.5:
	mov	x0, x20
	mov	x1, x19
	bl	_ad714x_wheel_cal_sensor_val
	mov	x0, x20
	mov	x1, x19
	bl	_ad714x_wheel_cal_highest_stage
	mov	x0, x20
	mov	x1, x19
	bl	_ad714x_wheel_cal_abs_pos
	add	x8, x22, x21, lsl #4
	ldr	w9, [x8, #12]
	str	w9, [x8, #8]
	mov	w8, #130
	str	w8, [x23]
	b	LBB0_9
LBB0_6:
	cmp	w9, w8
	b.ne	LBB0_9
; %bb.7:
	mov	x0, x20
	mov	x1, x19
	cbz	w10, LBB0_10
; %bb.8:
	bl	_ad714x_wheel_cal_sensor_val
	mov	x0, x20
	mov	x1, x19
	bl	_ad714x_wheel_cal_highest_stage
	mov	x0, x20
	mov	x1, x19
	bl	_ad714x_wheel_cal_abs_pos
	mov	x0, x20
	mov	x1, x19
	bl	_ad714x_wheel_cal_flt_pos
	add	x19, x22, x21, lsl #4
Lloh2:
	adrp	x8, _ABS_WHEEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ABS_WHEEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	ldp	w0, w2, [x19, #4]
	bl	_input_report_abs
	ldr	w0, [x19, #4]
Lloh5:
	adrp	x8, _BTN_TOUCH@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BTN_TOUCH@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	w2, #1
	bl	_input_report_key
	b	LBB0_11
LBB0_9:
	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_10:
	bl	_ad714x_wheel_use_thr_int
	mov	w8, #129
	str	w8, [x23]
	add	x8, x22, x21, lsl #4
	ldr	w0, [x8, #4]
Lloh8:
	adrp	x8, _BTN_TOUCH@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BTN_TOUCH@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_input_report_key
	ldr	w0, [x20, #4]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x19
	bl	_dev_dbg
LBB0_11:
	add	x8, x22, x21, lsl #4
	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 AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wheel %d touched\n"

	.comm	_ABS_WHEEL,4,2                  ; @ABS_WHEEL
	.comm	_BTN_TOUCH,4,2                  ; @BTN_TOUCH
l_.str.1:                               ; @.str.1
	.asciz	"wheel %d released\n"

	.no_dead_strip	_ad714x_wheel_state_machine
.subsections_via_symbols
