	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wacom_bpt_pen
_wacom_bpt_pen:                         ## @wacom_bpt_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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rbx
	xorl	%eax, %eax
	cmpb	$2, (%rbx)
	jne	LBB0_9
## %bb.1:
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %rax
	movq	(%rax), %r14
	movzbl	1(%rbx), %esi
	xorl	%r12d, %r12d
	movl	%esi, %ecx
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	$0, %eax
	movl	$0, %edi
	movl	$0, %edx
	movl	$0, %r15d
	movl	$0, %r13d
	andl	$32, %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	je	LBB0_5
## %bb.2:
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	16(%r15), %rcx
	cmpl	$0, (%rcx)
	jne	LBB0_4
## %bb.3:
	testb	$8, %sil
	movq	_BTN_TOOL_RUBBER@GOTPCREL(%rip), %rax
	cmoveq	_BTN_TOOL_PEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_ERASER_DEVICE_ID@GOTPCREL(%rip), %rdx
	cmoveq	_STYLUS_DEVICE_ID@GOTPCREL(%rip), %rdx
	movl	%eax, (%rcx)
	movl	(%rdx), %eax
	movq	8(%r15), %rcx
	movl	%eax, (%rcx)
LBB0_4:
	leaq	2(%rbx), %rdi
	callq	_le16_to_cpup
	movl	%eax, %r12d
	leaq	4(%rbx), %rdi
	callq	_le16_to_cpup
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	leaq	6(%rbx), %rdi
	callq	_le16_to_cpup
	movzbl	8(%rbx), %esi
	movq	24(%r15), %rcx
	movzbl	(%rcx), %ecx
	movl	%ecx, %edx
	subl	%esi, %edx
	xorl	%edi, %edi
	cmpb	%sil, %cl
	cmovael	%edx, %edi
	movzbl	1(%rbx), %r13d
	movl	%r13d, %edx
	andl	$1, %edx
	movl	%r13d, %r15d
	andl	$2, %r15d
	andl	$4, %r13d
LBB0_5:
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	%edi, -60(%rbp)                 ## 4-byte Spill
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %r12d
	shrl	$5, %r12d
	movq	_BTN_TOUCH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%r14, %rdi
	callq	_input_report_key
	movq	_BTN_STYLUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_input_report_key
	movq	_BTN_STYLUS2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r13d, %edx
	callq	_input_report_key
	movq	_ABS_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	callq	_input_report_abs
	movq	_ABS_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_input_report_abs
	movq	_ABS_PRESSURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	callq	_input_report_abs
	movq	_ABS_DISTANCE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	callq	_input_report_abs
	testl	%ebx, %ebx
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_7
## %bb.6:
	movq	8(%rbx), %rax
	movl	$0, (%rax)
LBB0_7:
	movq	16(%rbx), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r12d, %edx
	callq	_input_report_key
	movq	_ABS_MISC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	8(%rbx), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_input_report_abs
	movl	$1, %eax
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_9
## %bb.8:
	movq	16(%rbx), %rcx
	movl	$0, (%rcx)
