#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 fahr2cels(float);
int /*<<< orphan*/ printf(char *, ...);
void main() {
  float fahr, cels;
  int lower, upper, step;
  lower = -30;
  upper = 45;
  step = 5;
  printf("cels\tfahr\n");
  cels = lower;
  while (cels <= upper) {
    printf("%5.1f\t%5.1f\n", cels, fahr2cels(cels));
    cels = cels + step;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xffffffe2,-0xc(%rbp)
movl   $0x2d,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cvtsi2ssl -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
cvtsi2ssl -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     11ae <main+0x8e>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <fahr2cels@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
lea    0xe7c(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x14(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1155 <main+0x35>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf8d(%rip),%rdi
call   1030 <puts@plt>
movss  0xebb(%rip),%xmm0
call   1040 <fahr2cels@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   1040 <fahr2cels@plt>
movaps %xmm0,%xmm1
movsd  0xeca(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xe78(%rip),%xmm0
call   1040 <fahr2cels@plt>
movaps %xmm0,%xmm1
movsd  0xeb0(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xe5a(%rip),%xmm0
call   1040 <fahr2cels@plt>
movaps %xmm0,%xmm1
movsd  0xe96(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xe3c(%rip),%xmm0
call   1040 <fahr2cels@plt>
movaps %xmm0,%xmm1
movsd  0xe7c(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xe1e(%rip),%xmm0
call   1040 <fahr2cels@plt>
movaps %xmm0,%xmm1
movsd  0xe62(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
call   1040 <fahr2cels@plt>
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xde8(%rip),%xmm0
call   1040 <fahr2cels@plt>
movaps %xmm0,%xmm1
movsd  0xe30(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xdca(%rip),%xmm0
call   1040 <fahr2cels@plt>
movaps %xmm0,%xmm1
movsd  0xe16(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xdac(%rip),%xmm0
call   1040 <fahr2cels@plt>
movaps %xmm0,%xmm1
movsd  0xdfc(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xd8e(%rip),%xmm0
call   1040 <fahr2cels@plt>
movaps %xmm0,%xmm1
movsd  0xde2(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xd70(%rip),%xmm0
call   1040 <fahr2cels@plt>
movaps %xmm0,%xmm1
movsd  0xdc8(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xd52(%rip),%xmm0
call   1040 <fahr2cels@plt>
movaps %xmm0,%xmm1
movsd  0xdae(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xd34(%rip),%xmm0
call   1040 <fahr2cels@plt>
movaps %xmm0,%xmm1
movsd  0xd94(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xd16(%rip),%xmm0
call   1040 <fahr2cels@plt>
movaps %xmm0,%xmm1
movsd  0xd7a(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  0xcf8(%rip),%xmm0
call   1040 <fahr2cels@plt>
movaps %xmm0,%xmm1
movsd  0xd60(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
pop    %rbx
jmp    1050 <printf@plt>

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

LLVM IR (-O2):
@.str.1 = [13 x i8] c"%5.1f\09%5.1f\0A\00"
@str = [10 x i8] c"cels\09fahr\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call double @fahr2cels(float -3.000000e+01)
%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+01, double %2)
%4 = tail call double @fahr2cels(float -2.500000e+01)
%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.500000e+01, double %4)
%6 = tail call double @fahr2cels(float -2.000000e+01)
%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.000000e+01, double %6)
%8 = tail call double @fahr2cels(float -1.500000e+01)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double -1.500000e+01, double %8)
%10 = tail call double @fahr2cels(float -1.000000e+01)
%11 = 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+01, double %10)
%12 = tail call double @fahr2cels(float -5.000000e+00)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double -5.000000e+00, double %12)
%14 = tail call double @fahr2cels(float 0.000000e+00)
%15 = 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 %14)
%16 = tail call double @fahr2cels(float 5.000000e+00)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 5.000000e+00, double %16)
%18 = tail call double @fahr2cels(float 1.000000e+01)
%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.000000e+01, double %18)
%20 = tail call double @fahr2cels(float 1.500000e+01)
%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.500000e+01, double %20)
%22 = tail call double @fahr2cels(float 2.000000e+01)
%23 = 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 %22)
%24 = tail call double @fahr2cels(float 2.500000e+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 2.500000e+01, double %24)
%26 = tail call double @fahr2cels(float 3.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 3.000000e+01, double %26)
%28 = tail call double @fahr2cels(float 3.500000e+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 3.500000e+01, double %28)
%30 = tail call double @fahr2cels(float 4.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 4.000000e+01, double %30)
%32 = tail call double @fahr2cels(float 4.500000e+01)
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 4.500000e+01, double %32)
ret void
}