#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 rand();
void random_genes(char *arr) {
  for (int i = 0; i < 16; ++i) {
    arr[i] = (char)(rand() % 14);
  }
}


x86 assembly (clang, -O0):
<random_genes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1155 <random_genes+0x45>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xe,%ecx
cltd
idiv   %ecx
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 <random_genes+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_genes>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x3,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
mov    %sil,(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x3,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
mov    %sil,0x1(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x3,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
mov    %sil,0x2(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x3,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
mov    %sil,0x3(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x3,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
mov    %sil,0x4(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x3,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
mov    %sil,0x5(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x3,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
mov    %sil,0x6(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x3,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
mov    %sil,0x7(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x3,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
mov    %sil,0x8(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x3,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
mov    %sil,0x9(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x3,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
mov    %sil,0xa(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x3,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
mov    %sil,0xb(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x3,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
mov    %sil,0xc(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x3,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
mov    %sil,0xd(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x3,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
mov    %sil,0xe(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x3,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
mov    %sil,0xf(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @random_genes(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %15, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 16
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = call i32 (...) @rand()
%9 = srem i32 %8, 14
%10 = trunc i32 %9 to i8
%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 = %7
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @random_genes(i8* nocapture writeonly %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 14
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 14
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %7, i8* %8
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, 14
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %11, i8* %12
%13 = tail call i32 (...) @rand()
%14 = srem i32 %13, 14
%15 = trunc i32 %14 to i8
%16 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %15, i8* %16
%17 = tail call i32 (...) @rand()
%18 = srem i32 %17, 14
%19 = trunc i32 %18 to i8
%20 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %19, i8* %20
%21 = tail call i32 (...) @rand()
%22 = srem i32 %21, 14
%23 = trunc i32 %22 to i8
%24 = getelementptr inbounds i8, i8* %0, i64 5
store i8 %23, i8* %24
%25 = tail call i32 (...) @rand()
%26 = srem i32 %25, 14
%27 = trunc i32 %26 to i8
%28 = getelementptr inbounds i8, i8* %0, i64 6
store i8 %27, i8* %28
%29 = tail call i32 (...) @rand()
%30 = srem i32 %29, 14
%31 = trunc i32 %30 to i8
%32 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %31, i8* %32
%33 = tail call i32 (...) @rand()
%34 = srem i32 %33, 14
%35 = trunc i32 %34 to i8
%36 = getelementptr inbounds i8, i8* %0, i64 8
store i8 %35, i8* %36
%37 = tail call i32 (...) @rand()
%38 = srem i32 %37, 14
%39 = trunc i32 %38 to i8
%40 = getelementptr inbounds i8, i8* %0, i64 9
store i8 %39, i8* %40
%41 = tail call i32 (...) @rand()
%42 = srem i32 %41, 14
%43 = trunc i32 %42 to i8
%44 = getelementptr inbounds i8, i8* %0, i64 10
store i8 %43, i8* %44
%45 = tail call i32 (...) @rand()
%46 = srem i32 %45, 14
%47 = trunc i32 %46 to i8
%48 = getelementptr inbounds i8, i8* %0, i64 11
store i8 %47, i8* %48
%49 = tail call i32 (...) @rand()
%50 = srem i32 %49, 14
%51 = trunc i32 %50 to i8
%52 = getelementptr inbounds i8, i8* %0, i64 12
store i8 %51, i8* %52
%53 = tail call i32 (...) @rand()
%54 = srem i32 %53, 14
%55 = trunc i32 %54 to i8
%56 = getelementptr inbounds i8, i8* %0, i64 13
store i8 %55, i8* %56
%57 = tail call i32 (...) @rand()
%58 = srem i32 %57, 14
%59 = trunc i32 %58 to i8
%60 = getelementptr inbounds i8, i8* %0, i64 14
store i8 %59, i8* %60
%61 = tail call i32 (...) @rand()
%62 = srem i32 %61, 14
%63 = trunc i32 %62 to i8
%64 = getelementptr inbounds i8, i8* %0, i64 15
store i8 %63, i8* %64
ret void
}