#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(void) {
  float height, heightSquared, weight, bodyMassIndex, minimumWeight,
      maximumWeight;
  printf("Digite a sua altura:");
  scanf("%f", &height);
  printf("Digite o seu peso:");
  scanf("%f", &weight);
  heightSquared = (height * height);
  bodyMassIndex = (weight) / heightSquared;
  minimumWeight = (25.0) * heightSquared;
  maximumWeight = (30.0) * heightSquared;
  printf("Sua classificação pela OMS:");
  if (bodyMassIndex < 18.5)
    printf("Abaixo do peso.");
  else if (bodyMassIndex < 25.0)
    printf("Peso normal.");
  else if (bodyMassIndex < 30.0)
    printf("Pre obesidade.");
  else if (bodyMassIndex < 35.0)
    printf("Obesidade grau 1.");
  else if (bodyMassIndex < 40.0)
    printf("Obesidade grau 2.");
  else
    printf("Obesidade grau 3.");
  printf("\n\n");
  printf("A sua faixa de peso recomendada pela OMS:");
  printf("%5.1f", minimumWeight);
  printf(" ate ");
  printf("%5.1f", maximumWeight);
  printf("\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xef2(%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    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x10(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe76(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe50(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe1c(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1201 <main+0xe1>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12db <main+0x1bb>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdfe(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    122f <main+0x10f>
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d6 <main+0x1b6>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdc8(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    125d <main+0x13d>
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d1 <main+0x1b1>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdaa(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    128b <main+0x16b>
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12cc <main+0x1ac>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd84(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    12b9 <main+0x199>
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12c7 <main+0x1a7>
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12cc <main+0x1ac>
jmp    12d1 <main+0x1b1>
jmp    12d6 <main+0x1b6>
jmp    12db <main+0x1bb>
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xde6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdf9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdd4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xd99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedd(%rip),%rbx
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x14(%rsp),%xmm0
mulss  %xmm0,%xmm0
movss  0x10(%rsp),%xmm1
movss  %xmm0,0xc(%rsp)
divss  %xmm0,%xmm1
movss  %xmm1,0x8(%rsp)
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0x8(%rsp),%xmm1
movss  0xe50(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    11be <main+0x8e>
lea    0xea1(%rip),%rdi
jmp    121d <main+0xed>
movss  0xe3e(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    11d4 <main+0xa4>
lea    0xe9b(%rip),%rdi
jmp    121d <main+0xed>
movss  0xe2c(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    11ea <main+0xba>
lea    0xe92(%rip),%rdi
jmp    121d <main+0xed>
movss  0xe1a(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    1200 <main+0xd0>
lea    0xe8b(%rip),%rdi
jmp    121d <main+0xed>
movss  0xe08(%rip),%xmm0
ucomiss %xmm1,%xmm0
lea    0xe89(%rip),%rax
lea    0xe94(%rip),%rdi
cmova  %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0xddc(%rip),%xmm0
movss  0xc(%rsp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,0x8(%rsp)
mulss  0xdc0(%rip),%xmm1
movss  %xmm1,0xc(%rsp)
lea    0xea4(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xe5f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe71(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe66(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Digite a sua altura:\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [19 x i8] c"Digite o seu peso:\00"
@.str.3 = [30 x i8] c"Sua classifica\C3\A7\C3\A3o pela OMS:\00"
@.str.4 = [16 x i8] c"Abaixo do peso.\00"
@.str.5 = [13 x i8] c"Peso normal.\00"
@.str.6 = [15 x i8] c"Pre obesidade.\00"
@.str.7 = [18 x i8] c"Obesidade grau 1.\00"
@.str.8 = [18 x i8] c"Obesidade grau 2.\00"
@.str.9 = [18 x i8] c"Obesidade grau 3.\00"
@.str.10 = [3 x i8] c"\0A\0A\00"
@.str.11 = [42 x i8] c"A sua faixa de peso recomendada pela OMS:\00"
@.str.12 = [6 x i8] c"%5.1f\00"
@.str.13 = [6 x i8] c" ate \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%12 = load float, float* %2
%13 = load float, float* %2
%14 = fmul float %12, %13
store float %14, float* %3
%15 = load float, float* %4
%16 = load float, float* %3
%17 = fdiv float %15, %16
store float %17, float* %5
%18 = load float, float* %3
%19 = fpext float %18 to double
%20 = fmul double 2.500000e+01, %19
%21 = fptrunc double %20 to float
store float %21, float* %6
%22 = load float, float* %3
%23 = fpext float %22 to double
%24 = fmul double 3.000000e+01, %23
%25 = fptrunc double %24 to float
store float %25, float* %7
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%27 = load float, float* %5
%28 = fpext float %27 to double
%29 = fcmp olt double %28, 1.850000e+01
br i1 %29, label %30, label %32
30: ; preds = %0
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
br label %62
32: ; preds = %0
%33 = load float, float* %5
%34 = fpext float %33 to double
%35 = fcmp olt double %34, 2.500000e+01
br i1 %35, label %36, label %38
36: ; preds = %32
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %61
38: ; preds = %32
%39 = load float, float* %5
%40 = fpext float %39 to double
%41 = fcmp olt double %40, 3.000000e+01
br i1 %41, label %42, label %44
42: ; preds = %38
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
br label %60
44: ; preds = %38
%45 = load float, float* %5
%46 = fpext float %45 to double
%47 = fcmp olt double %46, 3.500000e+01
br i1 %47, label %48, label %50
48: ; preds = %44
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
br label %59
50: ; preds = %44
%51 = load float, float* %5
%52 = fpext float %51 to double
%53 = fcmp olt double %52, 4.000000e+01
br i1 %53, label %54, label %56
54: ; preds = %50
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
br label %58
56: ; preds = %50
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
br label %58
58: ; preds = %56, %54
br label %59
59: ; preds = %58, %48
br label %60
60: ; preds = %59, %42
br label %61
61: ; preds = %60, %36
br label %62
62: ; preds = %61, %30
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0))
%65 = load float, float* %6
%66 = fpext float %65 to double
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), double %66)
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
%69 = load float, float* %7
%70 = fpext float %69 to double
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), double %70)
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Digite a sua altura:\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [19 x i8] c"Digite o seu peso:\00"
@.str.3 = [30 x i8] c"Sua classifica\C3\A7\C3\A3o pela OMS:\00"
@.str.4 = [16 x i8] c"Abaixo do peso.\00"
@.str.5 = [13 x i8] c"Peso normal.\00"
@.str.6 = [15 x i8] c"Pre obesidade.\00"
@.str.7 = [18 x i8] c"Obesidade grau 1.\00"
@.str.8 = [18 x i8] c"Obesidade grau 2.\00"
@.str.9 = [18 x i8] c"Obesidade grau 3.\00"
@.str.11 = [42 x i8] c"A sua faixa de peso recomendada pela OMS:\00"
@.str.12 = [6 x i8] c"%5.1f\00"
@.str.13 = [6 x i8] c" ate \00"
@str.14 = [2 x i8] c"\0A\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 ([21 x i8], [21 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 ([19 x i8], [19 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 = fmul float %9, %9
%11 = load float, float* %2
%12 = fdiv float %11, %10
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%14 = fcmp olt float %12, 1.850000e+01
br i1 %14, label %24, label %15
15: ; preds = %0
%16 = fcmp olt float %12, 2.500000e+01
br i1 %16, label %24, label %17
17: ; preds = %15
%18 = fcmp olt float %12, 3.000000e+01
br i1 %18, label %24, label %19
19: ; preds = %17
%20 = fcmp olt float %12, 3.500000e+01
br i1 %20, label %24, label %21
21: ; preds = %19
%22 = fcmp olt float %12, 4.000000e+01
%23 = select i1 %22, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0)
br label %24
24: ; preds = %21, %19, %17, %15, %0
%25 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), %0 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), %15 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), %17 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), %19 ], [ %23, %21 ]
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %25)
%27 = fmul float %10, 3.000000e+01
%28 = fmul float %10, 2.500000e+01
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.14, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0))
%31 = fpext float %28 to double
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), double %31)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
%34 = fpext float %27 to double
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), double %34)
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.14, i64 0, i64 0))
ret i32 0
}