// File: /workspace/github_c_makefile_star2_O1/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, %rbx
movl 0x8(%rdi), %eax
cltd
idivl 0x10(%rdi)
movl %eax, %ebp
movq %rsi, 0xe0(%rsp)
imull %esi, %eax
movq %rax, 0x70(%rsp)
movslq %eax, %r12
leaq (,%r12,8), %r14
movq %r14, %rdi
callq 0x21d0
movq %rax, 0xa8(%rsp)
movq %r14, %rdi
callq 0x21d0
movq %rax, 0x38(%rsp)
movq %r14, %rdi
callq 0x21d0
movq %rax, 0x58(%rsp)
leaq (,%r12,4), %r15
movq %r15, %rdi
callq 0x21d0
movq %rax, 0x68(%rsp)
movq %r15, %rdi
callq 0x21d0
movq %rax, 0x60(%rsp)
movq %r14, %rdi
callq 0x21d0
movq %rax, %r13
movl %ebp, 0x78(%rsp)
movslq %ebp, %rbp
testl %r12d, %r12d
jle 0x14b4a
leaq (,%rbp,8), %r14
movl 0x70(%rsp), %r15d
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x21d0
movq %rax, (%r13,%r12,8)
incq %r12
cmpq %r12, %r15
jne 0x14b35
movl %ebp, %r14d
shlq $0x3, %rbp
xorl %r15d, %r15d
movq %rbp, %rdi
callq 0x21d0
movq %rax, 0x80(%rsp,%r15,8)
incq %r15
cmpq $0x3, %r15
jne 0x14b54
movq %rbp, 0xe8(%rsp)
movl 0x78(%rsp), %eax
testl %eax, %eax
jle 0x14ba3
movl %eax, %r15d
xorl %r12d, %r12d
movq 0x20(%rbx), %rax
movl (%rax,%r12,4), %edi
movq %rbx, %rsi
callq 0x754c
movq (%r13), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
cmpq %r12, %r15
jne 0x14b83
movq 0x38(%rsp), %r12
movq $0x0, (%r12)
xorl %edi, %edi
xorl %esi, %esi
movq %rbx, %rdx
callq 0xbed5
movq 0x58(%rsp), %rcx
movq %rax, (%rcx)
movq 0x68(%rsp), %rax
movl %r14d, (%rax)
movq 0x60(%rsp), %rbx
movl %r14d, (%rbx)
movq 0xe0(%rsp), %rax
decl %eax
movl %eax, 0xc0(%rsp)
movq 0x70(%rsp), %rax
movl %eax, 0xc4(%rsp)
movl $0x1, %eax
movl $0x0, 0xbc(%rsp)
movq $0x0, 0xd0(%rsp)
movq $0x0, 0xc8(%rsp)
movq %rax, 0x40(%rsp)
movslq %eax, %rcx
leaq -0x1(%rcx), %r8
movq 0x58(%rsp), %rax
movq -0x8(%rax,%rcx,8), %rax
movq %rax, 0x78(%rsp)
movq -0x8(%r12,%rcx,8), %rax
movq %rax, 0x20(%rsp)
movq 0x68(%rsp), %rax
movslq -0x4(%rax,%rcx,4), %rax
movl %eax, 0xc(%rsp)
movq %rbx, 0x60(%rsp)
movl -0x4(%rbx,%rcx,4), %ecx
subl %eax, %ecx
movl %ecx, 0x10(%rsp)
movl $0x0, 0x14(%rsp)
testq %rax, %rax
jle 0x14c87
movq 0x80(%rsp), %rdx
xorl %esi, %esi
movq (%r13,%r8,8), %rdi
movq (%rdi,%rsi,8), %rdi
movq %rdi, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x14c72
movq %r12, 0x38(%rsp)
testl %ecx, %ecx
jle 0x14cb8
movq 0x88(%rsp), %rdx
movl %ecx, %ecx
shlq $0x3, %rax
xorl %esi, %esi
movq (%r13,%r8,8), %rdi
addq %rax, %rdi
movq (%rdi,%rsi,8), %rdi
movq %rdi, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rcx
jne 0x14ca0
movq %r8, 0x48(%rsp)
movq %r13, 0x30(%rsp)
movq 0x40(%rsp), %rax
decl %eax
movl %eax, 0x2c(%rsp)
xorl %ecx, %ecx
movl 0xc(%rsp,%rcx,4), %eax
movl %eax, 0x18(%rsp)
testl %eax, %eax
jle 0x14d84
xorl %r13d, %r13d
movq %rcx, 0x50(%rsp)
leal -0x1(%r13), %r12d
testl %r12d, %r12d
js 0x14d76
movq 0x80(%rsp,%rcx,8), %r15
movslq %r13d, %rbx
movq (%r15,%rbx,8), %rdi
movl %r12d, %ebp
movq (%r15,%rbp,8), %rsi
movl 0x14(%rdi), %eax
movl 0x14(%rsi), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movq 0x78(%rsp), %rdx
callq 0x7cbb
movq %rax, %r14
testq %rax, %rax
je 0x14d65
movq (%r15,%rbx,8), %rdi
callq 0x7060
movq (%r15,%rbp,8), %rdi
callq 0x7060
movl 0x18(%rsp), %ecx
movslq %ecx, %rax
decl %ecx
movl %ecx, 0x18(%rsp)
movq -0x8(%r15,%rax,8), %rax
movq %rax, (%r15,%rbx,8)
movq -0x8(%r15,%rbx,8), %rax
movq %rax, (%r15,%rbp,8)
movq %r14, -0x8(%r15,%rbx,8)
addl $-0x2, %ebx
movl %ebx, %r13d
jmp 0x14d68
decl %r12d
testq %r14, %r14
movq 0x50(%rsp), %rcx
je 0x14ceb
incl %r13d
cmpl 0x18(%rsp), %r13d
jl 0x14ce7
movl 0x18(%rsp), %eax
movl %eax, 0xc(%rsp,%rcx,4)
leaq 0x1(%rcx), %rax
testq %rcx, %rcx
movq %rax, %rcx
je 0x14ccf
movl 0xc(%rsp), %ecx
movl 0x10(%rsp), %edx
movl 0x14(%rsp), %eax
movl %eax, 0xa0(%rsp)
movl %ecx, 0x18(%rsp)
testl %ecx, %ecx
jle 0x14eaf
movq 0x80(%rsp), %r14
movq 0x88(%rsp), %r13
xorl %r12d, %r12d
movq 0x90(%rsp), %rcx
movq %rcx, 0xd8(%rsp)
xorl %ebp, %ebp
movq %r14, 0xb0(%rsp)
cmpl %edx, %ebp
jge 0x14e9c
movl %edx, 0x50(%rsp)
movslq %r12d, %rbx
movq (%r14,%rbx,8), %rdi
movslq %ebp, %r15
movq (%r13,%r15,8), %rsi
movl 0x14(%rdi), %eax
movl 0x14(%rsi), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movq 0x78(%rsp), %rdx
callq 0x7cbb
testq %rax, %rax
je 0x14e85
movq (%r14,%rbx,8), %rdi
movq %rax, %r12
callq 0x7060
movl 0x18(%rsp), %ecx
movslq %ecx, %rax
decl %ecx
movl %ecx, 0x18(%rsp)
movq -0x8(%r14,%rax,8), %rax
movq %rax, (%r14,%rbx,8)
movq (%r13,%r15,8), %rdi
callq 0x7060
movl 0x50(%rsp), %edx
movslq %edx, %rax
decl %edx
movq -0x8(%r13,%rax,8), %rax
movq %rax, (%r13,%r15,8)
movl 0xa0(%rsp), %ecx
movslq %ecx, %rax
incl %ecx
movl %ecx, 0xa0(%rsp)
movq 0xd8(%rsp), %rcx
movq %r12, (%rcx,%rax,8)
movq %r12, %rax
decl %ebx
movl %ebx, %r12d
jmp 0x14e8b
incl %ebp
movl 0x50(%rsp), %edx
testq %rax, %rax
movq 0xb0(%rsp), %r14
je 0x14de8
incl %r12d
movl $0x0, %ebp
cmpl 0x18(%rsp), %r12d
jl 0x14de8
movl 0x18(%rsp), %eax
movl %eax, 0xc(%rsp)
movl %edx, 0x10(%rsp)
movl 0xa0(%rsp), %r8d
movl %r8d, 0x14(%rsp)
testl %r8d, %r8d
jle 0x15049
xorl %ebp, %ebp
movq 0x90(%rsp), %r13
leal -0x1(%rbp), %r12d
movl 0x14(%rsp), %ecx
movl %ecx, 0x18(%rsp)
testl %r12d, %r12d
js 0x14f70
movslq %ebp, %rbx
movq (%r13,%rbx,8), %rdi
movl %r12d, %r15d
movq (%r13,%r15,8), %rsi
movl 0x14(%rdi), %eax
movl 0x14(%rsi), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movq 0x78(%rsp), %rdx
callq 0x7cbb
movq %rax, %r14
testq %rax, %rax
je 0x14f5b
movq (%r13,%rbx,8), %rdi
callq 0x7060
movq (%r13,%r15,8), %rdi
callq 0x7060
decl %ebp
movq -0x8(%r13,%rbx,8), %rax
movq %rax, (%r13,%r15,8)
movq %r14, -0x8(%r13,%rbx,8)
movl 0x18(%rsp), %ecx
movslq %ecx, %rax
decl %ecx
movl %ecx, 0x18(%rsp)
movq -0x8(%r13,%rax,8), %rax
movq %rax, (%r13,%rbx,8)
jmp 0x14f5e
decl %r12d
testq %r14, %r14
je 0x14ee7
movl 0x18(%rsp), %ecx
movl %ecx, 0x14(%rsp)
jmp 0x14edb
movl 0x18(%rsp), %ecx
movl %ecx, 0x14(%rsp)
movq %rbp, 0xa0(%rsp)
movslq %ebp, %r15
xorl %ecx, %ecx
movl 0xc(%rsp,%rcx,4), %edx
xorl %ebx, %ebx
movq %rcx, 0x50(%rsp)
cmpl %edx, %ebx
jge 0x1500a
movl %edx, 0x18(%rsp)
movq (%r13,%r15,8), %rdi
movq 0x80(%rsp,%rcx,8), %rbp
movslq %ebx, %r12
movq (%rbp,%r12,8), %rsi
movl 0x14(%rdi), %eax
movl 0x14(%rsi), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movq 0x78(%rsp), %rdx
callq 0x7cbb
movq %rax, %r14
testq %rax, %rax
je 0x14ff8
movq (%r13,%r15,8), %rdi
callq 0x7060
movq (%rbp,%r12,8), %rdi
callq 0x7060
movl 0x18(%rsp), %edx
movslq %edx, %rax
decl %edx
movq -0x8(%rbp,%rax,8), %rax
movq %rax, (%rbp,%r12,8)
movq %r14, (%r13,%r15,8)
jmp 0x14ffe
incl %ebx
movl 0x18(%rsp), %edx
testq %r14, %r14
movq 0x50(%rsp), %rcx
je 0x14f90
jmp 0x15038
movl %edx, 0xc(%rsp,%rcx,4)
leaq 0x1(%rcx), %rax
testq %rcx, %rcx
movq %rax, %rcx
je 0x14f85
movq 0xa0(%rsp), %rbp
incl %ebp
movl 0x14(%rsp), %r8d
cmpl %r8d, %ebp
jl 0x14edb
jmp 0x15049
movl %edx, 0xc(%rsp,%rcx,4)
movq 0xa0(%rsp), %rbp
jmp 0x14edb
movslq 0xc(%rsp), %r9
addl %r9d, %r8d
addl 0x10(%rsp), %r8d
cmpl $0x1, %r8d
jne 0x15108
xorl %ebx, %ebx
movq 0x30(%rsp), %r13
movq 0x38(%rsp), %r12
cmpl $0x0, 0xc(%rsp,%rbx)
leaq 0x4(%rbx), %rbx
je 0x1506c
movq 0x20(%rsp), %rbp
testq %rbp, %rbp
je 0x15628
callq 0x6fb4
movq %rax, %r14
movq 0x78(%rsp,%rbx,2), %rbx
movq (%rbx), %rax
movl 0x14(%rax), %ecx
addl 0x14(%rbp), %ecx
testl %ecx, %ecx
movl $0x0, %r15d
cmovlel %r15d, %ecx
movl %ecx, 0x14(%r14)
movq (%rbp), %rdi
movl 0x8(%rbp), %esi
movq (%rax), %rdx
movl 0x8(%rax), %ecx
leaq 0x8(%r14), %r8
callq 0x2544
movq %rax, (%r14)
movl 0xc(%rbp), %eax
movl 0x14(%rbp), %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(%rbp), %eax
movl 0x10(%rdx), %ecx
cmpl %ecx, %eax
cmovgl %eax, %ecx
movl %ecx, 0x10(%r14)
movq %rdx, 0x20(%r14)
movq %rbp, 0x28(%r14)
movq %r14, 0xc8(%rsp)
movb $0x2, 0x18(%r14)
jmp 0x15638
xorl %eax, %eax
xorl %r15d, %r15d
xorl %r13d, %r13d
movq 0x38(%rsp), %r12
movslq 0xc(%rsp,%rax,4), %rcx
testq %rcx, %rcx
jle 0x1513b
movq 0x80(%rsp,%rax,8), %rsi
xorl %edx, %edx
movq (%rsi,%rdx,8), %rdi
cmpl $0x0, 0x14(%rdi)
jle 0x1513f
incq %rdx
cmpq %rdx, %rcx
jne 0x15129
xorl %ecx, %ecx
jmp 0x1514a
movl $0x36, %ecx
movl %eax, %r13d
movl %edx, %r15d
testl %ecx, %ecx
jne 0x15534
incq %rax
cmpq $0x3, %rax
jne 0x15115
movq 0xe0(%rsp), %rax
cmpl $0x2, %eax
movq 0x20(%rsp), %rdx
jl 0x15172
testq %rdx, %rdx
je 0x15182
movl 0xc0(%rsp), %ecx
cmpl %ecx, 0x14(%rdx)
jge 0x156f6
testq %rdx, %rdx
je 0x1518a
subl 0x14(%rdx), %eax
cmpl %eax, %r9d
movq 0x30(%rsp), %r13
jl 0x154f1
decl %r8d
movl %r8d, 0xa0(%rsp)
cltq
movq %rax, 0x40(%rsp)
leal -0x1(%r9), %eax
movq %rax, 0x50(%rsp)
movq 0x48(%rsp), %r14
movq 0x70(%rsp), %rax
movq %r14, 0x48(%rsp)
cmpl %r14d, %eax
movq %r9, 0xb0(%rsp)
jne 0x1526e
leal (%rax,%rax), %ebp
movslq %ebp, %rbx
leaq (,%rbx,8), %r14
movq %r12, %rdi
movq %r14, %rsi
callq 0x2200
movq %rax, %r12
leaq (,%rbx,4), %r15
movq 0x68(%rsp), %rdi
movq %r15, %rsi
callq 0x2200
movq %rax, 0x68(%rsp)
movq 0x60(%rsp), %rdi
movq %r15, %rsi
callq 0x2200
movq %rax, 0x60(%rsp)
movq 0x58(%rsp), %rdi
movq %r14, %rsi
callq 0x2200
movq %rax, 0x58(%rsp)
movq %r13, %rdi
movq %r14, %rsi
callq 0x2200
movq 0x70(%rsp), %rcx
movq %rax, %r13
cmpl %ebx, %ecx
jge 0x15264
movslq %ecx, %r15
movq 0xe8(%rsp), %r14
movq %r14, %rdi
callq 0x21d0
movq %rax, (%r13,%r15,8)
incq %r15
cmpq %r15, %rbx
jne 0x1524f
movl %ebp, %eax
movq 0xb0(%rsp), %r9
movq %rax, 0x70(%rsp)
leaq -0x1(%r9), %r14
movq 0x20(%rsp), %r15
testq %r15, %r15
movq %r14, 0xd8(%rsp)
je 0x15333
callq 0x6fb4
movq 0x48(%rsp), %rbp
movq %rax, (%r12,%rbp,8)
movq 0x80(%rsp), %rbx
movq (%rbx,%r14,8), %rcx
movl 0x14(%rcx), %edx
addl 0x14(%r15), %edx
testl %edx, %edx
movl $0x0, %esi
cmovlel %esi, %edx
movl %edx, 0x14(%rax)
movq (%r15), %rdi
movl 0x8(%r15), %esi
movq (%rcx), %rdx
movl 0x8(%rcx), %ecx
leaq 0x8(%rax), %r8
callq 0x2544
movq (%r12,%rbp,8), %rcx
movq %rax, (%rcx)
movl 0x14(%r15), %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
movq (%rbx,%r14,8), %rdi
addl 0xc(%rdi), %eax
movl 0xc(%r15), %ecx
cmpl %eax, %ecx
cmovgl %ecx, %eax
movq (%r12,%rbp,8), %rcx
movl %eax, 0xc(%rcx)
movl 0x10(%r15), %eax
movl 0x10(%rdi), %edx
cmpl %edx, %eax
cmovgl %eax, %edx
movl %edx, 0x10(%rcx)
callq 0x7054
movq (%r12,%rbp,8), %rcx
movq %rax, 0x20(%rcx)
movq %r15, %rdi
callq 0x7054
movq (%r12,%rbp,8), %rcx
movq %rax, 0x28(%rcx)
movq (%r12,%rbp,8), %rax
movb $0x2, 0x18(%rax)
jmp 0x1534d
movq 0x80(%rsp), %rax
movq (%rax,%r14,8), %rdi
callq 0x7054
movq 0x48(%rsp), %rcx
movq %rax, (%r12,%rcx,8)
movq 0x50(%rsp), %rbp
movl %ebp, %ebp
xorl %r15d, %r15d
movq 0xb0(%rsp), %rax
cmpq $0x2, %rax
jl 0x15397
movq 0x80(%rsp), %rbx
xorl %r15d, %r15d
movq 0x48(%rsp), %r14
movq (%rbx,%r15,8), %rdi
callq 0x7054
movq (%r13,%r14,8), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
cmpq %r15, %rbp
jne 0x15375
movq 0xb0(%rsp), %rax
movslq 0xc(%rsp), %rbx
cmpq %rbx, %rax
movq %r13, 0x30(%rsp)
movq %r12, 0x38(%rsp)
movq %rbp, 0x50(%rsp)
jge 0x153e3
movq 0x80(%rsp), %r12
movl %r15d, %r15d
movq %r13, %rbp
movq %rax, %r13
movq 0x48(%rsp), %r14
movq (%r12,%r13,8), %rdi
callq 0x7054
movq (%rbp,%r14,8), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
incq %r13
cmpq %rbx, %r13
jl 0x153c6
movslq 0x10(%rsp), %r12
testq %r12, %r12
jle 0x15436
movq 0x88(%rsp), %rcx
movq %rcx, 0x18(%rsp)
movl %r15d, %r15d
leaq (,%r15,8), %rbp
xorl %r13d, %r13d
movq 0x30(%rsp), %r14
movq 0x48(%rsp), %rbx
movq 0x18(%rsp), %rcx
movq (%rcx,%r13,8), %rdi
callq 0x7054
movq (%r14,%rbx,8), %rcx
addq %rbp, %rcx
movq %rax, (%rcx,%r13,8)
incq %r13
cmpq %r13, %r12
jne 0x15412
addl %r13d, %r15d
movslq 0x14(%rsp), %rbx
testq %rbx, %rbx
movq 0x30(%rsp), %rbp
movq 0x48(%rsp), %r14
jle 0x15479
movq 0x90(%rsp), %r12
movl %r15d, %r15d
shlq $0x3, %r15
xorl %r13d, %r13d
movq (%r12,%r13,8), %rdi
callq 0x7054
movq (%rbp,%r14,8), %rcx
addq %r15, %rcx
movq %rax, (%rcx,%r13,8)
incq %r13
cmpq %r13, %rbx
jne 0x1545c
movq 0x60(%rsp), %rax
movl 0xa0(%rsp), %ecx
movl %ecx, (%rax,%r14,4)
movq 0x68(%rsp), %rax
movq 0xd8(%rsp), %rbx
movl %ebx, (%rax,%r14,4)
movq 0x80(%rsp), %rax
movq (%rax,%rbx,8), %rax
movq (%rax), %rdi
movl 0x8(%rax), %esi
movq 0x78(%rsp), %rdx
callq 0xbed5
movq 0x58(%rsp), %rcx
movq %rax, (%rcx,%r14,8)
incq %r14
movq 0x50(%rsp), %rax
decl %eax
movq %rax, 0x50(%rsp)
movq 0x40(%rsp), %rax
cmpq %rax, 0xb0(%rsp)
movq %rbx, %r9
movq %rbp, %r13
movq 0x38(%rsp), %r12
jg 0x151b8
movl %r14d, 0x2c(%rsp)
movq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x7060
xorl %ebx, %ebx
movslq 0xc(%rsp,%rbx,4), %r14
testq %r14, %r14
jle 0x15526
movq 0x80(%rsp,%rbx,8), %r15
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdi
callq 0x7060
incq %r12
cmpq %r12, %r14
jne 0x15515
incq %rbx
cmpq $0x3, %rbx
jne 0x15500
jmp 0x15a39
cmpl $0x36, %ecx
jne 0x1569e
testl %r13d, %r13d
je 0x1556d
cmpl $0x2, %r13d
jne 0x156b1
cmpq $0x0, 0x20(%rsp)
je 0x156b1
movl 0xc0(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl %eax, 0x14(%rcx)
jne 0x156b1
movq 0x70(%rsp), %rax
cmpl %eax, 0x2c(%rsp)
jne 0x15866
leal (%rax,%rax), %ebp
movslq %ebp, %rbx
leaq (,%rbx,8), %rsi
movq %r12, %rdi
movq %rsi, %r12
callq 0x2200
movq %rax, 0x38(%rsp)
leaq (,%rbx,4), %r14
movq 0x68(%rsp), %rdi
movq %r14, %rsi
callq 0x2200
movq %rax, 0x68(%rsp)
movq 0x60(%rsp), %rdi
movq %r14, %rsi
callq 0x2200
movq %rax, 0x60(%rsp)
movq 0x58(%rsp), %rdi
movq %r12, %rsi
callq 0x2200
movq %rax, 0x58(%rsp)
movq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x2200
movq 0x70(%rsp), %rcx
movq %rax, 0x30(%rsp)
cmpl %ebx, %ecx
jge 0x15864
movl %ebp, 0x18(%rsp)
movslq %ecx, %r14
movq 0x30(%rsp), %r12
movq 0xe8(%rsp), %rbp
movq %rbp, %rdi
callq 0x21d0
movq %rax, (%r12,%r14,8)
incq %r14
cmpq %r14, %rbx
jne 0x1560b
movl 0x18(%rsp), %eax
jmp 0x15866
movq 0x78(%rsp,%rbx,2), %rax
movq (%rax), %rax
movq %rax, 0xc8(%rsp)
cmpl $0x2, 0x40(%rsp)
jl 0x15690
movl 0x2c(%rsp), %ebx
xorl %r14d, %r14d
movq (%r12,%r14,8), %rdi
callq 0x7060
movq 0x60(%rsp), %rbp
cmpl $0x0, (%rbp,%r14,4)
jle 0x1567a
xorl %r15d, %r15d
movq (%r13,%r14,8), %rax
movq (%rax,%r15,8), %rdi
callq 0x7060
incq %r15
movslq (%rbp,%r14,4), %rax
cmpq %rax, %r15
jl 0x1565f
movq 0x58(%rsp), %rax
movq (%rax,%r14,8), %rdi
callq 0xc453
incq %r14
cmpq %rbx, %r14
jne 0x15646
movq $0x0, 0x40(%rsp)
jmp 0x15a47
movl 0x2c(%rsp), %eax
movq %rax, 0x40(%rsp)
movq 0x30(%rsp), %r13
jmp 0x15a47
xorl %ebx, %ebx
movq 0x30(%rsp), %r13
movslq 0xc(%rsp,%rbx,4), %r14
testq %r14, %r14
jle 0x156de
movq 0x80(%rsp,%rbx,8), %r15
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdi
callq 0x7060
incq %r12
cmpq %r12, %r14
jne 0x156cd
incq %rbx
cmpq $0x3, %rbx
jne 0x156b8
movq 0x20(%rsp), %rdi
callq 0x7060
jmp 0x15a39
cmpl $0x0, 0xc(%rsp)
movl 0xbc(%rsp), %eax
jle 0x15ac6
movslq %eax, %r14
movl %r14d, %eax
movq %rax, 0x18(%rsp)
shlq $0x3, %r14
xorl %r13d, %r13d
movl 0xc4(%rsp), %ebp
movq 0x20(%rsp), %r15
movq 0x18(%rsp), %rax
addl %r13d, %eax
cmpl %ebp, %eax
jne 0x15750
addl %ebp, %ebp
movslq %ebp, %rsi
shlq $0x3, %rsi
movq 0xa8(%rsp), %rdi
callq 0x2200
movq %rax, 0xa8(%rsp)
testq %r15, %r15
je 0x1581a
callq 0x6fb4
movq 0xa8(%rsp), %rcx
leaq (%rcx,%r14), %rbx
movq %rax, (%rbx,%r13,8)
movq 0x80(%rsp), %r12
movq (%r12,%r13,8), %rcx
movl 0x14(%rcx), %edx
movq 0x20(%rsp), %rsi
addl 0x14(%rsi), %edx
testl %edx, %edx
movl $0x0, %r15d
cmovlel %r15d, %edx
movl %edx, 0x14(%rax)
movq 0x20(%rsp), %rdx
movq (%rdx), %rdi
movq 0x20(%rsp), %rdx
movl 0x8(%rdx), %esi
movq (%rcx), %rdx
movl 0x8(%rcx), %ecx
leaq 0x8(%rax), %r8
callq 0x2544
movq (%rbx,%r13,8), %rcx
movq %rax, (%rcx)
movq 0x20(%rsp), %rax
movl 0x14(%rax), %eax
testl %eax, %eax
cmovlel %r15d, %eax
movq (%r12,%r13,8), %rdi
movq 0x20(%rsp), %r15
addl 0xc(%rdi), %eax
movl 0xc(%r15), %ecx
cmpl %eax, %ecx
cmovgl %ecx, %eax
movq (%rbx,%r13,8), %rcx
movl %eax, 0xc(%rcx)
movl 0x10(%r15), %eax
movl 0x10(%rdi), %edx
cmpl %edx, %eax
cmovgl %eax, %edx
movl %edx, 0x10(%rcx)
callq 0x7054
movq (%rbx,%r13,8), %rcx
movq %rax, 0x20(%rcx)
movq %r15, %rdi
callq 0x7054
movq (%rbx,%r13,8), %rcx
movq %rax, 0x28(%rcx)
movq (%rbx,%r13,8), %rax
movb $0x2, 0x18(%rax)
jmp 0x1583a
movq 0x80(%rsp), %rax
movq (%rax,%r13,8), %rdi
callq 0x7054
movq 0xa8(%rsp), %rcx
addq %r14, %rcx
movq %rax, (%rcx,%r13,8)
incq %r13
movslq 0xc(%rsp), %rax
cmpq %rax, %r13
jl 0x15726
movl %ebp, 0xc4(%rsp)
addl %r13d, 0xbc(%rsp)
movq 0x30(%rsp), %r13
jmp 0x154f6
movl %ebp, %eax
movq %rax, 0x70(%rsp)
movslq %r13d, %r12
movslq %r15d, %r14
movq 0x20(%rsp), %rbp
testq %rbp, %rbp
je 0x15917
callq 0x6fb4
movq 0x38(%rsp), %r15
movq 0x48(%rsp), %rbx
movq %rax, (%r15,%rbx,8)
movq 0x80(%rsp,%r12,8), %r13
movq (%r13,%r14,8), %rcx
movl 0x14(%rcx), %edx
addl 0x14(%rbp), %edx
testl %edx, %edx
movl $0x0, %esi
cmovlel %esi, %edx
movl %edx, 0x14(%rax)
movq (%rbp), %rdi
movl 0x8(%rbp), %esi
movq (%rcx), %rdx
movl 0x8(%rcx), %ecx
leaq 0x8(%rax), %r8
callq 0x2544
movq (%r15,%rbx,8), %rcx
movq %rax, (%rcx)
movl 0x14(%rbp), %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
movl 0xc(%rbp), %ecx
movq (%r13,%r14,8), %rdx
addl 0xc(%rdx), %eax
cmpl %eax, %ecx
cmovgl %ecx, %eax
movq (%r15,%rbx,8), %rcx
movl %eax, 0xc(%rcx)
movl 0x10(%rbp), %eax
movl 0x10(%rdx), %esi
cmpl %esi, %eax
cmovgl %eax, %esi
movl %esi, 0x10(%rcx)
movq %rdx, 0x20(%rcx)
movq (%r15,%rbx,8), %rax
movq %rbp, 0x28(%rax)
movq (%r15,%rbx,8), %rax
movb $0x2, 0x18(%rax)
jmp 0x15931
movq 0x80(%rsp,%r12,8), %rax
movq (%rax,%r14,8), %rax
movq 0x38(%rsp), %rcx
movq 0x48(%rsp), %rbx
movq %rax, (%rcx,%rbx,8)
movq 0x30(%rsp), %r13
movq 0x80(%rsp,%r12,8), %rax
movslq 0xc(%rsp,%r12,4), %rcx
leaq -0x1(%rcx), %rdx
movl %edx, 0xc(%rsp,%r12,4)
movq -0x8(%rax,%rcx,8), %rcx
movq %rcx, (%rax,%r14,8)
movl 0x10(%rsp), %eax
addl 0xc(%rsp), %eax
addl 0x14(%rsp), %eax
movq 0x60(%rsp), %rcx
movl %eax, (%rcx,%rbx,4)
testq %rbp, %rbp
je 0x1597a
movl 0xc0(%rsp), %ecx
cmpl %ecx, 0x14(%rbp)
je 0x1597e
movl 0xc(%rsp), %eax
movq 0x68(%rsp), %rcx
movl %eax, (%rcx,%rbx,4)
testl %eax, %eax
movq 0x38(%rsp), %r12
je 0x159fc
xorl %eax, %eax
xorl %ecx, %ecx
movslq 0xc(%rsp,%rax,4), %rdx
testq %rdx, %rdx
jle 0x159cf
movq 0x80(%rsp,%rax,8), %rsi
movslq %ecx, %rdi
shlq $0x3, %rdi
xorl %r8d, %r8d
movq 0x48(%rsp), %r11
movq (%rsi,%r8,8), %r9
movq (%r13,%r11,8), %r10
addq %rdi, %r10
movq %r9, (%r10,%r8,8)
incq %r8
cmpq %r8, %rdx
jne 0x159b4
addl %r8d, %ecx
incq %rax
cmpq $0x3, %rax
jne 0x15993
movq 0x48(%rsp), %rbx
movq (%r12,%rbx,8), %rax
movq (%rax), %rdi
movl 0x8(%rax), %esi
movq 0x78(%rsp), %rdx
callq 0xbed5
movq 0x58(%rsp), %rcx
movq %rax, (%rcx,%rbx,8)
jmp 0x15a47
movq (%r12,%rbx,8), %rdi
callq 0x7060
movl $0x1, %ebx
movslq 0xc(%rsp,%rbx,4), %r14
testq %r14, %r14
jle 0x15a30
movq 0x80(%rsp,%rbx,8), %r15
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdi
callq 0x7060
incq %r12
cmpq %r12, %r14
jne 0x15a1f
incq %rbx
cmpq $0x3, %rbx
jne 0x15a0a
movl 0x2c(%rsp), %eax
movq %rax, 0x40(%rsp)
movq 0x38(%rsp), %r12
movq 0x78(%rsp), %rdi
callq 0xc453
movq 0xd0(%rsp), %rax
incq %rax
movq %rax, 0xd0(%rsp)
testb %al, %al
jne 0x15ab2
movq 0x40(%rsp), %rax
testl %eax, %eax
jle 0x15a8b
movl %eax, %eax
xorl %edx, %edx
movq (%r12,%rdx,8), %rcx
cmpl $0x1, 0xc(%rcx)
jne 0x15a8d
incq %rdx
cmpq %rdx, %rax
jne 0x15a75
movl %eax, %edx
jmp 0x15a8d
xorl %edx, %edx
leaq 0x1709c(%rip), %rdi     # 0x2cb30
movq 0xd0(%rsp), %rsi
xorl %eax, %eax
callq 0x2110
movq 0x1c516(%rip), %rax     # 0x31fc0
movq (%rax), %rdi
callq 0x21e0
movq 0x40(%rsp), %rax
testl %eax, %eax
movq 0x60(%rsp), %rbx
jne 0x14c19
jmp 0x15ad0
movq 0x30(%rsp), %r13
jmp 0x154f1
movl $0xa, %edi
callq 0x2040
movq %r12, %rdi
callq 0x2030
movq 0x58(%rsp), %rdi
callq 0x2030
movq 0x68(%rsp), %rdi
callq 0x2030
movq %rbx, %rdi
callq 0x2030
movq 0x70(%rsp), %rax
testl %eax, %eax
jle 0x15b1e
movl %eax, %ebx
xorl %r14d, %r14d
movq (%r13,%r14,8), %rdi
callq 0x2030
incq %r14
cmpq %r14, %rbx
jne 0x15b0c
movq %r13, %rdi
callq 0x2030
xorl %ebx, %ebx
movq 0xc8(%rsp), %r15
movq 0x80(%rsp,%rbx,8), %rdi
callq 0x2030
incq %rbx
cmpq $0x3, %rbx
jne 0x15b30
testq %r15, %r15
movl 0xbc(%rsp), %edx
je 0x15b98
testl %edx, %edx
movq 0xa8(%rsp), %rdi
jle 0x15b7c
movl %edx, %ebx
xorl %r14d, %r14d
movq (%rdi,%r14,8), %rdi
callq 0x7060
movq 0xa8(%rsp), %rdi
incq %r14
cmpq %r14, %rbx
jne 0x15b63
callq 0x2030
movl $0x8, %edi
callq 0x21d0
movq %rax, %rcx
movq %r15, (%rax)
movl $0x1, %edx
jmp 0x15ba0
movq 0xa8(%rsp), %rcx
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