#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("\nPara o calculo do IMC, vou precisar do seu peso e altura.\n");
  printf("\nQual é a seu peso em quilos?\n");
  scanf("%f", &peso);
  printf("\nQual é sua altura em metros?\n");
  scanf("%f", &altura);
  imc = peso / (altura * altura);
  if (imc < 20)
    printf("Você está magra, abaixo do peso ideal. Com indice IMC de %.2f",
           imc);
  else if (imc < 26)
    printf("Você está com peso ideal. Com indice IMC de %.2f", imc);
  else if (imc < 31)
    printf("Você está acima do peso ideal. Com indice IMC de %.2f", imc);
  else
    printf("Você está obesa, muito acima do peso ideal. Com indice IMC de %.2f",
           imc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf16(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xf09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef8(%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  0xe67(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    11bf <main+0x9f>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xed8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    123c <main+0x11c>
movss  0xe3d(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    11ed <main+0xcd>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeea(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1237 <main+0x117>
movss  0xe13(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    121b <main+0xfb>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeef(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1232 <main+0x112>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xf0b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1237 <main+0x117>
jmp    123c <main+0x11c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xfc3(%rip),%rdi
call   1030 <puts@plt>
lea    0xff2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xff1(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
mulss  %xmm1,%xmm1
divss  %xmm1,%xmm0
movss  0xe6a(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    11a8 <main+0x78>
cvtss2sd %xmm0,%xmm0
lea    0xe69(%rip),%rdi
jmp    11e3 <main+0xb3>
movss  0xe54(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    11c2 <main+0x92>
cvtss2sd %xmm0,%xmm0
lea    0xe8f(%rip),%rdi
jmp    11e3 <main+0xb3>
movss  0xe3e(%rip),%xmm1
ucomiss %xmm0,%xmm1
cvtss2sd %xmm0,%xmm0
jbe    11dc <main+0xac>
lea    0xea8(%rip),%rdi
jmp    11e3 <main+0xb3>
lea    0xed7(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [60 x i8] c"\0APara o calculo do IMC, vou precisar do seu peso e altura.\0A\00"
@.str.1 = [32 x i8] c"\0AQual \C3\A9 a seu peso em quilos?\0A\00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [32 x i8] c"\0AQual \C3\A9 sua altura em metros?\0A\00"
@.str.4 = [64 x i8] c"Voc\C3\AA est\C3\A1 magra, abaixo do peso ideal. Com indice IMC de %.2f\00"
@.str.5 = [51 x i8] c"Voc\C3\AA est\C3\A1 com peso ideal. Com indice IMC de %.2f\00"
@.str.6 = [56 x i8] c"Voc\C3\AA est\C3\A1 acima do peso ideal. Com indice IMC de %.2f\00"
@.str.7 = [69 x i8] c"Voc\C3\AA est\C3\A1 obesa, muito acima do peso ideal. Com indice IMC de %.2f\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 ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%10 = load float, float* %2
%11 = load float, float* %3
%12 = load float, float* %3
%13 = fmul float %11, %12
%14 = fdiv float %10, %13
store float %14, float* %4
%15 = load float, float* %4
%16 = fcmp olt float %15, 2.000000e+01
br i1 %16, label %17, label %21
17: ; preds = %0
%18 = load float, float* %4
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.4, i64 0, i64 0), double %19)
br label %41
21: ; preds = %0
%22 = load float, float* %4
%23 = fcmp olt float %22, 2.600000e+01
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = load float, float* %4
%26 = fpext float %25 to double
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0), double %26)
br label %40
28: ; preds = %21
%29 = load float, float* %4
%30 = fcmp olt float %29, 3.100000e+01
br i1 %30, label %31, label %35
31: ; preds = %28
%32 = load float, float* %4
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.6, i64 0, i64 0), double %33)
br label %39
35: ; preds = %28
%36 = load float, float* %4
%37 = fpext float %36 to double
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.7, i64 0, i64 0), double %37)
br label %39
39: ; preds = %35, %31
br label %40
40: ; preds = %39, %24
br label %41
41: ; preds = %40, %17
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%f\00"
@.str.4 = [64 x i8] c"Voc\C3\AA est\C3\A1 magra, abaixo do peso ideal. Com indice IMC de %.2f\00"
@.str.5 = [51 x i8] c"Voc\C3\AA est\C3\A1 com peso ideal. Com indice IMC de %.2f\00"
@.str.6 = [56 x i8] c"Voc\C3\AA est\C3\A1 acima do peso ideal. Com indice IMC de %.2f\00"
@.str.7 = [69 x i8] c"Voc\C3\AA est\C3\A1 obesa, muito acima do peso ideal. Com indice IMC de %.2f\00"
@str = [59 x i8] c"\0APara o calculo do IMC, vou precisar do seu peso e altura.\00"
@str.8 = [31 x i8] c"\0AQual \C3\A9 a seu peso em quilos?\00"
@str.9 = [31 x i8] c"\0AQual \C3\A9 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 ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.8, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.9, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%10 = load float, float* %1
%11 = load float, float* %2
%12 = fmul float %11, %11
%13 = fdiv float %10, %12
%14 = fcmp olt float %13, 2.000000e+01
br i1 %14, label %15, label %18
15: ; preds = %0
%16 = fpext float %13 to double
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.4, i64 0, i64 0), double %16)
br label %30
18: ; preds = %0
%19 = fcmp olt float %13, 2.600000e+01
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = fpext float %13 to double
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0), double %21)
br label %30
23: ; preds = %18
%24 = fcmp olt float %13, 3.100000e+01
%25 = fpext float %13 to double
br i1 %24, label %26, label %28
26: ; preds = %23
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.6, i64 0, i64 0), double %25)
br label %30
28: ; preds = %23
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str.7, i64 0, i64 0), double %25)
br label %30
30: ; preds = %20, %28, %26, %15
ret i32 0
}