#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ readFile(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                            int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                            int /*<<< orphan*/ *);
int /*<<< orphan*/ reconstruct(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  FILE *input, *out1, *out2, *out3, *out4;
  if (argv[1] != NULL) {
    input = fopen(argv[1], "r");
    out1 = fopen("out1.txt", "w");
    out2 = fopen("out2.txt", "w");
    out3 = fopen("out3.txt", "w");
    out4 = fopen("out4.txt", "w");
    if (input != NULL) {
      if (out1 != NULL && out2 != NULL && out3 != NULL && out4 != NULL) {
        readFile(input, out1, out2, out3, out4);
        fclose(input);
        fclose(out1);
        fclose(out2);
        fclose(out3);
        fclose(out4);
        out1 = fopen("out1.txt", "r");
        out2 = fopen("out2.txt", "r");
        out3 = fopen("out3.txt", "r");
        out4 = fopen("out4.txt", "r");
        if (out1 != NULL && out2 != NULL && out3 != NULL && out4 != NULL) {
          if ((input = fopen("rec1.txt", "w")) != NULL) {
            reconstruct(input, out1, out2, out4, 3);
            fclose(input);
          } else
            printf("Rekonstruktionsfile 1 (out2,out3,out4) konnte nicht "
                   "erstellt werden!");
          if ((input = fopen("rec2.txt", "w")) != NULL) {
            reconstruct(input, out1, out3, out4, 2);
            fclose(input);
          } else
            printf("Rekonstruktionsfile 2 (out1,out3,out4) konnte nicht "
                   "erstellt werden!");
          if ((input = fopen("rec3.txt", "w")) != NULL) {
            reconstruct(input, out2, out3, out4, 1);
            fclose(input);
          } else
            printf("Rekonstruktionsfile 3 (out1,out2,out4) konnte nicht "
                   "erstellt werden!");
          if ((input = fopen("rec4.txt", "w")) != NULL) {
            reconstruct(input, out1, out2, out3, 4);
            fclose(input);
          } else
            printf("Rekonstruktionsfile 4 (out1,out2,out3) konnte nicht "
                   "erstellt werden!");
          fclose(out1);
          fclose(out2);
          fclose(out3);
          fclose(out4);
          printf("Die Ausgabedateien out1-out4.txt sowie die "
                 "Rekonstruktionsdateien rec1-rec4.txt wurden erfolgreich im "
                 "Verzeichnis des Programmes erstellt!\n");
        } else {
          printf("Eines der Files zum Einlesen für die Rekonstruktionsdateien "
                 "konnte nicht geöffnet werden!");
          return 1;
        }
      } else {
        printf("Eines der Outputfiles konnte nicht erstellt werden! Das "
               "Programm beendet sich...");
        return 1;
      }
    } else
      printf(
          "Die Eingabedatei existiert nicht! Das Programm beendet sich....\n");
  } else
    printf("Zu wenige Parameter angegeben. Das Programm beendet sich...\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     14c6 <main+0x376>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe7c(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
lea    0xe6e(%rip),%rdi
lea    0xe70(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x20(%rbp)
lea    0xe62(%rip),%rdi
lea    0xe59(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x28(%rbp)
lea    0xe54(%rip),%rdi
lea    0xe42(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x30(%rbp)
lea    0xe46(%rip),%rdi
lea    0xe2b(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     14b5 <main+0x365>
cmpq   $0x0,-0x20(%rbp)
je     1498 <main+0x348>
cmpq   $0x0,-0x28(%rbp)
je     1498 <main+0x348>
cmpq   $0x0,-0x30(%rbp)
je     1498 <main+0x348>
cmpq   $0x0,-0x38(%rbp)
je     1498 <main+0x348>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%r8
call   1070 <readFile@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x30(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x38(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xd95(%rip),%rdi
lea    0xd8c(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x20(%rbp)
lea    0xd89(%rip),%rdi
lea    0xd75(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x28(%rbp)
lea    0xd7b(%rip),%rdi
lea    0xd5e(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x30(%rbp)
lea    0xd6d(%rip),%rdi
lea    0xd47(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     147b <main+0x32b>
cmpq   $0x0,-0x28(%rbp)
je     147b <main+0x32b>
cmpq   $0x0,-0x30(%rbp)
je     147b <main+0x32b>
cmpq   $0x0,-0x38(%rbp)
je     147b <main+0x32b>
lea    0xd33(%rip),%rdi
lea    0xd0f(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1338 <main+0x1e8>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    $0x3,%r8d
call   1030 <reconstruct@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
jmp    1344 <main+0x1f4>
lea    0xcf2(%rip),%rdi
call   1050 <printf@plt>
lea    0xd2b(%rip),%rdi
lea    0xcb9(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     138e <main+0x23e>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    $0x2,%r8d
call   1030 <reconstruct@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
jmp    139a <main+0x24a>
lea    0xcea(%rip),%rdi
call   1050 <printf@plt>
lea    0xd23(%rip),%rdi
lea    0xc63(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     13e4 <main+0x294>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <reconstruct@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
jmp    13f0 <main+0x2a0>
lea    0xce2(%rip),%rdi
call   1050 <printf@plt>
lea    0xd1b(%rip),%rdi
lea    0xc0d(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     143a <main+0x2ea>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <reconstruct@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
jmp    1446 <main+0x2f6>
lea    0xcda(%rip),%rdi
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x30(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x38(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xcef(%rip),%rdi
call   1050 <printf@plt>
jmp    1493 <main+0x343>
lea    0xd6a(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14d9 <main+0x389>
jmp    14b0 <main+0x360>
lea    0xda9(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14d9 <main+0x389>
jmp    14c1 <main+0x371>
lea    0xddd(%rip),%rdi
call   1050 <printf@plt>
jmp    14d2 <main+0x382>
lea    0xe0d(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
je     12de <main+0x17e>
lea    0xe81(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbp
lea    0xe74(%rip),%rdi
lea    0xe76(%rip),%rbx
mov    %rbx,%rsi
call   1070 <fopen@plt>
mov    %rax,%r14
lea    0xe66(%rip),%rdi
mov    %rbx,%rsi
call   1070 <fopen@plt>
mov    %rax,%r15
lea    0xe5d(%rip),%rdi
mov    %rbx,%rsi
call   1070 <fopen@plt>
mov    %rax,%r12
lea    0xe54(%rip),%rdi
mov    %rbx,%rsi
call   1070 <fopen@plt>
test   %rbp,%rbp
je     12ea <main+0x18a>
test   %r14,%r14
je     12f6 <main+0x196>
test   %r15,%r15
je     12f6 <main+0x196>
test   %r12,%r12
je     12f6 <main+0x196>
mov    %rax,%r13
test   %rax,%rax
je     12f6 <main+0x196>
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
mov    %r13,%r8
call   1080 <readFile@plt>
mov    %rbp,%rdi
call   1050 <fclose@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %r15,%rdi
call   1050 <fclose@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    %r13,%rdi
call   1050 <fclose@plt>
lea    0xdbc(%rip),%rdi
lea    0xdb3(%rip),%rbx
mov    %rbx,%rsi
call   1070 <fopen@plt>
mov    %rax,%r14
lea    0xdae(%rip),%rdi
mov    %rbx,%rsi
call   1070 <fopen@plt>
mov    %rax,%r13
lea    0xda5(%rip),%rdi
mov    %rbx,%rsi
call   1070 <fopen@plt>
mov    %rax,%r15
lea    0xd9c(%rip),%rdi
mov    %rbx,%rsi
call   1070 <fopen@plt>
test   %r14,%r14
je     12ff <main+0x19f>
test   %r13,%r13
je     12ff <main+0x19f>
test   %r15,%r15
je     12ff <main+0x19f>
mov    %rax,%r12
test   %rax,%rax
je     12ff <main+0x19f>
lea    0xd7f(%rip),%rdi
lea    0xd5b(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     1315 <main+0x1b5>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r13,%rdx
mov    %r12,%rcx
mov    $0x3,%r8d
call   1030 <reconstruct@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
jmp    1321 <main+0x1c1>
lea    0xf28(%rip),%rdi
jmp    1420 <main+0x2c0>
lea    0xf58(%rip),%rdi
jmp    1420 <main+0x2c0>
lea    0xebf(%rip),%rdi
jmp    1306 <main+0x1a6>
lea    0xe5a(%rip),%rdi
call   1060 <printf@plt>
mov    $0x1,%eax
jmp    1427 <main+0x2c7>
lea    0xd15(%rip),%rdi
call   1060 <printf@plt>
lea    0xd4e(%rip),%rdi
lea    0xcdc(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     135d <main+0x1fd>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
mov    $0x2,%r8d
call   1030 <reconstruct@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
jmp    1369 <main+0x209>
lea    0xd1b(%rip),%rdi
call   1060 <printf@plt>
lea    0xd54(%rip),%rdi
lea    0xc94(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     13a5 <main+0x245>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
mov    $0x1,%r8d
call   1030 <reconstruct@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
jmp    13b1 <main+0x251>
lea    0xd21(%rip),%rdi
call   1060 <printf@plt>
lea    0xd5a(%rip),%rdi
lea    0xc4c(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     13ed <main+0x28d>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r13,%rdx
mov    %r15,%rcx
mov    $0x4,%r8d
call   1030 <reconstruct@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
jmp    13f9 <main+0x299>
lea    0xd27(%rip),%rdi
call   1060 <printf@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %r13,%rdi
call   1050 <fclose@plt>
mov    %r15,%rdi
call   1050 <fclose@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
lea    0xe69(%rip),%rdi
call   1040 <puts@plt>
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"r\00"
@.str.1 = [9 x i8] c"out1.txt\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [9 x i8] c"out2.txt\00"
@.str.4 = [9 x i8] c"out3.txt\00"
@.str.5 = [9 x i8] c"out4.txt\00"
@.str.6 = [9 x i8] c"rec1.txt\00"
@.str.7 = [69 x i8] c"Rekonstruktionsfile 1 (out2,out3,out4) konnte nicht erstellt werden!\00"
@.str.8 = [9 x i8] c"rec2.txt\00"
@.str.9 = [69 x i8] c"Rekonstruktionsfile 2 (out1,out3,out4) konnte nicht erstellt werden!\00"
@.str.10 = [9 x i8] c"rec3.txt\00"
@.str.11 = [69 x i8] c"Rekonstruktionsfile 3 (out1,out2,out4) konnte nicht erstellt werden!\00"
@.str.12 = [9 x i8] c"rec4.txt\00"
@.str.13 = [69 x i8] c"Rekonstruktionsfile 4 (out1,out2,out3) konnte nicht erstellt werden!\00"
@.str.14 = [140 x i8] c"Die Ausgabedateien out1-out4.txt sowie die Rekonstruktionsdateien rec1-rec4.txt wurden erfolgreich im Verzeichnis des Programmes erstellt!\0A\00"
@.str.15 = [92 x i8] c"Eines der Files zum Einlesen f\C3\BCr die Rekonstruktionsdateien konnte nicht ge\C3\B6ffnet werden!\00"
@.str.16 = [81 x i8] c"Eines der Outputfiles konnte nicht erstellt werden! Das Programm beendet sich...\00"
@.str.17 = [65 x i8] c"Die Eingabedatei existiert nicht! Das Programm beendet sich....\0A\00"
@.str.18 = [61 x i8] c"Zu wenige Parameter angegeben. Das Programm beendet sich...\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %141
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32* @fopen(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %19, i32** %6
%20 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %20, i32** %7
%21 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %21, i32** %8
%22 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %22, i32** %9
%23 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %23, i32** %10
%24 = load i32*, i32** %6
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %138
26: ; preds = %15
%27 = load i32*, i32** %7
%28 = icmp ne i32* %27, null
br i1 %28, label %29, label %135
29: ; preds = %26
%30 = load i32*, i32** %8
%31 = icmp ne i32* %30, null
br i1 %31, label %32, label %135
32: ; preds = %29
%33 = load i32*, i32** %9
%34 = icmp ne i32* %33, null
br i1 %34, label %35, label %135
35: ; preds = %32
%36 = load i32*, i32** %10
%37 = icmp ne i32* %36, null
br i1 %37, label %38, label %135
38: ; preds = %35
%39 = load i32*, i32** %6
%40 = load i32*, i32** %7
%41 = load i32*, i32** %8
%42 = load i32*, i32** %9
%43 = load i32*, i32** %10
%44 = call i32 @readFile(i32* %39, i32* %40, i32* %41, i32* %42, i32* %43)
%45 = load i32*, i32** %6
%46 = call i32 @fclose(i32* %45)
%47 = load i32*, i32** %7
%48 = call i32 @fclose(i32* %47)
%49 = load i32*, i32** %8
%50 = call i32 @fclose(i32* %49)
%51 = load i32*, i32** %9
%52 = call i32 @fclose(i32* %51)
%53 = load i32*, i32** %10
%54 = call i32 @fclose(i32* %53)
%55 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %55, i32** %7
%56 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %56, i32** %8
%57 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %57, i32** %9
%58 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %58, i32** %10
%59 = load i32*, i32** %7
%60 = icmp ne i32* %59, null
br i1 %60, label %61, label %132
61: ; preds = %38
%62 = load i32*, i32** %8
%63 = icmp ne i32* %62, null
br i1 %63, label %64, label %132
64: ; preds = %61
%65 = load i32*, i32** %9
%66 = icmp ne i32* %65, null
br i1 %66, label %67, label %132
67: ; preds = %64
%68 = load i32*, i32** %10
%69 = icmp ne i32* %68, null
br i1 %69, label %70, label %132
70: ; preds = %67
%71 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %71, i32** %6
%72 = icmp ne i32* %71, null
br i1 %72, label %73, label %81
73: ; preds = %70
%74 = load i32*, i32** %6
%75 = load i32*, i32** %7
%76 = load i32*, i32** %8
%77 = load i32*, i32** %10
%78 = call i32 @reconstruct(i32* %74, i32* %75, i32* %76, i32* %77, i32 3)
%79 = load i32*, i32** %6
%80 = call i32 @fclose(i32* %79)
br label %83
81: ; preds = %70
%82 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.7, i64 0, i64 0))
br label %83
83: ; preds = %81, %73
%84 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %84, i32** %6
%85 = icmp ne i32* %84, null
br i1 %85, label %86, label %94
86: ; preds = %83
%87 = load i32*, i32** %6
%88 = load i32*, i32** %7
%89 = load i32*, i32** %9
%90 = load i32*, i32** %10
%91 = call i32 @reconstruct(i32* %87, i32* %88, i32* %89, i32* %90, i32 2)
%92 = load i32*, i32** %6
%93 = call i32 @fclose(i32* %92)
br label %96
94: ; preds = %83
%95 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.9, i64 0, i64 0))
br label %96
96: ; preds = %94, %86
%97 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %97, i32** %6
%98 = icmp ne i32* %97, null
br i1 %98, label %99, label %107
99: ; preds = %96
%100 = load i32*, i32** %6
%101 = load i32*, i32** %8
%102 = load i32*, i32** %9
%103 = load i32*, i32** %10
%104 = call i32 @reconstruct(i32* %100, i32* %101, i32* %102, i32* %103, i32 1)
%105 = load i32*, i32** %6
%106 = call i32 @fclose(i32* %105)
br label %109
107: ; preds = %96
%108 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.11, i64 0, i64 0))
br label %109
109: ; preds = %107, %99
%110 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %110, i32** %6
%111 = icmp ne i32* %110, null
br i1 %111, label %112, label %120
112: ; preds = %109
%113 = load i32*, i32** %6
%114 = load i32*, i32** %7
%115 = load i32*, i32** %8
%116 = load i32*, i32** %9
%117 = call i32 @reconstruct(i32* %113, i32* %114, i32* %115, i32* %116, i32 4)
%118 = load i32*, i32** %6
%119 = call i32 @fclose(i32* %118)
br label %122
120: ; preds = %109
%121 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.13, i64 0, i64 0))
br label %122
122: ; preds = %120, %112
%123 = load i32*, i32** %7
%124 = call i32 @fclose(i32* %123)
%125 = load i32*, i32** %8
%126 = call i32 @fclose(i32* %125)
%127 = load i32*, i32** %9
%128 = call i32 @fclose(i32* %127)
%129 = load i32*, i32** %10
%130 = call i32 @fclose(i32* %129)
%131 = call i32 @printf(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.14, i64 0, i64 0))
br label %134
132: ; preds = %67, %64, %61, %38
%133 = call i32 @printf(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.15, i64 0, i64 0))
store i32 1, i32* %3
br label %144
134: ; preds = %122
br label %137
135: ; preds = %35, %32, %29, %26
%136 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.16, i64 0, i64 0))
store i32 1, i32* %3
br label %144
137: ; preds = %134
br label %140
138: ; preds = %15
%139 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.17, i64 0, i64 0))
br label %140
140: ; preds = %138, %137
br label %143
141: ; preds = %2
%142 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.18, i64 0, i64 0))
br label %143
143: ; preds = %141, %140
store i32 0, i32* %3
br label %144
144: ; preds = %143, %135, %132
%145 = load i32, i32* %3
ret i32 %145
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [9 x i8] c"out1.txt\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [9 x i8] c"out2.txt\00"
@.str.4 = [9 x i8] c"out3.txt\00"
@.str.5 = [9 x i8] c"out4.txt\00"
@.str.6 = [9 x i8] c"rec1.txt\00"
@.str.7 = [69 x i8] c"Rekonstruktionsfile 1 (out2,out3,out4) konnte nicht erstellt werden!\00"
@.str.8 = [9 x i8] c"rec2.txt\00"
@.str.9 = [69 x i8] c"Rekonstruktionsfile 2 (out1,out3,out4) konnte nicht erstellt werden!\00"
@.str.10 = [9 x i8] c"rec3.txt\00"
@.str.11 = [69 x i8] c"Rekonstruktionsfile 3 (out1,out2,out4) konnte nicht erstellt werden!\00"
@.str.12 = [9 x i8] c"rec4.txt\00"
@.str.13 = [69 x i8] c"Rekonstruktionsfile 4 (out1,out2,out3) konnte nicht erstellt werden!\00"
@.str.15 = [92 x i8] c"Eines der Files zum Einlesen f\C3\BCr die Rekonstruktionsdateien konnte nicht ge\C3\B6ffnet werden!\00"
@.str.16 = [81 x i8] c"Eines der Outputfiles konnte nicht erstellt werden! Das Programm beendet sich...\00"
@str = [60 x i8] c"Zu wenige Parameter angegeben. Das Programm beendet sich...\00"
@str.19 = [64 x i8] c"Die Eingabedatei existiert nicht! Das Programm beendet sich....\00"
@str.20 = [139 x i8] c"Die Ausgabedateien out1-out4.txt sowie die Rekonstruktionsdateien rec1-rec4.txt wurden erfolgreich im Verzeichnis des Programmes erstellt!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %83, label %6
6: ; preds = %2
%7 = tail call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%11 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp eq i32* %7, null
br i1 %12, label %81, label %13
13: ; preds = %6
%14 = icmp ne i32* %8, null
%15 = icmp ne i32* %9, null
%16 = and i1 %14, %15
%17 = icmp ne i32* %10, null
%18 = and i1 %16, %17
%19 = icmp ne i32* %11, null
%20 = and i1 %18, %19
br i1 %20, label %21, label %79
21: ; preds = %13
%22 = tail call i32 @readFile(i32* %7, i32* %8, i32* %9, i32* %10, i32* %11)
%23 = tail call i32 @fclose(i32* %7)
%24 = tail call i32 @fclose(i32* %8)
%25 = tail call i32 @fclose(i32* %9)
%26 = tail call i32 @fclose(i32* %10)
%27 = tail call i32 @fclose(i32* %11)
%28 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%29 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%30 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%31 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%32 = icmp ne i32* %28, null
%33 = icmp ne i32* %29, null
%34 = and i1 %32, %33
%35 = icmp ne i32* %30, null
%36 = and i1 %34, %35
%37 = icmp ne i32* %31, null
%38 = and i1 %36, %37
br i1 %38, label %39, label %77
39: ; preds = %21
%40 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%41 = icmp eq i32* %40, null
br i1 %41, label %45, label %42
42: ; preds = %39
%43 = tail call i32 @reconstruct(i32* %40, i32* %28, i32* %29, i32* %31, i32 3)
%44 = tail call i32 @fclose(i32* %40)
br label %47
45: ; preds = %39
%46 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str.7, i64 0, i64 0))
br label %47
47: ; preds = %45, %42
%48 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%49 = icmp eq i32* %48, null
br i1 %49, label %53, label %50
50: ; preds = %47
%51 = tail call i32 @reconstruct(i32* %48, i32* %28, i32* %30, i32* %31, i32 2)
%52 = tail call i32 @fclose(i32* %48)
br label %55
53: ; preds = %47
%54 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str.9, i64 0, i64 0))
br label %55
55: ; preds = %53, %50
%56 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%57 = icmp eq i32* %56, null
br i1 %57, label %61, label %58
58: ; preds = %55
%59 = tail call i32 @reconstruct(i32* %56, i32* %29, i32* %30, i32* %31, i32 1)
%60 = tail call i32 @fclose(i32* %56)
br label %63
61: ; preds = %55
%62 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str.11, i64 0, i64 0))
br label %63
63: ; preds = %61, %58
%64 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%65 = icmp eq i32* %64, null
br i1 %65, label %69, label %66
66: ; preds = %63
%67 = tail call i32 @reconstruct(i32* %64, i32* %28, i32* %29, i32* %30, i32 4)
%68 = tail call i32 @fclose(i32* %64)
br label %71
69: ; preds = %63
%70 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str.13, i64 0, i64 0))
br label %71
71: ; preds = %69, %66
%72 = tail call i32 @fclose(i32* %28)
%73 = tail call i32 @fclose(i32* %29)
%74 = tail call i32 @fclose(i32* %30)
%75 = tail call i32 @fclose(i32* %31)
%76 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([139 x i8], [139 x i8]* @str.20, i64 0, i64 0))
br label %85
77: ; preds = %21
%78 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([92 x i8], [92 x i8]* @.str.15, i64 0, i64 0))
br label %85
79: ; preds = %13
%80 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @.str.16, i64 0, i64 0))
br label %85
81: ; preds = %6
%82 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.19, i64 0, i64 0))
br label %85
83: ; preds = %2
%84 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
br label %85
85: ; preds = %83, %81, %71, %79, %77
%86 = phi i32 [ 1, %77 ], [ 1, %79 ], [ 0, %71 ], [ 0, %81 ], [ 0, %83 ]
ret i32 %86
}