// File: /workspace/github_c_makefile_star2_O0/cbouilla[P]AES-attacks-finder/Search.c
// Function: ExhaustiveSearchBalancedSolver
Solver * ExhaustiveSearchBalancedSolver(SysEqLin E, const int T, int * taille)
{
	int nb_wait;
	Solver * __restrict wait=SearchAlgoLowMem_All(E,T,&nb_wait);		
	
	int alloc_wait = nb_wait;
	
	Solver * __restrict checked=malloc(nb_wait*sizeof(Solver));
	int alloc_checked = nb_wait;
	int nb_checked = 0;
	
	int nb_low_time;
	Solver * __restrict low_time=MakeSolver1(E,&nb_low_time);
	
	int max_checked=0;
	int max_wait=nb_wait;
	start_1 :
	while (nb_wait>0)
	{
		if (nb_checked>max_checked) max_checked=nb_checked;
		if (nb_wait>max_wait) max_wait=nb_wait;
		printf("\r wait : %d - checked : %d - ",nb_wait,nb_checked);
		Solver B = wait[--nb_wait];
		const int nb_wait_backup = nb_wait;
		int nb_staying = nb_checked;
		start_2 :
		while (nb_staying>0)
		{
			Solver result = UnionSolverBorne(B,checked[--nb_staying],E,T);
			if (result!=NULL)
			{
				if (result->Nvar==checked[nb_staying]->Nvar)
				{
					freeSolver(result);
					if (PlusInteressant2(checked[nb_staying],B))
					{
						freeSolver(B);
						int i;
						for (i = nb_wait_backup; i < nb_wait; i++) freeSolver(wait[i]);
						nb_wait=nb_wait_backup;
						goto start_1;
					}
					else goto start_2;
				}
				if (result->Nvar==B->Nvar)
				{
					if (PlusInteressant2(B,checked[nb_staying]))
					{
						freeSolver(checked[nb_staying]);
						checked[nb_staying--]=checked[--nb_checked];
					}
					freeSolver(result);
					goto start_2;
				}
				Solver tmp = PropagateSolver2(result,E,low_time,nb_low_time);
				freeSolver(result);
				if (PlusInteressant_NoVarsNoMem(tmp,B))
				{
					freeSolver(B);
					int i=nb_checked;
					while (i>0)
					{
						i--;
						if (ContenuListesTriees(checked[i]->var,checked[i]->Nvar,tmp->var,tmp->Nvar) && PlusInteressant_NoVarsNoMem(tmp,checked[i]))
						{
							freeSolver(checked[i]);
							checked[i]=checked[--nb_checked];
						}
					}
					if (nb_wait==alloc_wait)
					{
						alloc_wait=2*alloc_wait;
						wait=realloc(wait,alloc_wait*sizeof(Solver));
					}
					wait[nb_wait++]=tmp;
					goto start_1;
				}
				else
				{
					int i=nb_staying;
					while (i>0)
					{
						i--;
						if (ContenuListesTriees(checked[i]->var,checked[i]->Nvar,tmp->var,tmp->Nvar) && PlusInteressant_NoVarsNoMem(tmp,checked[i]))
						{
							freeSolver(checked[i]);
							checked[i]=checked[--nb_staying];
							checked[nb_staying]=checked[--nb_checked];
						}
					}
					i=nb_checked;
					while (i>nb_staying)
					{
						i--;
						if (ContenuListesTriees(checked[i]->var,checked[i]->Nvar,tmp->var,tmp->Nvar) && PlusInteressant_NoVarsNoMem(tmp,checked[i]))
						{
							freeSolver(checked[i]);
							checked[i]=checked[--nb_checked];
						}
					}
					if (nb_wait==alloc_wait)
					{
						alloc_wait=2*alloc_wait;
						wait=realloc(wait,alloc_wait*sizeof(Solver));
					}
					wait[nb_wait++]=tmp;					
				}		
			}
		}
		if (nb_checked==alloc_checked)
		{
			alloc_checked=2*alloc_checked;
			checked=realloc(checked,alloc_checked*sizeof(Solver));
		}
		checked[nb_checked++]=B;		
	}
	printf("\n");
	printf("\r wait : %d - checked : %d",max_wait,max_checked);
	free(wait);
	int i;
	for (i = 0; i < nb_low_time; i++) freeSolver(low_time[i]);
	free(low_time);
	*taille=nb_checked;
	return checked;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x1c(%rbp), %rdx
callq 0x1e720
movq %rax, -0x28(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movslq -0x1c(%rbp), %rdi
shlq $0x3, %rdi
callq 0x21c0
movq %rax, -0x38(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x44(%rbp), %rsi
callq 0xb340
movq %rax, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x58(%rbp)
jmp 0x2149e
cmpl $0x0, -0x1c(%rbp)
jle 0x21a4f
movl -0x40(%rbp), %eax
cmpl -0x54(%rbp), %eax
jle 0x214b6
movl -0x40(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x58(%rbp), %eax
jle 0x214c4
movl -0x1c(%rbp), %eax
movl %eax, -0x58(%rbp)
movl -0x1c(%rbp), %esi
movl -0x40(%rbp), %edx
leaq 0x17854(%rip), %rdi     # 0x38d25
movb $0x0, %al
callq 0x2100
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $-0x1, %ecx
movl %ecx, -0x1c(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x60(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x68(%rbp)
jmp 0x214fe
cmpl $0x0, -0x68(%rbp)
jle 0x21a0b
movq -0x60(%rbp), %rdi
movq -0x38(%rbp), %rax
movl -0x68(%rbp), %ecx
addl $-0x1, %ecx
movl %ecx, -0x68(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
movq -0x8(%rbp), %rdx
movl -0xc(%rbp), %ecx
callq 0xac00
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
je 0x21a06
movq -0x70(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x38(%rbp), %rcx
movslq -0x68(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl 0x8(%rcx), %eax
jne 0x215eb
movq -0x70(%rbp), %rdi
callq 0x93b0
movq -0x38(%rbp), %rax
movslq -0x68(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x8(%rax), %eax
movq -0x60(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jl 0x215e6
movq -0x38(%rbp), %rax
movslq -0x68(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x14(%rax), %eax
movq -0x60(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jg 0x215e6
movq -0x38(%rbp), %rax
movslq -0x68(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0xc(%rax), %eax
movq -0x60(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jg 0x215e6
movq -0x60(%rbp), %rdi
callq 0x93b0
movl -0x64(%rbp), %eax
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x215db
movq -0x28(%rbp), %rax
movslq -0x74(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x93b0
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x215b7
movl -0x64(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x2149c
jmp 0x214fc
movq -0x70(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x60(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x21690
movq -0x60(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x38(%rbp), %rcx
movslq -0x68(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl 0x8(%rcx), %eax
jl 0x21682
movq -0x60(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x38(%rbp), %rcx
movslq -0x68(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl 0x14(%rcx), %eax
jg 0x21682
movq -0x60(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x38(%rbp), %rcx
movslq -0x68(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl 0xc(%rcx), %eax
jg 0x21682
movq -0x38(%rbp), %rax
movslq -0x68(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x93b0
movq -0x38(%rbp), %rax
movl -0x40(%rbp), %ecx
addl $-0x1, %ecx
movl %ecx, -0x40(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x38(%rbp), %rax
movl -0x68(%rbp), %ecx
movl %ecx, %esi
addl $-0x1, %esi
movl %esi, -0x68(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x70(%rbp), %rdi
callq 0x93b0
jmp 0x214fc
movq -0x70(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x50(%rbp), %rdx
movl -0x44(%rbp), %ecx
callq 0xb580
movq %rax, -0x80(%rbp)
movq -0x70(%rbp), %rdi
callq 0x93b0
movq -0x80(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x60(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jg 0x217f9
movq -0x80(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x60(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jg 0x217f9
movq -0x60(%rbp), %rdi
callq 0x93b0
movl -0x40(%rbp), %eax
movl %eax, -0x84(%rbp)
cmpl $0x0, -0x84(%rbp)
jle 0x217b5
movl -0x84(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x84(%rbp)
movq -0x38(%rbp), %rax
movslq -0x84(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rdi
movq -0x38(%rbp), %rax
movslq -0x84(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x8(%rax), %esi
movq -0x80(%rbp), %rax
movq (%rax), %rdx
movq -0x80(%rbp), %rax
movl 0x8(%rax), %ecx
callq 0x3360
cmpl $0x0, %eax
je 0x217b0
movq -0x80(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x38(%rbp), %rcx
movslq -0x84(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl 0x14(%rcx), %eax
jg 0x217b0
movq -0x80(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x38(%rbp), %rcx
movslq -0x84(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl 0xc(%rcx), %eax
jg 0x217b0
movq -0x38(%rbp), %rax
movslq -0x84(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x93b0
movq -0x38(%rbp), %rax
movl -0x40(%rbp), %ecx
addl $-0x1, %ecx
movl %ecx, -0x40(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x38(%rbp), %rax
movslq -0x84(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x216eb
movl -0x1c(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jne 0x217da
movl -0x2c(%rbp), %eax
shll %eax
movl %eax, -0x2c(%rbp)
movq -0x28(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
shlq $0x3, %rsi
callq 0x21f0
movq %rax, -0x28(%rbp)
movq -0x80(%rbp), %rdx
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x2149c
movl -0x68(%rbp), %eax
movl %eax, -0x88(%rbp)
cmpl $0x0, -0x88(%rbp)
jle 0x218f0
movl -0x88(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x88(%rbp)
movq -0x38(%rbp), %rax
movslq -0x88(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rdi
movq -0x38(%rbp), %rax
movslq -0x88(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x8(%rax), %esi
movq -0x80(%rbp), %rax
movq (%rax), %rdx
movq -0x80(%rbp), %rax
movl 0x8(%rax), %ecx
callq 0x3360
cmpl $0x0, %eax
je 0x218eb
movq -0x80(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x38(%rbp), %rcx
movslq -0x88(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl 0x14(%rcx), %eax
jg 0x218eb
movq -0x80(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x38(%rbp), %rcx
movslq -0x88(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl 0xc(%rcx), %eax
jg 0x218eb
movq -0x38(%rbp), %rax
movslq -0x88(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x93b0
movq -0x38(%rbp), %rax
movl -0x68(%rbp), %ecx
addl $-0x1, %ecx
movl %ecx, -0x68(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x38(%rbp), %rax
movslq -0x88(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rax
movl -0x40(%rbp), %ecx
addl $-0x1, %ecx
movl %ecx, -0x40(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x38(%rbp), %rax
movslq -0x68(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x21802
movl -0x40(%rbp), %eax
movl %eax, -0x88(%rbp)
movl -0x88(%rbp), %eax
cmpl -0x68(%rbp), %eax
jle 0x219c5
movl -0x88(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x88(%rbp)
movq -0x38(%rbp), %rax
movslq -0x88(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rdi
movq -0x38(%rbp), %rax
movslq -0x88(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x8(%rax), %esi
movq -0x80(%rbp), %rax
movq (%rax), %rdx
movq -0x80(%rbp), %rax
movl 0x8(%rax), %ecx
callq 0x3360
cmpl $0x0, %eax
je 0x219c0
movq -0x80(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x38(%rbp), %rcx
movslq -0x88(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl 0x14(%rcx), %eax
jg 0x219c0
movq -0x80(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x38(%rbp), %rcx
movslq -0x88(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl 0xc(%rcx), %eax
jg 0x219c0
movq -0x38(%rbp), %rax
movslq -0x88(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x93b0
movq -0x38(%rbp), %rax
movl -0x40(%rbp), %ecx
addl $-0x1, %ecx
movl %ecx, -0x40(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x38(%rbp), %rax
movslq -0x88(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x218f9
movl -0x1c(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jne 0x219ea
movl -0x2c(%rbp), %eax
shll %eax
movl %eax, -0x2c(%rbp)
movq -0x28(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
shlq $0x3, %rsi
callq 0x21f0
movq %rax, -0x28(%rbp)
movq -0x80(%rbp), %rdx
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x21a06
jmp 0x214fe
movl -0x40(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jne 0x21a30
movl -0x3c(%rbp), %eax
shll %eax
movl %eax, -0x3c(%rbp)
movq -0x38(%rbp), %rdi
movslq -0x3c(%rbp), %rsi
shlq $0x3, %rsi
callq 0x21f0
movq %rax, -0x38(%rbp)
movq -0x60(%rbp), %rdx
movq -0x38(%rbp), %rax
movl -0x40(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x40(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x2149e
leaq 0x15481(%rip), %rdi     # 0x36ed7
movb $0x0, %al
callq 0x2100
movl -0x58(%rbp), %esi
movl -0x54(%rbp), %edx
leaq 0x172d9(%rip), %rdi     # 0x38d43
movb $0x0, %al
callq 0x2100
movq -0x28(%rbp), %rdi
callq 0x2030
movl $0x0, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0x21ab4
movq -0x50(%rbp), %rax
movslq -0x8c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x93b0
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0x21a84
movq -0x50(%rbp), %rdi
callq 0x2030
movl -0x40(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)