// File: /workspace/github_c_makefile_star2_O2/cbouilla[P]AES-attacks-finder/SysEqLin.c
// Function: PrintSysEqLinManual
void PrintSysEqLinManual(SysEqLin E)
{
	int * __restrict X = malloc(E->a/E->gen*sizeof(int));
	int N;
	int choix;
	SysEqLin F;
	while (1)
	{
		printf("Système d'équations : \n");
		printf("	- Variables :");
		int i;
		for (i = 0; i < E->a/E->gen; i++) printf("%d ",E->varligne[i]);
		printf("\n\n");
		printf("Actions :\n");
		printf("	- Printr le système d'équations : 1\n");
		printf("	- Supposer des variables connues : 2\n");
		printf("	- Extraire un sous-système : 3\n");
		printf("	- Exit : 0\n");
		do
		{
			printf("\r Votre choix : ");
			scanf(" %d",&choix);
			getchar();
		} while (choix<0 || choix>3);
		switch (choix)
		{
			case 1: 
				PrintMat(E->mat,E->a,E->b);
				printf("\n Appuyez sur une touche pour continuer ...");
				getchar();
				break;
			case 2:
				N=0;
				while (1)
				{
					printf("\rNouvelle variable connue (0 pour stop) : ");
					scanf(" %d",X+N);
					getchar();
					if (X[N])
					{
						if (E->lignevar[X[N]]>=E->a/E->gen) printf("Impossible!!");
						else N++;
					}
					else break;
				}
				F = EsachantX(X,N,E);
				PrintSysEqLinManual(F);
				freeSysEq(F);
				break;	
			case 3:
				N=0;
				while (1)
				{
					printf("\rNouvelle variable (0 pour stop) : ");
					scanf(" %d",X+N);
					getchar();
					if (X[N])
					{
						if (E->lignevar[X[N]]>=E->a/E->gen) printf("Impossible!!");
						else N++;
					}
					else break;
				}
				F = ExtraireEX2(X,N,E);
				PrintSysEqLinManual(F);
				freeSysEq(F);
				break;	
			default:
				goto fin;
				break;	
		}
	}
	fin :
	free(X);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl 0x8(%rdi), %eax
cltd
idivl 0x10(%rdi)
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x21c0
movq %rax, 0x8(%rsp)
leaq 0x1f934(%rip), %r13     # 0x2af53
leaq 0x1bd39(%rip), %rbp     # 0x2735f
leaq 0x1f56f(%rip), %r15     # 0x2ab9c
leaq 0x14(%rsp), %r12
leaq 0x1bdbf(%rip), %rdi     # 0x273f8
callq 0x2090
leaq 0x1bd0b(%rip), %rdi     # 0x27350
xorl %eax, %eax
callq 0x2110
xorl %r14d, %r14d
movl 0x8(%rbx), %eax
cltd
idivl 0x10(%rbx)
cltq
cmpq %rax, %r14
jge 0xb674
movq 0x20(%rbx), %rax
movl (%rax,%r14,4), %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x2110
incq %r14
jmp 0xb64f
leaq 0x1d662(%rip), %rdi     # 0x28cdd
callq 0x2090
leaq 0x1bd8a(%rip), %rdi     # 0x27411
callq 0x2090
leaq 0x1bd88(%rip), %rdi     # 0x2741b
callq 0x2090
leaq 0x1bda3(%rip), %rdi     # 0x27442
callq 0x2090
leaq 0x1bdbd(%rip), %rdi     # 0x27468
callq 0x2090
leaq 0x1bdd2(%rip), %rdi     # 0x27489
callq 0x2090
movq %rbp, %rdi
xorl %eax, %eax
callq 0x2110
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x2220
callq 0x2170
movl 0x14(%rsp), %eax
cmpl $0x3, %eax
ja 0xb6bc
movl %eax, %eax
leaq 0x1bc2e(%rip), %rcx     # 0x27318
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rbx), %rdi
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
callq 0x2b97
leaq 0x1bc68(%rip), %rdi     # 0x27370
xorl %eax, %eax
callq 0x2110
callq 0x2170
jmp 0xb632
xorl %eax, %eax
movl %eax, 0x4(%rsp)
movl %eax, %eax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,4), %r14
leaq 0x1bc6b(%rip), %rdi     # 0x2739c
xorl %eax, %eax
callq 0x2110
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x2220
callq 0x2170
movslq (%r14), %rax
testq %rax, %rax
je 0xb77c
movq 0x18(%rbx), %rcx
movl (%rcx,%rax,4), %ecx
movl 0x8(%rbx), %eax
cltd
idivl 0x10(%rbx)
cmpl %eax, %ecx
jl 0xb774
leaq 0x1bc5c(%rip), %rdi     # 0x273c7
xorl %eax, %eax
callq 0x2110
jmp 0xb72a
movl 0x4(%rsp), %eax
incl %eax
jmp 0xb71b
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %esi
movq %rbx, %rdx
callq 0xb021
jmp 0xb803
xorl %eax, %eax
movl %eax, 0x4(%rsp)
movl %eax, %eax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,4), %r14
leaq 0x1bc2d(%rip), %rdi     # 0x273d4
xorl %eax, %eax
callq 0x2110
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x2220
callq 0x2170
movslq (%r14), %rax
testq %rax, %rax
je 0xb7f2
movq 0x18(%rbx), %rcx
movl (%rcx,%rax,4), %ecx
movl 0x8(%rbx), %eax
cltd
idivl 0x10(%rbx)
cmpl %eax, %ecx
jl 0xb7ea
leaq 0x1bbe6(%rip), %rdi     # 0x273c7
xorl %eax, %eax
callq 0x2110
jmp 0xb7a0
movl 0x4(%rsp), %eax
incl %eax
jmp 0xb791
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %esi
movq %rbx, %rdx
callq 0xace0
movq %rax, %r14
movq %rax, %rdi
callq 0xb5ef
movq %r14, %rdi
callq 0xb562
jmp 0xb632
movq 0x8(%rsp), %rdi
callq 0x2030
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq