// File: /workspace/github_cpp_makefile_star2_O2/ADAPTLab[P]MuDBSCAN/RTree.cpp
// Function: isCorrectRTree(RhdrNd*)
void isCorrectRTree(RHdrNd hdrNdTree)
{
    RLstNd lstNdTemp = hdrNdTree->ptrFirstNd,temp;
    int iCnt = 0,flag;

    while(lstNdTemp != NULL)
    {   
        if(lstNdTemp->tnInfo->ndType == INTNODE)
        {   
            temp=lstNdTemp->ptrChildLst->ptrFirstNd;
            while(temp!=NULL)
            {
            	switch(temp->tnInfo->ndType)
            	{
            		case INTNODE:
            			flag=0;
		                for(iCnt=0;iCnt<DIMENSION;iCnt++)
		                {
		                    if(temp->tnInfo->tdInfo->rgnRect->iBottomLeft[iCnt]<lstNdTemp->tnInfo->tdInfo->rgnRect->iBottomLeft[iCnt])
		                        flag=1;
		                }
		                for(iCnt=0;iCnt<DIMENSION;iCnt++)
		                {
		                    if(temp->tnInfo->tdInfo->rgnRect->iTopRight[iCnt]>lstNdTemp->tnInfo->tdInfo->rgnRect->iTopRight[iCnt])
		                        flag=1;
		                }
		                if(flag==1)
		                {
		                    printf("WRONG!!!\n");
		                    for(iCnt=0;iCnt<DIMENSION;iCnt++)
		                    {
		                        printf("%lf %lf %lf %lf\n",temp->tnInfo->tdInfo->rgnRect->iBottomLeft[iCnt],temp->tnInfo->tdInfo->rgnRect->iTopRight[iCnt],lstNdTemp->tnInfo->tdInfo->rgnRect->iBottomLeft[iCnt],lstNdTemp->tnInfo->tdInfo->rgnRect->iTopRight[iCnt]);
		                    }
		                }
		                temp=temp->ptrNextNd;
            		break;

            		case EXTNODE:
            			return;
            		break;
            	}
                
            }
            isCorrectRTree(lstNdTemp->ptrChildLst);
        }
        lstNdTemp = lstNdTemp->ptrNextNd;
    }
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x8, %rbx
leaq 0xf334(%rip), %r12      # 0x14334
pushq $0x1
popq %r13
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x5141
movq (%rbx), %rax
cmpl $0x0, (%rax)
jne 0x5138
movq 0x8(%rbx), %r14
addq $0x8, %r14
movq (%r14), %r14
testq %r14, %r14
je 0x512f
movq (%r14), %rax
movl (%rax), %ecx
cmpl $0x1, %ecx
je 0x5141
testl %ecx, %ecx
jne 0x5027
movl (%r12), %ecx
xorl %esi, %esi
testl %ecx, %ecx
cmovlel %esi, %ecx
xorl %edx, %edx
cmpq %rsi, %rcx
je 0x5084
movq 0x8(%rax), %rdi
movq (%rdi), %rdi
movq (%rdi), %rdi
movq (%rbx), %r8
movq 0x8(%r8), %r8
movq (%r8), %r8
movq (%r8), %r8
movsd (%r8,%rsi,8), %xmm0
ucomisd (%rdi,%rsi,8), %xmm0
movl %r13d, %edi
ja 0x507d
movl %edx, %edi
incq %rsi
movl %edi, %edx
jmp 0x504f
xorl %esi, %esi
cmpq %rsi, %rcx
je 0x50bc
movq 0x8(%rax), %rdi
movq (%rdi), %rdi
movq 0x8(%rdi), %rdi
movsd (%rdi,%rsi,8), %xmm0
movq (%rbx), %rdi
movq 0x8(%rdi), %rdi
movq (%rdi), %rdi
movq 0x8(%rdi), %rdi
ucomisd (%rdi,%rsi,8), %xmm0
movl %r13d, %edi
ja 0x50b5
movl %edx, %edi
incq %rsi
movl %edi, %edx
jmp 0x5086
cmpl $0x1, %edx
jne 0x5126
leaq 0xa079(%rip), %rdi      # 0xf141
callq 0x23c0
xorl %r15d, %r15d
movslq (%r12), %rax
cmpq %rax, %r15
jge 0x5126
movq (%r14), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
movsd (%rcx,%r15,8), %xmm0
movsd (%rax,%r15,8), %xmm1
movq (%rbx), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
movsd (%rcx,%r15,8), %xmm2
movsd (%rax,%r15,8), %xmm3
leaq 0xa016(%rip), %rdi      # 0xf130
movb $0x4, %al
callq 0x2040
incq %r15
jmp 0x50d0
addq $0x10, %r14
jmp 0x5024
movq 0x8(%rbx), %rdi
callq 0x4fe4
addq $0x10, %rbx
jmp 0x5004
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq