#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 FastestFirstEndSolve(unsigned char *, double, double, int, int, int, int);
int NoParEndSolve(unsigned char *, double, double, int, int, int, int);
int ParEndSolve(unsigned char *, double, double, int, int, int, int);
int EndSolve(unsigned char *board, double alpha, double beta, int color,
             int empties, int discdiff, int prevmove) {
  if (empties > 7)
    return FastestFirstEndSolve(board, alpha, beta, color, empties, discdiff,
                                prevmove);
  else {
    if (empties <= (2 > 4 ? 2 : 4))
      return NoParEndSolve(board, alpha, beta, color, empties, discdiff,
                           prevmove);
    else
      return ParEndSolve(board, alpha, beta, color, empties, discdiff,
                         prevmove);
  }
}


x86 assembly (clang, -O0):
<EndSolve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %esi,-0x24(%rbp)
mov    %edx,-0x28(%rbp)
mov    %ecx,-0x2c(%rbp)
mov    %r8d,-0x30(%rbp)
cmpl   $0x7,-0x28(%rbp)
jle    1185 <EndSolve+0x55>
mov    -0x10(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%r8d
call   1040 <FastestFirstEndSolve@plt>
mov    %eax,-0x4(%rbp)
jmp    11da <EndSolve+0xaa>
cmpl   $0x4,-0x28(%rbp)
jg     11b7 <EndSolve+0x87>
mov    -0x10(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%r8d
call   1030 <NoParEndSolve@plt>
mov    %eax,-0x4(%rbp)
jmp    11da <EndSolve+0xaa>
mov    -0x10(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%r8d
call   1050 <ParEndSolve@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EndSolve>:
cmp    $0x8,%edx
jl     113a <EndSolve+0xa>
jmp    1040 <FastestFirstEndSolve@plt>
cmp    $0x4,%edx
jg     1144 <EndSolve+0x14>
jmp    1030 <NoParEndSolve@plt>
jmp    1050 <ParEndSolve@plt>

LLVM IR (-O0):
define i32 @EndSolve(i8* %0, double %1, double %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i8*
%10 = alloca double
%11 = alloca double
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i8* %0, i8** %9
store double %1, double* %10
store double %2, double* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
%16 = load i32, i32* %13
%17 = icmp sgt i32 %16, 7
br i1 %17, label %18, label %27
18: ; preds = %7
%19 = load i8*, i8** %9
%20 = load double, double* %10
%21 = load double, double* %11
%22 = load i32, i32* %12
%23 = load i32, i32* %13
%24 = load i32, i32* %14
%25 = load i32, i32* %15
%26 = call i32 @FastestFirstEndSolve(i8* %19, double %20, double %21, i32 %22, i32 %23, i32 %24, i32 %25)
store i32 %26, i32* %8
br label %48
27: ; preds = %7
%28 = load i32, i32* %13
%29 = icmp sle i32 %28, 4
br i1 %29, label %30, label %39
30: ; preds = %27
%31 = load i8*, i8** %9
%32 = load double, double* %10
%33 = load double, double* %11
%34 = load i32, i32* %12
%35 = load i32, i32* %13
%36 = load i32, i32* %14
%37 = load i32, i32* %15
%38 = call i32 @NoParEndSolve(i8* %31, double %32, double %33, i32 %34, i32 %35, i32 %36, i32 %37)
store i32 %38, i32* %8
br label %48
39: ; preds = %27
%40 = load i8*, i8** %9
%41 = load double, double* %10
%42 = load double, double* %11
%43 = load i32, i32* %12
%44 = load i32, i32* %13
%45 = load i32, i32* %14
%46 = load i32, i32* %15
%47 = call i32 @ParEndSolve(i8* %40, double %41, double %42, i32 %43, i32 %44, i32 %45, i32 %46)
store i32 %47, i32* %8
br label %48
48: ; preds = %39, %30, %18
%49 = load i32, i32* %8
ret i32 %49
}

LLVM IR (-O2):
define i32 @EndSolve(i8* %0, double %1, double %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = icmp sgt i32 %4, 7
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 @FastestFirstEndSolve(i8* %0, double %1, double %2, i32 %3, i32 %4, i32 %5, i32 %6)
br label %17
11: ; preds = %7
%12 = icmp slt i32 %4, 5
br i1 %12, label %13, label %15
13: ; preds = %11
%14 = tail call i32 @NoParEndSolve(i8* %0, double %1, double %2, i32 %3, i32 %4, i32 %5, i32 %6)
br label %17
15: ; preds = %11
%16 = tail call i32 @ParEndSolve(i8* %0, double %1, double %2, i32 %3, i32 %4, i32 %5, i32 %6)
br label %17
17: ; preds = %15, %13, %9
%18 = phi i32 [ %10, %9 ], [ %14, %13 ], [ %16, %15 ]
ret i32 %18
}