#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 st_size;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *, int);
scalar_t__ stat(char *, struct stat *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int i = 0;
  struct stat s;
  if (argc < 2) {
    fprintf(stderr, "Keine Datei(en) angegeben!\n");
    exit(1);
  }
  for (i = 1; i < argc; i++) {
    if (stat(argv[i], &s) == 0) {
      printf("Datei '%s' \t.. Größe: %d Bytes\n", argv[i], s.st_size);
    } else {
      fprintf(stderr, "Fehler bei Datei '%s': ", argv[i]);
      perror("");
    }
  }
  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)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1198 <main+0x48>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
lea    0xe79(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    122c <main+0xdc>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <stat@plt>
cmp    $0x0,%rax
jne    11ea <main+0x9a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x18(%rbp),%edx
lea    0xe3c(%rip),%rdi
call   1030 <printf@plt>
jmp    1219 <main+0xc9>
mov    0x2def(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe38(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
lea    0xe07(%rip),%rdi
call   1060 <perror@plt>
jmp    121e <main+0xce>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    119f <main+0x4f>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jge    1181 <main+0x31>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x1,%r12d
mov    %rsp,%r14
lea    0xe86(%rip),%r15
lea    0xe7e(%rip),%r13
jmp    11b8 <main+0x68>
nop
mov    (%rbx,%r12,8),%rsi
mov    (%rsp),%edx
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%r12
cmp    %r12,%rbp
je     11ee <main+0x9e>
mov    (%rbx,%r12,8),%rdi
mov    %r14,%rsi
call   1050 <stat@plt>
test   %rax,%rax
je     11a0 <main+0x50>
mov    0x2e10(%rip),%rax
mov    (%rax),%edi
mov    (%rbx,%r12,8),%rdx
lea    0xe61(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %r13,%rdi
call   1060 <perror@plt>
jmp    11af <main+0x5f>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [28 x i8] c"Keine Datei(en) angegeben!\0A\00"
@.str.1 = [34 x i8] c"Datei '%s' \09.. Gr\C3\B6\C3\9Fe: %d Bytes\0A\00"
@.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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
store i32 1, i32* %6
br label %15
15: ; preds = %46, %14
%16 = load i32, i32* %6
%17 = load i32, i32* %4
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %49
19: ; preds = %15
%20 = load i8**, i8*** %5
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8*, i8** %20, i64 %22
%24 = load i8*, i8** %23
%25 = call i64 @stat(i8* %24, %struct.stat* %7)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %36
27: ; preds = %19
%28 = load i8**, i8*** %5
%29 = load i32, i32* %6
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8*, i8** %28, i64 %30
%32 = load i8*, i8** %31
%33 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%34 = load i32, i32* %33
%35 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %32, i32 %34)
br label %45
36: ; preds = %19
%37 = load i32, i32* @stderr
%38 = load i8**, i8*** %5
%39 = load i32, i32* %6
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8*, i8** %38, i64 %40
%42 = load i8*, i8** %41
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %42)
%44 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
br label %45
45: ; preds = %36, %27
br label %46
46: ; preds = %45
%47 = load i32, i32* %6
%48 = add nsw i32 %47, 1
store i32 %48, i32* %6
br label %15
49: ; preds = %15
%50 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [28 x i8] c"Keine Datei(en) angegeben!\0A\00"
@.str.1 = [34 x i8] c"Datei '%s' \09.. Gr\C3\B6\C3\9Fe: %d Bytes\0A\00"
@.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 = bitcast %struct.stat* %3 to i8*
%5 = icmp slt i32 %0, 2
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%8 = zext i32 %0 to i64
br label %13
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %6, %28
%14 = phi i64 [ 1, %6 ], [ %29, %28 ]
%15 = getelementptr inbounds i8*, i8** %1, i64 %14
%16 = load i8*, i8** %15
%17 = call i64 @stat(i8* %16, %struct.stat* %3)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %13
%20 = load i8*, i8** %15
%21 = load i32, i32* %7
%22 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %20, i32 %21)
br label %28
23: ; preds = %13
%24 = load i32, i32* @stderr
%25 = load i8*, i8** %15
%26 = call i32 (i32, i8*, ...) @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 = %19, %23
%29 = add nuw nsw i64 %14, 1
%30 = icmp eq i64 %29, %8
br i1 %30, label %31, label %13
31: ; preds = %28
%32 = call i32 @exit(i32 0)
unreachable
}