// File: dcarrey[P]hgt-detection/./fonctions.cpp
// Function: findAllHGT_no_criterion(InputTree, InputTree, Parameters, HGT*)
int findAllHGT_no_criterion(struct InputTree SpeciesTree, struct InputTree GeneTree,struct Parameters param,struct HGT *tabHGT){
	
	int nbHGT=0;	
	struct InputTree tmpTree;
	int i,j,ktSpecies;
	int size = SpeciesTree.size;
	struct CRITERIA aCrit;
	struct DescTree *DTSpecies,*DTGene;

	initInputTree(&tmpTree);

	//== compute criteria
	InitCriteria(&aCrit,size);

	DTSpecies = (struct DescTree*)malloc((2*SpeciesTree.size)*sizeof(struct DescTree));
	RechercherBipartition(SpeciesTree.ARETE,SpeciesTree.ADD,SpeciesTree.Root,SpeciesTree.Adjacence,DTSpecies,SpeciesTree.size,SpeciesTree.kt);

	for(i=1;i<2*size-3-SpeciesTree.kt;i++)
		for(j=i+1;j<2*size-3-SpeciesTree.kt;j++){
		
			//== is it a valid hgt ?
			if(isAValidHGT(SpeciesTree,i,j)==1){
				
				nbHGT++;
				tabHGT[nbHGT].source = i;
				tabHGT[nbHGT].destination = j;
				tabHGT[nbHGT].valide = 1;

			}
		}
	
	FreeCriteria(&aCrit,size);

	for(i=1;i<=nbHGT;i++)
		findListSpecies(&tabHGT[i],DTSpecies,SpeciesTree);

	
	//printf("\nfin de la fonction");

	return nbHGT;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x210, %rsp            # imm = 0x210
leaq 0x10(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl (%rax), %eax
movl %eax, -0x78(%rbp)
leaq -0x68(%rbp), %rdi
callq 0xd040
movl -0x78(%rbp), %esi
leaq -0xd8(%rbp), %rdi
callq 0x14520
movq -0x1a0(%rbp), %rax
movl (%rax), %eax
shll %eax
cltq
imulq $0x18, %rax, %rdi
callq 0x1110
movq %rax, %rcx
movq -0x1a0(%rbp), %rax
movq %rcx, -0xe0(%rbp)
movq 0x30(%rax), %rdi
movq 0x8(%rax), %rsi
movl 0x20(%rax), %edx
movq 0x28(%rax), %rcx
movq -0xe0(%rbp), %r8
movl (%rax), %r9d
movl 0x48(%rax), %eax
movl %eax, (%rsp)
callq 0x84e0
movl $0x1, -0x6c(%rbp)
movq -0x1a0(%rbp), %rdx
movl -0x6c(%rbp), %eax
movl -0x78(%rbp), %ecx
shll %ecx
subl $0x3, %ecx
subl 0x48(%rdx), %ecx
cmpl %ecx, %eax
jge 0x148b0
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
movq -0x1a0(%rbp), %rdx
movl -0x70(%rbp), %eax
movl -0x78(%rbp), %ecx
shll %ecx
subl $0x3, %ecx
subl 0x48(%rdx), %ecx
cmpl %ecx, %eax
jge 0x148a0
movq -0x1a0(%rbp), %rsi
leaq -0x140(%rbp), %rdi
movl $0x58, %edx
callq 0x1070
movl -0x6c(%rbp), %edi
movl -0x70(%rbp), %esi
movq -0xf0(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x50(%rax)
movups -0x100(%rbp), %xmm0
movups %xmm0, 0x40(%rax)
movups -0x140(%rbp), %xmm0
movups -0x130(%rbp), %xmm1
movups -0x120(%rbp), %xmm2
movups -0x110(%rbp), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x12050
cmpl $0x1, %eax
jne 0x14890
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movl -0x6c(%rbp), %ecx
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rdx
imulq $0xa8, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movl -0x70(%rbp), %ecx
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rdx
imulq $0xa8, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl $0x1, (%rax)
jmp 0x14892
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x147b6
jmp 0x148a2
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x14790
movl -0x78(%rbp), %esi
leaq -0xd8(%rbp), %rdi
callq 0x14650
movl $0x1, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jg 0x14976
movq -0x1a0(%rbp), %rsi
movq -0x8(%rbp), %rax
movslq -0x6c(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x1b0(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0x1a8(%rbp)
leaq -0x198(%rbp), %rdi
movl $0x58, %edx
callq 0x1070
movq -0x1b0(%rbp), %rdi
movq -0x1a8(%rbp), %rsi
movq -0x148(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x50(%rax)
movups -0x158(%rbp), %xmm0
movups %xmm0, 0x40(%rax)
movups -0x198(%rbp), %xmm0
movups -0x188(%rbp), %xmm1
movups -0x178(%rbp), %xmm2
movups -0x168(%rbp), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x11b40
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x148c6
movl -0xc(%rbp), %eax
addq $0x210, %rsp            # imm = 0x210
popq %rbp
retq
nopw %cs:(%rax,%rax)