#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*/ mt_init_by_seed_array(unsigned long *, int);
unsigned long rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void mt_init_by_seed_rand_array(void) {
  int i;
  unsigned long k[256];
  srand((unsigned int)time(NULL));
  for (i = 0; i < 256; i++)
    k[i] = rand();
  mt_init_by_seed_array(k, 256);
}


x86 assembly (clang, -O0):
<mt_init_by_seed_rand_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1193 <mt_init_by_seed_rand_array+0x53>
mov    $0x0,%al
call   1060 <rand@plt>
mov    %rax,%rcx
movslq -0x4(%rbp),%rax
mov    %rcx,-0x810(%rbp,%rax,8)
ff
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <mt_init_by_seed_rand_array+0x22>
lea    -0x810(%rbp),%rdi
mov    $0x100,%esi
call   1050 <mt_init_by_seed_array@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_init_by_seed_rand_array>:
push   %rbx
sub    $0x800,%rsp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <rand@plt>
mov    %rax,(%rsp,%rbx,8)
add    $0x1,%rbx
cmp    $0x100,%rbx
jne    1160 <mt_init_by_seed_rand_array+0x20>
mov    %rsp,%rdi
mov    $0x100,%esi
call   1050 <mt_init_by_seed_array@plt>
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @mt_init_by_seed_rand_array() {
%1 = alloca i32
%2 = alloca [256 x i64]
%3 = call i64 @time(i32* null)
%4 = trunc i64 %3 to i32
%5 = call i32 @srand(i32 %4)
store i32 0, i32* %1
br label %6
6: ; preds = %14, %0
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 256
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = call i64 (...) @rand()
%11 = load i32, i32* %1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [256 x i64], [256 x i64]* %2, i64 0, i64 %12
store i64 %10, i64* %13
br label %14
14: ; preds = %9
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %6
17: ; preds = %6
%18 = getelementptr inbounds [256 x i64], [256 x i64]* %2, i64 0, i64 0
%19 = call i32 @mt_init_by_seed_array(i64* %18, i32 256)
ret void
}

LLVM IR (-O2):
define void @mt_init_by_seed_rand_array() {
%1 = alloca [256 x i64]
%2 = bitcast [256 x i64]* %1 to i8*
%3 = tail call i64 @time(i32* null)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @srand(i32 %4)
br label %6
6: ; preds = %0, %6
%7 = phi i64 [ 0, %0 ], [ %10, %6 ]
%8 = tail call i64 (...) @rand()
%9 = getelementptr inbounds [256 x i64], [256 x i64]* %1, i64 0, i64 %7
store i64 %8, i64* %9
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, 256
br i1 %11, label %12, label %6
12: ; preds = %6
%13 = getelementptr inbounds [256 x i64], [256 x i64]* %1, i64 0, i64 0
%14 = call i32 @mt_init_by_seed_array(i64* %13, i32 256)
ret void
}