#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 /*<<< orphan*/ scanf(char *, float *);
main() {
  int i;
  float temps[3];
  printf("Please insert 3 temperatures in Farenheit:\n");
  for (i = 0; i < 3; i++) {
    scanf("%f", &temps[i]);
  }
  for (i = 0; i < 3; i++) {
    printf("Farenheit %d: %f\n", i + 1, temps[i]);
    temps[i] = (temps[i] - 32.0) * (5.0 / 9.0);
    printf("Celsius %d: %f\n\n", i + 1, temps[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1177 <main+0x57>
movslq -0x8(%rbp),%rax
lea    -0x14(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xed8(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <main+0x24>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    120e <main+0xee>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
movslq -0x8(%rbp),%rax
movss  -0x14(%rbp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movslq -0x8(%rbp),%rax
movss  -0x14(%rbp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe48(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe34(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movslq -0x8(%rbp),%rax
movss  %xmm0,-0x14(%rbp,%rax,4)
mov    -0x8(%rbp),%esi
add    $0x1,%esi
movslq -0x8(%rbp),%rax
movss  -0x14(%rbp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe58(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117e <main+0x5e>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
lea    0xec6(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe91(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xe5d(%rip),%xmm0
mulsd  0xe5d(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xe65(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x2,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xe06(%rip),%xmm0
mulsd  0xe06(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x10(%rsp)
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x3,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xdb6(%rip),%xmm0
mulsd  0xdb6(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x14(%rsp)
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [18 x i8] c"Farenheit %d: %f\0A\00"
@.str.3 = [17 x i8] c"Celsius %d: %f\0A\0A\00"
@str = [43 x i8] c"Please insert 3 temperatures in Farenheit:\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 ([43 x i8], [43 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 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 1
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %6)
%8 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 2
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %8)
%10 = load float, float* %4
%11 = fpext float %10 to double
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 1, double %11)
%13 = load float, float* %4
%14 = fpext float %13 to double
%15 = fadd double %14, -3.200000e+01
%16 = fmul double %15, 0x3FE1C71C71C71C72
%17 = fptrunc double %16 to float
store float %17, float* %4
%18 = fpext float %17 to double
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 1, double %18)
%20 = load float, float* %6
%21 = fpext float %20 to double
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 2, double %21)
%23 = load float, float* %6
%24 = fpext float %23 to double
%25 = fadd double %24, -3.200000e+01
%26 = fmul double %25, 0x3FE1C71C71C71C72
%27 = fptrunc double %26 to float
store float %27, float* %6
%28 = fpext float %27 to double
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 2, double %28)
%30 = load float, float* %8
%31 = fpext float %30 to double
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 3, double %31)
%33 = load float, float* %8
%34 = fpext float %33 to double
%35 = fadd double %34, -3.200000e+01
%36 = fmul double %35, 0x3FE1C71C71C71C72
%37 = fptrunc double %36 to float
store float %37, float* %8
%38 = fpext float %37 to double
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 3, double %38)
ret i32 0
}