	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function titsc_read_coordinates
_titsc_read_coordinates:                ## @titsc_read_coordinates
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -120(%rbp)                 ## 8-byte Spill
	movq	%rcx, %r14
	movq	%rdx, -128(%rbp)                ## 8-byte Spill
	movq	%rsi, -136(%rbp)                ## 8-byte Spill
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	(%rdi), %r12d
	testq	%r12, %r12
	je	LBB0_3
## %bb.1:
	xorl	%ebx, %ebx
	movq	_REG_FIFO0@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%r13, %rdi
	callq	_titsc_readl
	andl	$4095, %eax                     ## imm = 0xFFF
	movl	%eax, -80(%rbp,%rbx,4)
	incq	%rbx
	cmpq	%rbx, %r12
	jne	LBB0_2
LBB0_3:
	movq	_REG_FIFO0@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r13, %rdi
	callq	_titsc_readl
	andl	$4095, %eax                     ## imm = 0xFFF
	movl	%eax, (%r14)
	movl	(%r15), %esi
	movq	%r13, %rdi
	callq	_titsc_readl
	andl	$4095, %eax                     ## imm = 0xFFF
	movq	-120(%rbp), %rcx                ## 8-byte Reload
	movl	%eax, (%rcx)
	testq	%r12, %r12
	je	LBB0_4
## %bb.5:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%r13, %rdi
	callq	_titsc_readl
	andl	$4095, %eax                     ## imm = 0xFFF
	movl	%eax, -112(%rbp,%rbx,4)
	incq	%rbx
	cmpq	%rbx, %r12
	jne	LBB0_6
## %bb.7:
	cmpl	$3, %r12d
	ja	LBB0_12
## %bb.8:
	movl	-80(%rbp), %eax
	movl	-112(%rbp), %ecx
	cmpl	$1, %r12d
	je	LBB0_11
## %bb.9:
	addl	-76(%rbp), %eax
	addl	-108(%rbp), %ecx
	cmpl	$2, %r12d
	je	LBB0_11
## %bb.10:
	addl	-72(%rbp), %eax
	addl	-104(%rbp), %ecx
	jmp	LBB0_11
LBB0_4:
	xorl	%ecx, %ecx
	xorl	%eax, %eax
LBB0_11:
	xorl	%edx, %edx
	divl	%r12d
	movl	%eax, %esi
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%r12d
	jmp	LBB0_23
LBB0_12:
	movq	_titsc_cmp_coord@GOTPCREL(%rip), %r14
	movl	(%r14), %ecx
	xorl	%ebx, %ebx
	leaq	-80(%rbp), %rdi
	movl	%r12d, %esi
	movl	$4, %edx
	xorl	%r8d, %r8d
	callq	_sort
	movl	(%r14), %ecx
	leaq	-112(%rbp), %rdi
	movl	%r12d, %esi
	movl	$4, %edx
	xorl	%r8d, %r8d
	callq	_sort
	movl	%r12d, %eax
	decl	%eax
	leaq	-1(%rax), %rsi
	movl	$1, %edx
	movl	$0, %ecx
	cmpq	$8, %rsi
	jb	LBB0_21
## %bb.13:
	movq	%rsi, %rdx
	andq	$-8, %rdx
	leaq	-8(%rdx), %rcx
	movq	%rcx, %rbx
	shrq	$3, %rbx
	incq	%rbx
	testq	%rcx, %rcx
	je	LBB0_14
## %bb.15:
	movq	%rbx, %rdi
	andq	$-2, %rdi
	pxor	%xmm0, %xmm0
	movl	$1, %ecx
	pxor	%xmm2, %xmm2
	pxor	%xmm1, %xmm1
	pxor	%xmm3, %xmm3
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movdqu	-80(%rbp,%rcx,4), %xmm4
	paddd	%xmm0, %xmm4
	movdqu	-64(%rbp,%rcx,4), %xmm5
	paddd	%xmm2, %xmm5
	movdqu	-48(%rbp,%rcx,4), %xmm0
	paddd	%xmm4, %xmm0
	movdqu	-32(%rbp,%rcx,4), %xmm2
	paddd	%xmm5, %xmm2
	movdqu	-112(%rbp,%rcx,4), %xmm4
	paddd	%xmm1, %xmm4
	movdqu	-96(%rbp,%rcx,4), %xmm5
	paddd	%xmm3, %xmm5
	movdqu	-80(%rbp,%rcx,4), %xmm1
	paddd	%xmm4, %xmm1
	movdqu	-64(%rbp,%rcx,4), %xmm3
	paddd	%xmm5, %xmm3
	addq	$16, %rcx
	addq	$-2, %rdi
	jne	LBB0_16
