#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() {
  int current_year;
  int current_pop;
  float birth_rate;
  float death_rate;
  float migration_rate;
  int current_birth;
  int current_death;
  int current_migration;
  char userChoice;
  printf("\nToday we are going to simulate population growth for a fictional "
         "country!");
  printf("\nTo begin, please enter the current year:");
  scanf("%d", &current_year);
  printf("\nNow, please enter the current population:");
  scanf("%d", &current_pop);
  printf("\nNow, please enter the birth rate:");
  scanf("%f", &birth_rate);
  printf("\nNow, please enter the death rate:");
  scanf("%f", &death_rate);
  printf("\nPlease enter the net migration rate:");
  scanf("%f", &migration_rate);
  for (int year = 0; year < 100; year++) {
    current_year += 1;
    current_birth = current_pop * birth_rate;
    current_death = current_pop * death_rate;
    current_migration = current_pop * migration_rate;
    current_pop += current_birth;
    current_pop -= current_death;
    current_pop += current_migration;
    printf("\n\n In the year %d, your country had the following demographics:",
           current_year);
    printf("\nTotal Population: %d", current_pop);
    printf("\nLive Births in the Past Year: %d", current_birth);
    printf("\nDeaths in the Past Year: %d", current_death);
    printf("\nMigration over the Past Year: %d", current_migration);
    printf("\n\nDo you want to continue to next year? Select 'Y' or 'y' to "
           "continue:");
    scanf(" %c", &userChoice);
    if (userChoice == 'y' || userChoice == 'Y') {
      continue;
      printf("\n\nTHIS IS A TEST");
    } else {
      break;
    }
    printf("I will never be executed!! MUAHAHAHAHA!!");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1010(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xf11(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xff0(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xf1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf31(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xf22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf11(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xf25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x64,-0x2c(%rbp)
jge    12ee <main+0x1ce>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x1c(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x20(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x24(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xeed(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xf03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xf0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf23(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf5c(%rip),%rdi
lea    -0x25(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl -0x25(%rbp),%eax
cmp    $0x79,%eax
je     12d6 <main+0x1b6>
movsbl -0x25(%rbp),%eax
cmp    $0x59,%eax
jne    12db <main+0x1bb>
jmp    12e0 <main+0x1c0>
jmp    12ee <main+0x1ce>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11e4 <main+0xc4>
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    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf08(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x1011(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xf0e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xf1c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf31(%rip),%rbx
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xf1e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xf24(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    $0x63,%ebp
lea    0x1026(%rip),%r14
lea    0x3(%rsp),%r15
nopl   0x0(%rax)
mov    0x8(%rsp),%esi
add    $0x1,%esi
mov    %esi,0x8(%rsp)
mov    0x4(%rsp),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  0x14(%rsp),%xmm1
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%ebx
movss  0x10(%rsp),%xmm1
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%r13d
mulss  0xc(%rsp),%xmm0
cvttss2si %xmm0,%r12d
add    %ebx,%eax
sub    %r13d,%eax
add    %r12d,%eax
mov    %eax,0x4(%rsp)
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xefc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf04(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf16(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf22(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf33(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movzbl 0x3(%rsp),%ecx
and    $0xdf,%cl
sub    $0x1,%ebp
setb   %al
cmp    $0x59,%cl
jne    12c2 <main+0x1a2>
test   %al,%al
je     11f0 <main+0xd0>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [75 x i8] c"\0AToday we are going to simulate population growth for a fictional country!\00"
@.str.1 = [42 x i8] c"\0ATo begin, please enter the current year:\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [43 x i8] c"\0ANow, please enter the current population:\00"
@.str.4 = [35 x i8] c"\0ANow, please enter the birth rate:\00"
@.str.5 = [3 x i8] c"%f\00"
@.str.6 = [35 x i8] c"\0ANow, please enter the death rate:\00"
@.str.7 = [38 x i8] c"\0APlease enter the net migration rate:\00"
@.str.8 = [64 x i8] c"\0A\0A In the year %d, your country had the following demographics:\00"
@.str.9 = [22 x i8] c"\0ATotal Population: %d\00"
@.str.10 = [34 x i8] c"\0ALive Births in the Past Year: %d\00"
@.str.11 = [29 x i8] c"\0ADeaths in the Past Year: %d\00"
@.str.12 = [34 x i8] c"\0AMigration over the Past Year: %d\00"
@.str.13 = [71 x i8] c"\0A\0ADo you want to continue to next year? Select 'Y' or 'y' to continue:\00"
@.str.14 = [4 x i8] c" %c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
%11 = alloca i32
store i32 0, i32* %1
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %4)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %5)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %6)
store i32 0, i32* %11
br label %23
23: ; preds = %74, %0
%24 = load i32, i32* %11
%25 = icmp slt i32 %24, 100
br i1 %25, label %26, label %77
26: ; preds = %23
%27 = load i32, i32* %2
%28 = add nsw i32 %27, 1
store i32 %28, i32* %2
%29 = load i32, i32* %3
%30 = sitofp i32 %29 to float
%31 = load float, float* %4
%32 = fmul float %30, %31
%33 = fptosi float %32 to i32
store i32 %33, i32* %7
%34 = load i32, i32* %3
%35 = sitofp i32 %34 to float
%36 = load float, float* %5
%37 = fmul float %35, %36
%38 = fptosi float %37 to i32
store i32 %38, i32* %8
%39 = load i32, i32* %3
%40 = sitofp i32 %39 to float
%41 = load float, float* %6
%42 = fmul float %40, %41
%43 = fptosi float %42 to i32
store i32 %43, i32* %9
%44 = load i32, i32* %7
%45 = load i32, i32* %3
%46 = add nsw i32 %45, %44
store i32 %46, i32* %3
%47 = load i32, i32* %8
%48 = load i32, i32* %3
%49 = sub nsw i32 %48, %47
store i32 %49, i32* %3
%50 = load i32, i32* %9
%51 = load i32, i32* %3
%52 = add nsw i32 %51, %50
store i32 %52, i32* %3
%53 = load i32, i32* %2
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.8, i64 0, i64 0), i32 %53)
%55 = load i32, i32* %3
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), i32 %55)
%57 = load i32, i32* %7
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.10, i64 0, i64 0), i32 %57)
%59 = load i32, i32* %8
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i32 %59)
%61 = load i32, i32* %9
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.12, i64 0, i64 0), i32 %61)
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.13, i64 0, i64 0))
%64 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i8* %10)
%65 = load i8, i8* %10
%66 = sext i8 %65 to i32
%67 = icmp eq i32 %66, 121
br i1 %67, label %72, label %68
68: ; preds = %26
%69 = load i8, i8* %10
%70 = sext i8 %69 to i32
%71 = icmp eq i32 %70, 89
br i1 %71, label %72, label %73
72: ; preds = %68, %26
br label %74
73: ; preds = %68
br label %77
74: ; preds = %72
%75 = load i32, i32* %11
%76 = add nsw i32 %75, 1
store i32 %76, i32* %11
br label %23
77: ; preds = %73, %23
ret i32 0
}

LLVM IR (-O2):
@.str = [75 x i8] c"\0AToday we are going to simulate population growth for a fictional country!\00"
@.str.1 = [42 x i8] c"\0ATo begin, please enter the current year:\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [43 x i8] c"\0ANow, please enter the current population:\00"
@.str.4 = [35 x i8] c"\0ANow, please enter the birth rate:\00"
@.str.5 = [3 x i8] c"%f\00"
@.str.6 = [35 x i8] c"\0ANow, please enter the death rate:\00"
@.str.7 = [38 x i8] c"\0APlease enter the net migration rate:\00"
@.str.8 = [64 x i8] c"\0A\0A In the year %d, your country had the following demographics:\00"
@.str.9 = [22 x i8] c"\0ATotal Population: %d\00"
@.str.10 = [34 x i8] c"\0ALive Births in the Past Year: %d\00"
@.str.11 = [29 x i8] c"\0ADeaths in the Past Year: %d\00"
@.str.12 = [34 x i8] c"\0AMigration over the Past Year: %d\00"
@.str.13 = [71 x i8] c"\0A\0ADo you want to continue to next year? Select 'Y' or 'y' to continue:\00"
@.str.14 = [4 x i8] c" %c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca i8
%7 = bitcast i32* %1 to i8*
%8 = bitcast i32* %2 to i8*
%9 = bitcast float* %3 to i8*
%10 = bitcast float* %4 to i8*
%11 = bitcast float* %5 to i8*
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %3)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %4)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %5)
br label %23
23: ; preds = %23, %0
%24 = phi i32 [ 0, %0 ], [ %52, %23 ]
%25 = load i32, i32* %1
%26 = add nsw i32 %25, 1
store i32 %26, i32* %1
%27 = load i32, i32* %2
%28 = sitofp i32 %27 to float
%29 = load float, float* %3
%30 = fmul float %29, %28
%31 = fptosi float %30 to i32
%32 = load float, float* %4
%33 = fmul float %32, %28
%34 = fptosi float %33 to i32
%35 = load float, float* %5
%36 = fmul float %35, %28
%37 = fptosi float %36 to i32
%38 = add nsw i32 %27, %31
%39 = sub i32 %38, %34
%40 = add nsw i32 %39, %37
store i32 %40, i32* %2
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.8, i64 0, i64 0), i32 %26)
%42 = load i32, i32* %2
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), i32 %42)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.10, i64 0, i64 0), i32 %31)
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i32 %34)
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.12, i64 0, i64 0), i32 %37)
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str.13, i64 0, i64 0))
%48 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i8* %6)
%49 = load i8, i8* %6
%50 = and i8 %49, -33
%51 = icmp ne i8 %50, 89
%52 = add nuw nsw i32 %24, 1
%53 = icmp eq i32 %52, 100
%54 = select i1 %51, i1 true, i1 %53
br i1 %54, label %55, label %23
55: ; preds = %23
ret i32 0
}