#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 generateRandomAns(int arr[]) {
  arr[0] = arr[1] = arr[2] = 0;
  while (arr[0] == arr[1] || arr[1] == arr[2]) {
    arr[0] = rand() % 9 + 1;
    arr[1] = rand() % 9 + 1;
    arr[2] = rand() % 9 + 1;
  }
}


x86 assembly (clang, -O0):
<generateRandomAns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rdx
mov    $0x1,%al
cmp    0x4(%rdx),%ecx
mov    %al,-0x9(%rbp)
je     1168 <generateRandomAns+0x58>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x8(%rbp),%rcx
cmp    0x8(%rcx),%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1178 <generateRandomAns+0x68>
jmp    11c7 <generateRandomAns+0xb7>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x9,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    -0x8(%rbp),%rax
mov    %edx,(%rax)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x9,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    -0x8(%rbp),%rax
mov    %edx,0x4(%rax)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x9,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    -0x8(%rbp),%rax
mov    %edx,0x8(%rax)
jmp    113c <generateRandomAns+0x2c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateRandomAns>:
push   %rbx
mov    %rdi,%rbx
movl   $0x0,0x8(%rdi)
movq   $0x0,(%rdi)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,0x4(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,0x8(%rbx)
mov    0x4(%rbx),%ecx
cmp    %ecx,(%rbx)
je     1130 <generateRandomAns+0x20>
cmp    %eax,%ecx
je     1130 <generateRandomAns+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @generateRandomAns(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
store i32 0, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 0, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 0, i32* %8
br label %9
9: ; preds = %27, %1
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = icmp eq i32 %12, %15
br i1 %16, label %25, label %17
17: ; preds = %9
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 1
%20 = load i32, i32* %19
%21 = load i32*, i32** %2
%22 = getelementptr inbounds i32, i32* %21, i64 2
%23 = load i32, i32* %22
%24 = icmp eq i32 %20, %23
br label %25
25: ; preds = %17, %9
%26 = phi i1 [ true, %9 ], [ %24, %17 ]
br i1 %26, label %27, label %43
27: ; preds = %25
%28 = call i32 (...) @rand()
%29 = srem i32 %28, 9
%30 = add nsw i32 %29, 1
%31 = load i32*, i32** %2
%32 = getelementptr inbounds i32, i32* %31, i64 0
store i32 %30, i32* %32
%33 = call i32 (...) @rand()
%34 = srem i32 %33, 9
%35 = add nsw i32 %34, 1
%36 = load i32*, i32** %2
%37 = getelementptr inbounds i32, i32* %36, i64 1
store i32 %35, i32* %37
%38 = call i32 (...) @rand()
%39 = srem i32 %38, 9
%40 = add nsw i32 %39, 1
%41 = load i32*, i32** %2
%42 = getelementptr inbounds i32, i32* %41, i64 2
store i32 %40, i32* %42
br label %9
43: ; preds = %25
ret void
}

LLVM IR (-O2):
define void @generateRandomAns(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
store i32 0, i32* %2
%3 = getelementptr inbounds i32, i32* %0, i64 1
store i32 0, i32* %3
store i32 0, i32* %0
br label %4
4: ; preds = %1, %4
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 9
%7 = add nsw i32 %6, 1
store i32 %7, i32* %0
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, 9
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = tail call i32 (...) @rand()
%12 = srem i32 %11, 9
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
%14 = load i32, i32* %0
%15 = load i32, i32* %3
%16 = icmp eq i32 %14, %15
%17 = icmp eq i32 %15, %13
%18 = select i1 %16, i1 true, i1 %17
br i1 %18, label %4, label %19
19: ; preds = %4
ret void
}