// File: /workspace/github_c_makefile_star2_O3/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, %ebp
movq %rsi, 0xc8(%rsp)
imull %esi, %eax
movq %rax, 0x88(%rsp)
movslq %eax, %r14
leaq (,%r14,8), %rbx
movq %rbx, %rdi
callq 0x21d0
movq %rax, 0x30(%rsp)
movq %rbx, %rdi
callq 0x21d0
movq %rax, 0x48(%rsp)
leaq (,%r14,4), %r12
movq %r12, %rdi
callq 0x21d0
movq %rax, 0x50(%rsp)
movq %r12, %rdi
callq 0x21d0
movq %rax, 0x28(%rsp)
movq %rbx, %rdi
callq 0x21d0
movq %rax, %r15
movl %ebp, %r12d
movslq %ebp, %rbp
shlq $0x3, %rbp
testl %r14d, %r14d
jle 0x13fbf
movl 0x88(%rsp), %ebx
xorl %r14d, %r14d
movq %rbp, %rdi
callq 0x21d0
movq %rax, (%r15,%r14,8)
incq %r14
cmpq %r14, %rbx
jne 0x13fab
xorl %ebx, %ebx
movq %rbp, %rdi
callq 0x21d0
movq %rax, 0x70(%rsp,%rbx,8)
incq %rbx
cmpq $0x3, %rbx
jne 0x13fc1
movq %rbp, 0xd0(%rsp)
testl %r12d, %r12d
jle 0x14009
movl %r12d, %ebx
xorl %r14d, %r14d
movq 0x20(%r13), %rax
movl (%rax,%r14,4), %edi
movq %r13, %rsi
callq 0x790b
movq (%r15), %rcx
movq %rax, (%rcx,%r14,8)
incq %r14
cmpq %r14, %rbx
jne 0x13fea
movq 0x30(%rsp), %rax
movq $0x0, (%rax)
xorl %edi, %edi
xorl %esi, %esi
movq %r13, %rdx
callq 0xc29a
movq 0x48(%rsp), %rcx
movq %rax, (%rcx)
movq 0x50(%rsp), %rax
movl %r12d, (%rax)
movq 0x28(%rsp), %rbx
movl %r12d, (%rbx)
movq 0xc8(%rsp), %rax
decl %eax
movl %eax, 0xa4(%rsp)
movl $0x1, %eax
xorl %r14d, %r14d
movq $0x0, 0xb8(%rsp)
movq %rax, 0x58(%rsp)
movslq %eax, %rcx
leaq -0x1(%rcx), %r8
movq 0x48(%rsp), %rax
movq -0x8(%rax,%rcx,8), %rax
movq %rax, 0x98(%rsp)
movq 0x30(%rsp), %rax
movq -0x8(%rax,%rcx,8), %rax
movq %rax, 0xb0(%rsp)
movq 0x50(%rsp), %rax
movslq -0x4(%rax,%rcx,4), %rax
movl %eax, 0x4(%rsp)
movl -0x4(%rbx,%rcx,4), %ecx
subl %eax, %ecx
movl %ecx, 0x8(%rsp)
movl $0x0, 0xc(%rsp)
testq %rax, %rax
jle 0x140ce
movq 0x70(%rsp), %rdx
xorl %esi, %esi
movq (%r15,%r8,8), %rdi
movq (%rdi,%rsi,8), %rdi
movq %rdi, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x140ba
movq %r14, 0xa8(%rsp)
movq %rbx, 0x28(%rsp)
testl %ecx, %ecx
jle 0x14103
movq 0x78(%rsp), %rdx
movl %ecx, %ecx
shlq $0x3, %rax
xorl %esi, %esi
movq (%r15,%r8,8), %rdi
addq %rax, %rdi
movq (%rdi,%rsi,8), %rdi
movq %rdi, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rcx
jne 0x140ec
movq %r8, 0x38(%rsp)
movq %r15, 0x20(%rsp)
movq 0x58(%rsp), %rax
decl %eax
movl %eax, 0x44(%rsp)
movb $0x1, %cl
leaq 0x4(%rsp), %rax
leaq 0x70(%rsp), %r15
movl %ecx, 0x68(%rsp)
movq %rax, 0x60(%rsp)
movl (%rax), %ecx
testl %ecx, %ecx
jle 0x141c5
xorl %ebx, %ebx
movl %ecx, 0x10(%rsp)
movslq %ebx, %r13
movl %r13d, %r14d
testl %r14d, %r14d
jle 0x141b7
movq (%r15), %rbp
movq (%rbp,%r13,8), %rdi
movq -0x8(%rbp,%r14,8), %rsi
decq %r14
movl 0x14(%rdi), %eax
movl 0x14(%rsi), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movq 0x98(%rsp), %rdx
callq 0x7ff0
testq %rax, %rax
je 0x14143
movq %rax, %r12
movq (%rbp,%r13,8), %rdi
callq 0x7447
movq (%rbp,%r14,8), %rdi
callq 0x7447
movl 0x10(%rsp), %ecx
movslq %ecx, %rax
decl %ecx
movq -0x8(%rbp,%rax,8), %rax
movq %rax, (%rbp,%r13,8)
movq -0x8(%rbp,%r13,8), %rax
movq %rax, (%rbp,%r14,8)
movq %r12, -0x8(%rbp,%r13,8)
addl $-0x2, %r13d
movl %r13d, %ebx
jmp 0x141bb
movl 0x10(%rsp), %ecx
incl %ebx
cmpl %ecx, %ebx
jl 0x14139
movq 0x60(%rsp), %rax
movl %ecx, (%rax)
leaq 0x8(%rsp), %rax
leaq 0x78(%rsp), %r15
testb $0x1, 0x68(%rsp)
movl $0x0, %ecx
jne 0x14124
movl 0x4(%rsp), %ebp
movl 0x8(%rsp), %edx
movl 0xc(%rsp), %eax
movl %eax, 0x1c(%rsp)
testl %ebp, %ebp
jle 0x142d4
movq 0x70(%rsp), %r14
movq 0x78(%rsp), %r15
xorl %ecx, %ecx
movq 0x80(%rsp), %rax
movq %rax, 0x90(%rsp)
testl %edx, %edx
jle 0x142ca
movq %rbp, 0x10(%rsp)
movl %ecx, 0x60(%rsp)
movslq %ecx, %rbx
movl %edx, 0x68(%rsp)
movl %edx, %ebp
xorl %r13d, %r13d
movq (%r14,%rbx,8), %rdi
movq (%r15,%r13,8), %rsi
movl 0x14(%rdi), %eax
movl 0x14(%rsi), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movq 0x98(%rsp), %rdx
callq 0x7ff0
testq %rax, %rax
jne 0x14273
incq %r13
cmpq %r13, %rbp
jne 0x14237
movq 0x10(%rsp), %rbp
movl 0x68(%rsp), %edx
movl 0x60(%rsp), %ecx
jmp 0x142ca
movq %rax, %r12
movq (%r14,%rbx,8), %rdi
callq 0x7447
movq 0x10(%rsp), %rbp
movslq %ebp, %rax
decl %ebp
movq -0x8(%r14,%rax,8), %rax
movq %rax, (%r14,%rbx,8)
movq (%r15,%r13,8), %rdi
callq 0x7447
movl 0x68(%rsp), %edx
movslq %edx, %rax
decl %edx
movq -0x8(%r15,%rax,8), %rax
movq %rax, (%r15,%r13,8)
movl 0x1c(%rsp), %ecx
movslq %ecx, %rax
incl %ecx
movl %ecx, 0x1c(%rsp)
movq 0x90(%rsp), %rcx
movq %r12, (%rcx,%rax,8)
decl %ebx
movl %ebx, %ecx
incl %ecx
cmpl %ebp, %ecx
jl 0x1421a
movl %ebp, 0x4(%rsp)
movl %edx, 0x8(%rsp)
movl 0x1c(%rsp), %esi
movl %esi, 0xc(%rsp)
testl %esi, %esi
jle 0x14483
xorl %r13d, %r13d
movq 0x80(%rsp), %rbx
leal 0x1(%r13), %ebp
movl %esi, 0x1c(%rsp)
movslq %r13d, %rax
movq %rax, 0x10(%rsp)
movq %r13, 0xc0(%rsp)
movl %ebp, 0x90(%rsp)
movl %ebp, %r14d
testl %r13d, %r13d
jle 0x14359
leal -0x2(%r14), %r15d
movq 0x10(%rsp), %rax
movq (%rbx,%rax,8), %rdi
movq (%rbx,%r15,8), %rsi
movl 0x14(%rdi), %eax
movl 0x14(%rsi), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movq 0x98(%rsp), %rdx
callq 0x7ff0
testq %rax, %rax
jne 0x14434
decl %r14d
cmpl $0x1, %r14d
jg 0x1431e
movb $0x1, %cl
leaq 0x4(%rsp), %rax
leaq 0x70(%rsp), %r15
movl %ecx, 0x60(%rsp)
movq %rax, 0x68(%rsp)
movslq (%rax), %r13
testq %r13, %r13
jle 0x143ad
xorl %ebp, %ebp
movq 0x10(%rsp), %rax
movq (%rbx,%rax,8), %rdi
movq (%r15), %r14
movq (%r14,%rbp,8), %rsi
movl 0x14(%rdi), %eax
movl 0x14(%rsi), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movq 0x98(%rsp), %rdx
callq 0x7ff0
testq %rax, %rax
jne 0x143cd
incq %rbp
cmpl %r13d, %ebp
jl 0x14378
movq 0x68(%rsp), %rax
movl %r13d, (%rax)
leaq 0x8(%rsp), %rax
leaq 0x78(%rsp), %r15
testb $0x1, 0x60(%rsp)
movl $0x0, %ecx
jne 0x14365
jmp 0x14413
movq %rax, %r12
movq 0x10(%rsp), %r15
movq (%rbx,%r15,8), %rdi
callq 0x7447
movq (%r14,%rbp,8), %rdi
callq 0x7447
movq -0x8(%r14,%r13,8), %rax
decq %r13
movq %rax, (%r14,%rbp,8)
movq %r12, (%rbx,%r15,8)
movq 0x68(%rsp), %rax
movl %r13d, (%rax)
movq 0xc0(%rsp), %r13
movl 0x90(%rsp), %ebp
jmp 0x14316
movq 0x10(%rsp), %rax
leal 0x1(%rax), %r13d
movl 0x90(%rsp), %ebp
incl %ebp
movl 0x1c(%rsp), %esi
cmpl %esi, %r13d
jl 0x142ff
jmp 0x14477
movq %rax, %r12
movq 0x10(%rsp), %r14
movq (%rbx,%r14,8), %rdi
callq 0x7447
movq (%rbx,%r15,8), %rdi
callq 0x7447
leal -0x1(%r14), %r13d
movq -0x8(%rbx,%r14,8), %rax
movq %rax, (%rbx,%r15,8)
movq %r12, -0x8(%rbx,%r14,8)
movl 0x1c(%rsp), %esi
movslq %esi, %rax
decl %esi
movq -0x8(%rbx,%rax,8), %rax
movq %rax, (%rbx,%r14,8)
jmp 0x142f7
movl %esi, 0xc(%rsp)
movl 0x4(%rsp), %ebp
movl 0x8(%rsp), %edx
addl %ebp, %esi
addl %edx, %esi
cmpl $0x1, %esi
movq 0xb0(%rsp), %r14
jne 0x1453e
xorl %ebx, %ebx
cmpl $0x0, 0x4(%rsp,%rbx)
leaq 0x4(%rbx), %rbx
je 0x1449a
testq %r14, %r14
je 0x14a89
callq 0x7394
movq %r14, %r12
movq %rax, %r14
movq 0x68(%rsp,%rbx,2), %rbx
movq (%rbx), %rax
movl 0x14(%rax), %ecx
addl 0x14(%r12), %ecx
testl %ecx, %ecx
movl $0x0, %r15d
cmovlel %r15d, %ecx
movl %ecx, 0x14(%r14)
movq (%r12), %rdi
movl 0x8(%r12), %esi
movq (%rax), %rdx
movl 0x8(%rax), %ecx
leaq 0x8(%r14), %r8
callq 0x2544
movq %rax, (%r14)
movl 0xc(%r12), %eax
movl 0x14(%r12), %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(%r12), %eax
movl 0x10(%rdx), %ecx
cmpl %ecx, %eax
cmovgl %eax, %ecx
movl %ecx, 0x10(%r14)
movq %rdx, 0x20(%r14)
movq %r12, 0x28(%r14)
movq %r14, 0xb8(%rsp)
movb $0x2, 0x18(%r14)
jmp 0x14a99
xorl %ebx, %ebx
movslq 0x4(%rsp,%rbx,4), %rax
testq %rax, %rax
jle 0x14568
movq 0x70(%rsp,%rbx,8), %rcx
xorl %r12d, %r12d
movq (%rcx,%r12,8), %rdx
cmpl $0x0, 0x14(%rdx)
jle 0x14954
incq %r12
cmpq %r12, %rax
jne 0x14552
incq %rbx
cmpq $0x3, %rbx
jne 0x14540
movl %esi, 0x1c(%rsp)
movq 0xc8(%rsp), %rdx
cmpl $0x2, %edx
movq 0x28(%rsp), %r15
movq 0x38(%rsp), %rbx
jl 0x14593
movl %edx, %eax
testq %r14, %r14
je 0x145a8
movl 0x14(%r14), %ecx
cmpl 0xa4(%rsp), %ecx
jge 0x14919
movl %edx, %eax
subl %ecx, %eax
cmpl %eax, %ebp
jl 0x14919
decl 0x1c(%rsp)
movslq %ebp, %r13
cltq
movq %rax, 0xc0(%rsp)
decl %ebp
movq 0x88(%rsp), %rax
cmpl %ebx, %eax
movq %rbx, 0x38(%rsp)
movq %r13, 0x90(%rsp)
jne 0x1469f
addl %eax, %eax
movl %eax, 0x10(%rsp)
movslq %eax, %r14
leaq (,%r14,8), %rbx
movq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x2200
movq %rax, 0x30(%rsp)
leaq (,%r14,4), %r12
movq 0x50(%rsp), %rdi
movq %r12, %rsi
callq 0x2200
movq %rax, 0x50(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x2200
movq %rax, 0x28(%rsp)
movq 0x48(%rsp), %rdi
movq %rbx, %rsi
callq 0x2200
movq %rax, 0x48(%rsp)
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x2200
movq %rax, 0x20(%rsp)
movq 0x88(%rsp), %rax
cmpl %r14d, %eax
jge 0x146a6
movl 0x10(%rsp), %ebx
movslq %eax, %r15
movq 0x20(%rsp), %r12
movq 0xd0(%rsp), %r13
movq %r13, %rdi
callq 0x21d0
movq %rax, (%r12,%r15,8)
incq %r15
cmpq %r15, %r14
jne 0x14672
movl %ebx, %eax
movq 0xb0(%rsp), %r14
movq 0x38(%rsp), %rbx
movq 0x90(%rsp), %r13
jmp 0x146b7
movq %r15, 0x28(%rsp)
jmp 0x146b7
movl 0x10(%rsp), %eax
movq 0xb0(%rsp), %r14
movq 0x38(%rsp), %rbx
movq %rax, 0x88(%rsp)
leaq -0x1(%r13), %r15
testq %r14, %r14
movq %r15, 0x60(%rsp)
je 0x1478b
movq %r14, %r12
callq 0x7394
movq 0x30(%rsp), %r14
movq %rax, (%r14,%rbx,8)
movq %rbx, %r13
movq 0x70(%rsp), %rbx
movq (%rbx,%r15,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 (%r14,%r13,8), %rcx
movq %rax, (%rcx)
movl 0x14(%r12), %eax
testl %eax, %eax
cmovlel %r15d, %eax
movq 0x60(%rsp), %rcx
movq (%rbx,%rcx,8), %rdi
addl 0xc(%rdi), %eax
movl 0xc(%r12), %ecx
cmpl %eax, %ecx
cmovgl %ecx, %eax
movq (%r14,%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 (%r14,%r13,8), %rcx
movq %rax, 0x20(%rcx)
movq %r12, %rdi
callq 0x743b
movq (%r14,%r13,8), %rcx
movq %rax, 0x28(%rcx)
movq (%r14,%r13,8), %rax
movq 0x90(%rsp), %r13
movb $0x2, 0x18(%rax)
jmp 0x147a2
movq 0x70(%rsp), %rax
movq (%rax,%r15,8), %rdi
callq 0x743b
movq 0x30(%rsp), %rcx
movq %rax, (%rcx,%rbx,8)
movl %ebp, %ebp
xorl %ebx, %ebx
cmpq $0x2, %r13
jl 0x147dc
movq 0x70(%rsp), %rbx
xorl %r14d, %r14d
movq 0x20(%rsp), %r15
movq 0x38(%rsp), %r12
movq (%rbx,%r14,8), %rdi
callq 0x743b
movq (%r15,%r12,8), %rcx
movq %rax, (%rcx,%r14,8)
incq %r14
cmpq %r14, %rbp
jne 0x147be
movq 0x60(%rsp), %rbx
movslq 0x4(%rsp), %r14
cmpq %r14, %r13
movq %rbp, 0x10(%rsp)
jge 0x14819
movq 0x70(%rsp), %r15
movl %ebx, %ebx
movq 0x20(%rsp), %rbp
movq 0x38(%rsp), %r12
movq (%r15,%r13,8), %rdi
callq 0x743b
movq (%rbp,%r12,8), %rcx
movq %rax, (%rcx,%rbx,8)
incq %rbx
incq %r13
cmpq %r14, %r13
jl 0x147fc
movslq 0x8(%rsp), %r15
testq %r15, %r15
jle 0x14868
movq 0x78(%rsp), %rcx
movq %rcx, 0x68(%rsp)
movl %ebx, %ebx
leaq (,%rbx,8), %rbp
xorl %r13d, %r13d
movq 0x20(%rsp), %r12
movq 0x38(%rsp), %r14
movq 0x68(%rsp), %rcx
movq (%rcx,%r13,8), %rdi
callq 0x743b
movq (%r12,%r14,8), %rcx
addq %rbp, %rcx
movq %rax, (%rcx,%r13,8)
incq %r13
cmpq %r13, %r15
jne 0x14844
addl %r13d, %ebx
movslq 0xc(%rsp), %r14
testq %r14, %r14
movq 0x20(%rsp), %rbp
movq 0x38(%rsp), %r12
jle 0x148aa
movq 0x80(%rsp), %r15
movl %ebx, %ebx
shlq $0x3, %rbx
xorl %r13d, %r13d
movq (%r15,%r13,8), %rdi
callq 0x743b
movq (%rbp,%r12,8), %rcx
addq %rbx, %rcx
movq %rax, (%rcx,%r13,8)
incq %r13
cmpq %r13, %r14
jne 0x1488d
movq 0x28(%rsp), %r15
movl 0x1c(%rsp), %eax
movl %eax, (%r15,%r12,4)
movq 0x50(%rsp), %rax
movq 0x60(%rsp), %r13
movl %r13d, (%rax,%r12,4)
movq 0x70(%rsp), %rax
movq (%rax,%r13,8), %rax
movq (%rax), %rdi
movl 0x8(%rax), %esi
movq 0x98(%rsp), %rdx
callq 0xc29a
movq 0x48(%rsp), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
movq 0x10(%rsp), %rbp
decl %ebp
movq 0x90(%rsp), %rax
cmpq 0xc0(%rsp), %rax
movq 0xb0(%rsp), %r14
movq %r12, %rbx
jg 0x145c3
movl %ebx, 0x44(%rsp)
movq %r14, %rdi
callq 0x7447
xorl %ebx, %ebx
movslq 0x4(%rsp,%rbx,4), %r14
testq %r14, %r14
jle 0x14946
movq 0x70(%rsp,%rbx,8), %r15
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdi
callq 0x7447
incq %r12
cmpq %r12, %r14
jne 0x14935
incq %rbx
cmpq $0x3, %rbx
jne 0x14923
jmp 0x14ce1
testq %rbx, %rbx
je 0x1497d
cmpq $0x2, %rbx
jne 0x14a49
testq %r14, %r14
je 0x14a49
movl 0xa4(%rsp), %eax
cmpl %eax, 0x14(%r14)
jne 0x14a49
movq 0x88(%rsp), %rax
cmpl %eax, 0x44(%rsp)
jne 0x14b0c
addl %eax, %eax
movl %eax, 0x10(%rsp)
movslq %eax, %r15
leaq (,%r15,8), %r13
movq 0x30(%rsp), %rdi
movq %r13, %rsi
callq 0x2200
movq %rax, 0x30(%rsp)
leaq (,%r15,4), %rbp
movq 0x50(%rsp), %rdi
movq %rbp, %rsi
callq 0x2200
movq %rax, 0x50(%rsp)
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0x2200
movq %rax, 0x28(%rsp)
movq 0x48(%rsp), %rdi
movq %r13, %rsi
callq 0x2200
movq %rax, 0x48(%rsp)
movq 0x20(%rsp), %rdi
movq %r13, %rsi
callq 0x2200
movq %rax, 0x20(%rsp)
movq 0x88(%rsp), %rax
cmpl %r15d, %eax
jge 0x14b08
movslq %eax, %r13
movq 0x20(%rsp), %rbp
movq 0xd0(%rsp), %r14
movq %r14, %rdi
callq 0x21d0
movq %rax, (%rbp,%r13,8)
incq %r13
cmpq %r13, %r15
jne 0x14a23
movl 0x10(%rsp), %eax
movq 0xb0(%rsp), %r14
jmp 0x14b0c
xorl %ebx, %ebx
movslq 0x4(%rsp,%rbx,4), %r14
testq %r14, %r14
jle 0x14a6e
movq 0x70(%rsp,%rbx,8), %r15
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdi
callq 0x7447
incq %r12
cmpq %r12, %r14
jne 0x14a5d
incq %rbx
cmpq $0x3, %rbx
jne 0x14a4b
movq 0xb0(%rsp), %rdi
callq 0x7447
jmp 0x14ce1
movq 0x68(%rsp,%rbx,2), %rax
movq (%rax), %rax
movq %rax, 0xb8(%rsp)
cmpl $0x2, 0x58(%rsp)
jl 0x14afa
movl 0x44(%rsp), %ebx
xorl %r14d, %r14d
movq 0x30(%rsp), %rax
movq (%rax,%r14,8), %rdi
callq 0x7447
movq 0x28(%rsp), %r13
cmpl $0x0, (%r13,%r14,4)
movq 0x20(%rsp), %r12
jle 0x14ae4
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 0x14aca
movq 0x48(%rsp), %rax
movq (%rax,%r14,8), %rdi
callq 0xc82d
incq %r14
cmpq %rbx, %r14
jne 0x14aa7
movq $0x0, 0x58(%rsp)
jmp 0x14cea
movl 0x10(%rsp), %eax
movq %rax, 0x88(%rsp)
testq %r14, %r14
movq %r14, %rbp
je 0x14bb5
callq 0x7394
movq 0x30(%rsp), %r15
movq 0x38(%rsp), %r13
movq %rax, (%r15,%r13,8)
movl %ebx, %ebx
movq 0x70(%rsp,%rbx,8), %r14
movq (%r14,%r12,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,%r13,8), %rcx
movq %rax, (%rcx)
movl 0x14(%rbp), %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
movl 0xc(%rbp), %ecx
movq (%r14,%r12,8), %rdx
addl 0xc(%rdx), %eax
cmpl %eax, %ecx
cmovgl %ecx, %eax
movq (%r15,%r13,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,%r13,8), %rax
movq %rbp, 0x28(%rax)
movq (%r15,%r13,8), %rax
movb $0x2, 0x18(%rax)
jmp 0x14bd3
movl %ebx, %ebx
movq 0x70(%rsp,%rbx,8), %rax
movq (%rax,%r12,8), %rax
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %r13
movq %rax, (%rcx,%r13,8)
movq 0x70(%rsp,%rbx,8), %r14
movslq 0x4(%rsp,%rbx,4), %rax
leaq -0x1(%rax), %rcx
movl %ecx, 0x4(%rsp,%rbx,4)
movq -0x8(%r14,%rax,8), %rax
movq %rax, (%r14,%r12,8)
movl 0x8(%rsp), %eax
addl 0x4(%rsp), %eax
addl 0xc(%rsp), %eax
movq 0x28(%rsp), %rbx
movl %eax, (%rbx,%r13,4)
testq %rbp, %rbp
je 0x14c0f
movl 0xa4(%rsp), %ecx
cmpl %ecx, 0x14(%rbp)
je 0x14c13
movl 0x4(%rsp), %eax
movq 0x50(%rsp), %rcx
movq 0x38(%rsp), %rdx
movl %eax, (%rcx,%rdx,4)
testl %eax, %eax
movq 0x20(%rsp), %r15
movq 0xa8(%rsp), %r14
je 0x14ca2
xorl %eax, %eax
xorl %ecx, %ecx
movslq 0x4(%rsp,%rax,4), %rdx
testq %rdx, %rdx
jle 0x14c6d
movq 0x70(%rsp,%rax,8), %rsi
movslq %ecx, %rdi
shlq $0x3, %rdi
xorl %r8d, %r8d
movq 0x38(%rsp), %r11
movq (%rsi,%r8,8), %r9
movq (%r15,%r11,8), %r10
addq %rdi, %r10
movq %r9, (%r10,%r8,8)
incq %r8
cmpq %r8, %rdx
jne 0x14c53
addl %r8d, %ecx
incq %rax
cmpq $0x3, %rax
jne 0x14c35
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %r12
movq (%rax,%r12,8), %rax
movq (%rax), %rdi
movl 0x8(%rax), %esi
movq 0x98(%rsp), %rdx
callq 0xc29a
movq 0x48(%rsp), %rcx
movq %rax, (%rcx,%r12,8)
jmp 0x14cfc
movq 0x30(%rsp), %rax
movq (%rax,%rdx,8), %rdi
callq 0x7447
movl $0x1, %ebx
movslq 0x4(%rsp,%rbx,4), %r14
testq %r14, %r14
jle 0x14cd8
movq 0x70(%rsp,%rbx,8), %r15
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdi
callq 0x7447
incq %r12
cmpq %r12, %r14
jne 0x14cc7
incq %rbx
cmpq $0x3, %rbx
jne 0x14cb5
movl 0x44(%rsp), %eax
movq %rax, 0x58(%rsp)
movq 0x20(%rsp), %r15
movq 0x28(%rsp), %rbx
movq 0xa8(%rsp), %r14
movq 0x98(%rsp), %rdi
callq 0xc82d
incq %r14
testb %r14b, %r14b
jne 0x14d5b
movq 0x58(%rsp), %rax
testl %eax, %eax
jle 0x14d39
movl %eax, %eax
xorl %edx, %edx
movq 0x30(%rsp), %rcx
movq (%rcx,%rdx,8), %rcx
cmpl $0x1, 0xc(%rcx)
jne 0x14d3b
incq %rdx
cmpq %rdx, %rax
jne 0x14d1e
movl %eax, %edx
jmp 0x14d3b
xorl %edx, %edx
leaq 0x17e4e(%rip), %rdi     # 0x2cb90
movq %r14, %rsi
xorl %eax, %eax
callq 0x2110
movq 0x1d26d(%rip), %rax     # 0x31fc0
movq (%rax), %rdi
callq 0x21e0
movq 0x58(%rsp), %rax
testl %eax, %eax
jne 0x1405e
movl $0xa, %edi
callq 0x2040
movq 0x30(%rsp), %rdi
callq 0x2030
movq 0x48(%rsp), %rdi
callq 0x2030
movq 0x50(%rsp), %rdi
callq 0x2030
movq %rbx, %rdi
callq 0x2030
movq 0x88(%rsp), %rax
testl %eax, %eax
jle 0x14dba
movl %eax, %ebx
xorl %r14d, %r14d
movq (%r15,%r14,8), %rdi
callq 0x2030
incq %r14
cmpq %r14, %rbx
jne 0x14da9
movq %r15, %rdi
callq 0x2030
xorl %ebx, %ebx
movq 0x70(%rsp,%rbx,8), %rdi
callq 0x2030
incq %rbx
cmpq $0x3, %rbx
jne 0x14dc4
movq 0xb8(%rsp), %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq