LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/position.cpp
// Function: Position::clear()
void Position::clear() {

  st = &startState;
  memset(st, 0, sizeof(StateInfo));
  st->epSquare = SQ_NONE;
  startPosPlyCounter = 0;
  nodes = 0;

  memset(byColorBB,  0, sizeof(Bitboard) * 2);
  memset(byTypeBB,   0, sizeof(Bitboard) * 8);
  memset(pieceCount, 0, sizeof(int) * 2 * 8);
  memset(index,      0, sizeof(int) * 64);

  for (int i = 0; i < 64; i++)
      board[i] = PIECE_NONE;

  for (int i = 0; i < 8; i++)
      for (int j = 0; j < 16; j++)
          pieceList[0][i][j] = pieceList[1][i][j] = SQ_NONE;

  for (Square sq = SQ_A1; sq <= SQ_H8; sq++)
      castleRightsMask[sq] = ALL_CASTLES;

  sideToMove = WHITE;
  initialKFile = FILE_E;
  initialKRFile = FILE_H;
  initialQRFile = FILE_A;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
addq $0x1878, %rdi           # imm = 0x1878
movq %rdi, 0x1938(%rbx)
xorl %r15d, %r15d
movl $0xa0, %edx
xorl %esi, %esi
callq 0x5210
movl $0x40, 0x1898(%rbx)
movl $0x0, 0x1928(%rbx)
movq $0x0, 0x1930(%rbx)
leaq 0x100(%rbx), %r14
leaq 0x590(%rbx), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x5210
movl $0x90, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x5210
movaps 0x1159a(%rip), %xmm0    # 0x2e300
movups %xmm0, (%rbx,%r15,4)
addq $0x4, %r15
cmpq $0x40, %r15
jne 0x1cd66
leaq 0x390(%rbx), %rax
xorl %ecx, %ecx
movaps 0x14e0b(%rip), %xmm0    # 0x31b90
xorl %edx, %edx
movups %xmm0, (%rax,%rdx,4)
movups %xmm0, -0x200(%rax,%rdx,4)
addq $0x4, %rdx
cmpq $0x10, %rdx
jne 0x1cd87
incq %rcx
addq $0x40, %rax
cmpq $0x8, %rcx
jne 0x1cd85
xorl %eax, %eax
movaps 0x14ded(%rip), %xmm0    # 0x31ba0
movups %xmm0, 0x1778(%rbx,%rax,4)
addq $0x4, %rax
cmpq $0x40, %rax
jne 0x1cdb3
xorl %eax, %eax
movl %eax, 0x1090(%rbx)
movabsq $0x700000004, %rcx      # imm = 0x700000004
movq %rcx, 0x1918(%rbx)
movl %eax, 0x1920(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/position.cpp
// Function: Position::compute_key() const
Key Position::compute_key() const {

  Key result = zobCastle[st->castleRights];

  for (Square s = SQ_A1; s <= SQ_H8; s++)
      if (square_is_occupied(s))
          result ^= zobrist[color_of_piece_on(s)][type_of_piece_on(s)][s];

  if (ep_square() != SQ_NONE)
      result ^= zobEp[ep_square()];

  if (side_to_move() == BLACK)
      result ^= zobSideToMove;

  return result;
}

// Assembly:
movq 0x1938(%rdi), %rax
movslq 0x10(%rax), %rcx
leaq 0x39d048(%rip), %rdx    # 0x3ba190
movq (%rdx,%rcx,8), %rcx
xorl %edx, %edx
leaq 0x39ae3b(%rip), %rsi    # 0x3b7f90
movq %rdi, %r8
movl (%r8), %r9d
cmpq $0x10, %r9
je 0x1d17e
movl %r9d, %r10d
sarl $0x3, %r10d
andl $0x7, %r9d
shlq $0xc, %r10
shll $0x9, %r9d
orq %r10, %r9
addq %rdx, %r9
xorq (%rsi,%r9), %rcx
addq $0x8, %rdx
addq $0x4, %r8
cmpq $0x200, %rdx            # imm = 0x200
jne 0x1d158
movslq 0x20(%rax), %rax
cmpq $0x40, %rax
je 0x1d1a4
leaq 0x39cdf0(%rip), %rdx    # 0x3b9f90
xorq (%rdx,%rax,8), %rcx
cmpl $0x1, 0x1090(%rdi)
jne 0x1d1b6
movq 0x39d05c(%rip), %rax    # 0x3ba210
jmp 0x1d1b8
xorl %eax, %eax
xorq %rcx, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/position.cpp
// Function: Position::compute_pawn_key() const
Key Position::compute_pawn_key() const {

  Bitboard b;
  Key result = 0;

  for (Color c = WHITE; c <= BLACK; c++)
  {
      b = pieces(PAWN, c);
      while (b)
          result ^= zobrist[c][PAWN][pop_1st_bit(&b)];
  }
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r12d, %r12d
movq %rsp, %r14
leaq 0x39adb9(%rip), %r13    # 0x3b7f90
xorl %r15d, %r15d
movq 0x140(%rbx,%r12,8), %rax
andq 0x108(%rbx), %rax
movq %rax, (%rsp)
je 0x1d212
movq %r12, %rbp
shlq $0xc, %rbp
addq %r13, %rbp
movq %r14, %rdi
callq 0x7d37
cltq
xorq 0x200(%rbp,%rax,8), %r15
cmpq $0x0, (%rsp)
jne 0x1d1f9
leaq 0x1(%r12), %rax
testq %r12, %r12
movq %rax, %r12
je 0x1d1da
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/position.cpp
// Function: Position::compute_material_key() const
Key Position::compute_material_key() const {

  int count;
  Key result = 0;

  for (Color c = WHITE; c <= BLACK; c++)
      for (PieceType pt = PAWN; pt <= QUEEN; pt++)
      {
          count = piece_count(c, pt);
          for (int i = 0; i < count; i++)
              result ^= zobrist[c][pt][i];
      }
  return result;
}

// Assembly:
addq $0x150, %rdi            # imm = 0x150
leaq 0x39af50(%rip), %rcx    # 0x3b8190
xorl %edx, %edx
xorl %eax, %eax
movl $0x1, %esi
movq %rdx, %r8
shlq $0x5, %r8
addq %rdi, %r8
movq %rcx, %r9
movslq (%r8,%rsi,4), %r10
testq %r10, %r10
jle 0x1d26e
xorl %r11d, %r11d
xorq (%r9,%r11,8), %rax
incq %r11
cmpq %r11, %r10
jne 0x1d262
incq %rsi
addq $0x200, %r9             # imm = 0x200
cmpq $0x6, %rsi
jne 0x1d256
leaq 0x1(%rdx), %rsi
addq $0x1000, %rcx           # imm = 0x1000
testq %rdx, %rdx
movq %rsi, %rdx
je 0x1d244
retq
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/position.cpp
// Function: Position::compute_value() const
Score Position::compute_value() const {

  Bitboard b;
  Score result = SCORE_ZERO;

  for (Color c = WHITE; c <= BLACK; c++)
      for (PieceType pt = PAWN; pt <= KING; pt++)
      {
          b = pieces(pt, c);
          while (b)
              result += pst(c, pt, pop_1st_bit(&b));
      }

  result += (side_to_move() == WHITE ? TempoValue / 2 : -TempoValue / 2);
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x8(%rsp), %r14
xorl %ebp, %ebp
leaq (,%r15,8), %rax
movq %rax, 0x10(%rsp)
movl $0x1, %r12d
movq 0x140(%rbx,%r15,8), %rax
andq 0x100(%rbx,%r12,8), %rax
movq %rax, 0x8(%rsp)
je 0x1d305
movq 0x10(%rsp), %rax
leaq (%r12,%rax), %r13
shlq $0x8, %r13
leaq 0x39cf35(%rip), %rax    # 0x3ba220
addq %rax, %r13
movq %r14, %rdi
callq 0x7d37
cltq
addl (%r13,%rax,4), %ebp
cmpq $0x0, 0x8(%rsp)
jne 0x1d2ee
incq %r12
cmpq $0x7, %r12
jne 0x1d2c0
leaq 0x1(%r15), %rax
testq %r15, %r15
movq %rax, %r15
je 0x1d2ad
movl 0x39dfc0(%rip), %eax    # 0x3bb2e0
movl %eax, %ecx
negl %ecx
cmpl $0x0, 0x1090(%rbx)
cmovel %eax, %ecx
movl $0x8000, %edx           # imm = 0x8000
leal (%rcx,%rdx), %eax
movl %eax, %esi
sarl $0x10, %esi
shrl $0x1f, %eax
addl %esi, %eax
movl %ecx, %esi
andl $0x7fff, %esi           # imm = 0x7FFF
andl %edx, %ecx
subl %ecx, %esi
movl %esi, %ecx
shrl $0x1f, %ecx
addl %esi, %ecx
sarl %ecx
andl $-0x2, %eax
shll $0xf, %eax
addl %ecx, %eax
addl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/position.cpp
// Function: Position::compute_non_pawn_material(Color) const
Value Position::compute_non_pawn_material(Color c) const {

  Value result = VALUE_ZERO;

  for (PieceType pt = KNIGHT; pt <= QUEEN; pt++)
      result += piece_count(c, pt) * PieceValueMidgame[pt];

  return result;
}

// Assembly:
movl %esi, %eax
movdqu 0x39deb0(%rip), %xmm0   # 0x3bb228
shlq $0x5, %rax
movdqu 0x158(%rdi,%rax), %xmm1
pshufd $0xf5, %xmm0, %xmm2     # xmm2 = xmm0[1,1,3,3]
pmuludq %xmm1, %xmm0
pshufd $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3]
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
pmuludq %xmm2, %xmm1
pshufd $0xe8, %xmm1, %xmm1     # xmm1 = xmm1[0,2,2,3]
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
pshufd $0xee, %xmm0, %xmm1     # xmm1 = xmm0[2,3,2,3]
paddd %xmm0, %xmm1
pshufd $0x55, %xmm1, %xmm0     # xmm0 = xmm1[1,1,1,1]
paddd %xmm1, %xmm0
movd %xmm0, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/position.cpp
// Function: Position::neigh_is_ok()
bool Position::neigh_is_ok() {
	
	Square noSquares[64][9];
	Value neValue[64];
	
	write_neigh_arrays(noSquares, neValue);
	
	for (Square s = SQ_A1; s < SQ_NONE; ++s) {
		cout << s << endl;
		
		if (neValue[s] != neigh_expl_value(s)) {
			
#ifndef NDEBUG
			cout << "neValue - Square: " << s 
				 << ", neValue: " << neValue[s] 
				 << ", neigh_expl_value: " << neigh_expl_value(s) << endl;
#endif
			
			return false;
		}
		
		
		Bitboard b1 = EmptyBoardBB;
		Bitboard b2 = EmptyBoardBB;
		
		for (int k = 1; k <= noSquares[s][0]; ++k) {
			set_bit(&b1, noSquares[s][k]);
		}
		for (int k = 1; k <= neighOccSquares[s][0]; ++k) {
			set_bit(&b2, neighOccSquares[s][k]);
		}
		
		if (b1 != b2) {
			return false;
		}
	}
	
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa18, %rsp            # imm = 0xA18
movq %rdi, %rbx
leaq 0x110(%rsp), %r14
leaq 0x10(%rsp), %rdx
movq %r14, %rsi
callq 0x1d3bc
leaq 0x690(%rbx), %rax
movq %rax, (%rsp)
movq %rbx, 0x8(%rsp)
leaq 0x694(%rbx), %r15
xorl %r13d, %r13d
leaq 0xfab2c(%rip), %rbx     # 0x1181a0
xorl %r12d, %r12d
movq 0x1e922(%rip), %rdi     # 0x3bfa0
movl %r13d, %esi
callq 0x5760
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x53c0
movsbl %al, %esi
movq %rbp, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x5270
movl 0x10(%rsp,%r13,4), %eax
movq 0x8(%rsp), %rcx
cmpl 0xf90(%rcx,%r13,4), %eax
jne 0x1d741
leaq (,%r13,8), %rcx
addq %r13, %rcx
movl 0x110(%rsp,%rcx,4), %edx
testl %edx, %edx
jle 0x1d6f6
incq %rdx
movl $0x1, %esi
xorl %eax, %eax
movslq (%r14,%rsi,4), %rdi
orq (%rbx,%rdi,8), %rax
incq %rsi
cmpq %rsi, %rdx
jne 0x1d6e4
jmp 0x1d6f8
xorl %eax, %eax
movq (%rsp), %rdx
movl (%rdx,%rcx,4), %ecx
testl %ecx, %ecx
jle 0x1d719
xorl %esi, %esi
xorl %edx, %edx
movslq (%r15,%rsi,4), %rdi
orq (%rbx,%rdi,8), %rdx
incq %rsi
cmpq %rsi, %rcx
jne 0x1d707
jmp 0x1d71b
xorl %edx, %edx
cmpq %rdx, %rax
jne 0x1d741
cmpq $0x3f, %r13
leaq 0x1(%r13), %rax
setae %r12b
addq $0x24, %r14
addq $0x24, %r15
movq %rax, %r13
cmpq $0x40, %rax
jne 0x1d677
andb $0x1, %r12b
movl %r12d, %eax
addq $0xa18, %rsp            # imm = 0xA18
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/position.cpp
// Function: Position::attacks_from(Piece, Square) const
Bitboard Position::attacks_from(Piece p, Square s) const {

  assert(square_is_ok(s));

  switch (p)
  {
  case WB: case BB: return attacks_from<BISHOP>(s);
  case WR: case BR: return attacks_from<ROOK>(s);
  case WQ: case BQ: return attacks_from<QUEEN>(s);
  default: return StepAttacksBB[p][s];
  }
}

// Assembly:
cmpl $0xd, %esi
ja 0x1e10a
movl $0x808, %eax            # imm = 0x808
btl %esi, %eax
jb 0x1e0b6
movl $0x1010, %eax           # imm = 0x1010
btl %esi, %eax
jb 0x1e065
movl $0x2020, %eax           # imm = 0x2020
btl %esi, %eax
jae 0x1e10a
movq 0x100(%rdi), %rsi
movslq %edx, %rax
leaq 0x277ca(%rip), %rcx     # 0x457a0
movq (%rcx,%rax,8), %rcx
andq %rsi, %rcx
leaq 0x1055c(%rip), %rdx     # 0x2e540
movq (%rdx,%rax,8), %rdx
movl %edx, %edi
imull %ecx, %edi
shrq $0x20, %rcx
shrq $0x20, %rdx
imull %ecx, %edx
xorl %edi, %edx
leaq 0x1083f(%rip), %rcx     # 0x2e840
movb (%rcx,%rax,4), %cl
shrl %cl, %edx
leaq 0x27993(%rip), %rcx     # 0x459a0
addl (%rcx,%rax,4), %edx
leaq 0xefa89(%rip), %rcx     # 0x10daa0
andq (%rcx,%rax,8), %rsi
leaq 0x1031e(%rip), %rcx     # 0x2e340
movq (%rcx,%rax,8), %rdi
movl %edi, %ecx
imull %esi, %ecx
shrq $0x20, %rsi
shrq $0x20, %rdi
imull %esi, %edi
xorl %ecx, %edi
leaq 0x10701(%rip), %rcx     # 0x2e740
movb (%rcx,%rax,4), %cl
shrl %cl, %edi
leaq 0x27a55(%rip), %rcx     # 0x45aa0
leaq 0xefc4e(%rip), %rsi     # 0x10dca0
addl (%rsi,%rax,4), %edi
leaq 0xefd44(%rip), %rax     # 0x10dda0
movq (%rax,%rdi,8), %rax
orq (%rcx,%rdx,8), %rax
retq
movslq %edx, %rax
leaq 0x27731(%rip), %rcx     # 0x457a0
movq (%rcx,%rax,8), %rcx
andq 0x100(%rdi), %rcx
leaq 0x2791f(%rip), %rdx     # 0x459a0
leaq 0x104b8(%rip), %rsi     # 0x2e540
movq (%rsi,%rax,8), %rsi
movl %esi, %edi
imull %ecx, %edi
shrq $0x20, %rcx
shrq $0x20, %rsi
imull %ecx, %esi
xorl %edi, %esi
leaq 0x1079b(%rip), %rcx     # 0x2e840
movb (%rcx,%rax,4), %cl
shrl %cl, %esi
addl (%rdx,%rax,4), %esi
leaq 0x279ec(%rip), %rax     # 0x45aa0
jmp 0x1e105
movslq %edx, %rax
leaq 0xef9e0(%rip), %rcx     # 0x10daa0
movq (%rcx,%rax,8), %rcx
andq 0x100(%rdi), %rcx
leaq 0xefbce(%rip), %rdx     # 0x10dca0
leaq 0x10267(%rip), %rsi     # 0x2e340
movq (%rsi,%rax,8), %rsi
movl %esi, %edi
imull %ecx, %edi
shrq $0x20, %rcx
shrq $0x20, %rsi
imull %ecx, %esi
xorl %edi, %esi
leaq 0x1064a(%rip), %rcx     # 0x2e740
movb (%rcx,%rax,4), %cl
shrl %cl, %esi
addl (%rdx,%rax,4), %esi
leaq 0xefc9b(%rip), %rax     # 0x10dda0
movq (%rax,%rsi,8), %rax
retq
movl %esi, %eax
movslq %edx, %rcx
shlq $0x9, %rax
addq 0x1debe(%rip), %rax     # 0x3bfd8
movq (%rax,%rcx,8), %rax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/position.cpp
// Function: Position::attacks_from(Piece, Square, unsigned long)
Bitboard Position::attacks_from(Piece p, Square s, Bitboard occ) {

  assert(square_is_ok(s));

  switch (p)
  {
  case WB: case BB: return bishop_attacks_bb(s, occ);
  case WR: case BR: return rook_attacks_bb(s, occ);
  case WQ: case BQ: return bishop_attacks_bb(s, occ) | rook_attacks_bb(s, occ);
  default: return StepAttacksBB[p][s];
  }
}

// Assembly:
cmpl $0xd, %edi
ja 0x1e283
movl $0x808, %eax            # imm = 0x808
btl %edi, %eax
jb 0x1e236
movl $0x1010, %eax           # imm = 0x1010
btl %edi, %eax
jb 0x1e1ec
movl $0x2020, %eax           # imm = 0x2020
btl %edi, %eax
jae 0x1e283
movslq %esi, %rax
leaq 0xef943(%rip), %rcx     # 0x10daa0
movq (%rcx,%rax,8), %rcx
andq %rdx, %rcx
leaq 0x101d5(%rip), %rsi     # 0x2e340
movq (%rsi,%rax,8), %rsi
movl %esi, %edi
imull %ecx, %edi
shrq $0x20, %rcx
shrq $0x20, %rsi
imull %ecx, %esi
xorl %edi, %esi
leaq 0x105b8(%rip), %rcx     # 0x2e740
movb (%rcx,%rax,4), %cl
shrl %cl, %esi
leaq 0xefb0c(%rip), %rcx     # 0x10dca0
addl (%rcx,%rax,4), %esi
leaq 0x27602(%rip), %rcx     # 0x457a0
andq (%rcx,%rax,8), %rdx
leaq 0x10397(%rip), %rcx     # 0x2e540
movq (%rcx,%rax,8), %rdi
movl %edi, %ecx
imull %edx, %ecx
shrq $0x20, %rdx
shrq $0x20, %rdi
imull %edx, %edi
xorl %ecx, %edi
leaq 0x1067a(%rip), %rcx     # 0x2e840
movb (%rcx,%rax,4), %cl
shrl %cl, %edi
leaq 0xefbce(%rip), %rcx     # 0x10dda0
leaq 0x277c7(%rip), %rdx     # 0x459a0
addl (%rdx,%rax,4), %edi
leaq 0x278bd(%rip), %rax     # 0x45aa0
movq (%rax,%rdi,8), %rax
orq (%rcx,%rsi,8), %rax
retq
movslq %esi, %rax
leaq 0x275aa(%rip), %rcx     # 0x457a0
andq (%rcx,%rax,8), %rdx
leaq 0x2779f(%rip), %rsi     # 0x459a0
leaq 0x10338(%rip), %rcx     # 0x2e540
movq (%rcx,%rax,8), %rdi
movl %edi, %ecx
imull %edx, %ecx
shrq $0x20, %rdx
shrq $0x20, %rdi
imull %edx, %edi
xorl %ecx, %edi
leaq 0x1061b(%rip), %rcx     # 0x2e840
movb (%rcx,%rax,4), %cl
shrl %cl, %edi
addl (%rsi,%rax,4), %edi
leaq 0x2786c(%rip), %rax     # 0x45aa0
jmp 0x1e27e
movslq %esi, %rax
leaq 0xef860(%rip), %rcx     # 0x10daa0
andq (%rcx,%rax,8), %rdx
leaq 0xefa55(%rip), %rsi     # 0x10dca0
leaq 0x100ee(%rip), %rcx     # 0x2e340
movq (%rcx,%rax,8), %rdi
movl %edi, %ecx
imull %edx, %ecx
shrq $0x20, %rdx
shrq $0x20, %rdi
imull %edx, %edi
xorl %ecx, %edi
leaq 0x104d1(%rip), %rcx     # 0x2e740
movb (%rcx,%rax,4), %cl
shrl %cl, %edi
addl (%rsi,%rax,4), %edi
leaq 0xefb22(%rip), %rax     # 0x10dda0
movq (%rax,%rdi,8), %rax
retq
movl %edi, %eax
movslq %esi, %rcx
shlq $0x9, %rax
addq 0x1dd45(%rip), %rax     # 0x3bfd8
movq (%rax,%rcx,8), %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/position.cpp
// Function: Position::pl_move_is_evasion(Move, unsigned long) const
bool Position::pl_move_is_evasion(Move m, Bitboard pinned) const
{
  assert(in_check());

  NEW assert(color_of_piece_on(move_from(m)) == side_to_move());
  
  Color us = side_to_move();
  Square from = move_from(m);
  Square to = move_to(m);

  // King moves and en-passant captures are verified in pl_move_is_legal()
  if (type_of_piece_on(from) == KING || move_is_ep(m))
      return pl_move_is_legal(m, pinned);

  Bitboard target = checkers();
  Square checksq = pop_1st_bit(&target);

  if (target) // double check ?
      return false;

  // Our move must be a blocking evasion or a capture of the checking piece
  NEW assert(piece_count(us, KING));
  target = squares_between(checksq, king_square(us)) | checkers();
  return bit_is_set(target, to) && pl_move_is_legal(m, pinned);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movl %esi, %eax
andl $0xc000, %eax           # imm = 0xC000
cmpl $0x8000, %eax           # imm = 0x8000
je 0x1e74c
movl %ebp, %eax
shrl $0x4, %eax
andl $0xfc, %eax
movl (%r14,%rax), %eax
andl $0x7, %eax
cmpl $0x6, %eax
je 0x1e74c
movl 0x1090(%r14), %r12d
movq 0x1938(%r14), %rax
movq 0x40(%rax), %rax
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
movq %r15, %rdi
callq 0x7d37
cmpq $0x0, (%r15)
je 0x1e765
xorl %eax, %eax
jmp 0x1e7b3
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1e44a
movl %ebp, %ecx
andl $0x3f, %ecx
shlq $0x9, %r12
movslq 0x310(%r14,%r12), %rdx
cltq
shlq $0x9, %rax
addq 0x1d825(%rip), %rax     # 0x3bfa8
movq 0x1938(%r14), %rsi
movq 0x40(%rsi), %rsi
orq (%rax,%rdx,8), %rsi
movq %rsi, 0x8(%rsp)
movl %ecx, %eax
leaq 0xf9a00(%rip), %rcx     # 0x1181a0
testq %rsi, (%rcx,%rax,8)
je 0x1e748
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x1e44a
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/position.cpp
// Function: Position::move_is_legal(Move) const
bool Position::move_is_legal(const Move m) const {
	
	NEW // don't test that since it might be a tested tt
	//NEW assert(color_of_piece_on(move_from(m)) == side_to_move());
	
  MoveStack mlist[MAX_MOVES];
  MoveStack *cur, *last = generate<MV_PSEUDO_LEGAL>(*this, mlist);

   for (cur = mlist; cur != last; cur++)
      if (cur->move == m)
          return pl_move_is_legal(m, pinned_pieces(sideToMove));

  return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x800, %rsp            # imm = 0x800
movl %esi, %ebx
movq %rdi, %r14
movq %rsp, %r15
movq %r15, %rsi
callq 0x1a0a1
cmpq %rax, %r15
je 0x1e7ec
cmpl %ebx, (%r15)
je 0x1e7f0
addq $0x8, %r15
jmp 0x1e7dc
xorl %eax, %eax
jmp 0x1e80c
movl 0x1090(%r14), %esi
movq %r14, %rdi
callq 0x20e3c
movq %r14, %rdi
movl %ebx, %esi
movq %rax, %rdx
callq 0x1e44a
addq $0x800, %rsp            # imm = 0x800
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/position.cpp
// Function: Position::do_setup_move(Move)
void Position::do_setup_move(Move m) {

  StateInfo newSt;

  do_move(m, newSt);

  // Reset "game ply" in case we made a non-reversible move.
  // "game ply" is used for repetition detection.
  if (st->rule50 == 0)
      st->gamePly = 0;

  // Update the number of plies played from the starting position
  startPosPlyCounter++;

  // Our StateInfo newSt is about going out of scope so copy
  // its content before it disappears.
  detach();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdx
callq 0x1ef10
movq 0x1938(%rbx), %rsi
cmpl $0x0, 0x14(%rsi)
jne 0x1eed9
movl $0x0, 0x18(%rsi)
incl 0x1928(%rbx)
leaq 0x1878(%rbx), %r14
movl $0xa0, %edx
movq %r14, %rdi
callq 0x5320
movq %r14, 0x1938(%rbx)
movq $0x0, 0x1910(%rbx)
addq $0xa8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/position.cpp
// Function: Position::restore_piece(Color, Square, PieceType)
void Position::restore_piece(Color color, Square square, PieceType type) {
	// Restore the attacking piece 
	set_bit(&(byColorBB[color]), square);
	set_bit(&(byTypeBB[type]), square);
	set_bit(&(byTypeBB[0]), square); 

	board[square] = make_piece(color, type);

	// Update piece count
	pieceCount[color][type]++;

	// Update piece list, add a new captured piece in capsq square
	index[square] = pieceCount[color][type] - 1;
	pieceList[color][type][index[square]] = square;
}

// Assembly:
movl %esi, %r8d
movslq %edx, %rax
leaq 0xf81b3(%rip), %rdx     # 0x1181a0
movq (%rdx,%rax,8), %r9
orq %r9, 0x140(%rdi,%r8,8)
movl %ecx, %r9d
movq (%rdx,%rax,8), %r10
orq %r10, 0x100(%rdi,%r9,8)
movq (%rdx,%rax,8), %rdx
orq %rdx, 0x100(%rdi)
shll $0x3, %esi
orl %ecx, %esi
movl %esi, (%rdi,%rax,4)
movq %r8, %rcx
shlq $0x5, %rcx
addq %rdi, %rcx
movslq 0x150(%rcx,%r9,4), %rdx
leal 0x1(%rdx), %esi
movl %esi, 0x150(%rcx,%r9,4)
movl %edx, 0x590(%rdi,%rax,4)
shlq $0x9, %r8
addq %rdi, %r8
shlq $0x6, %r9
addq %r8, %r9
movl %eax, 0x190(%r9,%rdx,4)
retq
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/position.cpp
// Function: Position::do_null_move(StateInfo&)
void Position::do_null_move(StateInfo& backupSt) {

  assert(is_ok());
  assert(!in_check());

  // Back up the information necessary to undo the null move to the supplied
  // StateInfo object.
  // Note that differently from normal case here backupSt is actually used as
  // a backup storage not as a new state to be used.
  backupSt.key      = st->key;
  backupSt.epSquare = st->epSquare;
  backupSt.value    = st->value;
  backupSt.previous = st->previous;
  backupSt.pliesFromNull = st->pliesFromNull;
  st->previous = &backupSt;

  // Save the current key to the history[] array, in order to be able to
  // detect repetition draws.
  history[st->gamePly++] = st->key;

  // Update the necessary information
  if (st->epSquare != SQ_NONE)
      st->key ^= zobEp[st->epSquare];

  st->key ^= zobSideToMove;
  
  // TODO: PREFETCH
  prefetch((char*)TT.first_entry(st->key));

  sideToMove = opposite_color(sideToMove);
  st->epSquare = SQ_NONE;
  st->rule50++;
  st->pliesFromNull = 0;
  st->value += (sideToMove == WHITE) ?  TempoValue : -TempoValue;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x1938(%rdi), %rax
movq 0x38(%rax), %rcx
movq %rcx, 0x38(%rsi)
movl 0x24(%rax), %ecx
movl %ecx, 0x24(%rsi)
movq 0x98(%rax), %rcx
movq %rcx, 0x98(%rsi)
movq 0x1c(%rax), %rcx
movq %rcx, 0x1c(%rsi)
movq %rsi, 0x98(%rax)
movq 0x38(%rax), %rcx
movslq 0x18(%rax), %rdx
leal 0x1(%rdx), %esi
movl %esi, 0x18(%rax)
movq %rcx, 0x1098(%rdi,%rdx,8)
movslq 0x20(%rax), %rcx
cmpq $0x40, %rcx
je 0x205bf
leaq 0x3999d9(%rip), %rdx    # 0x3b9f90
movq (%rdx,%rcx,8), %rcx
xorq %rcx, 0x38(%rax)
movq 0x38(%rax), %rcx
xorq 0x399c46(%rip), %rcx    # 0x3ba210
movq %rcx, 0x38(%rax)
leaq 0x3ab10b(%rip), %rax    # 0x3cb6e0
movl (%rax), %edi
decl %edi
andl %ecx, %edi
shlq $0x6, %rdi
addq 0x8(%rax), %rdi
callq 0x16fd2
movl 0x1090(%rbx), %eax
movl %eax, %ecx
xorl $0x1, %ecx
movl %ecx, 0x1090(%rbx)
movq 0x1938(%rbx), %rcx
incl 0x14(%rcx)
movabsq $0x4000000000, %rdx     # imm = 0x4000000000
movq %rdx, 0x1c(%rcx)
movl 0x39acc9(%rip), %edx    # 0x3bb2e0
movl %edx, %esi
negl %esi
cmpl $0x1, %eax
cmovel %edx, %esi
addl %esi, 0x24(%rcx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/position.cpp
// Function: Position::init_zobrist()
void Position::init_zobrist() {

  int i,j, k;
  RKISS rk;

  for (i = 0; i < 2; i++) for (j = 0; j < 8; j++) for (k = 0; k < 64; k++)
      zobrist[i][j][k] = rk.rand<Key>();

  for (i = 0; i < 64; i++)
      zobEp[i] = rk.rand<Key>();

  for (i = 0; i < 16; i++)
      zobCastle[i] = rk.rand<Key>();

  zobSideToMove = rk.rand<Key>();
  zobExclusion  = rk.rand<Key>();
}

// Assembly:
pushq %r14
pushq %rbx
movabsq $-0x2c1f8a302bb644e2, %rax # imm = 0xD3E075CFD449BB1E
movabsq $-0x440b26c48dff17a8, %rsi # imm = 0xBBF4D93B7200E858
movabsq $-0x3bf8842205306785, %rdx # imm = 0xC4077BDDFACF987B
movabsq $0x46dd577ff603b540, %rcx # imm = 0x46DD577FF603B540
leaq 0x3977c8(%rip), %rdi    # 0x3b7f90
xorl %r8d, %r8d
movq %rdi, %r9
xorl %r10d, %r10d
xorl %r11d, %r11d
movq %rsi, %rbx
movq %rdx, %rsi
rolq $0x7, %rsi
movq %rcx, %r14
movq %rbx, %rcx
rolq $0xd, %rcx
subq %rsi, %r14
leaq (%r14,%rax), %rsi
rolq $0x25, %rax
xorq %rdx, %rcx
movq %rax, %rdx
addq %rbx, %rdx
movq %r14, %rax
addq %rcx, %rax
movq %rax, (%r9,%r11,8)
incq %r11
cmpq $0x40, %r11
jne 0x207d4
incq %r10
addq $0x200, %r9             # imm = 0x200
cmpq $0x8, %r10
jne 0x207d1
leaq 0x1(%r8), %r9
addq $0x1000, %rdi           # imm = 0x1000
testq %r8, %r8
movq %r9, %r8
je 0x207cb
xorl %edi, %edi
leaq 0x399755(%rip), %r8     # 0x3b9f90
movq %rsi, %r9
movq %rdx, %rsi
rolq $0x7, %rsi
movq %rcx, %r10
movq %r9, %rcx
rolq $0xd, %rcx
subq %rsi, %r10
leaq (%r10,%rax), %rsi
rolq $0x25, %rax
xorq %rdx, %rcx
movq %rax, %rdx
addq %r9, %rdx
movq %r10, %rax
addq %rcx, %rax
movq %rax, (%rdi,%r8)
addq $0x8, %rdi
cmpq $0x200, %rdi            # imm = 0x200
jne 0x2083b
xorl %edi, %edi
leaq 0x39990d(%rip), %r8     # 0x3ba190
movq %rsi, %r9
movq %rdx, %rsi
rolq $0x7, %rsi
movq %rcx, %r10
movq %r9, %rcx
rolq $0xd, %rcx
subq %rsi, %r10
leaq (%r10,%rax), %rsi
rolq $0x25, %rax
xorq %rdx, %rcx
movq %rax, %rdx
addq %r9, %rdx
movq %r10, %rax
addq %rcx, %rax
movq %rax, (%rdi,%r8)
addq $0x8, %rdi
cmpq $0x80, %rdi
jne 0x20883
movq %rdx, %rdi
rolq $0x7, %rdi
subq %rdi, %rcx
movq %rsi, %rdi
rolq $0xd, %rdi
xorq %rdx, %rdi
leaq (%rcx,%rax), %rdx
rolq $0x25, %rax
addq %rsi, %rax
addq %rdi, %rcx
movq %rcx, 0x399925(%rip)    # 0x3ba210
movq %rax, %rcx
rolq $0x7, %rcx
rolq $0xd, %rdx
subq %rcx, %rdi
xorq %rax, %rdx
addq %rdi, %rdx
movq %rdx, 0x399912(%rip)    # 0x3ba218
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/position.cpp
// Function: Position::init_piece_square_tables()
void Position::init_piece_square_tables() {

  for (Square s = SQ_A1; s <= SQ_H8; s++)
      for (Piece p = WP; p <= WK; p++)
          PieceSquareTable[p][s] = make_score(MgPST[p][s], EgPST[p][s]);

  for (Square s = SQ_A1; s <= SQ_H8; s++)
      for (Piece p = BP; p <= BK; p++)
          PieceSquareTable[p][s] = -PieceSquareTable[p-8][flip_square(s)];
}

// Assembly:
leaq 0x3926ef(%rip), %rcx    # 0x3b3000
movl $0x100, %edx            # imm = 0x100
addq %rdx, %rcx
leaq 0x392e00(%rip), %rsi    # 0x3b3720
addq %rdx, %rsi
leaq 0x3998f6(%rip), %rax    # 0x3ba220
addq %rax, %rdx
xorl %edi, %edi
xorl %r8d, %r8d
movl (%rcx,%r8), %r9d
shll $0x10, %r9d
addl (%rsi,%r8), %r9d
movl %r9d, (%rdx,%r8)
addq $0x100, %r8             # imm = 0x100
cmpq $0x600, %r8             # imm = 0x600
jne 0x20932
incq %rdi
addq $0x4, %rcx
addq $0x4, %rsi
addq $0x4, %rdx
cmpq $0x40, %rdi
jne 0x2092f
leaq 0x39a1b2(%rip), %rcx    # 0x3bab20
xorl %edx, %edx
movl %edx, %esi
xorq $0x38, %rsi
leaq (%rax,%rsi,4), %rsi
addq $0x100, %rsi            # imm = 0x100
xorl %edi, %edi
xorl %r8d, %r8d
subl (%rsi,%rdi), %r8d
movl %r8d, (%rcx,%rdi)
addq $0x100, %rdi            # imm = 0x100
cmpq $0x600, %rdi            # imm = 0x600
jne 0x20983
incq %rdx
addq $0x4, %rcx
cmpq $0x40, %rdx
jne 0x20970
retq
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/position.cpp
// Function: bool Position::is_draw<false>() const
bool Position::is_draw() const {

  // Draw by material?
  if (   !pieces(PAWN)
      && (non_pawn_material(WHITE) + non_pawn_material(BLACK) <= BishopValueMidgame))
      return true;

  // Draw by the 50 moves rule?
  if (st->rule50 > 99 && !is_mate())
      return true;

  // Draw by repetition?

#if 0
  if (false && !SkipRepetition) // not working in Atomic :(
  {
      int i = 4, e = Min(st->rule50, st->pliesFromNull);

      if (st && st->previous && i <= e)
      {
          StateInfo* stp = st->previous->previous;
	  if (stp && stp->previous)
	    {
	      do {
		stp = stp->previous->previous;

		if (stp && stp->key == st->key)
                  return true;

		i +=2;
		
	      } while (i <= e);
	    }
      }
  }
#else // here is the SF 2.1.1 code, not sure what ATOMKRAFT was doing ?
      // seems to have mixed-matched from later code, with state->previous
      // rather than history to detect draws
  for (int i = 4, e = Min(Min(st->gamePly, st->rule50), st->pliesFromNull);
       i <= e; i += 2)
    if (history[st->gamePly - i] == st->key)
      return true;
#endif
  return false;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x108(%rdi)
jne 0x21242
movq 0x1938(%rbx), %rax
movl 0x2c(%rax), %ecx
addl 0x28(%rax), %ecx
leaq 0x1b21c(%rip), %rdx     # 0x3c458
movb $0x1, %al
cmpl (%rdx), %ecx
jle 0x212ba
movq 0x1938(%rbx), %rax
cmpl $0x64, 0x14(%rax)
jl 0x2125f
movq %rbx, %rdi
callq 0x2074c
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
je 0x212ba
movq 0x1938(%rbx), %rcx
movslq 0x18(%rcx), %rdx
movl 0x14(%rcx), %esi
movl 0x1c(%rcx), %eax
cmpl %esi, %edx
cmovll %edx, %esi
cmpl %eax, %esi
cmovgel %eax, %esi
cmpl $0x4, %esi
setge %al
jl 0x212ba
movq 0x38(%rcx), %rcx
cmpq %rcx, 0x1078(%rbx,%rdx,8)
je 0x212ba
movl %esi, %esi
leaq (%rbx,%rdx,8), %rdi
addq $0x1068, %rdi           # imm = 0x1068
movl $0x6, %edx
cmpq %rsi, %rdx
setbe %al
ja 0x212ba
leaq -0x10(%rdi), %r8
addq $0x2, %rdx
cmpq %rcx, (%rdi)
movq %r8, %rdi
jne 0x212a2
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/search.cpp
// Function: (anonymous namespace)::speed_to_uci[abi:cxx11](long)
std::string speed_to_uci(int64_t nodes) {

    std::stringstream s;
    int64_t t = current_search_time();
    int64_t us = int64_t(current_cpu_usage()); // mult by 1000
    HACK_NPS = t>0 ? (nodes*1000)/t : 0;
    s << " nodes " << nodes << " nps " << HACK_NPS << " time " << t;
    if (t>1000) s << " cpuload " << (t>0 ? (1000*us)/t : 0)
		  << " hashfull " << TT.full (nodes);
    return s.str();
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %rdi
callq 0x5290
callq 0x16e80
movq %rax, %r15
subq 0x39c0fb(%rip), %r15    # 0x3c0a70
callq 0x16ebe
movq %rax, %r12
subq 0x39c0f4(%rip), %r12    # 0x3c0a78
testq %r15, %r15
jle 0x24997
imulq $0x3e8, %r14, %rax      # imm = 0x3E8
cqto
idivq %r15
jmp 0x24999
xorl %eax, %eax
movq %rax, 0x39a088(%rip)    # 0x3bea28
leaq 0x10(%rsp), %r13
leaq 0xdae7(%rip), %rsi      # 0x32493
movl $0x7, %edx
movq %r13, %rdi
callq 0x5460
movq %r13, %rdi
movq %r14, %rsi
callq 0x5390
movq %rax, %rbp
leaq 0xdacd(%rip), %rsi      # 0x3249b
movl $0x5, %edx
movq %rax, %rdi
callq 0x5460
movq 0x39a046(%rip), %rsi    # 0x3bea28
movq %rbp, %rdi
callq 0x5390
movq %rax, %rbp
leaq 0xda66(%rip), %rsi      # 0x3245a
movl $0x6, %edx
movq %rax, %rdi
callq 0x5460
movq %rbp, %rdi
movq %r15, %rsi
callq 0x5390
cmpq $0x3e9, %r15            # imm = 0x3E9
jl 0x24a79
leaq 0xda85(%rip), %rsi      # 0x324a1
movl $0x9, %edx
movq %r13, %rdi
callq 0x5460
testq %r15, %r15
jle 0x24a3f
imulq $0x3e8, %r12, %rax      # imm = 0x3E8
cqto
idivq %r15
movq %rax, %rsi
jmp 0x24a41
xorl %esi, %esi
movq %r13, %rdi
callq 0x5390
movq %rax, %r15
leaq 0xda58(%rip), %rsi      # 0x324ab
movl $0xa, %edx
movq %rax, %rdi
callq 0x5460
leaq 0x3a6c79(%rip), %rdi    # 0x3cb6e0
movq %r14, %rsi
callq 0x29fc6
movl %eax, %esi
movq %r15, %rdi
callq 0x5260
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x5690
movq 0x174ab(%rip), %rsi     # 0x3bf38
movq %rsp, %rdi
callq 0x52c0
leaq 0x80(%rsp), %rdi
callq 0x5140
movq %rbx, %rax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x24ab9
movq %rax, %rbx
movq 0x17475(%rip), %rsi     # 0x3bf38
movq %rsp, %rdi
callq 0x52c0
leaq 0x80(%rsp), %rdi
callq 0x5140
movq %rbx, %rdi
callq 0x5790
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/search.cpp
// Function: (anonymous namespace)::value_to_uci[abi:cxx11](Value)
std::string value_to_uci(Value v) {

    std::stringstream s;

    if (abs(v) < VALUE_MATE - PLY_MAX * ONE_PLY)
        s << "cp " << int(v) * 100 / int(PawnValueMidgame); // Scale to centipawns
    else
        s << "mate " << (v > 0 ? VALUE_MATE - v + 1 : -VALUE_MATE - v) / 2;

    return s.str();
  }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5290
movl %ebp, %eax
negl %eax
cmovsl %ebp, %eax
leaq 0x18(%rsp), %r14
cmpl $0x7467, %eax           # imm = 0x7467
ja 0x259bf
leaq 0xca65(%rip), %rsi      # 0x32406
movl $0x3, %edx
movq %r14, %rdi
callq 0x5460
imull $0x64, %ebp, %eax
leaq 0x16a90(%rip), %rcx     # 0x3c448
cltd
idivl (%rcx)
movl %eax, %esi
jmp 0x259ed
leaq 0xca44(%rip), %rsi      # 0x3240a
movl $0x5, %edx
movq %r14, %rdi
callq 0x5460
testl %ebp, %ebp
movl $0x7531, %eax           # imm = 0x7531
movl $0xffff8ad0, %ecx       # imm = 0xFFFF8AD0
cmovgl %eax, %ecx
subl %ebp, %ecx
movl %ecx, %esi
shrl $0x1f, %esi
addl %ecx, %esi
sarl %esi
movq %r14, %rdi
callq 0x5760
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x5690
movq 0x1652f(%rip), %rsi     # 0x3bf38
leaq 0x8(%rsp), %rdi
callq 0x52c0
leaq 0x88(%rsp), %rdi
callq 0x5140
movq %rbx, %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movq 0x164ff(%rip), %rsi     # 0x3bf38
leaq 0x8(%rsp), %rdi
callq 0x52c0
leaq 0x88(%rsp), %rdi
callq 0x5140
movq %rbx, %rdi
callq 0x5790
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/search.cpp
// Function: (anonymous namespace)::update_gains(Position const&, Move, Value, Value)
void update_gains(const Position& pos, Move m, Value before, Value after) {

    if (   m != MOVE_NULL
        && before != VALUE_NONE
        && after != VALUE_NONE
        && pos.captured_piece_type() == PIECE_TYPE_NONE
        && !move_is_special(m))
        H.update_gain(pos.piece_on(move_to(m)), move_to(m), -(before + after));
  }

// Assembly:
cmpl $0x41, %esi
sete %al
movl $0x7532, %r8d           # imm = 0x7532
cmpl %r8d, %edx
sete %r9b
orb %al, %r9b
cmpl %r8d, %ecx
sete %al
orb %r9b, %al
jne 0x261b0
movq 0x1938(%rdi), %rax
movl %esi, %r8d
andl $0xc000, %r8d           # imm = 0xC000
orl 0x30(%rax), %r8d
je 0x261b1
retq
andl $0x3f, %esi
shll $0x2, %esi
movl (%rdi,%rsi), %eax
addl %ecx, %edx
negl %edx
shlq $0x8, %rax
leaq 0x398877(%rip), %rcx    # 0x3bea40
addq %rax, %rcx
movl 0x1000(%rsi,%rcx), %eax
decl %eax
cmpl %edx, %eax
cmovlel %edx, %eax
movl %eax, 0x1000(%rsi,%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/search.cpp
// Function: Depth (anonymous namespace)::extension<((anonymous namespace)::NodeType)1>(Position const&, Move, bool, bool, bool*)
Depth extension(const Position& pos, Move m, bool captureOrPromotion,
                  bool moveIsCheck, bool* dangerous) {

    assert(m != MOVE_NONE);

    Depth result = DEPTH_ZERO;
    *dangerous = moveIsCheck;
    
    if (moveIsCheck && pos.see_sign(m) >= 0)
        result += CheckExtension[PvNode];

    if (pos.type_of_piece_on(move_from(m)) == PAWN)
    {
        Color c = pos.side_to_move();
        if (relative_rank(c, move_to(m)) == RANK_7)
        {
            result += PawnPushTo7thExtension[PvNode];
            *dangerous = true;
        }
        if (pos.pawn_is_passed(c, move_to(m)))
        {
            result += PassedPawnExtension[PvNode];
            *dangerous = true;
        }
    }

    if (   captureOrPromotion
        && pos.type_of_piece_on(move_to(m)) != PAWN
        && (  pos.non_pawn_material(WHITE) + pos.non_pawn_material(BLACK)
            - pos.midgame_value_of_piece_on(move_to(m)) == VALUE_ZERO)
        && !move_is_special(m))
    {
        result += PawnEndgameExtension[PvNode];
        *dangerous = true;
    }

    return Min(result, ONE_PLY);
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %edx, %r15d
movl %esi, %ebp
movq %rdi, %r14
movb %cl, (%r8)
xorl %edx, %edx
testl %ecx, %ecx
je 0x26be2
movq %r14, %rdi
movl %ebp, %esi
callq 0x2073c
xorl %edx, %edx
testl %eax, %eax
js 0x26be2
movl 0x3948e2(%rip), %edx    # 0x3bb4c4
movl %ebp, %eax
shrl $0x4, %eax
andl $0xfc, %eax
movl (%r14,%rax), %eax
andl $0x7, %eax
cmpl $0x1, %eax
jne 0x26c54
movl 0x1090(%r14), %eax
movl %ebp, %ecx
andl $0x3f, %ecx
movl %ecx, %esi
shrl $0x3, %esi
leal (,%rax,8), %edi
subl %eax, %edi
xorl %esi, %edi
cmpl $0x6, %edi
jne 0x26c22
addl 0x3948b5(%rip), %edx    # 0x3bb4d4
movb $0x1, (%rbx)
movq %rax, %rsi
xorq $0x1, %rsi
movq 0x140(%r14,%rsi,8), %rsi
andq 0x108(%r14), %rsi
movl %ecx, %ecx
shlq $0x9, %rax
addq 0x152fb(%rip), %rax     # 0x3bf40
testq %rsi, (%rax,%rcx,8)
jne 0x26c54
addl 0x39488b(%rip), %edx    # 0x3bb4dc
movb $0x1, (%rbx)
testb %r15b, %r15b
je 0x26c96
movl %ebp, %eax
andl $0x3f, %eax
movl (%r14,%rax,4), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x1, %ecx
je 0x26c96
testl $0xc000, %ebp           # imm = 0xC000
jne 0x26c96
movq 0x1938(%r14), %rcx
movl 0x2c(%rcx), %esi
addl 0x28(%rcx), %esi
leaq 0x394598(%rip), %rcx    # 0x3bb220
cmpl (%rcx,%rax,4), %esi
jne 0x26c96
addl 0x394839(%rip), %edx    # 0x3bb4cc
movb $0x1, (%rbx)
cmpl $0x2, %edx
movl $0x2, %eax
cmovll %edx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/search.cpp
// Function: (anonymous namespace)::update_history(Position const&, Move, Depth, Move*, int)
void update_history(const Position& pos, Move move, Depth depth,
                      Move movesSearched[], int moveCount) {
    Move m;
    Value bonus = Value(int(depth) * int(depth));

    H.update(pos.piece_on(move_from(move)), move_to(move), bonus);

    for (int i = 0; i < moveCount - 1; i++)
    {
        m = movesSearched[i];

        assert(m != move);

        H.update(pos.piece_on(move_from(m)), move_to(m), -bonus);
    }
  }

// Assembly:
imull %edx, %edx
movl %esi, %eax
shrl $0x4, %eax
andl $0xfc, %eax
movl (%rdi,%rax), %r9d
andl $0x3f, %esi
shlq $0x8, %r9
leaq 0x396dd8(%rip), %rax    # 0x3bea40
addq %rax, %r9
movl (%r9,%rsi,4), %r10d
addl %edx, %r10d
movl %r10d, %r11d
negl %r11d
cmovsl %r10d, %r11d
cmpl $0x7cf, %r11d           # imm = 0x7CF
ja 0x27c8c
leaq (%r9,%rsi,4), %rsi
movl %r10d, (%rsi)
cmpl $0x2, %r8d
jl 0x27ce1
pushq %rbx
decl %r8d
xorl %esi, %esi
movl (%rcx,%rsi,4), %r9d
movl %r9d, %r10d
shrl $0x4, %r10d
andl $0xfc, %r10d
movl (%rdi,%r10), %r10d
andl $0x3f, %r9d
shlq $0x8, %r10
addq %rax, %r10
movl (%r10,%r9,4), %r11d
subl %edx, %r11d
movl %r11d, %ebx
negl %ebx
cmovsl %r11d, %ebx
cmpl $0x7cf, %ebx            # imm = 0x7CF
ja 0x27cd8
leaq (%r10,%r9,4), %r9
movl %r11d, (%r9)
incq %rsi
cmpq %rsi, %r8
jne 0x27c98
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/search.cpp
// Function: (anonymous namespace)::connected_moves(Position const&, Move, Move)
bool connected_moves(const Position& pos, Move m1, Move m2) {

    Square f1, t1, f2, t2;
    Piece p;

    assert(m1 && move_is_ok(m1));
    assert(m2 && move_is_ok(m2));

    // Case 1: The moving piece is the same in both moves
    f2 = move_from(m2);
    t1 = move_to(m1);
    if (f2 == t1)
        return true;

    // Case 2: The destination square for m2 was vacated by m1
    t2 = move_to(m2);
    f1 = move_from(m1);
    if (t2 == f1)
        return true;

    // Case 3: Moving through the vacated square
    if (   piece_is_slider(pos.piece_on(f2))
        && bit_is_set(squares_between(f2, t2), f1))
      return true;

    // Case 4: The destination square for m2 is defended by the moving piece in m1
    p = pos.piece_on(t1);
    if (bit_is_set(pos.attacks_from(p, t1), t2))
        return true;

    // Case 5: Discovered check, checking piece is the piece moved in m1
    if (    piece_is_slider(p)
        &&  bit_is_set(squares_between(t1, pos.king_square(pos.side_to_move())), f2)
        && !bit_is_set(squares_between(t1, pos.king_square(pos.side_to_move())), t2))
    {
        // discovered_check_candidates() works also if the Position's side to
        // move is the opposite of the checking piece.
        Color them = opposite_color(pos.side_to_move());
        Bitboard dcCandidates = pos.discovered_check_candidates(them);

        if (bit_is_set(dcCandidates, f2))
            return true;
    }
    return false;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %eax
movl %edx, %ecx
shrl $0x6, %ecx
andl $0x3f, %ecx
movl %esi, %edx
andl $0x3f, %edx
movb $0x1, %bl
cmpl %edx, %ecx
je 0x28961
andl $0x3f, %eax
shrl $0x6, %esi
andl $0x3f, %esi
cmpl %esi, %eax
je 0x28961
movq %rdi, %r14
movl %ecx, %r12d
movl (%rdi,%r12,4), %ecx
leaq 0x9bfe(%rip), %rdi      # 0x324c0
cmpb $0x1, (%rcx,%rdi)
movl %eax, %ebp
jne 0x288ea
movl %r12d, %eax
shll $0x9, %eax
addq 0x136d1(%rip), %rax     # 0x3bfa8
movl %esi, %ecx
leaq 0xef8c0(%rip), %rsi     # 0x1181a0
movq (%rsi,%rcx,8), %rcx
testq %rcx, (%rax,%rbp,8)
jne 0x28961
movl %edx, %r13d
movl (%r14,%r13,4), %r15d
movq %r14, %rdi
movl %r15d, %esi
callq 0x1df92
leaq 0xef89d(%rip), %rdx     # 0x1181a0
movq (%rdx,%rbp,8), %rcx
testq %rax, %rcx
jne 0x28961
leaq 0x9bad(%rip), %rax      # 0x324c0
cmpb $0x1, (%r15,%rax)
jne 0x2895f
movl 0x1090(%r14), %esi
movq %rsi, %rax
shlq $0x9, %rax
movslq 0x310(%r14,%rax), %rax
shll $0x9, %r13d
addq 0x1366d(%rip), %r13     # 0x3bfa8
movq (%r13,%rax,8), %rax
testq %rcx, %rax
jne 0x2895f
andq (%rdx,%r12,8), %rax
je 0x2895f
xorl $0x1, %esi
movq %r14, %rdi
movq %rdx, %r14
callq 0x1c72c
testq %rax, (%r14,%r12,8)
jne 0x28961
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/simple_search.cpp
// Function: test_search(Position&, int, int, int)
int test_search(Position &pos, int alpha, int beta, int depth) {
	
	if(depth == 0) return test_eval(pos);
	bool bSearchPv = true;
	int score;
	
	MoveStack mlist[MAX_MOVES];
	StateInfo st;
	Move m;

	// Generate all legal moves
	MoveStack* last = generate<MV_LEGAL>(pos, mlist);
	
	if (mlist == last) {
		return -100000;
	}
	
	for (MoveStack* cur = mlist; cur != last; cur++) {
		m = cur->move;
		pos.do_move(m, st);
		if (bSearchPv) {
			score = -test_search(pos, -beta, -alpha, depth - 1);
		} else {
			score = -test_search(pos, -alpha-1, -alpha, depth - 1);
			if (score > alpha) // in fail-soft ... && score < beta ) is common
				score = -test_search(pos, -beta, -alpha, depth - 1); // re-search
		}
		pos.undo_move(m);
		if(score >= beta)
			return beta;   // fail-hard beta-cutoff
		if(score > alpha) {
			alpha = score; // alpha acts like max in MiniMax
		}
		bSearchPv = false;
	}
	
	
	
	return alpha; // fail-hard
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x8c8, %rsp            # imm = 0x8C8
movl %edx, 0x10(%rsp)
movq %rdi, %r15
movl %ecx, 0xc(%rsp)
testl %ecx, %ecx
je 0x28db4
movl %esi, %r13d
leaq 0xc0(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x1a0ce
movq %rax, 0x18(%rsp)
cmpq %rax, %r12
je 0x28dcd
decl 0xc(%rsp)
movl 0x10(%rsp), %eax
negl %eax
movl %eax, 0x14(%rsp)
movb $0x1, %r14b
movl (%r12), %ebp
movq %r15, %rdi
movl %ebp, %esi
leaq 0x20(%rsp), %rdx
callq 0x1ef10
movl %r13d, %ebx
negl %ebx
testb $0x1, %r14b
jne 0x28d74
movl %r13d, %esi
notl %esi
movq %r15, %rdi
movl %ebx, %edx
movl 0xc(%rsp), %ecx
callq 0x28cdf
movl %eax, %r14d
negl %r14d
cmpl %r14d, %r13d
jge 0x28d8c
movq %r15, %rdi
movl 0x14(%rsp), %esi
movl %ebx, %edx
movl 0xc(%rsp), %ecx
callq 0x28cdf
movl %eax, %r14d
negl %r14d
movq %r15, %rdi
movl %ebp, %esi
callq 0x20056
cmpl 0x10(%rsp), %r14d
jge 0x28dd5
cmpl %r13d, %r14d
cmovgl %r14d, %r13d
addq $0x8, %r12
xorl %r14d, %r14d
cmpq 0x18(%rsp), %r12
jne 0x28d38
jmp 0x28dda
movq %r15, %rdi
addq $0x8c8, %rsp            # imm = 0x8C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x28def
movl $0xfffe7960, %r13d      # imm = 0xFFFE7960
jmp 0x28dda
movl 0x10(%rsp), %r13d
movl %r13d, %eax
addq $0x8c8, %rsp            # imm = 0x8C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/thread.cpp
// Function: ThreadsManager::read_uci_options()
void ThreadsManager::read_uci_options() {
  maxThreadsPerSplitPoint = Options["Maximum Number of Threads per Split Point"].value<int>();
  minimumSplitDepth       = Options["Minimum Split Depth"].value<int>() * ONE_PLY;
  useSleepingThreads      = Options["Use Sleeping Threads"].value<bool>();
  activeThreads           = Options["Threads"].value<int>();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x95b4(%rip), %rsi      # 0x324d2
leaq 0x95d6(%rip), %rdx      # 0x324fb
leaq 0x8(%rsp), %rdi
callq 0xa7de
leaq 0x3a4142(%rip), %rdi    # 0x3cd078
leaq 0x8(%rsp), %rsi
callq 0x15516
movq 0x20(%rax), %rdi
callq 0x5660
movl %eax, 0x2c(%rbx)
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x28f63
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5400
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x958a(%rip), %rsi      # 0x324fc
leaq 0x9596(%rip), %rdx      # 0x3250f
callq 0xa7de
leaq 0x3a40f3(%rip), %rdi    # 0x3cd078
leaq 0x8(%rsp), %rsi
callq 0x15516
movq 0x20(%rax), %rdi
callq 0x5660
addl %eax, %eax
movl %eax, 0x28(%rbx)
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x28fb4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5400
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x954d(%rip), %rsi      # 0x32510
leaq 0x955a(%rip), %rdx      # 0x32524
callq 0xa7de
leaq 0x3a40a2(%rip), %rdi    # 0x3cd078
leaq 0x8(%rsp), %rsi
callq 0x15516
addq $0x20, %rax
leaq 0x81ac(%rip), %rsi      # 0x31197
movq %rax, %rdi
callq 0x5120
testl %eax, %eax
sete 0x30(%rbx)
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x29010
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5400
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x94fe(%rip), %rsi      # 0x3251d
leaq 0x94fe(%rip), %rdx      # 0x32524
callq 0xa7de
leaq 0x3a4046(%rip), %rdi    # 0x3cd078
leaq 0x8(%rsp), %rsi
callq 0x15516
movq 0x20(%rax), %rdi
callq 0x5660
movl %eax, 0x34(%rbx)
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x2905f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5400
addq $0x28, %rsp
popq %rbx
popq %r14
retq
jmp 0x29073
jmp 0x2908f
jmp 0x29073
jmp 0x2908f
jmp 0x29073
jmp 0x2908f
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x29092
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5400
jmp 0x29092
movq %rax, %rbx
movq %rbx, %rdi
callq 0x5790