	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ts4800_ts_poll
_ts4800_ts_poll:                        ## @ts4800_ts_poll
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rbx
	movq	8(%rdi), %r14
	movq	_X_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%rbx), %rdi
	callq	_readw
	movl	%eax, %r12d
	movq	_Y_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%rbx), %rdi
	callq	_readw
	movl	%eax, %r15d
	movq	_PENDOWN_MASK@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_7
## %bb.1:
	movq	8(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	decq	%rax
	movq	%rax, 8(%rbx)
	jmp	LBB0_3
LBB0_7:
	cmpl	$0, (%rbx)
	je	LBB0_3
## %bb.8:
	movl	$0, (%rbx)
	movq	_DEBOUNCE_COUNT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%rbx)
	movq	_BTN_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_input_report_key
	jmp	LBB0_9
LBB0_3:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	cmpl	$0, (%rbx)
	jne	LBB0_6
## %bb.5:
	movq	_BTN_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_input_report_key
	movl	$1, (%rbx)
LBB0_6:
	sarl	$4, %r12d
	notl	%r12d
	movq	_MAX_12BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%eax, %r12d
	sarl	$4, %r15d
	notl	%r15d
	andl	%eax, %r15d
	movq	_ABS_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r12d, %edx
	callq	_input_report_abs
	movq	_ABS_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_input_report_abs
LBB0_9:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_input_sync                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_X_OFFSET,8,3                   ## @X_OFFSET
	.comm	_Y_OFFSET,8,3                   ## @Y_OFFSET
	.comm	_PENDOWN_MASK,4,2               ## @PENDOWN_MASK
	.comm	_BTN_TOUCH,4,2                  ## @BTN_TOUCH
	.comm	_MAX_12BIT,4,2                  ## @MAX_12BIT
	.comm	_ABS_X,4,2                      ## @ABS_X
	.comm	_ABS_Y,4,2                      ## @ABS_Y
	.comm	_DEBOUNCE_COUNT,8,3             ## @DEBOUNCE_COUNT
	.no_dead_strip	_ts4800_ts_poll
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ts4800_ts_poll
_ts4800_ts_poll:                        ; @ts4800_ts_poll
	.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
	ldp	x22, x19, [x0]
	ldr	x8, [x22, #16]
Lloh0:
	adrp	x9, _X_OFFSET@GOTPAGE
Lloh1:
	ldr	x9, [x9, _X_OFFSET@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readw
	mov	x20, x0
	ldr	x8, [x22, #16]
Lloh3:
	adrp	x9, _Y_OFFSET@GOTPAGE
Lloh4:
	ldr	x9, [x9, _Y_OFFSET@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readw
Lloh6:
	adrp	x8, _PENDOWN_MASK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PENDOWN_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_3
; %bb.1:
	ldr	x8, [x22, #8]
	cbz	x8, LBB0_6
; %bb.2:
	sub	x8, x8, #1
	str	x8, [x22, #8]
	b	LBB0_5
LBB0_3:
	ldr	w8, [x22]
	cbz	w8, LBB0_5
; %bb.4:
Lloh9:
	adrp	x8, _DEBOUNCE_COUNT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DEBOUNCE_COUNT@GOTPAGEOFF]
	str	wzr, [x22]
Lloh11:
	ldr	x8, [x8]
	str	x8, [x22, #8]
Lloh12:
	adrp	x8, _BTN_TOUCH@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BTN_TOUCH@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_input_report_key
	b	LBB0_9
LBB0_5:
	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
LBB0_6:
	mov	x21, x0
	ldr	w8, [x22]
	cbnz	w8, LBB0_8
; %bb.7:
Lloh15:
	adrp	x8, _BTN_TOUCH@GOTPAGE
Lloh16:
	ldr	x8, [x8, _BTN_TOUCH@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	w23, #1
	mov	x0, x19
	mov	w2, #1
	bl	_input_report_key
	str	w23, [x22]
LBB0_8:
Lloh18:
	adrp	x8, _MAX_12BIT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MAX_12BIT@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	bic	w2, w8, w20, asr #4
	bic	w20, w8, w21, asr #4
Lloh21:
	adrp	x8, _ABS_X@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ABS_X@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_input_report_abs
Lloh24:
	adrp	x8, _ABS_Y@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ABS_Y@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_input_report_abs
LBB0_9:
	mov	x0, x19
	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	_input_sync
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_X_OFFSET,8,3                   ; @X_OFFSET
	.comm	_Y_OFFSET,8,3                   ; @Y_OFFSET
	.comm	_PENDOWN_MASK,4,2               ; @PENDOWN_MASK
	.comm	_BTN_TOUCH,4,2                  ; @BTN_TOUCH
	.comm	_MAX_12BIT,4,2                  ; @MAX_12BIT
	.comm	_ABS_X,4,2                      ; @ABS_X
	.comm	_ABS_Y,4,2                      ; @ABS_Y
	.comm	_DEBOUNCE_COUNT,8,3             ; @DEBOUNCE_COUNT
	.no_dead_strip	_ts4800_ts_poll
.subsections_via_symbols
