// File: /workspace/github_c_makefile_star2_O2/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 $0x28, %rsp
movq %rdx, %rbx
movl %esi, 0x4(%rsp)
movq %rdi, %r12
pushq $0x40
popq %rdi
callq 0x21c0
movq %rax, %r14
movslq 0x10(%rbx), %rbp
leaq 0x25466(%rip), %rax     # 0x302b8
movslq (%rax), %rax
movq %rax, 0x18(%rsp)
imulq %rax, %rbp
movq %rbp, %rdi
shlq $0x3, %rdi
callq 0x21c0
movq %rax, %r15
movq %r14, 0x8(%rsp)
movq %rax, (%r14)
xorl %r14d, %r14d
testl %ebp, %ebp
movl $0x0, %r13d
cmovgl %ebp, %r13d
cmpq %r14, %r13
je 0xae9b
movslq 0xc(%rbx), %rdi
callq 0x21c0
movq %rax, (%r15,%r14,8)
incq %r14
jmp 0xae84
movq %r15, %rdi
movq %r12, %rsi
movl 0x4(%rsp), %edx
movq %rbx, %rcx
callq 0xa644
movq 0x8(%rsp), %r14
movl %eax, 0x14(%rsp)
movl %eax, 0xc(%r14)
movl 0x10(%rbx), %eax
movl %eax, 0x10(%r14)
movq 0x18(%rsp), %rax
leaq (,%rax,4), %r13
movq %r13, %rdi
callq 0x21c0
movq %rax, %rbp
movq %rax, 0x18(%r14)
movq %r13, %rdi
callq 0x21c0
movq %rax, %r13
movq %rax, 0x20(%r14)
xorl %ecx, %ecx
movq 0x18(%rsp), %rdx
testl %edx, %edx
movl $0x0, %eax
cmovgl %edx, %eax
cmpq %rcx, %rax
je 0xaf12
movq 0x18(%rbx), %rdx
movl (%rdx,%rcx,4), %edx
movl %edx, (%rbp,%rcx,4)
incq %rcx
jmp 0xaefd
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0xaf2a
movq 0x20(%rbx), %rdx
movl (%rdx,%rcx,4), %edx
movl %edx, (%r13,%rcx,4)
incq %rcx
jmp 0xaf14
xorl %ebp, %ebp
movl 0x4(%rsp), %eax
testl %eax, %eax
movl $0x0, %r14d
cmovgl %eax, %r14d
cmpq %rbp, %r14
je 0xaf59
movl (%r12,%rbp,4), %edi
movl (%r13,%rbp,4), %esi
movq 0x8(%rsp), %rdx
callq 0xa35c
incq %rbp
jmp 0xaf3c
movslq 0x10(%rbx), %rdx
movl 0x4(%rsp), %ecx
imull %edx, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x4(%rsp)
movl %ecx, 0x8(%rax)
imulq 0x18(%rsp), %rdx
movq %rdx, %rdi
movq %rdx, %r13
shlq $0x3, %rdi
callq 0x21c0
movq %rax, %r12
movslq 0x14(%rsp), %rbp
xorl %r14d, %r14d
movq %r13, %rax
testl %eax, %eax
movl $0x0, %r13d
movq %rax, 0x20(%rsp)
cmovgl %eax, %r13d
cmpq %r14, %r13
je 0xafba
movq %rbp, %rdi
callq 0x21c0
movq %rax, (%r12,%r14,8)
incq %r14
jmp 0xafa4
movq %r12, %rdi
movq %r15, %rsi
movq 0x20(%rsp), %rdx
movl 0x14(%rsp), %ecx
movl 0x4(%rsp), %r8d
callq 0x3103
movq 0x8(%rsp), %rcx
movl %eax, 0xc(%rcx)
xorl %r14d, %r14d
movq 0x18(%rsp), %r13
movslq 0x10(%rbx), %rax
imulq %r13, %rax
cmpq %rax, %r14
jge 0xaffe
movq (%r15,%r14,8), %rdi
callq 0x2030
incq %r14
jmp 0xafe3
movq %r15, %rdi
callq 0x2030
movq 0x8(%rsp), %rax
movq %r12, (%rax)
movb $0x0, 0x28(%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq