#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 = 0, celsius;
  printf("Conversion chart for F to C temperatures\n\n");
  while (fahr <= 300) {
    celsius = (5.0 / 9.0) * (fahr - 32.0);
    printf("%3.0f\t%6.1f\n", fahr, celsius);
    fahr = fahr + 20;
  }
  printf("\n\n");
  printf("Conversion chart for C to F temperatures\n\n");
  celsius = 0;
  while (celsius <= 100) {
    fahr = 9.0 / 5.0 * celsius + 32.0;
    printf("%3.0f\t%6.1f\n", celsius, fahr);
    celsius = celsius + 5;
  }
  printf("\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  0xec3(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     11a8 <main+0x98>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec0(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xebc(%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    0xec9(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  0xe73(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1135 <main+0x25>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xe30(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     123f <main+0x12f>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe21(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe1d(%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    0xe32(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  0xdd8(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    11cc <main+0xbc>
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xfe3(%rip),%rdi
call   1030 <puts@plt>
lea    0xfca(%rip),%rbx
movsd  0xec2(%rip),%xmm1
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xeb5(%rip),%xmm0
movsd  0xeb5(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xeab(%rip),%xmm0
movsd  0xeab(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xea1(%rip),%xmm0
movsd  0xea1(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe97(%rip),%xmm0
movsd  0xe97(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe8d(%rip),%xmm0
movsd  0xe8d(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe83(%rip),%xmm0
movsd  0xe83(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe79(%rip),%xmm0
mov    %rbx,%rdi
movsd  0xe2e(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe67(%rip),%xmm0
movsd  0xe67(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe5d(%rip),%xmm0
movsd  0xe5d(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe53(%rip),%xmm0
movsd  0xe53(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe49(%rip),%xmm0
movsd  0xe49(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe3f(%rip),%xmm0
movsd  0xe3f(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe35(%rip),%xmm0
movsd  0xe35(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe2b(%rip),%xmm0
movsd  0xe2b(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe21(%rip),%xmm0
movsd  0xe21(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xe33(%rip),%rdi
call   1030 <puts@plt>
lea    0xe53(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfffffffb,%ebp
xchg   %ax,%ax
add    $0x5,%ebp
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
cvtss2sd %xmm0,%xmm0
movaps %xmm0,%xmm1
mulsd  0xde7(%rip),%xmm1
addsd  0xde7(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
cmp    $0x60,%ebp
jb     12f0 <main+0x1d0>
lea    0xddc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Conversion chart for F to C temperatures\0A\0A\00"
@.str.1 = [13 x i8] c"%3.0f\09%6.1f\0A\00"
@.str.2 = [3 x i8] c"\0A\0A\00"
@.str.3 = [43 x i8] c"Conversion chart for C to F temperatures\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %8, %0
%6 = load float, float* %2
%7 = fcmp ole float %6, 3.000000e+02
br i1 %7, label %8, label %21
8: ; preds = %5
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = fsub double %10, 3.200000e+01
%12 = fmul double 0x3FE1C71C71C71C72, %11
%13 = fptrunc double %12 to float
store float %13, float* %3
%14 = load float, float* %2
%15 = fpext float %14 to double
%16 = load float, float* %3
%17 = fpext float %16 to double
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %15, double %17)
%19 = load float, float* %2
%20 = fadd float %19, 2.000000e+01
store float %20, float* %2
br label %5
21: ; preds = %5
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
store float 0.000000e+00, float* %3
br label %24
24: ; preds = %27, %21
%25 = load float, float* %3
%26 = fcmp ole float %25, 1.000000e+02
br i1 %26, label %27, label %39
27: ; preds = %24
%28 = load float, float* %3
%29 = fpext float %28 to double
%30 = call double @llvm.fmuladd.f64(double 1.800000e+00, double %29, double 3.200000e+01)
%31 = fptrunc double %30 to float
store float %31, float* %2
%32 = load float, float* %3
%33 = fpext float %32 to double
%34 = load float, float* %2
%35 = fpext float %34 to double
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %33, double %35)
%37 = load float, float* %3
%38 = fadd float %37, 5.000000e+00
store float %38, float* %3
br label %24
39: ; preds = %24
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"%3.0f\09%6.1f\0A\00"
@str = [42 x i8] c"Conversion chart for F to C temperatures\0A\00"
@str.5 = [42 x i8] c"Conversion chart for C to F temperatures\0A\00"
@str.6 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, 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), double 0.000000e+00, double 0xC031C71C80000000)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 2.000000e+01, double 0xC01AAAAAA0000000)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 4.000000e+01, double 0x4011C71C80000000)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 6.000000e+01, double 0x402F1C71C0000000)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 8.000000e+01, double 0x403AAAAAA0000000)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 1.000000e+02, double 0x4042E38E40000000)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 1.200000e+02, double 0x404871C720000000)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 1.400000e+02, double 6.000000e+01)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 1.600000e+02, double 0x4051C71C80000000)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 1.800000e+02, double 0x40548E38E0000000)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 2.000000e+02, double 0x4057555560000000)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 2.200000e+02, double 0x405A1C71C0000000)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 2.400000e+02, double 0x405CE38E40000000)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 2.600000e+02, double 0x405FAAAAA0000000)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 2.800000e+02, double 0x406138E380000000)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 3.000000e+02, double 0x40629C71C0000000)
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.6, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.5, i64 0, i64 0))
br label %20
20: ; preds = %0, %20
%21 = phi i32 [ 0, %0 ], [ %28, %20 ]
%22 = sitofp i32 %21 to float
%23 = fpext float %22 to double
%24 = tail call double @llvm.fmuladd.f64(double %23, double 1.800000e+00, double 3.200000e+01)
%25 = fptrunc double %24 to float
%26 = fpext float %25 to double
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %23, double %26)
%28 = add nuw nsw i32 %21, 5
%29 = icmp ugt i32 %21, 95
br i1 %29, label %30, label %20
30: ; preds = %20
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}