	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tca8418_read_keypad
_tca8418_read_keypad:                   ## @tca8418_read_keypad
	.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	%rdi, %r12
	movq	16(%rdi), %r14
	movq	(%r14), %r15
	movq	_REG_KEY_EVENT_A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	leaq	-44(%rbp), %rdx
	callq	_tca8418_read_byte
	testl	%eax, %eax
	js	LBB0_2
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	-44(%rbp), %eax
	testl	%eax, %eax
	jle	LBB0_3
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_KEY_EVENT_VALUE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	andl	%eax, %r13d
	movq	_KEY_EVENT_CODE@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_TCA8418_MAX_COLS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	cltd
	idivl	%esi
	xorl	%ecx, %ecx
	testl	%edx, %edx
	cmovnel	%edx, %esi
	sete	%cl
	subl	%ecx, %eax
	decl	%esi
	movl	(%r12), %edx
	movl	%eax, %edi
	callq	_MATRIX_SCAN_CODE
	movl	%eax, %ebx
	movq	_EV_MSC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MSC_SCAN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	%ebx, %ecx
	callq	_input_event
	movslq	%ebx, %rax
	movzwl	(%r15,%rax,2), %esi
	movq	%r14, %rdi
	movl	%r13d, %edx
	callq	_input_report_key
	movq	_REG_KEY_EVENT_A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	jmp	LBB0_1
LBB0_2:
	movq	8(%r12), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_3:
	movq	%r14, %rdi
	callq	_input_sync
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_KEY_EVENT_A,4,2            ## @REG_KEY_EVENT_A
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unable to read REG_KEY_EVENT_A\n"

	.comm	_KEY_EVENT_VALUE,4,2            ## @KEY_EVENT_VALUE
	.comm	_KEY_EVENT_CODE,4,2             ## @KEY_EVENT_CODE
	.comm	_TCA8418_MAX_COLS,4,2           ## @TCA8418_MAX_COLS
	.comm	_EV_MSC,4,2                     ## @EV_MSC
	.comm	_MSC_SCAN,4,2                   ## @MSC_SCAN
	.no_dead_strip	_tca8418_read_keypad
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tca8418_read_keypad
_tca8418_read_keypad:                   ; @tca8418_read_keypad
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x20, x0
	ldr	x19, [x0, #16]
	ldr	x23, [x19]
Lloh0:
	adrp	x8, _REG_KEY_EVENT_A@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REG_KEY_EVENT_A@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_tca8418_read_byte
	tbnz	w0, #31, LBB0_4
; %bb.1:
Lloh3:
	adrp	x25, _KEY_EVENT_VALUE@GOTPAGE
Lloh4:
	ldr	x25, [x25, _KEY_EVENT_VALUE@GOTPAGEOFF]
Lloh5:
	adrp	x26, _KEY_EVENT_CODE@GOTPAGE
Lloh6:
	ldr	x26, [x26, _KEY_EVENT_CODE@GOTPAGEOFF]
Lloh7:
	adrp	x27, _TCA8418_MAX_COLS@GOTPAGE
Lloh8:
	ldr	x27, [x27, _TCA8418_MAX_COLS@GOTPAGEOFF]
Lloh9:
	adrp	x28, _EV_MSC@GOTPAGE
Lloh10:
	ldr	x28, [x28, _EV_MSC@GOTPAGEOFF]
Lloh11:
	adrp	x24, _MSC_SCAN@GOTPAGE
Lloh12:
	ldr	x24, [x24, _MSC_SCAN@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [sp, #12]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w9, [x25]
	and	w21, w9, w8
	ldr	w9, [x26]
	and	w8, w9, w8
	ldr	w9, [x27]
	sdiv	w10, w8, w9
	msub	w8, w10, w9, w8
	cmp	w8, #0
	csel	w8, w9, w8, eq
	cset	w9, eq
	sub	w0, w10, w9
	sub	w1, w8, #1
	ldr	w2, [x20]
	bl	_MATRIX_SCAN_CODE
	mov	x22, x0
	ldr	w1, [x28]
	ldr	w2, [x24]
	mov	x0, x19
	mov	x3, x22
	bl	_input_event
	ldrh	w1, [x23, w22, sxtw #1]
	mov	x0, x19
	mov	x2, x21
	bl	_input_report_key
Lloh13:
	adrp	x8, _REG_KEY_EVENT_A@GOTPAGE
Lloh14:
	ldr	x8, [x8, _REG_KEY_EVENT_A@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x20
	bl	_tca8418_read_byte
	tbz	w0, #31, LBB0_2
LBB0_4:
	ldr	x0, [x20, #8]
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_5:
	mov	x0, x19
	bl	_input_sync
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_KEY_EVENT_A,4,2            ; @REG_KEY_EVENT_A
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unable to read REG_KEY_EVENT_A\n"

	.comm	_KEY_EVENT_VALUE,4,2            ; @KEY_EVENT_VALUE
	.comm	_KEY_EVENT_CODE,4,2             ; @KEY_EVENT_CODE
	.comm	_TCA8418_MAX_COLS,4,2           ; @TCA8418_MAX_COLS
	.comm	_EV_MSC,4,2                     ; @EV_MSC
	.comm	_MSC_SCAN,4,2                   ; @MSC_SCAN
	.no_dead_strip	_tca8418_read_keypad
.subsections_via_symbols
