#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*/ bfs();
int /*<<< orphan*/ create();
int /*<<< orphan*/ dfs();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int ch;
  create();
  while (1) {
    printf("\n1: DFS\n2: BSF\n3: Exit\nEnter your choice: ");
    scanf("%d", &ch);
    switch (ch) {
    case 1:
      dfs();
      break;
    case 2:
      bfs();
      break;
    case 3:
      exit(0);
      break;
    default:
      printf("Incorrect choice!\n");
    }
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <create@plt>
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
lea    0xea2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     11c8 <main+0x68>
jmp    11a6 <main+0x46>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     11d4 <main+0x74>
jmp    11b7 <main+0x57>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     11e0 <main+0x80>
jmp    11e7 <main+0x87>
mov    $0x0,%al
call   1080 <dfs@plt>
jmp    11f3 <main+0x93>
mov    $0x0,%al
call   1040 <bfs@plt>
jmp    11f3 <main+0x93>
xor    %edi,%edi
call   1070 <exit@plt>
lea    0xe40(%rip),%rdi
call   1030 <printf@plt>
jmp    1176 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <create@plt>
lea    0xe7a(%rip),%r14
lea    0xe9e(%rip),%r15
lea    0x4(%rsp),%rbx
lea    0xe95(%rip),%r12
jmp    11a7 <main+0x37>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <bfs@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x1,%eax
je     11e0 <main+0x70>
cmp    $0x2,%eax
je     11a0 <main+0x30>
cmp    $0x3,%eax
je     11e9 <main+0x79>
mov    %r12,%rdi
call   1030 <puts@plt>
jmp    11a7 <main+0x37>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1090 <dfs@plt>
jmp    11a7 <main+0x37>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"\0A1: DFS\0A2: BSF\0A3: Exit\0AEnter your choice: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"Incorrect choice!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @create()
br label %4
4: ; preds = %0, %16
%5 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
switch i32 %7, label %14 [
i32 1, label %8
i32 2, label %10
i32 3, label %12
]
8: ; preds = %4
%9 = call i32 (...) @dfs()
br label %16
10: ; preds = %4
%11 = call i32 (...) @bfs()
br label %16
12: ; preds = %4
%13 = call i32 @exit(i32 0)
unreachable
14: ; preds = %4
%15 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %16
16: ; preds = %14, %10, %8
br label %4
}

LLVM IR (-O2):
@.str = [43 x i8] c"\0A1: DFS\0A2: BSF\0A3: Exit\0AEnter your choice: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [18 x i8] c"Incorrect choice!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @create()
br label %4
4: ; preds = %16, %0
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
switch i32 %7, label %14 [
i32 1, label %8
i32 2, label %10
i32 3, label %12
]
8: ; preds = %4
%9 = call i32 (...) @dfs()
br label %16
10: ; preds = %4
%11 = call i32 (...) @bfs()
br label %16
12: ; preds = %4
%13 = call i32 @exit(i32 0)
unreachable
14: ; preds = %4
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %16
16: ; preds = %14, %10, %8
br label %4
}