#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 *, int *);
int tocentimetros(int);
int topie(int);
int topulgada(int);
int toyarda(int);
int main() {
  int medida;
  int centimetros;
  int pulgadas;
  int pies;
  int yarda;
  printf("Ingresar el valor en metros \n");
  scanf("%d", &medida);
  centimetros = tocentimetros(medida);
  pulgadas = topulgada(centimetros);
  pies = topie(pulgadas);
  yarda = toyarda(pies);
  printf("%d metros equivale a %d pies \n", medida, pies);
  printf("%d metros equivale a %d yardas \n", medida, yarda);
  printf("%d metros equivale a %d pulgadas \n", medida, pulgadas);
  printf("%d metros equivale a %d cm \n", medida, centimetros);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe9a(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <tocentimetros@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1080 <topulgada@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <topie@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <toyarda@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xf05(%rip),%rdi
call   1040 <puts@plt>
lea    0xe76(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1080 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <tocentimetros@plt>
mov    %eax,%r14d
mov    %eax,%edi
call   1090 <topulgada@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1050 <topie@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1070 <toyarda@plt>
mov    %eax,%r15d
mov    0x4(%rsp),%esi
lea    0xe3c(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xe47(%rip),%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xe53(%rip),%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xe62(%rip),%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Ingresar el valor en metros \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"%d metros equivale a %d pies \0A\00"
@.str.3 = [33 x i8] c"%d metros equivale a %d yardas \0A\00"
@.str.4 = [35 x i8] c"%d metros equivale a %d pulgadas \0A\00"
@.str.5 = [29 x i8] c"%d metros equivale a %d cm \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = call i32 @tocentimetros(i32 %9)
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = call i32 @topulgada(i32 %11)
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = call i32 @topie(i32 %13)
store i32 %14, i32* %5
%15 = load i32, i32* %5
%16 = call i32 @toyarda(i32 %15)
store i32 %16, i32* %6
%17 = load i32, i32* %2
%18 = load i32, i32* %5
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %17, i32 %18)
%20 = load i32, i32* %2
%21 = load i32, i32* %6
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %20, i32 %21)
%23 = load i32, i32* %2
%24 = load i32, i32* %4
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i32 %23, i32 %24)
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %26, i32 %27)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"%d metros equivale a %d pies \0A\00"
@.str.3 = [33 x i8] c"%d metros equivale a %d yardas \0A\00"
@.str.4 = [35 x i8] c"%d metros equivale a %d pulgadas \0A\00"
@.str.5 = [29 x i8] c"%d metros equivale a %d cm \0A\00"
@str = [29 x i8] c"Ingresar el valor en metros \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 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), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @tocentimetros(i32 %5)
%7 = call i32 @topulgada(i32 %6)
%8 = call i32 @topie(i32 %7)
%9 = call i32 @toyarda(i32 %8)
%10 = load i32, i32* %1
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %10, i32 %8)
%12 = load i32, i32* %1
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %12, i32 %9)
%14 = load i32, i32* %1
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i32 %14, i32 %7)
%16 = load i32, i32* %1
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %16, i32 %6)
ret i32 0
}