#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 dealACard();
int /*<<< orphan*/ rankHand(int const **, int *, int *);
int /*<<< orphan*/ sortHand(int const **, int *);
void dealAHand(const int wDeck[][13], int *hand) {
  int i;
  int playerHandRank[3] = {0};
  for (i = 0; i < 5; i++)
    hand[i] = dealACard();
  sortHand(wDeck, hand);
  rankHand(wDeck, hand, playerHandRank);
}


x86 assembly (clang, -O0):
<dealAHand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1030 <memset@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    1193 <dealAHand+0x53>
mov    $0x0,%al
call   1060 <dealACard@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1167 <dealAHand+0x27>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <sortHand@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <rankHand@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dealAHand>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
movl   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
xor    %eax,%eax
call   1050 <dealACard@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
call   1050 <dealACard@plt>
mov    %eax,0x4(%rbx)
xor    %eax,%eax
call   1050 <dealACard@plt>
mov    %eax,0x8(%rbx)
xor    %eax,%eax
call   1050 <dealACard@plt>
mov    %eax,0xc(%rbx)
xor    %eax,%eax
call   1050 <dealACard@plt>
mov    %eax,0x10(%rbx)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <sortHand@plt>
lea    0x8(%rsp),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <rankHand@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @dealAHand([13 x i32]* %0, i32* %1) {
%3 = alloca [3 x i32]
%4 = bitcast [3 x i32]* %3 to i8*
%5 = tail call i32 (...) @dealACard()
store i32 %5, i32* %1
%6 = tail call i32 (...) @dealACard()
%7 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %6, i32* %7
%8 = tail call i32 (...) @dealACard()
%9 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %8, i32* %9
%10 = tail call i32 (...) @dealACard()
%11 = getelementptr inbounds i32, i32* %1, i64 3
store i32 %10, i32* %11
%12 = tail call i32 (...) @dealACard()
%13 = getelementptr inbounds i32, i32* %1, i64 4
store i32 %12, i32* %13
%14 = bitcast [13 x i32]* %0 to i32**
%15 = tail call i32 @sortHand(i32** %14, i32* %1)
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%17 = call i32 @rankHand(i32** %14, i32* %1, i32* %16)
ret void
}