	.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), %r14
	movb	(%r14), %al
	movq	_WACOM_REPORT_PENABLED@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpb	(%rcx), %al
	jne	LBB0_16
## %bb.1:
	movq	%rdi, %r12
	movq	40(%rdi), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movzbl	1(%r14), %r13d
	movl	%r13d, %r15d
	shrl	$7, %r15d
	movq	32(%rdi), %rax
	movl	%r15d, (%rax)
	callq	_delay_pen_events
	testq	%rax, %rax
	jne	LBB0_16
## %bb.2:
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -60(%rbp)                   ## 4-byte Folded Spill
	movl	$0, %edx
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -56(%rbp)                   ## 4-byte Folded Spill
	testb	$32, %r13b
	movl	%r13d, %r15d
	je	LBB0_4
## %bb.3:
	leaq	6(%r14), %rdi
	callq	_le16_to_cpup
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movzbl	1(%r14), %eax
	movl	%eax, %edx
	andl	$1, %edx
	movl	%eax, %ecx
	andl	$2, %ecx
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	andl	$4, %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
LBB0_4:
	movl	$0, %r13d
	testb	$64, %r15b
	je	LBB0_6
## %bb.5:
	leaq	2(%r14), %rdi
	movl	%edx, %ebx
	callq	_le16_to_cpup
	movl	%eax, %r13d
	leaq	4(%r14), %rdi
	callq	_le16_to_cpup
	movl	%ebx, %edx
	testb	$8, 1(%r14)
	movq	_BTN_TOOL_RUBBER@GOTPCREL(%rip), %rcx
	cmoveq	_BTN_TOOL_PEN@GOTPCREL(%rip), %rcx
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	(%rcx), %eax
	movq	24(%r12), %rcx
	movl	%eax, (%rcx)
	movq	_ERASER_DEVICE_ID@GOTPCREL(%rip), %rax
	cmoveq	_STYLUS_DEVICE_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	8(%r12), %rcx
	movl	%eax, (%rcx)
	movl	$1, 16(%r12)
LBB0_6:
	testb	$-128, %r15b
	jne	LBB0_7
## %bb.9:
	movq	8(%r12), %rax
	movl	$0, (%rax)
	xorl	%esi, %esi
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	jmp	LBB0_10
LBB0_7:
	movzbl	8(%r14), %eax
	movzbl	48(%r12), %ecx
	xorl	%esi, %esi
	cmpb	%al, %cl
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	jb	LBB0_10
## %bb.8:
	subl	%eax, %ecx
	movl	%ecx, %esi
LBB0_10:
	cmpl	$0, 16(%r12)
	je	LBB0_14
## %bb.11:
	movl	%esi, -72(%rbp)                 ## 4-byte Spill
	movq	_BTN_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_input_report_key
	movq	_BTN_STYLUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	callq	_input_report_key
	movq	_BTN_STYLUS2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	callq	_input_report_key
	movl	%r15d, %eax
	andl	$-64, %eax
	cmpl	$128, %eax
	je	LBB0_13
## %bb.12:
	movq	_ABS_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r13d, %edx
	callq	_input_report_abs
	movq	_ABS_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_input_report_abs
LBB0_13:
	movq	_ABS_PRESSURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	callq	_input_report_abs
	movq	_ABS_DISTANCE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	-72(%rbp), %edx                 ## 4-byte Reload
	callq	_input_report_abs
	movq	24(%r12), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_input_report_key
	movq	_ABS_MISC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	8(%r12), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_input_report_abs
LBB0_14:
	movl	$1, %ebx
	testb	$-128, %r15b
	jne	LBB0_16
## %bb.15:
	movl	$0, 16(%r12)
LBB0_16:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WACOM_REPORT_PENABLED,1,0      ## @WACOM_REPORT_PENABLED
	.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:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x28, [x0]
	ldrb	w8, [x28]
