#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);
struct graph *buildGraph() {
  int V = 9;
  struct graph *grp = creategraph(V);
  addEdge(grp, 0, 1, 4);
  addEdge(grp, 0, 7, 8);
  addEdge(grp, 1, 2, 8);
  addEdge(grp, 1, 7, 11);
  addEdge(grp, 2, 3, 7);
  addEdge(grp, 2, 8, 2);
  addEdge(grp, 2, 5, 4);
  addEdge(grp, 3, 4, 9);
  addEdge(grp, 3, 5, 14);
  addEdge(grp, 4, 5, 10);
  addEdge(grp, 5, 6, 2);
  addEdge(grp, 6, 7, 1);
  addEdge(grp, 6, 8, 6);
  addEdge(grp, 7, 8, 7);
  return grp;
}


x86 assembly (clang, -O0):
<buildGraph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x9,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <creategraph@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x4,%ecx
call   1040 <addEdge@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x7,%edx
mov    $0x8,%ecx
call   1040 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x8,%ecx
call   1040 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x7,%edx
mov    $0xb,%ecx
call   1040 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x7,%ecx
call   1040 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%ecx
mov    $0x8,%edx
mov    %ecx,%esi
call   1040 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
mov    $0x5,%edx
mov    $0x4,%ecx
call   1040 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
mov    $0x4,%edx
mov    $0x9,%ecx
call   1040 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
mov    $0x5,%edx
mov    $0xe,%ecx
call   1040 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
mov    $0x5,%edx
mov    $0xa,%ecx
call   1040 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x5,%esi
mov    $0x6,%edx
mov    $0x2,%ecx
call   1040 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x6,%esi
mov    $0x7,%edx
mov    $0x1,%ecx
call   1040 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x6,%ecx
mov    $0x8,%edx
mov    %ecx,%esi
call   1040 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x7,%ecx
mov    $0x8,%edx
mov    %ecx,%esi
call   1040 <addEdge@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildGraph>:
push   %rbx
mov    $0x9,%edi
call   1030 <creategraph@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x4,%ecx
call   1040 <addEdge@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x7,%edx
mov    $0x8,%ecx
call   1040 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x8,%ecx
call   1040 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x7,%edx
mov    $0xb,%ecx
call   1040 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x7,%ecx
call   1040 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x8,%edx
mov    $0x2,%ecx
call   1040 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x5,%edx
mov    $0x4,%ecx
call   1040 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x4,%edx
mov    $0x9,%ecx
call   1040 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x5,%edx
mov    $0xe,%ecx
call   1040 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x5,%edx
mov    $0xa,%ecx
call   1040 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x6,%edx
mov    $0x2,%ecx
call   1040 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x7,%edx
mov    $0x1,%ecx
call   1040 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x8,%edx
mov    $0x6,%ecx
call   1040 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x8,%edx
mov    $0x7,%ecx
call   1040 <addEdge@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.graph = type { i32 }
define %struct.graph* @buildGraph() {
%1 = alloca i32
%2 = alloca %struct.graph*
store i32 9, i32* %1
%3 = load i32, i32* %1
%4 = call %struct.graph* @creategraph(i32 %3)
store %struct.graph* %4, %struct.graph** %2
%5 = load %struct.graph*, %struct.graph** %2
%6 = call i32 @addEdge(%struct.graph* %5, i32 0, i32 1, i32 4)
%7 = load %struct.graph*, %struct.graph** %2
%8 = call i32 @addEdge(%struct.graph* %7, i32 0, i32 7, i32 8)
%9 = load %struct.graph*, %struct.graph** %2
%10 = call i32 @addEdge(%struct.graph* %9, i32 1, i32 2, i32 8)
%11 = load %struct.graph*, %struct.graph** %2
%12 = call i32 @addEdge(%struct.graph* %11, i32 1, i32 7, i32 11)
%13 = load %struct.graph*, %struct.graph** %2
%14 = call i32 @addEdge(%struct.graph* %13, i32 2, i32 3, i32 7)
%15 = load %struct.graph*, %struct.graph** %2
%16 = call i32 @addEdge(%struct.graph* %15, i32 2, i32 8, i32 2)
%17 = load %struct.graph*, %struct.graph** %2
%18 = call i32 @addEdge(%struct.graph* %17, i32 2, i32 5, i32 4)
%19 = load %struct.graph*, %struct.graph** %2
%20 = call i32 @addEdge(%struct.graph* %19, i32 3, i32 4, i32 9)
%21 = load %struct.graph*, %struct.graph** %2
%22 = call i32 @addEdge(%struct.graph* %21, i32 3, i32 5, i32 14)
%23 = load %struct.graph*, %struct.graph** %2
%24 = call i32 @addEdge(%struct.graph* %23, i32 4, i32 5, i32 10)
%25 = load %struct.graph*, %struct.graph** %2
%26 = call i32 @addEdge(%struct.graph* %25, i32 5, i32 6, i32 2)
%27 = load %struct.graph*, %struct.graph** %2
%28 = call i32 @addEdge(%struct.graph* %27, i32 6, i32 7, i32 1)
%29 = load %struct.graph*, %struct.graph** %2
%30 = call i32 @addEdge(%struct.graph* %29, i32 6, i32 8, i32 6)
%31 = load %struct.graph*, %struct.graph** %2
%32 = call i32 @addEdge(%struct.graph* %31, i32 7, i32 8, i32 7)
%33 = load %struct.graph*, %struct.graph** %2
ret %struct.graph* %33
}

LLVM IR (-O2):
%struct.graph = type { i32 }
define %struct.graph* @buildGraph() {
%1 = tail call %struct.graph* @creategraph(i32 9)
%2 = tail call i32 @addEdge(%struct.graph* %1, i32 0, i32 1, i32 4)
%3 = tail call i32 @addEdge(%struct.graph* %1, i32 0, i32 7, i32 8)
%4 = tail call i32 @addEdge(%struct.graph* %1, i32 1, i32 2, i32 8)
%5 = tail call i32 @addEdge(%struct.graph* %1, i32 1, i32 7, i32 11)
%6 = tail call i32 @addEdge(%struct.graph* %1, i32 2, i32 3, i32 7)
%7 = tail call i32 @addEdge(%struct.graph* %1, i32 2, i32 8, i32 2)
%8 = tail call i32 @addEdge(%struct.graph* %1, i32 2, i32 5, i32 4)
%9 = tail call i32 @addEdge(%struct.graph* %1, i32 3, i32 4, i32 9)
%10 = tail call i32 @addEdge(%struct.graph* %1, i32 3, i32 5, i32 14)
%11 = tail call i32 @addEdge(%struct.graph* %1, i32 4, i32 5, i32 10)
%12 = tail call i32 @addEdge(%struct.graph* %1, i32 5, i32 6, i32 2)
%13 = tail call i32 @addEdge(%struct.graph* %1, i32 6, i32 7, i32 1)
%14 = tail call i32 @addEdge(%struct.graph* %1, i32 6, i32 8, i32 6)
%15 = tail call i32 @addEdge(%struct.graph* %1, i32 7, i32 8, i32 7)
ret %struct.graph* %1
}