#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 */
float dummy();
double get_seconds();
float my_random_float2();
int /*<<< orphan*/ printf(char *, double);
float random_float();
int /*<<< orphan*/ srandom(int);
main(int argc, char *argv[]) {
  int i;
  float f;
  double t0, t1;
  int iters = 100000000;
  int seed = 17;
  srandom(seed);
  t0 = get_seconds();
  for (i = 0; i < iters; i++) {
    f = dummy();
  }
  t1 = get_seconds();
  printf("dummy \t %f ms\n", t1 - t0);
  srandom(seed);
  t0 = get_seconds();
  for (i = 0; i < iters; i++) {
    f = dummy();
  }
  t1 = get_seconds();
  printf("dummy \t %f ms\n", t1 - t0);
  srandom(seed);
  t0 = get_seconds();
  for (i = 0; i < iters; i++) {
    f = my_random_float2();
  }
  t1 = get_seconds();
  printf("mine \t %f ms\n", t1 - t0);
  srandom(seed);
  t0 = get_seconds();
  for (i = 0; i < iters; i++) {
    f = my_random_float2();
  }
  t1 = get_seconds();
  printf("mine \t %f ms\n", t1 - t0);
  srandom(seed);
  t0 = get_seconds();
  for (i = 0; i < iters; i++) {
    f = random_float();
  }
  t1 = get_seconds();
  printf("theirs \t %f ms\n", t1 - t0);
  srandom(seed);
  t0 = get_seconds();
  for (i = 0; i < iters; i++) {
    f = random_float();
  }
  t1 = get_seconds();
  printf("theirs \t %f ms\n", t1 - t0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5f5e100,-0x2c(%rbp)
movl   $0x11,-0x30(%rbp)
mov    -0x30(%rbp),%edi
call   1050 <srandom@plt>
mov    $0x0,%al
call   1030 <get_seconds@plt>
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    11c5 <main+0x65>
mov    $0x0,%al
call   1040 <dummy@plt>
movss  %xmm0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    119f <main+0x3f>
mov    $0x0,%al
call   1030 <get_seconds@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
lea    0xe1e(%rip),%rdi
call   1080 <printf@plt>
mov    -0x30(%rbp),%edi
call   1050 <srandom@plt>
mov    $0x0,%al
call   1030 <get_seconds@plt>
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1228 <main+0xc8>
mov    $0x0,%al
call   1040 <dummy@plt>
movss  %xmm0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1202 <main+0xa2>
mov    $0x0,%al
call   1030 <get_seconds@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
lea    0xdbb(%rip),%rdi
call   1080 <printf@plt>
mov    -0x30(%rbp),%edi
call   1050 <srandom@plt>
mov    $0x0,%al
call   1030 <get_seconds@plt>
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    128b <main+0x12b>
mov    $0x0,%al
call   1060 <my_random_float2@plt>
movss  %xmm0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1265 <main+0x105>
mov    $0x0,%al
call   1030 <get_seconds@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
lea    0xd67(%rip),%rdi
call   1080 <printf@plt>
mov    -0x30(%rbp),%edi
call   1050 <srandom@plt>
mov    $0x0,%al
call   1030 <get_seconds@plt>
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    12ee <main+0x18e>
mov    $0x0,%al
call   1060 <my_random_float2@plt>
movss  %xmm0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12c8 <main+0x168>
mov    $0x0,%al
call   1030 <get_seconds@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
lea    0xd04(%rip),%rdi
call   1080 <printf@plt>
mov    -0x30(%rbp),%edi
call   1050 <srandom@plt>
mov    $0x0,%al
call   1030 <get_seconds@plt>
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1351 <main+0x1f1>
mov    $0x0,%al
call   1070 <random_float@plt>
movss  %xmm0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    132b <main+0x1cb>
mov    $0x0,%al
call   1030 <get_seconds@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
lea    0xcaf(%rip),%rdi
call   1080 <printf@plt>
mov    -0x30(%rbp),%edi
call   1050 <srandom@plt>
mov    $0x0,%al
call   1030 <get_seconds@plt>
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    13b4 <main+0x254>
mov    $0x0,%al
call   1070 <random_float@plt>
movss  %xmm0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    138e <main+0x22e>
mov    $0x0,%al
call   1030 <get_seconds@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
lea    0xc4c(%rip),%rdi
call   1080 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x11,%edi
call   1050 <srandom@plt>
xor    %eax,%eax
call   1030 <get_seconds@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x5f5e100,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <dummy@plt>
add    $0xffffffff,%ebx
jne    1190 <main+0x30>
xor    %eax,%eax
call   1030 <get_seconds@plt>
subsd  0x8(%rsp),%xmm0
lea    0xe50(%rip),%rdi
call   1080 <printf@plt>
mov    $0x11,%edi
call   1050 <srandom@plt>
xor    %eax,%eax
call   1030 <get_seconds@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x5f5e100,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <dummy@plt>
add    $0xffffffff,%ebx
jne    11e0 <main+0x80>
xor    %eax,%eax
call   1030 <get_seconds@plt>
subsd  0x8(%rsp),%xmm0
lea    0xe00(%rip),%rdi
call   1080 <printf@plt>
mov    $0x11,%edi
call   1050 <srandom@plt>
xor    %eax,%eax
call   1030 <get_seconds@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x5f5e100,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <my_random_float2@plt>
add    $0xffffffff,%ebx
jne    1230 <main+0xd0>
xor    %eax,%eax
call   1030 <get_seconds@plt>
subsd  0x8(%rsp),%xmm0
lea    0xdbf(%rip),%rdi
call   1080 <printf@plt>
mov    $0x11,%edi
call   1050 <srandom@plt>
xor    %eax,%eax
call   1030 <get_seconds@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x5f5e100,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <my_random_float2@plt>
add    $0xffffffff,%ebx
jne    1280 <main+0x120>
xor    %eax,%eax
call   1030 <get_seconds@plt>
subsd  0x8(%rsp),%xmm0
lea    0xd6f(%rip),%rdi
call   1080 <printf@plt>
mov    $0x11,%edi
call   1050 <srandom@plt>
xor    %eax,%eax
call   1030 <get_seconds@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x5f5e100,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <random_float@plt>
add    $0xffffffff,%ebx
jne    12d0 <main+0x170>
xor    %eax,%eax
call   1030 <get_seconds@plt>
subsd  0x8(%rsp),%xmm0
lea    0xd2d(%rip),%rdi
call   1080 <printf@plt>
mov    $0x11,%edi
call   1050 <srandom@plt>
xor    %eax,%eax
call   1030 <get_seconds@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x5f5e100,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <random_float@plt>
add    $0xffffffff,%ebx
jne    1320 <main+0x1c0>
xor    %eax,%eax
call   1030 <get_seconds@plt>
subsd  0x8(%rsp),%xmm0
lea    0xcdd(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"dummy \09 %f ms\0A\00"
@.str.1 = [14 x i8] c"mine \09 %f ms\0A\00"
@.str.2 = [16 x i8] c"theirs \09 %f ms\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 100000000, i32* %10
store i32 17, i32* %11
%12 = load i32, i32* %11
%13 = call i32 @srandom(i32 %12)
%14 = call double (...) @get_seconds()
store double %14, double* %8
store i32 0, i32* %6
br label %15
15: ; preds = %21, %2
%16 = load i32, i32* %6
%17 = load i32, i32* %10
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = call float (...) @dummy()
store float %20, float* %7
br label %21
21: ; preds = %19
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %15
24: ; preds = %15
%25 = call double (...) @get_seconds()
store double %25, double* %9
%26 = load double, double* %9
%27 = load double, double* %8
%28 = fsub double %26, %27
%29 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %28)
%30 = load i32, i32* %11
%31 = call i32 @srandom(i32 %30)
%32 = call double (...) @get_seconds()
store double %32, double* %8
store i32 0, i32* %6
br label %33
33: ; preds = %39, %24
%34 = load i32, i32* %6
%35 = load i32, i32* %10
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %42
37: ; preds = %33
%38 = call float (...) @dummy()
store float %38, float* %7
br label %39
39: ; preds = %37
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
br label %33
42: ; preds = %33
%43 = call double (...) @get_seconds()
store double %43, double* %9
%44 = load double, double* %9
%45 = load double, double* %8
%46 = fsub double %44, %45
%47 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %46)
%48 = load i32, i32* %11
%49 = call i32 @srandom(i32 %48)
%50 = call double (...) @get_seconds()
store double %50, double* %8
store i32 0, i32* %6
br label %51
51: ; preds = %57, %42
%52 = load i32, i32* %6
%53 = load i32, i32* %10
%54 = icmp slt i32 %52, %53
br i1 %54, label %55, label %60
55: ; preds = %51
%56 = call float (...) @my_random_float2()
store float %56, float* %7
br label %57
57: ; preds = %55
%58 = load i32, i32* %6
%59 = add nsw i32 %58, 1
store i32 %59, i32* %6
br label %51
60: ; preds = %51
%61 = call double (...) @get_seconds()
store double %61, double* %9
%62 = load double, double* %9
%63 = load double, double* %8
%64 = fsub double %62, %63
%65 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %64)
%66 = load i32, i32* %11
%67 = call i32 @srandom(i32 %66)
%68 = call double (...) @get_seconds()
store double %68, double* %8
store i32 0, i32* %6
br label %69
69: ; preds = %75, %60
%70 = load i32, i32* %6
%71 = load i32, i32* %10
%72 = icmp slt i32 %70, %71
br i1 %72, label %73, label %78
73: ; preds = %69
%74 = call float (...) @my_random_float2()
store float %74, float* %7
br label %75
75: ; preds = %73
%76 = load i32, i32* %6
%77 = add nsw i32 %76, 1
store i32 %77, i32* %6
br label %69
78: ; preds = %69
%79 = call double (...) @get_seconds()
store double %79, double* %9
%80 = load double, double* %9
%81 = load double, double* %8
%82 = fsub double %80, %81
%83 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %82)
%84 = load i32, i32* %11
%85 = call i32 @srandom(i32 %84)
%86 = call double (...) @get_seconds()
store double %86, double* %8
store i32 0, i32* %6
br label %87
87: ; preds = %93, %78
%88 = load i32, i32* %6
%89 = load i32, i32* %10
%90 = icmp slt i32 %88, %89
br i1 %90, label %91, label %96
91: ; preds = %87
%92 = call float (...) @random_float()
store float %92, float* %7
br label %93
93: ; preds = %91
%94 = load i32, i32* %6
%95 = add nsw i32 %94, 1
store i32 %95, i32* %6
br label %87
96: ; preds = %87
%97 = call double (...) @get_seconds()
store double %97, double* %9
%98 = load double, double* %9
%99 = load double, double* %8
%100 = fsub double %98, %99
%101 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %100)
%102 = load i32, i32* %11
%103 = call i32 @srandom(i32 %102)
%104 = call double (...) @get_seconds()
store double %104, double* %8
store i32 0, i32* %6
br label %105
105: ; preds = %111, %96
%106 = load i32, i32* %6
%107 = load i32, i32* %10
%108 = icmp slt i32 %106, %107
br i1 %108, label %109, label %114
109: ; preds = %105
%110 = call float (...) @random_float()
store float %110, float* %7
br label %111
111: ; preds = %109
%112 = load i32, i32* %6
%113 = add nsw i32 %112, 1
store i32 %113, i32* %6
br label %105
114: ; preds = %105
%115 = call double (...) @get_seconds()
store double %115, double* %9
%116 = load double, double* %9
%117 = load double, double* %8
%118 = fsub double %116, %117
%119 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %118)
%120 = load i32, i32* %3
ret i32 %120
}

LLVM IR (-O2):
@.str = [15 x i8] c"dummy \09 %f ms\0A\00"
@.str.1 = [14 x i8] c"mine \09 %f ms\0A\00"
@.str.2 = [16 x i8] c"theirs \09 %f ms\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @srandom(i32 17)
%4 = tail call double (...) @get_seconds()
br label %5
5: ; preds = %2, %5
%6 = phi i32 [ 0, %2 ], [ %8, %5 ]
%7 = tail call float (...) @dummy()
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, 100000000
br i1 %9, label %10, label %5
10: ; preds = %5
%11 = tail call double (...) @get_seconds()
%12 = fsub double %11, %4
%13 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %12)
%14 = tail call i32 @srandom(i32 17)
%15 = tail call double (...) @get_seconds()
br label %16
16: ; preds = %10, %16
%17 = phi i32 [ 0, %10 ], [ %19, %16 ]
%18 = tail call float (...) @dummy()
%19 = add nuw nsw i32 %17, 1
%20 = icmp eq i32 %19, 100000000
br i1 %20, label %21, label %16
21: ; preds = %16
%22 = tail call double (...) @get_seconds()
%23 = fsub double %22, %15
%24 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %23)
%25 = tail call i32 @srandom(i32 17)
%26 = tail call double (...) @get_seconds()
br label %27
27: ; preds = %21, %27
%28 = phi i32 [ 0, %21 ], [ %30, %27 ]
%29 = tail call float (...) @my_random_float2()
%30 = add nuw nsw i32 %28, 1
%31 = icmp eq i32 %30, 100000000
br i1 %31, label %32, label %27
32: ; preds = %27
%33 = tail call double (...) @get_seconds()
%34 = fsub double %33, %26
%35 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %34)
%36 = tail call i32 @srandom(i32 17)
%37 = tail call double (...) @get_seconds()
br label %38
38: ; preds = %32, %38
%39 = phi i32 [ 0, %32 ], [ %41, %38 ]
%40 = tail call float (...) @my_random_float2()
%41 = add nuw nsw i32 %39, 1
%42 = icmp eq i32 %41, 100000000
br i1 %42, label %43, label %38
43: ; preds = %38
%44 = tail call double (...) @get_seconds()
%45 = fsub double %44, %37
%46 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %45)
%47 = tail call i32 @srandom(i32 17)
%48 = tail call double (...) @get_seconds()
br label %49
49: ; preds = %43, %49
%50 = phi i32 [ 0, %43 ], [ %52, %49 ]
%51 = tail call float (...) @random_float()
%52 = add nuw nsw i32 %50, 1
%53 = icmp eq i32 %52, 100000000
br i1 %53, label %54, label %49
54: ; preds = %49
%55 = tail call double (...) @get_seconds()
%56 = fsub double %55, %48
%57 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %56)
%58 = tail call i32 @srandom(i32 17)
%59 = tail call double (...) @get_seconds()
br label %60
60: ; preds = %54, %60
%61 = phi i32 [ 0, %54 ], [ %63, %60 ]
%62 = tail call float (...) @random_float()
%63 = add nuw nsw i32 %61, 1
%64 = icmp eq i32 %63, 100000000
br i1 %64, label %65, label %60
65: ; preds = %60
%66 = tail call double (...) @get_seconds()
%67 = fsub double %66, %59
%68 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %67)
ret i32 0
}