#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 */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ getcwd(char *, int);
int /*<<< orphan*/ listInode(char *, int);
scalar_t__ lstat(char *, struct stat *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int i = 0;
  struct stat s;
  char buff[257];
  if (argc < 2) {
    getcwd(buff, 256);
    if (lstat(buff, &s) == 0) {
      printf("Verz '%s'\n", buff);
      listInode(buff, 1);
      printf("\n");
    } else {
      fprintf(stderr, "Fehler bei Datei '%s': ", buff);
      perror("");
    }
  }
  for (i = 1; i < argc; i++) {
    if (lstat(argv[i], &s) == 0) {
      printf("Verz '%s'\n", argv[i]);
      listInode(argv[i], 1);
      printf("\n");
    } else {
      fprintf(stderr, "Fehler bei Datei '%s': ", argv[i]);
      perror("");
    }
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    122b <main+0xbb>
lea    -0x120(%rbp),%rdi
mov    $0x100,%esi
call   1040 <getcwd@plt>
lea    -0x120(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <lstat@plt>
cmp    $0x0,%rax
jne    11fe <main+0x8e>
lea    -0x120(%rbp),%rsi
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x120(%rbp),%rdi
mov    $0x1,%esi
call   1080 <listInode@plt>
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1226 <main+0xb6>
mov    0x2ddb(%rip),%rax
mov    (%rax),%edi
lea    -0x120(%rbp),%rdx
lea    0xdf6(%rip),%rsi
call   1060 <fprintf@plt>
lea    0xde9(%rip),%rdi
call   1070 <perror@plt>
jmp    122b <main+0xbb>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12e0 <main+0x170>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <lstat@plt>
cmp    $0x0,%rax
jne    12a0 <main+0x130>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xd90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x1,%esi
call   1080 <listInode@plt>
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12cd <main+0x15d>
mov    0x2d39(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xd4f(%rip),%rsi
call   1060 <fprintf@plt>
lea    0xd42(%rip),%rdi
call   1070 <perror@plt>
jmp    12d2 <main+0x162>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1232 <main+0xc2>
xor    %edi,%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
cmp    $0x1,%edi
jg     11eb <main+0x6b>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1050 <getcwd@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <lstat@plt>
test   %rax,%rax
je     1279 <main+0xf9>
mov    0x2e1b(%rip),%rax
mov    (%rax),%edi
lea    0xe3d(%rip),%rsi
lea    0x10(%rsp),%rdx
call   1070 <fprintf@plt>
lea    0xe2b(%rip),%rdi
call   1080 <perror@plt>
xor    %edi,%edi
call   10a0 <exit@plt>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x1,%r12d
lea    0x8(%rsp),%r14
lea    0xdfe(%rip),%r15
lea    0xe01(%rip),%r13
jmp    1239 <main+0xb9>
mov    0x2dce(%rip),%rax
mov    (%rax),%edi
mov    (%rbx,%r12,8),%rdx
lea    0xdec(%rip),%rsi
call   1070 <fprintf@plt>
mov    %r13,%rdi
call   1080 <perror@plt>
nopl   0x0(%rax)
add    $0x1,%r12
cmp    %r12,%rbp
je     1272 <main+0xf2>
mov    (%rbx,%r12,8),%rdi
mov    %r14,%rsi
call   1060 <lstat@plt>
test   %rax,%rax
jne    120b <main+0x8b>
mov    (%rbx,%r12,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx,%r12,8),%rdi
mov    $0x1,%esi
call   1090 <listInode@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1230 <main+0xb0>
xor    %edi,%edi
call   10a0 <exit@plt>
lea    0xd80(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1090 <listInode@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [11 x i8] c"Verz '%s'\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@stderr = global i32 0
@.str.2 = [24 x i8] c"Fehler bei Datei '%s': \00"
@.str.3 = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca %struct.stat
%8 = alloca [257 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %29
11: ; preds = %2
%12 = getelementptr inbounds [257 x i8], [257 x i8]* %8, i64 0, i64 0
%13 = call i32 @getcwd(i8* %12, i32 256)
%14 = getelementptr inbounds [257 x i8], [257 x i8]* %8, i64 0, i64 0
%15 = call i64 @lstat(i8* %14, %struct.stat* %7)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %11
%18 = getelementptr inbounds [257 x i8], [257 x i8]* %8, i64 0, i64 0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [257 x i8], [257 x i8]* %8, i64 0, i64 0
%21 = call i32 @listInode(i8* %20, i32 1)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %28
23: ; preds = %11
%24 = load i32, i32* @stderr
%25 = getelementptr inbounds [257 x i8], [257 x i8]* %8, i64 0, i64 0
%26 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %25)
%27 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
br label %28
28: ; preds = %23, %17
br label %29
29: ; preds = %28, %2
store i32 1, i32* %6
br label %30
30: ; preds = %66, %29
%31 = load i32, i32* %6
%32 = load i32, i32* %4
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %69
34: ; preds = %30
%35 = load i8**, i8*** %5
%36 = load i32, i32* %6
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8*, i8** %35, i64 %37
%39 = load i8*, i8** %38
%40 = call i64 @lstat(i8* %39, %struct.stat* %7)
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %56
42: ; preds = %34
%43 = load i8**, i8*** %5
%44 = load i32, i32* %6
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8*, i8** %43, i64 %45
%47 = load i8*, i8** %46
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %47)
%49 = load i8**, i8*** %5
%50 = load i32, i32* %6
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8*, i8** %49, i64 %51
%53 = load i8*, i8** %52
%54 = call i32 @listInode(i8* %53, i32 1)
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %65
56: ; preds = %34
%57 = load i32, i32* @stderr
%58 = load i8**, i8*** %5
%59 = load i32, i32* %6
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8*, i8** %58, i64 %60
%62 = load i8*, i8** %61
%63 = call i32 @fprintf(i32 %57, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %62)
%64 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
br label %65
65: ; preds = %56, %42
br label %66
66: ; preds = %65
%67 = load i32, i32* %6
%68 = add nsw i32 %67, 1
store i32 %68, i32* %6
br label %30
69: ; preds = %30
%70 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [11 x i8] c"Verz '%s'\0A\00"
@stderr = global i32 0
@.str.2 = [24 x i8] c"Fehler bei Datei '%s': \00"
@.str.3 = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
%4 = alloca [257 x i8]
%5 = bitcast %struct.stat* %3 to i8*
%6 = getelementptr inbounds [257 x i8], [257 x i8]* %4, i64 0, i64 0
%7 = icmp slt i32 %0, 2
br i1 %7, label %8, label %20
8: ; preds = %2
%9 = call i32 @getcwd(i8* %6, i32 256)
%10 = call i64 @lstat(i8* %6, %struct.stat* %3)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %6)
%14 = call i32 @listInode(i8* %6, i32 1)
%15 = call i32 @putchar(i32 10)
br label %42
16: ; preds = %8
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%19 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
br label %42
20: ; preds = %2
%21 = zext i32 %0 to i64
br label %22
22: ; preds = %20, %39
%23 = phi i64 [ 1, %20 ], [ %40, %39 ]
%24 = getelementptr inbounds i8*, i8** %1, i64 %23
%25 = load i8*, i8** %24
%26 = call i64 @lstat(i8* %25, %struct.stat* %3)
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %34
28: ; preds = %22
%29 = load i8*, i8** %24
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %29)
%31 = load i8*, i8** %24
%32 = call i32 @listInode(i8* %31, i32 1)
%33 = call i32 @putchar(i32 10)
br label %39
34: ; preds = %22
%35 = load i32, i32* @stderr
%36 = load i8*, i8** %24
%37 = call i32 @fprintf(i32 %35, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %36)
%38 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
br label %39
39: ; preds = %28, %34
%40 = add nuw nsw i64 %23, 1
%41 = icmp eq i64 %40, %21
br i1 %41, label %42, label %22
42: ; preds = %39, %16, %12
%43 = call i32 @exit(i32 0)
unreachable
}