	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wacom_tpc_pen
_wacom_tpc_pen:                         ## @wacom_tpc_pen
	.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
	movq	%rdi, %rbx
	movq	(%rdi), %r13
	movq	16(%rdi), %rax
	movq	24(%rdi), %r14
	movzbl	1(%r13), %ecx
	movl	%ecx, %r15d
	andl	$32, %r15d
	cmpl	$0, (%rax)
	jne	LBB0_5
## %bb.1:
	testb	$12, %cl
	jne	LBB0_2
## %bb.3:
	movq	_BTN_TOOL_PEN@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_2:
	movq	_BTN_TOOL_RUBBER@GOTPCREL(%rip), %rcx
LBB0_4:
	movl	(%rcx), %ecx
	movq	8(%rbx), %rdx
	movl	%ecx, (%rdx)
LBB0_5:
	movl	%r15d, (%rax)
	movq	%rbx, %rdi
	callq	_delay_pen_events
	movl	%eax, %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jne	LBB0_7
## %bb.6:
	movq	_BTN_STYLUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	1(%r13), %edx
	andl	$2, %edx
	movq	%r14, %rdi
	callq	_input_report_key
	movq	_BTN_STYLUS2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	1(%r13), %edx
	andl	$16, %edx
	movq	%r14, %rdi
	callq	_input_report_key
	movq	_ABS_X@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	leaq	2(%r13), %rdi
	callq	_le16_to_cpup
	movzbl	%al, %edx
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_input_report_abs
	movq	_ABS_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	leaq	4(%r13), %rdi
	callq	_le16_to_cpup
	movzbl	%al, %edx
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_input_report_abs
	movq	_ABS_PRESSURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	6(%r13), %edx
	movq	%r14, %rdi
	callq	_input_report_abs
	movq	_BTN_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	1(%r13), %edx
	andl	$5, %edx
	movq	%r14, %rdi
	callq	_input_report_key
	movq	8(%rbx), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_input_report_key
	movl	$1, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BTN_TOOL_RUBBER,4,2            ## @BTN_TOOL_RUBBER
	.comm	_BTN_TOOL_PEN,4,2               ## @BTN_TOOL_PEN
	.comm	_BTN_STYLUS,4,2                 ## @BTN_STYLUS
	.comm	_BTN_STYLUS2,4,2                ## @BTN_STYLUS2
	.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
	.no_dead_strip	_wacom_tpc_pen
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wacom_tpc_pen
_wacom_tpc_pen:                         ; @wacom_tpc_pen
	.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, x0
	ldr	x23, [x0]
	ldrb	w9, [x23, #1]
	and	w19, w9, #0x20
	ldp	x8, x21, [x0, #16]
	ldr	w10, [x8]
	cbnz	w10, LBB0_2
; %bb.1:
Lloh0:
	adrp	x10, _BTN_TOOL_RUBBER@GOTPAGE
Lloh1:
	ldr	x10, [x10, _BTN_TOOL_RUBBER@GOTPAGEOFF]
Lloh2:
	adrp	x11, _BTN_TOOL_PEN@GOTPAGE
Lloh3:
	ldr	x11, [x11, _BTN_TOOL_PEN@GOTPAGEOFF]
	tst	w9, #0xc
	csel	x9, x11, x10, eq
	ldr	w9, [x9]
	ldr	x10, [x20, #8]
	str	w9, [x10]
LBB0_2:
	str	w19, [x8]
	mov	x0, x20
	bl	_delay_pen_events
	cbz	w0, LBB0_4
; %bb.3:
	mov	w0, #0
	b	LBB0_5
LBB0_4:
Lloh4:
	adrp	x8, _BTN_STYLUS@GOTPAGE
Lloh5:
	ldr	x8, [x8, _BTN_STYLUS@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	ldrb	w8, [x23, #1]
	and	w2, w8, #0x2
	mov	x0, x21
	bl	_input_report_key
Lloh7:
	adrp	x8, _BTN_STYLUS2@GOTPAGE
Lloh8:
	ldr	x8, [x8, _BTN_STYLUS2@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	ldrb	w8, [x23, #1]
	and	w2, w8, #0x10
	mov	x0, x21
	bl	_input_report_key
Lloh10:
	adrp	x8, _ABS_X@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ABS_X@GOTPAGEOFF]
Lloh12:
	ldr	w22, [x8]
	add	x0, x23, #2
	bl	_le16_to_cpup
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_input_report_abs
Lloh13:
	adrp	x8, _ABS_Y@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ABS_Y@GOTPAGEOFF]
Lloh15:
	ldr	w22, [x8]
	add	x0, x23, #4
	bl	_le16_to_cpup
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_input_report_abs
Lloh16:
	adrp	x8, _ABS_PRESSURE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ABS_PRESSURE@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	ldrb	w2, [x23, #6]
	mov	x0, x21
	bl	_input_report_abs
Lloh19:
	adrp	x8, _BTN_TOUCH@GOTPAGE
Lloh20:
	ldr	x8, [x8, _BTN_TOUCH@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	ldrb	w8, [x23, #1]
	mov	w9, #5
	and	w2, w8, w9
	mov	x0, x21
	bl	_input_report_key
	ldr	x8, [x20, #8]
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x19
	bl	_input_report_key
	mov	w0, #1
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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_BTN_TOOL_RUBBER,4,2            ; @BTN_TOOL_RUBBER
	.comm	_BTN_TOOL_PEN,4,2               ; @BTN_TOOL_PEN
	.comm	_BTN_STYLUS,4,2                 ; @BTN_STYLUS
	.comm	_BTN_STYLUS2,4,2                ; @BTN_STYLUS2
	.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
	.no_dead_strip	_wacom_tpc_pen
.subsections_via_symbols
