#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 /*<<< orphan*/ scanf(char *, double *);
int main() {
  double a, l, i, x, d;
  while (1) {
    scanf("%lf", &l);
    if (l == 0)
      break;
    i = l + (l - 3);
    a = i - l;
    if (a == 0) {
      l = 0;
    } else {
      l = a / l;
    }
    printf("%.6lf\n", l);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    115c <main+0x3c>
jp     115c <main+0x3c>
jmp    11d4 <main+0xb4>
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe92(%rip),%xmm2
subsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11af <main+0x8f>
jp     11af <main+0x8f>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11be <main+0x9e>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe42(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xee0(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    1158 <main+0x38>
jp     1158 <main+0x38>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xeb5(%rip),%r14
lea    0xeaa(%rip),%r15
lea    0x8(%rsp),%rbx
jmp    119b <main+0x7b>
nopl   (%rax)
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm1
ucomisd 0xe71(%rip),%xmm1
jne    119b <main+0x7b>
jnp    114c <main+0x2c>
movapd %xmm1,%xmm2
addsd  0xe59(%rip),%xmm2
addsd  %xmm1,%xmm2
subsd  %xmm1,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jne    11bb <main+0x9b>
jnp    1170 <main+0x50>
divsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
jmp    1170 <main+0x50>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [7 x i8] c"%.6lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %18, label %6
6: ; preds = %0, %6
%7 = phi double [ %16, %6 ], [ %4, %0 ]
%8 = fadd double %7, -3.000000e+00
%9 = fadd double %7, %8
%10 = fsub double %9, %7
%11 = fcmp oeq double %10, 0.000000e+00
%12 = fdiv double %10, %7
%13 = select i1 %11, double 0.000000e+00, double %12
store double %13, double* %1
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %13)
%15 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%16 = load double, double* %1
%17 = fcmp oeq double %16, 0.000000e+00
br i1 %17, label %18, label %6
18: ; preds = %6, %0
ret i32 0
}