#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 /*<<< orphan*/ anda(int *, char **, int *);
int /*<<< orphan*/ marca_target(char **, int *);
int /*<<< orphan*/ print_maze(char **);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ verifica_target(int *, char **);
void inky(int dir[2], int red[3], char maze[23][30], int ghost[3]) {
  int target[2], boo = 1;
  target[0] = (red[0] - dir[0]) + dir[0];
  target[1] = (red[1] - dir[1]) + dir[1];
  printf("%d", target[0]);
  printf("%d", target[1]);
  verifica_target(target, maze);
  marca_target(maze, target);
  print_maze(maze);
  anda(ghost, maze, target);
}


x86 assembly (clang, -O0):
<inky>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%eax
mov    -0x8(%rbp),%rcx
add    (%rcx),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x8(%rbp),%rcx
sub    0x4(%rcx),%eax
mov    -0x8(%rbp),%rcx
add    0x4(%rcx),%eax
mov    %eax,-0x24(%rbp)
mov    -0x28(%rbp),%esi
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xe4b(%rip),%rdi
call   1030 <printf@plt>
lea    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <verifica_target@plt>
mov    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1050 <marca_target@plt>
mov    -0x18(%rbp),%rdi
call   1070 <print_maze@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1040 <anda@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inky>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    (%rsi),%eax
mov    %eax,(%rsp)
mov    0x4(%rsi),%ebp
mov    %ebp,0x4(%rsp)
lea    0xe90(%rip),%r15
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1060 <verifica_target@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1050 <marca_target@plt>
mov    %rbx,%rdi
call   1070 <print_maze@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1040 <anda@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @inky(i32* %0, i32* %1, [30 x i8]* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca [30 x i8]*
%8 = alloca i32*
%9 = alloca [2 x i32]
%10 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store [30 x i8]* %2, [30 x i8]** %7
store i32* %3, i32** %8
store i32 1, i32* %10
%11 = load i32*, i32** %6
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 0
%16 = load i32, i32* %15
%17 = sub nsw i32 %13, %16
%18 = load i32*, i32** %5
%19 = getelementptr inbounds i32, i32* %18, i64 0
%20 = load i32, i32* %19
%21 = add nsw i32 %17, %20
%22 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32 %21, i32* %22
%23 = load i32*, i32** %6
%24 = getelementptr inbounds i32, i32* %23, i64 1
%25 = load i32, i32* %24
%26 = load i32*, i32** %5
%27 = getelementptr inbounds i32, i32* %26, i64 1
%28 = load i32, i32* %27
%29 = sub nsw i32 %25, %28
%30 = load i32*, i32** %5
%31 = getelementptr inbounds i32, i32* %30, i64 1
%32 = load i32, i32* %31
%33 = add nsw i32 %29, %32
%34 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
store i32 %33, i32* %34
%35 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%36 = load i32, i32* %35
%37 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %36)
%38 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%39 = load i32, i32* %38
%40 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %39)
%41 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%42 = load [30 x i8]*, [30 x i8]** %7
%43 = bitcast [30 x i8]* %42 to i8**
%44 = call i32 @verifica_target(i32* %41, i8** %43)
%45 = load [30 x i8]*, [30 x i8]** %7
%46 = bitcast [30 x i8]* %45 to i8**
%47 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%48 = call i32 @marca_target(i8** %46, i32* %47)
%49 = load [30 x i8]*, [30 x i8]** %7
%50 = bitcast [30 x i8]* %49 to i8**
%51 = call i32 @print_maze(i8** %50)
%52 = load i32*, i32** %8
%53 = load [30 x i8]*, [30 x i8]** %7
%54 = bitcast [30 x i8]* %53 to i8**
%55 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%56 = call i32 @anda(i32* %52, i8** %54, i32* %55)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @inky(i32* nocapture readnone %0, i32* nocapture %1, [30 x i8]* %2, i32* %3) {
%5 = alloca [2 x i32]
%6 = bitcast [2 x i32]* %5 to i8*
%7 = load i32, i32* %1
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %7, i32* %8
%9 = getelementptr inbounds i32, i32* %1, i64 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %10, i32* %11
%12 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
%14 = bitcast [30 x i8]* %2 to i8**
%15 = call i32 @verifica_target(i32* %8, i8** %14)
%16 = call i32 @marca_target(i8** %14, i32* %8)
%17 = call i32 @print_maze(i8** %14)
%18 = call i32 @anda(i32* %3, i8** %14, i32* %8)
ret void
}