#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*/ clrKeyboardBuffer();
int fibo(int);
int /*<<< orphan*/ printf(char *, ...);
int scanf(char *, ...);
int main(int argc, char *argv[]) {
  char answer;
  int scanfReturn, greenCrud, days, tempVar, totalPounds;
  do {
    do {
      printf("Please enter the initial size of the green crud: ");
      scanfReturn = scanf("%d", &greenCrud);
      if (greenCrud <= 0 || scanfReturn == 0) {
        clrKeyboardBuffer();
        printf("I'm sorry that value is unrecognizable or is negative.\n");
      }
      totalPounds = greenCrud;
    } while (greenCrud <= 0);
    do {
      printf("Please enter the number of days: ");
      scanfReturn = scanf("%d", &days);
      if (days < 0 || scanfReturn == 0) {
        clrKeyboardBuffer();
        days = -1;
        printf("I'm sorry that value is unrecognizable or is negative.\n");
      } else if (days % 5 == 0) {
        tempVar = days / 5;
        totalPounds *= fibo(tempVar);
      }
    } while (days < 0);
    printf("With an initial population of %d pounds of crud growing for %d "
           "day/s.\n",
           greenCrud, days);
    printf("The final population would be %d pound/s.\n", totalPounds);
    printf("Would you like to continue? (y/n) ");
    scanf(" %c", &answer);
  } while (answer == 'y' || answer == 'Y');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    115b <main+0x1b>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    1192 <main+0x52>
cmpl   $0x0,-0x18(%rbp)
jne    11a7 <main+0x67>
mov    $0x0,%al
call   1040 <clrKeyboardBuffer@plt>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    115b <main+0x1b>
jmp    11bc <main+0x7c>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe61(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x20(%rbp)
jl     11f3 <main+0xb3>
cmpl   $0x0,-0x18(%rbp)
jne    1214 <main+0xd4>
mov    $0x0,%al
call   1040 <clrKeyboardBuffer@plt>
movl   $0xffffffff,-0x20(%rbp)
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124a <main+0x10a>
mov    -0x20(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1245 <main+0x105>
mov    -0x20(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
call   1060 <fibo@plt>
imul   -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    124a <main+0x10a>
jmp    124f <main+0x10f>
cmpl   $0x0,-0x20(%rbp)
jl     11bc <main+0x7c>
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe91(%rip),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movsbl -0x11(%rbp),%ecx
mov    $0x1,%al
cmp    $0x79,%ecx
mov    %al,-0x29(%rbp)
je     12bd <main+0x17d>
movsbl -0x11(%rbp),%eax
cmp    $0x59,%eax
sete   %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    1156 <main+0x16>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecd(%rip),%rbx
lea    0xf84(%rip),%r12
lea    0xec2(%rip),%r13
lea    0x10(%rsp),%rbp
mov    $0xcccccccd,%r15d
jmp    11d2 <main+0x82>
mov    0x14(%rsp),%esi
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf05(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf1f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf34(%rip),%rdi
lea    0xf(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0xf(%rsp),%al
and    $0xdf,%al
cmp    $0x59,%al
jne    1289 <main+0x139>
lea    0xe27(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
test   %eax,%eax
je     11fd <main+0xad>
mov    0x14(%rsp),%r14d
test   %r14d,%r14d
jg     1243 <main+0xf3>
xor    %eax,%eax
call   1050 <clrKeyboardBuffer@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    0x14(%rsp),%r14d
test   %r14d,%r14d
jg     1243 <main+0xf3>
jmp    11d2 <main+0x82>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <clrKeyboardBuffer@plt>
movl   $0xffffffff,0x10(%rsp)
ff
mov    %r12,%rdi
call   1030 <puts@plt>
mov    0x10(%rsp),%edx
test   %edx,%edx
jns    1180 <main+0x30>
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
test   %eax,%eax
je     1220 <main+0xd0>
mov    0x10(%rsp),%eax
test   %eax,%eax
js     1220 <main+0xd0>
imul   $0xcccccccd,%eax,%ecx
cmp    $0x33333333,%ecx
ja     1237 <main+0xe7>
mov    %eax,%edi
imul   %r15,%rdi
shr    $0x22,%rdi
call   1070 <fibo@plt>
imul   %eax,%r14d
jmp    1237 <main+0xe7>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [50 x i8] c"Please enter the initial size of the green crud: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [56 x i8] c"I'm sorry that value is unrecognizable or is negative.\0A\00"
@.str.3 = [34 x i8] c"Please enter the number of days: \00"
@.str.4 = [71 x i8] c"With an initial population of %d pounds of crud growing for %d day/s.\0A\00"
@.str.5 = [43 x i8] c"The final population would be %d pound/s.\0A\00"
@.str.6 = [35 x i8] c"Would you like to continue? (y/n) \00"
@.str.7 = [4 x i8] c" %c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %12
12: ; preds = %73, %2
br label %13
13: ; preds = %26, %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
store i32 %15, i32* %7
%16 = load i32, i32* %8
%17 = icmp sle i32 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %13
%19 = load i32, i32* %7
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %18, %13
%22 = call i32 (...) @clrKeyboardBuffer()
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
br label %24
24: ; preds = %21, %18
%25 = load i32, i32* %8
store i32 %25, i32* %11
br label %26
26: ; preds = %24
%27 = load i32, i32* %8
%28 = icmp sle i32 %27, 0
br i1 %28, label %13, label %29
29: ; preds = %26
br label %30
30: ; preds = %54, %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%32 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
store i32 %32, i32* %7
%33 = load i32, i32* %9
%34 = icmp slt i32 %33, 0
br i1 %34, label %38, label %35
35: ; preds = %30
%36 = load i32, i32* %7
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %35, %30
%39 = call i32 (...) @clrKeyboardBuffer()
store i32 -1, i32* %9
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
br label %53
41: ; preds = %35
%42 = load i32, i32* %9
%43 = srem i32 %42, 5
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %52
45: ; preds = %41
%46 = load i32, i32* %9
%47 = sdiv i32 %46, 5
store i32 %47, i32* %10
%48 = load i32, i32* %10
%49 = call i32 @fibo(i32 %48)
%50 = load i32, i32* %11
%51 = mul nsw i32 %50, %49
store i32 %51, i32* %11
br label %52
52: ; preds = %45, %41
br label %53
53: ; preds = %52, %38
br label %54
54: ; preds = %53
%55 = load i32, i32* %9
%56 = icmp slt i32 %55, 0
br i1 %56, label %30, label %57
57: ; preds = %54
%58 = load i32, i32* %8
%59 = load i32, i32* %9
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.4, i64 0, i64 0), i32 %58, i32 %59)
%61 = load i32, i32* %11
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i32 %61)
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0))
%64 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %6)
br label %65
65: ; preds = %57
%66 = load i8, i8* %6
%67 = sext i8 %66 to i32
%68 = icmp eq i32 %67, 121
br i1 %68, label %73, label %69
69: ; preds = %65
%70 = load i8, i8* %6
%71 = sext i8 %70 to i32
%72 = icmp eq i32 %71, 89
br label %73
73: ; preds = %69, %65
%74 = phi i1 [ true, %65 ], [ %72, %69 ]
br i1 %74, label %12, label %75
75: ; preds = %73
ret i32 0
}

