#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 convert_fahr_celsius(float);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  float fahr;
  float lower, upper, step;
  lower = 0.;
  upper = 500.;
  step = 50.;
  fahr = lower;
  printf("celsius\t\tfahr\n");
  while (fahr < upper) {
    printf("%6.1f\t\t%3.0f\n", fahr, convert_fahr_celsius(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,-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   1040 <printf@plt>
movss  -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    11be <main+0x9e>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <convert_fahr_celsius@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
lea    0xe74(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  -0x14(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1169 <main+0x49>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf46(%rip),%rdi
call   1040 <puts@plt>
xorps  %xmm0,%xmm0
call   1030 <convert_fahr_celsius@plt>
movaps %xmm0,%xmm1
lea    0xf21(%rip),%rbx
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xe9c(%rip),%xmm0
call   1030 <convert_fahr_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xeb4(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xe7e(%rip),%xmm0
call   1030 <convert_fahr_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xe9a(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xe60(%rip),%xmm0
call   1030 <convert_fahr_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xe80(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xe42(%rip),%xmm0
call   1030 <convert_fahr_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xe66(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xe24(%rip),%xmm0
call   1030 <convert_fahr_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xe4c(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xe06(%rip),%xmm0
call   1030 <convert_fahr_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xe32(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xde8(%rip),%xmm0
call   1030 <convert_fahr_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xe18(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xdca(%rip),%xmm0
call   1030 <convert_fahr_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xdfe(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xdac(%rip),%xmm0
call   1030 <convert_fahr_celsius@plt>
movaps %xmm0,%xmm1
movsd  0xde4(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"celsius\09\09fahr\0A\00"
@.str.1 = [14 x i8] c"%6.1f\09\09%3.0f\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 5.000000e+02, float* %4
store float 5.000000e+01, float* %5
%6 = load float, float* %3
store float %6, float* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %12, %0
%9 = load float, float* %2
%10 = load float, float* %4
%11 = fcmp olt float %9, %10
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = load float, float* %2
%14 = fpext float %13 to double
%15 = load float, float* %2
%16 = call double @convert_fahr_celsius(float %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %14, double %16)
%18 = load float, float* %5
%19 = load float, float* %2
%20 = fadd float %19, %18
store float %20, float* %2
br label %8
21: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"%6.1f\09\09%3.0f\0A\00"
@str = [14 x i8] c"celsius\09\09fahr\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call double @convert_fahr_celsius(float 0.000000e+00)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double 0.000000e+00, double %2)
%4 = tail call double @convert_fahr_celsius(float 5.000000e+01)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double 5.000000e+01, double %4)
%6 = tail call double @convert_fahr_celsius(float 1.000000e+02)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double 1.000000e+02, double %6)
%8 = tail call double @convert_fahr_celsius(float 1.500000e+02)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double 1.500000e+02, double %8)
%10 = tail call double @convert_fahr_celsius(float 2.000000e+02)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double 2.000000e+02, double %10)
%12 = tail call double @convert_fahr_celsius(float 2.500000e+02)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double 2.500000e+02, double %12)
%14 = tail call double @convert_fahr_celsius(float 3.000000e+02)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double 3.000000e+02, double %14)
%16 = tail call double @convert_fahr_celsius(float 3.500000e+02)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double 3.500000e+02, double %16)
%18 = tail call double @convert_fahr_celsius(float 4.000000e+02)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double 4.000000e+02, double %18)
%20 = tail call double @convert_fahr_celsius(float 4.500000e+02)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double 4.500000e+02, double %20)
ret i32 0
}