#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 */
double cos(double);
int exp(double);
double sin(double);
int sqrt(int);
void cgau3(double *x, int sigInLength, double *psir, double *psii,
           int sigOutLength, double ys) {
  int count;
  double x2, cosx, sinx, x3;
  for (count = 0; count < sigInLength; count++) {
    x2 = x[count] * x[count];
    x3 = x[count] * x2;
    cosx = cos(x[count]);
    sinx = sin(x[count]);
    psir[count] =
        (-8 * x3 * cosx - 12 * x2 * sinx + 18 * x[count] * cosx + 7 * sinx) *
        exp(-x2) / sqrt(76 * sqrt(3.1415926535897931159980 / 2));
    psii[count] =
        (8 * x3 * sinx - 12 * x2 * cosx - 18 * x[count] * sinx + 7 * cosx) *
        exp(-x2) / sqrt(76 * sqrt(3.1415926535897931159980 / 2));
  }
  return;
}


x86 assembly (clang, -O0):
<cgau3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    13bb <cgau3+0x27b>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  0xe3e(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  0xe1c(%rip),%xmm1
mulsd  -0x40(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  0xddb(%rip),%xmm1
mulsd  (%rax,%rcx,8),%xmm1
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  0xdb4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1040 <exp@plt>
movsd  -0x78(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    $0x1,%edi
call   1060 <sqrt@plt>
imul   $0x4c,%eax,%edi
call   1060 <sqrt@plt>
movsd  -0x70(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xd58(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  0xd3e(%rip),%xmm1
mulsd  -0x40(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  0xcfd(%rip),%xmm1
mulsd  (%rax,%rcx,8),%xmm1
movsd  -0x50(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  0xcbf(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1040 <exp@plt>
movsd  -0x68(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    $0x1,%edi
call   1060 <sqrt@plt>
imul   $0x4c,%eax,%edi
call   1060 <sqrt@plt>
movsd  -0x60(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    116a <cgau3+0x2a>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgau3>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x50,%rsp
test   %esi,%esi
jle    1318 <cgau3+0x1d8>
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rdi,%r13
mov    %esi,%r12d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  0x0(%r13,%rbx,8),%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,0x20(%rsp)
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x18(%rsp)
call   1050 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x0(%r13,%rbx,8),%xmm0
call   1030 <sin@plt>
movsd  0x18(%rsp),%xmm2
mulsd  0xe48(%rip),%xmm2
movapd 0x20(%rsp),%xmm4
movapd %xmm4,%xmm1
mulsd  0xe3e(%rip),%xmm1
movapd %xmm1,0x40(%rsp)
mulsd  %xmm0,%xmm1
movapd %xmm0,%xmm3
movsd  %xmm0,0x38(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  0x0(%r13,%rbx,8),%xmm1
mulsd  0xe15(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
movsd  0xe0d(%rip),%xmm0
mulsd  %xmm0,%xmm3
addsd  %xmm1,%xmm3
movsd  %xmm3,0x10(%rsp)
movapd %xmm4,%xmm0
xorpd  0xe0b(%rip),%xmm0
movapd %xmm0,0x20(%rsp)
call   1040 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    $0x1,%edi
call   1060 <sqrt@plt>
imul   $0x4c,%eax,%edi
call   1060 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r15,%rbx,8)
movsd  0x18(%rsp),%xmm0
mulsd  0xda6(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
movapd 0x40(%rsp),%xmm2
mulsd  %xmm1,%xmm2
movsd  0x38(%rsp),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
movapd %xmm0,%xmm2
movsd  0x0(%r13,%rbx,8),%xmm0
mulsd  0xd7d(%rip),%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
mulsd  0xd5d(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movaps 0x20(%rsp),%xmm0
call   1040 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%edi
call   1060 <sqrt@plt>
imul   $0x4c,%eax,%edi
call   1060 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1170 <cgau3+0x30>
add    $0x50,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @cgau3(double* %0, i32 %1, double* %2, double* %3, i32 %4, double %5) {
%7 = alloca double*
%8 = alloca i32
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32
%12 = alloca double
%13 = alloca i32
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
store double* %0, double** %7
store i32 %1, i32* %8
store double* %2, double** %9
store double* %3, double** %10
store i32 %4, i32* %11
store double %5, double* %12
store i32 0, i32* %13
br label %18
18: ; preds = %120, %6
%19 = load i32, i32* %13
%20 = load i32, i32* %8
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %123
22: ; preds = %18
%23 = load double*, double** %7
%24 = load i32, i32* %13
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %23, i64 %25
%27 = load double, double* %26
%28 = load double*, double** %7
%29 = load i32, i32* %13
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds double, double* %28, i64 %30
%32 = load double, double* %31
%33 = fmul double %27, %32
store double %33, double* %14
%34 = load double*, double** %7
%35 = load i32, i32* %13
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double, double* %34, i64 %36
%38 = load double, double* %37
%39 = load double, double* %14
%40 = fmul double %38, %39
store double %40, double* %17
%41 = load double*, double** %7
%42 = load i32, i32* %13
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %41, i64 %43
%45 = load double, double* %44
%46 = call double @cos(double %45)
store double %46, double* %15
%47 = load double*, double** %7
%48 = load i32, i32* %13
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds double, double* %47, i64 %49
%51 = load double, double* %50
%52 = call double @sin(double %51)
store double %52, double* %16
%53 = load double, double* %17
%54 = fmul double -8.000000e+00, %53
%55 = load double, double* %15
%56 = load double, double* %14
%57 = fmul double 1.200000e+01, %56
%58 = load double, double* %16
%59 = fmul double %57, %58
%60 = fneg double %59
%61 = call double @llvm.fmuladd.f64(double %54, double %55, double %60)
%62 = load double*, double** %7
%63 = load i32, i32* %13
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds double, double* %62, i64 %64
%66 = load double, double* %65
%67 = fmul double 1.800000e+01, %66
%68 = load double, double* %15
%69 = call double @llvm.fmuladd.f64(double %67, double %68, double %61)
%70 = load double, double* %16
%71 = call double @llvm.fmuladd.f64(double 7.000000e+00, double %70, double %69)
%72 = load double, double* %14
%73 = fneg double %72
%74 = call i32 @exp(double %73)
%75 = sitofp i32 %74 to double
%76 = fmul double %71, %75
%77 = call i32 @sqrt(i32 1)
%78 = mul nsw i32 76, %77
%79 = call i32 @sqrt(i32 %78)
%80 = sitofp i32 %79 to double
%81 = fdiv double %76, %80
%82 = load double*, double** %9
%83 = load i32, i32* %13
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds double, double* %82, i64 %84
store double %81, double* %85
%86 = load double, double* %17
%87 = fmul double 8.000000e+00, %86
%88 = load double, double* %16
%89 = load double, double* %14
%90 = fmul double 1.200000e+01, %89
%91 = load double, double* %15
%92 = fmul double %90, %91
%93 = fneg double %92
%94 = call double @llvm.fmuladd.f64(double %87, double %88, double %93)
%95 = load double*, double** %7
%96 = load i32, i32* %13
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds double, double* %95, i64 %97
%99 = load double, double* %98
%100 = fmul double 1.800000e+01, %99
%101 = load double, double* %16
%102 = fneg double %100
%103 = call double @llvm.fmuladd.f64(double %102, double %101, double %94)
%104 = load double, double* %15
%105 = call double @llvm.fmuladd.f64(double 7.000000e+00, double %104, double %103)
%106 = load double, double* %14
%107 = fneg double %106
%108 = call i32 @exp(double %107)
%109 = sitofp i32 %108 to double
%110 = fmul double %105, %109
%111 = call i32 @sqrt(i32 1)
%112 = mul nsw i32 76, %111
%113 = call i32 @sqrt(i32 %112)
%114 = sitofp i32 %113 to double
%115 = fdiv double %110, %114
%116 = load double*, double** %10
%117 = load i32, i32* %13
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds double, double* %116, i64 %118
store double %115, double* %119
br label %120
120: ; preds = %22
%121 = load i32, i32* %13
%122 = add nsw i32 %121, 1
store i32 %122, i32* %13
br label %18
123: ; preds = %18
ret void
}

LLVM IR (-O2):
define void @cgau3(double* nocapture %0, i32 %1, double* nocapture writeonly %2, double* nocapture writeonly %3, i32 %4, double %5) {
%7 = icmp sgt i32 %1, 0
br i1 %7, label %8, label %55
8: ; preds = %6
%9 = zext i32 %1 to i64
br label %10
10: ; preds = %8, %10
%11 = phi i64 [ 0, %8 ], [ %53, %10 ]
%12 = getelementptr inbounds double, double* %0, i64 %11
%13 = load double, double* %12
%14 = fmul double %13, %13
%15 = fmul double %13, %14
%16 = tail call double @cos(double %13)
%17 = load double, double* %12
%18 = tail call double @sin(double %17)
%19 = fmul double %15, -8.000000e+00
%20 = fmul double %14, -1.200000e+01
%21 = fmul double %20, %18
%22 = tail call double @llvm.fmuladd.f64(double %19, double %16, double %21)
%23 = load double, double* %12
%24 = fmul double %23, 1.800000e+01
%25 = tail call double @llvm.fmuladd.f64(double %24, double %16, double %22)
%26 = tail call double @llvm.fmuladd.f64(double %18, double 7.000000e+00, double %25)
%27 = fneg double %14
%28 = tail call i32 @exp(double %27)
%29 = sitofp i32 %28 to double
%30 = fmul double %26, %29
%31 = tail call i32 @sqrt(i32 1)
%32 = mul nsw i32 %31, 76
%33 = tail call i32 @sqrt(i32 %32)
%34 = sitofp i32 %33 to double
%35 = fdiv double %30, %34
%36 = getelementptr inbounds double, double* %2, i64 %11
store double %35, double* %36
%37 = fmul double %15, 8.000000e+00
%38 = fmul double %16, %20
%39 = tail call double @llvm.fmuladd.f64(double %37, double %18, double %38)
%40 = load double, double* %12
%41 = fmul double %40, -1.800000e+01
%42 = tail call double @llvm.fmuladd.f64(double %41, double %18, double %39)
%43 = tail call double @llvm.fmuladd.f64(double %16, double 7.000000e+00, double %42)
%44 = tail call i32 @exp(double %27)
%45 = sitofp i32 %44 to double
%46 = fmul double %43, %45
%47 = tail call i32 @sqrt(i32 1)
%48 = mul nsw i32 %47, 76
%49 = tail call i32 @sqrt(i32 %48)
%50 = sitofp i32 %49 to double
%51 = fdiv double %46, %50
%52 = getelementptr inbounds double, double* %3, i64 %11
store double %51, double* %52
%53 = add nuw nsw i64 %11, 1
%54 = icmp eq i64 %53, %9
br i1 %54, label %55, label %10
55: ; preds = %10, %6
ret void
}