#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*/ gaussMF(double *, int, double, double);
double *iirFilter(double *, double *, int, double *, int);
int /*<<< orphan*/ printf(char *, int, double);
int main() {
  int i;
  double j = 2.4;
  double x[10] = {0, .1, .2, .3, .4, .5, .6, .7, .8, .9};
  double *y;
  double B[5] = {0.0003, -0.0013, 0.0018, -0.0013, 0.0003};
  double A[5] = {1.0000, -3.9890, 5.9673, -3.9677, 0.9894};
  y = iirFilter(B, A, 5, x, 15);
  for (i = 0; i < 15; i++) {
    printf("output y[%d] = %f\n", i, y[i]);
  }
  gaussMF(x, 10, .25, .5);
  for (i = 0; i < 10; i++) {
    printf("this is x[%d] = %f\n", i, x[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed6(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xee6(%rip),%rsi
mov    $0x50,%edx
call   1050 <memcpy@plt>
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movsd  0xe89(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xe81(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xe79(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xe64(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xe4f(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
lea    -0xc0(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movsd  0xe27(%rip),%xmm0
movsd  %xmm0,-0xc0(%rbp)
movsd  0xe0f(%rip),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0xdf7(%rip),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xddf(%rip),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xdc7(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
lea    -0x90(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
lea    -0x60(%rbp),%rcx
mov    $0x5,%edx
mov    $0xf,%r8d
call   1070 <iirFilter@plt>
mov    %rax,-0x68(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xf,-0x8(%rbp)
jge    12a2 <main+0x152>
mov    -0x8(%rbp),%esi
mov    -0x68(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe21(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    126e <main+0x11e>
lea    -0x60(%rbp),%rdi
mov    $0xa,%esi
movsd  0xd95(%rip),%xmm0
movsd  0xd95(%rip),%xmm1
call   1060 <gaussMF@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    12f8 <main+0x1a8>
mov    -0x8(%rbp),%esi
movslq -0x8(%rbp),%rax
movsd  -0x60(%rbp,%rax,8),%xmm0
lea    0xdde(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12c7 <main+0x177>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xb0,%rsp
movaps 0xf4d(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xf31(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xe82(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xe83(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movabs $0x3f33a92a30553261,%rax
a9 33 3f
mov    %rax,0xa0(%rsp)
movaps 0xe72(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xe76(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movabs $0x3fefa92a30553261,%rax
a9 ef 3f
mov    %rax,0x70(%rsp)
lea    0x80(%rsp),%rdi
lea    0x50(%rsp),%rsi
mov    %rsp,%r14
mov    $0x5,%edx
mov    %r14,%rcx
mov    $0xf,%r8d
call   1050 <iirFilter@plt>
mov    %rax,%rbx
movsd  (%rax),%xmm0
lea    0xea1(%rip),%r15
mov    %r15,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
movsd  0x8(%rbx),%xmm0
mov    %r15,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
movsd  0x10(%rbx),%xmm0
mov    %r15,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
movsd  0x18(%rbx),%xmm0
mov    %r15,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
movsd  0x20(%rbx),%xmm0
mov    %r15,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
movsd  0x28(%rbx),%xmm0
mov    %r15,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
movsd  0x30(%rbx),%xmm0
mov    %r15,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
movsd  0x38(%rbx),%xmm0
mov    %r15,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
movsd  0x40(%rbx),%xmm0
mov    %r15,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
movsd  0x48(%rbx),%xmm0
mov    %r15,%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
movsd  0x50(%rbx),%xmm0
mov    %r15,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
movsd  0x58(%rbx),%xmm0
mov    %r15,%rdi
mov    $0xb,%esi
call   1030 <printf@plt>
movsd  0x60(%rbx),%xmm0
mov    %r15,%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
movsd  0x68(%rbx),%xmm0
mov    %r15,%rdi
mov    $0xd,%esi
call   1030 <printf@plt>
movsd  0x70(%rbx),%xmm0
mov    %r15,%rdi
mov    $0xe,%esi
call   1030 <printf@plt>
movsd  0xd33(%rip),%xmm0
movsd  0xd33(%rip),%xmm1
mov    %r14,%rdi
mov    $0xa,%esi
call   1040 <gaussMF@plt>
movsd  (%rsp),%xmm0
lea    0xd85(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
movsd  0x18(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
movsd  0x20(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
movsd  0x28(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
movsd  0x30(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
movsd  0x38(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
movsd  0x40(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
movsd  0x48(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.x = [10 x double] [double 0.000000e+00, double 1.000000e-01, double 2.000000e-01, double 3.000000e-01, double 4.000000e-01, double 5.000000e-01, double 6.000000e-01, double 0x3FE6666666666666, double 8.000000e-01, double 9.000000e-01]
@.str = [19 x i8] c"output y[%d] = %f\0A\00"
@.str.1 = [20 x i8] c"this is x[%d] = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca [10 x double]
%5 = alloca double*
%6 = alloca [5 x double]
%7 = alloca [5 x double]
store i32 0, i32* %1
store double 2.400000e+00, double* %3
%8 = bitcast [10 x double]* %4 to i8*
%9 = bitcast [5 x double]* %6 to i8*
%10 = bitcast i8* %9 to [5 x double]*
%11 = getelementptr inbounds [5 x double], [5 x double]* %10, i32 0, i32 0
store double 3.000000e-04, double* %11
%12 = getelementptr inbounds [5 x double], [5 x double]* %10, i32 0, i32 1
store double -1.300000e-03, double* %12
%13 = getelementptr inbounds [5 x double], [5 x double]* %10, i32 0, i32 2
store double 1.800000e-03, double* %13
%14 = getelementptr inbounds [5 x double], [5 x double]* %10, i32 0, i32 3
store double -1.300000e-03, double* %14
%15 = getelementptr inbounds [5 x double], [5 x double]* %10, i32 0, i32 4
store double 3.000000e-04, double* %15
%16 = bitcast [5 x double]* %7 to i8*
%17 = bitcast i8* %16 to [5 x double]*
%18 = getelementptr inbounds [5 x double], [5 x double]* %17, i32 0, i32 0
store double 1.000000e+00, double* %18
%19 = getelementptr inbounds [5 x double], [5 x double]* %17, i32 0, i32 1
store double -3.989000e+00, double* %19
%20 = getelementptr inbounds [5 x double], [5 x double]* %17, i32 0, i32 2
store double 5.967300e+00, double* %20
%21 = getelementptr inbounds [5 x double], [5 x double]* %17, i32 0, i32 3
store double -3.967700e+00, double* %21
%22 = getelementptr inbounds [5 x double], [5 x double]* %17, i32 0, i32 4
store double 0x3FEFA92A30553261, double* %22
%23 = getelementptr inbounds [5 x double], [5 x double]* %6, i64 0, i64 0
%24 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 0
%25 = getelementptr inbounds [10 x double], [10 x double]* %4, i64 0, i64 0
%26 = call double* @iirFilter(double* %23, double* %24, i32 5, double* %25, i32 15)
store double* %26, double** %5
store i32 0, i32* %2
br label %27
27: ; preds = %38, %0
%28 = load i32, i32* %2
%29 = icmp slt i32 %28, 15
br i1 %29, label %30, label %41
30: ; preds = %27
%31 = load i32, i32* %2
%32 = load double*, double** %5
%33 = load i32, i32* %2
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds double, double* %32, i64 %34
%36 = load double, double* %35
%37 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %31, double %36)
br label %38
38: ; preds = %30
%39 = load i32, i32* %2
%40 = add nsw i32 %39, 1
store i32 %40, i32* %2
br label %27
41: ; preds = %27
%42 = getelementptr inbounds [10 x double], [10 x double]* %4, i64 0, i64 0
%43 = call i32 @gaussMF(double* %42, i32 10, double 2.500000e-01, double 5.000000e-01)
store i32 0, i32* %2
br label %44
44: ; preds = %54, %41
%45 = load i32, i32* %2
%46 = icmp slt i32 %45, 10
br i1 %46, label %47, label %57
47: ; preds = %44
%48 = load i32, i32* %2
%49 = load i32, i32* %2
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [10 x double], [10 x double]* %4, i64 0, i64 %50
%52 = load double, double* %51
%53 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %48, double %52)
br label %54
54: ; preds = %47
%55 = load i32, i32* %2
%56 = add nsw i32 %55, 1
store i32 %56, i32* %2
br label %44
57: ; preds = %44
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [10 x double] [double 0.000000e+00, double 1.000000e-01, double 2.000000e-01, double 3.000000e-01, double 4.000000e-01, double 5.000000e-01, double 6.000000e-01, double 0x3FE6666666666666, double 8.000000e-01, double 9.000000e-01]
@.str = [19 x i8] c"output y[%d] = %f\0A\00"
@.str.1 = [20 x i8] c"this is x[%d] = %f\0A\00"
define i32 @main() {
%1 = alloca [10 x double]
%2 = alloca [5 x double]
%3 = alloca [5 x double]
%4 = bitcast [10 x double]* %1 to i8*
%5 = bitcast [5 x double]* %2 to i8*
%6 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 0
%7 = bitcast [5 x double]* %2 to <2 x double>*
store <2 x double> <double 3.000000e-04, double -1.300000e-03>, <2 x double>* %7
%8 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 2
%9 = bitcast double* %8 to <2 x double>*
store <2 x double> <double 1.800000e-03, double -1.300000e-03>, <2 x double>* %9
%10 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 4
store double 3.000000e-04, double* %10
%11 = bitcast [5 x double]* %3 to i8*
%12 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 0
%13 = bitcast [5 x double]* %3 to <2 x double>*
store <2 x double> <double 1.000000e+00, double -3.989000e+00>, <2 x double>* %13
%14 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 2
%15 = bitcast double* %14 to <2 x double>*
store <2 x double> <double 5.967300e+00, double -3.967700e+00>, <2 x double>* %15
%16 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 4
store double 0x3FEFA92A30553261, double* %16
%17 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 0
%18 = call double* @iirFilter(double* %6, double* %12, i32 5, double* %17, i32 15)
%19 = load double, double* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 0, double %19)
%21 = getelementptr inbounds double, double* %18, i64 1
%22 = load double, double* %21
%23 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1, double %22)
%24 = getelementptr inbounds double, double* %18, i64 2
%25 = load double, double* %24
%26 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 2, double %25)
%27 = getelementptr inbounds double, double* %18, i64 3
%28 = load double, double* %27
%29 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 3, double %28)
%30 = getelementptr inbounds double, double* %18, i64 4
%31 = load double, double* %30
%32 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 4, double %31)
%33 = getelementptr inbounds double, double* %18, i64 5
%34 = load double, double* %33
%35 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 5, double %34)
%36 = getelementptr inbounds double, double* %18, i64 6
%37 = load double, double* %36
%38 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 6, double %37)
%39 = getelementptr inbounds double, double* %18, i64 7
%40 = load double, double* %39
%41 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 7, double %40)
%42 = getelementptr inbounds double, double* %18, i64 8
%43 = load double, double* %42
%44 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 8, double %43)
%45 = getelementptr inbounds double, double* %18, i64 9
%46 = load double, double* %45
%47 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 9, double %46)
%48 = getelementptr inbounds double, double* %18, i64 10
%49 = load double, double* %48
%50 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 10, double %49)
%51 = getelementptr inbounds double, double* %18, i64 11
%52 = load double, double* %51
%53 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 11, double %52)
%54 = getelementptr inbounds double, double* %18, i64 12
%55 = load double, double* %54
%56 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 12, double %55)
%57 = getelementptr inbounds double, double* %18, i64 13
%58 = load double, double* %57
%59 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 13, double %58)
%60 = getelementptr inbounds double, double* %18, i64 14
%61 = load double, double* %60
%62 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 14, double %61)
%63 = call i32 @gaussMF(double* %17, i32 10, double 2.500000e-01, double 5.000000e-01)
%64 = load double, double* %17
%65 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 0, double %64)
%66 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 1
%67 = load double, double* %66
%68 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 1, double %67)
%69 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 2
%70 = load double, double* %69
%71 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 2, double %70)
%72 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 3
%73 = load double, double* %72
%74 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 3, double %73)
%75 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 4
%76 = load double, double* %75
%77 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 4, double %76)
%78 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 5
%79 = load double, double* %78
%80 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 5, double %79)
%81 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 6
%82 = load double, double* %81
%83 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 6, double %82)
%84 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 7
%85 = load double, double* %84
%86 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 7, double %85)
%87 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 8
%88 = load double, double* %87
%89 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 8, double %88)
%90 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 9
%91 = load double, double* %90
%92 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 9, double %91)
ret i32 0
}