#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", "Fahrenheit", "Celsius");
  printf("+----------------------+\n");
  for (fahr = cold; fahr <= hot; fahr = fahr + step) {
    cels = (5.0 / 9.0) * (fahr - 32.0);
    printf("| %10.1f | %7.1f |\n", fahr, cels);
  }
  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    0xeeb(%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,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
cvtsi2ssl -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     11eb <main+0xdb>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe6e(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe5a(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe7e(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x18(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%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    0xee1(%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
addsd  0xe77(%rip),%xmm1
mulsd  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 = [11 x i8] c"Fahrenheit\00"
@.str.3 = [8 x i8] c"Celsius\00"
@.str.4 = [20 x i8] c"| %10.1f | %7.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 ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 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* %2
br label %12
12: ; preds = %28, %0
%13 = load float, float* %2
%14 = load i32, i32* %5
%15 = sitofp i32 %14 to float
%16 = fcmp ole float %13, %15
br i1 %16, label %17, label %33
17: ; preds = %12
%18 = load float, float* %2
%19 = fpext float %18 to double
%20 = fsub double %19, 3.200000e+01
%21 = fmul double 0x3FE1C71C71C71C72, %20
%22 = fptrunc double %21 to float
store float %22, float* %3
%23 = load float, float* %2
%24 = fpext float %23 to double
%25 = load float, float* %3
%26 = fpext float %25 to double
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), double %24, double %26)
br label %28
28: ; preds = %17
%29 = load float, float* %2
%30 = load i32, i32* %6
%31 = sitofp i32 %30 to float
%32 = fadd float %29, %31
store float %32, float* %2
br label %12
33: ; preds = %12
%34 = 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 = [11 x i8] c"Fahrenheit\00"
@.str.3 = [8 x i8] c"Celsius\00"
@.str.4 = [20 x i8] c"| %10.1f | %7.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 ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 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 ], [ %13, %4 ]
%6 = sitofp i32 %5 to float
%7 = fpext float %6 to double
%8 = fadd double %7, -3.200000e+01
%9 = fmul double %8, 0x3FE1C71C71C71C72
%10 = fptrunc double %9 to float
%11 = fpext float %10 to double
%12 = 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 %11)
%13 = add nsw i32 %5, 20
%14 = icmp sgt i32 %5, 280
br i1 %14, label %15, label %4
15: ; preds = %4
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}