// File: /workspace/github_c_makefile_star2_O1/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), %edx
incl %edx
leal 0xf(%rsi), %edi
testl %esi, %esi
cmovnsl %esi, %edi
movl %edi, %r13d
sarl $0x4, %r13d
movl %r13d, 0xc(%rax)
andl $-0x10, %edi
movl %esi, %r11d
subl %edi, %r11d
negl %edi
addl %esi, %edi
addl $0x3, %edi
testl %r11d, %r11d
cmovnsl %r11d, %edi
movl %edi, %r10d
sarl $0x2, %r10d
movl %r10d, 0x14(%rax)
andl $-0x4, %edi
subl %edi, %r11d
movl %r11d, 0x10(%rax)
movl %esi, (%rax)
movl %edx, %edi
shll $0x4, %edi
cmpl %esi, %edi
jle 0x6bf8
movb $0x4b, 0x4(%rax)
movl $0x0, 0x8(%rax)
jmp 0x6cf1
movl 0xc(%rax), %r10d
testl %r9d, %r9d
jle 0x6cb7
movl %r9d, -0xc(%rsp)
leal (%r8,%rcx), %edi
movl %edi, -0x14(%rsp)
movb 0x4(%rax), %r14b
movl 0x8(%rax), %ebp
leal (%rcx,%rcx), %edi
movq %rdi, -0x8(%rsp)
movl %r8d, %r12d
negl %r12d
xorl %r11d, %r11d
movl $0x58, %r9d
testl %ecx, %ecx
jle 0x6c73
movq -0x8(%rsp), %rdi
addl %edx, %edi
movl %edi, -0x10(%rsp)
movl %r13d, %edi
subl %edx, %edi
xorl %r15d, %r15d
testl %edi, %edi
cmovel %r11d, %ebp
movzbl %r14b, %r14d
cmovel %r9d, %r14d
cmovel %r15d, %r10d
leal 0x1(%rdx), %ebx
cmpl %ebx, %r13d
je 0x6cd4
addl $0x2, %edx
incl %r15d
addl $-0x2, %edi
cmpl %r15d, %ecx
jne 0x6c47
movl -0x10(%rsp), %edx
testl %r8d, %r8d
jle 0x6c96
movl %r13d, %ebx
subl %edx, %ebx
xorl %edi, %edi
movl %ebx, %r15d
addl %edi, %r15d
je 0x6cde
cmpl $0x1, %r15d
je 0x6ce4
decl %edi
cmpl %edi, %r12d
jne 0x6c7f
subl %edi, %edx
cmpl %edx, %r13d
je 0x6cfc
leal 0x1(%rdx), %edi
cmpl %edi, %r13d
je 0x6d02
addl $0x2, %edx
incl %r11d
cmpl -0xc(%rsp), %r11d
jne 0x6c30
movb %r14b, 0x4(%rax)
movl %ebp, 0x8(%rax)
movl %r10d, 0xc(%rax)
movb $0x43, 0x4(%rax)
movl 0x2b5f3(%rip), %ecx     # 0x322b8
subl %esi, %ecx
movl %ecx, 0xc(%rax)
movq $0x0, 0x10(%rax)
jmp 0x6cf1
movb $0x57, 0x4(%rax)
movl %r15d, 0xc(%rax)
jmp 0x6ced
movb $0x58, 0x4(%rax)
jmp 0x6ce8
movb $0x57, 0x4(%rax)
subl %edi, %ecx
movl %ecx, 0xc(%rax)
movl %r11d, 0x8(%rax)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x58, 0x4(%rax)
jmp 0x6cea
movb $0x5a, 0x4(%rax)
movl -0x14(%rsp), %ecx
movl %ecx, 0xc(%rax)
jmp 0x6ced