#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();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void initiate(int *origin) {
  int i;
  int count;
  int j;
  int *status = origin;
  srand((unsigned)time(NULL));
  i = rand() % 16;
  do {
    j = rand() % 16;
  } while (j == i);
  for (count = 0; count <= 15; count++) {
    if (count == i) {
      *status = 1;
      if ((rand() % 10) == 9)
        (*status)++;
    } else if (count == j) {
      *status = 1;
      if ((rand() % 10) == 9)
        (*status)++;
    } else
      *status = 0;
    status++;
  }
}


x86 assembly (clang, -O0):
<initiate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1166 <initiate+0x36>
movl   $0x0,-0x10(%rbp)
cmpl   $0xf,-0x10(%rbp)
jg     123a <initiate+0x10a>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    11d3 <initiate+0xa3>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x9,%edx
jne    11ce <initiate+0x9e>
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    1220 <initiate+0xf0>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1211 <initiate+0xe1>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x9,%edx
jne    120c <initiate+0xdc>
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    121b <initiate+0xeb>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
jmp    1220 <initiate+0xf0>
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    118b <initiate+0x5b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initiate>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
mov    %eax,%ebx
lea    0xf(%rbx),%eax
test   %ebx,%ebx
cmovns %ebx,%eax
and    $0xfffffff0,%eax
sub    %eax,%ebx
nop
xor    %eax,%eax
call   1050 <rand@plt>
lea    0xf(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffff0,%ecx
sub    %ecx,%eax
cmp    %ebx,%eax
je     1160 <initiate+0x30>
mov    %ebx,%r12d
mov    %eax,%r15d
xor    %ebx,%ebx
jmp    119d <initiate+0x6d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    $0x10,%ebx
je     11e3 <initiate+0xb3>
cmp    %ebx,%r12d
je     11a9 <initiate+0x79>
xor    %eax,%eax
cmp    %ebx,%r15d
jne    1190 <initiate+0x60>
movl   $0x1,(%r14,%rbx,4)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cmp    $0x9,%eax
jne    1194 <initiate+0x64>
mov    (%r14,%rbx,4),%eax
add    $0x1,%eax
jmp    1190 <initiate+0x60>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @initiate(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32* %0, i32** %2
%7 = load i32*, i32** %2
store i32* %7, i32** %6
%8 = call i64 @time(i32* null)
%9 = trunc i64 %8 to i32
%10 = call i32 @srand(i32 %9)
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 16
store i32 %12, i32* %3
br label %13
13: ; preds = %16, %1
%14 = call i32 (...) @rand()
%15 = srem i32 %14, 16
store i32 %15, i32* %5
br label %16
16: ; preds = %13
%17 = load i32, i32* %5
%18 = load i32, i32* %3
%19 = icmp eq i32 %17, %18
br i1 %19, label %13, label %20
20: ; preds = %16
store i32 0, i32* %4
br label %21
21: ; preds = %58, %20
%22 = load i32, i32* %4
%23 = icmp sle i32 %22, 15
br i1 %23, label %24, label %61
24: ; preds = %21
%25 = load i32, i32* %4
%26 = load i32, i32* %3
%27 = icmp eq i32 %25, %26
br i1 %27, label %28, label %38
28: ; preds = %24
%29 = load i32*, i32** %6
store i32 1, i32* %29
%30 = call i32 (...) @rand()
%31 = srem i32 %30, 10
%32 = icmp eq i32 %31, 9
br i1 %32, label %33, label %37
33: ; preds = %28
%34 = load i32*, i32** %6
%35 = load i32, i32* %34
%36 = add nsw i32 %35, 1
store i32 %36, i32* %34
br label %37
37: ; preds = %33, %28
br label %55
38: ; preds = %24
%39 = load i32, i32* %4
%40 = load i32, i32* %5
%41 = icmp eq i32 %39, %40
br i1 %41, label %42, label %52
42: ; preds = %38
%43 = load i32*, i32** %6
store i32 1, i32* %43
%44 = call i32 (...) @rand()
%45 = srem i32 %44, 10
%46 = icmp eq i32 %45, 9
br i1 %46, label %47, label %51
47: ; preds = %42
%48 = load i32*, i32** %6
%49 = load i32, i32* %48
%50 = add nsw i32 %49, 1
store i32 %50, i32* %48
br label %51
51: ; preds = %47, %42
br label %54
52: ; preds = %38
%53 = load i32*, i32** %6
store i32 0, i32* %53
br label %54
54: ; preds = %52, %51
br label %55
55: ; preds = %54, %37
%56 = load i32*, i32** %6
%57 = getelementptr inbounds i32, i32* %56, i32 1
store i32* %57, i32** %6
br label %58
58: ; preds = %55
%59 = load i32, i32* %4
%60 = add nsw i32 %59, 1
store i32 %60, i32* %4
br label %21
61: ; preds = %21
ret void
}

LLVM IR (-O2):
define void @initiate(i32* nocapture %0) {
%2 = tail call i64 @time(i32* null)
%3 = trunc i64 %2 to i32
%4 = tail call i32 @srand(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 16
br label %7
7: ; preds = %7, %1
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, 16
%10 = icmp eq i32 %9, %6
br i1 %10, label %7, label %11
11: ; preds = %7, %30
%12 = phi i32* [ %31, %30 ], [ %0, %7 ]
%13 = phi i32 [ %32, %30 ], [ 0, %7 ]
%14 = icmp eq i32 %13, %6
br i1 %14, label %15, label %19
15: ; preds = %11
store i32 1, i32* %12
%16 = tail call i32 (...) @rand()
%17 = srem i32 %16, 10
%18 = icmp eq i32 %17, 9
br i1 %18, label %25, label %30
19: ; preds = %11
%20 = icmp eq i32 %13, %9
br i1 %20, label %21, label %28
21: ; preds = %19
store i32 1, i32* %12
%22 = tail call i32 (...) @rand()
%23 = srem i32 %22, 10
%24 = icmp eq i32 %23, 9
br i1 %24, label %25, label %30
25: ; preds = %21, %15
%26 = load i32, i32* %12
%27 = add nsw i32 %26, 1
br label %28
28: ; preds = %25, %19
%29 = phi i32 [ 0, %19 ], [ %27, %25 ]
store i32 %29, i32* %12
br label %30
30: ; preds = %28, %21, %15
%31 = getelementptr inbounds i32, i32* %12, i64 1
%32 = add nuw nsw i32 %13, 1
%33 = icmp eq i32 %32, 16
br i1 %33, label %34, label %11
34: ; preds = %30
ret void
}