#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 */
struct Graph {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BFS(struct Graph *, int /*<<< orphan*/);
int /*<<< orphan*/ DFS(struct Graph *, int /*<<< orphan*/);
int /*<<< orphan*/ add_edge(struct Graph *, int, int);
struct Graph *create_graph(int);
int /*<<< orphan*/ print_graph(struct Graph *);
void main() {
  int V = 5;
  struct Graph *graph = create_graph(V);
  add_edge(graph, 0, 1);
  add_edge(graph, 0, 4);
  add_edge(graph, 1, 2);
  add_edge(graph, 1, 3);
  add_edge(graph, 1, 4);
  add_edge(graph, 2, 3);
  add_edge(graph, 3, 4);
  print_graph(graph);
  DFS(graph, 0);
  BFS(graph, 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1070 <create_graph@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <add_edge@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <add_edge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1040 <add_edge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   1040 <add_edge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1040 <add_edge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <add_edge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
mov    $0x4,%edx
call   1040 <add_edge@plt>
mov    -0x10(%rbp),%rdi
call   1030 <print_graph@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1060 <DFS@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1050 <BFS@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%edi
call   1070 <create_graph@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <add_edge@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <add_edge@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1040 <add_edge@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   1040 <add_edge@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1040 <add_edge@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <add_edge@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x4,%edx
call   1040 <add_edge@plt>
mov    %rbx,%rdi
call   1030 <print_graph@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <DFS@plt>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1050 <BFS@plt>

LLVM IR (-O0):
%struct.Graph = type { i32 }
define void @main() {
%1 = alloca i32
%2 = alloca %struct.Graph*
store i32 5, i32* %1
%3 = load i32, i32* %1
%4 = call %struct.Graph* @create_graph(i32 %3)
store %struct.Graph* %4, %struct.Graph** %2
%5 = load %struct.Graph*, %struct.Graph** %2
%6 = call i32 @add_edge(%struct.Graph* %5, i32 0, i32 1)
%7 = load %struct.Graph*, %struct.Graph** %2
%8 = call i32 @add_edge(%struct.Graph* %7, i32 0, i32 4)
%9 = load %struct.Graph*, %struct.Graph** %2
%10 = call i32 @add_edge(%struct.Graph* %9, i32 1, i32 2)
%11 = load %struct.Graph*, %struct.Graph** %2
%12 = call i32 @add_edge(%struct.Graph* %11, i32 1, i32 3)
%13 = load %struct.Graph*, %struct.Graph** %2
%14 = call i32 @add_edge(%struct.Graph* %13, i32 1, i32 4)
%15 = load %struct.Graph*, %struct.Graph** %2
%16 = call i32 @add_edge(%struct.Graph* %15, i32 2, i32 3)
%17 = load %struct.Graph*, %struct.Graph** %2
%18 = call i32 @add_edge(%struct.Graph* %17, i32 3, i32 4)
%19 = load %struct.Graph*, %struct.Graph** %2
%20 = call i32 @print_graph(%struct.Graph* %19)
%21 = load %struct.Graph*, %struct.Graph** %2
%22 = call i32 @DFS(%struct.Graph* %21, i32 0)
%23 = load %struct.Graph*, %struct.Graph** %2
%24 = call i32 @BFS(%struct.Graph* %23, i32 0)
ret void
}

LLVM IR (-O2):
%struct.Graph = type { i32 }
define void @main() {
%1 = tail call %struct.Graph* @create_graph(i32 5)
%2 = tail call i32 @add_edge(%struct.Graph* %1, i32 0, i32 1)
%3 = tail call i32 @add_edge(%struct.Graph* %1, i32 0, i32 4)
%4 = tail call i32 @add_edge(%struct.Graph* %1, i32 1, i32 2)
%5 = tail call i32 @add_edge(%struct.Graph* %1, i32 1, i32 3)
%6 = tail call i32 @add_edge(%struct.Graph* %1, i32 1, i32 4)
%7 = tail call i32 @add_edge(%struct.Graph* %1, i32 2, i32 3)
%8 = tail call i32 @add_edge(%struct.Graph* %1, i32 3, i32 4)
%9 = tail call i32 @print_graph(%struct.Graph* %1)
%10 = tail call i32 @DFS(%struct.Graph* %1, i32 0)
%11 = tail call i32 @BFS(%struct.Graph* %1, i32 0)
ret void
}