## %bb.17:
	testb	$1, %bl
	je	LBB0_19
LBB0_18:
	movdqu	-80(%rbp,%rcx,4), %xmm4
	paddd	%xmm4, %xmm0
	movdqu	-64(%rbp,%rcx,4), %xmm4
	paddd	%xmm4, %xmm2
	movdqu	-112(%rbp,%rcx,4), %xmm4
	paddd	%xmm4, %xmm1
	movdqu	-96(%rbp,%rcx,4), %xmm4
	paddd	%xmm4, %xmm3
LBB0_19:
	paddd	%xmm2, %xmm0
	paddd	%xmm3, %xmm1
	pshufd	$238, %xmm1, %xmm2              ## xmm2 = xmm1[2,3,2,3]
	paddd	%xmm1, %xmm2
	pshufd	$85, %xmm2, %xmm1               ## xmm1 = xmm2[1,1,1,1]
	paddd	%xmm2, %xmm1
	movd	%xmm1, %ecx
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	paddd	%xmm0, %xmm1
	pshufd	$85, %xmm1, %xmm0               ## xmm0 = xmm1[1,1,1,1]
	paddd	%xmm1, %xmm0
	movd	%xmm0, %ebx
	cmpq	%rdx, %rsi
	je	LBB0_22
## %bb.20:
	orq	$1, %rdx
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	addl	-80(%rbp,%rdx,4), %ebx
	addl	-112(%rbp,%rdx,4), %ecx
	incq	%rdx
	cmpq	%rdx, %rax
	jne	LBB0_21
LBB0_22:
	leal	-2(%r12), %edi
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%edi
	movl	%eax, %esi
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%edi
LBB0_23:
	movq	-128(%rbp), %rcx                ## 8-byte Reload
	movl	%esi, (%rcx)
	movq	-136(%rbp), %rcx                ## 8-byte Reload
	movl	%eax, (%rcx)
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_25
## %bb.24:
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	pxor	%xmm0, %xmm0
	movl	$1, %ecx
	pxor	%xmm2, %xmm2
	pxor	%xmm1, %xmm1
	pxor	%xmm3, %xmm3
	testb	$1, %bl
	jne	LBB0_18
	jmp	LBB0_19
LBB0_25:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_FIFO0,4,2                  ## @REG_FIFO0
	.comm	_titsc_cmp_coord,4,2            ## @titsc_cmp_coord
	.no_dead_strip	_titsc_read_coordinates
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function titsc_read_coordinates
_titsc_read_coordinates:                ; @titsc_read_coordinates
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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	x23, x4
	mov	x24, x3
	mov	x20, x2
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #56]
	ldr	w21, [x0]
Lloh3:
	adrp	x25, _REG_FIFO0@GOTPAGE
Lloh4:
	ldr	x25, [x25, _REG_FIFO0@GOTPAGEOFF]
	cbz	w21, LBB0_3
; %bb.1:
	add	x26, sp, #28
	mov	x27, x21
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x25]
	mov	x0, x22
	bl	_titsc_readl
	and	w8, w0, #0xfff
	str	w8, [x26], #4
	subs	x27, x27, #1
	b.ne	LBB0_2
LBB0_3:
	ldr	w1, [x25]
	mov	x0, x22
	bl	_titsc_readl
	and	w8, w0, #0xfff
	str	w8, [x24]
	ldr	w1, [x25]
	mov	x0, x22
	bl	_titsc_readl
	and	w8, w0, #0xfff
	str	w8, [x23]
	cbz	w21, LBB0_10
