#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*/ dist(int *);
int /*<<< orphan*/ inky(int *, int *, char **, int *);
int /*<<< orphan*/ marca_pacman(char **, int *);
int main(int argc, const char *argv[]) {
  char maze[23][30] = {{'0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
                        '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
                        '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'},
                       {'0', ' ', ' ', ' ', ' ', ' ', '7', ' ', ' ', ' ',
                        ' ', ' ', ' ', ' ', '0', ' ', ' ', ' ', ' ', ' ',
                        ' ', ' ', '7', ' ', ' ', ' ', ' ', ' ', ' ', '0'},
                       {'0', ' ', '0', '0', '0', '0', ' ', '0', '0', '0',
                        '0', '0', '0', ' ', '0', ' ', '0', '0', '0', '0',
                        '0', '0', ' ', '0', '0', '0', '0', '0', ' ', '0'},
                       {'0', ' ', '0', '0', '0', '0', ' ', '0', '0', '0',
                        '0', '0', '0', ' ', '0', ' ', '0', '0', '0', '0',
                        '0', '0', ' ', '0', '0', '0', '0', '0', ' ', '0'},
                       {'0', '7', ' ', ' ', ' ', ' ', '7', ' ', ' ', ' ',
                        ' ', ' ', ' ', '7', ' ', '7', ' ', ' ', ' ', ' ',
                        ' ', ' ', '7', ' ', ' ', ' ', ' ', ' ', '7', '0'},
                       {'0', ' ', '0', '0', '0', '0', ' ', '0', ' ', '0',
                        '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
                        ' ', '0', ' ', '0', '0', '0', '0', '0', ' ', '0'},
                       {'0', ' ', ' ', ' ', ' ', ' ', '7', '0', ' ', ' ',
                        ' ', ' ', ' ', ' ', '0', ' ', ' ', ' ', ' ', ' ',
                        ' ', '0', '7', ' ', ' ', ' ', ' ', ' ', ' ', '0'},
                       {'0', ' ', '0', '0', '0', '0', ' ', '0', '0', '0',
                        '0', '0', '0', ' ', '0', ' ', '0', '0', '0', '0',
                        '0', '0', ' ', '0', '0', '0', '0', '0', ' ', '0'},
                       {'0', ' ', '0', '0', '0', '0', ' ', '0', ' ', ' ',
                        ' ', ' ', ' ', '6', ' ', '6', ' ', ' ', ' ', ' ',
                        ' ', '0', ' ', '0', '0', '0', '0', '0', ' ', '0'},
                       {'0', ' ', '0', '0', '0', '0', ' ', '0', ' ', '0',
                        '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
                        ' ', '0', ' ', '0', '0', '0', '0', '0', ' ', '0'},
                       {'0', ' ', '0', '0', '0', '0', ' ', ' ', '7', '0',
                        '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
                        '7', ' ', ' ', '0', '0', '0', '0', '0', ' ', '0'},
                       {'0', ' ', '0', '0', '0', '0', ' ', '0', ' ', '0',
                        '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
                        ' ', '0', ' ', '0', '0', '0', '0', '0', ' ', '0'},
                       {'0', ' ', '0', '0', '0', '0', ' ', '0', ' ', '0',
                        '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
                        ' ', '0', ' ', '0', '0', '0', '0', '0', ' ', '0'},
                       {'0', ' ', '0', '0', '0', '0', ' ', '0', '7', ' ',
                        ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
                        '7', '0', ' ', '0', '0', '0', '0', '0', ' ', '0'},
                       {'0', ' ', '0', '0', '0', '0', ' ', '0', ' ', '0',
                        '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
                        ' ', '0', ' ', '0', '0', '0', '0', '0', ' ', '0'},
                       {'0', ' ', ' ', ' ', ' ', ' ', '7', ' ', '7', ' ',
                        ' ', ' ', ' ', ' ', '0', ' ', ' ', ' ', ' ', ' ',
                        '7', ' ', '7', ' ', ' ', ' ', ' ', ' ', ' ', '0'},
                       {'0', ' ', '0', '0', '0', '0', ' ', '0', '0', '0',
                        '0', '0', '0', ' ', '0', ' ', '0', '0', '0', '0',
                        '0', '0', ' ', '0', '0', '0', '0', '0', ' ', '0'},
                       {'0', '7', ' ', ' ', ' ', ' ', '7', ' ', '7', ' ',
                        ' ', ' ', ' ', '6', ' ', '6', ' ', ' ', ' ', ' ',
                        '7', ' ', '7', '0', ' ', ' ', ' ', ' ', '7', '0'},
                       {'0', ' ', '0', '0', '0', '0', ' ', '0', ' ', '0',
                        '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
                        ' ', '0', ' ', '0', ' ', '0', '0', '0', ' ', '0'},
                       {'0', '7', ' ', ' ', ' ', ' ', ' ', '0', ' ', ' ',
                        ' ', ' ', ' ', ' ', '0', ' ', ' ', ' ', ' ', ' ',
                        ' ', '0', ' ', ' ', '7', ' ', ' ', ' ', '7', '0'},
                       {'0', ' ', '0', '0', '0', '0', '0', '0', '0', '0',
                        '0', '0', '0', ' ', '0', ' ', '0', '0', '0', '0',
                        '0', '0', '0', '0', '0', '0', '0', '0', ' ', '0'},
                       {'0', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
                        ' ', ' ', ' ', '7', ' ', '7', ' ', ' ', ' ', ' ',
                        ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '0'},
                       {'0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
                        '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
                        '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'}};
  int red[3], pacman[3], ghost[3];
  red[0] = 2;
  red[1] = 6;
  red[2] = 2;
  pacman[0] = 4;
  pacman[1] = 7;
  pacman[2] = 2;
  ghost[0] = 1;
  ghost[1] = 1;
  ghost[2] = 2;
  marca_pacman(maze, pacman);
  dist(pacman);
  inky(pacman, red, maze, ghost);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x300,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x2d0(%rbp),%rdi
lea    0xe99(%rip),%rsi
mov    $0x2b2,%edx
call   1040 <memcpy@plt>
movl   $0x2,-0x2dc(%rbp)
movl   $0x6,-0x2d8(%rbp)
movl   $0x2,-0x2d4(%rbp)
movl   $0x4,-0x2e8(%rbp)
movl   $0x7,-0x2e4(%rbp)
movl   $0x2,-0x2e0(%rbp)
movl   $0x1,-0x2f4(%rbp)
movl   $0x1,-0x2f0(%rbp)
movl   $0x2,-0x2ec(%rbp)
lea    -0x2d0(%rbp),%rdi
lea    -0x2e8(%rbp),%rsi
call   1060 <marca_pacman@plt>
lea    -0x2e8(%rbp),%rdi
call   1050 <dist@plt>
lea    -0x2e8(%rbp),%rdi
lea    -0x2dc(%rbp),%rsi
lea    -0x2d0(%rbp),%rdx
lea    -0x2f4(%rbp),%rcx
call   1030 <inky@plt>
xor    %eax,%eax
add    $0x300,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x2e8,%rsp
lea    0xeaf(%rip),%rsi
lea    0x30(%rsp),%r14
mov    $0x2b2,%edx
mov    %r14,%rdi
call   1040 <memcpy@plt>
movabs $0x600000002,%rax
mov    %rax,0x24(%rsp)
movl   $0x2,0x2c(%rsp)
movabs $0x700000004,%rax
mov    %rax,0x18(%rsp)
movl   $0x2,0x20(%rsp)
movabs $0x100000001,%rax
mov    %rax,0xc(%rsp)
movl   $0x2,0x14(%rsp)
lea    0x18(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <marca_pacman@plt>
mov    %rbx,%rdi
call   1050 <dist@plt>
lea    0x24(%rsp),%rsi
lea    0xc(%rsp),%rcx
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <inky@plt>
xor    %eax,%eax
add    $0x2e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.maze = [23 x [30 x i8]] [[30 x i8] c"000000000000000000000000000000", [30 x i8] c"0 7 0 7 0", [30 x i8] c"0 0000 000000 0 000000 00000 0", [30 x i8] c"0 0000 000000 0 000000 00000 0", [30 x i8] c"07 7 7 7 7 70", [30 x i8] c"0 0000 0 00000000000 0 00000 0", [30 x i8] c"0 70 0 07 0", [30 x i8] c"0 0000 000000 0 000000 00000 0", [30 x i8] c"0 0000 0 6 6 0 00000 0", [30 x i8] c"0 0000 0 00000000000 0 00000 0", [30 x i8] c"0 0000 7000000000007 00000 0", [30 x i8] c"0 0000 0 00000000000 0 00000 0", [30 x i8] c"0 0000 0 00000000000 0 00000 0", [30 x i8] c"0 0000 07 70 00000 0", [30 x i8] c"0 0000 0 00000000000 0 00000 0", [30 x i8] c"0 7 7 0 7 7 0", [30 x i8] c"0 0000 000000 0 000000 00000 0", [30 x i8] c"07 7 7 6 6 7 70 70", [30 x i8] c"0 0000 0 00000000000 0 0 000 0", [30 x i8] c"07 0 0 0 7 70", [30 x i8] c"0 00000000000 0 000000000000 0", [30 x i8] c"0 7 7 0", [30 x i8] c"000000000000000000000000000000"]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [23 x [30 x i8]]
%7 = alloca [3 x i32]
%8 = alloca [3 x i32]
%9 = alloca [3 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [23 x [30 x i8]]* %6 to i8*
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
store i32 2, i32* %11
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 1
store i32 6, i32* %12
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 2
store i32 2, i32* %13
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 0
store i32 4, i32* %14
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 1
store i32 7, i32* %15
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 2
store i32 2, i32* %16
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
store i32 1, i32* %17
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 1
store i32 1, i32* %18
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 2
store i32 2, i32* %19
%20 = getelementptr inbounds [23 x [30 x i8]], [23 x [30 x i8]]* %6, i64 0, i64 0
%21 = bitcast [30 x i8]* %20 to i8**
%22 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 0
%23 = call i32 @marca_pacman(i8** %21, i32* %22)
%24 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 0
%25 = call i32 @dist(i32* %24)
%26 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 0
%27 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
%28 = getelementptr inbounds [23 x [30 x i8]], [23 x [30 x i8]]* %6, i64 0, i64 0
%29 = bitcast [30 x i8]* %28 to i8**
%30 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%31 = call i32 @inky(i32* %26, i32* %27, i8** %29, i32* %30)
ret i32 0
}

LLVM IR (-O2):
@__const.main.maze = [23 x [30 x i8]] [[30 x i8] c"000000000000000000000000000000", [30 x i8] c"0 7 0 7 0", [30 x i8] c"0 0000 000000 0 000000 00000 0", [30 x i8] c"0 0000 000000 0 000000 00000 0", [30 x i8] c"07 7 7 7 7 70", [30 x i8] c"0 0000 0 00000000000 0 00000 0", [30 x i8] c"0 70 0 07 0", [30 x i8] c"0 0000 000000 0 000000 00000 0", [30 x i8] c"0 0000 0 6 6 0 00000 0", [30 x i8] c"0 0000 0 00000000000 0 00000 0", [30 x i8] c"0 0000 7000000000007 00000 0", [30 x i8] c"0 0000 0 00000000000 0 00000 0", [30 x i8] c"0 0000 0 00000000000 0 00000 0", [30 x i8] c"0 0000 07 70 00000 0", [30 x i8] c"0 0000 0 00000000000 0 00000 0", [30 x i8] c"0 7 7 0 7 7 0", [30 x i8] c"0 0000 000000 0 000000 00000 0", [30 x i8] c"07 7 7 6 6 7 70 70", [30 x i8] c"0 0000 0 00000000000 0 0 000 0", [30 x i8] c"07 0 0 0 7 70", [30 x i8] c"0 00000000000 0 000000000000 0", [30 x i8] c"0 7 7 0", [30 x i8] c"000000000000000000000000000000"]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [23 x [30 x i8]]
%4 = alloca [3 x i32]
%5 = alloca [3 x i32]
%6 = alloca [3 x i32]
%7 = getelementptr inbounds [23 x [30 x i8]], [23 x [30 x i8]]* %3, i64 0, i64 0, i64 0
%8 = bitcast [3 x i32]* %4 to i8*
%9 = bitcast [3 x i32]* %5 to i8*
%10 = bitcast [3 x i32]* %6 to i8*
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
store i32 2, i32* %11
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 1
store i32 6, i32* %12
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 2
store i32 2, i32* %13
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
store i32 4, i32* %14
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
store i32 7, i32* %15
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
store i32 2, i32* %16
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
store i32 1, i32* %17
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 1
store i32 1, i32* %18
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 2
store i32 2, i32* %19
%20 = bitcast [23 x [30 x i8]]* %3 to i8**
%21 = call i32 @marca_pacman(i8** %20, i32* %14)
%22 = call i32 @dist(i32* %14)
%23 = call i32 @inky(i32* %14, i32* %11, i8** %20, i32* %17)
ret i32 0
}