// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
movq %rdi, -0x38(%rbp)
movq %rdi, %rax
movq %rax, -0x30(%rbp)
movl %esi, -0x4(%rbp)
movl %edx, -0x8(%rbp)
movl %ecx, -0xc(%rbp)
movl %r8d, -0x10(%rbp)
movl %r9d, -0x14(%rbp)
movl -0xc(%rbp), %eax
addl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x4(%rbp), %eax
movl $0x10, %ecx
cltd
idivl %ecx
movl %eax, 0xc(%rdi)
movl -0x4(%rbp), %eax
movl 0xc(%rdi), %ecx
shll $0x4, %ecx
subl %ecx, %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %eax, 0x14(%rdi)
movl -0x4(%rbp), %eax
movl 0xc(%rdi), %ecx
shll $0x4, %ecx
subl %ecx, %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %edx, 0x10(%rdi)
movl -0x4(%rbp), %eax
movl %eax, (%rdi)
movl -0x4(%rbp), %eax
movl -0x20(%rbp), %ecx
shll $0x4, %ecx
cmpl %ecx, %eax
jge 0x8ddc
movq -0x38(%rbp), %rax
movb $0x4b, 0x4(%rax)
movl $0x0, 0x8(%rax)
jmp 0x8f54
movl -0x4(%rbp), %eax
movl $0x10, %ecx
cltd
idivl %ecx
movl %eax, -0x24(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x8f32
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x8e66
movl -0x24(%rbp), %eax
cmpl -0x20(%rbp), %eax
jne 0x8e28
movq -0x38(%rbp), %rax
movb $0x58, 0x4(%rax)
movl -0x1c(%rbp), %ecx
movl %ecx, 0xc(%rax)
movl -0x18(%rbp), %ecx
movl %ecx, 0x8(%rax)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x20(%rbp), %eax
jne 0x8e52
movq -0x38(%rbp), %rax
movb $0x57, 0x4(%rax)
movl -0x1c(%rbp), %ecx
movl %ecx, 0xc(%rax)
movl -0x18(%rbp), %ecx
movl %ecx, 0x8(%rax)
jmp 0x8f54
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x8e04
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x8ed3
movl -0x24(%rbp), %eax
cmpl -0x20(%rbp), %eax
jne 0x8e99
movq -0x38(%rbp), %rax
movb $0x58, 0x4(%rax)
movl -0xc(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movl %ecx, 0xc(%rax)
movl -0x18(%rbp), %ecx
movl %ecx, 0x8(%rax)
jmp 0x8f54
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x20(%rbp), %eax
jne 0x8ec6
movq -0x38(%rbp), %rax
movb $0x57, 0x4(%rax)
movl -0xc(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movl %ecx, 0xc(%rax)
movl -0x18(%rbp), %ecx
movl %ecx, 0x8(%rax)
jmp 0x8f54
jmp 0x8ec8
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x8e6d
movl -0x24(%rbp), %eax
cmpl -0x20(%rbp), %eax
jne 0x8ef1
movq -0x38(%rbp), %rax
movb $0x58, 0x4(%rax)
movl -0xc(%rbp), %ecx
movl %ecx, 0xc(%rax)
movl -0x18(%rbp), %ecx
movl %ecx, 0x8(%rax)
jmp 0x8f54
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x20(%rbp), %eax
jne 0x8f1b
movq -0x38(%rbp), %rax
movb $0x5a, 0x4(%rax)
movl -0xc(%rbp), %ecx
addl -0x10(%rbp), %ecx
movl %ecx, 0xc(%rax)
movl -0x18(%rbp), %ecx
movl %ecx, 0x8(%rax)
jmp 0x8f54
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x8df1
movq -0x38(%rbp), %rax
movb $0x43, 0x4(%rax)
movl 0x34388(%rip), %ecx     # 0x3d2c8
subl -0x4(%rbp), %ecx
movl %ecx, 0xc(%rax)
movl $0x0, 0x10(%rax)
movl $0x0, 0x14(%rax)
movq -0x30(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)