#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 Gaus4(double *x, int sigInLength, double *psi, int sigOutLength,
           double ys) {
  int count;
  double x2, x4;
  for (count = 0; count < sigInLength; count++) {
    x2 = x[count] * x[count];
    x4 = x2 * x2;
    psi[count] = 4 * (-12 * x2 + 4 * x4 + 3) * exp(-x2) /
                 sqrt(105 * sqrt(3.1415926535897931159980 / 2));
  }
  return;
}


x86 assembly (clang, -O0):
<Gaus4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%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    1228 <Gaus4+0x108>
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
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm1
movsd  0xe77(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  0xe7a(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe62(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe4e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movsd  -0x50(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    $0x1,%edi
call   1040 <sqrt@plt>
imul   $0x69,%eax,%edi
call   1040 <sqrt@plt>
movsd  -0x48(%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 <Gaus4+0x22>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Gaus4>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %esi,%esi
jle    11d2 <Gaus4+0xb2>
mov    %rdx,%r14
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
xchg   %ax,%ax
movsd  (%r15,%rbx,8),%xmm0
mulsd  %xmm0,%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xea6(%rip),%xmm2
mulsd  %xmm2,%xmm1
movapd %xmm0,%xmm3
mulsd  0xe9e(%rip),%xmm3
addsd  %xmm1,%xmm3
addsd  0xe9a(%rip),%xmm3
mulsd  %xmm2,%xmm3
movapd %xmm3,(%rsp)
xorpd  0xe99(%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   $0x69,%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 <Gaus4+0x20>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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