#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 *, ...);
main() {
  float fahr, celsius;
  float lower, upper, step;
  lower = 0;
  upper = 3000;
  step = 20;
  fahr = lower;
  while (fahr <= upper) {
    if (fahr == 0) {
      printf("fahr\tcelsius\n");
    }
    celsius = (fahr - 32) * 5 / 9;
    printf("%5.0f\t%5.3f\n", fahr, celsius);
    fahr = fahr + step;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xed5(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xec4(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     11e5 <main+0xd5>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1183 <main+0x73>
jp     1183 <main+0x73>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xe80(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xe70(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe60(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe58(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    114b <main+0x3b>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rbx
movsd  0xec2(%rip),%xmm1
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %ebp,%ebp
nopl   (%rax)
add    $0x14,%ebp
xorps  %xmm1,%xmm1
cvtsi2ss %ebp,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
addss  0xe9f(%rip),%xmm1
mulss  0xe9b(%rip),%xmm1
divss  0xe97(%rip),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
cmp    $0xba5,%ebp
jb     1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [13 x i8] c"%5.0f\09%5.3f\0A\00"
@str = [13 x i8] c"fahr\09celsius\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = 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 0xC031C71C80000000)
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 20, %0 ], [ %12, %3 ]
%5 = sitofp i32 %4 to float
%6 = fadd float %5, -3.200000e+01
%7 = fmul float %6, 5.000000e+00
%8 = fdiv float %7, 9.000000e+00
%9 = fpext float %5 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 %4, 20
%13 = icmp ugt i32 %4, 2980
br i1 %13, label %14, label %3
14: ; preds = %3
ret i32 0
}