#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 metro, cm, pol, pes, jardas, milhas;
  printf("Vamos converter Metros em outras unidades de medida?\nDigite quantos "
         "metros voce quer que eu converta em:\n 1- Centimetros 2- "
         "Polegadas\n3- Pes 4- Jardas 5- Milhas\n");
  scanf("%f", &metro);
  cm = metro * 100;
  pol = metro * 39.3701;
  pes = metro * 3.28084;
  jardas = metro * 1.09361;
  milhas = metro * 0.000621371;
  printf("Voce me deu %f\n", metro);
  printf("O que equivale a:\n%.2f centimetros\n%.2f polegadas\n%.2f pes\n%.2f "
         "jardas\n%.4f milhas",
         cm, pol, pes, jardas, milhas);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf82(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xecb(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea8(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe82(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe5c(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe36(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xee2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x14(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x18(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
movss  -0x1c(%rbp),%xmm4
cvtss2sd %xmm4,%xmm4
lea    0xeb7(%rip),%rdi
mov    $0x5,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xf53(%rip),%rdi
call   1030 <puts@plt>
lea    0xee1(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x14(%rsp),%xmm0
movss  0xea1(%rip),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x10(%rsp)
cvtss2sd %xmm0,%xmm0
movsd  0xe93(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,0xc(%rsp)
movsd  0xe85(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,0x8(%rsp)
movsd  0xe77(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,0x4(%rsp)
movsd  0xe69(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,(%rsp)
lea    0xe60(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0xc(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0x8(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  0x4(%rsp),%xmm3
cvtss2sd %xmm3,%xmm3
movss  (%rsp),%xmm4
cvtss2sd %xmm4,%xmm4
lea    0xe31(%rip),%rdi
mov    $0x5,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [162 x i8] c"Vamos converter Metros em outras unidades de medida?\0ADigite quantos metros voce quer que eu converta em:\0A 1- Centimetros 2- Polegadas\0A3- Pes 4- Jardas 5- Milhas\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [16 x i8] c"Voce me deu %f\0A\00"
@.str.3 = [83 x i8] c"O que equivale a:\0A%.2f centimetros\0A%.2f polegadas\0A%.2f pes\0A%.2f jardas\0A%.4f milhas\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%10 = load float, float* %2
%11 = fmul float %10, 1.000000e+02
store float %11, float* %3
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = fmul double %13, 3.937010e+01
%15 = fptrunc double %14 to float
store float %15, float* %4
%16 = load float, float* %2
%17 = fpext float %16 to double
%18 = fmul double %17, 3.280840e+00
%19 = fptrunc double %18 to float
store float %19, float* %5
%20 = load float, float* %2
%21 = fpext float %20 to double
%22 = fmul double %21, 1.093610e+00
%23 = fptrunc double %22 to float
store float %23, float* %6
%24 = load float, float* %2
%25 = fpext float %24 to double
%26 = fmul double %25, 6.213710e-04
%27 = fptrunc double %26 to float
store float %27, float* %7
%28 = load float, float* %2
%29 = fpext float %28 to double
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %29)
%31 = load float, float* %3
%32 = fpext float %31 to double
%33 = load float, float* %4
%34 = fpext float %33 to double
%35 = load float, float* %5
%36 = fpext float %35 to double
%37 = load float, float* %6
%38 = fpext float %37 to double
%39 = load float, float* %7
%40 = fpext float %39 to double
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.3, i64 0, i64 0), double %32, double %34, double %36, double %38, double %40)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [16 x i8] c"Voce me deu %f\0A\00"
@.str.3 = [83 x i8] c"O que equivale a:\0A%.2f centimetros\0A%.2f polegadas\0A%.2f pes\0A%.2f jardas\0A%.4f milhas\00"
@str = [161 x i8] c"Vamos converter Metros em outras unidades de medida?\0ADigite quantos metros voce quer que eu converta em:\0A 1- Centimetros 2- Polegadas\0A3- Pes 4- Jardas 5- Milhas\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([161 x i8], [161 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, 1.000000e+02
%7 = fpext float %5 to double
%8 = fmul double %7, 3.937010e+01
%9 = fptrunc double %8 to float
%10 = fmul double %7, 3.280840e+00
%11 = fptrunc double %10 to float
%12 = fmul double %7, 1.093610e+00
%13 = fptrunc double %12 to float
%14 = fmul double %7, 6.213710e-04
%15 = fptrunc double %14 to float
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %7)
%17 = fpext float %6 to double
%18 = fpext float %9 to double
%19 = fpext float %11 to double
%20 = fpext float %13 to double
%21 = fpext float %15 to double
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @.str.3, i64 0, i64 0), double %17, double %18, double %19, double %20, double %21)
ret i32 0
}