// File: /workspace/github_cpp_makefile_star2_O3/dcarrey[P]hgt-detection/./utils_tree.cpp
// Function: ParcoursArbre(TNoeud*, DescTree*)
void ParcoursArbre(struct TNoeud * unNoeud, struct DescTree * SousMatriceTree){

	int j,k;
	int somme=0;
	int nbSommet=0;
	int nbfils;
	
	if(unNoeud != NULL){
		nbfils = unNoeud->nbfils;
		/*printf("\n%d",unNoeud->NoNoeud);*/


		if(nbfils != 0){

			for(j=0; j<nbfils;j++){
				ParcoursArbre(unNoeud->fils[j],SousMatriceTree);
			}
		
			for(j=0; j<nbfils;j++){
				/*toto = unNoeud->fils[j]->NoNoeud;*/
				somme = somme + SousMatriceTree[unNoeud->fils[j]->NoNoeud].nbSommet;
			}
			SousMatriceTree[unNoeud->NoNoeud].nbSommet = somme; /*SousMatriceTree[unNoeud->droit->NoNoeud].nbSommet + SousMatriceTree[unNoeud->gauche->NoNoeud].nbSommet;*/
			SousMatriceTree[unNoeud->NoNoeud].Tableau = (int*)malloc((somme+1)*sizeof(int));
			
			for(j=0;j<nbfils;j++){
				for(k=1;k<=SousMatriceTree[unNoeud->fils[j]->NoNoeud].nbSommet;k++) {
					nbSommet++;	
					SousMatriceTree[unNoeud->NoNoeud].Tableau[nbSommet] = SousMatriceTree[unNoeud->fils[j]->NoNoeud].Tableau[k];
				}
			}
			/*sort(listeSommet.begin(),listeSommet.end());*/
			sortIntTab(SousMatriceTree[unNoeud->NoNoeud].Tableau,1,nbSommet);

			/*SousMatriceTree[unNoeud->NoNoeud].nbSommet = listeSommet.size();*/
			SousMatriceTree[unNoeud->NoNoeud].nbSommet = nbSommet;
			
		}
		else{

			SousMatriceTree[unNoeud->NoNoeud].Tableau = (int*)malloc((2)*sizeof(int));

			SousMatriceTree[unNoeud->NoNoeud].Tableau[1] = unNoeud->NoNoeud;
			SousMatriceTree[unNoeud->NoNoeud].nbSommet = 1;
		}
	}
	
}

// Assembly:
testq %rdi, %rdi
je 0x4cc0
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x10(%rdi), %r12d
testq %r12, %r12
je 0x4bdb
xorl %r15d, %r15d
movl $0x0, %eax
testl %r12d, %r12d
jle 0x4c01
xorl %r13d, %r13d
movq 0x8(%r14), %rax
movq (%rax,%r13,8), %rdi
movq %rbx, %rsi
callq 0x4b68
incq %r13
cmpq %r13, %r12
jne 0x4b9e
testl %r12d, %r12d
jle 0x4bff
movq 0x8(%r14), %rcx
xorl %edx, %edx
xorl %eax, %eax
movq (%rcx,%rdx,8), %rsi
movslq (%rsi), %rsi
leaq (%rsi,%rsi,2), %rsi
addl (%rbx,%rsi,8), %eax
incq %rdx
cmpq %rdx, %r12
jne 0x4bc3
jmp 0x4c01
movl $0x8, %edi
callq 0x1140
movslq (%r14), %rcx
leaq (%rcx,%rcx,2), %rdx
movq %rax, 0x10(%rbx,%rdx,8)
movl %ecx, 0x4(%rax)
movl $0x1, %r15d
jmp 0x4caa
xorl %eax, %eax
movslq (%r14), %rcx
leaq (%rcx,%rcx,2), %r13
movl %eax, (%rbx,%r13,8)
cltq
leaq 0x4(,%rax,4), %rdi
callq 0x1140
movq %rax, 0x10(%rbx,%r13,8)
testl %r12d, %r12d
jle 0x4c97
movq 0x8(%r14), %rax
xorl %ecx, %ecx
xorl %r15d, %r15d
movq (%rax,%rcx,8), %rdx
movslq (%rdx), %r8
leaq (%r8,%r8,2), %rsi
cmpl $0x0, (%rbx,%rsi,8)
jle 0x4c83
movslq %r15d, %rsi
leaq 0x4(,%rsi,4), %rdi
xorl %esi, %esi
leaq (%r8,%r8,2), %r8
movq 0x10(%rbx,%r8,8), %r8
movl 0x4(%r8,%rsi,4), %r8d
movslq (%r14), %r9
leaq (%r9,%r9,2), %r9
movq 0x10(%rbx,%r9,8), %r9
addq %rdi, %r9
movl %r8d, (%r9,%rsi,4)
movslq (%rdx), %r8
leaq (%r8,%r8,2), %r9
movslq (%rbx,%r9,8), %r9
incq %rsi
cmpq %r9, %rsi
jl 0x4c4c
addl %esi, %r15d
incq %rcx
cmpq %r12, %rcx
jne 0x4c2e
movslq (%r14), %rax
leaq (%rax,%rax,2), %rax
movq 0x10(%rbx,%rax,8), %rax
movq %rax, %rdi
movl $0x1, %esi
movl %r15d, %edx
callq 0x4b21
movslq (%r14), %rcx
leaq (%rcx,%rcx,2), %rax
movl %r15d, (%rbx,%rax,8)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq