#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 *, float, float);
int /*<<< orphan*/ puts(char *);
int main() {
  int lower = 0;
  int upper = 300;
  int step = 20;
  float cels = lower;
  float fahr = 0;
  puts("  C   F");
  puts("--- ---");
  while (cels <= upper) {
    fahr = ((cels * 9.0) / 5.0) + 32.0;
    printf("%3.0f %3.0f\n", cels, fahr);
    cels += step;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x12c,-0xc(%rbp)
movl   $0x14,-0x10(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
movss  -0x14(%rbp),%xmm1
cvtsi2ssl -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     11e1 <main+0xc1>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe7e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe6a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe56(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
lea    0xe60(%rip),%rdi
call   1040 <printf@plt>
cvtsi2ssl -0x10(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    116e <main+0x4e>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffec,%ebp
lea    0xee1(%rip),%rbx
nopw   0x0(%rax,%rax,1)
add    $0x14,%ebp
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
mulsd  0xe97(%rip),%xmm1
divsd  0xe97(%rip),%xmm1
addsd  0xe97(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
mov    %rbx,%rdi
call   1040 <printf@plt>
cmp    $0x119,%ebp
jb     1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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