// File: /workspace/github_cpp_makefile_star2_O1/ADAPTLab[P]MuDBSCAN/MuC_RTree.cpp
// Function: findReachableGroupsofGroupG(dataHdr*, GhdrNd*, int)
void findReachableGroupsofGroupG(DataHdr dataList, GHdrNd GRTree, int i)
{
	if(GisLstEmpty(GRTree))
	{
		return ;
	}
	
	Group G = groupList->groupItems[i];
 	unsigned int uiRecCnt = 0;
	int iCnt = 0;
    double t;
    static int flag = 0;

	GLstNd lstNdTemp = GRTree->ptrFirstNd;
	Group currGroup = NULL;
	
	DataPoint d = (dataList->dataClstElem + G->master_id)->iData;
	Region x3rgnRect = createCellRegOfDataPoint(d, 3*EPS);

	while(lstNdTemp != NULL)
    {
		switch(lstNdTemp->tnInfo->ndType)
        {
           case INTNODE:   
				if(GisOverLap(lstNdTemp->tnInfo->tdInfo->rgnRect, x3rgnRect))
	            {
	            	//if((dataList->dataClstElem + G->master_id)->debugPoint==TRUE){
						//printf("%lf\t%lf\t%lf\tRank Is %d\t Overlaps Group ID%d\n",d[0],d[1],d[2],rank,(dataList->dataClstElem + G->master_id)->group_id);
					//}
	            	findReachableGroupsofGroupG(dataList, lstNdTemp->ptrChildLst, i);
	            }
            break;
            case EXTNODE:   
				if(G->id != lstNdTemp->tnInfo->tdInfo->groupElem && distance(d, (dataList->dataClstElem + (groupList->groupItems[lstNdTemp->tnInfo->tdInfo->groupElem])->master_id)->iData) <= 3*EPS)
				{
						addHelper[0] = lstNdTemp->tnInfo->tdInfo->groupElem;
						VECTOR_ADD(G->reachable_groups, addHelper);
				}      			            				
            break;
		}
		lstNdTemp = lstNdTemp->ptrNextNd;
	}

	free(x3rgnRect->iBottomLeft);
	free(x3rgnRect->iTopRight);
	free(x3rgnRect);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rdi
callq 0x42e9
testl %eax, %eax
je 0x8825
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xeb74(%rip), %rax      # 0x173a0
movq (%rax), %rax
movq (%rax), %rax
movl %ebx, -0x2c(%rbp)
movslq %ebx, %rcx
movq (%rax,%rcx,8), %r13
movq 0x8(%r15), %rbx
movq 0x8(%r14), %rax
movslq 0x30(%r13), %rcx
shlq $0x6, %rcx
movq (%rax,%rcx), %r12
leaq 0xeb01(%rip), %rax      # 0x17358
movsd (%rax), %xmm0
mulsd 0x991d(%rip), %xmm0     # 0x12180
movq %r12, %rdi
callq 0x875d
movq %rax, %r15
testq %rbx, %rbx
je 0x8973
movq (%rbx), %rax
movl (%rax), %ecx
cmpl $0x1, %ecx
je 0x88b4
testl %ecx, %ecx
jne 0x896a
movq 0x8(%rax), %rax
movq (%rax), %rdi
movq %r15, %rsi
callq 0x68ac
testl %eax, %eax
je 0x896a
movq 0x8(%rbx), %rsi
movq %r14, %rdi
movl -0x2c(%rbp), %edx
callq 0x87f4
jmp 0x896a
movq 0x8(%rax), %rax
movslq 0x8(%rax), %rcx
cmpl %ecx, (%r13)
je 0x896a
leaq 0xea97(%rip), %rax      # 0x17364
movslq (%rax), %rax
testq %rax, %rax
jle 0x8919
movq 0x8(%r14), %rdx
leaq 0xeac0(%rip), %rsi      # 0x173a0
movq (%rsi), %rsi
movq (%rsi), %rsi
movq (%rsi,%rcx,8), %rcx
movslq 0x30(%rcx), %rcx
shlq $0x6, %rcx
movq (%rdx,%rcx), %rcx
xorpd %xmm0, %xmm0
xorl %edx, %edx
movsd (%r12,%rdx,8), %xmm1
subsd (%rcx,%rdx,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incq %rdx
cmpq %rdx, %rax
jne 0x88fc
jmp 0x891d
xorpd %xmm0, %xmm0
ucomisd 0x97cb(%rip), %xmm0     # 0x120f0
jb 0x892d
sqrtsd %xmm0, %xmm0
jmp 0x8932
callq 0x3230
leaq 0xea1f(%rip), %rax      # 0x17358
movsd (%rax), %xmm1
mulsd 0x983b(%rip), %xmm1     # 0x12180
ucomisd %xmm0, %xmm1
jb 0x896a
movq (%rbx), %rax
movq 0x8(%rax), %rax
movl 0x8(%rax), %eax
leaq 0xea34(%rip), %rcx      # 0x17390
movq (%rcx), %rsi
movl %eax, (%rsi)
movq 0x50(%r13), %rdi
callq 0x3c19
movq 0x10(%rbx), %rbx
jmp 0x886e
movq (%r15), %rdi
callq 0x3310
movq 0x8(%r15), %rdi
callq 0x3310
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3310