	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function da9034_event_handler
_da9034_event_handler:                  ## @da9034_event_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	%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
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	_EVENT_TSI_READY@GOTPCREL(%rip), %r15
	movq	_EVENT_PEN_DOWN@GOTPCREL(%rip), %r12
	movq	_EVENT_PEN_UP@GOTPCREL(%rip), %r13
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	(%rcx), %r14d
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %eax
	cmpl	$131, %eax
	jne	LBB0_2
## %bb.8:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%r14d, (%r15)
	jne	LBB0_22
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %rdi
	callq	_read_tsi
	testl	%eax, %eax
	jne	LBB0_7
## %bb.10:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %rdi
	callq	_stop_tsi
	testl	%eax, %eax
	jne	LBB0_7
## %bb.11:                              ##   in Loop: Header=BB0_1 Depth=1
	movl	$129, (%rbx)
	movl	$1, %edi
	callq	_mdelay
	movq	%rbx, %rdi
	callq	_is_pen_down
	movq	%r12, %rcx
	testl	%eax, %eax
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	%r13, %rcx
	jmp	LBB0_13
LBB0_2:
	cmpl	$128, %eax
	je	LBB0_18
## %bb.3:
	cmpl	$129, %eax
	je	LBB0_14
## %bb.4:
	cmpl	$130, %eax
	jne	LBB0_22
## %bb.5:
	movq	_EVENT_PEN_DOWN@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_22
## %bb.6:
	movq	%rbx, %rdi
	callq	_start_tsi
	testl	%eax, %eax
	je	LBB0_21
LBB0_7:
	movl	$130, (%rbx)
	movq	%rbx, %rdi
	callq	_stop_tsi
	movq	%rbx, %rdi
	movl	$1, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_detect_pen_down                ## TAILCALL
LBB0_18:
	movq	_EVENT_TIMEDOUT@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_22
## %bb.19:
	movq	%rbx, %rdi
	callq	_is_pen_down
	testl	%eax, %eax
	je	LBB0_17
## %bb.20:
	movq	%rbx, %rdi
	callq	_start_tsi
LBB0_21:
	movl	$131, (%rbx)
	jmp	LBB0_22
LBB0_14:
	movq	_EVENT_PEN_DOWN@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_16
## %bb.15:
	movq	%rbx, %rdi
	callq	_report_pen_down
	leaq	8(%rbx), %r15
	movl	4(%rbx), %edi
	callq	_msecs_to_jiffies
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_schedule_delayed_work
	movl	$128, (%rbx)
LBB0_16:
	movq	_EVENT_PEN_UP@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_22
LBB0_17:
	movq	%rbx, %rdi
	callq	_report_pen_up
	movl	$130, (%rbx)
LBB0_22:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EVENT_PEN_DOWN,4,2             ## @EVENT_PEN_DOWN
	.comm	_EVENT_TSI_READY,4,2            ## @EVENT_TSI_READY
	.comm	_EVENT_PEN_UP,4,2               ## @EVENT_PEN_UP
	.comm	_EVENT_TIMEDOUT,4,2             ## @EVENT_TIMEDOUT
	.no_dead_strip	_da9034_event_handler
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function da9034_event_handler
_da9034_event_handler:                  ; @da9034_event_handler
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x23, _EVENT_TSI_READY@GOTPAGE
Lloh1:
	ldr	x23, [x23, _EVENT_TSI_READY@GOTPAGEOFF]
	mov	w24, #129
Lloh2:
	adrp	x21, _EVENT_PEN_DOWN@GOTPAGE
Lloh3:
	ldr	x21, [x21, _EVENT_PEN_DOWN@GOTPAGEOFF]
Lloh4:
	adrp	x22, _EVENT_PEN_UP@GOTPAGE
Lloh5:
	ldr	x22, [x22, _EVENT_PEN_UP@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x19]
	cmp	w8, #131
	b.ne	LBB0_6
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [x23]
	cmp	w8, w20
	b.ne	LBB0_21
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x19
	bl	_read_tsi
	cbnz	w0, LBB0_11
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x19
	bl	_stop_tsi
	cbnz	w0, LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_1 Depth=1
	str	w24, [x19]
	mov	w0, #1
	bl	_mdelay
	mov	x0, x19
	bl	_is_pen_down
	cmp	w0, #0
	csel	x8, x22, x21, eq
	ldr	w20, [x8]
	b	LBB0_1
LBB0_6:
	cmp	w8, #128
	b.eq	LBB0_12
; %bb.7:
	cmp	w8, #129
	b.eq	LBB0_16
; %bb.8:
	cmp	w8, #130
	b.ne	LBB0_21
; %bb.9:
	ldr	w8, [x21]
	cmp	w8, w20
	b.ne	LBB0_21
; %bb.10:
	mov	x0, x19
	bl	_start_tsi
	cbz	w0, LBB0_15
LBB0_11:
	mov	w8, #130
	str	w8, [x19]
	mov	x0, x19
	bl	_stop_tsi
	mov	x0, x19
	mov	w1, #1
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_detect_pen_down
LBB0_12:
Lloh6:
	adrp	x8, _EVENT_TIMEDOUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EVENT_TIMEDOUT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_21
; %bb.13:
	mov	x0, x19
	bl	_is_pen_down
	cbz	w0, LBB0_19
; %bb.14:
	mov	x0, x19
	bl	_start_tsi
LBB0_15:
	mov	w8, #131
	b	LBB0_20
LBB0_16:
	ldr	w8, [x21]
	cmp	w8, w20
	b.ne	LBB0_18
; %bb.17:
	mov	x0, x19
	bl	_report_pen_down
	add	x21, x19, #8
	ldr	w0, [x19, #4]
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x21
	bl	_schedule_delayed_work
	mov	w8, #128
	str	w8, [x19]
LBB0_18:
	ldr	w8, [x22]
	cmp	w8, w20
	b.ne	LBB0_21
LBB0_19:
	mov	x0, x19
	bl	_report_pen_up
	mov	w8, #130
LBB0_20:
	str	w8, [x19]
LBB0_21:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EVENT_PEN_DOWN,4,2             ; @EVENT_PEN_DOWN
	.comm	_EVENT_TSI_READY,4,2            ; @EVENT_TSI_READY
	.comm	_EVENT_PEN_UP,4,2               ; @EVENT_PEN_UP
	.comm	_EVENT_TIMEDOUT,4,2             ; @EVENT_TIMEDOUT
	.no_dead_strip	_da9034_event_handler
.subsections_via_symbols
