#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 *, double);
int main(void) {
  double valueDa = 100.0, valueDe = 100.0;
  int count = 0;
  while (valueDe <= valueDa) {
    valueDa += 100.0 * 0.1;
    valueDe *= (1.0 + 0.05);
    count++;
  }
  printf("After %d years, Deirdre's investment will exceed the value of "
         "Daphne's investment.\n",
         count);
  printf("Deirdre's investment: %.2lf\n", valueDe);
  printf("Daphne's investment:  %.2lf\n", valueDa);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1186 <main+0x76>
movsd  0xeb4(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe9a(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1140 <main+0x30>
cvtsi2sdl -0x1c(%rbp),%xmm0
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movsd  0xee4(%rip),%xmm2
xor    %eax,%eax
movsd  0xee2(%rip),%xmm0
movsd  0xee2(%rip),%xmm1
movapd %xmm2,%xmm3
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
addsd  %xmm0,%xmm3
mulsd  %xmm1,%xmm2
add    $0x1,%eax
ucomisd %xmm2,%xmm3
jae    1140 <main+0x30>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
lea    0xeb9(%rip),%rdi
movsd  %xmm2,0x8(%rsp)
movsd  %xmm3,0x10(%rsp)
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
movsd  0x10(%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [84 x i8] c"After %d years, Deirdre's investment will exceed the value of Daphne's investment.\0A\00"
@.str.1 = [29 x i8] c"Deirdre's investment: %.2lf\0A\00"
@.str.2 = [29 x i8] c"Daphne's investment: %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store i32 0, i32* %1
store double 1.000000e+02, double* %2
store double 1.000000e+02, double* %3
store i32 0, i32* %4
br label %5
5: ; preds = %9, %0
%6 = load double, double* %3
%7 = load double, double* %2
%8 = fcmp ole double %6, %7
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load double, double* %2
%11 = fadd double %10, 1.000000e+01
store double %11, double* %2
%12 = load double, double* %3
%13 = fmul double %12, 1.050000e+00
store double %13, double* %3
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %5
16: ; preds = %5
%17 = load i32, i32* %4
%18 = sitofp i32 %17 to double
%19 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), double %18)
%20 = load double, double* %3
%21 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), double %20)
%22 = load double, double* %2
%23 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), double %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [84 x i8] c"After %d years, Deirdre's investment will exceed the value of Daphne's investment.\0A\00"
@.str.1 = [29 x i8] c"Deirdre's investment: %.2lf\0A\00"
@.str.2 = [29 x i8] c"Daphne's investment: %.2lf\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = phi double [ 1.000000e+02, %0 ], [ %6, %1 ]
%4 = phi double [ 1.000000e+02, %0 ], [ %5, %1 ]
%5 = fadd double %4, 1.000000e+01
%6 = fmul double %3, 1.050000e+00
%7 = add nuw nsw i32 %2, 1
%8 = fcmp ugt double %6, %5
br i1 %8, label %9, label %1
9: ; preds = %1
%10 = sitofp i32 %7 to double
%11 = tail call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), double %10)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), double %6)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), double %5)
ret i32 0
}