// File: /workspace/github_c_makefile_star2_O2/cbouilla[P]AES-attacks-finder/Search.c
// Function: SearchAlgoLowMem
Solver SearchAlgoLowMem(SysEqLin E, const int T)
{
	const int nb_variables = E->a/E->gen;
	int Alloue=T*nb_variables;
	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++;
				}
			}
			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]);
	
	return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %r13
movl 0x8(%rdi), %eax
cltd
idivl 0x10(%rdi)
movl %eax, %r12d
movq %rsi, 0xc0(%rsp)
imull %esi, %eax
movq %rax, 0x68(%rsp)
movslq %eax, %r15
leaq (,%r15,8), %rbx
movq %rbx, %rdi
callq 0x21c0
movq %rax, 0x28(%rsp)
movq %rbx, %rdi
callq 0x21c0
movq %rax, 0x40(%rsp)
leaq (,%r15,4), %r14
movq %r14, %rdi
callq 0x21c0
movq %rax, 0x50(%rsp)
movq %r14, %rdi
callq 0x21c0
movq %rax, 0x48(%rsp)
movq %rbx, %rdi
callq 0x21c0
movq %rax, %rbp
movl %r12d, %r14d
movslq %r12d, %rax
shlq $0x3, %rax
movq %rax, 0xb8(%rsp)
xorl %ebx, %ebx
testl %r15d, %r15d
cmovlel %ebx, %r15d
cmpq %rbx, %r15
je 0x123af
movq 0xb8(%rsp), %rdi
callq 0x21c0
movq %rax, (%rbp,%rbx,8)
incq %rbx
jmp 0x12393
xorl %ebx, %ebx
movl %r14d, %r15d
cmpq $0x3, %rbx
je 0x123d4
movq 0xb8(%rsp), %rdi
callq 0x21c0
movq %rax, 0x80(%rsp,%rbx,8)
incq %rbx
jmp 0x123b4
xorl %ebx, %ebx
testl %r15d, %r15d
movl %r15d, %r14d
cmovlel %ebx, %r14d
cmpq %rbx, %r14
je 0x12401
movq 0x20(%r13), %rax
movl (%rax,%rbx,4), %edi
movq %r13, %rsi
callq 0x6d1e
movq (%rbp), %rcx
movq %rax, (%rcx,%rbx,8)
incq %rbx
jmp 0x123e0
movq 0x28(%rsp), %rax
andq $0x0, (%rax)
xorl %r14d, %r14d
xorl %edi, %edi
xorl %esi, %esi
movq %r13, %rdx
callq 0xb021
movq 0x40(%rsp), %rcx
movq %rax, (%rcx)
movq 0x50(%rsp), %rax
movl %r15d, (%rax)
movq 0x48(%rsp), %rax
movl %r15d, (%rax)
movq 0xc0(%rsp), %rax
decl %eax
movl %eax, 0x7c(%rsp)
pushq $0x1
popq %rcx
movq $0x0, 0xc8(%rsp)
xorl %r15d, %r15d
movq %rbp, %r12
testl %ecx, %ecx
je 0x1313b
leal -0x1(%rcx), %eax
movq %rax, 0xa8(%rsp)
movq %rcx, 0xa0(%rsp)
movslq %ecx, %rdx
leaq -0x1(%rdx), %rax
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rax
movslq -0x4(%rax,%rdx,4), %rax
movl %eax, 0xc(%rsp)
movq 0x48(%rsp), %rcx
movl -0x4(%rcx,%rdx,4), %ecx
subl %eax, %ecx
movl %ecx, 0x10(%rsp)
andl $0x0, 0x14(%rsp)
movq 0x40(%rsp), %rsi
movq -0x8(%rsi,%rdx,8), %rsi
movq %rsi, 0x70(%rsp)
movq 0x28(%rsp), %rsi
movq -0x8(%rsi,%rdx,8), %rdx
movq %rdx, 0x58(%rsp)
movq 0x80(%rsp), %rdx
movq %rdx, 0xd0(%rsp)
testl %eax, %eax
movl $0x0, %edx
cmovgl %eax, %edx
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x124fa
movq 0x20(%rsp), %rdi
movq (%r12,%rdi,8), %rdi
movq (%rdi,%rsi,8), %rdi
movq 0xd0(%rsp), %r8
movq %rdi, (%r8,%rsi,8)
incq %rsi
jmp 0x124d7
movq 0x88(%rsp), %rdx
movq %rdx, 0x38(%rsp)
testl %ecx, %ecx
cmovlel %r14d, %ecx
shlq $0x3, %rax
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x12536
movq 0x20(%rsp), %rsi
movq (%r12,%rsi,8), %rsi
addq %rax, %rsi
movq (%rsi,%rdx,8), %rsi
movq 0x38(%rsp), %rdi
movq %rsi, (%rdi,%rdx,8)
incq %rdx
jmp 0x12513
movq %r15, 0x98(%rsp)
xorl %r15d, %r15d
movq %r12, 0x30(%rsp)
cmpq $0x2, %r15
je 0x125fa
movl 0xc(%rsp,%r15,4), %eax
movl %eax, 0x18(%rsp)
xorl %ebp, %ebp
cmpl 0x18(%rsp), %ebp
jge 0x125e6
movslq %ebp, %r14
movl %ebp, %r12d
testl %r12d, %r12d
jle 0x125df
movq 0x80(%rsp,%r15,8), %r13
movq (%r13,%r14,8), %rdi
movq -0x8(%r13,%r12,8), %rsi
decq %r12
movl 0x14(%rdi), %eax
movl 0x14(%rsi), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movq 0x70(%rsp), %rdx
callq 0x73be
testq %rax, %rax
je 0x1256b
movq %rax, %rbx
movq (%r13,%r14,8), %rdi
callq 0x6852
movq (%r13,%r12,8), %rdi
callq 0x6852
movl 0x18(%rsp), %ecx
movslq %ecx, %rax
decl %ecx
movl %ecx, 0x18(%rsp)
movq -0x8(%r13,%rax,8), %rax
movq %rax, (%r13,%r14,8)
movq -0x8(%r13,%r14,8), %rax
movq %rax, (%r13,%r12,8)
movq %rbx, -0x8(%r13,%r14,8)
addl $-0x2, %ebp
incl %ebp
jmp 0x1255b
movl 0x18(%rsp), %eax
movl %eax, 0xc(%rsp,%r15,4)
incq %r15
xorl %r14d, %r14d
jmp 0x12546
movl 0xc(%rsp), %eax
movl %eax, 0x60(%rsp)
movl 0x10(%rsp), %edx
movl 0x14(%rsp), %r12d
xorl %ecx, %ecx
movq 0x90(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xd0(%rsp), %r15
testl %edx, %edx
movl $0x0, %r13d
cmovgl %edx, %r13d
movl %edx, 0xb0(%rsp)
cmpl 0x60(%rsp), %ecx
jge 0x126f7
movl %ecx, 0xb4(%rsp)
movslq %ecx, %rbp
xorl %r14d, %r14d
cmpq %r14, %r13
je 0x1267d
movq (%r15,%rbp,8), %rdi
movq 0x38(%rsp), %rax
movq (%rax,%r14,8), %rsi
movl 0x14(%rdi), %eax
movl 0x14(%rsi), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movq 0x70(%rsp), %rdx
callq 0x73be
incq %r14
testq %rax, %rax
je 0x1264c
jmp 0x12692
movl 0xb4(%rsp), %ecx
incl %ecx
xorl %r14d, %r14d
movl 0xb0(%rsp), %edx
jmp 0x12635
movq %rax, %rbx
movq (%r15,%rbp,8), %rdi
callq 0x6852
movl 0x60(%rsp), %ecx
movslq %ecx, %rax
decl %ecx
movl %ecx, 0x60(%rsp)
movq -0x8(%r15,%rax,8), %rax
movq %rax, (%r15,%rbp,8)
movq 0x38(%rsp), %r13
movq -0x8(%r13,%r14,8), %rdi
callq 0x6852
movl 0xb0(%rsp), %edx
movslq %edx, %rax
decl %edx
movq -0x8(%r13,%rax,8), %rax
movq %rax, -0x8(%r13,%r14,8)
movslq %r12d, %rax
incl %r12d
movq 0x18(%rsp), %rcx
movq %rbx, (%rcx,%rax,8)
xorl %r14d, %r14d
movl 0xb4(%rsp), %ecx
jmp 0x12622
movl 0x60(%rsp), %eax
movl %eax, 0xc(%rsp)
movl %edx, 0x10(%rsp)
movl %r12d, 0x14(%rsp)
xorl %ebp, %ebp
cmpl %r12d, %ebp
jge 0x12851
movslq %ebp, %r14
movl %ebp, %r13d
testl %r13d, %r13d
jle 0x1274d
decl %r13d
movq 0x18(%rsp), %rax
movq (%rax,%r14,8), %rdi
movq (%rax,%r13,8), %rsi
movl 0x14(%rdi), %eax
movl 0x14(%rsi), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movq 0x70(%rsp), %rdx
callq 0x73be
testq %rax, %rax
je 0x12719
jmp 0x127ff
movl %r12d, 0x14(%rsp)
xorl %r12d, %r12d
movl %ebp, 0x38(%rsp)
cmpq $0x2, %r12
je 0x12842
movl 0xc(%rsp,%r12,4), %r15d
movslq %r15d, %rax
movq %rax, 0x60(%rsp)
xorl %r13d, %r13d
cmpl %r15d, %r13d
jge 0x127ad
movq 0x18(%rsp), %rax
movq (%rax,%r14,8), %rdi
movq 0x80(%rsp,%r12,8), %rbp
movq (%rbp,%r13,8), %rsi
movl 0x14(%rdi), %eax
movl 0x14(%rsi), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movq 0x70(%rsp), %rdx
callq 0x73be
incq %r13
testq %rax, %rax
je 0x12773
jmp 0x127bb
movl %r15d, 0xc(%rsp,%r12,4)
incq %r12
movl 0x38(%rsp), %ebp
jmp 0x12759
movq %rax, %rbx
movq 0x18(%rsp), %r15
movq (%r15,%r14,8), %rdi
callq 0x6852
movq -0x8(%rbp,%r13,8), %rdi
callq 0x6852
movq 0x60(%rsp), %rcx
movq -0x8(%rbp,%rcx,8), %rax
decq %rcx
movq %rax, -0x8(%rbp,%r13,8)
movq %rbx, (%r15,%r14,8)
movl %ecx, 0xc(%rsp,%r12,4)
movl 0x14(%rsp), %r12d
movl 0x38(%rsp), %ebp
jmp 0x12716
movq %rax, %rbx
movq 0x18(%rsp), %r15
movq (%r15,%r14,8), %rdi
callq 0x6852
movq (%r15,%r13,8), %rdi
callq 0x6852
decl %ebp
movq -0x8(%r15,%r14,8), %rax
movq %rax, (%r15,%r13,8)
movq %rbx, -0x8(%r15,%r14,8)
movslq %r12d, %rax
decl %r12d
movq -0x8(%r15,%rax,8), %rax
movq %rax, (%r15,%r14,8)
movl %r12d, 0x14(%rsp)
jmp 0x12713
incl %ebp
movl 0x14(%rsp), %r12d
xorl %r14d, %r14d
jmp 0x1270a
movslq 0xc(%rsp), %rbx
addl %ebx, %r12d
addl 0x10(%rsp), %r12d
cmpl $0x1, %r12d
jne 0x12910
xorl %ebx, %ebx
cmpl $0x0, 0xc(%rsp,%rbx)
leaq 0x4(%rbx), %rbx
je 0x1286a
movq 0x58(%rsp), %r13
testq %r13, %r13
movq 0x30(%rsp), %r12
je 0x12a8a
callq 0x67a4
xorl %r15d, %r15d
movq %rax, %r14
movq 0x78(%rsp,%rbx,2), %rbx
movq (%rbx), %rax
movl 0x14(%rax), %ecx
addl 0x14(%r13), %ecx
testl %ecx, %ecx
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 0x2440
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)
xorl %r14d, %r14d
jmp 0x12a9a
xorl %r15d, %r15d
cmpq $0x3, %r15
je 0x12d31
movl 0xc(%rsp,%r15,4), %eax
testl %eax, %eax
movl $0x0, %r13d
cmovlel %r14d, %eax
xorl %r14d, %r14d
cmpq %r14, %rax
je 0x1294d
movq 0x80(%rsp,%r15,8), %rcx
movq (%rcx,%r14,8), %rcx
cmpl $0x0, 0x14(%rcx)
jle 0x12955
incq %r14
jmp 0x12931
incq %r15
xorl %r14d, %r14d
jmp 0x12913
testq %r15, %r15
je 0x12982
cmpq $0x2, %r15
jne 0x12a2c
cmpq $0x0, 0x58(%rsp)
je 0x12a2c
movl 0x7c(%rsp), %eax
movq 0x58(%rsp), %rcx
cmpl %eax, 0x14(%rcx)
jne 0x12a2c
movq 0x68(%rsp), %rax
cmpl %eax, 0xa8(%rsp)
jne 0x12b10
leal (%rax,%rax), %ebp
movq %rax, 0x68(%rsp)
movslq %ebp, %r12
leaq (,%r12,8), %r13
movq 0x28(%rsp), %rdi
movq %r13, %rsi
callq 0x21f0
movq %rax, 0x28(%rsp)
leaq (,%r12,4), %rbx
movq 0x50(%rsp), %rdi
movq %rbx, %rsi
callq 0x21f0
movq %rax, 0x50(%rsp)
movq 0x48(%rsp), %rdi
movq %rbx, %rsi
callq 0x21f0
movq %rax, 0x48(%rsp)
movq 0x40(%rsp), %rdi
movq %r13, %rsi
callq 0x21f0
movq %rax, 0x40(%rsp)
movq 0x30(%rsp), %rdi
movq %r13, %rsi
callq 0x21f0
movq %rax, %r13
movslq 0x68(%rsp), %rbx
cmpq %r12, %rbx
jge 0x12b17
movq 0xb8(%rsp), %rdi
callq 0x21c0
movq %rax, (%r13,%rbx,8)
incq %rbx
jmp 0x12a0c
xorl %ebx, %ebx
movq 0x30(%rsp), %r12
cmpq $0x3, %rbx
je 0x12a68
movl 0xc(%rsp,%rbx,4), %r14d
testl %r14d, %r14d
cmovlel %r13d, %r14d
xorl %r15d, %r15d
cmpq %r15, %r14
je 0x12a63
movq 0x80(%rsp,%rbx,8), %rax
movq (%rax,%r15,8), %rdi
callq 0x6852
incq %r15
jmp 0x12a48
incq %rbx
jmp 0x12a33
movq 0x58(%rsp), %rdi
callq 0x6852
movq 0xa8(%rsp), %rax
movq %rax, 0xa0(%rsp)
xorl %r14d, %r14d
jmp 0x130c5
movq 0x78(%rsp,%rbx,2), %rax
movq (%rax), %rax
movq %rax, 0xc8(%rsp)
movq 0x98(%rsp), %r15
movq 0xa8(%rsp), %r13
testl %r13d, %r13d
cmovlel %r14d, %r13d
xorl %ebx, %ebx
cmpq %r13, %rbx
je 0x12aff
movq 0x28(%rsp), %rax
movq (%rax,%rbx,8), %rdi
callq 0x6852
xorl %r14d, %r14d
movq 0x48(%rsp), %rax
movslq (%rax,%rbx,4), %rax
cmpq %rax, %r14
jge 0x12ae9
movq (%r12,%rbx,8), %rax
movq (%rax,%r14,8), %rdi
callq 0x6852
incq %r14
jmp 0x12ac9
movq 0x40(%rsp), %rax
movq (%rax,%rbx,8), %rdi
callq 0xb562
incq %rbx
xorl %r14d, %r14d
jmp 0x12ab3
movq $0x0, 0xa0(%rsp)
jmp 0x130cd
movq 0x30(%rsp), %r12
jmp 0x12b21
movl %ebp, %eax
movq %rax, 0x68(%rsp)
movq %r13, %r12
movq 0x58(%rsp), %rbx
testq %rbx, %rbx
je 0x12bd6
callq 0x67a4
movq 0x28(%rsp), %r13
movq 0x20(%rsp), %rbp
movq %rax, (%r13,%rbp,8)
movl %r15d, %ecx
movq %rcx, 0x18(%rsp)
movq 0x80(%rsp,%rcx,8), %r15
movq (%r15,%r14,8), %rcx
movl 0x14(%rcx), %edx
addl 0x14(%rbx), %edx
testl %edx, %edx
movl $0x0, %esi
cmovlel %esi, %edx
movl %edx, 0x14(%rax)
movq (%rbx), %rdi
movl 0x8(%rbx), %esi
movq (%rcx), %rdx
movl 0x8(%rcx), %ecx
leaq 0x8(%rax), %r8
callq 0x2440
movq (%r13,%rbp,8), %rcx
movq %rax, (%rcx)
movl 0x14(%rbx), %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
movl 0xc(%rbx), %ecx
movq (%r15,%r14,8), %rdx
addl 0xc(%rdx), %eax
cmpl %eax, %ecx
cmovgl %ecx, %eax
movq (%r13,%rbp,8), %rcx
movl %eax, 0xc(%rcx)
movl 0x10(%rbx), %eax
movl 0x10(%rdx), %esi
cmpl %esi, %eax
cmovgl %eax, %esi
movl %esi, 0x10(%rcx)
movq %rdx, 0x20(%rcx)
movq 0x18(%rsp), %rdx
movq (%r13,%rbp,8), %rax
movq %rbx, 0x28(%rax)
movq (%r13,%rbp,8), %rax
movb $0x2, 0x18(%rax)
jmp 0x12bfb
movl %r15d, %edx
movq 0x80(%rsp,%rdx,8), %rax
movq (%rax,%r14,8), %rax
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rbp
movq %rax, (%rcx,%rbp,8)
movq 0x80(%rsp,%rdx,8), %r15
movslq 0xc(%rsp,%rdx,4), %rax
leaq -0x1(%rax), %rcx
movl %ecx, 0xc(%rsp,%rdx,4)
movq -0x8(%r15,%rax,8), %rax
movq %rax, (%r15,%r14,8)
movl 0x10(%rsp), %eax
addl 0xc(%rsp), %eax
addl 0x14(%rsp), %eax
movq 0x48(%rsp), %rcx
movl %eax, (%rcx,%rbp,4)
testq %rbx, %rbx
je 0x12c33
movl 0x7c(%rsp), %ecx
cmpl %ecx, 0x14(%rbx)
je 0x12c37
movl 0xc(%rsp), %eax
movq 0x50(%rsp), %rcx
movq 0x20(%rsp), %rdx
movl %eax, (%rcx,%rdx,4)
testl %eax, %eax
movl $0x0, %r14d
movq 0x98(%rsp), %r15
je 0x12cd1
xorl %eax, %eax
xorl %ecx, %ecx
cmpq $0x3, %rax
je 0x12ca5
movl 0xc(%rsp,%rax,4), %edx
movslq %ecx, %rcx
testl %edx, %edx
cmovlel %r14d, %edx
leaq (,%rcx,8), %rdi
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x12c9d
movq 0x80(%rsp,%rax,8), %r8
movq (%r8,%rsi,8), %r8
movq 0x20(%rsp), %r9
movq (%r12,%r9,8), %r9
addq %rdi, %r9
movq %r8, (%r9,%rsi,8)
incq %rsi
jmp 0x12c77
incq %rax
addq %rsi, %rcx
jmp 0x12c5a
movq 0x28(%rsp), %rax
movq 0x20(%rsp), %rbx
movq (%rax,%rbx,8), %rax
movq (%rax), %rdi
movl 0x8(%rax), %esi
movq 0x70(%rsp), %rdx
callq 0xb021
movq 0x40(%rsp), %rcx
movq %rax, (%rcx,%rbx,8)
jmp 0x130cd
movq 0x28(%rsp), %rax
movq (%rax,%rdx,8), %rdi
callq 0x6852
pushq $0x1
popq %rbx
cmpq $0x3, %rbx
je 0x12d1c
xorl %eax, %eax
movl 0xc(%rsp,%rbx,4), %r14d
testl %r14d, %r14d
cmovlel %eax, %r14d
xorl %r15d, %r15d
cmpq %r15, %r14
je 0x12d14
movq 0x80(%rsp,%rbx,8), %rax
movq (%rax,%r15,8), %rdi
callq 0x6852
incq %r15
jmp 0x12cf9
incq %rbx
xorl %r14d, %r14d
jmp 0x12ce2
movq 0xa8(%rsp), %rax
movq %rax, 0xa0(%rsp)
jmp 0x130c5
movq 0xc0(%rsp), %rax
cmpl $0x2, %eax
jl 0x12d46
cmpq $0x0, 0x58(%rsp)
je 0x12d62
movq 0x58(%rsp), %rax
movl 0x14(%rax), %ecx
cmpl 0x7c(%rsp), %ecx
jge 0x1306a
movq 0xc0(%rsp), %rax
subl %ecx, %eax
decl %r12d
cltq
movq %rax, 0x60(%rsp)
movq 0x20(%rsp), %r13
cmpq 0x60(%rsp), %rbx
jl 0x13072
movq 0x68(%rsp), %r15
cmpl %r13d, %r15d
movq %r13, 0x20(%rsp)
jne 0x12e33
leal (%r15,%r15), %eax
movl %eax, 0x18(%rsp)
movslq %eax, %r14
leaq (,%r14,8), %r13
movq 0x28(%rsp), %rdi
movq %r13, %rsi
callq 0x21f0
movq %rax, 0x28(%rsp)
leaq (,%r14,4), %rbp
movq 0x50(%rsp), %rdi
movq %rbp, %rsi
callq 0x21f0
movq %rax, 0x50(%rsp)
movq 0x48(%rsp), %rdi
movq %rbp, %rsi
callq 0x21f0
movq %rax, 0x48(%rsp)
movq 0x40(%rsp), %rdi
movq %r13, %rsi
callq 0x21f0
movq %rax, 0x40(%rsp)
movq 0x30(%rsp), %rdi
movq %r13, %rsi
callq 0x21f0
movq %rax, 0x30(%rsp)
movslq %r15d, %r15
cmpq %r14, %r15
jge 0x12e27
movq 0xb8(%rsp), %rdi
callq 0x21c0
movq 0x30(%rsp), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
jmp 0x12e07
movl 0x18(%rsp), %eax
movq %rax, 0x68(%rsp)
xorl %r14d, %r14d
leaq -0x1(%rbx), %r13
movq 0x58(%rsp), %rbp
testq %rbp, %rbp
movq %r13, 0x38(%rsp)
je 0x12f08
callq 0x67a4
movq 0x28(%rsp), %r14
movq 0x20(%rsp), %r13
movq %rax, (%r14,%r13,8)
movq 0x80(%rsp), %r15
movq 0x38(%rsp), %rcx
movq (%r15,%rcx,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 0x2440
movq (%r14,%r13,8), %rcx
movq %rax, (%rcx)
movl 0x14(%rbp), %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
movq 0x38(%rsp), %rcx
movq %r15, 0x18(%rsp)
movq (%r15,%rcx,8), %rdi
addl 0xc(%rdi), %eax
movl 0xc(%rbp), %ecx
cmpl %eax, %ecx
cmovgl %ecx, %eax
movq (%r14,%r13,8), %rcx
movl %eax, 0xc(%rcx)
movl 0x10(%rbp), %eax
movl 0x10(%rdi), %edx
cmpl %edx, %eax
cmovgl %eax, %edx
movl %edx, 0x10(%rcx)
callq 0x6846
movq (%r14,%r13,8), %rcx
movq %rax, 0x20(%rcx)
movq %rbp, %rdi
callq 0x6846
movq (%r14,%r13,8), %rcx
movq %rax, 0x28(%rcx)
movq (%r14,%r13,8), %rax
movq 0x38(%rsp), %r13
xorl %r14d, %r14d
movb $0x2, 0x18(%rax)
jmp 0x12f34
movq 0x80(%rsp), %rax
movq (%rax,%r13,8), %rdi
callq 0x6846
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rdx
movq %rax, (%rcx,%rdx,8)
movq 0x80(%rsp), %rax
movq %rax, 0x18(%rsp)
xorl %ebp, %ebp
xorl %r15d, %r15d
cmpq %r13, %r15
jge 0x12f67
movq 0x18(%rsp), %rax
movq (%rax,%r15,8), %rdi
callq 0x6846
movq 0x30(%rsp), %rcx
movq 0x20(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
addq $0x8, %rbp
jmp 0x12f39
movslq 0xc(%rsp), %r13
cmpq %r13, %rbx
jge 0x12f9d
movq 0x18(%rsp), %rax
movq (%rax,%rbx,8), %rdi
callq 0x6846
movq 0x30(%rsp), %rcx
movq 0x20(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
incq %rbx
addq $0x8, %rbp
jmp 0x12f6c
movl 0x10(%rsp), %ebx
movq 0x88(%rsp), %r13
testl %ebx, %ebx
cmovlel %r14d, %ebx
xorl %r14d, %r14d
cmpq %r14, %rbx
je 0x12fdf
movq (%r13,%r14,8), %rdi
callq 0x6846
movq 0x30(%rsp), %rcx
movq 0x20(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
incq %r14
addq $0x8, %rbp
jmp 0x12fb2
movl 0x14(%rsp), %ebx
movq 0x90(%rsp), %r15
testl %ebx, %ebx
movl $0x0, %eax
cmovlel %eax, %ebx
xorl %r14d, %r14d
cmpq %r14, %rbx
je 0x13021
movq (%r15,%r14,8), %rdi
callq 0x6846
movq 0x30(%rsp), %rcx
movq 0x20(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
movq %rax, (%rcx,%rbp)
incq %r14
addq $0x8, %rbp
jmp 0x12ff8
movq 0x48(%rsp), %rax
movq 0x20(%rsp), %r13
movl %r12d, (%rax,%r13,4)
movq 0x50(%rsp), %rax
movq 0x38(%rsp), %rbx
movl %ebx, (%rax,%r13,4)
movq 0x18(%rsp), %rax
movq (%rax,%rbx,8), %rax
movq (%rax), %rdi
movl 0x8(%rax), %esi
movq 0x70(%rsp), %rdx
callq 0xb021
movq 0x40(%rsp), %rcx
movq %rax, (%rcx,%r13,8)
incq %r13
xorl %r14d, %r14d
jmp 0x12d71
movq 0xa8(%rsp), %r13
movq 0x58(%rsp), %rdi
callq 0x6852
xorl %ebx, %ebx
movq 0x30(%rsp), %r12
cmpq $0x3, %rbx
je 0x130bd
xorl %eax, %eax
movl 0xc(%rsp,%rbx,4), %r14d
testl %r14d, %r14d
cmovlel %eax, %r14d
xorl %r15d, %r15d
cmpq %r15, %r14
je 0x130b5
movq 0x80(%rsp,%rbx,8), %rax
movq (%rax,%r15,8), %rdi
callq 0x6852
incq %r15
jmp 0x1309a
incq %rbx
xorl %r14d, %r14d
jmp 0x13083
movq %r13, 0xa0(%rsp)
movq 0x98(%rsp), %r15
movq 0x70(%rsp), %rdi
callq 0xb562
incq %r15
testb %r15b, %r15b
jne 0x1312e
movq 0xa0(%rsp), %rax
testl %eax, %eax
movl $0x0, %edx
cmovgl %eax, %edx
xorl %eax, %eax
cmpq %rax, %rdx
je 0x1310e
movq 0x28(%rsp), %rcx
movq (%rcx,%rax,8), %rcx
cmpl $0x1, 0xc(%rcx)
jne 0x1310c
incq %rax
jmp 0x130f3
movl %eax, %edx
leaq 0x17a1b(%rip), %rdi     # 0x2ab30
movq %r15, %rsi
xorl %eax, %eax
callq 0x2110
movq 0x1ce9a(%rip), %rax     # 0x2ffc0
movq (%rax), %rdi
callq 0x21d0
movq 0xa0(%rsp), %rcx
jmp 0x12454
pushq $0xa
popq %rdi
callq 0x2040
movq 0x28(%rsp), %rdi
callq 0x2030
movq 0x40(%rsp), %rdi
callq 0x2030
movq 0x50(%rsp), %rdi
callq 0x2030
movq 0x48(%rsp), %rdi
callq 0x2030
xorl %ebx, %ebx
movq 0x68(%rsp), %r14
testl %r14d, %r14d
cmovlel %ebx, %r14d
cmpq %rbx, %r14
je 0x1318c
movq (%r12,%rbx,8), %rdi
callq 0x2030
incq %rbx
jmp 0x13179
movq %r12, %rdi
callq 0x2030
xorl %ebx, %ebx
cmpq $0x3, %rbx
je 0x131ae
movq 0x80(%rsp,%rbx,8), %rdi
callq 0x2030
incq %rbx
jmp 0x13196
movq 0xc8(%rsp), %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq