	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wm97xx_acc_pen_down
_wm97xx_acc_pen_down:                   ## @wm97xx_acc_pen_down
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_WM97XX_ADCSEL_PRES@GOTPCREL(%rip), %r15
	movl	$256, %r12d                     ## imm = 0x100
	orl	(%r15), %r12d
	movl	$1, %edi
	callq	_msleep
	movl	_wm97xx_acc_pen_down.tries(%rip), %eax
	cmpl	$6, %eax
	jl	LBB0_2
## %bb.1:
	movl	$0, _wm97xx_acc_pen_down.tries(%rip)
	movq	_RC_PENUP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_11
LBB0_2:
	movq	_MODR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	cmpl	_wm97xx_acc_pen_down.last(%rip), %ebx
	jne	LBB0_4
## %bb.3:
	incl	%eax
	movl	%eax, _wm97xx_acc_pen_down.tries(%rip)
	movq	_RC_AGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_11
LBB0_4:
	movl	%ebx, _wm97xx_acc_pen_down.last(%rip)
	movq	_WM97XX_ADCSRC_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	andl	%ebx, %ecx
	movq	_WM97XX_ADCSEL_X@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_10
## %bb.5:
	movq	_pressure@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	cmovnel	%ebx, %r12d
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	%eax, %ecx
	andl	%ebx, %ecx
	movq	_WM97XX_ADCSEL_Y@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	andl	%r12d, %eax
	cmpl	(%r15), %eax
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	$0, _wm97xx_acc_pen_down.tries(%rip)
	movl	(%r14), %edi
	movq	_ABS_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	andl	$4095, %ebx                     ## imm = 0xFFF
	movl	%ebx, %edx
	callq	_input_report_abs
	movl	(%r14), %edi
	movq	_ABS_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edx
	callq	_input_report_abs
	movl	(%r14), %edi
	movq	_ABS_PRESSURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r12d, %edx
	andl	$4095, %edx                     ## imm = 0xFFF
	callq	_input_report_abs
	movl	(%r14), %edi
	movq	_BTN_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	testl	%r12d, %r12d
	setne	%dl
	callq	_input_report_key
	movl	(%r14), %edi
	callq	_input_sync
	incl	%r13d
	movq	_cinfo@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_sp_idx@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpl	(%rax,%rcx,4), %r13d
	jge	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	_MODR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_pressure@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	cmovnel	%ebx, %r12d
	movq	_WM97XX_ADCSRC_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	andl	%ebx, %ecx
	movq	_WM97XX_ADCSEL_X@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	je	LBB0_6
LBB0_10:
	movq	_RC_PENDOWN@GOTPCREL(%rip), %rcx
	movq	_RC_AGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WM97XX_ADCSEL_PRES,4,2         ## @WM97XX_ADCSEL_PRES
.zerofill __DATA,__bss,_wm97xx_acc_pen_down.last,4,2 ## @wm97xx_acc_pen_down.last
.zerofill __DATA,__bss,_wm97xx_acc_pen_down.tries,4,2 ## @wm97xx_acc_pen_down.tries
	.comm	_RC_PENUP,4,2                   ## @RC_PENUP
	.comm	_MODR,4,2                       ## @MODR
	.comm	_RC_AGAIN,4,2                   ## @RC_AGAIN
	.comm	_pressure,8,3                   ## @pressure
	.comm	_WM97XX_ADCSRC_MASK,4,2         ## @WM97XX_ADCSRC_MASK
	.comm	_WM97XX_ADCSEL_X,4,2            ## @WM97XX_ADCSEL_X
	.comm	_WM97XX_ADCSEL_Y,4,2            ## @WM97XX_ADCSEL_Y
	.comm	_ABS_X,4,2                      ## @ABS_X
	.comm	_ABS_Y,4,2                      ## @ABS_Y
	.comm	_ABS_PRESSURE,4,2               ## @ABS_PRESSURE
	.comm	_BTN_TOUCH,4,2                  ## @BTN_TOUCH
	.comm	_cinfo,8,3                      ## @cinfo
	.comm	_sp_idx,8,3                     ## @sp_idx
	.comm	_RC_PENDOWN,4,2                 ## @RC_PENDOWN
	.no_dead_strip	_wm97xx_acc_pen_down
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wm97xx_acc_pen_down
_wm97xx_acc_pen_down:                   ; @wm97xx_acc_pen_down
	.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
	mov	x19, x0
