#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() {
  float fahr, cels;
  int cold = -80;
  int hot = 300;
  int step = 20;
  printf("+----------------------+\n");
  printf("| %s | %s |\n", "Celsius", "Fahrenheit");
  printf("+----------------------+\n");
  for (cels = cold; cels <= hot; cels = cels + step) {
    fahr = (cels * (9.0 / 5.0)) + 32;
    printf("| %7.1f | %10.1f |\n", cels, fahr);
  }
  printf("+----------------------+\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffb0,-0x10(%rbp)
movl   $0x12c,-0x14(%rbp)
movl   $0x14,-0x18(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0xee7(%rip),%rsi
lea    0xee8(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2ssl -0x10(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm1
cvtsi2ssl -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     11eb <main+0xdb>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe66(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe62(%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    0xe7e(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x18(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1176 <main+0x66>
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xf1a(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xed7(%rip),%rdi
lea    0xedd(%rip),%rsi
lea    0xede(%rip),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0xffffff9c,%ebp
lea    0xece(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x14,%ebp
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
cvtss2sd %xmm0,%xmm0
movaps %xmm0,%xmm1
mulsd  0xe77(%rip),%xmm1
addsd  0xe77(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
cmp    $0x119,%ebp
jl     1170 <main+0x50>
lea    0xe92(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [13 x i8] c"| %s | %s |\0A\00"
@.str.2 = [8 x i8] c"Celsius\00"
@.str.3 = [11 x i8] c"Fahrenheit\00"
@.str.4 = [20 x i8] c"| %7.1f | %10.1f |\0A\00"
@str.6 = [25 x i8] c"+----------------------+\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.6, 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), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.6, i64 0, i64 0))
br label %4
4: ; preds = %0, %4
%5 = phi i32 [ -80, %0 ], [ %12, %4 ]
%6 = sitofp i32 %5 to float
%7 = fpext float %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %7, double 1.800000e+00, double 3.200000e+01)
%9 = fptrunc double %8 to float
%10 = fpext float %9 to double
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), double %7, double %10)
%12 = add nsw i32 %5, 20
%13 = icmp sgt i32 %5, 280
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}