#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 cgau4(double *x, int sigInLength, double *psir, double *psii,
           int sigOutLength, double ys) {
  int count;
  double x2, cosx, sinx, x3, x4;
  for (count = 0; count < sigInLength; count++) {
    x2 = x[count] * x[count];
    x3 = x[count] * x2;
    x4 = x2 * x2;
    cosx = cos(x[count]);
    sinx = sin(x[count]);
    psir[count] = (16 * x4 * cosx + 32 * x3 * sinx - 72 * x2 * cosx -
                   56 * x[count] * sinx + 25 * cosx) *
                  exp(-x2) / sqrt(764 * sqrt(3.1415926535897931159980 / 2));
    psii[count] = (-16 * x4 * sinx + 32 * x3 * cosx + 72 * x2 * sinx -
                   56 * x[count] * cosx - 25 * sinx) *
                  exp(-x2) / sqrt(764 * sqrt(3.1415926535897931159980 / 2));
  }
  return;
}


x86 assembly (clang, -O0):
<cgau4>:
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    1404 <cgau4+0x2c4>
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)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x60(%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  0xe3f(%rip),%xmm1
mulsd  -0x60(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movsd  0xe15(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xdf3(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  0xdb2(%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  0xd9c(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1040 <exp@plt>
movsd  -0x80(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    $0x1,%edi
call   1060 <sqrt@plt>
imul   $0x2fc,%eax,%edi
call   1060 <sqrt@plt>
movsd  -0x78(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xd1d(%rip),%xmm1
mulsd  -0x60(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  0xd03(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xce1(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  0xcb7(%rip),%xmm1
mulsd  (%rax,%rcx,8),%xmm1
movsd  -0x48(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  0xc79(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1040 <exp@plt>
movsd  -0x70(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    $0x1,%edi
call   1060 <sqrt@plt>
imul   $0x2fc,%eax,%edi
call   1060 <sqrt@plt>
movsd  -0x68(%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 <cgau4+0x2a>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgau4>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x50,%rsp
test   %esi,%esi
jle    1350 <cgau4+0x210>
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,(%rsp)
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm2,0x30(%rsp)
call   1050 <cos@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x0(%r13,%rbx,8),%xmm0
call   1030 <sin@plt>
movapd 0x30(%rsp),%xmm4
mulsd  0xe3b(%rip),%xmm4
movsd  (%rsp),%xmm1
mulsd  0xe36(%rip),%xmm1
movsd  %xmm1,(%rsp)
mulsd  %xmm0,%xmm1
movapd %xmm0,%xmm5
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm2
mulsd  %xmm2,%xmm4
addsd  %xmm1,%xmm4
movapd 0x20(%rsp),%xmm3
movapd %xmm3,%xmm1
mulsd  0xe0b(%rip),%xmm1
movapd %xmm1,0x40(%rsp)
mulsd  %xmm2,%xmm1
movapd %xmm2,%xmm0
subsd  %xmm1,%xmm4
movsd  0x0(%r13,%rbx,8),%xmm1
movsd  0xdf2(%rip),%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm5,%xmm1
addsd  %xmm4,%xmm1
mulsd  0xde6(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movapd %xmm3,%xmm0
xorpd  0xdf0(%rip),%xmm0
movapd %xmm0,0x20(%rsp)
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   $0x2fc,%eax,%edi
call   1060 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r15,%rbx,8)
movapd 0x30(%rsp),%xmm0
mulsd  0xd80(%rip),%xmm0
movsd  (%rsp),%xmm2
movsd  0x18(%rsp),%xmm3
mulsd  %xmm3,%xmm2
movsd  0x10(%rsp),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
movapd 0x40(%rsp),%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movsd  0x0(%r13,%rbx,8),%xmm0
mulsd  0xd36(%rip),%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
mulsd  0xd3e(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movaps 0x20(%rsp),%xmm0
call   1040 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rsp)
mov    $0x1,%edi
call   1060 <sqrt@plt>
imul   $0x2fc,%eax,%edi
call   1060 <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    1170 <cgau4+0x30>
add    $0x50,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @cgau4(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 %60
8: ; preds = %6
%9 = zext i32 %1 to i64
br label %10
10: ; preds = %8, %10
%11 = phi i64 [ 0, %8 ], [ %58, %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 = fmul double %14, %14
%17 = tail call double @cos(double %13)
%18 = load double, double* %12
%19 = tail call double @sin(double %18)
%20 = fmul double %16, 1.600000e+01
%21 = fmul double %15, 3.200000e+01
%22 = fmul double %21, %19
%23 = tail call double @llvm.fmuladd.f64(double %20, double %17, double %22)
%24 = fmul double %14, 7.200000e+01
%25 = fneg double %24
%26 = tail call double @llvm.fmuladd.f64(double %25, double %17, double %23)
%27 = load double, double* %12
%28 = fmul double %27, -5.600000e+01
%29 = tail call double @llvm.fmuladd.f64(double %28, double %19, double %26)
%30 = tail call double @llvm.fmuladd.f64(double %17, double 2.500000e+01, double %29)
%31 = fneg double %14
%32 = tail call i32 @exp(double %31)
%33 = sitofp i32 %32 to double
%34 = fmul double %30, %33
%35 = tail call i32 @sqrt(i32 1)
%36 = mul nsw i32 %35, 764
%37 = tail call i32 @sqrt(i32 %36)
%38 = sitofp i32 %37 to double
%39 = fdiv double %34, %38
%40 = getelementptr inbounds double, double* %2, i64 %11
store double %39, double* %40
%41 = fmul double %16, -1.600000e+01
%42 = fmul double %17, %21
%43 = tail call double @llvm.fmuladd.f64(double %41, double %19, double %42)
%44 = tail call double @llvm.fmuladd.f64(double %24, double %19, double %43)
%45 = load double, double* %12
%46 = fmul double %45, -5.600000e+01
%47 = tail call double @llvm.fmuladd.f64(double %46, double %17, double %44)
%48 = tail call double @llvm.fmuladd.f64(double %19, double -2.500000e+01, double %47)
%49 = tail call i32 @exp(double %31)
%50 = sitofp i32 %49 to double
%51 = fmul double %48, %50
%52 = tail call i32 @sqrt(i32 1)
%53 = mul nsw i32 %52, 764
%54 = tail call i32 @sqrt(i32 %53)
%55 = sitofp i32 %54 to double
%56 = fdiv double %51, %55
%57 = getelementptr inbounds double, double* %3, i64 %11
store double %56, double* %57
%58 = add nuw nsw i64 %11, 1
%59 = icmp eq i64 %58, %9
br i1 %59, label %60, label %10
60: ; preds = %10, %6
ret void
}