// File: dcarrey[P]hgt-detection/./fonctions.cpp
// Function: SAVEASNewick(double*, long*, char**, int, char const*)
void SAVEASNewick(double *LONGUEUR, long int *ARETE, char ** noms, int nn,const char* t) 
{
	int n,root,a;
	int Ns;
	int i, j, sd, sf, *Suc, *Fre, *Tree, *degre, *Mark;
	double *Long;
	int *boot; 
	char *string = (char*)malloc(10000);	
	n = nn;
	Ns=2*n-3;
	
	double * bootStrap= NULL;
	
	Suc =(int*) malloc((2*n) * sizeof(int));
	Fre =(int*) malloc((2*n) * sizeof(int));
	degre =(int*) malloc((2*n) * sizeof(int));
	Long = (double*) malloc((2*n) * sizeof(double));	
	boot = (int*) malloc((2*n) * sizeof(int));
	Tree = (int*) malloc((2*n) * sizeof(int));
	Mark =(int*) malloc((2*n) * sizeof(int));
	
	if ((degre==NULL)||(Mark==NULL)||(string==NULL)||(Suc==NULL)||(Fre==NULL)||(Long==NULL)||(Tree==NULL)||(ARETE==NULL)||(LONGUEUR==NULL))	
		{ printf("Tree is too large to be saved"); return;} 
	
	for (i=1;i<=2*n-3;i++)
	{ 
		
		if (i<=n) degre[i]=1;
		else degre[i]=3;
	} degre[2*n-2]=3;
	
	root=Ns+1;
	
	int cpt=0;
	
	for (;;)
	{
		cpt++;
		if(cpt > 1000000) exit(1);
		a=0; a++;
		for (j=1;j<=2*n-2;j++)
			Mark[j]=0;
		
		for (i=1;i<=2*n-3;i++)
		{ 	  									
			if ((degre[ARETE[2*i-2]]==1)&&(degre[ARETE[2*i-1]]>1)&&(Mark[ARETE[2*i-1]]==0)&&(Mark[ARETE[2*i-2]]==0))
			{
				Tree[ARETE[2*i-2]]=ARETE[2*i-1]; degre[ARETE[2*i-1]]--; degre[ARETE[2*i-2]]--; Mark[ARETE[2*i-1]]=1; Mark[ARETE[2*i-2]]=1;
				Long[ARETE[2*i-2]]=LONGUEUR[i-1];
				if(bootStrap != NULL) boot[ARETE[2*i-2]] = (int) bootStrap[i-1];
				
			}
			else if ((degre[ARETE[2*i-1]]==1)&&(degre[ARETE[2*i-2]]>1)&&(Mark[ARETE[2*i-1]]==0)&&(Mark[ARETE[2*i-2]]==0))
			{
				Tree[ARETE[2*i-1]]=ARETE[2*i-2]; degre[ARETE[2*i-1]]--; degre[ARETE[2*i-2]]--; Mark[ARETE[2*i-1]]=1; Mark[ARETE[2*i-2]]=1;
				Long[ARETE[2*i-1]]=LONGUEUR[i-1];
				if(bootStrap != NULL) boot[ARETE[2*i-1]] = (int) bootStrap[i-1];
				
			}
			else if ((degre[ARETE[2*i-2]]==1)&&(degre[ARETE[2*i-1]]==1)&&(Mark[ARETE[2*i-2]]==0)&&(Mark[ARETE[2*i-1]]==0))
			{
				Tree[ARETE[2*i-2]]=ARETE[2*i-1]; root=ARETE[2*i-1]; degre[ARETE[2*i-1]]--; degre[ARETE[2*i-2]]--; a=-1;
				Long[ARETE[2*i-2]]=LONGUEUR[i-1];
				if(bootStrap != NULL) boot[ARETE[2*i-2]] = (int) bootStrap[i-1];
			}
			if (a==-1) break;
		}
		if (a==-1) break;
	}
	
	
	/*  On decale et on complete la structure d'arbre avec Successeurs et Freres  */
	for (i=Ns+1;i>0;i--)
	{ 	Fre[i]=0; Suc[i]=0;
		//Tree[i]=Tree[i-1]+1; Long[i]=Long[i-1];
	}	Tree[root]=0;/*Tree[Ns+1]=0;*/
	
	for (i=1;i<=Ns+1/*Ns*/;i++)
	{	
		if (i!=root) 
		{
			sd=i; sf=Tree[i];
			if (Suc[sf]==0) Suc[sf]=sd;
			else {	
				sf=Suc[sf];
				while (Fre[sf]>0) sf=Fre[sf];
				Fre[sf]=sd;
			}		 
		}
	}
	
	
	/* On compose la chaine parenthesee */
	string[0]=0; i=root;/*i=Ns+1;*/
	cpt=0;
	for (;;)
	{	
		if(cpt > 1000000) exit(1);
		
		if (Suc[i]>0)
		{	sprintf(string,"%s(",string);
		Suc[i]=-Suc[i]; i=-Suc[i]; }
		else if (Fre[i]!=0)
		{	if (Suc[i]==0) sprintf(string,"%s%s:%.4f,",string,noms[i],Long[i]);
			else {
				if(bootStrap != NULL)
					sprintf(string,"%s%d:%.4f,",string,boot[i],Long[i]);
				else
					sprintf(string,"%s:%.4f,",string,Long[i]);
			}
		i=Fre[i]; }
		else if (Tree[i]!=0)
		{	if (Suc[i]==0) sprintf(string,"%s%s:%.4f)",string,noms[i],Long[i]);
		else {
			if(bootStrap != NULL)
				sprintf(string,"%s%d:%.4f)",string,boot[i],Long[i]);
			else
				sprintf(string,"%s:%.4f)",string,Long[i]);
			}
		i=Tree[i]; }
		else break;
	}	
	strcat(string,";");
	
	FILE *pt_t = fopen(t,"w+");
	fprintf(pt_t,"%s",string);
	fclose(pt_t);
	
	free(Suc); free(Fre); free(Tree); free(Long); free(degre); free(Mark);	free(string);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movl $0x2710, %edi           # imm = 0x2710
callq 0x1110
movq %rax, -0x88(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
shll %eax
subl $0x3, %eax
movl %eax, -0x38(%rbp)
movq $0x0, -0x90(%rbp)
movl -0x2c(%rbp), %eax
shll %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x1110
movq %rax, -0x50(%rbp)
movl -0x2c(%rbp), %eax
shll %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x1110
movq %rax, -0x58(%rbp)
movl -0x2c(%rbp), %eax
shll %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x1110
movq %rax, -0x68(%rbp)
movl -0x2c(%rbp), %eax
shll %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x1110
movq %rax, -0x78(%rbp)
movl -0x2c(%rbp), %eax
shll %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x1110
movq %rax, -0x80(%rbp)
movl -0x2c(%rbp), %eax
shll %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x1110
movq %rax, -0x60(%rbp)
movl -0x2c(%rbp), %eax
shll %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x1110
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0xc460
cmpq $0x0, -0x70(%rbp)
je 0xc460
cmpq $0x0, -0x88(%rbp)
je 0xc460
cmpq $0x0, -0x50(%rbp)
je 0xc460
cmpq $0x0, -0x58(%rbp)
je 0xc460
cmpq $0x0, -0x78(%rbp)
je 0xc460
cmpq $0x0, -0x60(%rbp)
je 0xc460
cmpq $0x0, -0x10(%rbp)
je 0xc460
cmpq $0x0, -0x8(%rbp)
jne 0xc473
leaq 0x193fa(%rip), %rdi     # 0x25861
movb $0x0, %al
callq 0x1030
jmp 0xcdf0
movl $0x1, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl -0x2c(%rbp), %ecx
shll %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jg 0xc4be
movl -0x3c(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jg 0xc4a2
movq -0x68(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
jmp 0xc4b1
movq -0x68(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movl $0x3, (%rax,%rcx,4)
jmp 0xc4b3
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xc47a
movq -0x68(%rbp), %rax
movl -0x2c(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movl $0x3, (%rax,%rcx,4)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl $0x0, -0x94(%rbp)
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
cmpl $0xf4240, -0x94(%rbp)   # imm = 0xF4240
jle 0xc50c
movl $0x1, %edi
callq 0x10f0
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl $0x1, -0x40(%rbp)
movl -0x40(%rbp), %eax
movl -0x2c(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jg 0xc54c
movq -0x70(%rbp), %rax
movslq -0x40(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xc523
movl $0x1, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl -0x2c(%rbp), %ecx
shll %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jg 0xca31
movq -0x68(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %edx
shll %edx
subl $0x2, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0xc701
movq -0x68(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %edx
shll %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
cmpl $0x1, (%rax,%rcx,4)
jle 0xc701
movq -0x70(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %edx
shll %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0xc701
movq -0x70(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %edx
shll %edx
subl $0x2, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0xc701
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
shll %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %edx
movq -0x60(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %esi
shll %esi
subl $0x2, %esi
movslq %esi, %rsi
movq (%rcx,%rsi,8), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x68(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%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 -0x68(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%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)
movq -0x70(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %edx
shll %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movl $0x1, (%rax,%rcx,4)
movq -0x70(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %edx
shll %edx
subl $0x2, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movl $0x1, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movl -0x3c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x78(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %edx
shll %edx
subl $0x2, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movsd %xmm0, (%rax,%rcx,8)
cmpq $0x0, -0x90(%rbp)
je 0xc6fc
movq -0x90(%rbp), %rax
movl -0x3c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
cvttsd2si (%rax,%rcx,8), %edx
movq -0x80(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %esi
shll %esi
subl $0x2, %esi
movslq %esi, %rsi
movq (%rcx,%rsi,8), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0xca19
movq -0x68(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %edx
shll %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0xc89c
movq -0x68(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %edx
shll %edx
subl $0x2, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
cmpl $0x1, (%rax,%rcx,4)
jle 0xc89c
movq -0x70(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %edx
shll %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0xc89c
movq -0x70(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %edx
shll %edx
subl $0x2, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0xc89c
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %edx
movq -0x60(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %esi
shll %esi
subl $0x1, %esi
movslq %esi, %rsi
movq (%rcx,%rsi,8), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x68(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%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 -0x68(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%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)
movq -0x70(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %edx
shll %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movl $0x1, (%rax,%rcx,4)
movq -0x70(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %edx
shll %edx
subl $0x2, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movl $0x1, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movl -0x3c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x78(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %edx
shll %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movsd %xmm0, (%rax,%rcx,8)
cmpq $0x0, -0x90(%rbp)
je 0xc897
movq -0x90(%rbp), %rax
movl -0x3c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
cvttsd2si (%rax,%rcx,8), %edx
movq -0x80(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %esi
shll %esi
subl $0x1, %esi
movslq %esi, %rsi
movq (%rcx,%rsi,8), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0xca17
movq -0x68(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %edx
shll %edx
subl $0x2, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0xca15
movq -0x68(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %edx
shll %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0xca15
movq -0x70(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %edx
shll %edx
subl $0x2, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0xca15
movq -0x70(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %edx
shll %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0xca15
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
shll %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %edx
movq -0x60(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %esi
shll %esi
subl $0x2, %esi
movslq %esi, %rsi
movq (%rcx,%rsi,8), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
shll %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x30(%rbp)
movq -0x68(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%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 -0x68(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%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 $0xffffffff, -0x34(%rbp) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movl -0x3c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x78(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %edx
shll %edx
subl $0x2, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movsd %xmm0, (%rax,%rcx,8)
cmpq $0x0, -0x90(%rbp)
je 0xca13
movq -0x90(%rbp), %rax
movl -0x3c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
cvttsd2si (%rax,%rcx,8), %edx
movq -0x80(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %esi
shll %esi
subl $0x2, %esi
movslq %esi, %rsi
movq (%rcx,%rsi,8), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0xca15
jmp 0xca17
jmp 0xca19
cmpl $-0x1, -0x34(%rbp)
jne 0xca21
jmp 0xca31
jmp 0xca23
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xc553
cmpl $-0x1, -0x34(%rbp)
jne 0xca39
jmp 0xca3e
jmp 0xc4e7
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jle 0xca76
movq -0x58(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movq -0x50(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xca47
movq -0x60(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl $0x1, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl -0x38(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jg 0xcb23
movl -0x3c(%rbp), %eax
cmpl -0x30(%rbp), %eax
je 0xcb13
movl -0x3c(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x60(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x48(%rbp)
movq -0x50(%rbp), %rax
movslq -0x48(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0xcad7
movl -0x44(%rbp), %edx
movq -0x50(%rbp), %rax
movslq -0x48(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0xcb11
movq -0x50(%rbp), %rax
movslq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x48(%rbp)
movq -0x58(%rbp), %rax
movslq -0x48(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jle 0xcb03
movq -0x58(%rbp), %rax
movslq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x48(%rbp)
jmp 0xcae5
movl -0x44(%rbp), %edx
movq -0x58(%rbp), %rax
movslq -0x48(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0xcb13
jmp 0xcb15
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xca8c
movq -0x88(%rbp), %rax
movb $0x0, (%rax)
movl -0x30(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl $0x0, -0x94(%rbp)
cmpl $0xf4240, -0x94(%rbp)   # imm = 0xF4240
jle 0xcb53
movl $0x1, %edi
callq 0x10f0
movq -0x50(%rbp), %rax
movslq -0x3c(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jle 0xcbaa
movq -0x88(%rbp), %rdi
movq -0x88(%rbp), %rdx
leaq 0x18d09(%rip), %rsi     # 0x2587f
movb $0x0, %al
callq 0x1040
movq -0x50(%rbp), %rax
movslq -0x3c(%rbp), %rcx
xorl %edx, %edx
subl (%rax,%rcx,4), %edx
movq -0x50(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x50(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
xorl %eax, %eax
subl (%rcx,%rdx,4), %eax
movl %eax, -0x3c(%rbp)
jmp 0xcd57
movq -0x58(%rbp), %rax
movslq -0x3c(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0xcc7f
movq -0x50(%rbp), %rax
movslq -0x3c(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0xcc01
movq -0x88(%rbp), %rdi
movq -0x88(%rbp), %rdx
movq -0x18(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x78(%rbp), %rax
movslq -0x3c(%rbp), %rsi
movsd (%rax,%rsi,8), %xmm0
leaq 0x18c8b(%rip), %rsi     # 0x25883
movb $0x1, %al
callq 0x1040
jmp 0xcc6c
cmpq $0x0, -0x90(%rbp)
je 0xcc41
movq -0x88(%rbp), %rdi
movq -0x88(%rbp), %rdx
movq -0x80(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movq -0x78(%rbp), %rax
movslq -0x3c(%rbp), %rsi
movsd (%rax,%rsi,8), %xmm0
leaq 0x18c56(%rip), %rsi     # 0x2588e
movb $0x1, %al
callq 0x1040
jmp 0xcc6a
movq -0x88(%rbp), %rdi
movq -0x88(%rbp), %rdx
movq -0x78(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x18c22(%rip), %rsi     # 0x25885
movb $0x1, %al
callq 0x1040
jmp 0xcc6c
movq -0x58(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
jmp 0xcd55
movq -0x60(%rbp), %rax
movslq -0x3c(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0xcd51
movq -0x50(%rbp), %rax
movslq -0x3c(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0xccd6
movq -0x88(%rbp), %rdi
movq -0x88(%rbp), %rdx
movq -0x18(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x78(%rbp), %rax
movslq -0x3c(%rbp), %rsi
movsd (%rax,%rsi,8), %xmm0
leaq 0x18bcc(%rip), %rsi     # 0x25899
movb $0x1, %al
callq 0x1040
jmp 0xcd41
cmpq $0x0, -0x90(%rbp)
je 0xcd16
movq -0x88(%rbp), %rdi
movq -0x88(%rbp), %rdx
movq -0x80(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movq -0x78(%rbp), %rax
movslq -0x3c(%rbp), %rsi
movsd (%rax,%rsi,8), %xmm0
leaq 0x18b97(%rip), %rsi     # 0x258a4
movb $0x1, %al
callq 0x1040
jmp 0xcd3f
movq -0x88(%rbp), %rdi
movq -0x88(%rbp), %rdx
movq -0x78(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x18b63(%rip), %rsi     # 0x2589b
movb $0x1, %al
callq 0x1040
jmp 0xcd41
movq -0x60(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
jmp 0xcd53
jmp 0xcd5c
jmp 0xcd55
jmp 0xcd57
jmp 0xcb3d
movq -0x88(%rbp), %rdi
leaq 0x18b45(%rip), %rsi     # 0x258af
callq 0x1170
movq -0x28(%rbp), %rdi
leaq 0x18a4f(%rip), %rsi     # 0x257c9
callq 0x10c0
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rdi
movq -0x88(%rbp), %rdx
leaq 0x1972e(%rip), %rsi     # 0x264c9
movb $0x0, %al
callq 0x1140
movq -0xa0(%rbp), %rdi
callq 0x1090
movq -0x50(%rbp), %rdi
callq 0x10e0
movq -0x58(%rbp), %rdi
callq 0x10e0
movq -0x60(%rbp), %rdi
callq 0x10e0
movq -0x78(%rbp), %rdi
callq 0x10e0
movq -0x68(%rbp), %rdi
callq 0x10e0
movq -0x70(%rbp), %rdi
callq 0x10e0
movq -0x88(%rbp), %rdi
callq 0x10e0
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)