#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*/ addEdge(struct Graph *, int, int);
struct Graph *createGraph(int);
int /*<<< orphan*/ printGraph(struct Graph *);
int main() {
  int V = 5;
  int visited[5] = {0};
  struct Graph *graph = createGraph(V);
  addEdge(graph, 0, 1);
  addEdge(graph, 0, 4);
  addEdge(graph, 1, 2);
  addEdge(graph, 1, 3);
  addEdge(graph, 1, 4);
  addEdge(graph, 2, 3);
  addEdge(graph, 3, 4);
  printGraph(graph);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%edi
call   1050 <createGraph@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <addEdge@plt>
mov    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <addEdge@plt>
mov    -0x28(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1040 <addEdge@plt>
mov    -0x28(%rbp),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   1040 <addEdge@plt>
mov    -0x28(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1040 <addEdge@plt>
mov    -0x28(%rbp),%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <addEdge@plt>
mov    -0x28(%rbp),%rdi
mov    $0x3,%esi
mov    $0x4,%edx
call   1040 <addEdge@plt>
mov    -0x28(%rbp),%rdi
call   1060 <printGraph@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%edi
call   1040 <createGraph@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x4,%edx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
call   1050 <printGraph@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.Graph = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [5 x i32]
%4 = alloca %struct.Graph*
store i32 0, i32* %1
store i32 5, i32* %2
%5 = bitcast [5 x i32]* %3 to i8*
%6 = load i32, i32* %2
%7 = call %struct.Graph* @createGraph(i32 %6)
store %struct.Graph* %7, %struct.Graph** %4
%8 = load %struct.Graph*, %struct.Graph** %4
%9 = call i32 @addEdge(%struct.Graph* %8, i32 0, i32 1)
%10 = load %struct.Graph*, %struct.Graph** %4
%11 = call i32 @addEdge(%struct.Graph* %10, i32 0, i32 4)
%12 = load %struct.Graph*, %struct.Graph** %4
%13 = call i32 @addEdge(%struct.Graph* %12, i32 1, i32 2)
%14 = load %struct.Graph*, %struct.Graph** %4
%15 = call i32 @addEdge(%struct.Graph* %14, i32 1, i32 3)
%16 = load %struct.Graph*, %struct.Graph** %4
%17 = call i32 @addEdge(%struct.Graph* %16, i32 1, i32 4)
%18 = load %struct.Graph*, %struct.Graph** %4
%19 = call i32 @addEdge(%struct.Graph* %18, i32 2, i32 3)
%20 = load %struct.Graph*, %struct.Graph** %4
%21 = call i32 @addEdge(%struct.Graph* %20, i32 3, i32 4)
%22 = load %struct.Graph*, %struct.Graph** %4
%23 = call i32 @printGraph(%struct.Graph* %22)
ret i32 0
}

LLVM IR (-O2):
%struct.Graph = type { i32 }
define i32 @main() {
%1 = tail call %struct.Graph* @createGraph(i32 5)
%2 = tail call i32 @addEdge(%struct.Graph* %1, i32 0, i32 1)
%3 = tail call i32 @addEdge(%struct.Graph* %1, i32 0, i32 4)
%4 = tail call i32 @addEdge(%struct.Graph* %1, i32 1, i32 2)
%5 = tail call i32 @addEdge(%struct.Graph* %1, i32 1, i32 3)
%6 = tail call i32 @addEdge(%struct.Graph* %1, i32 1, i32 4)
%7 = tail call i32 @addEdge(%struct.Graph* %1, i32 2, i32 3)
%8 = tail call i32 @addEdge(%struct.Graph* %1, i32 3, i32 4)
%9 = tail call i32 @printGraph(%struct.Graph* %1)
ret i32 0
}