#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 = (a - c) / (b + c);
    c = (a - b) / (a - c);
  }
}


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  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  %xmm1,-0x40(%rbp)
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x18(%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),%xmm2
movsd  0xee3(%rip),%xmm0
lea    0xee4(%rip),%rbx
movapd %xmm0,%xmm3
movsd  %xmm3,0x10(%rsp)
mov    %rbx,%rdi
movsd  %xmm0,0x18(%rsp)
movapd %xmm2,%xmm1
movsd  %xmm2,0x8(%rsp)
movapd %xmm3,%xmm2
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
subsd  %xmm1,%xmm2
movsd  0x10(%rsp),%xmm4
addsd  %xmm4,%xmm1
movapd %xmm1,%xmm0
movapd %xmm1,%xmm3
divsd  %xmm2,%xmm0
movapd %xmm0,%xmm1
subsd  %xmm4,%xmm1
movapd %xmm1,%xmm2
divsd  %xmm3,%xmm2
movapd %xmm0,%xmm3
subsd  %xmm2,%xmm3
divsd  %xmm1,%xmm3
jmp    1130 <main+0x20>

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* %1
%17 = load double, double* %3
%18 = fsub double %16, %17
%19 = load double, double* %2
%20 = load double, double* %3
%21 = fadd double %19, %20
%22 = fdiv double %18, %21
store double %22, double* %2
%23 = load double, double* %1
%24 = load double, double* %2
%25 = fsub double %23, %24
%26 = load double, double* %1
%27 = load double, double* %3
%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 ], [ %12, %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, %4
%10 = fdiv double %9, %6
%11 = fsub double %8, %10
%12 = fdiv double %11, %9
br label %1
}