	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tm2_touchkey_irq_handler
_tm2_touchkey_irq_handler:              ## @tm2_touchkey_irq_handler
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	16(%rsi), %rax
	movq	40(%rsi), %rdi
	cmpq	$0, 16(%rax)
	je	LBB0_2
## %bb.1:
	callq	_i2c_smbus_read_byte
	jmp	LBB0_3
LBB0_2:
	movl	8(%rax), %esi
	callq	_i2c_smbus_read_byte_data
LBB0_3:
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movq	_TM2_TOUCHKEY_BIT_KEYCODE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	andl	%r14d, %ecx
	movl	%ecx, %edx
	subl	$1, %edx
	jb	LBB0_7
## %bb.6:
	movl	(%r15), %eax
	cmpl	%eax, %ecx
	jle	LBB0_8
LBB0_7:
	movq	40(%r15), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_warn
	jmp	LBB0_14
LBB0_4:
	movq	40(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	callq	_dev_err
	jmp	LBB0_14
LBB0_8:
	movq	_TM2_TOUCHKEY_BIT_PRESS_EV@GOTPCREL(%rip), %rcx
	testl	%r14d, (%rcx)
	je	LBB0_12
## %bb.9:
	testl	%eax, %eax
	jle	LBB0_13
## %bb.10:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	24(%r15), %edi
	movq	32(%r15), %rax
	movl	(%rax,%rbx,4), %esi
	xorl	%edx, %edx
	callq	_input_report_key
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_11
	jmp	LBB0_13
LBB0_12:
	movl	24(%r15), %edi
	movq	32(%r15), %rax
	movl	%edx, %ecx
	movl	(%rax,%rcx,4), %esi
	movl	$1, %edx
	callq	_input_report_key
LBB0_13:
	movl	24(%r15), %edi
	callq	_input_sync
LBB0_14:
	movq	16(%r15), %rax
	cmpq	$0, (%rax)
	je	LBB0_18
## %bb.15:
	movq	_TM2_TOUCHKEY_BIT_PRESS_EV@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_18
## %bb.16:
	movq	8(%r15), %rsi
	movq	_LED_OFF@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jne	LBB0_18
## %bb.17:
	addq	$8, %r15
	movq	%r15, %rdi
	callq	_tm2_touchkey_led_brightness_set
LBB0_18:
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read i2c data: %d\n"

	.comm	_TM2_TOUCHKEY_BIT_KEYCODE,4,2   ## @TM2_TOUCHKEY_BIT_KEYCODE
L_.str.1:                               ## @.str.1
	.asciz	"invalid keycode index %d\n"

	.comm	_TM2_TOUCHKEY_BIT_PRESS_EV,4,2  ## @TM2_TOUCHKEY_BIT_PRESS_EV
	.comm	_LED_OFF,8,3                    ## @LED_OFF
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_tm2_touchkey_irq_handler
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tm2_touchkey_irq_handler
_tm2_touchkey_irq_handler:              ; @tm2_touchkey_irq_handler
	.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
	mov	x19, x1
	ldr	x8, [x1, #16]
	ldr	x9, [x8, #16]
	ldr	x0, [x1, #40]
	cbz	x9, LBB0_5
; %bb.1:
	bl	_i2c_smbus_read_byte
	mov	x20, x0
	tbnz	w0, #31, LBB0_6
LBB0_2:
Lloh0:
	adrp	x8, _TM2_TOUCHKEY_BIT_KEYCODE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TM2_TOUCHKEY_BIT_KEYCODE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w9, w8, w20
	sub	w2, w9, #1
	cbz	w9, LBB0_4
; %bb.3:
	ldr	w8, [x19]
	cmp	w9, w8
	b.le	LBB0_7
LBB0_4:
	ldr	x0, [x19, #40]
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_warn
	b	LBB0_13
LBB0_5:
	ldr	w1, [x8, #8]
	bl	_i2c_smbus_read_byte_data
	mov	x20, x0
	tbz	w0, #31, LBB0_2
LBB0_6:
	ldr	x0, [x19, #40]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_err
	b	LBB0_13
LBB0_7:
Lloh7:
	adrp	x9, _TM2_TOUCHKEY_BIT_PRESS_EV@GOTPAGE
Lloh8:
	ldr	x9, [x9, _TM2_TOUCHKEY_BIT_PRESS_EV@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w20
	b.eq	LBB0_11
; %bb.8:
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.9:
	mov	x21, #0
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #24]
	ldr	x8, [x19, #32]
	ldr	w1, [x8, x21, lsl #2]
	mov	w2, #0
	bl	_input_report_key
	add	x21, x21, #1
	ldrsw	x8, [x19]
	cmp	x21, x8
	b.lt	LBB0_10
	b	LBB0_12
LBB0_11:
	ldr	w0, [x19, #24]
	ldr	x8, [x19, #32]
	ldr	w1, [x8, w2, uxtw #2]
	mov	w2, #1
	bl	_input_report_key
LBB0_12:
	ldr	w0, [x19, #24]
	bl	_input_sync
LBB0_13:
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_17
; %bb.14:
Lloh10:
	adrp	x8, _TM2_TOUCHKEY_BIT_PRESS_EV@GOTPAGE
Lloh11:
	ldr	x8, [x8, _TM2_TOUCHKEY_BIT_PRESS_EV@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_17
; %bb.15:
	ldr	x1, [x19, #8]!
Lloh13:
	adrp	x8, _LED_OFF@GOTPAGE
Lloh14:
	ldr	x8, [x8, _LED_OFF@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	cmp	x1, x8
	b.ne	LBB0_17
; %bb.16:
	mov	x0, x19
	bl	_tm2_touchkey_led_brightness_set
LBB0_17:
Lloh16:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh17:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read i2c data: %d\n"

	.comm	_TM2_TOUCHKEY_BIT_KEYCODE,4,2   ; @TM2_TOUCHKEY_BIT_KEYCODE
l_.str.1:                               ; @.str.1
	.asciz	"invalid keycode index %d\n"

	.comm	_TM2_TOUCHKEY_BIT_PRESS_EV,4,2  ; @TM2_TOUCHKEY_BIT_PRESS_EV
	.comm	_LED_OFF,8,3                    ; @LED_OFF
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_tm2_touchkey_irq_handler
.subsections_via_symbols
