	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tc3589x_keypad_irq
_tc3589x_keypad_irq:                    ## @tc3589x_keypad_irq
	.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	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	16(%rsi), %r15
	movq	_TC35893_DATA_REGS@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jle	LBB0_6
## %bb.1:
	xorl	%r13d, %r13d
	movq	_TC3589x_EVTCODE_FIFO@GOTPCREL(%rip), %r14
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	incl	%r13d
	movl	(%r12), %eax
	addl	%eax, %eax
	cmpl	%eax, %r13d
	jge	LBB0_6
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %esi
	movq	%r15, %rdi
	callq	_tc3589x_reg_read
	movl	%eax, %ebx
	movq	_TC35893_KEYCODE_FIFO_EMPTY@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_TC35893_KEYCODE_FIFO_CLEAR@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_KP_EVCODE_COL_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	andl	%ebx, %esi
	movq	_KP_EVCODE_ROW_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	andl	%ebx, %edi
	movq	_KP_ROW_SHIFT@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	sarl	%cl, %edi
	movq	_TC35893_KEYPAD_ROW_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_MATRIX_SCAN_CODE
	movq	_KP_RELEASE_EVT_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %ebx
	movl	%eax, %r12d
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movl	(%r14), %edi
	movq	_EV_MSC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MSC_SCAN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r12d, %ecx
	callq	_input_event
	movl	(%r14), %edi
	movq	8(%r14), %rax
	movslq	%r12d, %rcx
	movq	_TC35893_DATA_REGS@GOTPCREL(%rip), %r12
	movl	(%rax,%rcx,4), %esi
	xorl	%edx, %edx
	testl	%ebx, %ebx
	sete	%dl
	callq	_input_report_key
	movl	(%r14), %edi
	movq	_TC3589x_EVTCODE_FIFO@GOTPCREL(%rip), %r14
	callq	_input_sync
	jmp	LBB0_5
