#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*/ BreadthFirstSearch(int **, int *, int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int main() {
  int graph[10][10] = {
      {0, 1, 0, 0, 1, 0, 0, 0, 0, 1}, {1, 0, 1, 0, 0, 1, 0, 0, 0, 0},
      {0, 1, 0, 1, 0, 0, 1, 0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 1, 1, 0},
      {1, 0, 0, 0, 0, 1, 0, 0, 1, 0}, {0, 1, 0, 0, 1, 0, 1, 0, 0, 0},
      {0, 0, 1, 0, 0, 1, 0, 1, 0, 0}, {0, 0, 0, 1, 0, 0, 1, 0, 0, 1},
      {0, 0, 0, 1, 1, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 0, 0, 0, 1, 1, 0},
  };
  int visited[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  BreadthFirstSearch(graph, visited, 0);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
lea    -0x190(%rbp),%rdi
lea    0xea7(%rip),%rsi
mov    $0x190,%edx
call   1060 <memcpy@plt>
lea    -0x1c0(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    -0x190(%rbp),%rdi
lea    -0x1c0(%rbp),%rsi
xor    %edx,%edx
call   1030 <BreadthFirstSearch@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x1c0,%rsp
lea    0xec1(%rip),%rsi
lea    0x30(%rsp),%rbx
mov    $0x190,%edx
mov    %rbx,%rdi
call   1050 <memcpy@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x20(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
xor    %edx,%edx
call   1030 <BreadthFirstSearch@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.graph = [10 x [10 x i32]] [[10 x i32] [i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 1], [10 x i32] [i32 1, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0], [10 x i32] [i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0], [10 x i32] [i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 0], [10 x i32] [i32 1, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0], [10 x i32] [i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 0], [10 x i32] [i32 0, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0], [10 x i32] [i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 0, i32 1], [10 x i32] [i32 0, i32 0, i32 0, i32 1, i32 1, i32 0, i32 0, i32 0, i32 0, i32 1], [10 x i32] [i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 0]]
define i32 @main() {
%1 = alloca [10 x [10 x i32]]
%2 = alloca [10 x i32]
%3 = bitcast [10 x [10 x i32]]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %1, i64 0, i64 0
%6 = bitcast [10 x i32]* %5 to i32**
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%8 = call i32 @BreadthFirstSearch(i32** %6, i32* %7, i32 0)
%9 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.graph = [10 x [10 x i32]] [[10 x i32] [i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 1], [10 x i32] [i32 1, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0], [10 x i32] [i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0], [10 x i32] [i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 0], [10 x i32] [i32 1, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0], [10 x i32] [i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 0], [10 x i32] [i32 0, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0], [10 x i32] [i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 0, i32 1], [10 x i32] [i32 0, i32 0, i32 0, i32 1, i32 1, i32 0, i32 0, i32 0, i32 0, i32 1], [10 x i32] [i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 0]]
define i32 @main() {
%1 = alloca [10 x [10 x i32]]
%2 = alloca [10 x i32]
%3 = bitcast [10 x [10 x i32]]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = bitcast [10 x [10 x i32]]* %1 to i32**
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = call i32 @BreadthFirstSearch(i32** %5, i32* %6, i32 0)
%8 = call i32 (...) @getchar()
ret i32 0
}