#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 *);
void print_hand(unsigned long long hand) {
  for (unsigned suit = 0; suit < 4; suit++) {
    for (unsigned rank = 0; rank < 13; rank++) {
      const unsigned RANK_MASK = 1 << rank;
      if (hand & RANK_MASK) {
        switch (rank) {
        case 0:
          printf("Ace");
          break;
        case 1:
          printf("Two");
          break;
        case 2:
          printf("Three");
          break;
        case 3:
          printf("Four");
          break;
        case 4:
          printf("Five");
          break;
        case 5:
          printf("Six");
          break;
        case 6:
          printf("Seven");
          break;
        case 7:
          printf("Eight");
          break;
        case 8:
          printf("Nine");
          break;
        case 9:
          printf("Ten");
          break;
        case 10:
          printf("Jack");
          break;
        case 11:
          printf("Queen");
          break;
        case 12:
          printf("King");
          break;
        }
        printf(" of ");
        switch (suit) {
        case 0:
          printf("Clubs");
          break;
        case 1:
          printf("Diamonds");
          break;
        case 2:
          printf("Hearts");
          break;
        case 3:
          printf("Spades");
          break;
        }
        printf(", ");
      }
    }
    hand >>= 13;
  }
}


x86 assembly (clang, -O0):
<print_hand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jae    1305 <print_hand+0x1f5>
movl   $0x0,-0x10(%rbp)
cmpl   $0xd,-0x10(%rbp)
jae    12eb <print_hand+0x1db>
mov    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
and    %rcx,%rax
cmp    $0x0,%rax
je     12d8 <print_hand+0x1c8>
mov    -0x10(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0xc,%rax
ja     125c <print_hand+0x14c>
mov    -0x20(%rbp),%rax
lea    0xe85(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    125c <print_hand+0x14c>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
jmp    125c <print_hand+0x14c>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    125c <print_hand+0x14c>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
jmp    125c <print_hand+0x14c>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
jmp    125c <print_hand+0x14c>
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
jmp    125c <print_hand+0x14c>
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
jmp    125c <print_hand+0x14c>
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
jmp    125c <print_hand+0x14c>
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
jmp    125c <print_hand+0x14c>
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
jmp    125c <print_hand+0x14c>
lea    0xe40(%rip),%rdi
call   1030 <printf@plt>
jmp    125c <print_hand+0x14c>
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
jmp    125c <print_hand+0x14c>
lea    0xe29(%rip),%rdi
call   1030 <printf@plt>
lea    0xe22(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %rax,-0x28(%rbp)
sub    $0x3,%rax
ja     12cc <print_hand+0x1bc>
mov    -0x28(%rbp),%rax
lea    0xdb0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xdf6(%rip),%rdi
call   1030 <printf@plt>
jmp    12cc <print_hand+0x1bc>
lea    0xdeb(%rip),%rdi
call   1030 <printf@plt>
jmp    12cc <print_hand+0x1bc>
lea    0xde3(%rip),%rdi
call   1030 <printf@plt>
jmp    12cc <print_hand+0x1bc>
lea    0xdd9(%rip),%rdi
call   1030 <printf@plt>
lea    0xdd4(%rip),%rdi
call   1030 <printf@plt>
jmp    12dd <print_hand+0x1cd>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <print_hand+0x24>
mov    -0x8(%rbp),%rax
shr    $0xd,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_hand+0x13>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hand>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r13
xor    %ebx,%ebx
lea    0x2c91(%rip),%rbp
lea    0xf13(%rip),%r14
lea    0xf11(%rip),%r15
lea    0xf27(%rip),%r12
jmp    1164 <print_hand+0x54>
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
call   1030 <printf@plt>
mov    %r12,%rdi
call   1030 <printf@plt>
add    $0x1,%ebx
add    $0x8,%rbp
cmp    $0xd,%ebx
je     117a <print_hand+0x6a>
bt     %rbx,%r13
jae    1158 <print_hand+0x48>
cmp    $0xc,%ebx
ja     1140 <print_hand+0x30>
mov    0x0(%rbp),%rdi
call   1030 <printf@plt>
jmp    1140 <print_hand+0x30>
mov    %r13,%rbx
shr    $0xd,%rbx
xor    %ebp,%ebp
lea    0x2c2e(%rip),%r14
lea    0xebb(%rip),%r15
lea    0xecb(%rip),%r12
jmp    11c8 <print_hand+0xb8>
nopw   0x0(%rax,%rax,1)
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
call   1030 <printf@plt>
mov    %r12,%rdi
call   1030 <printf@plt>
add    $0x1,%ebp
add    $0x8,%r14
cmp    $0xd,%ebp
je     11dd <print_hand+0xcd>
bt     %rbp,%rbx
jae    11bc <print_hand+0xac>
cmp    $0xc,%ebp
ja     11a0 <print_hand+0x90>
mov    (%r14),%rdi
call   1030 <printf@plt>
jmp    11a0 <print_hand+0x90>
mov    %r13,%rbx
shr    $0x1a,%rbx
xor    %ebp,%ebp
lea    0x2bcb(%rip),%r14
lea    0xe61(%rip),%r15
lea    0xe68(%rip),%r12
jmp    1228 <print_hand+0x118>
nopl   (%rax)
lea    0xe3a(%rip),%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
call   1030 <printf@plt>
mov    %r12,%rdi
call   1030 <printf@plt>
add    $0x1,%ebp
add    $0x8,%r14
cmp    $0xd,%ebp
je     123d <print_hand+0x12d>
bt     %rbp,%rbx
jae    121c <print_hand+0x10c>
cmp    $0xc,%ebp
ja     1200 <print_hand+0xf0>
mov    (%r14),%rdi
call   1030 <printf@plt>
jmp    1200 <print_hand+0xf0>
shr    $0x27,%r13
xor    %ebx,%ebx
lea    0x2b6e(%rip),%rbp
lea    0xdf0(%rip),%r14
lea    0xe04(%rip),%r15
lea    0xe04(%rip),%r12
jmp    1294 <print_hand+0x184>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
call   1030 <printf@plt>
mov    %r12,%rdi
call   1030 <printf@plt>
add    $0x1,%ebx
add    $0x8,%rbp
cmp    $0xd,%ebx
je     12aa <print_hand+0x19a>
bt     %rbx,%r13
jae    1288 <print_hand+0x178>
cmp    $0xc,%ebx
ja     1270 <print_hand+0x160>
mov    0x0(%rbp),%rdi
call   1030 <printf@plt>
jmp    1270 <print_hand+0x160>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"Ace\00"
@.str.1 = [4 x i8] c"Two\00"
@.str.2 = [6 x i8] c"Three\00"
@.str.3 = [5 x i8] c"Four\00"
@.str.4 = [5 x i8] c"Five\00"
@.str.5 = [4 x i8] c"Six\00"
@.str.6 = [6 x i8] c"Seven\00"
@.str.7 = [6 x i8] c"Eight\00"
@.str.8 = [5 x i8] c"Nine\00"
@.str.9 = [4 x i8] c"Ten\00"
@.str.10 = [5 x i8] c"Jack\00"
@.str.11 = [6 x i8] c"Queen\00"
@.str.12 = [5 x i8] c"King\00"
@.str.13 = [5 x i8] c" of \00"
@.str.14 = [6 x i8] c"Clubs\00"
@.str.15 = [9 x i8] c"Diamonds\00"
@.str.16 = [7 x i8] c"Hearts\00"
@.str.17 = [7 x i8] c"Spades\00"
@.str.18 = [3 x i8] c", \00"
define void @print_hand(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
br label %6
6: ; preds = %69, %1
%7 = load i32, i32* %3
%8 = icmp ult i32 %7, 4
br i1 %8, label %9, label %72
9: ; preds = %6
store i32 0, i32* %4
br label %10
10: ; preds = %63, %9
%11 = load i32, i32* %4
%12 = icmp ult i32 %11, 13
br i1 %12, label %13, label %66
13: ; preds = %10
%14 = load i32, i32* %4
%15 = shl i32 1, %14
store i32 %15, i32* %5
%16 = load i64, i64* %2
%17 = load i32, i32* %5
%18 = zext i32 %17 to i64
%19 = and i64 %16, %18
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %62
21: ; preds = %13
%22 = load i32, i32* %4
switch i32 %22, label %49 [
i32 0, label %23
i32 1, label %25
i32 2, label %27
i32 3, label %29
i32 4, label %31
i32 5, label %33
i32 6, label %35
i32 7, label %37
i32 8, label %39
i32 9, label %41
i32 10, label %43
i32 11, label %45
i32 12, label %47
]
23: ; preds = %21
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %49
25: ; preds = %21
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %49
27: ; preds = %21
%28 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %49
29: ; preds = %21
%30 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %49
31: ; preds = %21
%32 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %49
33: ; preds = %21
%34 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %49
35: ; preds = %21
%36 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %49
37: ; preds = %21
%38 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
br label %49
39: ; preds = %21
%40 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
br label %49
41: ; preds = %21
%42 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
br label %49
43: ; preds = %21
%44 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
br label %49
45: ; preds = %21
%46 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
br label %49
47: ; preds = %21
%48 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
br label %49
49: ; preds = %21, %47, %45, %43, %41, %39, %37, %35, %33, %31, %29, %27, %25, %23
%50 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%51 = load i32, i32* %3
switch i32 %51, label %60 [
i32 0, label %52
i32 1, label %54
i32 2, label %56
i32 3, label %58
]
52: ; preds = %49
%53 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
br label %60
54: ; preds = %49
%55 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
br label %60
56: ; preds = %49
%57 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0))
br label %60
58: ; preds = %49
%59 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0))
br label %60
60: ; preds = %49, %58, %56, %54, %52
%61 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0))
br label %62
62: ; preds = %60, %13
br label %63
63: ; preds = %62
%64 = load i32, i32* %4
%65 = add i32 %64, 1
store i32 %65, i32* %4
br label %10
66: ; preds = %10
%67 = load i64, i64* %2
%68 = lshr i64 %67, 13
store i64 %68, i64* %2
br label %69
69: ; preds = %66
%70 = load i32, i32* %3
%71 = add i32 %70, 1
store i32 %71, i32* %3
br label %6
72: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"Ace\00"
@.str.1 = [4 x i8] c"Two\00"
@.str.2 = [6 x i8] c"Three\00"
@.str.3 = [5 x i8] c"Four\00"
@.str.4 = [5 x i8] c"Five\00"
@.str.5 = [4 x i8] c"Six\00"
@.str.6 = [6 x i8] c"Seven\00"
@.str.7 = [6 x i8] c"Eight\00"
@.str.8 = [5 x i8] c"Nine\00"
@.str.9 = [4 x i8] c"Ten\00"
@.str.10 = [5 x i8] c"Jack\00"
@.str.11 = [6 x i8] c"Queen\00"
@.str.12 = [5 x i8] c"King\00"
@.str.13 = [5 x i8] c" of \00"
@.str.14 = [6 x i8] c"Clubs\00"
@.str.15 = [9 x i8] c"Diamonds\00"
@.str.16 = [7 x i8] c"Hearts\00"
@.str.17 = [7 x i8] c"Spades\00"
@.str.18 = [3 x i8] c", \00"
@switch.table.print_hand = [13 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0)]
define void @print_hand(i64 %0) {
br label %69
2: ; preds = %86
%3 = lshr i64 %0, 13
br label %4
4: ; preds = %21, %2
%5 = phi i32 [ 0, %2 ], [ %22, %21 ]
%6 = shl nuw nsw i32 1, %5
%7 = zext i32 %6 to i64
%8 = and i64 %3, %7
%9 = icmp eq i64 %8, 0
br i1 %9, label %21, label %10
10: ; preds = %4
%11 = icmp ult i32 %5, 13
br i1 %11, label %12, label %17
12: ; preds = %10
%13 = zext i32 %5 to i64
%14 = getelementptr inbounds [13 x i8*], [13 x i8*]* @switch.table.print_hand, i64 0, i64 %13
%15 = load i8*, i8** %14
%16 = tail call i32 @printf(i8* dereferenceable(1) %15)
br label %17
17: ; preds = %12, %10
%18 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%19 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
%20 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0))
br label %21
21: ; preds = %17, %4
%22 = add nuw nsw i32 %5, 1
%23 = icmp eq i32 %22, 13
br i1 %23, label %24, label %4
24: ; preds = %21
%25 = lshr i64 %0, 26
br label %26
26: ; preds = %43, %24
%27 = phi i32 [ 0, %24 ], [ %44, %43 ]
%28 = shl nuw nsw i32 1, %27
%29 = zext i32 %28 to i64
%30 = and i64 %25, %29
%31 = icmp eq i64 %30, 0
br i1 %31, label %43, label %32
32: ; preds = %26
%33 = icmp ult i32 %27, 13
br i1 %33, label %34, label %39
34: ; preds = %32
%35 = zext i32 %27 to i64
%36 = getelementptr inbounds [13 x i8*], [13 x i8*]* @switch.table.print_hand, i64 0, i64 %35
%37 = load i8*, i8** %36
%38 = tail call i32 @printf(i8* dereferenceable(1) %37)
br label %39
39: ; preds = %34, %32
%40 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%41 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0))
%42 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0))
br label %43
43: ; preds = %39, %26
%44 = add nuw nsw i32 %27, 1
%45 = icmp eq i32 %44, 13
br i1 %45, label %46, label %26
46: ; preds = %43
%47 = lshr i64 %0, 39
br label %48
48: ; preds = %65, %46
%49 = phi i32 [ 0, %46 ], [ %66, %65 ]
%50 = shl nuw nsw i32 1, %49
%51 = zext i32 %50 to i64
%52 = and i64 %47, %51
%53 = icmp eq i64 %52, 0
br i1 %53, label %65, label %54
54: ; preds = %48
%55 = icmp ult i32 %49, 13
br i1 %55, label %56, label %61
56: ; preds = %54
%57 = zext i32 %49 to i64
%58 = getelementptr inbounds [13 x i8*], [13 x i8*]* @switch.table.print_hand, i64 0, i64 %57
%59 = load i8*, i8** %58
%60 = tail call i32 @printf(i8* dereferenceable(1) %59)
br label %61
61: ; preds = %56, %54
%62 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%63 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0))
%64 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0))
br label %65
65: ; preds = %61, %48
%66 = add nuw nsw i32 %49, 1
%67 = icmp eq i32 %66, 13
br i1 %67, label %68, label %48
68: ; preds = %65
ret void
69: ; preds = %1, %86
%70 = phi i32 [ 0, %1 ], [ %87, %86 ]
%71 = shl nuw nsw i32 1, %70
%72 = zext i32 %71 to i64
%73 = and i64 %72, %0
%74 = icmp eq i64 %73, 0
br i1 %74, label %86, label %75
75: ; preds = %69
%76 = icmp ult i32 %70, 13
br i1 %76, label %77, label %82
77: ; preds = %75
%78 = zext i32 %70 to i64
%79 = getelementptr inbounds [13 x i8*], [13 x i8*]* @switch.table.print_hand, i64 0, i64 %78
%80 = load i8*, i8** %79
%81 = tail call i32 @printf(i8* dereferenceable(1) %80)
br label %82
82: ; preds = %75, %77
%83 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%84 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
%85 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0))
br label %86
86: ; preds = %82, %69
%87 = add nuw nsw i32 %70, 1
%88 = icmp eq i32 %87, 13
br i1 %88, label %2, label %69
}