#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 EXIT_SUCCESS;
double basal_metabolic_rate(int, int, int, char);
double floor(double);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, int *, int *, int *, char *, int *);
int main() {
  int weight, height, age, workOuts;
  char gender;
  scanf("%d %d %d %c %d%*c", &weight, &height, &age, &gender, &workOuts);
  double bmr = basal_metabolic_rate(weight, height, age, gender);
  double dailyCalorieIntake;
  if (workOuts <= 0) {
    dailyCalorieIntake = bmr * 1.2;
  } else if (workOuts >= 1 && workOuts <= 3) {
    dailyCalorieIntake = bmr * 1.375;
  } else if (workOuts >= 4 && workOuts <= 6) {
    dailyCalorieIntake = bmr * 1.55;
  } else if (workOuts >= 7 && workOuts <= 9) {
    dailyCalorieIntake = bmr * 1.725;
  } else {
    dailyCalorieIntake = bmr * 1.9;
  }
  dailyCalorieIntake = floor(dailyCalorieIntake);
  printf("%.0lf", dailyCalorieIntake);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x15(%rbp),%r8
lea    -0x14(%rbp),%r9
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsbl -0x15(%rbp),%ecx
call   1050 <basal_metabolic_rate@plt>
movsd  %xmm0,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     11a7 <main+0x67>
movsd  0xe88(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1249 <main+0x109>
cmpl   $0x1,-0x14(%rbp)
jl     11d2 <main+0x92>
cmpl   $0x3,-0x14(%rbp)
jg     11d2 <main+0x92>
movsd  0xe55(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1244 <main+0x104>
cmpl   $0x4,-0x14(%rbp)
jl     11fd <main+0xbd>
cmpl   $0x6,-0x14(%rbp)
jg     11fd <main+0xbd>
movsd  0xe22(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    123f <main+0xff>
cmpl   $0x7,-0x14(%rbp)
jl     1228 <main+0xe8>
cmpl   $0x9,-0x14(%rbp)
jg     1228 <main+0xe8>
movsd  0xdef(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    123a <main+0xfa>
movsd  0xdd0(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    123f <main+0xff>
jmp    1244 <main+0x104>
jmp    1249 <main+0x109>
movsd  -0x28(%rbp),%xmm0
call   1060 <floor@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xdd6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2d70(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xedd(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x7(%rsp),%r8
lea    0x8(%rsp),%r9
call   1040 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
movsbl 0x7(%rsp),%ecx
call   1050 <basal_metabolic_rate@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
jle    1196 <main+0x56>
cmp    $0x4,%eax
jae    11a0 <main+0x60>
movsd  0xe74(%rip),%xmm1
jmp    11c3 <main+0x83>
movsd  0xe62(%rip),%xmm1
jmp    11c3 <main+0x83>
cmp    $0x7,%eax
jae    11af <main+0x6f>
movsd  0xe63(%rip),%xmm1
jmp    11c3 <main+0x83>
xor    %ecx,%ecx
cmp    $0xa,%eax
setb   %cl
lea    0xe5a(%rip),%rax
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm1,%xmm0
call   1060 <floor@plt>
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e01(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"%d %d %d %c %d%*c\00"
@.str.1 = [6 x i8] c"%.0lf\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = alloca double
%8 = alloca double
store i32 0, i32* %1
%9 = call i32 @scanf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i8* %6, i32* %5)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = load i8, i8* %6
%14 = call double @basal_metabolic_rate(i32 %10, i32 %11, i32 %12, i8 signext %13)
store double %14, double* %7
%15 = load i32, i32* %5
%16 = icmp sle i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %0
%18 = load double, double* %7
%19 = fmul double %18, 1.200000e+00
store double %19, double* %8
br label %53
20: ; preds = %0
%21 = load i32, i32* %5
%22 = icmp sge i32 %21, 1
br i1 %22, label %23, label %29
23: ; preds = %20
%24 = load i32, i32* %5
%25 = icmp sle i32 %24, 3
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = load double, double* %7
%28 = fmul double %27, 1.375000e+00
store double %28, double* %8
br label %52
29: ; preds = %23, %20
%30 = load i32, i32* %5
%31 = icmp sge i32 %30, 4
br i1 %31, label %32, label %38
32: ; preds = %29
%33 = load i32, i32* %5
%34 = icmp sle i32 %33, 6
br i1 %34, label %35, label %38
35: ; preds = %32
%36 = load double, double* %7
%37 = fmul double %36, 1.550000e+00
store double %37, double* %8
br label %51
38: ; preds = %32, %29
%39 = load i32, i32* %5
%40 = icmp sge i32 %39, 7
br i1 %40, label %41, label %47
41: ; preds = %38
%42 = load i32, i32* %5
%43 = icmp sle i32 %42, 9
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = load double, double* %7
%46 = fmul double %45, 1.725000e+00
store double %46, double* %8
br label %50
47: ; preds = %41, %38
%48 = load double, double* %7
%49 = fmul double %48, 1.900000e+00
store double %49, double* %8
br label %50
50: ; preds = %47, %44
br label %51
51: ; preds = %50, %35
br label %52
52: ; preds = %51, %26
br label %53
53: ; preds = %52, %17
%54 = load double, double* %8
%55 = call double @llvm.floor.f64(double %54)
store double %55, double* %8
%56 = load double, double* %8
%57 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %56)
%58 = load i32, i32* @EXIT_SUCCESS
ret i32 %58
}

LLVM IR (-O2):
@.str = [18 x i8] c"%d %d %d %c %d%*c\00"
@.str.1 = [6 x i8] c"%.0lf\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = call i32 @scanf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i8* %5, i32* %4)
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = load i8, i8* %5
%15 = call double @basal_metabolic_rate(i32 %11, i32 %12, i32 %13, i8 signext %14)
%16 = load i32, i32* %4
%17 = icmp slt i32 %16, 1
br i1 %17, label %25, label %18
18: ; preds = %0
%19 = icmp ult i32 %16, 4
br i1 %19, label %25, label %20
20: ; preds = %18
%21 = icmp ult i32 %16, 7
br i1 %21, label %25, label %22
22: ; preds = %20
%23 = icmp ult i32 %16, 10
%24 = select i1 %23, double 1.725000e+00, double 1.900000e+00
br label %25
25: ; preds = %22, %20, %18, %0
%26 = phi double [ 1.200000e+00, %0 ], [ 1.375000e+00, %18 ], [ 1.550000e+00, %20 ], [ %24, %22 ]
%27 = fmul double %15, %26
%28 = call double @llvm.floor.f64(double %27)
%29 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %28)
%30 = load i32, i32* @EXIT_SUCCESS
ret i32 %30
}