// File: /workspace/github_c_makefile_star2_O3/cbouilla[P]AES-attacks-finder/SysEqLin.c
// Function: ExtraireEX2Special
SysEqLin ExtraireEX2Special(int *var, int N, SysEqLin E) // Calcul E(X) mais supprime les equations entre les variables connues.
{
	SysEqLin F=malloc(sizeof(SYSEQLIN));
	F->mat=malloc(E->gen*VARIABLES*sizeof(unsigned char *));
	int i;
	for (i = 0; i < E->gen*VARIABLES; i++) F->mat[i]=malloc(E->b*sizeof(unsigned char));
	F->b=ExtraireEX(F->mat,var,N,E);
	F->gen=E->gen;
	F->lignevar=malloc(VARIABLES*sizeof(int));
	F->varligne=malloc(VARIABLES*sizeof(int));
	for (i = 0; i < VARIABLES; i++) F->lignevar[i]=E->lignevar[i];
	for (i = 0; i < VARIABLES; i++) F->varligne[i]=E->varligne[i];
	for (i = 0; i < N; i++) PermuterVar(var[i],F->varligne[i],F);
	F->a=N*E->gen;
	unsigned char **m=malloc(E->gen*VARIABLES*sizeof(unsigned char *));
	for (i = 0; i < E->gen*VARIABLES; i++) m[i]=malloc(F->b*sizeof(unsigned char));
	F->b=BaseSpeciale(m,F->mat,E->gen*VARIABLES,F->b,F->a);
	for (i = 0; i < E->gen*VARIABLES; i++) free(F->mat[i]);
	free(F->mat);
	F->mat=m;
	F->initialise=0;
	return F;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movl %esi, %r12d
movq %rdi, 0x18(%rsp)
movl $0x40, %edi
callq 0x21d0
movq %rax, %rbx
movq %r14, 0x10(%rsp)
movslq 0x10(%r14), %rbp
leaq 0x261ff(%rip), %rax     # 0x322b8
movslq (%rax), %r14
imulq %r14, %rbp
movq %rbp, %rdi
shlq $0x3, %rdi
callq 0x21d0
movq %rax, %r15
movq %rbx, 0x28(%rsp)
movq %rax, (%rbx)
testl %ebp, %ebp
jle 0xc0fc
movq 0x10(%rsp), %rax
movslq 0xc(%rax), %r13
movl %ebp, %ebx
xorl %ebp, %ebp
movq %r13, %rdi
callq 0x21d0
movq %rax, (%r15,%rbp,8)
incq %rbp
cmpq %rbp, %rbx
jne 0xc0e8
movq %r15, %rdi
movq 0x18(%rsp), %rsi
movl %r12d, 0xc(%rsp)
movl %r12d, %edx
movq 0x10(%rsp), %r12
movq %r12, %rcx
callq 0xb7c5
movq 0x28(%rsp), %rbx
movl %eax, 0x24(%rsp)
movl %eax, 0xc(%rbx)
movl 0x10(%r12), %r12d
movl %r12d, 0x10(%rbx)
leaq (,%r14,4), %r13
movq %r13, %rdi
callq 0x21d0
movq %rax, %rbp
movq %rax, 0x18(%rbx)
movq %r13, %rdi
callq 0x21d0
movq %rax, %r13
movq %rax, 0x20(%rbx)
testl %r14d, %r14d
jle 0xc193
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
xorl %ecx, %ecx
movl (%rax,%rcx,4), %edx
movl %edx, (%rbp,%rcx,4)
incq %rcx
cmpq %rcx, %r14
jne 0xc164
testl %r14d, %r14d
jle 0xc193
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rax
xorl %ecx, %ecx
movl (%rax,%rcx,4), %edx
movl %edx, (%r13,%rcx,4)
incq %rcx
cmpq %rcx, %r14
jne 0xc183
movl 0xc(%rsp), %ecx
testl %ecx, %ecx
jle 0xc1d9
movq %r15, 0x30(%rsp)
movl %ecx, %ebp
xorl %ebx, %ebx
movq 0x28(%rsp), %r12
movq 0x18(%rsp), %r15
movl (%r15,%rbx,4), %edi
movl (%r13,%rbx,4), %esi
movq %r12, %rdx
callq 0xb3f1
incq %rbx
cmpq %rbx, %rbp
jne 0xc1ae
movq 0x10(%rsp), %rax
movl 0x10(%rax), %r12d
movl 0xc(%rsp), %ecx
movq 0x30(%rsp), %r15
imull %r12d, %ecx
movq 0x28(%rsp), %rax
movl %ecx, 0xc(%rsp)
movl %ecx, 0x8(%rax)
movl %r14d, %eax
imull %r12d, %eax
movl %eax, 0x18(%rsp)
movslq %eax, %rbx
leaq (,%rbx,8), %rdi
callq 0x21d0
movq %rax, %r12
testl %ebx, %ebx
jle 0xc22b
movslq 0x24(%rsp), %rbp
movl 0x18(%rsp), %ebx
xorl %r13d, %r13d
movq %rbp, %rdi
callq 0x21d0
movq %rax, (%r12,%r13,8)
incq %r13
cmpq %r13, %rbx
jne 0xc217
movq %r12, %rdi
movq %r15, %rsi
movl 0x18(%rsp), %edx
movl 0x24(%rsp), %ecx
movl 0xc(%rsp), %r8d
callq 0x3796
movq 0x28(%rsp), %r13
movl %eax, 0xc(%r13)
movq 0x10(%rsp), %rbp
movl 0x10(%rbp), %eax
imull %r14d, %eax
testl %eax, %eax
jle 0xc277
xorl %ebx, %ebx
movq (%r15,%rbx,8), %rdi
callq 0x2030
incq %rbx
movslq 0x10(%rbp), %rax
imulq %r14, %rax
cmpq %rax, %rbx
jl 0xc25e
movq %r15, %rdi
callq 0x2030
movq %r12, (%r13)
movb $0x0, 0x28(%r13)
movq %r13, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq