#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 *, unsigned int, double, ...);
int main(void) {
  double population = 70000;
  double birth_rate = 0.010;
  double death_rate = 0.015;
  unsigned int year = 2014;
  double orig_pop = population;
  printf("population in %d is %.0f\n", year, population);
  for (; year < 2114; year++) {
    population += population * birth_rate - population * death_rate;
  }
  printf("population in %d is %.0f (%.2f%% with %.2f%% delta)\n", year,
         population, (population - orig_pop) / orig_pop * 100,
         (birth_rate - death_rate) * 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed4(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xebf(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x7de,-0x24(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x24(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
lea    0xeba(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
cmpl   $0x842,-0x24(%rbp)
jae    11c5 <main+0xb5>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    116d <main+0x5d>
mov    -0x24(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  -0x30(%rbp),%xmm1
divsd  -0x30(%rbp),%xmm1
movsd  0xe34(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  -0x18(%rbp),%xmm2
subsd  -0x20(%rbp),%xmm2
movsd  0xe1e(%rip),%xmm3
mulsd  %xmm3,%xmm2
lea    0xe35(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf18(%rip),%rdi
movsd  0xee0(%rip),%xmm0
mov    $0x7de,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xecc(%rip),%xmm0
mov    $0x64,%eax
movsd  0xec7(%rip),%xmm5
movsd  0xec7(%rip),%xmm1
nopl   0x0(%rax)
movapd %xmm0,%xmm2
mulsd  %xmm5,%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
addsd  %xmm0,%xmm3
movapd %xmm3,%xmm2
mulsd  %xmm5,%xmm2
movapd %xmm3,%xmm4
mulsd  %xmm1,%xmm4
addsd  %xmm2,%xmm4
addsd  %xmm3,%xmm4
movapd %xmm4,%xmm2
mulsd  %xmm5,%xmm2
movapd %xmm4,%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
addsd  %xmm4,%xmm3
movapd %xmm3,%xmm2
mulsd  %xmm5,%xmm2
movapd %xmm3,%xmm4
mulsd  %xmm1,%xmm4
addsd  %xmm2,%xmm4
addsd  %xmm3,%xmm4
movapd %xmm4,%xmm2
mulsd  %xmm5,%xmm2
movapd %xmm4,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm4,%xmm0
add    $0xfffffffb,%eax
jne    1150 <main+0x40>
movsd  0xe43(%rip),%xmm1
addsd  %xmm0,%xmm1
divsd  0xe1f(%rip),%xmm1
mulsd  0xe37(%rip),%xmm1
lea    0xe5a(%rip),%rdi
movsd  0xe30(%rip),%xmm2
mov    $0x842,%esi
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"population in %d is %.0f\0A\00"
@.str.1 = [53 x i8] c"population in %d is %.0f (%.2f%% with %.2f%% delta)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca double
store i32 0, i32* %1
store double 7.000000e+04, double* %2
store double 1.000000e-02, double* %3
store double 1.500000e-02, double* %4
store i32 2014, i32* %5
%7 = load double, double* %2
store double %7, double* %6
%8 = load i32, i32* %5
%9 = load double, double* %2
%10 = call i32 (i8*, i32, double, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %8, double %9)
br label %11
11: ; preds = %24, %0
%12 = load i32, i32* %5
%13 = icmp ult i32 %12, 2114
br i1 %13, label %14, label %27
14: ; preds = %11
%15 = load double, double* %2
%16 = load double, double* %3
%17 = load double, double* %2
%18 = load double, double* %4
%19 = fmul double %17, %18
%20 = fneg double %19
%21 = call double @llvm.fmuladd.f64(double %15, double %16, double %20)
%22 = load double, double* %2
%23 = fadd double %22, %21
store double %23, double* %2
br label %24
24: ; preds = %14
%25 = load i32, i32* %5
%26 = add i32 %25, 1
store i32 %26, i32* %5
br label %11
27: ; preds = %11
%28 = load i32, i32* %5
%29 = load double, double* %2
%30 = load double, double* %2
%31 = load double, double* %6
%32 = fsub double %30, %31
%33 = load double, double* %6
%34 = fdiv double %32, %33
%35 = fmul double %34, 1.000000e+02
%36 = load double, double* %3
%37 = load double, double* %4
%38 = fsub double %36, %37
%39 = fmul double %38, 1.000000e+02
%40 = call i32 (i8*, i32, double, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i32 %28, double %29, double %35, double %39)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"population in %d is %.0f\0A\00"
@.str.1 = [53 x i8] c"population in %d is %.0f (%.2f%% with %.2f%% delta)\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, double, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 2014, double 7.000000e+04)
br label %2
2: ; preds = %2, %0
%3 = phi double [ 7.000000e+04, %0 ], [ %19, %2 ]
%4 = phi i32 [ 2014, %0 ], [ %20, %2 ]
%5 = fmul double %3, -1.500000e-02
%6 = tail call double @llvm.fmuladd.f64(double %3, double 1.000000e-02, double %5)
%7 = fadd double %3, %6
%8 = fmul double %7, -1.500000e-02
%9 = tail call double @llvm.fmuladd.f64(double %7, double 1.000000e-02, double %8)
%10 = fadd double %7, %9
%11 = fmul double %10, -1.500000e-02
%12 = tail call double @llvm.fmuladd.f64(double %10, double 1.000000e-02, double %11)
%13 = fadd double %10, %12
%14 = fmul double %13, -1.500000e-02
%15 = tail call double @llvm.fmuladd.f64(double %13, double 1.000000e-02, double %14)
%16 = fadd double %13, %15
%17 = fmul double %16, -1.500000e-02
%18 = tail call double @llvm.fmuladd.f64(double %16, double 1.000000e-02, double %17)
%19 = fadd double %16, %18
%20 = add nuw nsw i32 %4, 5
%21 = icmp eq i32 %20, 2114
br i1 %21, label %22, label %2
22: ; preds = %2
%23 = fadd double %19, -7.000000e+04
%24 = fdiv double %23, 7.000000e+04
%25 = fmul double %24, 1.000000e+02
%26 = tail call i32 (i8*, i32, double, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i32 2114, double %19, double %25, double 0xBFDFFFFFFFFFFFFF)
ret i32 0
}