#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 */
unsigned char random();
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void id_create(unsigned char *id_hash) {
  int i;
  srandom(time(NULL));
  for (i = 0; i < (160 / 8); i++)
    id_hash[i] = random();
  return;
}


x86 assembly (clang, -O0):
<id_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    117f <id_create+0x4f>
mov    $0x0,%al
call   1050 <random@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1153 <id_create+0x23>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<id_create>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
xor    %eax,%eax
call   1050 <random@plt>
mov    %al,(%rbx)
xor    %eax,%eax
call   1050 <random@plt>
mov    %al,0x1(%rbx)
xor    %eax,%eax
call   1050 <random@plt>
mov    %al,0x2(%rbx)
xor    %eax,%eax
call   1050 <random@plt>
mov    %al,0x3(%rbx)
xor    %eax,%eax
call   1050 <random@plt>
mov    %al,0x4(%rbx)
xor    %eax,%eax
call   1050 <random@plt>
mov    %al,0x5(%rbx)
xor    %eax,%eax
call   1050 <random@plt>
mov    %al,0x6(%rbx)
xor    %eax,%eax
call   1050 <random@plt>
mov    %al,0x7(%rbx)
xor    %eax,%eax
call   1050 <random@plt>
mov    %al,0x8(%rbx)
xor    %eax,%eax
call   1050 <random@plt>
mov    %al,0x9(%rbx)
xor    %eax,%eax
call   1050 <random@plt>
mov    %al,0xa(%rbx)
xor    %eax,%eax
call   1050 <random@plt>
mov    %al,0xb(%rbx)
xor    %eax,%eax
call   1050 <random@plt>
mov    %al,0xc(%rbx)
xor    %eax,%eax
call   1050 <random@plt>
mov    %al,0xd(%rbx)
xor    %eax,%eax
call   1050 <random@plt>
mov    %al,0xe(%rbx)
xor    %eax,%eax
call   1050 <random@plt>
mov    %al,0xf(%rbx)
xor    %eax,%eax
call   1050 <random@plt>
mov    %al,0x10(%rbx)
xor    %eax,%eax
call   1050 <random@plt>
mov    %al,0x11(%rbx)
xor    %eax,%eax
call   1050 <random@plt>
mov    %al,0x12(%rbx)
xor    %eax,%eax
call   1050 <random@plt>
mov    %al,0x13(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @id_create(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @time(i32* null)
%5 = call i32 @srandom(i32 %4)
store i32 0, i32* %3
br label %6
6: ; preds = %15, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 20
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = call zeroext i8 (...) @random()
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 %10, i8* %14
br label %15
15: ; preds = %9
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @id_create(i8* nocapture writeonly %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srandom(i32 %2)
%4 = tail call zeroext i8 (...) @random()
store i8 %4, i8* %0
%5 = tail call zeroext i8 (...) @random()
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = tail call zeroext i8 (...) @random()
%8 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %7, i8* %8
%9 = tail call zeroext i8 (...) @random()
%10 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %9, i8* %10
%11 = tail call zeroext i8 (...) @random()
%12 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %11, i8* %12
%13 = tail call zeroext i8 (...) @random()
%14 = getelementptr inbounds i8, i8* %0, i64 5
store i8 %13, i8* %14
%15 = tail call zeroext i8 (...) @random()
%16 = getelementptr inbounds i8, i8* %0, i64 6
store i8 %15, i8* %16
%17 = tail call zeroext i8 (...) @random()
%18 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %17, i8* %18
%19 = tail call zeroext i8 (...) @random()
%20 = getelementptr inbounds i8, i8* %0, i64 8
store i8 %19, i8* %20
%21 = tail call zeroext i8 (...) @random()
%22 = getelementptr inbounds i8, i8* %0, i64 9
store i8 %21, i8* %22
%23 = tail call zeroext i8 (...) @random()
%24 = getelementptr inbounds i8, i8* %0, i64 10
store i8 %23, i8* %24
%25 = tail call zeroext i8 (...) @random()
%26 = getelementptr inbounds i8, i8* %0, i64 11
store i8 %25, i8* %26
%27 = tail call zeroext i8 (...) @random()
%28 = getelementptr inbounds i8, i8* %0, i64 12
store i8 %27, i8* %28
%29 = tail call zeroext i8 (...) @random()
%30 = getelementptr inbounds i8, i8* %0, i64 13
store i8 %29, i8* %30
%31 = tail call zeroext i8 (...) @random()
%32 = getelementptr inbounds i8, i8* %0, i64 14
store i8 %31, i8* %32
%33 = tail call zeroext i8 (...) @random()
%34 = getelementptr inbounds i8, i8* %0, i64 15
store i8 %33, i8* %34
%35 = tail call zeroext i8 (...) @random()
%36 = getelementptr inbounds i8, i8* %0, i64 16
store i8 %35, i8* %36
%37 = tail call zeroext i8 (...) @random()
%38 = getelementptr inbounds i8, i8* %0, i64 17
store i8 %37, i8* %38
%39 = tail call zeroext i8 (...) @random()
%40 = getelementptr inbounds i8, i8* %0, i64 18
store i8 %39, i8* %40
%41 = tail call zeroext i8 (...) @random()
%42 = getelementptr inbounds i8, i8* %0, i64 19
store i8 %41, i8* %42
ret void
}