#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 /*<<< orphan*/ system(char *);
int main() {
  float p, h, imc;
  printf("Digite peso: \n");
  scanf("%f", &p);
  printf("Digite altura: \n");
  scanf("%f", &h);
  imc = p / (h * h);
  if (imc < 20)
    printf("O seu Idice de Massa Corporea e %.2f e esta magro\n", imc);
  else if (imc < 26)
    printf("O seu Indice de Massa Corporea e %.2f e voce esta no peso ideal\n",
           imc);
  else if (imc < 31)
    printf("O seu Indice de Massa Corporea e %.2f e voce esta acima do peso\n",
           imc);
  else
    printf("O seu Indice de Massa Corporea e %.2f e voce esta obeso\n", imc);
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe65(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    11c1 <main+0x91>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe7a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    123e <main+0x10e>
movss  0xe3b(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    11ef <main+0xbf>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe7f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1239 <main+0x109>
movss  0xe11(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    121d <main+0xed>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe92(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1234 <main+0x104>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb7(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1239 <main+0x109>
jmp    123e <main+0x10e>
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xfb7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xfa5(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
mulss  %xmm1,%xmm1
divss  %xmm1,%xmm0
movss  0xe66(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    11ac <main+0x6c>
cvtss2sd %xmm0,%xmm0
lea    0xe65(%rip),%rdi
jmp    11e7 <main+0xa7>
movss  0xe50(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    11c6 <main+0x86>
cvtss2sd %xmm0,%xmm0
lea    0xe7e(%rip),%rdi
jmp    11e7 <main+0xa7>
movss  0xe3a(%rip),%xmm1
ucomiss %xmm0,%xmm1
cvtss2sd %xmm0,%xmm0
jbe    11e0 <main+0xa0>
lea    0xea5(%rip),%rdi
jmp    11e7 <main+0xa7>
lea    0xedd(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xf08(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Digite peso: \0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [17 x i8] c"Digite altura: \0A\00"
@.str.3 = [51 x i8] c"O seu Idice de Massa Corporea e %.2f e esta magro\0A\00"
@.str.4 = [65 x i8] c"O seu Indice de Massa Corporea e %.2f e voce esta no peso ideal\0A\00"
@.str.5 = [65 x i8] c"O seu Indice de Massa Corporea e %.2f e voce esta acima do peso\0A\00"
@.str.6 = [57 x i8] c"O seu Indice de Massa Corporea e %.2f e voce esta obeso\0A\00"
@.str.7 = [6 x i8] c"pause\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 ([15 x i8], [15 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 ([17 x i8], [17 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, 2.000000e+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 ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0), double %18)
br label %40
20: ; preds = %0
%21 = load float, float* %4
%22 = fcmp olt float %21, 2.600000e+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 ([65 x i8], [65 x i8]* @.str.4, i64 0, i64 0), double %25)
br label %39
27: ; preds = %20
%28 = load float, float* %4
%29 = fcmp olt float %28, 3.100000e+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 ([65 x i8], [65 x i8]* @.str.5, i64 0, i64 0), double %32)
br label %38
34: ; preds = %27
%35 = load float, float* %4
%36 = fpext float %35 to double
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.6, i64 0, i64 0), double %36)
br label %38
38: ; preds = %34, %30
br label %39
39: ; preds = %38, %23
br label %40
40: ; preds = %39, %16
%41 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%42 = load i32, i32* %1
ret i32 %42
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.3 = [51 x i8] c"O seu Idice de Massa Corporea e %.2f e esta magro\0A\00"
@.str.4 = [65 x i8] c"O seu Indice de Massa Corporea e %.2f e voce esta no peso ideal\0A\00"
@.str.5 = [65 x i8] c"O seu Indice de Massa Corporea e %.2f e voce esta acima do peso\0A\00"
@.str.6 = [57 x i8] c"O seu Indice de Massa Corporea e %.2f e voce esta obeso\0A\00"
@.str.7 = [6 x i8] c"pause\00"
@str = [14 x i8] c"Digite peso: \00"
@str.8 = [16 x i8] c"Digite altura: \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 ([14 x i8], [14 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 ([16 x i8], [16 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* %1
%10 = load float, float* %2
%11 = fmul float %10, %10
%12 = fdiv float %9, %11
%13 = fcmp olt float %12, 2.000000e+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 ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0), double %15)
br label %29
17: ; preds = %0
%18 = fcmp olt float %12, 2.600000e+01
br i1 %18, label %19, label %22
19: ; preds = %17
%20 = fpext float %12 to double
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.4, i64 0, i64 0), double %20)
br label %29
22: ; preds = %17
%23 = fcmp olt float %12, 3.100000e+01
%24 = fpext float %12 to double
br i1 %23, label %25, label %27
25: ; preds = %22
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.5, i64 0, i64 0), double %24)
br label %29
27: ; preds = %22
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.6, i64 0, i64 0), double %24)
br label %29
29: ; preds = %19, %27, %25, %14
%30 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}