#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 altura;
  float peso;
  float IMC;
  printf("\n Entre com sua altura (em metros):\n");
  scanf("%f", &altura);
  printf("\n Entre com seu peso (em quilos):\n");
  scanf("%f", &peso);
  IMC = peso / (altura * altura);
  printf("\n Seu IMC é:  %.2f\n", IMC);
  if (IMC > 30.99) {
    printf("\n De acordo com o seu IMC você está OBESO !\n");
  } else if (IMC > 25.99) {
    printf("\n De acordo com o seu IMC você está ACIMA DO PESO !\n");
  } else if (IMC > 19.99) {
    printf("\n De acordo com o seu IMC você está NO PESO IDEAL !\n");
  } else if (IMC < 19.99) {
    printf("\n De acordo com o seu IMC você está MAGRO !\n");
  }
  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    0xef9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xed0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe55(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11c8 <main+0xa8>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125c <main+0x13c>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe2f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11f6 <main+0xd6>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1257 <main+0x137>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe09(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1224 <main+0x104>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1252 <main+0x132>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xddb(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    124d <main+0x12d>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1252 <main+0x132>
jmp    1257 <main+0x137>
jmp    125c <main+0x13c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
lea    0xed0(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
mulss  %xmm1,%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0xe8b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm1
ucomisd 0xe5b(%rip),%xmm1
jbe    11b0 <main+0x80>
lea    0xf62(%rip),%rdi
jmp    11eb <main+0xbb>
ucomisd 0xe50(%rip),%xmm1
jbe    11c3 <main+0x93>
lea    0xf19(%rip),%rdi
jmp    11eb <main+0xbb>
ucomisd 0xe45(%rip),%xmm1
jbe    11d6 <main+0xa6>
lea    0xed0(%rip),%rdi
jmp    11eb <main+0xbb>
movsd  0xe32(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11f0 <main+0xc0>
lea    0xe8b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"\0A Entre com sua altura (em metros):\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [35 x i8] c"\0A Entre com seu peso (em quilos):\0A\00"
@.str.3 = [21 x i8] c"\0A Seu IMC \C3\A9: %.2f\0A\00"
@.str.4 = [47 x i8] c"\0A De acordo com o seu IMC voc\C3\AA est\C3\A1 OBESO !\0A\00"
@.str.5 = [55 x i8] c"\0A De acordo com o seu IMC voc\C3\AA est\C3\A1 ACIMA DO PESO !\0A\00"
@.str.6 = [55 x i8] c"\0A De acordo com o seu IMC voc\C3\AA est\C3\A1 NO PESO IDEAL !\0A\00"
@.str.7 = [47 x i8] c"\0A De acordo com o seu IMC voc\C3\AA est\C3\A1 MAGRO !\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 ([37 x i8], [37 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 ([35 x i8], [35 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* %2
%11 = load float, float* %2
%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 ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), double %15)
%17 = load float, float* %4
%18 = fpext float %17 to double
%19 = fcmp ogt double %18, 3.099000e+01
br i1 %19, label %20, label %22
20: ; preds = %0
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0))
br label %43
22: ; preds = %0
%23 = load float, float* %4
%24 = fpext float %23 to double
%25 = fcmp ogt double %24, 2.599000e+01
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i64 0, i64 0))
br label %42
28: ; preds = %22
%29 = load float, float* %4
%30 = fpext float %29 to double
%31 = fcmp ogt double %30, 1.999000e+01
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.6, i64 0, i64 0))
br label %41
34: ; preds = %28
%35 = load float, float* %4
%36 = fpext float %35 to double
%37 = fcmp olt double %36, 1.999000e+01
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0))
br label %40
40: ; preds = %38, %34
br label %41
41: ; preds = %40, %32
br label %42
42: ; preds = %41, %26
br label %43
43: ; preds = %42, %20
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.3 = [21 x i8] c"\0A Seu IMC \C3\A9: %.2f\0A\00"
@str = [36 x i8] c"\0A Entre com sua altura (em metros):\00"
@str.8 = [34 x i8] c"\0A Entre com seu peso (em quilos):\00"
@str.9 = [46 x i8] c"\0A De acordo com o seu IMC voc\C3\AA est\C3\A1 MAGRO !\00"
@str.10 = [54 x i8] c"\0A De acordo com o seu IMC voc\C3\AA est\C3\A1 NO PESO IDEAL !\00"
@str.11 = [54 x i8] c"\0A De acordo com o seu IMC voc\C3\AA est\C3\A1 ACIMA DO PESO !\00"
@str.12 = [46 x i8] c"\0A De acordo com o seu IMC voc\C3\AA est\C3\A1 OBESO !\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 ([36 x i8], [36 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 ([34 x i8], [34 x i8]* @str.8, 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 = load float, float* %1
%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 ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), double %13)
%15 = fcmp ogt double %13, 3.099000e+01
br i1 %15, label %22, label %16
16: ; preds = %0
%17 = fcmp ogt double %13, 2.599000e+01
br i1 %17, label %22, label %18
18: ; preds = %16
%19 = fcmp ogt double %13, 1.999000e+01
br i1 %19, label %22, label %20
20: ; preds = %18
%21 = fcmp olt double %13, 1.999000e+01
br i1 %21, label %22, label %25
22: ; preds = %20, %18, %16, %0
%23 = phi i8* [ getelementptr inbounds ([46 x i8], [46 x i8]* @str.12, i64 0, i64 0), %0 ], [ getelementptr inbounds ([54 x i8], [54 x i8]* @str.11, i64 0, i64 0), %16 ], [ getelementptr inbounds ([54 x i8], [54 x i8]* @str.10, i64 0, i64 0), %18 ], [ getelementptr inbounds ([46 x i8], [46 x i8]* @str.9, i64 0, i64 0), %20 ]
%24 = call i32 @puts(i8* dereferenceable(1) %23)
br label %25
25: ; preds = %22, %20
ret i32 0
}