#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 *, ...);
main() {
  float fahr, celsius, fahrenheit;
  float lower, upper, step;
  lower = 0;
  upper = 300;
  step = 20;
  printf("%6s\t|%8s\t|%12s\n", "Fahr", "Celsius", "Fahrenheit");
  printf("---------------------------------------\n");
  fahr = lower;
  while (fahr <= upper) {
    celsius = (5.0 / 9.0) * (fahr - 32.0);
    fahrenheit = (9.0 / 5.0) * celsius + 32;
    printf("%6.0f\t|%8.1f\t|%12.1f\n", fahr, celsius, fahrenheit);
    fahr = fahr + step;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xed5(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xec4(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
lea    0xed8(%rip),%rdi
lea    0xee1(%rip),%rsi
lea    0xedf(%rip),%rdx
lea    0xee0(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x18(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1220 <main+0x110>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe70(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe6c(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe3e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe3a(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe6c(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    117c <main+0x6c>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xef6(%rip),%rdi
lea    0xeff(%rip),%rsi
lea    0xefd(%rip),%rdx
lea    0xefe(%rip),%rcx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf11(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffec,%ebp
lea    0xeea(%rip),%rbx
xchg   %ax,%ax
add    $0x14,%ebp
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
cvtss2sd %xmm0,%xmm0
movaps %xmm0,%xmm1
addsd  0xe87(%rip),%xmm1
mulsd  0xe87(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
movaps %xmm1,%xmm2
mulsd  0xe7c(%rip),%xmm2
addsd  0xe7c(%rip),%xmm2
cvtsd2ss %xmm2,%xmm2
cvtss2sd %xmm2,%xmm2
mov    %rbx,%rdi
mov    $0x3,%al
call   1040 <printf@plt>
cmp    $0x119,%ebp
jb     1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%6s\09|%8s\09|%12s\0A\00"
@.str.1 = [5 x i8] c"Fahr\00"
@.str.2 = [8 x i8] c"Celsius\00"
@.str.3 = [11 x i8] c"Fahrenheit\00"
@.str.4 = [41 x i8] c"---------------------------------------\0A\00"
@.str.5 = [22 x i8] c"%6.0f\09|%8.1f\09|%12.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %5
store float 3.000000e+02, float* %6
store float 2.000000e+01, float* %7
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 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 ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
%10 = load float, float* %5
store float %10, float* %2
br label %11
11: ; preds = %15, %0
%12 = load float, float* %2
%13 = load float, float* %6
%14 = fcmp ole float %12, %13
br i1 %14, label %15, label %35
15: ; preds = %11
%16 = load float, float* %2
%17 = fpext float %16 to double
%18 = fsub double %17, 3.200000e+01
%19 = fmul double 0x3FE1C71C71C71C72, %18
%20 = fptrunc double %19 to float
store float %20, float* %3
%21 = load float, float* %3
%22 = fpext float %21 to double
%23 = call double @llvm.fmuladd.f64(double 1.800000e+00, double %22, double 3.200000e+01)
%24 = fptrunc double %23 to float
store float %24, float* %4
%25 = load float, float* %2
%26 = fpext float %25 to double
%27 = load float, float* %3
%28 = fpext float %27 to double
%29 = load float, float* %4
%30 = fpext float %29 to double
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), double %26, double %28, double %30)
%32 = load float, float* %2
%33 = load float, float* %7
%34 = fadd float %32, %33
store float %34, float* %2
br label %11
35: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"%6s\09|%8s\09|%12s\0A\00"
@.str.1 = [5 x i8] c"Fahr\00"
@.str.2 = [8 x i8] c"Celsius\00"
@.str.3 = [11 x i8] c"Fahrenheit\00"
@.str.5 = [22 x i8] c"%6.0f\09|%8.1f\09|%12.1f\0A\00"
@str = [40 x i8] c"---------------------------------------\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 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 ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %15, %3 ]
%5 = sitofp i32 %4 to float
%6 = fpext float %5 to double
%7 = fadd double %6, -3.200000e+01
%8 = fmul double %7, 0x3FE1C71C71C71C72
%9 = fptrunc double %8 to float
%10 = fpext float %9 to double
%11 = tail call double @llvm.fmuladd.f64(double %10, double 1.800000e+00, double 3.200000e+01)
%12 = fptrunc double %11 to float
%13 = fpext float %12 to double
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), double %6, double %10, double %13)
%15 = add nuw nsw i32 %4, 20
%16 = icmp ugt i32 %4, 280
br i1 %16, label %17, label %3
17: ; preds = %3
ret i32 0
}