#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) {
  float fahr, celsius;
  int lower, upper, step;
  lower = 0;
  upper = 300;
  step = 20;
  printf("|-----------|\n");
  printf("|%4s|%6s|\n", "F", "C");
  printf("|-----------|\n");
  fahr = lower;
  while (fahr <= upper) {
    celsius = (5.0 / 9.0) * (fahr - 32);
    printf("|%4.0f|%6.1f|\n", fahr, celsius);
    fahr = fahr + step;
  }
  printf("|-----------|\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x12c,-0x14(%rbp)
movl   $0x14,-0x18(%rbp)
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    0xed6(%rip),%rsi
lea    0xed1(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea7(%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
movss  0xe72(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %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    0xe5e(%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    0xe1a(%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    0xf04(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xed7(%rip),%rdi
lea    0xedb(%rip),%rsi
lea    0xed6(%rip),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0xffffffec,%ebp
lea    0xebd(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x14,%ebp
xorps  %xmm1,%xmm1
cvtsi2ss %ebp,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
addss  0xe77(%rip),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  0xe73(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
cmp    $0x119,%ebp
jb     1170 <main+0x50>
lea    0xe78(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"|-----------|\0A\00"
@.str.1 = [11 x i8] c"|%4s|%6s|\0A\00"
@.str.2 = [2 x i8] c"F\00"
@.str.3 = [2 x i8] c"C\00"
@.str.4 = [15 x i8] c"|%4.0f|%6.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 0, i32* %4
store i32 300, i32* %5
store i32 20, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 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 = %17, %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 %32
17: ; preds = %12
%18 = load float, float* %2
%19 = fsub float %18, 3.200000e+01
%20 = fpext float %19 to double
%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 ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %24, double %26)
%28 = load float, float* %2
%29 = load i32, i32* %6
%30 = sitofp i32 %29 to float
%31 = fadd float %28, %30
store float %31, float* %2
br label %12
32: ; preds = %12
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

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