#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__ benchmarkFen(char *, int);
int /*<<< orphan*/ evalClear();
int /*<<< orphan*/ searchClear();
unsigned long long int benchmark(void) {
  searchClear();
  evalClear();
  unsigned long long int nodes = 0;
  nodes += benchmarkFen(
      "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", 9);
  nodes += benchmarkFen(
      "r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1",
      8);
  nodes += benchmarkFen("8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - - 0 1", 11);
  nodes += benchmarkFen(
      "r3k2r/Pppp1ppp/1b3nbN/nP6/BBP1P3/q4N2/Pp1P2PP/R2Q1RK1 w kq - 0 1", 9);
  nodes += benchmarkFen(
      "rnbqkb1r/pp1p1ppp/2p5/4P3/2B5/8/PPP1NnPP/RNBQK2R w KQkq - 0 6", 8);
  nodes += benchmarkFen(
      "r1bq1rk1/pppnnppp/4p3/3pP3/1b1P4/2NB3N/PPP2PPP/R1BQK2R w KQ - 3 7", 8);
  nodes += benchmarkFen(
      "rnb3nr/ppq2kpp/4pp2/1B1pP3/P5Q1/B1p2N2/2P2PPP/R4RK1 w - - 0 1", 7);
  nodes += benchmarkFen(
      "3B4/1r2p3/r2p1p2/bkp1P1p1/1p1P1PPp/p1P1K2P/PPB5/8 w - - 0 1", 10);
  return nodes;
}


x86 assembly (clang, -O0):
<benchmark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <searchClear@plt>
mov    $0x0,%al
call   1040 <evalClear@plt>
movq   $0x0,-0x8(%rbp)
lea    0xeab(%rip),%rdi
mov    $0x9,%esi
call   1030 <benchmarkFen@plt>
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
lea    0xecb(%rip),%rdi
mov    $0x8,%esi
call   1030 <benchmarkFen@plt>
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
lea    0xef7(%rip),%rdi
mov    $0xb,%esi
call   1030 <benchmarkFen@plt>
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
lea    0xf08(%rip),%rdi
mov    $0x9,%esi
call   1030 <benchmarkFen@plt>
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
lea    0xf30(%rip),%rdi
mov    $0x8,%esi
call   1030 <benchmarkFen@plt>
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
lea    0xf55(%rip),%rdi
mov    $0x8,%esi
call   1030 <benchmarkFen@plt>
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
lea    0xf7e(%rip),%rdi
mov    $0x7,%esi
call   1030 <benchmarkFen@plt>
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
lea    0xfa3(%rip),%rdi
mov    $0xa,%esi
call   1030 <benchmarkFen@plt>
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<benchmark>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <searchClear@plt>
xor    %eax,%eax
call   1040 <evalClear@plt>
lea    0xeb6(%rip),%rdi
mov    $0x9,%esi
call   1030 <benchmarkFen@plt>
mov    %rax,%r14
lea    0xedb(%rip),%rdi
mov    $0x8,%esi
call   1030 <benchmarkFen@plt>
mov    %rax,%r15
add    %r14,%r15
lea    0xf09(%rip),%rdi
mov    $0xb,%esi
call   1030 <benchmarkFen@plt>
mov    %rax,%rbx
add    %r15,%rbx
lea    0xf1c(%rip),%rdi
mov    $0x9,%esi
call   1030 <benchmarkFen@plt>
mov    %rax,%r14
add    %rbx,%r14
lea    0xf46(%rip),%rdi
mov    $0x8,%esi
call   1030 <benchmarkFen@plt>
mov    %rax,%rbx
add    %r14,%rbx
lea    0xf6d(%rip),%rdi
mov    $0x8,%esi
call   1030 <benchmarkFen@plt>
mov    %rax,%r14
add    %rbx,%r14
lea    0xf98(%rip),%rdi
mov    $0x7,%esi
call   1030 <benchmarkFen@plt>
mov    %rax,%rbx
add    %r14,%rbx
lea    0xfbf(%rip),%rdi
mov    $0xa,%esi
call   1030 <benchmarkFen@plt>
add    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [57 x i8] c"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1\00"
@.str.1 = [69 x i8] c"r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1\00"
@.str.2 = [42 x i8] c"8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - - 0 1\00"
@.str.3 = [65 x i8] c"r3k2r/Pppp1ppp/1b3nbN/nP6/BBP1P3/q4N2/Pp1P2PP/R2Q1RK1 w kq - 0 1\00"
@.str.4 = [62 x i8] c"rnbqkb1r/pp1p1ppp/2p5/4P3/2B5/8/PPP1NnPP/RNBQK2R w KQkq - 0 6\00"
@.str.5 = [66 x i8] c"r1bq1rk1/pppnnppp/4p3/3pP3/1b1P4/2NB3N/PPP2PPP/R1BQK2R w KQ - 3 7\00"
@.str.6 = [62 x i8] c"rnb3nr/ppq2kpp/4pp2/1B1pP3/P5Q1/B1p2N2/2P2PPP/R4RK1 w - - 0 1\00"
@.str.7 = [60 x i8] c"3B4/1r2p3/r2p1p2/bkp1P1p1/1p1P1PPp/p1P1K2P/PPB5/8 w - - 0 1\00"
define i64 @benchmark() {
%1 = alloca i64
%2 = call i32 (...) @searchClear()
%3 = call i32 (...) @evalClear()
store i64 0, i64* %1
%4 = call i64 @benchmarkFen(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 9)
%5 = load i64, i64* %1
%6 = add i64 %5, %4
store i64 %6, i64* %1
%7 = call i64 @benchmarkFen(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0), i32 8)
%8 = load i64, i64* %1
%9 = add i64 %8, %7
store i64 %9, i64* %1
%10 = call i64 @benchmarkFen(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i32 11)
%11 = load i64, i64* %1
%12 = add i64 %11, %10
store i64 %12, i64* %1
%13 = call i64 @benchmarkFen(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.3, i64 0, i64 0), i32 9)
%14 = load i64, i64* %1
%15 = add i64 %14, %13
store i64 %15, i64* %1
%16 = call i64 @benchmarkFen(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.4, i64 0, i64 0), i32 8)
%17 = load i64, i64* %1
%18 = add i64 %17, %16
store i64 %18, i64* %1
%19 = call i64 @benchmarkFen(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.5, i64 0, i64 0), i32 8)
%20 = load i64, i64* %1
%21 = add i64 %20, %19
store i64 %21, i64* %1
%22 = call i64 @benchmarkFen(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.6, i64 0, i64 0), i32 7)
%23 = load i64, i64* %1
%24 = add i64 %23, %22
store i64 %24, i64* %1
%25 = call i64 @benchmarkFen(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.7, i64 0, i64 0), i32 10)
%26 = load i64, i64* %1
%27 = add i64 %26, %25
store i64 %27, i64* %1
%28 = load i64, i64* %1
ret i64 %28
}

