#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*/ DFS(char *, int, char *);
int /*<<< orphan*/ EXIT_FAILURE;
int atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char **argv) {
  if (argc != 4) {
    fprintf(stderr, "Usage: %s directory search_of_depth name\n", argv[0]);
    exit(EXIT_FAILURE);
  }
  int deep = atoi(argv[2]);
  char directory[1000];
  char file[1000];
  strcpy(directory, argv[1]);
  strcpy(file, argv[3]);
  DFS(directory, deep, file);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     119d <main+0x4d>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe76(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
lea    -0x400(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x7f0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x400(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x7f0(%rbp),%rdx
call   1050 <DFS@plt>
xor    %eax,%eax
add    $0x7f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x7e0,%rsp
mov    %rsi,%rbx
cmp    $0x4,%edi
jne    11ac <main+0x5c>
mov    0x10(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebp
mov    0x8(%rbx),%rsi
lea    0x3f0(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    0x18(%rbx),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1050 <DFS@plt>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe41(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e0d(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"Usage: %s directory search_of_depth name\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [1000 x i8]
%8 = alloca [1000 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 4
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i32, i32* @EXIT_FAILURE
%18 = call i32 @exit(i32 %17)
unreachable
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
%23 = call i32 @atoi(i8* %22)
store i32 %23, i32* %6
%24 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32 @strcpy(i8* %24, i8* %27)
%29 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 3
%32 = load i8*, i8** %31
%33 = call i32 @strcpy(i8* %29, i8* %32)
%34 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%35 = load i32, i32* %6
%36 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%37 = call i32 @DFS(i8* %34, i32 %35, i8* %36)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"Usage: %s directory search_of_depth name\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1000 x i8]
%4 = alloca [1000 x i8]
%5 = icmp eq i32 %0, 4
br i1 %5, label %12, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @EXIT_FAILURE
%11 = tail call i32 @exit(i32 %10)
unreachable
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
%15 = tail call i32 @atoi(i8* %14)
%16 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%17 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%18 = getelementptr inbounds i8*, i8** %1, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @strcpy(i8* %16, i8* %19)
%21 = getelementptr inbounds i8*, i8** %1, i64 3
%22 = load i8*, i8** %21
%23 = call i32 @strcpy(i8* %17, i8* %22)
%24 = call i32 @DFS(i8* %16, i32 %15, i8* %17)
ret i32 0
}