LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x8b8e
leaq 0x3968ac(%rip), %r14    # 0x3b0f90
xorl %r15d, %r15d
cmpq $0x2, %r15
je 0x1a72a
movq %r14, %r12
xorl %r13d, %r13d
cmpq $0x8, %r13
je 0x1a71e
xorl %ebp, %ebp
cmpq $0x40, %rbp
je 0x1a712
movq %rbx, %rdi
callq 0x8bc8
movq %rax, (%r12,%rbp,8)
incq %rbp
jmp 0x1a6fb
incq %r13
addq $0x200, %r12            # imm = 0x200
jmp 0x1a6f3
incq %r15
addq $0x1000, %r14           # imm = 0x1000
jmp 0x1a6e7
xorl %r14d, %r14d
leaq 0x8(%rsp), %rbx
leaq 0x398857(%rip), %r15    # 0x3b2f90
cmpq $0x200, %r14            # imm = 0x200
je 0x1a754
movq %rbx, %rdi
callq 0x8bc8
movq %rax, (%r14,%r15)
addq $0x8, %r14
jmp 0x1a739
xorl %r14d, %r14d
leaq 0x8(%rsp), %rbx
leaq 0x398a2d(%rip), %r15    # 0x3b3190
movq %rbx, %rdi
callq 0x8bc8
cmpq $0x80, %r14
je 0x1a77e
movq %rax, (%r14,%r15)
addq $0x8, %r14
jmp 0x1a763
movq %rax, 0x398a8b(%rip)    # 0x3b3210
leaq 0x8(%rsp), %rdi
callq 0x8bc8
movq %rax, 0x398a82(%rip)    # 0x3b3218
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x391853(%rip), %rax    # 0x3ac000
leaq 0x391f6c(%rip), %rcx    # 0x3ac720
leaq 0x398a65(%rip), %rdx    # 0x3b3220
xorl %esi, %esi
cmpq $0x40, %rsi
je 0x1a7fb
movl $0x100, %edi            # imm = 0x100
cmpq $0x700, %rdi            # imm = 0x700
je 0x1a7ea
movl (%rax,%rdi), %r8d
shll $0x10, %r8d
addl (%rcx,%rdi), %r8d
movl %r8d, (%rdx,%rdi)
addq $0x100, %rdi            # imm = 0x100
jmp 0x1a7c8
incq %rsi
addq $0x4, %rax
addq $0x4, %rcx
addq $0x4, %rdx
jmp 0x1a7bd
leaq 0x39931e(%rip), %rax    # 0x3b3b20
xorl %ecx, %ecx
leaq 0x398a15(%rip), %rdx    # 0x3b3220
cmpq $0x40, %rcx
je 0x1a84a
movl %ecx, %esi
xorq $0x38, %rsi
leaq (%rdx,%rsi,4), %rsi
addq $0x100, %rsi            # imm = 0x100
xorl %edi, %edi
cmpq $0x600, %rdi            # imm = 0x600
je 0x1a841
xorl %r8d, %r8d
subl (%rsi,%rdi), %r8d
movl %r8d, (%rax,%rdi)
addq $0x100, %rdi            # imm = 0x100
jmp 0x1a824
incq %rcx
addq $0x4, %rax
jmp 0x1a80b
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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)
movq 0x1938(%rdi), %rcx
jne 0x1ae84
movl 0x2c(%rcx), %edx
addl 0x28(%rcx), %edx
leaq 0x1a5da(%rip), %rsi     # 0x35458
movb $0x1, %al
cmpl (%rsi), %edx
jle 0x1aee1
movl 0x14(%rcx), %eax
cmpl $0x64, %eax
jl 0x1aea6
movq %rbx, %rdi
callq 0x1a678
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
je 0x1aee1
movq 0x1938(%rbx), %rcx
movl 0x14(%rcx), %eax
movslq 0x18(%rcx), %rsi
cmpl %eax, %esi
cmovll %esi, %eax
movl 0x1c(%rcx), %edx
cmpl %edx, %eax
cmovgel %edx, %eax
movslq %eax, %rdx
leaq (%rbx,%rsi,8), %rsi
addq $0x1078, %rsi           # imm = 0x1078
pushq $0x4
popq %rdi
cmpq %rdx, %rdi
setle %al
jg 0x1aee1
movq (%rsi), %r8
addq $0x2, %rdi
addq $-0x10, %rsi
cmpq 0x38(%rcx), %r8
jne 0x1aec8
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5280
xorl %edi, %edi
callq 0x1d821
movq %rax, %r15
xorl %edi, %edi
callq 0x1d83c
movq %rax, %r12
testq %r15, %r15
jle 0x1d9e2
imulq $0x3e8, %r14, %rax      # imm = 0x3E8
cqto
idivq %r15
jmp 0x1d9e4
xorl %eax, %eax
movq %rax, 0x39a03d(%rip)    # 0x3b7a28
leaq 0x18(%rsp), %r13
leaq 0xc924(%rip), %rsi      # 0x2a31b
movq %r13, %rdi
callq 0x53b0
movq %rax, %rdi
movq %r14, %rsi
callq 0x5380
leaq 0xc912(%rip), %rsi      # 0x2a323
movq %rax, %rdi
callq 0x53b0
movq 0x39a008(%rip), %rsi    # 0x3b7a28
movq %rax, %rdi
callq 0x5380
leaq 0xc8b3(%rip), %rsi      # 0x2a2e2
movq %rax, %rdi
callq 0x53b0
movq %rax, %rdi
movq %r15, %rsi
callq 0x5380
cmpq $0x3e9, %r15            # imm = 0x3E9
jl 0x1da9c
leaq 0xc8d7(%rip), %rsi      # 0x2a329
movq %r13, %rdi
callq 0x53b0
movq %rax, %rdi
imulq $0x3e8, %r12, %rax      # imm = 0x3E8
cqto
idivq %r15
movq %rax, %rsi
callq 0x5380
leaq 0xc8bb(%rip), %rsi      # 0x2a333
movq %rax, %rdi
callq 0x53b0
movq %rax, %r15
leaq 0x3a6c56(%rip), %rdi    # 0x3c46e0
movq %r14, %rsi
callq 0x22b42
movl %eax, %esi
movq %r15, %rdi
callq 0x5260
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x5670
leaq 0x8(%rsp), %rdi
callq 0x5860
movq %rbx, %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x1dac9
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5860
movq %rbx, %rdi
callq 0x5780
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x188, %rsp            # imm = 0x188
movl %esi, %ebp
movq %rdi, %rbx
movq %rsp, %rdi
callq 0x5280
movl %ebp, %eax
negl %eax
cmovsl %ebp, %eax
leaq 0x10(%rsp), %rdi
cmpl $0x7467, %eax           # imm = 0x7467
ja 0x1e95d
leaq 0xb948(%rip), %rsi      # 0x2a28e
callq 0x53b0
movq %rax, %rdi
imull $0x64, %ebp, %eax
leaq 0x16af0(%rip), %rcx     # 0x35448
cltd
idivl (%rcx)
jmp 0x1e983
leaq 0xb92e(%rip), %rsi      # 0x2a292
callq 0x53b0
movq %rax, %rdi
testl %ebp, %ebp
movl $0x7531, %ecx           # imm = 0x7531
movl $0xffff8ad0, %eax       # imm = 0xFFFF8AD0
cmovgl %ecx, %eax
subl %ebp, %eax
pushq $0x2
popq %rcx
cltd
idivl %ecx
movl %eax, %esi
callq 0x5760
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x5670
movq %rsp, %rdi
callq 0x5860
movq %rbx, %rax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5860
movq %rbx, %rdi
callq 0x5780
// File: /workspace/github_cpp_makefile_star2_O2/ATOMIC-LICHESS[P]ATOMKRAFT/search.cpp
// Function: (anonymous namespace)::RootMove::operator=((anonymous namespace)::RootMove const&)
RootMove& RootMove::operator=(const RootMove& rm) {

    const Move* src = rm.pv;
    Move* dst = pv;

    // Avoid a costly full rm.pv[] copy
    do *dst++ = *src; while (*src++ != MOVE_NONE);

    nodes = rm.nodes;
    pv_score = rm.pv_score;
    non_pv_score = rm.non_pv_score;
    return *this;
  }

