	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function process_keys
_process_keys:                          ## @process_keys
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_LM8323_FIFO_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leal	1(%rbx), %eax
	shlq	$3, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	movl	(%r14), %r15d
	movq	_LM8323_CMD_READ_FIFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movq	%r13, %rdx
	movl	%ebx, %ecx
	callq	_lm8323_read
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	%r15d, -52(%rbp)                ## 4-byte Spill
	movl	%eax, %eax
	movq	$0, (%r13,%rax,8)
	movq	(%r13), %rbx
	testq	%rbx, %rbx
	je	LBB0_7
## %bb.3:
	addq	$8, %r13
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$1, %r12d
	movl	$0, %eax
	sbbl	%eax, %eax
	orl	$1, %eax
	addl	%eax, (%r14)
	movq	(%r13), %rbx
	addq	$8, %r13
	testq	%rbx, %rbx
	je	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_lm8323_whichkey
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_lm8323_ispress
	movl	%eax, %r12d
	movq	8(%r14), %rax
	movq	32(%r14), %rdi
	movzwl	(%rax,%r15,2), %ebx
	testl	%r12d, %r12d
	leaq	L_.str.2(%rip), %rcx
	leaq	L_.str.3(%rip), %rax
	cmoveq	%rax, %rcx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdx
	callq	_dev_vdbg
	cmpq	$0, 24(%r14)
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	20(%r14), %edi
	movq	_EV_MSC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MSC_SCAN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rcx
	callq	_input_event
	movl	20(%r14), %edi
	movzwl	%bx, %esi
	movl	%r12d, %edx
	callq	_input_report_key
	movl	20(%r14), %edi
	callq	_input_sync
	jmp	LBB0_6
LBB0_7:
	movl	(%r14), %eax
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_8
## %bb.10:
	testl	%eax, %eax
	jne	LBB0_13
## %bb.11:
	movl	16(%r14), %esi
	movq	%r14, %rdi
	jmp	LBB0_12
LBB0_1:
	movq	32(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_13
LBB0_8:
	testl	%eax, %eax
	je	LBB0_13
## %bb.9:
	movq	%r14, %rdi
	xorl	%esi, %esi
LBB0_12:
	callq	_lm8323_set_active_time
LBB0_13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_LM8323_FIFO_LEN,4,2            ## @LM8323_FIFO_LEN
	.comm	_LM8323_CMD_READ_FIFO,4,2       ## @LM8323_CMD_READ_FIFO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed reading fifo \n"

L_.str.1:                               ## @.str.1
	.asciz	"key 0x%02x %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"down"

L_.str.3:                               ## @.str.3
	.asciz	"up"

	.comm	_EV_MSC,4,2                     ## @EV_MSC
	.comm	_MSC_SCAN,4,2                   ## @MSC_SCAN
	.no_dead_strip	_process_keys
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function process_keys
_process_keys:                          ; @process_keys
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	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, #-88]
Lloh3:
	adrp	x8, _LM8323_FIFO_LEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LM8323_FIFO_LEN@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	add	w8, w3, #1
	lsl	x8, x8, #3
	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, #0xffffffff0
	sub	x20, x9, x8
	mov	sp, x20
	ldr	w21, [x0]
Lloh8:
	adrp	x8, _LM8323_CMD_READ_FIFO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _LM8323_CMD_READ_FIFO@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x2, x20
	bl	_lm8323_read
	tbnz	w0, #31, LBB0_9
; %bb.1:
	stur	w21, [x29, #-92]                ; 4-byte Folded Spill
	str	xzr, [x20, w0, uxtw #3]
	ldr	x21, [x20]
	cbz	x21, LBB0_6
; %bb.2:
	add	x25, x20, #8
Lloh11:
	adrp	x26, l_.str.2@PAGE
Lloh12:
	add	x26, x26, l_.str.2@PAGEOFF
Lloh13:
	adrp	x27, l_.str.3@PAGE
Lloh14:
	add	x27, x27, l_.str.3@PAGEOFF
Lloh15:
	adrp	x28, _EV_MSC@GOTPAGE
Lloh16:
	ldr	x28, [x28, _EV_MSC@GOTPAGEOFF]
Lloh17:
	adrp	x24, _MSC_SCAN@GOTPAGE
Lloh18:
	ldr	x24, [x24, _MSC_SCAN@GOTPAGEOFF]
Lloh19:
	adrp	x20, l_.str.1@PAGE
Lloh20:
	add	x20, x20, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x19]
	sub	w9, w8, #1
	cmp	w21, #0
	csinc	w8, w9, w8, eq
	str	w8, [x19]
	ldr	x21, [x25], #8
	cbz	x21, LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_lm8323_whichkey
	mov	x22, x0
	mov	x0, x21
	bl	_lm8323_ispress
	mov	x21, x0
	ldr	x8, [x19, #8]
	ldrh	w23, [x8, x22, lsl #1]
	ldr	x0, [x19, #32]
	cmp	w21, #0
	csel	x3, x27, x26, eq
	mov	x1, x20
	mov	x2, x22
	bl	_dev_vdbg
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x19, #20]
	ldr	w1, [x28]
	ldr	w2, [x24]
	mov	x3, x22
	bl	_input_event
	ldr	w0, [x19, #20]
	mov	x1, x23
	mov	x2, x21
	bl	_input_report_key
	ldr	w0, [x19, #20]
	bl	_input_sync
	b	LBB0_3
LBB0_6:
	ldr	w8, [x19]
	ldur	w9, [x29, #-92]                 ; 4-byte Folded Reload
	cbz	w9, LBB0_10
; %bb.7:
	cbnz	w8, LBB0_13
; %bb.8:
	ldr	w1, [x19, #16]
	mov	x0, x19
	b	LBB0_12
LBB0_9:
	ldr	x0, [x19, #32]
Lloh21:
	adrp	x1, l_.str@PAGE
Lloh22:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_13
LBB0_10:
	cbz	w8, LBB0_13
; %bb.11:
	mov	x0, x19
	mov	w1, #0
LBB0_12:
	bl	_lm8323_set_active_time
LBB0_13:
	ldur	x8, [x29, #-88]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
	sub	sp, x29, #80
	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
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_LM8323_FIFO_LEN,4,2            ; @LM8323_FIFO_LEN
	.comm	_LM8323_CMD_READ_FIFO,4,2       ; @LM8323_CMD_READ_FIFO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed reading fifo \n"

l_.str.1:                               ; @.str.1
	.asciz	"key 0x%02x %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"down"

l_.str.3:                               ; @.str.3
	.asciz	"up"

	.comm	_EV_MSC,4,2                     ; @EV_MSC
	.comm	_MSC_SCAN,4,2                   ; @MSC_SCAN
	.no_dead_strip	_process_keys
.subsections_via_symbols
