LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: sunweilun[P]Delaunay/Mesh.cpp
// Function: Mesh::delaunay(std::vector<glm::detail::tvec3<double, (glm::precision)0>, std::allocator<glm::detail::tvec3<double, (glm::precision)0>>> const&)
void Mesh::delaunay(const std::vector<vec3>& v)
{
    std::vector<vec3> vList = v;

    if(randomize)
        shuffle(vList, seed);

    clearAll();
    buildGhostTriangle(vList);

    for(unsigned i=0; i<vList.size(); i++)
    {
        vertices.push_back(Vertex());
        vertices.back().pos = vList[i];
        if(method == CONFLICT_GRAPH)
        {
            vertices.back().confTriIndex = 0;
            triangles.front().confVertIndices.insert(i+3);
        }
    }

    for(unsigned i=0; i<vList.size(); i++)
    {
        insertVertex(i+3);
    }

    destroyGhostTriangle();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x5ed0
movq -0x88(%rbp), %rax
testb $0x1, 0x4(%rax)
je 0x3ef6
movq -0x88(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x3df0
jmp 0x3eda
jmp 0x3ef6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x42e0
jmp 0x409e
movq -0x88(%rbp), %rdi
callq 0x1530
movq -0x88(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1570
jmp 0x3f14
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq %rax, -0x90(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x4560
movq %rax, %rcx
movq -0x90(%rbp), %rax
cmpq %rcx, %rax
jae 0x4034
movq -0x88(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x98(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movaps %xmm0, -0x60(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x4810
jmp 0x3f69
movq -0x98(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x5fc0
jmp 0x3f7b
movl -0x38(%rbp), %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0x5eb0
movq -0x88(%rbp), %rdi
movq %rax, -0xa0(%rbp)
addq $0x10, %rdi
callq 0x5ff0
movq -0xa0(%rbp), %rsi
movq %rax, %rdi
addq $0x8, %rdi
callq 0x4790
jmp 0x3fb5
movq -0x88(%rbp), %rax
cmpl $0x1, 0x8(%rax)
jne 0x4024
movq -0x88(%rbp), %rdi
addq $0x10, %rdi
callq 0x5ff0
movq -0x88(%rbp), %rdi
movl $0x0, (%rax)
addq $0x28, %rdi
callq 0x6030
movq %rax, %rdi
addq $0x10, %rdi
movl -0x38(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x64(%rbp)
leaq -0x64(%rbp), %rsi
callq 0x6060
movb %dl, -0xa9(%rbp)
movq %rax, -0xa8(%rbp)
jmp 0x4010
movb -0xa9(%rbp), %al
movq -0xa8(%rbp), %rcx
movq %rcx, -0x78(%rbp)
movb %al, -0x70(%rbp)
jmp 0x4026
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x3f1b
movl $0x0, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movq %rax, -0xb8(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x4560
movq %rax, %rcx
movq -0xb8(%rbp), %rax
cmpq %rcx, %rax
jae 0x407e
movq -0x88(%rbp), %rdi
movl -0x7c(%rbp), %esi
addl $0x3, %esi
callq 0x3470
jmp 0x4071
jmp 0x4073
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x403b
movq -0x88(%rbp), %rdi
callq 0x1bc0
jmp 0x408c
leaq -0x28(%rbp), %rdi
callq 0x42e0
addq $0xc0, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x11c0
nopw (%rax,%rax)
// File: sunweilun[P]Delaunay/Mesh.cpp
// Function: std::vector<unsigned int, std::allocator<unsigned int>> lazyDeletion<Mesh::HalfEdge>(std::vector<Mesh::HalfEdge, std::allocator<Mesh::HalfEdge>>&, std::vector<bool, std::allocator<bool>>)
std::vector<unsigned> lazyDeletion(std::vector<T>& v, std::vector<bool> delMap)
{
    std::vector<unsigned> indicesMap(v.size());
    unsigned k=0;
    for(unsigned i=0; i<v.size(); i++)
    {
        v[k] = v[i];
        indicesMap[i] = k;
        if(!delMap[i])
            k++;
    }
    v.resize(k);
    return indicesMap;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdx, -0x70(%rbp)
movq %rdi, -0x60(%rbp)
movq %rdi, %rax
movq %rax, -0x68(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4b30
movq %rax, -0x58(%rbp)
leaq -0x1a(%rbp), %rdi
movq %rdi, -0x50(%rbp)
callq 0xbac0
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
callq 0xbae0
jmp 0x4c87
leaq -0x1a(%rbp), %rdi
callq 0xbb50
movl $0x0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4b30
movq %rax, %rcx
movq -0x78(%rbp), %rax
cmpq %rcx, %rax
jae 0x4d9d
movq -0x10(%rbp), %rdi
movl -0x34(%rbp), %eax
movl %eax, %esi
callq 0x4990
movq %rax, -0x98(%rbp)
movq -0x10(%rbp), %rdi
movl -0x30(%rbp), %eax
movl %eax, %esi
callq 0x4990
movq -0x98(%rbp), %rcx
movq -0x60(%rbp), %rdi
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movups (%rcx), %xmm0
movups %xmm0, (%rax)
movl -0x30(%rbp), %eax
movl %eax, -0x8c(%rbp)
movl -0x34(%rbp), %eax
movl %eax, %esi
callq 0x5190
movl -0x8c(%rbp), %ecx
movq -0x70(%rbp), %rdi
movl %ecx, (%rax)
movl -0x34(%rbp), %eax
movl %eax, %esi
callq 0x4b80
movq %rdx, -0x88(%rbp)
movq %rax, -0x80(%rbp)
jmp 0x4d30
movq -0x88(%rbp), %rax
movq -0x80(%rbp), %rcx
movq %rcx, -0x48(%rbp)
movq %rax, -0x40(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xbb70
xorb $-0x1, %al
testb $0x1, %al
jne 0x4d54
jmp 0x4d8d
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x4d8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x1a(%rbp), %rdi
callq 0xbb50
jmp 0x4dcd
movq -0x60(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x5130
jmp 0x4dcd
jmp 0x4d8f
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x4c9e
movq -0x10(%rbp), %rdi
movl -0x30(%rbp), %eax
movl %eax, %esi
callq 0xbba0
jmp 0x4dad
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x4dc0
movq -0x60(%rbp), %rdi
callq 0x5130
movq -0x68(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x11c0
nopw %cs:(%rax,%rax)
// File: sunweilun[P]Delaunay/./Mesh.h
// Function: orient(glm::detail::tvec3<double, (glm::precision)0> const&, glm::detail::tvec3<double, (glm::precision)0> const&, glm::detail::tvec3<double, (glm::precision)0> const&)
inline int orient(const vec3& a, const vec3& b, const vec3& c)
{
    vec3 da = a - c;
    vec3 db = b - c;
    real det = da.x * db.y - db.x * da.y;
    return det == 0 ? 0 : int(det > 0)*2-1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x4650
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x48(%rbp), %rdi
callq 0x4650
movsd -0x30(%rbp), %xmm0
movsd -0x40(%rbp), %xmm2
movsd -0x48(%rbp), %xmm1
mulsd -0x28(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x5365
jp 0x5365
xorl %eax, %eax
movl %eax, -0x54(%rbp)
jmp 0x5381
movsd -0x50(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
seta %al
andb $0x1, %al
movzbl %al, %eax
shll %eax
subl $0x1, %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: simap[P]ecctools/archiver.cpp
// Function: fsize(char const*)
off_t fsize(const char *filename) {
    struct stat st; 
    if (stat(filename, &st) == 0)
        return st.st_size;
    return -1; 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x10b0
cmpl $0x0, %eax
jne 0x12ae
movq -0x70(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x12b6
movq $-0x1, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/atomicdata.cpp
// Function: generate_squaresTouch()
void generate_squaresTouch() {
	for (int i = 0; i < 64; ++i) {
		for (int j = 0; j < 64; ++j) {
			if (explBB[i] & ((Bitboard)1 << j)) {
				squares_touch[i][j] = 1;
			} else {
				squares_touch[i][j] = 0;
			}
			square_dist_arr[i][j] = square_distance(Square(i), Square(j));
		}
	}
}

// Assembly:
pushq %rax
movl $0x0, 0x4(%rsp)
cmpl $0x40, 0x4(%rsp)
jge 0xca0c
movl $0x0, (%rsp)
cmpl $0x40, (%rsp)
jge 0xc9fa
movslq 0x4(%rsp), %rcx
leaq 0x4a69f(%rip), %rax     # 0x57010
movq (%rax,%rcx,8), %rax
movl (%rsp), %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0xc9a9
movslq 0x4(%rsp), %rcx
leaq 0x60f08(%rip), %rax     # 0x6d8a0
shlq $0x6, %rcx
addq %rcx, %rax
movslq (%rsp), %rcx
movb $0x1, (%rax,%rcx)
jmp 0xc9c4
movslq 0x4(%rsp), %rcx
leaq 0x60eeb(%rip), %rax     # 0x6d8a0
shlq $0x6, %rcx
addq %rcx, %rax
movslq (%rsp), %rcx
movb $0x0, (%rax,%rcx)
movl 0x4(%rsp), %edi
movl (%rsp), %esi
callq 0xcd00
movb %al, %dl
movslq 0x4(%rsp), %rcx
leaq 0x61ec2(%rip), %rax     # 0x6e8a0
shlq $0x6, %rcx
addq %rcx, %rax
movslq (%rsp), %rcx
movb %dl, (%rax,%rcx)
movl (%rsp), %eax
addl $0x1, %eax
movl %eax, (%rsp)
jmp 0xc95b
jmp 0xc9fc
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0xc949
popq %rax
retq
nop
// File: ATOMIC-LICHESS[P]ATOMKRAFT/atomicdata.cpp
// Function: generate_explosionSquares()
void generate_explosionSquares() {
	int rank, file, currR, currF;
	
	int r[9] = { 0,  0,  1,  1,  1,  0, -1, -1, -1};
	int f[9] = { 0,  1,  1,  0, -1, -1, -1,  0,  1}; 
	
	for (int sq = 0; sq < 64; ++sq) {
		rank = sq / 8;
		file = sq % 8;
		
		explSq[sq].size = 0;
		
		for (int k = 0; k < 9; ++k) {
			currR = rank + r[k];
			currF = file + f[k];
			if (SQUARE_LEGAL(currR, currF)) {
				explSq[sq].square[explSq[sq].size] = (Square)(currR * 8 + currF);
				++explSq[sq].size;
			}
		}
	}
}

// Assembly:
subq $0x78, %rsp
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
movl $0x24, %edx
callq 0x6280
movl $0x1, 0x48(%rsp)
movl $0x1, 0x4c(%rsp)
movl $0x1, 0x50(%rsp)
movl $0xffffffff, 0x58(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x60(%rsp) # imm = 0xFFFFFFFF
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
movl $0x24, %edx
callq 0x6280
movl $0x1, 0x14(%rsp)
movl $0x1, 0x18(%rsp)
movl $0xffffffff, 0x20(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x28(%rsp) # imm = 0xFFFFFFFF
movl $0x1, 0x30(%rsp)
movl $0x0, 0xc(%rsp)
cmpl $0x40, 0xc(%rsp)
jge 0xcbac
movl 0xc(%rsp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, 0x74(%rsp)
movl 0xc(%rsp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, 0x70(%rsp)
movslq 0xc(%rsp), %rcx
leaq 0x5facb(%rip), %rax     # 0x6c5a0
imulq $0x4c, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x48(%rax)
movl $0x0, 0x8(%rsp)
cmpl $0x9, 0x8(%rsp)
jge 0xcb9a
movl 0x74(%rsp), %eax
movslq 0x8(%rsp), %rcx
addl 0x40(%rsp,%rcx,4), %eax
movl %eax, 0x6c(%rsp)
movl 0x70(%rsp), %eax
movslq 0x8(%rsp), %rcx
addl 0x10(%rsp,%rcx,4), %eax
movl %eax, 0x68(%rsp)
cmpl $0x0, 0x6c(%rsp)
jl 0xcb88
cmpl $0x7, 0x6c(%rsp)
jg 0xcb88
cmpl $0x0, 0x68(%rsp)
jl 0xcb88
cmpl $0x7, 0x68(%rsp)
jg 0xcb88
movl 0x6c(%rsp), %edx
shll $0x3, %edx
addl 0x68(%rsp), %edx
movslq 0xc(%rsp), %rcx
leaq 0x5fa55(%rip), %rax     # 0x6c5a0
imulq $0x4c, %rcx, %rcx
addq %rcx, %rax
movslq 0xc(%rsp), %rsi
leaq 0x5fa42(%rip), %rcx     # 0x6c5a0
imulq $0x4c, %rsi, %rsi
addq %rsi, %rcx
movslq 0x48(%rcx), %rcx
movl %edx, (%rax,%rcx,4)
movslq 0xc(%rsp), %rcx
leaq 0x5fa28(%rip), %rax     # 0x6c5a0
imulq $0x4c, %rcx, %rcx
addq %rcx, %rax
movl 0x48(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x48(%rax)
jmp 0xcb8a
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xcaeb
jmp 0xcb9c
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xca9e
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/atomicdata.cpp
// Function: generate_explosionBitboards()
void generate_explosionBitboards() {
	generate_explosionSquares();
	
	Bitboard b;
	
	printf("const Bitboard explosionBB[64] = {\n\t");
	for (int sq = 0; sq < 64; ++sq) {
		b = 0;
		for (int k = 0; k < explSq[sq].size; ++k) {
			b |= BIT(explSq[sq].square[k]);	
		}
		printf("0x%.8X%.8XULL", HI64(b), LO64(b));
		if (sq < 63) printf(", ");
		if (sq % 4 == 3) printf("\n");
		if (sq < 63 && sq % 4 == 3) printf("\t");
	}
	printf("};");
	
}

// Assembly:
subq $0x18, %rsp
callq 0xca10
leaq 0x4a640(%rip), %rdi     # 0x57210
movb $0x0, %al
callq 0x6070
movl $0x0, 0xc(%rsp)
cmpl $0x40, 0xc(%rsp)
jge 0xccdf
movq $0x0, 0x10(%rsp)
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movslq 0xc(%rsp), %rdx
leaq 0x5f995(%rip), %rcx     # 0x6c5a0
imulq $0x4c, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x48(%rcx), %eax
jge 0xcc53
movslq 0xc(%rsp), %rcx
leaq 0x5f97d(%rip), %rax     # 0x6c5a0
imulq $0x4c, %rcx, %rcx
addq %rcx, %rax
movslq 0x8(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
orq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xcbfb
movq 0x10(%rsp), %rax
shrq $0x20, %rax
movl %eax, %esi
movq 0x10(%rsp), %rax
movl %eax, %edx
leaq 0x4a5c9(%rip), %rdi     # 0x57235
movb $0x0, %al
callq 0x6070
cmpl $0x3f, 0xc(%rsp)
jge 0xcc88
leaq 0x4d339(%rip), %rdi     # 0x59fba
movb $0x0, %al
callq 0x6070
movl 0xc(%rsp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
cmpl $0x3, %edx
jne 0xcca7
leaq 0x4df8b(%rip), %rdi     # 0x5ac2b
movb $0x0, %al
callq 0x6070
cmpl $0x3f, 0xc(%rsp)
jge 0xcccd
movl 0xc(%rsp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
cmpl $0x3, %edx
jne 0xcccd
leaq 0x4a56d(%rip), %rdi     # 0x57233
movb $0x0, %al
callq 0x6070
jmp 0xcccf
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xcbdf
leaq 0x4a55d(%rip), %rdi     # 0x57243
movb $0x0, %al
callq 0x6070
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/bitbase.cpp
// Function: (anonymous namespace)::compute_index(Square, Square, Square, Color)
int compute_index(Square wksq, Square bksq, Square wpsq, Color stm) {

    assert(square_file(wpsq) <= FILE_D);

    int p = int(square_file(wpsq)) + 4 * int(square_rank(wpsq) - 1);
    int r = int(stm) + 2 * int(bksq) + 128 * int(wksq) + 8192 * p;

    assert(r >= 0 && r < IndexMax);

    return r;
  }

// Assembly:
subq $0x28, %rsp
movl %edi, 0x24(%rsp)
movl %esi, 0x20(%rsp)
movl %edx, 0x1c(%rsp)
movl %ecx, 0x18(%rsp)
movl 0x1c(%rsp), %edi
callq 0xce10
movl %eax, 0xc(%rsp)
movl 0x1c(%rsp), %edi
callq 0xce40
movl %eax, %ecx
movl 0xc(%rsp), %eax
subl $0x1, %ecx
shll $0x2, %ecx
addl %ecx, %eax
movl %eax, 0x14(%rsp)
movl 0x18(%rsp), %eax
movl 0x20(%rsp), %ecx
shll %ecx
addl %ecx, %eax
movl 0x24(%rsp), %ecx
shll $0x7, %ecx
addl %ecx, %eax
movl 0x14(%rsp), %ecx
shll $0xd, %ecx
addl %ecx, %eax
movl %eax, 0x10(%rsp)
movl 0x10(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/bitbase.cpp
// Function: (anonymous namespace)::KPKPosition::from_index(int)
void KPKPosition::from_index(int index) {

    int s = (index / 8192) % 24;

    sideToMove = Color(index % 2);
    blackKingSquare = Square((index / 2) % 64);
    whiteKingSquare = Square((index / 128) % 64);
    pawnSquare = make_square(File(s % 4), Rank(s / 4 + 1));
  }

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movl 0xc(%rsp), %eax
movl $0x2000, %ecx           # imm = 0x2000
cltd
idivl %ecx
movl $0x18, %ecx
cltd
idivl %ecx
movl %edx, 0x8(%rsp)
movl 0xc(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movq (%rsp), %rax
movl %edx, 0xc(%rax)
movl 0xc(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl $0x40, %ecx
cltd
idivl %ecx
movq (%rsp), %rax
movl %edx, 0x4(%rax)
movl 0xc(%rsp), %eax
movl $0x80, %ecx
cltd
idivl %ecx
movl $0x40, %ecx
cltd
idivl %ecx
movq (%rsp), %rax
movl %edx, (%rax)
movl 0x8(%rsp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %edx, %edi
movl 0x8(%rsp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %eax, %esi
addl $0x1, %esi
callq 0xd740
movl %eax, %ecx
movq (%rsp), %rax
movl %ecx, 0x8(%rax)
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/bitbase.cpp
// Function: (anonymous namespace)::KPKPosition::is_legal() const
bool KPKPosition::is_legal() const {

    if (   whiteKingSquare == pawnSquare
        || whiteKingSquare == blackKingSquare
        || blackKingSquare == pawnSquare)
        return false;

    if (sideToMove == WHITE)
    {
        if (   bit_is_set(wk_attacks(), blackKingSquare)
            || bit_is_set(pawn_attacks(), blackKingSquare))
            return false;
    }
    else if (bit_is_set(bk_attacks(), whiteKingSquare))
        return false;

    return true;
  }

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rcx
movq %rcx, (%rsp)
movl (%rcx), %eax
cmpl 0x8(%rcx), %eax
je 0xd1e0
movq (%rsp), %rcx
movl (%rcx), %eax
cmpl 0x4(%rcx), %eax
je 0xd1e0
movq (%rsp), %rcx
movl 0x4(%rcx), %eax
cmpl 0x8(%rcx), %eax
jne 0xd1e7
movb $0x0, 0x17(%rsp)
jmp 0xd261
movq (%rsp), %rax
cmpl $0x0, 0xc(%rax)
jne 0xd236
movq (%rsp), %rdi
callq 0xd6e0
movq %rax, %rdi
movq (%rsp), %rax
movl 0x4(%rax), %esi
callq 0xd760
cmpq $0x0, %rax
jne 0xd22d
movq (%rsp), %rdi
callq 0xd700
movq %rax, %rdi
movq (%rsp), %rax
movl 0x4(%rax), %esi
callq 0xd760
cmpq $0x0, %rax
je 0xd234
movb $0x0, 0x17(%rsp)
jmp 0xd261
jmp 0xd25c
movq (%rsp), %rdi
callq 0xd720
movq %rax, %rdi
movq (%rsp), %rax
movl (%rax), %esi
callq 0xd760
cmpq $0x0, %rax
je 0xd25a
movb $0x0, 0x17(%rsp)
jmp 0xd261
jmp 0xd25c
movb $0x1, 0x17(%rsp)
movb 0x17(%rsp), %al
andb $0x1, %al
addq $0x18, %rsp
retq
nopl (%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/bitbase.cpp
// Function: (anonymous namespace)::KPKPosition::is_immediate_draw() const
bool KPKPosition::is_immediate_draw() const {

    if (sideToMove == BLACK)
    {
        Bitboard wka = wk_attacks();
        Bitboard bka = bk_attacks();

        // Case 1: Stalemate
        if ((bka & ~(wka | pawn_attacks())) == EmptyBoardBB)
            return true;

        // Case 2: King can capture pawn
        if (bit_is_set(bka, pawnSquare) && !bit_is_set(wka, pawnSquare))
            return true;
    }
    else
    {
        // Case 1: Stalemate (possible pawn files are only from A to D)
        if (   whiteKingSquare == SQ_A8
            && pawnSquare == SQ_A7
            && (blackKingSquare == SQ_C7 || blackKingSquare == SQ_C8))
            return true;
    }
    return false;
  }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpl $0x1, 0xc(%rax)
jne 0xd324
movq 0x10(%rsp), %rdi
callq 0xd6e0
movq 0x10(%rsp), %rdi
movq %rax, 0x20(%rsp)
callq 0xd720
movq 0x10(%rsp), %rdi
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
callq 0xd700
movq (%rsp), %rcx
movq %rax, %rdx
movq 0x8(%rsp), %rax
orq %rdx, %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
jne 0xd2eb
movb $0x1, 0x37(%rsp)
jmp 0xd35d
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdi
movl 0x8(%rax), %esi
callq 0xd760
cmpq $0x0, %rax
je 0xd322
movq 0x10(%rsp), %rax
movq 0x20(%rsp), %rdi
movl 0x8(%rax), %esi
callq 0xd760
cmpq $0x0, %rax
jne 0xd322
movb $0x1, 0x37(%rsp)
jmp 0xd35d
jmp 0xd358
movq 0x10(%rsp), %rax
cmpl $0x38, (%rax)
jne 0xd356
movq 0x10(%rsp), %rax
cmpl $0x30, 0x8(%rax)
jne 0xd356
movq 0x10(%rsp), %rax
cmpl $0x32, 0x4(%rax)
je 0xd34f
movq 0x10(%rsp), %rax
cmpl $0x3a, 0x4(%rax)
jne 0xd356
movb $0x1, 0x37(%rsp)
jmp 0xd35d
jmp 0xd358
movb $0x0, 0x37(%rsp)
movb 0x37(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/bitbase.cpp
// Function: (anonymous namespace)::KPKPosition::is_immediate_win() const
bool KPKPosition::is_immediate_win() const {

    // The position is an immediate win if it is white to move and the
    // white pawn can be promoted without getting captured.
    return   sideToMove == WHITE
          && square_rank(pawnSquare) == RANK_7
          && whiteKingSquare != pawnSquare + DELTA_N
          && (   square_distance(blackKingSquare, pawnSquare + DELTA_N) > 1
              || bit_is_set(wk_attacks(), pawnSquare + DELTA_N));
  }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rcx
movq %rcx, 0x20(%rsp)
xorl %eax, %eax
cmpl $0x0, 0xc(%rcx)
movb %al, 0x2f(%rsp)
jne 0xd44d
movq 0x20(%rsp), %rax
movl 0x8(%rax), %edi
callq 0xce40
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x6, %ecx
movb %al, 0x2f(%rsp)
jne 0xd44d
movq 0x20(%rsp), %rax
movl (%rax), %ecx
movl %ecx, 0x1c(%rsp)
movl 0x8(%rax), %edi
movl $0x8, %esi
callq 0xd780
movl 0x1c(%rsp), %ecx
movl %eax, %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, 0x2f(%rsp)
je 0xd44d
movq 0x20(%rsp), %rax
movl 0x4(%rax), %ecx
movl %ecx, 0x14(%rsp)
movl 0x8(%rax), %edi
movl $0x8, %esi
callq 0xd780
movl 0x14(%rsp), %edi
movl %eax, %esi
callq 0xcd00
movl %eax, %ecx
movb $0x1, %al
cmpl $0x1, %ecx
movb %al, 0x1b(%rsp)
jg 0xd445
movq 0x20(%rsp), %rdi
callq 0xd6e0
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x8(%rsp)
movl 0x8(%rax), %edi
movl $0x8, %esi
callq 0xd780
movq 0x8(%rsp), %rdi
movl %eax, %esi
callq 0xd760
cmpq $0x0, %rax
setne %al
movb %al, 0x1b(%rsp)
movb 0x1b(%rsp), %al
movb %al, 0x2f(%rsp)
movb 0x2f(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/bitbase.cpp
// Function: (anonymous namespace)::classify_btm((anonymous namespace)::KPKPosition const&, (anonymous namespace)::Result const*)
Result classify_btm(const KPKPosition& pos, const Result bb[]) {

    // If one move leads to a position classified as RESULT_DRAW, the result
    // of the current position is RESULT_DRAW. If all moves lead to positions
    // classified as RESULT_WIN, the current position is classified as
    // RESULT_LOSS. Otherwise, the current position is classified as
    // RESULT_UNKNOWN.

    bool unknownFound = false;
    Bitboard b;
    Square s;
    Result r;

    // King moves
    b = pos.bk_attacks();
    while (b)
    {
        s = pop_1st_bit(&b);
        r = bb[compute_index(pos.whiteKingSquare, s, pos.pawnSquare, WHITE)];

        if (r == RESULT_DRAW)
            return RESULT_DRAW;

        if (r == RESULT_UNKNOWN)
            unknownFound = true;
    }
    return unknownFound ? RESULT_UNKNOWN : RESULT_LOSS;
  }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movb $0x0, 0x1f(%rsp)
movq 0x28(%rsp), %rdi
callq 0xd720
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0xd6ba
leaq 0x10(%rsp), %rdi
callq 0xd940
movl %eax, 0xc(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq 0x28(%rsp), %rax
movl (%rax), %edi
movl 0xc(%rsp), %esi
movq 0x28(%rsp), %rax
movl 0x8(%rax), %edx
xorl %ecx, %ecx
callq 0xceb0
movl %eax, %ecx
movq (%rsp), %rax
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x8(%rsp)
cmpl $0x4, 0x8(%rsp)
jne 0xd6ac
movl $0x4, 0x34(%rsp)
jmp 0xd6cf
cmpl $0x0, 0x8(%rsp)
jne 0xd6b8
movb $0x1, 0x1f(%rsp)
jmp 0xd652
movb 0x1f(%rsp), %dl
movl $0x3, %eax
xorl %ecx, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/bitboard.cpp
// Function: print_bitboard(unsigned long)
void print_bitboard(Bitboard b) {

  for (Rank r = RANK_8; r >= RANK_1; r--)
  {
      std::cout << "+---+---+---+---+---+---+---+---+" << '\n';
      for (File f = FILE_A; f <= FILE_H; f++)
          std::cout << "| " << (bit_is_set(b, make_square(f, r)) ? 'X' : ' ') << ' ';

      std::cout << "|\n";
  }
  std::cout << "+---+---+---+---+---+---+---+---+" << std::endl;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl $0x7, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
jl 0xd8c8
movq 0x5e7c5(%rip), %rdi     # 0x6bfb8
leaq 0x4be80(%rip), %rsi     # 0x5967a
callq 0x64b0
movq %rax, %rdi
movl $0xa, %esi
callq 0x65d0
movl $0x0, 0x18(%rsp)
cmpl $0x7, 0x18(%rsp)
jg 0xd8a4
movq 0x5e792(%rip), %rdi     # 0x6bfb8
leaq 0x4c754(%rip), %rsi     # 0x59f81
callq 0x64b0
movq %rax, (%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x18(%rsp), %edi
movl 0x1c(%rsp), %esi
callq 0xd740
movq 0x8(%rsp), %rdi
movl %eax, %esi
callq 0xd760
movq %rax, %rcx
movb $0x58, %al
movb $0x20, %dl
movb %dl, 0x16(%rsp)
cmpq $0x0, %rcx
movb %al, 0x17(%rsp)
jne 0xd876
movb 0x16(%rsp), %al
movb %al, 0x17(%rsp)
movq (%rsp), %rdi
movb 0x17(%rsp), %al
movsbl %al, %esi
callq 0x65d0
movq %rax, %rdi
movl $0x20, %esi
callq 0x65d0
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0xe560
jmp 0xd814
movq 0x5e70d(%rip), %rdi     # 0x6bfb8
leaq 0x4a2ea(%rip), %rsi     # 0x57b9c
callq 0x64b0
leaq 0x1c(%rsp), %rdi
xorl %esi, %esi
callq 0xe590
jmp 0xd7e1
movq 0x5e6e9(%rip), %rdi     # 0x6bfb8
leaq 0x4bda4(%rip), %rsi     # 0x5967a
callq 0x64b0
movq %rax, %rdi
movq 0x5e6ab(%rip), %rsi     # 0x6bf90
callq 0x6520
addq $0x28, %rsp
retq
nop
// File: ATOMIC-LICHESS[P]ATOMKRAFT/bitboard.cpp
// Function: pop_1st_bit(unsigned long*)
Square pop_1st_bit(Bitboard* bb) {

   b_union u;
   Square ret;

   u.b = *bb;

   if (u.dw.l)
   {
       ret = Square(BitTable[((u.dw.l ^ (u.dw.l - 1)) * 0x783a9b23) >> 26]);
       u.dw.l &= (u.dw.l - 1);
       *bb = u.b;
       return ret;
   }
   ret = Square(BitTable[((~(u.dw.h ^ (u.dw.h - 1))) * 0x783a9b23) >> 26]);
   u.dw.h &= (u.dw.h - 1);
   *bb = u.b;
   return ret;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq -0x10(%rsp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rsp)
cmpl $0x0, -0x18(%rsp)
je 0xd9a7
movl -0x18(%rsp), %eax
movl -0x18(%rsp), %ecx
subl $0x1, %ecx
xorl %ecx, %eax
imull $0x783a9b23, %eax, %eax # imm = 0x783A9B23
shrl $0x1a, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x49f06(%rip), %rax     # 0x57880
movl (%rax,%rcx,4), %eax
movl %eax, -0x1c(%rsp)
movl -0x18(%rsp), %eax
subl $0x1, %eax
andl -0x18(%rsp), %eax
movl %eax, -0x18(%rsp)
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rax
movq %rcx, (%rax)
movl -0x1c(%rsp), %eax
movl %eax, -0x4(%rsp)
jmp 0xd9f6
movl -0x14(%rsp), %eax
movl -0x14(%rsp), %ecx
subl $0x1, %ecx
xorl %ecx, %eax
xorl $-0x1, %eax
imull $0x783a9b23, %eax, %eax # imm = 0x783A9B23
shrl $0x1a, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x49eb5(%rip), %rax     # 0x57880
movl (%rax,%rcx,4), %eax
movl %eax, -0x1c(%rsp)
movl -0x14(%rsp), %eax
subl $0x1, %eax
andl -0x14(%rsp), %eax
movl %eax, -0x14(%rsp)
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rax
movq %rcx, (%rax)
movl -0x1c(%rsp), %eax
movl %eax, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nopl (%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/bitboard.cpp
// Function: init_bitboards()
void init_bitboards() {

  int rookDeltas[4][2] = {{0,1},{0,-1},{1,0},{-1,0}};
  int bishopDeltas[4][2] = {{1,1},{-1,1},{1,-1},{-1,-1}};

  init_masks();
  init_step_attacks();
  init_sliding_attacks(RAttacks, RAttackIndex, RMask, RShift, RMult, rookDeltas);
  init_sliding_attacks(BAttacks, BAttackIndex, BMask, BShift, BMult, bishopDeltas);
  init_pseudo_attacks();
  init_between_bitboards();
}

// Assembly:
subq $0x48, %rsp
movq 0x4a195(%rip), %rax     # 0x57ba0
movq %rax, 0x20(%rsp)
movq 0x4a191(%rip), %rax     # 0x57ba8
movq %rax, 0x28(%rsp)
movq 0x4a18d(%rip), %rax     # 0x57bb0
movq %rax, 0x30(%rsp)
movq 0x4a189(%rip), %rax     # 0x57bb8
movq %rax, 0x38(%rsp)
movq 0x4a185(%rip), %rax     # 0x57bc0
movq %rax, (%rsp)
movq 0x4a182(%rip), %rax     # 0x57bc8
movq %rax, 0x8(%rsp)
movq 0x4a17e(%rip), %rax     # 0x57bd0
movq %rax, 0x10(%rsp)
movq 0x4a17a(%rip), %rax     # 0x57bd8
movq %rax, 0x18(%rsp)
callq 0xdae0
callq 0xdee0
leaq 0x20(%rsp), %r9
leaq 0x68137(%rip), %rdi     # 0x75bb0
leaq 0x68030(%rip), %rsi     # 0x75ab0
leaq 0x67e29(%rip), %rdx     # 0x758b0
leaq 0x49cf2(%rip), %rcx     # 0x57780
leaq 0x499eb(%rip), %r8      # 0x57480
callq 0xe000
movq %rsp, %r9
leaq 0x13040c(%rip), %rdi    # 0x13deb0
leaq 0x130305(%rip), %rsi    # 0x13ddb0
leaq 0x1300fe(%rip), %rdx    # 0x13dbb0
leaq 0x49bc7(%rip), %rcx     # 0x57680
leaq 0x497c0(%rip), %r8      # 0x57280
callq 0xe000
callq 0xe1a0
callq 0xe220
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/bitboard.cpp
// Function: (anonymous namespace)::init_step_attacks()
void init_step_attacks() {

    const int step[][9] =  {
      {0},
      {7,9,0}, {17,15,10,6,-6,-10,-15,-17,0}, {0}, {0}, {0},
      {9,7,-7,-9,8,1,-1,-8,0}, {0}, {0},
      {-7,-9,0}, {17,15,10,6,-6,-10,-15,-17,0}, {0}, {0}, {0},
      {9,7,-7,-9,8,1,-1,-8,0}
    };

    for (Square s = SQ_A1; s <= SQ_H8; s++)
        for (Piece pc = WP; pc <= BK; pc++)
            for (int k = 0; step[pc][k] != 0; k++)
            {
                Square to = s + Square(step[pc][k]);

                if (square_is_ok(to) && square_distance(s, to) < 3)
                    set_bit(&StepAttacksBB[pc][s], to);
           }
  }

// Assembly:
subq $0x238, %rsp            # imm = 0x238
leaq 0x10(%rsp), %rdi
leaq 0x49a8d(%rip), %rsi     # 0x57980
movl $0x21c, %edx            # imm = 0x21C
callq 0x63f0
movl $0x0, 0xc(%rsp)
cmpl $0x3f, 0xc(%rsp)
jg 0xdfeb
movl $0x1, 0x8(%rsp)
cmpl $0xe, 0x8(%rsp)
jg 0xdfd8
movl $0x0, 0x4(%rsp)
movl 0x8(%rsp), %eax
movl %eax, %ecx
leaq 0x10(%rsp), %rax
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movslq 0x4(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0xdfc5
movl 0xc(%rsp), %edi
movl 0x8(%rsp), %eax
movl %eax, %ecx
leaq 0x10(%rsp), %rax
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movslq 0x4(%rsp), %rcx
movl (%rax,%rcx,4), %esi
callq 0xd780
movl %eax, (%rsp)
movl (%rsp), %edi
callq 0xe790
testb $0x1, %al
jne 0xdf7c
jmp 0xdfb3
movl 0xc(%rsp), %edi
movl (%rsp), %esi
callq 0xcd00
cmpl $0x3, %eax
jge 0xdfb3
movl 0x8(%rsp), %eax
leaq 0x13a8c8(%rip), %rdi    # 0x148860
shlq $0x9, %rax
addq %rax, %rdi
movslq 0xc(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movl (%rsp), %esi
callq 0xe7c0
jmp 0xdfb5
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0xdf2b
jmp 0xdfc7
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0xe7f0
jmp 0xdf18
jmp 0xdfda
leaq 0xc(%rsp), %rdi
xorl %esi, %esi
callq 0xe5c0
jmp 0xdf05
addq $0x238, %rsp            # imm = 0x238
retq
nopw %cs:(%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/bitboard.cpp
// Function: (anonymous namespace)::init_sliding_attacks(unsigned long*, int*, unsigned long*, int const*, unsigned long const*, int (*) [2])
void init_sliding_attacks(Bitboard attacks[], int attackIndex[], Bitboard mask[],
                            const int shift[], const Bitboard mult[], int deltas[][2]) {
    Bitboard b, v;
    int i, j, index;

    for (i = index = 0; i < 64; i++)
    {
        attackIndex[i] = index;
        mask[i] = sliding_attacks(i, 0, deltas, 1, 6, 1, 6);
        j = 1 << ((CpuIs64Bit ? 64 : 32) - shift[i]);

        for (int k = 0; k < j; k++)
        {
            b = index_to_bitboard(k, mask[i]);
            v = CpuIs64Bit ? b * mult[i] : unsigned(b * mult[i] ^ (b >> 32) * (mult[i] >> 32));
            attacks[index + (v >> shift[i])] = sliding_attacks(i, b, deltas, 0, 7, 0, 7);
        }
        index += j;
    }
  }

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdx, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x38(%rsp)
movl $0x0, 0x1c(%rsp)
movl $0x0, 0x24(%rsp)
cmpl $0x40, 0x24(%rsp)
jge 0xe198
movl 0x1c(%rsp), %edx
movq 0x58(%rsp), %rax
movslq 0x24(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x24(%rsp), %edi
movq 0x38(%rsp), %rdx
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %r9d
movl $0x6, %r8d
movl %r9d, %ecx
movl $0x6, (%rsp)
callq 0xe350
movq %rax, %rdx
movq 0x50(%rsp), %rax
movslq 0x24(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x48(%rsp), %rax
movslq 0x24(%rsp), %rdx
movl $0x20, %ecx
subl (%rax,%rdx,4), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, 0x20(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x20(%rsp), %eax
jge 0xe17c
movl 0x18(%rsp), %edi
movq 0x50(%rsp), %rax
movslq 0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0xe4e0
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq 0x40(%rsp), %rcx
movslq 0x24(%rsp), %rdx
imulq (%rcx,%rdx,8), %rax
movq 0x30(%rsp), %rcx
shrq $0x20, %rcx
movq 0x40(%rsp), %rdx
movslq 0x24(%rsp), %rsi
movq (%rdx,%rsi,8), %rdx
shrq $0x20, %rdx
imulq %rdx, %rcx
xorq %rcx, %rax
movl %eax, %eax
movq %rax, 0x28(%rsp)
movl 0x24(%rsp), %edi
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
xorl %r9d, %r9d
movl $0x7, %r8d
movl %r9d, %ecx
movl $0x7, (%rsp)
callq 0xe350
movq %rax, %rdx
movq 0x60(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movq 0x28(%rsp), %rsi
movq 0x48(%rsp), %rcx
movslq 0x24(%rsp), %rdi
movl (%rcx,%rdi,4), %ecx
shrq %cl, %rsi
movq 0x10(%rsp), %rcx
addq %rsi, %rcx
movq %rdx, (%rax,%rcx,8)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xe0ac
movl 0x20(%rsp), %eax
addl 0x1c(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0xe032
addq $0x68, %rsp
retq
nopl (%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/bitboard.cpp
// Function: (anonymous namespace)::init_pseudo_attacks()
void init_pseudo_attacks() {

    for (Square s = SQ_A1; s <= SQ_H8; s++)
    {
        BishopPseudoAttacks[s] = bishop_attacks_bb(s, EmptyBoardBB);
        RookPseudoAttacks[s]   = rook_attacks_bb(s, EmptyBoardBB);
        QueenPseudoAttacks[s]  = queen_attacks_bb(s, EmptyBoardBB);
    }
  }

// Assembly:
pushq %rax
movl $0x0, 0x4(%rsp)
cmpl $0x3f, 0x4(%rsp)
jg 0xe21e
movl 0x4(%rsp), %edi
xorl %eax, %eax
movl %eax, %esi
callq 0xe820
movq %rax, %rdx
movslq 0x4(%rsp), %rcx
leaq 0x145294(%rip), %rax    # 0x153460
movq %rdx, (%rax,%rcx,8)
movl 0x4(%rsp), %edi
xorl %eax, %eax
movl %eax, %esi
callq 0xe8c0
movq %rax, %rdx
movslq 0x4(%rsp), %rcx
leaq 0x145474(%rip), %rax    # 0x153660
movq %rdx, (%rax,%rcx,8)
movl 0x4(%rsp), %edi
xorl %eax, %eax
movl %eax, %esi
callq 0xe960
movq %rax, %rdx
movslq 0x4(%rsp), %rcx
leaq 0x145654(%rip), %rax    # 0x153860
movq %rdx, (%rax,%rcx,8)
leaq 0x4(%rsp), %rdi
xorl %esi, %esi
callq 0xe5c0
jmp 0xe1a9
popq %rax
retq
// File: ATOMIC-LICHESS[P]ATOMKRAFT/bitboard.cpp
// Function: (anonymous namespace)::init_between_bitboards()
void init_between_bitboards() {

    Square s1, s2, s3, d;
    int f, r;

    for (s1 = SQ_A1; s1 <= SQ_H8; s1++)
        for (s2 = SQ_A1; s2 <= SQ_H8; s2++)
            if (bit_is_set(QueenPseudoAttacks[s1], s2))
            {
                f = file_distance(s1, s2);
                r = rank_distance(s1, s2);

                d = (s2 - s1) / Max(f, r);

                for (s3 = s1 + d; s3 != s2; s3 += d)
                    set_bit(&(BetweenBB[s1][s2]), s3);
            }
  }

// Assembly:
subq $0x28, %rsp
movl $0x0, 0x24(%rsp)
cmpl $0x3f, 0x24(%rsp)
jg 0xe348
movl $0x0, 0x20(%rsp)
cmpl $0x3f, 0x20(%rsp)
jg 0xe335
movslq 0x24(%rsp), %rcx
leaq 0x14560a(%rip), %rax    # 0x153860
movq (%rax,%rcx,8), %rdi
movl 0x20(%rsp), %esi
callq 0xd760
cmpq $0x0, %rax
je 0xe322
movl 0x24(%rsp), %edi
movl 0x20(%rsp), %esi
callq 0xcd70
movl %eax, 0x14(%rsp)
movl 0x24(%rsp), %edi
movl 0x20(%rsp), %esi
callq 0xcdb0
movl %eax, 0x10(%rsp)
movl 0x20(%rsp), %edi
movl 0x24(%rsp), %esi
callq 0xe9c0
movl %eax, 0xc(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x10(%rsp), %eax
jge 0xe2b4
movl 0x10(%rsp), %eax
movl %eax, 0x8(%rsp)
jmp 0xe2bc
movl 0x14(%rsp), %eax
movl %eax, 0x8(%rsp)
movl 0xc(%rsp), %edi
movl 0x8(%rsp), %esi
callq 0xe9a0
movl %eax, 0x18(%rsp)
movl 0x24(%rsp), %edi
movl 0x18(%rsp), %esi
callq 0xd780
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
cmpl 0x20(%rsp), %eax
je 0xe320
movslq 0x24(%rsp), %rax
leaq 0x13c56c(%rip), %rdi    # 0x14a860
shlq $0x9, %rax
addq %rax, %rdi
movslq 0x20(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movl 0x1c(%rsp), %esi
callq 0xe7c0
movl 0x18(%rsp), %esi
leaq 0x1c(%rsp), %rdi
callq 0xd7a0
jmp 0xe2de
jmp 0xe322
jmp 0xe324
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0xe5c0
jmp 0xe23f
jmp 0xe337
leaq 0x24(%rsp), %rdi
xorl %esi, %esi
callq 0xe5c0
jmp 0xe22c
addq $0x28, %rsp
retq
nopl (%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/bitboard.cpp
// Function: (anonymous namespace)::sliding_attacks(int, unsigned long, int (*) [2], int, int, int, int)
Bitboard sliding_attacks(int sq, Bitboard occupied, int deltas[][2],
                           int fmin, int fmax, int rmin, int rmax) {
    int dx, dy, f, r;
    int rk = sq / 8;
    int fl = sq % 8;
    Bitboard attacks = EmptyBoardBB;

    for (int i = 0; i < 4; i++)
    {
        dx = deltas[i][0];
        dy = deltas[i][1];
        f = fl + dx;
        r = rk + dy;

        while (   (dx == 0 || (f >= fmin && f <= fmax))
               && (dy == 0 || (r >= rmin && r <= rmax)))
        {
            attacks |= (1ULL << (f + r * 8));

            if (occupied & (1ULL << (f + r * 8)))
                break;

            f += dx;
            r += dy;
        }
    }
    return attacks;
  }

// Assembly:
movl 0x8(%rsp), %eax
movl %edi, -0x4(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movl %ecx, -0x1c(%rsp)
movl %r8d, -0x20(%rsp)
movl %r9d, -0x24(%rsp)
movl -0x4(%rsp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, -0x38(%rsp)
movl -0x4(%rsp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, -0x3c(%rsp)
movq $0x0, -0x48(%rsp)
movl $0x0, -0x4c(%rsp)
cmpl $0x4, -0x4c(%rsp)
jge 0xe4d0
movq -0x18(%rsp), %rax
movslq -0x4c(%rsp), %rcx
movl (%rax,%rcx,8), %eax
movl %eax, -0x28(%rsp)
movq -0x18(%rsp), %rax
movslq -0x4c(%rsp), %rcx
movl 0x4(%rax,%rcx,8), %eax
movl %eax, -0x2c(%rsp)
movl -0x3c(%rsp), %eax
addl -0x28(%rsp), %eax
movl %eax, -0x30(%rsp)
movl -0x38(%rsp), %eax
addl -0x2c(%rsp), %eax
movl %eax, -0x34(%rsp)
cmpl $0x0, -0x28(%rsp)
je 0xe40e
movl -0x30(%rsp), %ecx
xorl %eax, %eax
cmpl -0x1c(%rsp), %ecx
movb %al, -0x4d(%rsp)
jl 0xe44a
movl -0x30(%rsp), %ecx
xorl %eax, %eax
cmpl -0x20(%rsp), %ecx
movb %al, -0x4d(%rsp)
jg 0xe44a
movb $0x1, %al
cmpl $0x0, -0x2c(%rsp)
movb %al, -0x4e(%rsp)
je 0xe442
movl -0x34(%rsp), %ecx
xorl %eax, %eax
cmpl -0x24(%rsp), %ecx
movb %al, -0x4f(%rsp)
jl 0xe43a
movl -0x34(%rsp), %eax
cmpl 0x8(%rsp), %eax
setle %al
movb %al, -0x4f(%rsp)
movb -0x4f(%rsp), %al
movb %al, -0x4e(%rsp)
movb -0x4e(%rsp), %al
movb %al, -0x4d(%rsp)
movb -0x4d(%rsp), %al
testb $0x1, %al
jne 0xe454
jmp 0xe4be
movl -0x30(%rsp), %eax
movl -0x34(%rsp), %ecx
shll $0x3, %ecx
addl %ecx, %eax
movl %eax, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
orq -0x48(%rsp), %rax
movq %rax, -0x48(%rsp)
movq -0x10(%rsp), %rax
movl -0x30(%rsp), %ecx
movl -0x34(%rsp), %edx
shll $0x3, %edx
addl %edx, %ecx
movl %ecx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0xe4a1
jmp 0xe4be
movl -0x28(%rsp), %eax
addl -0x30(%rsp), %eax
movl %eax, -0x30(%rsp)
movl -0x2c(%rsp), %eax
addl -0x34(%rsp), %eax
movl %eax, -0x34(%rsp)
jmp 0xe3e7
jmp 0xe4c0
movl -0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rsp)
jmp 0xe3a1
movq -0x48(%rsp), %rax
retq
nopw %cs:(%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/bitboard.cpp
// Function: (anonymous namespace)::index_to_bitboard(int, unsigned long)
Bitboard index_to_bitboard(int index, Bitboard mask) {

    Bitboard result = EmptyBoardBB;
    int sq, cnt = 0;

    while (mask)
    {
        sq = pop_1st_bit(&mask);

        if (index & (1 << cnt++))
            result |= (1ULL << sq);
    }
    return result;
  }

// Assembly:
subq $0x28, %rsp
movl %edi, 0x24(%rsp)
movq %rsi, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movl $0x0, 0x8(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0xe54f
leaq 0x18(%rsp), %rdi
callq 0xd940
movl %eax, 0xc(%rsp)
movl 0x24(%rsp), %eax
movl 0x8(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x8(%rsp)
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0xe54d
movl 0xc(%rsp), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
orq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0xe4fe
movq 0x10(%rsp), %rax
addq $0x28, %rsp
retq
nopl (%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/./bitcount.h
// Function: int count_1s<(BitCountType)2>(unsigned long)
inline int count_1s<CNT32>(Bitboard b) {
  unsigned w = unsigned(b >> 32), v = unsigned(b);
  v -= (v >> 1) & 0x55555555; // 0-2 in 2 bits
  w -= (w >> 1) & 0x55555555;
  v = ((v >> 2) & 0x33333333) + (v & 0x33333333); // 0-4 in 4 bits
  w = ((w >> 2) & 0x33333333) + (w & 0x33333333);
  v = ((v >> 4) + v) & 0x0F0F0F0F; // 0-8 in 8 bits
  v += (((w >> 4) + w) & 0x0F0F0F0F);  // 0-16 in 8 bits
  v *= 0x01010101; // mul is fast on amd procs
  return int(v >> 24);
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
shrq $0x20, %rax
movl %eax, -0xc(%rsp)
movq -0x8(%rsp), %rax
movl %eax, -0x10(%rsp)
movl -0x10(%rsp), %ecx
shrl %ecx
andl $0x55555555, %ecx       # imm = 0x55555555
movl -0x10(%rsp), %eax
subl %ecx, %eax
movl %eax, -0x10(%rsp)
movl -0xc(%rsp), %ecx
shrl %ecx
andl $0x55555555, %ecx       # imm = 0x55555555
movl -0xc(%rsp), %eax
subl %ecx, %eax
movl %eax, -0xc(%rsp)
movl -0x10(%rsp), %eax
shrl $0x2, %eax
andl $0x33333333, %eax       # imm = 0x33333333
movl -0x10(%rsp), %ecx
andl $0x33333333, %ecx       # imm = 0x33333333
addl %ecx, %eax
movl %eax, -0x10(%rsp)
movl -0xc(%rsp), %eax
shrl $0x2, %eax
andl $0x33333333, %eax       # imm = 0x33333333
movl -0xc(%rsp), %ecx
andl $0x33333333, %ecx       # imm = 0x33333333
addl %ecx, %eax
movl %eax, -0xc(%rsp)
movl -0x10(%rsp), %eax
shrl $0x4, %eax
addl -0x10(%rsp), %eax
andl $0xf0f0f0f, %eax        # imm = 0xF0F0F0F
movl %eax, -0x10(%rsp)
movl -0xc(%rsp), %eax
shrl $0x4, %eax
addl -0xc(%rsp), %eax
andl $0xf0f0f0f, %eax        # imm = 0xF0F0F0F
addl -0x10(%rsp), %eax
movl %eax, -0x10(%rsp)
imull $0x1010101, -0x10(%rsp), %eax # imm = 0x1010101
movl %eax, -0x10(%rsp)
movl -0x10(%rsp), %eax
shrl $0x18, %eax
retq
nop
// File: ATOMIC-LICHESS[P]ATOMKRAFT/book.cpp
// Function: Book::Book()
Book::Book() {

  OLD for (int i = abs(get_system_time() % 10000); i > 0; i--)
      RKiss.rand<unsigned>();
  
  STARTNEW
  // in our implementation get_system_time returns the milliseconds since program start 
  for (int i = abs(rand() % 10000); i > 0; i--)
        RKiss.rand<unsigned>();
  ENDNEW
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movq %rdi, %rax
movq %rax, 0x8(%rsp)
callq 0x6600
movq 0x18(%rsp), %rdi
addq $0x210, %rdi            # imm = 0x210
movq %rdi, 0x10(%rsp)
callq 0x6730
movq 0x18(%rsp), %rdi
addq $0x238, %rdi            # imm = 0x238
callq 0xf5f0
jmp 0xeba9
callq 0x6140
movl $0x2710, %ecx           # imm = 0x2710
cltd
idivl %ecx
movl %edx, %eax
negl %eax
cmovnsl %eax, %edx
movl %edx, 0x20(%rsp)
cmpl $0x0, 0x20(%rsp)
jle 0xec0e
movq 0x8(%rsp), %rdi
addq $0x238, %rdi            # imm = 0x238
callq 0xf600
jmp 0xebdb
jmp 0xebdd
movl 0x20(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0xebc1
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
callq 0x6a78
movq 0x18(%rsp), %rdi
callq 0x6110
jmp 0xec13
addq $0x38, %rsp
retq
movq 0x28(%rsp), %rdi
callq 0x6970
nopl (%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/book.cpp
// Function: Book::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Book::open(const string& fileName) {

  // Close old file before opening the new
  close();
  
  OLD bookFile.open(fileName.c_str(), ifstream::in | ifstream::binary);
  NEW bookFile.open(fileName.c_str(), 
		  ifstream::in | ifstream::binary | ofstream::binary | ofstream::out);

  // Silently return when asked to open a non-exsistent file
  if (!bookFile.is_open())
      return;

  // Get the book size in number of entries
  bookFile.seekg(0, ios::end);
  bookSize = long(bookFile.tellg()) / sizeof(BookEntry);

  if (!bookFile.good())
  {
      cerr << "Failed to open book file " << fileName << endl;
      exit(EXIT_FAILURE);
  }

  // Set only if successful
  bookName = fileName;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xec70
movq 0x28(%rsp), %rdi
callq 0x61d0
movq %rax, 0x8(%rsp)
movl $0x8, %edi
movl $0x4, %esi
callq 0xf620
movl %eax, %edi
movl $0x4, %esi
callq 0xf620
movl %eax, %edi
movl $0x10, %esi
callq 0xf620
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdi
movl %eax, %edx
callq 0x6440
movq 0x10(%rsp), %rdi
callq 0x6930
testb $0x1, %al
jne 0xed37
jmp 0xedd6
movq 0x10(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x6700
movq 0x10(%rsp), %rdi
callq 0x6950
movq %rax, 0x18(%rsp)
movq %rdx, 0x20(%rsp)
leaq 0x18(%rsp), %rdi
callq 0xf640
movq 0x10(%rsp), %rdi
shrq $0x4, %rax
movl %eax, 0x230(%rdi)
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0x6900
testb $0x1, %al
jne 0xedc0
movq 0x5d262(%rip), %rdi     # 0x6bff0
leaq 0x4a6f3(%rip), %rsi     # 0x59488
callq 0x64b0
movq %rax, %rdi
movq 0x28(%rsp), %rsi
callq 0x6420
movq %rax, %rdi
movq 0x5d1df(%rip), %rsi     # 0x6bf90
callq 0x6520
movl $0x1, %edi
callq 0x6630
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rsi
addq $0x210, %rdi            # imm = 0x210
callq 0x6060
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/book.cpp
// Function: Book::find_entry(unsigned long)
int Book::find_entry(uint64_t key) {

  int left, right, mid;

  // Binary search (finds the leftmost entry)
  left = 0;
  right = bookSize - 1;

  assert(left <= right);

  while (left < right)
  {
      mid = (left + right) / 2;

      assert(mid >= left && mid < right);

      if (key <= read_entry(mid).key)
          right = mid;
      else
          left = mid + 1;
  }

  assert(left == right);

  return read_entry(left).key == key ? left : bookSize;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movl $0x0, 0x44(%rsp)
movl 0x230(%rax), %eax
subl $0x1, %eax
movl %eax, 0x40(%rsp)
movl 0x44(%rsp), %eax
cmpl 0x40(%rsp), %eax
jge 0xf123
movq 0x10(%rsp), %rdi
movl 0x44(%rsp), %eax
addl 0x40(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x3c(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x3c(%rsp), %esi
callq 0xf170
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
cmpq 0x28(%rsp), %rax
ja 0xf116
movl 0x3c(%rsp), %eax
movl %eax, 0x40(%rsp)
jmp 0xf121
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0xf0bd
movq 0x10(%rsp), %rdi
movl 0x44(%rsp), %esi
callq 0xf170
movq %rax, 0x18(%rsp)
movq %rdx, 0x20(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x48(%rsp), %rax
jne 0xf151
movl 0x44(%rsp), %eax
movl %eax, 0x4(%rsp)
jmp 0xf160
movq 0x10(%rsp), %rax
movl 0x230(%rax), %eax
movl %eax, 0x4(%rsp)
movl 0x4(%rsp), %eax
addq $0x58, %rsp
retq
nopl (%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/book.cpp
// Function: Book::read_entry(int)
BookEntry Book::read_entry(int idx) {

  assert(idx >= 0 && idx < bookSize);
  assert(bookFile.is_open());

  BookEntry e;

  bookFile.seekg(idx * sizeof(BookEntry), ios_base::beg);

  get_number(e.key);
  get_number(e.move);
  get_number(e.count);
  get_number(e.learn);

  if (!bookFile.good())
  {
      cerr << "Failed to read book entry at index " << idx << endl;
      exit(EXIT_FAILURE);
  }
  return e;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
movslq 0xc(%rsp), %rsi
shlq $0x4, %rsi
xorl %edx, %edx
callq 0x6700
movq (%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xf6a0
movq (%rsp), %rdi
leaq 0x18(%rsp), %rsi
addq $0x8, %rsi
callq 0xf720
movq (%rsp), %rdi
leaq 0x18(%rsp), %rsi
addq $0xa, %rsi
callq 0xf720
movq (%rsp), %rdi
leaq 0x18(%rsp), %rsi
addq $0xc, %rsi
callq 0xf7a0
movq (%rsp), %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0x6900
testb $0x1, %al
jne 0xf226
movq 0x5cdfb(%rip), %rdi     # 0x6bff0
leaq 0x4a2a6(%rip), %rsi     # 0x594a2
callq 0x64b0
movq %rax, %rdi
movl 0xc(%rsp), %esi
callq 0x6940
movq %rax, %rdi
movq 0x5cd79(%rip), %rsi     # 0x6bf90
callq 0x6520
movl $0x1, %edi
callq 0x6630
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rdx
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/book.cpp
// Function: Book::write_entry(unsigned long, Move, unsigned short)
void Book::write_entry(uint64_t key, Move move, uint16_t count) {
	// convert Move to polyglot move
	uint16_t m = make_move(move_from(move), move_to(move)) | (move_promotion_piece(move) << 12);
	uint32_t learn = 0;
	
	write_number(key);
	write_number(m);
	write_number(count);
	write_number(learn);
	
	++bookSize;
	
	if (!bookFile.good()) {
		cerr << "Failed to write book." << endl;
		exit(EXIT_FAILURE);
	}
	
//	bookFile.flush();
//	
//	if (!bookFile.good()) {
//		cerr << "Failed to flush book." << endl;
//		exit(EXIT_FAILURE);
//	}
}

// Assembly:
subq $0x38, %rsp
movw %cx, %ax
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl %edx, 0x24(%rsp)
movw %ax, 0x22(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0x24(%rsp), %edi
callq 0xf680
movl %eax, 0x8(%rsp)
movl 0x24(%rsp), %edi
callq 0xf690
movl 0x8(%rsp), %edi
movl %eax, %esi
callq 0xf810
movl %eax, 0xc(%rsp)
movl 0x24(%rsp), %edi
callq 0xf830
movq 0x10(%rsp), %rdi
movl %eax, %ecx
movl 0xc(%rsp), %eax
shll $0xc, %ecx
orl %ecx, %eax
movw %ax, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
leaq 0x28(%rsp), %rsi
callq 0xf870
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xf8f0
movq 0x10(%rsp), %rdi
leaq 0x22(%rsp), %rsi
callq 0xf8f0
movq 0x10(%rsp), %rdi
leaq 0x1c(%rsp), %rsi
callq 0xf970
movq 0x10(%rsp), %rdi
movl 0x230(%rdi), %eax
addl $0x1, %eax
movl %eax, 0x230(%rdi)
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0x6900
testb $0x1, %al
jne 0xf336
movq 0x5ccdf(%rip), %rdi     # 0x6bff0
leaq 0x4a1ae(%rip), %rsi     # 0x594c6
callq 0x64b0
movq %rax, %rdi
movq 0x5cc69(%rip), %rsi     # 0x6bf90
callq 0x6520
movl $0x1, %edi
callq 0x6630
addq $0x38, %rsp
retq
nopl (%rax,%rax)