#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 */
scalar_t__ frand();
double ftom(double);
double itor(double);
double mtof(double);
int /*<<< orphan*/ printf(char *, double, double, double);
double rtoi(double);
int main() {
  for (double i = 0; i < 10; i += 0.5 + frand()) {
    printf("%g -> %g -> %g\n", i, itor(i), rtoi(itor(i)));
    printf("%g -> %g -> %g\n", i + 60, mtof(i + 60), mtof(ftom(i + 60)));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe81(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    124b <main+0xeb>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1060 <itor@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1060 <itor@plt>
call   1030 <rtoi@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
lea    0xe52(%rip),%rdi
call   1040 <printf@plt>
movsd  0xe35(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe23(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1080 <mtof@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xe0c(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1050 <ftom@plt>
call   1080 <mtof@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
lea    0xdf9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <frand@plt>
cvtsi2sd %rax,%xmm1
movsd  0xdd8(%rip),%xmm0
addsd  %xmm1,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1177 <main+0x17>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
xorpd  %xmm0,%xmm0
lea    0xea8(%rip),%rbx
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1060 <itor@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1060 <itor@plt>
call   1030 <rtoi@plt>
movaps %xmm0,%xmm2
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xe44(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1080 <mtof@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
call   1050 <ftom@plt>
call   1080 <mtof@plt>
movaps %xmm0,%xmm2
mov    %rbx,%rdi
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <frand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xdfd(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0xde7(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1170 <main+0x10>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%g -> %g -> %g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
br label %3
3: ; preds = %24, %0
%4 = load double, double* %2
%5 = fcmp olt double %4, 1.000000e+01
br i1 %5, label %6, label %30
6: ; preds = %3
%7 = load double, double* %2
%8 = load double, double* %2
%9 = call double @itor(double %8)
%10 = load double, double* %2
%11 = call double @itor(double %10)
%12 = call double @rtoi(double %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %7, double %9, double %12)
%14 = load double, double* %2
%15 = fadd double %14, 6.000000e+01
%16 = load double, double* %2
%17 = fadd double %16, 6.000000e+01
%18 = call double @mtof(double %17)
%19 = load double, double* %2
%20 = fadd double %19, 6.000000e+01
%21 = call double @ftom(double %20)
%22 = call double @mtof(double %21)
%23 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %15, double %18, double %22)
br label %24
24: ; preds = %6
%25 = call i64 (...) @frand()
%26 = sitofp i64 %25 to double
%27 = fadd double 5.000000e-01, %26
%28 = load double, double* %2
%29 = fadd double %28, %27
store double %29, double* %2
br label %3
30: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"%g -> %g -> %g\0A\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi double [ 0.000000e+00, %0 ], [ %16, %2 ]
%4 = tail call double @itor(double %3)
%5 = tail call double @itor(double %3)
%6 = tail call double @rtoi(double %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %3, double %4, double %6)
%8 = fadd double %3, 6.000000e+01
%9 = tail call double @mtof(double %8)
%10 = tail call double @ftom(double %8)
%11 = tail call double @mtof(double %10)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %8, double %9, double %11)
%13 = tail call i64 (...) @frand()
%14 = sitofp i64 %13 to double
%15 = fadd double %14, 5.000000e-01
%16 = fadd double %3, %15
%17 = fcmp olt double %16, 1.000000e+01
br i1 %17, label %2, label %1
}