#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 double clock_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
double clock();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ for_loop(int, int, int const);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  const int f_max = 4;
  const int pow_min = 4;
  const int pow_max = 8;
  const int j_max = 1 << 24;
  clock_t time_min;
  for (int pow = pow_min; pow < pow_max; pow++) {
    printf("%d ", pow);
    for (int f = 0; f < f_max; f++) {
      clock_t start = clock();
      for_loop(f, 1 << pow, j_max);
      clock_t stop = clock();
      if (f == 0) {
        time_min = stop - start;
      }
      printf("%f ", (double)(stop - start) / time_min);
    }
    printf("\n");
  }
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
movl   $0x8,-0x10(%rbp)
movl   $0x1000000,-0x14(%rbp)
movl   $0x4,-0x24(%rbp)
cmpl   $0x8,-0x24(%rbp)
jge    122d <main+0xed>
mov    -0x24(%rbp),%esi
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x28(%rbp)
cmpl   $0x4,-0x28(%rbp)
jge    1211 <main+0xd1>
mov    $0x0,%al
call   1030 <clock@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x28(%rbp),%edi
mov    -0x24(%rbp),%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    $0x1000000,%edx
call   1050 <for_loop@plt>
mov    $0x0,%al
call   1030 <clock@plt>
movsd  %xmm0,-0x38(%rbp)
cmpl   $0x0,-0x28(%rbp)
jne    11e6 <main+0xa6>
movsd  -0x38(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
lea    0xe08(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1194 <main+0x54>
lea    0xdf0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1172 <main+0x32>
mov    0x2dac(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    $0x4,%ebx
lea    0xe9a(%rip),%r14
lea    0xe97(%rip),%r15
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%ebp
mov    %ebx,%ecx
shl    %cl,%ebp
xor    %eax,%eax
call   1040 <clock@plt>
movsd  %xmm0,0x10(%rsp)
xor    %edi,%edi
mov    %ebp,%esi
mov    $0x1000000,%edx
call   1060 <for_loop@plt>
xor    %eax,%eax
call   1040 <clock@plt>
subsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
divsd  %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <clock@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%edi
mov    %ebp,%esi
mov    $0x1000000,%edx
call   1060 <for_loop@plt>
xor    %eax,%eax
call   1040 <clock@plt>
subsd  0x8(%rsp),%xmm0
divsd  0x10(%rsp),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <clock@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
mov    %ebp,%esi
mov    $0x1000000,%edx
call   1060 <for_loop@plt>
xor    %eax,%eax
call   1040 <clock@plt>
subsd  0x8(%rsp),%xmm0
divsd  0x10(%rsp),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <clock@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x3,%edi
mov    %ebp,%esi
mov    $0x1000000,%edx
call   1060 <for_loop@plt>
xor    %eax,%eax
call   1040 <clock@plt>
subsd  0x8(%rsp),%xmm0
divsd  0x10(%rsp),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x8,%ebx
jne    1170 <main+0x20>
mov    0x2d51(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [4 x i8] c"%f \00"
@.str.2 = [2 x i8] c"\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca double
store i32 0, i32* %1
store i32 4, i32* %2
store i32 4, i32* %3
store i32 8, i32* %4
store i32 16777216, i32* %5
store i32 4, i32* %7
br label %11
11: ; preds = %45, %0
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 8
br i1 %13, label %14, label %48
14: ; preds = %11
%15 = load i32, i32* %7
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
store i32 0, i32* %8
br label %17
17: ; preds = %40, %14
%18 = load i32, i32* %8
%19 = icmp slt i32 %18, 4
br i1 %19, label %20, label %43
20: ; preds = %17
%21 = call double (...) @clock()
store double %21, double* %9
%22 = load i32, i32* %8
%23 = load i32, i32* %7
%24 = shl i32 1, %23
%25 = call i32 @for_loop(i32 %22, i32 %24, i32 16777216)
%26 = call double (...) @clock()
store double %26, double* %10
%27 = load i32, i32* %8
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %33
29: ; preds = %20
%30 = load double, double* %10
%31 = load double, double* %9
%32 = fsub double %30, %31
store double %32, double* %6
br label %33
33: ; preds = %29, %20
%34 = load double, double* %10
%35 = load double, double* %9
%36 = fsub double %34, %35
%37 = load double, double* %6
%38 = fdiv double %36, %37
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %38)
br label %40
40: ; preds = %33
%41 = load i32, i32* %8
%42 = add nsw i32 %41, 1
store i32 %42, i32* %8
br label %17
43: ; preds = %17
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %45
45: ; preds = %43
%46 = load i32, i32* %7
%47 = add nsw i32 %46, 1
store i32 %47, i32* %7
br label %11
48: ; preds = %11
%49 = load i32, i32* @EXIT_SUCCESS
%50 = call i32 @exit(i32 %49)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
@.str.1 = [4 x i8] c"%f \00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
br label %4
1: ; preds = %4
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
4: ; preds = %0, %4
%5 = phi i32 [ 4, %0 ], [ %33, %4 ]
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = shl nuw i32 1, %5
%8 = tail call double (...) @clock()
%9 = tail call i32 @for_loop(i32 0, i32 %7, i32 16777216)
%10 = tail call double (...) @clock()
%11 = fsub double %10, %8
%12 = fdiv double %11, %11
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %12)
%14 = tail call double (...) @clock()
%15 = tail call i32 @for_loop(i32 1, i32 %7, i32 16777216)
%16 = tail call double (...) @clock()
%17 = fsub double %16, %14
%18 = fdiv double %17, %11
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %18)
%20 = tail call double (...) @clock()
%21 = tail call i32 @for_loop(i32 2, i32 %7, i32 16777216)
%22 = tail call double (...) @clock()
%23 = fsub double %22, %20
%24 = fdiv double %23, %11
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %24)
%26 = tail call double (...) @clock()
%27 = tail call i32 @for_loop(i32 3, i32 %7, i32 16777216)
%28 = tail call double (...) @clock()
%29 = fsub double %28, %26
%30 = fdiv double %29, %11
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %30)
%32 = tail call i32 @putchar(i32 10)
%33 = add nuw nsw i32 %5, 1
%34 = icmp eq i32 %33, 8
br i1 %34, label %1, label %4
}