#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 int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
double rand_oof2(int /*<<< orphan*/ *, int /*<<< orphan*/ *, double *,
                 double *);
void fill_vector_oof2(int32_t *flat_state, int8_t *empty, double *gset,
                      double *oof2_state, double *array, int num) {
  int i;
  for (i = 0; i < num; ++i) {
    array[i] = rand_oof2(flat_state, empty, gset, oof2_state);
  }
}


x86 assembly (clang, -O0):
<fill_vector_oof2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1173 <fill_vector_oof2+0x63>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <rand_oof2@plt>
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1137 <fill_vector_oof2+0x27>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_vector_oof2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %r9d,%r9d
jle    1161 <fill_vector_oof2+0x51>
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    %r9d,%eax
mov    %rax,(%rsp)
xor    %r14d,%r14d
nopl   0x0(%rax)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
mov    %r12,%rcx
call   1030 <rand_oof2@plt>
movsd  %xmm0,(%r15,%r14,8)
add    $0x1,%r14
cmp    %r14,(%rsp)
jne    1140 <fill_vector_oof2+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @fill_vector_oof2(i32* %0, i32* %1, double* %2, double* %3, double* nocapture writeonly %4, i32 %5) {
%7 = icmp sgt i32 %5, 0
br i1 %7, label %8, label %16
8: ; preds = %6
%9 = zext i32 %5 to i64
br label %10
10: ; preds = %8, %10
%11 = phi i64 [ 0, %8 ], [ %14, %10 ]
%12 = tail call double @rand_oof2(i32* %0, i32* %1, double* %2, double* %3)
%13 = getelementptr inbounds double, double* %4, i64 %11
store double %12, double* %13
%14 = add nuw nsw i64 %11, 1
%15 = icmp eq i64 %14, %9
br i1 %15, label %16, label %10
16: ; preds = %10, %6
ret void
}