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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <createGraph@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x5,%ecx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
mov    $0x2,%ecx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x8,%ecx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%ecx
mov    $0x4,%edx
mov    %ecx,%esi
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%ecx
mov    $0x3,%edx
mov    %ecx,%esi
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
mov    $0x4,%edx
mov    $0x1,%ecx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x4,%ecx
mov    $0x2,%edx
mov    %ecx,%esi
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x4,%ecx
mov    $0x5,%edx
mov    %ecx,%esi
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    $0x6,%edi
call   1040 <createGraph@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x5,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
mov    $0x2,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x8,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    $0x1,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x2,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x4,%edx
mov    $0x1,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x2,%edx
mov    $0x4,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x5,%edx
mov    $0x4,%ecx
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 6, 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, i32 5)
%8 = load %struct.Graph*, %struct.Graph** %3
%9 = call i32 @addEdge(%struct.Graph* %8, i32 0, i32 4, i32 2)
%10 = load %struct.Graph*, %struct.Graph** %3
%11 = call i32 @addEdge(%struct.Graph* %10, i32 1, i32 2, i32 3)
%12 = load %struct.Graph*, %struct.Graph** %3
%13 = call i32 @addEdge(%struct.Graph* %12, i32 1, i32 3, i32 8)
%14 = load %struct.Graph*, %struct.Graph** %3
%15 = call i32 @addEdge(%struct.Graph* %14, i32 1, i32 4, i32 1)
%16 = load %struct.Graph*, %struct.Graph** %3
%17 = call i32 @addEdge(%struct.Graph* %16, i32 2, i32 3, i32 2)
%18 = load %struct.Graph*, %struct.Graph** %3
%19 = call i32 @addEdge(%struct.Graph* %18, i32 3, i32 4, i32 1)
%20 = load %struct.Graph*, %struct.Graph** %3
%21 = call i32 @addEdge(%struct.Graph* %20, i32 4, i32 2, i32 4)
%22 = load %struct.Graph*, %struct.Graph** %3
%23 = call i32 @addEdge(%struct.Graph* %22, i32 4, i32 5, i32 4)
%24 = load %struct.Graph*, %struct.Graph** %3
%25 = call i32 @printGraph(%struct.Graph* %24)
ret i32 0
}

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