// File: /workspace/github_c_makefile_star2_O0/cbouilla[P]AES-attacks-finder/Equation.c
// Function: mulEq
Equation mulEq(unsigned char m, Equation a)
{
	if (m==0) return NulEq();
	Equation p=malloc(sizeof(EQUATION));
	p->nV=a->nV;
	p->nS=a->nS;
	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 < p->nV; i++)
		{
			p->var[i]=a->var[i];
			p->coefV[i]=Multiply(a->coefV[i],m);
		}
	}
	else
	{
		p->var=NULL;
		p->coefV=NULL;
	}
	if (p->nS>0)
	{
		p->S=malloc(p->nS*sizeof(Equation));
		p->sbox=malloc(p->nS*sizeof(unsigned char));
		p->coefS=malloc(p->nS*sizeof(unsigned char));
		int i;
		for (i = 0; i < p->nS; i++)
		{
			p->sbox[i]=a->sbox[i];
			p->coefS[i]=Multiply(a->coefS[i],m);
			p->S[i]=copyEq(a->S[i]);
		}
	}
	else
	{
		p->S=NULL;
		p->coefS=NULL;
		p->sbox=NULL;
	}
	return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %dil, %al
movb %al, -0x9(%rbp)
movq %rsi, -0x18(%rbp)
movzbl -0x9(%rbp), %eax
cmpl $0x0, %eax
jne 0x5ec9
callq 0x5850
movq %rax, -0x8(%rbp)
jmp 0x60f0
movl $0x38, %edi
callq 0x21c0
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movl 0x18(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
jle 0x5fa7
movq -0x20(%rbp), %rax
movslq (%rax), %rdi
shlq $0x2, %rdi
callq 0x21c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movslq (%rax), %rdi
shlq $0x0, %rdi
callq 0x21c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x5fa5
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x24(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
leaq 0x1f093(%rip), %rax     # 0x25010
shlq $0x8, %rcx
addq %rcx, %rax
movzbl -0x9(%rbp), %ecx
movb (%rax,%rcx), %dl
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x24(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x5f3b
jmp 0x5fbf
movq -0x20(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x18(%rax)
jle 0x60c4
movq -0x20(%rbp), %rax
movslq 0x18(%rax), %rdi
shlq $0x3, %rdi
callq 0x21c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x20(%rbp), %rax
movslq 0x18(%rax), %rdi
shlq $0x0, %rdi
callq 0x21c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x20(%rbp), %rax
movslq 0x18(%rax), %rdi
shlq $0x0, %rdi
callq 0x21c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x28(%rax)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x60c2
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x28(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x28(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x28(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
leaq 0x1efa1(%rip), %rax     # 0x25010
shlq $0x8, %rcx
addq %rcx, %rax
movzbl -0x9(%rbp), %ecx
movb (%rax,%rcx), %dl
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x28(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x59c0
movq %rax, %rdx
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x28(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x6028
jmp 0x60e8
movq -0x20(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)