	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wm97xx_read_samples
_wm97xx_read_samples:                   ## @wm97xx_read_samples
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	leaq	12(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	32(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	cmpq	$0, 8(%rax)
	je	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	*(%rax)
	jmp	LBB0_4
LBB0_3:
	movq	24(%rbx), %rax
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	callq	*(%rax)
LBB0_4:
	movl	%eax, %r15d
	movq	_RC_PENUP@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_10
## %bb.5:
	cmpl	$0, (%rbx)
	je	LBB0_7
## %bb.6:
	movl	$0, (%rbx)
	movl	16(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	20(%rbx), %edi
	movq	_ABS_PRESSURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_input_report_abs
	movl	20(%rbx), %edi
	movq	_BTN_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_input_report_key
	movl	20(%rbx), %edi
	callq	_input_sync
	jmp	LBB0_21
LBB0_10:
	movq	_RC_VALID@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_17
## %bb.11:
	movl	16(%rbx), %edi
	movl	-48(%rbp), %ecx
	movl	-44(%rbp), %r9d
	movl	%ecx, %edx
	sarl	$12, %edx
	andl	$4095, %ecx                     ## imm = 0xFFF
	movl	%r9d, %r8d
	sarl	$12, %r8d
	andl	$4095, %r9d                     ## imm = 0xFFF
	movl	-40(%rbp), %r10d
	movl	%r10d, %r11d
	sarl	$12, %r11d
	andl	$4095, %r10d                    ## imm = 0xFFF
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r10
	pushq	%r11
	callq	_dev_dbg
	addq	$16, %rsp
	movq	_abs_x@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	$4095, %edx                     ## imm = 0xFFF
	andl	-48(%rbp), %edx
	cmpl	%edx, (%rax)
	jg	LBB0_15
## %bb.12:
	cmpl	%edx, 4(%rax)
	jl	LBB0_15
## %bb.13:
	movq	_abs_y@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	$4095, %ecx                     ## imm = 0xFFF
	andl	-44(%rbp), %ecx
	cmpl	%ecx, (%rax)
	jg	LBB0_15
## %bb.14:
	cmpl	%ecx, 4(%rax)
	jge	LBB0_16
LBB0_15:
	movl	16(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_RC_AGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_21
LBB0_7:
	movq	_RC_AGAIN@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	jne	LBB0_21
## %bb.8:
	movl	4(%rbx), %eax
	movq	_HZ@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	imulq	$1717986919, %rcx, %rcx         ## imm = 0x66666667
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$34, %rcx
	addl	%edx, %ecx
	cmpl	%ecx, %eax
	jge	LBB0_21
## %bb.9:
	incl	%eax
	jmp	LBB0_20
LBB0_17:
	movq	_RC_PENDOWN@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_21
## %bb.18:
	movl	16(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_19:
	movl	$1, (%rbx)
	movl	8(%rbx), %eax
LBB0_20:
	movl	%eax, 4(%rbx)
LBB0_21:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movl	20(%rbx), %edi
	movq	_ABS_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_input_report_abs
	movl	20(%rbx), %edi
	movq	_ABS_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4095, %r12d                    ## imm = 0xFFF
	movl	-44(%rbp), %edx
	andl	%r12d, %edx
	callq	_input_report_abs
	movl	20(%rbx), %edi
	movq	_ABS_PRESSURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	andl	-40(%rbp), %r12d
	movl	%r12d, %edx
	callq	_input_report_abs
	movl	20(%rbx), %edi
	movq	_BTN_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	callq	_input_report_key
	movl	20(%rbx), %edi
	callq	_input_sync
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_RC_PENUP,4,2                   ## @RC_PENUP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pen up\n"

	.comm	_ABS_PRESSURE,4,2               ## @ABS_PRESSURE
	.comm	_BTN_TOUCH,4,2                  ## @BTN_TOUCH
	.comm	_RC_AGAIN,4,2                   ## @RC_AGAIN
	.comm	_HZ,4,2                         ## @HZ
	.comm	_RC_VALID,4,2                   ## @RC_VALID
L_.str.1:                               ## @.str.1
	.asciz	"pen down: x=%x:%d, y=%x:%d, pressure=%x:%d\n"

	.comm	_abs_x,8,3                      ## @abs_x
	.comm	_abs_y,8,3                      ## @abs_y
L_.str.2:                               ## @.str.2
	.asciz	"Measurement out of range, dropping it\n"

	.comm	_ABS_X,4,2                      ## @ABS_X
	.comm	_ABS_Y,4,2                      ## @ABS_Y
	.comm	_RC_PENDOWN,4,2                 ## @RC_PENDOWN
L_.str.3:                               ## @.str.3
	.asciz	"pen down\n"

	.no_dead_strip	_wm97xx_read_samples
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wm97xx_read_samples
_wm97xx_read_samples:                   ; @wm97xx_read_samples
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x21, x0
	add	x19, x0, #12
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x21, #32]
	cbz	x8, LBB0_3
; %bb.1:
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_3
; %bb.2:
	ldr	x8, [x8]
	mov	x0, x21
	blr	x8
	b	LBB0_4
LBB0_3:
	ldr	x8, [x21, #24]
	ldr	x8, [x8]
	add	x1, sp, #48
	mov	x0, x21
	blr	x8
LBB0_4:
	mov	x20, x0
Lloh0:
	adrp	x8, _RC_PENUP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RC_PENUP@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_7
; %bb.5:
	ldr	w8, [x21]
	cbz	w8, LBB0_13
; %bb.6:
	str	wzr, [x21]
	ldr	w0, [x21, #16]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	w0, [x21, #20]
Lloh5:
	adrp	x8, _ABS_PRESSURE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ABS_PRESSURE@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_input_report_abs
	ldr	w0, [x21, #20]
Lloh8:
	adrp	x8, _BTN_TOUCH@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BTN_TOUCH@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_input_report_key
	ldr	w0, [x21, #20]
	bl	_input_sync
	b	LBB0_18
LBB0_7:
Lloh11:
	adrp	x8, _RC_VALID@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RC_VALID@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_16
; %bb.8:
	ldr	w0, [x21, #16]
	ldp	w8, w9, [sp, #48]
	asr	w10, w8, #12
	and	w8, w8, #0xfff
	asr	w11, w9, #12
	and	w9, w9, #0xfff
	ldr	w12, [sp, #56]
	asr	w13, w12, #12
	and	w12, w12, #0xfff
	stp	x13, x12, [sp, #32]
	stp	x11, x9, [sp, #16]
	stp	x10, x8, [sp]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
Lloh16:
	adrp	x8, _abs_x@GOTPAGE
Lloh17:
	ldr	x8, [x8, _abs_x@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	ldr	w9, [x8]
	ldr	w10, [sp, #48]
	and	w2, w10, #0xfff
	cmp	w9, w2
	b.gt	LBB0_12
; %bb.9:
	ldr	w8, [x8, #4]
	cmp	w8, w2
	b.lt	LBB0_12
; %bb.10:
Lloh19:
	adrp	x8, _abs_y@GOTPAGE
Lloh20:
	ldr	x8, [x8, _abs_y@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	ldr	w10, [x8]
	ldr	w9, [sp, #52]
	and	w9, w9, #0xfff
	cmp	w10, w9
	b.gt	LBB0_12
; %bb.11:
	ldr	w8, [x8, #4]
	cmp	w8, w9
	b.ge	LBB0_19
LBB0_12:
	ldr	w0, [x21, #16]
Lloh22:
	adrp	x1, l_.str.2@PAGE
Lloh23:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
Lloh24:
	adrp	x8, _RC_AGAIN@GOTPAGE
Lloh25:
	ldr	x8, [x8, _RC_AGAIN@GOTPAGEOFF]
Lloh26:
	ldr	w20, [x8]
	b	LBB0_18
LBB0_13:
Lloh27:
	adrp	x8, _RC_AGAIN@GOTPAGE
Lloh28:
	ldr	x8, [x8, _RC_AGAIN@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	tst	w8, w20
	b.ne	LBB0_18
; %bb.14:
	ldr	w8, [x21, #4]
Lloh30:
	adrp	x9, _HZ@GOTPAGE
Lloh31:
	ldr	x9, [x9, _HZ@GOTPAGEOFF]
Lloh32:
	ldrsw	x9, [x9]
	mov	w10, #26215
	movk	w10, #26214, lsl #16
	mul	x9, x9, x10
	lsr	x10, x9, #63
	asr	x9, x9, #34
	add	w9, w9, w10
	cmp	w8, w9
	b.ge	LBB0_18
; %bb.15:
	add	w8, w8, #1
	str	w8, [x21, #4]
	b	LBB0_18
LBB0_16:
Lloh33:
	adrp	x8, _RC_PENDOWN@GOTPAGE
Lloh34:
	ldr	x8, [x8, _RC_PENDOWN@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_18
; %bb.17:
	ldr	w0, [x21, #16]
Lloh36:
	adrp	x1, l_.str.3@PAGE
Lloh37:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_dbg
	mov	w8, #1
	ldr	w9, [x21, #8]
	stp	w8, w9, [x21]
LBB0_18:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	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
	add	sp, sp, #112
	ret
LBB0_19:
	ldr	w0, [x21, #20]
Lloh38:
	adrp	x8, _ABS_X@GOTPAGE
Lloh39:
	ldr	x8, [x8, _ABS_X@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
	bl	_input_report_abs
	ldr	w0, [x21, #20]
Lloh41:
	adrp	x8, _ABS_Y@GOTPAGE
Lloh42:
	ldr	x8, [x8, _ABS_Y@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
	ldr	w8, [sp, #52]
	and	w2, w8, #0xfff
	bl	_input_report_abs
	ldr	w0, [x21, #20]
Lloh44:
	adrp	x8, _ABS_PRESSURE@GOTPAGE
Lloh45:
	ldr	x8, [x8, _ABS_PRESSURE@GOTPAGEOFF]
Lloh46:
	ldr	w1, [x8]
	ldr	w8, [sp, #56]
	and	w2, w8, #0xfff
	bl	_input_report_abs
	ldr	w0, [x21, #20]
Lloh47:
	adrp	x8, _BTN_TOUCH@GOTPAGE
Lloh48:
	ldr	x8, [x8, _BTN_TOUCH@GOTPAGEOFF]
Lloh49:
	ldr	w1, [x8]
	mov	w22, #1
	mov	w2, #1
	bl	_input_report_key
	ldr	w0, [x21, #20]
	bl	_input_sync
	ldr	w8, [x21, #8]
	stp	w22, w8, [x21]
	b	LBB0_18
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_RC_PENUP,4,2                   ; @RC_PENUP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pen up\n"

	.comm	_ABS_PRESSURE,4,2               ; @ABS_PRESSURE
	.comm	_BTN_TOUCH,4,2                  ; @BTN_TOUCH
	.comm	_RC_AGAIN,4,2                   ; @RC_AGAIN
	.comm	_HZ,4,2                         ; @HZ
	.comm	_RC_VALID,4,2                   ; @RC_VALID
l_.str.1:                               ; @.str.1
	.asciz	"pen down: x=%x:%d, y=%x:%d, pressure=%x:%d\n"

	.comm	_abs_x,8,3                      ; @abs_x
	.comm	_abs_y,8,3                      ; @abs_y
l_.str.2:                               ; @.str.2
	.asciz	"Measurement out of range, dropping it\n"

	.comm	_ABS_X,4,2                      ; @ABS_X
	.comm	_ABS_Y,4,2                      ; @ABS_Y
	.comm	_RC_PENDOWN,4,2                 ; @RC_PENDOWN
l_.str.3:                               ; @.str.3
	.asciz	"pen down\n"

	.no_dead_strip	_wm97xx_read_samples
.subsections_via_symbols
