#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 scalar_t__ time_t;

/* Variables and functions */
int rand();
scalar_t__ rawTime;
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void genIntDatas(int data[], int len) {
  int i, r;
  time_t rawTime = time(&rawTime);
  srand((unsigned int)rawTime);
  for (i = 0; i < len; i++) {
    data[i] = (rand() % 98) + 1;
  }
}


x86 assembly (clang, -O0):
<genIntDatas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <time@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1195 <genIntDatas+0x65>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x62,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115e <genIntDatas+0x2e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genIntDatas>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebp
mov    %rdi,%r14
lea    0x8(%rsp),%rdi
call   1040 <time@plt>
mov    %rax,0x8(%rsp)
mov    %eax,%edi
call   1030 <srand@plt>
test   %ebp,%ebp
jle    1194 <genIntDatas+0x64>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x5397829d,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x62,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1160 <genIntDatas+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@rawTime = global i64 0
define void @genIntDatas(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i32* %0, i32** %3
store i32 %1, i32* %4
%8 = bitcast i64* %7 to i32*
%9 = call i64 @time(i32* %8)
store i64 %9, i64* %7
%10 = load i64, i64* %7
%11 = trunc i64 %10 to i32
%12 = call i32 @srand(i32 %11)
store i32 0, i32* %5
br label %13
13: ; preds = %25, %2
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %28
17: ; preds = %13
%18 = call i32 (...) @rand()
%19 = srem i32 %18, 98
%20 = add nsw i32 %19, 1
%21 = load i32*, i32** %3
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
store i32 %20, i32* %24
br label %25
25: ; preds = %17
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %13
28: ; preds = %13
ret void
}

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