// File: /workspace/github_cpp_makefile_star2_O2/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 0x2fae
testl %eax, %eax
je 0x6d00
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd669(%rip), %rax      # 0x14370
movq (%rax), %rax
movq (%rax), %rax
movslq %ebx, %rcx
movq (%rax,%rcx,8), %r13
movq 0x8(%r15), %r12
movq 0x8(%r14), %rax
movslq 0x30(%r13), %rcx
shlq $0x6, %rcx
movq (%rax,%rcx), %rdi
leaq 0xd5f9(%rip), %rax      # 0x14328
movsd (%rax), %xmm0
mulsd 0x8425(%rip), %xmm0     # 0xf160
movq %rdi, -0x30(%rbp)
callq 0x6c32
movq %rax, %r15
testq %r12, %r12
je 0x6e06
movq (%r12), %rax
movl (%rax), %ecx
cmpl $0x1, %ecx
je 0x6d8b
testl %ecx, %ecx
jne 0x6dfc
movq 0x8(%rax), %rax
movq (%rax), %rdi
movq %r15, %rsi
callq 0x5150
testl %eax, %eax
je 0x6dfc
movq 0x8(%r12), %rsi
movq %r14, %rdi
movl %ebx, %edx
callq 0x6ccf
jmp 0x6dfc
movq 0x8(%rax), %rax
movslq 0x8(%rax), %rax
cmpl %eax, (%r13)
je 0x6dfc
movq 0x8(%r14), %rcx
leaq 0xd5cc(%rip), %rdx      # 0x14370
movq (%rdx), %rdx
movq (%rdx), %rdx
movq (%rdx,%rax,8), %rax
movslq 0x30(%rax), %rax
shlq $0x6, %rax
movq (%rcx,%rax), %rsi
movq -0x30(%rbp), %rdi
callq 0x61e9
leaq 0xd55e(%rip), %rax      # 0x14328
movsd (%rax), %xmm1
mulsd 0x838a(%rip), %xmm1     # 0xf160
ucomisd %xmm0, %xmm1
jb 0x6dfc
movq (%r12), %rax
movq 0x8(%rax), %rax
movl 0x8(%rax), %eax
leaq 0xd572(%rip), %rcx      # 0x14360
movq (%rcx), %rsi
movl %eax, (%rsi)
movq 0x50(%r13), %rdi
callq 0x29f0
movq 0x10(%r12), %r12
jmp 0x6d47
movq (%r15), %rdi
callq 0x2280
movq 0x8(%r15), %rdi
callq 0x2280
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2280