#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 */
scalar_t__ floor(double);
int /*<<< orphan*/ printf(char *, int, double, double, double, double);
int /*<<< orphan*/ scanf(char *, double *, double *, double *);
int main() {
  double p, r, t;
  int i = 0, j = 0;
  double ans;
  while (1) {
    scanf("%lf%lf%lf", &p, &r, &t);
    if (p == 0 && r == 0 && t == 0)
      break;
    j++;
    ans = p;
    for (i = 0; i < t; i++) {
      ans += ((int)floor(ans * r / t)) / 100.0;
    }
    printf(
        "Case %d. $%.2lf at %.2lf%% APR compounded %.0lf times yields $%.2lf\n",
        j, p, r, t, ans);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
lea    0xeb4(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11b2 <main+0x82>
jp     11b2 <main+0x82>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11b2 <main+0x82>
jp     11b2 <main+0x82>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11b2 <main+0x82>
jp     11b2 <main+0x82>
jmp    1244 <main+0x114>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x24(%rbp)
cvtsi2sdl -0x24(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    121c <main+0xec>
movsd  -0x30(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
call   1050 <floor@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe00(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11cc <main+0x9c>
mov    -0x28(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
lea    0xdd8(%rip),%rdi
call   1030 <printf@plt>
jmp    114d <main+0x1d>
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    $0x28,%rsp
lea    0xec3(%rip),%rdi
lea    0x18(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1040 <scanf@plt>
movsd  0x18(%rsp),%xmm3
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm3
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
jne    118f <main+0x5f>
jp     118f <main+0x5f>
ucomisd %xmm4,%xmm1
jne    118f <main+0x5f>
jp     118f <main+0x5f>
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jne    118f <main+0x5f>
jnp    12ab <main+0x17b>
xor    %r13d,%r13d
lea    0xe79(%rip),%r14
lea    0xe68(%rip),%r12
lea    0x18(%rsp),%r15
lea    0x8(%rsp),%rbp
lea    0x10(%rsp),%rbx
nop
add    $0x1,%r13d
ucomisd %xmm4,%xmm2
jbe    1220 <main+0xf0>
mov    %r14,%rbp
mov    $0x1,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  %xmm3,0x20(%rsp)
mulsd  %xmm3,%xmm1
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
call   1050 <floor@plt>
xorps  %xmm3,%xmm3
cvtsi2sd %eax,%xmm3
divsd  0xe0a(%rip),%xmm3
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
addsd  0x20(%rsp),%xmm3
movsd  0x10(%rsp),%xmm2
ucomisd %xmm0,%xmm2
jbe    1230 <main+0x100>
movsd  0x8(%rsp),%xmm1
add    $0x1,%r14d
jmp    11d0 <main+0xa0>
nopl   0x0(%rax)
movapd %xmm3,%xmm0
jmp    1249 <main+0x119>
cs nopw 0x0(%rax,%rax,1)
movsd  0x18(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    %rbp,%r14
lea    0x8(%rsp),%rbp
lea    0x10(%rsp),%rbx
mov    %r14,%rdi
mov    %r13d,%esi
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
mov    %rbx,%rcx
call   1040 <scanf@plt>
movsd  0x18(%rsp),%xmm3
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm3
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
jne    11b0 <main+0x80>
jp     11b0 <main+0x80>
ucomisd %xmm4,%xmm1
jne    11b0 <main+0x80>
jp     11b0 <main+0x80>
ucomisd %xmm4,%xmm2
jne    11b0 <main+0x80>
jp     11b0 <main+0x80>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%lf%lf%lf\00"
@.str.1 = [69 x i8] c"Case %d. $%.2lf at %.2lf%% APR compounded %.0lf times yields $%.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
store i32 0, i32* %1
store i32 0, i32* %5
store i32 0, i32* %6
br label %8
8: ; preds = %0, %43
%9 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double* %2, double* %3, double* %4)
%10 = load double, double* %2
%11 = fcmp oeq double %10, 0.000000e+00
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = load double, double* %3
%14 = fcmp oeq double %13, 0.000000e+00
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load double, double* %4
%17 = fcmp oeq double %16, 0.000000e+00
br i1 %17, label %18, label %19
18: ; preds = %15
br label %50
19: ; preds = %15, %12, %8
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
%22 = load double, double* %2
store double %22, double* %7
store i32 0, i32* %5
br label %23
23: ; preds = %40, %19
%24 = load i32, i32* %5
%25 = sitofp i32 %24 to double
%26 = load double, double* %4
%27 = fcmp olt double %25, %26
br i1 %27, label %28, label %43
28: ; preds = %23
%29 = load double, double* %7
%30 = load double, double* %3
%31 = fmul double %29, %30
%32 = load double, double* %4
%33 = fdiv double %31, %32
%34 = call i64 @floor(double %33)
%35 = trunc i64 %34 to i32
%36 = sitofp i32 %35 to double
%37 = fdiv double %36, 1.000000e+02
%38 = load double, double* %7
%39 = fadd double %38, %37
store double %39, double* %7
br label %40
40: ; preds = %28
%41 = load i32, i32* %5
%42 = add nsw i32 %41, 1
store i32 %42, i32* %5
br label %23
43: ; preds = %23
%44 = load i32, i32* %6
%45 = load double, double* %2
%46 = load double, double* %3
%47 = load double, double* %4
%48 = load double, double* %7
%49 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0), i32 %44, double %45, double %46, double %47, double %48)
br label %8
50: ; preds = %18
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%lf%lf%lf\00"
@.str.1 = [69 x i8] c"Case %d. $%.2lf at %.2lf%% APR compounded %.0lf times yields $%.2lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, double* %3)
%8 = load double, double* %1
%9 = fcmp oeq double %8, 0.000000e+00
%10 = load double, double* %2
%11 = fcmp oeq double %10, 0.000000e+00
%12 = select i1 %9, i1 %11, i1 false
%13 = load double, double* %3
%14 = fcmp oeq double %13, 0.000000e+00
%15 = select i1 %12, i1 %14, i1 false
br i1 %15, label %59, label %16
16: ; preds = %0, %44
%17 = phi double [ %53, %44 ], [ %10, %0 ]
%18 = phi double [ %56, %44 ], [ %13, %0 ]
%19 = phi double [ %51, %44 ], [ %8, %0 ]
%20 = phi i32 [ %21, %44 ], [ 0, %0 ]
%21 = add nuw nsw i32 %20, 1
%22 = fcmp ogt double %18, 0.000000e+00
br i1 %22, label %23, label %44
23: ; preds = %16, %39
%24 = phi double [ %40, %39 ], [ %17, %16 ]
%25 = phi double [ %37, %39 ], [ %18, %16 ]
%26 = phi double [ %34, %39 ], [ %19, %16 ]
%27 = phi i32 [ %35, %39 ], [ 0, %16 ]
%28 = fmul double %26, %24
%29 = fdiv double %28, %25
%30 = call i64 @floor(double %29)
%31 = trunc i64 %30 to i32
%32 = sitofp i32 %31 to double
%33 = fdiv double %32, 1.000000e+02
%34 = fadd double %26, %33
%35 = add nuw nsw i32 %27, 1
%36 = sitofp i32 %35 to double
%37 = load double, double* %3
%38 = fcmp ogt double %37, %36
br i1 %38, label %39, label %41
39: ; preds = %23
%40 = load double, double* %2
br label %23
41: ; preds = %23
%42 = load double, double* %1
%43 = load double, double* %2
br label %44
44: ; preds = %41, %16
%45 = phi double [ %17, %16 ], [ %43, %41 ]
%46 = phi double [ %19, %16 ], [ %42, %41 ]
%47 = phi double [ %19, %16 ], [ %34, %41 ]
%48 = phi double [ %18, %16 ], [ %37, %41 ]
%49 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0), i32 %21, double %46, double %45, double %48, double %47)
%50 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, double* %3)
%51 = load double, double* %1
%52 = fcmp oeq double %51, 0.000000e+00
%53 = load double, double* %2
%54 = fcmp oeq double %53, 0.000000e+00
%55 = select i1 %52, i1 %54, i1 false
%56 = load double, double* %3
%57 = fcmp oeq double %56, 0.000000e+00
%58 = select i1 %55, i1 %57, i1 false
br i1 %58, label %59, label %16
59: ; preds = %44, %0
ret i32 0
}