	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function w8001_setup_touch
_w8001_setup_touch:                     ## @w8001_setup_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	$40, %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, %rbx
	movq	64(%rdi), %r12
	movq	_W8001_CMD_TOUCHQUERY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	callq	_w8001_command
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_18
## %bb.1:
	movq	56(%rbx), %rax
	cmpl	$0, 4(%rax)
	je	LBB0_2
## %bb.3:
	movq	_EV_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%r12), %esi
	callq	___set_bit
	movq	_EV_ABS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%r12), %esi
	callq	___set_bit
	movq	_BTN_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r12), %esi
	callq	___set_bit
	movq	_INPUT_PROP_DIRECT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	4(%r12), %esi
	callq	___set_bit
	movq	56(%rbx), %rdi
	leaq	-64(%rbp), %rsi
	callq	_parse_touchquery
	movq	-48(%rbp), %rcx
	movups	-56(%rbp), %xmm0
	movups	%xmm0, 40(%rbx)
	movq	16(%rbx), %rax
	testq	%rax, %rax
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_6
## %bb.4:
	movq	8(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_6
## %bb.5:
	movq	%rax, -48(%rbp)
	movq	%rdx, -56(%rbp)
	movq	_W8001_PEN_RESOLUTION@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -60(%rbp)
	movq	%rax, %rcx
LBB0_6:
	movq	_ABS_X@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	xorl	%r13d, %r13d
	movq	%r12, %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	-56(%rbp), %rcx
	movq	%r12, %rdi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_input_set_abs_params
	movl	(%r14), %esi
	movl	-60(%rbp), %edx
	movq	%r12, %rdi
	callq	_input_abs_set_res
	movl	(%r15), %esi
	movl	-60(%rbp), %edx
	movq	%r12, %rdi
	callq	_input_abs_set_res
	movl	-64(%rbp), %eax
	cmpl	$5, %eax
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	ja	LBB0_17
## %bb.7:
	movl	$26, %ecx
	btl	%eax, %ecx
	jae	LBB0_8
## %bb.10:
	movq	_W8001_PKTLEN_TOUCH9A@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_strlcat
	movl	$154, (%rbx)
	jmp	LBB0_17
LBB0_2:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_18
LBB0_8:
	movl	$5, %ecx
	btl	%eax, %ecx
	jae	LBB0_11
## %bb.9:
	movq	_W8001_PKTLEN_TOUCH93@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movl	$147, (%rbx)
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_strlcat
LBB0_17:
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_strlcat
LBB0_18:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	_W8001_PKTLEN_TOUCH2FG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	_BTN_TOOL_DOUBLETAP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r12), %esi
	callq	___set_bit
	movq	%r12, %rdi
	movl	$2, %esi
	xorl	%edx, %edx
	callq	_input_mt_init_slots
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movq	24(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	movl	%eax, %r13d
	callq	_dev_err
	jmp	LBB0_18
LBB0_13:
	movq	_ABS_MT_POSITION_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-48(%rbp), %rcx
	movq	%r12, %rdi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_input_set_abs_params
	movq	_ABS_MT_POSITION_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-56(%rbp), %rcx
	movq	%r12, %rdi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_input_set_abs_params
	movq	_ABS_MT_TOOL_TYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MT_TOOL_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%r12, %rdi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_input_set_abs_params
	movq	_ABS_MT_POSITION_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-60(%rbp), %edx
	movq	%r12, %rdi
	callq	_input_abs_set_res
	movq	_ABS_MT_POSITION_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-60(%rbp), %edx
	movq	%r12, %rdi
	callq	_input_abs_set_res
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_strlcat
	cmpq	$0, 16(%rbx)
	je	LBB0_16
## %bb.14:
	cmpq	$0, 8(%rbx)
	je	LBB0_16
## %bb.15:
	movl	$227, (%rbx)
	jmp	LBB0_17
LBB0_16:
	movl	$226, (%rbx)
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_W8001_CMD_TOUCHQUERY,4,2       ## @W8001_CMD_TOUCHQUERY
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_EV_KEY,4,2                     ## @EV_KEY
	.comm	_EV_ABS,4,2                     ## @EV_ABS
	.comm	_BTN_TOUCH,4,2                  ## @BTN_TOUCH
	.comm	_INPUT_PROP_DIRECT,4,2          ## @INPUT_PROP_DIRECT
	.comm	_W8001_PEN_RESOLUTION,4,2       ## @W8001_PEN_RESOLUTION
	.comm	_ABS_X,4,2                      ## @ABS_X
	.comm	_ABS_Y,4,2                      ## @ABS_Y
	.comm	_W8001_PKTLEN_TOUCH93,4,2       ## @W8001_PKTLEN_TOUCH93
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	" 1FG"

	.comm	_W8001_PKTLEN_TOUCH9A,4,2       ## @W8001_PKTLEN_TOUCH9A
	.comm	_W8001_PKTLEN_TOUCH2FG,4,2      ## @W8001_PKTLEN_TOUCH2FG
	.comm	_BTN_TOOL_DOUBLETAP,4,2         ## @BTN_TOOL_DOUBLETAP
L_.str.1:                               ## @.str.1
	.asciz	"failed to initialize MT slots: %d\n"

	.comm	_ABS_MT_POSITION_X,4,2          ## @ABS_MT_POSITION_X
	.comm	_ABS_MT_POSITION_Y,4,2          ## @ABS_MT_POSITION_Y
	.comm	_ABS_MT_TOOL_TYPE,4,2           ## @ABS_MT_TOOL_TYPE
	.comm	_MT_TOOL_MAX,8,3                ## @MT_TOOL_MAX
L_.str.2:                               ## @.str.2
	.asciz	" 2FG"

L_.str.3:                               ## @.str.3
	.asciz	" Touchscreen"

	.no_dead_strip	_w8001_setup_touch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function w8001_setup_touch
_w8001_setup_touch:                     ; @w8001_setup_touch
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x22, [x0, #64]
Lloh0:
	adrp	x8, _W8001_CMD_TOUCHQUERY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _W8001_CMD_TOUCHQUERY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #1
	bl	_w8001_command
	mov	x23, x0
	cbnz	w0, LBB0_13
; %bb.1:
	ldr	x8, [x21, #56]
	ldr	w8, [x8, #4]
	cbz	w8, LBB0_9
; %bb.2:
Lloh3:
	adrp	x8, _EV_KEY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EV_KEY@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ldr	w1, [x22, #8]
	bl	___set_bit
Lloh6:
	adrp	x8, _EV_ABS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EV_ABS@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	ldr	w1, [x22, #8]
	bl	___set_bit
Lloh9:
	adrp	x8, _BTN_TOUCH@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BTN_TOUCH@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	ldr	w1, [x22]
	bl	___set_bit
Lloh12:
	adrp	x8, _INPUT_PROP_DIRECT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _INPUT_PROP_DIRECT@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	ldr	w1, [x22, #4]
	bl	___set_bit
	ldr	x0, [x21, #56]
	add	x1, sp, #8
	bl	_parse_touchquery
	ldp	x8, x3, [sp, #16]
	stp	x8, x3, [x21, #40]
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_5
; %bb.3:
	ldr	x9, [x21, #8]
	cbz	x9, LBB0_5
; %bb.4:
	stp	x9, x8, [sp, #16]
Lloh15:
	adrp	x9, _W8001_PEN_RESOLUTION@GOTPAGE
Lloh16:
	ldr	x9, [x9, _W8001_PEN_RESOLUTION@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	str	w9, [sp, #12]
	mov	x3, x8
LBB0_5:
Lloh18:
	adrp	x23, _ABS_X@GOTPAGE
Lloh19:
	ldr	x23, [x23, _ABS_X@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x22
	mov	w2, #0
	mov	w4, #0
	mov	w5, #0
	bl	_input_set_abs_params
Lloh20:
	adrp	x24, _ABS_Y@GOTPAGE
Lloh21:
	ldr	x24, [x24, _ABS_Y@GOTPAGEOFF]
	ldr	w1, [x24]
	ldr	x3, [sp, #16]
	mov	x0, x22
	mov	w2, #0
	mov	w4, #0
	mov	w5, #0
	bl	_input_set_abs_params
	ldr	w1, [x23]
	ldr	w2, [sp, #12]
	mov	x0, x22
	bl	_input_abs_set_res
	ldr	w1, [x24]
	ldr	w2, [sp, #12]
	mov	x0, x22
	bl	_input_abs_set_res
	ldr	w8, [sp, #8]
	cmp	w8, #5
	b.hi	LBB0_12
; %bb.6:
	mov	w9, #1
	lsl	w8, w9, w8
	mov	w9, #26
	tst	w8, w9
	b.eq	LBB0_10
; %bb.7:
Lloh22:
	adrp	x8, _W8001_PKTLEN_TOUCH9A@GOTPAGE
Lloh23:
	ldr	x8, [x8, _W8001_PKTLEN_TOUCH9A@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	str	w8, [x21, #32]
Lloh25:
	adrp	x1, l_.str@PAGE
Lloh26:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	bl	_strlcat
	mov	w8, #154
LBB0_8:
	str	w8, [x21]
	b	LBB0_12
LBB0_9:
Lloh27:
	adrp	x8, _ENXIO@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_13
LBB0_10:
	mov	w9, #5
	tst	w8, w9
	b.eq	LBB0_14
; %bb.11:
Lloh30:
	adrp	x8, _W8001_PKTLEN_TOUCH93@GOTPAGE
Lloh31:
	ldr	x8, [x8, _W8001_PKTLEN_TOUCH93@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	str	w8, [x21, #32]
	mov	w8, #147
	str	w8, [x21]
Lloh33:
	adrp	x1, l_.str@PAGE
Lloh34:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	bl	_strlcat
LBB0_12:
Lloh35:
	adrp	x1, l_.str.3@PAGE
Lloh36:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	bl	_strlcat
	mov	w23, #0
LBB0_13:
	mov	x0, x23
	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
	add	sp, sp, #96
	ret
LBB0_14:
Lloh37:
	adrp	x8, _W8001_PKTLEN_TOUCH2FG@GOTPAGE
Lloh38:
	ldr	x8, [x8, _W8001_PKTLEN_TOUCH2FG@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	str	w8, [x21, #32]
Lloh40:
	adrp	x8, _BTN_TOOL_DOUBLETAP@GOTPAGE
Lloh41:
	ldr	x8, [x8, _BTN_TOOL_DOUBLETAP@GOTPAGEOFF]
Lloh42:
	ldr	w0, [x8]
	ldr	w1, [x22]
	bl	___set_bit
	mov	x0, x22
	mov	w1, #2
	mov	w2, #0
	bl	_input_mt_init_slots
	cbz	w0, LBB0_16
; %bb.15:
	mov	x23, x0
	ldr	x0, [x21, #24]
Lloh43:
	adrp	x1, l_.str.1@PAGE
Lloh44:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x23
	bl	_dev_err
	b	LBB0_13
LBB0_16:
Lloh45:
	adrp	x23, _ABS_MT_POSITION_X@GOTPAGE
Lloh46:
	ldr	x23, [x23, _ABS_MT_POSITION_X@GOTPAGEOFF]
	ldr	w1, [x23]
	ldr	x3, [sp, #24]
	mov	x0, x22
	mov	w2, #0
	mov	w4, #0
	mov	w5, #0
	bl	_input_set_abs_params
Lloh47:
	adrp	x24, _ABS_MT_POSITION_Y@GOTPAGE
Lloh48:
	ldr	x24, [x24, _ABS_MT_POSITION_Y@GOTPAGEOFF]
	ldr	w1, [x24]
	ldr	x3, [sp, #16]
	mov	x0, x22
	mov	w2, #0
	mov	w4, #0
	mov	w5, #0
	bl	_input_set_abs_params
Lloh49:
	adrp	x8, _ABS_MT_TOOL_TYPE@GOTPAGE
Lloh50:
	ldr	x8, [x8, _ABS_MT_TOOL_TYPE@GOTPAGEOFF]
Lloh51:
	ldr	w1, [x8]
Lloh52:
	adrp	x8, _MT_TOOL_MAX@GOTPAGE
Lloh53:
	ldr	x8, [x8, _MT_TOOL_MAX@GOTPAGEOFF]
Lloh54:
	ldr	x3, [x8]
	mov	x0, x22
	mov	w2, #0
	mov	w4, #0
	mov	w5, #0
	bl	_input_set_abs_params
	ldr	w1, [x23]
	ldr	w2, [sp, #12]
	mov	x0, x22
	bl	_input_abs_set_res
	ldr	w1, [x24]
	ldr	w2, [sp, #12]
	mov	x0, x22
	bl	_input_abs_set_res
Lloh55:
	adrp	x1, l_.str.2@PAGE
Lloh56:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	bl	_strlcat
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_19
; %bb.17:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_19
; %bb.18:
	mov	w8, #227
	b	LBB0_8
LBB0_19:
	mov	w8, #226
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpAdd	Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGot	Lloh47, Lloh48
	.loh AdrpLdrGot	Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.comm	_W8001_CMD_TOUCHQUERY,4,2       ; @W8001_CMD_TOUCHQUERY
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_EV_KEY,4,2                     ; @EV_KEY
	.comm	_EV_ABS,4,2                     ; @EV_ABS
	.comm	_BTN_TOUCH,4,2                  ; @BTN_TOUCH
	.comm	_INPUT_PROP_DIRECT,4,2          ; @INPUT_PROP_DIRECT
	.comm	_W8001_PEN_RESOLUTION,4,2       ; @W8001_PEN_RESOLUTION
	.comm	_ABS_X,4,2                      ; @ABS_X
	.comm	_ABS_Y,4,2                      ; @ABS_Y
	.comm	_W8001_PKTLEN_TOUCH93,4,2       ; @W8001_PKTLEN_TOUCH93
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" 1FG"

	.comm	_W8001_PKTLEN_TOUCH9A,4,2       ; @W8001_PKTLEN_TOUCH9A
	.comm	_W8001_PKTLEN_TOUCH2FG,4,2      ; @W8001_PKTLEN_TOUCH2FG
	.comm	_BTN_TOOL_DOUBLETAP,4,2         ; @BTN_TOOL_DOUBLETAP
l_.str.1:                               ; @.str.1
	.asciz	"failed to initialize MT slots: %d\n"

	.comm	_ABS_MT_POSITION_X,4,2          ; @ABS_MT_POSITION_X
	.comm	_ABS_MT_POSITION_Y,4,2          ; @ABS_MT_POSITION_Y
	.comm	_ABS_MT_TOOL_TYPE,4,2           ; @ABS_MT_TOOL_TYPE
	.comm	_MT_TOOL_MAX,8,3                ; @MT_TOOL_MAX
l_.str.2:                               ; @.str.2
	.asciz	" 2FG"

l_.str.3:                               ; @.str.3
	.asciz	" Touchscreen"

	.no_dead_strip	_w8001_setup_touch
.subsections_via_symbols
