	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wacom_intuos_inout
_wacom_intuos_inout:                    ## @wacom_intuos_inout
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	(%rdi), %rdx
	movq	40(%rdi), %rdi
	movq	_INTUOS@GOTPCREL(%rip), %rcx
	movzbl	1(%rdx), %esi
	movl	%esi, %ebx
	andl	$1, %ebx
	xorl	%eax, %eax
	cmpq	(%rcx), %rdi
	cmovneq	%rax, %rbx
	movl	%esi, %ecx
	andb	$-4, %cl
	cmpb	$-64, %cl
	jne	LBB0_2
## %bb.1:
	movb	6(%rdx), %al
	movb	7(%rdx), %cl
	shrb	$4, %cl
	shlb	$4, %al
	orb	%cl, %al
	movq	8(%r15), %rcx
	movb	%al, (%rcx,%rbx)
	movb	2(%rdx), %al
	movb	3(%rdx), %cl
	shrb	$4, %cl
	shlb	$4, %al
	orb	%cl, %al
	movq	16(%r15), %rcx
	movb	%al, (%rcx,%rbx)
	movq	16(%r15), %rax
	movzbl	(%rax,%rbx), %edi
	callq	_wacom_intuos_get_tool_type
	movq	56(%r15), %rcx
	movl	%eax, (%rcx,%rbx,4)
	movq	32(%r15), %rax
	movl	$1, (%rax)
LBB0_12:
	movl	$1, %eax
	jmp	LBB0_13
LBB0_2:
	andb	$-2, %sil
	cmpb	$-128, %sil
	je	LBB0_8
## %bb.3:
	cmpb	$32, %sil
	jne	LBB0_13
## %bb.4:
	movq	64(%r15), %r14
	movq	_INTUOSHT2@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	je	LBB0_6
## %bb.5:
	movq	32(%r15), %rax
	movl	$1, (%rax)
LBB0_6:
	cmpl	$0, 24(%r15)
	je	LBB0_12
## %bb.7:
	movq	_BTN_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_input_report_key
	movq	_ABS_PRESSURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_input_report_abs
	movq	_ABS_DISTANCE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	48(%r15), %edx
	movq	%r14, %rdi
	callq	_input_report_abs
	jmp	LBB0_10
LBB0_8:
	movq	32(%r15), %rax
	movl	$0, (%rax)
	movl	$0, 24(%r15)
	movq	16(%r15), %rax
	cmpb	$0, (%rax,%rbx)
	je	LBB0_12
## %bb.9:
	movq	%r15, %rdi
	callq	_wacom_exit_report
LBB0_10:
	movl	$2, %eax
LBB0_13:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INTUOS,8,3                     ## @INTUOS
	.comm	_INTUOSHT2,8,3                  ## @INTUOSHT2
	.comm	_BTN_TOUCH,4,2                  ## @BTN_TOUCH
	.comm	_ABS_PRESSURE,4,2               ## @ABS_PRESSURE
	.comm	_ABS_DISTANCE,4,2               ## @ABS_DISTANCE
	.no_dead_strip	_wacom_intuos_inout
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wacom_intuos_inout
_wacom_intuos_inout:                    ; @wacom_intuos_inout
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0]
	ldr	x9, [x0, #40]
Lloh0:
	adrp	x10, _INTUOS@GOTPAGE
Lloh1:
	ldr	x10, [x10, _INTUOS@GOTPAGEOFF]
Lloh2:
	ldr	x11, [x10]
	ldrb	w10, [x8, #1]
	and	w12, w10, #0x1
	cmp	x9, x11
	csel	x20, x12, xzr, eq
	and	w11, w10, #0xfc
	cmp	w11, #192
	b.ne	LBB0_2
; %bb.1:
	ldrb	w9, [x8, #6]
	ldrb	w10, [x8, #7]
	lsl	w10, w10, #24
	extr	w9, w9, w10, #28
	ldr	x10, [x19, #8]
	strb	w9, [x10, x20]
	ldrb	w9, [x8, #2]
	ldrb	w8, [x8, #3]
	lsl	w8, w8, #24
	extr	w8, w9, w8, #28
	ldr	x9, [x19, #16]
	strb	w8, [x9, x20]
	ldr	x8, [x19, #16]
	ldrb	w0, [x8, x20]
	bl	_wacom_intuos_get_tool_type
	ldr	x8, [x19, #56]
	str	w0, [x8, x20, lsl #2]
	ldr	x8, [x19, #32]
	mov	w0, #1
	str	w0, [x8]
	b	LBB0_13
LBB0_2:
	and	w8, w10, #0xfe
	cmp	w8, #32
	b.eq	LBB0_6
; %bb.3:
	cmp	w8, #128
	b.ne	LBB0_11
; %bb.4:
	ldr	x8, [x19, #32]
	str	wzr, [x8]
	str	wzr, [x19, #24]
	ldr	x8, [x19, #16]
	ldrb	w8, [x8, x20]
	cbz	w8, LBB0_12
; %bb.5:
	mov	x0, x19
	bl	_wacom_exit_report
	b	LBB0_10
LBB0_6:
	ldr	x20, [x19, #64]
Lloh3:
	adrp	x8, _INTUOSHT2@GOTPAGE
Lloh4:
	ldr	x8, [x8, _INTUOSHT2@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x9, x8
	b.eq	LBB0_8
; %bb.7:
	ldr	x8, [x19, #32]
	mov	w9, #1
	str	w9, [x8]
LBB0_8:
	ldr	w8, [x19, #24]
	cbz	w8, LBB0_12
; %bb.9:
Lloh6:
	adrp	x8, _BTN_TOUCH@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BTN_TOUCH@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_input_report_key
Lloh9:
	adrp	x8, _ABS_PRESSURE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ABS_PRESSURE@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_input_report_abs
Lloh12:
	adrp	x8, _ABS_DISTANCE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ABS_DISTANCE@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	ldr	w2, [x19, #48]
	mov	x0, x20
	bl	_input_report_abs
LBB0_10:
	mov	w0, #2
	b	LBB0_13
LBB0_11:
	mov	w0, #0
	b	LBB0_13
LBB0_12:
	mov	w0, #1
LBB0_13:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_INTUOS,8,3                     ; @INTUOS
	.comm	_INTUOSHT2,8,3                  ; @INTUOSHT2
	.comm	_BTN_TOUCH,4,2                  ; @BTN_TOUCH
	.comm	_ABS_PRESSURE,4,2               ; @ABS_PRESSURE
	.comm	_ABS_DISTANCE,4,2               ; @ABS_DISTANCE
	.no_dead_strip	_wacom_intuos_inout
.subsections_via_symbols
