// File: /workspace/github_cpp_makefile_star2_O3/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 0x4299
testl %eax, %eax
je 0x87f9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xeba0(%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 0xeb2d(%rip), %rax      # 0x17358
movsd (%rax), %xmm0
mulsd 0x9949(%rip), %xmm0     # 0x12180
movq %r12, %rdi
callq 0x8731
movq %rax, %r15
testq %rbx, %rbx
je 0x8947
movq (%rbx), %rax
movl (%rax), %ecx
cmpl $0x1, %ecx
je 0x8888
testl %ecx, %ecx
jne 0x893e
movq 0x8(%rax), %rax
movq (%rax), %rdi
movq %r15, %rsi
callq 0x6868
testl %eax, %eax
je 0x893e
movq 0x8(%rbx), %rsi
movq %r14, %rdi
movl -0x2c(%rbp), %edx
callq 0x87c8
jmp 0x893e
movq 0x8(%rax), %rax
movslq 0x8(%rax), %rcx
cmpl %ecx, (%r13)
je 0x893e
leaq 0xeac3(%rip), %rax      # 0x17364
movslq (%rax), %rax
testq %rax, %rax
jle 0x88ed
movq 0x8(%r14), %rdx
leaq 0xeaec(%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 0x88d0
jmp 0x88f1
xorpd %xmm0, %xmm0
ucomisd 0x97f7(%rip), %xmm0     # 0x120f0
jb 0x8901
sqrtsd %xmm0, %xmm0
jmp 0x8906
callq 0x3230
leaq 0xea4b(%rip), %rax      # 0x17358
movsd (%rax), %xmm1
mulsd 0x9867(%rip), %xmm1     # 0x12180
ucomisd %xmm0, %xmm1
jb 0x893e
movq (%rbx), %rax
movq 0x8(%rax), %rax
movl 0x8(%rax), %eax
leaq 0xea60(%rip), %rcx      # 0x17390
movq (%rcx), %rsi
movl %eax, (%rsi)
movq 0x50(%r13), %rdi
callq 0x3c20
movq 0x10(%rbx), %rbx
jmp 0x8842
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