#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, double, double);
int main(void) {
  double daphne = 100, deirdre = 100;
  int i = 0;
  while (deirdre <= daphne) {
    i++;
    daphne += 100 * 0.1;
    deirdre *= 1.05;
  }
  printf("%d years\nDaphne: $%.2f\nDeirdre: $%.2f\n", i, daphne, deirdre);
  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>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movsd  0xeab(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe91(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1140 <main+0x30>
mov    -0x1c(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm1
xor    %esi,%esi
movsd  0xee5(%rip),%xmm2
movsd  0xee5(%rip),%xmm3
movapd %xmm1,%xmm0
nop
add    $0x1,%esi
addsd  %xmm2,%xmm0
mulsd  %xmm3,%xmm1
ucomisd %xmm1,%xmm0
jae    1130 <main+0x20>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"%d years\0ADaphne: $%.2f\0ADeirdre: $%.2f\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 i32, i32* %4
%11 = add nsw i32 %10, 1
store i32 %11, i32* %4
%12 = load double, double* %2
%13 = fadd double %12, 1.000000e+01
store double %13, double* %2
%14 = load double, double* %3
%15 = fmul double %14, 1.050000e+00
store double %15, double* %3
br label %5
16: ; preds = %5
%17 = load i32, i32* %4
%18 = load double, double* %2
%19 = load double, double* %3
%20 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %17, double %18, double %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"%d years\0ADaphne: $%.2f\0ADeirdre: $%.2f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = phi double [ 1.000000e+02, %0 ], [ %7, %1 ]
%4 = phi double [ 1.000000e+02, %0 ], [ %6, %1 ]
%5 = add nuw nsw i32 %2, 1
%6 = fadd double %4, 1.000000e+01
%7 = fmul double %3, 1.050000e+00
%8 = fcmp ugt double %7, %6
br i1 %8, label %9, label %1
9: ; preds = %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %5, double %6, double %7)
ret i32 0
}