#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 */
scalar_t__ check_flush();
scalar_t__ check_four_cards();
scalar_t__ check_straight();
scalar_t__ check_three_cards();
int count_pairs();
int /*<<< orphan*/ printf(char *);
void analyze_hand(void) {
  if (check_flush())
    printf("Flush\n");
  else if (check_straight())
    printf("Straight\n");
  else if (check_four_cards())
    printf("Four cards\n");
  else if (check_three_cards())
    printf("Three cards\n");
  else if (count_pairs() == 2)
    printf("Two pair\n");
  else if (count_pairs() == 1)
    printf("One pair\n");
  else
    printf("None\n");
}


x86 assembly (clang, -O0):
<analyze_hand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <check_flush@plt>
cmp    $0x0,%rax
je     1186 <analyze_hand+0x26>
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
jmp    1253 <analyze_hand+0xf3>
mov    $0x0,%al
call   1030 <check_straight@plt>
cmp    $0x0,%rax
je     11a8 <analyze_hand+0x48>
lea    0xe69(%rip),%rdi
call   1040 <printf@plt>
jmp    124e <analyze_hand+0xee>
mov    $0x0,%al
call   1050 <check_four_cards@plt>
cmp    $0x0,%rax
je     11ca <analyze_hand+0x6a>
lea    0xe51(%rip),%rdi
call   1040 <printf@plt>
jmp    1249 <analyze_hand+0xe9>
mov    $0x0,%al
call   1070 <check_three_cards@plt>
cmp    $0x0,%rax
je     11ec <analyze_hand+0x8c>
lea    0xe3b(%rip),%rdi
call   1040 <printf@plt>
jmp    1244 <analyze_hand+0xe4>
mov    $0x0,%al
call   1060 <count_pairs@plt>
cmp    $0x2,%eax
jne    120d <analyze_hand+0xad>
lea    0xe27(%rip),%rdi
call   1040 <printf@plt>
jmp    123f <analyze_hand+0xdf>
mov    $0x0,%al
call   1060 <count_pairs@plt>
cmp    $0x1,%eax
jne    122e <analyze_hand+0xce>
lea    0xe10(%rip),%rdi
call   1040 <printf@plt>
jmp    123a <analyze_hand+0xda>
lea    0xe09(%rip),%rdi
call   1040 <printf@plt>
jmp    123f <analyze_hand+0xdf>
jmp    1244 <analyze_hand+0xe4>
jmp    1249 <analyze_hand+0xe9>
jmp    124e <analyze_hand+0xee>
jmp    1253 <analyze_hand+0xf3>
pop    %rbp
ret

x86 assembly (clang, -O2):
<analyze_hand>:
push   %rax
xor    %eax,%eax
call   1080 <check_flush@plt>
test   %rax,%rax
je     117a <analyze_hand+0x1a>
lea    0xec3(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>
xor    %eax,%eax
call   1030 <check_straight@plt>
test   %rax,%rax
je     1193 <analyze_hand+0x33>
lea    0xea1(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>
xor    %eax,%eax
call   1050 <check_four_cards@plt>
test   %rax,%rax
je     11ac <analyze_hand+0x4c>
lea    0xe7d(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>
xor    %eax,%eax
call   1070 <check_three_cards@plt>
test   %rax,%rax
je     11c5 <analyze_hand+0x65>
lea    0xe58(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>
xor    %eax,%eax
call   1060 <count_pairs@plt>
cmp    $0x2,%eax
jne    11de <analyze_hand+0x7e>
lea    0xe36(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>
xor    %eax,%eax
call   1060 <count_pairs@plt>
cmp    $0x1,%eax
lea    0xe16(%rip),%rax
lea    0xe0a(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Flush\0A\00"
@.str.1 = [10 x i8] c"Straight\0A\00"
@.str.2 = [12 x i8] c"Four cards\0A\00"
@.str.3 = [13 x i8] c"Three cards\0A\00"
@.str.4 = [10 x i8] c"Two pair\0A\00"
@.str.5 = [10 x i8] c"One pair\0A\00"
@.str.6 = [6 x i8] c"None\0A\00"
define void @analyze_hand() {
%1 = call i64 (...) @check_flush()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %37
5: ; preds = %0
%6 = call i64 (...) @check_straight()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %36
10: ; preds = %5
%11 = call i64 (...) @check_four_cards()
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %35
15: ; preds = %10
%16 = call i64 (...) @check_three_cards()
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %34
20: ; preds = %15
%21 = call i32 (...) @count_pairs()
%22 = icmp eq i32 %21, 2
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
br label %33
25: ; preds = %20
%26 = call i32 (...) @count_pairs()
%27 = icmp eq i32 %26, 1
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %32
30: ; preds = %25
%31 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %32
32: ; preds = %30, %28
br label %33
33: ; preds = %32, %23
br label %34
34: ; preds = %33, %18
br label %35
35: ; preds = %34, %13
br label %36
36: ; preds = %35, %8
br label %37
37: ; preds = %36, %3
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"None\00"
@str.7 = [9 x i8] c"One pair\00"
@str.8 = [9 x i8] c"Two pair\00"
@str.9 = [12 x i8] c"Three cards\00"
@str.10 = [11 x i8] c"Four cards\00"
@str.11 = [9 x i8] c"Straight\00"
@str.12 = [6 x i8] c"Flush\00"
define void @analyze_hand() {
%1 = tail call i64 (...) @check_flush()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %19
3: ; preds = %0
%4 = tail call i64 (...) @check_straight()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %19
6: ; preds = %3
%7 = tail call i64 (...) @check_four_cards()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = tail call i64 (...) @check_three_cards()
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = tail call i32 (...) @count_pairs()
%14 = icmp eq i32 %13, 2
br i1 %14, label %19, label %15
15: ; preds = %12
%16 = tail call i32 (...) @count_pairs()
%17 = icmp eq i32 %16, 1
%18 = select i1 %17, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0)
br label %19
19: ; preds = %15, %12, %9, %6, %3, %0
%20 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @str.12, i64 0, i64 0), %0 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @str.11, i64 0, i64 0), %3 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @str.10, i64 0, i64 0), %6 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.9, i64 0, i64 0), %9 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @str.8, i64 0, i64 0), %12 ], [ %18, %15 ]
%21 = tail call i32 @puts(i8* dereferenceable(1) %20)
ret void
}