#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int EXIT_SUCCESS;
int letra_para_numero(char);
int /*<<< orphan*/ passeio_do_cavalo(int **, char *, int, int, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(int argc, char **argv) {
  int tabuleiro[8][8] = {0};
  char passeio[(8 * 8) * 2];
  int p = 1, c = 0;
  char inicio[3];
  printf("Use a notação usual de cordenadas do tabuleiro de xadrez.\n");
  printf("Entre com a coordenada de início: ");
  scanf("%s", inicio);
  int x = 8 - (inicio[1] - '0');
  int y = letra_para_numero(inicio[0]);
  passeio_do_cavalo(tabuleiro, passeio, x, y, p, c);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1060 <memset@plt>
movl   $0x1,-0x194(%rbp)
movl   $0x0,-0x198(%rbp)
lea    0xe69(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
lea    -0x19b(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1070 <scanf@plt>
movsbl -0x19a(%rbp),%ecx
sub    $0x30,%ecx
mov    $0x8,%eax
sub    %ecx,%eax
mov    %eax,-0x1a0(%rbp)
movsbl -0x19b(%rbp),%edi
call   1030 <letra_para_numero@plt>
mov    %eax,-0x1a4(%rbp)
lea    -0x110(%rbp),%rdi
lea    -0x190(%rbp),%rsi
mov    -0x1a0(%rbp),%edx
mov    -0x1a4(%rbp),%ecx
mov    -0x194(%rbp),%r8d
mov    -0x198(%rbp),%r9d
call   1050 <passeio_do_cavalo@plt>
mov    0x2dc8(%rip),%rax
mov    (%rax),%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x190,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
lea    0xe5a(%rip),%rdi
call   1030 <puts@plt>
lea    0xe27(%rip),%rdi
call   1050 <printf@plt>
lea    0xe3f(%rip),%rdi
lea    0xd(%rsp),%rsi
call   1070 <scanf@plt>
movsbl 0xe(%rsp),%eax
mov    $0x38,%ebx
sub    %eax,%ebx
movsbl 0xd(%rsp),%edi
call   1040 <letra_para_numero@plt>
lea    0x10(%rsp),%rdi
lea    0x110(%rsp),%rsi
mov    %ebx,%edx
mov    %eax,%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
call   1060 <passeio_do_cavalo@plt>
mov    0x2db5(%rip),%rax
mov    (%rax),%eax
add    $0x190,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [61 x i8] c"Use a nota\C3\A7\C3\A3o usual de cordenadas do tabuleiro de xadrez.\0A\00"
@.str.1 = [36 x i8] c"Entre com a coordenada de in\C3\ADcio: \00"
@.str.2 = [3 x i8] c"%s\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8 x [8 x i32]]
%7 = alloca [128 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca [3 x i8]
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = bitcast [8 x [8 x i32]]* %6 to i8*
store i32 1, i32* %8
store i32 0, i32* %9
%14 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%16 = getelementptr inbounds [3 x i8], [3 x i8]* %10, i64 0, i64 0
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds [3 x i8], [3 x i8]* %10, i64 0, i64 1
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = sub nsw i32 %20, 48
%22 = sub nsw i32 8, %21
store i32 %22, i32* %11
%23 = getelementptr inbounds [3 x i8], [3 x i8]* %10, i64 0, i64 0
%24 = load i8, i8* %23
%25 = call i32 @letra_para_numero(i8 signext %24)
store i32 %25, i32* %12
%26 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %6, i64 0, i64 0
%27 = bitcast [8 x i32]* %26 to i32**
%28 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%29 = load i32, i32* %11
%30 = load i32, i32* %12
%31 = load i32, i32* %8
%32 = load i32, i32* %9
%33 = call i32 @passeio_do_cavalo(i32** %27, i8* %28, i32 %29, i32 %30, i32 %31, i32 %32)
%34 = load i32, i32* @EXIT_SUCCESS
ret i32 %34
}

LLVM IR (-O2):
@.str.1 = [36 x i8] c"Entre com a coordenada de in\C3\ADcio: \00"
@.str.2 = [3 x i8] c"%s\00"
@EXIT_SUCCESS = global i32 0
@str = [60 x i8] c"Use a nota\C3\A7\C3\A3o usual de cordenadas do tabuleiro de xadrez.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8 x [8 x i32]]
%4 = alloca [128 x i8]
%5 = alloca [3 x i8]
%6 = bitcast [8 x [8 x i32]]* %3 to i8*
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 1
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = sub nsw i32 56, %14
%16 = load i8, i8* %8
%17 = call i32 @letra_para_numero(i8 signext %16)
%18 = bitcast [8 x [8 x i32]]* %3 to i32**
%19 = call i32 @passeio_do_cavalo(i32** %18, i8* %7, i32 %15, i32 %17, i32 1, i32 0)
%20 = load i32, i32* @EXIT_SUCCESS
ret i32 %20
}