#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 */
float fahr_to_celsius(float);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  float fahr, celsius;
  int lower, upper, step;
  lower = 0;
  upper = 300;
  step = 20;
  printf("Farenheit    Celsius\n");
  printf("--------------------\n");
  fahr = lower;
  while (fahr <= upper) {
    celsius = fahr_to_celsius(fahr);
    printf("%9.0f    %6.1f\n", fahr, celsius);
    fahr = fahr + step;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x12c,-0x14(%rbp)
movl   $0x14,-0x18(%rbp)
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2ssl -0x10(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
cvtsi2ssl -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     11c4 <main+0xa4>
movss  -0x8(%rbp),%xmm0
call   1040 <fahr_to_celsius@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe87(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x18(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    116a <main+0x4a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf90(%rip),%rdi
call   1030 <puts@plt>
lea    0xf99(%rip),%rdi
call   1030 <puts@plt>
xorps  %xmm0,%xmm0
call   1050 <fahr_to_celsius@plt>
cvtss2sd %xmm0,%xmm1
lea    0xf5c(%rip),%rbx
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xe8f(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xebb(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xe6d(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xe9d(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xe4b(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xe7f(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xe29(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xe61(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xe07(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xe43(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xde5(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xe25(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xdc3(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xe07(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xda1(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xde9(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xd7f(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xdcb(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xd5d(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xdad(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xd3b(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xd8f(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xd19(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xd71(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xcf7(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xd53(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xcd5(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xd35(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xcb3(%rip),%xmm0
call   1050 <fahr_to_celsius@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xd17(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Farenheit Celsius\0A\00"
@.str.1 = [22 x i8] c"--------------------\0A\00"
@.str.2 = [16 x i8] c"%9.0f %6.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 300, i32* %5
store i32 20, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to float
store float %10, float* %2
br label %11
11: ; preds = %16, %0
%12 = load float, float* %2
%13 = load i32, i32* %5
%14 = sitofp i32 %13 to float
%15 = fcmp ole float %12, %14
br i1 %15, label %16, label %28
16: ; preds = %11
%17 = load float, float* %2
%18 = call float @fahr_to_celsius(float %17)
store float %18, float* %3
%19 = load float, float* %2
%20 = fpext float %19 to double
%21 = load float, float* %3
%22 = fpext float %21 to double
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %20, double %22)
%24 = load float, float* %2
%25 = load i32, i32* %6
%26 = sitofp i32 %25 to float
%27 = fadd float %24, %26
store float %27, float* %2
br label %11
28: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [16 x i8] c"%9.0f %6.1f\0A\00"
@str = [21 x i8] c"Farenheit Celsius\00"
@str.3 = [21 x i8] c"--------------------\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.3, i64 0, i64 0))
%3 = tail call float @fahr_to_celsius(float 0.000000e+00)
%4 = fpext float %3 to double
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 0.000000e+00, double %4)
%6 = tail call float @fahr_to_celsius(float 2.000000e+01)
%7 = fpext float %6 to double
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 2.000000e+01, double %7)
%9 = tail call float @fahr_to_celsius(float 4.000000e+01)
%10 = fpext float %9 to double
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 4.000000e+01, double %10)
%12 = tail call float @fahr_to_celsius(float 6.000000e+01)
%13 = fpext float %12 to double
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 6.000000e+01, double %13)
%15 = tail call float @fahr_to_celsius(float 8.000000e+01)
%16 = fpext float %15 to double
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 8.000000e+01, double %16)
%18 = tail call float @fahr_to_celsius(float 1.000000e+02)
%19 = fpext float %18 to double
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 1.000000e+02, double %19)
%21 = tail call float @fahr_to_celsius(float 1.200000e+02)
%22 = fpext float %21 to double
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 1.200000e+02, double %22)
%24 = tail call float @fahr_to_celsius(float 1.400000e+02)
%25 = fpext float %24 to double
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 1.400000e+02, double %25)
%27 = tail call float @fahr_to_celsius(float 1.600000e+02)
%28 = fpext float %27 to double
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 1.600000e+02, double %28)
%30 = tail call float @fahr_to_celsius(float 1.800000e+02)
%31 = fpext float %30 to double
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 1.800000e+02, double %31)
%33 = tail call float @fahr_to_celsius(float 2.000000e+02)
%34 = fpext float %33 to double
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 2.000000e+02, double %34)
%36 = tail call float @fahr_to_celsius(float 2.200000e+02)
%37 = fpext float %36 to double
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 2.200000e+02, double %37)
%39 = tail call float @fahr_to_celsius(float 2.400000e+02)
%40 = fpext float %39 to double
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 2.400000e+02, double %40)
%42 = tail call float @fahr_to_celsius(float 2.600000e+02)
%43 = fpext float %42 to double
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 2.600000e+02, double %43)
%45 = tail call float @fahr_to_celsius(float 2.800000e+02)
%46 = fpext float %45 to double
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 2.800000e+02, double %46)
%48 = tail call float @fahr_to_celsius(float 3.000000e+02)
%49 = fpext float %48 to double
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 3.000000e+02, double %49)
ret i32 0
}