// File: /workspace/github_c_makefile_star2_O3/cbouilla[P]AES-attacks-finder/Search.c
// Function: SearchAlgoLowMem_All
Solver * SearchAlgoLowMem_All(SysEqLin E, const int T, int *taille)
{
	const int nb_variables = E->a/E->gen;
	int Alloue=T*nb_variables;
	int Alloue_all_algo = Alloue;
	Solver * __restrict all_algo = malloc(Alloue_all_algo*sizeof(Solver));
	int nb_all_algo = 0;
	Solver * __restrict R = malloc(Alloue*sizeof(Solver));
	SysEqLin * __restrict Eq = malloc(Alloue*sizeof(SysEqLin));
	int * __restrict nb_guess = malloc(Alloue*sizeof(int));
	int * __restrict nb_total = malloc(Alloue*sizeof(int));
	Solver ** __restrict variables = malloc(Alloue*sizeof(Solver *));
	int i;
	for (i = 0; i < Alloue; i++) variables[i]=malloc(nb_variables*sizeof(Solver));
	Solver * tab[3];
	for (i = 0; i < 3; i++) tab[i]=malloc(nb_variables*sizeof(Solver));
	
	for (i = 0; i < nb_variables; i++) variables[0][i]=BaseSolver(E->varligne[i],E);
	R[0]=NULL;
	Eq[0]=EsachantX(NULL,0,E);
	nb_guess[0]=nb_variables;
	nb_total[0]=nb_variables;
	int nb_state = 1;
	
	Solver result = NULL;
	
	unsigned long int nb_round = 0;
	while (nb_state)
	{		
		nb_state--;
		
		SysEqLin F = Eq[nb_state];
		Solver r = R[nb_state];
		int n[3];
		n[0]=nb_guess[nb_state];
		n[1]=nb_total[nb_state]-n[0];
		n[2]=0;
			
			
		for (i = 0; i < n[0]; i++) tab[0][i]=variables[nb_state][i];
		for (i = 0; i < n[1]; i++) tab[1][i]=variables[nb_state][i+n[0]];
		
		int k;
		for (k = 0; k < 2; k++)
		{
			i=0;
			while (i<n[k])
			{
				int j=i-1;
				while (j>=0)
				{
					Solver tmp = UnionSolverBorne(tab[k][i],tab[k][j],F,min(tab[k][i]->sortie,tab[k][j]->sortie));
					if (tmp)
					{
						freeSolver(tab[k][i]);
						freeSolver(tab[k][j]);
						tab[k][i]=tab[k][--n[k]];
						i--;
						tab[k][j]=tab[k][i];
						tab[k][i]=tmp;							
						i--;
						break;
					}
					j--;
				}
				i++;
			}	
		}
		
		int i=0;
		while (i<n[0])
		{
			int j=0;
			while (j<n[1])
			{
				Solver tmp = UnionSolverBorne(tab[0][i],tab[1][j],F,min(tab[0][i]->sortie,tab[1][j]->sortie));
				if (tmp)
				{
					freeSolver(tab[0][i]);
					tab[0][i]=tab[0][--n[0]];
					freeSolver(tab[1][j]);
					tab[1][j]=tab[1][--n[1]];
					tab[2][n[2]++]=tmp;
					i--;
					break;
				}
				j++;
			}
			i++;
		}
		
		i=0;
		while (i<n[2])
		{
			int j;
			debut:
			j=i-1;
			while (j>=0)
			{
				Solver tmp = UnionSolverBorne(tab[2][i],tab[2][j],F,min(tab[2][i]->sortie,tab[2][j]->sortie));
				if (tmp)
				{
					freeSolver(tab[2][i]);
					freeSolver(tab[2][j]);
					tab[2][j]=tab[2][i-1];
					tab[2][i-1]=tmp;
					tab[2][i]=tab[2][--n[2]];
					i--;
					goto debut;
				}
				j--;
			}
			for (k = 0; k < 2; k++)
			{
				j=0;
				while (j < n[k])
				{
					Solver tmp = UnionSolverBorne(tab[2][i],tab[k][j],F,min(tab[2][i]->sortie,tab[k][j]->sortie));
					if (tmp)
					{
						freeSolver(tab[2][i]);
						freeSolver(tab[k][j]);
						tab[k][j]=tab[k][--n[k]];
						tab[2][i]=tmp;
						goto debut;
					}
					j++;
				}
			}
			i++;
		}		
		
		if (n[0]+n[1]+n[2]==1)
		{
			i=0;
			while (!n[i]) i++;
			if (r!=NULL)
			{
				result=NewSolver();
				result->sortie=max(r->sortie+tab[i][0]->sortie,0);
				result->var=UnionListesTriees(r->var,r->Nvar,tab[i][0]->var,tab[i][0]->Nvar,&result->Nvar);
				result->temps=max(r->temps,max(r->sortie,0)+tab[i][0]->temps);
				result->memoire=max(r->memoire,tab[i][0]->memoire);
				result->fils1=tab[i][0];
				result->fils2=r;
				result->type=2;
			}
			else result=tab[i][0];
						
			for (i = 0; i < nb_state; i++)
			{
				freeSolver(R[i]);
				int j;
				for (j = 0; j < nb_total[i]; j++) freeSolver(variables[i][j]);
				freeSysEq(Eq[i]);
			}
			nb_state=0;
		}
		else
		{
			int one_solution=0;
			int one_solution_i=0;
			int one_solution_j=0;
		
			for (i = 0; i < 3; i++)
			{
				int j;
				for (j = 0; j < n[i]; j++)
				{
					if (tab[i][j]->sortie<=0)
					{
						one_solution=1;
						one_solution_i=i;
						one_solution_j=j;
						goto suite;
					}
				}
			}
			
			if ((r==NULL && T>1) || r->sortie<T-1)
			{
				const int m = (r==NULL ? T : T-r->sortie);
				int g = n[0];
				const int new_nb_total = n[0]+n[1]+n[2]-1;
				while (g>=m)
				{
					if (nb_state==Alloue)
					{
						Alloue=2*Alloue;
						R=realloc(R,Alloue*sizeof(Solver));
						nb_guess=realloc(nb_guess,Alloue*sizeof(int));
						nb_total=realloc(nb_total,Alloue*sizeof(int));
						Eq=realloc(Eq,Alloue*sizeof(SysEqLin));
						variables=realloc(variables,Alloue*sizeof(Solver *));
						for (i = Alloue/2; i < Alloue; i++) variables[i]=malloc(nb_variables*sizeof(Solver));
					}
					g--;
					if (r!=NULL)
					{
						R[nb_state]=NewSolver();
						R[nb_state]->sortie=max(r->sortie+tab[0][g]->sortie,0);
						R[nb_state]->var=UnionListesTriees(r->var,r->Nvar,tab[0][g]->var,tab[0][g]->Nvar,&R[nb_state]->Nvar);
						R[nb_state]->temps=max(r->temps,max(r->sortie,0)+tab[0][g]->temps);
						R[nb_state]->memoire=max(r->memoire,tab[0][g]->memoire);
						R[nb_state]->fils1=copySolver(tab[0][g]);
						R[nb_state]->fils2=copySolver(r);
						R[nb_state]->type=2;
					}
					else R[nb_state]=copySolver(tab[0][g]);
					
					int pos=0;
					for (i = 0; i < g; i++) variables[nb_state][pos++]=copySolver(tab[0][i]);
					for (i = g+1; i < n[0]; i++) variables[nb_state][pos++]=copySolver(tab[0][i]);
					for (i = 0; i < n[1]; i++) variables[nb_state][pos++]=copySolver(tab[1][i]);
					for (i = 0; i < n[2]; i++) variables[nb_state][pos++]=copySolver(tab[2][i]);
					
					nb_total[nb_state]=new_nb_total;
					nb_guess[nb_state]=g;
					Eq[nb_state]=EsachantX(tab[0][g]->var,tab[0][g]->Nvar,F);
					nb_state++;
				}
			}
			else
			{
				for (i = 0; i < n[0]; i++)
				{
					{
						if (nb_all_algo==Alloue_all_algo)
						{
							Alloue_all_algo=2*Alloue_all_algo;
							all_algo=realloc(all_algo,Alloue_all_algo*sizeof(Solver));
						}
						if (r!=NULL)
						{
							all_algo[nb_all_algo]=NewSolver();
							all_algo[nb_all_algo]->sortie=max(r->sortie+tab[0][i]->sortie,0);
							all_algo[nb_all_algo]->var=UnionListesTriees(r->var,r->Nvar,tab[0][i]->var,tab[0][i]->Nvar,&all_algo[nb_all_algo]->Nvar);
							all_algo[nb_all_algo]->temps=max(r->temps,max(r->sortie,0)+tab[0][i]->temps);
							all_algo[nb_all_algo]->memoire=max(r->memoire,tab[0][i]->memoire);
							all_algo[nb_all_algo]->fils1=copySolver(tab[0][i]);
							all_algo[nb_all_algo]->fils2=copySolver(r);
							all_algo[nb_all_algo]->type=2;
						}
						else all_algo[nb_all_algo]=copySolver(tab[0][i]);
						nb_all_algo++;
					}
				}
			}
			freeSolver(r);
			for (i = 0; i < 3; i++)
			{
				int j;
				for (j = 0; j < n[i]; j++) freeSolver(tab[i][j]);					
			}
			
			goto fin;
			suite :
			
			if (one_solution_i==0 || (one_solution_i==2 && r!=NULL && r->sortie==T-1))
			{
				if (nb_state==Alloue)
				{
					Alloue=2*Alloue;
					R=realloc(R,Alloue*sizeof(Solver));
					nb_guess=realloc(nb_guess,Alloue*sizeof(int));
					nb_total=realloc(nb_total,Alloue*sizeof(int));
					Eq=realloc(Eq,Alloue*sizeof(SysEqLin));
					variables=realloc(variables,Alloue*sizeof(Solver *));
					for (i = Alloue/2; i < Alloue; i++) variables[i]=malloc(nb_variables*sizeof(Solver));
				}
				if (r!=NULL)
				{
					R[nb_state]=NewSolver();
					R[nb_state]->sortie=max(r->sortie+tab[one_solution_i][one_solution_j]->sortie,0);
					R[nb_state]->var=UnionListesTriees(r->var,r->Nvar,tab[one_solution_i][one_solution_j]->var,tab[one_solution_i][one_solution_j]->Nvar,&R[nb_state]->Nvar);
					R[nb_state]->temps=max(r->temps,max(r->sortie,0)+tab[one_solution_i][one_solution_j]->temps);
					R[nb_state]->memoire=max(r->memoire,tab[one_solution_i][one_solution_j]->memoire);
					R[nb_state]->fils1=tab[one_solution_i][one_solution_j];
					R[nb_state]->fils2=r;
					R[nb_state]->type=2;
				}
				else R[nb_state]=tab[one_solution_i][one_solution_j];
				tab[one_solution_i][one_solution_j]=tab[one_solution_i][--n[one_solution_i]];
				
				nb_total[nb_state]=n[0]+n[1]+n[2];
				if (r==NULL || r->sortie!=T-1) nb_guess[nb_state]=n[0];
				else nb_guess[nb_state]=nb_total[nb_state];
				
				if (nb_guess[nb_state]==0)
				{
					freeSolver(R[nb_state]);
					for (i = 1; i < 3; i++)
					{
						int j;
						for (j = 0; j < n[i]; j++) freeSolver(tab[i][j]);
					}
				}
				else
				{
					int pos=0;
					for (i = 0; i < 3; i++)
					{
						int j;
						for (j = 0; j < n[i]; j++) variables[nb_state][pos++]=tab[i][j];
					}
					Eq[nb_state]=EsachantX(R[nb_state]->var,R[nb_state]->Nvar,F);
					nb_state++;
				}
			}
			else
			{
				for (i = 0; i < 3; i++)
				{
					int j;
					for (j = 0; j < n[i]; j++) freeSolver(tab[i][j]);
				}
				freeSolver(r);
			}	
		}
		fin :
		freeSysEq(F);
		nb_round++;
		if (nb_round%0x100 == 0)
		{
			i=0;
			while (i<nb_state && R[i]->temps==1) i++;
			printf("\r %lu - %d - ",nb_round,i);
			fflush(stdout);
		}	
	}
	printf("\n");
	free(R);
	free(Eq);
	free(nb_guess);
	free(nb_total);
	for (i = 0; i < Alloue; i++) free(variables[i]);
	free(variables);
	for (i = 0; i < 3; i++) free(tab[i]);
	
	if (result==NULL)
	{
		*taille = nb_all_algo;
		return all_algo;
	}
	else
	{
		for (i = 0; i < nb_all_algo; i++) freeSolver(all_algo[i]);
		free(all_algo);
		all_algo=malloc(1*sizeof(Solver));
		all_algo[0]=result;
		*taille=1;
		return all_algo;
	}
	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdx, 0xf0(%rsp)
movq %rdi, %rbp
movl 0x8(%rdi), %eax
cltd
idivl 0x10(%rdi)
movl %eax, %ebx
movq %rsi, 0xd8(%rsp)
imull %esi, %eax
movq %rax, 0x78(%rsp)
movslq %eax, %r14
leaq (,%r14,8), %r12
movq %r12, %rdi
callq 0x21d0
movq %rax, 0x98(%rsp)
movq %r12, %rdi
callq 0x21d0
movq %rax, 0x20(%rsp)
movq %r12, %rdi
callq 0x21d0
movq %rax, 0x50(%rsp)
leaq (,%r14,4), %r15
movq %r15, %rdi
callq 0x21d0
movq %rax, 0x80(%rsp)
movq %r15, %rdi
callq 0x21d0
movq %rax, 0x58(%rsp)
movq %r12, %rdi
callq 0x21d0
movq %rax, %r12
movslq %ebx, %r13
shlq $0x3, %r13
testl %r14d, %r14d
jle 0x14eb3
movl 0x78(%rsp), %r14d
xorl %r15d, %r15d
movq %r13, %rdi
callq 0x21d0
movq %rax, (%r12,%r15,8)
incq %r15
cmpq %r15, %r14
jne 0x14e9f
movq %r12, %r15
xorl %r14d, %r14d
movq %r13, %rdi
callq 0x21d0
movq %rax, 0x60(%rsp,%r14,8)
incq %r14
cmpq $0x3, %r14
jne 0x14eb9
movq %r13, 0xe0(%rsp)
testl %ebx, %ebx
movq 0xd8(%rsp), %r12
movq %r15, %r13
jle 0x14f0c
movl %ebx, %r14d
xorl %r15d, %r15d
movq 0x20(%rbp), %rax
movl (%rax,%r15,4), %edi
movq %rbp, %rsi
callq 0x790b
movq (%r13), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
cmpq %r15, %r14
jne 0x14eec
movq 0x20(%rsp), %rax
movq $0x0, (%rax)
xorl %edi, %edi
xorl %esi, %esi
movq %rbp, %rdx
callq 0xc29a
movq 0x50(%rsp), %rcx
movq %rax, (%rcx)
movq 0x80(%rsp), %rax
movl %ebx, (%rax)
movq 0x58(%rsp), %rdx
movl %ebx, (%rdx)
leal -0x1(%r12), %eax
movl %eax, 0xb4(%rsp)
movl $0x1, %r14d
movq 0x78(%rsp), %rax
movl %eax, 0xc4(%rsp)
movl $0x0, 0x8c(%rsp)
xorl %ebx, %ebx
movq $0x0, 0xc8(%rsp)
movq %r13, %r12
movslq %r14d, %rcx
leaq -0x1(%rcx), %r9
movq 0x50(%rsp), %rax
movq -0x8(%rax,%rcx,8), %rax
movq %rax, 0xa8(%rsp)
movq 0x20(%rsp), %rax
movq -0x8(%rax,%rcx,8), %r8
movq 0x80(%rsp), %rax
movslq -0x4(%rax,%rcx,4), %rax
movl %eax, 0x10(%rsp)
movq %rdx, 0x58(%rsp)
movl -0x4(%rdx,%rcx,4), %ecx
subl %eax, %ecx
movl %ecx, 0x14(%rsp)
movl $0x0, 0x18(%rsp)
testq %rax, %rax
jle 0x14fe2
movq 0x60(%rsp), %rdx
xorl %esi, %esi
movq (%r12,%r9,8), %rdi
movq (%rdi,%rsi,8), %rdi
movq %rdi, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x14fce
movq %r8, 0x90(%rsp)
movq %rbx, 0xb8(%rsp)
testl %ecx, %ecx
jle 0x1501a
movq 0x68(%rsp), %rdx
movl %ecx, %ecx
shlq $0x3, %rax
xorl %esi, %esi
movq (%r12,%r9,8), %rdi
addq %rax, %rdi
movq (%rdi,%rsi,8), %rdi
movq %rdi, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rcx
jne 0x15003
movq %r9, 0x48(%rsp)
movq %r12, 0x30(%rsp)
movq %r14, 0xe8(%rsp)
leal -0x1(%r14), %eax
movl %eax, 0x2c(%rsp)
movb $0x1, %cl
leaq 0x10(%rsp), %rax
leaq 0x60(%rsp), %r12
movl %ecx, 0x40(%rsp)
movq %rax, 0x38(%rsp)
movl (%rax), %ecx
testl %ecx, %ecx
jle 0x150e4
xorl %r14d, %r14d
movl %ecx, 0x8(%rsp)
movslq %r14d, %rbx
movl %ebx, %r15d
testl %r15d, %r15d
jle 0x150d4
movq (%r12), %r13
movq (%r13,%rbx,8), %rdi
movq -0x8(%r13,%r15,8), %rsi
decq %r15
movl 0x14(%rdi), %eax
movl 0x14(%rsi), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movq 0xa8(%rsp), %rdx
callq 0x7ff0
testq %rax, %rax
je 0x15060
movq %rax, %rbp
movq (%r13,%rbx,8), %rdi
callq 0x7447
movq (%r13,%r15,8), %rdi
callq 0x7447
movl 0x8(%rsp), %ecx
movslq %ecx, %rax
decl %ecx
movq -0x8(%r13,%rax,8), %rax
movq %rax, (%r13,%rbx,8)
movq -0x8(%r13,%rbx,8), %rax
movq %rax, (%r13,%r15,8)
movq %rbp, -0x8(%r13,%rbx,8)
addl $-0x2, %ebx
movl %ebx, %r14d
jmp 0x150d8
movl 0x8(%rsp), %ecx
incl %r14d
cmpl %ecx, %r14d
jl 0x15056
movq 0x38(%rsp), %rax
movl %ecx, (%rax)
leaq 0x14(%rsp), %rax
leaq 0x68(%rsp), %r12
testb $0x1, 0x40(%rsp)
movl $0x0, %ecx
jne 0x15040
movl 0x10(%rsp), %r13d
movl 0x14(%rsp), %edx
movl 0x18(%rsp), %eax
movl %eax, 0x1c(%rsp)
testl %r13d, %r13d
jle 0x151f6
movq 0x60(%rsp), %r14
movq 0x68(%rsp), %r15
xorl %ecx, %ecx
movq 0x70(%rsp), %rax
movq %rax, 0xa0(%rsp)
testl %edx, %edx
jle 0x151eb
movq %r13, 0x8(%rsp)
movl %ecx, 0x38(%rsp)
movslq %ecx, %r12
movl %edx, 0x40(%rsp)
movl %edx, %r13d
xorl %ebx, %ebx
movq (%r14,%r12,8), %rdi
movq (%r15,%rbx,8), %rsi
movl 0x14(%rdi), %eax
movl 0x14(%rsi), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movq 0xa8(%rsp), %rdx
callq 0x7ff0
testq %rax, %rax
jne 0x15191
incq %rbx
cmpq %rbx, %r13
jne 0x15155
movq 0x8(%rsp), %r13
movl 0x40(%rsp), %edx
movl 0x38(%rsp), %ecx
jmp 0x151eb
movq %rax, %rbp
movq (%r14,%r12,8), %rdi
callq 0x7447
movq 0x8(%rsp), %r13
movslq %r13d, %rax
decl %r13d
movq -0x8(%r14,%rax,8), %rax
movq %rax, (%r14,%r12,8)
movq (%r15,%rbx,8), %rdi
callq 0x7447
movl 0x40(%rsp), %edx
movslq %edx, %rax
decl %edx
movq -0x8(%r15,%rax,8), %rax
movq %rax, (%r15,%rbx,8)
movl 0x1c(%rsp), %ecx
movslq %ecx, %rax
incl %ecx
movl %ecx, 0x1c(%rsp)
movq 0xa0(%rsp), %rcx
movq %rbp, (%rcx,%rax,8)
decl %r12d
movl %r12d, %ecx
incl %ecx
cmpl %r13d, %ecx
jl 0x15138
movl %r13d, 0x10(%rsp)
movl %edx, 0x14(%rsp)
movl 0x1c(%rsp), %ecx
movl %ecx, 0x18(%rsp)
testl %ecx, %ecx
jle 0x153a8
xorl %r15d, %r15d
movq 0x70(%rsp), %r12
leal 0x1(%r15), %r13d
movl %ecx, 0x1c(%rsp)
movslq %r15d, %rax
movq %rax, 0x8(%rsp)
movq %r15, 0xd0(%rsp)
movl %r13d, 0xa0(%rsp)
movl %r13d, %r14d
testl %r15d, %r15d
jle 0x1527a
leal -0x2(%r14), %ebx
movq 0x8(%rsp), %rax
movq (%r12,%rax,8), %rdi
movq (%r12,%rbx,8), %rsi
movl 0x14(%rdi), %eax
movl 0x14(%rsi), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movq 0xa8(%rsp), %rdx
callq 0x7ff0
testq %rax, %rax
jne 0x15358
decl %r14d
cmpl $0x1, %r14d
jg 0x1523f
movb $0x1, %cl
leaq 0x10(%rsp), %rax
leaq 0x60(%rsp), %r13
movl %ecx, 0x38(%rsp)
movq %rax, 0x40(%rsp)
movslq (%rax), %rbx
testq %rbx, %rbx
jle 0x152d0
xorl %r15d, %r15d
movq 0x8(%rsp), %rax
movq (%r12,%rax,8), %rdi
movq (%r13), %r14
movq (%r14,%r15,8), %rsi
movl 0x14(%rdi), %eax
movl 0x14(%rsi), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movq 0xa8(%rsp), %rdx
callq 0x7ff0
testq %rax, %rax
jne 0x152ef
incq %r15
cmpl %ebx, %r15d
jl 0x1529a
movq 0x40(%rsp), %rax
movl %ebx, (%rax)
leaq 0x14(%rsp), %rax
leaq 0x68(%rsp), %r13
testb $0x1, 0x38(%rsp)
movl $0x0, %ecx
jne 0x15286
jmp 0x15335
movq %rax, %rbp
movq 0x8(%rsp), %r13
movq (%r12,%r13,8), %rdi
callq 0x7447
movq (%r14,%r15,8), %rdi
callq 0x7447
movq -0x8(%r14,%rbx,8), %rax
decq %rbx
movq %rax, (%r14,%r15,8)
movq %rbp, (%r12,%r13,8)
movq 0x40(%rsp), %rax
movl %ebx, (%rax)
movq 0xd0(%rsp), %r15
movl 0xa0(%rsp), %r13d
jmp 0x15237
movq 0x8(%rsp), %rax
leal 0x1(%rax), %r15d
movl 0xa0(%rsp), %r13d
incl %r13d
movl 0x1c(%rsp), %ecx
cmpl %ecx, %r15d
jl 0x1521f
jmp 0x1539b
movq %rax, %rbp
movq 0x8(%rsp), %r14
movq (%r12,%r14,8), %rdi
callq 0x7447
movq (%r12,%rbx,8), %rdi
callq 0x7447
leal -0x1(%r14), %r15d
movq -0x8(%r12,%r14,8), %rax
movq %rax, (%r12,%rbx,8)
movq %rbp, -0x8(%r12,%r14,8)
movl 0x1c(%rsp), %ecx
movslq %ecx, %rax
decl %ecx
movq -0x8(%r12,%rax,8), %rax
movq %rax, (%r12,%r14,8)
jmp 0x15217
movl %ecx, 0x18(%rsp)
movl 0x10(%rsp), %r13d
movl 0x14(%rsp), %edx
addl %r13d, %ecx
addl %edx, %ecx
movl %ecx, 0x1c(%rsp)
cmpl $0x1, %ecx
movq 0x90(%rsp), %r14
jne 0x15468
xorl %ebx, %ebx
cmpl $0x0, 0x10(%rsp,%rbx)
leaq 0x4(%rbx), %rbx
je 0x153c4
testq %r14, %r14
movq 0x30(%rsp), %r12
je 0x1596b
callq 0x7394
movq %r14, %r13
movq %rax, %r14
movq 0x58(%rsp,%rbx,2), %rbx
movq (%rbx), %rax
movl 0x14(%rax), %ecx
addl 0x14(%r13), %ecx
testl %ecx, %ecx
movl $0x0, %r15d
cmovlel %r15d, %ecx
movl %ecx, 0x14(%r14)
movq (%r13), %rdi
movl 0x8(%r13), %esi
movq (%rax), %rdx
movl 0x8(%rax), %ecx
leaq 0x8(%r14), %r8
callq 0x2544
movq %rax, (%r14)
movl 0xc(%r13), %eax
movl 0x14(%r13), %ecx
testl %ecx, %ecx
cmovlel %r15d, %ecx
movq (%rbx), %rdx
addl 0xc(%rdx), %ecx
cmpl %ecx, %eax
cmovgl %eax, %ecx
movl %ecx, 0xc(%r14)
movl 0x10(%r13), %eax
movl 0x10(%rdx), %ecx
cmpl %ecx, %eax
cmovgl %eax, %ecx
movl %ecx, 0x10(%r14)
movq %rdx, 0x20(%r14)
movq %r13, 0x28(%r14)
movq %r14, 0xc8(%rsp)
movb $0x2, 0x18(%r14)
jmp 0x1597b
xorl %r12d, %r12d
movslq 0x10(%rsp,%r12,4), %rax
testq %rax, %rax
jle 0x15492
movq 0x60(%rsp,%r12,8), %rcx
xorl %ebp, %ebp
movq (%rcx,%rbp,8), %rdx
cmpl $0x0, 0x14(%rdx)
jle 0x15837
incq %rbp
cmpq %rbp, %rax
jne 0x1547c
incq %r12
cmpq $0x3, %r12
jne 0x1546b
movq 0xd8(%rsp), %rdx
cmpl $0x2, %edx
jl 0x154af
movl %edx, %eax
testq %r14, %r14
je 0x154c4
movl 0x14(%r14), %ecx
cmpl 0xb4(%rsp), %ecx
jge 0x15bc6
movl %edx, %eax
subl %ecx, %eax
cmpl %eax, %r13d
jl 0x15d2a
decl 0x1c(%rsp)
movslq %r13d, %rcx
movq %rcx, 0x38(%rsp)
cltq
movq %rax, 0xd0(%rsp)
decl %r13d
movq 0x48(%rsp), %rbp
movq 0x78(%rsp), %rax
movq %rbp, 0x48(%rsp)
cmpl %ebp, %eax
movq 0x30(%rsp), %r12
movq %r13, 0x8(%rsp)
jne 0x155bf
leal (%rax,%rax), %r14d
movslq %r14d, %rbx
leaq (,%rbx,8), %r15
movq 0x20(%rsp), %rdi
movq %r15, %rsi
callq 0x2200
movq %rax, 0x20(%rsp)
leaq (,%rbx,4), %rbp
movq 0x80(%rsp), %rdi
movq %rbp, %rsi
callq 0x2200
movq %rax, 0x80(%rsp)
movq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0x2200
movq %rax, 0x58(%rsp)
movq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x2200
movq %rax, 0x50(%rsp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x2200
movq %rax, %r12
movq 0x78(%rsp), %rax
cmpl %ebx, %eax
jge 0x155b4
movslq %eax, %r15
movq 0xe0(%rsp), %r13
movq 0x38(%rsp), %rbp
movq %r13, %rdi
callq 0x21d0
movq %rax, (%r12,%r15,8)
incq %r15
cmpq %r15, %rbx
jne 0x15593
movl %r14d, %eax
movq 0x90(%rsp), %r14
jmp 0x155c4
movl %r14d, %eax
movq 0x90(%rsp), %r14
movq 0x38(%rsp), %rbp
movq %rax, 0x78(%rsp)
leaq -0x1(%rbp), %r15
testq %r14, %r14
movq %r15, 0xa0(%rsp)
je 0x1568f
movq %r14, %r13
callq 0x7394
movq 0x20(%rsp), %r14
movq 0x48(%rsp), %rbp
movq %rax, (%r14,%rbp,8)
movq 0x60(%rsp), %rbx
movq (%rbx,%r15,8), %rcx
movl 0x14(%rcx), %edx
addl 0x14(%r13), %edx
testl %edx, %edx
movl $0x0, %esi
cmovlel %esi, %edx
movl %edx, 0x14(%rax)
movq (%r13), %rdi
movl 0x8(%r13), %esi
movq (%rcx), %rdx
movl 0x8(%rcx), %ecx
leaq 0x8(%rax), %r8
callq 0x2544
movq (%r14,%rbp,8), %rcx
movq %rax, (%rcx)
movl 0x14(%r13), %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
movq (%rbx,%r15,8), %rdi
addl 0xc(%rdi), %eax
movl 0xc(%r13), %ecx
cmpl %eax, %ecx
cmovgl %ecx, %eax
movq (%r14,%rbp,8), %rcx
movl %eax, 0xc(%rcx)
movl 0x10(%r13), %eax
movl 0x10(%rdi), %edx
cmpl %edx, %eax
cmovgl %eax, %edx
movl %edx, 0x10(%rcx)
callq 0x743b
movq (%r14,%rbp,8), %rcx
movq %rax, 0x20(%rcx)
movq %r13, %rdi
callq 0x743b
movq (%r14,%rbp,8), %rcx
movq %rax, 0x28(%rcx)
movq (%r14,%rbp,8), %rax
movq 0x38(%rsp), %rbp
movb $0x2, 0x18(%rax)
jmp 0x156ab
movq 0x60(%rsp), %rax
movq (%rax,%r15,8), %rdi
callq 0x743b
movq 0x20(%rsp), %rcx
movq 0x48(%rsp), %rdx
movq %rax, (%rcx,%rdx,8)
movq 0x8(%rsp), %r13
movl %r13d, %r13d
xorl %r14d, %r14d
cmpq $0x2, %rbp
jl 0x156ea
movq 0x60(%rsp), %rbx
xorl %r14d, %r14d
movq 0x48(%rsp), %r15
movq (%rbx,%r14,8), %rdi
callq 0x743b
movq (%r12,%r15,8), %rcx
movq %rax, (%rcx,%r14,8)
incq %r14
cmpq %r14, %r13
jne 0x156c9
movq 0xa0(%rsp), %r14
movslq 0x10(%rsp), %rbx
cmpq %rbx, %rbp
movq %r12, 0x30(%rsp)
movq %r13, 0x8(%rsp)
jge 0x1572e
movq 0x60(%rsp), %r15
movl %r14d, %r14d
movq %r12, %r13
movq %rbp, %r12
movq 0x48(%rsp), %rbp
movq (%r15,%r12,8), %rdi
callq 0x743b
movq (%r13,%rbp,8), %rcx
movq %rax, (%rcx,%r14,8)
incq %r14
incq %r12
cmpq %rbx, %r12
jl 0x15711
movslq 0x14(%rsp), %r15
testq %r15, %r15
jle 0x1577f
movq 0x68(%rsp), %rcx
movq %rcx, 0x40(%rsp)
movl %r14d, %r14d
leaq (,%r14,8), %r13
xorl %r12d, %r12d
movq 0x30(%rsp), %rbp
movq 0x48(%rsp), %rbx
movq 0x40(%rsp), %rcx
movq (%rcx,%r12,8), %rdi
callq 0x743b
movq (%rbp,%rbx,8), %rcx
addq %r13, %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
cmpq %r12, %r15
jne 0x1575a
addl %r12d, %r14d
movslq 0x18(%rsp), %rbx
testq %rbx, %rbx
movq 0x30(%rsp), %r13
movq 0x48(%rsp), %rbp
jle 0x157bf
movq 0x70(%rsp), %r15
movl %r14d, %r14d
shlq $0x3, %r14
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdi
callq 0x743b
movq (%r13,%rbp,8), %rcx
addq %r14, %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
cmpq %r12, %rbx
jne 0x157a2
movq 0x58(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %ecx, (%rax,%rbp,4)
movq 0x80(%rsp), %rax
movq 0xa0(%rsp), %rbx
movl %ebx, (%rax,%rbp,4)
movq 0x60(%rsp), %rax
movq (%rax,%rbx,8), %rax
movq (%rax), %rdi
movl 0x8(%rax), %esi
movq 0xa8(%rsp), %rdx
callq 0xc29a
movq 0x50(%rsp), %rcx
movq %rax, (%rcx,%rbp,8)
incq %rbp
movq 0x8(%rsp), %r13
decl %r13d
movq 0x38(%rsp), %rax
cmpq 0xd0(%rsp), %rax
movq %rbx, 0x38(%rsp)
movq 0x90(%rsp), %r14
jg 0x154eb
movl %ebp, 0x2c(%rsp)
jmp 0x15d2a
testq %r12, %r12
je 0x15860
cmpq $0x2, %r12
jne 0x1592b
testq %r14, %r14
je 0x1592b
movl 0xb4(%rsp), %eax
cmpl %eax, 0x14(%r14)
jne 0x1592b
movq 0x78(%rsp), %rax
cmpl %eax, 0x2c(%rsp)
jne 0x159e6
addl %eax, %eax
movl %eax, 0x8(%rsp)
movslq %eax, %rbx
leaq (,%rbx,8), %r13
movq 0x20(%rsp), %rdi
movq %r13, %rsi
callq 0x2200
movq %rax, 0x20(%rsp)
leaq (,%rbx,4), %r15
movq 0x80(%rsp), %rdi
movq %r15, %rsi
callq 0x2200
movq %rax, 0x80(%rsp)
movq 0x58(%rsp), %rdi
movq %r15, %rsi
callq 0x2200
movq %rax, 0x58(%rsp)
movq 0x50(%rsp), %rdi
movq %r13, %rsi
callq 0x2200
movq %rax, 0x50(%rsp)
movq 0x30(%rsp), %rdi
movq %r13, %rsi
callq 0x2200
movq %rax, 0x30(%rsp)
movq 0x78(%rsp), %rax
cmpl %ebx, %eax
jge 0x159e2
movslq %eax, %r15
movq 0x30(%rsp), %r13
movq 0xe0(%rsp), %r14
movq %r14, %rdi
callq 0x21d0
movq %rax, (%r13,%r15,8)
incq %r15
cmpq %r15, %rbx
jne 0x15905
movl 0x8(%rsp), %eax
movq 0x90(%rsp), %r14
jmp 0x159e6
xorl %ebx, %ebx
movslq 0x10(%rsp,%rbx,4), %r14
testq %r14, %r14
jle 0x15950
movq 0x60(%rsp,%rbx,8), %r15
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdi
callq 0x7447
incq %r12
cmpq %r12, %r14
jne 0x1593f
incq %rbx
cmpq $0x3, %rbx
jne 0x1592d
movq 0x90(%rsp), %rdi
callq 0x7447
jmp 0x15d60
movq 0x58(%rsp,%rbx,2), %rax
movq (%rax), %rax
movq %rax, 0xc8(%rsp)
cmpl $0x2, 0xe8(%rsp)
jl 0x159da
movl 0x2c(%rsp), %ebx
xorl %r14d, %r14d
movq 0x20(%rsp), %rax
movq (%rax,%r14,8), %rdi
callq 0x7447
movq 0x58(%rsp), %r13
cmpl $0x0, (%r13,%r14,4)
jle 0x159c4
xorl %r15d, %r15d
movq (%r12,%r14,8), %rax
movq (%rax,%r15,8), %rdi
callq 0x7447
incq %r15
movslq (%r13,%r14,4), %rax
cmpq %rax, %r15
jl 0x159aa
movq 0x50(%rsp), %rax
movq (%rax,%r14,8), %rdi
callq 0xc82d
incq %r14
cmpq %rbx, %r14
jne 0x1598c
xorl %r14d, %r14d
jmp 0x15d6c
movl 0x8(%rsp), %eax
movq %rax, 0x78(%rsp)
testq %r14, %r14
movq %r14, %r13
je 0x15a92
callq 0x7394
movq 0x20(%rsp), %rbx
movq 0x48(%rsp), %r14
movq %rax, (%rbx,%r14,8)
movl %r12d, %r12d
movq 0x60(%rsp,%r12,8), %r15
movq (%r15,%rbp,8), %rcx
movl 0x14(%rcx), %edx
addl 0x14(%r13), %edx
testl %edx, %edx
movl $0x0, %esi
cmovlel %esi, %edx
movl %edx, 0x14(%rax)
movq (%r13), %rdi
movl 0x8(%r13), %esi
movq (%rcx), %rdx
movl 0x8(%rcx), %ecx
leaq 0x8(%rax), %r8
callq 0x2544
movq (%rbx,%r14,8), %rcx
movq %rax, (%rcx)
movl 0x14(%r13), %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
movl 0xc(%r13), %ecx
movq (%r15,%rbp,8), %rdx
addl 0xc(%rdx), %eax
cmpl %eax, %ecx
cmovgl %ecx, %eax
movq (%rbx,%r14,8), %rcx
movl %eax, 0xc(%rcx)
movl 0x10(%r13), %eax
movl 0x10(%rdx), %esi
cmpl %esi, %eax
cmovgl %eax, %esi
movl %esi, 0x10(%rcx)
movq %rdx, 0x20(%rcx)
movq (%rbx,%r14,8), %rax
movq %r13, 0x28(%rax)
movq (%rbx,%r14,8), %rax
movb $0x2, 0x18(%rax)
jmp 0x15ab1
movl %r12d, %r12d
movq 0x60(%rsp,%r12,8), %rax
movq (%rax,%rbp,8), %rax
movq 0x20(%rsp), %rcx
movq 0x48(%rsp), %r14
movq %rax, (%rcx,%r14,8)
movq 0x60(%rsp,%r12,8), %r15
movslq 0x10(%rsp,%r12,4), %rax
leaq -0x1(%rax), %rcx
movl %ecx, 0x10(%rsp,%r12,4)
movq -0x8(%r15,%rax,8), %rax
movq %rax, (%r15,%rbp,8)
movl 0x14(%rsp), %eax
addl 0x10(%rsp), %eax
addl 0x18(%rsp), %eax
movq 0x58(%rsp), %rcx
movl %eax, (%rcx,%r14,4)
testq %r13, %r13
movq 0x30(%rsp), %r12
je 0x15af4
movl 0xb4(%rsp), %ecx
cmpl %ecx, 0x14(%r13)
je 0x15af8
movl 0x10(%rsp), %eax
movq 0x80(%rsp), %rcx
movl %eax, (%rcx,%r14,4)
testl %eax, %eax
movq 0xb8(%rsp), %rbx
je 0x15b82
xorl %eax, %eax
xorl %ecx, %ecx
movslq 0x10(%rsp,%rax,4), %rdx
testq %rdx, %rdx
jle 0x15b47
movq 0x60(%rsp,%rax,8), %rsi
movslq %ecx, %rdi
shlq $0x3, %rdi
xorl %r8d, %r8d
movq (%rsi,%r8,8), %r9
movq (%r12,%r14,8), %r10
addq %rdi, %r10
movq %r9, (%r10,%r8,8)
incq %r8
cmpq %r8, %rdx
jne 0x15b2d
addl %r8d, %ecx
incq %rax
cmpq $0x3, %rax
jne 0x15b14
movq 0x20(%rsp), %rax
movq (%rax,%r14,8), %rax
movq (%rax), %rdi
movl 0x8(%rax), %esi
movq 0xa8(%rsp), %rdx
callq 0xc29a
movq 0x50(%rsp), %rcx
movq %rax, (%rcx,%r14,8)
movq 0xe8(%rsp), %r14
jmp 0x15d74
movq 0x20(%rsp), %rax
movq (%rax,%r14,8), %rdi
callq 0x7447
movl $0x1, %ebx
movslq 0x10(%rsp,%rbx,4), %r14
testq %r14, %r14
jle 0x15bb8
movq 0x60(%rsp,%rbx,8), %r15
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdi
callq 0x7447
incq %r12
cmpq %r12, %r14
jne 0x15ba7
incq %rbx
cmpq $0x3, %rbx
jne 0x15b95
jmp 0x15d60
testl %r13d, %r13d
movl 0x8c(%rsp), %eax
jle 0x15d2a
movslq %eax, %r14
movl %r13d, %eax
movq %rax, 0x8(%rsp)
movl %r14d, %eax
movq %rax, 0x40(%rsp)
shlq $0x3, %r14
xorl %r13d, %r13d
movq 0x40(%rsp), %rax
addl %r13d, %eax
movl 0xc4(%rsp), %ecx
cmpl %ecx, %eax
jne 0x15c2a
movl %ecx, %eax
addl %ecx, %eax
movl %eax, 0xc4(%rsp)
movslq %eax, %rsi
shlq $0x3, %rsi
movq 0x98(%rsp), %rdi
callq 0x2200
movq %rax, 0x98(%rsp)
movq 0x90(%rsp), %r12
testq %r12, %r12
je 0x15cef
callq 0x7394
movq 0x98(%rsp), %rcx
leaq (%rcx,%r14), %rbp
movq %rax, (%rbp,%r13,8)
movq 0x60(%rsp), %rbx
movq (%rbx,%r13,8), %rcx
movl 0x14(%rcx), %edx
addl 0x14(%r12), %edx
testl %edx, %edx
movl $0x0, %r15d
cmovlel %r15d, %edx
movl %edx, 0x14(%rax)
movq (%r12), %rdi
movl 0x8(%r12), %esi
movq (%rcx), %rdx
movl 0x8(%rcx), %ecx
leaq 0x8(%rax), %r8
callq 0x2544
movq (%rbp,%r13,8), %rcx
movq %rax, (%rcx)
movl 0x14(%r12), %eax
testl %eax, %eax
cmovlel %r15d, %eax
movq (%rbx,%r13,8), %rdi
addl 0xc(%rdi), %eax
movl 0xc(%r12), %ecx
cmpl %eax, %ecx
cmovgl %ecx, %eax
movq (%rbp,%r13,8), %rcx
movl %eax, 0xc(%rcx)
movl 0x10(%r12), %eax
movl 0x10(%rdi), %edx
cmpl %edx, %eax
cmovgl %eax, %edx
movl %edx, 0x10(%rcx)
callq 0x743b
movq (%rbp,%r13,8), %rcx
movq %rax, 0x20(%rcx)
movq %r12, %rdi
callq 0x743b
movq (%rbp,%r13,8), %rcx
movq %rax, 0x28(%rcx)
movq (%rbp,%r13,8), %rax
movb $0x2, 0x18(%rax)
jmp 0x15d0c
movq 0x60(%rsp), %rax
movq (%rax,%r13,8), %rdi
callq 0x743b
movq 0x98(%rsp), %rcx
addq %r14, %rcx
movq %rax, (%rcx,%r13,8)
incq %r13
cmpq %r13, 0x8(%rsp)
jne 0x15bf0
addl %r13d, 0x8c(%rsp)
movq 0x90(%rsp), %r14
movq %r14, %rdi
callq 0x7447
xorl %ebx, %ebx
movslq 0x10(%rsp,%rbx,4), %r14
testq %r14, %r14
jle 0x15d57
movq 0x60(%rsp,%rbx,8), %r15
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdi
callq 0x7447
incq %r12
cmpq %r12, %r14
jne 0x15d46
incq %rbx
cmpq $0x3, %rbx
jne 0x15d34
movl 0x2c(%rsp), %eax
movl %eax, %r14d
movq 0x30(%rsp), %r12
movq 0xb8(%rsp), %rbx
movq 0xa8(%rsp), %rdi
callq 0xc82d
incq %rbx
testb %bl, %bl
jne 0x15dcf
testl %r14d, %r14d
jle 0x15dad
movl %r14d, %eax
xorl %edx, %edx
movq 0x20(%rsp), %rcx
movq (%rcx,%rdx,8), %rcx
cmpl $0x1, 0xc(%rcx)
jne 0x15daf
incq %rdx
cmpq %rdx, %rax
jne 0x15d92
movl %eax, %edx
jmp 0x15daf
xorl %edx, %edx
leaq 0x16dda(%rip), %rdi     # 0x2cb90
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2110
movq 0x1c1f9(%rip), %rax     # 0x31fc0
movq (%rax), %rdi
callq 0x21e0
testl %r14d, %r14d
movq 0x58(%rsp), %rdx
jne 0x14f77
movl $0xa, %edi
movq %rdx, %rbx
callq 0x2040
movq 0x20(%rsp), %rdi
callq 0x2030
movq 0x50(%rsp), %rdi
callq 0x2030
movq 0x80(%rsp), %rdi
callq 0x2030
movq %rbx, %rdi
callq 0x2030
movq 0x78(%rsp), %rax
testl %eax, %eax
jle 0x15e32
movl %eax, %ebx
xorl %r14d, %r14d
movq (%r12,%r14,8), %rdi
callq 0x2030
incq %r14
cmpq %r14, %rbx
jne 0x15e21
movq %r12, %rdi
callq 0x2030
xorl %ebx, %ebx
movq 0x60(%rsp,%rbx,8), %rdi
callq 0x2030
incq %rbx
cmpq $0x3, %rbx
jne 0x15e3c
movq 0xc8(%rsp), %r15
testq %r15, %r15
je 0x15ea9
movl 0x8c(%rsp), %eax
testl %eax, %eax
movq 0x98(%rsp), %rdi
jle 0x15e8d
movl %eax, %ebx
xorl %r14d, %r14d
movq (%rdi,%r14,8), %rdi
callq 0x7447
movq 0x98(%rsp), %rdi
incq %r14
cmpq %r14, %rbx
jne 0x15e74
callq 0x2030
movl $0x8, %edi
callq 0x21d0
movq %rax, %rcx
movq %r15, (%rax)
movl $0x1, %edx
jmp 0x15eb8
movq 0x98(%rsp), %rcx
movl 0x8c(%rsp), %edx
movq 0xf0(%rsp), %rax
movl %edx, (%rax)
movq %rcx, %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq