#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 toCelsius(float);
int main(void) {
  float fahr;
  float lower, upper, step;
  lower = 0;
  upper = 300;
  step = 20;
  fahr = lower;
  printf("F:   C:\n");
  printf("__________\n");
  while (fahr <= upper) {
    printf("%3.0f %6.1f\n", fahr, toCelsius(fahr));
    fahr = fahr + step;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xec5(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xeb4(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     11cc <main+0xac>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <toCelsius@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
lea    0xe6c(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1177 <main+0x57>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf8d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf89(%rip),%rdi
call   1030 <puts@plt>
xorps  %xmm0,%xmm0
call   1050 <toCelsius@plt>
movaps %xmm0,%xmm1
lea    0xf5d(%rip),%rbx
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xe90(%rip),%xmm0
call   1050 <toCelsius@plt>
movaps %xmm0,%xmm1
movsd  0xec0(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xe72(%rip),%xmm0
call   1050 <toCelsius@plt>
movaps %xmm0,%xmm1
movsd  0xea6(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xe54(%rip),%xmm0
call   1050 <toCelsius@plt>
movaps %xmm0,%xmm1
movsd  0xe8c(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xe36(%rip),%xmm0
call   1050 <toCelsius@plt>
movaps %xmm0,%xmm1
movsd  0xe72(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xe18(%rip),%xmm0
call   1050 <toCelsius@plt>
movaps %xmm0,%xmm1
movsd  0xe58(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xdfa(%rip),%xmm0
call   1050 <toCelsius@plt>
movaps %xmm0,%xmm1
movsd  0xe3e(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xddc(%rip),%xmm0
call   1050 <toCelsius@plt>
movaps %xmm0,%xmm1
movsd  0xe24(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xdbe(%rip),%xmm0
call   1050 <toCelsius@plt>
movaps %xmm0,%xmm1
movsd  0xe0a(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xda0(%rip),%xmm0
call   1050 <toCelsius@plt>
movaps %xmm0,%xmm1
movsd  0xdf0(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xd82(%rip),%xmm0
call   1050 <toCelsius@plt>
movaps %xmm0,%xmm1
movsd  0xdd6(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xd64(%rip),%xmm0
call   1050 <toCelsius@plt>
movaps %xmm0,%xmm1
movsd  0xdbc(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xd46(%rip),%xmm0
call   1050 <toCelsius@plt>
movaps %xmm0,%xmm1
movsd  0xda2(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xd28(%rip),%xmm0
call   1050 <toCelsius@plt>
movaps %xmm0,%xmm1
movsd  0xd88(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xd0a(%rip),%xmm0
call   1050 <toCelsius@plt>
movaps %xmm0,%xmm1
movsd  0xd6e(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xcec(%rip),%xmm0
call   1050 <toCelsius@plt>
movaps %xmm0,%xmm1
movsd  0xd54(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"F: C:\0A\00"
@.str.1 = [12 x i8] c"__________\0A\00"
@.str.2 = [13 x i8] c"%3.0f %6.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %3
store float 3.000000e+02, float* %4
store float 2.000000e+01, float* %5
%6 = load float, float* %3
store float %6, float* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %13, %0
%10 = load float, float* %2
%11 = load float, float* %4
%12 = fcmp ole float %10, %11
br i1 %12, label %13, label %22
13: ; preds = %9
%14 = load float, float* %2
%15 = fpext float %14 to double
%16 = load float, float* %2
%17 = call double @toCelsius(float %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %15, double %17)
%19 = load float, float* %2
%20 = load float, float* %5
%21 = fadd float %19, %20
store float %21, float* %2
br label %9
22: ; preds = %9
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str.2 = [13 x i8] c"%3.0f %6.1f\0A\00"
@str = [8 x i8] c"F: C:\00"
@str.3 = [11 x i8] c"__________\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.3, i64 0, i64 0))
%3 = tail call double @toCelsius(float 0.000000e+00)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double 0.000000e+00, double %3)
%5 = tail call double @toCelsius(float 2.000000e+01)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double 2.000000e+01, double %5)
%7 = tail call double @toCelsius(float 4.000000e+01)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double 4.000000e+01, double %7)
%9 = tail call double @toCelsius(float 6.000000e+01)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double 6.000000e+01, double %9)
%11 = tail call double @toCelsius(float 8.000000e+01)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double 8.000000e+01, double %11)
%13 = tail call double @toCelsius(float 1.000000e+02)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double 1.000000e+02, double %13)
%15 = tail call double @toCelsius(float 1.200000e+02)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double 1.200000e+02, double %15)
%17 = tail call double @toCelsius(float 1.400000e+02)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double 1.400000e+02, double %17)
%19 = tail call double @toCelsius(float 1.600000e+02)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double 1.600000e+02, double %19)
%21 = tail call double @toCelsius(float 1.800000e+02)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double 1.800000e+02, double %21)
%23 = tail call double @toCelsius(float 2.000000e+02)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double 2.000000e+02, double %23)
%25 = tail call double @toCelsius(float 2.200000e+02)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double 2.200000e+02, double %25)
%27 = tail call double @toCelsius(float 2.400000e+02)
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double 2.400000e+02, double %27)
%29 = tail call double @toCelsius(float 2.600000e+02)
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double 2.600000e+02, double %29)
%31 = tail call double @toCelsius(float 2.800000e+02)
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double 2.800000e+02, double %31)
%33 = tail call double @toCelsius(float 3.000000e+02)
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double 3.000000e+02, double %33)
ret i32 0
}