#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 /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ shuffle(int *, int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srand(time(NULL));
  int roll[8] = {0, 1, 2, 3, 4, 5, 6, 7};
  shuffle(roll, 8);
  int resultado[6];
  for (int i = 0; i < 3; i++) {
    resultado[i] = roll[i];
    resultado[i + 3] = roll[i];
  }
  shuffle(resultado, 6);
  for (int i = 0; i < 6; i++)
    printf("%d ", resultado[i]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    0xe9a(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe97(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe94(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe91(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1030 <shuffle@plt>
movl   $0x0,-0x54(%rbp)
cmpl   $0x3,-0x54(%rbp)
jge    11dc <main+0x9c>
movslq -0x54(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%ecx
movslq -0x54(%rbp),%rax
mov    %ecx,-0x50(%rbp,%rax,4)
movslq -0x54(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%ecx
mov    -0x54(%rbp),%eax
add    $0x3,%eax
cltq
mov    %ecx,-0x50(%rbp,%rax,4)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    11a0 <main+0x60>
lea    -0x50(%rbp),%rdi
mov    $0x6,%esi
call   1030 <shuffle@plt>
movl   $0x0,-0x58(%rbp)
cmpl   $0x6,-0x58(%rbp)
jge    121d <main+0xdd>
movslq -0x58(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%esi
lea    0xe16(%rip),%rdi
call   1040 <printf@plt>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    11f1 <main+0xb1>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
movaps 0xeb6(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe9a(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0x20(%rsp),%rdi
mov    $0x8,%esi
call   1030 <shuffle@plt>
mov    0x28(%rsp),%eax
mov    %eax,0x8(%rsp)
mov    0x20(%rsp),%rcx
mov    %rcx,(%rsp)
mov    %rcx,0xc(%rsp)
mov    %eax,0x14(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1030 <shuffle@plt>
mov    (%rsp),%esi
lea    0xe75(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.roll = [8 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca [6 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @time(i32* null)
%7 = call i32 @srand(i32 %6)
%8 = bitcast [8 x i32]* %2 to i8*
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%10 = call i32 @shuffle(i32* %9, i32 8)
store i32 0, i32* %4
br label %11
11: ; preds = %30, %0
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 3
br i1 %13, label %14, label %33
14: ; preds = %11
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 %20
store i32 %18, i32* %21
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 %28
store i32 %25, i32* %29
br label %30
30: ; preds = %14
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %11
33: ; preds = %11
%34 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%35 = call i32 @shuffle(i32* %34, i32 6)
store i32 0, i32* %5
br label %36
36: ; preds = %45, %33
%37 = load i32, i32* %5
%38 = icmp slt i32 %37, 6
br i1 %38, label %39, label %48
39: ; preds = %36
%40 = load i32, i32* %5
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 %41
%43 = load i32, i32* %42
%44 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %43)
br label %45
45: ; preds = %39
%46 = load i32, i32* %5
%47 = add nsw i32 %46, 1
store i32 %47, i32* %5
br label %36
48: ; preds = %36
%49 = load i32, i32* %1
ret i32 %49
}

LLVM IR (-O2):
@__const.main.roll = [8 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = alloca [6 x i32]
%4 = bitcast [6 x i32]* %3 to i8*
%5 = tail call i32 @time(i32* null)
%6 = tail call i32 @srand(i32 %5)
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%8 = call i32 @shuffle(i32* %7, i32 8)
%9 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 3
%10 = bitcast i32* %9 to i8*
%11 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%12 = call i32 @shuffle(i32* %11, i32 6)
%13 = load i32, i32* %11
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 1
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 2
%19 = load i32, i32* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %9
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 4
%24 = load i32, i32* %23
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 5
%27 = load i32, i32* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %27)
ret i32 0
}