LBB0_6:
	movq	_TC3589x_KBDIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TC3589x_EVT_INT_CLR@GOTPCREL(%rip), %rax
	movq	_TC3589x_KBD_INT_CLR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_tc3589x_set_bits
	movq	_TC3589x_KBDMSK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TC3589x_EVT_LOSS_INT@GOTPCREL(%rip), %rax
	movq	_TC3589x_EVT_INT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_tc3589x_set_bits
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TC35893_DATA_REGS,4,2          ## @TC35893_DATA_REGS
	.comm	_TC3589x_EVTCODE_FIFO,4,2       ## @TC3589x_EVTCODE_FIFO
	.comm	_TC35893_KEYCODE_FIFO_EMPTY,4,2 ## @TC35893_KEYCODE_FIFO_EMPTY
	.comm	_TC35893_KEYCODE_FIFO_CLEAR,4,2 ## @TC35893_KEYCODE_FIFO_CLEAR
	.comm	_KP_EVCODE_COL_MASK,4,2         ## @KP_EVCODE_COL_MASK
	.comm	_KP_EVCODE_ROW_MASK,4,2         ## @KP_EVCODE_ROW_MASK
	.comm	_KP_ROW_SHIFT,4,2               ## @KP_ROW_SHIFT
	.comm	_TC35893_KEYPAD_ROW_SHIFT,4,2   ## @TC35893_KEYPAD_ROW_SHIFT
	.comm	_KP_RELEASE_EVT_MASK,4,2        ## @KP_RELEASE_EVT_MASK
	.comm	_EV_MSC,4,2                     ## @EV_MSC
	.comm	_MSC_SCAN,4,2                   ## @MSC_SCAN
	.comm	_TC3589x_KBDIC,4,2              ## @TC3589x_KBDIC
	.comm	_TC3589x_EVT_INT_CLR,4,2        ## @TC3589x_EVT_INT_CLR
	.comm	_TC3589x_KBD_INT_CLR,4,2        ## @TC3589x_KBD_INT_CLR
	.comm	_TC3589x_KBDMSK,4,2             ## @TC3589x_KBDMSK
	.comm	_TC3589x_EVT_LOSS_INT,4,2       ## @TC3589x_EVT_LOSS_INT
	.comm	_TC3589x_EVT_INT,4,2            ## @TC3589x_EVT_INT
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_tc3589x_keypad_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tc3589x_keypad_irq
_tc3589x_keypad_irq:                    ; @tc3589x_keypad_irq
	.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
	ldr	x19, [x1, #16]
Lloh0:
	adrp	x23, _TC35893_DATA_REGS@GOTPAGE
Lloh1:
	ldr	x23, [x23, _TC35893_DATA_REGS@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.1:
	mov	x20, x1
	mov	w24, #0
Lloh2:
	adrp	x25, _TC3589x_EVTCODE_FIFO@GOTPAGE
Lloh3:
	ldr	x25, [x25, _TC3589x_EVTCODE_FIFO@GOTPAGEOFF]
Lloh4:
	adrp	x26, _TC35893_KEYCODE_FIFO_EMPTY@GOTPAGE
Lloh5:
	ldr	x26, [x26, _TC35893_KEYCODE_FIFO_EMPTY@GOTPAGEOFF]
Lloh6:
	adrp	x27, _TC35893_KEYCODE_FIFO_CLEAR@GOTPAGE
Lloh7:
	ldr	x27, [x27, _TC35893_KEYCODE_FIFO_CLEAR@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w24, w24, #1
	ldr	w8, [x23]
	cmp	w24, w8, lsl #1
	b.ge	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x25]
	mov	x0, x19
	bl	_tc3589x_reg_read
	ldr	w8, [x26]
	ldr	w9, [x27]
	cmp	w0, w8
	ccmp	w0, w9, #4, ne
	b.eq	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x21, x0
Lloh8:
	adrp	x8, _KP_EVCODE_COL_MASK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _KP_EVCODE_COL_MASK@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	and	w1, w8, w0
Lloh11:
	adrp	x8, _KP_EVCODE_ROW_MASK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _KP_EVCODE_ROW_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh14:
	adrp	x9, _KP_ROW_SHIFT@GOTPAGE
Lloh15:
	ldr	x9, [x9, _KP_ROW_SHIFT@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	asr	w0, w8, w9
Lloh17:
	adrp	x8, _TC35893_KEYPAD_ROW_SHIFT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _TC35893_KEYPAD_ROW_SHIFT@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	bl	_MATRIX_SCAN_CODE
	mov	x22, x0
Lloh20:
	adrp	x8, _KP_RELEASE_EVT_MASK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _KP_RELEASE_EVT_MASK@GOTPAGEOFF]
Lloh22:
	ldr	w28, [x8]
	ldr	w0, [x20]
Lloh23:
	adrp	x8, _EV_MSC@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EV_MSC@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
Lloh26:
	adrp	x8, _MSC_SCAN@GOTPAGE
Lloh27:
	ldr	x8, [x8, _MSC_SCAN@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	mov	x3, x22
	bl	_input_event
	ldr	w0, [x20]
	ldr	x8, [x20, #8]
	ldr	w1, [x8, w22, sxtw #2]
	tst	w28, w21
	cset	w2, eq
	bl	_input_report_key
	ldr	w0, [x20]
	bl	_input_sync
	b	LBB0_2
LBB0_5:
Lloh29:
	adrp	x8, _TC3589x_KBDIC@GOTPAGE
Lloh30:
	ldr	x8, [x8, _TC3589x_KBDIC@GOTPAGEOFF]
Lloh31:
	adrp	x9, _TC3589x_EVT_INT_CLR@GOTPAGE
Lloh32:
	ldr	x9, [x9, _TC3589x_EVT_INT_CLR@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
Lloh34:
	ldr	w8, [x9]
Lloh35:
	adrp	x9, _TC3589x_KBD_INT_CLR@GOTPAGE
Lloh36:
	ldr	x9, [x9, _TC3589x_KBD_INT_CLR@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	x0, x19
	mov	w2, #0
	bl	_tc3589x_set_bits
Lloh38:
	adrp	x8, _TC3589x_KBDMSK@GOTPAGE
Lloh39:
	ldr	x8, [x8, _TC3589x_KBDMSK@GOTPAGEOFF]
Lloh40:
	adrp	x9, _TC3589x_EVT_LOSS_INT@GOTPAGE
Lloh41:
	ldr	x9, [x9, _TC3589x_EVT_LOSS_INT@GOTPAGEOFF]
Lloh42:
	ldr	w1, [x8]
Lloh43:
	ldr	w8, [x9]
Lloh44:
	adrp	x9, _TC3589x_EVT_INT@GOTPAGE
Lloh45:
	ldr	x9, [x9, _TC3589x_EVT_INT@GOTPAGEOFF]
Lloh46:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	x0, x19
	mov	w2, #0
	bl	_tc3589x_set_bits
Lloh47:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh48:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh49:
	ldr	w0, [x8]
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh42
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_TC35893_DATA_REGS,4,2          ; @TC35893_DATA_REGS
	.comm	_TC3589x_EVTCODE_FIFO,4,2       ; @TC3589x_EVTCODE_FIFO
	.comm	_TC35893_KEYCODE_FIFO_EMPTY,4,2 ; @TC35893_KEYCODE_FIFO_EMPTY
	.comm	_TC35893_KEYCODE_FIFO_CLEAR,4,2 ; @TC35893_KEYCODE_FIFO_CLEAR
	.comm	_KP_EVCODE_COL_MASK,4,2         ; @KP_EVCODE_COL_MASK
	.comm	_KP_EVCODE_ROW_MASK,4,2         ; @KP_EVCODE_ROW_MASK
	.comm	_KP_ROW_SHIFT,4,2               ; @KP_ROW_SHIFT
	.comm	_TC35893_KEYPAD_ROW_SHIFT,4,2   ; @TC35893_KEYPAD_ROW_SHIFT
	.comm	_KP_RELEASE_EVT_MASK,4,2        ; @KP_RELEASE_EVT_MASK
	.comm	_EV_MSC,4,2                     ; @EV_MSC
	.comm	_MSC_SCAN,4,2                   ; @MSC_SCAN
	.comm	_TC3589x_KBDIC,4,2              ; @TC3589x_KBDIC
	.comm	_TC3589x_EVT_INT_CLR,4,2        ; @TC3589x_EVT_INT_CLR
	.comm	_TC3589x_KBD_INT_CLR,4,2        ; @TC3589x_KBD_INT_CLR
	.comm	_TC3589x_KBDMSK,4,2             ; @TC3589x_KBDMSK
	.comm	_TC3589x_EVT_LOSS_INT,4,2       ; @TC3589x_EVT_LOSS_INT
	.comm	_TC3589x_EVT_INT,4,2            ; @TC3589x_EVT_INT
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_tc3589x_keypad_irq
.subsections_via_symbols
