#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 exp(double);
int sqrt(int);
void Gaus7(double *x, int sigInLength, double *psi, int sigOutLength,
           double ys) {
  int count;
  double x2, x3, x5, x7;
  for (count = 0; count < sigInLength; count++) {
    x2 = x[count] * x[count];
    x3 = x2 * x[count];
    x5 = x3 * x2;
    x7 = x5 * x2;
    psi[count] = 16 * (-8 * x7 + 84 * x5 - 210 * x3 + 105 * x[count]) *
                 exp(-x2) /
                 sqrt(105 * 9 * 11 * 13 * sqrt(3.1415926535897931159980 / 2));
  }
  return;
}


x86 assembly (clang, -O0):
<Gaus7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1277 <Gaus7+0x157>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  0xe71(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  0xe5c(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  0xe3f(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xe1a(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe02(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movsd  -0x60(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    $0x1,%edi
call   1040 <sqrt@plt>
imul   $0x20fdf,%eax,%edi
call   1040 <sqrt@plt>
movsd  -0x58(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1142 <Gaus7+0x22>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Gaus7>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    11f5 <Gaus7+0xd5>
mov    %rdx,%r14
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm4
movapd %xmm4,%xmm0
mulsd  %xmm4,%xmm0
movapd %xmm4,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm2,%xmm3
mulsd  0xe92(%rip),%xmm2
mulsd  0xe92(%rip),%xmm3
addsd  %xmm2,%xmm3
mulsd  0xe8e(%rip),%xmm1
addsd  %xmm3,%xmm1
mulsd  0xe8a(%rip),%xmm4
addsd  %xmm1,%xmm4
mulsd  0xe86(%rip),%xmm4
movsd  %xmm4,(%rsp)
xorpd  0xe89(%rip),%xmm0
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
mov    $0x1,%edi
call   1040 <sqrt@plt>
imul   $0x20fdf,%eax,%edi
call   1040 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <Gaus7+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @Gaus7(double* %0, i32 %1, double* %2, i32 %3, double %4) {
%6 = alloca double*
%7 = alloca i32
%8 = alloca double*
%9 = alloca i32
%10 = alloca double
%11 = alloca i32
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
store double* %0, double** %6
store i32 %1, i32* %7
store double* %2, double** %8
store i32 %3, i32* %9
store double %4, double* %10
store i32 0, i32* %11
br label %16
16: ; preds = %72, %5
%17 = load i32, i32* %11
%18 = load i32, i32* %7
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %75
20: ; preds = %16
%21 = load double*, double** %6
%22 = load i32, i32* %11
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds double, double* %21, i64 %23
%25 = load double, double* %24
%26 = load double*, double** %6
%27 = load i32, i32* %11
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %26, i64 %28
%30 = load double, double* %29
%31 = fmul double %25, %30
store double %31, double* %12
%32 = load double, double* %12
%33 = load double*, double** %6
%34 = load i32, i32* %11
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double, double* %33, i64 %35
%37 = load double, double* %36
%38 = fmul double %32, %37
store double %38, double* %13
%39 = load double, double* %13
%40 = load double, double* %12
%41 = fmul double %39, %40
store double %41, double* %14
%42 = load double, double* %14
%43 = load double, double* %12
%44 = fmul double %42, %43
store double %44, double* %15
%45 = load double, double* %15
%46 = load double, double* %14
%47 = fmul double 8.400000e+01, %46
%48 = call double @llvm.fmuladd.f64(double -8.000000e+00, double %45, double %47)
%49 = load double, double* %13
%50 = call double @llvm.fmuladd.f64(double -2.100000e+02, double %49, double %48)
%51 = load double*, double** %6
%52 = load i32, i32* %11
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds double, double* %51, i64 %53
%55 = load double, double* %54
%56 = call double @llvm.fmuladd.f64(double 1.050000e+02, double %55, double %50)
%57 = fmul double 1.600000e+01, %56
%58 = load double, double* %12
%59 = fneg double %58
%60 = call i32 @exp(double %59)
%61 = sitofp i32 %60 to double
%62 = fmul double %57, %61
%63 = call i32 @sqrt(i32 1)
%64 = mul nsw i32 135135, %63
%65 = call i32 @sqrt(i32 %64)
%66 = sitofp i32 %65 to double
%67 = fdiv double %62, %66
%68 = load double*, double** %8
%69 = load i32, i32* %11
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds double, double* %68, i64 %70
store double %67, double* %71
br label %72
72: ; preds = %20
%73 = load i32, i32* %11
%74 = add nsw i32 %73, 1
store i32 %74, i32* %11
br label %16
75: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @Gaus7(double* nocapture %0, i32 %1, double* nocapture writeonly %2, i32 %3, double %4) {
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %34
7: ; preds = %5
%8 = zext i32 %1 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ 0, %7 ], [ %32, %9 ]
%11 = getelementptr inbounds double, double* %0, i64 %10
%12 = load double, double* %11
%13 = fmul double %12, %12
%14 = fmul double %12, %13
%15 = fmul double %13, %14
%16 = fmul double %13, %15
%17 = fmul double %15, 8.400000e+01
%18 = tail call double @llvm.fmuladd.f64(double %16, double -8.000000e+00, double %17)
%19 = tail call double @llvm.fmuladd.f64(double %14, double -2.100000e+02, double %18)
%20 = tail call double @llvm.fmuladd.f64(double %12, double 1.050000e+02, double %19)
%21 = fmul double %20, 1.600000e+01
%22 = fneg double %13
%23 = tail call i32 @exp(double %22)
%24 = sitofp i32 %23 to double
%25 = fmul double %21, %24
%26 = tail call i32 @sqrt(i32 1)
%27 = mul nsw i32 %26, 135135
%28 = tail call i32 @sqrt(i32 %27)
%29 = sitofp i32 %28 to double
%30 = fdiv double %25, %29
%31 = getelementptr inbounds double, double* %2, i64 %10
store double %30, double* %31
%32 = add nuw nsw i64 %10, 1
%33 = icmp eq i64 %32, %8
br i1 %33, label %34, label %9
34: ; preds = %9, %5
ret void
}