#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*/ compareHands(int const **, int *, int *, int *, int *);
int /*<<< orphan*/ dealAHand(int const **, int *);
int /*<<< orphan*/ dealerDiscards(int const **, int *, int *);
int /*<<< orphan*/ printHand(int const **, int *);
int /*<<< orphan*/ printHandRank(int *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rankHand(int const **, int *, int *);
int /*<<< orphan*/ system(char *);
void playAGame(const int deck[][13]) {
  int playerHand[5], dealerHand[5];
  int playerHandRank[3] = {0};
  int dealerHandRank[3] = {0};
  printf("---- DEALER HAND ----\n");
  dealAHand(deck, dealerHand);
  rankHand(deck, dealerHand, dealerHandRank);
  printHand(deck, dealerHand);
  printHandRank(dealerHandRank);
  printf("\n---- PLAYER HAND ----\n");
  dealAHand(deck, playerHand);
  rankHand(deck, playerHand, playerHandRank);
  printHand(deck, playerHand);
  printHandRank(playerHandRank);
  system("pause");
  system("cls");
  dealerDiscards(deck, dealerHand, dealerHandRank);
  rankHand(deck, dealerHand, dealerHandRank);
  printf("---- DEALER HAND ----\n");
  printHand(deck, dealerHand);
  printHandRank(dealerHandRank);
  printf("\n---- PLAYER HAND ----\n");
  printHand(deck, playerHand);
  printHandRank(playerHandRank);
  compareHands(deck, dealerHand, playerHand, dealerHandRank, playerHandRank);
}


x86 assembly (clang, -O0):
<playAGame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x4c(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1060 <memset@plt>
lea    -0x58(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1060 <memset@plt>
lea    0xe3d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   10a0 <dealAHand@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x58(%rbp),%rdx
call   1080 <rankHand@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1070 <printHand@plt>
lea    -0x58(%rbp),%rdi
call   1090 <printHandRank@plt>
lea    0xe14(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   10a0 <dealAHand@plt>
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x4c(%rbp),%rdx
call   1080 <rankHand@plt>
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1070 <printHand@plt>
lea    -0x4c(%rbp),%rdi
call   1090 <printHandRank@plt>
lea    0xdec(%rip),%rdi
call   1030 <system@plt>
lea    0xde6(%rip),%rdi
call   1030 <system@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x58(%rbp),%rdx
call   1050 <dealerDiscards@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x58(%rbp),%rdx
call   1080 <rankHand@plt>
lea    0xd83(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1070 <printHand@plt>
lea    -0x58(%rbp),%rdi
call   1090 <printHandRank@plt>
lea    0xd78(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1070 <printHand@plt>
lea    -0x4c(%rbp),%rdi
call   1090 <printHandRank@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x58(%rbp),%rcx
lea    -0x4c(%rbp),%r8
call   10b0 <compareHands@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<playAGame>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rdi,%rbx
movl   $0x0,0x18(%rsp)
movq   $0x0,0x10(%rsp)
movl   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
lea    0xe51(%rip),%rdi
call   1030 <puts@plt>
lea    0x20(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1090 <dealAHand@plt>
mov    %rsp,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1070 <rankHand@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <printHand@plt>
mov    %r15,%rdi
call   1080 <printHandRank@plt>
lea    0xe27(%rip),%r12
mov    %r12,%rdi
call   1030 <puts@plt>
lea    0x40(%rsp),%r13
mov    %rbx,%rdi
mov    %r13,%rsi
call   1090 <dealAHand@plt>
lea    0x10(%rsp),%rbp
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1070 <rankHand@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1060 <printHand@plt>
mov    %rbp,%rdi
call   1080 <printHandRank@plt>
lea    0xdc2(%rip),%rdi
call   1040 <system@plt>
lea    0xdbc(%rip),%rdi
call   1040 <system@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <dealerDiscards@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1070 <rankHand@plt>
lea    0xd98(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <printHand@plt>
mov    %r15,%rdi
call   1080 <printHandRank@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1060 <printHand@plt>
mov    %rbp,%rdi
call   1080 <printHandRank@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r13,%rdx
mov    %r15,%rcx
mov    %rbp,%r8
call   10a0 <compareHands@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"---- DEALER HAND ----\0A\00"
@.str.1 = [24 x i8] c"\0A---- PLAYER HAND ----\0A\00"
@.str.2 = [6 x i8] c"pause\00"
@.str.3 = [4 x i8] c"cls\00"
define void @playAGame([13 x i32]* %0) {
%2 = alloca [13 x i32]*
%3 = alloca [5 x i32]
%4 = alloca [5 x i32]
%5 = alloca [3 x i32]
%6 = alloca [3 x i32]
store [13 x i32]* %0, [13 x i32]** %2
%7 = bitcast [3 x i32]* %5 to i8*
%8 = bitcast [3 x i32]* %6 to i8*
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%10 = load [13 x i32]*, [13 x i32]** %2
%11 = bitcast [13 x i32]* %10 to i32**
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%13 = call i32 @dealAHand(i32** %11, i32* %12)
%14 = load [13 x i32]*, [13 x i32]** %2
%15 = bitcast [13 x i32]* %14 to i32**
%16 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%18 = call i32 @rankHand(i32** %15, i32* %16, i32* %17)
%19 = load [13 x i32]*, [13 x i32]** %2
%20 = bitcast [13 x i32]* %19 to i32**
%21 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%22 = call i32 @printHand(i32** %20, i32* %21)
%23 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%24 = call i32 @printHandRank(i32* %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%26 = load [13 x i32]*, [13 x i32]** %2
%27 = bitcast [13 x i32]* %26 to i32**
%28 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%29 = call i32 @dealAHand(i32** %27, i32* %28)
%30 = load [13 x i32]*, [13 x i32]** %2
%31 = bitcast [13 x i32]* %30 to i32**
%32 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%33 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%34 = call i32 @rankHand(i32** %31, i32* %32, i32* %33)
%35 = load [13 x i32]*, [13 x i32]** %2
%36 = bitcast [13 x i32]* %35 to i32**
%37 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%38 = call i32 @printHand(i32** %36, i32* %37)
%39 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%40 = call i32 @printHandRank(i32* %39)
%41 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%42 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%43 = load [13 x i32]*, [13 x i32]** %2
%44 = bitcast [13 x i32]* %43 to i32**
%45 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%46 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%47 = call i32 @dealerDiscards(i32** %44, i32* %45, i32* %46)
%48 = load [13 x i32]*, [13 x i32]** %2
%49 = bitcast [13 x i32]* %48 to i32**
%50 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%51 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%52 = call i32 @rankHand(i32** %49, i32* %50, i32* %51)
%53 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%54 = load [13 x i32]*, [13 x i32]** %2
%55 = bitcast [13 x i32]* %54 to i32**
%56 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%57 = call i32 @printHand(i32** %55, i32* %56)
%58 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%59 = call i32 @printHandRank(i32* %58)
%60 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%61 = load [13 x i32]*, [13 x i32]** %2
%62 = bitcast [13 x i32]* %61 to i32**
%63 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%64 = call i32 @printHand(i32** %62, i32* %63)
%65 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%66 = call i32 @printHandRank(i32* %65)
%67 = load [13 x i32]*, [13 x i32]** %2
%68 = bitcast [13 x i32]* %67 to i32**
%69 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%70 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%71 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%72 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%73 = call i32 @compareHands(i32** %68, i32* %69, i32* %70, i32* %71, i32* %72)
ret void
}

LLVM IR (-O2):
@.str.2 = [6 x i8] c"pause\00"
@.str.3 = [4 x i8] c"cls\00"
@str.5 = [22 x i8] c"---- DEALER HAND ----\00"
@str.6 = [23 x i8] c"\0A---- PLAYER HAND ----\00"
define void @playAGame([13 x i32]* %0) {
%2 = alloca [5 x i32]
%3 = alloca [5 x i32]
%4 = alloca [3 x i32]
%5 = alloca [3 x i32]
%6 = bitcast [5 x i32]* %2 to i8*
%7 = bitcast [5 x i32]* %3 to i8*
%8 = bitcast [3 x i32]* %4 to i8*
%9 = bitcast [3 x i32]* %5 to i8*
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.5, i64 0, i64 0))
%11 = bitcast [13 x i32]* %0 to i32**
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%13 = call i32 @dealAHand(i32** %11, i32* %12)
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%15 = call i32 @rankHand(i32** %11, i32* %12, i32* %14)
%16 = call i32 @printHand(i32** %11, i32* %12)
%17 = call i32 @printHandRank(i32* %14)
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.6, i64 0, i64 0))
%19 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%20 = call i32 @dealAHand(i32** %11, i32* %19)
%21 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%22 = call i32 @rankHand(i32** %11, i32* %19, i32* %21)
%23 = call i32 @printHand(i32** %11, i32* %19)
%24 = call i32 @printHandRank(i32* %21)
%25 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%26 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%27 = call i32 @dealerDiscards(i32** %11, i32* %12, i32* %14)
%28 = call i32 @rankHand(i32** %11, i32* %12, i32* %14)
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.5, i64 0, i64 0))
%30 = call i32 @printHand(i32** %11, i32* %12)
%31 = call i32 @printHandRank(i32* %14)
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.6, i64 0, i64 0))
%33 = call i32 @printHand(i32** %11, i32* %19)
%34 = call i32 @printHandRank(i32* %21)
%35 = call i32 @compareHands(i32** %11, i32* %12, i32* %19, i32* %14, i32* %21)
ret void
}