LBB0_9:
	addq	$40, %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	_ERASER_DEVICE_ID,4,2           ## @ERASER_DEVICE_ID
	.comm	_BTN_TOOL_PEN,4,2               ## @BTN_TOOL_PEN
	.comm	_STYLUS_DEVICE_ID,4,2           ## @STYLUS_DEVICE_ID
	.comm	_BTN_TOUCH,4,2                  ## @BTN_TOUCH
	.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	_ABS_DISTANCE,4,2               ## @ABS_DISTANCE
	.comm	_ABS_MISC,4,2                   ## @ABS_MISC
	.no_dead_strip	_wacom_bpt_pen
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wacom_bpt_pen
_wacom_bpt_pen:                         ; @wacom_bpt_pen
	.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	x26, [x0]
	ldrb	w8, [x26]
	cmp	w8, #2
	b.ne	LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	x8, [x1]
	ldr	x20, [x8]
	ldrb	w8, [x26, #1]
	and	w28, w8, #0x20
	ubfx	w21, w8, #5, #1
	tbnz	w8, #5, LBB0_4
; %bb.2:
	mov	w22, #0
	mov	w23, #0
	mov	w24, #0
	mov	w25, #0
	mov	w2, #0
	mov	w27, #0
	mov	w26, #0
	b	LBB0_7
LBB0_3:
	mov	w0, #0
	b	LBB0_12
LBB0_4:
	ldr	x9, [x19, #16]
	ldr	w10, [x9]
	cbnz	w10, LBB0_6
; %bb.5:
Lloh0:
	adrp	x10, _BTN_TOOL_PEN@GOTPAGE
Lloh1:
	ldr	x10, [x10, _BTN_TOOL_PEN@GOTPAGEOFF]
Lloh2:
	adrp	x11, _BTN_TOOL_RUBBER@GOTPAGE
Lloh3:
	ldr	x11, [x11, _BTN_TOOL_RUBBER@GOTPAGEOFF]
	tst	w8, #0x8
	csel	x8, x10, x11, eq
	ldr	w8, [x8]
	str	w8, [x9]
Lloh4:
	adrp	x8, _STYLUS_DEVICE_ID@GOTPAGE
Lloh5:
	ldr	x8, [x8, _STYLUS_DEVICE_ID@GOTPAGEOFF]
Lloh6:
	adrp	x9, _ERASER_DEVICE_ID@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ERASER_DEVICE_ID@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
	ldr	x9, [x19, #8]
	str	w8, [x9]
LBB0_6:
	add	x0, x26, #2
	bl	_le16_to_cpup
	mov	x22, x0
	add	x0, x26, #4
	bl	_le16_to_cpup
	mov	x23, x0
	add	x0, x26, #6
	bl	_le16_to_cpup
	mov	x24, x0
	ldrb	w8, [x26, #8]
	ldr	x9, [x19, #24]
	ldrb	w9, [x9]
	subs	w8, w9, w8
	csel	w25, wzr, w8, lo
	ldrb	w8, [x26, #1]
	and	w2, w8, #0x1
	and	w27, w8, #0x2
	and	w26, w8, #0x4
LBB0_7:
Lloh8:
	adrp	x8, _BTN_TOUCH@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BTN_TOUCH@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_input_report_key
Lloh11:
	adrp	x8, _BTN_STYLUS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BTN_STYLUS@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x27
	bl	_input_report_key
Lloh14:
	adrp	x8, _BTN_STYLUS2@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BTN_STYLUS2@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x26
	bl	_input_report_key
Lloh17:
	adrp	x8, _ABS_X@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ABS_X@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x22
	bl	_input_report_abs
Lloh20:
	adrp	x8, _ABS_Y@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ABS_Y@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x23
	bl	_input_report_abs
Lloh23:
	adrp	x8, _ABS_PRESSURE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ABS_PRESSURE@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x24
	bl	_input_report_abs
Lloh26:
	adrp	x8, _ABS_DISTANCE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ABS_DISTANCE@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x25
	bl	_input_report_abs
	cbnz	w28, LBB0_9
; %bb.8:
	ldr	x8, [x19, #8]
	str	wzr, [x8]
LBB0_9:
	ldr	x8, [x19, #16]
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x21
	bl	_input_report_key
Lloh29:
	adrp	x8, _ABS_MISC@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ABS_MISC@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	ldr	x8, [x19, #8]
	ldr	w2, [x8]
	mov	x0, x20
	bl	_input_report_abs
	cbnz	w28, LBB0_11
; %bb.10:
	ldr	x8, [x19, #16]
	str	wzr, [x8]
LBB0_11:
	mov	w0, #1
LBB0_12:
	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	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_BTN_TOOL_RUBBER,4,2            ; @BTN_TOOL_RUBBER
	.comm	_ERASER_DEVICE_ID,4,2           ; @ERASER_DEVICE_ID
	.comm	_BTN_TOOL_PEN,4,2               ; @BTN_TOOL_PEN
	.comm	_STYLUS_DEVICE_ID,4,2           ; @STYLUS_DEVICE_ID
	.comm	_BTN_TOUCH,4,2                  ; @BTN_TOUCH
	.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	_ABS_DISTANCE,4,2               ; @ABS_DISTANCE
	.comm	_ABS_MISC,4,2                   ; @ABS_MISC
	.no_dead_strip	_wacom_bpt_pen
.subsections_via_symbols
