// File: /workspace/github_c_makefile_star2_O3/cbouilla[P]AES-attacks-finder/EquationAES.c
// Function: ConversionVars
VARS ConversionVars(int v, int Nk, int Tours, int Final, int Messages)
{
	int i,j,state,tmp;
	VARS V;
	state=(Tours+Final+1);
	V.round=v/16;
	V.j=(v-16*V.round)/4;
	V.i=(v-16*V.round)%4;
	V.v=v;
	if (v<16*state)
	{
		V.lettre='K';
		V.message=0;
		return V;
	}
	tmp=v/16;
	for (i = 0; i < Messages; i++)
	{
		for (j = 0; j < Tours; j++)
		{
			if (tmp==state)
			{
				V.lettre='X';
				V.round=j;
				V.message=i;
			}
			state++;
			if (tmp==state)
			{
				V.lettre='W';
				V.round=j;
				V.message=i;
				return V;
			}
			state++;
		}
		for (j = 0; j < Final; j++)
		{
			if (tmp==state)
			{
				V.lettre='X';
				V.round=Tours+j;
				V.message=i;
				return V;
			}
			state++;
			if (tmp==state)
			{
				V.lettre='W';
				V.round=Tours+j;
				V.message=i;
				return V;
			}
		}
		if (tmp==state)
		{
			V.lettre='X';
			V.round=Tours;
			V.message=i;
			return V;
		}
		state++;
		if (tmp==state)
		{
			V.lettre='Z';
			V.round=Tours+Final;
			V.message=i;
			return V;
		}
		state++;
	}
	V.lettre='C';
	V.round=VARIABLES-v;
	V.i=0;
	V.j=0;
	return V;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rax
leal (%r8,%rcx), %r11d
incl %r11d
leal 0xf(%rsi), %edx
testl %esi, %esi
cmovnsl %esi, %edx
movl %edx, %r12d
sarl $0x4, %r12d
movl %r12d, 0xc(%rdi)
andl $-0x10, %edx
movl %esi, %edi
subl %edx, %edi
negl %edx
addl %esi, %edx
addl $0x3, %edx
testl %edi, %edi
cmovnsl %edi, %edx
movl %edx, %r10d
sarl $0x2, %r10d
movl %r10d, 0x14(%rax)
andl $-0x4, %edx
subl %edx, %edi
movl %edi, 0x10(%rax)
movl %esi, (%rax)
movl %r11d, %edx
shll $0x4, %edx
cmpl %esi, %edx
jle 0x6fc6
movb $0x4b, 0x4(%rax)
movl $0x0, 0x8(%rax)
jmp 0x70c2
movl %r9d, %r14d
testl %r9d, %r9d
jle 0x708d
leal (%r8,%rcx), %edx
movl %edx, -0x14(%rsp)
movb 0x4(%rax), %bpl
movl 0x8(%rax), %ebx
leal (%rcx,%rcx), %edx
movq %rdx, -0x8(%rsp)
movl %r8d, %r15d
negl %r15d
xorl %edi, %edi
movl $0x58, %r9d
movl %r12d, %r13d
testl %ecx, %ecx
jle 0x7038
movq -0x8(%rsp), %rdx
leal (%rdx,%r11), %r10d
movl %r12d, %edx
subl %r11d, %edx
xorl %r11d, %r11d
cmpl $0x1, %edx
je 0x70a6
testl %edx, %edx
cmovel %r11d, %r13d
movzbl %bpl, %ebp
cmovel %r9d, %ebp
cmovel %edi, %ebx
incl %r11d
addl $-0x2, %edx
cmpl %r11d, %ecx
jne 0x7010
movl %r10d, %r11d
testl %r8d, %r8d
jle 0x706d
movq %r8, -0x10(%rsp)
movl %r14d, %r8d
movl %r12d, %r14d
subl %r11d, %r14d
xorl %edx, %edx
movl %r14d, %r10d
addl %edx, %r10d
je 0x70b0
cmpl $0x1, %r10d
je 0x70b6
decl %edx
cmpl %edx, %r15d
jne 0x704d
subl %edx, %r11d
movl %r8d, %r14d
movq -0x10(%rsp), %r8
cmpl %r11d, %r12d
je 0x70cd
leal 0x1(%r11), %edx
cmpl %edx, %r12d
je 0x70d3
addl $0x2, %r11d
incl %edi
cmpl %r14d, %edi
jne 0x6ffa
movl %ebx, 0x8(%rax)
movb $0x43, 0x4(%rax)
movl 0x2b221(%rip), %ecx     # 0x322b8
subl %esi, %ecx
movl %ecx, 0xc(%rax)
movq $0x0, 0x10(%rax)
jmp 0x70c2
movb $0x57, 0x4(%rax)
movl %r11d, 0xc(%rax)
jmp 0x70bf
movb $0x58, 0x4(%rax)
jmp 0x70ba
movb $0x57, 0x4(%rax)
subl %edx, %ecx
movl %ecx, 0xc(%rax)
movl %edi, 0x8(%rax)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x58, 0x4(%rax)
jmp 0x70bc
movb $0x5a, 0x4(%rax)
movl -0x14(%rsp), %ecx
movl %ecx, 0xc(%rax)
jmp 0x70bf