#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 acos(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double, double, double);
scalar_t__ scanf(char *, double *);
double sqrt(int);
int main(void) {
  const double PI = 2 * acos(0);
  const double SQUARE_ROOT_THREE = sqrt(3);
  double squareSide, stripedArea, dottedArea, rest, squareArea;
  while (scanf("%lf", &squareSide) > 0) {
    squareArea = squareSide * squareSide;
    stripedArea = squareArea * (1 - SQUARE_ROOT_THREE + PI / 3.0);
    dottedArea = squareArea * (2 * SQUARE_ROOT_THREE - 4 + PI / 3.0);
    rest = squareArea - stripedArea - dottedArea;
    printf("%.3lf %.3lf %.3lf\n", stripedArea, dottedArea, rest);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <acos@plt>
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x3,%edi
call   1060 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
lea    0xea0(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x0,%rax
jle    1236 <main+0xf6>
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  0xe69(%rip),%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  0xe47(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xe28(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  0xe0f(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x40(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
lea    0xdf0(%rip),%rdi
call   1030 <printf@plt>
jmp    1171 <main+0x31>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
xor    %edi,%edi
call   1040 <acos@plt>
mov    %eax,%ebx
mov    $0x3,%edi
call   1060 <sqrt@plt>
movsd  %xmm0,0x8(%rsp)
lea    0xeaf(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1050 <scanf@plt>
test   %rax,%rax
jle    121e <main+0xde>
add    %ebx,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  0xe73(%rip),%xmm2
movsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm2
divsd  0xe69(%rip),%xmm0
addsd  %xmm0,%xmm2
movsd  %xmm2,0x18(%rsp)
addsd  %xmm1,%xmm1
addsd  0xe5b(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
lea    0xe56(%rip),%r14
lea    0xe4b(%rip),%r15
lea    0x10(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm2
movsd  0x18(%rsp),%xmm0
mulsd  %xmm2,%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  %xmm2,%xmm1
subsd  %xmm0,%xmm2
subsd  %xmm1,%xmm2
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
test   %rax,%rax
jg     11e0 <main+0xa0>
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 = [19 x i8] c"%.3lf %.3lf %.3lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32 0, i32* %1
%9 = call i32 @acos(i32 0)
%10 = mul nsw i32 2, %9
%11 = sitofp i32 %10 to double
store double %11, double* %2
%12 = call double @sqrt(i32 3)
store double %12, double* %3
br label %13
13: ; preds = %16, %0
%14 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
%15 = icmp sgt i64 %14, 0
br i1 %15, label %16, label %43
16: ; preds = %13
%17 = load double, double* %4
%18 = load double, double* %4
%19 = fmul double %17, %18
store double %19, double* %8
%20 = load double, double* %8
%21 = load double, double* %3
%22 = fsub double 1.000000e+00, %21
%23 = load double, double* %2
%24 = fdiv double %23, 3.000000e+00
%25 = fadd double %22, %24
%26 = fmul double %20, %25
store double %26, double* %5
%27 = load double, double* %8
%28 = load double, double* %3
%29 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %28, double -4.000000e+00)
%30 = load double, double* %2
%31 = fdiv double %30, 3.000000e+00
%32 = fadd double %29, %31
%33 = fmul double %27, %32
store double %33, double* %6
%34 = load double, double* %8
%35 = load double, double* %5
%36 = fsub double %34, %35
%37 = load double, double* %6
%38 = fsub double %36, %37
store double %38, double* %7
%39 = load double, double* %5
%40 = load double, double* %6
%41 = load double, double* %7
%42 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double %39, double %40, double %41)
br label %13
43: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [19 x i8] c"%.3lf %.3lf %.3lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = tail call i32 @acos(i32 0)
%3 = tail call double @sqrt(i32 3)
%4 = bitcast double* %1 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %25
7: ; preds = %0
%8 = shl nsw i32 %2, 1
%9 = sitofp i32 %8 to double
%10 = fsub double 1.000000e+00, %3
%11 = fdiv double %9, 3.000000e+00
%12 = fadd double %10, %11
%13 = call double @llvm.fmuladd.f64(double %3, double 2.000000e+00, double -4.000000e+00)
%14 = fadd double %13, %11
br label %15
15: ; preds = %7, %15
%16 = load double, double* %1
%17 = fmul double %16, %16
%18 = fmul double %12, %17
%19 = fmul double %14, %17
%20 = fsub double %17, %18
%21 = fsub double %20, %19
%22 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double %18, double %19, double %21)
%23 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%24 = icmp sgt i64 %23, 0
br i1 %24, label %15, label %25
25: ; preds = %15, %0
ret i32 0
}