// File: dcarrey[P]hgt-detection/./utils_tree.cpp
// Function: lectureNewick(char const*, long*, double*, char**, int*)
int lectureNewick(const char * newick, long int * ARETE, double * LONGUEUR, char ** lesNoms, int *kt)
{
	int n;                                     
	int cpt_x;
	// 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, *string4;
	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;
	//char *string4 = (char*) malloc(100000 * sizeof(char));
	string4 = (char*)malloc((100000) * sizeof(char));
	//char *string4 = (char*) malloc(100000);
	//char *string4 = new char[10000];

	int temoin=0;
	int cpt_parenthese=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 !=')' && temoin != 1) n++;
		if(symbol >= '0' && symbol <= '9' && symbolOld==')') temoin=1;
		if(symbol==':' && temoin==1) temoin=0;
		symbolOld = symbol;
	}  while(symbol != '\0');

	cpt=0;

	if(i<=2*n-3)(*kt)=i;
	else (*kt)=2*n-3;

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

	if ((i>2*n-3) || (i<n)){
		//printf("Unable to read your input data, please check it and try again...");
		//exit(-1);
	}

	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((100000) * sizeof(char));
	string2 = (char*)malloc((100000) * sizeof(char));
	//string3 = (char*)malloc((1000*n) * sizeof(char));
	string1 = (char*)malloc((100000) * 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'); 

	int boot_value;
	int temoin3 = 0;
	k=0; VertexNumber=n;
	//a1 = 0;
	//a2 = 0;
	taxaPos =1;    // nous allons commencer � mettre les taxas � la position 1
	aretePos = 1;
	boot_value=0;
	
	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
		boot_value=0;
		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++)
					{
						if(string[jj] == '|')
							break;
						string1[xx++] = string[jj]; 
					}
					temoin3=1;
					string1[xx++] = '\0';
					numero = atoi(string1);
					
					if(string[jj] == '|' ){
						boot_value=1;
						cpt_x=0;
						jj++;
						while(string[jj] != ':')
							string4[cpt_x++] = string[jj++];
						string4[cpt_x] = '\0';
					}
					
				}
				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;

				if(boot_value == 1){
					//printf("\n%d--%d : %lf (%s)",VertexNumber,numero,longueur,string4);
					boot_value=0;
				}
			}

		}

		// 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];}

		int temoin=0;
		
		// transcrire la fin
		for( jj = a2+1; jj <= a; jj++)  // il faut voir si c'est  <= a ou c < a
		{
			if(string[jj] != ':' && temoin==0){
				string2[xx++] = '|';	
			}
			temoin = 1;
			//if(temoin==1)
				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

	int root_existance = -1;
	for( jj=n;jj>0;jj--){
		strcpy(lesNoms[jj],lesNoms[jj-1]);
		if (strcmp(lesNoms[jj],"Root") == 0)
			root_existance = jj;
	}
	printf("\nRoot_existance = %d",root_existance);
	for( jj=1;jj<=n;jj++){
		printf("\n(%d) - %s",jj,lesNoms[jj]); 
	}
	
	
	ARETE[aretePos++] = 0;
	ARETE[aretePos++] = 0;


	for(i=1;i<=2*n-3;i++){
		LONGUEUR[i-1] = LONGUEUR[i];
		if(LONGUEUR[i-1] < 5*epsilon){
			LONGUEUR[i-1] = 5*epsilon;
		}
	}
	for(i=1;i<=2*(2*n-3);i++){
		ARETE[i-1] = ARETE[i];
	}
	
	//== recherche des branches connexes a celle de la racine;
	if( root_existance > 0){
		int noeud_interne = -1;
		for(i=1;i<=2*n-3;i++){
			if(ARETE[2*i-1] == root_existance)
				noeud_interne = ARETE[2*i-2];
			if(ARETE[2*i-2] == root_existance)
				noeud_interne = ARETE[2*i-1];
		}
		printf("\n[%d,%d]",noeud_interne,root_existance);
		for(i=1;i<=2*n-3;i++){
			if((ARETE[2*i-1] != root_existance) && (noeud_interne == ARETE[2*i-2])){
				LONGUEUR[i-1] = 50;
				printf("\n[%d,%ld]",noeud_interne,ARETE[2*i-1]);
			}
			if((ARETE[2*i-2] != root_existance) && (noeud_interne == ARETE[2*i-1])){
				LONGUEUR[i-1] = 50;
				printf("\n[%d,%ld]",noeud_interne,ARETE[2*i-2]);
			}
		}
		
		
	}
	
	
	//=== on teste si il y a un noeud de degre 2 et un noeud de degre 1

	printf("\n");
	for(i=1;i<=2*n-3;i++){
		printf("\n%ld-%ld --> %lf",ARETE[2*i-1],ARETE[2*i-2],LONGUEUR[i-1]);
	}
    printf("\n");
  
	int * tableau = (int*)malloc((2*n)*sizeof(int));
	int deg2=-1,deg1=-1;
	for(i=1;i<2*n;i++)
		tableau[i-1] = 0;
	for(i=1;i<=2*n-3;i++){
		tableau[ARETE[2*i-1]]++;
		tableau[ARETE[2*i-2]]++;
	}
//	printf("\n");
	i=n+1;
	while(tableau[i] > 0){
		//printf("\n%d-->%d",i,tableau[i]);
		if(tableau[i] == 2) deg2 = i;
		if(tableau[i] == 1) deg1 = i;
		i++;
	}
	//printf("\ndeg2=%d , deg1=%d",deg2,deg1);
	int pos_racine=-1;
	
	for(i=1;i<=2*n-3;i++){
		if(ARETE[2*i-1] == deg1){ ARETE[2*i-1] = deg2; pos_racine=i; break;} 
		if(ARETE[2*i-2] == deg1){ ARETE[2*i-2] = deg2; pos_racine=i; break;} 
	}
    if(pos_racine != -1){
        LONGUEUR[pos_racine-1] = 100;
    }
	/*printf("\n");
	for(i=1;i<=2*n-3;i++){
		printf("\n%d-%d --> %lf",ARETE[2*i-1],ARETE[2*i-2],LONGUEUR[i-1]);
	}
  printf("\n");
*/

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

	(*kt) = 2*n-3 - (*kt);
    
    
	return pos_racine;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movb $0x20, -0x89(%rbp)
movl $0x0, -0xb4(%rbp)
movl $0x186a0, %edi          # imm = 0x186A0
callq 0x1110
movq %rax, -0x80(%rbp)
movl $0x0, -0xb8(%rbp)
movl $0x0, -0xbc(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xb4(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x59(%rbp)
movsbl -0x59(%rbp), %eax
cmpl $0x3a, %eax
jne 0x8ad0
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movsbl -0x59(%rbp), %eax
cmpl $0x3a, %eax
jne 0x8af7
movsbl -0x89(%rbp), %eax
cmpl $0x29, %eax
je 0x8af7
cmpl $0x1, -0xb8(%rbp)
je 0x8af7
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movsbl -0x59(%rbp), %eax
cmpl $0x30, %eax
jl 0x8b1f
movsbl -0x59(%rbp), %eax
cmpl $0x39, %eax
jg 0x8b1f
movsbl -0x89(%rbp), %eax
cmpl $0x29, %eax
jne 0x8b1f
movl $0x1, -0xb8(%rbp)
movsbl -0x59(%rbp), %eax
cmpl $0x3a, %eax
jne 0x8b3b
cmpl $0x1, -0xb8(%rbp)
jne 0x8b3b
movl $0x0, -0xb8(%rbp)
movb -0x59(%rbp), %al
movb %al, -0x89(%rbp)
movsbl -0x59(%rbp), %eax
cmpl $0x0, %eax
jne 0x8aa0
movl $0x0, -0xb4(%rbp)
movl -0x34(%rbp), %eax
movl -0x2c(%rbp), %ecx
shll %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jg 0x8b75
movl -0x34(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
jmp 0x8b83
movl -0x2c(%rbp), %ecx
shll %ecx
subl $0x3, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
cmpl $0x0, -0x34(%rbp)
jne 0x8ba1
leaq 0x1c90d(%rip), %rdi     # 0x2549d
movb $0x0, %al
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10f0
movl -0x34(%rbp), %eax
movl -0x2c(%rbp), %ecx
shll %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jg 0x8bb8
movl -0x34(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x8bba
jmp 0x8bba
movl $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xb4(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x59(%rbp)
movsbl -0x59(%rbp), %eax
cmpl $0x28, %eax
jne 0x8bf1
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x8bf3
movsbl -0x59(%rbp), %eax
cmpl $0x0, %eax
jne 0x8bc1
movl $0x0, -0xb4(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xb4(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x59(%rbp)
movsbl -0x59(%rbp), %eax
cmpl $0x29, %eax
jne 0x8c3d
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x8c3f
movsbl -0x59(%rbp), %eax
cmpl $0x0, %eax
jne 0x8c0d
movl $0x0, -0xb4(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x38(%rbp), %eax
je 0x8c72
leaq 0x1c891(%rip), %rdi     # 0x254f2
movb $0x0, %al
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10f0
movl $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xb4(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x59(%rbp)
movsbl -0x59(%rbp), %eax
cmpl $0x2c, %eax
jne 0x8ca9
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x8cab
movsbl -0x59(%rbp), %eax
cmpl $0x0, %eax
jne 0x8c79
movl $0x0, -0xb4(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x8(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xb4(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x59(%rbp)
movsbl -0x59(%rbp), %eax
cmpl $0x3b, %eax
jne 0x8cf5
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x8cf7
movsbl -0x59(%rbp), %eax
cmpl $0x0, %eax
jne 0x8cc5
movl $0x0, -0xb4(%rbp)
cmpl $0x0, -0x44(%rbp)
jne 0x8d28
leaq 0x1c842(%rip), %rdi     # 0x25559
movb $0x0, %al
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10f0
cmpl $0x1, -0x44(%rbp)
jle 0x8d46
leaq 0x1c875(%rip), %rdi     # 0x255aa
movb $0x0, %al
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10f0
jmp 0x8d48
movl $0x0, -0x44(%rbp)
movq -0x8(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xb4(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x59(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movsbl -0x59(%rbp), %eax
cmpl $0x20, %eax
je 0x8d4f
movl $0x0, -0xb4(%rbp)
movsbl -0x59(%rbp), %eax
cmpl $0x28, %eax
je 0x8daa
leaq 0x1c86f(%rip), %rdi     # 0x25608
movb $0x0, %al
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10f0
movl $0x0, -0x44(%rbp)
movq -0x8(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xb4(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x59(%rbp)
movsbl -0x59(%rbp), %eax
cmpl $0x25, %eax
jne 0x8de1
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x8de3
movsbl -0x59(%rbp), %eax
cmpl $0x0, %eax
jne 0x8db1
movl $0x0, -0xb4(%rbp)
cmpl $0x0, -0x44(%rbp)
jle 0x8e14
leaq 0x1c852(%rip), %rdi     # 0x25655
movb $0x0, %al
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10f0
jmp 0x8e16
movq -0x8(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xb4(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x59(%rbp)
movsbl -0x59(%rbp), %eax
cmpl $0x28, %eax
je 0x8e4a
movsbl -0x59(%rbp), %eax
cmpl $0x2c, %eax
jne 0x8f25
movq -0x8(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xb4(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x59(%rbp)
movl $0x0, -0x44(%rbp)
movsbl -0x59(%rbp), %eax
cmpl $0x28, %eax
je 0x8ef6
movsbl -0x59(%rbp), %eax
cmpl $0x2c, %eax
je 0x8ef6
movsbl -0x59(%rbp), %eax
cmpl $0x3b, %eax
je 0x8ef6
movsbl -0x59(%rbp), %eax
cmpl $0x3a, %eax
je 0x8ef6
movl -0xb4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xb4(%rbp)
movq -0x8(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xb4(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x59(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movsbl -0x59(%rbp), %ecx
xorl %eax, %eax
cmpl $0x3a, %ecx
movb %al, -0xe5(%rbp)
je 0x8eea
movsbl -0x59(%rbp), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0xe5(%rbp)
movb -0xe5(%rbp), %al
testb $0x1, %al
jne 0x8ea2
jmp 0x8f05
movl -0xb4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xb4(%rbp)
cmpl $0x32, -0x44(%rbp)
jle 0x8f23
leaq 0x1c78e(%rip), %rdi     # 0x256a0
movb $0x0, %al
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10f0
jmp 0x8f25
jmp 0x8f27
movsbl -0x59(%rbp), %eax
cmpl $0x0, %eax
jne 0x8e16
movl $0x0, -0xb4(%rbp)
movl $0x186a0, %edi          # imm = 0x186A0
callq 0x1110
movq %rax, -0x68(%rbp)
movl $0x186a0, %edi          # imm = 0x186A0
callq 0x1110
movq %rax, -0x78(%rbp)
movl $0x186a0, %edi          # imm = 0x186A0
callq 0x1110
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0x8f7d
cmpq $0x0, -0x70(%rbp)
je 0x8f7d
cmpq $0x0, -0x78(%rbp)
jne 0x8f95
leaq 0x1c76a(%rip), %rdi     # 0x256ee
movb $0x0, %al
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10f0
movl $0x0, -0x44(%rbp)
movq -0x8(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xb4(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x59(%rbp)
movsbl -0x59(%rbp), %eax
cmpl $0x20, %eax
je 0x8fed
movsbl -0x59(%rbp), %eax
cmpl $0xa, %eax
je 0x8fed
movsbl -0x59(%rbp), %eax
cmpl $0x9, %eax
je 0x8fed
movb -0x59(%rbp), %dl
movq -0x68(%rbp), %rax
movl -0x44(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x44(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
jmp 0x8fef
movsbl -0x59(%rbp), %eax
cmpl $0x0, %eax
jne 0x8f9c
movl $0x0, -0xc4(%rbp)
movl $0x0, -0x40(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x54(%rbp)
movl $0x1, -0x84(%rbp)
movl $0x1, -0x88(%rbp)
movl $0x0, -0xc0(%rbp)
movq -0x68(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x28, %eax
jne 0x95f5
movl $0x0, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movq -0x68(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x29, %eax
je 0x907e
movq -0x68(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x28, %eax
jne 0x9073
movl -0x4c(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x904b
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x90(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
movl $0x0, -0xc0(%rbp)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jg 0x942d
movq -0x68(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
jne 0x92c8
movl $0x0, -0x94(%rbp)
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
movq -0x68(%rbp), %rax
movslq -0x90(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x25, %eax
jne 0x9228
movl -0x90(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
movl -0x98(%rbp), %eax
cmpl -0x9c(%rbp), %eax
jge 0x916b
movq -0x68(%rbp), %rax
movslq -0x98(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x7c, %eax
jne 0x9131
jmp 0x916b
movq -0x68(%rbp), %rax
movslq -0x98(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x70(%rbp), %rax
movl -0x94(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x94(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0x910d
movl $0x1, -0xc4(%rbp)
movq -0x70(%rbp), %rax
movl -0x94(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x94(%rbp)
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq -0x70(%rbp), %rdi
callq 0x1150
movl %eax, -0x58(%rbp)
movq -0x68(%rbp), %rax
movslq -0x98(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x7c, %eax
jne 0x9223
movl $0x1, -0xc0(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
movq -0x68(%rbp), %rax
movslq -0x98(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
je 0x9217
movq -0x68(%rbp), %rax
movl -0x98(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x98(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x80(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x30(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
jmp 0x91d1
movq -0x80(%rbp), %rax
movslq -0x30(%rbp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x92c3
movl -0x90(%rbp), %eax
movl %eax, -0x98(%rbp)
movl -0x98(%rbp), %eax
cmpl -0x9c(%rbp), %eax
jge 0x928c
movq -0x68(%rbp), %rax
movslq -0x98(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x20(%rbp), %rax
movl -0x84(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl -0x94(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x94(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0x9234
movl -0x84(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x20(%rbp), %rax
movl -0x84(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0x94(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x9417
movq -0x68(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2c, %eax
je 0x92f4
movq -0x68(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x29, %eax
jne 0x9415
movl $0x0, -0x94(%rbp)
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x90(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0x98(%rbp)
movl -0x98(%rbp), %eax
cmpl -0x9c(%rbp), %eax
jge 0x935e
movq -0x68(%rbp), %rax
movslq -0x98(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x70(%rbp), %rax
movl -0x94(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x94(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0x9316
movq -0x70(%rbp), %rax
movl -0x94(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x94(%rbp)
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq -0x70(%rbp), %rdi
callq 0x1100
movsd %xmm0, -0xa8(%rbp)
movslq -0x54(%rbp), %rdx
movq -0x10(%rbp), %rax
movl -0x88(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x88(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movslq -0x58(%rbp), %rdx
movq -0x10(%rbp), %rax
movl -0x88(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x88(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movsd -0xa8(%rbp), %xmm0
movq -0x18(%rbp), %rax
movq %rax, -0xf0(%rbp)
movl -0x88(%rbp), %eax
subl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0xf0(%rbp), %rax
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
cmpl $0x1, -0xc0(%rbp)
jne 0x9413
movl $0x0, -0xc0(%rbp)
jmp 0x9415
jmp 0x9417
jmp 0x9419
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x90a9
movl $0x0, -0x94(%rbp)
movl $0x0, -0x98(%rbp)
movl -0x98(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x9486
movq -0x68(%rbp), %rax
movslq -0x98(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x78(%rbp), %rax
movl -0x94(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x94(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0x9441
movl -0x54(%rbp), %edi
movq -0x70(%rbp), %rsi
movl $0xa, %edx
callq 0x88d0
movq -0x78(%rbp), %rax
movl -0x94(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x94(%rbp)
movslq %ecx, %rcx
movb $0x25, (%rax,%rcx)
movl $0x0, -0x98(%rbp)
movl -0x98(%rbp), %eax
movl %eax, -0xf4(%rbp)
movq -0x70(%rbp), %rdi
callq 0x1050
movq %rax, %rcx
movl -0xf4(%rbp), %eax
cmpl %ecx, %eax
jge 0x9519
movq -0x70(%rbp), %rax
movslq -0x98(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x78(%rbp), %rax
movl -0x94(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x94(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0x94bd
movl $0x0, -0xc8(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
movl -0x98(%rbp), %eax
cmpl -0x44(%rbp), %eax
jg 0x95be
movq -0x68(%rbp), %rax
movslq -0x98(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
je 0x9577
cmpl $0x0, -0xc8(%rbp)
jne 0x9577
movq -0x78(%rbp), %rax
movl -0x94(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x94(%rbp)
movslq %ecx, %rcx
movb $0x7c, (%rax,%rcx)
movl $0x1, -0xc8(%rbp)
movq -0x68(%rbp), %rax
movslq -0x98(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x78(%rbp), %rax
movl -0x94(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x94(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0x952f
movq -0x68(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x78(%rbp)
movq $0x0, -0xb0(%rbp)
movl -0x94(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x902d
movl $0xffffffff, -0xcc(%rbp) # imm = 0xFFFFFFFF
movl -0x2c(%rbp), %eax
movl %eax, -0x98(%rbp)
cmpl $0x0, -0x98(%rbp)
jle 0x9678
movq -0x20(%rbp), %rax
movslq -0x98(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x20(%rbp), %rax
movl -0x98(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
callq 0x1080
movq -0x20(%rbp), %rax
movslq -0x98(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1c0dc(%rip), %rsi     # 0x2572b
callq 0x1130
cmpl $0x0, %eax
jne 0x9665
movl -0x98(%rbp), %eax
movl %eax, -0xcc(%rbp)
jmp 0x9667
movl -0x98(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0x9608
movl -0xcc(%rbp), %esi
leaq 0x1c0ab(%rip), %rdi     # 0x25730
movb $0x0, %al
callq 0x1030
movl $0x1, -0x98(%rbp)
movl -0x98(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jg 0x96d5
movl -0x98(%rbp), %esi
movq -0x20(%rbp), %rax
movslq -0x98(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x1c088(%rip), %rdi     # 0x25745
movb $0x0, %al
callq 0x1030
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0x9696
movq -0x10(%rbp), %rax
movl -0x88(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x88(%rbp)
movslq %ecx, %rcx
movq $0x0, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movl -0x88(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x88(%rbp)
movslq %ecx, %rcx
movq $0x0, (%rax,%rcx,8)
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl -0x2c(%rbp), %ecx
shll %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jg 0x978d
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x18(%rbp), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd 0x1b8e1(%rip), %xmm0    # 0x25040
ucomisd (%rax,%rcx,8), %xmm0
jbe 0x9780
movq -0x18(%rbp), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd 0x1b8c5(%rip), %xmm0    # 0x25040
movsd %xmm0, (%rax,%rcx,8)
jmp 0x9782
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x971c
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl -0x2c(%rbp), %ecx
shll %ecx
subl $0x3, %ecx
shll %ecx
cmpl %ecx, %eax
jg 0x97cd
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x9794
cmpl $0x0, -0xcc(%rbp)
jle 0x99bc
movl $0xffffffff, -0xd0(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl -0x2c(%rbp), %ecx
shll %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jg 0x987e
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
shll %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0xcc(%rbp), %rcx
cmpq %rcx, %rax
jne 0x9836
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0xd0(%rbp)
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0xcc(%rbp), %rcx
cmpq %rcx, %rax
jne 0x986e
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
shll %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0xd0(%rbp)
jmp 0x9870
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x97eb
movl -0xd0(%rbp), %esi
movl -0xcc(%rbp), %edx
leaq 0x1bebf(%rip), %rdi     # 0x25750
movb $0x0, %al
callq 0x1030
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl -0x2c(%rbp), %ecx
shll %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jg 0x99ba
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
shll %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0xcc(%rbp), %rcx
cmpq %rcx, %rax
je 0x992e
movslq -0xd0(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x34(%rbp), %edx
shll %edx
subl $0x2, %edx
movslq %edx, %rdx
cmpq (%rcx,%rdx,8), %rax
jne 0x992e
movq -0x18(%rbp), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd 0x1b756(%rip), %xmm0    # 0x25058
movsd %xmm0, (%rax,%rcx,8)
movl -0xd0(%rbp), %esi
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
shll %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x1be32(%rip), %rdi     # 0x25759
movb $0x0, %al
callq 0x1030
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0xcc(%rbp), %rcx
cmpq %rcx, %rax
je 0x99aa
movslq -0xd0(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x34(%rbp), %edx
shll %edx
subl $0x1, %edx
movslq %edx, %rdx
cmpq (%rcx,%rdx,8), %rax
jne 0x99aa
movq -0x18(%rbp), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd 0x1b6da(%rip), %xmm0    # 0x25058
movsd %xmm0, (%rax,%rcx,8)
movl -0xd0(%rbp), %esi
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x1bdb6(%rip), %rdi     # 0x25759
movb $0x0, %al
callq 0x1030
jmp 0x99ac
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x989f
jmp 0x99bc
leaq 0x1c834(%rip), %rdi     # 0x261f7
movb $0x0, %al
callq 0x1030
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl -0x2c(%rbp), %ecx
shll %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jg 0x9a31
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
shll %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x18(%rbp), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x1bd44(%rip), %rdi     # 0x25763
movb $0x1, %al
callq 0x1030
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x99d1
leaq 0x1c7bf(%rip), %rdi     # 0x261f7
movb $0x0, %al
callq 0x1030
movl -0x2c(%rbp), %eax
shll %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x1110
movq %rax, -0xd8(%rbp)
movl $0xffffffff, -0xdc(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0xe0(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl -0x2c(%rbp), %ecx
shll %ecx
cmpl %ecx, %eax
jge 0x9aa0
movq -0xd8(%rbp), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x9a72
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl -0x2c(%rbp), %ecx
shll %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jg 0x9b07
movq -0xd8(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x34(%rbp), %edx
shll %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0xd8(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x34(%rbp), %edx
shll %edx
subl $0x2, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x9aa7
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0xd8(%rbp), %rax
movslq -0x34(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jle 0x9b60
movq -0xd8(%rbp), %rax
movslq -0x34(%rbp), %rcx
cmpl $0x2, (%rax,%rcx,4)
jne 0x9b3b
movl -0x34(%rbp), %eax
movl %eax, -0xdc(%rbp)
movq -0xd8(%rbp), %rax
movslq -0x34(%rbp), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x9b55
movl -0x34(%rbp), %eax
movl %eax, -0xe0(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x9b10
movl $0xffffffff, -0xe4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl -0x2c(%rbp), %ecx
shll %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jg 0x9c1c
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
shll %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0xe0(%rbp), %rcx
cmpq %rcx, %rax
jne 0x9bc8
movslq -0xdc(%rbp), %rdx
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
shll %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x34(%rbp), %eax
movl %eax, -0xe4(%rbp)
jmp 0x9c1c
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0xe0(%rbp), %rcx
cmpq %rcx, %rax
jne 0x9c0c
movslq -0xdc(%rbp), %rdx
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x34(%rbp), %eax
movl %eax, -0xe4(%rbp)
jmp 0x9c1c
jmp 0x9c0e
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x9b71
cmpl $-0x1, -0xe4(%rbp)
je 0x9c42
movq -0x18(%rbp), %rax
movl -0xe4(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd 0x1b413(%rip), %xmm0    # 0x25050
movsd %xmm0, (%rax,%rcx,8)
movq -0x68(%rbp), %rdi
callq 0x10e0
movq -0x70(%rbp), %rdi
callq 0x10e0
movq -0x78(%rbp), %rdi
callq 0x10e0
movl -0x2c(%rbp), %ecx
shll %ecx
subl $0x3, %ecx
movq -0x28(%rbp), %rax
subl (%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl -0xe4(%rbp), %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq