#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*/ buscar_en_dir(char *, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (argc == 1) {
    fprintf(stderr, "usage: %s pal [directorios]\n", argv[0]);
  }
  argc--;
  argv++;
  char *palab_comp = argv[0];
  argc--;
  argv++;
  int i = 0;
  if (argc == 0) {
    buscar_en_dir(palab_comp, ".");
  } else {
    for (i = 0; i < argc; i++) {
      buscar_en_dir(palab_comp, argv[i]);
    }
  }
  exit(0);
}


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)
cmpl   $0x1,-0x8(%rbp)
jne    116c <main+0x3c>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe99(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    11c7 <main+0x97>
mov    -0x18(%rbp),%rdi
lea    0xe60(%rip),%rsi
call   1050 <buscar_en_dir@plt>
jmp    1202 <main+0xd2>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11fd <main+0xcd>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1050 <buscar_en_dir@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11ce <main+0x9e>
jmp    1202 <main+0xd2>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
cmp    $0x1,%edi
jne    115f <main+0x2f>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
lea    0xead(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
mov    0x8(%r14),%r15
mov    %edi,%eax
add    $0xfffffffe,%eax
jne    1180 <main+0x50>
lea    0xeac(%rip),%rsi
mov    %r15,%rdi
call   1050 <buscar_en_dir@plt>
xor    %edi,%edi
call   1040 <exit@plt>
cmp    $0x3,%edi
jl     11a6 <main+0x76>
mov    %eax,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    0x10(%r14,%rbx,8),%rsi
mov    %r15,%rdi
call   1050 <buscar_en_dir@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1190 <main+0x60>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"usage: %s pal [directorios]\0A\00"
@.str.1 = [2 x i8] c".\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %10, %2
%17 = load i32, i32* %4
%18 = add nsw i32 %17, -1
store i32 %18, i32* %4
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i32 1
store i8** %20, i8*** %5
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 0
%23 = load i8*, i8** %22
store i8* %23, i8** %6
%24 = load i32, i32* %4
%25 = add nsw i32 %24, -1
store i32 %25, i32* %4
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i32 1
store i8** %27, i8*** %5
store i32 0, i32* %7
%28 = load i32, i32* %4
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %16
%31 = load i8*, i8** %6
%32 = call i32 @buscar_en_dir(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %50
33: ; preds = %16
store i32 0, i32* %7
br label %34
34: ; preds = %46, %33
%35 = load i32, i32* %7
%36 = load i32, i32* %4
%37 = icmp slt i32 %35, %36
br i1 %37, label %38, label %49
38: ; preds = %34
%39 = load i8*, i8** %6
%40 = load i8**, i8*** %5
%41 = load i32, i32* %7
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i8*, i8** %40, i64 %42
%44 = load i8*, i8** %43
%45 = call i32 @buscar_en_dir(i8* %39, i8* %44)
br label %46
46: ; preds = %38
%47 = load i32, i32* %7
%48 = add nsw i32 %47, 1
store i32 %48, i32* %7
br label %34
49: ; preds = %34
br label %50
50: ; preds = %49, %30
%51 = call i32 @exit(i32 0)
unreachable
}

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