#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*/ aitken(double *, double *, int const);
int /*<<< orphan*/ leibniz(double *, int const);
int /*<<< orphan*/ printseq(double *, int const);
int main() {
  const int len = 13;
  double seq1[len];
  double seq2[len];
  int n, i, j;
  leibniz(seq1, len);
  n = len / 2;
  if (len % 2 == 0)
    n--;
  for (i = 0; i < n; i++) {
    printseq(seq1, len - 2 * i);
    aitken(seq1, seq2, len - 2 * i);
    for (j = 0; j < len - 2 * (i + 1); j++)
      seq1[j] = seq2[j];
  }
  if (len % 2 == 0)
    printseq(seq1, 2);
  else
    printseq(seq1, 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xd,-0x8(%rbp)
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
mov    $0xd,%esi
call   1030 <leibniz@plt>
movl   $0x6,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1211 <main+0xe1>
mov    -0x18(%rbp),%eax
shl    $0x1,%eax
mov    $0xd,%esi
sub    %eax,%esi
lea    -0x90(%rbp),%rdi
call   1040 <printseq@plt>
mov    -0x18(%rbp),%eax
shl    $0x1,%eax
mov    $0xd,%edx
sub    %eax,%edx
lea    -0x90(%rbp),%rdi
lea    -0x100(%rbp),%rsi
call   1050 <aitken@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%edx
add    $0x1,%edx
shl    $0x1,%edx
mov    $0xd,%ecx
sub    %edx,%ecx
cmp    %ecx,%eax
jge    11fe <main+0xce>
movslq -0x1c(%rbp),%rax
movsd  -0x100(%rbp,%rax,8),%xmm0
ff ff
movslq -0x1c(%rbp),%rax
movsd  %xmm0,-0x90(%rbp,%rax,8)
ff ff
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11bb <main+0x8b>
jmp    1203 <main+0xd3>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    116f <main+0x3f>
lea    -0x90(%rbp),%rdi
mov    $0x1,%esi
call   1040 <printseq@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <leibniz@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1040 <printseq@plt>
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xd,%edx
call   1050 <aitken@plt>
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
movaps 0x20(%rsp),%xmm2
movaps 0x30(%rsp),%xmm3
movaps %xmm0,0x70(%rsp)
movaps %xmm1,0x80(%rsp)
movaps %xmm2,0x90(%rsp)
movaps %xmm3,0xa0(%rsp)
movaps 0x40(%rsp),%xmm0
movaps %xmm0,0xb0(%rsp)
mov    0x50(%rsp),%rax
mov    %rax,0xc0(%rsp)
mov    %rbx,%rdi
mov    $0xb,%esi
call   1040 <printseq@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xb,%edx
call   1050 <aitken@plt>
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
movaps 0x20(%rsp),%xmm2
movaps 0x30(%rsp),%xmm3
movaps %xmm0,0x70(%rsp)
movaps %xmm1,0x80(%rsp)
movaps %xmm2,0x90(%rsp)
movaps %xmm3,0xa0(%rsp)
mov    0x40(%rsp),%rax
mov    %rax,0xb0(%rsp)
mov    %rbx,%rdi
mov    $0x9,%esi
call   1040 <printseq@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x9,%edx
call   1050 <aitken@plt>
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
movaps 0x20(%rsp),%xmm2
movaps %xmm0,0x70(%rsp)
movaps %xmm1,0x80(%rsp)
movaps %xmm2,0x90(%rsp)
mov    0x30(%rsp),%rax
mov    %rax,0xa0(%rsp)
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <printseq@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x7,%edx
call   1050 <aitken@plt>
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
movaps %xmm0,0x70(%rsp)
movaps %xmm1,0x80(%rsp)
mov    0x20(%rsp),%rax
mov    %rax,0x90(%rsp)
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <printseq@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
call   1050 <aitken@plt>
movaps (%rsp),%xmm0
movaps %xmm0,0x70(%rsp)
mov    0x10(%rsp),%rax
mov    %rax,0x80(%rsp)
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <printseq@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
call   1050 <aitken@plt>
mov    (%rsp),%rax
mov    %rax,0x70(%rsp)
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <printseq@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 13, i32* %2
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca double, i64 13
%9 = alloca double, i64 13
%10 = call i32 @leibniz(double* %8, i32 13)
store i32 6, i32* %4
store i32 0, i32* %5
br label %11
11: ; preds = %43, %0
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %46
15: ; preds = %11
%16 = load i32, i32* %5
%17 = mul nsw i32 2, %16
%18 = sub nsw i32 13, %17
%19 = call i32 @printseq(double* %8, i32 %18)
%20 = load i32, i32* %5
%21 = mul nsw i32 2, %20
%22 = sub nsw i32 13, %21
%23 = call i32 @aitken(double* %8, double* %9, i32 %22)
store i32 0, i32* %6
br label %24
24: ; preds = %39, %15
%25 = load i32, i32* %6
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
%28 = mul nsw i32 2, %27
%29 = sub nsw i32 13, %28
%30 = icmp slt i32 %25, %29
br i1 %30, label %31, label %42
31: ; preds = %24
%32 = load i32, i32* %6
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double, double* %9, i64 %33
%35 = load double, double* %34
%36 = load i32, i32* %6
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %8, i64 %37
store double %35, double* %38
br label %39
39: ; preds = %31
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
br label %24
42: ; preds = %24
br label %43
43: ; preds = %42
%44 = load i32, i32* %5
%45 = add nsw i32 %44, 1
store i32 %45, i32* %5
br label %11
46: ; preds = %11
%47 = call i32 @printseq(double* %8, i32 1)
%48 = load i8*, i8** %3
%49 = load i32, i32* %1
ret i32 %49
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [13 x double]
%2 = bitcast [13 x double]* %1 to i8*
%3 = alloca [13 x double]
%4 = bitcast [13 x double]* %3 to i8*
%5 = getelementptr inbounds [13 x double], [13 x double]* %3, i64 0, i64 0
%6 = getelementptr inbounds [13 x double], [13 x double]* %1, i64 0, i64 0
%7 = call i32 @leibniz(double* %6, i32 13)
%8 = call i32 @printseq(double* %6, i32 13)
%9 = call i32 @aitken(double* %6, double* %5, i32 13)
%10 = call i32 @printseq(double* %6, i32 11)
%11 = call i32 @aitken(double* %6, double* %5, i32 11)
%12 = call i32 @printseq(double* %6, i32 9)
%13 = call i32 @aitken(double* %6, double* %5, i32 9)
%14 = call i32 @printseq(double* %6, i32 7)
%15 = call i32 @aitken(double* %6, double* %5, i32 7)
%16 = call i32 @printseq(double* %6, i32 5)
%17 = call i32 @aitken(double* %6, double* %5, i32 5)
%18 = call i32 @printseq(double* %6, i32 3)
%19 = call i32 @aitken(double* %6, double* %5, i32 3)
%20 = bitcast [13 x double]* %3 to i64*
%21 = bitcast [13 x double]* %1 to i64*
%22 = load i64, i64* %20
store i64 %22, i64* %21
%23 = call i32 @printseq(double* %6, i32 1)
ret i32 0
}