#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;
  float altura;
  float indice;
  printf("Digite o seu peso: ");
  scanf("%f", &peso);
  printf("Digite a sua altura: ");
  scanf("%f", &altura);
  indice = peso / (altura * altura);
  if (indice <= 19) {
    printf("Você está abaixo do peso e seu imc é: %0.0f", indice);
  } else if (indice < 25) {
    printf("Você está em seu peso ideal e seu imc é: %0.0f", indice);
  } else if (indice <= 30) {
    printf("Você está acima do peso e seu imc é: %0.0f", indice);
  } else if (indice > 31) {
    printf("Você está obeso e seu imc é: %0.0f", indice);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%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
jb     11b1 <main+0x91>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe98(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1249 <main+0x129>
movss  0xe4b(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    11df <main+0xbf>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe99(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1244 <main+0x124>
movss  0xe21(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jb     120d <main+0xed>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    123f <main+0x11f>
movss  -0x10(%rbp),%xmm0
movss  0xdf2(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    123a <main+0x11a>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe99(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    123f <main+0x11f>
jmp    1244 <main+0x124>
jmp    1249 <main+0x129>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeea(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xed9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
mulss  %xmm1,%xmm1
divss  %xmm1,%xmm0
movss  0xe82(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    1199 <main+0x79>
movss  0xe79(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    11b3 <main+0x93>
lea    0xed5(%rip),%rdi
jmp    11a0 <main+0x80>
lea    0xe9d(%rip),%rdi
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
movss  0xe4d(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    11d2 <main+0xb2>
ucomiss 0xe45(%rip),%xmm0
jbe    11ab <main+0x8b>
lea    0xefc(%rip),%rdi
jmp    11a0 <main+0x80>
lea    0xec5(%rip),%rdi
jmp    11a0 <main+0x80>

LLVM IR (-O0):
@.str = [20 x i8] c"Digite o seu peso: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [22 x i8] c"Digite a sua altura: \00"
@.str.3 = [47 x i8] c"Voc\C3\AA est\C3\A1 abaixo do peso e seu imc \C3\A9: %0.0f\00"
@.str.4 = [50 x i8] c"Voc\C3\AA est\C3\A1 em seu peso ideal e seu imc \C3\A9: %0.0f\00"
@.str.5 = [46 x i8] c"Voc\C3\AA est\C3\A1 acima do peso e seu imc \C3\A9: %0.0f\00"
@.str.6 = [38 x i8] c"Voc\C3\AA est\C3\A1 obeso e seu imc \C3\A9: %0.0f\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 ([20 x i8], [20 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 ([22 x i8], [22 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 ole 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 ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), double %18)
br label %44
20: ; preds = %0
%21 = load float, float* %4
%22 = fcmp olt float %21, 2.500000e+01
br i1 %22, label %23, label %27
23: ; preds = %20
%24 = load float, float* %4
%25 = fpext float %24 to double
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0), double %25)
br label %43
27: ; preds = %20
%28 = load float, float* %4
%29 = fcmp ole float %28, 3.000000e+01
br i1 %29, label %30, label %34
30: ; preds = %27
%31 = load float, float* %4
%32 = fpext float %31 to double
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), double %32)
br label %42
34: ; preds = %27
%35 = load float, float* %4
%36 = fcmp ogt float %35, 3.100000e+01
br i1 %36, label %37, label %41
37: ; preds = %34
%38 = load float, float* %4
%39 = fpext float %38 to double
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0), double %39)
br label %41
41: ; preds = %37, %34
br label %42
42: ; preds = %41, %30
br label %43
43: ; preds = %42, %23
br label %44
44: ; preds = %43, %16
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Digite o seu peso: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [22 x i8] c"Digite a sua altura: \00"
@.str.3 = [47 x i8] c"Voc\C3\AA est\C3\A1 abaixo do peso e seu imc \C3\A9: %0.0f\00"
@.str.4 = [50 x i8] c"Voc\C3\AA est\C3\A1 em seu peso ideal e seu imc \C3\A9: %0.0f\00"
@.str.5 = [46 x i8] c"Voc\C3\AA est\C3\A1 acima do peso e seu imc \C3\A9: %0.0f\00"
@.str.6 = [38 x i8] c"Voc\C3\AA est\C3\A1 obeso e seu imc \C3\A9: %0.0f\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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 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 ([22 x i8], [22 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* %1
%10 = load float, float* %2
%11 = fmul float %10, %10
%12 = fdiv float %9, %11
%13 = fcmp ugt float %12, 1.900000e+01
br i1 %13, label %14, label %20
14: ; preds = %0
%15 = fcmp olt float %12, 2.500000e+01
br i1 %15, label %20, label %16
16: ; preds = %14
%17 = fcmp ugt float %12, 3.000000e+01
br i1 %17, label %18, label %20
18: ; preds = %16
%19 = fcmp ogt float %12, 3.100000e+01
br i1 %19, label %20, label %24
20: ; preds = %18, %16, %14, %0
%21 = phi i8* [ getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), %0 ], [ getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0), %14 ], [ getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), %16 ], [ getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0), %18 ]
%22 = fpext float %12 to double
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %21, double %22)
br label %24
24: ; preds = %20, %18
ret i32 0
}