#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 */
typedef scalar_t__ uint;

/* Variables and functions */
int /*<<< orphan*/ DC(double, double *, scalar_t__ *, scalar_t__, double,
                      double, double);
double fabs(double);
double gauss();
double pow(double, double);
void GAUSS(double mean, double stdv, double *output, uint *index, uint Ni,
           double expon, double srate, double dt) {
  uint i;
  if (stdv == 0.) {
    DC(mean, output, index, Ni, expon, srate, dt);
    return;
  }
  if (expon == -1)
    for (i = 0; i < Ni; i++)
      output[(*index)++] = fabs(mean + stdv * gauss());
  else if (expon == 0)
    for (i = 0; i < Ni; i++)
      output[(*index)++] =
          (((mean + stdv * gauss()) > 0) ? mean + stdv * gauss() : 0.);
  else if (expon != 1)
    for (i = 0; i < Ni; i++)
      output[(*index)++] = pow(mean + stdv * gauss(), expon);
  else
    for (i = 0; i < Ni; i++)
      output[(*index)++] = mean + stdv * gauss();
  return;
}


x86 assembly (clang, -O0):
<GAUSS>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
movsd  %xmm3,-0x38(%rbp)
movsd  %xmm4,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11a2 <GAUSS+0x72>
jp     11a2 <GAUSS+0x72>
movsd  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm3
call   1040 <DC@plt>
jmp    1466 <GAUSS+0x336>
movsd  -0x30(%rbp),%xmm0
movsd  0xe51(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1240 <GAUSS+0x110>
jp     1240 <GAUSS+0x110>
movq   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    123b <GAUSS+0x10b>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    $0x0,%al
call   1030 <gauss@plt>
movsd  -0x58(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movaps 0xe04(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rdx
mov    (%rdx),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    11c7 <GAUSS+0x97>
jmp    1461 <GAUSS+0x331>
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1327 <GAUSS+0x1f7>
jp     1327 <GAUSS+0x1f7>
movq   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1322 <GAUSS+0x1f2>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    $0x0,%al
call   1030 <gauss@plt>
movsd  -0x68(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    12e5 <GAUSS+0x1b5>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    $0x0,%al
call   1030 <gauss@plt>
movsd  -0x80(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    12f2 <GAUSS+0x1c2>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    12f2 <GAUSS+0x1c2>
movsd  -0x70(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rdx
mov    (%rdx),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    1260 <GAUSS+0x130>
jmp    145c <GAUSS+0x32c>
movsd  -0x30(%rbp),%xmm0
movsd  0xcd4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1349 <GAUSS+0x219>
jp     1349 <GAUSS+0x219>
jmp    13d5 <GAUSS+0x2a5>
movq   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    13d0 <GAUSS+0x2a0>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    $0x0,%al
call   1030 <gauss@plt>
movsd  -0x90(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
call   1050 <pow@plt>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rdx
mov    (%rdx),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    1351 <GAUSS+0x221>
jmp    1457 <GAUSS+0x327>
movq   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1452 <GAUSS+0x322>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    $0x0,%al
call   1030 <gauss@plt>
movsd  -0xa0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x98(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rdx
mov    (%rdx),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    13dd <GAUSS+0x2ad>
jmp    1457 <GAUSS+0x327>
jmp    145c <GAUSS+0x32c>
jmp    1461 <GAUSS+0x331>
jmp    1466 <GAUSS+0x336>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GAUSS>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
xorpd  %xmm5,%xmm5
ucomisd %xmm5,%xmm1
jne    116e <GAUSS+0x3e>
jp     116e <GAUSS+0x3e>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
movaps %xmm4,%xmm3
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <DC@plt>
ucomisd 0xe8a(%rip),%xmm2
jne    11d3 <GAUSS+0xa3>
jp     11d3 <GAUSS+0xa3>
test   %rbx,%rbx
jle    11c9 <GAUSS+0x99>
movapd %xmm0,%xmm2
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
nop
xor    %eax,%eax
call   1030 <gauss@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
andpd  0xe5d(%rip),%xmm0
mov    (%r14),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%r14)
movlpd %xmm0,(%r15,%rax,8)
add    $0xffffffffffffffff,%rbx
jne    1190 <GAUSS+0x60>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm2
jne    124c <GAUSS+0x11c>
jp     124c <GAUSS+0x11c>
test   %rbx,%rbx
jle    11c9 <GAUSS+0x99>
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
jmp    1216 <GAUSS+0xe6>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%r14)
movsd  %xmm0,(%r15,%rax,8)
add    $0xffffffffffffffff,%rbx
je     11c9 <GAUSS+0x99>
xor    %eax,%eax
call   1030 <gauss@plt>
movapd %xmm0,%xmm1
mulsd  0x8(%rsp),%xmm1
addsd  0x10(%rsp),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jbe    1200 <GAUSS+0xd0>
xor    %eax,%eax
call   1030 <gauss@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
jmp    1200 <GAUSS+0xd0>
ucomisd 0xdb4(%rip),%xmm2
jne    1258 <GAUSS+0x128>
jnp    12b9 <GAUSS+0x189>
test   %rbx,%rbx
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm2,0x18(%rsp)
jle    11c9 <GAUSS+0x99>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <gauss@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
call   1050 <pow@plt>
mov    (%r14),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%r14)
movsd  %xmm0,(%r15,%rax,8)
add    $0xffffffffffffffff,%rbx
jne    1280 <GAUSS+0x150>
jmp    11c9 <GAUSS+0x99>
test   %rbx,%rbx
jle    11c9 <GAUSS+0x99>
movapd %xmm0,%xmm2
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <gauss@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
mov    (%r14),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%r14)
movsd  %xmm0,(%r15,%rax,8)
add    $0xffffffffffffffff,%rbx
jne    12e0 <GAUSS+0x1b0>
jmp    11c9 <GAUSS+0x99>

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

LLVM IR (-O2):
define void @GAUSS(double %0, double %1, double* %2, i64* %3, i64 %4, double %5, double %6, double %7) {
%9 = fcmp oeq double %1, 0.000000e+00
br i1 %9, label %10, label %12
10: ; preds = %8
%11 = tail call i32 @DC(double %0, double* %2, i64* %3, i64 %4, double %5, double %6, double %7)
br label %69
12: ; preds = %8
%13 = fcmp oeq double %5, -1.000000e+00
br i1 %13, label %14, label %26
14: ; preds = %12
%15 = icmp sgt i64 %4, 0
br i1 %15, label %16, label %69
16: ; preds = %14, %16
%17 = phi i64 [ %24, %16 ], [ 0, %14 ]
%18 = tail call double (...) @gauss()
%19 = tail call double @llvm.fmuladd.f64(double %1, double %18, double %0)
%20 = tail call double @llvm.fabs.f64(double %19)
%21 = load i64, i64* %3
%22 = add nsw i64 %21, 1
store i64 %22, i64* %3
%23 = getelementptr inbounds double, double* %2, i64 %21
store double %20, double* %23
%24 = add nuw nsw i64 %17, 1
%25 = icmp eq i64 %24, %4
br i1 %25, label %69, label %16
26: ; preds = %12
%27 = fcmp oeq double %5, 0.000000e+00
br i1 %27, label %28, label %45
28: ; preds = %26
%29 = icmp sgt i64 %4, 0
br i1 %29, label %30, label %69
30: ; preds = %28, %38
%31 = phi i64 [ %43, %38 ], [ 0, %28 ]
%32 = tail call double (...) @gauss()
%33 = tail call double @llvm.fmuladd.f64(double %1, double %32, double %0)
%34 = fcmp ogt double %33, 0.000000e+00
br i1 %34, label %35, label %38
35: ; preds = %30
%36 = tail call double (...) @gauss()
%37 = tail call double @llvm.fmuladd.f64(double %1, double %36, double %0)
br label %38
38: ; preds = %30, %35
%39 = phi double [ %37, %35 ], [ 0.000000e+00, %30 ]
%40 = load i64, i64* %3
%41 = add nsw i64 %40, 1
store i64 %41, i64* %3
%42 = getelementptr inbounds double, double* %2, i64 %40
store double %39, double* %42
%43 = add nuw nsw i64 %31, 1
%44 = icmp eq i64 %43, %4
br i1 %44, label %69, label %30
45: ; preds = %26
%46 = fcmp une double %5, 1.000000e+00
%47 = icmp sgt i64 %4, 0
br i1 %46, label %49, label %48
48: ; preds = %45
br i1 %47, label %60, label %69
49: ; preds = %45
br i1 %47, label %50, label %69
50: ; preds = %49, %50
%51 = phi i64 [ %58, %50 ], [ 0, %49 ]
%52 = tail call double (...) @gauss()
%53 = tail call double @llvm.fmuladd.f64(double %1, double %52, double %0)
%54 = tail call double @pow(double %53, double %5)
%55 = load i64, i64* %3
%56 = add nsw i64 %55, 1
store i64 %56, i64* %3
%57 = getelementptr inbounds double, double* %2, i64 %55
store double %54, double* %57
%58 = add nuw nsw i64 %51, 1
%59 = icmp eq i64 %58, %4
br i1 %59, label %69, label %50
60: ; preds = %48, %60
%61 = phi i64 [ %67, %60 ], [ 0, %48 ]
%62 = tail call double (...) @gauss()
%63 = tail call double @llvm.fmuladd.f64(double %1, double %62, double %0)
%64 = load i64, i64* %3
%65 = add nsw i64 %64, 1
store i64 %65, i64* %3
%66 = getelementptr inbounds double, double* %2, i64 %64
store double %63, double* %66
%67 = add nuw nsw i64 %61, 1
%68 = icmp eq i64 %67, %4
br i1 %68, label %69, label %60
69: ; preds = %60, %50, %38, %16, %48, %49, %28, %14, %10
ret void
}