#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 /*<<< orphan*/ printGraph(struct graph *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int sink(struct graph *);
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 s = sink(g);
  if (s == -1)
    printf("Not sink in the graph\n");
  else
    printf("there exist a universal in the graph %d\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <adjacencyMatrix@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <printGraph@plt>
mov    -0x18(%rbp),%rdi
call   1050 <sink@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    11c2 <main+0x72>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11d3 <main+0x83>
mov    -0x1c(%rbp),%esi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xe94(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1070 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <adjacencyMatrix@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1080 <printGraph@plt>
mov    %rbx,%rdi
call   1060 <sink@plt>
cmp    $0xffffffff,%eax
je     11c0 <main+0x60>
lea    0xe83(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11cc <main+0x6c>
lea    0xe9a(%rip),%rdi
call   1030 <puts@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 = [23 x i8] c"Not sink in the graph\0A\00"
@.str.3 = [41 x i8] c"there exist a universal in the graph %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.graph*
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call %struct.graph* @adjacencyMatrix(i32 %8, i32 %9)
store %struct.graph* %10, %struct.graph** %4
%11 = load %struct.graph*, %struct.graph** %4
%12 = call i32 @printGraph(%struct.graph* %11)
%13 = load %struct.graph*, %struct.graph** %4
%14 = call i32 @sink(%struct.graph* %13)
store i32 %14, i32* %5
%15 = load i32, i32* %5
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %19
17: ; preds = %0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %22
19: ; preds = %0
%20 = load i32, i32* %5
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %19, %17
%23 = load i32, i32* %1
ret i32 %23
}

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.3 = [41 x i8] c"there exist a universal in the graph %d\0A\00"
@str = [22 x i8] c"Not sink in the graph\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 @sink(%struct.graph* %9)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %17
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i32 %11)
br label %17
17: ; preds = %15, %13
ret i32 0
}