#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, int);
int scanf(char *, double *);
int sqrt(int);
int main() {
  double a;
  double x, y, z;
  while (scanf("%lf", &a) == 1) {
    if (a < 0) {
      break;
    }
    x = a * a * (1 - sqrt(3) + 3.14159265358979 / 3);
    y = a * a * (3.14159265358979 / 12 + sqrt(3) / 2 - 1);
    z = a * a * (1 - 3.14159265358979 / 6 - sqrt(3) / 4);
    printf("%.3f %.3f %.3f\n", x, 4 * y, 4 * z);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    126d <main+0x13d>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    116b <main+0x3b>
jmp    126d <main+0x13d>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    $0x3,%edi
call   1050 <sqrt@plt>
movsd  -0x40(%rbp),%xmm0
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  0xe82(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    $0x3,%edi
call   1050 <sqrt@plt>
movsd  -0x38(%rbp),%xmm0
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm2
movsd  0xe3b(%rip),%xmm1
addsd  %xmm2,%xmm1
movsd  0xe27(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    $0x3,%edi
call   1050 <sqrt@plt>
movsd  -0x30(%rbp),%xmm0
mov    $0x4,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm2
movsd  0xde0(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xdbe(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
cvttsd2si %xmm1,%esi
movsd  0xdad(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
cvttsd2si %xmm1,%edx
lea    0xdc9(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
lea    0xef0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1287 <main+0x157>
movsd  (%rsp),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     1287 <main+0x157>
lea    0xec9(%rip),%r14
lea    0xebe(%rip),%r15
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mulsd  %xmm1,%xmm1
movsd  %xmm1,0x10(%rsp)
mov    $0x3,%edi
call   1050 <sqrt@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
addsd  0xe56(%rip),%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x3,%edi
call   1050 <sqrt@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
addsd  0xe21(%rip),%xmm0
addsd  0xe21(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x18(%rsp)
mov    $0x3,%edi
call   1050 <sqrt@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x2,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
movsd  0xdea(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  0xde6(%rip),%xmm0
movsd  0x8(%rsp),%xmm2
mulsd  %xmm0,%xmm2
cvttsd2si %xmm2,%esi
mulsd  0x18(%rsp),%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edx
mov    %r14,%rdi
movsd  0x10(%rsp),%xmm0
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1287 <main+0x157>
movsd  (%rsp),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1180 <main+0x50>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [16 x i8] c"%.3f %.3f %.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
br label %6
6: ; preds = %13, %0
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %47
9: ; preds = %6
%10 = load double, double* %2
%11 = fcmp olt double %10, 0.000000e+00
br i1 %11, label %12, label %13
12: ; preds = %9
br label %47
13: ; preds = %9
%14 = load double, double* %2
%15 = load double, double* %2
%16 = fmul double %14, %15
%17 = call i32 @sqrt(i32 3)
%18 = sub nsw i32 1, %17
%19 = sitofp i32 %18 to double
%20 = fadd double %19, 0x3FF0C152382D7361
%21 = fmul double %16, %20
store double %21, double* %3
%22 = load double, double* %2
%23 = load double, double* %2
%24 = fmul double %22, %23
%25 = call i32 @sqrt(i32 3)
%26 = sdiv i32 %25, 2
%27 = sitofp i32 %26 to double
%28 = fadd double 0x3FD0C152382D7361, %27
%29 = fsub double %28, 1.000000e+00
%30 = fmul double %24, %29
store double %30, double* %4
%31 = load double, double* %2
%32 = load double, double* %2
%33 = fmul double %31, %32
%34 = call i32 @sqrt(i32 3)
%35 = sdiv i32 %34, 4
%36 = sitofp i32 %35 to double
%37 = fsub double 0x3FDE7D5B8FA5193E, %36
%38 = fmul double %33, %37
store double %38, double* %5
%39 = load double, double* %3
%40 = load double, double* %4
%41 = fmul double 4.000000e+00, %40
%42 = fptosi double %41 to i32
%43 = load double, double* %5
%44 = fmul double 4.000000e+00, %43
%45 = fptosi double %44 to i32
%46 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %39, i32 %42, i32 %45)
br label %6
47: ; preds = %12, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [16 x i8] c"%.3f %.3f %.3f\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 = icmp ne i32 %3, 1
%5 = load double, double* %1
%6 = fcmp olt double %5, 0.000000e+00
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %41, label %8
8: ; preds = %0, %8
%9 = phi double [ %38, %8 ], [ %5, %0 ]
%10 = fmul double %9, %9
%11 = call i32 @sqrt(i32 3)
%12 = sub nsw i32 1, %11
%13 = sitofp i32 %12 to double
%14 = fadd double %13, 0x3FF0C152382D7361
%15 = fmul double %10, %14
%16 = load double, double* %1
%17 = fmul double %16, %16
%18 = call i32 @sqrt(i32 3)
%19 = sdiv i32 %18, 2
%20 = sitofp i32 %19 to double
%21 = fadd double %20, 0x3FD0C152382D7361
%22 = fadd double %21, -1.000000e+00
%23 = fmul double %17, %22
%24 = load double, double* %1
%25 = fmul double %24, %24
%26 = call i32 @sqrt(i32 3)
%27 = sdiv i32 %26, 4
%28 = sitofp i32 %27 to double
%29 = fsub double 0x3FDE7D5B8FA5193E, %28
%30 = fmul double %25, %29
%31 = fmul double %23, 4.000000e+00
%32 = fptosi double %31 to i32
%33 = fmul double %30, 4.000000e+00
%34 = fptosi double %33 to i32
%35 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %15, i32 %32, i32 %34)
%36 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%37 = icmp ne i32 %36, 1
%38 = load double, double* %1
%39 = fcmp olt double %38, 0.000000e+00
%40 = select i1 %37, i1 true, i1 %39
br i1 %40, label %41, label %8
41: ; preds = %8, %0
ret i32 0
}