; %bb.4:
	mov	x23, sp
	mov	x24, x21
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x25]
	mov	x0, x22
	bl	_titsc_readl
	and	w8, w0, #0xfff
	str	w8, [x23], #4
	subs	x24, x24, #1
	b.ne	LBB0_5
; %bb.6:
	cmp	w21, #3
	b.hi	LBB0_12
; %bb.7:
	ldr	w9, [sp, #28]
	ldr	w8, [sp]
	cmp	w21, #1
	b.eq	LBB0_11
; %bb.8:
	ldr	w10, [sp, #32]
	add	w9, w10, w9
	ldr	w10, [sp, #4]
	add	w8, w10, w8
	cmp	w21, #2
	b.eq	LBB0_11
; %bb.9:
	ldr	w10, [sp, #36]
	add	w9, w10, w9
	ldr	w10, [sp, #8]
	add	w8, w10, w8
	b	LBB0_11
LBB0_10:
	mov	w8, #0
	mov	w9, #0
LBB0_11:
	udiv	w9, w9, w21
	udiv	w8, w8, w21
	b	LBB0_20
LBB0_12:
Lloh5:
	adrp	x23, _titsc_cmp_coord@GOTPAGE
Lloh6:
	ldr	x23, [x23, _titsc_cmp_coord@GOTPAGEOFF]
	ldr	w3, [x23]
	add	x22, sp, #28
	add	x0, sp, #28
	mov	x1, x21
	mov	w2, #4
	mov	x4, #0
	bl	_sort
	ldr	w3, [x23]
	mov	x23, sp
	mov	x0, sp
	mov	x1, x21
	mov	w2, #4
	mov	x4, #0
	bl	_sort
	sub	w8, w21, #1
	sub	x10, x8, #1
	cmp	x10, #16
	b.hs	LBB0_14
; %bb.13:
	mov	w13, #0
	mov	w11, #0
	mov	w9, #1
	b	LBB0_17
LBB0_14:
	movi.2d	v0, #0000000000000000
	and	x12, x10, #0xfffffffffffffff0
	movi.2d	v1, #0000000000000000
	orr	x9, x12, #0x1
	add	x11, x23, #36
	add	x13, x22, #36
	mov	x14, x12
	movi.2d	v3, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v4, #0000000000000000
	movi.2d	v5, #0000000000000000
	movi.2d	v6, #0000000000000000
	movi.2d	v7, #0000000000000000
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldp	q16, q17, [x13, #-32]
	ldp	q18, q19, [x13], #64
	add.4s	v0, v16, v0
	add.4s	v1, v17, v1
	add.4s	v3, v18, v3
	add.4s	v2, v19, v2
	ldp	q16, q17, [x11, #-32]
	ldp	q18, q19, [x11], #64
	add.4s	v4, v16, v4
	add.4s	v5, v17, v5
	add.4s	v6, v18, v6
	add.4s	v7, v19, v7
	subs	x14, x14, #16
	b.ne	LBB0_15
; %bb.16:
	add.4s	v4, v5, v4
	add.4s	v4, v6, v4
	add.4s	v4, v7, v4
	addv.4s	s4, v4
	fmov	w11, s4
	add.4s	v0, v1, v0
	add.4s	v0, v3, v0
	add.4s	v0, v2, v0
	addv.4s	s0, v0
	fmov	w13, s0
	cmp	x10, x12
	b.eq	LBB0_19
LBB0_17:
	lsl	x12, x9, #2
	add	x10, x22, x12
	add	x12, x23, x12
	sub	x8, x8, x9
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x10], #4
	add	w13, w9, w13
	ldr	w9, [x12], #4
	add	w11, w9, w11
	subs	x8, x8, #1
	b.ne	LBB0_18
LBB0_19:
	sub	w8, w21, #2
	udiv	w9, w13, w8
	udiv	w8, w11, w8
LBB0_20:
	str	w9, [x20]
	str	w8, [x19]
	ldr	x8, [sp, #56]
Lloh7:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh8:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_22
; %bb.21:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_22:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_FIFO0,4,2                  ; @REG_FIFO0
	.comm	_titsc_cmp_coord,4,2            ; @titsc_cmp_coord
	.no_dead_strip	_titsc_read_coordinates
.subsections_via_symbols
