#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*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int find_directory(char *);
int main(int argc, char *argv[]) {
  int i;
  int ok;
  i = 1;
  while (i < argc) {
    ok = find_directory(argv[i]);
    if (!ok) {
      exit(EXIT_FAILURE);
    }
    i++;
  }
  if (argc == 1) {
    find_directory(".");
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1183 <main+0x63>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <find_directory@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    1175 <main+0x55>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
cmpl   $0x1,-0x8(%rbp)
jne    1199 <main+0x79>
lea    0xe6c(%rip),%rdi
call   1030 <find_directory@plt>
mov    0x2e38(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
cmp    $0x2,%edi
jl     1156 <main+0x36>
mov    %rsi,%r15
mov    %r14d,%ebp
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
call   1030 <find_directory@plt>
test   %eax,%eax
je     117c <main+0x5c>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <main+0x20>
cmp    $0x1,%r14d
jne    1168 <main+0x48>
lea    0xe9d(%rip),%rdi
call   1030 <find_directory@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [2 x i8] c".\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
br label %8
8: ; preds = %24, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %27
12: ; preds = %8
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @find_directory(i8* %17)
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = icmp ne i32 %19, 0
br i1 %20, label %24, label %21
21: ; preds = %12
%22 = load i32, i32* @EXIT_FAILURE
%23 = call i32 @exit(i32 %22)
unreachable
24: ; preds = %12
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %6
br label %8
27: ; preds = %8
%28 = load i32, i32* %4
%29 = icmp eq i32 %28, 1
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 @find_directory(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %32
32: ; preds = %30, %27
%33 = load i32, i32* @EXIT_SUCCESS
ret i32 %33
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [2 x i8] c".\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %14, %5
br i1 %7, label %18, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 1, %4 ], [ %14, %6 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @find_directory(i8* %11)
%13 = icmp eq i32 %12, 0
%14 = add nuw nsw i64 %9, 1
br i1 %13, label %15, label %6
15: ; preds = %8
%16 = load i32, i32* @EXIT_FAILURE
%17 = tail call i32 @exit(i32 %16)
unreachable
18: ; preds = %6, %2
%19 = icmp eq i32 %0, 1
br i1 %19, label %20, label %22
20: ; preds = %18
%21 = tail call i32 @find_directory(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %20, %18
%23 = load i32, i32* @EXIT_SUCCESS
ret i32 %23
}