#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*/ do_list(char *, int);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  int a = 0;
  bool flaga = false;
  if (argc == 1)
    do_list(".", flaga);
  else
    while ((++a) < argc) {
      if (strcmp(argv[1], "-a") == 0) {
        flaga = true;
        continue;
      }
      printf("%s", argv[a]);
      do_list(argv[a], flaga);
    }
  return 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)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1172 <main+0x42>
mov    -0x18(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1040 <do_list@plt>
jmp    11e9 <main+0xb9>
jmp    1177 <main+0x47>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmp    -0x8(%rbp),%eax
jge    11e4 <main+0xb4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe6a(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11b3 <main+0x83>
movl   $0x1,-0x18(%rbp)
jmp    1177 <main+0x47>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe3f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x18(%rbp),%esi
call   1040 <do_list@plt>
jmp    1177 <main+0x47>
jmp    11e9 <main+0xb9>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edi,0x4(%rsp)
cmp    $0x1,%edi
jne    1154 <main+0x24>
lea    0xeb5(%rip),%rdi
xor    %esi,%esi
call   1040 <do_list@plt>
jmp    11cc <main+0x9c>
jle    11cc <main+0x9c>
mov    %rsi,%rbx
mov    0x4(%rsp),%r13d
xor    %ebp,%ebp
mov    $0x1,%r14d
lea    0xe95(%rip),%r15
movslq %r14d,%r12
lea    0x1(%r12),%r14d
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x8(%rbx),%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11c0 <main+0x90>
mov    (%rbx,%r12,8),%rsi
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
mov    (%rbx,%r12,8),%rdi
mov    %ebp,%esi
call   1040 <do_list@plt>
add    $0x1,%r12
add    $0x1,%r14d
cmp    %r13,%r12
jl     1180 <main+0x50>
jmp    11cc <main+0x9c>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%ebp
cmp    0x4(%rsp),%r14d
jl     116d <main+0x3d>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"-a\00"
@.str.2 = [3 x i8] c"%s\00"
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 0, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %7
%12 = call i32 @do_list(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %41
13: ; preds = %2
br label %14
14: ; preds = %26, %25, %13
%15 = load i32, i32* %6
%16 = add nsw i32 %15, 1
store i32 %16, i32* %6
%17 = load i32, i32* %4
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %40
19: ; preds = %14
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %19
store i32 1, i32* %7
br label %14
26: ; preds = %19
%27 = load i8**, i8*** %5
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8*, i8** %27, i64 %29
%31 = load i8*, i8** %30
%32 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %31)
%33 = load i8**, i8*** %5
%34 = load i32, i32* %6
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8*, i8** %33, i64 %35
%37 = load i8*, i8** %36
%38 = load i32, i32* %7
%39 = call i32 @do_list(i8* %37, i32 %38)
br label %14
40: ; preds = %14
br label %41
41: ; preds = %40, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"-a\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %32
6: ; preds = %4
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = zext i32 %0 to i64
br label %20
9: ; preds = %2
%10 = tail call i32 @do_list(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
br label %32
11: ; preds = %20, %24
%12 = phi i64 [ %23, %20 ], [ %30, %24 ]
%13 = load i8*, i8** %7
%14 = tail call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %24
16: ; preds = %11
%17 = trunc i64 %12 to i32
%18 = add nsw i32 %17, 1
%19 = icmp slt i32 %18, %0
br i1 %19, label %20, label %32
20: ; preds = %6, %16
%21 = phi i32 [ 1, %6 ], [ %18, %16 ]
%22 = phi i32 [ 0, %6 ], [ 1, %16 ]
%23 = sext i32 %21 to i64
br label %11
24: ; preds = %11
%25 = getelementptr inbounds i8*, i8** %1, i64 %12
%26 = load i8*, i8** %25
%27 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %26)
%28 = load i8*, i8** %25
%29 = tail call i32 @do_list(i8* %28, i32 %22)
%30 = add nsw i64 %12, 1
%31 = icmp slt i64 %30, %8
br i1 %31, label %11, label %32
32: ; preds = %16, %24, %4, %9
ret i32 0
}