#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*/ shuffle_deck(int *, int, int);
void init_deck(int deck[], int tid) {
  int i;
  for (i = 0; i < 52; i++) {
    deck[i] = i;
  }
  for (i = 0; i < 10; i++) {
    shuffle_deck(deck, 52, tid);
  }
}


x86 assembly (clang, -O0):
<init_deck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x34,-0x10(%rbp)
jge    114c <init_deck+0x3c>
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <init_deck+0x16>
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    117c <init_deck+0x6c>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x34,%esi
call   1030 <shuffle_deck@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1153 <init_deck+0x43>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_deck>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
movaps 0xee1(%rip),%xmm0
movups %xmm0,(%rdi)
movaps 0xee7(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movaps 0xeec(%rip),%xmm0
movups %xmm0,0x20(%rdi)
movaps 0xef1(%rip),%xmm0
movups %xmm0,0x30(%rdi)
movaps 0xef6(%rip),%xmm0
movups %xmm0,0x40(%rdi)
movaps 0xefb(%rip),%xmm0
movups %xmm0,0x50(%rdi)
movaps 0xf00(%rip),%xmm0
movups %xmm0,0x60(%rdi)
movaps 0xf05(%rip),%xmm0
movups %xmm0,0x70(%rdi)
movaps 0xf0a(%rip),%xmm0
movups %xmm0,0x80(%rdi)
movaps 0xf0c(%rip),%xmm0
movups %xmm0,0x90(%rdi)
movaps 0xf0e(%rip),%xmm0
movups %xmm0,0xa0(%rdi)
movaps 0xf10(%rip),%xmm0
movups %xmm0,0xb0(%rdi)
movaps 0xf12(%rip),%xmm0
movups %xmm0,0xc0(%rdi)
mov    $0x34,%esi
mov    %ebp,%edx
call   1030 <shuffle_deck@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
mov    %ebp,%edx
call   1030 <shuffle_deck@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
mov    %ebp,%edx
call   1030 <shuffle_deck@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
mov    %ebp,%edx
call   1030 <shuffle_deck@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
mov    %ebp,%edx
call   1030 <shuffle_deck@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
mov    %ebp,%edx
call   1030 <shuffle_deck@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
mov    %ebp,%edx
call   1030 <shuffle_deck@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
mov    %ebp,%edx
call   1030 <shuffle_deck@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
mov    %ebp,%edx
call   1030 <shuffle_deck@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <shuffle_deck@plt>

LLVM IR (-O0):
define void @init_deck(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 52
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i32, i32* %5
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 %10, i32* %14
br label %15
15: ; preds = %9
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
store i32 0, i32* %5
br label %19
19: ; preds = %26, %18
%20 = load i32, i32* %5
%21 = icmp slt i32 %20, 10
br i1 %21, label %22, label %29
22: ; preds = %19
%23 = load i32*, i32** %3
%24 = load i32, i32* %4
%25 = call i32 @shuffle_deck(i32* %23, i32 52, i32 %24)
br label %26
26: ; preds = %22
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %19
29: ; preds = %19
ret void
}

LLVM IR (-O2):
define void @init_deck(i32* %0, i32 %1) {
%3 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %3
%4 = getelementptr inbounds i32, i32* %0, i64 4
%5 = bitcast i32* %4 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, <4 x i32>* %5
%6 = getelementptr inbounds i32, i32* %0, i64 8
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> <i32 8, i32 9, i32 10, i32 11>, <4 x i32>* %7
%8 = getelementptr inbounds i32, i32* %0, i64 12
%9 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> <i32 12, i32 13, i32 14, i32 15>, <4 x i32>* %9
%10 = getelementptr inbounds i32, i32* %0, i64 16
%11 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> <i32 16, i32 17, i32 18, i32 19>, <4 x i32>* %11
%12 = getelementptr inbounds i32, i32* %0, i64 20
%13 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> <i32 20, i32 21, i32 22, i32 23>, <4 x i32>* %13
%14 = getelementptr inbounds i32, i32* %0, i64 24
%15 = bitcast i32* %14 to <4 x i32>*
store <4 x i32> <i32 24, i32 25, i32 26, i32 27>, <4 x i32>* %15
%16 = getelementptr inbounds i32, i32* %0, i64 28
%17 = bitcast i32* %16 to <4 x i32>*
store <4 x i32> <i32 28, i32 29, i32 30, i32 31>, <4 x i32>* %17
%18 = getelementptr inbounds i32, i32* %0, i64 32
%19 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> <i32 32, i32 33, i32 34, i32 35>, <4 x i32>* %19
%20 = getelementptr inbounds i32, i32* %0, i64 36
%21 = bitcast i32* %20 to <4 x i32>*
store <4 x i32> <i32 36, i32 37, i32 38, i32 39>, <4 x i32>* %21
%22 = getelementptr inbounds i32, i32* %0, i64 40
%23 = bitcast i32* %22 to <4 x i32>*
store <4 x i32> <i32 40, i32 41, i32 42, i32 43>, <4 x i32>* %23
%24 = getelementptr inbounds i32, i32* %0, i64 44
%25 = bitcast i32* %24 to <4 x i32>*
store <4 x i32> <i32 44, i32 45, i32 46, i32 47>, <4 x i32>* %25
%26 = getelementptr inbounds i32, i32* %0, i64 48
%27 = bitcast i32* %26 to <4 x i32>*
store <4 x i32> <i32 48, i32 49, i32 50, i32 51>, <4 x i32>* %27
%28 = tail call i32 @shuffle_deck(i32* %0, i32 52, i32 %1)
%29 = tail call i32 @shuffle_deck(i32* %0, i32 52, i32 %1)
%30 = tail call i32 @shuffle_deck(i32* %0, i32 52, i32 %1)
%31 = tail call i32 @shuffle_deck(i32* %0, i32 52, i32 %1)
%32 = tail call i32 @shuffle_deck(i32* %0, i32 52, i32 %1)
%33 = tail call i32 @shuffle_deck(i32* %0, i32 52, i32 %1)
%34 = tail call i32 @shuffle_deck(i32* %0, i32 52, i32 %1)
%35 = tail call i32 @shuffle_deck(i32* %0, i32 52, i32 %1)
%36 = tail call i32 @shuffle_deck(i32* %0, i32 52, i32 %1)
%37 = tail call i32 @shuffle_deck(i32* %0, i32 52, i32 %1)
ret void
}