#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*/ BITBOARD_init();
int /*<<< orphan*/ test_see(char *, int, int, int);
int main() {
  BITBOARD_init();
  test_see("1k1r4/1pp4p/p7/4p3/8/P5P1/1PP4P/2K1R3 w - -", 4, 36, 1);
  test_see("1k1r3q/1ppn3p/p4b2/4p3/8/P2N2P1/1PP1R1BP/2K1Q3 w - -", 19, 36,
           1 - 3);
  test_see("1k1r3q/1pp4p/p4b2/4p3/8/P2N2P1/1PP1R1BP/2K1Q3 b - -", 59, 19,
           3 - 5);
  test_see("k7/8/1q1r4/2p5/3P4/2P1K2/8/8 b - - 0 1", 34, 27, 1);
  test_see("8/8/1k6/2p5/3K4/4B3/8/8 w - - 0 1", 27, 34, 1 - 20);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <BITBOARD_init@plt>
lea    0xec3(%rip),%rdi
mov    $0x4,%esi
mov    $0x24,%edx
mov    $0x1,%ecx
call   1040 <test_see@plt>
lea    0xed4(%rip),%rdi
mov    $0x13,%esi
mov    $0x24,%edx
mov    $0xfffffffe,%ecx
call   1040 <test_see@plt>
lea    0xeee(%rip),%rdi
mov    $0x3b,%esi
mov    $0x13,%edx
mov    $0xfffffffe,%ecx
call   1040 <test_see@plt>
lea    0xf07(%rip),%rdi
mov    $0x22,%esi
mov    $0x1b,%edx
mov    $0x1,%ecx
call   1040 <test_see@plt>
lea    0xf13(%rip),%rdi
mov    $0x1b,%esi
mov    $0x22,%edx
mov    $0xffffffed,%ecx
call   1040 <test_see@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <BITBOARD_init@plt>
lea    0xed1(%rip),%rdi
mov    $0x4,%esi
mov    $0x24,%edx
mov    $0x1,%ecx
call   1040 <test_see@plt>
lea    0xee2(%rip),%rdi
mov    $0x13,%esi
mov    $0x24,%edx
mov    $0xfffffffe,%ecx
call   1040 <test_see@plt>
lea    0xefc(%rip),%rdi
mov    $0x3b,%esi
mov    $0x13,%edx
mov    $0xfffffffe,%ecx
call   1040 <test_see@plt>
lea    0xf15(%rip),%rdi
mov    $0x22,%esi
mov    $0x1b,%edx
mov    $0x1,%ecx
call   1040 <test_see@plt>
lea    0xf21(%rip),%rdi
mov    $0x1b,%esi
mov    $0x22,%edx
mov    $0xffffffed,%ecx
call   1040 <test_see@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"1k1r4/1pp4p/p7/4p3/8/P5P1/1PP4P/2K1R3 w - -\00"
@.str.1 = [53 x i8] c"1k1r3q/1ppn3p/p4b2/4p3/8/P2N2P1/1PP1R1BP/2K1Q3 w - -\00"
@.str.2 = [52 x i8] c"1k1r3q/1pp4p/p4b2/4p3/8/P2N2P1/1PP1R1BP/2K1Q3 b - -\00"
@.str.3 = [39 x i8] c"k7/8/1q1r4/2p5/3P4/2P1K2/8/8 b - - 0 1\00"
@.str.4 = [34 x i8] c"8/8/1k6/2p5/3K4/4B3/8/8 w - - 0 1\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @BITBOARD_init()
%3 = call i32 @test_see(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 4, i32 36, i32 1)
%4 = call i32 @test_see(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i32 19, i32 36, i32 -2)
%5 = call i32 @test_see(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), i32 59, i32 19, i32 -2)
%6 = call i32 @test_see(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i32 34, i32 27, i32 1)
%7 = call i32 @test_see(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i32 27, i32 34, i32 -19)
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"1k1r4/1pp4p/p7/4p3/8/P5P1/1PP4P/2K1R3 w - -\00"
@.str.1 = [53 x i8] c"1k1r3q/1ppn3p/p4b2/4p3/8/P2N2P1/1PP1R1BP/2K1Q3 w - -\00"
@.str.2 = [52 x i8] c"1k1r3q/1pp4p/p4b2/4p3/8/P2N2P1/1PP1R1BP/2K1Q3 b - -\00"
@.str.3 = [39 x i8] c"k7/8/1q1r4/2p5/3P4/2P1K2/8/8 b - - 0 1\00"
@.str.4 = [34 x i8] c"8/8/1k6/2p5/3K4/4B3/8/8 w - - 0 1\00"
define i32 @main() {
%1 = tail call i32 (...) @BITBOARD_init()
%2 = tail call i32 @test_see(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 4, i32 36, i32 1)
%3 = tail call i32 @test_see(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i32 19, i32 36, i32 -2)
%4 = tail call i32 @test_see(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), i32 59, i32 19, i32 -2)
%5 = tail call i32 @test_see(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i32 34, i32 27, i32 1)
%6 = tail call i32 @test_see(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i32 27, i32 34, i32 -19)
ret i32 0
}