#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*/ createGraph(struct Graph *, int, int);
struct Graph *initGraph(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ showAllGraph(struct Graph *);
int main() {
  int vertices = 1;
  struct Graph *graph = initGraph(3);
  if (graph == NULL)
    printf("Failed to allocate memory");
  createGraph(graph, 1, 2);
  createGraph(graph, 1, 3);
  createGraph(graph, 1, 5);
  createGraph(graph, 1, 4);
  createGraph(graph, 2, 2);
  createGraph(graph, 3, 25);
  createGraph(graph, 2, 5);
  createGraph(graph, 2, 4);
  showAllGraph(graph);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    $0x3,%edi
call   1030 <initGraph@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117b <main+0x3b>
lea    0xe8a(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1060 <createGraph@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   1060 <createGraph@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x5,%edx
call   1060 <createGraph@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1060 <createGraph@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%edx
mov    %edx,%esi
call   1060 <createGraph@plt>
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
mov    $0x19,%edx
call   1060 <createGraph@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
mov    $0x5,%edx
call   1060 <createGraph@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
mov    $0x4,%edx
call   1060 <createGraph@plt>
mov    -0x10(%rbp),%rdi
call   1040 <showAllGraph@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%edi
call   1030 <initGraph@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115f <main+0x1f>
lea    0xea6(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1060 <createGraph@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   1060 <createGraph@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x5,%edx
call   1060 <createGraph@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1060 <createGraph@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
call   1060 <createGraph@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x19,%edx
call   1060 <createGraph@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x5,%edx
call   1060 <createGraph@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x4,%edx
call   1060 <createGraph@plt>
mov    %rbx,%rdi
call   1040 <showAllGraph@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.Graph = type { i32 }
@.str = [26 x i8] c"Failed to allocate memory\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.Graph*
store i32 0, i32* %1
store i32 1, i32* %2
%4 = call %struct.Graph* @initGraph(i32 3)
store %struct.Graph* %4, %struct.Graph** %3
%5 = load %struct.Graph*, %struct.Graph** %3
%6 = icmp eq %struct.Graph* %5, null
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = load %struct.Graph*, %struct.Graph** %3
%11 = call i32 @createGraph(%struct.Graph* %10, i32 1, i32 2)
%12 = load %struct.Graph*, %struct.Graph** %3
%13 = call i32 @createGraph(%struct.Graph* %12, i32 1, i32 3)
%14 = load %struct.Graph*, %struct.Graph** %3
%15 = call i32 @createGraph(%struct.Graph* %14, i32 1, i32 5)
%16 = load %struct.Graph*, %struct.Graph** %3
%17 = call i32 @createGraph(%struct.Graph* %16, i32 1, i32 4)
%18 = load %struct.Graph*, %struct.Graph** %3
%19 = call i32 @createGraph(%struct.Graph* %18, i32 2, i32 2)
%20 = load %struct.Graph*, %struct.Graph** %3
%21 = call i32 @createGraph(%struct.Graph* %20, i32 3, i32 25)
%22 = load %struct.Graph*, %struct.Graph** %3
%23 = call i32 @createGraph(%struct.Graph* %22, i32 2, i32 5)
%24 = load %struct.Graph*, %struct.Graph** %3
%25 = call i32 @createGraph(%struct.Graph* %24, i32 2, i32 4)
%26 = load %struct.Graph*, %struct.Graph** %3
%27 = call i32 @showAllGraph(%struct.Graph* %26)
ret i32 0
}

LLVM IR (-O2):
%struct.Graph = type { i32 }
@.str = [26 x i8] c"Failed to allocate memory\00"
define i32 @main() {
%1 = tail call %struct.Graph* @initGraph(i32 3)
%2 = icmp eq %struct.Graph* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @createGraph(%struct.Graph* %1, i32 1, i32 2)
%7 = tail call i32 @createGraph(%struct.Graph* %1, i32 1, i32 3)
%8 = tail call i32 @createGraph(%struct.Graph* %1, i32 1, i32 5)
%9 = tail call i32 @createGraph(%struct.Graph* %1, i32 1, i32 4)
%10 = tail call i32 @createGraph(%struct.Graph* %1, i32 2, i32 2)
%11 = tail call i32 @createGraph(%struct.Graph* %1, i32 3, i32 25)
%12 = tail call i32 @createGraph(%struct.Graph* %1, i32 2, i32 5)
%13 = tail call i32 @createGraph(%struct.Graph* %1, i32 2, i32 4)
%14 = tail call i32 @showAllGraph(%struct.Graph* %1)
ret i32 0
}