// File: /workspace/github_c_makefile_star2_O0/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 %rbx
subq $0x80, %rsp
movq 0xa8(%rsp), %rax
movq 0xa0(%rsp), %rax
movq 0x98(%rsp), %rax
movq 0x90(%rsp), %rax
movq %rdi, 0x78(%rsp)
movq %rsi, 0x70(%rsp)
movq %rdx, 0x68(%rsp)
movl %ecx, 0x64(%rsp)
movq %r8, 0x58(%rsp)
movq %r9, 0x50(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x38(%rsp)
movl $0x0, 0x30(%rsp)
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x48(%rsp)
je 0x3b34
movq 0x48(%rsp), %rax
movl 0x24(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x3b1f
movq 0x78(%rsp), %rdi
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rsi
movq 0x68(%rsp), %rdx
movl 0x64(%rsp), %ecx
movq 0x58(%rsp), %r8
movq 0x50(%rsp), %r9
movq 0x38(%rsp), %rbx
movq 0x98(%rsp), %r11
movq 0xa0(%rsp), %r10
movq 0xa8(%rsp), %rax
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x3a40
movq %rax, 0x38(%rsp)
jmp 0x3b21
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
jmp 0x3aa8
movl $0x0, 0x2c(%rsp)
movq 0x68(%rsp), %rax
movl 0x18(%rax), %eax
movq 0x70(%rsp), %rcx
cmpl 0x18(%rcx), %eax
jne 0x3b5d
movq 0x70(%rsp), %rax
cmpl $0x0, 0x18(%rax)
jne 0x3ce7
movq 0x70(%rsp), %rax
cmpl $0x0, 0x28(%rax)
jge 0x3bdc
jmp 0x3b6a
movl 0x2c(%rsp), %eax
movq 0x98(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x3bd7
movq 0x70(%rsp), %rdi
movl 0x64(%rsp), %esi
movq 0x50(%rsp), %rcx
movq 0x38(%rsp), %r8
movq 0x98(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x2c(%rsp), %rdx
movq (%rax,%rdx,8), %r9
movq 0x98(%rsp), %rax
movl (%rax), %r10d
movq 0xa0(%rsp), %rax
xorl %edx, %edx
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x3f40
movq %rax, 0x38(%rsp)
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x3b6a
jmp 0x3ce5
movq 0x58(%rsp), %rax
movq 0x70(%rsp), %rcx
movslq 0x28(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x28(%rax), %rdi
shlq $0x3, %rdi
callq 0x1170
movq %rax, 0x40(%rsp)
movq 0x58(%rsp), %rax
movq 0x70(%rsp), %rcx
movslq 0x28(%rcx), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x40(%rsp), %rsi
movl $0x2, %edx
callq 0x3920
movl $0x0, 0x30(%rsp)
movl $0x0, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
movq 0x98(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x3ca0
movq 0x70(%rsp), %rdi
movl 0x64(%rsp), %esi
movl 0x30(%rsp), %edx
movq 0x50(%rsp), %rcx
movq 0x38(%rsp), %r8
movq 0x98(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x2c(%rsp), %r9
movq (%rax,%r9,8), %r9
movq 0x98(%rsp), %rax
movl (%rax), %r10d
movq 0xa0(%rsp), %rax
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x3f40
movq %rax, 0x38(%rsp)
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x3c31
movq 0x58(%rsp), %rax
movq 0x70(%rsp), %rcx
movslq 0x28(%rcx), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x40(%rsp), %rsi
movl $0x2, %edx
callq 0x3d00
movb %al, 0x37(%rsp)
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
cmpb $0x0, 0x37(%rsp)
jne 0x3c29
movq 0x40(%rsp), %rdi
callq 0x1030
jmp 0x3ce7
movq 0x38(%rsp), %rax
addq $0x80, %rsp
popq %rbx
retq
nopw %cs:(%rax,%rax)