	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wacom_mt_touch
_wacom_mt_touch:                        ## @wacom_mt_touch
	.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	%rdi, %r14
	movq	(%rdi), %rdx
	movq	24(%rdi), %rax
	movq	%rdx, %rcx
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movzbl	2(%rdx), %esi
	movq	_MTTPC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	setne	%bl
	movq	_MTTPC_B@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	setne	%r15b
	testl	%esi, %esi
	je	LBB0_1
## %bb.2:
	movl	%esi, 8(%r14)
	jmp	LBB0_3
LBB0_1:
	movl	8(%r14), %esi
LBB0_3:
	movq	32(%r14), %r12
	movl	$5, %edi
	callq	_min
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	jle	LBB0_12
## %bb.4:
	andb	%r15b, %bl
	movzbl	%bl, %eax
	leal	-4(,%rax,4), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	xorl	%r15d, %r15d
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	incl	%r15d
	cmpl	%r15d, -44(%rbp)                ## 4-byte Folded Reload
	je	LBB0_12
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	_WACOM_BYTES_PER_MT_PACKET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	-48(%rbp), %eax                 ## 4-byte Folded Reload
	imull	%r15d, %eax
	movslq	%eax, %rbx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	testb	$1, 3(%rax,%rbx)
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	xorl	%r13d, %r13d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	%r14, %rdi
	callq	_report_touch_events
	testq	%rax, %rax
	setne	%r13b
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rbx,%rax), %rdi
	addq	$4, %rdi
	callq	_get_unaligned_le16
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_input_mt_get_slot_by_key
	testl	%eax, %eax
	js	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movzbl	%r13b, %r13d
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_input_mt_slot
	movq	_MT_TOOL_FINGER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%r13d, %edx
	callq	_input_mt_report_slot_state
	testb	%r13b, %r13b
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	addq	$3, %rbx
	addl	-48(%rbp), %ebx                 ## 4-byte Folded Reload
	movslq	%ebx, %r13
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	leaq	(%rbx,%r13), %rdi
	addq	$7, %rdi
	callq	_get_unaligned_le16
	movl	%eax, %r14d
	leaq	(%rbx,%r13), %rdi
	addq	$9, %rdi
	callq	_get_unaligned_le16
	movl	%eax, %r13d
	movq	_ABS_MT_POSITION_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%r14d, %edx
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	callq	_input_report_abs
	movq	_ABS_MT_POSITION_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%r13d, %edx
	callq	_input_report_abs
	jmp	LBB0_11
LBB0_12:
	movq	%r12, %rdi
	callq	_input_mt_sync_frame
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	subl	%eax, 8(%r14)
	jg	LBB0_14
## %bb.13:
	movl	$0, 8(%r14)
	movq	%r14, %rdi
	callq	_wacom_wac_finger_count_touches
	movq	16(%r14), %rcx
	movl	%eax, (%rcx)
LBB0_14:
	movl	$1, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTTPC,8,3                      ## @MTTPC
	.comm	_MTTPC_B,8,3                    ## @MTTPC_B
	.comm	_WACOM_BYTES_PER_MT_PACKET,4,2  ## @WACOM_BYTES_PER_MT_PACKET
	.comm	_MT_TOOL_FINGER,4,2             ## @MT_TOOL_FINGER
	.comm	_ABS_MT_POSITION_X,4,2          ## @ABS_MT_POSITION_X
	.comm	_ABS_MT_POSITION_Y,4,2          ## @ABS_MT_POSITION_Y
	.no_dead_strip	_wacom_mt_touch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wacom_mt_touch
