	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function imx_keypad_check_for_events
_imx_keypad_check_for_events:           ## @imx_keypad_check_for_events
	.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	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	_check_matrix_timer@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rdi, %rsi
	callq	_from_timer
	movq	%rax, %r14
	movq	_MAX_MATRIX_KEY_COLS@GOTPCREL(%rip), %r12
	movl	(%r12), %r15d
	movq	%r15, %rax
	addq	%r15, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	addl	%r15d, %r15d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	%r15d, %edx
	callq	_memset
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_imx_keypad_scan_matrix
	movl	(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_5
## %bb.1:
	movl	(%r14), %ecx
	xorl	%edx, %edx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rdx
	cmpq	%rdx, %rax
	je	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	btl	%edx, %ecx
	jae	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r14), %rdi
	movzwl	(%rdi,%rdx,2), %esi
	cmpw	(%rbx,%rdx,2), %si
	je	LBB0_4
## %bb.18:
	movq	%rbx, %rsi
	movl	%r15d, %edx
	callq	_memcpy
	movq	$0, 16(%r14)
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_5:
	movq	16(%r14), %rax
	incq	%rax
	movq	%rax, 16(%r14)
LBB0_6:
	movq	_IMX_KEYPAD_SCANS_FOR_STABILITY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_8
## %bb.7:
	addq	$40, %r14
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	$10, %edi
	callq	_msecs_to_jiffies
	addq	%rax, %rbx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_mod_timer
	jmp	LBB0_16
LBB0_8:
	jne	LBB0_10
## %bb.9:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_imx_keypad_fire_events
	movq	24(%r14), %rdi
	movq	%rbx, %rsi
	movl	%r15d, %edx
	callq	_memcpy
