// File: /workspace/github_c_makefile_star2_O0/cbouilla[P]AES-attacks-finder/SysEqLin.c
// Function: EsachantX
SysEqLin EsachantX(int *var, int N, SysEqLin E) // Calcul E|_X (les variables X sont maintenant supposées connues
{
	SysEqLin F=malloc(sizeof(SYSEQLIN));
	F->a=E->a;
	F->b=E->b;
	F->gen=E->gen;
	F->mat=malloc(E->gen*VARIABLES*sizeof(unsigned char *));
	int i;
	for (i = 0; i < E->gen*VARIABLES; i++)
	{
		F->mat[i]=malloc(F->b*sizeof(unsigned char));
		int j;
		for (j = 0; j < F->b; j++) F->mat[i][j]=E->mat[i][j];		
	}
	F->varligne=malloc(VARIABLES*sizeof(int));
	F->lignevar=malloc(VARIABLES*sizeof(int));
	
	for (i = 0; i < VARIABLES; i++) F->varligne[i]=E->varligne[i];
	for (i = 0; i < VARIABLES; i++) F->lignevar[i]=E->lignevar[i];
	for (i = 0; i < N; i++)
	{
		if (F->gen*F->lignevar[var[i]]<F->a)
		{
			F->a=F->a-F->gen;
			int l;
			for (l = 0; l < F->gen; l++) echangeligne(F->gen*F->lignevar[var[i]]+l,F->a+l,F->mat,F->gen*VARIABLES,F->b);
			int j=F->varligne[F->a/F->gen];
			int k=F->lignevar[var[i]];
			F->lignevar[var[i]]=F->lignevar[j];
			F->lignevar[j]=k;
			F->varligne[F->a/F->gen]=var[i];
			F->varligne[k]=j;
		}
	}
	F->initialise=0;
	return F;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x40, %edi
callq 0x21c0
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x18(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
leaq 0x2b7cf(%rip), %rcx     # 0x3d2c8
imull (%rcx), %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x21c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x18(%rbp), %rcx
movl 0x10(%rcx), %ecx
leaq 0x2b79e(%rip), %rdx     # 0x3d2c8
imull (%rdx), %ecx
cmpl %ecx, %eax
jge 0x11bae
movq -0x20(%rbp), %rax
movslq 0xc(%rax), %rdi
shlq $0x0, %rdi
callq 0x21c0
movq %rax, %rdx
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0x24(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x11b9e
movq -0x18(%rbp), %rax
movq (%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x11b5b
jmp 0x11ba0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x11b19
leaq 0x2b713(%rip), %rax     # 0x3d2c8
movslq (%rax), %rdi
shlq $0x2, %rdi
callq 0x21c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x20(%rax)
leaq 0x2b6f5(%rip), %rax     # 0x3d2c8
movslq (%rax), %rdi
shlq $0x2, %rdi
callq 0x21c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
leaq 0x2b6cd(%rip), %rcx     # 0x3d2c8
cmpl (%rcx), %eax
jge 0x11c28
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x24(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x24(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x11bf1
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
leaq 0x2b68f(%rip), %rcx     # 0x3d2c8
cmpl (%rcx), %eax
jge 0x11c66
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x24(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x24(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x11c2f
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x11dff
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x20(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x8(%rbp), %rdx
movslq -0x24(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
imull (%rcx,%rdx,4), %eax
movq -0x20(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x11def
movq -0x20(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x20(%rbp), %rax
subl 0x10(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x8(%rax)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x11d29
movq -0x20(%rbp), %rax
movl 0x10(%rax), %edi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rcx
movslq -0x24(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
imull (%rax,%rcx,4), %edi
addl -0x2c(%rbp), %edi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %esi
addl -0x2c(%rbp), %esi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
movq -0x20(%rbp), %rax
movl 0x10(%rax), %ecx
leaq 0x2b5ba(%rip), %rax     # 0x3d2c8
imull (%rax), %ecx
movq -0x20(%rbp), %rax
movl 0xc(%rax), %r8d
callq 0x35a0
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x11cc1
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x20(%rbp), %rcx
cltd
idivl 0x10(%rcx)
movl %eax, %ecx
movq -0x50(%rbp), %rax
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rcx
movslq -0x24(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rcx
movslq -0x24(%rbp), %rsi
movslq (%rcx,%rsi,4), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x34(%rbp), %edx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x30(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x44(%rbp)
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x20(%rbp), %rcx
cltd
idivl 0x10(%rcx)
movl -0x44(%rbp), %edx
movl %eax, %ecx
movq -0x40(%rbp), %rax
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x30(%rbp), %edx
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x34(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x11df1
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x11c6d
movq -0x20(%rbp), %rax
movb $0x0, 0x28(%rax)
movq -0x20(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)