#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 INT_MAX;
int atoi(int /*<<< orphan*/);
int berechneNeuesSpielfeld(int, int, int **);
int /*<<< orphan*/ free(int *);
int getopt(int, char **, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ optarg;
int /*<<< orphan*/ printHilfe();
int /*<<< orphan*/ printSpielfeld(int, int, int *);
int /*<<< orphan*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  int breite = 16;
  int hoehe = 16;
  int belegungsDichte = INT_MAX;
  int ret;
  while ((ret = getopt(argc, argv, "b:h:d:")) != -1) {
    switch (ret) {
    case 'b':
      breite = atoi(optarg);
      break;
    case 'h':
      hoehe = atoi(optarg);
      break;
    case 'd':
      belegungsDichte = atoi(optarg);
      break;
    default:
      printHilfe();
      break;
    }
  }
  if (belegungsDichte == INT_MAX) {
    printf("Fehler. Es muss mindestens die gewuenschte Belegungsdichte des "
           "Spielfeldes angegeben werden.\n\n");
    printHilfe();
    return -1;
  } else if (belegungsDichte < 0) {
    printf("Feler. Die gewuenschte Belegungsdichte des Spielfeldes muss >= 0 "
           "sein.\n");
    return -2;
  } else if (belegungsDichte > 100) {
    printf("Hinweis: Ihre Eingabe der Belegungsdichte ist mit %i%% nicht "
           "sinnvoll.\n",
           belegungsDichte);
    printf("Eine maximale Belegungsdichte von 100%% wird impliziert.\n\n");
  }
  bool *spielfeld = NULL;
  spielfeld = (bool *)malloc(breite * hoehe * sizeof(bool));
  srand(time(NULL));
  for (int h = 0; h < hoehe; h++) {
    for (int b = 0; b < breite; b++) {
      if (rand() % 100 < belegungsDichte)
        spielfeld[h * breite + b] = true;
      else
        spielfeld[h * breite + b] = false;
    }
  }
  int runde = 0;
  bool aenderung = true;
  while (aenderung) {
    printf("Runde %i:", runde);
    if (runde == 0)
      printf(" (Ausgangssituation)");
    printf("\n");
    printSpielfeld(breite, hoehe, spielfeld);
    printf("\n");
    aenderung = berechneNeuesSpielfeld(breite, hoehe, &spielfeld);
    runde++;
    sleep(1);
  }
  printf("Keine Aenderungen mehr in Runde %i!\n", runde);
  printSpielfeld(breite, hoehe, spielfeld);
  if (spielfeld != NULL)
    free(spielfeld);
  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)
movl   $0x10,-0x14(%rbp)
movl   $0x10,-0x18(%rbp)
mov    0x2df5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe02(%rip),%rdx
call   10b0 <getopt@plt>
mov    %eax,-0x20(%rbp)
cmp    $0xffffffff,%eax
je     1293 <main+0xd3>
mov    -0x20(%rbp),%eax
mov    %eax,-0x3c(%rbp)
sub    $0x62,%eax
je     1245 <main+0x85>
jmp    1223 <main+0x63>
mov    -0x3c(%rbp),%eax
sub    $0x64,%eax
je     1271 <main+0xb1>
jmp    1234 <main+0x74>
mov    -0x3c(%rbp),%eax
sub    $0x68,%eax
je     125b <main+0x9b>
jmp    1287 <main+0xc7>
mov    0x2dac(%rip),%rax
mov    (%rax),%edi
call   10c0 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    128e <main+0xce>
mov    0x2d96(%rip),%rax
mov    (%rax),%edi
call   10c0 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    128e <main+0xce>
mov    0x2d80(%rip),%rax
mov    (%rax),%edi
call   10c0 <atoi@plt>
mov    %eax,-0x1c(%rbp)
jmp    128e <main+0xce>
mov    $0x0,%al
call   1060 <printHilfe@plt>
jmp    11f0 <main+0x30>
mov    -0x1c(%rbp),%eax
mov    0x2d43(%rip),%rcx
cmp    (%rcx),%eax
jne    12c6 <main+0x106>
lea    0xd5b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <printHilfe@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14b7 <main+0x2f7>
cmpl   $0x0,-0x1c(%rbp)
jge    12ea <main+0x12a>
lea    0xd8f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    14b7 <main+0x2f7>
cmpl   $0x64,-0x1c(%rbp)
jle    1313 <main+0x153>
mov    -0x1c(%rbp),%esi
lea    0xdb0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1318 <main+0x158>
jmp    131d <main+0x15d>
movq   $0x0,-0x28(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    13e6 <main+0x226>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    13d3 <main+0x213>
mov    $0x0,%al
call   10e0 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    -0x1c(%rbp),%edx
jge    13a8 <main+0x1e8>
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movl   $0x1,(%rax,%rcx,4)
jmp    13c0 <main+0x200>
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movl   $0x0,(%rax,%rcx,4)
jmp    13c5 <main+0x205>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1367 <main+0x1a7>
jmp    13d8 <main+0x218>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1354 <main+0x194>
movl   $0x0,-0x34(%rbp)
movl   $0x1,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
je     147c <main+0x2bc>
mov    -0x34(%rbp),%esi
lea    0xd29(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x0,-0x34(%rbp)
jne    1427 <main+0x267>
lea    0xd1b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc36(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   10a0 <printSpielfeld@plt>
lea    0xc19(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
lea    -0x28(%rbp),%rdx
call   1040 <berechneNeuesSpielfeld@plt>
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    $0x1,%edi
call   10d0 <sleep@plt>
jmp    13f4 <main+0x234>
mov    -0x34(%rbp),%esi
lea    0xcca(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   10a0 <printSpielfeld@plt>
cmpq   $0x0,-0x28(%rbp)
je     14b0 <main+0x2f0>
mov    -0x28(%rbp),%rdi
call   1030 <free@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
sub    $0x28,%rsp
mov    %rsi,%r12
mov    %edi,%ebx
mov    0x2de6(%rip),%rax
mov    (%rax),%ebp
mov    $0x10,%r14d
lea    0xdf7(%rip),%r13
mov    $0x10,%r15d
jmp    1227 <main+0x47>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1080 <printHilfe@plt>
mov    %ebx,%edi
mov    %r12,%rsi
mov    %r13,%rdx
call   10d0 <getopt@plt>
cmp    $0x63,%eax
jg     1260 <main+0x80>
cmp    $0xffffffff,%eax
je     128f <main+0xaf>
cmp    $0x62,%eax
jne    1220 <main+0x40>
mov    0x2dae(%rip),%rax
mov    (%rax),%edi
call   10e0 <atoi@plt>
mov    %eax,%r14d
jmp    1227 <main+0x47>
cs nopw 0x0(%rax,%rax,1)
cmp    $0x64,%eax
je     127d <main+0x9d>
cmp    $0x68,%eax
jne    1220 <main+0x40>
mov    0x2d87(%rip),%rax
mov    (%rax),%edi
call   10e0 <atoi@plt>
mov    %eax,%r15d
jmp    1227 <main+0x47>
mov    0x2d74(%rip),%rax
mov    (%rax),%edi
call   10e0 <atoi@plt>
mov    %eax,%ebp
jmp    1227 <main+0x47>
mov    0x2d4a(%rip),%rax
cmp    (%rax),%ebp
jne    12b7 <main+0xd7>
lea    0xe74(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1080 <printHilfe@plt>
mov    $0xffffffff,%ebp
jmp    14c5 <main+0x2e5>
test   %ebp,%ebp
js     14b4 <main+0x2d4>
cmp    $0x65,%ebp
jb     12e2 <main+0x102>
lea    0xd3c(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xd74(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14d,0x10(%rsp)
imul   %r15d,%r14d
shl    $0x2,%r14d
mov    %r14d,%edi
call   10b0 <malloc@plt>
mov    %rax,0x8(%rsp)
xor    %edi,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1090 <srand@plt>
mov    %r15d,0x14(%rsp)
test   %r15d,%r15d
jle    13a8 <main+0x1c8>
movslq 0x10(%rsp),%rax
mov    0x14(%rsp),%ecx
mov    %rcx,0x18(%rsp)
mov    %rax,0x20(%rsp)
mov    %eax,%ebx
xor    %r14d,%r14d
xor    %r15d,%r15d
jmp    1350 <main+0x170>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%r15
add    0x20(%rsp),%r14
cmp    0x18(%rsp),%r15
je     13a8 <main+0x1c8>
cmpl   $0x0,0x10(%rsp)
jle    1340 <main+0x160>
lea    0x0(,%r14,4),%r12
add    0x8(%rsp),%r12
xor    %r13d,%r13d
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1100 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
xor    %ecx,%ecx
cmp    %ebp,%eax
setl   %cl
mov    %ecx,(%r12,%r13,4)
add    $0x1,%r13
cmp    %r13,%rbx
jne    1370 <main+0x190>
jmp    1340 <main+0x160>
lea    0xcdb(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xcd5(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0x8(%rsp),%rdx
mov    0x10(%rsp),%r14d
mov    %r14d,%edi
mov    0x14(%rsp),%r15d
mov    %r15d,%esi
call   10c0 <printSpielfeld@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x8(%rsp),%rdx
mov    %r14d,%edi
mov    %r15d,%esi
call   1050 <berechneNeuesSpielfeld@plt>
mov    %eax,%ebp
mov    $0x1,%ebx
mov    $0x1,%edi
call   10f0 <sleep@plt>
test   %ebp,%ebp
je     1481 <main+0x2a1>
mov    $0x1,%ebx
lea    0xc65(%rip),%r12
lea    0x8(%rsp),%r13
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0x8(%rsp),%rdx
mov    %r14d,%edi
mov    %r15d,%esi
call   10c0 <printSpielfeld@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %r14d,%edi
mov    %r15d,%esi
mov    %r13,%rdx
call   1050 <berechneNeuesSpielfeld@plt>
mov    %eax,%ebp
add    $0x1,%ebx
mov    $0x1,%edi
call   10f0 <sleep@plt>
test   %ebp,%ebp
jne    1430 <main+0x250>
lea    0xc21(%rip),%rdi
xor    %ebp,%ebp
mov    %ebx,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x8(%rsp),%rdx
mov    %r14d,%edi
mov    %r15d,%esi
call   10c0 <printSpielfeld@plt>
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     14c5 <main+0x2e5>
call   1030 <free@plt>
jmp    14c5 <main+0x2e5>
lea    0xc13(%rip),%rdi
call   1060 <puts@plt>
mov    $0xfffffffe,%ebp
mov    %ebp,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
@.str = [7 x i8] c"b:h:d:\00"
@optarg = global i32 0
@.str.1 = [95 x i8] c"Fehler. Es muss mindestens die gewuenschte Belegungsdichte des Spielfeldes angegeben werden.\0A\0A\00"
@.str.2 = [72 x i8] c"Feler. Die gewuenschte Belegungsdichte des Spielfeldes muss >= 0 sein.\0A\00"
@.str.3 = [72 x i8] c"Hinweis: Ihre Eingabe der Belegungsdichte ist mit %i%% nicht sinnvoll.\0A\00"
@.str.4 = [59 x i8] c"Eine maximale Belegungsdichte von 100%% wird impliziert.\0A\0A\00"
@.str.5 = [10 x i8] c"Runde %i:\00"
@.str.6 = [21 x i8] c" (Ausgangssituation)\00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [37 x i8] c"Keine Aenderungen mehr in Runde %i!\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*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 16, i32* %6
store i32 16, i32* %7
%15 = load i32, i32* @INT_MAX
store i32 %15, i32* %8
br label %16
16: ; preds = %34, %2
%17 = load i32, i32* %4
%18 = load i8**, i8*** %5
%19 = call i32 @getopt(i32 %17, i8** %18, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 %19, i32* %9
%20 = icmp ne i32 %19, -1
br i1 %20, label %21, label %35
21: ; preds = %16
%22 = load i32, i32* %9
switch i32 %22, label %32 [
i32 98, label %23
i32 104, label %26
i32 100, label %29
]
23: ; preds = %21
%24 = load i32, i32* @optarg
%25 = call i32 @atoi(i32 %24)
store i32 %25, i32* %6
br label %34
26: ; preds = %21
%27 = load i32, i32* @optarg
%28 = call i32 @atoi(i32 %27)
store i32 %28, i32* %7
br label %34
29: ; preds = %21
%30 = load i32, i32* @optarg
%31 = call i32 @atoi(i32 %30)
store i32 %31, i32* %8
br label %34
32: ; preds = %21
%33 = call i32 (...) @printHilfe()
br label %34
34: ; preds = %32, %29, %26, %23
br label %16
35: ; preds = %16
%36 = load i32, i32* %8
%37 = load i32, i32* @INT_MAX
%38 = icmp eq i32 %36, %37
br i1 %38, label %39, label %42
39: ; preds = %35
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.1, i64 0, i64 0))
%41 = call i32 (...) @printHilfe()
store i32 -1, i32* %3
br label %144
42: ; preds = %35
%43 = load i32, i32* %8
%44 = icmp slt i32 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.2, i64 0, i64 0))
store i32 -2, i32* %3
br label %144
47: ; preds = %42
%48 = load i32, i32* %8
%49 = icmp sgt i32 %48, 100
br i1 %49, label %50, label %54
50: ; preds = %47
%51 = load i32, i32* %8
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.3, i64 0, i64 0), i32 %51)
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0))
br label %54
54: ; preds = %50, %47
br label %55
55: ; preds = %54
br label %56
56: ; preds = %55
store i32* null, i32** %10
%57 = load i32, i32* %6
%58 = load i32, i32* %7
%59 = mul nsw i32 %57, %58
%60 = sext i32 %59 to i64
%61 = mul i64 %60, 4
%62 = trunc i64 %61 to i32
%63 = call i64 @malloc(i32 %62)
%64 = inttoptr i64 %63 to i32*
store i32* %64, i32** %10
%65 = call i32 @time(i32* null)
%66 = call i32 @srand(i32 %65)
store i32 0, i32* %11
br label %67
67: ; preds = %104, %56
%68 = load i32, i32* %11
%69 = load i32, i32* %7
%70 = icmp slt i32 %68, %69
br i1 %70, label %71, label %107
71: ; preds = %67
store i32 0, i32* %12
br label %72
72: ; preds = %100, %71
%73 = load i32, i32* %12
%74 = load i32, i32* %6
%75 = icmp slt i32 %73, %74
br i1 %75, label %76, label %103
76: ; preds = %72
%77 = call i32 (...) @rand()
%78 = srem i32 %77, 100
%79 = load i32, i32* %8
%80 = icmp slt i32 %78, %79
br i1 %80, label %81, label %90
81: ; preds = %76
%82 = load i32*, i32** %10
%83 = load i32, i32* %11
%84 = load i32, i32* %6
%85 = mul nsw i32 %83, %84
%86 = load i32, i32* %12
%87 = add nsw i32 %85, %86
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i32, i32* %82, i64 %88
store i32 1, i32* %89
br label %99
90: ; preds = %76
%91 = load i32*, i32** %10
%92 = load i32, i32* %11
%93 = load i32, i32* %6
%94 = mul nsw i32 %92, %93
%95 = load i32, i32* %12
%96 = add nsw i32 %94, %95
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds i32, i32* %91, i64 %97
store i32 0, i32* %98
br label %99
99: ; preds = %90, %81
br label %100
100: ; preds = %99
%101 = load i32, i32* %12
%102 = add nsw i32 %101, 1
store i32 %102, i32* %12
br label %72
103: ; preds = %72
br label %104
104: ; preds = %103
%105 = load i32, i32* %11
%106 = add nsw i32 %105, 1
store i32 %106, i32* %11
br label %67
107: ; preds = %67
store i32 0, i32* %13
store i32 1, i32* %14
br label %108
108: ; preds = %118, %107
%109 = load i32, i32* %14
%110 = icmp ne i32 %109, 0
br i1 %110, label %111, label %131
111: ; preds = %108
%112 = load i32, i32* %13
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %112)
%114 = load i32, i32* %13
%115 = icmp eq i32 %114, 0
br i1 %115, label %116, label %118
116: ; preds = %111
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
br label %118
118: ; preds = %116, %111
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%120 = load i32, i32* %6
%121 = load i32, i32* %7
%122 = load i32*, i32** %10
%123 = call i32 @printSpielfeld(i32 %120, i32 %121, i32* %122)
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%125 = load i32, i32* %6
%126 = load i32, i32* %7
%127 = call i32 @berechneNeuesSpielfeld(i32 %125, i32 %126, i32** %10)
store i32 %127, i32* %14
%128 = load i32, i32* %13
%129 = add nsw i32 %128, 1
store i32 %129, i32* %13
%130 = call i32 @sleep(i32 1)
br label %108
131: ; preds = %108
%132 = load i32, i32* %13
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i32 %132)
%134 = load i32, i32* %6
%135 = load i32, i32* %7
%136 = load i32*, i32** %10
%137 = call i32 @printSpielfeld(i32 %134, i32 %135, i32* %136)
%138 = load i32*, i32** %10
%139 = icmp ne i32* %138, null
br i1 %139, label %140, label %143
140: ; preds = %131
%141 = load i32*, i32** %10
%142 = call i32 @free(i32* %141)
br label %143
143: ; preds = %140, %131
store i32 0, i32* %3
br label %144
144: ; preds = %143, %45, %39
%145 = load i32, i32* %3
ret i32 %145
}

LLVM IR (-O2):
@INT_MAX = global i32 0
@.str = [7 x i8] c"b:h:d:\00"
@optarg = global i32 0
@.str.3 = [72 x i8] c"Hinweis: Ihre Eingabe der Belegungsdichte ist mit %i%% nicht sinnvoll.\0A\00"
@.str.4 = [59 x i8] c"Eine maximale Belegungsdichte von 100%% wird impliziert.\0A\0A\00"
@.str.5 = [10 x i8] c"Runde %i:\00"
@.str.6 = [21 x i8] c" (Ausgangssituation)\00"
@.str.8 = [37 x i8] c"Keine Aenderungen mehr in Runde %i!\0A\00"
@str = [71 x i8] c"Feler. Die gewuenschte Belegungsdichte des Spielfeldes muss >= 0 sein.\00"
@str.9 = [94 x i8] c"Fehler. Es muss mindestens die gewuenschte Belegungsdichte des Spielfeldes angegeben werden.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32*
%4 = load i32, i32* @INT_MAX
br label %5
5: ; preds = %16, %2
%6 = phi i32 [ %18, %16 ], [ 16, %2 ]
%7 = phi i32 [ %10, %16 ], [ 16, %2 ]
%8 = phi i32 [ %13, %16 ], [ %4, %2 ]
br label %9
9: ; preds = %5, %19
%10 = phi i32 [ %7, %5 ], [ %21, %19 ]
%11 = phi i32 [ %8, %5 ], [ %13, %19 ]
br label %12
12: ; preds = %9, %22
%13 = phi i32 [ %11, %9 ], [ %24, %22 ]
br label %14
14: ; preds = %12, %25
%15 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
switch i32 %15, label %25 [
i32 -1, label %27
i32 98, label %16
i32 104, label %19
i32 100, label %22
]
16: ; preds = %14
%17 = load i32, i32* @optarg
%18 = tail call i32 @atoi(i32 %17)
br label %5
19: ; preds = %14
%20 = load i32, i32* @optarg
%21 = tail call i32 @atoi(i32 %20)
br label %9
22: ; preds = %14
%23 = load i32, i32* @optarg
%24 = tail call i32 @atoi(i32 %23)
br label %12
25: ; preds = %14
%26 = tail call i32 (...) @printHilfe()
br label %14
27: ; preds = %14
%28 = load i32, i32* @INT_MAX
%29 = icmp eq i32 %13, %28
br i1 %29, label %30, label %33
30: ; preds = %27
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([94 x i8], [94 x i8]* @str.9, i64 0, i64 0))
%32 = tail call i32 (...) @printHilfe()
br label %105
33: ; preds = %27
%34 = icmp slt i32 %13, 0
br i1 %34, label %35, label %37
35: ; preds = %33
%36 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str, i64 0, i64 0))
br label %105
37: ; preds = %33
%38 = icmp ugt i32 %13, 100
br i1 %38, label %39, label %42
39: ; preds = %37
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @.str.3, i64 0, i64 0), i32 %13)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0))
br label %42
42: ; preds = %39, %37
%43 = bitcast i32** %3 to i8*
%44 = shl i32 %6, 2
%45 = mul i32 %44, %10
%46 = tail call i64 @malloc(i32 %45)
%47 = inttoptr i64 %46 to i32*
store i32* %47, i32** %3
%48 = tail call i32 @time(i32* null)
%49 = tail call i32 @srand(i32 %48)
%50 = icmp sgt i32 %10, 0
br i1 %50, label %51, label %61
51: ; preds = %42
%52 = icmp sgt i32 %6, 0
%53 = sext i32 %6 to i64
%54 = zext i32 %10 to i64
%55 = zext i32 %6 to i64
br label %56
56: ; preds = %51, %71
%57 = phi i64 [ 0, %51 ], [ %72, %71 ]
br i1 %52, label %58, label %71
58: ; preds = %56
%59 = load i32*, i32** %3
%60 = mul nsw i64 %57, %53
br label %74
61: ; preds = %71, %42
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 0)
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%64 = call i32 @putchar(i32 10)
%65 = load i32*, i32** %3
%66 = call i32 @printSpielfeld(i32 %6, i32 %10, i32* %65)
%67 = call i32 @putchar(i32 10)
%68 = call i32 @berechneNeuesSpielfeld(i32 %6, i32 %10, i32** %3)
%69 = call i32 @sleep(i32 1)
%70 = icmp eq i32 %68, 0
br i1 %70, label %95, label %84
71: ; preds = %74, %56
%72 = add nuw nsw i64 %57, 1
%73 = icmp eq i64 %72, %54
br i1 %73, label %61, label %56
74: ; preds = %58, %74
%75 = phi i64 [ 0, %58 ], [ %82, %74 ]
%76 = tail call i32 (...) @rand()
%77 = srem i32 %76, 100
%78 = icmp slt i32 %77, %13
%79 = add nsw i64 %75, %60
%80 = getelementptr inbounds i32, i32* %59, i64 %79
%81 = zext i1 %78 to i32
store i32 %81, i32* %80
%82 = add nuw nsw i64 %75, 1
%83 = icmp eq i64 %82, %55
br i1 %83, label %71, label %74
84: ; preds = %61, %84
%85 = phi i32 [ %92, %84 ], [ 1, %61 ]
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %85)
%87 = call i32 @putchar(i32 10)
%88 = load i32*, i32** %3
%89 = call i32 @printSpielfeld(i32 %6, i32 %10, i32* %88)
%90 = call i32 @putchar(i32 10)
%91 = call i32 @berechneNeuesSpielfeld(i32 %6, i32 %10, i32** %3)
%92 = add nuw nsw i32 %85, 1
%93 = call i32 @sleep(i32 1)
%94 = icmp eq i32 %91, 0
br i1 %94, label %95, label %84
95: ; preds = %84, %61
%96 = phi i32 [ 1, %61 ], [ %92, %84 ]
%97 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i32 %96)
%98 = load i32*, i32** %3
%99 = call i32 @printSpielfeld(i32 %6, i32 %10, i32* %98)
%100 = load i32*, i32** %3
%101 = icmp eq i32* %100, null
br i1 %101, label %104, label %102
102: ; preds = %95
%103 = call i32 @free(i32* %100)
br label %104
104: ; preds = %102, %95
br label %105
105: ; preds = %104, %35, %30
%106 = phi i32 [ -1, %30 ], [ -2, %35 ], [ 0, %104 ]
ret i32 %106
}