#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 *, ...);
void main() {
  float fahr, cels;
  int lower, upper, step;
  lower = 0;
  upper = 300;
  step = 10;
  fahr = lower;
  printf("fahr\tcels\n");
  while (fahr <= upper) {
    cels = (5.0 / 9.0) * (fahr - 32);
    printf("%4.1f\t%4.1f\n", fahr, cels);
    fahr = fahr + step;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0x12c,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm1
cvtsi2ssl -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     11ba <main+0xaa>
movss  -0x4(%rbp),%xmm0
movss  0xea3(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe8b(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe7c(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x14(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1145 <main+0x35>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfffffff6,%ebp
lea    0xed5(%rip),%rbx
nopl   0x0(%rax,%rax,1)
add    $0xa,%ebp
xorps  %xmm1,%xmm1
cvtsi2ss %ebp,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
addss  0xea7(%rip),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  0xea3(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
cmp    $0x123,%ebp
jb     1140 <main+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [13 x i8] c"%4.1f\09%4.1f\0A\00"
@str = [10 x i8] c"fahr\09cels\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))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %12, %2 ]
%4 = sitofp i32 %3 to float
%5 = fadd float %4, -3.200000e+01
%6 = fpext float %5 to double
%7 = fmul double %6, 0x3FE1C71C71C71C72
%8 = fptrunc double %7 to float
%9 = fpext float %4 to double
%10 = fpext float %8 to double
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %9, double %10)
%12 = add nuw nsw i32 %3, 10
%13 = icmp ugt i32 %3, 290
br i1 %13, label %14, label %2
14: ; preds = %2
ret void
}