LLVM IR (-O2):
@.str = [50 x i8] c"Please enter the initial size of the green crud: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [34 x i8] c"Please enter the number of days: \00"
@.str.4 = [71 x i8] c"With an initial population of %d pounds of crud growing for %d day/s.\0A\00"
@.str.5 = [43 x i8] c"The final population would be %d pound/s.\0A\00"
@.str.6 = [35 x i8] c"Would you like to continue? (y/n) \00"
@.str.7 = [4 x i8] c" %c\00"
@str.8 = [55 x i8] c"I'm sorry that value is unrecognizable or is negative.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
%7 = bitcast i32* %5 to i8*
br label %8
8: ; preds = %20, %2
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 1
%13 = icmp eq i32 %10, 0
%14 = or i1 %13, %12
br i1 %14, label %15, label %21
15: ; preds = %8
%16 = call i32 (...) @clrKeyboardBuffer()
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.8, i64 0, i64 0))
%18 = load i32, i32* %4
%19 = icmp slt i32 %18, 1
br i1 %19, label %20, label %21
20: ; preds = %15, %45
br label %8
21: ; preds = %8, %15
%22 = phi i32 [ %11, %8 ], [ %18, %15 ]
br label %23
23: ; preds = %21, %41
%24 = phi i32 [ %42, %41 ], [ %22, %21 ]
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%27 = load i32, i32* %5
%28 = icmp slt i32 %27, 0
%29 = icmp eq i32 %26, 0
%30 = or i1 %29, %28
br i1 %30, label %31, label %34
31: ; preds = %23
%32 = call i32 (...) @clrKeyboardBuffer()
store i32 -1, i32* %5
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.8, i64 0, i64 0))
br label %41
34: ; preds = %23
%35 = urem i32 %27, 5
%36 = udiv i32 %27, 5
%37 = icmp eq i32 %35, 0
br i1 %37, label %38, label %41
38: ; preds = %34
%39 = call i32 @fibo(i32 %36)
%40 = mul nsw i32 %39, %24
br label %41
41: ; preds = %31, %38, %34
%42 = phi i32 [ %24, %31 ], [ %40, %38 ], [ %24, %34 ]
%43 = load i32, i32* %5
%44 = icmp slt i32 %43, 0
br i1 %44, label %23, label %45
45: ; preds = %41
%46 = load i32, i32* %4
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str.4, i64 0, i64 0), i32 %46, i32 %43)
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i32 %42)
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0))
%50 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %3)
%51 = load i8, i8* %3
%52 = and i8 %51, -33
%53 = icmp eq i8 %52, 89
br i1 %53, label %20, label %54
54: ; preds = %45
ret i32 0
}