	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wacom_bpt_touch
_wacom_bpt_touch:                       ## @wacom_bpt_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
	xorl	%eax, %eax
	cmpb	$2, (%r14)
	jne	LBB0_10
## %bb.1:
	movq	%rdi, %r12
	movq	24(%rdi), %r15
	movq	16(%rdi), %rbx
	callq	_report_touch_events
	testq	%rax, %rax
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_4
## %bb.2:
	movzbl	3(%r14), %r13d
	movl	%r13d, %ebx
	shrl	$7, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_input_mt_slot
	movq	_MT_TOOL_FINGER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_input_mt_report_slot_state
	testb	%r13b, %r13b
	jns	LBB0_5
## %bb.3:
	leaq	3(%r14), %rdi
	callq	_get_unaligned_be16
	movl	%eax, %r13d
	andl	$2047, %r13d                    ## imm = 0x7FF
	leaq	5(%r14), %rdi
	callq	_get_unaligned_be16
	andl	$2047, %eax                     ## imm = 0x7FF
	movq	_WACOM_QUIRK_BBTOUCH_LOWRES@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	32(%r12), %ecx
	movl	%r13d, %edx
	shll	$5, %edx
	movl	%eax, %ebx
	shll	$5, %ebx
	testl	%ecx, %ecx
	cmovel	%r13d, %edx
	cmovel	%eax, %ebx
	movq	_ABS_MT_POSITION_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_input_report_abs
	movq	_ABS_MT_POSITION_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_input_report_abs
	jmp	LBB0_5
LBB0_4:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_input_mt_slot
	movq	_MT_TOOL_FINGER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_input_mt_report_slot_state
LBB0_5:
	movb	1(%r14), %bl
	movq	%r12, %rdi
	callq	_report_touch_events
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	shrb	$7, %bl
	movzbl	%bl, %eax
	xorl	$9, %eax
	movl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movzbl	3(%rax,%r14), %r13d
	movl	%r13d, %ebx
	shrl	$7, %ebx
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_input_mt_slot
	movq	_MT_TOOL_FINGER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_input_mt_report_slot_state
	testb	%r13b, %r13b
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jns	LBB0_9
## %bb.7:
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	leaq	(%r14,%r13), %rdi
	addq	$3, %rdi
	callq	_get_unaligned_be16
	andl	$2047, %eax                     ## imm = 0x7FF
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	leaq	(%r14,%r13), %rdi
	addq	$5, %rdi
	callq	_get_unaligned_be16
	andl	$2047, %eax                     ## imm = 0x7FF
	movq	_WACOM_QUIRK_BBTOUCH_LOWRES@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	32(%r12), %ecx
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%esi, %edx
	shll	$5, %edx
	movl	%eax, %r13d
	shll	$5, %r13d
	testl	%ecx, %ecx
	cmovel	%esi, %edx
	cmovel	%eax, %r13d
	movq	_ABS_MT_POSITION_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_input_report_abs
	movq	_ABS_MT_POSITION_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r13d, %edx
	callq	_input_report_abs
	jmp	LBB0_9
LBB0_8:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_input_mt_slot
	movq	_MT_TOOL_FINGER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_input_mt_report_slot_state
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_9:
	movq	%r15, %rdi
	callq	_input_mt_sync_frame
	movq	_BTN_LEFT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	1(%r14), %edx
	shrl	$3, %edx
	andl	$1, %edx
	movq	%rbx, %rdi
	callq	_input_report_key
	movq	_BTN_FORWARD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	1(%r14), %edx
	shrl	$2, %edx
	andl	$1, %edx
	movq	%rbx, %rdi
	callq	_input_report_key
	movq	_BTN_BACK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	1(%r14), %edx
	shrl	%edx
	andl	$1, %edx
	movq	%rbx, %rdi
	callq	_input_report_key
	movq	_BTN_RIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	1(%r14), %edx
	andl	$1, %edx
	movq	%rbx, %rdi
	callq	_input_report_key
	movq	%r12, %rdi
	callq	_wacom_wac_finger_count_touches
	movq	8(%r12), %rcx
	movl	%eax, (%rcx)
	movl	$1, %eax
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MT_TOOL_FINGER,4,2             ## @MT_TOOL_FINGER
	.comm	_WACOM_QUIRK_BBTOUCH_LOWRES,4,2 ## @WACOM_QUIRK_BBTOUCH_LOWRES
	.comm	_ABS_MT_POSITION_X,4,2          ## @ABS_MT_POSITION_X
	.comm	_ABS_MT_POSITION_Y,4,2          ## @ABS_MT_POSITION_Y
	.comm	_BTN_LEFT,4,2                   ## @BTN_LEFT
	.comm	_BTN_FORWARD,4,2                ## @BTN_FORWARD
	.comm	_BTN_BACK,4,2                   ## @BTN_BACK
	.comm	_BTN_RIGHT,4,2                  ## @BTN_RIGHT
	.no_dead_strip	_wacom_bpt_touch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wacom_bpt_touch
_wacom_bpt_touch:                       ; @wacom_bpt_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
	ldr	x24, [x0]
	ldrb	w8, [x24]
	cmp	w8, #2
	b.ne	LBB0_4
; %bb.1:
	mov	x19, x0
	ldp	x20, x21, [x0, #16]
	bl	_report_touch_events
Lloh0:
	adrp	x25, _MT_TOOL_FINGER@GOTPAGE
Lloh1:
	ldr	x25, [x25, _MT_TOOL_FINGER@GOTPAGEOFF]
	cbz	x0, LBB0_5
; %bb.2:
	mov	x22, x24
	ldrsb	w26, [x22, #3]!
	ubfx	w23, w26, #7, #1
	mov	x0, x21
	mov	w1, #0
	bl	_input_mt_slot
	ldr	w1, [x25]
	mov	x0, x21
	mov	x2, x23
	bl	_input_mt_report_slot_state
	tbz	w26, #31, LBB0_6
; %bb.3:
	mov	x0, x22
	bl	_get_unaligned_be16
	and	w22, w0, #0x7ff
	add	x0, x24, #5
	bl	_get_unaligned_be16
	and	w8, w0, #0x7ff
	ldr	w9, [x19, #32]
Lloh2:
	adrp	x10, _WACOM_QUIRK_BBTOUCH_LOWRES@GOTPAGE
Lloh3:
	ldr	x10, [x10, _WACOM_QUIRK_BBTOUCH_LOWRES@GOTPAGEOFF]
Lloh4:
	ldr	w10, [x10]
	lsl	w11, w22, #5
	lsl	w12, w8, #5
	tst	w10, w9
	csel	w2, w22, w11, eq
	csel	w22, w8, w12, eq
Lloh5:
	adrp	x8, _ABS_MT_POSITION_X@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ABS_MT_POSITION_X@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_input_report_abs
Lloh8:
	adrp	x8, _ABS_MT_POSITION_Y@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ABS_MT_POSITION_Y@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x22
	bl	_input_report_abs
	b	LBB0_6
LBB0_4:
	mov	w0, #0
	b	LBB0_11
LBB0_5:
	mov	x0, x21
	mov	w1, #0
	bl	_input_mt_slot
	ldr	w1, [x25]
	mov	x0, x21
	mov	w2, #0
	bl	_input_mt_report_slot_state
LBB0_6:
	ldrsb	w8, [x24, #1]
	cmp	w8, #0
	mov	w8, #8
	cinc	w26, w8, ge
	mov	x0, x19
	bl	_report_touch_events
	cbz	x0, LBB0_9
; %bb.7:
	add	x22, x24, w26, uxtw
	ldrsb	w27, [x22, #3]!
	ubfx	w23, w27, #7, #1
	mov	x0, x21
	mov	w1, #1
	bl	_input_mt_slot
	ldr	w1, [x25]
	mov	x0, x21
	mov	x2, x23
	bl	_input_mt_report_slot_state
	tbz	w27, #31, LBB0_10
; %bb.8:
	mov	x0, x22
	bl	_get_unaligned_be16
	and	w22, w0, #0x7ff
	add	w8, w26, #5
	add	x0, x24, x8
	bl	_get_unaligned_be16
	and	w8, w0, #0x7ff
	ldr	w9, [x19, #32]
Lloh11:
	adrp	x10, _WACOM_QUIRK_BBTOUCH_LOWRES@GOTPAGE
Lloh12:
	ldr	x10, [x10, _WACOM_QUIRK_BBTOUCH_LOWRES@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	lsl	w11, w22, #5
	lsl	w12, w8, #5
	tst	w10, w9
	csel	w2, w22, w11, eq
	csel	w22, w8, w12, eq
Lloh14:
	adrp	x8, _ABS_MT_POSITION_X@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ABS_MT_POSITION_X@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_input_report_abs
Lloh17:
	adrp	x8, _ABS_MT_POSITION_Y@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ABS_MT_POSITION_Y@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x22
	bl	_input_report_abs
	b	LBB0_10
LBB0_9:
	mov	x0, x21
	mov	w1, #1
	bl	_input_mt_slot
	ldr	w1, [x25]
	mov	x0, x21
	mov	w2, #0
	bl	_input_mt_report_slot_state
LBB0_10:
	mov	x0, x21
	bl	_input_mt_sync_frame
Lloh20:
	adrp	x8, _BTN_LEFT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _BTN_LEFT@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	ldrb	w8, [x24, #1]
	ubfx	w2, w8, #3, #1
	mov	x0, x20
	bl	_input_report_key
Lloh23:
	adrp	x8, _BTN_FORWARD@GOTPAGE
Lloh24:
	ldr	x8, [x8, _BTN_FORWARD@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	ldrb	w8, [x24, #1]
	ubfx	w2, w8, #2, #1
	mov	x0, x20
	bl	_input_report_key
Lloh26:
	adrp	x8, _BTN_BACK@GOTPAGE
Lloh27:
	ldr	x8, [x8, _BTN_BACK@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	ldrb	w8, [x24, #1]
	ubfx	w2, w8, #1, #1
	mov	x0, x20
	bl	_input_report_key
Lloh29:
	adrp	x8, _BTN_RIGHT@GOTPAGE
Lloh30:
	ldr	x8, [x8, _BTN_RIGHT@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	ldrb	w8, [x24, #1]
	and	w2, w8, #0x1
	mov	x0, x20
	bl	_input_report_key
	mov	x0, x19
	bl	_wacom_wac_finger_count_touches
	ldr	x8, [x19, #8]
	str	w0, [x8]
	mov	w0, #1
LBB0_11:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_MT_TOOL_FINGER,4,2             ; @MT_TOOL_FINGER
	.comm	_WACOM_QUIRK_BBTOUCH_LOWRES,4,2 ; @WACOM_QUIRK_BBTOUCH_LOWRES
	.comm	_ABS_MT_POSITION_X,4,2          ; @ABS_MT_POSITION_X
	.comm	_ABS_MT_POSITION_Y,4,2          ; @ABS_MT_POSITION_Y
	.comm	_BTN_LEFT,4,2                   ; @BTN_LEFT
	.comm	_BTN_FORWARD,4,2                ; @BTN_FORWARD
	.comm	_BTN_BACK,4,2                   ; @BTN_BACK
	.comm	_BTN_RIGHT,4,2                  ; @BTN_RIGHT
	.no_dead_strip	_wacom_bpt_touch
.subsections_via_symbols
