#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, double, double);
void main() {
  double a = 1, b = 2, c = 1;
  while (1) {
    printf("%f %f %f\n", a, b, c);
    a = (b + c) / (a - b);
    b = (b + c) / (a - b);
    c = (b + c) / (a - b);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec6(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  %xmm1,-0x58(%rbp)
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  %xmm1,-0x40(%rbp)
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  %xmm1,-0x28(%rbp)
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm0,-0x18(%rbp)
jmp    113f <main+0x2f>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movsd  0xee3(%rip),%xmm1
movsd  0xee3(%rip),%xmm4
lea    0xee4(%rip),%rbx
movapd %xmm4,%xmm2
movapd %xmm1,%xmm3
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  %xmm4,0x8(%rsp)
movsd  %xmm3,0x18(%rsp)
movsd  %xmm2,(%rsp)
mov    %rbx,%rdi
movapd %xmm4,%xmm0
movsd  %xmm1,0x10(%rsp)
movsd  (%rsp),%xmm2
call   1030 <printf@plt>
movsd  0x18(%rsp),%xmm3
movsd  (%rsp),%xmm2
addsd  %xmm2,%xmm3
movsd  0x10(%rsp),%xmm5
movsd  0x8(%rsp),%xmm1
subsd  %xmm5,%xmm1
movapd %xmm3,%xmm0
divsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
movapd %xmm0,%xmm4
subsd  %xmm5,%xmm0
divsd  %xmm0,%xmm3
addsd  %xmm3,%xmm2
subsd  %xmm3,%xmm1
divsd  %xmm1,%xmm2
movapd %xmm3,%xmm1
jmp    1140 <main+0x30>

LLVM IR (-O0):
@.str = [10 x i8] c"%f %f %f\0A\00"
define void @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
store double 1.000000e+00, double* %1
store double 2.000000e+00, double* %2
store double 1.000000e+00, double* %3
br label %4
4: ; preds = %0, %4
%5 = load double, double* %1
%6 = load double, double* %2
%7 = load double, double* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %5, double %6, double %7)
%9 = load double, double* %2
%10 = load double, double* %3
%11 = fadd double %9, %10
%12 = load double, double* %1
%13 = load double, double* %2
%14 = fsub double %12, %13
%15 = fdiv double %11, %14
store double %15, double* %1
%16 = load double, double* %2
%17 = load double, double* %3
%18 = fadd double %16, %17
%19 = load double, double* %1
%20 = load double, double* %2
%21 = fsub double %19, %20
%22 = fdiv double %18, %21
store double %22, double* %2
%23 = load double, double* %2
%24 = load double, double* %3
%25 = fadd double %23, %24
%26 = load double, double* %1
%27 = load double, double* %2
%28 = fsub double %26, %27
%29 = fdiv double %25, %28
store double %29, double* %3
br label %4
}

LLVM IR (-O2):
@.str = [10 x i8] c"%f %f %f\0A\00"
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = phi double [ 1.000000e+00, %0 ], [ %8, %1 ]
%3 = phi double [ 2.000000e+00, %0 ], [ %10, %1 ]
%4 = phi double [ 1.000000e+00, %0 ], [ %13, %1 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %2, double %3, double %4)
%6 = fadd double %3, %4
%7 = fsub double %2, %3
%8 = fdiv double %6, %7
%9 = fsub double %8, %3
%10 = fdiv double %6, %9
%11 = fadd double %4, %10
%12 = fsub double %8, %10
%13 = fdiv double %11, %12
br label %1
}