#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 *);
int main() {
  float val, g_cel, g_far, g_kel;
  printf("\nIngrese el valor de temperatura a convertir: ");
  scanf("%f", &val);
  g_far = ((val * 9) / 5) + 32;
  g_kel = val + 273.15;
  printf("\nSi el valor ingresado es %.2f°C es igual a %.2f°F y %.2f°K\n", val,
         g_far, g_kel);
  g_cel = ((val - 32) * 5) / 9;
  g_kel = (val + 459.67) * (float)5 / 9;
  printf("\nSi el valor ingresado es %.2f°F es igual a %.2f°C y %.2f°K\n", val,
         g_cel, g_kel);
  g_cel = val - 273.15;
  g_far = (val * (float)9 / 5) - 459.67;
  printf("\nSi el valor ingresado es %.2f°K es igual a %.2f°F y %.2f°C\n", val,
         g_far, g_cel);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xef6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf17(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xecf(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xebe(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xeba(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe80(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x14(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xea7(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xe5d(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xe49(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe41(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe03(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe0f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdfb(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x14(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe5a(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdac(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xdb3(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xda2(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd72(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0xc(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe21(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf18(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf39(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm1
cvtss2sd %xmm1,%xmm0
mulss  0xeae(%rip),%xmm1
divss  0xeaa(%rip),%xmm1
addss  0xea6(%rip),%xmm1
movsd  0xea6(%rip),%xmm2
addsd  %xmm0,%xmm2
cvtsd2ss %xmm2,%xmm2
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm2,%xmm2
lea    0xef1(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
movss  0xe76(%rip),%xmm1
addss  %xmm0,%xmm1
mulss  0xe62(%rip),%xmm1
divss  0xe56(%rip),%xmm1
cvtss2sd %xmm0,%xmm0
movsd  0xe62(%rip),%xmm2
addsd  %xmm0,%xmm2
mulsd  0xe5e(%rip),%xmm2
divsd  0xe5e(%rip),%xmm2
cvtsd2ss %xmm2,%xmm2
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm2,%xmm2
lea    0xed5(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  0xe37(%rip),%xmm2
addsd  %xmm0,%xmm2
cvtsd2ss %xmm2,%xmm2
mulss  0xdf7(%rip),%xmm1
divss  0xdf3(%rip),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  0xe1b(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm2,%xmm2
lea    0xec2(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"\0AIngrese el valor de temperatura a convertir: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [64 x i8] c"\0ASi el valor ingresado es %.2f\C2\B0C es igual a %.2f\C2\B0F y %.2f\C2\B0K\0A\00"
@.str.3 = [64 x i8] c"\0ASi el valor ingresado es %.2f\C2\B0F es igual a %.2f\C2\B0C y %.2f\C2\B0K\0A\00"
@.str.4 = [64 x i8] c"\0ASi el valor ingresado es %.2f\C2\B0K es igual a %.2f\C2\B0F y %.2f\C2\B0C\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 ([47 x i8], [47 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* %2)
%8 = load float, float* %2
%9 = fmul float %8, 9.000000e+00
%10 = fdiv float %9, 5.000000e+00
%11 = fadd float %10, 3.200000e+01
store float %11, float* %4
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = fadd double %13, 2.731500e+02
%15 = fptrunc double %14 to float
store float %15, float* %5
%16 = load float, float* %2
%17 = fpext float %16 to double
%18 = load float, float* %4
%19 = fpext float %18 to double
%20 = load float, float* %5
%21 = fpext float %20 to double
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0), double %17, double %19, double %21)
%23 = load float, float* %2
%24 = fsub float %23, 3.200000e+01
%25 = fmul float %24, 5.000000e+00
%26 = fdiv float %25, 9.000000e+00
store float %26, float* %3
%27 = load float, float* %2
%28 = fpext float %27 to double
%29 = fadd double %28, 4.596700e+02
%30 = fmul double %29, 5.000000e+00
%31 = fdiv double %30, 9.000000e+00
%32 = fptrunc double %31 to float
store float %32, float* %5
%33 = load float, float* %2
%34 = fpext float %33 to double
%35 = load float, float* %3
%36 = fpext float %35 to double
%37 = load float, float* %5
%38 = fpext float %37 to double
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0), double %34, double %36, double %38)
%40 = load float, float* %2
%41 = fpext float %40 to double
%42 = fsub double %41, 2.731500e+02
%43 = fptrunc double %42 to float
store float %43, float* %3
%44 = load float, float* %2
%45 = fmul float %44, 9.000000e+00
%46 = fdiv float %45, 5.000000e+00
%47 = fpext float %46 to double
%48 = fsub double %47, 4.596700e+02
%49 = fptrunc double %48 to float
store float %49, float* %4
%50 = load float, float* %2
%51 = fpext float %50 to double
%52 = load float, float* %4
%53 = fpext float %52 to double
%54 = load float, float* %3
%55 = fpext float %54 to double
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.4, i64 0, i64 0), double %51, double %53, double %55)
ret i32 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"\0AIngrese el valor de temperatura a convertir: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [64 x i8] c"\0ASi el valor ingresado es %.2f\C2\B0C es igual a %.2f\C2\B0F y %.2f\C2\B0K\0A\00"
@.str.3 = [64 x i8] c"\0ASi el valor ingresado es %.2f\C2\B0F es igual a %.2f\C2\B0C y %.2f\C2\B0K\0A\00"
@.str.4 = [64 x i8] c"\0ASi el valor ingresado es %.2f\C2\B0K es igual a %.2f\C2\B0F y %.2f\C2\B0C\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fmul float %5, 9.000000e+00
%7 = fdiv float %6, 5.000000e+00
%8 = fadd float %7, 3.200000e+01
%9 = fpext float %5 to double
%10 = fadd double %9, 2.731500e+02
%11 = fptrunc double %10 to float
%12 = fpext float %8 to double
%13 = fpext float %11 to double
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0), double %9, double %12, double %13)
%15 = load float, float* %1
%16 = fadd float %15, -3.200000e+01
%17 = fmul float %16, 5.000000e+00
%18 = fdiv float %17, 9.000000e+00
%19 = fpext float %15 to double
%20 = fadd double %19, 4.596700e+02
%21 = fmul double %20, 5.000000e+00
%22 = fdiv double %21, 9.000000e+00
%23 = fptrunc double %22 to float
%24 = fpext float %18 to double
%25 = fpext float %23 to double
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0), double %19, double %24, double %25)
%27 = load float, float* %1
%28 = fpext float %27 to double
%29 = fadd double %28, -2.731500e+02
%30 = fptrunc double %29 to float
%31 = fmul float %27, 9.000000e+00
%32 = fdiv float %31, 5.000000e+00
%33 = fpext float %32 to double
%34 = fadd double %33, -4.596700e+02
%35 = fptrunc double %34 to float
%36 = fpext float %35 to double
%37 = fpext float %30 to double
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.4, i64 0, i64 0), double %28, double %36, double %37)
ret i32 0
}