LLVM IR (-O2):
@.str = [57 x i8] c"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1\00"
@.str.1 = [69 x i8] c"r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1\00"
@.str.2 = [42 x i8] c"8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - - 0 1\00"
@.str.3 = [65 x i8] c"r3k2r/Pppp1ppp/1b3nbN/nP6/BBP1P3/q4N2/Pp1P2PP/R2Q1RK1 w kq - 0 1\00"
@.str.4 = [62 x i8] c"rnbqkb1r/pp1p1ppp/2p5/4P3/2B5/8/PPP1NnPP/RNBQK2R w KQkq - 0 6\00"
@.str.5 = [66 x i8] c"r1bq1rk1/pppnnppp/4p3/3pP3/1b1P4/2NB3N/PPP2PPP/R1BQK2R w KQ - 3 7\00"
@.str.6 = [62 x i8] c"rnb3nr/ppq2kpp/4pp2/1B1pP3/P5Q1/B1p2N2/2P2PPP/R4RK1 w - - 0 1\00"
@.str.7 = [60 x i8] c"3B4/1r2p3/r2p1p2/bkp1P1p1/1p1P1PPp/p1P1K2P/PPB5/8 w - - 0 1\00"
define i64 @benchmark() {
%1 = tail call i32 (...) @searchClear()
%2 = tail call i32 (...) @evalClear()
%3 = tail call i64 @benchmarkFen(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 9)
%4 = tail call i64 @benchmarkFen(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0), i32 8)
%5 = add i64 %4, %3
%6 = tail call i64 @benchmarkFen(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i32 11)
%7 = add i64 %5, %6
%8 = tail call i64 @benchmarkFen(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.3, i64 0, i64 0), i32 9)
%9 = add i64 %7, %8
%10 = tail call i64 @benchmarkFen(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.4, i64 0, i64 0), i32 8)
%11 = add i64 %9, %10
%12 = tail call i64 @benchmarkFen(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.5, i64 0, i64 0), i32 8)
%13 = add i64 %11, %12
%14 = tail call i64 @benchmarkFen(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.6, i64 0, i64 0), i32 7)
%15 = add i64 %13, %14
%16 = tail call i64 @benchmarkFen(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.7, i64 0, i64 0), i32 10)
%17 = add i64 %15, %16
ret i64 %17
}