#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 *, float *, float *);
main() {
  float v1, v2, v3;
  printf("Please input three temperature values in celcius:\n");
  scanf("%f %f %f", &v1, &v2, &v3);
  v1 = (v1 / (5.0 / 9.0)) + 32.0;
  v2 = (v2 / (5.0 / 9.0)) + 32.0;
  v3 = (v3 / (5.0 / 9.0)) + 32.0;
  printf("Your values in fahrenheit are:\n%.2f\n%.2f\n%.2f\n", v1, v2, v3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf06(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1040 <scanf@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea9(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe95(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe7f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe6b(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe55(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe41(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0xc(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe5e(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xf0d(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <scanf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe93(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe8f(%rip),%xmm2
addsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  0x10(%rsp),%xmm3
cvtss2sd %xmm3,%xmm3
divsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
cvtsd2ss %xmm3,%xmm3
movss  %xmm0,0x14(%rsp)
movss  %xmm3,0x10(%rsp)
movss  0xc(%rsp),%xmm4
cvtss2sd %xmm4,%xmm4
divsd  %xmm1,%xmm4
addsd  %xmm2,%xmm4
xorps  %xmm2,%xmm2
cvtsd2ss %xmm4,%xmm2
movss  %xmm2,0xc(%rsp)
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm3,%xmm1
cvtss2sd %xmm2,%xmm2
lea    0xe41(%rip),%rdi
mov    $0x3,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [51 x i8] c"Please input three temperature values in celcius:\0A\00"
@.str.1 = [9 x i8] c"%f %f %f\00"
@.str.2 = [47 x i8] c"Your values in fahrenheit are:\0A%.2f\0A%.2f\0A%.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2, float* %3)
%6 = load float, float* %1
%7 = fpext float %6 to double
%8 = fdiv double %7, 0x3FE1C71C71C71C72
%9 = fadd double %8, 3.200000e+01
%10 = fptrunc double %9 to float
store float %10, float* %1
%11 = load float, float* %2
%12 = fpext float %11 to double
%13 = fdiv double %12, 0x3FE1C71C71C71C72
%14 = fadd double %13, 3.200000e+01
%15 = fptrunc double %14 to float
store float %15, float* %2
%16 = load float, float* %3
%17 = fpext float %16 to double
%18 = fdiv double %17, 0x3FE1C71C71C71C72
%19 = fadd double %18, 3.200000e+01
%20 = fptrunc double %19 to float
store float %20, float* %3
%21 = load float, float* %1
%22 = fpext float %21 to double
%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 ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), double %22, double %24, double %26)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%f %f %f\00"
@.str.2 = [47 x i8] c"Your values in fahrenheit are:\0A%.2f\0A%.2f\0A%.2f\0A\00"
@str = [50 x i8] c"Please input three temperature values in celcius:\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2, float* %3)
%9 = load float, float* %1
%10 = fpext float %9 to double
%11 = fdiv double %10, 0x3FE1C71C71C71C72
%12 = fadd double %11, 3.200000e+01
%13 = fptrunc double %12 to float
store float %13, float* %1
%14 = load float, float* %2
%15 = fpext float %14 to double
%16 = fdiv double %15, 0x3FE1C71C71C71C72
%17 = fadd double %16, 3.200000e+01
%18 = fptrunc double %17 to float
store float %18, float* %2
%19 = load float, float* %3
%20 = fpext float %19 to double
%21 = fdiv double %20, 0x3FE1C71C71C71C72
%22 = fadd double %21, 3.200000e+01
%23 = fptrunc double %22 to float
store float %23, float* %3
%24 = fpext float %13 to double
%25 = fpext float %18 to double
%26 = fpext float %23 to double
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), double %24, double %25, double %26)
ret i32 0
}