#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 peso = 0;
  float altura = 0;
  float Mc = 0;
  printf("Diga seu Peso");
  scanf("%f", &peso);
  printf("Diga sua altura");
  scanf("%f", &altura);
  altura = altura * altura;
  Mc = peso / altura;
  printf("Mc=%f", Mc);
  if (Mc <= 19) {
    printf("Você esta Magra");
  } else if (Mc < 25) {
    printf("Você esta no Peso Ideal");
  } else if (Mc <= 30) {
    printf("Você esta Acima do Peso Ideal");
  } else if (Mc > 31) {
    printf("Você esta Obesa");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe7d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xe40(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jb     11dd <main+0xbd>
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125a <main+0x13a>
movss  0xe1f(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1202 <main+0xe2>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1255 <main+0x135>
movss  0xdfe(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jb     1227 <main+0x107>
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1250 <main+0x130>
movss  -0x10(%rbp),%xmm0
movss  0xdd8(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    124b <main+0x12b>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1250 <main+0x130>
jmp    1255 <main+0x135>
jmp    125a <main+0x13a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee7(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
mulss  %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
movss  0x8(%rsp),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xe8e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm1
movss  0xe4b(%rip),%xmm0
ucomiss %xmm1,%xmm0
jae    11d0 <main+0xb0>
movss  0xe42(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    11e6 <main+0xc6>
lea    0xe77(%rip),%rdi
jmp    11d7 <main+0xb7>
lea    0xe5d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
movss  0xe1a(%rip),%xmm0
ucomiss %xmm1,%xmm0
jae    1205 <main+0xe5>
ucomiss 0xe12(%rip),%xmm1
jbe    11de <main+0xbe>
lea    0xe7a(%rip),%rdi
jmp    11d7 <main+0xb7>
lea    0xe52(%rip),%rdi
jmp    11d7 <main+0xb7>

LLVM IR (-O0):
@.str = [14 x i8] c"Diga seu Peso\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [16 x i8] c"Diga sua altura\00"
@.str.3 = [6 x i8] c"Mc=%f\00"
@.str.4 = [17 x i8] c"Voc\C3\AA esta Magra\00"
@.str.5 = [25 x i8] c"Voc\C3\AA esta no Peso Ideal\00"
@.str.6 = [31 x i8] c"Voc\C3\AA esta Acima do Peso Ideal\00"
@.str.7 = [17 x i8] c"Voc\C3\AA esta Obesa\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %2
store float 0.000000e+00, float* %3
store float 0.000000e+00, float* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%9 = load float, float* %3
%10 = load float, float* %3
%11 = fmul float %9, %10
store float %11, float* %3
%12 = load float, float* %2
%13 = load float, float* %3
%14 = fdiv float %12, %13
store float %14, float* %4
%15 = load float, float* %4
%16 = fpext float %15 to double
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %16)
%18 = load float, float* %4
%19 = fcmp ole float %18, 1.900000e+01
br i1 %19, label %20, label %22
20: ; preds = %0
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
br label %40
22: ; preds = %0
%23 = load float, float* %4
%24 = fcmp olt float %23, 2.500000e+01
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
br label %39
27: ; preds = %22
%28 = load float, float* %4
%29 = fcmp ole float %28, 3.000000e+01
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
br label %38
32: ; preds = %27
%33 = load float, float* %4
%34 = fcmp ogt float %33, 3.100000e+01
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
br label %37
37: ; preds = %35, %32
br label %38
38: ; preds = %37, %30
br label %39
39: ; preds = %38, %25
br label %40
40: ; preds = %39, %20
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Diga seu Peso\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [16 x i8] c"Diga sua altura\00"
@.str.3 = [6 x i8] c"Mc=%f\00"
@.str.4 = [17 x i8] c"Voc\C3\AA esta Magra\00"
@.str.5 = [25 x i8] c"Voc\C3\AA esta no Peso Ideal\00"
@.str.6 = [31 x i8] c"Voc\C3\AA esta Acima do Peso Ideal\00"
@.str.7 = [17 x i8] c"Voc\C3\AA esta Obesa\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
store float 0.000000e+00, float* %1
%4 = bitcast float* %2 to i8*
store float 0.000000e+00, float* %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 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* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%9 = load float, float* %2
%10 = fmul float %9, %9
store float %10, float* %2
%11 = load float, float* %1
%12 = fdiv float %11, %10
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %13)
%15 = fcmp ugt float %12, 1.900000e+01
br i1 %15, label %16, label %22
16: ; preds = %0
%17 = fcmp olt float %12, 2.500000e+01
br i1 %17, label %22, label %18
18: ; preds = %16
%19 = fcmp ugt float %12, 3.000000e+01
br i1 %19, label %20, label %22
20: ; preds = %18
%21 = fcmp ogt float %12, 3.100000e+01
br i1 %21, label %22, label %25
22: ; preds = %20, %18, %16, %0
%23 = phi i8* [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), %0 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), %16 ], [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), %18 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), %20 ]
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %23)
br label %25
25: ; preds = %22, %20
ret i32 0
}