#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 */
double CtoF(double);
double FtoC(double);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  double initial_temp, gen_temp_f, gen_temp_c;
  initial_temp = 300;
  printf("%s\t%s\t%s\t%s\n------------------------------\n", "Fahr", "Cels",
         "Cels", "Fahr");
  while (initial_temp >= 0) {
    gen_temp_c = FtoC(initial_temp);
    gen_temp_f = CtoF(initial_temp);
    printf("%3.0f\t%6.1f\t%3.0f\t%6.1f\n", initial_temp, gen_temp_c,
           initial_temp, gen_temp_f);
    initial_temp = initial_temp - 5;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xebd(%rip),%rdi
lea    0xee2(%rip),%r8
lea    0xee0(%rip),%rcx
mov    %r8,%rsi
mov    %rcx,%rdx
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11db <main+0xab>
movsd  -0x10(%rbp),%xmm0
call   1030 <FtoC@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <CtoF@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
lea    0xe8d(%rip),%rdi
mov    $0x4,%al
call   1040 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xe3b(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    116e <main+0x3e>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
lea    0xec3(%rip),%rdi
lea    0xeed(%rip),%rcx
lea    0xee1(%rip),%rsi
mov    %rcx,%rdx
mov    %rsi,%r8
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x131,%ebp
lea    0xed2(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0xfffffffb,%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1030 <FtoC@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <CtoF@plt>
movaps %xmm0,%xmm3
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movaps %xmm0,%xmm2
mov    $0x4,%al
call   1040 <printf@plt>
cmp    $0x4,%ebp
ja     1170 <main+0x40>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [44 x i8] c"%s\09%s\09%s\09%s\0A------------------------------\0A\00"
@.str.1 = [5 x i8] c"Fahr\00"
@.str.2 = [5 x i8] c"Cels\00"
@.str.3 = [25 x i8] c"%3.0f\09%6.1f\09%3.0f\09%6.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double 3.000000e+02, double* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %9, %0
%7 = load double, double* %2
%8 = fcmp oge double %7, 0.000000e+00
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load double, double* %2
%11 = call double @FtoC(double %10)
store double %11, double* %4
%12 = load double, double* %2
%13 = call double @CtoF(double %12)
store double %13, double* %3
%14 = load double, double* %2
%15 = load double, double* %4
%16 = load double, double* %2
%17 = load double, double* %3
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), double %14, double %15, double %16, double %17)
%19 = load double, double* %2
%20 = fsub double %19, 5.000000e+00
store double %20, double* %2
br label %6
21: ; preds = %6
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@.str = [44 x i8] c"%s\09%s\09%s\09%s\0A------------------------------\0A\00"
@.str.1 = [5 x i8] c"Fahr\00"
@.str.2 = [5 x i8] c"Cels\00"
@.str.3 = [25 x i8] c"%3.0f\09%6.1f\09%3.0f\09%6.1f\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 300, %0 ], [ %8, %2 ]
%4 = sitofp i32 %3 to double
%5 = tail call double @FtoC(double %4)
%6 = tail call double @CtoF(double %4)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), double %4, double %5, double %4, double %6)
%8 = add nsw i32 %3, -5
%9 = icmp ult i32 %3, 5
br i1 %9, label %10, label %2
10: ; preds = %2
ret i32 0
}