#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 *, float);
void report(float d, int ops, size_t len) {
  printf("   len: %lu\n", len);
  printf("   ops: %'d\n", ops);
  printf("   ops/s: %'.2f\n", ops / d);
  printf("   ns/op: %'.2f\n", d / ops * 1e9);
  printf("   MiB/s: %'.2lu\n", ops * len / (1 << 20));
  printf("   duration: %.2fs\n", d);
}


x86 assembly (clang, -O0):
<report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x18(%rbp)
test   %rax,%rax
movss  %xmm0,-0x14(%rbp)
js     1161 <report+0x51>
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
cvtsi2ssl -0x8(%rbp),%xmm0
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
cvtsi2ssl -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe49(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
movslq -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
imul   %rcx,%rax
shr    $0x14,%rax
cvtsi2ss %rax,%xmm0
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
movss  %xmm0,(%rsp)
test   %rsi,%rsi
js     112c <report+0x1c>
xorps  %xmm0,%xmm0
cvtsi2ss %rbx,%xmm0
jmp    1146 <report+0x36>
mov    %rbx,%rax
shr    %rax
mov    %ebx,%ecx
and    $0x1,%ecx
or     %rax,%rcx
xorps  %xmm0,%xmm0
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
movss  %xmm0,0x4(%rsp)
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
divss  (%rsp),%xmm0
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
movss  (%rsp),%xmm0
divss  0x4(%rsp),%xmm0
mulss  0xe6b(%rip),%xmm0
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
movslq %ebp,%rax
imul   %rbx,%rax
shr    $0x14,%rax
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
lea    0xe8b(%rip),%rdi
movss  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c" len: %lu\0A\00"
@.str.1 = [13 x i8] c" ops: %'d\0A\00"
@.str.2 = [17 x i8] c" ops/s: %'.2f\0A\00"
@.str.3 = [17 x i8] c" ns/op: %'.2f\0A\00"
@.str.4 = [18 x i8] c" MiB/s: %'.2lu\0A\00"
@.str.5 = [20 x i8] c" duration: %.2fs\0A\00"
define void @report(float %0, i32 %1, i64 %2) {
%4 = alloca float
%5 = alloca i32
%6 = alloca i64
store float %0, float* %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = uitofp i64 %7 to float
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), float %8)
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to float
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), float %11)
%13 = load i32, i32* %5
%14 = sitofp i32 %13 to float
%15 = load float, float* %4
%16 = fdiv float %14, %15
%17 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), float %16)
%18 = load float, float* %4
%19 = load i32, i32* %5
%20 = sitofp i32 %19 to float
%21 = fdiv float %18, %20
%22 = fpext float %21 to double
%23 = fmul double %22, 1.000000e+09
%24 = fptrunc double %23 to float
%25 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), float %24)
%26 = load i32, i32* %5
%27 = sext i32 %26 to i64
%28 = load i64, i64* %6
%29 = mul i64 %27, %28
%30 = udiv i64 %29, 1048576
%31 = uitofp i64 %30 to float
%32 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), float %31)
%33 = load float, float* %4
%34 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), float %33)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c" len: %lu\0A\00"
@.str.1 = [13 x i8] c" ops: %'d\0A\00"
@.str.2 = [17 x i8] c" ops/s: %'.2f\0A\00"
@.str.3 = [17 x i8] c" ns/op: %'.2f\0A\00"
@.str.4 = [18 x i8] c" MiB/s: %'.2lu\0A\00"
@.str.5 = [20 x i8] c" duration: %.2fs\0A\00"
define void @report(float %0, i32 %1, i64 %2) {
%4 = uitofp i64 %2 to float
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), float %4)
%6 = sitofp i32 %1 to float
%7 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), float %6)
%8 = fdiv float %6, %0
%9 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), float %8)
%10 = fdiv float %0, %6
%11 = fmul float %10, 1.000000e+09
%12 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), float %11)
%13 = sext i32 %1 to i64
%14 = mul i64 %13, %2
%15 = lshr i64 %14, 20
%16 = uitofp i64 %15 to float
%17 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), float %16)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), float %0)
ret void
}