#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 */
double durchschnitt_int_array(int *, int);
double durchschnitt_versuche;
double durchschnittlich_benoetigten_kaeufe(int);
double fabs(double);
int indizes_kleiner_als_double_array(double *, int, int *, double);
int /*<<< orphan*/ initialisiere_int_array(int *, int, int /*<<< orphan*/);
int /*<<< orphan*/ initialisiere_zufallszahlengenerator();
double *liefere_max_double_array(double *, int);
double *liefere_min_double_array(double *, int);
double median_double_array(double *, int);
double median_int_array(int *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ schreibe_int_array(int *, int, int /*<<< orphan*/, char *,
                                      int /*<<< orphan*/);
int /*<<< orphan*/ simulier_einkaeufe(int, int *, int);
void schreibe_statistik_sammelbilderproblem(int sammelbilder, int kunden) {
  int anzahl_kaeufe_pro_kunde[kunden];
  initialisiere_int_array(anzahl_kaeufe_pro_kunde, kunden, 0);
  initialisiere_zufallszahlengenerator();
  simulier_einkaeufe(kunden, anzahl_kaeufe_pro_kunde, sammelbilder);
  double durchschnitt_versuche = durchschnitt_versuche =
      durchschnittlich_benoetigten_kaeufe(sammelbilder);
  double abweichung_versuche = 0.0;
  double durchschnitt_kaeufe = 0.0;
  double abweichung_kaeufe[kunden];
  printf("\n%5s %5s %15s %15s %15s %15s\n", "KNR", "KK", "AE", "E", "M", "AM");
  for (int i = 0; i < kunden; i++) {
    abweichung_versuche =
        fabs((double)anzahl_kaeufe_pro_kunde[i] - durchschnitt_versuche);
    durchschnitt_kaeufe =
        durchschnitt_int_array(anzahl_kaeufe_pro_kunde, i + 1);
    abweichung_kaeufe[i] = fabs(durchschnitt_versuche - durchschnitt_kaeufe);
    printf("\n%7d %5d %15lf %15lf %15lf %15lf", i + 1,
           anzahl_kaeufe_pro_kunde[i], abweichung_versuche,
           durchschnitt_versuche, durchschnitt_kaeufe, abweichung_kaeufe[i]);
  }
  printf("\n\n");
  double median_kaeufe = median_int_array(anzahl_kaeufe_pro_kunde, kunden);
  double median_am = median_double_array(abweichung_kaeufe, kunden);
  double *min = liefere_min_double_array(abweichung_kaeufe, kunden);
  double *max = liefere_max_double_array(abweichung_kaeufe, kunden);
  printf("%-25s %10lf\n", "Median der Anzahl Kaeufe: ", median_kaeufe);
  printf("%-25s %10lf\n", "Median der Werte AM: ", median_am);
  printf("%-25s %10lf\n", "groesster der Werte AM: ", *max);
  printf("%-25s %10lf\n", "kleinster der Werte AM: ", *min);
  int indizes_array[kunden];
  int anzahl_indizes = 0;
  initialisiere_int_array(indizes_array, kunden, 0);
  for (double i = 1.0; i > 0.6; i = i - 0.2) {
    anzahl_indizes = indizes_kleiner_als_double_array(abweichung_kaeufe, kunden,
                                                      indizes_array, i);
    printf("\n%-s %4.1lf :\t", "Indizes der Werte AM < ", i);
    putchar('[');
    schreibe_int_array(indizes_array, anzahl_indizes, 0, ", ", 0);
    putchar(']');
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<schreibe_statistik_sammelbilderproblem>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x88(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%esi
xor    %edx,%edx
mov    %edx,-0x8c(%rbp)
call   1060 <initialisiere_int_array@plt>
mov    -0x8c(%rbp),%eax
call   10b0 <initialisiere_zufallszahlengenerator@plt>
mov    -0x88(%rbp),%rsi
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%edx
call   10e0 <simulier_einkaeufe@plt>
mov    -0x4(%rbp),%edi
call   10f0 <durchschnittlich_benoetigten_kaeufe@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x8(%rbp),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x80(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
lea    0xdaf(%rip),%rdi
lea    0xdc6(%rip),%rsi
lea    0xdc3(%rip),%rdx
lea    0xdbf(%rip),%rcx
lea    0xdb9(%rip),%r8
lea    0xdb5(%rip),%r9
lea    0xdad(%rip),%rax
sub    $0x10,%rsp
mov    %rax,(%rsp)
mov    $0x0,%al
call   1080 <printf@plt>
add    $0x10,%rsp
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1370 <schreibe_statistik_sammelbilderproblem+0x1a0>
mov    -0x88(%rbp),%rdi
movslq -0x3c(%rbp),%rax
cvtsi2sdl (%rdi,%rax,4),%xmm0
subsd  -0x20(%rbp),%xmm0
movaps 0xd33(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x3c(%rbp),%esi
add    $0x1,%esi
call   10c0 <durchschnitt_int_array@plt>
mov    -0x88(%rbp),%rcx
mov    -0x80(%rbp),%rax
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movaps 0xcfe(%rip),%xmm1
pand   %xmm1,%xmm0
movslq -0x3c(%rbp),%rdx
movsd  %xmm0,(%rax,%rdx,8)
mov    -0x3c(%rbp),%esi
add    $0x1,%esi
movslq -0x3c(%rbp),%rdx
mov    (%rcx,%rdx,4),%edx
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
lea    0xd00(%rip),%rdi
mov    $0x4,%al
call   1080 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    12c5 <schreibe_statistik_sammelbilderproblem+0xf5>
lea    0xd05(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    -0x88(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   10d0 <median_int_array@plt>
mov    -0x80(%rbp),%rdi
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%esi
call   1040 <median_double_array@plt>
mov    -0x80(%rbp),%rdi
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%esi
call   1070 <liefere_min_double_array@plt>
mov    -0x80(%rbp),%rdi
mov    %rax,-0x58(%rbp)
mov    -0x8(%rbp),%esi
call   10a0 <liefere_max_double_array@plt>
mov    %rax,-0x60(%rbp)
movsd  -0x48(%rbp),%xmm0
lea    0xcb0(%rip),%rdi
mov    %rdi,-0xa8(%rbp)
lea    0xcaf(%rip),%rsi
mov    $0x1,%al
mov    %al,-0x99(%rbp)
call   1080 <printf@plt>
mov    -0xa8(%rbp),%rdi
mov    -0x99(%rbp),%al
movsd  -0x50(%rbp),%xmm0
lea    0xca4(%rip),%rsi
call   1080 <printf@plt>
mov    -0xa8(%rbp),%rdi
mov    -0x99(%rbp),%al
mov    -0x60(%rbp),%rcx
movsd  (%rcx),%xmm0
lea    0xc99(%rip),%rsi
call   1080 <printf@plt>
mov    -0xa8(%rbp),%rdi
mov    -0x99(%rbp),%al
mov    -0x58(%rbp),%rcx
movsd  (%rcx),%xmm0
lea    0xc91(%rip),%rsi
call   1080 <printf@plt>
mov    -0x8(%rbp),%eax
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x98(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1060 <initialisiere_int_array@plt>
movsd  0xb7a(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  0xb70(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1522 <schreibe_statistik_sammelbilderproblem+0x352>
mov    -0x98(%rbp),%rdx
mov    -0x80(%rbp),%rdi
mov    -0x8(%rbp),%esi
movsd  -0x78(%rbp),%xmm0
call   1050 <indizes_kleiner_als_double_array@plt>
mov    %eax,-0x6c(%rbp)
movsd  -0x78(%rbp),%xmm0
lea    0xc26(%rip),%rdi
lea    0xc2e(%rip),%rsi
mov    $0x1,%al
call   1080 <printf@plt>
mov    $0x5b,%edi
call   1030 <putchar@plt>
mov    -0x98(%rbp),%rdi
mov    -0x6c(%rbp),%esi
xor    %r8d,%r8d
lea    0xc21(%rip),%rcx
mov    %r8d,%edx
call   1090 <schreibe_int_array@plt>
mov    $0x5d,%edi
call   1030 <putchar@plt>
movsd  -0x78(%rbp),%xmm0
movsd  0xafc(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    148b <schreibe_statistik_sammelbilderproblem+0x2bb>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<schreibe_statistik_sammelbilderproblem>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %esi,%ebx
mov    %edi,%r15d
mov    %esi,%r14d
mov    %rsp,%r13
lea    0xf(,%r14,4),%rax
and    $0xfffffffffffffff0,%rax
mov    %rax,-0x58(%rbp)
sub    %rax,%r13
mov    %r13,%rsp
mov    %r13,%rdi
xor    %edx,%edx
call   1070 <initialisiere_int_array@plt>
xor    %eax,%eax
call   10c0 <initialisiere_zufallszahlengenerator@plt>
mov    %ebx,%edi
mov    %r13,%rsi
mov    %r15d,%edx
call   10f0 <simulier_einkaeufe@plt>
mov    %r15d,%edi
call   1100 <durchschnittlich_benoetigten_kaeufe@plt>
movsd  %xmm0,-0x30(%rbp)
mov    %rsp,%rcx
lea    0xf(,%r14,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,%r12
mov    %rcx,%rsp
sub    $0x8,%rsp
lea    0xdf0(%rip),%r10
lea    0xdc1(%rip),%rdi
lea    0xdd8(%rip),%rsi
lea    0xdd5(%rip),%rdx
lea    0xdd1(%rip),%rcx
lea    0xdcb(%rip),%r8
lea    0xdc7(%rip),%r9
xor    %eax,%eax
push   %r10
call   1090 <printf@plt>
add    $0x10,%rsp
mov    %ebx,-0x34(%rbp)
test   %ebx,%ebx
jle    1310 <schreibe_statistik_sammelbilderproblem+0x130>
xor    %ebx,%ebx
xorps  %xmm1,%xmm1
cvtsi2sdl 0x0(%r13,%rbx,4),%xmm1
subsd  -0x30(%rbp),%xmm1
movapd 0xd49(%rip),%xmm0
andpd  %xmm0,%xmm1
movapd %xmm1,-0x50(%rbp)
lea    0x1(%rbx),%r15
mov    %r13,%rdi
mov    %r15d,%esi
call   10d0 <durchschnitt_int_array@plt>
movapd %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm1
movapd %xmm1,%xmm3
subsd  %xmm0,%xmm3
andpd  0xd18(%rip),%xmm3
movlpd %xmm3,(%r12,%rbx,8)
mov    0x0(%r13,%rbx,4),%edx
lea    0xd59(%rip),%rdi
mov    %r15d,%esi
movaps -0x50(%rbp),%xmm0
mov    $0x4,%al
call   1090 <printf@plt>
mov    %r15,%rbx
cmp    %r15,%r14
jne    12a0 <schreibe_statistik_sammelbilderproblem+0xc0>
lea    0xd68(%rip),%rdi
call   1050 <puts@plt>
mov    %r13,%rdi
mov    -0x34(%rbp),%r14d
mov    %r14d,%esi
call   10e0 <median_int_array@plt>
movsd  %xmm0,-0x50(%rbp)
mov    %r12,%r15
mov    %r12,%rdi
mov    %r14d,%esi
call   1040 <median_double_array@plt>
movsd  %xmm0,-0x30(%rbp)
mov    %r12,%rdi
mov    %r14d,%esi
call   1080 <liefere_min_double_array@plt>
mov    %rax,%r12
mov    %r15,%rdi
mov    %r14d,%esi
call   10b0 <liefere_max_double_array@plt>
mov    %rax,%r13
lea    0xd0e(%rip),%rbx
lea    0xd14(%rip),%rsi
mov    %rbx,%rdi
movsd  -0x50(%rbp),%xmm0
mov    $0x1,%al
call   1090 <printf@plt>
lea    0xd19(%rip),%rsi
mov    %rbx,%rdi
movsd  -0x30(%rbp),%xmm0
mov    $0x1,%al
call   1090 <printf@plt>
movsd  0x0(%r13),%xmm0
lea    0xd13(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%al
call   1090 <printf@plt>
movsd  (%r12),%xmm0
lea    0xd15(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    %rsp,%rbx
sub    -0x58(%rbp),%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
mov    %r14d,%esi
xor    %edx,%edx
call   1070 <initialisiere_int_array@plt>
movsd  0xc31(%rip),%xmm0
mov    %r15,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
call   1060 <indizes_kleiner_als_double_array@plt>
mov    %eax,%r12d
lea    0xced(%rip),%r13
lea    0xcf5(%rip),%rsi
mov    %r13,%rdi
movsd  0xc07(%rip),%xmm0
mov    $0x1,%al
call   1090 <printf@plt>
mov    $0x5b,%edi
call   1030 <putchar@plt>
lea    0xcea(%rip),%rcx
mov    %rbx,%rdi
mov    %r12d,%esi
xor    %edx,%edx
xor    %r8d,%r8d
call   10a0 <schreibe_int_array@plt>
mov    $0x5d,%edi
call   1030 <putchar@plt>
movsd  0xbd5(%rip),%xmm0
mov    %r15,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
call   1060 <indizes_kleiner_als_double_array@plt>
mov    %eax,%r12d
mov    %r13,%rdi
lea    0xc95(%rip),%rsi
movsd  0xbb2(%rip),%xmm0
mov    $0x1,%al
call   1090 <printf@plt>
mov    $0x5b,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
xor    %edx,%edx
lea    0xc85(%rip),%r12
mov    %r12,%rcx
xor    %r8d,%r8d
call   10a0 <schreibe_int_array@plt>
mov    $0x5d,%edi
call   1030 <putchar@plt>
movsd  0xb7d(%rip),%xmm0
mov    %r15,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
call   1060 <indizes_kleiner_als_double_array@plt>
mov    %eax,%r14d
mov    %r13,%rdi
lea    0xc35(%rip),%rsi
movsd  0xb5a(%rip),%xmm0
mov    $0x1,%al
call   1090 <printf@plt>
mov    $0x5b,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
xor    %edx,%edx
mov    %r12,%rcx
xor    %r8d,%r8d
call   10a0 <schreibe_int_array@plt>
mov    $0x5d,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"\0A%5s %5s %15s %15s %15s %15s\0A\00"
@.str.1 = [4 x i8] c"KNR\00"
@.str.2 = [3 x i8] c"KK\00"
@.str.3 = [3 x i8] c"AE\00"
@.str.4 = [2 x i8] c"E\00"
@.str.5 = [2 x i8] c"M\00"
@.str.6 = [3 x i8] c"AM\00"
@.str.7 = [33 x i8] c"\0A%7d %5d %15lf %15lf %15lf %15lf\00"
@.str.8 = [3 x i8] c"\0A\0A\00"
@.str.9 = [13 x i8] c"%-25s %10lf\0A\00"
@.str.10 = [27 x i8] c"Median der Anzahl Kaeufe: \00"
@.str.11 = [22 x i8] c"Median der Werte AM: \00"
@.str.12 = [25 x i8] c"groesster der Werte AM: \00"
@.str.13 = [25 x i8] c"kleinster der Werte AM: \00"
@.str.14 = [15 x i8] c"\0A%-s %4.1lf :\09\00"
@.str.15 = [24 x i8] c"Indizes der Werte AM < \00"
@.str.16 = [3 x i8] c", \00"
@durchschnitt_versuche = global double 0.000000e+00
define void @schreibe_statistik_sammelbilderproblem(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i64
%11 = alloca i32
%12 = alloca double
%13 = alloca double
%14 = alloca double*
%15 = alloca double*
%16 = alloca i64
%17 = alloca i32
%18 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%19 = load i32, i32* %4
%20 = zext i32 %19 to i64
%21 = call i8* @llvm.stacksave()
store i8* %21, i8** %5
%22 = alloca i32, i64 %20
store i64 %20, i64* %6
%23 = load i32, i32* %4
%24 = call i32 @initialisiere_int_array(i32* %22, i32 %23, i32 0)
%25 = call i32 (...) @initialisiere_zufallszahlengenerator()
%26 = load i32, i32* %4
%27 = load i32, i32* %3
%28 = call i32 @simulier_einkaeufe(i32 %26, i32* %22, i32 %27)
%29 = load i32, i32* %3
%30 = call double @durchschnittlich_benoetigten_kaeufe(i32 %29)
store double %30, double* %7
store double %30, double* %7
store double 0.000000e+00, double* %8
store double 0.000000e+00, double* %9
%31 = load i32, i32* %4
%32 = zext i32 %31 to i64
%33 = alloca double, i64 %32
store i64 %32, i64* %10
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %11
br label %35
35: ; preds = %72, %2
%36 = load i32, i32* %11
%37 = load i32, i32* %4
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %75
39: ; preds = %35
%40 = load i32, i32* %11
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %22, i64 %41
%43 = load i32, i32* %42
%44 = sitofp i32 %43 to double
%45 = load double, double* %7
%46 = fsub double %44, %45
%47 = call double @llvm.fabs.f64(double %46)
store double %47, double* %8
%48 = load i32, i32* %11
%49 = add nsw i32 %48, 1
%50 = call double @durchschnitt_int_array(i32* %22, i32 %49)
store double %50, double* %9
%51 = load double, double* %7
%52 = load double, double* %9
%53 = fsub double %51, %52
%54 = call double @llvm.fabs.f64(double %53)
%55 = load i32, i32* %11
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %33, i64 %56
store double %54, double* %57
%58 = load i32, i32* %11
%59 = add nsw i32 %58, 1
%60 = load i32, i32* %11
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i32, i32* %22, i64 %61
%63 = load i32, i32* %62
%64 = load double, double* %8
%65 = load double, double* %7
%66 = load double, double* %9
%67 = load i32, i32* %11
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %33, i64 %68
%70 = load double, double* %69
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i32 %59, i32 %63, double %64, double %65, double %66, double %70)
br label %72
72: ; preds = %39
%73 = load i32, i32* %11
%74 = add nsw i32 %73, 1
store i32 %74, i32* %11
br label %35
75: ; preds = %35
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%77 = load i32, i32* %4
%78 = call double @median_int_array(i32* %22, i32 %77)
store double %78, double* %12
%79 = load i32, i32* %4
%80 = call double @median_double_array(double* %33, i32 %79)
store double %80, double* %13
%81 = load i32, i32* %4
%82 = call double* @liefere_min_double_array(double* %33, i32 %81)
store double* %82, double** %14
%83 = load i32, i32* %4
%84 = call double* @liefere_max_double_array(double* %33, i32 %83)
store double* %84, double** %15
%85 = load double, double* %12
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), double %85)
%87 = load double, double* %13
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), double %87)
%89 = load double*, double** %15
%90 = load double, double* %89
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0), double %90)
%92 = load double*, double** %14
%93 = load double, double* %92
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0), double %93)
%95 = load i32, i32* %4
%96 = zext i32 %95 to i64
%97 = alloca i32, i64 %96
store i64 %96, i64* %16
store i32 0, i32* %17
%98 = load i32, i32* %4
%99 = call i32 @initialisiere_int_array(i32* %97, i32 %98, i32 0)
store double 1.000000e+00, double* %18
br label %100
100: ; preds = %113, %75
%101 = load double, double* %18
%102 = fcmp ogt double %101, 6.000000e-01
br i1 %102, label %103, label %116
103: ; preds = %100
%104 = load i32, i32* %4
%105 = load double, double* %18
%106 = call i32 @indizes_kleiner_als_double_array(double* %33, i32 %104, i32* %97, double %105)
store i32 %106, i32* %17
%107 = load double, double* %18
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), double %107)
%109 = call i32 @putchar(i8 signext 91)
%110 = load i32, i32* %17
%111 = call i32 @schreibe_int_array(i32* %97, i32 %110, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0), i32 0)
%112 = call i32 @putchar(i8 signext 93)
br label %113
113: ; preds = %103
%114 = load double, double* %18
%115 = fsub double %114, 2.000000e-01
store double %115, double* %18
br label %100
116: ; preds = %100
%117 = call i32 @putchar(i8 signext 10)
%118 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"\0A%5s %5s %15s %15s %15s %15s\0A\00"
@.str.1 = [4 x i8] c"KNR\00"
@.str.2 = [3 x i8] c"KK\00"
@.str.3 = [3 x i8] c"AE\00"
@.str.4 = [2 x i8] c"E\00"
@.str.5 = [2 x i8] c"M\00"
@.str.6 = [3 x i8] c"AM\00"
@.str.7 = [33 x i8] c"\0A%7d %5d %15lf %15lf %15lf %15lf\00"
@.str.9 = [13 x i8] c"%-25s %10lf\0A\00"
@.str.10 = [27 x i8] c"Median der Anzahl Kaeufe: \00"
@.str.11 = [22 x i8] c"Median der Werte AM: \00"
@.str.12 = [25 x i8] c"groesster der Werte AM: \00"
@.str.13 = [25 x i8] c"kleinster der Werte AM: \00"
@.str.14 = [15 x i8] c"\0A%-s %4.1lf :\09\00"
@.str.15 = [24 x i8] c"Indizes der Werte AM < \00"
@.str.16 = [3 x i8] c", \00"
@durchschnitt_versuche = global double 0.000000e+00
@str = [2 x i8] c"\0A\00"
define void @schreibe_statistik_sammelbilderproblem(i32 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = alloca i32, i64 %3
%5 = call i32 @initialisiere_int_array(i32* %4, i32 %1, i32 0)
%6 = call i32 (...) @initialisiere_zufallszahlengenerator()
%7 = call i32 @simulier_einkaeufe(i32 %1, i32* %4, i32 %0)
%8 = call double @durchschnittlich_benoetigten_kaeufe(i32 %0)
%9 = alloca double, i64 %3
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%11 = icmp sgt i32 %1, 0
br i1 %11, label %42, label %12
12: ; preds = %42, %2
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%14 = call double @median_int_array(i32* %4, i32 %1)
%15 = call double @median_double_array(double* %9, i32 %1)
%16 = call double* @liefere_min_double_array(double* %9, i32 %1)
%17 = call double* @liefere_max_double_array(double* %9, i32 %1)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), double %14)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), double %15)
%20 = load double, double* %17
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0), double %20)
%22 = load double, double* %16
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0), double %22)
%24 = alloca i32, i64 %3
%25 = call i32 @initialisiere_int_array(i32* %24, i32 %1, i32 0)
%26 = call i32 @indizes_kleiner_als_double_array(double* %9, i32 %1, i32* %24, double 1.000000e+00)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), double 1.000000e+00)
%28 = call i32 @putchar(i8 signext 91)
%29 = call i32 @schreibe_int_array(i32* %24, i32 %26, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0), i32 0)
%30 = call i32 @putchar(i8 signext 93)
%31 = call i32 @indizes_kleiner_als_double_array(double* %9, i32 %1, i32* %24, double 8.000000e-01)
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), double 8.000000e-01)
%33 = call i32 @putchar(i8 signext 91)
%34 = call i32 @schreibe_int_array(i32* %24, i32 %31, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0), i32 0)
%35 = call i32 @putchar(i8 signext 93)
%36 = call i32 @indizes_kleiner_als_double_array(double* %9, i32 %1, i32* %24, double 0x3FE3333333333334)
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), double 0x3FE3333333333334)
%38 = call i32 @putchar(i8 signext 91)
%39 = call i32 @schreibe_int_array(i32* %24, i32 %36, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0), i32 0)
%40 = call i32 @putchar(i8 signext 93)
%41 = call i32 @putchar(i8 signext 10)
ret void
42: ; preds = %2, %42
%43 = phi i64 [ %49, %42 ], [ 0, %2 ]
%44 = getelementptr inbounds i32, i32* %4, i64 %43
%45 = load i32, i32* %44
%46 = sitofp i32 %45 to double
%47 = fsub double %46, %8
%48 = call double @llvm.fabs.f64(double %47)
%49 = add nuw nsw i64 %43, 1
%50 = trunc i64 %49 to i32
%51 = call double @durchschnitt_int_array(i32* %4, i32 %50)
%52 = fsub double %8, %51
%53 = call double @llvm.fabs.f64(double %52)
%54 = getelementptr inbounds double, double* %9, i64 %43
store double %53, double* %54
%55 = load i32, i32* %44
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i32 %50, i32 %55, double %48, double %8, double %51, double %53)
%57 = icmp eq i64 %49, %3
br i1 %57, label %12, label %42
}