	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function w8001_setup_pen
_w8001_setup_pen:                       ## @w8001_setup_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	32(%rdi), %rbx
	movq	_W8001_CMD_QUERY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	callq	_w8001_command
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_5
## %bb.1:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	_EV_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%rbx), %esi
	callq	___set_bit
	movq	_EV_ABS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%rbx), %esi
	callq	___set_bit
	movq	_BTN_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	4(%rbx), %esi
	callq	___set_bit
	movq	_BTN_TOOL_PEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	4(%rbx), %esi
	callq	___set_bit
	movq	_BTN_TOOL_RUBBER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	4(%rbx), %esi
	callq	___set_bit
	movq	_BTN_STYLUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	4(%rbx), %esi
	callq	___set_bit
	movq	_BTN_STYLUS2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	4(%rbx), %esi
	callq	___set_bit
	movq	_INPUT_PROP_DIRECT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%rbx), %esi
	callq	___set_bit
	movl	24(%r13), %edi
	leaq	-96(%rbp), %rsi
	callq	_parse_pen_data
	movq	-64(%rbp), %rcx
	movups	-72(%rbp), %xmm0
	movups	%xmm0, 8(%r13)
	movq	_ABS_X@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_input_set_abs_params
	movq	_ABS_Y@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	-72(%rbp), %rcx
	movq	%rbx, %rdi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_input_set_abs_params
	movl	(%r14), %esi
	movq	_W8001_PEN_RESOLUTION@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movq	%rbx, %rdi
	callq	_input_abs_set_res
	movl	(%r15), %esi
	movl	(%r14), %edx
	movq	%rbx, %rdi
	callq	_input_abs_set_res
	movq	_ABS_PRESSURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-80(%rbp), %rcx
	movq	%rbx, %rdi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_input_set_abs_params
	movq	-88(%rbp), %rcx
	testq	%rcx, %rcx
	je	LBB0_4
## %bb.2:
	cmpq	$0, -96(%rbp)
	je	LBB0_4
## %bb.3:
	movq	_ABS_TILT_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_input_set_abs_params
	movq	_ABS_TILT_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-96(%rbp), %rcx
	movq	%rbx, %rdi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_input_set_abs_params
