#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() {
  int fahr;
  float celsius;
  int lower, upper, step;
  lower = 0;
  upper = 300;
  step = 20;
  fahr = lower;
  printf("### Fahrenheit-Celsius ###\n\n");
  printf("Fahrenheit\tCelsius\n");
  while (fahr <= upper) {
    celsius = (5.0 / 9.0) * (fahr - 32);
    printf("%10d\t%7.1f\n", fahr, celsius);
    fahr = fahr + step;
  }
}


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)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11a9 <main+0x99>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
cvtsi2sd %eax,%xmm1
movsd  0xe8c(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1156 <main+0x46>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf64(%rip),%rdi
call   1030 <puts@plt>
lea    0xf74(%rip),%rdi
call   1030 <puts@plt>
lea    0xf40(%rip),%rbx
movsd  0xeb8(%rip),%xmm0
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xeac(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x14,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe9d(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x28,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe8e(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x3c,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe7f(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x50,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe70(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x64,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe61(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x78,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe52(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x8c,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe43(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xa0,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe34(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xb4,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe25(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xc8,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe16(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xdc,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe07(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xf0,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xdf8(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x104,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xde9(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x118,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xdda(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x12c,%esi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"### Fahrenheit-Celsius ###\0A\0A\00"
@.str.1 = [20 x i8] c"Fahrenheit\09Celsius\0A\00"
@.str.2 = [12 x i8] c"%10d\09%7.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%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 = load i32, i32* %4
store i32 %7, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %14, %0
%11 = load i32, i32* %2
%12 = load i32, i32* %5
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %27
14: ; preds = %10
%15 = load i32, i32* %2
%16 = sub nsw i32 %15, 32
%17 = sitofp i32 %16 to double
%18 = fmul double 0x3FE1C71C71C71C72, %17
%19 = fptrunc double %18 to float
store float %19, float* %3
%20 = load i32, i32* %2
%21 = load float, float* %3
%22 = fpext float %21 to double
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %20, double %22)
%24 = load i32, i32* %2
%25 = load i32, i32* %6
%26 = add nsw i32 %24, %25
store i32 %26, i32* %2
br label %10
27: ; preds = %10
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
@.str.2 = [12 x i8] c"%10d\09%7.1f\0A\00"
@str = [28 x i8] c"### Fahrenheit-Celsius ###\0A\00"
@str.3 = [19 x i8] c"Fahrenheit\09Celsius\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 0, double 0xC031C71C80000000)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 20, double 0xC01AAAAAA0000000)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 40, double 0x4011C71C80000000)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 60, double 0x402F1C71C0000000)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 80, double 0x403AAAAAA0000000)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 100, double 0x4042E38E40000000)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 120, double 0x404871C720000000)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 140, double 6.000000e+01)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 160, double 0x4051C71C80000000)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 180, double 0x40548E38E0000000)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 200, double 0x4057555560000000)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 220, double 0x405A1C71C0000000)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 240, double 0x405CE38E40000000)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 260, double 0x405FAAAAA0000000)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 280, double 0x406138E380000000)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 300, double 0x40629C71C0000000)
ret i32 0
}