#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*/ getch();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ seriesfour(double *, int, double *, double *);
main() {
  int i;
  double f[10 + 1], a[5 + 1], b[5 + 1], c, h;
  h = 2 * 3.1415926 / 11.0;
  for (i = 0; i <= 10; i++) {
    c = (i + 0.5) * h;
    f[i] = c * c;
  }
  seriesfour(f, 5, a, b);
  printf("\n");
  for (i = 0; i < 5; i++)
    printf("a[%d]=%3.5lf b[%d]=%3.5lf\n", i, a[i], i, b[i]);
  printf("\n");
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xeb6(%rip),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     11ac <main+0x7c>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xe98(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
mulsd  -0xc8(%rbp),%xmm0
ff
movslq -0x8(%rbp),%rax
movsd  %xmm0,-0x60(%rbp,%rax,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1159 <main+0x29>
lea    -0x60(%rbp),%rdi
lea    -0x90(%rbp),%rdx
lea    -0xc0(%rbp),%rcx
mov    $0x5,%esi
call   1030 <seriesfour@plt>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1223 <main+0xf3>
mov    -0x8(%rbp),%esi
movslq -0x8(%rbp),%rax
movsd  -0x90(%rbp,%rax,8),%xmm0
ff ff
mov    -0x8(%rbp),%edx
movslq -0x8(%rbp),%rax
movsd  -0xc0(%rbp,%rax,8),%xmm1
ff ff
lea    0xe02(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11dd <main+0xad>
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getch@plt>
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xc0,%rsp
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xeba(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xebb(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movabs $0x4041fc4aeae172e3,%rax
fc 41 40
mov    %rax,0xb0(%rsp)
lea    0x60(%rsp),%rdi
lea    0x30(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x5,%esi
call   1040 <seriesfour@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movsd  0x30(%rsp),%xmm0
movsd  (%rsp),%xmm1
lea    0xe7e(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x2,%al
call   1050 <printf@plt>
movsd  0x38(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x2,%al
call   1050 <printf@plt>
movsd  0x40(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
mov    $0x2,%al
call   1050 <printf@plt>
movsd  0x48(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
mov    $0x2,%al
call   1050 <printf@plt>
movsd  0x50(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x4,%edx
mov    $0x2,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [27 x i8] c"a[%d]=%3.5lf b[%d]=%3.5lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [11 x double]
%4 = alloca [6 x double]
%5 = alloca [6 x double]
%6 = alloca double
%7 = alloca double
store i32 0, i32* %1
store double 0x3FE247426699577C, double* %7
store i32 0, i32* %2
br label %8
8: ; preds = %23, %0
%9 = load i32, i32* %2
%10 = icmp sle i32 %9, 10
br i1 %10, label %11, label %26
11: ; preds = %8
%12 = load i32, i32* %2
%13 = sitofp i32 %12 to double
%14 = fadd double %13, 5.000000e-01
%15 = load double, double* %7
%16 = fmul double %14, %15
store double %16, double* %6
%17 = load double, double* %6
%18 = load double, double* %6
%19 = fmul double %17, %18
%20 = load i32, i32* %2
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [11 x double], [11 x double]* %3, i64 0, i64 %21
store double %19, double* %22
br label %23
23: ; preds = %11
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %8
26: ; preds = %8
%27 = getelementptr inbounds [11 x double], [11 x double]* %3, i64 0, i64 0
%28 = getelementptr inbounds [6 x double], [6 x double]* %4, i64 0, i64 0
%29 = getelementptr inbounds [6 x double], [6 x double]* %5, i64 0, i64 0
%30 = call i32 @seriesfour(double* %27, i32 5, double* %28, double* %29)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %32
32: ; preds = %47, %26
%33 = load i32, i32* %2
%34 = icmp slt i32 %33, 5
br i1 %34, label %35, label %50
35: ; preds = %32
%36 = load i32, i32* %2
%37 = load i32, i32* %2
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [6 x double], [6 x double]* %4, i64 0, i64 %38
%40 = load double, double* %39
%41 = load i32, i32* %2
%42 = load i32, i32* %2
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [6 x double], [6 x double]* %5, i64 0, i64 %43
%45 = load double, double* %44
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %36, double %40, i32 %41, double %45)
br label %47
47: ; preds = %35
%48 = load i32, i32* %2
%49 = add nsw i32 %48, 1
store i32 %49, i32* %2
br label %32
50: ; preds = %32
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%52 = call i32 (...) @getch()
%53 = load i32, i32* %1
ret i32 %53
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c"a[%d]=%3.5lf b[%d]=%3.5lf\0A\00"
define i32 @main() {
%1 = alloca [11 x double]
%2 = alloca [6 x double]
%3 = alloca [6 x double]
%4 = bitcast [11 x double]* %1 to i8*
%5 = bitcast [6 x double]* %2 to i8*
%6 = bitcast [6 x double]* %3 to i8*
%7 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 0
%8 = bitcast [11 x double]* %1 to <2 x double>*
store <2 x double> <double 0x3FB4E192C53B26C2, double 0x3FE77DC51DE28B9B>, <2 x double>* %8
%9 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 2
%10 = bitcast double* %9 to <2 x double>*
store <2 x double> <double 0x4000503AAA163648, double 0x400FF968BE02935A>, <2 x double>* %10
%11 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 4
%12 = bitcast double* %11 to <2 x double>*
store <2 x double> <double 0x401A6D7DC19EDD0F, double 0x4023BD3CBE71EAA3>, <2 x double>* %12
%13 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 6
%14 = bitcast double* %13 to <2 x double>*
store <2 x double> <double 0x402B91D3C868192E, double 0x40325A41FF58FD10>, <2 x double>* %14
%15 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 8
%16 = bitcast double* %15 to <2 x double>*
store <2 x double> <double 0x403792A6B0A7C6C2, double 0x403D7217F82069A7>, <2 x double>* %16
%17 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 10
store double 0x4041FC4AEAE172E3, double* %17
%18 = getelementptr inbounds [6 x double], [6 x double]* %2, i64 0, i64 0
%19 = getelementptr inbounds [6 x double], [6 x double]* %3, i64 0, i64 0
%20 = call i32 @seriesfour(double* %7, i32 5, double* %18, double* %19)
%21 = call i32 @putchar(i32 10)
%22 = load double, double* %18
%23 = load double, double* %19
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 0, double %22, i32 0, double %23)
%25 = getelementptr inbounds [6 x double], [6 x double]* %2, i64 0, i64 1
%26 = load double, double* %25
%27 = getelementptr inbounds [6 x double], [6 x double]* %3, i64 0, i64 1
%28 = load double, double* %27
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 1, double %26, i32 1, double %28)
%30 = getelementptr inbounds [6 x double], [6 x double]* %2, i64 0, i64 2
%31 = load double, double* %30
%32 = getelementptr inbounds [6 x double], [6 x double]* %3, i64 0, i64 2
%33 = load double, double* %32
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 2, double %31, i32 2, double %33)
%35 = getelementptr inbounds [6 x double], [6 x double]* %2, i64 0, i64 3
%36 = load double, double* %35
%37 = getelementptr inbounds [6 x double], [6 x double]* %3, i64 0, i64 3
%38 = load double, double* %37
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 3, double %36, i32 3, double %38)
%40 = getelementptr inbounds [6 x double], [6 x double]* %2, i64 0, i64 4
%41 = load double, double* %40
%42 = getelementptr inbounds [6 x double], [6 x double]* %3, i64 0, i64 4
%43 = load double, double* %42
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 4, double %41, i32 4, double %43)
%45 = call i32 @putchar(i32 10)
%46 = call i32 (...) @getch()
ret i32 0
}