#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 */
float celsius_to_fahrenheit(float);
float fahrenheit_to_celsius(float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float F;
  float C;
  float resf;
  float resc;
  printf("Please Enter Celsius to Convert Fahrenheit: \t\t\n");
  scanf("%f", &C);
  resf = fahrenheit_to_celsius(C);
  printf("Your Entered Celsius is:\t(%.2f) and your Fahrenheit is: \t%.2f\n", C,
         resf);
  printf("Please Enter Fahrenheit to Convert Celsius: \t\t\n");
  scanf("%f", &F);
  resc = celsius_to_fahrenheit(F);
  printf("Your Entered Fahrenheit is:\t(%.2f) and your Celsius is: \t%.2f\n", F,
         resc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
movss  -0xc(%rbp),%xmm0
call   1050 <fahrenheit_to_celsius@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe9e(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7f(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
movss  -0x8(%rbp),%xmm0
call   1030 <celsius_to_fahrenheit@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xec0(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf25(%rip),%rdi
call   1030 <puts@plt>
lea    0xe98(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
movss  0x8(%rsp),%xmm0
call   1060 <fahrenheit_to_celsius@plt>
movss  0x8(%rsp),%xmm1
cvtss2sd %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
lea    0xe6b(%rip),%rdi
movaps %xmm2,%xmm0
mov    $0x2,%al
call   1050 <printf@plt>
lea    0xf07(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
movss  0xc(%rsp),%xmm0
call   1040 <celsius_to_fahrenheit@plt>
movss  0xc(%rsp),%xmm1
xorps  %xmm2,%xmm2
cvtss2sd %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
lea    0xe61(%rip),%rdi
movaps %xmm2,%xmm0
mov    $0x2,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"Please Enter Celsius to Convert Fahrenheit: \09\09\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [63 x i8] c"Your Entered Celsius is:\09(%.2f) and your Fahrenheit is: \09%.2f\0A\00"
@.str.3 = [48 x i8] c"Please Enter Fahrenheit to Convert Celsius: \09\09\0A\00"
@.str.4 = [63 x i8] c"Your Entered Fahrenheit is:\09(%.2f) and your Celsius is: \09%.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%8 = load float, float* %3
%9 = call float @fahrenheit_to_celsius(float %8)
store float %9, float* %4
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = load float, float* %4
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0), double %11, double %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%17 = load float, float* %2
%18 = call float @celsius_to_fahrenheit(float %17)
store float %18, float* %5
%19 = load float, float* %2
%20 = fpext float %19 to double
%21 = load float, float* %5
%22 = fpext float %21 to double
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.4, i64 0, i64 0), double %20, double %22)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [63 x i8] c"Your Entered Celsius is:\09(%.2f) and your Fahrenheit is: \09%.2f\0A\00"
@.str.4 = [63 x i8] c"Your Entered Fahrenheit is:\09(%.2f) and your Celsius is: \09%.2f\0A\00"
@str = [47 x i8] c"Please Enter Celsius to Convert Fahrenheit: \09\09\00"
@str.5 = [47 x i8] c"Please Enter Fahrenheit to Convert Celsius: \09\09\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%7 = load float, float* %2
%8 = call float @fahrenheit_to_celsius(float %7)
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = fpext float %8 to double
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0), double %10, double %11)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.5, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%15 = load float, float* %1
%16 = call float @celsius_to_fahrenheit(float %15)
%17 = load float, float* %1
%18 = fpext float %17 to double
%19 = fpext float %16 to double
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.4, i64 0, i64 0), double %18, double %19)
ret i32 0
}