LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: ATOMIC-LICHESS[P]ATOMKRAFT/book.cpp
// Function: Book::print_all_moves(Position const&)
void Book::print_all_moves(const Position& pos) {
	  if (!bookFile.is_open() || bookSize == 0) {
		  cout << "book is empty" << endl;
		  return;
	  }
	  

	  BookEntry entry;
	  uint64_t key = book_key(pos);
	  
	  
	  // Choose a book move among the possible moves for the given position
	  for (int idx = find_entry(key); idx < bookSize; idx++)
	  {
	      entry = read_entry(idx);
	      
	      if (entry.key != key)
	          break;
	      
	      cout << "(" << move_to_string(Move(entry.move)) << " " << entry.count << ") ";
	  }
	  cout << endl;

}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq 0xa0(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x6930
testb $0x1, %al
jne 0xf36f
jmp 0xf37d
movq 0x30(%rsp), %rax
cmpl $0x0, 0x230(%rax)
jne 0xf3a4
movq 0x5cc34(%rip), %rdi     # 0x6bfb8
leaq 0x4a151(%rip), %rsi     # 0x594dc
callq 0x64b0
movq %rax, %rdi
movq 0x5cbf6(%rip), %rsi     # 0x6bf90
callq 0x6520
jmp 0xf4fd
movq 0x98(%rsp), %rdi
callq 0xe9e0
movq 0x30(%rsp), %rdi
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rsi
callq 0xf090
movl %eax, 0x7c(%rsp)
movq 0x30(%rsp), %rcx
movl 0x7c(%rsp), %eax
cmpl 0x230(%rcx), %eax
jge 0xf4ea
movq 0x30(%rsp), %rdi
movl 0x7c(%rsp), %esi
callq 0xf170
movq %rax, 0x68(%rsp)
movq %rdx, 0x70(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x88(%rsp), %rax
cmpq 0x80(%rsp), %rax
je 0xf42d
jmp 0xf4ea
movq 0x5cb84(%rip), %rdi     # 0x6bfb8
leaq 0x4a0af(%rip), %rsi     # 0x594ea
callq 0x64b0
movq %rax, 0x18(%rsp)
movzwl 0x90(%rsp), %esi
leaq 0x48(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x2c450
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x6420
movq %rax, 0x28(%rsp)
jmp 0xf472
movq 0x28(%rsp), %rdi
leaq 0x4a0e2(%rip), %rsi     # 0x59560
callq 0x64b0
movq %rax, 0x10(%rsp)
jmp 0xf48a
movq 0x10(%rsp), %rdi
movzwl 0x92(%rsp), %esi
callq 0x68d0
movq %rax, 0x8(%rsp)
jmp 0xf4a3
movq 0x8(%rsp), %rdi
leaq 0x4b35c(%rip), %rsi     # 0x5a80b
callq 0x64b0
jmp 0xf4b6
leaq 0x48(%rsp), %rdi
callq 0x6a78
movl 0x7c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7c(%rsp)
jmp 0xf3cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x40(%rsp)
movl %eax, 0x3c(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x6a78
jmp 0xf505
movq 0x5cac7(%rip), %rdi     # 0x6bfb8
movq 0x5ca98(%rip), %rsi     # 0x6bf90
callq 0x6520
addq $0xa8, %rsp
retq
movq 0x40(%rsp), %rdi
callq 0x6970
nop
// File: ATOMIC-LICHESS[P]ATOMKRAFT/book.cpp
// Function: void Book::get_number<unsigned long>(unsigned long&)
void Book::get_number(T& n) {

  n = 0;

  for (size_t i = 0; i < sizeof(T); i++) {
      n = (n << 8) + (T)bookFile.get();
      
//      int get = bookFile.get();
//      n = (n << 8) + (T)get;
//      if (sizeof(T) == 8) {
//    	  cout << get << " ";
//      } 
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq $0x0, (%rax)
movq $0x0, 0x10(%rsp)
cmpq $0x8, 0x10(%rsp)
jae 0xf710
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rax
movq (%rax), %rax
shlq $0x8, %rax
movq %rax, (%rsp)
callq 0x6610
movq (%rsp), %rcx
cltq
addq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0xf6cd
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: ATOMIC-LICHESS[P]ATOMKRAFT/./rkiss.h
// Function: RKISS::raninit()
void raninit() {

    s.a = 0xf1ea5eed;
    s.b = s.c = s.d = 0xd4e12c77;
    for (int i = 0; i < 73; i++)
        rand64();
  }

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movl $0xf1ea5eed, %ecx       # imm = 0xF1EA5EED
movq %rcx, (%rax)
movl $0xd4e12c77, %ecx       # imm = 0xD4E12C77
movq %rcx, 0x18(%rax)
movl $0xd4e12c77, %ecx       # imm = 0xD4E12C77
movq %rcx, 0x10(%rax)
movl $0xd4e12c77, %ecx       # imm = 0xD4E12C77
movq %rcx, 0x8(%rax)
movl $0x0, 0xc(%rsp)
cmpl $0x49, 0xc(%rsp)
jge 0xfa3a
movq (%rsp), %rdi
callq 0xfa40
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xfa1d
addq $0x18, %rsp
retq
nop
// File: ATOMIC-LICHESS[P]ATOMKRAFT/./rkiss.h
// Function: RKISS::rand64()
uint64_t rand64() {

    const uint64_t
      e = s.a - rotate(s.b,  7);
    s.a = s.b ^ rotate(s.c, 13);
    s.b = s.c + rotate(s.d, 37);
    s.c = s.d + e;
    return s.d = e + s.a;
  }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movq (%rdi), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rdi), %rsi
movl $0x7, %edx
callq 0xfb00
movq 0x18(%rsp), %rdi
movq %rax, %rcx
movq 0x8(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x28(%rsp)
movq 0x8(%rdi), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rdi), %rsi
movl $0xd, %edx
callq 0xfb00
movq 0x18(%rsp), %rdi
movq %rax, %rcx
movq 0x10(%rsp), %rax
xorq %rcx, %rax
movq %rax, (%rdi)
movq 0x10(%rdi), %rax
movq %rax, 0x20(%rsp)
movq 0x18(%rdi), %rsi
movl $0x25, %edx
callq 0xfb00
movq 0x18(%rsp), %rcx
movq %rax, %rdx
movq 0x20(%rsp), %rax
addq %rdx, %rax
movq %rax, 0x8(%rcx)
movq 0x18(%rcx), %rax
addq 0x28(%rsp), %rax
movq %rax, 0x10(%rcx)
movq 0x28(%rsp), %rax
addq (%rcx), %rax
movq %rax, 0x18(%rcx)
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/create_book.cpp
// Function: getPiece(char)
PieceType getPiece(char c) {
	switch (c) {
	case 'N': return KNIGHT;
	case 'B': return BISHOP;
	case 'R': return ROOK;
	case 'Q': return QUEEN;
	case 'K': return KING;
	default:
		return PIECE_TYPE_NONE;
	}
}

// Assembly:
movb %dil, %al
movb %al, -0x5(%rsp)
movsbl -0x5(%rsp), %eax
addl $-0x42, %eax
movl %eax, %ecx
movq %rcx, -0x10(%rsp)
subl $0x10, %eax
ja 0x10012
movq -0x10(%rsp), %rax
leaq 0x49515(%rip), %rcx     # 0x594ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x2, -0x4(%rsp)
jmp 0x1001a
movl $0x3, -0x4(%rsp)
jmp 0x1001a
movl $0x4, -0x4(%rsp)
jmp 0x1001a
movl $0x5, -0x4(%rsp)
jmp 0x1001a
movl $0x6, -0x4(%rsp)
jmp 0x1001a
movl $0x0, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nop
// File: ATOMIC-LICHESS[P]ATOMKRAFT/create_book.cpp
// Function: printTree(MoveTreeNode*)
void printTree(MoveTreeNode* node) {

	if (node->child_count == 0) {
		cout << endl;
		return;
	}

	// print first move
	cout << move_to_string(node->child[0]->ms.move) << " ";
	printTree(node->child[0]);

	// print following moves
	for (int k = 1; k < node->child_count; ++k) {
		// indentation
		for (int s = 0; s < node->depth; ++s) {
			cout << "     ";
		}

		// print moves
		cout << move_to_string(node->child[k]->ms.move) << " ";
		printTree(node->child[k]);
	}
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq 0x80(%rsp), %rax
cmpl $0x0, 0xa8(%rax)
jne 0x103b8
movq 0x5bc11(%rip), %rdi     # 0x6bfb8
movq 0x5bbe2(%rip), %rsi     # 0x6bf90
callq 0x6520
jmp 0x10535
movq 0x80(%rsp), %rax
movq 0x8(%rax), %rax
movl 0xac(%rax), %esi
leaq 0x60(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x2c450
movq 0x18(%rsp), %rsi
movq 0x5bbd3(%rip), %rdi     # 0x6bfb8
callq 0x6420
movq %rax, 0x20(%rsp)
jmp 0x103f1
movq 0x20(%rsp), %rdi
leaq 0x49163(%rip), %rsi     # 0x59560
callq 0x64b0
jmp 0x10404
leaq 0x60(%rsp), %rdi
callq 0x6a78
movq 0x80(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x10380
movl $0x1, 0x50(%rsp)
movl 0x50(%rsp), %eax
movq 0x80(%rsp), %rcx
cmpl 0xa8(%rcx), %eax
jge 0x10535
movl $0x0, 0x4c(%rsp)
movl 0x4c(%rsp), %eax
movq 0x80(%rsp), %rcx
cmpl 0xb8(%rcx), %eax
jge 0x10498
movq 0x5bb56(%rip), %rdi     # 0x6bfb8
leaq 0x490f3(%rip), %rsi     # 0x5955c
callq 0x64b0
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0x10447
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x6a78
jmp 0x1053d
movq 0x80(%rsp), %rax
movslq 0x50(%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rax
movl 0xac(%rax), %esi
leaq 0x28(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x2c450
movq 0x8(%rsp), %rsi
movq 0x5baed(%rip), %rdi     # 0x6bfb8
callq 0x6420
movq %rax, 0x10(%rsp)
jmp 0x104d7
movq 0x10(%rsp), %rdi
leaq 0x4907d(%rip), %rsi     # 0x59560
callq 0x64b0
jmp 0x104ea
leaq 0x28(%rsp), %rdi
callq 0x6a78
movq 0x80(%rsp), %rax
movslq 0x50(%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rdi
callq 0x10380
movl 0x50(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x50(%rsp)
jmp 0x10427
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x6a78
jmp 0x1053d
addq $0x88, %rsp
retq
movq 0x58(%rsp), %rdi
callq 0x6970
nopw (%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/create_book.cpp
// Function: numberOfNodes(MoveTreeNode*)
int numberOfNodes(MoveTreeNode* node) {

	int sum = 0;

	for (int k = 0; k < node->child_count; ++k) {
		sum += numberOfNodes(node->child[k]);
	}

	// node->ms.score was set true or false, false means not playable
	if (node->ms.score) {
		node->ms.score = 1;//sum + 1;	// a move with score 0 will never be played
	}
	return sum + 1;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0xa8(%rcx), %eax
jge 0x105a3
movq 0x10(%rsp), %rax
movslq 0x8(%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rdi
callq 0x10550
addl 0xc(%rsp), %eax
movl %eax, 0xc(%rsp)
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x10569
movq 0x10(%rsp), %rax
cmpl $0x0, 0xb0(%rax)
je 0x105c0
movq 0x10(%rsp), %rax
movl $0x1, 0xb0(%rax)
movl 0xc(%rsp), %eax
addl $0x1, %eax
addq $0x18, %rsp
retq
nopl (%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/create_book.cpp
// Function: write_entry(_IO_FILE*, unsigned long, Move, unsigned short)
void write_entry(FILE* file, 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(file, key);
	write_number(file, m);
	write_number(file, count);
	write_number(file, learn);


	if (ferror(file)) {
		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 $0x28, %rsp
movw %cx, %ax
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl %edx, 0x14(%rsp)
movw %ax, 0x12(%rsp)
movl 0x14(%rsp), %edi
callq 0xf680
movl %eax, 0x4(%rsp)
movl 0x14(%rsp), %edi
callq 0xf690
movl 0x4(%rsp), %edi
movl %eax, %esi
callq 0xf810
movl %eax, 0x8(%rsp)
movl 0x14(%rsp), %edi
callq 0xf830
movl %eax, %ecx
movl 0x8(%rsp), %eax
shll $0xc, %ecx
orl %ecx, %eax
movw %ax, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x11f40
movq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x11fb0
movq 0x20(%rsp), %rdi
leaq 0x12(%rsp), %rsi
callq 0x11fb0
movq 0x20(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x12010
movq 0x20(%rsp), %rdi
callq 0x6a00
cmpl $0x0, %eax
je 0x106a7
movq 0x5b96e(%rip), %rdi     # 0x6bff0
leaq 0x48e3d(%rip), %rsi     # 0x594c6
callq 0x64b0
movq %rax, %rdi
movq 0x5b8f8(%rip), %rsi     # 0x6bf90
callq 0x6520
movl $0x1, %edi
callq 0x6630
addq $0x28, %rsp
retq
nopl (%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/./move.h
// Function: void insertion_sort<(anonymous namespace)::RootMove, __gnu_cxx::__normal_iterator<(anonymous namespace)::RootMove*, std::vector<(anonymous namespace)::RootMove, std::allocator<(anonymous namespace)::RootMove>>>>(__gnu_cxx::__normal_iterator<(anonymous namespace)::RootMove*, std::vector<(anonymous namespace)::RootMove, std::allocator<(anonymous namespace)::RootMove>>>, __gnu_cxx::__normal_iterator<(anonymous namespace)::RootMove*, std::vector<(anonymous namespace)::RootMove, std::allocator<(anonymous namespace)::RootMove>>>)
inline void insertion_sort(K firstMove, K lastMove)
{
    T value;
    K cur, p, d;

    if (firstMove != lastMove)
        for (cur = firstMove + 1; cur != lastMove; cur++)
        {
            p = d = cur;
            value = *p--;
            if (*p < value)
            {
                do *d = *p;
                while (--d != firstMove && *--p < value);
                *d = value;
            }
        }
}

// Assembly:
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rdi, 0x1f0(%rsp)
movq %rsi, 0x1e8(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x47880
leaq 0x38(%rsp), %rdi
callq 0x4b310
leaq 0x30(%rsp), %rdi
callq 0x4b310
leaq 0x28(%rsp), %rdi
callq 0x4b310
leaq 0x1f0(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x4b330
testb $0x1, %al
jne 0x4b42d
jmp 0x4b572
leaq 0x1f0(%rsp), %rdi
movl $0x1, %esi
callq 0x4b580
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x38(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x4b330
testb $0x1, %al
jne 0x4b469
jmp 0x4b570
movq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
callq 0x4b5c0
movq %rax, 0x18(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x4b600
movq %rax, %rsi
leaq 0x40(%rsp), %rdi
callq 0x47dc0
leaq 0x30(%rsp), %rdi
callq 0x4b600
movq %rax, %rdi
leaq 0x40(%rsp), %rsi
callq 0x4b610
testb $0x1, %al
jne 0x4b4c5
jmp 0x4b558
jmp 0x4b4c7
leaq 0x30(%rsp), %rdi
callq 0x4b600
movq %rax, 0x8(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x4b600
movq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x47dc0
leaq 0x28(%rsp), %rdi
callq 0x4b670
movq %rax, %rdi
leaq 0x1f0(%rsp), %rsi
callq 0x4b330
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x7(%rsp)
jne 0x4b516
jmp 0x4b539
leaq 0x30(%rsp), %rdi
callq 0x4b670
movq %rax, %rdi
callq 0x4b600
movq %rax, %rdi
leaq 0x40(%rsp), %rsi
callq 0x4b610
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x4b4c7
leaq 0x28(%rsp), %rdi
callq 0x4b600
movq %rax, %rdi
leaq 0x40(%rsp), %rsi
callq 0x47dc0
jmp 0x4b55a
leaq 0x38(%rsp), %rdi
xorl %esi, %esi
callq 0x4b690
movq %rax, 0x10(%rsp)
jmp 0x4b44e
jmp 0x4b572
addq $0x1f8, %rsp            # imm = 0x1F8
retq
nopw (%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/create_book.cpp
// Function: void write_number<unsigned long>(_IO_FILE*, unsigned long&)
void write_number(FILE* file, T& n) {

	for (size_t i = 0; i < sizeof(T); i++) {
		uint8_t c = uint8_t((n >> ((sizeof(T) - 1) * 8)));
		n <<= 8;
		fputc(c, file);
	}

}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
cmpq $0x8, 0x10(%rsp)
jae 0x11f9d
movq 0x18(%rsp), %rax
movq (%rax), %rax
shrq $0x38, %rax
movb %al, 0xf(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rcx
shlq $0x8, %rcx
movq %rcx, (%rax)
movzbl 0xf(%rsp), %edi
movq 0x20(%rsp), %rsi
callq 0x6660
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x11f57
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/debug.cpp
// Function: print_pos(Position const&)
void print_pos(const Position& pos) {
	Piece piece;
	
	cout << "    0   1   2   3   4   5   6   7" << endl;
	cout << "  +---+---+---+---+---+---+---+---+" << endl;
	
	for (int rank = 7; rank >= 0; --rank) {
		cout << rank + 1 << " |";
		for (int file = 0; file < 8; ++file) {
			piece = pos.piece_on(BOARDVTOI[rank][file]);
			if (piece < 0 || piece > 16) {
				cout << "ERROR" << endl;
				return;
			}
			cout << " " << PIECE_NAME[piece] << " |";
		}
		cout << " " << rank << endl;
		cout << "  +---+---+---+---+---+---+---+---+" << endl;
	}
	
	cout << "    a   b   c   d   e   f   g   h" << endl;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x563d8(%rip), %rdi     # 0x6bfb8
leaq 0x43a6f(%rip), %rsi     # 0x59656
callq 0x64b0
movq %rax, %rdi
movq 0x5639a(%rip), %rsi     # 0x6bf90
callq 0x6520
movq 0x563b6(%rip), %rdi     # 0x6bfb8
leaq 0x43a6f(%rip), %rsi     # 0x59678
callq 0x64b0
movq %rax, %rdi
movq 0x56378(%rip), %rsi     # 0x6bf90
callq 0x6520
movl $0x7, 0x8(%rsp)
cmpl $0x0, 0x8(%rsp)
jl 0x15d6e
movl 0x8(%rsp), %esi
addl $0x1, %esi
movq 0x5637a(%rip), %rdi     # 0x6bfb8
callq 0x6940
movq %rax, %rdi
leaq 0x43a4f(%rip), %rsi     # 0x5969c
callq 0x64b0
movl $0x0, 0x4(%rsp)
cmpl $0x8, 0x4(%rsp)
jge 0x15d0e
movq 0x10(%rsp), %rdi
movslq 0x8(%rsp), %rcx
leaq 0x43aca(%rip), %rax     # 0x59740
shlq $0x5, %rcx
addq %rcx, %rax
movslq 0x4(%rsp), %rcx
movl (%rax,%rcx,4), %esi
callq 0xf530
movl %eax, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
jl 0x15c9c
cmpl $0x10, 0xc(%rsp)
jle 0x15cc3
movq 0x56315(%rip), %rdi     # 0x6bfb8
leaq 0x439f5(%rip), %rsi     # 0x5969f
callq 0x64b0
movq %rax, %rdi
movq 0x562d7(%rip), %rsi     # 0x6bf90
callq 0x6520
jmp 0x15d90
movq 0x562ee(%rip), %rdi     # 0x6bfb8
leaq 0x4388f(%rip), %rsi     # 0x59560
callq 0x64b0
movq %rax, %rdi
movl 0xc(%rsp), %eax
movl %eax, %ecx
leaq 0x43b5a(%rip), %rax     # 0x59840
movsbl (%rax,%rcx), %esi
callq 0x65d0
movq %rax, %rdi
leaq 0x439a3(%rip), %rsi     # 0x5969c
callq 0x64b0
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x15c5a
movq 0x562a3(%rip), %rdi     # 0x6bfb8
leaq 0x43844(%rip), %rsi     # 0x59560
callq 0x64b0
movq %rax, %rdi
movl 0x8(%rsp), %esi
callq 0x6940
movq %rax, %rdi
movq 0x56259(%rip), %rsi     # 0x6bf90
callq 0x6520
movq 0x56275(%rip), %rdi     # 0x6bfb8
leaq 0x4392e(%rip), %rsi     # 0x59678
callq 0x64b0
movq %rax, %rdi
movq 0x56237(%rip), %rsi     # 0x6bf90
callq 0x6520
movl 0x8(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x15c25
movq 0x56243(%rip), %rdi     # 0x6bfb8
leaq 0x43929(%rip), %rsi     # 0x596a5
callq 0x64b0
movq %rax, %rdi
movq 0x56205(%rip), %rsi     # 0x6bf90
callq 0x6520
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/debug.cpp
// Function: print_castleRights(Position const&)
void print_castleRights(const Position& pos) {
	cout << (pos.can_castle_queenside(BLACK) ? 1 : 0);
	cout << (pos.can_castle_queenside(WHITE) ? 1 : 0);
	cout << (pos.can_castle_kingside(BLACK) ? 1 : 0);
	cout << (pos.can_castle_kingside(WHITE) ? 1 : 0);
	cout << endl;
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
movq (%rsp), %rdi
movl $0x1, %esi
callq 0xf580
movb %al, %cl
xorl %esi, %esi
movl $0x1, %eax
testb $0x1, %cl
cmovnel %eax, %esi
movq 0x55fbf(%rip), %rdi     # 0x6bfb8
callq 0x6940
movq (%rsp), %rdi
xorl %esi, %esi
callq 0xf580
movb %al, %cl
xorl %esi, %esi
movl $0x1, %eax
testb $0x1, %cl
cmovnel %eax, %esi
movq 0x55f99(%rip), %rdi     # 0x6bfb8
callq 0x6940
movq (%rsp), %rdi
movl $0x1, %esi
callq 0xf550
movb %al, %cl
xorl %esi, %esi
movl $0x1, %eax
testb $0x1, %cl
cmovnel %eax, %esi
movq 0x55f70(%rip), %rdi     # 0x6bfb8
callq 0x6940
movq (%rsp), %rdi
xorl %esi, %esi
callq 0xf550
movb %al, %cl
xorl %esi, %esi
movl $0x1, %eax
testb $0x1, %cl
cmovnel %eax, %esi
movq 0x55f4a(%rip), %rdi     # 0x6bfb8
callq 0x6940
movq 0x55f3e(%rip), %rdi     # 0x6bfb8
movq 0x55f0f(%rip), %rsi     # 0x6bf90
callq 0x6520
popq %rax
retq
nopl (%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/endgame.cpp
// Function: Endgame<Value, (EndgameType)28>::apply(Position const&) const
Value Endgame<Value, KRPKP_ATOMIC>::apply(const Position& pos) const {
	// there are 6 draw pawn configurations all the others are a win for white
	
#define S(x) (1ULL << (x))
	static const Bitboard draw_pattern_white = 
		S(SQ_A3) | S(SQ_E3) | S(SQ_D3) | S(SQ_H3) | S(SQ_E4) | S(SQ_D4);
	static const Bitboard draw_pattern_black = 
		S(SQ_A6) | S(SQ_E6) | S(SQ_D6) | S(SQ_H6) | S(SQ_E5) | S(SQ_D5);
#undef S
	
	if (strongerSide == WHITE) {
		Bitboard blocked_pawn = pos.pieces(PAWN, WHITE) & draw_pattern_white;
		if ((blocked_pawn << 8) & pos.pieces(PAWN, BLACK)) {
			return VALUE_DRAW;
		}
	} else {
		Bitboard blocked_pawn = pos.pieces(PAWN, BLACK) & draw_pattern_black;
		if ((blocked_pawn >> 8) & pos.pieces(PAWN, WHITE)) {
			return VALUE_DRAW;
		}
	}
	
	// TODO: this is not always true
	return strongerSide == pos.side_to_move() ? VALUE_KNOWN_WIN : -VALUE_KNOWN_WIN;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpl $0x0, 0x8(%rax)
jne 0x17309
movq 0x30(%rsp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x16530
andq $0x18990000, %rax       # imm = 0x18990000
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
shlq $0x8, %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0x16530
movq %rax, %rcx
movq 0x10(%rsp), %rax
andq %rcx, %rax
cmpq $0x0, %rax
je 0x17307
movl $0x0, 0x44(%rsp)
jmp 0x173a6
jmp 0x17368
movq 0x30(%rsp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0x16530
movabsq $0x991800000000, %rcx   # imm = 0x991800000000
andq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
shrq $0x8, %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x16530
movq %rax, %rcx
movq 0x8(%rsp), %rax
andq %rcx, %rax
cmpq $0x0, %rax
je 0x17366
movl $0x0, 0x44(%rsp)
jmp 0x173a6
jmp 0x17368
movq 0x18(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0x4(%rsp)
movq 0x30(%rsp), %rdi
callq 0xf5d0
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jne 0x17392
movl $0x3a98, %eax           # imm = 0x3A98
movl %eax, (%rsp)
jmp 0x1739f
movl $0x3a98, %edi           # imm = 0x3A98
callq 0x1b2b0
movl %eax, (%rsp)
movl (%rsp), %eax
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nop
// File: ATOMIC-LICHESS[P]ATOMKRAFT/endgame.cpp
// Function: Endgame<Value, (EndgameType)2>::apply(Position const&) const
Value Endgame<Value, KPK>::apply(const Position& pos) const {

  assert(pos.non_pawn_material(strongerSide) == VALUE_ZERO);
  assert(pos.non_pawn_material(weakerSide) == VALUE_ZERO);
  assert(pos.piece_count(strongerSide, PAWN) == 1);
  assert(pos.piece_count(weakerSide, PAWN) == 0);
  

		  
  Square wksq, bksq, wpsq;
  Color stm;
  
  STARTNEW
  Square spsq = pos.piece_list(strongerSide, PAWN, 0);	// stronger pawn square
  wksq = pos.king_square(WHITE);
  bksq = pos.king_square(BLACK);
  stm = pos.side_to_move();
  
  int moves_to_adjacent_kings 	= square_dist(wksq, bksq) - 1;
  int moves_to_promote 			= RANK_8 - relative_rank(strongerSide, spsq);
  
  // we can evaluate the outcome of some patterns, similar to KQK
  if (strongerSide == stm) {
	  if 		(moves_to_promote + 2 <= moves_to_adjacent_kings) {
		  return VALUE_KNOWN_WIN;
	  } else if (moves_to_promote >= moves_to_adjacent_kings) {
		  return VALUE_DRAW;
	  }
  } else {
	  // if the weaker side moves the distances can be even bigger
	  if 		(moves_to_promote + 3 <= moves_to_adjacent_kings) {
		  return -VALUE_KNOWN_WIN;
	  } else if (moves_to_promote + 1 >= moves_to_adjacent_kings) {
		  return VALUE_DRAW;
	  }
  }
  
  // we don't know...
  return VALUE_NONE;
  ENDNEW

  if (strongerSide == WHITE)
  {
      wksq = pos.king_square(WHITE);
      bksq = pos.king_square(BLACK);
      wpsq = pos.piece_list(WHITE, PAWN, 0);
      stm = pos.side_to_move();
  }
  else
  {
      wksq = flip_square(pos.king_square(BLACK));
      bksq = flip_square(pos.king_square(WHITE));
      wpsq = flip_square(pos.piece_list(BLACK, PAWN, 0));
      stm = opposite_color(pos.side_to_move());
  }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rdi
movl 0x8(%rax), %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x164f0
movl %eax, 0x1c(%rsp)
movq 0x30(%rsp), %rdi
xorl %esi, %esi
callq 0x1b250
movl %eax, 0x2c(%rsp)
movq 0x30(%rsp), %rdi
movl $0x1, %esi
callq 0x1b250
movl %eax, 0x28(%rsp)
movq 0x30(%rsp), %rdi
callq 0xf5d0
movl %eax, 0x20(%rsp)
movl 0x2c(%rsp), %edi
movl 0x28(%rsp), %esi
callq 0x1b280
movl %eax, %ecx
movq 0x8(%rsp), %rax
subl $0x1, %ecx
movl %ecx, 0x18(%rsp)
movl 0x8(%rax), %edi
movl 0x1c(%rsp), %esi
callq 0x1b2c0
movl %eax, %esi
movl $0x7, %edi
callq 0xce20
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x14(%rsp)
movl 0x8(%rax), %eax
cmpl 0x20(%rsp), %eax
jne 0x17617
movl 0x14(%rsp), %eax
addl $0x2, %eax
cmpl 0x18(%rsp), %eax
jg 0x175ff
movl $0x3a98, 0x44(%rsp)     # imm = 0x3A98
jmp 0x17657
movl 0x14(%rsp), %eax
cmpl 0x18(%rsp), %eax
jl 0x17613
movl $0x0, 0x44(%rsp)
jmp 0x17657
jmp 0x17615
jmp 0x1764f
movl 0x14(%rsp), %eax
addl $0x3, %eax
cmpl 0x18(%rsp), %eax
jg 0x17634
movl $0x3a98, %edi           # imm = 0x3A98
callq 0x1b2b0
movl %eax, 0x44(%rsp)
jmp 0x17657
movl 0x14(%rsp), %eax
addl $0x1, %eax
cmpl 0x18(%rsp), %eax
jl 0x1764b
movl $0x0, 0x44(%rsp)
jmp 0x17657
jmp 0x1764d
jmp 0x1764f
movl $0x7532, 0x44(%rsp)     # imm = 0x7532
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
// File: ATOMIC-LICHESS[P]ATOMKRAFT/endgame.cpp
// Function: Endgame<Value, (EndgameType)6>::apply(Position const&) const
Value Endgame<Value, KQKR>::apply(const Position& pos) const {

  assert(pos.non_pawn_material(strongerSide) == QueenValueMidgame);
  assert(pos.piece_count(strongerSide, PAWN) == 0);
  assert(pos.non_pawn_material(weakerSide) == RookValueMidgame);
  assert(pos.piece_count(weakerSide, PAWN) == 0);

  Square winnerKSq = pos.king_square(strongerSide);
  Square loserKSq = pos.king_square(weakerSide);

  Value result =  QueenValueEndgame
                - RookValueEndgame
                + MateTable[loserKSq]
                + DistanceBonus[square_distance(winnerKSq, loserKSq)];

  return strongerSide == pos.side_to_move() ? result : -result;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rdi
movl 0x8(%rax), %esi
callq 0x1b250
movl %eax, %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x24(%rsp)
movq 0x28(%rsp), %rdi
movl 0xc(%rax), %esi
callq 0x1b250
movl %eax, 0x20(%rsp)
leaq 0x54bd4(%rip), %rax     # 0x6c57c
movl (%rax), %edi
leaq 0x54bc3(%rip), %rax     # 0x6c574
movl (%rax), %esi
callq 0x1b300
movl %eax, %edi
movslq 0x20(%rsp), %rcx
leaq 0x4202a(%rip), %rax     # 0x599f0
movl (%rax,%rcx,4), %esi
callq 0x1b340
movl %eax, 0xc(%rsp)
movl 0x24(%rsp), %edi
movl 0x20(%rsp), %esi
callq 0xcd00
movl 0xc(%rsp), %edi
movslq %eax, %rcx
leaq 0x42103(%rip), %rax     # 0x59af0
movl (%rax,%rcx,4), %esi
callq 0x1b340
movl %eax, %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x1c(%rsp)
movl 0x8(%rax), %eax
movl %eax, 0x18(%rsp)
movq 0x28(%rsp), %rdi
callq 0xf5d0
movl %eax, %ecx
movl 0x18(%rsp), %eax
cmpl %ecx, %eax
jne 0x17a25
movl 0x1c(%rsp), %eax
movl %eax, 0x8(%rsp)
jmp 0x17a32
movl 0x1c(%rsp), %edi
callq 0x1b2b0
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/endgame.cpp
// Function: Endgame<ScaleFactor, (EndgameType)11>::apply(Position const&) const
ScaleFactor Endgame<ScaleFactor, KQKRPs>::apply(const Position& pos) const {

  assert(pos.non_pawn_material(strongerSide) == QueenValueMidgame);
  assert(pos.piece_count(strongerSide, QUEEN) == 1);
  assert(pos.piece_count(strongerSide, PAWN) == 0);
  assert(pos.piece_count(weakerSide, ROOK) == 1);
  assert(pos.piece_count(weakerSide, PAWN) >= 1);

  Square kingSq = pos.king_square(weakerSide);
  if (   relative_rank(weakerSide, kingSq) <= RANK_2
      && relative_rank(weakerSide, pos.king_square(strongerSide)) >= RANK_4
      && (pos.pieces(ROOK, weakerSide) & rank_bb(relative_rank(weakerSide, RANK_3)))
      && (pos.pieces(PAWN, weakerSide) & rank_bb(relative_rank(weakerSide, RANK_2)))
      && (pos.attacks_from<KING>(kingSq) & pos.pieces(PAWN, weakerSide)))
  {
      Square rsq = pos.piece_list(weakerSide, ROOK, 0);
      if (pos.attacks_from<PAWN>(rsq, strongerSide) & pos.pieces(PAWN, weakerSide))
          return SCALE_FACTOR_ZERO;
  }
  return SCALE_FACTOR_NONE;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rdi
movl 0xc(%rax), %esi
callq 0x1b250
movl %eax, %ecx
movq 0x30(%rsp), %rax
movl %ecx, 0x3c(%rsp)
movl 0xc(%rax), %edi
movl 0x3c(%rsp), %esi
callq 0x1b2c0
cmpl $0x1, %eax
jg 0x17e1b
movq 0x30(%rsp), %rax
movl 0xc(%rax), %ecx
movl %ecx, 0x2c(%rsp)
movq 0x40(%rsp), %rdi
movl 0x8(%rax), %esi
callq 0x1b250
movl 0x2c(%rsp), %edi
movl %eax, %esi
callq 0x1b2c0
cmpl $0x3, %eax
jl 0x17e1b
movq 0x30(%rsp), %rax
movq 0x40(%rsp), %rdi
movl 0xc(%rax), %edx
movl $0x4, %esi
callq 0x16530
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x20(%rsp)
movl 0xc(%rax), %edi
movl $0x2, %esi
callq 0x1b420
movl %eax, %edi
callq 0x1b3d0
movq %rax, %rcx
movq 0x20(%rsp), %rax
andq %rcx, %rax
cmpq $0x0, %rax
je 0x17e1b
movq 0x30(%rsp), %rax
movq 0x40(%rsp), %rdi
movl 0xc(%rax), %edx
movl $0x1, %esi
callq 0x16530
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x18(%rsp)
movl 0xc(%rax), %edi
movl $0x1, %esi
callq 0x1b420
movl %eax, %edi
callq 0x1b3d0
movq %rax, %rcx
movq 0x18(%rsp), %rax
andq %rcx, %rax
cmpq $0x0, %rax
je 0x17e1b
movq 0x40(%rsp), %rdi
movl 0x3c(%rsp), %esi
callq 0x1b440
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x10(%rsp)
movq 0x40(%rsp), %rdi
movl 0xc(%rax), %edx
movl $0x1, %esi
callq 0x16530
movq %rax, %rcx
movq 0x10(%rsp), %rax
andq %rcx, %rax
cmpq $0x0, %rax
je 0x17e1b
movq 0x30(%rsp), %rax
movq 0x40(%rsp), %rdi
movl 0xc(%rax), %esi
movl $0x4, %edx
xorl %ecx, %ecx
callq 0x164f0
movl %eax, %ecx
movq 0x30(%rsp), %rax
movl %ecx, 0x38(%rsp)
movq 0x40(%rsp), %rdi
movl 0x38(%rsp), %esi
movl 0x8(%rax), %edx
callq 0x1b460
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x8(%rsp)
movq 0x40(%rsp), %rdi
movl 0xc(%rax), %edx
movl $0x1, %esi
callq 0x16530
movq %rax, %rcx
movq 0x8(%rsp), %rax
andq %rcx, %rax
cmpq $0x0, %rax
je 0x17e19
movl $0x0, 0x54(%rsp)
jmp 0x17e23
jmp 0x17e1b
movl $0xff, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopl (%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/endgame.cpp
// Function: Endgame<ScaleFactor, (EndgameType)14>::apply(Position const&) const
ScaleFactor Endgame<ScaleFactor, KPsK>::apply(const Position& pos) const {

  assert(pos.non_pawn_material(strongerSide) == VALUE_ZERO);
  assert(pos.piece_count(strongerSide, PAWN) >= 2);
  assert(pos.non_pawn_material(weakerSide) == VALUE_ZERO);
  assert(pos.piece_count(weakerSide, PAWN) == 0);

  Square ksq = pos.king_square(weakerSide);
  Bitboard pawns = pos.pieces(PAWN, strongerSide);

  // Are all pawns on the 'a' file?
  if ((pawns & ~FileABB) == EmptyBoardBB)
  {
      // Does the defending king block the pawns?
      if (   square_distance(ksq, relative_square(strongerSide, SQ_A8)) <= 1
          || (   square_file(ksq) == FILE_A
              && (in_front_bb(strongerSide, ksq) & pawns) == EmptyBoardBB))
          return SCALE_FACTOR_ZERO;
  }
  // Are all pawns on the 'h' file?
  else if ((pawns & ~FileHBB) == EmptyBoardBB)
  {
    // Does the defending king block the pawns?
    if (   square_distance(ksq, relative_square(strongerSide, SQ_H8)) <= 1
        || (   square_file(ksq) == FILE_H
            && (in_front_bb(strongerSide, ksq) & pawns) == EmptyBoardBB))
        return SCALE_FACTOR_ZERO;
  }
  return SCALE_FACTOR_NONE;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
movl 0xc(%rax), %esi
callq 0x1b250
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x1c(%rsp)
movq 0x20(%rsp), %rdi
movl 0x8(%rax), %edx
movl $0x1, %esi
callq 0x16530
movq %rax, 0x10(%rsp)
movabsq $-0x101010101010102, %rax # imm = 0xFEFEFEFEFEFEFEFE
andq 0x10(%rsp), %rax
cmpq $0x0, %rax
jne 0x186fc
movq 0x8(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %ecx, 0x4(%rsp)
movl 0x8(%rax), %edi
movl $0x38, %esi
callq 0x1b380
movl 0x4(%rsp), %edi
movl %eax, %esi
callq 0xcd00
cmpl $0x1, %eax
jle 0x186f0
movl 0x1c(%rsp), %edi
callq 0xce10
cmpl $0x0, %eax
jne 0x186fa
movq 0x8(%rsp), %rax
movl 0x8(%rax), %edi
movl 0x1c(%rsp), %esi
callq 0xe5f0
andq 0x10(%rsp), %rax
cmpq $0x0, %rax
jne 0x186fa
movl $0x0, 0x34(%rsp)
jmp 0x18779
jmp 0x18771
movabsq $0x7f7f7f7f7f7f7f7f, %rax # imm = 0x7F7F7F7F7F7F7F7F
andq 0x10(%rsp), %rax
cmpq $0x0, %rax
jne 0x1876f
movq 0x8(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %ecx, (%rsp)
movl 0x8(%rax), %edi
movl $0x3f, %esi
callq 0x1b380
movl (%rsp), %edi
movl %eax, %esi
callq 0xcd00
cmpl $0x1, %eax
jle 0x18763
movl 0x1c(%rsp), %edi
callq 0xce10
cmpl $0x7, %eax
jne 0x1876d
movq 0x8(%rsp), %rax
movl 0x8(%rax), %edi
movl 0x1c(%rsp), %esi
callq 0xe5f0
andq 0x10(%rsp), %rax
cmpq $0x0, %rax
jne 0x1876d
movl $0x0, 0x34(%rsp)
jmp 0x18779
jmp 0x1876f
jmp 0x18771
movl $0xff, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/endgame.cpp
// Function: Endgame<ScaleFactor, (EndgameType)17>::apply(Position const&) const
ScaleFactor Endgame<ScaleFactor, KBPKN>::apply(const Position& pos) const {

  assert(pos.non_pawn_material(strongerSide) == BishopValueMidgame);
  assert(pos.piece_count(strongerSide, BISHOP) == 1);
  assert(pos.piece_count(strongerSide, PAWN) == 1);
  assert(pos.non_pawn_material(weakerSide) == KnightValueMidgame);
  assert(pos.piece_count(weakerSide, KNIGHT) == 1);
  assert(pos.piece_count(weakerSide, PAWN) == 0);

  Square pawnSq = pos.piece_list(strongerSide, PAWN, 0);
  Square strongerBishopSq = pos.piece_list(strongerSide, BISHOP, 0);
  Square weakerKingSq = pos.king_square(weakerSide);

  if (   square_file(weakerKingSq) == square_file(pawnSq)
      && relative_rank(strongerSide, pawnSq) < relative_rank(strongerSide, weakerKingSq)
      && (   opposite_color_squares(weakerKingSq, strongerBishopSq)
          || relative_rank(strongerSide, weakerKingSq) <= RANK_6))
      return SCALE_FACTOR_ZERO;

  return SCALE_FACTOR_NONE;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
movl 0x8(%rax), %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x164f0
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x1c(%rsp)
movq 0x20(%rsp), %rdi
movl 0x8(%rax), %esi
movl $0x3, %edx
xorl %ecx, %ecx
callq 0x164f0
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x18(%rsp)
movq 0x20(%rsp), %rdi
movl 0xc(%rax), %esi
callq 0x1b250
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %edi
callq 0xce10
movl %eax, 0x10(%rsp)
movl 0x1c(%rsp), %edi
callq 0xce10
movl %eax, %ecx
movl 0x10(%rsp), %eax
cmpl %ecx, %eax
jne 0x18dca
movq 0x8(%rsp), %rax
movl 0x8(%rax), %edi
movl 0x1c(%rsp), %esi
callq 0x1b2c0
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x4(%rsp)
movl 0x8(%rax), %edi
movl 0x14(%rsp), %esi
callq 0x1b2c0
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x18dca
movl 0x14(%rsp), %edi
movl 0x18(%rsp), %esi
callq 0x1b3a0
testb $0x1, %al
jne 0x18dc0
movq 0x8(%rsp), %rax
movl 0x8(%rax), %edi
movl 0x14(%rsp), %esi
callq 0x1b2c0
cmpl $0x5, %eax
jg 0x18dca
movl $0x0, 0x34(%rsp)
jmp 0x18dd2
movl $0xff, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/endgame.cpp
// Function: Endgame<ScaleFactor, (EndgameType)18>::apply(Position const&) const
ScaleFactor Endgame<ScaleFactor, KNPK>::apply(const Position& pos) const {

  assert(pos.non_pawn_material(strongerSide) == KnightValueMidgame);
  assert(pos.piece_count(strongerSide, KNIGHT) == 1);
  assert(pos.piece_count(strongerSide, PAWN) == 1);
  assert(pos.non_pawn_material(weakerSide) == VALUE_ZERO);
  assert(pos.piece_count(weakerSide, PAWN) == 0);

  Square pawnSq = pos.piece_list(strongerSide, PAWN, 0);
  Square weakerKingSq = pos.king_square(weakerSide);

  if (   pawnSq == relative_square(strongerSide, SQ_A7)
      && square_distance(weakerKingSq, relative_square(strongerSide, SQ_A8)) <= 1)
      return SCALE_FACTOR_ZERO;

  if (   pawnSq == relative_square(strongerSide, SQ_H7)
      && square_distance(weakerKingSq, relative_square(strongerSide, SQ_H8)) <= 1)
      return SCALE_FACTOR_ZERO;

  return SCALE_FACTOR_NONE;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rdi
movl 0x8(%rax), %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x164f0
movl %eax, %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x2c(%rsp)
movq 0x30(%rsp), %rdi
movl 0xc(%rax), %esi
callq 0x1b250
movl %eax, %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x28(%rsp)
movl 0x2c(%rsp), %ecx
movl %ecx, 0x24(%rsp)
movl 0x8(%rax), %edi
movl $0x30, %esi
callq 0x1b380
movl %eax, %ecx
movl 0x24(%rsp), %eax
cmpl %ecx, %eax
jne 0x18e82
movq 0x18(%rsp), %rax
movl 0x28(%rsp), %ecx
movl %ecx, 0x14(%rsp)
movl 0x8(%rax), %edi
movl $0x38, %esi
callq 0x1b380
movl 0x14(%rsp), %edi
movl %eax, %esi
callq 0xcd00
cmpl $0x1, %eax
jg 0x18e82
movl $0x0, 0x44(%rsp)
jmp 0x18ee2
movq 0x18(%rsp), %rax
movl 0x2c(%rsp), %ecx
movl %ecx, 0x10(%rsp)
movl 0x8(%rax), %edi
movl $0x37, %esi
callq 0x1b380
movl %eax, %ecx
movl 0x10(%rsp), %eax
cmpl %ecx, %eax
jne 0x18eda
movq 0x18(%rsp), %rax
movl 0x28(%rsp), %ecx
movl %ecx, 0xc(%rsp)
movl 0x8(%rax), %edi
movl $0x3f, %esi
callq 0x1b380
movl 0xc(%rsp), %edi
movl %eax, %esi
callq 0xcd00
cmpl $0x1, %eax
jg 0x18eda
movl $0x0, 0x44(%rsp)
jmp 0x18ee2
movl $0xff, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/endgame.cpp
// Function: Endgame<ScaleFactor, (EndgameType)19>::apply(Position const&) const
ScaleFactor Endgame<ScaleFactor, KPKP>::apply(const Position& pos) const {

  assert(pos.non_pawn_material(strongerSide) == VALUE_ZERO);
  assert(pos.non_pawn_material(weakerSide) == VALUE_ZERO);
  assert(pos.piece_count(WHITE, PAWN) == 1);
  assert(pos.piece_count(BLACK, PAWN) == 1);

  Square wksq, bksq, wpsq;
  Color stm;

  if (strongerSide == WHITE)
  {
      wksq = pos.king_square(WHITE);
      bksq = pos.king_square(BLACK);
      wpsq = pos.piece_list(WHITE, PAWN, 0);
      stm = pos.side_to_move();
  }
  else
  {
      wksq = flip_square(pos.king_square(BLACK));
      bksq = flip_square(pos.king_square(WHITE));
      wpsq = flip_square(pos.piece_list(BLACK, PAWN, 0));
      stm = opposite_color(pos.side_to_move());
  }

  if (square_file(wpsq) >= FILE_E)
  {
      wksq = flop_square(wksq);
      bksq = flop_square(bksq);
      wpsq = flop_square(wpsq);
  }

  // If the pawn has advanced to the fifth rank or further, and is not a
  // rook pawn, it's too dangerous to assume that it's at least a draw.
  if (   square_rank(wpsq) >= RANK_5
      && square_file(wpsq) != FILE_A)
      return SCALE_FACTOR_NONE;

  // Probe the KPK bitbase with the weakest side's pawn removed. If it's a
  // draw, it's probably at least a draw even with the pawn.
  return probe_kpk_bitbase(wksq, wpsq, bksq, stm) ? SCALE_FACTOR_NONE : SCALE_FACTOR_ZERO;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x18f52
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x1b250
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %rdi
movl $0x1, %esi
callq 0x1b250
movl %eax, 0x8(%rsp)
movq 0x10(%rsp), %rdi
xorl %ecx, %ecx
movl $0x1, %edx
movl %ecx, %esi
callq 0x164f0
movl %eax, 0x4(%rsp)
movq 0x10(%rsp), %rdi
callq 0xf5d0
movl %eax, (%rsp)
jmp 0x18fb5
movq 0x10(%rsp), %rdi
movl $0x1, %esi
callq 0x1b250
movl %eax, %edi
callq 0x1b2f0
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x1b250
movl %eax, %edi
callq 0x1b2f0
movl %eax, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movl $0x1, %edx
xorl %ecx, %ecx
movl %edx, %esi
callq 0x164f0
movl %eax, %edi
callq 0x1b2f0
movl %eax, 0x4(%rsp)
movq 0x10(%rsp), %rdi
callq 0xf5d0
movl %eax, %edi
callq 0x122b0
movl %eax, (%rsp)
movl 0x4(%rsp), %edi
callq 0xce10
cmpl $0x4, %eax
jl 0x18fea
movl 0xc(%rsp), %edi
callq 0x1b4a0
movl %eax, 0xc(%rsp)
movl 0x8(%rsp), %edi
callq 0x1b4a0
movl %eax, 0x8(%rsp)
movl 0x4(%rsp), %edi
callq 0x1b4a0
movl %eax, 0x4(%rsp)
movl 0x4(%rsp), %edi
callq 0xce40
cmpl $0x4, %eax
jl 0x19010
movl 0x4(%rsp), %edi
callq 0xce10
cmpl $0x0, %eax
je 0x19010
movl $0xff, 0x24(%rsp)
jmp 0x19037
movl 0xc(%rsp), %edi
movl 0x4(%rsp), %esi
movl 0x8(%rsp), %edx
movl (%rsp), %ecx
callq 0xce50
movl %eax, %edx
xorl %eax, %eax
movl $0xff, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
// File: ATOMIC-LICHESS[P]ATOMKRAFT/endgame.cpp
// Function: (anonymous namespace)::mat_key(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
Key mat_key(const string& keyCode) {

    assert(keyCode.length() > 0 && keyCode.length() < 8);
    assert(keyCode[0] == 'K');

    string fen;
    size_t i = 0;

    // First add white and then black pieces
    do fen += keyCode[i];                while (keyCode[++i] != 'K');
    do fen += char(tolower(keyCode[i])); while (++i < keyCode.length());

    // Add file padding and remaining empty ranks
    fen += string(1, '0' + int(8 - keyCode.length())) + "/8/8/8/8/8/8/8 w - -";

    // Build a Position out of the fen string and get its material key
    return Position(fen, false, 0).get_material_key();
  }

// Assembly:
subq $0x19e8, %rsp           # imm = 0x19E8
movq %rdi, 0x19e0(%rsp)
leaq 0x19c0(%rsp), %rdi
callq 0x6730
movq $0x0, 0x19b8(%rsp)
movq 0x19e0(%rsp), %rdi
movq 0x19b8(%rsp), %rsi
callq 0x6570
movsbl (%rax), %esi
leaq 0x19c0(%rsp), %rdi
callq 0x62d0
jmp 0x1908f
jmp 0x19091
movq 0x19e0(%rsp), %rdi
movq 0x19b8(%rsp), %rsi
addq $0x1, %rsi
movq %rsi, 0x19b8(%rsp)
callq 0x6570
movsbl (%rax), %eax
cmpl $0x4b, %eax
jne 0x19068
jmp 0x190bc
movq 0x19e0(%rsp), %rdi
movq 0x19b8(%rsp), %rsi
callq 0x6570
movsbl (%rax), %edi
callq 0x6770
movsbl %al, %esi
leaq 0x19c0(%rsp), %rdi
callq 0x62d0
jmp 0x190eb
jmp 0x190ed
movq 0x19b8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
movq %rax, 0x19b8(%rsp)
movq 0x19e0(%rsp), %rdi
callq 0x67b0
movq %rax, %rcx
movq 0x18(%rsp), %rax
cmpq %rcx, %rax
jb 0x190bc
movq 0x19e0(%rsp), %rdi
callq 0x67b0
movl %eax, %ecx
movl $0x38, %eax
subl %ecx, %eax
movl %eax, 0xc(%rsp)
leaq 0x1967(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x6980
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
movsbl %al, %edx
leaq 0x1968(%rsp), %rdi
movl $0x1, %esi
callq 0x1c660
jmp 0x1916c
leaq 0x409e3(%rip), %rdx     # 0x59b56
leaq 0x1988(%rsp), %rdi
leaq 0x1968(%rsp), %rsi
callq 0x1c610
jmp 0x1918a
leaq 0x19c0(%rsp), %rdi
leaq 0x1988(%rsp), %rsi
callq 0x6690
jmp 0x191a1
leaq 0x1988(%rsp), %rdi
callq 0x6a78
leaq 0x1968(%rsp), %rdi
callq 0x6a78
leaq 0x1967(%rsp), %rdi
callq 0x6550
leaq 0x20(%rsp), %rdi
leaq 0x19c0(%rsp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x36520
jmp 0x191e0
leaq 0x20(%rsp), %rdi
callq 0x1c6e0
movq %rax, (%rsp)
jmp 0x191f0
leaq 0x19c0(%rsp), %rdi
callq 0x6a78
movq (%rsp), %rax
addq $0x19e8, %rsp           # imm = 0x19E8
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x19b0(%rsp)
movl %eax, 0x19ac(%rsp)
jmp 0x19286
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x19b0(%rsp)
movl %eax, 0x19ac(%rsp)
jmp 0x19279
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x19b0(%rsp)
movl %eax, 0x19ac(%rsp)
jmp 0x1926c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x19b0(%rsp)
movl %eax, 0x19ac(%rsp)
leaq 0x1988(%rsp), %rdi
callq 0x6a78
leaq 0x1968(%rsp), %rdi
callq 0x6a78
leaq 0x1967(%rsp), %rdi
callq 0x6550
leaq 0x19c0(%rsp), %rdi
callq 0x6a78
movq 0x19b0(%rsp), %rdi
callq 0x6970
// File: ATOMIC-LICHESS[P]ATOMKRAFT/endgame.cpp
// Function: void Endgames::add<Endgame<Value, (EndgameType)8>>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Endgames::add(const string& keyCode) {

  typedef typename T::Base F;
  typedef std::map<Key, F*> M;

  const_cast<M&>(get<F>()).insert(std::pair<Key, F*>(mat_key(keyCode), new T(WHITE)));
  const_cast<M&>(get<F>()).insert(std::pair<Key, F*>(mat_key(swap_colors(keyCode)), new T(BLACK)));
}

// Assembly:
subq $0xf8, %rsp
movq %rdi, 0xf0(%rsp)
movq %rsi, 0xe8(%rsp)
movq 0xf0(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x16560
movq %rax, 0x48(%rsp)
movq 0xe8(%rsp), %rdi
callq 0x19040
movq %rax, 0xd0(%rsp)
movl $0x10, %edi
callq 0x64d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x50(%rsp)
xorl %esi, %esi
callq 0x1bd80
jmp 0x19431
movq 0x50(%rsp), %rax
movq %rax, 0xc8(%rsp)
leaq 0xd8(%rsp), %rdi
movq %rdi, 0x20(%rsp)
leaq 0xd0(%rsp), %rsi
leaq 0xc8(%rsp), %rdx
callq 0x1bdd0
movq 0x48(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x1bd30
movq 0x40(%rsp), %rdi
movq %rax, 0xa8(%rsp)
movb %dl, 0xb0(%rsp)
callq 0x16560
movq %rax, 0x28(%rsp)
movq 0xe8(%rsp), %rsi
leaq 0x70(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x192a0
movq 0x30(%rsp), %rdi
callq 0x19040
movq %rax, 0x38(%rsp)
jmp 0x194b5
movq 0x38(%rsp), %rax
movq %rax, 0x90(%rsp)
movl $0x10, %edi
callq 0x64d0
movq %rax, 0x18(%rsp)
jmp 0x194d3
movq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0x1bd80
jmp 0x194e4
movq 0x18(%rsp), %rax
movq %rax, 0x68(%rsp)
leaq 0x98(%rsp), %rdi
leaq 0x90(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x1bdd0
jmp 0x1950a
movq 0x28(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x1bd30
movb %dl, 0xf(%rsp)
movq %rax, 0x10(%rsp)
jmp 0x19527
movb 0xf(%rsp), %al
movq 0x10(%rsp), %rcx
movq %rcx, 0x58(%rsp)
movb %al, 0x60(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x6a78
addq $0xf8, %rsp
retq
movq 0x50(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
movl $0x10, %esi
callq 0x64e0
jmp 0x195b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
jmp 0x195a9
movq 0x18(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
movl $0x10, %esi
callq 0x64e0
leaq 0x70(%rsp), %rdi
callq 0x6a78
movq 0xc0(%rsp), %rdi
callq 0x6970
// File: ATOMIC-LICHESS[P]ATOMKRAFT/evaluate.cpp
// Function: (anonymous namespace)::weight_option(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, Score)
Score weight_option(const std::string& mgOpt, const std::string& egOpt, Score internalWeight) {

    // Scale option value from 100 to 256
    int mg = Options[mgOpt].value<int>() * 256 / 100;
    int eg = Options[egOpt].value<int>() * 256 / 100;

    return apply_weight(make_score(mg, eg), internalWeight);
  }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl %edx, 0x14(%rsp)
movq 0x20(%rsp), %rsi
leaq 0x3de9aa(%rip), %rdi    # 0x3fd228
callq 0x28210
movq %rax, %rdi
callq 0x28300
shll $0x8, %eax
movl $0x64, %ecx
cltd
idivl %ecx
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rsi
leaq 0x3de982(%rip), %rdi    # 0x3fd228
callq 0x28210
movq %rax, %rdi
callq 0x28300
shll $0x8, %eax
movl $0x64, %ecx
cltd
idivl %ecx
movl %eax, 0xc(%rsp)
movl 0x10(%rsp), %edi
movl 0xc(%rsp), %esi
callq 0x27f40
movl %eax, %edi
movl 0x14(%rsp), %esi
callq 0x20050
addq $0x28, %rsp
retq
nop
// File: ATOMIC-LICHESS[P]ATOMKRAFT/evaluate.cpp
// Function: (anonymous namespace)::init_safety()
void init_safety() {

    const Value MaxSlope = Value(30);
    const Value Peak = Value(1280);
    Value t[100];

    // First setup the base table
    for (int i = 0; i < 100; i++)
    {
        t[i] = Value(int(0.4 * i * i));

        if (i > 0)
            t[i] = Min(t[i], t[i - 1] + MaxSlope);

        t[i] = Min(t[i], Peak);
    }

    // Then apply the weights and get the final KingDangerTable[] array
    for (Color c = WHITE; c <= BLACK; c++)
        for (int i = 0; i < 100; i++)
            KingDangerTable[c][i] = apply_weight(make_score(t[i], 0), Weights[KingDangerUs + c]);
    
  }

// Assembly:
subq $0x1b8, %rsp            # imm = 0x1B8
movl $0x1e, 0x1b4(%rsp)
movl $0x500, 0x1b0(%rsp) # imm = 0x500
movl $0x0, 0x1c(%rsp)
cmpl $0x64, 0x1c(%rsp)
jge 0x1e9eb
cvtsi2sdl 0x1c(%rsp), %xmm1
movsd 0x3b43a(%rip), %xmm0    # 0x59d58
mulsd %xmm1, %xmm0
cvtsi2sdl 0x1c(%rsp), %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movslq 0x1c(%rsp), %rax
movl %ecx, 0x20(%rsp,%rax,4)
cmpl $0x0, 0x1c(%rsp)
jle 0x1e9a5
movslq 0x1c(%rsp), %rax
movl 0x20(%rsp,%rax,4), %eax
movl %eax, 0x10(%rsp)
movl 0x1c(%rsp), %eax
subl $0x1, %eax
cltq
movl 0x20(%rsp,%rax,4), %edi
movl $0x1e, %esi
callq 0x1b320
movl %eax, %ecx
movl 0x10(%rsp), %eax
cmpl %ecx, %eax
jge 0x1e97d
movslq 0x1c(%rsp), %rax
movl 0x20(%rsp,%rax,4), %eax
movl %eax, 0xc(%rsp)
jmp 0x1e998
movl 0x1c(%rsp), %eax
subl $0x1, %eax
cltq
movl 0x20(%rsp,%rax,4), %edi
movl $0x1e, %esi
callq 0x1b320
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %ecx
movslq 0x1c(%rsp), %rax
movl %ecx, 0x20(%rsp,%rax,4)
movslq 0x1c(%rsp), %rax
cmpl $0x500, 0x20(%rsp,%rax,4) # imm = 0x500
jge 0x1e9c3
movslq 0x1c(%rsp), %rax
movl 0x20(%rsp,%rax,4), %eax
movl %eax, 0x8(%rsp)
jmp 0x1e9ce
movl $0x500, %eax            # imm = 0x500
movl %eax, 0x8(%rsp)
jmp 0x1e9ce
movl 0x8(%rsp), %ecx
movslq 0x1c(%rsp), %rax
movl %ecx, 0x20(%rsp,%rax,4)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x1e905
movl $0x0, 0x18(%rsp)
cmpl $0x1, 0x18(%rsp)
jg 0x1ea6f
movl $0x0, 0x14(%rsp)
cmpl $0x64, 0x14(%rsp)
jge 0x1ea5f
movslq 0x14(%rsp), %rax
movl 0x20(%rsp,%rax,4), %edi
xorl %esi, %esi
callq 0x27f40
movl %eax, %edi
movl 0x18(%rsp), %eax
addl $0x3, %eax
movslq %eax, %rcx
leaq 0x3c4004(%rip), %rax    # 0x3e2a30
movl (%rax,%rcx,4), %esi
callq 0x20050
movl %eax, %edx
movl 0x18(%rsp), %eax
movl %eax, %ecx
leaq 0x3c408d(%rip), %rax    # 0x3e2ad0
shlq $0x9, %rcx
addq %rcx, %rax
movslq 0x14(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x1ea02
jmp 0x1ea61
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0xe6a0
jmp 0x1e9f3
addq $0x1b8, %rsp            # imm = 0x1B8
retq
nopw (%rax,%rax)