	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dm355evm_keys_irq
_dm355evm_keys_irq:                     ## @dm355evm_keys_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, %r15
	movq	_DM355EVM_MSP_INPUT_HIGH@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_dm355evm_msp_read
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_4
## %bb.1:
	movq	_dm355evm_keys@GOTPCREL(%rip), %r14
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	$0, _dm355evm_keys_irq.last_event(%rip)
LBB0_17:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r13), %edi
	callq	_dm355evm_msp_read
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_4
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_12 Depth 2
	movq	_DM355EVM_MSP_INPUT_LOW@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_dm355evm_msp_read
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_3
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	shll	$8, %r12d
	orl	%r12d, %ebx
	cmpl	$57005, %ebx                    ## imm = 0xDEAD
	je	LBB0_6
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	_dm355evm_keys_irq.last_event(%rip), %ebx
	je	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, _dm355evm_keys_irq.last_event(%rip)
	andl	$-2049, %ebx                    ## imm = 0xF7FF
	movq	_KEY_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	(%r14), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_16
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_12:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r14), %rdi
	cmpl	%ebx, (%rdi,%r13,8)
	je	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=2
	incq	%r13
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %r13
	jl	LBB0_12
	jmp	LBB0_15
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	4(%rdi,%r13,8), %r12d
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_DM355EVM_MSP_INPUT_HIGH@GOTPCREL(%rip), %r13
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	4(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edx
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	(%r15), %edi
	movl	%r12d, %esi
	movl	$1, %edx
	callq	_input_report_key
	movl	(%r15), %edi
	callq	_input_sync
	movl	(%r15), %edi
	movl	%r12d, %esi
	xorl	%edx, %edx
	callq	_input_report_key
	movl	(%r15), %edi
	callq	_input_sync
	jmp	LBB0_17
LBB0_4:
	movl	4(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edx
	jmp	LBB0_5
LBB0_3:
	movl	4(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
LBB0_5:
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_6:
	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
.zerofill __DATA,__bss,_dm355evm_keys_irq.last_event,4,2 ## @dm355evm_keys_irq.last_event
	.comm	_DM355EVM_MSP_INPUT_HIGH,4,2    ## @DM355EVM_MSP_INPUT_HIGH
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"input high err %d\n"

	.comm	_DM355EVM_MSP_INPUT_LOW,4,2     ## @DM355EVM_MSP_INPUT_LOW
L_.str.1:                               ## @.str.1
	.asciz	"input low err %d\n"

	.comm	_KEY_UNKNOWN,4,2                ## @KEY_UNKNOWN
	.comm	_dm355evm_keys,8,3              ## @dm355evm_keys
L_.str.2:                               ## @.str.2
	.asciz	"input event 0x%04x--> keycode %d\n"

	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_dm355evm_keys_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dm355evm_keys_irq
_dm355evm_keys_irq:                     ; @dm355evm_keys_irq
	.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	x19, x1
Lloh0:
	adrp	x23, _DM355EVM_MSP_INPUT_HIGH@GOTPAGE
Lloh1:
	ldr	x23, [x23, _DM355EVM_MSP_INPUT_HIGH@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_dm355evm_msp_read
	mov	x21, x0
	tbnz	w0, #31, LBB0_13
; %bb.1:
Lloh2:
	adrp	x24, _DM355EVM_MSP_INPUT_LOW@GOTPAGE
Lloh3:
	ldr	x24, [x24, _DM355EVM_MSP_INPUT_LOW@GOTPAGEOFF]
	mov	w25, #57005
	adrp	x26, _dm355evm_keys_irq.last_event@PAGE
Lloh4:
	adrp	x28, _dm355evm_keys@GOTPAGE
Lloh5:
	ldr	x28, [x28, _dm355evm_keys@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x8, x0, x27
	ldr	w21, [x8, #4]
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x19, #4]
	str	x21, [sp]
Lloh6:
	adrp	x1, l_.str.2@PAGE
Lloh7:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x22
	bl	_dev_dbg
	ldr	w0, [x19]
	mov	x1, x21
	mov	w2, #1
	bl	_input_report_key
	ldr	w0, [x19]
	bl	_input_sync
	ldr	w0, [x19]
	mov	x1, x21
	mov	w2, #0
	bl	_input_report_key
	ldr	w0, [x19]
	bl	_input_sync
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x23]
	bl	_dm355evm_msp_read
	mov	x21, x0
	tbnz	w0, #31, LBB0_13
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
	ldr	w0, [x24]
	bl	_dm355evm_msp_read
	mov	x2, x0
	tbnz	w0, #31, LBB0_14
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	orr	w8, w2, w21, lsl #8
	cmp	w8, w25
	b.eq	LBB0_16
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w9, [x26, _dm355evm_keys_irq.last_event@PAGEOFF]
	cmp	w8, w9
	b.ne	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	str	wzr, [x26, _dm355evm_keys_irq.last_event@PAGEOFF]
	b	LBB0_4
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	str	w8, [x26, _dm355evm_keys_irq.last_event@PAGEOFF]
	and	w22, w8, #0xfffff7ff
Lloh8:
	adrp	x8, _KEY_UNKNOWN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _KEY_UNKNOWN@GOTPAGEOFF]
Lloh10:
	ldr	w21, [x8]
	ldr	x0, [x28]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_3
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x27, #0
	mov	x20, #0
LBB0_11:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x0, [x28]
	ldr	w8, [x0, x27]
	cmp	w8, w22
	b.eq	LBB0_2
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=2
	add	x20, x20, #1
	bl	_ARRAY_SIZE
	add	x27, x27, #8
	cmp	x20, w0, sxtw
	b.lt	LBB0_11
	b	LBB0_3
LBB0_13:
	ldr	w0, [x19, #4]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	b	LBB0_15
LBB0_14:
	ldr	w0, [x19, #4]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_15:
	bl	_dev_dbg
LBB0_16:
Lloh15:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_dm355evm_keys_irq.last_event,4,2 ; @dm355evm_keys_irq.last_event
	.comm	_DM355EVM_MSP_INPUT_HIGH,4,2    ; @DM355EVM_MSP_INPUT_HIGH
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"input high err %d\n"

	.comm	_DM355EVM_MSP_INPUT_LOW,4,2     ; @DM355EVM_MSP_INPUT_LOW
l_.str.1:                               ; @.str.1
	.asciz	"input low err %d\n"

	.comm	_KEY_UNKNOWN,4,2                ; @KEY_UNKNOWN
	.comm	_dm355evm_keys,8,3              ; @dm355evm_keys
l_.str.2:                               ; @.str.2
	.asciz	"input event 0x%04x--> keycode %d\n"

	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_dm355evm_keys_irq
.subsections_via_symbols
