#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 */
struct graph *adjacencyMatrix(int, int);
int connectedComponent(struct graph *);
int /*<<< orphan*/ printGraph(struct graph *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int v, e;
  printf("Enter number of vertices and edges in the graph : ");
  scanf("%d%d", &v, &e);
  struct graph *g = adjacencyMatrix(v, e);
  printGraph(g);
  int c = connectedComponent(g);
  printf("%d is the connectedComponent of the graph\n", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <adjacencyMatrix@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <printGraph@plt>
mov    -0x10(%rbp),%rdi
call   1060 <connectedComponent@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1030 <adjacencyMatrix@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <printGraph@plt>
mov    %rbx,%rdi
call   1060 <connectedComponent@plt>
lea    0xe98(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.graph = type { i32 }
@.str = [51 x i8] c"Enter number of vertices and edges in the graph : \00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [43 x i8] c"%d is the connectedComponent of the graph\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.graph*
%4 = alloca i32
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call %struct.graph* @adjacencyMatrix(i32 %7, i32 %8)
store %struct.graph* %9, %struct.graph** %3
%10 = load %struct.graph*, %struct.graph** %3
%11 = call i32 @printGraph(%struct.graph* %10)
%12 = load %struct.graph*, %struct.graph** %3
%13 = call i32 @connectedComponent(%struct.graph* %12)
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
%struct.graph = type { i32 }
@.str = [51 x i8] c"Enter number of vertices and edges in the graph : \00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [43 x i8] c"%d is the connectedComponent of the graph\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call %struct.graph* @adjacencyMatrix(i32 %7, i32 %8)
%10 = call i32 @printGraph(%struct.graph* %9)
%11 = call i32 @connectedComponent(%struct.graph* %9)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret i32 0
}