#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 p, h, IMC;
  printf("\nQuanto você pesa (medida em Kilogramas)?\n");
  scanf("%f", &p);
  printf("\nQual é a sua altura em metros?\n");
  scanf("%f", &h);
  IMC = (p / (h * h));
  printf("Seu IMC foi %f", IMC);
  if (IMC < 26) {
    printf("O seu Indice de Massa Corporea é %.2f e esta Normal\n", IMC);
  }
  if (IMC >= 26 && IMC < 30) {
    printf("O seu Indice de Massa Corporea é %.2f e voce esta Obeso\n", IMC);
  }
  if (IMC >= 30) {
    printf("O seu Indice de Massa Corporea é %.2f e voce esta com Obesidade "
           "Morbida\n",
           IMC);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1e(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xe5e(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    11c3 <main+0xa3>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
movss  0xe30(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1202 <main+0xe2>
movss  0xe23(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1202 <main+0xe2>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
movss  0xdf5(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     122f <main+0x10f>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xead(%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    $0x20,%rsp
lea    0xf95(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rbx
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xfa0(%rip),%rdi
call   1030 <puts@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x1c(%rsp),%xmm1
movss  0x18(%rsp),%xmm0
mulss  %xmm0,%xmm0
divss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xe72(%rip),%rdi
movsd  %xmm0,0x10(%rsp)
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm1
movss  0xe4f(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    11d0 <main+0xa0>
lea    0xe5a(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm1
ucomiss 0xe29(%rip),%xmm1
jb     1200 <main+0xd0>
movss  0xe23(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    1200 <main+0xd0>
lea    0xe60(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm1
ucomiss 0xdfd(%rip),%xmm1
jb     121d <main+0xed>
lea    0xe77(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"\0AQuanto voc\C3\AA pesa (medida em Kilogramas)?\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [34 x i8] c"\0AQual \C3\A9 a sua altura em metros?\0A\00"
@.str.3 = [15 x i8] c"Seu IMC foi %f\00"
@.str.4 = [54 x i8] c"O seu Indice de Massa Corporea \C3\A9 %.2f e esta Normal\0A\00"
@.str.5 = [58 x i8] c"O seu Indice de Massa Corporea \C3\A9 %.2f e voce esta Obeso\0A\00"
@.str.6 = [74 x i8] c"O seu Indice de Massa Corporea \C3\A9 %.2f e voce esta com Obesidade Morbida\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 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 ([34 x i8], [34 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* %2
%10 = load float, float* %3
%11 = load float, float* %3
%12 = fmul float %10, %11
%13 = fdiv float %9, %12
store float %13, float* %4
%14 = load float, float* %4
%15 = fpext float %14 to double
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %15)
%17 = load float, float* %4
%18 = fcmp olt float %17, 2.600000e+01
br i1 %18, label %19, label %23
19: ; preds = %0
%20 = load float, float* %4
%21 = fpext float %20 to double
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0), double %21)
br label %23
23: ; preds = %19, %0
%24 = load float, float* %4
%25 = fcmp oge float %24, 2.600000e+01
br i1 %25, label %26, label %33
26: ; preds = %23
%27 = load float, float* %4
%28 = fcmp olt float %27, 3.000000e+01
br i1 %28, label %29, label %33
29: ; preds = %26
%30 = load float, float* %4
%31 = fpext float %30 to double
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.5, i64 0, i64 0), double %31)
br label %33
33: ; preds = %29, %26, %23
%34 = load float, float* %4
%35 = fcmp oge float %34, 3.000000e+01
br i1 %35, label %36, label %40
36: ; preds = %33
%37 = load float, float* %4
%38 = fpext float %37 to double
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.6, i64 0, i64 0), double %38)
br label %40
40: ; preds = %36, %33
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.3 = [15 x i8] c"Seu IMC foi %f\00"
@.str.4 = [54 x i8] c"O seu Indice de Massa Corporea \C3\A9 %.2f e esta Normal\0A\00"
@.str.5 = [58 x i8] c"O seu Indice de Massa Corporea \C3\A9 %.2f e voce esta Obeso\0A\00"
@.str.6 = [74 x i8] c"O seu Indice de Massa Corporea \C3\A9 %.2f e voce esta com Obesidade Morbida\0A\00"
@str = [43 x i8] c"\0AQuanto voc\C3\AA pesa (medida em Kilogramas)?\00"
@str.7 = [33 x i8] c"\0AQual \C3\A9 a sua altura em metros?\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 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 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.7, 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* %1
%10 = load float, float* %2
%11 = fmul float %10, %10
%12 = fdiv float %9, %11
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %13)
%15 = fcmp olt float %12, 2.600000e+01
br i1 %15, label %16, label %18
16: ; preds = %0
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0), double %13)
br label %18
18: ; preds = %16, %0
%19 = fcmp oge float %12, 2.600000e+01
%20 = fcmp olt float %12, 3.000000e+01
%21 = and i1 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.5, i64 0, i64 0), double %13)
br label %24
24: ; preds = %22, %18
%25 = fcmp ult float %12, 3.000000e+01
br i1 %25, label %28, label %26
26: ; preds = %24
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @.str.6, i64 0, i64 0), double %13)
br label %28
28: ; preds = %26, %24
ret i32 0
}