// File: /workspace/github_c_makefile_star2_O0/cbouilla[P]AES-attacks-finder/Algo.c
// Function: EcrireEq
void EcrireEq(FILE *out, Equation a) // Ecrit une équation en C dans un fichier
{
	/* On pourrait peut-être factoriser ? */
	
	if (a==NULL || EstNulEq(a))
	{
		fprintf(out,"0");
	}
	else
	{
		int i;
		for (i = 0; i < a->nV; i++)
		{
			if (i!=0) fprintf(out," ^ ");
			if (a->coefV[i] != 0x01) fprintf(out,"Multiply(0x%02x,",a->coefV[i]);
			fprintf(out,"x%u",a->var[i]);
			if (a->coefV[i]!=0x01) fprintf(out,")");
		}
		if (a->nV!=0 && a->nS!=0) fprintf(out," ^ ");
		for (i = 0; i < a->nS; i++)
		{
			if (i!=0) fprintf(out," ^ ");
			if (a->coefS[i]!=0x01) fprintf(out,"Multiply(0x%02x,",a->coefS[i]);
			if (a->sbox[i]) fprintf(out,"R(");
			else fprintf(out,"S(");
			EcrireEq(out,a->S[i]);
			fprintf(out,")");
			if (a->coefS[i]!=0x01) fprintf(out,")");
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x16385
movq -0x10(%rbp), %rdi
callq 0x58d0
cmpl $0x0, %eax
je 0x1639c
movq -0x8(%rbp), %rdi
leaq 0x20391(%rip), %rsi     # 0x36721
movb $0x0, %al
callq 0x2180
jmp 0x16580
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x16459
cmpl $0x0, -0x14(%rbp)
je 0x163ca
movq -0x8(%rbp), %rdi
leaq 0x20088(%rip), %rsi     # 0x3644b
movb $0x0, %al
callq 0x2180
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x1, %eax
je 0x16401
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movzbl (%rax,%rcx), %edx
leaq 0x20055(%rip), %rsi     # 0x3644f
movb $0x0, %al
callq 0x2180
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %edx
leaq 0x20045(%rip), %rsi     # 0x36460
movb $0x0, %al
callq 0x2180
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x1, %eax
je 0x16449
movq -0x8(%rbp), %rdi
leaq 0x20007(%rip), %rsi     # 0x36449
movb $0x0, %al
callq 0x2180
jmp 0x1644b
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x163a3
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x1647e
movq -0x10(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x1647e
movq -0x8(%rbp), %rdi
leaq 0x1ffd4(%rip), %rsi     # 0x3644b
movb $0x0, %al
callq 0x2180
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x1657e
cmpl $0x0, -0x14(%rbp)
je 0x164ad
movq -0x8(%rbp), %rdi
leaq 0x1ffa5(%rip), %rsi     # 0x3644b
movb $0x0, %al
callq 0x2180
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x14(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x1, %eax
je 0x164e4
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x14(%rbp), %rcx
movzbl (%rax,%rcx), %edx
leaq 0x1ff72(%rip), %rsi     # 0x3644f
movb $0x0, %al
callq 0x2180
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x14(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x1650a
movq -0x8(%rbp), %rdi
leaq 0x1ec27(%rip), %rsi     # 0x35128
movb $0x0, %al
callq 0x2180
jmp 0x1651c
movq -0x8(%rbp), %rdi
leaq 0x1ec16(%rip), %rsi     # 0x3512b
movb $0x0, %al
callq 0x2180
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x16360
movq -0x8(%rbp), %rdi
leaq 0x1ff09(%rip), %rsi     # 0x36449
movb $0x0, %al
callq 0x2180
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x14(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x1, %eax
je 0x1656e
movq -0x8(%rbp), %rdi
leaq 0x1fee2(%rip), %rsi     # 0x36449
movb $0x0, %al
callq 0x2180
jmp 0x16570
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x16485
jmp 0x16580
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)