	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pm860x_touch_handler
_pm860x_touch_handler:                  ## @pm860x_touch_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	16(%rsi), %r13
	movq	_MEAS_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movl	8(%r12), %edi
	movq	_MEAS_TSIX_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edx
	movq	%r15, %rcx
	callq	_pm860x_bulk_read
	testl	%eax, %eax
	js	LBB0_9
## %bb.1:
	movzbl	1(%r15), %r14d
	testb	$64, %r14b
	jne	LBB0_2
## %bb.7:
	leaq	4(%r12), %r15
	movl	4(%r12), %edi
	movq	_ABS_PRESSURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_input_report_abs
	movl	4(%r12), %edi
	movq	_BTN_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_input_report_key
	movl	(%r13), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_8
LBB0_2:
	movzbl	(%r15), %eax
	shll	$4, %eax
	andl	$15, %r14d
	orl	%eax, %r14d
	movzbl	2(%r15), %eax
	shll	$4, %eax
	movzbl	3(%r15), %ebx
	andl	$15, %ebx
	orl	%eax, %ebx
	xorl	%ecx, %ecx
	testl	%r14d, %r14d
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_6
## %bb.3:
	movzbl	4(%r15), %eax
	shll	$4, %eax
	movzbl	5(%r15), %r8d
	andl	$15, %r8d
	orl	%eax, %r8d
	testl	%r8d, %r8d
	je	LBB0_6
## %bb.4:
	movl	(%r12), %r13d
	testl	%r13d, %r13d
	je	LBB0_6
## %bb.5:
	movzbl	6(%r15), %eax
	shll	$4, %eax
	movzbl	7(%r15), %r9d
	andl	$15, %r9d
	orl	%eax, %r9d
	movl	%r9d, %eax
	xorl	%edx, %edx
	divl	%r8d
	decl	%eax
	imull	%r14d, %r13d
	imull	%eax, %r13d
	movq	_ACCURATE_BIT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %r13d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r8d, %edx
	movl	%r9d, %ecx
	movl	%r13d, %r8d
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	%r13d, %ecx
LBB0_6:
	leaq	4(%r12), %r15
	movl	4(%r12), %edi
	movq	_ABS_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ecx, %r13d
	movl	%r14d, %edx
	callq	_input_report_abs
	movl	4(%r12), %edi
	movq	_ABS_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edx
	callq	_input_report_abs
	movl	4(%r12), %edi
	movq	_ABS_PRESSURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edx
	callq	_input_report_abs
	movl	4(%r12), %edi
	movq	_BTN_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	callq	_input_report_key
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edx
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_8:
	movl	(%r15), %edi
	callq	_input_sync
LBB0_9:
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_11
## %bb.10:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MEAS_LEN,4,2                   ## @MEAS_LEN
	.comm	_MEAS_TSIX_1,4,2                ## @MEAS_TSIX_1
	.comm	_ACCURATE_BIT,4,2               ## @ACCURATE_BIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"z1:%d, z2:%d, rt:%d\n"

	.comm	_ABS_X,4,2                      ## @ABS_X
	.comm	_ABS_Y,4,2                      ## @ABS_Y
	.comm	_ABS_PRESSURE,4,2               ## @ABS_PRESSURE
	.comm	_BTN_TOUCH,4,2                  ## @BTN_TOUCH
L_.str.1:                               ## @.str.1
	.asciz	"pen down at [%d, %d].\n"

L_.str.2:                               ## @.str.2
	.asciz	"pen release\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pm860x_touch_handler
