#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*/ time_t;

/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void initialData(float *ip, int size) {
  time_t t;
  srand((unsigned)time(&t));
  for (int i = 0; i < size; i++) {
    ip[i] = (float)(rand() & 0xFF) / 10.0f;
  }
  return;
}


x86 assembly (clang, -O0):
<initialData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1199 <initialData+0x69>
mov    $0x0,%al
call   1050 <rand@plt>
and    $0xff,%eax
cvtsi2ss %eax,%xmm0
movss  0xe86(%rip),%xmm1
divss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1156 <initialData+0x26>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialData>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebp
mov    %rdi,%r14
lea    0xc(%rsp),%rdi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
test   %ebp,%ebp
jle    1188 <initialData+0x58>
mov    %ebp,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <rand@plt>
movzbl %al,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
divss  0xe87(%rip),%xmm0
movss  %xmm0,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1160 <initialData+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @initialData(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
%7 = call i64 @time(i32* %5)
%8 = trunc i64 %7 to i32
%9 = call i32 @srand(i32 %8)
store i32 0, i32* %6
br label %10
10: ; preds = %23, %2
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %26
14: ; preds = %10
%15 = call i32 (...) @rand()
%16 = and i32 %15, 255
%17 = sitofp i32 %16 to float
%18 = fdiv float %17, 1.000000e+01
%19 = load float*, float** %3
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds float, float* %19, i64 %21
store float %18, float* %22
br label %23
23: ; preds = %14
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %10
26: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @initialData(float* nocapture writeonly %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i64 @time(i32* %3)
%6 = trunc i64 %5 to i32
%7 = call i32 @srand(i32 %6)
%8 = icmp sgt i32 %1, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = zext i32 %1 to i64
br label %12
11: ; preds = %12, %2
ret void
12: ; preds = %9, %12
%13 = phi i64 [ 0, %9 ], [ %19, %12 ]
%14 = call i32 (...) @rand()
%15 = and i32 %14, 255
%16 = sitofp i32 %15 to float
%17 = fdiv float %16, 1.000000e+01
%18 = getelementptr inbounds float, float* %0, i64 %13
store float %17, float* %18
%19 = add nuw nsw i64 %13, 1
%20 = icmp eq i64 %19, %10
br i1 %20, label %11, label %12
}