#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;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  int year = 0;
  double pop = 0;
  printf("Please input inhabitants as a non-negative integer: ");
  scanf("%lf", &pop);
  while (pop <= 30000) {
    pop = pop * 1.1;
    printf("%.2f\n", pop);
    year++;
  }
  printf("pop: %.2f, years passed: %d\n", pop, year);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xe9c(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     11a2 <main+0x82>
movsd  0xe91(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xebc(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115c <main+0x3c>
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%esi
lea    0xe9e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e21(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movq   $0x0,(%rsp)
lea    0xedd(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf02(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
movsd  0xea8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     119d <main+0x7d>
xor    %ebx,%ebx
lea    0xee2(%rip),%r14
nopw   0x0(%rax,%rax,1)
mulsd  0xe90(%rip),%xmm0
movsd  %xmm0,(%rsp)
mov    %r14,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xe71(%rip),%xmm1
add    $0x1,%ebx
movsd  (%rsp),%xmm0
ucomisd %xmm0,%xmm1
jae    1170 <main+0x50>
lea    0xeab(%rip),%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e2c(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [53 x i8] c"Please input inhabitants as a non-negative integer: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [6 x i8] c"%.2f\0A\00"
@.str.3 = [29 x i8] c"pop: %.2f, years passed: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 0, i32* %1
store i32 0, i32* %2
store double 0.000000e+00, double* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
br label %6
6: ; preds = %9, %0
%7 = load double, double* %3
%8 = fcmp ole double %7, 3.000000e+04
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load double, double* %3
%11 = fmul double %10, 1.100000e+00
store double %11, double* %3
%12 = load double, double* %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %12)
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %6
16: ; preds = %6
%17 = load double, double* %3
%18 = load i32, i32* %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), double %17, i32 %18)
%20 = load i32, i32* @EXIT_SUCCESS
ret i32 %20
}

LLVM IR (-O2):
@.str = [53 x i8] c"Please input inhabitants as a non-negative integer: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [6 x i8] c"%.2f\0A\00"
@.str.3 = [29 x i8] c"pop: %.2f, years passed: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fcmp ugt double %5, 3.000000e+04
br i1 %6, label %15, label %7
7: ; preds = %0, %7
%8 = phi double [ %13, %7 ], [ %5, %0 ]
%9 = phi i32 [ %12, %7 ], [ 0, %0 ]
%10 = fmul double %8, 1.100000e+00
store double %10, double* %1
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %10)
%12 = add nuw nsw i32 %9, 1
%13 = load double, double* %1
%14 = fcmp ugt double %13, 3.000000e+04
br i1 %14, label %15, label %7
15: ; preds = %7, %0
%16 = phi i32 [ 0, %0 ], [ %12, %7 ]
%17 = phi double [ %5, %0 ], [ %13, %7 ]
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), double %17, i32 %16)
%19 = load i32, i32* @EXIT_SUCCESS
ret i32 %19
}