#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 */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int tb_probe_wdl_impl(int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int /*<<< orphan*/, unsigned int,
                      int);
unsigned tb_probe_wdl(uint64_t _white, uint64_t _black, uint64_t _kings,
                      uint64_t _queens, uint64_t _rooks, uint64_t _bishops,
                      uint64_t _knights, uint64_t _pawns, unsigned _rule50,
                      unsigned _castling, unsigned _ep, bool _turn) {
  if (_castling != 0)
    return 0xFFFFFFFF;
  if (_rule50 != 0)
    return 0xFFFFFFFF;
  return tb_probe_wdl_impl(_white, _black, _kings, _queens, _rooks, _bishops,
                           _knights, _pawns, _ep, _turn);
}


x86 assembly (clang, -O0):
<tb_probe_wdl>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x48,%rsp
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
cmpl   $0x0,0x28(%rbp)
je     1155 <tb_probe_wdl+0x45>
movl   $0xffffffff,-0xc(%rbp)
jmp    11a6 <tb_probe_wdl+0x96>
cmpl   $0x0,0x20(%rbp)
je     116b <tb_probe_wdl+0x5b>
movl   $0xffffffff,-0xc(%rbp)
jmp    11a6 <tb_probe_wdl+0x96>
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
mov    0x10(%rbp),%ebx
mov    0x18(%rbp),%r11d
mov    0x30(%rbp),%r10d
mov    0x38(%rbp),%eax
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
call   1030 <tb_probe_wdl_impl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x48,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<tb_probe_wdl>:
push   %rbx
mov    0x28(%rsp),%eax
or     0x20(%rsp),%eax
je     1122 <tb_probe_wdl+0x12>
mov    $0xffffffff,%eax
pop    %rbx
ret
mov    0x38(%rsp),%eax
mov    0x30(%rsp),%r10d
mov    0x18(%rsp),%r11d
mov    0x10(%rsp),%ebx
push   %rax
push   %r10
push   %r11
push   %rbx
call   1030 <tb_probe_wdl_impl@plt>
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @tb_probe_wdl(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11) {
%13 = or i32 %9, %8
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = tail call i32 @tb_probe_wdl_impl(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %10, i32 %11)
br label %17
17: ; preds = %12, %15
%18 = phi i32 [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}