Lloh0:
	adrp	x9, _WACOM_REPORT_PENABLED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _WACOM_REPORT_PENABLED@GOTPAGEOFF]
	ldrb	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	mov	x19, x0
	ldrb	w22, [x28, #1]
	lsr	w21, w22, #7
	ldp	x8, x20, [x0, #32]
	str	w21, [x8]
	bl	_delay_pen_events
	cbz	x0, LBB0_4
LBB0_2:
	mov	w0, #0
LBB0_3:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_4:
	tbnz	w22, #5, LBB0_8
; %bb.5:
	str	wzr, [sp, #12]                  ; 4-byte Folded Spill
	mov	w26, #0
	mov	w24, #0
	mov	w23, #0
	tbz	w22, #6, LBB0_9
LBB0_6:
	add	x0, x28, #2
	bl	_le16_to_cpup
	mov	x27, x0
	add	x0, x28, #4
	bl	_le16_to_cpup
	mov	x25, x0
Lloh2:
	adrp	x8, _BTN_TOOL_PEN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BTN_TOOL_PEN@GOTPAGEOFF]
	ldrb	w9, [x28, #1]
Lloh4:
	adrp	x10, _BTN_TOOL_RUBBER@GOTPAGE
Lloh5:
	ldr	x10, [x10, _BTN_TOOL_RUBBER@GOTPAGEOFF]
	tst	w9, #0x8
	csel	x8, x8, x10, eq
	ldr	w8, [x8]
	ldr	x9, [x19, #24]
	str	w8, [x9]
Lloh6:
	adrp	x8, _STYLUS_DEVICE_ID@GOTPAGE
Lloh7:
	ldr	x8, [x8, _STYLUS_DEVICE_ID@GOTPAGEOFF]
Lloh8:
	adrp	x9, _ERASER_DEVICE_ID@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ERASER_DEVICE_ID@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
	ldr	x9, [x19, #8]
	str	w8, [x9]
	mov	w8, #1
	str	w8, [x19, #16]
	tbz	w22, #7, LBB0_10
LBB0_7:
	ldrb	w8, [x28, #8]
	ldrb	w9, [x19, #48]
	subs	w8, w9, w8
	csel	w28, wzr, w8, lo
	ldr	w8, [x19, #16]
	cbnz	w8, LBB0_11
	b	LBB0_14
LBB0_8:
	add	x0, x28, #6
	bl	_le16_to_cpup
	str	w0, [sp, #12]                   ; 4-byte Folded Spill
	ldrb	w8, [x28, #1]
	and	w26, w8, #0x1
	and	w24, w8, #0x2
	and	w23, w8, #0x4
	tbnz	w22, #6, LBB0_6
LBB0_9:
	mov	w25, #0
	mov	w27, #0
	tbnz	w22, #7, LBB0_7
LBB0_10:
	mov	w28, #0
	ldr	x8, [x19, #8]
	str	wzr, [x8]
	ldr	w8, [x19, #16]
	cbz	w8, LBB0_14
LBB0_11:
Lloh10:
	adrp	x8, _BTN_TOUCH@GOTPAGE
Lloh11:
	ldr	x8, [x8, _BTN_TOUCH@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x26
	bl	_input_report_key
Lloh13:
	adrp	x8, _BTN_STYLUS@GOTPAGE
Lloh14:
	ldr	x8, [x8, _BTN_STYLUS@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x24
	bl	_input_report_key
Lloh16:
	adrp	x8, _BTN_STYLUS2@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BTN_STYLUS2@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x23
	bl	_input_report_key
	and	w8, w22, #0xc0
	cmp	w8, #128
	b.eq	LBB0_13
; %bb.12:
Lloh19:
	adrp	x8, _ABS_X@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ABS_X@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x27
	bl	_input_report_abs
Lloh22:
	adrp	x8, _ABS_Y@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ABS_Y@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x25
	bl	_input_report_abs
LBB0_13:
Lloh25:
	adrp	x8, _ABS_PRESSURE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ABS_PRESSURE@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x20
	ldr	w2, [sp, #12]                   ; 4-byte Folded Reload
	bl	_input_report_abs
Lloh28:
	adrp	x8, _ABS_DISTANCE@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ABS_DISTANCE@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x28
	bl	_input_report_abs
	ldr	x8, [x19, #24]
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x21
	bl	_input_report_key
Lloh31:
	adrp	x8, _ABS_MISC@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ABS_MISC@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	ldr	x8, [x19, #8]
	ldr	w2, [x8]
	mov	x0, x20
	bl	_input_report_abs
LBB0_14:
	tbnz	w22, #7, LBB0_16
; %bb.15:
	str	wzr, [x19, #16]
LBB0_16:
	mov	w0, #1
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_WACOM_REPORT_PENABLED,1,0      ; @WACOM_REPORT_PENABLED
	.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
