LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: 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:
subq $0x18, %rsp
movl $0x0, 0x14(%rsp)
cmpl $0x3f, 0x14(%rsp)
jg 0x3d742
movl $0x1, 0x10(%rsp)
cmpl $0x6, 0x10(%rsp)
jg 0x3d72f
movl 0x10(%rsp), %eax
movl %eax, %ecx
leaq 0x3a5add(%rip), %rax    # 0x3e31b0
shlq $0x8, %rcx
addq %rcx, %rax
movslq 0x14(%rsp), %rcx
movl (%rax,%rcx,4), %edi
movl 0x10(%rsp), %eax
movl %eax, %ecx
leaq 0x3a61e1(%rip), %rax    # 0x3e38d0
shlq $0x8, %rcx
addq %rcx, %rax
movslq 0x14(%rsp), %rcx
movl (%rax,%rcx,4), %esi
callq 0x27f40
movl %eax, %edx
movl 0x10(%rsp), %eax
movl %eax, %ecx
leaq 0x3accbe(%rip), %rax    # 0x3ea3d0
shlq $0x8, %rcx
addq %rcx, %rax
movslq 0x14(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0xe7f0
jmp 0x3d6bf
jmp 0x3d731
leaq 0x14(%rsp), %rdi
xorl %esi, %esi
callq 0xe5c0
jmp 0x3d6ac
movl $0x0, 0xc(%rsp)
cmpl $0x3f, 0xc(%rsp)
jg 0x3d7d9
movl $0x9, 0x8(%rsp)
cmpl $0xe, 0x8(%rsp)
jg 0x3d7c6
movl 0x8(%rsp), %eax
subl $0x8, %eax
movslq %eax, %rcx
leaq 0x3acc5b(%rip), %rax    # 0x3ea3d0
shlq $0x8, %rcx
addq %rcx, %rax
movq %rax, (%rsp)
movl 0xc(%rsp), %edi
callq 0x1b2f0
movl %eax, %ecx
movq (%rsp), %rax
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edi
callq 0x29f10
movl %eax, %edx
movl 0x8(%rsp), %eax
movl %eax, %ecx
leaq 0x3acc27(%rip), %rax    # 0x3ea3d0
shlq $0x8, %rcx
addq %rcx, %rax
movslq 0xc(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0xe7f0
jmp 0x3d75d
jmp 0x3d7c8
leaq 0xc(%rsp), %rdi
xorl %esi, %esi
callq 0xe5c0
jmp 0x3d74a
addq $0x18, %rsp
retq
nop
// File: ATOMIC-LICHESS[P]ATOMKRAFT/search.cpp
// Function: (anonymous namespace)::current_search_time(long)
int64_t current_search_time(int64_t set) {

    static int64_t searchStartTime;

    if (set)
        searchStartTime = set;

    return get_system_time() - searchStartTime;
  }

// Assembly:
pushq %rax
movq %rdi, (%rsp)
cmpq $0x0, (%rsp)
je 0x42027
movq (%rsp), %rax
movq %rax, 0x3aebf9(%rip)    # 0x3f0c20
callq 0x2c170
subq 0x3aebed(%rip), %rax    # 0x3f0c20
popq %rcx
retq
nopw %cs:(%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/search.cpp
// Function: (anonymous namespace)::wait_for_stop_or_ponderhit()
void wait_for_stop_or_ponderhit() {

    std::string command;
#ifdef UCI_VERSION
    // Wait for a command from stdin
    while (   std::getline(uci_stream, command)
           && command != "ponderhit" && command != "stop" && command != "quit") {};

    if (command != "ponderhit" && command != "stop")
        QuitRequest = true; // Must be "quit" or getline() returned false
#else
    STARTNEW
    for (;;) {
        std::getline(uci_stream, command);
        if (command != "") cout << "wait_for_stop_or_ponderhit: " << command << endl;
        uci_stream.clear();
        
        if (command == "ponderhit" || command == "stop" || command == "quit") {
        	break;
        }
        
        Sleep(20);
    }
    
    if (command != "quit") QuitRequest = true;
    
    cout << "leaving wait_for_stop_or_ponderhit" << endl;
    ENDNEW
#endif
  }

// Assembly:
subq $0x48, %rsp
leaq 0x28(%rsp), %rdi
callq 0x6730
movq 0x29f53(%rip), %rdi     # 0x6bfd8
leaq 0x28(%rsp), %rsi
callq 0x6100
movq %rax, 0x10(%rsp)
jmp 0x42096
movq 0x10(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x6670
movb %al, 0xf(%rsp)
jmp 0x420b0
movb 0xf(%rsp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xe(%rsp)
jne 0x420c1
jmp 0x42132
leaq 0x19324(%rip), %rsi     # 0x5b3ec
leaq 0x28(%rsp), %rdi
callq 0x4ee40
movb %al, 0xd(%rsp)
jmp 0x420d8
movb 0xd(%rsp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xe(%rsp)
jne 0x420e9
jmp 0x42132
leaq 0x192f1(%rip), %rsi     # 0x5b3e1
leaq 0x28(%rsp), %rdi
callq 0x4ee40
movb %al, 0xc(%rsp)
jmp 0x42100
movb 0xc(%rsp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xe(%rsp)
jne 0x42111
jmp 0x42132
leaq 0x192be(%rip), %rsi     # 0x5b3d6
leaq 0x28(%rsp), %rdi
callq 0x4ee40
movb %al, 0xb(%rsp)
jmp 0x42128
movb 0xb(%rsp), %al
movb %al, 0xe(%rsp)
jmp 0x42132
movb 0xe(%rsp), %al
testb $0x1, %al
jne 0x4213c
jmp 0x4215b
jmp 0x4207e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x6a78
jmp 0x421b3
leaq 0x1928a(%rip), %rsi     # 0x5b3ec
leaq 0x28(%rsp), %rdi
callq 0x4ee40
movb %al, 0xa(%rsp)
jmp 0x42172
movb 0xa(%rsp), %al
testb $0x1, %al
jne 0x4217c
jmp 0x421a4
leaq 0x1925e(%rip), %rsi     # 0x5b3e1
leaq 0x28(%rsp), %rdi
callq 0x4ee40
movb %al, 0x9(%rsp)
jmp 0x42193
movb 0x9(%rsp), %al
testb $0x1, %al
jne 0x4219d
jmp 0x421a4
movb $0x1, 0x3aca1e(%rip)    # 0x3eebc2
leaq 0x28(%rsp), %rdi
callq 0x6a78
addq $0x48, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x6970
nopl (%rax)
// File: 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:
subq $0x238, %rsp            # imm = 0x238
movq %rdi, 0x68(%rsp)
movq %rdi, %rax
movq %rax, 0x70(%rsp)
movq %rdi, 0x230(%rsp)
movq %rsi, 0x228(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x6340
xorl %eax, %eax
movl %eax, %edi
callq 0x42010
movq %rax, 0x78(%rsp)
jmp 0x43161
movq 0x78(%rsp), %rax
movq %rax, 0x98(%rsp)
xorl %eax, %eax
movl %eax, %edi
callq 0x42040
movq %rax, 0x60(%rsp)
jmp 0x4317e
movq 0x60(%rsp), %rax
movq %rax, 0x80(%rsp)
cmpq $0x0, 0x98(%rsp)
jle 0x431b3
imulq $0x3e8, 0x228(%rsp), %rax # imm = 0x3E8
cqto
idivq 0x98(%rsp)
movq %rax, 0x58(%rsp)
jmp 0x431bc
xorl %eax, %eax
movq %rax, 0x58(%rsp)
jmp 0x431bc
movq 0x58(%rsp), %rax
movq %rax, 0x3aba10(%rip)    # 0x3eebd8
leaq 0xb0(%rsp), %rdi
leaq 0x1825c(%rip), %rsi     # 0x5b433
callq 0x64b0
movq %rax, 0x50(%rsp)
jmp 0x431e3
movq 0x50(%rsp), %rdi
movq 0x228(%rsp), %rsi
callq 0x69e0
movq %rax, 0x48(%rsp)
jmp 0x431fc
movq 0x48(%rsp), %rdi
leaq 0x18233(%rip), %rsi     # 0x5b43b
callq 0x64b0
movq %rax, 0x40(%rsp)
jmp 0x43214
movq 0x40(%rsp), %rdi
movq 0x3ab9b8(%rip), %rsi    # 0x3eebd8
callq 0x69e0
movq %rax, 0x38(%rsp)
jmp 0x4322c
movq 0x38(%rsp), %rdi
leaq 0x181c2(%rip), %rsi     # 0x5b3fa
callq 0x64b0
movq %rax, 0x30(%rsp)
jmp 0x43244
movq 0x30(%rsp), %rdi
movq 0x98(%rsp), %rsi
callq 0x69e0
jmp 0x43258
cmpq $0x3e8, 0x98(%rsp) # imm = 0x3E8
jle 0x43333
leaq 0xb0(%rsp), %rdi
leaq 0x181c8(%rip), %rsi     # 0x5b441
callq 0x64b0
movq %rax, 0x28(%rsp)
jmp 0x43285
cmpq $0x0, 0x98(%rsp)
jle 0x432ad
imulq $0x3e8, 0x80(%rsp), %rax # imm = 0x3E8
cqto
idivq 0x98(%rsp)
movq %rax, 0x20(%rsp)
jmp 0x432b6
xorl %eax, %eax
movq %rax, 0x20(%rsp)
jmp 0x432b6
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x69e0
movq %rax, 0x18(%rsp)
jmp 0x432cc
movq 0x18(%rsp), %rdi
leaq 0x18173(%rip), %rsi     # 0x5b44b
callq 0x64b0
movq %rax, 0x10(%rsp)
jmp 0x432e4
movq 0x228(%rsp), %rsi
leaq 0x3b859d(%rip), %rdi    # 0x3fb890
callq 0x51750
movl %eax, 0xc(%rsp)
jmp 0x432fe
movl 0xc(%rsp), %esi
movq 0x10(%rsp), %rdi
callq 0x66e0
jmp 0x4330e
jmp 0x43333
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x90(%rsp)
movl %eax, 0x8c(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x6a80
jmp 0x43361
movq 0x68(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x64a0
jmp 0x43347
leaq 0xa0(%rsp), %rdi
callq 0x6a80
movq 0x70(%rsp), %rax
addq $0x238, %rsp            # imm = 0x238
retq
movq 0x90(%rsp), %rdi
callq 0x6970
nop
// File: ATOMIC-LICHESS[P]ATOMKRAFT/search.cpp
// Function: (anonymous namespace)::RootMoveList::init(Position&, Move*)
void RootMoveList::init(Position& pos, Move searchMoves[]) {

    MoveStack mlist[MAX_MOVES];
    Move* sm;

    clear();
    bestMoveChanges = 0;

    // Generate all legal moves and add them to RootMoveList
    MoveStack* last = generate<MV_LEGAL>(pos, mlist);
    for (MoveStack* cur = mlist; cur != last; cur++)
    {
    	
        // If we have a searchMoves[] list then verify cur->move
        // is in the list before to add it.
        for (sm = searchMoves; *sm && *sm != cur->move; sm++) {}

        if (searchMoves[0] && *sm != cur->move)
            continue;

        RootMove rm;
        rm.pv[0] = cur->move;
        rm.pv[1] = MOVE_NONE;
        rm.pv_score = -VALUE_INFINITE;
        push_back(rm);
    }
  }

// Assembly:
subq $0x9e8, %rsp            # imm = 0x9E8
movq %rdi, 0x9e0(%rsp)
movq %rsi, 0x9d8(%rsp)
movq %rdx, 0x9d0(%rsp)
movq 0x9e0(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x47860
movq 0x8(%rsp), %rax
movl $0x0, 0x18(%rax)
movq 0x9d8(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x30420
movq %rax, 0x1c0(%rsp)
leaq 0x1d0(%rsp), %rax
movq %rax, 0x1b8(%rsp)
movq 0x1b8(%rsp), %rax
cmpq 0x1c0(%rsp), %rax
je 0x4584b
movq 0x9d0(%rsp), %rax
movq %rax, 0x1c8(%rsp)
movq 0x1c8(%rsp), %rcx
xorl %eax, %eax
cmpl $0x0, (%rcx)
movb %al, 0x7(%rsp)
je 0x457ae
movq 0x1c8(%rsp), %rax
movl (%rax), %eax
movq 0x1b8(%rsp), %rcx
cmpl (%rcx), %eax
setne %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x457b8
jmp 0x457d0
jmp 0x457ba
movq 0x1c8(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x1c8(%rsp)
jmp 0x45780
movq 0x9d0(%rsp), %rax
cmpl $0x0, (%rax)
je 0x457f5
movq 0x1c8(%rsp), %rax
movl (%rax), %eax
movq 0x1b8(%rsp), %rcx
cmpl (%rcx), %eax
je 0x457f5
jmp 0x45832
leaq 0x10(%rsp), %rdi
callq 0x47880
movq 0x1b8(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x20(%rsp)
movl $0x0, 0x24(%rsp)
movl $0x7531, %edi           # imm = 0x7531
callq 0x1b2b0
movq 0x8(%rsp), %rdi
movl %eax, 0x18(%rsp)
leaq 0x10(%rsp), %rsi
callq 0x478c0
movq 0x1b8(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x1b8(%rsp)
jmp 0x4575a
addq $0x9e8, %rsp            # imm = 0x9E8
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x1e8, %rsp            # imm = 0x1E8
movq %rdi, 0x28(%rsp)
movq %rdi, %rax
movq %rax, 0x30(%rsp)
movq %rdi, 0x1e0(%rsp)
movl %esi, 0x1dc(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x6340
movl 0x1dc(%rsp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movl %eax, 0x3c(%rsp)
movl $0x64, %edi
movl $0x2, %esi
callq 0x34660
movl %eax, %esi
movl $0x7530, %edi           # imm = 0x7530
callq 0x29ca0
movl %eax, 0x40(%rsp)
jmp 0x458e0
movl 0x3c(%rsp), %eax
movl 0x40(%rsp), %ecx
cmpl %ecx, %eax
jge 0x4594a
leaq 0x60(%rsp), %rdi
leaq 0x15aae(%rip), %rsi     # 0x5b3a6
callq 0x64b0
movq %rax, 0x20(%rsp)
jmp 0x45904
movq 0x20(%rsp), %rdi
movl 0x1dc(%rsp), %eax
imull $0x64, %eax, %eax
leaq 0x26c3e(%rip), %rcx     # 0x6c558
movl (%rcx), %ecx
cltd
idivl %ecx
movl %eax, %esi
callq 0x6940
jmp 0x45928
jmp 0x459ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x6a80
jmp 0x45a17
leaq 0x60(%rsp), %rdi
leaq 0x15a54(%rip), %rsi     # 0x5b3aa
callq 0x64b0
movq %rax, 0x18(%rsp)
jmp 0x45962
cmpl $0x0, 0x1dc(%rsp)
jle 0x459a1
movl 0x1dc(%rsp), %esi
movl $0x7530, %edi           # imm = 0x7530
callq 0x1b300
movl %eax, 0x14(%rsp)
jmp 0x45983
movl 0x14(%rsp), %edi
movl $0x1, %esi
callq 0x1b340
movl %eax, 0x10(%rsp)
jmp 0x45997
movl 0x10(%rsp), %eax
movl %eax, 0xc(%rsp)
jmp 0x459c9
movl $0x7530, %edi           # imm = 0x7530
callq 0x1b2b0
movl %eax, %edi
movl 0x1dc(%rsp), %esi
callq 0x1b300
movl %eax, 0x8(%rsp)
jmp 0x459bf
movl 0x8(%rsp), %eax
movl %eax, 0xc(%rsp)
jmp 0x459c9
movl 0xc(%rsp), %edi
movl $0x2, %esi
callq 0x281b0
movl %eax, 0x4(%rsp)
jmp 0x459dd
movl 0x4(%rsp), %esi
movq 0x18(%rsp), %rdi
callq 0x6940
jmp 0x459ed
jmp 0x459ef
movq 0x28(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x64a0
jmp 0x45a00
leaq 0x50(%rsp), %rdi
callq 0x6a80
movq 0x30(%rsp), %rax
addq $0x1e8, %rsp            # imm = 0x1E8
retq
movq 0x48(%rsp), %rdi
callq 0x6970
nopw %cs:(%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/search.cpp
// Function: (anonymous namespace)::RootMove::insert_pv_in_tt(Position&)
void RootMove::insert_pv_in_tt(Position& pos) {

    StateInfo state[PLY_MAX_PLUS_2], *st = state;
    TTEntry* tte;
    Key k;
    Value v, m = VALUE_NONE;
    int ply = 0;
    NEW bool expl_threat = false;

    assert(pv[0] != MOVE_NONE && pos.move_is_legal(pv[0]));

    do {
        k = pos.get_key();
        tte = TT.probe(k);

        // Don't overwrite existing correct entries
        if (!tte || tte->move() != pv[ply])
        {
        	NEW assert(pos.piece_count(pos.side_to_move(), KING));
        	NEW assert(pos.is_ok());
            v = (pos.in_check() ? VALUE_NONE : evaluate(pos, m, &expl_threat));
            TT.store(k, VALUE_NONE, VALUE_TYPE_NONE, DEPTH_NONE, pv[ply], v, m);
        }
        pos.do_move(pv[ply], *st++);

    } while (pv[++ply] != MOVE_NONE);

    do pos.undo_move(pv[--ply]); while (ply);
  }

// Assembly:
subq $0x4028, %rsp           # imm = 0x4028
movq %rdi, 0x4020(%rsp)
movq %rsi, 0x4018(%rsp)
movq 0x4020(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x50(%rsp), %rax
movq %rax, 0x48(%rsp)
movl $0x7532, 0x30(%rsp)     # imm = 0x7532
movl $0x0, 0x2c(%rsp)
movb $0x0, 0x2b(%rsp)
movq 0x4018(%rsp), %rdi
callq 0x4ea00
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rsi
leaq 0x3b484f(%rip), %rdi    # 0x3fb890
callq 0x516c0
movq %rax, 0x40(%rsp)
cmpq $0x0, 0x40(%rsp)
je 0x4706d
movq 0x40(%rsp), %rdi
callq 0x4ea20
movq 0x20(%rsp), %rcx
movslq 0x2c(%rsp), %rdx
cmpl 0x10(%rcx,%rdx,4), %eax
je 0x470ec
movq 0x4018(%rsp), %rdi
callq 0x2e600
testb $0x1, %al
jne 0x47080
jmp 0x4708b
movl $0x7532, %eax           # imm = 0x7532
movl %eax, 0x1c(%rsp)
jmp 0x470a6
movq 0x4018(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x2b(%rsp), %rdx
callq 0x1d800
movl %eax, 0x1c(%rsp)
movq 0x20(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %ecx, 0x34(%rsp)
movq 0x38(%rsp), %rsi
movslq 0x2c(%rsp), %rcx
movl 0x10(%rax,%rcx,4), %r9d
movl 0x34(%rsp), %r10d
movl 0x30(%rsp), %eax
leaq 0x3b47be(%rip), %rdi    # 0x3fb890
movl $0x7532, %edx           # imm = 0x7532
xorl %ecx, %ecx
movl $0xffffff02, %r8d       # imm = 0xFFFFFF02
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x514b0
movq 0x20(%rsp), %rax
movq 0x4018(%rsp), %rdi
movslq 0x2c(%rsp), %rcx
movl 0x10(%rax,%rcx,4), %esi
movq 0x48(%rsp), %rdx
movq %rdx, %rax
addq $0xa0, %rax
movq %rax, 0x48(%rsp)
callq 0x3a390
movq 0x20(%rsp), %rax
movl 0x2c(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rsp)
movslq %ecx, %rcx
cmpl $0x0, 0x10(%rax,%rcx,4)
jne 0x47023
jmp 0x4713a
movq 0x20(%rsp), %rax
movq 0x4018(%rsp), %rdi
movl 0x2c(%rsp), %ecx
addl $-0x1, %ecx
movl %ecx, 0x2c(%rsp)
movslq %ecx, %rcx
movl 0x10(%rax,%rcx,4), %esi
callq 0x3c620
cmpl $0x0, 0x2c(%rsp)
jne 0x4713a
addq $0x4028, %rsp           # imm = 0x4028
retq
nopl (%rax)
// File: 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, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x28(%rsp)
movq -0x10(%rsp), %rcx
addq $0x10, %rcx
movq %rcx, -0x18(%rsp)
addq $0x10, %rax
movq %rax, -0x20(%rsp)
movq -0x18(%rsp), %rax
movl (%rax), %ecx
movq -0x20(%rsp), %rax
movq %rax, %rdx
addq $0x4, %rdx
movq %rdx, -0x20(%rsp)
movl %ecx, (%rax)
movq -0x18(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x18(%rsp)
cmpl $0x0, (%rax)
jne 0x47deb
movq -0x28(%rsp), %rax
movq -0x10(%rsp), %rcx
movq (%rcx), %rcx
movq %rcx, (%rax)
movq -0x10(%rsp), %rcx
movl 0x8(%rcx), %ecx
movl %ecx, 0x8(%rax)
movq -0x10(%rsp), %rcx
movl 0xc(%rcx), %ecx
movl %ecx, 0xc(%rax)
retq
nopw %cs:(%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/search.cpp
// Function: (anonymous namespace)::refine_eval(TTEntry const*, Value, int)
Value refine_eval(const TTEntry* tte, Value defaultEval, int ply) {

      assert(tte);

      Value v = value_from_tt(tte->value(), ply);

      if (   ((tte->type() & VALUE_TYPE_LOWER) && v >= defaultEval)
          || ((tte->type() & VALUE_TYPE_UPPER) && v < defaultEval))
          return v;

      return defaultEval;
  }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movl %esi, 0x14(%rsp)
movl %edx, 0x10(%rsp)
movq 0x18(%rsp), %rdi
callq 0x4ea80
movl %eax, %edi
movl 0x10(%rsp), %esi
callq 0x48f80
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rdi
callq 0x4eac0
andl $0x2, %eax
cmpl $0x0, %eax
je 0x48a06
movl 0xc(%rsp), %eax
cmpl 0x14(%rsp), %eax
jge 0x48a22
movq 0x18(%rsp), %rdi
callq 0x4eac0
andl $0x1, %eax
cmpl $0x0, %eax
je 0x48a2c
movl 0xc(%rsp), %eax
cmpl 0x14(%rsp), %eax
jge 0x48a2c
movl 0xc(%rsp), %eax
movl %eax, 0x24(%rsp)
jmp 0x48a34
movl 0x14(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movl %edx, 0x18(%rsp)
movl %ecx, 0x14(%rsp)
cmpl $0x41, 0x1c(%rsp)
je 0x48ae8
cmpl $0x7532, 0x18(%rsp)     # imm = 0x7532
je 0x48ae8
cmpl $0x7532, 0x14(%rsp)     # imm = 0x7532
je 0x48ae8
movq 0x20(%rsp), %rdi
callq 0x4ead0
cmpl $0x0, %eax
jne 0x48ae8
movl 0x1c(%rsp), %edi
callq 0x3e710
testb $0x1, %al
jne 0x48ae8
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movl 0x1c(%rsp), %edi
callq 0xf690
movq (%rsp), %rdi
movl %eax, %esi
callq 0xf530
movl %eax, 0xc(%rsp)
movl 0x1c(%rsp), %edi
callq 0xf690
movl %eax, 0x10(%rsp)
movl 0x18(%rsp), %edi
movl 0x14(%rsp), %esi
callq 0x1b320
movl %eax, %edi
callq 0x1b2b0
movl 0xc(%rsp), %esi
movl 0x10(%rsp), %edx
movl %eax, %ecx
leaq 0x3a610d(%rip), %rdi    # 0x3eebf0
callq 0x4eaf0
addq $0x28, %rsp
retq
nopl (%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/search.cpp
// Function: (anonymous namespace)::MovePickerExt<false, true>::MovePickerExt(Position const&, Move, Depth, History const&, SearchStack*, Value)
MovePickerExt<false, true>::MovePickerExt(const Position& p, Move ttm, Depth d,
                                            const History& h, SearchStack* ss, Value b)
                            : MovePicker(p, ttm, d, h, ss, b), firstCall(true) {
    Move move;
    Value score = VALUE_ZERO;

    // Score root moves using standard ordering used in main search, the moves
    // are scored according to the order in which they are returned by MovePicker.
    // This is the second order score that is used to compare the moves when
    // the first orders pv_score of both moves are equal.
    while ((move = MovePicker::get_next_move()) != MOVE_NONE)
        for (rm = Rml.begin(); rm != Rml.end(); ++rm)
            if (rm->pv[0] == move)
            {
                rm->non_pv_score = score--;
                break;
            }

    Rml.sort();
    rm = Rml.begin();
  }

// Assembly:
subq $0x68, %rsp
movl 0x70(%rsp), %eax
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movl %edx, 0x54(%rsp)
movl %ecx, 0x50(%rsp)
movq %r8, 0x48(%rsp)
movq %r9, 0x40(%rsp)
movq 0x60(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movq 0x58(%rsp), %rsi
movl 0x54(%rsp), %edx
movl 0x50(%rsp), %ecx
movq 0x48(%rsp), %r8
movq 0x40(%rsp), %r9
movl 0x70(%rsp), %eax
movl %eax, (%rsp)
callq 0x33b50
movq 0x18(%rsp), %rdi
addq $0x868, %rdi            # imm = 0x868
callq 0x4b310
movq 0x18(%rsp), %rax
movb $0x1, 0x870(%rax)
movl $0x0, 0x38(%rsp)
movq 0x18(%rsp), %rdi
callq 0x342e0
movl %eax, 0x3c(%rsp)
cmpl $0x0, %eax
je 0x48ca9
leaq 0x3a2aa4(%rip), %rdi    # 0x3eb698
callq 0x47f90
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x30(%rsp)
movq 0x30(%rsp), %rcx
movq %rcx, 0x868(%rax)
movq 0x18(%rsp), %rax
addq $0x868, %rax            # imm = 0x868
movq %rax, 0x10(%rsp)
leaq 0x3a2a6f(%rip), %rdi    # 0x3eb698
callq 0x47d30
movq 0x10(%rsp), %rdi
movq %rax, 0x28(%rsp)
leaq 0x28(%rsp), %rsi
callq 0x4b330
testb $0x1, %al
jne 0x48c48
jmp 0x48ca4
movq 0x18(%rsp), %rdi
addq $0x868, %rdi            # imm = 0x868
callq 0x490e0
movl 0x10(%rax), %eax
cmpl 0x3c(%rsp), %eax
jne 0x48c8c
leaq 0x38(%rsp), %rdi
xorl %esi, %esi
callq 0x4ec20
movq 0x18(%rsp), %rdi
movl %eax, 0xc(%rsp)
addq $0x868, %rdi            # imm = 0x868
callq 0x490e0
movl 0xc(%rsp), %ecx
movl %ecx, 0xc(%rax)
jmp 0x48ca4
jmp 0x48c8e
movq 0x18(%rsp), %rdi
addq $0x868, %rdi            # imm = 0x868
callq 0x4b370
jmp 0x48c12
jmp 0x48bd6
leaq 0x3a29e8(%rip), %rdi    # 0x3eb698
callq 0x4b390
leaq 0x3a29dc(%rip), %rdi    # 0x3eb698
callq 0x47f90
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x20(%rsp)
movq 0x20(%rsp), %rcx
movq %rcx, 0x868(%rax)
addq $0x68, %rsp
retq
nop
// File: ATOMIC-LICHESS[P]ATOMKRAFT/search.cpp
// Function: (anonymous namespace)::MovePickerExt<false, true>::get_next_move()
Move MovePickerExt<false, true>::get_next_move() {

    if (!firstCall)
        ++rm;
    else
        firstCall = false;

    return rm != Rml.end() ? rm->pv[0] : MOVE_NONE;
  }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
testb $0x1, 0x870(%rax)
jne 0x48d0f
movq 0x10(%rsp), %rdi
addq $0x868, %rdi            # imm = 0x868
callq 0x4b370
jmp 0x48d1b
movq 0x10(%rsp), %rax
movb $0x0, 0x870(%rax)
movq 0x10(%rsp), %rax
addq $0x868, %rax            # imm = 0x868
movq %rax, 0x8(%rsp)
leaq 0x3a2966(%rip), %rdi    # 0x3eb698
callq 0x47d30
movq 0x8(%rsp), %rdi
movq %rax, 0x18(%rsp)
leaq 0x18(%rsp), %rsi
callq 0x4b330
testb $0x1, %al
jne 0x48d51
jmp 0x48d6b
movq 0x10(%rsp), %rdi
addq $0x868, %rdi            # imm = 0x868
callq 0x490e0
movl 0x10(%rax), %eax
movl %eax, 0x4(%rsp)
jmp 0x48d73
xorl %eax, %eax
movl %eax, 0x4(%rsp)
jmp 0x48d73
movl 0x4(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/search.cpp
// Function: (anonymous namespace)::value_from_tt(Value, int)
Value value_from_tt(Value v, int ply) {

    if (v >= VALUE_MATE_IN_PLY_MAX)
      return v - ply;

    if (v <= VALUE_MATED_IN_PLY_MAX)
      return v + ply;

    return v;
  }

// Assembly:
subq $0x18, %rsp
movl %edi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
cmpl $0x74cc, 0x10(%rsp)     # imm = 0x74CC
jl 0x48fa9
movl 0x10(%rsp), %edi
movl 0xc(%rsp), %esi
callq 0x29ca0
movl %eax, 0x14(%rsp)
jmp 0x48fce
cmpl $0xffff8b34, 0x10(%rsp) # imm = 0xFFFF8B34
jg 0x48fc6
movl 0x10(%rsp), %edi
movl 0xc(%rsp), %esi
callq 0x1b340
movl %eax, 0x14(%rsp)
jmp 0x48fce
movl 0x10(%rsp), %eax
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/search.cpp
// Function: (anonymous namespace)::value_to_tt(Value, int)
Value value_to_tt(Value v, int ply) {

    if (v >= VALUE_MATE_IN_PLY_MAX)
      return v + ply;

    if (v <= VALUE_MATED_IN_PLY_MAX)
      return v - ply;

    return v;
  }

// Assembly:
subq $0x18, %rsp
movl %edi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
cmpl $0x74cc, 0x10(%rsp)     # imm = 0x74CC
jl 0x493e9
movl 0x10(%rsp), %edi
movl 0xc(%rsp), %esi
callq 0x1b340
movl %eax, 0x14(%rsp)
jmp 0x4940e
cmpl $0xffff8b34, 0x10(%rsp) # imm = 0xFFFF8B34
jg 0x49406
movl 0x10(%rsp), %edi
movl 0xc(%rsp), %esi
callq 0x29ca0
movl %eax, 0x14(%rsp)
jmp 0x4940e
movl 0x10(%rsp), %eax
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movl %edx, 0x38(%rsp)
movq %rcx, 0x30(%rsp)
movl %r8d, 0x2c(%rsp)
movl 0x38(%rsp), %eax
imull 0x38(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0x3c(%rsp), %edi
callq 0xf680
movq 0x10(%rsp), %rdi
movl %eax, %esi
callq 0xf530
movl %eax, 0x1c(%rsp)
movl 0x3c(%rsp), %edi
callq 0xf690
movl 0x1c(%rsp), %esi
movl %eax, %edx
movl 0x24(%rsp), %ecx
leaq 0x3a576b(%rip), %rdi    # 0x3eebf0
callq 0x4eda0
movl $0x0, 0x20(%rsp)
movl 0x20(%rsp), %eax
movl 0x2c(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x4950c
movq 0x30(%rsp), %rax
movslq 0x20(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x28(%rsp)
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movl 0x28(%rsp), %edi
callq 0xf680
movq (%rsp), %rdi
movl %eax, %esi
callq 0xf530
movl %eax, 0x8(%rsp)
movl 0x28(%rsp), %edi
callq 0xf690
movl %eax, 0xc(%rsp)
movl 0x24(%rsp), %edi
callq 0x1b2b0
movl 0x8(%rsp), %esi
movl 0xc(%rsp), %edx
movl %eax, %ecx
leaq 0x3a56f6(%rip), %rdi    # 0x3eebf0
callq 0x4eda0
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x49492
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/search.cpp
// Function: (anonymous namespace)::ok_to_use_TT(TTEntry const*, Depth, Value, int)
bool ok_to_use_TT(const TTEntry* tte, Depth depth, Value beta, int ply) {

    Value v = value_from_tt(tte->value(), ply);

    return   (   tte->depth() >= depth
              || v >= Max(VALUE_MATE_IN_PLY_MAX, beta)
              || v < Min(VALUE_MATED_IN_PLY_MAX, beta))

          && (   ((tte->type() & VALUE_TYPE_LOWER) && v >= beta)
              || ((tte->type() & VALUE_TYPE_UPPER) && v < beta));
  }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movl %edx, 0x28(%rsp)
movl %ecx, 0x24(%rsp)
movq 0x30(%rsp), %rdi
callq 0x4ea80
movl %eax, %edi
movl 0x24(%rsp), %esi
callq 0x48f80
movl %eax, 0x20(%rsp)
movq 0x30(%rsp), %rdi
callq 0x4ebb0
cmpl 0x2c(%rsp), %eax
jge 0x4b23a
movl 0x20(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl $0x74cc, %eax           # imm = 0x74CC
cmpl 0x28(%rsp), %eax
jge 0x4b1eb
movl 0x28(%rsp), %eax
movl %eax, 0x18(%rsp)
jmp 0x4b1f6
movl $0x74cc, %eax           # imm = 0x74CC
movl %eax, 0x18(%rsp)
jmp 0x4b1f6
movl 0x1c(%rsp), %eax
movl 0x18(%rsp), %ecx
cmpl %ecx, %eax
jge 0x4b23a
movl 0x20(%rsp), %eax
movl %eax, 0x14(%rsp)
movl $0xffff8b34, %eax       # imm = 0xFFFF8B34
cmpl 0x28(%rsp), %eax
jge 0x4b220
movl $0xffff8b34, %eax       # imm = 0xFFFF8B34
movl %eax, 0x10(%rsp)
jmp 0x4b228
movl 0x28(%rsp), %eax
movl %eax, 0x10(%rsp)
movl 0x14(%rsp), %ecx
movl 0x10(%rsp), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, 0xf(%rsp)
jge 0x4b295
movq 0x30(%rsp), %rdi
callq 0x4eac0
andl $0x2, %eax
cmpl $0x0, %eax
je 0x4b25c
movl 0x20(%rsp), %ecx
movb $0x1, %al
cmpl 0x28(%rsp), %ecx
movb %al, 0xe(%rsp)
jge 0x4b28d
movq 0x30(%rsp), %rdi
callq 0x4eac0
movl %eax, %ecx
andl $0x1, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0xd(%rsp)
je 0x4b285
movl 0x20(%rsp), %eax
cmpl 0x28(%rsp), %eax
setl %al
movb %al, 0xd(%rsp)
movb 0xd(%rsp), %al
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
retq
// File: ATOMIC-LICHESS[P]ATOMKRAFT/search.cpp
// Function: (anonymous namespace)::connected_threat(Position const&, Move, Move)
bool connected_threat(const Position& pos, Move m, Move threat) {

    assert(move_is_ok(m));
    assert(threat && move_is_ok(threat));
    assert(!pos.move_gives_check(m));
    assert(!pos.move_is_capture_or_promotion(m));
    assert(!pos.move_is_passed_pawn_push(m));

    Square mfrom, mto, tfrom, tto;

    mfrom = move_from(m);
    mto = move_to(m);
    tfrom = move_from(threat);
    tto = move_to(threat);

    // Case 1: Don't prune moves which move the threatened piece
    if (mfrom == tto)
        return true;
    
    NEW // there is no "piece-defending" in atomic
    STARTOLD
    // Case 2: If the threatened piece has value less than or equal to the
    // value of the threatening piece, don't prune moves which defend it.
    if (   pos.move_is_capture(threat)
        && (   pos.midgame_value_of_piece_on(tfrom) >= pos.midgame_value_of_piece_on(tto)
            || pos.type_of_piece_on(tfrom) == KING)
        && pos.move_attacks_square(m, tto))
        return true;
    ENDOLD

    // Case 3: If the moving piece in the threatened move is a slider, don't
    // prune safe moves which block its ray.
    if (   piece_is_slider(pos.piece_on(tfrom))
        && bit_is_set(squares_between(tfrom, tto), mto)
        && pos.see_sign(m) >= 0)
        return true;

    return false;
  }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movl %esi, 0x14(%rsp)
movl %edx, 0x10(%rsp)
movl 0x14(%rsp), %edi
callq 0xf680
movl %eax, 0xc(%rsp)
movl 0x14(%rsp), %edi
callq 0xf690
movl %eax, 0x8(%rsp)
movl 0x10(%rsp), %edi
callq 0xf680
movl %eax, 0x4(%rsp)
movl 0x10(%rsp), %edi
callq 0xf690
movl %eax, (%rsp)
movl 0xc(%rsp), %eax
cmpl (%rsp), %eax
jne 0x4e584
movb $0x1, 0x27(%rsp)
jmp 0x4e5dc
movq 0x18(%rsp), %rdi
movl 0x4(%rsp), %esi
callq 0xf530
movl %eax, %edi
callq 0x4e680
testb $0x1, %al
jne 0x4e59f
jmp 0x4e5d7
movl 0x4(%rsp), %edi
movl (%rsp), %esi
callq 0x339d0
movq %rax, %rdi
movl 0x8(%rsp), %esi
callq 0xd760
cmpq $0x0, %rax
je 0x4e5d7
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
callq 0x3d470
cmpl $0x0, %eax
jl 0x4e5d7
movb $0x1, 0x27(%rsp)
jmp 0x4e5dc
movb $0x0, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x8e8, %rsp            # imm = 0x8E8
movq %rdi, 0x8d8(%rsp)
movl %esi, 0x8d4(%rsp)
movl %edx, 0x8d0(%rsp)
movl %ecx, 0x8cc(%rsp)
cmpl $0x0, 0x8cc(%rsp)
jne 0x4f137
movq 0x8d8(%rsp), %rdi
callq 0x4f310
movl %eax, 0x8e4(%rsp)
jmp 0x4f2f4
movb $0x1, 0x8cb(%rsp)
movq 0x8d8(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x30420
movq %rax, 0x10(%rsp)
leaq 0xc0(%rsp), %rax
cmpq 0x10(%rsp), %rax
jne 0x4f178
movl $0xfffe7960, 0x8e4(%rsp) # imm = 0xFFFE7960
jmp 0x4f2f4
leaq 0xc0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0x4f2e6
movq 0x8(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x1c(%rsp)
movq 0x8d8(%rsp), %rdi
movl 0x1c(%rsp), %esi
leaq 0x20(%rsp), %rdx
callq 0x3a390
testb $0x1, 0x8cb(%rsp)
je 0x4f1fb
movq 0x8d8(%rsp), %rdi
xorl %esi, %esi
subl 0x8d0(%rsp), %esi
xorl %edx, %edx
subl 0x8d4(%rsp), %edx
movl 0x8cc(%rsp), %ecx
subl $0x1, %ecx
callq 0x4f0f0
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, 0x8c4(%rsp)
jmp 0x4f27c
movq 0x8d8(%rsp), %rdi
xorl %esi, %esi
subl 0x8d4(%rsp), %esi
subl $0x1, %esi
xorl %edx, %edx
subl 0x8d4(%rsp), %edx
movl 0x8cc(%rsp), %ecx
subl $0x1, %ecx
callq 0x4f0f0
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, 0x8c4(%rsp)
movl 0x8c4(%rsp), %eax
cmpl 0x8d4(%rsp), %eax
jle 0x4f27a
movq 0x8d8(%rsp), %rdi
xorl %esi, %esi
subl 0x8d0(%rsp), %esi
xorl %edx, %edx
subl 0x8d4(%rsp), %edx
movl 0x8cc(%rsp), %ecx
subl $0x1, %ecx
callq 0x4f0f0
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, 0x8c4(%rsp)
jmp 0x4f27c
movq 0x8d8(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x3c620
movl 0x8c4(%rsp), %eax
cmpl 0x8d0(%rsp), %eax
jl 0x4f2ad
movl 0x8d0(%rsp), %eax
movl %eax, 0x8e4(%rsp)
jmp 0x4f2f4
movl 0x8c4(%rsp), %eax
cmpl 0x8d4(%rsp), %eax
jle 0x4f2cb
movl 0x8c4(%rsp), %eax
movl %eax, 0x8d4(%rsp)
movb $0x0, 0x8cb(%rsp)
movq 0x8(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x8(%rsp)
jmp 0x4f185
movl 0x8d4(%rsp), %eax
movl %eax, 0x8e4(%rsp)
movl 0x8e4(%rsp), %eax
addq $0x8e8, %rsp            # imm = 0x8E8
retq
nopw %cs:(%rax,%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/simple_search.cpp
// Function: test_eval(Position const&)
int test_eval(const Position& pos) {
	Color us = pos.side_to_move();
	Color them = opposite_color(us);
	return 
			pos.piece_count(us, PAWN) 		* 100 +
			pos.piece_count(us, KNIGHT) 	* 150 +
			pos.piece_count(us, BISHOP) 	* 150 +
			pos.piece_count(us, ROOK) 		* 300 +
			pos.piece_count(us, QUEEN) 		* 600 -
			pos.piece_count(them, PAWN) 	* 100 -
			pos.piece_count(them, KNIGHT) 	* 150 -
			pos.piece_count(them, BISHOP) 	* 150 -
			pos.piece_count(them, ROOK) 	* 300 -
			pos.piece_count(them, QUEEN) 	* 600;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rdi
callq 0xf5d0
movl %eax, 0x2c(%rsp)
movl 0x2c(%rsp), %edi
callq 0x122b0
movl %eax, 0x28(%rsp)
movq 0x30(%rsp), %rdi
movl 0x2c(%rsp), %esi
movl $0x1, %edx
callq 0x164c0
imull $0x64, %eax, %eax
movl %eax, 0x4(%rsp)
movq 0x30(%rsp), %rdi
movl 0x2c(%rsp), %esi
movl $0x2, %edx
callq 0x164c0
movl %eax, %ecx
movl 0x4(%rsp), %eax
imull $0x96, %ecx, %ecx
addl %ecx, %eax
movl %eax, 0x8(%rsp)
movq 0x30(%rsp), %rdi
movl 0x2c(%rsp), %esi
movl $0x3, %edx
callq 0x164c0
movl %eax, %ecx
movl 0x8(%rsp), %eax
imull $0x96, %ecx, %ecx
addl %ecx, %eax
movl %eax, 0xc(%rsp)
movq 0x30(%rsp), %rdi
movl 0x2c(%rsp), %esi
movl $0x4, %edx
callq 0x164c0
movl %eax, %ecx
movl 0xc(%rsp), %eax
imull $0x12c, %ecx, %ecx      # imm = 0x12C
addl %ecx, %eax
movl %eax, 0x10(%rsp)
movq 0x30(%rsp), %rdi
movl 0x2c(%rsp), %esi
movl $0x5, %edx
callq 0x164c0
movl %eax, %ecx
movl 0x10(%rsp), %eax
imull $0x258, %ecx, %ecx      # imm = 0x258
addl %ecx, %eax
movl %eax, 0x14(%rsp)
movq 0x30(%rsp), %rdi
movl 0x28(%rsp), %esi
movl $0x1, %edx
callq 0x164c0
movl %eax, %ecx
movl 0x14(%rsp), %eax
imull $0x64, %ecx, %ecx
subl %ecx, %eax
movl %eax, 0x18(%rsp)
movq 0x30(%rsp), %rdi
movl 0x28(%rsp), %esi
movl $0x2, %edx
callq 0x164c0
movl %eax, %ecx
movl 0x18(%rsp), %eax
imull $0x96, %ecx, %ecx
subl %ecx, %eax
movl %eax, 0x1c(%rsp)
movq 0x30(%rsp), %rdi
movl 0x28(%rsp), %esi
movl $0x3, %edx
callq 0x164c0
movl %eax, %ecx
movl 0x1c(%rsp), %eax
imull $0x96, %ecx, %ecx
subl %ecx, %eax
movl %eax, 0x20(%rsp)
movq 0x30(%rsp), %rdi
movl 0x28(%rsp), %esi
movl $0x4, %edx
callq 0x164c0
movl %eax, %ecx
movl 0x20(%rsp), %eax
imull $0x12c, %ecx, %ecx      # imm = 0x12C
subl %ecx, %eax
movl %eax, 0x24(%rsp)
movq 0x30(%rsp), %rdi
movl 0x28(%rsp), %esi
movl $0x5, %edx
callq 0x164c0
movl %eax, %ecx
movl 0x24(%rsp), %eax
imull $0x258, %ecx, %ecx      # imm = 0x258
subl %ecx, %eax
addq $0x38, %rsp
retq
nopl (%rax)
// File: ATOMIC-LICHESS[P]ATOMKRAFT/thread.cpp
// Function: Thread::cutoff_occurred() const
bool Thread::cutoff_occurred() const {

  for (SplitPoint* sp = splitPoint; sp; sp = sp->parent)
      if (sp->is_betaCutoff)
          return true;
  return false;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq -0x10(%rsp), %rax
movq 0x90(%rax), %rax
movq %rax, -0x18(%rsp)
cmpq $0x0, -0x18(%rsp)
je 0x4f542
movq -0x18(%rsp), %rax
movb 0x74(%rax), %al
testb $0x1, %al
je 0x4f531
movb $0x1, -0x1(%rsp)
jmp 0x4f547
jmp 0x4f533
movq -0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rsp)
jmp 0x4f516
movb $0x0, -0x1(%rsp)
movb -0x1(%rsp), %al
andb $0x1, %al
retq
nop
// File: ATOMIC-LICHESS[P]ATOMKRAFT/thread.cpp
// Function: Thread::is_available_to(int) const
bool Thread::is_available_to(int master) const {

  if (state != AVAILABLE)
      return false;

  // Make a local copy to be sure doesn't become zero under our feet while
  // testing next condition and so leading to an out of bound access.
  int localActiveSplitPoints = activeSplitPoints;

  // No active split points means that the thread is available as a slave for any
  // other thread otherwise apply the "helpful master" concept if possible.
  if (   !localActiveSplitPoints
      || splitPoints[localActiveSplitPoints - 1].is_slave[master])
      return true;

  return false;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movl %esi, -0x14(%rsp)
movq -0x10(%rsp), %rax
movq %rax, -0x20(%rsp)
movl 0x88(%rax), %eax
cmpl $0x2, %eax
je 0x4f575
movb $0x0, -0x1(%rsp)
jmp 0x4f5c3
movq -0x20(%rsp), %rax
movl 0x98(%rax), %eax
movl %eax, -0x18(%rsp)
cmpl $0x0, -0x18(%rsp)
je 0x4f5b7
movq -0x20(%rsp), %rax
addq $0xa0, %rax
movl -0x18(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x98, %rcx, %rcx
addq %rcx, %rax
movslq -0x14(%rsp), %rcx
movb 0x75(%rax,%rcx), %al
testb $0x1, %al
je 0x4f5be
movb $0x1, -0x1(%rsp)
jmp 0x4f5c3
movb $0x0, -0x1(%rsp)
movb -0x1(%rsp), %al
andb $0x1, %al
retq
nopw (%rax,%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movb $0x1, 0x38(%rax)
movl $0x0, 0xc(%rsp)
cmpl $0x20, 0xc(%rsp)
jge 0x4fcc6
cmpl $0x0, 0xc(%rsp)
je 0x4fc22
movq (%rsp), %rdi
addq $0x40, %rdi
movslq 0xc(%rsp), %rax
imulq $0x560, %rax, %rax      # imm = 0x560
addq %rax, %rdi
callq 0x4f4c0
movq (%rsp), %rax
addq $0x40, %rax
movslq 0xc(%rsp), %rcx
imulq $0x560, %rcx, %rcx      # imm = 0x560
addq %rcx, %rax
movl 0x88(%rax), %eax
cmpl $0x5, %eax
je 0x4fc20
jmp 0x4fbfc
jmp 0x4fc22
movq (%rsp), %rdi
addq $0x40, %rdi
movslq 0xc(%rsp), %rax
imulq $0x560, %rax, %rax      # imm = 0x560
addq %rax, %rdi
addq $0x30, %rdi
callq 0x65e0
movq (%rsp), %rdi
addq $0x40, %rdi
movslq 0xc(%rsp), %rax
imulq $0x560, %rax, %rax      # imm = 0x560
addq %rax, %rdi
addq $0x58, %rdi
callq 0x6a30
movl $0x0, 0x8(%rsp)
cmpl $0x8, 0x8(%rsp)
jge 0x4fcb4
movq (%rsp), %rdi
addq $0x40, %rdi
movslq 0xc(%rsp), %rax
imulq $0x560, %rax, %rax      # imm = 0x560
addq %rax, %rdi
addq $0xa0, %rdi
movslq 0x8(%rsp), %rax
imulq $0x98, %rax, %rax
addq %rax, %rdi
addq $0x38, %rdi
callq 0x65e0
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x4fc6a
jmp 0x4fcb6
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x4fbce
movq (%rsp), %rdi
callq 0x65e0
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movl %esi, 0x14(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movq 0x8(%rsp), %rcx
movl 0x10(%rsp), %eax
cmpl 0x34(%rcx), %eax
jge 0x4fd54
movl 0x10(%rsp), %eax
cmpl 0x14(%rsp), %eax
je 0x4fd45
movq 0x8(%rsp), %rdi
addq $0x40, %rdi
movslq 0x10(%rsp), %rax
imulq $0x560, %rax, %rax      # imm = 0x560
addq %rax, %rdi
movl 0x14(%rsp), %esi
callq 0x4f550
testb $0x1, %al
jne 0x4fd3e
jmp 0x4fd45
movb $0x1, 0x27(%rsp)
jmp 0x4fd59
jmp 0x4fd47
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x4fcff
movb $0x0, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: ATOMIC-LICHESS[P]ATOMKRAFT/timeman.cpp
// Function: int (anonymous namespace)::remaining<((anonymous namespace)::TimeType)0>(int, int, int)
int remaining(int myTime, int movesToGo, int currentPly)
  {
    const float TMaxRatio   = (T == OptimumTime ? 1 : MaxRatio);
    const float TStealRatio = (T == OptimumTime ? 0 : StealRatio);

    int thisMoveImportance = move_importance(currentPly);
    int otherMovesImportance = 0;

    for (int i = 1; i < movesToGo; i++)
        otherMovesImportance += move_importance(currentPly + 2 * i);

    float ratio1 = (TMaxRatio * thisMoveImportance) / float(TMaxRatio * thisMoveImportance + otherMovesImportance);
    float ratio2 = (thisMoveImportance + TStealRatio * otherMovesImportance) / float(thisMoveImportance + otherMovesImportance);

    return int(floor(myTime * Min(ratio1, ratio2)));
  }

// Assembly:
subq $0x38, %rsp
movl %edi, 0x34(%rsp)
movl %esi, 0x30(%rsp)
movl %edx, 0x2c(%rsp)
movss 0xa500(%rip), %xmm0     # 0x5b518
movss %xmm0, 0x28(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x24(%rsp)
movl 0x2c(%rsp), %edi
callq 0x51270
movl %eax, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movl $0x1, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x30(%rsp), %eax
jge 0x51074
movl 0x2c(%rsp), %edi
movl 0x18(%rsp), %eax
shll %eax
addl %eax, %edi
callq 0x51270
addl 0x1c(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x51044
cvtsi2ssl 0x20(%rsp), %xmm1
movss 0xa496(%rip), %xmm0     # 0x5b518
mulss %xmm1, %xmm0
cvtsi2ssl 0x20(%rsp), %xmm1
cvtsi2ssl 0x1c(%rsp), %xmm2
addss %xmm2, %xmm1
divss %xmm1, %xmm0
movss %xmm0, 0x14(%rsp)
cvtsi2ssl 0x20(%rsp), %xmm1
cvtsi2ssl 0x1c(%rsp), %xmm0
xorps %xmm2, %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movl 0x20(%rsp), %eax
addl 0x1c(%rsp), %eax
cvtsi2ss %eax, %xmm1
divss %xmm1, %xmm0
movss %xmm0, 0x10(%rsp)
cvtsi2ssl 0x34(%rsp), %xmm0
movss %xmm0, 0xc(%rsp)
movss 0x14(%rsp), %xmm1
movss 0x10(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x510f8
movss 0x14(%rsp), %xmm0
movss %xmm0, 0x8(%rsp)
jmp 0x51104
movss 0x10(%rsp), %xmm0
movss %xmm0, 0x8(%rsp)
movss 0xc(%rsp), %xmm0
movss 0x8(%rsp), %xmm1
mulss %xmm1, %xmm0
callq 0x512b0
cvttss2si %xmm0, %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x20(%rsp)
movq $0x400, 0x40(%rsp)      # imm = 0x400
movq 0x40(%rsp), %rax
shlq %rax
shlq $0x6, %rax
movq 0x48(%rsp), %rcx
shlq $0x14, %rcx
cmpq %rcx, %rax
ja 0x5136a
movq 0x40(%rsp), %rax
shlq %rax
movq %rax, 0x40(%rsp)
jmp 0x51341
movq 0x20(%rsp), %rcx
movq 0x40(%rsp), %rax
cmpq (%rcx), %rax
jne 0x5137e
jmp 0x5147a
movq 0x20(%rsp), %rax
movb $0x0, 0x10(%rax)
movq 0x40(%rsp), %rcx
movq %rcx, (%rax)
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, %rax
je 0x513a8
movq 0x18(%rsp), %rdi
callq 0x66a0
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl $0x40, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, (%rsp)
movq 0x1aba9(%rip), %rsi     # 0x6bf80
callq 0x68a0
movq %rax, %rcx
movq %rcx, 0x8(%rsp)
movb $0x0, 0x2f(%rsp)
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, 0x10(%rsp)
je 0x51413
movq 0x8(%rsp), %rax
movq (%rsp), %rcx
movq %rax, 0x38(%rsp)
movq %rcx, 0x30(%rsp)
movb $0x1, 0x2f(%rsp)
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, 0x8(%rax)
cmpq $0x0, 0x8(%rax)
jne 0x51470
movq 0x1abc1(%rip), %rdi     # 0x6bff0
leaq 0x9311(%rip), %rsi      # 0x5a747
callq 0x64b0
movq %rax, %rdi
movq 0x48(%rsp), %rsi
callq 0x6120
movq %rax, %rdi
leaq 0xa92e(%rip), %rsi      # 0x5bd80
callq 0x64b0
movq %rax, %rdi
movq 0x1ab2f(%rip), %rsi     # 0x6bf90
callq 0x6520
movl $0x1, %edi
callq 0x6630
movq 0x20(%rsp), %rdi
callq 0x51480
addq $0x58, %rsp
retq
nop
// File: ATOMIC-LICHESS[P]ATOMKRAFT/tt.cpp
// Function: TranspositionTable::probe(unsigned long) const
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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rax
shrq $0x20, %rax
movl %eax, 0x1c(%rsp)
movq 0x20(%rsp), %rsi
callq 0x3e740
movq %rax, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
cmpl $0x4, 0xc(%rsp)
jge 0x51737
movq 0x10(%rsp), %rdi
callq 0x51830
cmpl 0x1c(%rsp), %eax
jne 0x5171a
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x51740
jmp 0x5171c
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x10(%rsp)
jmp 0x516f7
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rcx
movq %rcx, (%rsp)
movl $0x0, 0x14(%rsp)
movq 0x18(%rsp), %rax
xorl %edx, %edx
divq (%rcx)
movl %edx, %eax
movl %eax, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
cmpl $0x3e8, 0xc(%rsp)       # imm = 0x3E8
jae 0x517fd
movq (%rsp), %rcx
imull $0x1234567, 0x10(%rsp), %eax # imm = 0x1234567
addl $0xfedcba9, %eax        # imm = 0xFEDCBA9
movl %eax, %eax
xorl %edx, %edx
divq (%rcx)
movq (%rsp), %rax
movl %edx, %ecx
movl %ecx, 0x10(%rsp)
movq 0x8(%rax), %rdi
movl 0x10(%rsp), %eax
shlq $0x6, %rax
addq %rax, %rdi
movl 0xc(%rsp), %eax
andl $0x3, %eax
movl %eax, %eax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x518b0
movq (%rsp), %rcx
movzbl 0x10(%rcx), %ecx
cmpl %ecx, %eax
jne 0x517ee
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x517f0
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x51787
movl 0x14(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)