#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 *, ...);
int main() {
  float lb, bmi;
  int ft, in;
  printf("Weight (lbs) :");
  scanf("%f", &lb);
  printf("    Height (ft/in) :");
  scanf("%d %d", &ft, &in);
  if (lb < 0.0 || ft < 0 || in < 0 || in >= 12)
    printf("  I'm sorry; this input is invalid.");
  else if (ft == 0 && in == 0)
    printf("   I'm sorry; I can't see you. You are too short.");
  else {
    in += ft * 12;
    ft = 0;
    bmi = (lb * 703) / (in * in);
    if (bmi > 30.0)
      printf("   Your BMI score is %.1f - you're obese!", bmi);
    else if (bmi > 25.0)
      printf("   Your BMI score is %.1f - you're overweight!", bmi);
    else if (bmi > 18.5)
      printf("   Your BMI score is %.1f - you're normal weight!", bmi);
    else
      printf("   Your BMI score is %.1f - you're underweight!", bmi);
  }
  printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     11a7 <main+0x87>
cmpl   $0x0,-0x10(%rbp)
jl     11a7 <main+0x87>
cmpl   $0x0,-0x14(%rbp)
jl     11a7 <main+0x87>
cmpl   $0xc,-0x14(%rbp)
jl     11ba <main+0x9a>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12e3 <main+0x1c3>
cmpl   $0x0,-0x10(%rbp)
jne    11e1 <main+0xc1>
cmpl   $0x0,-0x14(%rbp)
jne    11e1 <main+0xc1>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12de <main+0x1be>
imul   $0xc,-0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
movss  0xe1e(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xddc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    124a <main+0x12a>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe61(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    12d9 <main+0x1b9>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdad(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1281 <main+0x161>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe54(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    12d4 <main+0x1b4>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd7e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12b8 <main+0x198>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe4c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    12cf <main+0x1af>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe62(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    12d4 <main+0x1b4>
jmp    12d9 <main+0x1b9>
jmp    12de <main+0x1be>
jmp    12e3 <main+0x1c3>
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
movss  0x14(%rsp),%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm1,%xmm0
ja     11ad <main+0x7d>
mov    0x10(%rsp),%eax
test   %eax,%eax
js     11ad <main+0x7d>
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
js     11ad <main+0x7d>
cmp    $0xc,%ecx
jge    11ad <main+0x7d>
mov    %eax,%edx
or     %ecx,%edx
jne    11bd <main+0x8d>
lea    0xeb6(%rip),%rdi
jmp    11b4 <main+0x84>
lea    0xe89(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1230 <main+0x100>
lea    (%rax,%rax,2),%eax
lea    (%rcx,%rax,4),%eax
mov    %eax,0xc(%rsp)
movl   $0x0,0x10(%rsp)
mulss  0xe29(%rip),%xmm1
imul   %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
divss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
ucomiss 0xe11(%rip),%xmm1
jbe    11fe <main+0xce>
lea    0xe97(%rip),%rdi
jmp    1229 <main+0xf9>
ucomiss 0xe03(%rip),%xmm1
jbe    1210 <main+0xe0>
lea    0xeaf(%rip),%rdi
jmp    1229 <main+0xf9>
ucomiss 0xdf5(%rip),%xmm1
jbe    1222 <main+0xf2>
lea    0xecc(%rip),%rdi
jmp    1229 <main+0xf9>
lea    0xef5(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xf17(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Weight (lbs) :\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [21 x i8] c" Height (ft/in) :\00"
@.str.3 = [6 x i8] c"%d %d\00"
@.str.4 = [36 x i8] c" I'm sorry; this input is invalid.\00"
@.str.5 = [50 x i8] c" I'm sorry; I can't see you. You are too short.\00"
@.str.6 = [42 x i8] c" Your BMI score is %.1f - you're obese!\00"
@.str.7 = [47 x i8] c" Your BMI score is %.1f - you're overweight!\00"
@.str.8 = [50 x i8] c" Your BMI score is %.1f - you're normal weight!\00"
@.str.9 = [48 x i8] c" Your BMI score is %.1f - you're underweight!\00"
@.str.10 = [19 x i8] c"\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* %4, i32* %5)
%10 = load float, float* %2
%11 = fpext float %10 to double
%12 = fcmp olt double %11, 0.000000e+00
br i1 %12, label %22, label %13
13: ; preds = %0
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 0
br i1 %15, label %22, label %16
16: ; preds = %13
%17 = load i32, i32* %5
%18 = icmp slt i32 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = load i32, i32* %5
%21 = icmp sge i32 %20, 12
br i1 %21, label %22, label %24
22: ; preds = %19, %16, %13, %0
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
br label %75
24: ; preds = %19
%25 = load i32, i32* %4
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %32
27: ; preds = %24
%28 = load i32, i32* %5
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0))
br label %74
32: ; preds = %27, %24
%33 = load i32, i32* %4
%34 = mul nsw i32 %33, 12
%35 = load i32, i32* %5
%36 = add nsw i32 %35, %34
store i32 %36, i32* %5
store i32 0, i32* %4
%37 = load float, float* %2
%38 = fmul float %37, 7.030000e+02
%39 = load i32, i32* %5
%40 = load i32, i32* %5
%41 = mul nsw i32 %39, %40
%42 = sitofp i32 %41 to float
%43 = fdiv float %38, %42
store float %43, float* %3
%44 = load float, float* %3
%45 = fpext float %44 to double
%46 = fcmp ogt double %45, 3.000000e+01
br i1 %46, label %47, label %51
47: ; preds = %32
%48 = load float, float* %3
%49 = fpext float %48 to double
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.6, i64 0, i64 0), double %49)
br label %73
51: ; preds = %32
%52 = load float, float* %3
%53 = fpext float %52 to double
%54 = fcmp ogt double %53, 2.500000e+01
br i1 %54, label %55, label %59
55: ; preds = %51
%56 = load float, float* %3
%57 = fpext float %56 to double
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0), double %57)
br label %72
59: ; preds = %51
%60 = load float, float* %3
%61 = fpext float %60 to double
%62 = fcmp ogt double %61, 1.850000e+01
br i1 %62, label %63, label %67
63: ; preds = %59
%64 = load float, float* %3
%65 = fpext float %64 to double
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.8, i64 0, i64 0), double %65)
br label %71
67: ; preds = %59
%68 = load float, float* %3
%69 = fpext float %68 to double
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.9, i64 0, i64 0), double %69)
br label %71
71: ; preds = %67, %63
br label %72
72: ; preds = %71, %55
br label %73
73: ; preds = %72, %47
br label %74
74: ; preds = %73, %30
br label %75
75: ; preds = %74, %22
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Weight (lbs) :\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [21 x i8] c" Height (ft/in) :\00"
@.str.3 = [6 x i8] c"%d %d\00"
@.str.4 = [36 x i8] c" I'm sorry; this input is invalid.\00"
@.str.5 = [50 x i8] c" I'm sorry; I can't see you. You are too short.\00"
@.str.6 = [42 x i8] c" Your BMI score is %.1f - you're obese!\00"
@.str.7 = [47 x i8] c" Your BMI score is %.1f - you're overweight!\00"
@.str.8 = [50 x i8] c" Your BMI score is %.1f - you're normal weight!\00"
@.str.9 = [48 x i8] c" Your BMI score is %.1f - you're underweight!\00"
@str = [18 x i8] c"\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca i32
%3 = alloca i32
%4 = bitcast float* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* %2, i32* %3)
%11 = load float, float* %1
%12 = fcmp olt float %11, 0.000000e+00
%13 = load i32, i32* %2
%14 = icmp slt i32 %13, 0
%15 = select i1 %12, i1 true, i1 %14
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 0
%18 = select i1 %15, i1 true, i1 %17
%19 = icmp sgt i32 %16, 11
%20 = select i1 %18, i1 true, i1 %19
br i1 %20, label %21, label %23
21: ; preds = %0
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
br label %50
23: ; preds = %0
%24 = icmp eq i32 %13, 0
%25 = icmp eq i32 %16, 0
%26 = select i1 %24, i1 %25, i1 false
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0))
br label %50
29: ; preds = %23
%30 = mul nsw i32 %13, 12
%31 = add nsw i32 %16, %30
store i32 %31, i32* %3
store i32 0, i32* %2
%32 = fmul float %11, 7.030000e+02
%33 = mul nsw i32 %31, %31
%34 = sitofp i32 %33 to float
%35 = fdiv float %32, %34
%36 = fpext float %35 to double
%37 = fcmp ogt float %35, 3.000000e+01
br i1 %37, label %38, label %40
38: ; preds = %29
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.6, i64 0, i64 0), double %36)
br label %50
40: ; preds = %29
%41 = fcmp ogt float %35, 2.500000e+01
br i1 %41, label %42, label %44
42: ; preds = %40
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0), double %36)
br label %50
44: ; preds = %40
%45 = fcmp ogt float %35, 1.850000e+01
br i1 %45, label %46, label %48
46: ; preds = %44
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.8, i64 0, i64 0), double %36)
br label %50
48: ; preds = %44
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.9, i64 0, i64 0), double %36)
br label %50
50: ; preds = %27, %42, %48, %46, %38, %21
%51 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}