_pm860x_touch_handler:                  ; @pm860x_touch_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
	sub	sp, sp, #16
	mov	x19, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	ldr	x23, [x1, #16]
Lloh3:
	adrp	x8, _MEAS_LEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MEAS_LEN@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x9, x2
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x2, #15
	and	x9, x9, #0x1fffffff0
	sub	x22, x8, x9
	mov	sp, x22
	ldr	w0, [x1, #8]
Lloh8:
	adrp	x8, _MEAS_TSIX_1@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MEAS_TSIX_1@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
                                        ; kill: def $w2 killed $w2 killed $x2
	mov	x3, x22
	bl	_pm860x_bulk_read
	tbnz	w0, #31, LBB0_9
; %bb.1:
	ldrb	w8, [x22, #1]
	tbnz	w8, #6, LBB0_3
; %bb.2:
	ldr	w0, [x19, #4]!
Lloh11:
	adrp	x8, _ABS_PRESSURE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ABS_PRESSURE@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_input_report_abs
	ldr	w0, [x19]
Lloh14:
	adrp	x8, _BTN_TOUCH@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BTN_TOUCH@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_input_report_key
	ldr	w0, [x23]
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
	b	LBB0_8
LBB0_3:
	ldrb	w9, [x22]
	and	w20, w8, #0xf
	bfi	w20, w9, #4, #8
	ldrb	w8, [x22, #2]
	ldrb	w9, [x22, #3]
	and	w21, w9, #0xf
	bfi	w21, w8, #4, #8
	ldrb	w9, [x22, #4]
	ldrb	w8, [x22, #5]
	and	w8, w8, #0xf
	bfi	w8, w9, #4, #8
	cmp	w20, #0
	ccmp	w8, #0, #4, ne
	b.eq	LBB0_6
; %bb.4:
	ldr	w9, [x19]
	cbz	w9, LBB0_6
; %bb.5:
	ldrb	w10, [x22, #6]
	ldrb	w11, [x22, #7]
	and	w11, w11, #0xf
	bfi	w11, w10, #4, #8
	udiv	w10, w11, w8
	sub	w10, w10, #1
	mul	w9, w9, w20
	mul	w9, w9, w10
Lloh19:
	adrp	x10, _ACCURATE_BIT@GOTPAGE
Lloh20:
	ldr	x10, [x10, _ACCURATE_BIT@GOTPAGEOFF]
Lloh21:
	ldr	w10, [x10]
	asr	w22, w9, w10
	ldr	w0, [x23]
	stp	x8, x11, [sp, #-32]!
	str	x22, [sp, #16]
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	add	sp, sp, #32
	b	LBB0_7
LBB0_6:
	mov	w22, #0
LBB0_7:
	ldr	w0, [x19, #4]!
Lloh24:
	adrp	x8, _ABS_X@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ABS_X@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x2, x20
	bl	_input_report_abs
	ldr	w0, [x19]
Lloh27:
	adrp	x8, _ABS_Y@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ABS_Y@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	x2, x21
	bl	_input_report_abs
	ldr	w0, [x19]
Lloh30:
	adrp	x8, _ABS_PRESSURE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ABS_PRESSURE@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	mov	x2, x22
	bl	_input_report_abs
	ldr	w0, [x19]
Lloh33:
	adrp	x8, _BTN_TOUCH@GOTPAGE
Lloh34:
	ldr	x8, [x8, _BTN_TOUCH@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	mov	w2, #1
	bl	_input_report_key
	ldr	w0, [x23]
	stp	x20, x21, [sp, #-16]!
Lloh36:
	adrp	x1, l_.str.1@PAGE
Lloh37:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	add	sp, sp, #16
LBB0_8:
	ldr	w0, [x19]
	bl	_input_sync
LBB0_9:
Lloh38:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh39:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh40:
	ldr	w0, [x8]
	ldur	x8, [x29, #-56]
Lloh41:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh42:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh43:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	sub	sp, x29, #48
	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_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_MEAS_LEN,4,2                   ; @MEAS_LEN
	.comm	_MEAS_TSIX_1,4,2                ; @MEAS_TSIX_1
	.comm	_ACCURATE_BIT,4,2               ; @ACCURATE_BIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"z1:%d, z2:%d, rt:%d\n"

	.comm	_ABS_X,4,2                      ; @ABS_X
	.comm	_ABS_Y,4,2                      ; @ABS_Y
	.comm	_ABS_PRESSURE,4,2               ; @ABS_PRESSURE
	.comm	_BTN_TOUCH,4,2                  ; @BTN_TOUCH
l_.str.1:                               ; @.str.1
	.asciz	"pen down at [%d, %d].\n"

l_.str.2:                               ; @.str.2
	.asciz	"pen release\n"

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