#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_oof(int /*<<< orphan*/ *, int /*<<< orphan*/ *, double *, double *,
                int /*<<< orphan*/);
void fill_vector_oof(int32_t *flat_state, int8_t *empty, double *gset,
                     double *oof_state, int32_t oof_state_size, double *array,
                     int num) {
  int i;
  for (i = 0; i < num; ++i) {
    array[i] = rand_oof(flat_state, empty, gset, oof_state, oof_state_size);
  }
}


x86 assembly (clang, -O0):
<fill_vector_oof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    117a <fill_vector_oof+0x6a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <rand_oof@plt>
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    113a <fill_vector_oof+0x2a>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_vector_oof>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    0x50(%rsp),%eax
test   %eax,%eax
jle    117a <fill_vector_oof+0x6a>
mov    %r8d,%r13d
mov    %rcx,%rbx
mov    %rdx,%rbp
mov    %rsi,%r14
mov    %rdi,%r12
mov    %eax,%eax
mov    %rax,0x8(%rsp)
xor    %r15d,%r15d
mov    %r9,0x10(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r12,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
mov    %rbx,%rcx
mov    %r13d,%r8d
call   1030 <rand_oof@plt>
mov    0x10(%rsp),%r9
movsd  %xmm0,(%r9,%r15,8)
add    $0x1,%r15
cmp    %r15,0x8(%rsp)
jne    1150 <fill_vector_oof+0x40>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @fill_vector_oof(i32* %0, i32* %1, double* %2, double* %3, i32 %4, double* %5, i32 %6) {
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca double*
%11 = alloca double*
%12 = alloca i32
%13 = alloca double*
%14 = alloca i32
%15 = alloca i32
store i32* %0, i32** %8
store i32* %1, i32** %9
store double* %2, double** %10
store double* %3, double** %11
store i32 %4, i32* %12
store double* %5, double** %13
store i32 %6, i32* %14
store i32 0, i32* %15
br label %16
16: ; preds = %31, %7
%17 = load i32, i32* %15
%18 = load i32, i32* %14
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %34
20: ; preds = %16
%21 = load i32*, i32** %8
%22 = load i32*, i32** %9
%23 = load double*, double** %10
%24 = load double*, double** %11
%25 = load i32, i32* %12
%26 = call double @rand_oof(i32* %21, i32* %22, double* %23, double* %24, i32 %25)
%27 = load double*, double** %13
%28 = load i32, i32* %15
%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* %15
%33 = add nsw i32 %32, 1
store i32 %33, i32* %15
br label %16
34: ; preds = %16
ret void
}

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