// File: dcarrey[P]hgt-detection/./fonctions.cpp
// Function: ListesBranchesPourHGT(int*, long*, int, DescTree*, int*, int*)
void ListesBranchesPourHGT(int *tab_sommets,long int * ARETE, int taille,struct DescTree *DT,int *tab_branches,int *nb_branches){
	
	(*nb_branches) = 0;
	for(int i=1;i<=2*taille-3;i++){
		DT[ARETE[2*i-1]].Tableau[0] = DT[ARETE[2*i-1]].nbSommet;
		DT[ARETE[2*i-2]].Tableau[0] = DT[ARETE[2*i-2]].nbSommet;
		
		if( ((Est_un_sous_ensemble_exact(DT[ARETE[2*i-1]].Tableau,tab_sommets)==1) || (Est_un_sous_ensemble_exact(DT[ARETE[2*i-2]].Tableau,tab_sommets)==1)) ||
		    ((Est_un_sous_ensemble_exact(DT[ARETE[2*i-2]].Tableau,tab_sommets)==1) || (Est_un_sous_ensemble_exact(DT[ARETE[2*i-1]].Tableau,tab_sommets)==1)) ){
			(*nb_branches) ++;
			
			tab_branches[(*nb_branches)] = i;
					
		}	
	}
	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x30(%rbp), %rax
movl $0x0, (%rax)
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl -0x14(%rbp), %ecx
shll %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jg 0xc333
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x34(%rbp), %edx
shll %edx
subl $0x1, %edx
movslq %edx, %rdx
imulq $0x18, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rdx
movl -0x34(%rbp), %esi
shll %esi
subl $0x1, %esi
movslq %esi, %rsi
imulq $0x18, (%rdx,%rsi,8), %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x34(%rbp), %edx
shll %edx
subl $0x2, %edx
movslq %edx, %rdx
imulq $0x18, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rdx
movl -0x34(%rbp), %esi
shll %esi
subl $0x2, %esi
movslq %esi, %rsi
imulq $0x18, (%rdx,%rsi,8), %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x34(%rbp), %edx
shll %edx
subl $0x1, %edx
movslq %edx, %rdx
imulq $0x18, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0xc0e0
cmpl $0x1, %eax
je 0xc307
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x34(%rbp), %edx
shll %edx
subl $0x2, %edx
movslq %edx, %rdx
imulq $0x18, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0xc0e0
cmpl $0x1, %eax
je 0xc307
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x34(%rbp), %edx
shll %edx
subl $0x2, %edx
movslq %edx, %rdx
imulq $0x18, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0xc0e0
cmpl $0x1, %eax
je 0xc307
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x34(%rbp), %edx
shll %edx
subl $0x1, %edx
movslq %edx, %rdx
imulq $0x18, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0xc0e0
cmpl $0x1, %eax
jne 0xc323
movq -0x30(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl -0x34(%rbp), %edx
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movslq (%rcx), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0xc325
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xc1c0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)