#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 *, double *);
int main() {
  double peso, altura;
  printf("Entre com os dados para o calculo do IMC\nPeso (kg): ");
  scanf("%Lf", &peso);
  printf("Altura (m): ");
  scanf("%Lf", &altura);
  printf("IMC: %Lf\n\nVALORES DE IMC\nAbaixo do peso: menor que 18,5\nNormal:  "
         "       entre 18,5 e 24,9\nAcima do peso:  entre 25 e 29,9\nObeso:    "
         "      30 ou mais",
         peso / (altura * altura));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
lea    0xec8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xefb(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xeeb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
mulsd  %xmm1,%xmm1
divsd  %xmm1,%xmm0
lea    0xecc(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [53 x i8] c"Entre com os dados para o calculo do IMC\0APeso (kg): \00"
@.str.1 = [4 x i8] c"%Lf\00"
@.str.2 = [13 x i8] c"Altura (m): \00"
@.str.3 = [149 x i8] c"IMC: %Lf\0A\0AVALORES DE IMC\0AAbaixo do peso: menor que 18,5\0ANormal: entre 18,5 e 24,9\0AAcima do peso: entre 25 e 29,9\0AObeso: 30 ou mais\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%7 = load double, double* %1
%8 = load double, double* %2
%9 = load double, double* %2
%10 = fmul double %8, %9
%11 = fdiv double %7, %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.3, i64 0, i64 0), double %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [53 x i8] c"Entre com os dados para o calculo do IMC\0APeso (kg): \00"
@.str.1 = [4 x i8] c"%Lf\00"
@.str.2 = [13 x i8] c"Altura (m): \00"
@.str.3 = [149 x i8] c"IMC: %Lf\0A\0AVALORES DE IMC\0AAbaixo do peso: menor que 18,5\0ANormal: entre 18,5 e 24,9\0AAcima do peso: entre 25 e 29,9\0AObeso: 30 ou mais\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%9 = load double, double* %1
%10 = load double, double* %2
%11 = fmul double %10, %10
%12 = fdiv double %9, %11
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([149 x i8], [149 x i8]* @.str.3, i64 0, i64 0), double %12)
ret i32 0
}