#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 */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void DepthFirstSearch(int graph[10][10], int visited[10], int vertex) {
  printf("vertex %d\n", vertex);
  visited[vertex] = 1;
  int i;
  for (i = 0; i < 10; i++) {
    if (!visited[i] && graph[vertex][i]) {
      DepthFirstSearch(graph, visited, i);
    }
  }
}


x86 assembly (clang, -O0):
<DepthFirstSearch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
movl   $0x0,-0x18(%rbp)
cmpl   $0xa,-0x18(%rbp)
jge    11b4 <DepthFirstSearch+0x94>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    11a1 <DepthFirstSearch+0x81>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     11a1 <DepthFirstSearch+0x81>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1030 <DepthFirstSearch@plt>
jmp    11a6 <DepthFirstSearch+0x86>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1158 <DepthFirstSearch+0x38>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DepthFirstSearch>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xecd(%rip),%rdi
mov    %edx,%esi
call   1040 <printf@plt>
movslq %ebp,%rbp
movl   $0x1,(%rbx,%rbp,4)
cmpl   $0x0,(%rbx)
jne    1168 <DepthFirstSearch+0x48>
lea    0x0(,%rbp,4),%rax
add    %rbp,%rax
cmpl   $0x0,(%r14,%rax,8)
je     1168 <DepthFirstSearch+0x48>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <DepthFirstSearch@plt>
cmpl   $0x0,0x4(%rbx)
jne    1191 <DepthFirstSearch+0x71>
lea    0x0(,%rbp,4),%rax
add    %rbp,%rax
cmpl   $0x0,0x4(%r14,%rax,8)
je     1191 <DepthFirstSearch+0x71>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <DepthFirstSearch@plt>
cmpl   $0x0,0x8(%rbx)
jne    11ba <DepthFirstSearch+0x9a>
lea    0x0(,%rbp,4),%rax
add    %rbp,%rax
cmpl   $0x0,0x8(%r14,%rax,8)
je     11ba <DepthFirstSearch+0x9a>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1030 <DepthFirstSearch@plt>
cmpl   $0x0,0xc(%rbx)
jne    11e3 <DepthFirstSearch+0xc3>
lea    0x0(,%rbp,4),%rax
add    %rbp,%rax
cmpl   $0x0,0xc(%r14,%rax,8)
je     11e3 <DepthFirstSearch+0xc3>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1030 <DepthFirstSearch@plt>
cmpl   $0x0,0x10(%rbx)
jne    120c <DepthFirstSearch+0xec>
lea    0x0(,%rbp,4),%rax
add    %rbp,%rax
cmpl   $0x0,0x10(%r14,%rax,8)
je     120c <DepthFirstSearch+0xec>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <DepthFirstSearch@plt>
cmpl   $0x0,0x14(%rbx)
jne    1235 <DepthFirstSearch+0x115>
lea    0x0(,%rbp,4),%rax
add    %rbp,%rax
cmpl   $0x0,0x14(%r14,%rax,8)
je     1235 <DepthFirstSearch+0x115>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x5,%edx
call   1030 <DepthFirstSearch@plt>
cmpl   $0x0,0x18(%rbx)
jne    125e <DepthFirstSearch+0x13e>
lea    0x0(,%rbp,4),%rax
add    %rbp,%rax
cmpl   $0x0,0x18(%r14,%rax,8)
je     125e <DepthFirstSearch+0x13e>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x6,%edx
call   1030 <DepthFirstSearch@plt>
cmpl   $0x0,0x1c(%rbx)
jne    1287 <DepthFirstSearch+0x167>
lea    0x0(,%rbp,4),%rax
add    %rbp,%rax
cmpl   $0x0,0x1c(%r14,%rax,8)
je     1287 <DepthFirstSearch+0x167>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x7,%edx
call   1030 <DepthFirstSearch@plt>
cmpl   $0x0,0x20(%rbx)
jne    12b0 <DepthFirstSearch+0x190>
lea    0x0(,%rbp,4),%rax
add    %rbp,%rax
cmpl   $0x0,0x20(%r14,%rax,8)
je     12b0 <DepthFirstSearch+0x190>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <DepthFirstSearch@plt>
cmpl   $0x0,0x24(%rbx)
je     12bb <DepthFirstSearch+0x19b>
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0x0(,%rbp,4),%rax
add    %rbp,%rax
cmpl   $0x0,0x24(%r14,%rax,8)
je     12b6 <DepthFirstSearch+0x196>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x9,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <DepthFirstSearch@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"vertex %d\0A\00"
define void @DepthFirstSearch([10 x i32]* %0, i32* %1, i32 %2) {
%4 = alloca [10 x i32]*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store [10 x i32]* %0, [10 x i32]** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32*, i32** %5
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
store i32 1, i32* %13
store i32 0, i32* %7
br label %14
14: ; preds = %39, %3
%15 = load i32, i32* %7
%16 = icmp slt i32 %15, 10
br i1 %16, label %17, label %42
17: ; preds = %14
%18 = load i32*, i32** %5
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = icmp ne i32 %22, 0
br i1 %23, label %38, label %24
24: ; preds = %17
%25 = load [10 x i32]*, [10 x i32]** %4
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %25, i64 %27
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [10 x i32], [10 x i32]* %28, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %38
34: ; preds = %24
%35 = load [10 x i32]*, [10 x i32]** %4
%36 = load i32*, i32** %5
%37 = load i32, i32* %7
br label %38
38: ; preds = %34, %24, %17
br label %39
39: ; preds = %38
%40 = load i32, i32* %7
%41 = add nsw i32 %40, 1
store i32 %41, i32* %7
br label %14
42: ; preds = %14
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"vertex %d\0A\00"
define void @DepthFirstSearch([10 x i32]* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i32, i32* %1, i64 %5
store i32 1, i32* %6
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 %5, i64 0
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %9
tail call void @DepthFirstSearch([10 x i32]* %0, i32* %1, i32 0)
br label %14
14: ; preds = %3, %9, %13
%15 = getelementptr inbounds i32, i32* %1, i64 1
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 %5, i64 1
%20 = load i32, i32* %19
%21 = icmp eq i32 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %18
tail call void @DepthFirstSearch([10 x i32]* %0, i32* %1, i32 1)
br label %23
23: ; preds = %22, %18, %14
%24 = getelementptr inbounds i32, i32* %1, i64 2
%25 = load i32, i32* %24
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %32
27: ; preds = %23
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 %5, i64 2
%29 = load i32, i32* %28
%30 = icmp eq i32 %29, 0
br i1 %30, label %32, label %31
31: ; preds = %27
tail call void @DepthFirstSearch([10 x i32]* %0, i32* %1, i32 2)
br label %32
32: ; preds = %31, %27, %23
%33 = getelementptr inbounds i32, i32* %1, i64 3
%34 = load i32, i32* %33
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %41
36: ; preds = %32
%37 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 %5, i64 3
%38 = load i32, i32* %37
%39 = icmp eq i32 %38, 0
br i1 %39, label %41, label %40
40: ; preds = %36
tail call void @DepthFirstSearch([10 x i32]* %0, i32* %1, i32 3)
br label %41
41: ; preds = %40, %36, %32
%42 = getelementptr inbounds i32, i32* %1, i64 4
%43 = load i32, i32* %42
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %50
45: ; preds = %41
%46 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 %5, i64 4
%47 = load i32, i32* %46
%48 = icmp eq i32 %47, 0
br i1 %48, label %50, label %49
49: ; preds = %45
tail call void @DepthFirstSearch([10 x i32]* %0, i32* %1, i32 4)
br label %50
50: ; preds = %49, %45, %41
%51 = getelementptr inbounds i32, i32* %1, i64 5
%52 = load i32, i32* %51
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %59
54: ; preds = %50
%55 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 %5, i64 5
%56 = load i32, i32* %55
%57 = icmp eq i32 %56, 0
br i1 %57, label %59, label %58
58: ; preds = %54
tail call void @DepthFirstSearch([10 x i32]* %0, i32* %1, i32 5)
br label %59
59: ; preds = %58, %54, %50
%60 = getelementptr inbounds i32, i32* %1, i64 6
%61 = load i32, i32* %60
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %68
63: ; preds = %59
%64 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 %5, i64 6
%65 = load i32, i32* %64
%66 = icmp eq i32 %65, 0
br i1 %66, label %68, label %67
67: ; preds = %63
tail call void @DepthFirstSearch([10 x i32]* %0, i32* %1, i32 6)
br label %68
68: ; preds = %67, %63, %59
%69 = getelementptr inbounds i32, i32* %1, i64 7
%70 = load i32, i32* %69
%71 = icmp eq i32 %70, 0
br i1 %71, label %72, label %77
72: ; preds = %68
%73 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 %5, i64 7
%74 = load i32, i32* %73
%75 = icmp eq i32 %74, 0
br i1 %75, label %77, label %76
76: ; preds = %72
tail call void @DepthFirstSearch([10 x i32]* %0, i32* %1, i32 7)
br label %77
77: ; preds = %76, %72, %68
%78 = getelementptr inbounds i32, i32* %1, i64 8
%79 = load i32, i32* %78
%80 = icmp eq i32 %79, 0
br i1 %80, label %81, label %86
81: ; preds = %77
%82 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 %5, i64 8
%83 = load i32, i32* %82
%84 = icmp eq i32 %83, 0
br i1 %84, label %86, label %85
85: ; preds = %81
tail call void @DepthFirstSearch([10 x i32]* %0, i32* %1, i32 8)
br label %86
86: ; preds = %85, %81, %77
%87 = getelementptr inbounds i32, i32* %1, i64 9
%88 = load i32, i32* %87
%89 = icmp eq i32 %88, 0
br i1 %89, label %90, label %95
90: ; preds = %86
%91 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 %5, i64 9
%92 = load i32, i32* %91
%93 = icmp eq i32 %92, 0
br i1 %93, label %95, label %94
94: ; preds = %90
tail call void @DepthFirstSearch([10 x i32]* %0, i32* %1, i32 9)
br label %95
95: ; preds = %94, %90, %86
ret void
}