#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();
void random16(unsigned char *k) {
  int i;
  for (i = 0; i < 16; ++i)
    k[i] = random();
}


x86 assembly (clang, -O0):
<random16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    114f <random16+0x3f>
mov    $0x0,%al
call   1030 <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    1123 <random16+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random16>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <random@plt>
mov    %al,(%rbx)
xor    %eax,%eax
call   1030 <random@plt>
mov    %al,0x1(%rbx)
xor    %eax,%eax
call   1030 <random@plt>
mov    %al,0x2(%rbx)
xor    %eax,%eax
call   1030 <random@plt>
mov    %al,0x3(%rbx)
xor    %eax,%eax
call   1030 <random@plt>
mov    %al,0x4(%rbx)
xor    %eax,%eax
call   1030 <random@plt>
mov    %al,0x5(%rbx)
xor    %eax,%eax
call   1030 <random@plt>
mov    %al,0x6(%rbx)
xor    %eax,%eax
call   1030 <random@plt>
mov    %al,0x7(%rbx)
xor    %eax,%eax
call   1030 <random@plt>
mov    %al,0x8(%rbx)
xor    %eax,%eax
call   1030 <random@plt>
mov    %al,0x9(%rbx)
xor    %eax,%eax
call   1030 <random@plt>
mov    %al,0xa(%rbx)
xor    %eax,%eax
call   1030 <random@plt>
mov    %al,0xb(%rbx)
xor    %eax,%eax
call   1030 <random@plt>
mov    %al,0xc(%rbx)
xor    %eax,%eax
call   1030 <random@plt>
mov    %al,0xd(%rbx)
xor    %eax,%eax
call   1030 <random@plt>
mov    %al,0xe(%rbx)
xor    %eax,%eax
call   1030 <random@plt>
mov    %al,0xf(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @random16(i8* nocapture writeonly %0) {
%2 = tail call zeroext i8 (...) @random()
store i8 %2, i8* %0
%3 = tail call zeroext i8 (...) @random()
%4 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %3, i8* %4
%5 = tail call zeroext i8 (...) @random()
%6 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %5, i8* %6
%7 = tail call zeroext i8 (...) @random()
%8 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %7, i8* %8
%9 = tail call zeroext i8 (...) @random()
%10 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %9, i8* %10
%11 = tail call zeroext i8 (...) @random()
%12 = getelementptr inbounds i8, i8* %0, i64 5
store i8 %11, i8* %12
%13 = tail call zeroext i8 (...) @random()
%14 = getelementptr inbounds i8, i8* %0, i64 6
store i8 %13, i8* %14
%15 = tail call zeroext i8 (...) @random()
%16 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %15, i8* %16
%17 = tail call zeroext i8 (...) @random()
%18 = getelementptr inbounds i8, i8* %0, i64 8
store i8 %17, i8* %18
%19 = tail call zeroext i8 (...) @random()
%20 = getelementptr inbounds i8, i8* %0, i64 9
store i8 %19, i8* %20
%21 = tail call zeroext i8 (...) @random()
%22 = getelementptr inbounds i8, i8* %0, i64 10
store i8 %21, i8* %22
%23 = tail call zeroext i8 (...) @random()
%24 = getelementptr inbounds i8, i8* %0, i64 11
store i8 %23, i8* %24
%25 = tail call zeroext i8 (...) @random()
%26 = getelementptr inbounds i8, i8* %0, i64 12
store i8 %25, i8* %26
%27 = tail call zeroext i8 (...) @random()
%28 = getelementptr inbounds i8, i8* %0, i64 13
store i8 %27, i8* %28
%29 = tail call zeroext i8 (...) @random()
%30 = getelementptr inbounds i8, i8* %0, i64 14
store i8 %29, i8* %30
%31 = tail call zeroext i8 (...) @random()
%32 = getelementptr inbounds i8, i8* %0, i64 15
store i8 %31, i8* %32
ret void
}