#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 *, double const);
void Temperatures(double fah) {
  const double TO_CELSIUS_ONE = 5.0 / 9.0;
  const double TO_CELSIUS_TWO = 32.0;
  const double TO_KELVIN = 273.16;
  printf("The temperature is %.2lf.\n", fah);
  printf("The Celsius equivalent is %.2lf.\n",
         TO_CELSIUS_ONE * (fah - TO_CELSIUS_TWO));
  printf("The Kelvin equivalent is %.2lf.\n",
         TO_CELSIUS_ONE * (fah - TO_CELSIUS_TWO) + TO_KELVIN);
}


x86 assembly (clang, -O0):
<Temperatures>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xede(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm1
movsd  0xeae(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe92(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  0xe85(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe69(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe65(%rip),%xmm1
addsd  %xmm1,%xmm0
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Temperatures>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xefb(%rip),%rdi
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
addsd  0xed1(%rip),%xmm0
mulsd  0xed1(%rip),%xmm0
movsd  %xmm0,(%rsp)
lea    0xef0(%rip),%rdi
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
addsd  0xebb(%rip),%xmm0
lea    0xef9(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"The temperature is %.2lf.\0A\00"
@.str.1 = [34 x i8] c"The Celsius equivalent is %.2lf.\0A\00"
@.str.2 = [33 x i8] c"The Kelvin equivalent is %.2lf.\0A\00"
define void @Temperatures(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
store double 0x3FE1C71C71C71C72, double* %3
store double 3.200000e+01, double* %4
store double 2.731600e+02, double* %5
%6 = load double, double* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double %6)
%8 = load double, double* %2
%9 = fsub double %8, 3.200000e+01
%10 = fmul double 0x3FE1C71C71C71C72, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), double %10)
%12 = load double, double* %2
%13 = fsub double %12, 3.200000e+01
%14 = call double @llvm.fmuladd.f64(double 0x3FE1C71C71C71C72, double %13, double 2.731600e+02)
%15 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), double %14)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"The temperature is %.2lf.\0A\00"
@.str.1 = [34 x i8] c"The Celsius equivalent is %.2lf.\0A\00"
@.str.2 = [33 x i8] c"The Kelvin equivalent is %.2lf.\0A\00"
define void @Temperatures(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double %0)
%3 = fadd double %0, -3.200000e+01
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = tail call double @llvm.fmuladd.f64(double %3, double 0x3FE1C71C71C71C72, double 2.731600e+02)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), double %6)
ret void
}