	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ad714x_button_state_machine
_ad714x_button_state_machine:           ## @ad714x_button_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
	movq	16(%rdi), %rcx
	movq	24(%rdi), %rax
	movq	(%rax), %r12
	movslq	%esi, %rbx
	leaq	(%rbx,%rbx,2), %r13
	leaq	(%r12,%r13,4), %rax
	movq	(%rcx), %r15
	movl	(%r15,%rbx,8), %ecx
	cmpl	$129, %ecx
	je	LBB0_5
## %bb.1:
	cmpl	$128, %ecx
	jne	LBB0_8
## %bb.2:
	movl	(%rdi), %ecx
	notl	%ecx
	testl	%ecx, (%rax)
	jne	LBB0_8
## %bb.3:
	movl	4(%rdi), %eax
	notl	%eax
	testl	%eax, 4(%r12,%r13,4)
	jne	LBB0_8
## %bb.4:
	movl	$129, %edx
	movl	$1, %r14d
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_7
LBB0_5:
	movl	(%rdi), %ecx
	notl	%ecx
	movl	$128, %edx
	xorl	%r14d, %r14d
	leaq	L_.str.1(%rip), %rsi
	testl	%ecx, (%rax)
	jne	LBB0_7
## %bb.6:
	movl	4(%rdi), %eax
	notl	%eax
	testl	%eax, 4(%r12,%r13,4)
	je	LBB0_8
LBB0_7:
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	8(%rdi), %edi
	movl	%ebx, %edx
	callq	_dev_dbg
	movl	4(%r15,%rbx,8), %edi
	movl	8(%r12,%r13,4), %esi
	movl	%r14d, %edx
	callq	_input_report_key
	movl	4(%r15,%rbx,8), %edi
	callq	_input_sync
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r15,%rbx,8)
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"button %d touched\n"

L_.str.1:                               ## @.str.1
	.asciz	"button %d released\n"

	.no_dead_strip	_ad714x_button_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_button_state_machine
_ad714x_button_state_machine:           ; @ad714x_button_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	x2, x1
	ldp	x9, x8, [x0, #16]
	ldr	x21, [x8]
	sxtw	x22, w2
	mov	w8, #12
	smaddl	x8, w1, w8, x21
	ldr	x23, [x9]
	add	x20, x23, w1, sxtw #3
	ldr	w9, [x20]
	cmp	w9, #129
	b.eq	LBB0_5
; %bb.1:
	cmp	w9, #128
	b.ne	LBB0_9
; %bb.2:
	ldr	w9, [x0]
	ldr	w8, [x8]
	bics	wzr, w8, w9
	b.ne	LBB0_9
; %bb.3:
	ldr	w8, [x0, #4]
	mov	w9, #12
	madd	x9, x22, x9, x21
	ldr	w9, [x9, #4]
	bics	wzr, w9, w8
	b.ne	LBB0_9
; %bb.4:
	mov	w24, #129
	mov	w19, #1
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_8
LBB0_5:
	ldr	w9, [x0]
	ldr	w8, [x8]
	bics	wzr, w8, w9
	b.ne	LBB0_7
; %bb.6:
	ldr	w8, [x0, #4]
	mov	w9, #12
	madd	x9, x22, x9, x21
	ldr	w9, [x9, #4]
	bics	wzr, w9, w8
	b.eq	LBB0_9
LBB0_7:
	mov	w19, #0
	mov	w24, #128
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_8:
	ldr	w0, [x0, #8]
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_dev_dbg
	add	x23, x23, x22, lsl #3
	ldr	w0, [x23, #4]
	mov	w8, #12
	madd	x8, x22, x8, x21
	ldr	w1, [x8, #8]
	mov	x2, x19
	bl	_input_report_key
	ldr	w0, [x23, #4]
	bl	_input_sync
	str	w24, [x20]
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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"button %d touched\n"

l_.str.1:                               ; @.str.1
	.asciz	"button %d released\n"

	.no_dead_strip	_ad714x_button_state_machine
.subsections_via_symbols
