#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 *, ...);
int main(int argc, char **argv) {
  double fahr;
  double celsius;
  double lower = 0;
  double upper = 300;
  double step = 20;
  celsius = lower;
  printf("Celsius\tFahrenheit\n");
  while (celsius <= upper) {
    fahr = (9.0 * celsius + 160) / 5.0;
    printf("%7.0f\t%10.1f\n", celsius, fahr);
    celsius += step;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     11ce <main+0xbe>
movsd  -0x20(%rbp),%xmm0
movsd  0xe97(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe93(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe77(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe89(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x38(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1160 <main+0x50>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xf04(%rip),%rdi
call   1030 <puts@plt>
xorpd  %xmm1,%xmm1
mov    $0xffffffec,%ebp
lea    0xee1(%rip),%rbx
nop
movsd  %xmm1,(%rsp)
mulsd  0xeb3(%rip),%xmm1
addsd  0xeb3(%rip),%xmm1
divsd  0xeb3(%rip),%xmm1
mov    %rbx,%rdi
movsd  (%rsp),%xmm0
mov    $0x2,%al
call   1040 <printf@plt>
movsd  (%rsp),%xmm1
addsd  0xe9f(%rip),%xmm1
add    $0x14,%ebp
cmp    $0x119,%ebp
jb     1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Celsius\09Fahrenheit\0A\00"
@.str.1 = [14 x i8] c"%7.0f\09%10.1f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 0.000000e+00, double* %8
store double 3.000000e+02, double* %9
store double 2.000000e+01, double* %10
%11 = load double, double* %8
store double %11, double* %7
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %17, %2
%14 = load double, double* %7
%15 = load double, double* %9
%16 = fcmp ole double %14, %15
br i1 %16, label %17, label %27
17: ; preds = %13
%18 = load double, double* %7
%19 = call double @llvm.fmuladd.f64(double 9.000000e+00, double %18, double 1.600000e+02)
%20 = fdiv double %19, 5.000000e+00
store double %20, double* %6
%21 = load double, double* %7
%22 = load double, double* %6
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %21, double %22)
%24 = load double, double* %10
%25 = load double, double* %7
%26 = fadd double %25, %24
store double %26, double* %7
br label %13
27: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"%7.0f\09%10.1f\0A\00"
@str = [19 x i8] c"Celsius\09Fahrenheit\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %10, %4 ]
%6 = sitofp i32 %5 to double
%7 = tail call double @llvm.fmuladd.f64(double %6, double 9.000000e+00, double 1.600000e+02)
%8 = fdiv double %7, 5.000000e+00
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %6, double %8)
%10 = add nuw nsw i32 %5, 20
%11 = icmp ugt i32 %5, 280
br i1 %11, label %12, label %4
12: ; preds = %4
ret i32 0
}