LBB0_10:
	movl	(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_19
## %bb.11:
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	cmpw	$0, (%rbx,%rcx,2)
	jne	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_13 Depth=1
	incq	%rcx
	cmpq	%rcx, %rax
	jne	LBB0_13
LBB0_19:
	movq	_KPSR@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	addq	32(%r14), %rdi
	callq	_readw
	movq	_KBD_STAT_KPKD@GOTPCREL(%rip), %rcx
	movq	_KBD_STAT_KDSC@GOTPCREL(%rip), %rdx
	orw	(%rcx), %ax
	orw	(%rdx), %ax
	movq	(%rbx), %rsi
	addq	32(%r14), %rsi
	movzwl	%ax, %edi
	callq	_writew
	movq	(%rbx), %rdi
	addq	32(%r14), %rdi
	callq	_readw
                                        ## kill: def $ax killed $ax def $eax
	movq	_KBD_STAT_KDIE@GOTPCREL(%rip), %rcx
	orw	(%rcx), %ax
	movq	_KBD_STAT_KRIE@GOTPCREL(%rip), %rcx
	jmp	LBB0_15
LBB0_14:
	movq	%r14, %r15
	addq	$40, %r15
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	$60, %edi
	callq	_msecs_to_jiffies
	addq	%rax, %rbx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_mod_timer
	movq	_KPSR@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	addq	32(%r14), %rdi
	callq	_readw
	movq	_KBD_STAT_KPKR@GOTPCREL(%rip), %rcx
	movq	_KBD_STAT_KRSS@GOTPCREL(%rip), %rdx
	orw	(%rcx), %ax
	orw	(%rdx), %ax
	movq	(%rbx), %rsi
	addq	32(%r14), %rsi
	movzwl	%ax, %edi
	callq	_writew
	movq	(%rbx), %rdi
	addq	32(%r14), %rdi
	callq	_readw
                                        ## kill: def $ax killed $ax def $eax
	movq	_KBD_STAT_KRIE@GOTPCREL(%rip), %rcx
	orw	(%rcx), %ax
	movq	_KBD_STAT_KDIE@GOTPCREL(%rip), %rcx
LBB0_15:
	movzwl	(%rcx), %ecx
	notl	%ecx
	andl	%eax, %ecx
	movq	(%rbx), %rsi
	addq	32(%r14), %rsi
	movzwl	%cx, %edi
	callq	_writew
LBB0_16:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_20
## %bb.17:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_check_matrix_timer,4,2         ## @check_matrix_timer
	.comm	_MAX_MATRIX_KEY_COLS,4,2        ## @MAX_MATRIX_KEY_COLS
	.comm	_IMX_KEYPAD_SCANS_FOR_STABILITY,8,3 ## @IMX_KEYPAD_SCANS_FOR_STABILITY
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_KPSR,8,3                       ## @KPSR
	.comm	_KBD_STAT_KPKD,2,1              ## @KBD_STAT_KPKD
	.comm	_KBD_STAT_KDSC,2,1              ## @KBD_STAT_KDSC
	.comm	_KBD_STAT_KDIE,2,1              ## @KBD_STAT_KDIE
	.comm	_KBD_STAT_KRIE,2,1              ## @KBD_STAT_KRIE
	.comm	_KBD_STAT_KPKR,2,1              ## @KBD_STAT_KPKR
	.comm	_KBD_STAT_KRSS,2,1              ## @KBD_STAT_KRSS
	.comm	_keypad,8,3                     ## @keypad
	.no_dead_strip	_imx_keypad_check_for_events
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function imx_keypad_check_for_events
_imx_keypad_check_for_events:           ; @imx_keypad_check_for_events
	.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
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, _check_matrix_timer@GOTPAGE
Lloh4:
	ldr	x8, [x8, _check_matrix_timer@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x1, x0
	bl	_from_timer
	mov	x19, x0
Lloh6:
	adrp	x22, _MAX_MATRIX_KEY_COLS@GOTPAGE
Lloh7:
	ldr	x22, [x22, _MAX_MATRIX_KEY_COLS@GOTPAGEOFF]
	ldr	w12, [x22]
	lsl	x8, x12, #1
	mov	x9, x8
Lloh8:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh9:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x3fffffff0
	sub	x20, x9, x8
	mov	sp, x20
	lsl	w21, w12, #1
	mov	x0, x20
	mov	w1, #0
	mov	x2, x21
	bl	_memset
	mov	x0, x19
	mov	x1, x20
	bl	_imx_keypad_scan_matrix
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x9, #0
	ldr	w10, [x19]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x9, x9, #1
	cmp	x8, x9
	b.eq	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	lsr	w11, w10, w9
	tbz	w11, #0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [x19, #8]
	lsl	x11, x9, #1
	ldrh	w12, [x0, x11]
	ldrh	w11, [x20, x11]
	cmp	w12, w11
	b.eq	LBB0_2
; %bb.5:
	mov	x1, x20
	mov	x2, x21
	bl	_memcpy
	mov	x8, #0
	str	xzr, [x19, #16]
	b	LBB0_7
LBB0_6:
	ldr	x8, [x19, #16]
	add	x8, x8, #1
	str	x8, [x19, #16]
LBB0_7:
Lloh10:
	adrp	x9, _IMX_KEYPAD_SCANS_FOR_STABILITY@GOTPAGE
Lloh11:
	ldr	x9, [x9, _IMX_KEYPAD_SCANS_FOR_STABILITY@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_9
; %bb.8:
	add	x19, x19, #40
Lloh13:
	adrp	x8, _jiffies@GOTPAGE
Lloh14:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh15:
	ldr	x20, [x8]
	mov	w0, #10
	bl	_msecs_to_jiffies
	add	x1, x0, x20
	mov	x0, x19
	bl	_mod_timer
	b	LBB0_17
LBB0_9:
	b.ne	LBB0_11
; %bb.10:
	mov	x0, x19
	mov	x1, x20
	bl	_imx_keypad_fire_events
	ldr	x0, [x19, #24]
	mov	x1, x20
	mov	x2, x21
	bl	_memcpy
LBB0_11:
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_14
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldrh	w9, [x20]
	cbnz	w9, LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	add	x20, x20, #2
	subs	x8, x8, #1
	b.ne	LBB0_12
LBB0_14:
	ldr	x8, [x19, #32]
Lloh16:
	adrp	x20, _KPSR@GOTPAGE
Lloh17:
	ldr	x20, [x20, _KPSR@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readw
Lloh18:
	adrp	x8, _KBD_STAT_KPKD@GOTPAGE
Lloh19:
	ldr	x8, [x8, _KBD_STAT_KPKD@GOTPAGEOFF]
	ldrh	w8, [x8]
Lloh20:
	adrp	x9, _KBD_STAT_KDSC@GOTPAGE
Lloh21:
	ldr	x9, [x9, _KBD_STAT_KDSC@GOTPAGEOFF]
	ldrh	w9, [x9]
	orr	w8, w8, w0
	orr	w0, w8, w9
	ldr	x8, [x19, #32]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_writew
	ldr	x8, [x19, #32]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readw
Lloh22:
	adrp	x8, _KBD_STAT_KDIE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _KBD_STAT_KDIE@GOTPAGEOFF]
	ldrh	w8, [x8]
	orr	w8, w8, w0
Lloh24:
	adrp	x9, _KBD_STAT_KRIE@GOTPAGE
Lloh25:
	ldr	x9, [x9, _KBD_STAT_KRIE@GOTPAGEOFF]
	b	LBB0_16
LBB0_15:
	add	x20, x19, #40
Lloh26:
	adrp	x8, _jiffies@GOTPAGE
Lloh27:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh28:
	ldr	x21, [x8]
	mov	w0, #60
	bl	_msecs_to_jiffies
	add	x1, x0, x21
	mov	x0, x20
	bl	_mod_timer
	ldr	x8, [x19, #32]
Lloh29:
	adrp	x20, _KPSR@GOTPAGE
Lloh30:
	ldr	x20, [x20, _KPSR@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readw
Lloh31:
	adrp	x8, _KBD_STAT_KPKR@GOTPAGE
Lloh32:
	ldr	x8, [x8, _KBD_STAT_KPKR@GOTPAGEOFF]
	ldrh	w8, [x8]
Lloh33:
	adrp	x9, _KBD_STAT_KRSS@GOTPAGE
Lloh34:
	ldr	x9, [x9, _KBD_STAT_KRSS@GOTPAGEOFF]
	ldrh	w9, [x9]
	orr	w8, w8, w0
	orr	w0, w8, w9
	ldr	x8, [x19, #32]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_writew
	ldr	x8, [x19, #32]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readw
Lloh35:
	adrp	x8, _KBD_STAT_KRIE@GOTPAGE
Lloh36:
	ldr	x8, [x8, _KBD_STAT_KRIE@GOTPAGEOFF]
	ldrh	w8, [x8]
	orr	w8, w8, w0
Lloh37:
	adrp	x9, _KBD_STAT_KDIE@GOTPAGE
Lloh38:
	ldr	x9, [x9, _KBD_STAT_KDIE@GOTPAGEOFF]
LBB0_16:
	ldrh	w9, [x9]
	eor	w9, w9, #0xffff
	and	w0, w8, w9
	ldr	x8, [x19, #32]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_writew
LBB0_17:
	ldur	x8, [x29, #-40]
Lloh39:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh40:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh41:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_19
; %bb.18:
	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_19:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_check_matrix_timer,4,2         ; @check_matrix_timer
	.comm	_MAX_MATRIX_KEY_COLS,4,2        ; @MAX_MATRIX_KEY_COLS
	.comm	_IMX_KEYPAD_SCANS_FOR_STABILITY,8,3 ; @IMX_KEYPAD_SCANS_FOR_STABILITY
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_KPSR,8,3                       ; @KPSR
	.comm	_KBD_STAT_KPKD,2,1              ; @KBD_STAT_KPKD
	.comm	_KBD_STAT_KDSC,2,1              ; @KBD_STAT_KDSC
	.comm	_KBD_STAT_KDIE,2,1              ; @KBD_STAT_KDIE
	.comm	_KBD_STAT_KRIE,2,1              ; @KBD_STAT_KRIE
	.comm	_KBD_STAT_KPKR,2,1              ; @KBD_STAT_KPKR
	.comm	_KBD_STAT_KRSS,2,1              ; @KBD_STAT_KRSS
	.comm	_keypad,8,3                     ; @keypad
	.no_dead_strip	_imx_keypad_check_for_events
.subsections_via_symbols
