#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 /*<<< orphan*/ printf(char *, ...);
void printStats(char *testRun, long *results) {
  long long averageTime = 0;
  long min = results[0];
  long max = results[0];
  for (int i = 0; i < 100; i++) {
    averageTime += results[i];
    if (results[i] < min) {
      min = results[i];
    }
    if (results[i] > max) {
      max = results[i];
    }
  }
  printf("%s\n", testRun);
  printf("---- Stats for run ----\n");
  printf("Max Runtime:        %06ld\n", max);
  printf("Average Runtime:    %06ld\n", (long)(averageTime / 100));
  printf("Min Runtime:        %06ld\n\n", min);
}


x86 assembly (clang, -O0):
<printStats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x64,-0x2c(%rbp)
jge    11c2 <printStats+0xb2>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmp    -0x20(%rbp),%rax
jge    1189 <printStats+0x79>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmp    -0x28(%rbp),%rax
jle    11af <printStats+0x9f>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
jmp    11b4 <printStats+0xa4>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1145 <printStats+0x35>
mov    -0x8(%rbp),%rsi
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
mov    %rax,%rsi
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printStats>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    (%rsi),%r15
mov    $0x3,%eax
mov    %r15,%r14
mov    %r15,%r12
jmp    114d <printStats+0x2d>
nopl   0x0(%rax,%rax,1)
add    %rdx,%r12
add    $0x3,%rax
cmp    $0x66,%rax
je     119b <printStats+0x7b>
mov    -0x10(%rsi,%rax,8),%rdx
add    %rdx,%r12
cmp    %r14,%rdx
cmovl  %rdx,%r14
mov    -0x8(%rsi,%rax,8),%rcx
cmp    %r15,%rdx
cmovg  %rdx,%r15
cmp    %r14,%rcx
mov    %r14,%rbx
cmovl  %rcx,%rbx
cmp    %r15,%rcx
mov    %r15,%r8
cmovg  %rcx,%r8
mov    (%rsi,%rax,8),%rdx
mov    %rdx,%r14
cmp    %rbx,%rdx
jl     118b <printStats+0x6b>
mov    %rbx,%r14
add    %rcx,%r12
mov    %rdx,%r15
cmp    %r8,%rdx
jg     1140 <printStats+0x20>
mov    %r8,%r15
jmp    1140 <printStats+0x20>
call   1030 <puts@plt>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
lea    0xe4d(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
movabs $0xa3d70a3d70a3d70b,%rcx
0a d7 a3
mov    %r12,%rax
imul   %rcx
add    %rdx,%r12
mov    %r12,%rax
shr    $0x3f,%rax
sar    $0x6,%r12
add    %rax,%r12
lea    0xe36(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe40(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [25 x i8] c"---- Stats for run ----\0A\00"
@.str.2 = [27 x i8] c"Max Runtime: %06ld\0A\00"
@.str.3 = [27 x i8] c"Average Runtime: %06ld\0A\00"
@.str.4 = [28 x i8] c"Min Runtime: %06ld\0A\0A\00"
define void @printStats(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32
store i8* %0, i8** %3
store i64* %1, i64** %4
store i64 0, i64* %5
%9 = load i64*, i64** %4
%10 = getelementptr inbounds i64, i64* %9, i64 0
%11 = load i64, i64* %10
store i64 %11, i64* %6
%12 = load i64*, i64** %4
%13 = getelementptr inbounds i64, i64* %12, i64 0
%14 = load i64, i64* %13
store i64 %14, i64* %7
store i32 0, i32* %8
br label %15
15: ; preds = %54, %2
%16 = load i32, i32* %8
%17 = icmp slt i32 %16, 100
br i1 %17, label %18, label %57
18: ; preds = %15
%19 = load i64*, i64** %4
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i64, i64* %19, i64 %21
%23 = load i64, i64* %22
%24 = load i64, i64* %5
%25 = add nsw i64 %24, %23
store i64 %25, i64* %5
%26 = load i64*, i64** %4
%27 = load i32, i32* %8
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i64, i64* %26, i64 %28
%30 = load i64, i64* %29
%31 = load i64, i64* %6
%32 = icmp slt i64 %30, %31
br i1 %32, label %33, label %39
33: ; preds = %18
%34 = load i64*, i64** %4
%35 = load i32, i32* %8
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i64, i64* %34, i64 %36
%38 = load i64, i64* %37
store i64 %38, i64* %6
br label %39
39: ; preds = %33, %18
%40 = load i64*, i64** %4
%41 = load i32, i32* %8
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i64, i64* %40, i64 %42
%44 = load i64, i64* %43
%45 = load i64, i64* %7
%46 = icmp sgt i64 %44, %45
br i1 %46, label %47, label %53
47: ; preds = %39
%48 = load i64*, i64** %4
%49 = load i32, i32* %8
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i64, i64* %48, i64 %50
%52 = load i64, i64* %51
store i64 %52, i64* %7
br label %53
53: ; preds = %47, %39
br label %54
54: ; preds = %53
%55 = load i32, i32* %8
%56 = add nsw i32 %55, 1
store i32 %56, i32* %8
br label %15
57: ; preds = %15
%58 = load i8*, i8** %3
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %58)
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%61 = load i64, i64* %7
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i64 %61)
%63 = load i64, i64* %5
%64 = sdiv i64 %63, 100
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i64 %64)
%66 = load i64, i64* %6
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i64 %66)
ret void
}

LLVM IR (-O2):
@.str.2 = [27 x i8] c"Max Runtime: %06ld\0A\00"
@.str.3 = [27 x i8] c"Average Runtime: %06ld\0A\00"
@.str.4 = [28 x i8] c"Min Runtime: %06ld\0A\0A\00"
@str = [24 x i8] c"---- Stats for run ----\00"
define void @printStats(i8* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %1
br label %11
4: ; preds = %11
%5 = tail call i32 @puts(i8* dereferenceable(1) %0)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i64 %38)
%8 = sdiv i64 %34, 100
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i64 %8)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i64 %36)
ret void
11: ; preds = %11, %2
%12 = phi i64 [ 1, %2 ], [ %39, %11 ]
%13 = phi i64 [ %3, %2 ], [ %38, %11 ]
%14 = phi i64 [ %3, %2 ], [ %36, %11 ]
%15 = phi i64 [ %3, %2 ], [ %34, %11 ]
%16 = getelementptr inbounds i64, i64* %1, i64 %12
%17 = load i64, i64* %16
%18 = add nsw i64 %17, %15
%19 = icmp slt i64 %17, %14
%20 = select i1 %19, i64 %17, i64 %14
%21 = icmp sgt i64 %17, %13
%22 = select i1 %21, i64 %17, i64 %13
%23 = add nuw nsw i64 %12, 1
%24 = getelementptr inbounds i64, i64* %1, i64 %23
%25 = load i64, i64* %24
%26 = add nsw i64 %25, %18
%27 = icmp slt i64 %25, %20
%28 = select i1 %27, i64 %25, i64 %20
%29 = icmp sgt i64 %25, %22
%30 = select i1 %29, i64 %25, i64 %22
%31 = add nuw nsw i64 %12, 2
%32 = getelementptr inbounds i64, i64* %1, i64 %31
%33 = load i64, i64* %32
%34 = add nsw i64 %33, %26
%35 = icmp slt i64 %33, %28
%36 = select i1 %35, i64 %33, i64 %28
%37 = icmp sgt i64 %33, %30
%38 = select i1 %37, i64 %33, i64 %30
%39 = add nuw nsw i64 %12, 3
%40 = icmp eq i64 %39, 100
br i1 %40, label %4, label %11
}