LBB0_4:
	movl	$144, (%r13)
	leaq	L_.str(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_strlcat
LBB0_5:
	movl	%r12d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_W8001_CMD_QUERY,4,2            ## @W8001_CMD_QUERY
	.comm	_EV_KEY,4,2                     ## @EV_KEY
	.comm	_EV_ABS,4,2                     ## @EV_ABS
	.comm	_BTN_TOUCH,4,2                  ## @BTN_TOUCH
	.comm	_BTN_TOOL_PEN,4,2               ## @BTN_TOOL_PEN
	.comm	_BTN_TOOL_RUBBER,4,2            ## @BTN_TOOL_RUBBER
	.comm	_BTN_STYLUS,4,2                 ## @BTN_STYLUS
	.comm	_BTN_STYLUS2,4,2                ## @BTN_STYLUS2
	.comm	_INPUT_PROP_DIRECT,4,2          ## @INPUT_PROP_DIRECT
	.comm	_ABS_X,4,2                      ## @ABS_X
	.comm	_ABS_Y,4,2                      ## @ABS_Y
	.comm	_W8001_PEN_RESOLUTION,4,2       ## @W8001_PEN_RESOLUTION
	.comm	_ABS_PRESSURE,4,2               ## @ABS_PRESSURE
	.comm	_ABS_TILT_X,4,2                 ## @ABS_TILT_X
	.comm	_ABS_TILT_Y,4,2                 ## @ABS_TILT_Y
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	" Penabled"

	.no_dead_strip	_w8001_setup_pen
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function w8001_setup_pen
_w8001_setup_pen:                       ; @w8001_setup_pen
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x23, [x0, #32]
Lloh0:
	adrp	x8, _W8001_CMD_QUERY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _W8001_CMD_QUERY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #1
	bl	_w8001_command
	mov	x22, x0
	cbnz	w0, LBB0_5
; %bb.1:
Lloh3:
	adrp	x8, _EV_KEY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EV_KEY@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ldr	w1, [x23, #8]
	bl	___set_bit
Lloh6:
	adrp	x8, _EV_ABS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EV_ABS@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	ldr	w1, [x23, #8]
	bl	___set_bit
Lloh9:
	adrp	x8, _BTN_TOUCH@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BTN_TOUCH@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	ldr	w1, [x23, #4]
	bl	___set_bit
Lloh12:
	adrp	x8, _BTN_TOOL_PEN@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BTN_TOOL_PEN@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	ldr	w1, [x23, #4]
	bl	___set_bit
Lloh15:
	adrp	x8, _BTN_TOOL_RUBBER@GOTPAGE
Lloh16:
	ldr	x8, [x8, _BTN_TOOL_RUBBER@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	ldr	w1, [x23, #4]
	bl	___set_bit
Lloh18:
	adrp	x8, _BTN_STYLUS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _BTN_STYLUS@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	ldr	w1, [x23, #4]
	bl	___set_bit
Lloh21:
	adrp	x8, _BTN_STYLUS2@GOTPAGE
Lloh22:
	ldr	x8, [x8, _BTN_STYLUS2@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	ldr	w1, [x23, #4]
	bl	___set_bit
Lloh24:
	adrp	x8, _INPUT_PROP_DIRECT@GOTPAGE
Lloh25:
	ldr	x8, [x8, _INPUT_PROP_DIRECT@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	ldr	w1, [x23]
	bl	___set_bit
	ldr	w0, [x21, #24]
	add	x1, sp, #8
	bl	_parse_pen_data
	ldp	x8, x3, [sp, #32]
	stp	x8, x3, [x21, #8]
Lloh27:
	adrp	x24, _ABS_X@GOTPAGE
Lloh28:
	ldr	x24, [x24, _ABS_X@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x23
	mov	w2, #0
	mov	w4, #0
	mov	w5, #0
	bl	_input_set_abs_params
Lloh29:
	adrp	x25, _ABS_Y@GOTPAGE
Lloh30:
	ldr	x25, [x25, _ABS_Y@GOTPAGEOFF]
	ldr	w1, [x25]
	ldr	x3, [sp, #32]
	mov	x0, x23
	mov	w2, #0
	mov	w4, #0
	mov	w5, #0
	bl	_input_set_abs_params
	ldr	w1, [x24]
Lloh31:
	adrp	x24, _W8001_PEN_RESOLUTION@GOTPAGE
Lloh32:
	ldr	x24, [x24, _W8001_PEN_RESOLUTION@GOTPAGEOFF]
	ldr	w2, [x24]
	mov	x0, x23
	bl	_input_abs_set_res
	ldr	w1, [x25]
	ldr	w2, [x24]
	mov	x0, x23
	bl	_input_abs_set_res
Lloh33:
	adrp	x8, _ABS_PRESSURE@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ABS_PRESSURE@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	ldr	x3, [sp, #24]
	mov	x0, x23
	mov	w2, #0
	mov	w4, #0
	mov	w5, #0
	bl	_input_set_abs_params
	ldr	x3, [sp, #16]
	cbz	x3, LBB0_4
; %bb.2:
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_4
; %bb.3:
Lloh36:
	adrp	x8, _ABS_TILT_X@GOTPAGE
Lloh37:
	ldr	x8, [x8, _ABS_TILT_X@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	mov	x0, x23
	mov	w2, #0
	mov	w4, #0
	mov	w5, #0
	bl	_input_set_abs_params
Lloh39:
	adrp	x8, _ABS_TILT_Y@GOTPAGE
Lloh40:
	ldr	x8, [x8, _ABS_TILT_Y@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
	ldr	x3, [sp, #8]
	mov	x0, x23
	mov	w2, #0
	mov	w4, #0
	mov	w5, #0
	bl	_input_set_abs_params
LBB0_4:
	mov	w8, #144
	str	w8, [x21]
Lloh42:
	adrp	x1, l_.str@PAGE
Lloh43:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	bl	_strlcat
LBB0_5:
	mov	x0, x22
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_W8001_CMD_QUERY,4,2            ; @W8001_CMD_QUERY
	.comm	_EV_KEY,4,2                     ; @EV_KEY
	.comm	_EV_ABS,4,2                     ; @EV_ABS
	.comm	_BTN_TOUCH,4,2                  ; @BTN_TOUCH
	.comm	_BTN_TOOL_PEN,4,2               ; @BTN_TOOL_PEN
	.comm	_BTN_TOOL_RUBBER,4,2            ; @BTN_TOOL_RUBBER
	.comm	_BTN_STYLUS,4,2                 ; @BTN_STYLUS
	.comm	_BTN_STYLUS2,4,2                ; @BTN_STYLUS2
	.comm	_INPUT_PROP_DIRECT,4,2          ; @INPUT_PROP_DIRECT
	.comm	_ABS_X,4,2                      ; @ABS_X
	.comm	_ABS_Y,4,2                      ; @ABS_Y
	.comm	_W8001_PEN_RESOLUTION,4,2       ; @W8001_PEN_RESOLUTION
	.comm	_ABS_PRESSURE,4,2               ; @ABS_PRESSURE
	.comm	_ABS_TILT_X,4,2                 ; @ABS_TILT_X
	.comm	_ABS_TILT_Y,4,2                 ; @ABS_TILT_Y
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" Penabled"

	.no_dead_strip	_w8001_setup_pen
.subsections_via_symbols
