#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 height;
  float weight;
  float BMI;
  printf("please enter your height according to meter : ");
  scanf("%f", &height);
  printf("Please enter your weight according to kilogram : ");
  scanf("%f", &weight);
  BMI = ((weight) / (height * height));
  if (BMI < 16.5)
    printf("Very severely underweight");
  else if (16.5 <= BMI && BMI < 18.5)
    printf("Underweight");
  else if (18.5 <= BMI && BMI < 25)
    printf("Normal");
  else if (25 <= BMI && BMI < 30)
    printf("Overweight");
  else if (30 <= BMI && BMI < 35)
    printf("Obese class1");
  else if (35 <= BMI && BMI < 40)
    printf("Obese class2");
  else if (BMI > 40)
    printf("Obese class3");
  else
    printf("Error");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeea(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0d(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xf00(%rip),%rdi
call   1030 <printf@plt>
lea    0xef1(%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,%xmm1
movsd  0xe70(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11ab <main+0x8b>
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
jmp    132c <main+0x20c>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe44(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11f2 <main+0xd2>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe31(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11f2 <main+0xd2>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
jmp    1327 <main+0x207>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe05(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1230 <main+0x110>
movss  0xdfb(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1230 <main+0x110>
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
jmp    1322 <main+0x202>
movss  -0x10(%rbp),%xmm0
movss  0xdd3(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1269 <main+0x149>
movss  0xdc6(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1269 <main+0x149>
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
jmp    131d <main+0x1fd>
movss  -0x10(%rbp),%xmm0
movss  0xd9e(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     12a2 <main+0x182>
movss  0xd91(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    12a2 <main+0x182>
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
jmp    1318 <main+0x1f8>
movss  -0x10(%rbp),%xmm0
movss  0xd69(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     12db <main+0x1bb>
movss  0xd5c(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    12db <main+0x1bb>
lea    0xdf8(%rip),%rdi
call   1030 <printf@plt>
jmp    1313 <main+0x1f3>
movss  -0x10(%rbp),%xmm0
movss  0xd34(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1302 <main+0x1e2>
lea    0xdde(%rip),%rdi
call   1030 <printf@plt>
jmp    130e <main+0x1ee>
lea    0xdda(%rip),%rdi
call   1030 <printf@plt>
jmp    1313 <main+0x1f3>
jmp    1318 <main+0x1f8>
jmp    131d <main+0x1fd>
jmp    1322 <main+0x202>
jmp    1327 <main+0x207>
jmp    132c <main+0x20c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeec(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0f(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xefe(%rip),%rdi
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
mulss  %xmm1,%xmm1
divss  %xmm1,%xmm0
movss  0xe86(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    118b <main+0x6b>
lea    0xef6(%rip),%rdi
jmp    1242 <main+0x122>
ucomiss 0xe6e(%rip),%xmm0
jb     11ad <main+0x8d>
movss  0xe68(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    11ad <main+0x8d>
lea    0xeee(%rip),%rdi
jmp    1242 <main+0x122>
ucomiss 0xe50(%rip),%xmm0
jb     11cc <main+0xac>
movss  0xe4a(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    11cc <main+0xac>
lea    0xed8(%rip),%rdi
jmp    1242 <main+0x122>
ucomiss 0xe35(%rip),%xmm0
jb     11eb <main+0xcb>
movss  0xe2f(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    11eb <main+0xcb>
lea    0xec0(%rip),%rdi
jmp    1242 <main+0x122>
ucomiss 0xe1a(%rip),%xmm0
jb     120a <main+0xea>
movss  0xe14(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    120a <main+0xea>
lea    0xeac(%rip),%rdi
jmp    1242 <main+0x122>
ucomiss 0xdff(%rip),%xmm0
jb     1229 <main+0x109>
movss  0xdf9(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1229 <main+0x109>
lea    0xe9a(%rip),%rdi
jmp    1242 <main+0x122>
ucomiss 0xde4(%rip),%xmm0
lea    0xe97(%rip),%rax
lea    0xe9d(%rip),%rdi
cmova  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"please enter your height according to meter : \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [50 x i8] c"Please enter your weight according to kilogram : \00"
@.str.3 = [26 x i8] c"Very severely underweight\00"
@.str.4 = [12 x i8] c"Underweight\00"
@.str.5 = [7 x i8] c"Normal\00"
@.str.6 = [11 x i8] c"Overweight\00"
@.str.7 = [13 x i8] c"Obese class1\00"
@.str.8 = [13 x i8] c"Obese class2\00"
@.str.9 = [13 x i8] c"Obese class3\00"
@.str.10 = [6 x i8] c"Error\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 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 @printf(i8* getelementptr inbounds ([50 x i8], [50 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 = fcmp olt double %15, 1.650000e+01
br i1 %16, label %17, label %19
17: ; preds = %0
%18 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %75
19: ; preds = %0
%20 = load float, float* %4
%21 = fpext float %20 to double
%22 = fcmp ole double 1.650000e+01, %21
br i1 %22, label %23, label %29
23: ; preds = %19
%24 = load float, float* %4
%25 = fpext float %24 to double
%26 = fcmp olt double %25, 1.850000e+01
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
br label %74
29: ; preds = %23, %19
%30 = load float, float* %4
%31 = fpext float %30 to double
%32 = fcmp ole double 1.850000e+01, %31
br i1 %32, label %33, label %38
33: ; preds = %29
%34 = load float, float* %4
%35 = fcmp olt float %34, 2.500000e+01
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %73
38: ; preds = %33, %29
%39 = load float, float* %4
%40 = fcmp ole float 2.500000e+01, %39
br i1 %40, label %41, label %46
41: ; preds = %38
%42 = load float, float* %4
%43 = fcmp olt float %42, 3.000000e+01
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
br label %72
46: ; preds = %41, %38
%47 = load float, float* %4
%48 = fcmp ole float 3.000000e+01, %47
br i1 %48, label %49, label %54
49: ; preds = %46
%50 = load float, float* %4
%51 = fcmp olt float %50, 3.500000e+01
br i1 %51, label %52, label %54
52: ; preds = %49
%53 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
br label %71
54: ; preds = %49, %46
%55 = load float, float* %4
%56 = fcmp ole float 3.500000e+01, %55
br i1 %56, label %57, label %62
57: ; preds = %54
%58 = load float, float* %4
%59 = fcmp olt float %58, 4.000000e+01
br i1 %59, label %60, label %62
60: ; preds = %57
%61 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
br label %70
62: ; preds = %57, %54
%63 = load float, float* %4
%64 = fcmp ogt float %63, 4.000000e+01
br i1 %64, label %65, label %67
65: ; preds = %62
%66 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
br label %69
67: ; preds = %62
%68 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %69
69: ; preds = %67, %65
br label %70
70: ; preds = %69, %60
br label %71
71: ; preds = %70, %52
br label %72
72: ; preds = %71, %44
br label %73
73: ; preds = %72, %36
br label %74
74: ; preds = %73, %27
br label %75
75: ; preds = %74, %17
ret i32 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"please enter your height according to meter : \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [50 x i8] c"Please enter your weight according to kilogram : \00"
@.str.3 = [26 x i8] c"Very severely underweight\00"
@.str.4 = [12 x i8] c"Underweight\00"
@.str.5 = [7 x i8] c"Normal\00"
@.str.6 = [11 x i8] c"Overweight\00"
@.str.7 = [13 x i8] c"Obese class1\00"
@.str.8 = [13 x i8] c"Obese class2\00"
@.str.9 = [13 x i8] c"Obese class3\00"
@.str.10 = [6 x i8] c"Error\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 @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 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 @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 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* %2
%10 = load float, float* %1
%11 = fmul float %10, %10
%12 = fdiv float %9, %11
%13 = fcmp olt float %12, 1.650000e+01
br i1 %13, label %37, label %14
14: ; preds = %0
%15 = fcmp oge float %12, 1.650000e+01
%16 = fcmp olt float %12, 1.850000e+01
%17 = and i1 %15, %16
br i1 %17, label %37, label %18
18: ; preds = %14
%19 = fcmp oge float %12, 1.850000e+01
%20 = fcmp olt float %12, 2.500000e+01
%21 = and i1 %19, %20
br i1 %21, label %37, label %22
22: ; preds = %18
%23 = fcmp oge float %12, 2.500000e+01
%24 = fcmp olt float %12, 3.000000e+01
%25 = and i1 %23, %24
br i1 %25, label %37, label %26
26: ; preds = %22
%27 = fcmp oge float %12, 3.000000e+01
%28 = fcmp olt float %12, 3.500000e+01
%29 = and i1 %27, %28
br i1 %29, label %37, label %30
30: ; preds = %26
%31 = fcmp oge float %12, 3.500000e+01
%32 = fcmp olt float %12, 4.000000e+01
%33 = and i1 %31, %32
br i1 %33, label %37, label %34
34: ; preds = %30
%35 = fcmp ogt float %12, 4.000000e+01
%36 = select i1 %35, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0)
br label %37
37: ; preds = %34, %30, %26, %22, %18, %14, %0
%38 = phi i8* [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), %0 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), %14 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), %18 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), %22 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), %26 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), %30 ], [ %36, %34 ]
%39 = call i32 @printf(i8* dereferenceable(1) %38)
ret i32 0
}