#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(void) {
  double fahr;
  double celsius;
  int lower = 0;
  int upper = 300;
  int step = 20;
  celsius = (double)lower;
  printf("Celsius\t\tFahrenheit\n");
  while (celsius <= (double)upper) {
    fahr = (9.0 * celsius) / 5.0 + 32.0;
    printf("%3.0f\t\t%6.1f\n", celsius, fahr);
    celsius = celsius + step;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x12c,-0x20(%rbp)
movl   $0x14,-0x24(%rbp)
cvtsi2sdl -0x1c(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm1
cvtsi2sdl -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     11ba <main+0xaa>
movsd  0xea8(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xe93(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe7f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xe92(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    114c <main+0x3c>
xor    %eax,%eax
add    $0x30,%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
divsd  0xeb3(%rip),%xmm1
addsd  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 = [21 x i8] c"Celsius\09\09Fahrenheit\0A\00"
@.str.1 = [14 x i8] c"%3.0f\09\09%6.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 300, i32* %5
store i32 20, i32* %6
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
store double %8, double* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %15, %0
%11 = load double, double* %3
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to double
%14 = fcmp ole double %11, %13
br i1 %14, label %15, label %27
15: ; preds = %10
%16 = load double, double* %3
%17 = fmul double 9.000000e+00, %16
%18 = fdiv double %17, 5.000000e+00
%19 = fadd double %18, 3.200000e+01
store double %19, double* %2
%20 = load double, double* %3
%21 = load double, double* %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %20, double %21)
%23 = load double, double* %3
%24 = load i32, i32* %6
%25 = sitofp i32 %24 to double
%26 = fadd double %23, %25
store double %26, double* %3
br label %10
27: ; preds = %10
ret i32 0
}

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