	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_xydata
_read_xydata:                           ## @read_xydata
	.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, %r12
	callq	_local_irq_save
	xorl	%eax, %eax
	callq	_corgi_ssp_ads7846_lock
	movq	%r12, %rdi
	callq	_calc_waittime
	movq	%rax, %rbx
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$1, %edx
	movl	$1, %ecx
	movq	%rax, %r8
	callq	_sync_receive_data_send_cmd
	movq	%r12, %rdi
	movl	$1, %esi
	movl	$1, %edx
	movl	$1, %ecx
	movq	%rbx, %r8
	callq	_sync_receive_data_send_cmd
	movq	%r12, %rdi
	movl	$1, %esi
	movl	$1, %edx
	movl	$5, %ecx
	movq	%rbx, %r8
	callq	_sync_receive_data_send_cmd
	movl	%eax, %r14d
	movq	%r12, %rdi
	movl	$1, %esi
	movl	$1, %edx
	movl	$3, %ecx
	movq	%rbx, %r8
	callq	_sync_receive_data_send_cmd
	movl	%eax, %r15d
	movq	%r12, %rdi
	movl	$1, %esi
	movl	$1, %edx
	movl	$4, %ecx
	movq	%rbx, %r8
	callq	_sync_receive_data_send_cmd
	movl	%eax, %r13d
	movq	%r12, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	movl	$4, %ecx
	movq	%rbx, %r8
	callq	_sync_receive_data_send_cmd
	movl	%eax, %ebx
	movq	_ADSCTRL_ADR_SH@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	movq	_ADSCTRL_STS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	btsl	%eax, %edi
	callq	_corgi_ssp_ads7846_put
	xorl	%eax, %eax
	callq	_corgi_ssp_ads7846_get
	xorl	%eax, %eax
	callq	_corgi_ssp_ads7846_unlock
	callq	_local_irq_restore
	testl	%r15d, %r15d
	je	LBB0_1
## %bb.2:
	testl	%r14d, %r14d
	je	LBB0_1
## %bb.3:
	movl	$0, %eax
	testl	%r13d, %r13d
	movl	$0, %esi
	je	LBB0_6
## %bb.4:
	subl	%r13d, %ebx
	imull	%r15d, %ebx
	xorl	%esi, %esi
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%r13d
	movl	%eax, %ecx
	movl	$0, %eax
	cmpl	$14999, %ecx                    ## imm = 0x3A97
	ja	LBB0_6
## %bb.5:
	movl	%r15d, 4(%r12)
	movl	%r14d, 8(%r12)
	movl	$1, %eax
	movl	%ecx, %esi
	jmp	LBB0_6
LBB0_1:
	xorl	%eax, %eax
	xorl	%esi, %esi
LBB0_6:
	movl	%esi, (%r12)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ADSCTRL_ADR_SH,4,2             ## @ADSCTRL_ADR_SH
	.comm	_ADSCTRL_STS,4,2                ## @ADSCTRL_STS
	.no_dead_strip	_read_xydata
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_xydata
_read_xydata:                           ; @read_xydata
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x0
	bl	_local_irq_save
	bl	_corgi_ssp_ads7846_lock
	mov	x0, x19
	bl	_calc_waittime
	mov	x23, x0
	mov	w24, #1
	mov	x0, x19
	mov	w1, #0
	mov	w2, #1
	mov	w3, #1
	mov	x4, x23
	bl	_sync_receive_data_send_cmd
	mov	x0, x19
	mov	w1, #1
	mov	w2, #1
	mov	w3, #1
	mov	x4, x23
	bl	_sync_receive_data_send_cmd
	mov	x0, x19
	mov	w1, #1
	mov	w2, #1
	mov	w3, #5
	mov	x4, x23
	bl	_sync_receive_data_send_cmd
	mov	x20, x0
	mov	x0, x19
	mov	w1, #1
	mov	w2, #1
	mov	w3, #3
	mov	x4, x23
	bl	_sync_receive_data_send_cmd
	mov	x21, x0
	mov	x0, x19
	mov	w1, #1
	mov	w2, #1
	mov	w3, #4
	mov	x4, x23
	bl	_sync_receive_data_send_cmd
	mov	x22, x0
	mov	x0, x19
	mov	w1, #1
	mov	w2, #0
	mov	w3, #4
	mov	x4, x23
	bl	_sync_receive_data_send_cmd
	mov	x23, x0
Lloh0:
	adrp	x8, _ADSCTRL_ADR_SH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ADSCTRL_ADR_SH@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	lsl	w8, w24, w8
Lloh3:
	adrp	x9, _ADSCTRL_STS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ADSCTRL_STS@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w0, w8, w9
	bl	_corgi_ssp_ads7846_put
	bl	_corgi_ssp_ads7846_get
	bl	_corgi_ssp_ads7846_unlock
	bl	_local_irq_restore
	mov	w8, #0
	mov	w0, #0
	cbz	w21, LBB0_6
; %bb.1:
	cbz	w20, LBB0_6
; %bb.2:
	cbz	w22, LBB0_6
; %bb.3:
	sub	w8, w23, w22
	mul	w8, w8, w21
	udiv	w8, w8, w22
	lsr	w9, w8, #3
	cmp	w9, #1874
	b.ls	LBB0_5
; %bb.4:
	mov	w8, #0
	mov	w0, #0
	b	LBB0_6
LBB0_5:
	stp	w21, w20, [x19, #4]
	mov	w0, #1
LBB0_6:
	str	w8, [x19]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ADSCTRL_ADR_SH,4,2             ; @ADSCTRL_ADR_SH
	.comm	_ADSCTRL_STS,4,2                ; @ADSCTRL_STS
	.no_dead_strip	_read_xydata
.subsections_via_symbols
