#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*/ path_to_inode(char *);
int /*<<< orphan*/ print_filesystem(int /*<<< orphan*/);
int /*<<< orphan*/ print_filesystem_r(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  if (argc < 2)
    return 1;
  if (!strcmp(argv[1], "-r") && argc > 2) {
    print_filesystem_r(path_to_inode(argv[2]), 0);
  } else {
    print_filesystem(path_to_inode(argv[1]));
  }
  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)
cmpl   $0x2,-0x8(%rbp)
jge    116c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    11c9 <main+0x89>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe85(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11ae <main+0x6e>
cmpl   $0x2,-0x8(%rbp)
jle    11ae <main+0x6e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <path_to_inode@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1050 <print_filesystem_r@plt>
jmp    11c2 <main+0x82>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <path_to_inode@plt>
mov    %eax,%edi
call   1030 <print_filesystem@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jl     1199 <main+0x59>
mov    %rsi,%r15
mov    %edi,%ebx
mov    0x8(%rsi),%r14
lea    0xe9f(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
cmp    $0x2,%ebx
je     1188 <main+0x48>
test   %eax,%eax
jne    1188 <main+0x48>
mov    0x10(%r15),%rdi
call   1060 <path_to_inode@plt>
xor    %ebp,%ebp
mov    %eax,%edi
xor    %esi,%esi
call   1050 <print_filesystem_r@plt>
jmp    1199 <main+0x59>
mov    %r14,%rdi
call   1060 <path_to_inode@plt>
mov    %eax,%edi
call   1030 <print_filesystem@plt>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-r\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 = icmp slt i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %31
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @strcmp(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%14 = icmp ne i32 %13, 0
br i1 %14, label %24, label %15
15: ; preds = %9
%16 = load i32, i32* %4
%17 = icmp sgt i32 %16, 2
br i1 %17, label %18, label %24
18: ; preds = %15
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 2
%21 = load i8*, i8** %20
%22 = call i32 @path_to_inode(i8* %21)
%23 = call i32 @print_filesystem_r(i32 %22, i32 0)
br label %30
24: ; preds = %15, %9
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32 @path_to_inode(i8* %27)
%29 = call i32 @print_filesystem(i32 %28)
br label %30
30: ; preds = %24, %18
store i32 0, i32* %3
br label %31
31: ; preds = %30, %8
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
@.str = [3 x i8] c"-r\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %19, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
%9 = icmp ne i32 %0, 2
%10 = and i1 %9, %8
br i1 %10, label %11, label %16
11: ; preds = %4
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i32 @path_to_inode(i8* %13)
%15 = tail call i32 @print_filesystem_r(i32 %14, i32 0)
br label %19
16: ; preds = %4
%17 = tail call i32 @path_to_inode(i8* %6)
%18 = tail call i32 @print_filesystem(i32 %17)
br label %19
19: ; preds = %11, %16, %2
%20 = phi i32 [ 1, %2 ], [ 0, %16 ], [ 0, %11 ]
ret i32 %20
}