Lloh0:
	adrp	x21, _WM97XX_ADCSEL_PRES@GOTPAGE
Lloh1:
	ldr	x21, [x21, _WM97XX_ADCSEL_PRES@GOTPAGEOFF]
	ldr	w20, [x21]
	mov	w0, #1
	bl	_msleep
	adrp	x22, _wm97xx_acc_pen_down.tries@PAGE
	ldr	w9, [x22, _wm97xx_acc_pen_down.tries@PAGEOFF]
	cmp	w9, #6
	b.lt	LBB0_2
; %bb.1:
	str	wzr, [x22, _wm97xx_acc_pen_down.tries@PAGEOFF]
Lloh2:
	adrp	x8, _RC_PENUP@GOTPAGE
Lloh3:
	ldr	x8, [x8, _RC_PENUP@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	b	LBB0_11
LBB0_2:
Lloh5:
	adrp	x23, _MODR@GOTPAGE
Lloh6:
	ldr	x23, [x23, _MODR@GOTPAGEOFF]
	ldr	w8, [x23]
	adrp	x10, _wm97xx_acc_pen_down.last@PAGE
	ldr	w11, [x10, _wm97xx_acc_pen_down.last@PAGEOFF]
	cmp	w8, w11
	b.ne	LBB0_4
; %bb.3:
	add	w8, w9, #1
	str	w8, [x22, _wm97xx_acc_pen_down.tries@PAGEOFF]
Lloh7:
	adrp	x8, _RC_AGAIN@GOTPAGE
Lloh8:
	ldr	x8, [x8, _RC_AGAIN@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	b	LBB0_11
LBB0_4:
	str	w8, [x10, _wm97xx_acc_pen_down.last@PAGEOFF]
Lloh10:
	adrp	x24, _WM97XX_ADCSRC_MASK@GOTPAGE
Lloh11:
	ldr	x24, [x24, _WM97XX_ADCSRC_MASK@GOTPAGEOFF]
	ldr	w9, [x24]
	and	w10, w9, w8
Lloh12:
	adrp	x25, _WM97XX_ADCSEL_X@GOTPAGE
Lloh13:
	ldr	x25, [x25, _WM97XX_ADCSEL_X@GOTPAGEOFF]
	ldr	w11, [x25]
	cmp	w10, w11
	b.ne	LBB0_10
; %bb.5:
	mov	w26, #0
Lloh14:
	adrp	x11, _pressure@GOTPAGE
Lloh15:
	ldr	x11, [x11, _pressure@GOTPAGEOFF]
	orr	w10, w20, #0x100
Lloh16:
	ldr	x11, [x11]
	cmp	x11, #0
	csel	w28, w10, w8, eq
Lloh17:
	adrp	x27, _WM97XX_ADCSEL_Y@GOTPAGE
Lloh18:
	ldr	x27, [x27, _WM97XX_ADCSEL_Y@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	and	w10, w9, w8
	ldr	w11, [x27]
	cmp	w10, w11
	b.ne	LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	and	w9, w28, w9
	ldr	w10, [x21]
	cmp	w9, w10
	b.ne	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	str	wzr, [x22, _wm97xx_acc_pen_down.tries@PAGEOFF]
	ldr	w0, [x19]
Lloh19:
	adrp	x9, _ABS_X@GOTPAGE
Lloh20:
	ldr	x9, [x9, _ABS_X@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x9]
	and	w20, w8, #0xfff
	mov	x2, x20
	bl	_input_report_abs
	ldr	w0, [x19]
Lloh22:
	adrp	x8, _ABS_Y@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ABS_Y@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x2, x20
	bl	_input_report_abs
	ldr	w0, [x19]
Lloh25:
	adrp	x8, _ABS_PRESSURE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ABS_PRESSURE@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	and	w2, w28, #0xfff
	bl	_input_report_abs
	ldr	w0, [x19]
Lloh28:
	adrp	x8, _BTN_TOUCH@GOTPAGE
Lloh29:
	ldr	x8, [x8, _BTN_TOUCH@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	cmp	w28, #0
	cset	w2, ne
	bl	_input_report_key
	ldr	w0, [x19]
	bl	_input_sync
	add	w26, w26, #1
Lloh31:
	adrp	x8, _cinfo@GOTPAGE
Lloh32:
	ldr	x8, [x8, _cinfo@GOTPAGEOFF]
Lloh33:
	ldr	x8, [x8]
Lloh34:
	adrp	x9, _sp_idx@GOTPAGE
Lloh35:
	ldr	x9, [x9, _sp_idx@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	ldr	w8, [x8, x9, lsl #2]
	cmp	w26, w8
	b.ge	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x23]
Lloh37:
	adrp	x9, _pressure@GOTPAGE
Lloh38:
	ldr	x9, [x9, _pressure@GOTPAGEOFF]
Lloh39:
	ldr	x9, [x9]
	cmp	x9, #0
	csel	w28, w28, w8, eq
	ldr	w9, [x24]
	and	w10, w9, w8
	ldr	w11, [x25]
	cmp	w10, w11
	b.eq	LBB0_6
LBB0_10:
Lloh40:
	adrp	x8, _RC_PENDOWN@GOTPAGE
Lloh41:
	ldr	x8, [x8, _RC_PENDOWN@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
Lloh43:
	adrp	x9, _RC_AGAIN@GOTPAGE
Lloh44:
	ldr	x9, [x9, _RC_AGAIN@GOTPAGEOFF]
Lloh45:
	ldr	w9, [x9]
	orr	w0, w9, w8
LBB0_11:
	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	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_WM97XX_ADCSEL_PRES,4,2         ; @WM97XX_ADCSEL_PRES
.zerofill __DATA,__bss,_wm97xx_acc_pen_down.last,4,2 ; @wm97xx_acc_pen_down.last
.zerofill __DATA,__bss,_wm97xx_acc_pen_down.tries,4,2 ; @wm97xx_acc_pen_down.tries
	.comm	_RC_PENUP,4,2                   ; @RC_PENUP
	.comm	_MODR,4,2                       ; @MODR
	.comm	_RC_AGAIN,4,2                   ; @RC_AGAIN
	.comm	_pressure,8,3                   ; @pressure
	.comm	_WM97XX_ADCSRC_MASK,4,2         ; @WM97XX_ADCSRC_MASK
	.comm	_WM97XX_ADCSEL_X,4,2            ; @WM97XX_ADCSEL_X
	.comm	_WM97XX_ADCSEL_Y,4,2            ; @WM97XX_ADCSEL_Y
	.comm	_ABS_X,4,2                      ; @ABS_X
	.comm	_ABS_Y,4,2                      ; @ABS_Y
	.comm	_ABS_PRESSURE,4,2               ; @ABS_PRESSURE
	.comm	_BTN_TOUCH,4,2                  ; @BTN_TOUCH
	.comm	_cinfo,8,3                      ; @cinfo
	.comm	_sp_idx,8,3                     ; @sp_idx
	.comm	_RC_PENDOWN,4,2                 ; @RC_PENDOWN
	.no_dead_strip	_wm97xx_acc_pen_down
.subsections_via_symbols
