// File: /workspace/github_c_makefile_star2_O0/cbouilla[P]AES-attacks-finder/Algebre.c
// Function: Supplementaire_tmp
int Supplementaire_tmp(unsigned char **dst, unsigned char **mat1, int b1, unsigned char **mat2, int a, int b2)
{
	if (b2==0) return 0;
	if (b1==0)
	{
		int i,j;
		for (i = 0; i < a; i++) for ( j = 0; j < b2; j++) dst[i][j]=mat2[i][j];
		return b2;
	}
	int b=b1+b2,i;
	unsigned char **m=malloc(a*sizeof(unsigned char *));
	for (i = 0; i < a; i++) m[i]=malloc(b*sizeof(unsigned char)); 
	for (i = 0; i < a; i++)
	{
		int j;
		for (j = 0; j < b1; j++) m[i][j]=mat1[i][j];
		for (j = 0; j < b2; j++) m[i][j+b1]=mat2[i][j];	
	}
	for (i = 0; i < min(a,b1); i++)
	{
		int k1;
		for (k1 = i; k1 < b1; k1++)
		{
			int k2;
			for (k2 = i; k2 < a; k2++)
			{
				if (m[k2][k1]!=0)
				{
					if (k2!=i) echangeligne(k2,i,m,a,b);
					if (k1!=i) echangecolonne(k1,i,m,a,b);
					break;
				}
			}
			if (m[i][i]!=0) break;
		}
		unsigned char p=m[i][i];
		if (p==0) break;
		else
		{
			int j;
			for (j = i+1; j < a; j++)
			{
				unsigned char c=m[j][i];
				if (c!=0)
				{
					int k;
					for (k = i; k < b; k++) m[j][k]=Multiply(p,m[j][k])^Multiply(c,m[i][k]);
				}
			}
		}	
	}
	int b3=b2-b1;
	for (i = b1; i < min(a,b); i++)
	{
		int k1;
		for (k1 = i; k1 < b; k1++)
		{
			int k2;
			for (k2 = i; k2 < a; k2++)
			{
				if (m[k2][k1]!=0)
				{
					if (k2!=i) echangeligne(k2,i,m,a,b);
					if (k1!=i)
					{
						echangecolonne(k1,i,m,a,b);
						echangecolonne(k1-b1,i-b1,mat2,a,b2);
					}
					break;
				}
			}
			if (m[i][i]!=0) break;
		}
		unsigned char p=m[i][i];
		if (p==0) break;
		else
		{
			int j;
			for (j = i+1; j < a; j++)
			{
				unsigned char c=m[j][i];
				if (c!=0)
				{
					int k;
					for (k = i; k < b; k++) m[j][k]=Multiply(p,m[j][k])^Multiply(c,m[i][k]);
				}
			}
		}	
	}
	for (i = 0; i < b3; i++)
	{
		int j;
		for (j = 0; j < a; j++) dst[j][i]=mat2[j][i];
	}
	for (i = 0; i < a; i++) free(m[i]);
	free(m);
	return b3;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movl %r9d, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jne 0x43f4
movl $0x0, -0x4(%rbp)
jmp 0x4a20
cmpl $0x0, -0x1c(%rbp)
jne 0x4461
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x4456
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x4449
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x38(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x38(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x4410
jmp 0x444b
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x4401
movl -0x30(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x4a20
movl -0x1c(%rbp), %eax
addl -0x30(%rbp), %eax
movl %eax, -0x3c(%rbp)
movslq -0x2c(%rbp), %rdi
shlq $0x3, %rdi
callq 0x21c0
movq %rax, -0x48(%rbp)
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x44b1
movslq -0x3c(%rbp), %rdi
shlq $0x0, %rdi
callq 0x21c0
movq %rax, %rdx
movq -0x48(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x4482
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x4559
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x4504
movq -0x18(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x4c(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x48(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x4c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x44cb
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x4549
movq -0x28(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x4c(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x48(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x4c(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x450b
jmp 0x454b
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x44b8
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x88(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x457c
movl -0x2c(%rbp), %eax
movl %eax, -0x8c(%rbp)
jmp 0x4585
movl -0x1c(%rbp), %eax
movl %eax, -0x8c(%rbp)
movl -0x88(%rbp), %eax
movl -0x8c(%rbp), %ecx
cmpl %ecx, %eax
jge 0x4753
movl -0x40(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x4648
movl -0x40(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x461d
movq -0x48(%rbp), %rax
movslq -0x54(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x50(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x4610
movl -0x54(%rbp), %eax
cmpl -0x40(%rbp), %eax
je 0x45f0
movl -0x54(%rbp), %edi
movl -0x40(%rbp), %esi
movq -0x48(%rbp), %rdx
movl -0x2c(%rbp), %ecx
movl -0x3c(%rbp), %r8d
callq 0x35a0
movl -0x50(%rbp), %eax
cmpl -0x40(%rbp), %eax
je 0x460e
movl -0x50(%rbp), %edi
movl -0x40(%rbp), %esi
movq -0x48(%rbp), %rdx
movl -0x2c(%rbp), %ecx
movl -0x3c(%rbp), %r8d
callq 0x3600
jmp 0x461d
jmp 0x4612
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x45b1
movq -0x48(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x40(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x4638
jmp 0x4648
jmp 0x463a
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x459f
movq -0x48(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x40(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x55(%rbp)
movzbl -0x55(%rbp), %eax
cmpl $0x0, %eax
jne 0x466c
jmp 0x4753
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x4741
movq -0x48(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x40(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x5d(%rbp)
movzbl -0x5d(%rbp), %eax
cmpl $0x0, %eax
je 0x4731
movl -0x40(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x472f
movzbl -0x55(%rbp), %eax
movl %eax, %ecx
leaq 0x20951(%rip), %rax     # 0x25010
shlq $0x8, %rcx
addq %rcx, %rax
movq -0x48(%rbp), %rcx
movslq -0x5c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x64(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
movzbl (%rax,%rcx), %eax
movzbl -0x5d(%rbp), %ecx
movl %ecx, %edx
leaq 0x20925(%rip), %rcx     # 0x25010
shlq $0x8, %rdx
addq %rdx, %rcx
movq -0x48(%rbp), %rdx
movslq -0x40(%rbp), %rsi
movq (%rdx,%rsi,8), %rdx
movslq -0x64(%rbp), %rsi
movzbl (%rdx,%rsi), %edx
movzbl (%rcx,%rdx), %ecx
xorl %ecx, %eax
movb %al, %dl
movq -0x48(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x64(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x46aa
jmp 0x4731
jmp 0x4733
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x4675
jmp 0x4743
jmp 0x4745
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x4560
movl -0x30(%rbp), %eax
subl -0x1c(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x90(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x477e
movl -0x2c(%rbp), %eax
movl %eax, -0x94(%rbp)
jmp 0x4787
movl -0x3c(%rbp), %eax
movl %eax, -0x94(%rbp)
movl -0x90(%rbp), %eax
movl -0x94(%rbp), %ecx
cmpl %ecx, %eax
jge 0x4978
movl -0x40(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x486d
movl -0x40(%rbp), %eax
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x4842
movq -0x48(%rbp), %rax
movslq -0x70(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x6c(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x4832
movl -0x70(%rbp), %eax
cmpl -0x40(%rbp), %eax
je 0x47f6
movl -0x70(%rbp), %edi
movl -0x40(%rbp), %esi
movq -0x48(%rbp), %rdx
movl -0x2c(%rbp), %ecx
movl -0x3c(%rbp), %r8d
callq 0x35a0
movl -0x6c(%rbp), %eax
cmpl -0x40(%rbp), %eax
je 0x4830
movl -0x6c(%rbp), %edi
movl -0x40(%rbp), %esi
movq -0x48(%rbp), %rdx
movl -0x2c(%rbp), %ecx
movl -0x3c(%rbp), %r8d
callq 0x3600
movl -0x6c(%rbp), %edi
subl -0x1c(%rbp), %edi
movl -0x40(%rbp), %esi
subl -0x1c(%rbp), %esi
movq -0x28(%rbp), %rdx
movl -0x2c(%rbp), %ecx
movl -0x30(%rbp), %r8d
callq 0x3600
jmp 0x4842
jmp 0x4834
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x47b3
movq -0x48(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x40(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x485d
jmp 0x486d
jmp 0x485f
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x47a1
movq -0x48(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x40(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x71(%rbp)
movzbl -0x71(%rbp), %eax
cmpl $0x0, %eax
jne 0x4891
jmp 0x4978
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x4966
movq -0x48(%rbp), %rax
movslq -0x78(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x40(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x79(%rbp)
movzbl -0x79(%rbp), %eax
cmpl $0x0, %eax
je 0x4956
movl -0x40(%rbp), %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x4954
movzbl -0x71(%rbp), %eax
movl %eax, %ecx
leaq 0x2072c(%rip), %rax     # 0x25010
shlq $0x8, %rcx
addq %rcx, %rax
movq -0x48(%rbp), %rcx
movslq -0x78(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x80(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
movzbl (%rax,%rcx), %eax
movzbl -0x79(%rbp), %ecx
movl %ecx, %edx
leaq 0x20700(%rip), %rcx     # 0x25010
shlq $0x8, %rdx
addq %rdx, %rcx
movq -0x48(%rbp), %rdx
movslq -0x40(%rbp), %rsi
movq (%rdx,%rsi,8), %rdx
movslq -0x80(%rbp), %rsi
movzbl (%rdx,%rsi), %edx
movzbl (%rcx,%rdx), %ecx
xorl %ecx, %eax
movb %al, %dl
movq -0x48(%rbp), %rax
movslq -0x78(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x80(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x48cf
jmp 0x4956
jmp 0x4958
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x489a
jmp 0x4968
jmp 0x496a
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x4762
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x68(%rbp), %eax
jge 0x49e6
movl $0x0, -0x84(%rbp)
movl -0x84(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x49d9
movq -0x28(%rbp), %rax
movslq -0x84(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x40(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movslq -0x84(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x40(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x4991
jmp 0x49db
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x497f
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x4a11
movq -0x48(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2030
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x49ed
movq -0x48(%rbp), %rdi
callq 0x2030
movl -0x68(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)