// File: dcarrey[P]hgt-detection/./utils_tree.cpp
// Function: lectureNewick1(char const*, long*, double*, char**)
int lectureNewick1(const char * newick, long int * ARETE, double * LONGUEUR, char ** lesNoms)
{
	int n;                                     

	// Ce sous programme permet de lire un arbre au format newick et de le transcrire dans
	// des vecteurs arete-longueur commencant � 1
	// ATTENTION: les noms commencent � 0
	// 7 octobre 2004
	// Elmaestro

	// TODO: Add your command handler code here
	int i,j,j1,k, a, a1, a2,a3, VertexNumber,numero;
	char symbol, *string, *string1, *string2/* *string3,c ,**Et*/;
	int taxaPos; // le nombre de taxas recup�r�
	int aretePos; // le nombre d'aretes recup�r�
	char symbolOld =' ';
	int zz, xx,jj,ii;
	double longueur;
	char * tempString;
	int cpt=0;
	//long int *ARETE;
	//double *LONGUEUR; 	

	//Correctness of the Newick format verification
	i=0;
	n = 0;

	do
	{
		symbol = newick[cpt++];
		if (symbol==':') i++;
		if (symbol == ':' && symbolOld != ')') n++;
		symbolOld = symbol;
	}  while(symbol != '\0');

	cpt=0;

	if (i == 0) { printf("Incorrect Newick file format. Edge lengths must be indicated after a ':' characters."); exit(FAIL);}

	j=0;
	do{ 
	   symbol=newick[cpt++]; 
	   if (symbol=='(') j++; 
	}while(symbol != '\0');
	
	cpt=0;	
	j1=0;
	
	do{
		symbol=newick[cpt++];
		if (symbol==')') j1++; 
	}while(symbol != '\0');  
	
	cpt=0;

	// verification des arit�s de l'arbre
	if (j1!=j) { printf("Incorrect Newick file format. Number of right parentheses must be equal to number of left parentheses."); exit(FAIL);}
	//else if (j!=n-2) { printf("Incorrect Newick file format. Only trees with vertices of degree 1 and 3 are allowed by T-REX."); fclose (data); exit(FAIL);}

	k=0;

	do{ 
		symbol=newick[cpt++];
		if (symbol==',') k++; 
	}while(symbol != '\0');   
	
	cpt=0;
	//if (k!=(n-1)) { printf("Incorrect Newick file format. Number of objects must be equal to number of commas plus 1."); fclose (data); exit(FAIL);}

	a=0;

	do{ 
		symbol=newick[cpt++];
		if (symbol==';') a++; 
	}while(symbol != '\0');    
	cpt=0;

	if (a==0) { printf("Incorrect Newick file format. Newick string must be followed by a ';' character."); exit(FAIL);}
	else if (a>1) { printf("Incorrect Newick file format. Newick string must contain (in the end) only one ';' character."); exit(FAIL);}

	a=0;
	do{
		symbol=newick[cpt++];a++;
	}while(symbol == ' '); 
	
	cpt=0;

	if (symbol!='(') { printf("Incorrect Newick file format. Newick string must begin with a '(' character."); exit(FAIL);}  

	a=0;
	
	do{ symbol=newick[cpt++];
		if (symbol=='%') a++; 
	}while(symbol != '\0');

	cpt=0;

	if (a>0) { printf("Incorrect Newick file format. Newick string cannot contain \'%%\' character."); exit(FAIL);}

	do
	{
		symbol=newick[cpt++];
		if ((symbol=='(')||(symbol==','))		
		{ 
			symbol=newick[cpt++]; a=0;
			if ((symbol!='(')&&(symbol!=',')&&(symbol!=';')&&(symbol!=':'))		   
			{ 
				cpt--; 
				do{
					symbol=newick[cpt++];a++;
				}while ((symbol!=':')&&(symbol!='\0'));  
			}
			else cpt--;
			if (a>50) { printf("Incorrect Newick file format. Names of objects must not exceed 50 characters.");  exit(FAIL);}   
		}	
	}while(symbol != '\0');
	cpt=0;

	string = (char*)malloc((1000*n) * sizeof(char));
	string2 = (char*)malloc((1000*n) * sizeof(char));
	//string3 = (char*)malloc((1000*n) * sizeof(char));
	string1 = (char*)malloc((2000) * sizeof(char));

	if ((string == NULL)||(string1 == NULL)||(string2 == NULL)/*||(string3 == NULL)*/)
	{ printf("Input data are too large or not a correct Newick file chosen"); exit(FAIL);}

	a=0;

	do{		
		symbol=newick[cpt++];
		if ((symbol!=' ')&&(symbol!='\n')&&(symbol!='\t')) { string[a++]=symbol; } 
	}while(symbol !='\0'); 

	k=0; VertexNumber=n;
	//a1 = 0;
	//a2 = 0;
	taxaPos =1;    // nous allons commencer � mettre les taxas � la position 1
	aretePos = 1;
	while (string[0] == '(')   // traiter toute la chaine
	{
		a1 = 0;
		a2 = 0;
		while( string[a2] != ')')  // traiter la paire () la plus profonde
		{
			if(string[a2] == '(') a1 = a2;  // retrouver ;a parenth�se ouvrante
			a2++;
		}
		

		// a   => contient la longueur de la chaine
		// a1  => contient le debut d'un noeud � traiter
		// a2  => contient la fin d'un noeud � traiter
		// a3  => d�limite le noeud et sa longueur

		zz = a1+1;
		VertexNumber++;  // augmenter le nombre de noeuds
		for ( ii = a1+1; ii <= a2; ii++)
		{// decortiquer cette chaine

			if (string[ii] == ':')
			{
				xx = 0;
				a3 = ii+1;

				if( string[zz] == '%')
				{ // cela veut dire que c'est un  noeud que l'on traite

					for ( jj = zz+1; jj < ii; jj++)
					{
						string1[xx++] = string[jj]; 
					}
					string1[xx++] = '\0';
					numero = atoi(string1);
				}
				else
				{
					// on recup�re le nom du taxa

					for(jj = zz; jj < ii; jj++)
					{
						lesNoms[taxaPos-1][xx++] = string[jj];
					}
					numero = taxaPos;
					lesNoms[taxaPos-1][xx] = '\0';  // mettre la fin de chaine
					taxaPos++;  // augmenter le nombre de taxas pris
				}

			}
			else if(string[ii] == ','  || string[ii] == ')')
			{
				xx = 0;
				zz = ii +1;   // faire pointer sur le prochain noeud
				for ( jj = a3; jj < ii; jj++)
				{
					string1[xx++] = string[jj]; 
				}
				string1[xx++] = '\0';
				longueur = atof(string1);
				ARETE[aretePos++] = VertexNumber;
				ARETE[aretePos++] = numero;
				LONGUEUR[(aretePos-1)/ 2] = longueur;
			}

		}

		// fin for pour traiter noeud
		//transcrire la nouvelle chaine
		xx = 0;
		for ( jj = 0; jj < (int)a1; jj++)
		{string2[xx++] = string[jj];}

		// ecrire le vertex
		//	char buffer[50];
		itoa_(VertexNumber,string1,10);
		string2[xx++] = '%';   // indiquer que c'est un noeud
		for( jj = 0; jj < (int) strlen(string1); jj++)
		{string2[xx++] = string1[jj];}

		// transcrire la fin
		for( jj = a2+1; jj <= a; jj++)  // il faut voir si c'est  <= a ou c < a
		{string2[xx++] = string[jj];}

		// remplacer string par string2 en remplacant les pointeurs
		
		tempString = string;
		string = string2;
		string2 = tempString;
		tempString = 0;
		a = xx;  // mettre la longueur � jour 

	} // fin du while pour traiter toute la string

	for( jj=n;jj>0;jj--)
		strcpy(lesNoms[jj],lesNoms[jj-1]);

	ARETE[aretePos++] = 0;
	ARETE[aretePos++] = 0;


	for(i=1;i<=2*n-3;i++){
		LONGUEUR[i-1] = LONGUEUR[i];
	}
	for(i=1;i<=2*(2*n-3);i++){
		ARETE[i-1] = ARETE[i];
	}


	free(string);
	free(string1);
	free(string2);
	//free(string3);

	return n;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movb $0x20, -0x71(%rbp)
movl $0x0, -0x9c(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x8(%rbp), %rax
movl -0x9c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x9c(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x4d(%rbp)
movsbl -0x4d(%rbp), %eax
cmpl $0x3a, %eax
jne 0x9ce7
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movsbl -0x4d(%rbp), %eax
cmpl $0x3a, %eax
jne 0x9d02
movsbl -0x71(%rbp), %eax
cmpl $0x29, %eax
je 0x9d02
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movb -0x4d(%rbp), %al
movb %al, -0x71(%rbp)
movsbl -0x4d(%rbp), %eax
cmpl $0x0, %eax
jne 0x9cb7
movl $0x0, -0x9c(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0x9d39
leaq 0x1b775(%rip), %rdi     # 0x2549d
movb $0x0, %al
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10f0
movl $0x0, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movl -0x9c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x9c(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x4d(%rbp)
movsbl -0x4d(%rbp), %eax
cmpl $0x28, %eax
jne 0x9d70
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x9d72
movsbl -0x4d(%rbp), %eax
cmpl $0x0, %eax
jne 0x9d40
movl $0x0, -0x9c(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rax
movl -0x9c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x9c(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x4d(%rbp)
movsbl -0x4d(%rbp), %eax
cmpl $0x29, %eax
jne 0x9dbc
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x9dbe
movsbl -0x4d(%rbp), %eax
cmpl $0x0, %eax
jne 0x9d8c
movl $0x0, -0x9c(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x2c(%rbp), %eax
je 0x9df1
leaq 0x1b712(%rip), %rdi     # 0x254f2
movb $0x0, %al
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10f0
movl $0x0, -0x34(%rbp)
movq -0x8(%rbp), %rax
movl -0x9c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x9c(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x4d(%rbp)
movsbl -0x4d(%rbp), %eax
cmpl $0x2c, %eax
jne 0x9e28
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x9e2a
movsbl -0x4d(%rbp), %eax
cmpl $0x0, %eax
jne 0x9df8
movl $0x0, -0x9c(%rbp)
movl $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rax
movl -0x9c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x9c(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x4d(%rbp)
movsbl -0x4d(%rbp), %eax
cmpl $0x3b, %eax
jne 0x9e74
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x9e76
movsbl -0x4d(%rbp), %eax
cmpl $0x0, %eax
jne 0x9e44
movl $0x0, -0x9c(%rbp)
cmpl $0x0, -0x38(%rbp)
jne 0x9ea7
leaq 0x1b6c3(%rip), %rdi     # 0x25559
movb $0x0, %al
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10f0
cmpl $0x1, -0x38(%rbp)
jle 0x9ec5
leaq 0x1b6f6(%rip), %rdi     # 0x255aa
movb $0x0, %al
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10f0
jmp 0x9ec7
movl $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rax
movl -0x9c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x9c(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x4d(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movsbl -0x4d(%rbp), %eax
cmpl $0x20, %eax
je 0x9ece
movl $0x0, -0x9c(%rbp)
movsbl -0x4d(%rbp), %eax
cmpl $0x28, %eax
je 0x9f29
leaq 0x1b6f0(%rip), %rdi     # 0x25608
movb $0x0, %al
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10f0
movl $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rax
movl -0x9c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x9c(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x4d(%rbp)
movsbl -0x4d(%rbp), %eax
cmpl $0x25, %eax
jne 0x9f60
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x9f62
movsbl -0x4d(%rbp), %eax
cmpl $0x0, %eax
jne 0x9f30
movl $0x0, -0x9c(%rbp)
cmpl $0x0, -0x38(%rbp)
jle 0x9f93
leaq 0x1b6d3(%rip), %rdi     # 0x25655
movb $0x0, %al
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10f0
jmp 0x9f95
movq -0x8(%rbp), %rax
movl -0x9c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x9c(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x4d(%rbp)
movsbl -0x4d(%rbp), %eax
cmpl $0x28, %eax
je 0x9fc9
movsbl -0x4d(%rbp), %eax
cmpl $0x2c, %eax
jne 0xa0a4
movq -0x8(%rbp), %rax
movl -0x9c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x9c(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x4d(%rbp)
movl $0x0, -0x38(%rbp)
movsbl -0x4d(%rbp), %eax
cmpl $0x28, %eax
je 0xa075
movsbl -0x4d(%rbp), %eax
cmpl $0x2c, %eax
je 0xa075
movsbl -0x4d(%rbp), %eax
cmpl $0x3b, %eax
je 0xa075
movsbl -0x4d(%rbp), %eax
cmpl $0x3a, %eax
je 0xa075
movl -0x9c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x9c(%rbp)
movq -0x8(%rbp), %rax
movl -0x9c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x9c(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x4d(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movsbl -0x4d(%rbp), %ecx
xorl %eax, %eax
cmpl $0x3a, %ecx
movb %al, -0x9d(%rbp)
je 0xa069
movsbl -0x4d(%rbp), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x9d(%rbp)
movb -0x9d(%rbp), %al
testb $0x1, %al
jne 0xa021
jmp 0xa084
movl -0x9c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x9c(%rbp)
cmpl $0x32, -0x38(%rbp)
jle 0xa0a2
leaq 0x1b60f(%rip), %rdi     # 0x256a0
movb $0x0, %al
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10f0
jmp 0xa0a4
jmp 0xa0a6
movsbl -0x4d(%rbp), %eax
cmpl $0x0, %eax
jne 0x9f95
movl $0x0, -0x9c(%rbp)
imull $0x3e8, -0x24(%rbp), %eax # imm = 0x3E8
movslq %eax, %rdi
shlq $0x0, %rdi
callq 0x1110
movq %rax, -0x58(%rbp)
imull $0x3e8, -0x24(%rbp), %eax # imm = 0x3E8
movslq %eax, %rdi
shlq $0x0, %rdi
callq 0x1110
movq %rax, -0x68(%rbp)
movl $0x7d0, %edi            # imm = 0x7D0
callq 0x1110
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0xa10e
cmpq $0x0, -0x60(%rbp)
je 0xa10e
cmpq $0x0, -0x68(%rbp)
jne 0xa126
leaq 0x1b5d9(%rip), %rdi     # 0x256ee
movb $0x0, %al
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10f0
movl $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rax
movl -0x9c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x9c(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x4d(%rbp)
movsbl -0x4d(%rbp), %eax
cmpl $0x20, %eax
je 0xa17e
movsbl -0x4d(%rbp), %eax
cmpl $0xa, %eax
je 0xa17e
movsbl -0x4d(%rbp), %eax
cmpl $0x9, %eax
je 0xa17e
movb -0x4d(%rbp), %dl
movq -0x58(%rbp), %rax
movl -0x38(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x38(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
jmp 0xa180
movsbl -0x4d(%rbp), %eax
cmpl $0x0, %eax
jne 0xa12d
movl $0x0, -0x34(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x48(%rbp)
movl $0x1, -0x6c(%rbp)
movl $0x1, -0x70(%rbp)
movq -0x58(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x28, %eax
jne 0xa580
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x58(%rbp), %rax
movslq -0x40(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x29, %eax
je 0xa1f5
movq -0x58(%rbp), %rax
movslq -0x40(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x28, %eax
jne 0xa1ea
movl -0x40(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xa1c2
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %eax
cmpl -0x40(%rbp), %eax
jg 0xa457
movq -0x58(%rbp), %rax
movslq -0x84(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
jne 0xa337
movl $0x0, -0x7c(%rbp)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movq -0x58(%rbp), %rax
movslq -0x78(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x25, %eax
jne 0xa2c1
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x84(%rbp), %eax
jge 0xa29d
movq -0x58(%rbp), %rax
movslq -0x80(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x60(%rbp), %rax
movl -0x7c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x7c(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0xa267
movq -0x60(%rbp), %rax
movl -0x7c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x7c(%rbp)
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq -0x60(%rbp), %rdi
callq 0x1150
movl %eax, -0x4c(%rbp)
jmp 0xa332
movl -0x78(%rbp), %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x84(%rbp), %eax
jge 0xa30a
movq -0x58(%rbp), %rax
movslq -0x80(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x20(%rbp), %rax
movl -0x6c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl -0x7c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x7c(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0xa2c7
movl -0x6c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movq -0x20(%rbp), %rax
movl -0x6c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0x7c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0xa441
movq -0x58(%rbp), %rax
movslq -0x84(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2c, %eax
je 0xa363
movq -0x58(%rbp), %rax
movslq -0x84(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x29, %eax
jne 0xa43f
movl $0x0, -0x7c(%rbp)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x84(%rbp), %eax
jge 0xa3b2
movq -0x58(%rbp), %rax
movslq -0x80(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x60(%rbp), %rax
movl -0x7c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x7c(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0xa37c
movq -0x60(%rbp), %rax
movl -0x7c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x7c(%rbp)
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq -0x60(%rbp), %rdi
callq 0x1100
movsd %xmm0, -0x90(%rbp)
movslq -0x48(%rbp), %rdx
movq -0x10(%rbp), %rax
movl -0x70(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x70(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movslq -0x4c(%rbp), %rdx
movq -0x10(%rbp), %rax
movl -0x70(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x70(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movsd -0x90(%rbp), %xmm0
movq -0x18(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl -0x70(%rbp), %eax
subl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0xa8(%rbp), %rax
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xa441
jmp 0xa443
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0xa213
movl $0x0, -0x7c(%rbp)
movl $0x0, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0xa498
movq -0x58(%rbp), %rax
movslq -0x80(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x68(%rbp), %rax
movl -0x7c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x7c(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0xa465
movl -0x48(%rbp), %edi
movq -0x60(%rbp), %rsi
movl $0xa, %edx
callq 0x88d0
movq -0x68(%rbp), %rax
movl -0x7c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x7c(%rbp)
movslq %ecx, %rcx
movb $0x25, (%rax,%rcx)
movl $0x0, -0x80(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0xac(%rbp)
movq -0x60(%rbp), %rdi
callq 0x1050
movq %rax, %rcx
movl -0xac(%rbp), %eax
cmpl %ecx, %eax
jge 0xa510
movq -0x60(%rbp), %rax
movslq -0x80(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x68(%rbp), %rax
movl -0x7c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x7c(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0xa4c6
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x38(%rbp), %eax
jg 0xa54c
movq -0x58(%rbp), %rax
movslq -0x80(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x68(%rbp), %rax
movl -0x7c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x7c(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0xa519
movq -0x58(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x68(%rbp)
movq $0x0, -0x98(%rbp)
movl -0x7c(%rbp), %eax
movl %eax, -0x38(%rbp)
jmp 0xa1a4
movl -0x24(%rbp), %eax
movl %eax, -0x80(%rbp)
cmpl $0x0, -0x80(%rbp)
jle 0xa5b9
movq -0x20(%rbp), %rax
movslq -0x80(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x20(%rbp), %rax
movl -0x80(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
callq 0x1080
movl -0x80(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0xa586
movq -0x10(%rbp), %rax
movl -0x70(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x70(%rbp)
movslq %ecx, %rcx
movq $0x0, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movl -0x70(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x70(%rbp)
movslq %ecx, %rcx
movq $0x0, (%rax,%rcx,8)
movl $0x1, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl -0x24(%rbp), %ecx
shll %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jg 0xa62d
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x18(%rbp), %rax
movl -0x28(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xa5f4
movl $0x1, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl -0x24(%rbp), %ecx
shll %ecx
subl $0x3, %ecx
shll %ecx
cmpl %ecx, %eax
jg 0xa66d
movq -0x10(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xa634
movq -0x58(%rbp), %rdi
callq 0x10e0
movq -0x60(%rbp), %rdi
callq 0x10e0
movq -0x68(%rbp), %rdi
callq 0x10e0
movl -0x24(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)