// File: dcarrey[P]hgt-detection/./utils_tree.cpp
// Function: ecrireMatrice(double**, char const*, int, char**)
int ecrireMatrice(double **mat,const char *outfile,int taille,char **noms){
	int i,j,finalTaille;
	FILE *out;
	
	finalTaille=0;
	
	/*for(i=1;i<=taille;i++)
		if(mat[1][i] != -1)
			finalTaille = finalTaille+1;*/
	for(i=1;i<=taille;i++)
		if(strcmp(noms[i],"")!=0)
			finalTaille = finalTaille+1;
	if(finalTaille < 3){
		printf("There are less than 3 same species !");
		return -1;
	}
	if((out=fopen(outfile,"w+"))==NULL){
		printf("cannot create output file !!");
		printf("==1==>%s<===",outfile);
		exit(-1);
	}
	else{
		fprintf(out,"%d",finalTaille);
		//printf("%d",finalTaille);
		for(i=1;i<=taille;i++){
			if(strcmp(noms[i],"") != 0){//if(strlen(noms[i]) > 1){
				fprintf(out,"\n%s",noms[i]);
				//printf("\n%s",noms[i]);
				for(j=1;j<=taille;j++)
					if(mat[i][j] != -1){
						//printf(" %lf",mat[i][j]);
						fprintf(out," %lf",mat[i][j]);
					}
			}
			else{
				//printf("\nspecies : 1 cas");
			}
		}
		fclose(out);
	}
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x1, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jg 0xa990
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1b888(%rip), %rsi     # 0x261f8
callq 0x1130
cmpl $0x0, %eax
je 0xa983
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xa985
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xa955
cmpl $0x3, -0x34(%rbp)
jge 0xa9b0
leaq 0x1ae07(%rip), %rdi     # 0x257a4
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xaae9
movq -0x18(%rbp), %rdi
leaq 0x1ae0e(%rip), %rsi     # 0x257c9
callq 0x10c0
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0xa9f4
leaq 0x1adfb(%rip), %rdi     # 0x257cc
movb $0x0, %al
callq 0x1030
movq -0x18(%rbp), %rsi
leaq 0x1ae06(%rip), %rdi     # 0x257e9
movb $0x0, %al
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10f0
movq -0x40(%rbp), %rdi
movl -0x34(%rbp), %edx
leaq 0x1b87d(%rip), %rsi     # 0x2627f
movb $0x0, %al
callq 0x1140
movl $0x1, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jg 0xaad9
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1b7c9(%rip), %rsi     # 0x261f8
callq 0x1130
cmpl $0x0, %eax
je 0xaac7
movq -0x40(%rbp), %rdi
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x1ba74(%rip), %rsi     # 0x264c8
movb $0x0, %al
callq 0x1140
movl $0x1, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jg 0xaac5
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x1a5d9(%rip), %xmm1    # 0x25060
ucomisd %xmm1, %xmm0
jne 0xaa91
jp 0xaa91
jmp 0xaab8
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x1b954(%rip), %rsi     # 0x26405
movb $0x1, %al
callq 0x1140
jmp 0xaaba
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xaa62
jmp 0xaac9
jmp 0xaac9
jmp 0xaacb
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xaa10
movq -0x40(%rbp), %rdi
callq 0x1090
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)