// Assembly:
movq %rdi, %rax
pushq $0x10
popq %rcx
movl (%rsi,%rcx), %edx
movl %edx, (%rax,%rcx)
addq $0x4, %rcx
testl %edx, %edx
jne 0x1eb74
movq (%rsi), %rcx
movq %rcx, (%rax)
movq 0x8(%rsi), %rcx
movq %rcx, 0x8(%rax)
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x1ef6a
movq 0x1938(%rdi), %rax
movl %esi, %r8d
andl $0xc000, %r8d           # imm = 0xC000
orl 0x30(%rax), %r8d
je 0x1ef6b
retq
andl $0x3f, %esi
shll $0x2, %esi
movl (%rdi,%rsi), %eax
addl %ecx, %edx
negl %edx
shlq $0x8, %rax
leaq 0x398abd(%rip), %rcx    # 0x3b7a40
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_O2/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 0x1f965
movq %r14, %rdi
movl %ebp, %esi
callq 0x1a668
xorl %edx, %edx
testl %eax, %eax
js 0x1f965
movl 0x394b5f(%rip), %edx    # 0x3b44c4
movl %ebp, %eax
shrl $0x4, %eax
andl $0xfc, %eax
movl (%r14,%rax), %eax
andl $0x7, %eax
cmpl $0x1, %eax
jne 0x1f9d1
movl 0x1090(%r14), %eax
movl %ebp, %ecx
andl $0x3f, %ecx
movl %ecx, %esi
shrl $0x3, %esi
imull $0x7, %eax, %edi
xorl %esi, %edi
cmpl $0x6, %edi
jne 0x1f99f
addl 0x394b38(%rip), %edx    # 0x3b44d4
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 0x1558e(%rip), %rax     # 0x34f50
testq %rsi, (%rax,%rcx,8)
jne 0x1f9d1
addl 0x394b0e(%rip), %edx    # 0x3b44dc
movb $0x1, (%rbx)
testb %r15b, %r15b
je 0x1fa12
movl %ebp, %eax
andl $0x3f, %eax
movl (%r14,%rax,4), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x1, %ecx
je 0x1fa12
testw $0xc000, %bp            # imm = 0xC000
jne 0x1fa12
movq 0x1938(%r14), %rcx
movl 0x2c(%rcx), %esi
addl 0x28(%rcx), %esi
leaq 0x39481c(%rip), %rcx    # 0x3b4220
cmpl (%rcx,%rax,4), %esi
jne 0x1fa12
addl 0x394abd(%rip), %edx    # 0x3b44cc
movb $0x1, (%rbx)
cmpl $0x2, %edx
pushq $0x2
popq %rax
cmovll %edx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x3970cd(%rip), %rax    # 0x3b7a40
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 0x20997
leaq (%r9,%rsi,4), %rsi
movl %r10d, (%rsi)
pushq %rbx
cmpl $0x2, %r8d
movl $0x1, %esi
cmovgel %r8d, %esi
decl %esi
xorl %r8d, %r8d
cmpq %r8, %rsi
je 0x209f4
movl (%rcx,%r8,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 0x209ef
leaq (%r10,%r9,4), %r9
movl %r11d, (%r9)
incq %r8
jmp 0x209aa
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/ATOMIC-LICHESS[P]ATOMKRAFT/simple_search.cpp
// Function: test_bestmove(Position&, int)
Move test_bestmove(Position& pos, int maxdepth) {
	Move bestmove = MOVE_NONE;
	

	
	
	
	MoveStack mlist[MAX_MOVES];
	StateInfo st;
	Move m;

	// Generate all legal moves
	MoveStack* last = generate<MV_LEGAL>(pos, mlist);
	
	
	for (int it_depth = 1; it_depth <= maxdepth; ++it_depth) {
	
		bool bSearchPv = true;
		int alpha = -100000;
		int beta  =  100000;
		int score = alpha;
		
		for (MoveStack* cur = mlist; cur != last; cur++) {
			m = cur->move;
			pos.do_move(m, st);
			if (bSearchPv) {
				score = -test_search(pos, -beta, -alpha, it_depth - 1);
			} else {
				score = -test_search(pos, -alpha-1, -alpha, it_depth - 1);
				if (score > alpha) // in fail-soft ... && score < beta ) is common
					score = -test_search(pos, -beta, -alpha, it_depth - 1); // re-search
			}
			pos.undo_move(m);
			
			if(score > alpha) {
				alpha = score; // alpha acts like max in MiniMax
				bestmove = m;
			}
			bSearchPv = false;
		}
		
		
		cout << it_depth << " " << move_to_uci(bestmove, 0) << " " << score << endl;
		
	}
	
	
	return bestmove;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x8f8, %rsp            # imm = 0x8F8
movl %esi, %ebx
movq %rdi, %r14
leaq 0xf0(%rsp), %rsi
callq 0x1543a
movq %rax, 0x28(%rsp)
xorl %r12d, %r12d
testl %ebx, %ebx
cmovlel %r12d, %ebx
incl %ebx
movl %ebx, 0x10(%rsp)
pushq $0x1
popq %r13
movq %r14, 0x20(%rsp)
cmpl 0x10(%rsp), %r13d
je 0x21a0b
movq %r13, 0x18(%rsp)
leal -0x1(%r13), %eax
movl %eax, 0xc(%rsp)
movl $0xfffe7960, %ebp       # imm = 0xFFFE7960
movb $0x1, %r14b
movl $0xfffe7960, %r15d      # imm = 0xFFFE7960
leaq 0xf0(%rsp), %r13
cmpq 0x28(%rsp), %r13
je 0x21997
movl %r12d, 0x14(%rsp)
movl (%r13), %ebx
movq 0x20(%rsp), %r15
movq %r15, %rdi
movl %ebx, %esi
leaq 0x50(%rsp), %rdx
callq 0x19114
movl %ebp, %r12d
negl %r12d
testb $0x1, %r14b
movq %r15, %r14
jne 0x21957
movl %ebp, %esi
notl %esi
movq %r14, %rdi
movl %r12d, %edx
movl 0xc(%rsp), %ecx
callq 0x21a35
movl %eax, %r15d
negl %r15d
cmpl %r15d, %ebp
jge 0x21971
movq %r14, %rdi
movl $0xfffe7960, %esi       # imm = 0xFFFE7960
movl %r12d, %edx
movl 0xc(%rsp), %ecx
callq 0x21a35
movl %eax, %r15d
negl %r15d
movq %r14, %rdi
movl %ebx, %esi
callq 0x1a056
cmpl %ebp, %r15d
cmovgl %r15d, %ebp
movl 0x14(%rsp), %r12d
cmovgl %ebx, %r12d
addq $0x8, %r13
xorl %r14d, %r14d
jmp 0x21902
movq 0x13602(%rip), %rdi     # 0x34fa0
movq 0x18(%rsp), %r13
movl %r13d, %esi
callq 0x5760
movq %rax, %rdi
leaq 0x6bab(%rip), %r14      # 0x28560
movq %r14, %rsi
callq 0x53b0
movq %rax, %rbx
leaq 0x30(%rsp), %rbp
movq %rbp, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x1348d
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x5340
movq %rax, %rdi
movq %r14, %rsi
callq 0x53b0
movq %rax, %rdi
movl %r15d, %esi
callq 0x5760
movq %rax, %rdi
callq 0x51d0
movq %rbp, %rdi
callq 0x5858
incl %r13d
jmp 0x218d4
movl %r12d, %eax
addq $0x8f8, %rsp            # imm = 0x8F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x5858
movq %rbx, %rdi
callq 0x5780
// File: /workspace/github_cpp_makefile_star2_O2/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, 0xc(%rsp)
movq %rdi, %r15
movl %ecx, 0x10(%rsp)
testl %ecx, %ecx
je 0x21b0e
movl %esi, %r13d
leaq 0xc0(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x1543a
movq %rax, 0x18(%rsp)
cmpq %rax, %r12
je 0x21b27
decl 0x10(%rsp)
movl 0xc(%rsp), %eax
negl %eax
movl %eax, 0x14(%rsp)
movb $0x1, %r14b
cmpq 0x18(%rsp), %r12
je 0x21b34
movl (%r12), %ebp
movq %r15, %rdi
movl %ebp, %esi
leaq 0x20(%rsp), %rdx
callq 0x19114
movl %r13d, %ebx
negl %ebx
testb $0x1, %r14b
jne 0x21ad5
movl %r13d, %esi
notl %esi
movq %r15, %rdi
movl %ebx, %edx
movl 0x10(%rsp), %ecx
callq 0x21a35
movl %eax, %r14d
negl %r14d
cmpl %r14d, %r13d
jge 0x21aed
movq %r15, %rdi
movl 0x14(%rsp), %esi
movl %ebx, %edx
movl 0x10(%rsp), %ecx
callq 0x21a35
movl %eax, %r14d
negl %r14d
movq %r15, %rdi
movl %ebp, %esi
callq 0x1a056
cmpl 0xc(%rsp), %r14d
jge 0x21b2f
cmpl %r13d, %r14d
cmovgl %r14d, %r13d
addq $0x8, %r12
xorl %r14d, %r14d
jmp 0x21a8e
movq %r15, %rdi
addq $0x8c8, %rsp            # imm = 0x8C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21b49
movl $0xfffe7960, %r13d      # imm = 0xFFFE7960
jmp 0x21b34
movl 0xc(%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_O2/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 %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0x86e5(%rip), %rsi      # 0x2a352
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x9c42
leaq 0x3a43f5(%rip), %rdi    # 0x3c6078
leaq 0x10(%rsp), %rsi
callq 0x11d0c
movq %rax, %rdi
callq 0x11e28
movl %eax, 0x2c(%rbx)
leaq 0x10(%rsp), %rdi
callq 0x5858
leaq 0x86d3(%rip), %rsi      # 0x2a37c
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x9c42
leaq 0x3a43b9(%rip), %rdi    # 0x3c6078
leaq 0x10(%rsp), %rsi
callq 0x11d0c
movq %rax, %rdi
callq 0x11e28
addl %eax, %eax
movl %eax, 0x28(%rbx)
leaq 0x10(%rsp), %rdi
callq 0x5858
leaq 0x86a9(%rip), %rsi      # 0x2a390
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x9c42
leaq 0x3a437b(%rip), %rdi    # 0x3c6078
leaq 0x10(%rsp), %rsi
callq 0x11d0c
movq %rax, %rdi
callq 0x11d78
movb %al, 0x30(%rbx)
leaq 0x10(%rsp), %rdi
callq 0x5858
leaq 0x867a(%rip), %rsi      # 0x2a39d
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x9c42
leaq 0x3a433f(%rip), %rdi    # 0x3c6078
leaq 0x10(%rsp), %rsi
callq 0x11d0c
movq %rax, %rdi
callq 0x11e28
movl %eax, 0x34(%rbx)
leaq 0x10(%rsp), %rdi
callq 0x5858
addq $0x30, %rsp
popq %rbx
retq
jmp 0x21d6f
jmp 0x21d6a
jmp 0x21d6a
jmp 0x21d6f
jmp 0x21d6a
jmp 0x21d6f
movq %rax, %rbx
jmp 0x21d7c
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x5858
movq %rbx, %rdi
callq 0x5780
// File: /workspace/github_cpp_makefile_star2_O2/ATOMIC-LICHESS[P]ATOMKRAFT/thread.cpp
// Function: ThreadsManager::init()
void ThreadsManager::init() {

  int threadID[MAX_THREADS];

  // This flag is needed to properly end the threads when program exits
  allThreadsShouldExit = false;

  // Threads will sent to sleep as soon as created, only main thread is kept alive
  activeThreads = 1;
  threads[0].state = Thread::SEARCHING;

  // Allocate pawn and material hash tables for main thread
  init_hash_tables();

  lock_init(&mpLock);

  // Initialize thread and split point locks
  for (int i = 0; i < MAX_THREADS; i++)
  {
      lock_init(&threads[i].sleepLock);
      cond_init(&threads[i].sleepCond);

      for (int j = 0; j < MAX_ACTIVE_SPLIT_POINTS; j++)
          lock_init(&(threads[i].splitPoints[j].lock));
  }

  // Create and startup all the threads but the main that is already running
  for (int i = 1; i < MAX_THREADS; i++)
  {
      threads[i].state = Thread::INITIALIZING;
      threadID[i] = i;

#if defined(_MSC_VER)
      bool ok = (CreateThread(NULL, 0, start_routine, (LPVOID)&threadID[i], 0, NULL) != NULL);
#else
      pthread_t pthreadID;
      bool ok = (pthread_create(&pthreadID, NULL, start_routine, (void*)&threadID[i]) == 0);
      pthread_detach(pthreadID);
#endif
      if (!ok)
      {
          std::cout << "Failed to create thread number " << i << std::endl;
          ::exit(EXIT_FAILURE);
      }

      // Wait until the thread has finished launching and is gone to sleep
      while (threads[i].state == Thread::INITIALIZING) {}
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
movb $0x0, 0x38(%rdi)
pushq $0x1
popq %rax
movl %eax, 0x34(%rdi)
leaq 0x40(%rdi), %r12
movl %eax, 0xc8(%rdi)
callq 0x21eba
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x55e0
cmpq $0x20, %r14
je 0x21e18
imulq $0x560, %r14, %r15      # imm = 0x560
leaq (%r12,%r15), %rdi
addq $0x30, %rdi
xorl %esi, %esi
callq 0x55e0
leaq (%r12,%r15), %rdi
addq $0x58, %rdi
xorl %esi, %esi
callq 0x54a0
movl $0x118, %r15d           # imm = 0x118
cmpq $0x5d8, %r15            # imm = 0x5D8
je 0x21e0c
leaq (%rbx,%r15), %rdi
xorl %esi, %esi
callq 0x55e0
addq $0x98, %r15
jmp 0x21def
incq %r14
addq $0x560, %rbx            # imm = 0x560
jmp 0x21dbe
pushq $0x1
popq %rbx
leaq -0x256(%rip), %r14      # 0x21bcc
leaq 0x8(%rsp), %r15
cmpq $0x20, %rbx
je 0x21e7b
imulq $0x560, %rbx, %r13      # imm = 0x560
movl $0x0, 0x88(%r12,%r13)
leaq (%rsp,%rbx,4), %rcx
addq $0x10, %rcx
movl %ebx, (%rcx)
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x57c0
movl %eax, %ebp
movq 0x8(%rsp), %rdi
callq 0x52a0
testl %ebp, %ebp
jne 0x21e8d
leaq (%r12,%r13), %rax
addq $0x88, %rax
cmpl $0x0, (%rax)
je 0x21e71
incq %rbx
jmp 0x21e27
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1310c(%rip), %rdi     # 0x34fa0
leaq 0x850a(%rip), %rsi      # 0x2a3a5
callq 0x53b0
movq %rax, %rdi
movl %ebx, %esi
callq 0x5760
movq %rax, %rdi
callq 0x51d0
pushq $0x1
popq %rdi
callq 0x54b0
// File: /workspace/github_cpp_makefile_star2_O2/ATOMIC-LICHESS[P]ATOMKRAFT/thread.cpp
// Function: ThreadsManager::exit()
void ThreadsManager::exit() {

  // Force the woken up threads to exit idle_loop() and hence terminate
  allThreadsShouldExit = true;

  for (int i = 0; i < MAX_THREADS; i++)
  {
      // Wake up all the threads and waits for termination
      if (i != 0)
      {
          threads[i].wake_up();
          while (threads[i].state != Thread::TERMINATED) {}
      }

      // Now we can safely destroy the locks and wait conditions
      lock_destroy(&threads[i].sleepLock);
      cond_destroy(&threads[i].sleepCond);

      for (int j = 0; j < MAX_ACTIVE_SPLIT_POINTS; j++)
          lock_destroy(&(threads[i].splitPoints[j].lock));
  }

  lock_destroy(&mpLock);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movb $0x1, 0x38(%rdi)
leaq 0x40(%rdi), %r15
xorl %r12d, %r12d
movq %rdi, %r13
testq %r12, %r12
je 0x21f45
cmpq $0x20, %r12
je 0x21f93
imulq $0x560, %r12, %r14      # imm = 0x560
addq %r15, %r14
movq %r14, %rdi
callq 0x21be2
movl 0x88(%r14), %eax
cmpl $0x5, %eax
jne 0x21f39
imulq $0x560, %r12, %r14      # imm = 0x560
leaq (%r15,%r14), %rdi
addq $0x30, %rdi
callq 0x5460
leaq (%r15,%r14), %rdi
addq $0x58, %rdi
callq 0x5810
movl $0x118, %r14d           # imm = 0x118
cmpq $0x5d8, %r14            # imm = 0x5D8
je 0x21f87
leaq (%r14,%r13), %rdi
callq 0x5460
addq $0x98, %r14
jmp 0x21f6c
incq %r12
addq $0x560, %r13            # imm = 0x560
jmp 0x21f1c
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x5460
// File: /workspace/github_cpp_makefile_star2_O2/ATOMIC-LICHESS[P]ATOMKRAFT/thread.cpp
// Function: ThreadsManager::available_slave_exists(int) const
bool ThreadsManager::available_slave_exists(int master) const {

  assert(master >= 0 && master < activeThreads);

  for (int i = 0; i < activeThreads; i++)
      if (i != master && threads[i].is_available_to(master))
          return true;

  return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leaq 0x40(%rdi), %r15
movl %esi, %r12d
xorl %r13d, %r13d
movslq 0x34(%r14), %rbp
cmpq %rbp, %r13
jge 0x21fe6
cmpq %r13, %r12
je 0x21fda
movq %r15, %rdi
movl %ebx, %esi
callq 0x21c2e
testb %al, %al
jne 0x21fe6
incq %r13
addq $0x560, %r15            # imm = 0x560
jmp 0x21fbe
cmpq %rbp, %r13
setl %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ATOMIC-LICHESS[P]ATOMKRAFT/tt.cpp
// Function: TranspositionTable::set_size(unsigned long)
void TranspositionTable::set_size(size_t mbSize) {

  size_t newSize = 1024;

  // Transposition table consists of clusters and each cluster consists
  // of ClusterSize number of TTEntries. Each non-empty entry contains
  // information of exactly one position and newSize is the number of
  // clusters we are going to allocate.
  while (2ULL * newSize * sizeof(TTCluster) <= (mbSize << 20))
      newSize *= 2;

  if (newSize == size)
      return;

  generation = 0;
  size = newSize;
  delete [] entries;
  entries = new (std::nothrow) TTCluster[size];
  if (!entries)
  {
      std::cerr << "Failed to allocate " << mbSize
                << " MB for transposition table." << std::endl;
      exit(EXIT_FAILURE);
  }
  clear();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rax
shlq $0x14, %rax
movl $0x400, %ecx            # imm = 0x400
movq %rcx, %r15
movq %rcx, %rdx
shlq $0x7, %rdx
addq %rcx, %rcx
cmpq %rax, %rdx
jbe 0x22961
cmpq (%r14), %r15
jne 0x2297e
popq %rbx
popq %r14
popq %r15
retq
movb $0x0, 0x10(%r14)
movq %r15, (%r14)
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x22997
callq 0x54f0
movq (%r14), %r15
movq %r15, %rax
shrq $0x3a, %rax
shlq $0x6, %r15
xorl %edi, %edi
negq %rax
sbbq %rdi, %rdi
orq %r15, %rdi
movq 0x1258c(%rip), %rsi     # 0x34f40
callq 0x56f0
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x229d9
movb $0x0, 0x10(%r14)
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x5210
movq 0x12610(%rip), %rdi     # 0x34ff0
leaq 0x6ace(%rip), %rsi      # 0x294b5
callq 0x53b0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x50f0
leaq 0x8262(%rip), %rsi      # 0x2ac60
movq %rax, %rdi
callq 0x53b0
movq %rax, %rdi
callq 0x51d0
pushq $0x1
popq %rdi
callq 0x54b0
// File: /workspace/github_cpp_makefile_star2_O2/ATOMIC-LICHESS[P]ATOMKRAFT/tt.cpp
// Function: TranspositionTable::store(unsigned long, Value, ValueType, Depth, Move, Value, Value)
TTEntry* TranspositionTable::probe(const Key posKey) const {

  uint32_t posKey32 = posKey >> 32;
  TTEntry* tte = first_entry(posKey);

  for (int i = 0; i < ClusterSize; i++, tte++)
      if (tte->key() == posKey32)
          return tte;

  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl (%rdi), %ebx
decl %ebx
andl %esi, %ebx
shrq $0x20, %rsi
shlq $0x6, %rbx
addq 0x8(%rdi), %rbx
movb 0x10(%rdi), %dil
xorl %r14d, %r14d
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
movq %rbx, %r11
cmpl $0x40, %r14d
je 0x22ac1
leaq (%rbx,%r14), %r15
movl (%r15), %eax
testl %eax, %eax
je 0x22acc
cmpl %esi, %eax
je 0x22acc
xorl %r12d, %r12d
cmpb %dil, 0x7(%r11)
sete %al
movl %ebp, %r13d
cmpb %dil, 0x7(%rbx,%r14)
je 0x22a95
xorl %r13d, %r13d
cmpb $0x3, 0x6(%rbx,%r14)
setne %r13b
leal -0x2(,%r13,2), %r13d
movb %al, %r12b
addl %r12d, %r12d
movzwl 0xa(%rbx,%r14), %eax
xorl %r10d, %r10d
cmpw 0xa(%r11), %ax
setl %r10b
addl %r13d, %r12d
orl %r10d, %r12d
jg 0x22ab8
movq %r11, %r15
addq $0x10, %r14
movq %r15, %r11
jmp 0x22a57
movl 0x40(%rsp), %eax
movl 0x38(%rsp), %r10d
jmp 0x22ae4
leaq (%rbx,%r14), %r11
testl %r9d, %r9d
movl 0x40(%rsp), %eax
movl 0x38(%rsp), %r10d
jne 0x22ae4
movzwl 0x4(%rbx,%r14), %r9d
movl %esi, (%r11)
movw %r9w, 0x4(%r11)
movb %cl, 0x6(%r11)
movb %dil, 0x7(%r11)
movw %dx, 0x8(%r11)
movw %r8w, 0xa(%r11)
movw %r10w, 0xc(%r11)
movw %ax, 0xe(%r11)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ATOMIC-LICHESS[P]ATOMKRAFT/tt.cpp
// Function: TranspositionTable::full(long) const
uint32_t TranspositionTable::full(int64_t x) const {
  uint32_t c = 0;
  uint32_t w = (uint32_t) (x % size); // size is Cluster count
  for (unsigned int k = 0; k < 1000; k++)
    {
      w = (w * 0x1234567 + 0xfedcba9) % size;
      if (entries[w].data[k%ClusterSize].generation() == generation)
        c++;
    }
  return c;
}

// Assembly:
movq %rsi, %rax
movq (%rdi), %rsi
movq 0x8(%rdi), %r8
xorl %ecx, %ecx
xorl %edx, %edx
divq %rsi
movb 0x10(%rdi), %dil
xorl %r9d, %r9d
cmpl $0x3e8, %r9d            # imm = 0x3E8
je 0x22b9c
imull $0x1234567, %edx, %eax  # imm = 0x1234567
addl $0xfedcba9, %eax        # imm = 0xFEDCBA9
xorl %edx, %edx
divq %rsi
movq %rdx, %rax
shlq $0x6, %rax
addq %r8, %rax
movl %r9d, %r10d
andl $0x3, %r10d
shll $0x4, %r10d
xorl %r11d, %r11d
cmpb %dil, 0x7(%r10,%rax)
sete %r11b
addl %r11d, %ecx
incl %r9d
jmp 0x22b5a
movl %ecx, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ATOMIC-LICHESS[P]ATOMKRAFT/tuning.cpp
// Function: VarTuning::rand_unit_vector(double*, int)
void VarTuning::rand_unit_vector(tune_t* vector, int size) {
	
	double norm;
	int64_t s = 0;
	int64_t ran;
	
	for (int k = 0; k < size; ++k) {
		ran = rkiss.rand<unsigned>() % 16777216;
		ran *= (rkiss.rand<unsigned>() % 2 ? 1 : -1);
		vector[k] = tune_t(ran);
		s += (ran * ran);
	}
	
	norm = sqrt(s);

	for (int k = 0; k < size; ++k) {
		vector[k] /= norm;
		cout << vector[k] << endl;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
addq $0x29cc8, %r15          # imm = 0x29CC8
xorl %r13d, %r13d
testl %edx, %edx
cmovlel %r13d, %ebx
xorl %ebp, %ebp
cmpq %r13, %rbx
je 0x22c26
movq %r15, %rdi
callq 0x8bc8
movq %rax, %r12
andl $0xffffff, %r12d        # imm = 0xFFFFFF
movq %r15, %rdi
callq 0x8bc8
testb $0x1, %al
jne 0x22c0f
negq %r12
cvtsi2sd %r12d, %xmm0
movsd %xmm0, (%r14,%r13,8)
imulq %r12, %r12
addq %r12, %rbp
incq %r13
jmp 0x22be9
cvtsi2sd %rbp, %xmm0
sqrtsd %xmm0, %xmm0
movsd %xmm0, (%rsp)
xorl %r12d, %r12d
movq 0x12362(%rip), %r15     # 0x34fa0
cmpq %r12, %rbx
je 0x22c69
movsd (%r14,%r12,8), %xmm0
divsd (%rsp), %xmm0
movsd %xmm0, (%r14,%r12,8)
movq %r15, %rdi
callq 0x56a0
movq %rax, %rdi
callq 0x51d0
incq %r12
jmp 0x22c3e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ATOMIC-LICHESS[P]ATOMKRAFT/tuning.cpp
// Function: VarTuning::VarTuning(int, ...)
VarTuning::VarTuning(int s, ...) {
	
	for (int k = abs(rand() % 10000); k > 0; --k) {
		rkiss.rand<unsigned>();
	}
	
	updateCount = 0;
	size = s;
	
	assert(size >= 0 && size < 100);
	
	va_list vl;
	va_start(vl, s);
	for (int k = 0; k < size; ++k) {
		var[k].valueptr = (tune_t*)va_arg(vl, double*);
		var[k].value = *var[k].valueptr;
		var[k].startvalue = *var[k].valueptr;
		var[k].deltaAxisFactor = DELTA_AXIS_FACTOR;
		var[k].sdevSum = 0.0;
		var[k].varSum = 0.0;
		var[k].applyFactor = APPLY_FACTOR;
		memset(var[k].history, 0, sizeof(tune_t) * TUNE_HISTORY_SIZE);
		var[k].historyIndex = 0;
	}
	va_end(vl);
	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x22cdd
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
leaq 0x29cc8(%rdi), %r14
movq %r14, %rdi
callq 0x8b8e
callq 0x5110
movl $0x2710, %ecx           # imm = 0x2710
cltd
idivl %ecx
movl %edx, %r15d
negl %r15d
cmovsl %edx, %r15d
testl %r15d, %r15d
jle 0x22d15
movq %r14, %rdi
callq 0x8bc8
decl %r15d
jmp 0x22d03
andl $0x0, 0x29cc4(%rbx)
movl %ebp, 0x29cc0(%rbx)
leaq 0x20(%rsp), %r14
movq %r14, 0x10(%rsp)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rcx     # imm = 0x3000000010
movq %rcx, (%rsp)
movslq 0x29cc0(%rbx), %r15
pushq $0x10
popq %rbp
xorl %r12d, %r12d
cmpq %r15, %r12
jge 0x22dc0
cmpl $0x28, %ebp
ja 0x22d6e
movq %rax, %r13
movl %ebp, %eax
addq %r14, %rax
addl $0x8, %ebp
movl %ebp, (%rsp)
jmp 0x22d77
leaq 0x8(%rax), %r13
movq %r13, 0x8(%rsp)
movq (%rax), %rax
movq %rax, (%rbx)
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rbx)
movsd %xmm0, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rbx)
movaps 0x7f07(%rip), %xmm0     # 0x2aca0
movups %xmm0, 0x28(%rbx)
leaq 0x68(%rbx), %rdi
movl $0x640, %edx            # imm = 0x640
xorl %esi, %esi
callq 0x5210
andl $0x0, 0x60(%rbx)
incq %r12
addq $0x6b0, %rbx            # imm = 0x6B0
movq %r13, %rax
jmp 0x22d54
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ATOMIC-LICHESS[P]ATOMKRAFT/tuning.cpp
// Function: VarTuning::prepare_deltas()
void VarTuning::prepare_deltas() {
	double norm;
	int64_t s = 0;
	int64_t ran;
	
	for (int k = 0; k < size; ++k) {
		ran = rkiss.rand<unsigned>() % 16777216;
		ran *= (rkiss.rand<unsigned>() % 2 ? 1 : -1);
		var[k].delta = tune_t(ran);
		s += (ran * ran);
	}
	
	norm = sqrt(s);
	
	// normalize
	for (int k = 0; k < size; ++k) {
		var[k].delta *= (var[k].startvalue * var[k].deltaAxisFactor / norm);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x29cc8(%rdi), %r14
leaq 0x18(%rdi), %r12
xorl %r13d, %r13d
xorl %ebp, %ebp
movslq 0x29cc0(%rbx), %rcx
cmpq %rcx, %r13
jge 0x22e3b
movq %r14, %rdi
callq 0x8bc8
movq %rax, %r15
andl $0xffffff, %r15d        # imm = 0xFFFFFF
movq %r14, %rdi
callq 0x8bc8
testb $0x1, %al
jne 0x22e1d
negq %r15
cvtsi2sd %r15d, %xmm0
movsd %xmm0, (%r12)
imulq %r15, %r15
addq %r15, %rbp
incq %r13
addq $0x6b0, %r12            # imm = 0x6B0
jmp 0x22df0
cvtsi2sd %rbp, %xmm0
sqrtsd %xmm0, %xmm0
xorl %eax, %eax
testl %ecx, %ecx
cmovlel %eax, %ecx
imulq $0x6b0, %rcx, %rcx      # imm = 0x6B0
cmpq %rax, %rcx
je 0x22e7b
movsd 0x10(%rbx,%rax), %xmm1
mulsd 0x28(%rbx,%rax), %xmm1
divsd %xmm0, %xmm1
mulsd 0x18(%rbx,%rax), %xmm1
movsd %xmm1, 0x18(%rbx,%rax)
addq $0x6b0, %rax            # imm = 0x6B0
jmp 0x22e52
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ATOMIC-LICHESS[P]ATOMKRAFT/ucioption.cpp
// Function: CaseInsensitiveLess::operator()(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&) const
bool CaseInsensitiveLess::operator() (const string& s1, const string& s2) const {

  int c1, c2;
  size_t i = 0;

  while (i < s1.size() && i < s2.size())
  {
      c1 = tolower(s1[i]);
      c2 = tolower(s2[i++]);

      if (c1 != c2)
          return c1 < c2;
  }
  return s1.size() < s2.size();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rsi), %r15
movq 0x8(%rsi), %rax
movq (%rdx), %r13
movq 0x8(%rdx), %r12
cmpq %r12, %rax
movq %r12, %rbp
movq %rax, (%rsp)
cmovbq %rax, %rbp
xorl %r14d, %r14d
cmpq %r14, %rbp
je 0x23cf2
movsbl (%r15,%r14), %edi
callq 0x55b0
movl %eax, %ebx
movsbl (%r13,%r14), %edi
incq %r14
callq 0x55b0
cmpl %eax, %ebx
je 0x23cca
setl %al
jmp 0x23cf9
cmpq %r12, (%rsp)
setb %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ATOMIC-LICHESS[P]ATOMKRAFT/ucioption.cpp
// Function: OptionsMap::print_all[abi:cxx11]() const
string OptionsMap::print_all() const {

  std::stringstream s;

  for (size_t i = 0; i <= size(); i++)
      for (OptionsMap::const_iterator it = begin(); it != end(); ++it)
          if (it->second.idx == i)
          {
              const UCIOption& o = it->second;
              s << "\noption name " << it->first << " type " << o.type;

              if (o.type != "button")
                  s << " default " << o.defaultValue;

              if (o.type == "spin")
                  s << " min " << o.minValue << " max " << o.maxValue;

              break;
          }
  return s.str();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x5280
leaq 0x8(%r14), %rbp
leaq 0x20(%rsp), %r15
xorl %ebx, %ebx
cmpq 0x28(%r14), %rbx
ja 0x24cf2
movq 0x18(%r14), %r12
cmpq %rbp, %r12
je 0x24cea
cmpq %rbx, 0xa8(%r12)
je 0x24c2c
movq %r12, %rdi
callq 0x5430
movq %rax, %r12
jmp 0x24c0c
movq %r15, %rdi
leaq 0x61da(%rip), %rsi      # 0x2ae10
callq 0x53b0
leaq 0x20(%r12), %rsi
movq %rax, %rdi
callq 0x5340
movq %rax, %rdi
leaq 0x61cc(%rip), %rsi      # 0x2ae1e
callq 0x53b0
leaq 0x80(%r12), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x5340
movq %r13, %rdi
leaq 0x6195(%rip), %rsi      # 0x2ae09
callq 0x21889
testb %al, %al
je 0x24c99
movq %r15, %rdi
leaq 0x619e(%rip), %rsi      # 0x2ae25
callq 0x53b0
leaq 0x40(%r12), %rsi
movq %rax, %rdi
callq 0x5340
movq %r13, %rdi
leaq 0x618c(%rip), %rsi      # 0x2ae2f
callq 0x11daf
testb %al, %al
je 0x24cea
movq %r15, %rdi
leaq 0x617e(%rip), %rsi      # 0x2ae34
callq 0x53b0
movl 0xa0(%r12), %esi
movq %rax, %rdi
callq 0x5760
movq %rax, %rdi
leaq 0x6165(%rip), %rsi      # 0x2ae3a
callq 0x53b0
movl 0xa4(%r12), %esi
movq %rax, %rdi
callq 0x5760
incq %rbx
jmp 0x24bfe
leaq 0x28(%rsp), %rsi
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x5670
leaq 0x10(%rsp), %rdi
callq 0x5860
movq %rbx, %rax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x24d25
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x5860
movq %rbx, %rdi
callq 0x5780
// File: /workspace/github_cpp_makefile_star2_O2/Distrotech[P]stund/client.cxx
// Function: usage()
void
usage()
{
   cerr << "Usage:" << endl
	<< "    ./client stunServerHostname [testNumber] [-v] [-p srcPort] [-i nicAddr1] [-i nicAddr2] [-i nicAddr3]" << endl
	<< "For example, if the STUN server was larry.gloo.net, you could do:" << endl
	<< "    ./client larry.gloo.net" << endl
	<< "The testNumber is just used for special tests." << endl
	<< " test 1 runs test 1 from the RFC. For example:" << endl
	<< "    ./client larry.gloo.net 0" << endl << endl
        << endl;
}

// Assembly:
pushq %rax
movq 0x8b9c(%rip), %rdi      # 0xaff0
leaq 0x4bcd(%rip), %rsi      # 0x7028
callq 0x21d0
movq %rax, %rdi
callq 0x20c0
leaq 0x4bc0(%rip), %rsi      # 0x702f
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x20c0
leaq 0x4c12(%rip), %rsi      # 0x7098
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x20c0
leaq 0x4c3d(%rip), %rsi      # 0x70da
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x20c0
leaq 0x4c42(%rip), %rsi      # 0x70f6
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x20c0
leaq 0x4c5a(%rip), %rsi      # 0x7125
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x20c0
leaq 0x4c72(%rip), %rsi      # 0x7154
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x20c0
movq %rax, %rdi
callq 0x20c0
movq %rax, %rdi
popq %rax
jmp 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/Distrotech[P]stund/stun.cxx
// Function: stunParseAtrAddress(char*, unsigned int, StunAtrAddress4&)
static bool 
stunParseAtrAddress( char* body, unsigned int hdrLen,  StunAtrAddress4& result )
{
   if ( hdrLen != 8 )
   {
      clog << "hdrLen wrong for Address" <<endl;
      return false;
   }
   result.pad = *body++;
   result.family = *body++;
   if (result.family == IPv4Family)
   {
      UInt16 nport;
      memcpy(&nport, body, 2); body+=2;
      result.ipv4.port = ntohs(nport);
		
      UInt32 naddr;
      memcpy(&naddr, body, 4); body+=4;
      result.ipv4.addr = ntohl(naddr);
      return true;
   }
   else if (result.family == IPv6Family)
   {
      clog << "ipv6 not supported" << endl;
   }
   else
   {
      clog << "bad address family: " << result.family << endl;
   }
	
   return false;
}

// Assembly:
pushq %rbx
cmpl $0x8, %esi
jne 0x36e2
movq %rdx, %rbx
movb (%rdi), %al
movb %al, (%rdx)
movzbl 0x1(%rdi), %eax
movb %al, 0x1(%rdx)
cmpl $0x2, %eax
je 0x36f2
cmpl $0x1, %eax
jne 0x3711
movzwl 0x2(%rdi), %eax
rolw $0x8, %ax
movw %ax, 0x4(%rbx)
movl 0x4(%rdi), %eax
bswapl %eax
movl %eax, 0x8(%rbx)
movb $0x1, %al
jmp 0x370f
movq 0x78cf(%rip), %rdi      # 0xafb8
leaq 0x4ac0(%rip), %rsi      # 0x81b0
jmp 0x3700
movq 0x78bf(%rip), %rdi      # 0xafb8
leaq 0x4ac9(%rip), %rsi      # 0x81c9
callq 0x21d0
movq %rax, %rdi
callq 0x20c0
xorl %eax, %eax
popq %rbx
retq
movq 0x78a0(%rip), %rdi      # 0xafb8
leaq 0x4abd(%rip), %rsi      # 0x81dc
callq 0x21d0
movsbl 0x1(%rbx), %esi
movq %rax, %rdi
callq 0x2200
jmp 0x3705
// File: /workspace/github_cpp_makefile_star2_O2/Distrotech[P]stund/stun.cxx
// Function: operator<<(std::ostream&, StunAddress4 const&)
ostream& 
operator<<( ostream& strm, const StunAddress4& addr)
{
   UInt32 ip = addr.addr;
   strm << ((int)(ip>>24)&0xFF) << ".";
   strm << ((int)(ip>>16)&0xFF) << ".";
   strm << ((int)(ip>> 8)&0xFF) << ".";
   strm << ((int)(ip>> 0)&0xFF) ;
	
   strm << ":" << addr.port;
	
   return strm;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl 0x4(%rsi), %ebp
movl %ebp, %esi
shrl $0x18, %esi
callq 0x22a0
leaq 0x452d(%rip), %r15      # 0x7c81
movq %rax, %rdi
movq %r15, %rsi
callq 0x21d0
movl %ebp, %esi
shrl $0x10, %esi
movl $0xff, %r12d
andl %r12d, %esi
movq %rbx, %rdi
callq 0x22a0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21d0
movl %ebp, %esi
shrl $0x8, %esi
andl %r12d, %esi
movq %rbx, %rdi
callq 0x22a0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21d0
andl %r12d, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x22a0
leaq 0x44e4(%rip), %rsi      # 0x7c93
movq %rbx, %rdi
callq 0x21d0
movzwl (%r14), %esi
movq %rax, %rdi
callq 0x2290
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Distrotech[P]stund/stun.cxx
// Function: stunParseAtrString(char*, unsigned int, StunAtrString&)
static bool 
stunParseAtrString( char* body, unsigned int hdrLen,  StunAtrString& result )
{
   if ( hdrLen >= STUN_MAX_STRING )
   {
      clog << "String is too large" << endl;
      return false;
   }
   else
   {
      if (hdrLen % 4 != 0)
      {
         clog << "Bad length string " << hdrLen << endl;
         return false;
      }
		
      result.sizeValue = hdrLen;
      memcpy(&result.value, body, hdrLen);
      result.value[hdrLen] = 0;
      return true;
   }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
cmpl $0x100, %esi            # imm = 0x100
jb 0x37f2
movq 0x77d4(%rip), %rdi      # 0xafb8
leaq 0x4a41(%rip), %rsi      # 0x822c
callq 0x21d0
jmp 0x3814
testb $0x3, %bl
je 0x3826
movq 0x77ba(%rip), %rdi      # 0xafb8
leaq 0x4a3b(%rip), %rsi      # 0x8240
callq 0x21d0
movl %ebx, %esi
movq %rax, %rdi
callq 0x2130
movq %rax, %rdi
callq 0x20c0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rdx, %r14
movq %rdi, %rsi
movw %bx, 0x100(%rdx)
movl %ebx, %ebx
movq %rdx, %rdi
movq %rbx, %rdx
callq 0x2170
movb $0x0, (%r14,%rbx)
movb $0x1, %al
jmp 0x381e
// File: /workspace/github_cpp_makefile_star2_O2/Distrotech[P]stund/stun.cxx
// Function: encodeAtrAddress4(char*, unsigned short, StunAtrAddress4 const&)
static char* 
encodeAtrAddress4(char* ptr, UInt16 type, const StunAtrAddress4& atr)
{
   ptr = encode16(ptr, type);
   ptr = encode16(ptr, 8);
   *ptr++ = atr.pad;
   *ptr++ = IPv4Family;
   ptr = encode16(ptr, atr.ipv4.port);
   ptr = encode32(ptr, atr.ipv4.addr);
	
   return ptr;
}

// Assembly:
rolw $0x8, %si
movw %si, (%rdi)
movw $0x800, 0x2(%rdi)       # imm = 0x800
movb (%rdx), %al
movb %al, 0x4(%rdi)
movb $0x1, 0x5(%rdi)
movzwl 0x4(%rdx), %eax
rolw $0x8, %ax
movw %ax, 0x6(%rdi)
movl 0x8(%rdx), %eax
bswapl %eax
movl %eax, 0x8(%rdi)
leaq 0xc(%rdi), %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/Distrotech[P]stund/stun.cxx
// Function: encodeAtrString(char*, unsigned short, StunAtrString const&)
static char* 
encodeAtrString(char* ptr, UInt16 type, const StunAtrString& atr)
{
   assert(atr.sizeValue % 4 == 0);
	
   ptr = encode16(ptr, type);
   ptr = encode16(ptr, atr.sizeValue);
   ptr = encode(ptr, atr.value, atr.sizeValue);
   return ptr;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testb $0x3, 0x100(%rdx)
jne 0x4057
movq %rdi, %rbx
rolw $0x8, %si
movw %si, (%rdi)
movzwl 0x100(%rdx), %eax
rolw $0x8, %ax
movw %ax, 0x2(%rdi)
addq $0x4, %rdi
movzwl 0x100(%rdx), %r14d
movq %rdx, %rsi
movq %r14, %rdx
callq 0x2170
leaq (%rbx,%r14), %rax
addq $0x4, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x422f(%rip), %rdi      # 0x828d
leaq 0x36e8(%rip), %rsi      # 0x774d
leaq 0x4238(%rip), %rcx      # 0x82a4
movl $0x20b, %edx            # imm = 0x20B
callq 0x2120