#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 */
double pow(double, double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
main() {
  int y = 1;
  double c, h = 5.272, r, x, amnt;
  c = pow(2.71828, -0.693);
  printf("Please enter the initial amount of the isotope\n");
  scanf("%lf", &amnt);
  while (y <= 5) {
    r = amnt + pow(c, (double)y / h);
    printf("Year:     Amount:\n");
    printf("%d        %f\n", y, r);
    y += 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xea5(%rip),%xmm0
movsd  0xea5(%rip),%xmm1
call   1050 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x5,-0x8(%rbp)
jg     11f6 <main+0xc6>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
movsd  -0x20(%rbp),%xmm0
lea    0xe7e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    118b <main+0x5b>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1050 <scanf@plt>
movsd  0x10(%rsp),%xmm0
addsd  0xe9e(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0xefa(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xeae(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
addsd  0xe67(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    $0x2,%esi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
addsd  0xe3e(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    $0x3,%esi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
addsd  0xe15(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    $0x4,%esi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
addsd  0xdec(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    $0x5,%esi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [48 x i8] c"Please enter the initial amount of the isotope\0A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [19 x i8] c"Year: Amount:\0A\00"
@.str.3 = [14 x i8] c"%d %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store i32 0, i32* %1
store i32 1, i32* %2
store double 5.272000e+00, double* %4
%8 = call double @pow(double 2.718280e+00, double -6.930000e-01)
store double %8, double* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %7)
br label %11
11: ; preds = %14, %0
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 5
br i1 %13, label %14, label %29
14: ; preds = %11
%15 = load double, double* %7
%16 = load double, double* %3
%17 = load i32, i32* %2
%18 = sitofp i32 %17 to double
%19 = load double, double* %4
%20 = fdiv double %18, %19
%21 = call double @pow(double %16, double %20)
%22 = fadd double %15, %21
store double %22, double* %5
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%24 = load i32, i32* %2
%25 = load double, double* %5
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %24, double %25)
%27 = load i32, i32* %2
%28 = add nsw i32 %27, 1
store i32 %28, i32* %2
br label %11
29: ; preds = %11
%30 = load i32, i32* %1
ret i32 %30
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%lf\00"
@.str.3 = [14 x i8] c"%d %f\0A\00"
@str = [47 x i8] c"Please enter the initial amount of the isotope\00"
@str.4 = [18 x i8] c"Year: Amount:\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 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 = fadd double %5, 0x3FEC0EF10C056137
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.4, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 1, double %6)
%9 = load double, double* %1
%10 = fadd double %9, 0x3FE89A2CCF0BABEA
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 2, double %10)
%13 = load double, double* %1
%14 = fadd double %13, 0x3FE59263FB24367A
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.4, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 3, double %14)
%17 = load double, double* %1
%18 = fadd double %17, 0x3FE2EA2A061910D2
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.4, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 4, double %18)
%21 = load double, double* %1
%22 = fadd double %21, 0x3FE095B9B260156A
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.4, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 5, double %22)
ret i32 0
}