#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);
void Temperature(double fah) {
  double cel = (fah - 32) / 1.8;
  double kel = cel + 273.16;
  printf("Celcius: %.2f\n", cel);
  printf("Fahrenheit: %.2f\n", fah);
  printf("Kelvin: %.2f\n", kel);
}


x86 assembly (clang, -O0):
<Temperature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee6(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xed2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeb9(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Temperature>:
sub    $0x18,%rsp
movapd %xmm0,%xmm1
movsd  %xmm0,0x10(%rsp)
movsd  0xeda(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  0xed6(%rip),%xmm0
movsd  0xed6(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
movsd  0x10(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
movsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Celcius: %.2f\0A\00"
@.str.1 = [18 x i8] c"Fahrenheit: %.2f\0A\00"
@.str.2 = [14 x i8] c"Kelvin: %.2f\0A\00"
define void @Temperature(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fsub double %5, 3.200000e+01
%7 = fdiv double %6, 1.800000e+00
store double %7, double* %3
%8 = load double, double* %3
%9 = fadd double %8, 2.731600e+02
store double %9, double* %4
%10 = load double, double* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %10)
%12 = load double, double* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %12)
%14 = load double, double* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %14)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Celcius: %.2f\0A\00"
@.str.1 = [18 x i8] c"Fahrenheit: %.2f\0A\00"
@.str.2 = [14 x i8] c"Kelvin: %.2f\0A\00"
define void @Temperature(double %0) {
%2 = fadd double %0, -3.200000e+01
%3 = fdiv double %2, 1.800000e+00
%4 = fadd double %3, 2.731600e+02
%5 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %3)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %0)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %4)
ret void
}