_wacom_mt_touch:                        ; @wacom_mt_touch
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x0
	ldr	x24, [x0]
	ldrb	w1, [x24, #2]
	ldp	x8, x20, [x0, #24]
Lloh0:
	adrp	x9, _MTTPC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MTTPC@GOTPAGEOFF]
Lloh2:
	adrp	x10, _MTTPC_B@GOTPAGE
Lloh3:
	ldr	x10, [x10, _MTTPC_B@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
Lloh5:
	ldr	x10, [x10]
	cmp	x8, x10
	ccmp	x8, x9, #4, ne
	mov	w8, #-4
	csel	w25, w8, wzr, eq
	cbz	w1, LBB0_2
; %bb.1:
	str	w1, [x19, #8]
	b	LBB0_3
LBB0_2:
	ldr	w1, [x19, #8]
LBB0_3:
	mov	w0, #5
	bl	_min
	mov	x21, x0
	cmp	w0, #1
	b.lt	LBB0_12
; %bb.4:
	mov	w26, #0
Lloh6:
	adrp	x27, _WACOM_BYTES_PER_MT_PACKET@GOTPAGE
Lloh7:
	ldr	x27, [x27, _WACOM_BYTES_PER_MT_PACKET@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	w26, w26, #1
	cmp	w21, w26
	b.eq	LBB0_12
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldrsw	x8, [x27]
	add	x8, x8, w25, sxtw
	sxtw	x9, w26
	mul	x28, x8, x9
	sxtw	x8, w28
	add	x23, x8, #3
	ldrb	w8, [x24, x23]
	tbnz	w8, #0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w22, #0
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x19
	bl	_report_touch_events
	cmp	x0, #0
	cset	w22, ne
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x8, x28, x24
	add	x0, x8, #4
	bl	_get_unaligned_le16
	mov	x1, x0
	mov	x0, x20
	bl	_input_mt_get_slot_by_key
	tbnz	w0, #31, LBB0_5
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x1, x0
	mov	x0, x20
	bl	_input_mt_slot
Lloh8:
	adrp	x8, _MT_TOOL_FINGER@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MT_TOOL_FINGER@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x22
	bl	_input_mt_report_slot_state
	cbz	w22, LBB0_5
; %bb.11:                               ;   in Loop: Header=BB0_6 Depth=1
                                        ; kill: def $w23 killed $w23 killed $x23 def $x23
	sxtw	x8, w23
	add	x23, x8, w25, sxtw
	add	x8, x24, w23, sxtw
	add	x0, x8, #7
	bl	_get_unaligned_le16
	mov	x22, x0
	add	x8, x23, x24
	add	x0, x8, #9
	bl	_get_unaligned_le16
	mov	x23, x0
Lloh11:
	adrp	x8, _ABS_MT_POSITION_X@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ABS_MT_POSITION_X@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x22
	bl	_input_report_abs
Lloh14:
	adrp	x8, _ABS_MT_POSITION_Y@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ABS_MT_POSITION_Y@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x23
	bl	_input_report_abs
	b	LBB0_5
LBB0_12:
	mov	x0, x20
	bl	_input_mt_sync_frame
	ldr	w8, [x19, #8]
	sub	w8, w8, w21
	str	w8, [x19, #8]
	cmp	w8, #0
	b.gt	LBB0_14
; %bb.13:
	str	wzr, [x19, #8]
	mov	x0, x19
	bl	_wacom_wac_finger_count_touches
	ldr	x8, [x19, #16]
	str	w0, [x8]
LBB0_14:
	mov	w0, #1
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_MTTPC,8,3                      ; @MTTPC
	.comm	_MTTPC_B,8,3                    ; @MTTPC_B
	.comm	_WACOM_BYTES_PER_MT_PACKET,4,2  ; @WACOM_BYTES_PER_MT_PACKET
	.comm	_MT_TOOL_FINGER,4,2             ; @MT_TOOL_FINGER
	.comm	_ABS_MT_POSITION_X,4,2          ; @ABS_MT_POSITION_X
	.comm	_ABS_MT_POSITION_Y,4,2          ; @ABS_MT_POSITION_Y
	.no_dead_strip	_wacom_mt_touch
.subsections_via_symbols
