// File: /workspace/github_c_makefile_star2_O2/pwelke[P]GraphMiningTools/cactustree.c
// Function: processComponentTree
struct Characteristics *processComponentTree(struct Graph *graph, struct Vertex *root, struct Vertex *componentRoot, int treeNumber, struct ShallowGraph **rootedComponents, struct Characteristics *oldChars, struct Characteristics *newChars, struct Graph *pattern, struct GraphPool *gPool, struct ShallowGraphPool *sgPool){
    struct VertexList *ehlp, **deletedEdges;
    struct Characteristics *ret=newChars;
    char exNext;
    int wTreeNumber=0;
    //printf("\nComproot %i root%i \n",componentRoot->number, root->number);
    for(ehlp=root->neighborhood;ehlp;ehlp=ehlp->next){
        //no need to check for visited as flags imply a arborescence with no back edges =]
        //printf("\t neighbour is %i flag: %i\n",ehlp->endPoint->number,ehlp->flag);
        if((ehlp->flag & 1)){
            ret=processComponentTree(graph, ehlp->endPoint, componentRoot, treeNumber, rootedComponents, oldChars, ret, pattern, gPool, sgPool);
            //printf("After returning from %i:\n",ehlp->endPoint->number);
            //printCharacteristics(ret);
        }
    }
    /*
    printf("\ncomproot number is %i \n",componentRoot->number);

    printf("\nroot number is %i\n",root->number);
    printf("----------old----------\n");
    printCharacteristics(oldChars);
    printf("--------new-----------\n");
    printCharacteristics(ret);
    */
    int i =0;
    if((componentRoot->number != root->number) || root->number==0){
        if(root->d <0){// not a component root
            for(;i<pattern->n;++i)
                ret=characteristics(root, treeNumber, 0, oldChars, ret, pattern->vertices[i], pattern->n, gPool);
        }
        else{
            deletedEdges = malloc((rootedComponents[root->d]->data)*sizeof(struct VertexList *));
            initSpanningTree(rootedComponents[root->d], deletedEdges,2);
            wTreeNumber=0;
            do{
                for(i=0;i<pattern->n;++i)
                    ret= characteristics(root, treeNumber, wTreeNumber, oldChars, ret, pattern->vertices[i], pattern->n, gPool);
                exNext=nextSpanningTree(rootedComponents[root->d], deletedEdges,2);
                ++wTreeNumber;
            }while(exNext);
            free(deletedEdges);
        }
    }
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %r8, 0x8(%rsp)
movl %ecx, %ebp
movq %rdx, %r12
movq %rsi, %rbx
movq 0x68(%rsp), %rax
movq 0x58(%rsp), %r13
movq 0x50(%rsp), %r15
movq %rsi, %r14
movq 0x8(%r14), %r14
testq %r14, %r14
je 0x26bf
testb $0x1, 0x24(%r14)
je 0x2673
movq 0x18(%r14), %rsi
movq %rdi, (%rsp)
movq (%rsp), %rdi
movq %r12, %rdx
movl %ebp, %ecx
movq 0x8(%rsp), %r8
movq 0x10(%rsp), %r9
pushq %rax
pushq 0x68(%rsp)
pushq %r13
pushq %r15
callq 0x2641
movq 0x20(%rsp), %rdi
addq $0x20, %rsp
movq %rax, %r15
movq 0x68(%rsp), %rax
jmp 0x2673
movl 0x18(%rbx), %eax
cmpl %eax, 0x18(%r12)
sete %cl
testl %eax, %eax
setne %al
testb %al, %cl
jne 0x2771
movslq 0x28(%rbx), %rax
testq %rax, %rax
js 0x2783
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %r12
movslq 0x28(%r12), %rdi
shlq $0x3, %rdi
callq 0x1180
pushq $0x2
popq %rdx
movq %r12, %rdi
movq %rax, (%rsp)
movq %rax, %rsi
callq 0x25c3
xorl %r12d, %r12d
xorl %r14d, %r14d
movslq (%r13), %rax
cmpq %rax, %r14
jge 0x2748
movq 0x10(%r13), %rcx
movq (%rcx,%r14,8), %r9
movq %rbx, %rdi
movl %ebp, %esi
movl %r12d, %edx
movq 0x10(%rsp), %rcx
movq %r15, %r8
pushq 0x60(%rsp)
pushq %rax
callq 0x28b4
popq %rcx
popq %rdx
movq %rax, %r15
incq %r14
jmp 0x2713
movslq 0x28(%rbx), %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
movq (%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x27ba
incl %r12d
testb %al, %al
jne 0x2710
movq (%rsp), %rdi
callq 0x1030
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r14d, %r14d
movslq (%r13), %rax
cmpq %rax, %r14
jge 0x2771
movq 0x10(%r13), %rcx
movq (%rcx,%r14,8), %r9
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
movq 0x10(%rsp), %rcx
movq %r15, %r8
pushq 0x60(%rsp)
pushq %rax
callq 0x28b4
popq %rcx
popq %rdx
movq %rax, %r15
incq %r14
jmp 0x2786