// File: /workspace/github_c_makefile_star2_O0/cbouilla[P]AES-attacks-finder/Search.c
// Function: GenerateSolver_manual
Solver GenerateSolver_manual(int T, Solver *B1, int N1, SysEqLin E, string_list_t *variable_names) // Search manuelle
{
	int i,N;
	Solver B,*B1_tmp,tmp;

	for (i = 0; i < N1; i++)
	{
		printf(" Solver %d (%d || %d || %d): ",i,B1[i]->temps,B1[i]->memoire,B1[i]->sortie);
		PrintVarSolver2(B1[i],variable_names);
	}
	do
	{
		printf("index of guessed solver : ");
		scanf(" %d",&i);
		getchar();
	} while (i<0 || i>=N1);
	//i=rand()%N1;
	N=N1-1;
	B=B1[i];
	B1[i]=B1[N];
	B1[N]=B;
	B=copySolver(B);
	B1_tmp=malloc(N*sizeof(Solver));
	for (i = 0; i < N; i++) B1_tmp[i]=copySolver(B1[i]);
	while (B->sortie<T && N>0)
	{
		for (i = 0; i < N; i++)
		{
			tmp=UnionSpeciale(B1_tmp[i],B,E);
			if (tmp->sortie>T || tmp->temps>T)
			{
				printf("Something wrong - 2204 - Search.c");
				getchar();
			}
			freeSolver(B1_tmp[i]);
			B1_tmp[i]=tmp;
		}
		N=ReduireSolvers(B1_tmp,N,E);
		TriFusion1(B1_tmp,N);
		if (B1_tmp[0]->sortie<=B->sortie)
		{
			freeSolver(B);
			tmp=B1_tmp[0];
			N--;
			B1_tmp[0]=B1_tmp[N];
			B=PropagateSolver2(tmp,E,B1,N1);
			freeSolver(tmp);
			for (i = 0; i < N; i++) freeSolver(B1_tmp[i]);
			N=0;
			int *test,Ntest;
			for (i = 0; i < N1; i++)
			{
				test=UnionListesTriees(B->var,B->Nvar,B1[i]->var,B1[i]->Nvar,&Ntest);
				free(test);
				if (Ntest>B->Nvar) B1_tmp[N++]=copySolver(B1[i]);
			}			
		}
		else
		{
			for (i = 0; i < N; i++)
			{
				printf(" Solver %d : ",i);
				PrintVarSolver2(B1_tmp[i]->fils1,variable_names);
			}
			do
			{
				printf("index of guessed solver : ? ");
				scanf(" %d",&i);
				getchar();
			} while (i<0 || i>=N);
			freeSolver(B);
			B=B1_tmp[i];
			N--;
			B1_tmp[i]=B1_tmp[N];
		}
	}
	if (B->Nvar<T || B->memoire>1 || B->temps>T)
	{
		printf("Something wrong - 2249 - Search.c : %d %d %d\n",B->memoire,B->temps,B->sortie);
		PrintVarSolver(B);
		getchar();
	}
	printf(" Solver built (%d || %d || %d): ",B->temps,B->memoire,B->sortie);
	PrintVarSolver2(B,variable_names);
	getchar();
	for (i = 0; i < N; i++) freeSolver(B1_tmp[i]);
	free(B1_tmp);
	return B;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x21ce8
movl -0x2c(%rbp), %esi
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0xc(%rax), %edx
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x10(%rax), %ecx
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rdi
movq (%rax,%rdi,8), %rax
movl 0x14(%rax), %r8d
leaq 0x1709d(%rip), %rdi     # 0x38d5e
movb $0x0, %al
callq 0x2100
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x28(%rbp), %rsi
callq 0x99d0
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x21c81
jmp 0x21cea
leaq 0x1708b(%rip), %rdi     # 0x38d7c
movb $0x0, %al
callq 0x2100
leaq 0x1705b(%rip), %rdi     # 0x38d5a
leaq -0x2c(%rbp), %rsi
movb $0x0, %al
callq 0x2220
callq 0x2170
movb $0x1, %al
cmpl $0x0, -0x2c(%rbp)
movb %al, -0x55(%rbp)
jl 0x21d26
movl -0x2c(%rbp), %eax
cmpl -0x14(%rbp), %eax
setge %al
movb %al, -0x55(%rbp)
movb -0x55(%rbp), %al
testb $0x1, %al
jne 0x21cea
movl -0x14(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rdx
movq -0x10(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rdi
callq 0x9380
movq %rax, -0x38(%rbp)
movslq -0x30(%rbp), %rdi
shlq $0x3, %rdi
callq 0x21c0
movq %rax, -0x40(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x21dc6
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x9380
movq %rax, %rdx
movq -0x40(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x21d93
jmp 0x21dc8
movq -0x38(%rbp), %rax
movl 0x14(%rax), %ecx
xorl %eax, %eax
cmpl -0x4(%rbp), %ecx
movb %al, -0x56(%rbp)
jge 0x21de3
cmpl $0x0, -0x30(%rbp)
setg %al
movb %al, -0x56(%rbp)
movb -0x56(%rbp), %al
testb $0x1, %al
jne 0x21def
jmp 0x22093
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x21e72
movq -0x40(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x38(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xada0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl 0x14(%rax), %eax
cmpl -0x4(%rbp), %eax
jg 0x21e33
movq -0x48(%rbp), %rax
movl 0xc(%rax), %eax
cmpl -0x4(%rbp), %eax
jle 0x21e46
leaq 0x16f5d(%rip), %rdi     # 0x38d97
movb $0x0, %al
callq 0x2100
callq 0x2170
movq -0x40(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x93b0
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x21df6
movq -0x40(%rbp), %rdi
movl -0x30(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0xb310
movl %eax, -0x30(%rbp)
movq -0x40(%rbp), %rdi
movl -0x30(%rbp), %esi
callq 0x9f60
movq -0x40(%rbp), %rax
movq (%rax), %rax
movl 0x14(%rax), %eax
movq -0x38(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jg 0x21fcb
movq -0x38(%rbp), %rdi
callq 0x93b0
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
movq -0x40(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
movq -0x48(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
movl -0x14(%rbp), %ecx
callq 0xb580
movq %rax, -0x38(%rbp)
movq -0x48(%rbp), %rdi
callq 0x93b0
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x21f24
movq -0x40(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x93b0
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x21f00
movl $0x0, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x21fc6
movq -0x38(%rbp), %rax
movq (%rax), %rdi
movq -0x38(%rbp), %rax
movl 0x8(%rax), %esi
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x8(%rax), %ecx
leaq -0x54(%rbp), %r8
callq 0x24e0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0x2030
movl -0x54(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jle 0x21fb6
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x9380
movq %rax, %rdx
movq -0x40(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x30(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x21fb8
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x21f32
jmp 0x2208e
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x2200f
movl -0x2c(%rbp), %esi
leaq 0x16dd5(%rip), %rdi     # 0x38db9
movb $0x0, %al
callq 0x2100
movq -0x40(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x20(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x99d0
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x21fd2
jmp 0x22011
leaq 0x16daf(%rip), %rdi     # 0x38dc7
movb $0x0, %al
callq 0x2100
leaq 0x16d34(%rip), %rdi     # 0x38d5a
leaq -0x2c(%rbp), %rsi
movb $0x0, %al
callq 0x2220
callq 0x2170
movb $0x1, %al
cmpl $0x0, -0x2c(%rbp)
movb %al, -0x57(%rbp)
jl 0x2204d
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
setge %al
movb %al, -0x57(%rbp)
movb -0x57(%rbp), %al
testb $0x1, %al
jne 0x22011
movq -0x38(%rbp), %rdi
callq 0x93b0
movq -0x40(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rbp)
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
movq -0x40(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x40(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x21dc8
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
cmpl -0x4(%rbp), %eax
jl 0x220b5
movq -0x38(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jg 0x220b5
movq -0x38(%rbp), %rax
movl 0xc(%rax), %eax
cmpl -0x4(%rbp), %eax
jle 0x220e6
movq -0x38(%rbp), %rax
movl 0x10(%rax), %esi
movq -0x38(%rbp), %rax
movl 0xc(%rax), %edx
movq -0x38(%rbp), %rax
movl 0x14(%rax), %ecx
leaq 0x16d13(%rip), %rdi     # 0x38de4
movb $0x0, %al
callq 0x2100
movq -0x38(%rbp), %rdi
callq 0x9970
callq 0x2170
movq -0x38(%rbp), %rax
movl 0xc(%rax), %esi
movq -0x38(%rbp), %rax
movl 0x10(%rax), %edx
movq -0x38(%rbp), %rax
movl 0x14(%rax), %ecx
leaq 0x16d10(%rip), %rdi     # 0x38e12
movb $0x0, %al
callq 0x2100
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x99d0
callq 0x2170
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x22146
movq -0x40(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x93b0
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x22122
movq -0x40(%rbp), %rdi
callq 0x2030
movq -0x38(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)