#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 Gaus5(double *x, int sigInLength, double *psi, int sigOutLength,
           double ys) {
  int count;
  double x2, x3, x5;
  for (count = 0; count < sigInLength; count++) {
    x2 = x[count] * x[count];
    x3 = x2 * x[count];
    x5 = x3 * x2;
    psi[count] = 8 * (-4 * x5 + 20 * x3 - 15 * x[count]) * exp(-x2) /
                 sqrt(105 * 9 * sqrt(3.1415926535897931159980 / 2));
  }
  return;
}


x86 assembly (clang, -O0):
<Gaus5>:
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    1253 <Gaus5+0x133>
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
movsd  0xe78(%rip),%xmm1
mulsd  -0x40(%rbp),%xmm1
movsd  0xe63(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xe3e(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe26(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movsd  -0x58(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    $0x1,%edi
call   1040 <sqrt@plt>
imul   $0x3b1,%eax,%edi
call   1040 <sqrt@plt>
movsd  -0x50(%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 <Gaus5+0x22>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Gaus5>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    11e1 <Gaus5+0xc1>
mov    %rdx,%r14
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm3
movapd %xmm3,%xmm0
mulsd  %xmm3,%xmm0
movapd %xmm3,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
mulsd  0xe9a(%rip),%xmm1
mulsd  0xe9a(%rip),%xmm2
addsd  %xmm1,%xmm2
mulsd  0xe96(%rip),%xmm3
addsd  %xmm2,%xmm3
mulsd  0xe92(%rip),%xmm3
movsd  %xmm3,(%rsp)
xorpd  0xe8d(%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   $0x3b1,%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 <Gaus5+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @Gaus5(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
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 %15
15: ; preds = %66, %5
%16 = load i32, i32* %11
%17 = load i32, i32* %7
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %69
19: ; preds = %15
%20 = load double*, double** %6
%21 = load i32, i32* %11
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double, double* %20, i64 %22
%24 = load double, double* %23
%25 = load double*, double** %6
%26 = load i32, i32* %11
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds double, double* %25, i64 %27
%29 = load double, double* %28
%30 = fmul double %24, %29
store double %30, double* %12
%31 = load double, double* %12
%32 = load double*, double** %6
%33 = load i32, i32* %11
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds double, double* %32, i64 %34
%36 = load double, double* %35
%37 = fmul double %31, %36
store double %37, double* %13
%38 = load double, double* %13
%39 = load double, double* %12
%40 = fmul double %38, %39
store double %40, double* %14
%41 = load double, double* %14
%42 = load double, double* %13
%43 = fmul double 2.000000e+01, %42
%44 = call double @llvm.fmuladd.f64(double -4.000000e+00, double %41, double %43)
%45 = load double*, double** %6
%46 = load i32, i32* %11
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds double, double* %45, i64 %47
%49 = load double, double* %48
%50 = call double @llvm.fmuladd.f64(double -1.500000e+01, double %49, double %44)
%51 = fmul double 8.000000e+00, %50
%52 = load double, double* %12
%53 = fneg double %52
%54 = call i32 @exp(double %53)
%55 = sitofp i32 %54 to double
%56 = fmul double %51, %55
%57 = call i32 @sqrt(i32 1)
%58 = mul nsw i32 945, %57
%59 = call i32 @sqrt(i32 %58)
%60 = sitofp i32 %59 to double
%61 = fdiv double %56, %60
%62 = load double*, double** %8
%63 = load i32, i32* %11
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds double, double* %62, i64 %64
store double %61, double* %65
br label %66
66: ; preds = %19
%67 = load i32, i32* %11
%68 = add nsw i32 %67, 1
store i32 %68, i32* %11
br label %15
69: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @Gaus5(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 %32
7: ; preds = %5
%8 = zext i32 %1 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ 0, %7 ], [ %30, %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 %14, 2.000000e+01
%17 = tail call double @llvm.fmuladd.f64(double %15, double -4.000000e+00, double %16)
%18 = tail call double @llvm.fmuladd.f64(double %12, double -1.500000e+01, double %17)
%19 = fmul double %18, 8.000000e+00
%20 = fneg double %13
%21 = tail call i32 @exp(double %20)
%22 = sitofp i32 %21 to double
%23 = fmul double %19, %22
%24 = tail call i32 @sqrt(i32 1)
%25 = mul nsw i32 %24, 945
%26 = tail call i32 @sqrt(i32 %25)
%27 = sitofp i32 %26 to double
%28 = fdiv double %23, %27
%29 = getelementptr inbounds double, double* %2, i64 %10
store double %28, double* %29
%30 = add nuw nsw i64 %10, 1
%31 = icmp eq i64 %30, %8
br i1 %31, label %32, label %9
32: ; preds = %9, %5
ret void
}