#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, altura, imc;
  printf("Informe o seu peso (em kg):\n");
  scanf("%f", &peso);
  printf("Informe a sua altura (ex: 1.85):\n");
  scanf("%f", &altura);
  imc = peso / (altura * altura);
  if (imc < 19) {
    printf("Idice de Massa Corporal igual a: %.2f Você esta magra(o).\n", imc);
  }
  if (imc >= 20 && imc < 25) {
    printf(
        "Indice de Massa Corporal igual a: %.2f Você esta com o peso ideal.\n",
        imc);
  }
  if (imc >= 26 && imc < 30) {
    printf("Indice de Massa Corporal igual a: %.2f Você esta acima do peso.\n",
           imc);
  }
  if (imc >= 31) {
    printf("Indice de Massa Corporal igual a: %.2f Você esta obeso(a). Sendo "
           "essa situação prejudicial para sua saúde.\n",
           imc);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%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  0xe75(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    11ac <main+0x8c>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
movss  0xe4b(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     11eb <main+0xcb>
movss  0xe3e(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    11eb <main+0xcb>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
movss  0xe14(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     122a <main+0x10a>
movss  0xe07(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    122a <main+0x10a>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
movss  0xddd(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1257 <main+0x137>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xecd(%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    0x1012(%rip),%rdi
call   1030 <puts@plt>
lea    0xed0(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x100e(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm1
movss  0x8(%rsp),%xmm0
mulss  %xmm0,%xmm0
divss  %xmm0,%xmm1
movss  0xe76(%rip),%xmm0
ucomiss %xmm1,%xmm0
movss  %xmm1,0x4(%rsp)
jbe    11b0 <main+0x80>
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xe78(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm1
ucomiss 0xe4d(%rip),%xmm1
jb     11e1 <main+0xb1>
movss  0xe47(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    11e1 <main+0xb1>
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xe83(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm1
ucomiss 0xe24(%rip),%xmm1
jb     1212 <main+0xe2>
movss  0xe1e(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    1212 <main+0xe2>
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xe97(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm1
ucomiss 0xdfb(%rip),%xmm1
jb     1230 <main+0x100>
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xeb5(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Informe o seu peso (em kg):\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [34 x i8] c"Informe a sua altura (ex: 1.85):\0A\00"
@.str.3 = [60 x i8] c"Idice de Massa Corporal igual a: %.2f Voc\C3\AA esta magra(o).\0A\00"
@.str.4 = [69 x i8] c"Indice de Massa Corporal igual a: %.2f Voc\C3\AA esta com o peso ideal.\0A\00"
@.str.5 = [66 x i8] c"Indice de Massa Corporal igual a: %.2f Voc\C3\AA esta acima do peso.\0A\00"
@.str.6 = [112 x i8] c"Indice de Massa Corporal igual a: %.2f Voc\C3\AA esta obeso(a). Sendo essa situa\C3\A7\C3\A3o prejudicial para sua sa\C3\BAde.\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 ([29 x i8], [29 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 = fcmp olt float %14, 1.900000e+01
br i1 %15, label %16, label %20
16: ; preds = %0
%17 = load float, float* %4
%18 = fpext float %17 to double
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0), double %18)
br label %20
20: ; preds = %16, %0
%21 = load float, float* %4
%22 = fcmp oge float %21, 2.000000e+01
br i1 %22, label %23, label %30
23: ; preds = %20
%24 = load float, float* %4
%25 = fcmp olt float %24, 2.500000e+01
br i1 %25, label %26, label %30
26: ; preds = %23
%27 = load float, float* %4
%28 = fpext float %27 to double
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.4, i64 0, i64 0), double %28)
br label %30
30: ; preds = %26, %23, %20
%31 = load float, float* %4
%32 = fcmp oge float %31, 2.600000e+01
br i1 %32, label %33, label %40
33: ; preds = %30
%34 = load float, float* %4
%35 = fcmp olt 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 ([66 x i8], [66 x i8]* @.str.5, i64 0, i64 0), double %38)
br label %40
40: ; preds = %36, %33, %30
%41 = load float, float* %4
%42 = fcmp oge float %41, 3.100000e+01
br i1 %42, label %43, label %47
43: ; preds = %40
%44 = load float, float* %4
%45 = fpext float %44 to double
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.6, i64 0, i64 0), double %45)
br label %47
47: ; preds = %43, %40
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.3 = [60 x i8] c"Idice de Massa Corporal igual a: %.2f Voc\C3\AA esta magra(o).\0A\00"
@.str.4 = [69 x i8] c"Indice de Massa Corporal igual a: %.2f Voc\C3\AA esta com o peso ideal.\0A\00"
@.str.5 = [66 x i8] c"Indice de Massa Corporal igual a: %.2f Voc\C3\AA esta acima do peso.\0A\00"
@.str.6 = [112 x i8] c"Indice de Massa Corporal igual a: %.2f Voc\C3\AA esta obeso(a). Sendo essa situa\C3\A7\C3\A3o prejudicial para sua sa\C3\BAde.\0A\00"
@str = [28 x i8] c"Informe o seu peso (em kg):\00"
@str.7 = [33 x i8] c"Informe a sua altura (ex: 1.85):\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 ([28 x i8], [28 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 = fcmp olt float %12, 1.900000e+01
br i1 %13, label %14, label %17
14: ; preds = %0
%15 = fpext float %12 to double
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0), double %15)
br label %17
17: ; preds = %14, %0
%18 = fcmp oge float %12, 2.000000e+01
%19 = fcmp olt float %12, 2.500000e+01
%20 = and i1 %18, %19
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = fpext float %12 to double
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str.4, i64 0, i64 0), double %22)
br label %24
24: ; preds = %21, %17
%25 = fcmp oge float %12, 2.600000e+01
%26 = fcmp olt float %12, 3.000000e+01
%27 = and i1 %25, %26
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = fpext float %12 to double
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.5, i64 0, i64 0), double %29)
br label %31
31: ; preds = %28, %24
%32 = fcmp ult float %12, 3.100000e+01
br i1 %32, label %36, label %33
33: ; preds = %31
%34 = fpext float %12 to double
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([112 x i8], [112 x i8]* @.str.6, i64 0, i64 0), double %34)
br label %36
36: ; preds = %33, %31
ret i32 0
}