#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*/ explorePath(char *);
int /*<<< orphan*/ init(int, char **);
int optind;
int main(int argc, char **argv) {
  init(argc, argv);
  if (optind < argc) {
    do {
      explorePath(argv[optind]);
    } while (++optind < argc);
  } else {
    explorePath(".");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <init@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jge    1193 <main+0x73>
jmp    1159 <main+0x39>
mov    -0x10(%rbp),%rax
mov    0x2e84(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <explorePath@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    0x2e65(%rip),%rcx
mov    %eax,(%rcx)
cmp    -0x8(%rbp),%eax
jl     1159 <main+0x39>
jmp    119f <main+0x7f>
lea    0xe66(%rip),%rdi
call   1040 <explorePath@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
call   1030 <init@plt>
mov    0x2eb3(%rip),%rbx
mov    (%rbx),%eax
cmp    %ebp,%eax
jge    1158 <main+0x38>
nopl   0x0(%rax,%rax,1)
cltq
mov    (%r14,%rax,8),%rdi
call   1040 <explorePath@plt>
mov    (%rbx),%eax
add    $0x1,%eax
mov    %eax,(%rbx)
cmp    %ebp,%eax
jl     1140 <main+0x20>
jmp    1164 <main+0x44>
lea    0xea1(%rip),%rdi
call   1040 <explorePath@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@optind = global i32 0
@.str = [2 x i8] c".\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @init(i32 %0, i8** %1)
%4 = load i32, i32* @optind
%5 = icmp slt i32 %4, %0
br i1 %5, label %6, label %15
6: ; preds = %2, %6
%7 = phi i32 [ %13, %6 ], [ %4, %2 ]
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @explorePath(i8* %10)
%12 = load i32, i32* @optind
%13 = add nsw i32 %12, 1
store i32 %13, i32* @optind
%14 = icmp slt i32 %13, %0
br i1 %14, label %6, label %17
15: ; preds = %2
%16 = tail call i32 @explorePath(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %6, %15
ret i32 0
}