#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 *, int, float, float);
int main() {
  float investmentDaphne = 0.0, investmentDeirdre = 0.0;
  float balanceDaphne = 100.0, balanceDeirdre = 100.0;
  const float rateDaphne = 0.10, rateDeirdre = 0.05;
  int year;
  while (investmentDeirdre <= investmentDaphne) {
    investmentDaphne += balanceDaphne * rateDaphne;
    investmentDeirdre += balanceDeirdre * rateDeirdre;
    balanceDeirdre += rateDeirdre * balanceDeirdre;
    year++;
  }
  printf("It took %d years for investment of Deirdre %.2f to exceed the "
         "investment of Daphne %.2f .",
         year, investmentDeirdre, investmentDaphne);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xed1(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xec4(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xeb3(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xea2(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     11e1 <main+0xd1>
movss  -0x10(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xe7c(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xe59(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
movss  0xe3a(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1163 <main+0x53>
mov    -0x20(%rbp),%esi
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    0xe17(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movaps 0xee8(%rip),%xmm0
xorps  %xmm1,%xmm1
movss  0xefd(%rip),%xmm2
movaps 0xee6(%rip),%xmm3
nopw   0x0(%rax,%rax,1)
movaps %xmm0,%xmm4
addss  %xmm2,%xmm1
shufps $0x55,%xmm0,%xmm0
mulps  %xmm3,%xmm0
addps  %xmm4,%xmm0
add    $0x1,%esi
ucomiss %xmm0,%xmm1
jae    1130 <main+0x20>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [90 x i8] c"It took %d years for investment of Deirdre %.2f to exceed the investment of Daphne %.2f .\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca i32
store i32 0, i32* %1
store float 0.000000e+00, float* %2
store float 0.000000e+00, float* %3
store float 1.000000e+02, float* %4
store float 1.000000e+02, float* %5
store float 0x3FB99999A0000000, float* %6
store float 0x3FA99999A0000000, float* %7
br label %9
9: ; preds = %13, %0
%10 = load float, float* %3
%11 = load float, float* %2
%12 = fcmp ole float %10, %11
br i1 %12, label %13, label %25
13: ; preds = %9
%14 = load float, float* %4
%15 = load float, float* %2
%16 = call float @llvm.fmuladd.f32(float %14, float 0x3FB99999A0000000, float %15)
store float %16, float* %2
%17 = load float, float* %5
%18 = load float, float* %3
%19 = call float @llvm.fmuladd.f32(float %17, float 0x3FA99999A0000000, float %18)
store float %19, float* %3
%20 = load float, float* %5
%21 = load float, float* %5
%22 = call float @llvm.fmuladd.f32(float 0x3FA99999A0000000, float %20, float %21)
store float %22, float* %5
%23 = load i32, i32* %8
%24 = add nsw i32 %23, 1
store i32 %24, i32* %8
br label %9
25: ; preds = %9
%26 = load i32, i32* %8
%27 = load float, float* %3
%28 = load float, float* %2
%29 = call i32 @printf(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str, i64 0, i64 0), i32 %26, float %27, float %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [90 x i8] c"It took %d years for investment of Deirdre %.2f to exceed the investment of Daphne %.2f .\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ undef, %0 ], [ %8, %1 ]
%3 = phi float [ 0.000000e+00, %0 ], [ %5, %1 ]
%4 = phi <2 x float> [ <float 0.000000e+00, float 1.000000e+02>, %0 ], [ %7, %1 ]
%5 = fadd float %3, 1.000000e+01
%6 = shufflevector <2 x float> %4, <2 x float> undef, <2 x i32> <i32 1, i32 1>
%7 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %6, <2 x float> <float 0x3FA99999A0000000, float 0x3FA99999A0000000>, <2 x float> %4)
%8 = add nsw i32 %2, 1
%9 = extractelement <2 x float> %7, i64 0
%10 = fcmp ugt float %9, %5
br i1 %10, label %11, label %1
11: ; preds = %1
%12 = extractelement <2 x float> %7, i64 0
%13 = tail call i32 @printf(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str, i64 0, i64 0), i32 %8, float %12, float %5)
ret i32 0
}