// File: /workspace/github_cpp_makefile_star2_O3/ADAPTLab[P]MuDBSCAN/clustering.cpp
// Function: sequentialClustering(dataHdr*)
void sequentialClustering(DataHdr dataList)
{
	int i;
	int j, k, npid, prID;
	int rank, nproc, mpi_namelen;

	MPI_Comm_rank(MPI_COMM_WORLD, &rank);
	MPI_Comm_size(MPI_COMM_WORLD, &nproc);

	int pid;
	int root, root1, root2, tid;

    noiseNeighbours = (int**)calloc(dataList->localCnt, sizeof(int*));
    // assert(noiseNeighbours != NULL);
    
	Neighbours neigh = NULL,neigh1 = NULL;
	
	clusteringstart = MPI_Wtime();
	Data data;
	for(i = 0; i < dataList->localCnt; i++)
	{
		noiseNeighbours[i] = NULL;
		pid = i;
		data = dataList->dataClstElem + i;

		if(data->isProcessed == TRUE || data->core_tag == TRUE)
        {
            continue;   
        }

		neigh = findNeighbours3(dataList, i, EPS, NULL);
		data->isProcessed = TRUE;

		if(neigh->inner_neighbours >= MINPOINTS)
		{
			//Merging has already happened in the findNeighbours3 method. No need to duplicate merging
			continue;
		}


		if(VECTOR_TOTAL(neigh->neighbours_local_inner) + VECTOR_TOTAL(neigh->neighbours_remote_inner) + VECTOR_TOTAL(neigh->neighbours_local_outer) + VECTOR_TOTAL(neigh->neighbours_remote_outer) >= MINPOINTS)
		{
			// Current point is a core point
			// pid is a core point
			root = pid;

			data->core_tag = TRUE;
			data->ClusterID = 1;
			
			//NEEDS MODIFICATION
			Data dataroot1;
			Data dataroot2;
			for (j = 0; j < VECTOR_TOTAL(neigh->neighbours_local_inner); j++)
    		{

				Data datalocal = dataList->dataClstElem + neigh->neighbours_local_inner->intItems[j];
				npid = datalocal->id;

				root1 = npid;
				root2 = root;

				if(datalocal->core_tag == TRUE || datalocal->ClusterID == 0)
				{
					datalocal->ClusterID = 1;

					 dataroot1 = dataList->dataClstElem + root1;
					 dataroot2 = dataList->dataClstElem + root2;

					unionFindMerge(dataList, root1, root2, dataroot1, dataroot2);
					// REMS algorithm to (union) merge the trees
					
				}
			}


			//Data dataroot1;
			//Data dataroot2;
			for (j = 0; j < VECTOR_TOTAL(neigh->neighbours_local_outer); j++)
    		{

				Data datalocal = dataList->dataClstElem + neigh->neighbours_local_outer->intItems[j];
				npid = datalocal->id;

				root1 = npid;
				root2 = root;

				if(datalocal->core_tag == TRUE || datalocal->ClusterID == 0)
				{
					datalocal->ClusterID = 1;

					 dataroot1 = dataList->dataClstElem + root1;
					 dataroot2 = dataList->dataClstElem + root2;

					unionFindMerge(dataList, root1, root2, dataroot1, dataroot2);
					// REMS algorithm to (union) merge the trees
					
				}
			}
		}
		else
		{
			data->core_tag = FALSE;
			if(data->ClusterID == 1)
			{
				;
			}
			else
			{
				data->ClusterID = 0;
				Data neighbour;
				Data dataroot1;
				Data dataroot2;
	            for(j=0;j<VECTOR_TOTAL(neigh->neighbours_local_inner);j++)
	            {
	                neighbour = dataList->dataClstElem + neigh->neighbours_local_inner->intItems[j];
	                if(neighbour->core_tag == TRUE) //Border point scenario.
	                {
	                	root1 = data->id;
						root2 = neighbour->id;

						data->ClusterID = 1;

						Data dataroot1 = dataList->dataClstElem + root1;
						Data dataroot2 = dataList->dataClstElem + root2;
						unionFindMerge(dataList, root1, root2, dataroot1, dataroot2);
						// REMS algorithm to (union) merge the trees
	                    data->ClusterID = 1;
	                    neighbour->ClusterID = 1;
	                    break;
	                }
	            }

	            //Data dataroot1;
	            //Data dataroot2;
	            for(j=0;j<VECTOR_TOTAL(neigh->neighbours_local_outer);j++)
	            {
	                neighbour = dataList->dataClstElem + neigh->neighbours_local_outer->intItems[j];
	                if(neighbour->core_tag == TRUE) //Border point scenario.
	                {
	                	root1 = data->id;
						root2 = neighbour->id;

						data->ClusterID = 1;

						dataroot1 = dataList->dataClstElem + root1;
						dataroot2 = dataList->dataClstElem + root2;
						unionFindMerge(dataList, root1, root2, dataroot1, dataroot2);
						// REMS algorithm to (union) merge the trees
	                    data->ClusterID = 1;
	                    neighbour->ClusterID = 1;
	                    break;
	                }
	            }

	            if(data->ClusterID == 0)
	            {
	                noiseNeighbours[data->id] = (int*)malloc(sizeof(int)*MINPOINTS);

	                int k = 0;
	            	for(k=0;k<MINPOINTS;k++) noiseNeighbours[data->id][k] = -1;
	            	k=0;

	                for(j=0; j<VECTOR_TOTAL(neigh->neighbours_local_inner); j++)
	                {
                       	noiseNeighbours[data->id][k++] = neigh->neighbours_local_inner->intItems[j];
	                }

	                for(j=0; j<VECTOR_TOTAL(neigh->neighbours_local_outer); j++)
	                {
                       	noiseNeighbours[data->id][k++] = neigh->neighbours_local_outer->intItems[j];
	                }

	                for(j=0; j<VECTOR_TOTAL(neigh->neighbours_remote_inner); j++)
	                {
                       	noiseNeighbours[data->id][k++] = neigh->neighbours_remote_inner->intItems[j];
	                }

	                for(j=0; j<VECTOR_TOTAL(neigh->neighbours_remote_outer); j++)
	                {
                       	noiseNeighbours[data->id][k++] = neigh->neighbours_remote_outer->intItems[j];
	                }
	            }
			}
		}

		VECTOR_FREE(neigh->neighbours_local_outer);
		free(neigh->neighbours_local_outer);

		VECTOR_FREE(neigh->neighbours_remote_outer);
		free(neigh->neighbours_remote_outer);

		VECTOR_FREE(neigh->neighbours_local_inner);
		free(neigh->neighbours_local_inner);

		VECTOR_FREE(neigh->neighbours_remote_inner);
		free(neigh->neighbours_remote_inner);

		free(neigh);
		neigh = NULL;
	}

	clusteringend = MPI_Wtime();
	postprocessingstart = MPI_Wtime();
	postprocessingstart = MPI_Wtime();


	Data dataroot1;
	Data dataroot2;
	for(i=0; i<dataList->localCnt; i++)
	{
	    Data potentialNoise = dataList->dataClstElem + i;
	    
	    if(potentialNoise->ClusterID == 0 && noiseNeighbours[i] != NULL)
	    {
	    	int v;
		    for(v=0; v<MINPOINTS; v++)
		    {
		        if(noiseNeighbours[i][v] >= 0)
		        {
		            Data data = dataList->dataClstElem + noiseNeighbours[i][v];
		            if(data->core_tag == TRUE)
		            {
		            	root1 = data->id;
						root2 = potentialNoise->id;

						dataroot1 = dataList->dataClstElem + root1;
						dataroot2 = dataList->dataClstElem + root2;
						unionFindMerge(dataList, root1, root2, dataroot1, dataroot2);
						
						// REMS algorithm to (union) merge the trees
	                    data->ClusterID = 1;
		                potentialNoise->ClusterID = 1;
		                break;
		            }
		        }
		    }
		    free(noiseNeighbours[i]);
		}
	}

	free(noiseNeighbours);
	//Data data;
	Neighbours n;
	RHdrNd hdrNdTree;
	Data data2;
	Group g;
	for(i=0; i<VECTOR_TOTAL(unprocessedCore); i++)
	{
		data = dataList->dataClstElem + unprocessedCore->intItems[i];
		g = groupList->groupItems[data->group_id];
		Region region = createCellRegOfPoint(data, EPS);

		vectorc* neighbours_local_outer = (vectorc*)malloc(sizeof(struct vectorc));
		VECTOR_INIT(neighbours_local_outer, INTEGER);

		vectorc* neighbours_remote_outer = (vectorc*)malloc(sizeof(struct vectorc));
		VECTOR_INIT(neighbours_remote_outer, INTEGER);

		n = (Neighbours)malloc(sizeof(struct neighbours));

		n->neighbours_local_outer = neighbours_local_outer;
		n->neighbours_remote_outer = neighbours_remote_outer;

		hdrNdTree = g->bcell->auxCellRTree;
		for(k=0; k<VECTOR_TOTAL(g->corepoints); k++)
		{
			data2 = dataList->dataClstElem + g->corepoints->intItems[k];
			if(data2->haloPoint == FALSE)
			{
			    if(RisContains(region, data2->iData))
			    {
			    	if(distance(data->iData, data2->iData) <= EPS)
			    	{
				    	addHelper[0] = data2->id;
						VECTOR_ADD(n->neighbours_local_outer, addHelper);
			    	}
			    }
			}
		}
		Group rg;
		DataPoint d;
		Data data2;
		//RHdrNd hdrNdTree;
		for(j=0; j<VECTOR_TOTAL(g->reachable_groups); j++)
		{
			rg = groupList->groupItems[g->reachable_groups->intItems[j]];
			d = (dataList->dataClstElem + rg->master_id)->iData;
			Region potentialRegion = createCellRegOfDataPoint(d, EPS);

			if(GisOverLap(region, potentialRegion))
			{
				hdrNdTree = rg->bcell->auxCellRTree;
				for(k=0; k<VECTOR_TOTAL(rg->corepoints); k++)
				{
				    data2 = dataList->dataClstElem + rg->corepoints->intItems[k];
				    if(data2->haloPoint == FALSE)
				    {
				        if(RisContains(region, data2->iData))
			            {
			                if(distance(data->iData, data2->iData) <= EPS)
					    	{
						    	addHelper[0] = data2->id;
								VECTOR_ADD(n->neighbours_local_outer, addHelper);
					    	}
			            }
				    }
				}
			}
			free(potentialRegion->iBottomLeft);
			free(potentialRegion->iTopRight);
			free(potentialRegion);
		}
		Data temp;
		Data dataroot1;
		Data dataroot2;
		for(j=0;j<VECTOR_TOTAL(n->neighbours_local_outer);j++)
		{
			temp = dataList->dataClstElem + n->neighbours_local_outer->intItems[j];

			int root1 = temp->id;
			int root2 = data->id;
			int root;
			dataroot1 = dataList->dataClstElem + root1;
			dataroot2 = dataList->dataClstElem + root2;
			unionFindMerge(dataList, root1, root2, dataroot1, dataroot2);
	     	data->ClusterID = 1;
		}

		VECTOR_FREE(n->neighbours_remote_outer);
		VECTOR_FREE(n->neighbours_local_outer);
		free(n->neighbours_local_outer);
		free(n->neighbours_remote_outer);
		free(n);

		free(region->iBottomLeft);
		free(region->iTopRight);
		free(region);
	}
	 postprocessingend =  MPI_Wtime();

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq 0x7aa2(%rip), %r14      # 0x16fa8
leaq -0x68(%rbp), %rsi
movq %r14, %rdi
callq 0x33e0
leaq -0x64(%rbp), %rsi
movq %r14, %rdi
movq %rbx, %r14
callq 0x32e0
movslq 0x4(%rbx), %rdi
movl $0x8, %esi
callq 0x31b0
leaq 0x7e72(%rip), %rbx      # 0x173a8
movq %rax, (%rbx)
callq 0x3360
leaq 0x7f13(%rip), %rax      # 0x17458
movsd %xmm0, (%rax)
cmpl $0x0, 0x4(%r14)
movq %r14, -0x30(%rbp)
jle 0xf9fb
xorl %r13d, %r13d
movq (%rbx), %rax
movq $0x0, (%rax,%r13,8)
movq 0x8(%r14), %r12
movq %r13, %r14
shlq $0x6, %r14
cmpl $0x1, 0x2c(%r12,%r14)
je 0xf9e7
addq %r14, %r12
cmpl $0x1, 0x28(%r12)
je 0xf9e7
leaq 0x7dc5(%rip), %rax      # 0x17358
movsd (%rax), %xmm0
movq -0x30(%rbp), %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x7fb3
movq %rax, %r15
movl $0x1, 0x2c(%r12)
movl 0x28(%rax), %eax
leaq 0x7da5(%rip), %rcx      # 0x17360
cmpl (%rcx), %eax
jge 0xf9e7
movq 0x10(%r15), %rdi
callq 0x3a4d
movl %eax, -0x38(%rbp)
movq 0x8(%r15), %rdi
callq 0x3a4d
movl %eax, %ebx
addl -0x38(%rbp), %ebx
movq 0x20(%r15), %rdi
callq 0x3a4d
movl %eax, -0x38(%rbp)
movq 0x18(%r15), %rdi
callq 0x3a4d
addl -0x38(%rbp), %eax
addl %ebx, %eax
leaq 0x7d62(%rip), %rcx      # 0x17360
cmpl (%rcx), %eax
jge 0xf66b
movl $0x0, 0x28(%r12)
cmpl $0x1, 0x30(%r12)
je 0xf990
movl $0x0, 0x30(%r12)
movq 0x10(%r15), %rdi
callq 0x3a4d
testl %eax, %eax
jle 0xf7a2
xorl %r14d, %r14d
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%r15), %rdi
movq 0x8(%rdi), %rcx
movslq (%rcx,%r14,4), %rbx
shlq $0x6, %rbx
cmpl $0x1, 0x28(%rax,%rbx)
je 0xf765
incq %r14
callq 0x3a4d
cltq
cmpq %rax, %r14
jl 0xf634
jmp 0xf7a2
movl $0x1, %eax
movl %eax, 0x28(%r12)
movl %eax, 0x30(%r12)
movq 0x10(%r15), %rdi
callq 0x3a4d
testl %eax, %eax
jle 0xf6eb
xorl %ebx, %ebx
movq -0x30(%rbp), %rax
movq 0x8(%rax), %r8
movq 0x10(%r15), %rdi
movq 0x8(%rdi), %rax
movslq (%rax,%rbx,4), %rcx
shlq $0x6, %rcx
leaq (%r8,%rcx), %rax
movslq 0x1c(%r8,%rcx), %rsi
cmpl $0x1, 0x28(%r8,%rcx)
je 0xf6b8
cmpl $0x0, 0x30(%rax)
jne 0xf6dc
movl $0x1, 0x30(%rax)
movq %rsi, %rcx
shlq $0x6, %rcx
addq %r8, %rcx
addq %r14, %r8
movq -0x30(%rbp), %rdi
movl %r13d, %edx
callq 0x3cdc
movq 0x10(%r15), %rdi
incq %rbx
callq 0x3a4d
cltq
cmpq %rax, %rbx
jl 0xf689
movq 0x20(%r15), %rdi
callq 0x3a4d
testl %eax, %eax
jle 0xf990
xorl %ebx, %ebx
movq -0x30(%rbp), %rax
movq 0x8(%rax), %r8
movq 0x20(%r15), %rdi
movq 0x8(%rdi), %rax
movslq (%rax,%rbx,4), %rcx
shlq $0x6, %rcx
leaq (%r8,%rcx), %rax
movslq 0x1c(%r8,%rcx), %rsi
cmpl $0x1, 0x28(%r8,%rcx)
je 0xf72d
cmpl $0x0, 0x30(%rax)
jne 0xf751
movl $0x1, 0x30(%rax)
movq %rsi, %rcx
shlq $0x6, %rcx
addq %r8, %rcx
addq %r14, %r8
movq -0x30(%rbp), %rdi
movl %r13d, %edx
callq 0x3cdc
movq 0x20(%r15), %rdi
incq %rbx
callq 0x3a4d
cltq
cmpq %rax, %rbx
jl 0xf6fe
jmp 0xf990
addq %rax, %rbx
movslq 0x1c(%r12), %rsi
movslq 0x1c(%rbx), %rdx
movl $0x1, %r14d
movl %r14d, 0x30(%r12)
movq %rsi, %rcx
shlq $0x6, %rcx
addq %rax, %rcx
movq %rdx, %r8
shlq $0x6, %r8
addq %rax, %r8
movq -0x30(%rbp), %rdi
callq 0x3cdc
movl %r14d, 0x30(%r12)
movl %r14d, 0x30(%rbx)
movq 0x20(%r15), %rdi
callq 0x3a4d
testl %eax, %eax
jle 0xf81f
xorl %r14d, %r14d
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x20(%r15), %rdi
movq 0x8(%rdi), %rcx
movslq (%rcx,%r14,4), %rbx
shlq $0x6, %rbx
cmpl $0x1, 0x28(%rax,%rbx)
je 0xf7e2
incq %r14
callq 0x3a4d
cltq
cmpq %rax, %r14
jl 0xf7b2
jmp 0xf81f
addq %rax, %rbx
movslq 0x1c(%r12), %rsi
movslq 0x1c(%rbx), %rdx
movl $0x1, %r14d
movl %r14d, 0x30(%r12)
movq %rsi, %rcx
shlq $0x6, %rcx
addq %rax, %rcx
movq %rdx, %r8
shlq $0x6, %r8
addq %rax, %r8
movq -0x30(%rbp), %rdi
callq 0x3cdc
movl %r14d, 0x30(%r12)
movl %r14d, 0x30(%rbx)
cmpl $0x0, 0x30(%r12)
jne 0xf990
leaq 0x7b2e(%rip), %r14      # 0x17360
movslq (%r14), %rbx
leaq (,%rbx,4), %rdi
callq 0x33a0
leaq 0x7b5f(%rip), %rsi      # 0x173a8
movq (%rsi), %rcx
movslq 0x1c(%r12), %rdx
movq %rax, (%rcx,%rdx,8)
testq %rbx, %rbx
movq %rsi, %rbx
jle 0xf87d
movq (%rbx), %rax
xorl %ecx, %ecx
movslq 0x1c(%r12), %rdx
movq (%rax,%rdx,8), %rdx
movl $0xffffffff, (%rdx,%rcx,4) # imm = 0xFFFFFFFF
incq %rcx
movslq (%r14), %rdx
cmpq %rdx, %rcx
jl 0xf862
movq 0x10(%r15), %rdi
callq 0x3a4d
xorl %r14d, %r14d
testl %eax, %eax
jle 0xf8b8
movq 0x10(%r15), %rdi
movq 0x8(%rdi), %rax
movl (%rax,%r14,4), %eax
movq (%rbx), %rcx
movslq 0x1c(%r12), %rdx
movq (%rcx,%rdx,8), %rcx
movl %eax, (%rcx,%r14,4)
incq %r14
callq 0x3a4d
cltq
cmpq %rax, %r14
jl 0xf88d
movq 0x20(%r15), %rdi
callq 0x3a4d
testl %eax, %eax
jle 0xf8fe
movl %r14d, %r14d
xorl %ebx, %ebx
movq 0x20(%r15), %rdi
movq 0x8(%rdi), %rax
movl (%rax,%rbx,4), %eax
leaq 0x7acc(%rip), %rcx      # 0x173a8
movq (%rcx), %rcx
movslq 0x1c(%r12), %rdx
movq (%rcx,%rdx,8), %rcx
movl %eax, (%rcx,%r14,4)
incq %r14
incq %rbx
callq 0x3a4d
cltq
cmpq %rax, %rbx
jl 0xf8ca
movq 0x8(%r15), %rdi
callq 0x3a4d
testl %eax, %eax
jle 0xf944
movl %r14d, %r14d
xorl %ebx, %ebx
movq 0x8(%r15), %rdi
movq 0x8(%rdi), %rax
movl (%rax,%rbx,4), %eax
leaq 0x7a86(%rip), %rcx      # 0x173a8
movq (%rcx), %rcx
movslq 0x1c(%r12), %rdx
movq (%rcx,%rdx,8), %rcx
movl %eax, (%rcx,%r14,4)
incq %r14
incq %rbx
callq 0x3a4d
cltq
cmpq %rax, %rbx
jl 0xf910
movq 0x18(%r15), %rdi
callq 0x3a4d
testl %eax, %eax
jle 0xf990
movl %r14d, %ebx
shlq $0x2, %rbx
xorl %r14d, %r14d
movq 0x18(%r15), %rdi
movq 0x8(%rdi), %rax
movl (%rax,%r14,4), %eax
leaq 0x7a3a(%rip), %rcx      # 0x173a8
movq (%rcx), %rcx
movslq 0x1c(%r12), %rdx
movq (%rcx,%rdx,8), %rcx
addq %rbx, %rcx
movl %eax, (%rcx,%r14,4)
incq %r14
callq 0x3a4d
cltq
cmpq %rax, %r14
jl 0xf95b
movq 0x20(%r15), %rdi
callq 0x3ca8
movq 0x20(%r15), %rdi
callq 0x3310
movq 0x18(%r15), %rdi
callq 0x3ca8
movq 0x18(%r15), %rdi
callq 0x3310
movq 0x10(%r15), %rdi
callq 0x3ca8
movq 0x10(%r15), %rdi
callq 0x3310
movq 0x8(%r15), %rdi
callq 0x3ca8
movq 0x8(%r15), %rdi
callq 0x3310
movq %r15, %rdi
callq 0x3310
leaq 0x79c1(%rip), %rbx      # 0x173a8
incq %r13
movq -0x30(%rbp), %r14
movslq 0x4(%r14), %rax
cmpq %rax, %r13
jl 0xf55b
callq 0x3360
leaq 0x7a59(%rip), %rax      # 0x17460
movsd %xmm0, (%rax)
callq 0x3360
leaq 0x7a59(%rip), %rbx      # 0x17470
movsd %xmm0, (%rbx)
callq 0x3360
movsd %xmm0, (%rbx)
movl 0x4(%r14), %ecx
testl %ecx, %ecx
jle 0xfaf4
xorl %ebx, %ebx
leaq 0x7927(%rip), %r14      # 0x17360
movl $0x1, %r15d
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rbx, %r12
shlq $0x6, %r12
cmpl $0x0, 0x30(%rax,%r12)
jne 0xfae5
leaq 0x7947(%rip), %rdx      # 0x173a8
movq (%rdx), %rdx
movq (%rdx,%rbx,8), %rdi
testq %rdi, %rdi
je 0xfae5
movslq (%r14), %rcx
testq %rcx, %rcx
jle 0xfad9
addq %rax, %r12
xorl %edx, %edx
movslq (%rdi,%rdx,4), %r13
testq %r13, %r13
js 0xfa8f
shlq $0x6, %r13
cmpl $0x1, 0x28(%rax,%r13)
je 0xfa99
incq %rdx
cmpq %rdx, %rcx
jne 0xfa7a
jmp 0xfad9
addq %rax, %r13
movslq 0x1c(%r13), %rsi
movslq 0x1c(%r12), %rdx
movq %rsi, %rcx
shlq $0x6, %rcx
addq %rax, %rcx
movq %rdx, %r8
shlq $0x6, %r8
addq %rax, %r8
movq -0x30(%rbp), %rdi
callq 0x3cdc
movl %r15d, 0x30(%r13)
movl %r15d, 0x30(%r12)
leaq 0x78d6(%rip), %rax      # 0x173a8
movq (%rax), %rax
movq (%rax,%rbx,8), %rdi
callq 0x3310
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
incq %rbx
movslq %ecx, %rax
cmpq %rax, %rbx
jl 0xfa3f
leaq 0x78ad(%rip), %rax      # 0x173a8
movq (%rax), %rdi
callq 0x3310
leaq 0x78d6(%rip), %rbx      # 0x173e0
movq (%rbx), %rdi
callq 0x3a4d
testl %eax, %eax
movq -0x30(%rbp), %r14
jle 0xfe39
xorl %r15d, %r15d
movq 0x8(%r14), %rax
movq (%rbx), %rcx
movq 0x8(%rcx), %rcx
movq %r15, -0x60(%rbp)
movslq (%rcx,%r15,4), %rcx
shlq $0x6, %rcx
leaq (%rax,%rcx), %r12
leaq 0x785d(%rip), %rdx      # 0x173a0
movq (%rdx), %rdx
movq (%rdx), %rdx
movslq 0x20(%rax,%rcx), %rax
movq (%rdx,%rax,8), %r15
leaq 0x77ff(%rip), %rax      # 0x17358
movsd (%rax), %xmm0
movq %r12, %rdi
callq 0x8695
movq %rax, -0x38(%rbp)
movl $0x30, %edi
callq 0x33a0
movq %rax, %r13
movq %rax, %rdi
xorl %esi, %esi
callq 0x39bc
movl $0x30, %edi
callq 0x33a0
movq %rax, -0x58(%rbp)
movq %rax, %rdi
xorl %esi, %esi
callq 0x39bc
movq 0x58(%r15), %rdi
callq 0x3a4d
testl %eax, %eax
movq %r15, -0x48(%rbp)
jle 0xfc31
xorl %ebx, %ebx
movq %r15, %rax
movq 0x8(%r14), %r15
movq 0x58(%rax), %rax
movq 0x8(%rax), %rax
movslq (%rax,%rbx,4), %rax
shlq $0x6, %rax
cmpl $0x0, 0x8(%r15,%rax)
je 0xfbe7
incq %rbx
movq -0x48(%rbp), %r15
movq 0x58(%r15), %rdi
callq 0x3a4d
cltq
cmpq %rax, %rbx
jl 0xfbaf
jmp 0xfc31
addq %rax, %r15
movq (%r15), %rsi
movq -0x38(%rbp), %rdi
callq 0x6555
testl %eax, %eax
je 0xfbce
movq (%r12), %rdi
movq (%r15), %rsi
callq 0x7b2c
leaq 0x774b(%rip), %rax      # 0x17358
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jb 0xfbce
movl 0x1c(%r15), %eax
leaq 0x776e(%rip), %rcx      # 0x17390
movq (%rcx), %rsi
movl %eax, (%rsi)
movq %r13, %rdi
callq 0x3c20
jmp 0xfbce
movq %r13, -0x40(%rbp)
movq %r12, -0x50(%rbp)
movq 0x50(%r15), %rdi
callq 0x3a4d
testl %eax, %eax
jle 0xfd70
xorl %ebx, %ebx
leaq 0x774d(%rip), %rax      # 0x173a0
movq (%rax), %rax
movq (%rax), %rax
movq 0x50(%r15), %rcx
movq 0x8(%rcx), %rcx
movslq (%rcx,%rbx,4), %rcx
movq (%rax,%rcx,8), %r12
movq 0x8(%r14), %rax
movslq 0x30(%r12), %rcx
shlq $0x6, %rcx
movq (%rax,%rcx), %rdi
leaq 0x76d7(%rip), %rax      # 0x17358
movsd (%rax), %xmm0
callq 0x8731
movq %rax, %r13
movq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0x6868
testl %eax, %eax
je 0xfd3b
movq 0x58(%r12), %rdi
callq 0x3a4d
testl %eax, %eax
jle 0xfd3b
xorl %r15d, %r15d
movq 0x8(%r14), %r14
movq 0x58(%r12), %rax
movq 0x8(%rax), %rax
movslq (%rax,%r15,4), %rax
shlq $0x6, %rax
cmpl $0x0, 0x8(%r14,%rax)
je 0xfced
incq %r15
movq 0x58(%r12), %rdi
callq 0x3a4d
cltq
cmpq %rax, %r15
movq -0x30(%rbp), %r14
jl 0xfcb6
jmp 0xfd3b
addq %rax, %r14
movq (%r14), %rsi
movq -0x38(%rbp), %rdi
callq 0x6555
testl %eax, %eax
je 0xfcd3
movq -0x50(%rbp), %rax
movq (%rax), %rdi
movq (%r14), %rsi
callq 0x7b2c
leaq 0x7642(%rip), %rax      # 0x17358
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jb 0xfcd3
movl 0x1c(%r14), %eax
leaq 0x7665(%rip), %rcx      # 0x17390
movq (%rcx), %rsi
movl %eax, (%rsi)
movq -0x40(%rbp), %rdi
callq 0x3c20
jmp 0xfcd3
movq (%r13), %rdi
callq 0x3310
movq 0x8(%r13), %rdi
callq 0x3310
movq %r13, %rdi
callq 0x3310
incq %rbx
movq -0x48(%rbp), %r15
movq 0x50(%r15), %rdi
callq 0x3a4d
cltq
cmpq %rax, %rbx
jl 0xfc4c
movq -0x40(%rbp), %r13
movq %r13, %rdi
callq 0x3a4d
testl %eax, %eax
movq -0x60(%rbp), %r15
movq -0x50(%rbp), %r12
jle 0xfddb
xorl %ebx, %ebx
movq 0x8(%r14), %rax
movq 0x8(%r13), %rcx
movslq (%rcx,%rbx,4), %rcx
shlq $0x6, %rcx
movslq 0x1c(%rax,%rcx), %rsi
movslq 0x1c(%r12), %rdx
movq %rsi, %rcx
shlq $0x6, %rcx
addq %rax, %rcx
movq %rdx, %r8
shlq $0x6, %r8
addq %rax, %r8
movq %r14, %rdi
callq 0x3cdc
movl $0x1, 0x30(%r12)
incq %rbx
movq %r13, %rdi
callq 0x3a4d
cltq
cmpq %rax, %rbx
jl 0xfd8a
movq -0x58(%rbp), %rbx
movq %rbx, %rdi
callq 0x3ca8
movq %r13, %rdi
callq 0x3ca8
movq %r13, %rdi
callq 0x3310
movq %rbx, %rdi
callq 0x3310
movq -0x38(%rbp), %rbx
movq (%rbx), %rdi
callq 0x3310
movq 0x8(%rbx), %rdi
callq 0x3310
movq %rbx, %rdi
callq 0x3310
incq %r15
leaq 0x75ba(%rip), %rbx      # 0x173e0
movq (%rbx), %rdi
callq 0x3a4d
cltq
cmpq %rax, %r15
jl 0xfb21
callq 0x3360
leaq 0x7623(%rip), %rax      # 0x17468
movsd %xmm0, (%rax)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq