#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;
  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    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <createGraph@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
mov    $0x4,%edx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
call   1050 <printGraph@plt>
xor    %eax,%eax
add    $0x10,%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 %struct.Graph*
store i32 0, i32* %1
store i32 5, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.Graph* @createGraph(i32 %4)
store %struct.Graph* %5, %struct.Graph** %3
%6 = load %struct.Graph*, %struct.Graph** %3
%7 = call i32 @addEdge(%struct.Graph* %6, i32 0, i32 1)
%8 = load %struct.Graph*, %struct.Graph** %3
%9 = call i32 @addEdge(%struct.Graph* %8, i32 0, i32 4)
%10 = load %struct.Graph*, %struct.Graph** %3
%11 = call i32 @addEdge(%struct.Graph* %10, i32 1, i32 2)
%12 = load %struct.Graph*, %struct.Graph** %3
%13 = call i32 @addEdge(%struct.Graph* %12, i32 1, i32 3)
%14 = load %struct.Graph*, %struct.Graph** %3
%15 = call i32 @addEdge(%struct.Graph* %14, i32 1, i32 4)
%16 = load %struct.Graph*, %struct.Graph** %3
%17 = call i32 @addEdge(%struct.Graph* %16, i32 2, i32 3)
%18 = load %struct.Graph*, %struct.Graph** %3
%19 = call i32 @addEdge(%struct.Graph* %18, i32 3, i32 4)
%20 = load %struct.Graph*, %struct.Graph** %3
%21 = call i32 @printGraph(%struct.Graph* %20)
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
}