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


x86 assembly (clang, -O0):
<init_deck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x34,-0xc(%rbp)
jge    1149 <init_deck+0x39>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <init_deck+0x13>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1176 <init_deck+0x66>
mov    -0x8(%rbp),%rdi
mov    $0x34,%esi
call   1030 <shuffle_deck@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <init_deck+0x40>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_deck>:
push   %rbx
mov    %rdi,%rbx
movaps 0xee5(%rip),%xmm0
movups %xmm0,(%rdi)
movaps 0xeeb(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movaps 0xef0(%rip),%xmm0
movups %xmm0,0x20(%rdi)
movaps 0xef5(%rip),%xmm0
movups %xmm0,0x30(%rdi)
movaps 0xefa(%rip),%xmm0
movups %xmm0,0x40(%rdi)
movaps 0xeff(%rip),%xmm0
movups %xmm0,0x50(%rdi)
movaps 0xf04(%rip),%xmm0
movups %xmm0,0x60(%rdi)
movaps 0xf09(%rip),%xmm0
movups %xmm0,0x70(%rdi)
movaps 0xf0e(%rip),%xmm0
movups %xmm0,0x80(%rdi)
movaps 0xf10(%rip),%xmm0
movups %xmm0,0x90(%rdi)
movaps 0xf12(%rip),%xmm0
movups %xmm0,0xa0(%rdi)
movaps 0xf14(%rip),%xmm0
movups %xmm0,0xb0(%rdi)
movaps 0xf16(%rip),%xmm0
movups %xmm0,0xc0(%rdi)
mov    $0x34,%esi
call   1030 <shuffle_deck@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
call   1030 <shuffle_deck@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
call   1030 <shuffle_deck@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
call   1030 <shuffle_deck@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
call   1030 <shuffle_deck@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
call   1030 <shuffle_deck@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
call   1030 <shuffle_deck@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
call   1030 <shuffle_deck@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
call   1030 <shuffle_deck@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
pop    %rbx
jmp    1030 <shuffle_deck@plt>

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

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