#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*/ flushall();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
main() {
  float temps[3];
  float celcius[3];
  int i;
  printf("Please enter 3 Farenheit values\n");
  for (i = 0; i < 3; i++) {
    scanf("%f", &temps[i]);
    celcius[i] = (temps[i] - 32.0) * (5.0 / 9.0);
  }
  flushall();
  printf("The two versions of your temperature readings are\n");
  printf("On the left are the Farenheit readings and on the right are the "
         "Celcius readings\n");
  for (i = 0; i < 3; i++) {
    printf("%.2f = %.2f\n", temps[i], celcius[i]);
  }
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    11cb <main+0x8b>
movslq -0x20(%rbp),%rax
lea    -0x10(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xead(%rip),%rdi
call   1060 <scanf@plt>
movslq -0x20(%rbp),%rax
movss  -0x10(%rbp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe69(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe55(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movslq -0x20(%rbp),%rax
movss  %xmm0,-0x1c(%rbp,%rax,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1164 <main+0x24>
mov    $0x0,%al
call   1040 <flushall@plt>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    1237 <main+0xf7>
movslq -0x20(%rbp),%rax
movss  -0x10(%rbp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
movslq -0x20(%rbp),%rax
movss  -0x1c(%rbp,%rax,4),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe97(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11f5 <main+0xb5>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xe79(%rip),%xmm0
mulsd  0xe79(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x1c(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xe48(%rip),%xmm0
mulsd  0xe48(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x18(%rsp)
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xe17(%rip),%xmm0
mulsd  0xe17(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x14(%rsp)
xor    %eax,%eax
call   1050 <flushall@plt>
lea    0xe37(%rip),%rdi
call   1030 <puts@plt>
lea    0xe5d(%rip),%rdi
call   1030 <puts@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x1c(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xdde(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x18(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x14(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Please enter 3 Farenheit values\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [51 x i8] c"The two versions of your temperature readings are\0A\00"
@.str.3 = [82 x i8] c"On the left are the Farenheit readings and on the right are the Celcius readings\0A\00"
@.str.4 = [13 x i8] c"%.2f = %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x float]
%3 = alloca [3 x float]
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %6
6: ; preds = %25, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %28
9: ; preds = %6
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 %11
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %12)
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 %15
%17 = load float, float* %16
%18 = fpext float %17 to double
%19 = fsub double %18, 3.200000e+01
%20 = fmul double %19, 0x3FE1C71C71C71C72
%21 = fptrunc double %20 to float
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 %23
store float %21, float* %24
br label %25
25: ; preds = %9
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %6
28: ; preds = %6
%29 = call i32 (...) @flushall()
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %4
br label %32
32: ; preds = %47, %28
%33 = load i32, i32* %4
%34 = icmp slt i32 %33, 3
br i1 %34, label %35, label %50
35: ; preds = %32
%36 = load i32, i32* %4
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 %37
%39 = load float, float* %38
%40 = fpext float %39 to double
%41 = load i32, i32* %4
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 %42
%44 = load float, float* %43
%45 = fpext float %44 to double
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), double %40, double %45)
br label %47
47: ; preds = %35
%48 = load i32, i32* %4
%49 = add nsw i32 %48, 1
store i32 %49, i32* %4
br label %32
50: ; preds = %32
%51 = call i32 (...) @getchar()
%52 = load i32, i32* %1
ret i32 %52
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.4 = [13 x i8] c"%.2f = %.2f\0A\00"
@str = [32 x i8] c"Please enter 3 Farenheit values\00"
@str.5 = [50 x i8] c"The two versions of your temperature readings are\00"
@str.6 = [81 x i8] c"On the left are the Farenheit readings and on the right are the Celcius readings\00"
define i32 @main() {
%1 = alloca [3 x float]
%2 = bitcast [3 x float]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%6 = load float, float* %4
%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 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 1
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %11)
%13 = load float, float* %11
%14 = fpext float %13 to double
%15 = fadd double %14, -3.200000e+01
%16 = fmul double %15, 0x3FE1C71C71C71C72
%17 = fptrunc double %16 to float
%18 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 2
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %18)
%20 = load float, float* %18
%21 = fpext float %20 to double
%22 = fadd double %21, -3.200000e+01
%23 = fmul double %22, 0x3FE1C71C71C71C72
%24 = fptrunc double %23 to float
%25 = call i32 (...) @flushall()
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.5, i64 0, i64 0))
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str.6, i64 0, i64 0))
%28 = load float, float* %4
%29 = fpext float %28 to double
%30 = fpext float %10 to double
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), double %29, double %30)
%32 = load float, float* %11
%33 = fpext float %32 to double
%34 = fpext float %17 to double
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), double %33, double %34)
%36 = load float, float* %18
%37 = fpext float %36 to double
%38 = fpext float %24 to double
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), double %37, double %38)
%40 = call i32 (...) @getchar()
ret i32 0
}