// File: /workspace/github_c_makefile_star2_O0/cbouilla[P]AES-attacks-finder/Equation.c
// Function: addEq
Equation addEq(Equation a, Equation b)
{	
	Equation p=malloc(sizeof(EQUATION));
	p->nV=a->nV+b->nV;
	if (p->nV!=0)
	{
		p->var=malloc(p->nV*sizeof(int));
		p->coefV=malloc(p->nV*sizeof(unsigned char));
		int i;
		for (i = 0; i < a->nV; i++)
		{
			p->var[i]=a->var[i];
			p->coefV[i]=a->coefV[i];
		}
		int k=a->nV;
		for (i = 0; i < b->nV; i++)
		{
			p->var[i+k]=b->var[i];
			p->coefV[i+k]=b->coefV[i];
		}
	}
	else
	{
		p->var=NULL;
		p->coefV=NULL;
	}
	p->nS=a->nS+b->nS;
	if (p->nS!=0)
	{
		p->S=malloc(p->nS*sizeof(Equation));
		p->coefS=malloc(p->nS*sizeof(unsigned char));
		p->sbox=malloc(p->nS*sizeof(unsigned char));
		int i;
		for (i = 0; i < a->nS; i++)
		{
			p->sbox[i]=a->sbox[i];
			p->coefS[i]=a->coefS[i];
			p->S[i]=copyEq(a->S[i]);
		}
		int k=a->nS;
		for (i = 0; i < b->nS; i++)
		{
			p->sbox[i+k]=b->sbox[i];
			p->coefS[i+k]=b->coefS[i];
			p->S[i+k]=copyEq(b->S[i]);
		}
	}
	else
	{
		p->S=NULL;
		p->coefS=NULL;
		p->sbox=NULL;
	}
	Equation pp=reduitEq(p);
	freeEq(p);
	return pp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x38, %edi
callq 0x21c0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
addl (%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6a3a
movq -0x18(%rbp), %rax
movslq (%rax), %rdi
shlq $0x2, %rdi
callq 0x21c0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movslq (%rax), %rdi
shlq $0x0, %rdi
callq 0x21c0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x69cc
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x697a
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x6a38
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x1c(%rbp), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1c(%rbp), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x69dc
jmp 0x6a52
movq -0x18(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %ecx
movq -0x10(%rbp), %rax
addl 0x18(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x6bef
movq -0x18(%rbp), %rax
movslq 0x18(%rax), %rdi
shlq $0x3, %rdi
callq 0x21c0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
movslq 0x18(%rax), %rdi
shlq $0x0, %rdi
callq 0x21c0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x18(%rbp), %rax
movslq 0x18(%rax), %rdi
shlq $0x0, %rdi
callq 0x21c0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x6b4b
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x24(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x24(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x24(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x24(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x59c0
movq %rax, %rdx
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x24(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x6ad0
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x28(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x6bed
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x24(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x24(%rbp), %ecx
addl -0x28(%rbp), %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x24(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x24(%rbp), %ecx
addl -0x28(%rbp), %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x59c0
movq %rax, %rdx
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x24(%rbp), %ecx
addl -0x28(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x6b5c
jmp 0x6c13
movq -0x18(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x18(%rbp), %rdi
callq 0x6100
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x5900
movq -0x30(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)