#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*/ assert(int);
int IsPvals(const double *pval, const int n) {
  int i;
  assert(NULL != pval);
  assert(n > 0);
  for (i = 0; i < n; i++) {
    if (pval[i] < 0. || pval[i] > 1.) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<IsPvals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0x14(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11aa <IsPvals+0x9a>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
xorps  %xmm0,%xmm0
ucomisd (%rax,%rcx,8),%xmm0
ja     118b <IsPvals+0x7b>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xe7f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1197 <IsPvals+0x87>
movl   $0x0,-0x4(%rbp)
jmp    11b1 <IsPvals+0xa1>
jmp    119c <IsPvals+0x8c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114a <IsPvals+0x3a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsPvals>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %ebp,%ebp
setg   %dil
call   1030 <assert@plt>
mov    $0x1,%eax
test   %ebp,%ebp
jle    116e <IsPvals+0x5e>
mov    %ebp,%ecx
xor    %edx,%edx
xorpd  %xmm0,%xmm0
movsd  0xeb4(%rip),%xmm1
nopl   0x0(%rax)
movsd  (%rbx,%rdx,8),%xmm2
ucomisd %xmm2,%xmm0
ja     116c <IsPvals+0x5c>
ucomisd %xmm1,%xmm2
ja     116c <IsPvals+0x5c>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1150 <IsPvals+0x40>
jmp    116e <IsPvals+0x5e>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @IsPvals(double* %0, i32 %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
store double* %0, double** %4
store i32 %1, i32* %5
%7 = load double*, double** %4
%8 = icmp ne double* null, %7
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %5
%12 = icmp sgt i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
store i32 0, i32* %6
br label %15
15: ; preds = %35, %2
%16 = load i32, i32* %6
%17 = load i32, i32* %5
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %38
19: ; preds = %15
%20 = load double*, double** %4
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double, double* %20, i64 %22
%24 = load double, double* %23
%25 = fcmp olt double %24, 0.000000e+00
br i1 %25, label %33, label %26
26: ; preds = %19
%27 = load double*, double** %4
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %27, i64 %29
%31 = load double, double* %30
%32 = fcmp ogt double %31, 1.000000e+00
br i1 %32, label %33, label %34
33: ; preds = %26, %19
store i32 0, i32* %3
br label %39
34: ; preds = %26
br label %35
35: ; preds = %34
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
store i32 %37, i32* %6
br label %15
38: ; preds = %15
store i32 1, i32* %3
br label %39
39: ; preds = %38, %33
%40 = load i32, i32* %3
ret i32 %40
}

LLVM IR (-O2):
define i32 @IsPvals(double* %0, i32 %1) {
%3 = icmp ne double* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp sgt i32 %1, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
br i1 %6, label %9, label %21
9: ; preds = %2
%10 = zext i32 %1 to i64
br label %13
11: ; preds = %13
%12 = icmp eq i64 %20, %10
br i1 %12, label %21, label %13
13: ; preds = %9, %11
%14 = phi i64 [ 0, %9 ], [ %20, %11 ]
%15 = getelementptr inbounds double, double* %0, i64 %14
%16 = load double, double* %15
%17 = fcmp olt double %16, 0.000000e+00
%18 = fcmp ogt double %16, 1.000000e+00
%19 = or i1 %17, %18
%20 = add nuw nsw i64 %14, 1
br i1 %19, label %21, label %11
21: ; preds = %13, %11, %2
%22 = phi i32 [ 1, %2 ], [ 1, %11 ], [ 0, %13 ]
ret i32 %22
}