#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 fahr2celsius(float);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  float fahr;
  float lower, upper, step;
  printf("\nTemperature Conversion Table\n\n");
  for (fahr = 300; fahr >= 0; fahr -= 20) {
    printf("%3.0f\t%6.1f\n", fahr, fahr2celsius(fahr));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movss  0xebb(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     11a4 <main+0x84>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <fahr2celsius@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
lea    0xea6(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xe6e(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    114a <main+0x2a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf8d(%rip),%rdi
call   1040 <puts@plt>
movss  0xebb(%rip),%xmm0
call   1030 <fahr2celsius@plt>
movaps %xmm0,%xmm1
lea    0xf64(%rip),%rbx
movsd  0xee4(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xe96(%rip),%xmm0
call   1030 <fahr2celsius@plt>
movaps %xmm0,%xmm1
movsd  0xeca(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xe78(%rip),%xmm0
call   1030 <fahr2celsius@plt>
movaps %xmm0,%xmm1
movsd  0xeb0(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xe5a(%rip),%xmm0
call   1030 <fahr2celsius@plt>
movaps %xmm0,%xmm1
movsd  0xe96(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xe3c(%rip),%xmm0
call   1030 <fahr2celsius@plt>
movaps %xmm0,%xmm1
movsd  0xe7c(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xe1e(%rip),%xmm0
call   1030 <fahr2celsius@plt>
movaps %xmm0,%xmm1
movsd  0xe62(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xe00(%rip),%xmm0
call   1030 <fahr2celsius@plt>
movaps %xmm0,%xmm1
movsd  0xe48(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xde2(%rip),%xmm0
call   1030 <fahr2celsius@plt>
movaps %xmm0,%xmm1
movsd  0xe2e(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xdc4(%rip),%xmm0
call   1030 <fahr2celsius@plt>
movaps %xmm0,%xmm1
movsd  0xe14(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xda6(%rip),%xmm0
call   1030 <fahr2celsius@plt>
movaps %xmm0,%xmm1
movsd  0xdfa(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xd88(%rip),%xmm0
call   1030 <fahr2celsius@plt>
movaps %xmm0,%xmm1
movsd  0xde0(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xd6a(%rip),%xmm0
call   1030 <fahr2celsius@plt>
movaps %xmm0,%xmm1
movsd  0xdc6(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xd4c(%rip),%xmm0
call   1030 <fahr2celsius@plt>
movaps %xmm0,%xmm1
movsd  0xdac(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xd2e(%rip),%xmm0
call   1030 <fahr2celsius@plt>
movaps %xmm0,%xmm1
movsd  0xd92(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xd10(%rip),%xmm0
call   1030 <fahr2celsius@plt>
movaps %xmm0,%xmm1
movsd  0xd78(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
call   1030 <fahr2celsius@plt>
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"\0ATemperature Conversion Table\0A\0A\00"
@.str.1 = [13 x i8] c"%3.0f\09%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
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store float 3.000000e+02, float* %2
br label %7
7: ; preds = %16, %0
%8 = load float, float* %2
%9 = fcmp oge float %8, 0.000000e+00
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load float, float* %2
%12 = fpext float %11 to double
%13 = load float, float* %2
%14 = call double @fahr2celsius(float %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %12, double %14)
br label %16
16: ; preds = %10
%17 = load float, float* %2
%18 = fsub float %17, 2.000000e+01
store float %18, float* %2
br label %7
19: ; preds = %7
ret i32 0
}

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