// File: /workspace/github_cpp_makefile_star2_O2/SethKasmann[P]clever-girl/src/search.cpp
// Function: scout_search(State&, SearchInfo&, int, int, int, int, bool, bool, bool)
int scout_search(State& s, SearchInfo& si, int depth, int ply, int alpha, int beta, bool isPv, bool isNull, bool isRoot)
{
    assert(depth >= 0);
    Move best_move = nullMove;
    
    if (si.quit || (si.nodes % 3000 == 0 && interrupt(si)))
        return 0;

    si.nodes++;

    // Evaluate leaf nodes.
    if (depth == 0)
        return qsearch(s, si, ply, alpha, beta);

    // Check for draw.
    if (!isRoot && 
        (history.isThreefoldRepetition(s) ||
        s.insufficientMaterial() || 
        s.getFiftyMoveRule() > 99))
        return Draw;

    // Get a pointer to the correction transposition table location.
    const TableEntry* table_entry = ttable.probe(s.getKey());

    // Check if table entry is valid and matches the position key.
    if (table_entry->key == s.getKey() && table_entry->depth >= depth)
    {
        if (table_entry->type == pv)             // PV Node, return the score.
            return table_entry->score;
        else if (table_entry->type == cut)       // Cut Node, adjust alpha.
        {
            if (table_entry->score >= beta)
                return beta;
        }
        else
        {
            if (table_entry->score <= alpha)
                return alpha;
        }

        best_move = table_entry->best;
    }

    // Check if we are at the PV line.
    if (lineManager.getPvKey(ply) == s.getKey())
    {
        best_move = lineManager.getPvMove(ply);
    }

// -------------------------------------------------------------------------- //
//                                                                            //
// Static Evaluation. Evaluate the current position statically if the         //
// current node is not a PV node.                                             //
//                                                                            //
// -------------------------------------------------------------------------- //
    int staticEval = 0;
    if (!isPv)
    {
        Evaluate evaluate(s);
        staticEval = evaluate.getScore();
    }

// -------------------------------------------------------------------------- //
//                                                                            //
// Reverse Futility Pruning. At pre-frontier and pre-pre-frontier, if the     //
// side to move is doing so well that the static evaluation - a futility      //
// penalty still causes a beta cutoff, return beta.                           //
//                                                                            //
// -------------------------------------------------------------------------- //
    if (!isPv && 
        !isNull &&
        !s.inCheck() &&
        depth <= 2 &&
        s.getNonPawnPieceCount(s.getOurColor()))
    {
        if (staticEval - 100 * depth >= beta)
            return beta;
    }

// -------------------------------------------------------------------------- //
//                                                                            //
// Null move pruning. Make a null move and searched to a reduced to check     //
// for fail high under the following conditions:                              //
//   1. The current node is not a PV node.                                    //
//   2. The current state is not in check.                                    //
//   3. The depth is high enough.                                             //
//   4. There are enough non pawn pieces on the board.                        //
//                                                                            //
// -------------------------------------------------------------------------- //
    if (!isPv && !isNull && !s.inCheck() && depth > NullMoveDepth 
        && s.getNonPawnPieceCount(s.getOurColor()) > NullMoveCount)
    {
        State n;
        std::memmove(&n, &s, sizeof s);
        n.makeNull();
        history.push(std::make_pair(nullMove, n.getKey()));
        int nullScore = -scout_search(n, si, depth - 3, ply + 1, -(alpha + 1), -alpha, false, true, false);
        history.pop();
        if (nullScore >= beta)
            return beta;
    }

    // Internal Iterative Deepening. If no best move was found, do a small
    // search to determine which move to search first.
    if (isPv && !isNull && !s.inCheck() && best_move == nullMove && depth > 5)
    {
        // Using depth calculation from Stockfish.
        int d = 3 * depth / 4 - 2;
        scout_search(s, si, d, ply, alpha, beta, isPv, true, false);
        table_entry = ttable.probe(s.getKey());
        if (table_entry->key == s.getKey())
            best_move = table_entry->best;
    }
    // Generate moves and create the movelist.
    MoveList mlist(s, best_move, &history, ply);

    int a = alpha;
    int b = beta;
    int d;
    int score;
    int bestScore = Neg_inf;
    Move m;
    bool first = true;
    int count = 0;

    while (m = mlist.getBestMove())
    {
        d = depth - 1;
// -------------------------------------------------------------------------- //
//                                                                            //
// Early Pruning                                                              //
//                                                                            //
// It may be possible to prune before the child move is made, under the       //
// following conditions:                                                      //
//   1. Current node is not a PV node.                                        //
//   2. Best score searched is greater than the - checkmate bound.            //
//   3. Side to move is not in check.                                         //
//   4. Move itself does not give check.                                      //
//   5. Side to move has at least 1 major or minor piece.                     //
//                                                                            //
// -------------------------------------------------------------------------- //
        if (!isPv &&
            bestScore > -CheckmateBound &&
            !s.inCheck() &&
            !s.givesCheck(m) &&
            s.getNonPawnPieceCount(s.getOurColor()))
        {
// -------------------------------------------------------------------------- //
//                                                                            //
// Futility Pruning                                                           //
//                                                                            //
// Prune quiet moves at depth 1 that will not improve alpha.                  //
//                                                                            //
// -------------------------------------------------------------------------- //
            if (depth == 1 &&
                s.isQuiet(m) &&
                !isPromotion(m) &&
                staticEval + 300 < a)
                continue;

// -------------------------------------------------------------------------- //
//                                                                            //
// Pruning based on SEE.                                                      //
//                                                                            //
// Original idea from Stockfish. If the SEE is low relative to the depth,     //
// prune the move. The calculation I'm currently using is:                    //
//   see(move) < -pawn * 2^(depth - 1)                                        //
//                                                                            //
// -------------------------------------------------------------------------- //
            if (depth < 3 &&
                s.see(m) < -Pawn_wt * (1 << (depth - 1)))
                continue;
        }

        State c(s);
        c.make_t(m);                                 // Make move.
        history.push(std::make_pair(m, c.getKey())); // Add move to gamelist.
        count++;

        if (c.inCheck() && depth == 1)
            d++;

        // Scout alrogithm. Search the first node with a full window.
        if (first)
        {
            // Set the best move to the first move just in case no move
            // improves alpha.
            best_move = m;
            score = -scout_search(c, si, d, ply + 1, -b, -a, isPv, isNull, false);
            first = false;
        }       
        else
        {
// -------------------------------------------------------------------------- //
//                                                                            //
// Late move reduction. Perform a reduced depth search (by 1 ply) under the   //
// following conditions:                                                      //
//   1. A number (LmrCount) of moves have already been tried.                 //
//   2. The current node is not a PV node.                                    //
//   3. The side to move is not in check.                                     //
//   4. The move itself does not give check.                                  //
//   5. The move does not promote a piece.                                    //
//   6. The move does not capture a piece.                                    //
//                                                                            //
// -------------------------------------------------------------------------- //
            if (count > LmrCount && depth > LmrDepth && !isPv && !s.inCheck()
                && !c.inCheck() && !s.isCapture(m) && !isPromotion(m))
                score = -scout_search(c, si, d - 1, ply + 1, -(a + 1), -a, false, isNull, false);
            else
                score = a + 1;

            if (score > a)
                score = -scout_search(c, si, d, ply + 1, -(a + 1), -a, false, isNull, false);

            // If an alpha improvement caused fail high, research using a full window.
            if (a < score && b > score)
            {
                score = -scout_search(c, si, d, ply + 1, -b, -a, true, isNull, false);
            }
        }

        history.pop();                           // Remove move from gamelist.

        if (score > bestScore)
        {
            best_move = m;
            bestScore = score;
        }

        a = std::max(a, bestScore);

        // Alpha-Beta pruning. If the move that caused the Beta cutoff is a
        // quiet move, store it as a killer.
        if (a >= b)
        {
            a = b;
            if (s.isQuiet(m))
                history.update(m, depth, ply, true);
            break;
        }
        else
        {
            if (s.isQuiet(m))
                history.update(m, depth, ply, false);
        }
    }

    if (bestScore == Neg_inf)
        return s.check() ? -Checkmate + ply : Stalemate;

    if (a > alpha && a < b && !si.quit)
    {
        lineManager.pushToPv(best_move, s.getKey(), ply, a);
    }

    ttable.store(s.getKey(), best_move, a <= alpha ? all : a >= b ? cut : pv, depth, a);

    // Fail-Hard alpha beta score.
    return a;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xde8, %rsp            # imm = 0xDE8
movl %r9d, 0x10(%rsp)
movl %r8d, 0x14(%rsp)
movq %rcx, 0x28(%rsp)
movq %rdx, 0x18(%rsp)
xorl %ebp, %ebp
cmpb $0x0, 0x3a(%rsi)
jne 0x12305
movq %rdi, %r12
movq %rsi, %r15
movb 0xe30(%rsp), %bl
movb 0xe28(%rsp), %r14b
movb 0xe20(%rsp), %al
movb %al, 0xf(%rsp)
movl 0x1c(%rsi), %ecx
movl $0xbb8, %esi            # imm = 0xBB8
movl %ecx, %eax
cltd
idivl %esi
testl %edx, %edx
jne 0x11b64
movq %r15, %rdi
callq 0x11824
testb %al, %al
jne 0x12305
movl 0x1c(%r15), %ecx
incl %ecx
movl %ecx, 0x1c(%r15)
cmpl $0x0, 0x18(%rsp)
je 0x11bc2
movq %r15, 0x38(%rsp)
testb %bl, %bl
je 0x11bec
movq 0x18(%r12), %rcx
leaq 0x210a7a(%rip), %rbx    # 0x222600
movq (%rbx), %rsi
movq 0x8(%rbx), %rdi
subq %rsi, %rdi
sarq $0x5, %rdi
xorl %r15d, %r15d
movq %rcx, %rax
xorl %edx, %edx
divq %rdi
shlq $0x5, %rdx
cmpq %rcx, (%rsi,%rdx)
jne 0x11c51
addq %rdx, %rsi
movq 0x18(%rsp), %rax
cmpl %eax, 0x10(%rsi)
jge 0x11c24
xorl %r15d, %r15d
jmp 0x11c51
movq %r12, %rdi
movq %r15, %rsi
movq 0x28(%rsp), %rdx
movl 0x14(%rsp), %ecx
movl 0x10(%rsp), %r8d
addq $0xde8, %rsp            # imm = 0xDE8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x118ad
leaq 0x1d6abd(%rip), %rdi    # 0x1e86b0
movq %r12, %rsi
callq 0x1271a
testb %al, %al
jne 0x12305
movq %r12, %rdi
callq 0x139a8
testb %al, %al
jne 0x12305
cmpl $0x63, 0x8(%r12)
jle 0x11b7a
jmp 0x12305
movl 0xc(%rsi), %eax
movl 0x14(%rsi), %ebp
testl %eax, %eax
je 0x12305
cmpl $0x1, %eax
jne 0x11c42
cmpl 0x10(%rsp), %ebp
jl 0x11c4c
jmp 0x1222e
cmpl 0x14(%rsp), %ebp
jle 0x12321
movzwl 0x8(%rsi), %r15d
leaq 0x1d1a98(%rip), %rdi    # 0x1e36f0
movq 0x28(%rsp), %rsi
callq 0xce8c
cmpq 0x18(%r12), %rax
jne 0x11c7d
leaq 0x1d1a80(%rip), %rdi    # 0x1e36f0
movq 0x28(%rsp), %rsi
callq 0xce9a
movl %eax, %r15d
cmpb $0x0, 0xf(%rsp)
je 0x11d30
movq $0x0, 0x40(%rsp)
testb %r14b, %r14b
jne 0x11d59
cmpl $0x6, 0x18(%rsp)
jl 0x11d59
cmpq $0x0, 0x28(%r12)
jne 0x11d59
testw %r15w, %r15w
jne 0x11d59
movq 0x18(%rsp), %rax
leal (%rax,%rax,2), %edx
shrl $0x2, %edx
addl $-0x2, %edx
subq $0x8, %rsp
movq %r12, %rdi
movq 0x40(%rsp), %rsi
movq 0x30(%rsp), %rcx
movl 0x1c(%rsp), %r8d
movl 0x18(%rsp), %r9d
pushq $0x0
pushq $0x1
popq %rax
pushq %rax
pushq %rax
callq 0x11aee
addq $0x20, %rsp
movq 0x18(%r12), %rcx
movq (%rbx), %rsi
movq 0x8(%rbx), %rdi
subq %rsi, %rdi
sarq $0x5, %rdi
movq $0x0, 0x40(%rsp)
movq %rcx, %rax
xorl %edx, %edx
divq %rdi
shlq $0x5, %rdx
cmpq %rcx, (%rsi,%rdx)
jne 0x12319
addq %rdx, %rsi
movzwl 0x8(%rsi), %r15d
jmp 0x11d59
leaq 0x590(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0xb7f8
movq %rbx, %rdi
callq 0xc5d0
movq %rax, 0x40(%rsp)
testb %r14b, %r14b
je 0x120e5
movq %r15, 0x58(%rsp)
movzwl %r15w, %edx
leaq 0x1d6947(%rip), %rcx    # 0x1e86b0
leaq 0x590(%rsp), %rdi
movl $0x0, 0x4c(%rsp)
movq %r12, %rsi
movq 0x28(%rsp), %r15
movl %r15d, %r8d
xorl %r9d, %r9d
callq 0xd1d6
leaq 0x2e8(%r12), %rbx
movq 0x40(%rsp), %rax
addl $0x12c, %eax            # imm = 0x12C
movq %rax, 0x40(%rsp)
movl $0x7fffffce, %eax       # imm = 0x7FFFFFCE
movq 0x18(%rsp), %rcx
shll %cl, %eax
movl %eax, 0x6c(%rsp)
leal -0x1(%rcx), %eax
movl %eax, 0x68(%rsp)
leal -0x2(%rcx), %eax
movl %eax, 0x64(%rsp)
leal 0x1(%r15), %eax
movl %eax, 0x30(%rsp)
movl 0x10(%rsp), %eax
negl %eax
movl %eax, 0x48(%rsp)
movb $0x1, %al
movl %eax, 0x24(%rsp)
movl $0xffff3cb0, 0x34(%rsp) # imm = 0xFFFF3CB0
movzbl %r14b, %eax
movq %rax, 0x50(%rsp)
movzbl 0xf(%rsp), %eax
movq %rax, 0x70(%rsp)
movl 0x14(%rsp), %ebp
cmpl $0xffff8034, 0x34(%rsp) # imm = 0xFFFF8034
setl %r14b
orb 0xf(%rsp), %r14b
leaq 0x590(%rsp), %rdi
callq 0xd48e
movl %eax, %r15d
testw %ax, %ax
je 0x12267
cmpq $0x0, 0x28(%r12)
setne %al
orb %r14b, %al
movzwl %r15w, %r13d
jne 0x11ea3
movq %r12, %rdi
movl %r13d, %esi
callq 0x132fa
testb %al, %al
jne 0x11ea3
movl (%r12), %eax
imulq $0x18, %rax, %rax
movl 0x8(%rbx,%rax), %ecx
addl 0x4(%rbx,%rax), %ecx
addl 0xc(%rbx,%rax), %ecx
addl 0x10(%rbx,%rax), %ecx
je 0x11ea3
movq 0x18(%rsp), %rax
cmpl $0x1, %eax
jne 0x11e89
movq %r12, %rdi
movl %r13d, %esi
callq 0xe830
testw $0x7000, %r15w          # imm = 0x7000
setne %cl
xorb $0x1, %al
orb %cl, %al
jne 0x11e8e
cmpl %ebp, 0x40(%rsp)
jl 0x11e09
jmp 0x11e8e
cmpl $0x2, %eax
jg 0x11ea3
movq %r12, %rdi
movl %r13d, %esi
callq 0x13436
cmpl 0x6c(%rsp), %eax
jl 0x11e09
leaq 0x88(%rsp), %rdi
movq %r12, %rsi
callq 0x12874
leaq 0x88(%rsp), %rdi
movl %r13d, %esi
callq 0x13694
movq 0xa0(%rsp), %rax
movw %r15w, 0x78(%rsp)
movq %rax, 0x80(%rsp)
leaq 0x1d67d0(%rip), %rdi    # 0x1e86b0
leaq 0x78(%rsp), %rsi
callq 0x1121a
movq 0xb0(%rsp), %rax
testq %rax, %rax
movl 0x68(%rsp), %edx
movl %edx, %r14d
pushq $0x1
popq %rcx
cmovnel %ecx, %r14d
movq 0x18(%rsp), %rcx
cmpl $0x1, %ecx
cmovnel %edx, %r14d
testb $0x1, 0x24(%rsp)
je 0x11f5e
movl %ebp, %r9d
negl %r9d
subq $0x8, %rsp
leaq 0x90(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl %r14d, %edx
movl 0x38(%rsp), %ecx
movl 0x50(%rsp), %r8d
pushq $0x0
pushq 0x60(%rsp)
pushq 0x88(%rsp)
callq 0x11aee
addq $0x20, %rsp
negl %eax
movl %r15d, %ecx
movq %rcx, 0x58(%rsp)
jmp 0x12058
testq %rax, %rax
setne %al
cmpl $0x3, %ecx
setl %cl
cmpl $0x3, 0x4c(%rsp)
setb %dl
orb %cl, %dl
orb 0xf(%rsp), %dl
cmpq $0x0, 0x28(%r12)
setne %cl
orb %dl, %cl
orb %al, %cl
movl %ebp, %eax
notl %eax
movl %eax, 0x24(%rsp)
jne 0x11fe2
movq %r12, %rdi
movl %r13d, %esi
callq 0xe904
testw $0x7000, %r15w          # imm = 0x7000
setne %cl
orb %al, %cl
jne 0x11fe2
movl %ebp, %r9d
negl %r9d
subq $0x8, %rsp
leaq 0x90(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl 0x6c(%rsp), %edx
movl 0x38(%rsp), %ecx
movl 0x2c(%rsp), %r8d
pushq $0x0
pushq 0x60(%rsp)
pushq $0x0
callq 0x11aee
addq $0x20, %rsp
negl %eax
cmpl %eax, %ebp
jge 0x12018
movl %ebp, %r9d
negl %r9d
subq $0x8, %rsp
leaq 0x90(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl %r14d, %edx
movl 0x38(%rsp), %ecx
movl 0x2c(%rsp), %r8d
pushq $0x0
pushq 0x60(%rsp)
pushq $0x0
callq 0x11aee
addq $0x20, %rsp
negl %eax
cmpl %eax, %ebp
jge 0x12058
cmpl 0x10(%rsp), %eax
jge 0x12058
movl %ebp, %r9d
negl %r9d
subq $0x8, %rsp
leaq 0x90(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl %r14d, %edx
movl 0x38(%rsp), %ecx
movl 0x50(%rsp), %r8d
pushq $0x0
pushq 0x60(%rsp)
pushq $0x1
callq 0x11aee
addq $0x20, %rsp
negl %eax
movq 0x1d6659(%rip), %rcx    # 0x1e86b8
cmpq %rcx, 0x1d664a(%rip)    # 0x1e86b0
je 0x12073
addq $-0x10, %rcx
movq %rcx, 0x1d6645(%rip)    # 0x1e86b8
movl 0x34(%rsp), %ecx
cmpl %ecx, %eax
cmovgl %eax, %ecx
movq 0x58(%rsp), %rax
cmovgl %r15d, %eax
movq %rax, 0x58(%rsp)
cmpl %ecx, %ebp
movl %ecx, 0x34(%rsp)
cmovlel %ecx, %ebp
cmpl 0x10(%rsp), %ebp
jge 0x12237
movq %r12, %rdi
movl %r13d, %esi
callq 0xe830
testb %al, %al
je 0x120d4
movl %r15d, %eax
andl $0x3f, %eax
shll $0x8, %eax
leaq 0x1d65f4(%rip), %rcx    # 0x1e86b0
addq %rcx, %rax
shrl $0x6, %r15d
andl $0x3f, %r15d
movq 0x18(%rsp), %rcx
addl %ecx, 0xe0(%rax,%r15,4)
incl 0x4c(%rsp)
movl $0x0, 0x24(%rsp)
jmp 0x11df8
movq 0x28(%r12), %rax
testq %rax, %rax
setne %cl
movq 0x18(%rsp), %rsi
cmpl $0x3, %esi
setge %dl
orb %cl, %dl
je 0x121ea
testq %rax, %rax
setne %al
cmpl $0x4, %esi
setl %cl
orb %al, %cl
jne 0x11d59
movl (%r12), %eax
imulq $0x18, %rax, %rax
movdqu 0x2ec(%r12,%rax), %xmm0
pshufd $0xee, %xmm0, %xmm1     # xmm1 = xmm0[2,3,2,3]
paddd %xmm0, %xmm1
pshufd $0x55, %xmm1, %xmm0     # xmm0 = xmm1[1,1,1,1]
paddd %xmm1, %xmm0
movd %xmm0, %eax
cmpl $0x4, %eax
jl 0x11d59
leaq 0x590(%rsp), %rbx
movl $0x508, %edx            # imm = 0x508
movq %rbx, %rdi
movq %r12, %rsi
callq 0x41c0
movq %rbx, %rdi
callq 0x1390e
movq 0x18(%rbx), %rax
leaq 0x88(%rsp), %rsi
andw $0x0, (%rsi)
movq %rax, 0x8(%rsi)
leaq 0x1d652d(%rip), %rdi    # 0x1e86b0
callq 0x1121a
movq 0x18(%rsp), %rax
leal -0x3(%rax), %edx
movq 0x28(%rsp), %rax
leal 0x1(%rax), %ecx
movl 0x14(%rsp), %r9d
movl %r9d, %r8d
notl %r8d
negl %r9d
subq $0x8, %rsp
movq %rbx, %rdi
movq 0x40(%rsp), %rsi
pushq $0x0
pushq $0x1
pushq $0x0
callq 0x11aee
addq $0x20, %rsp
negl %eax
movq 0x1d64ee(%rip), %rcx    # 0x1e86b8
cmpq %rcx, 0x1d64df(%rip)    # 0x1e86b0
je 0x121de
addq $-0x10, %rcx
movq %rcx, 0x1d64da(%rip)    # 0x1e86b8
cmpl 0x10(%rsp), %eax
jl 0x11d59
jmp 0x1222e
movl (%r12), %eax
imulq $0x18, %rax, %rax
movl 0x2f0(%r12,%rax), %ecx
addl 0x2ec(%r12,%rax), %ecx
addl 0x2f4(%r12,%rax), %ecx
addl 0x2f8(%r12,%rax), %ecx
je 0x11d59
imull $-0x64, 0x18(%rsp), %eax
movq 0x40(%rsp), %rcx
addl %eax, %ecx
cmpl 0x10(%rsp), %ecx
jl 0x11d59
movl 0x10(%rsp), %ebp
jmp 0x12305
movq %r12, %rdi
movl %r13d, %esi
callq 0xe830
testb %al, %al
je 0x12263
leaq 0x1d6463(%rip), %rdi    # 0x1e86b0
pushq $0x1
popq %r8
movl %r13d, %esi
movq 0x18(%rsp), %rdx
movq 0x28(%rsp), %rcx
callq 0x12794
movl 0x10(%rsp), %ebp
cmpl $0xffff3cb0, 0x34(%rsp) # imm = 0xFFFF3CB0
jne 0x1228d
movq %r12, %rdi
callq 0x1277e
movq 0x28(%rsp), %rcx
addl $0xffff8001, %ecx       # imm = 0xFFFF8001
xorl %ebp, %ebp
testb %al, %al
cmovnel %ecx, %ebp
jmp 0x122f8
cmpl 0x14(%rsp), %ebp
setle %al
cmpl 0x10(%rsp), %ebp
setge %cl
orb %al, %cl
movzwl 0x58(%rsp), %ebx
jne 0x122ca
movq 0x38(%rsp), %rax
cmpb $0x0, 0x3a(%rax)
jne 0x122ca
movq 0x18(%r12), %rdx
leaq 0x1d1435(%rip), %rdi    # 0x1e36f0
movl %ebx, %esi
movq 0x28(%rsp), %rcx
movl %ebp, %r8d
callq 0xce1a
xorl %eax, %eax
cmpl 0x10(%rsp), %ebp
setge %al
cmpl 0x14(%rsp), %ebp
movq 0x18(%r12), %rsi
pushq $0x2
popq %rcx
cmovgl %eax, %ecx
leaq 0x210317(%rip), %rdi    # 0x222600
movl %ebx, %edx
movq 0x18(%rsp), %r8
movl %ebp, %r9d
callq 0x127d6
leaq 0xdc0(%rsp), %rdi
callq 0xd138
movl %ebp, %eax
addq $0xde8, %rsp            # imm = 0xDE8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r15d, %r15d
jmp 0x11d59
movl 0x14(%rsp), %ebp
jmp 0x12305
jmp 0x1232f
jmp 0x1232f
jmp 0x1232f
jmp 0x1232f
movq %rax, %rbx
leaq 0xdc0(%rsp), %rdi
callq 0xd138
movq %rbx, %rdi
callq 0x43d0