#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 = 150;
  step = 10;
  celsius = lower;
  printf("%7s %10s\n", "Celsius", "Fahrenheit");
  printf("%7s %10s\n", "-------", "----------");
  while (celsius <= upper) {
    fahr = (celsius * 9.0 / 5.0) + 32.0;
    printf("%7.0f %10.1f\n", celsius, fahr);
    celsius = celsius + 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,-0xc(%rbp)
lea    0xece(%rip),%rdi
lea    0xed1(%rip),%rsi
lea    0xed2(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
lea    0xecb(%rip),%rsi
lea    0xec1(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1200 <main+0xf0>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe71(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe5d(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe49(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe63(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1183 <main+0x73>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xefe(%rip),%rbx
lea    0xf01(%rip),%rsi
lea    0xf02(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeff(%rip),%rsi
lea    0xef5(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xfffffff6,%ebp
lea    0xeea(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
add    $0xa,%ebp
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
cvtss2sd %xmm0,%xmm0
movaps %xmm0,%xmm1
mulsd  0xe87(%rip),%xmm1
divsd  0xe87(%rip),%xmm1
addsd  0xe87(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1030 <printf@plt>
cmp    $0x8d,%ebp
jb     1160 <main+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%7s %10s\0A\00"
@.str.1 = [8 x i8] c"Celsius\00"
@.str.2 = [11 x i8] c"Fahrenheit\00"
@.str.3 = [8 x i8] c"-------\00"
@.str.4 = [11 x i8] c"----------\00"
@.str.5 = [14 x i8] c"%7.0f %10.1f\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 1.500000e+02, float* %5
store float 1.000000e+01, float* %6
%7 = load float, float* %4
store float %7, float* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %10
10: ; preds = %14, %0
%11 = load float, float* %3
%12 = load float, float* %5
%13 = fcmp ole float %11, %12
br i1 %13, label %14, label %29
14: ; preds = %10
%15 = load float, float* %3
%16 = fpext float %15 to double
%17 = fmul double %16, 9.000000e+00
%18 = fdiv double %17, 5.000000e+00
%19 = fadd double %18, 3.200000e+01
%20 = fptrunc double %19 to float
store float %20, float* %2
%21 = load float, float* %3
%22 = fpext float %21 to double
%23 = load float, float* %2
%24 = fpext float %23 to double
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), double %22, double %24)
%26 = load float, float* %3
%27 = load float, float* %6
%28 = fadd float %26, %27
store float %28, float* %3
br label %10
29: ; preds = %10
%30 = load i32, i32* %1
ret i32 %30
}

LLVM IR (-O2):
@.str = [10 x i8] c"%7s %10s\0A\00"
@.str.1 = [8 x i8] c"Celsius\00"
@.str.2 = [11 x i8] c"Fahrenheit\00"
@.str.3 = [8 x i8] c"-------\00"
@.str.4 = [11 x i8] c"----------\00"
@.str.5 = [14 x i8] c"%7.0f %10.1f\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %13, %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 = fpext float %10 to double
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), double %6, double %11)
%13 = add nuw nsw i32 %4, 10
%14 = icmp ugt i32 %4, 140
br i1 %14, label %15, label %3
15: ; preds = %3
ret i32 0
}