#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 Gaus6(double *x, int sigInLength, double *psi, int sigOutLength,
           double ys) {
  int count;
  double x2, x4, x6;
  for (count = 0; count < sigInLength; count++) {
    x2 = x[count] * x[count];
    x4 = x2 * x2;
    x6 = x4 * x2;
    psi[count] = 8 * (8 * x6 - 60 * x4 + 90 * x2 - 15) * exp(-x2) /
                 sqrt(105 * 9 * 11 * sqrt(3.1415926535897931159980 / 2));
  }
  return;
}


x86 assembly (clang, -O0):
<Gaus6>:
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    1266 <Gaus6+0x146>
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  -0x40(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xe80(%rip),%xmm1
mulsd  -0x40(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe44(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  0xe3f(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe27(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe13(%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   $0x289b,%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 <Gaus6+0x22>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Gaus6>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %esi,%esi
jle    11e9 <Gaus6+0xc9>
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
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
mulsd  0xe9e(%rip),%xmm1
movsd  0xe9e(%rip),%xmm3
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movapd %xmm0,%xmm1
mulsd  0xe92(%rip),%xmm1
addsd  %xmm2,%xmm1
addsd  0xe8e(%rip),%xmm1
mulsd  %xmm3,%xmm1
movapd %xmm1,(%rsp)
xorpd  0xe85(%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   $0x289b,%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 <Gaus6+0x20>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @Gaus6(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 = %60, %5
%16 = load i32, i32* %11
%17 = load i32, i32* %7
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %63
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* %12
%33 = fmul double %31, %32
store double %33, double* %13
%34 = load double, double* %13
%35 = load double, double* %12
%36 = fmul double %34, %35
store double %36, double* %14
%37 = load double, double* %14
%38 = load double, double* %13
%39 = fmul double 6.000000e+01, %38
%40 = fneg double %39
%41 = call double @llvm.fmuladd.f64(double 8.000000e+00, double %37, double %40)
%42 = load double, double* %12
%43 = call double @llvm.fmuladd.f64(double 9.000000e+01, double %42, double %41)
%44 = fsub double %43, 1.500000e+01
%45 = fmul double 8.000000e+00, %44
%46 = load double, double* %12
%47 = fneg double %46
%48 = call i32 @exp(double %47)
%49 = sitofp i32 %48 to double
%50 = fmul double %45, %49
%51 = call i32 @sqrt(i32 1)
%52 = mul nsw i32 10395, %51
%53 = call i32 @sqrt(i32 %52)
%54 = sitofp i32 %53 to double
%55 = fdiv double %50, %54
%56 = load double*, double** %8
%57 = load i32, i32* %11
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds double, double* %56, i64 %58
store double %55, double* %59
br label %60
60: ; preds = %19
%61 = load i32, i32* %11
%62 = add nsw i32 %61, 1
store i32 %62, i32* %11
br label %15
63: ; preds = %15
ret void
}

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