#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 /*<<< orphan*/ cumfnc(double *, double *, double *, double *, double *,
                          double *);
void nfdis_cdfc(int n, double a, double b, double c, double *x, double *array) {
  int i;
  double p, q;
  for (i = 0; i < n; i++) {
    cumfnc(&x[i], &a, &b, &c, &p, &q);
    *(array + i) = p;
  }
}


x86 assembly (clang, -O0):
<nfdis_cdfc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    118d <nfdis_cdfc+0x7d>
mov    -0x28(%rbp),%rdi
movslq -0x34(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x40(%rbp),%r8
lea    -0x48(%rbp),%r9
call   1030 <cumfnc@plt>
movsd  -0x40(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1139 <nfdis_cdfc+0x29>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nfdis_cdfc>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movsd  %xmm0,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
test   %edi,%edi
jle    1182 <nfdis_cdfc+0x72>
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%r12d
shl    $0x3,%r12
xor    %r13d,%r13d
mov    %rsp,%rbp
lea    0x20(%rsp),%r15
nopl   0x0(%rax)
lea    (%rbx,%r13,1),%rdi
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rbp,%r8
mov    %r15,%r9
call   1030 <cumfnc@plt>
movsd  (%rsp),%xmm0
movsd  %xmm0,(%r14,%r13,1)
add    $0x8,%r13
cmp    %r13,%r12
jne    1150 <nfdis_cdfc+0x40>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @nfdis_cdfc(i32 %0, double %1, double %2, double %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double*
%12 = alloca double*
%13 = alloca i32
%14 = alloca double
%15 = alloca double
store i32 %0, i32* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double* %4, double** %11
store double* %5, double** %12
store i32 0, i32* %13
br label %16
16: ; preds = %31, %6
%17 = load i32, i32* %13
%18 = load i32, i32* %7
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %34
20: ; preds = %16
%21 = load double*, double** %11
%22 = load i32, i32* %13
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds double, double* %21, i64 %23
%25 = call i32 @cumfnc(double* %24, double* %8, double* %9, double* %10, double* %14, double* %15)
%26 = load double, double* %14
%27 = load double*, double** %12
%28 = load i32, i32* %13
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %27, i64 %29
store double %26, double* %30
br label %31
31: ; preds = %20
%32 = load i32, i32* %13
%33 = add nsw i32 %32, 1
store i32 %33, i32* %13
br label %16
34: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @nfdis_cdfc(i32 %0, double %1, double %2, double %3, double* %4, double* nocapture writeonly %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
%12 = bitcast double* %10 to i8*
%13 = bitcast double* %11 to i8*
%14 = icmp sgt i32 %0, 0
br i1 %14, label %15, label %25
15: ; preds = %6
%16 = zext i32 %0 to i64
br label %17
17: ; preds = %15, %17
%18 = phi i64 [ 0, %15 ], [ %23, %17 ]
%19 = getelementptr inbounds double, double* %4, i64 %18
%20 = call i32 @cumfnc(double* %19, double* %7, double* %8, double* %9, double* %10, double* %11)
%21 = load double, double* %10
%22 = getelementptr inbounds double, double* %5, i64 %18
store double %21, double* %22
%23 = add nuw nsw i64 %18, 1
%24 = icmp eq i64 %23, %16
br i1 %24, label %25, label %17
25: ; preds = %17, %6
ret void
}