// File: /workspace/github_cpp_makefile_star2_O1/dcarrey[P]hgt-detection/./utils_tree.cpp
// Function: TrierMatrices(double**, char**, char**, int)
void TrierMatrices(double **DISS,char **NomsDISS,char **NomsADD,int n)
{
	int trouve, ligne,colonne,i,j;
	double ** DISS_;
	char   ** NomsDISS_;
	char noms[50];
	int * table;
	

	table = (int *) malloc((n+1)*sizeof(int));
	DISS_ = (double **) malloc((n+1)*sizeof(double*));
	NomsDISS_ = (char **) malloc((n+1)*sizeof(char*));

	for (i=0;i<=n;i++)
	{
		DISS_[i]=(double*)malloc((n+1)*sizeof(double));
		NomsDISS_[i] = (char*) malloc((n+1)*sizeof(15));
	}

	for(ligne = 1;ligne<=n;ligne++)
	{
		strcpy(noms,NomsADD[ligne]);
		trouve = 0;
		for(colonne = 1;colonne<=n;colonne++)
		{
			if(strcmp(noms,NomsDISS[colonne])==0)
			{
				trouve = 1;
				table[ligne] = colonne;
				strcpy(NomsDISS_[ligne],noms);
			}
		}
		if(trouve==0)
		{
			printf("\n%s %s",noms,"is not in the gene matrix.This program must stop");
			exit (-1);	
		}
	}

	for(i=1;i<=n;i++)
		for(j=1;j<=i;j++) DISS_[i][j] = DISS_[j][i] = DISS[table[i]][table[j]];

	for(i=1;i<=n;i++)
	{
		strcpy(NomsDISS[i],NomsDISS_[i]);
		for(j=1;j<=n;j++) DISS[i][j] = DISS_[i][j];
	}
//exit(0);
	for (i=0;i<=n;i++)
	{
		free(DISS_[i]);
		free(NomsDISS_[i]);
	}

	free(DISS_);
    free(NomsDISS_);
	free(table);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, -0x60(%rbp)
movq %rsi, -0x50(%rbp)
movq %rdi, -0x40(%rbp)
movq %rcx, -0x38(%rbp)
movslq %ecx, %rbx
leaq 0x4(,%rbx,4), %rdi
movq %rdi, -0x30(%rbp)
callq 0x1140
movq %rax, -0x48(%rbp)
leaq 0x8(,%rbx,8), %r14
movq %r14, %rdi
callq 0x1140
movq %rax, %r13
movq %r14, %rdi
callq 0x1140
movq %rax, %r12
testl %ebx, %ebx
js 0x677f
movq -0x38(%rbp), %rax
leal 0x1(%rax), %ebx
xorl %r15d, %r15d
movq %r14, %rdi
callq 0x1140
movq %rax, (%r13,%r15,8)
movq -0x30(%rbp), %rdi
callq 0x1140
movq %rax, (%r12,%r15,8)
incq %r15
cmpq %r15, %rbx
jne 0x675d
movq %r12, -0x30(%rbp)
movq %r13, -0x58(%rbp)
cmpl $0x0, -0x38(%rbp)
jle 0x6803
movq -0x38(%rbp), %rax
leal 0x1(%rax), %r12d
movl $0x1, %r13d
leaq -0xa0(%rbp), %r14
movq -0x60(%rbp), %rax
movq (%rax,%r13,8), %rsi
movq %r14, %rdi
callq 0x1090
xorl %ebx, %ebx
movl $0x1, %r15d
movq -0x50(%rbp), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x1170
testl %eax, %eax
jne 0x67eb
movq -0x48(%rbp), %rax
movl %r15d, (%rax,%r13,4)
movq -0x30(%rbp), %rax
movq (%rax,%r13,8), %rdi
movq %r14, %rsi
callq 0x1090
movl $0x1, %ebx
incq %r15
cmpq %r15, %r12
jne 0x67ba
testl %ebx, %ebx
je 0x68fc
incq %r13
cmpq %r12, %r13
jne 0x67a2
movq -0x38(%rbp), %r13
testl %r13d, %r13d
movq -0x48(%rbp), %r12
movq -0x58(%rbp), %rbx
jle 0x685b
leal 0x1(%r13), %eax
movl $0x1, %ecx
movslq (%r12,%rcx,4), %rdx
movq -0x40(%rbp), %rsi
movq (%rsi,%rdx,8), %rdx
movq (%rbx,%rcx,8), %rsi
xorl %edi, %edi
movslq 0x4(%r12,%rdi,4), %r8
movsd (%rdx,%r8,8), %xmm0
movq 0x8(%rbx,%rdi,8), %r8
movsd %xmm0, (%r8,%rcx,8)
movsd %xmm0, 0x8(%rsi,%rdi,8)
incq %rdi
cmpq %rdi, %rcx
jne 0x682f
incq %rcx
cmpq %rax, %rcx
jne 0x681d
testl %r13d, %r13d
jle 0x68aa
leal 0x1(%r13), %r14d
movl $0x1, %r15d
movq -0x50(%rbp), %rax
movq (%rax,%r15,8), %rdi
movq -0x30(%rbp), %rax
movq (%rax,%r15,8), %rsi
callq 0x1090
movq (%rbx,%r15,8), %rax
movq -0x40(%rbp), %rcx
movq (%rcx,%r15,8), %rcx
movl $0x1, %edx
movsd (%rax,%rdx,8), %xmm0
movsd %xmm0, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %r14
jne 0x6890
incq %r15
cmpq %r14, %r15
jne 0x686a
testl %r13d, %r13d
movq %rbx, %r14
movq -0x30(%rbp), %r15
js 0x68d5
incl %r13d
xorl %ebx, %ebx
movq (%r14,%rbx,8), %rdi
callq 0x1100
movq (%r15,%rbx,8), %rdi
callq 0x1100
incq %rbx
cmpq %rbx, %r13
jne 0x68bb
movq %r14, %rdi
callq 0x1100
movq %r15, %rdi
callq 0x1100
movq %r12, %rdi
callq 0x1100
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xeece(%rip), %rdi      # 0x157d1
leaq 0xeece(%rip), %rdx      # 0x157d8
leaq -0xa0(%rbp), %rsi
xorl %eax, %eax
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1110