// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x8303
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x82a7
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x8140
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rsi
callq 0x80d0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x8114
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x8180
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rdx
movq 0x8(%rdx), %rdx
movslq -0x14(%rbp), %rsi
movq (%rdx,%rsi,8), %rdx
movslq (%rdx), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
addl (%rcx), %eax
movl %eax, -0x1c(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x8147
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
movslq (%rdx), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x1110
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
movslq (%rdx), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x826b
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rdx
movq 0x8(%rdx), %rdx
movslq -0x14(%rbp), %rsi
movq (%rdx,%rsi,8), %rdx
movslq (%rdx), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jg 0x825b
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq (%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movslq -0x20(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x81dc
jmp 0x825d
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x81c9
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
movl -0x20(%rbp), %edx
movl $0x1, %esi
callq 0x8030
movl -0x20(%rbp), %ecx
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
movslq (%rdx), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
jmp 0x8301
movl $0x8, %edi
callq 0x1110
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
movslq (%rdx), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
movslq (%rdx), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x1, (%rax)
jmp 0x8303
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)