#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 print_results(int iterations, double elapsed) {
  double rate = (double)iterations / elapsed;
  printf("  ---\n");
  printf("  iterations: %d\n", iterations);
  printf("  elapsed: %0.9f\n", elapsed);
  printf("  rate: %0.9f\n", rate);
  printf("  ...\n");
}


x86 assembly (clang, -O0):
<print_results>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xebf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xebe(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_results>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,(%rsp)
mov    %edi,%ebx
cvtsi2sd %edi,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb3(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb5(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xeb4(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xeb5(%rip),%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c" ---\0A\00"
@.str.1 = [18 x i8] c" iterations: %d\0A\00"
@.str.2 = [18 x i8] c" elapsed: %0.9f\0A\00"
@.str.3 = [15 x i8] c" rate: %0.9f\0A\00"
@.str.4 = [7 x i8] c" ...\0A\00"
define void @print_results(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = load double, double* %4
%9 = fdiv double %7, %8
store double %9, double* %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load double, double* %4
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %13)
%15 = load double, double* %5
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c" iterations: %d\0A\00"
@.str.2 = [18 x i8] c" elapsed: %0.9f\0A\00"
@.str.3 = [15 x i8] c" rate: %0.9f\0A\00"
@str = [6 x i8] c" ---\00"
@str.5 = [6 x i8] c" ...\00"
define void @print_results(i32 %0, double %1) {
%3 = sitofp i32 %0 to double
%4 = fdiv double %3, %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %1)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %4)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.5, i64 0, i64 0))
ret void
}