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


x86 assembly (clang, -O0):
<Gaus8>:
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    128a <Gaus8+0x16a>
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
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  0xe79(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe35(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  0xe38(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  0xe1b(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe03(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xdef(%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   $0x1eee11,%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 <Gaus8+0x22>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Gaus8>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %esi,%esi
jle    11fd <Gaus8+0xdd>
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
movapd %xmm0,%xmm3
mulsd  %xmm2,%xmm3
mulsd  0xe96(%rip),%xmm2
movsd  0xe96(%rip),%xmm4
mulsd  %xmm4,%xmm3
addsd  %xmm2,%xmm3
mulsd  0xe8e(%rip),%xmm1
addsd  %xmm3,%xmm1
movapd %xmm0,%xmm2
mulsd  0xe86(%rip),%xmm2
addsd  %xmm1,%xmm2
addsd  0xe82(%rip),%xmm2
mulsd  %xmm4,%xmm2
movapd %xmm2,(%rsp)
xorpd  0xe81(%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   $0x1eee11,%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 <Gaus8+0x20>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @Gaus8(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 = %66, %5
%17 = load i32, i32* %11
%18 = load i32, i32* %7
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %69
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* %12
%34 = fmul double %32, %33
store double %34, double* %13
%35 = load double, double* %13
%36 = load double, double* %12
%37 = fmul double %35, %36
store double %37, double* %14
%38 = load double, double* %14
%39 = load double, double* %12
%40 = fmul double %38, %39
store double %40, double* %15
%41 = load double, double* %15
%42 = load double, double* %14
%43 = fmul double 2.240000e+02, %42
%44 = fneg double %43
%45 = call double @llvm.fmuladd.f64(double 1.600000e+01, double %41, double %44)
%46 = load double, double* %13
%47 = call double @llvm.fmuladd.f64(double 8.400000e+02, double %46, double %45)
%48 = load double, double* %12
%49 = call double @llvm.fmuladd.f64(double -8.400000e+02, double %48, double %47)
%50 = fadd double %49, 1.050000e+02
%51 = fmul double 1.600000e+01, %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 2027025, %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 = %20
%67 = load i32, i32* %11
%68 = add nsw i32 %67, 1
store i32 %68, i32* %11
br label %16
69: ; preds = %16
ret void
}

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