// File: /workspace/github_cpp_makefile_star2_O3/ATOMIC-LICHESS[P]ATOMKRAFT/search.cpp
// Function: ThreadsManager::idle_loop(int, SplitPoint*)
void ThreadsManager::idle_loop(int threadID, SplitPoint* sp) {

  assert(threadID >= 0 && threadID < MAX_THREADS);

  int i;
  bool allFinished;

  while (true)
  {
      // Slave threads can exit as soon as AllThreadsShouldExit raises,
      // master should exit as last one.
      if (allThreadsShouldExit)
      {
          assert(!sp);
          threads[threadID].state = Thread::TERMINATED;
          return;
      }

      // If we are not thinking, wait for a condition to be signaled
      // instead of wasting CPU time polling for work.
      while (   threadID >= activeThreads
             || threads[threadID].state == Thread::INITIALIZING
             || (useSleepingThreads && threads[threadID].state == Thread::AVAILABLE))
      {
          assert(!sp || useSleepingThreads);
          assert(threadID != 0 || useSleepingThreads);

          if (threads[threadID].state == Thread::INITIALIZING)
              threads[threadID].state = Thread::AVAILABLE;

          // Grab the lock to avoid races with Thread::wake_up()
          lock_grab(&threads[threadID].sleepLock);

          // If we are master and all slaves have finished do not go to sleep
          for (i = 0; sp && i < activeThreads && !sp->is_slave[i]; i++) {}
          allFinished = (i == activeThreads);

          if (allFinished || allThreadsShouldExit)
          {
              lock_release(&threads[threadID].sleepLock);
              break;
          }

          // Do sleep here after retesting sleep conditions
          if (threadID >= activeThreads || threads[threadID].state == Thread::AVAILABLE)
              cond_wait(&threads[threadID].sleepCond, &threads[threadID].sleepLock);

          lock_release(&threads[threadID].sleepLock);
      }

      // If this thread has been assigned work, launch a search
      if (threads[threadID].state == Thread::WORKISWAITING)
      {
          assert(!allThreadsShouldExit);

          threads[threadID].state = Thread::SEARCHING;

          // Copy split point position and search stack and call search()
          // with SplitPoint template parameter set to true.
          SearchStack ss[PLY_MAX_PLUS_2];
          SplitPoint* tsp = threads[threadID].splitPoint;
          Position pos(*tsp->pos, threadID);

          memcpy(ss, tsp->ss - 1, 4 * sizeof(SearchStack));
          (ss+1)->sp = tsp;

          if (tsp->pvNode)
              search<PV, true, false>(pos, ss+1, tsp->alpha, tsp->beta, tsp->depth);
          else
              search<NonPV, true, false>(pos, ss+1, tsp->alpha, tsp->beta, tsp->depth);

          assert(threads[threadID].state == Thread::SEARCHING);

          threads[threadID].state = Thread::AVAILABLE;

          // Wake up master thread so to allow it to return from the idle loop in
          // case we are the last slave of the split point.
          if (   useSleepingThreads
              && threadID != tsp->master
              && threads[tsp->master].state == Thread::AVAILABLE)
              threads[tsp->master].wake_up();
      }

      // If this thread is the master of a split point and all slaves have
      // finished their work at this split point, return from the idle loop.
      for (i = 0; sp && i < activeThreads && !sp->is_slave[i]; i++) {}
      allFinished = (i == activeThreads);

      if (allFinished)
      {
          // Because sp->slaves[] is reset under lock protection,
          // be sure sp->lock has been released before to return.
          lock_grab(&(sp->lock));
          lock_release(&(sp->lock));

          // In helpful master concept a master can help only a sub-tree, and
          // because here is all finished is not possible master is booked.
          assert(threads[threadID].state == Thread::AVAILABLE);

          threads[threadID].state = Thread::SEARCHING;
          return;
      }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x39a8, %rsp           # imm = 0x39A8
movq %rdx, %rbx
movl %esi, %r12d
movq %rdi, %r14
leaq 0x40(%rdi), %rax
movq %rax, 0x90(%rsp)
movslq %esi, %rax
imulq $0x560, %rax, %rax      # imm = 0x560
leaq (%rdi,%rax), %r15
addq $0xc8, %r15
leaq 0x70(%rdi,%rax), %r13
addq %rdi, %rax
addq $0x98, %rax
movq %rax, 0xa8(%rsp)
movl %esi, 0x64(%rsp)
movq %r13, 0x98(%rsp)
cmpb $0x0, 0x38(%r14)
jne 0x25dd5
cmpl %r12d, 0x34(%r14)
jle 0x24ff9
cmpl $0x0, (%r15)
je 0x24ff9
cmpb $0x1, 0x30(%r14)
jne 0x2507a
movl (%r15), %eax
cmpl $0x2, %eax
jne 0x2507a
cmpl $0x0, (%r15)
jne 0x25006
movl $0x2, (%r15)
testq %rbx, %rbx
setne %bpl
movq %r13, %rdi
callq 0x55f0
movl 0x34(%r14), %ecx
movl %ecx, %eax
testl %ecx, %ecx
setg %dl
andb %bpl, %dl
xorl %ecx, %ecx
cmpb $0x1, %dl
jne 0x2503b
xorl %ecx, %ecx
cmpb $0x0, 0x75(%rbx,%rcx)
jne 0x2503b
incq %rcx
cmpq %rax, %rcx
jb 0x2502c
cmpl %eax, %ecx
je 0x25072
movb 0x38(%r14), %cl
cmpb $0x1, %cl
je 0x25072
cmpl %r12d, %eax
jle 0x25055
movl (%r15), %eax
cmpl $0x2, %eax
jne 0x25065
movq 0xa8(%rsp), %rdi
movq %r13, %rsi
callq 0x5620
movq %r13, %rdi
callq 0x52e0
jmp 0x24fd6
movq %r13, %rdi
callq 0x52e0
movl (%r15), %eax
cmpl $0x4, %eax
jne 0x25d85
movl $0x1, (%r15)
movq 0x8(%r15), %rbp
movq 0x8(%rbp), %rsi
leaq 0x17f0(%rsp), %rdi
movl %r12d, %edx
callq 0x1cc62
movq 0x30(%rbp), %rsi
addq $-0x38, %rsi
movl $0xe0, %edx
leaq 0x1a0(%rsp), %rdi
callq 0x5320
movq %rbp, 0x208(%rsp)
movl 0x68(%rbp), %eax
movl %eax, 0xc(%rsp)
movl 0x18(%rbp), %eax
movl %eax, 0x14(%rsp)
movslq 0x10(%rbp), %rax
movq %rax, 0x40(%rsp)
cmpb $0x1, 0x14(%rbp)
movq %rbp, 0x18(%rsp)
jne 0x25650
movslq 0x311c(%rsp), %rdi
movl 0x1a0(%rsp), %ecx
leal 0x1(%rcx), %eax
movl %eax, 0x1d8(%rsp)
movl 0x2880(%rsp), %edx
shlq $0x5, %rdx
leaq 0x1940(%rsp), %rsi
cmpl $0x0, 0x18(%rsi,%rdx)
je 0x25d46
movq %rdi, 0x68(%rsp)
imulq $0x560, %rdi, %rdx      # imm = 0x560
leaq 0x39c959(%rip), %rsi    # 0x3c1a90
addq %rsi, %rdx
addq $0x40, %rdx
movq %rdx, 0x58(%rsp)
cmpl %ecx, 0x28(%rdx)
jg 0x25150
movq 0x58(%rsp), %rcx
movl %eax, 0x28(%rcx)
movl $0xffff8acf, (%rsp)     # imm = 0xFFFF8ACF
leaq 0x3130(%rsp), %rdi
leaq 0x17f0(%rsp), %r12
movq %r12, %rsi
xorl %edx, %edx
movq 0x40(%rsp), %rcx
leaq 0x39a8c8(%rip), %r8     # 0x3bfa40
leaq 0x1d8(%rsp), %r9
callq 0x1b664
movq $0x0, 0x3998(%rsp)
movq 0x208(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x39a0(%rsp)
leaq 0xb0(%rsp), %rdi
movq %r12, %rsi
callq 0x1cac8
movl $0x0, 0x1e8(%rsp)
leaq 0x38(%rbp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x55f0
movl 0x6c(%rbp), %eax
cmpl 0x14(%rsp), %eax
jge 0x2561e
movq 0x40(%rsp), %rcx
leal -0x2(%rcx), %eax
movl %eax, 0x70(%rsp)
cmpl $0x6, %ecx
setge %al
cmpl $0x10, %ecx
setb %dl
movl %ecx, %esi
shrl %esi
andl $0x7f, %esi
cmpl $0x7e, %ecx
movl $0x3f, %ecx
cmovael %ecx, %esi
movl 0x14(%rsp), %ecx
negl %ecx
movl %ecx, 0x50(%rsp)
andb %al, %dl
movb %dl, 0x4c(%rsp)
movl $0xffff8acf, 0x10(%rsp) # imm = 0xFFFF8ACF
shll $0x6, %esi
leaq 0x397509(%rip), %rax    # 0x3bc730
addq %rax, %rsi
movq %rsi, 0x80(%rsp)
movq 0x39a0(%rsp), %rdi
callq 0x1bb3a
testl %eax, %eax
je 0x2561e
movl %eax, %r13d
movq 0x58(%rsp), %rdi
callq 0x291f8
testb %al, %al
jne 0x2561e
movl 0x70(%rbp), %eax
movq %rax, 0x78(%rsp)
incl %eax
movq %rax, 0x88(%rsp)
movl %eax, 0x70(%rbp)
movq 0x28(%rsp), %rdi
callq 0x52e0
leaq 0x17f0(%rsp), %rdi
movl %r13d, %esi
leaq 0xb0(%rsp), %rdx
callq 0x1eee6
testl $0x1f000, %r13d         # imm = 0x1F000
je 0x252a9
movl %r13d, %ecx
notl %ecx
testl $0xc000, %ecx           # imm = 0xC000
jmp 0x252b7
movl %r13d, %ecx
andl $0x3f, %ecx
cmpl $0x10, 0x17f0(%rsp,%rcx,4)
setne %cl
movb %cl, 0x34(%rsp)
movzbl %cl, %ebp
movzbl %al, %r12d
leaq 0x17f0(%rsp), %rdi
movl %r13d, %esi
movl %ebp, %edx
movl %r12d, %ecx
leaq 0xb(%rsp), %r8
callq 0x26ff2
movl %eax, %r8d
movl %r13d, 0x1dc(%rsp)
andb 0x4c(%rsp), %bpl
cmpb $0x1, %bpl
jne 0x2530f
cmpb $0x0, 0xb(%rsp)
movq 0x18(%rsp), %rbp
je 0x25430
movl $0x0, 0x38(%rsp)
jmp 0x2531c
movl $0x0, 0x38(%rsp)
movq 0x18(%rsp), %rbp
addl 0x70(%rsp), %r8d
movq %r8, 0x20(%rsp)
leaq 0x17f0(%rsp), %rdi
movl %r13d, %esi
leaq 0x100(%rsp), %rdx
leaq 0xb0(%rsp), %rcx
movl %r12d, %r8d
callq 0x1f424
cmpl $0x0, 0x78(%rsp)
jle 0x25418
cmpl $0x6, 0x40(%rsp)
setl %al
movl 0x68(%rbp), %r12d
orb 0x34(%rsp), %al
movb $0x1, %al
movq 0x20(%rsp), %r8
jne 0x25496
movl %r13d, %ecx
notl %ecx
testl $0xc000, %ecx           # imm = 0xC000
je 0x25496
cmpb $0x0, 0xb(%rsp)
jne 0x25496
cmpl %r13d, 0x1ec(%rsp)
je 0x25496
cmpl %r13d, 0x1f0(%rsp)
je 0x25496
movq 0x88(%rsp), %rcx
cmpl $0x3f, %ecx
movl $0x3f, %eax
cmovael %eax, %ecx
movq 0x80(%rsp), %rax
movsbl 0x1000(%rcx,%rax), %eax
movl %eax, 0x1f4(%rsp)
testl %eax, %eax
je 0x25489
movq 0x20(%rsp), %rcx
movl %ecx, %r8d
subl %eax, %r8d
movl %r12d, %edx
notl %edx
movl %r12d, %ecx
negl %ecx
leaq 0x17f0(%rsp), %rdi
leaq 0x210(%rsp), %rsi
callq 0x270ed
movq 0x20(%rsp), %r8
negl %eax
movl %eax, 0x10(%rsp)
cmpl %eax, %r12d
setl %al
jmp 0x2548b
movl 0xc(%rsp), %ecx
negl %ecx
leaq 0x17f0(%rsp), %rdi
movq 0x20(%rsp), %r8
jmp 0x2555f
movl %r13d, %ecx
andl $0xc000, %ecx           # imm = 0xC000
movl 0xc(%rsp), %edx
movl %edx, %eax
negl %eax
cmovsl %edx, %eax
movl $0x0, 0x38(%rsp)
cmpl $0x4000, %ecx           # imm = 0x4000
je 0x2531c
cmpl $0x74cb, %eax           # imm = 0x74CB
ja 0x2531c
leaq 0x17f0(%rsp), %rdi
movl %r13d, %esi
movq %r8, 0x20(%rsp)
callq 0x20bf8
movq 0x20(%rsp), %r8
shrl $0x1f, %eax
movl %eax, 0x38(%rsp)
jmp 0x2531c
movb $0x1, %al
movl $0x0, 0x1f4(%rsp)
cmpb $0x0, 0x38(%rsp)
je 0x25506
movl $0x6, 0x1f4(%rsp)
leal -0x12c(%r12), %ebp
movq 0x20(%rsp), %rax
leal -0x6(%rax), %r8d
movl $0x12b, %edx            # imm = 0x12B
subl %r12d, %edx
movl $0x12c, %ecx            # imm = 0x12C
subl %r12d, %ecx
leaq 0x17f0(%rsp), %r12
movq %r12, %rdi
leaq 0x210(%rsp), %rsi
callq 0x270ed
movq %r12, %rdi
movq 0x20(%rsp), %r8
movl %eax, %r12d
negl %r12d
movl $0x0, 0x1f4(%rsp)
cmpl %r12d, %ebp
movq 0x18(%rsp), %rbp
jl 0x25517
jmp 0x2557c
testb %al, %al
leaq 0x17f0(%rsp), %rdi
movl 0x10(%rsp), %r12d
je 0x2557c
movl 0x68(%rbp), %ebp
movl %ebp, %edx
notl %edx
movl %ebp, %ecx
negl %ecx
leaq 0x210(%rsp), %rsi
movl %ecx, 0xc(%rsp)
callq 0x270ed
movl %eax, %r12d
negl %r12d
cmpl %r12d, %ebp
jge 0x255d4
cmpl %r12d, 0x14(%rsp)
movq 0x18(%rsp), %rbp
movl 0xc(%rsp), %ecx
movq 0x20(%rsp), %r8
leaq 0x17f0(%rsp), %rdi
jle 0x2557c
movq %rdi, %r12
leaq 0x210(%rsp), %rsi
movl 0x50(%rsp), %edx
callq 0x26606
movq %r12, %rdi
movl %eax, %r12d
negl %r12d
movl %r13d, %esi
callq 0x2051a
movq 0x28(%rsp), %rdi
callq 0x55f0
movq %rbp, %rax
movl 0x6c(%rbp), %ebp
movl 0x68(%rax), %eax
movl %eax, 0xc(%rsp)
movl %r12d, 0x10(%rsp)
cmpl %ebp, %r12d
jle 0x2560f
movq 0x58(%rsp), %rdi
callq 0x291f8
testb %al, %al
jne 0x2560f
movq 0x18(%rsp), %rcx
movl 0x10(%rsp), %ebp
movl %ebp, 0x6c(%rcx)
cmpl 0xc(%rsp), %ebp
jle 0x2560f
cmpl 0x14(%rsp), %ebp
jge 0x255e3
movl %ebp, 0x68(%rcx)
movl %ebp, 0xc(%rsp)
jmp 0x255e7
movq 0x18(%rsp), %rbp
leaq 0x17f0(%rsp), %rdi
jmp 0x2557c
movb $0x1, 0x74(%rcx)
movl $0x752f, %eax           # imm = 0x752F
subl 0x1d8(%rsp), %eax
cmpl %eax, %ebp
jne 0x255ff
movl %r13d, 0x1e0(%rsp)
movl %r13d, 0x1e8(%rsp)
movq 0x30(%rcx), %rax
movl %r13d, 0x10(%rax)
cmpl 0x14(%rsp), %ebp
movq 0x18(%rsp), %rbp
jl 0x25232
movq 0x68(%rsp), %rax
movb $0x0, 0x75(%rbp,%rax)
movq 0x3120(%rsp), %rax
addq %rax, 0x60(%rbp)
movq 0x28(%rsp), %rdi
callq 0x52e0
movl 0x64(%rsp), %r12d
movq 0x98(%rsp), %r13
jmp 0x25d46
movq 0x3128(%rsp), %rax
cmpq $0x0, 0x40(%rax)
setne 0x58(%rsp)
movl 0x2880(%rsp), %eax
shlq $0x5, %rax
leaq 0x1940(%rsp), %rcx
movl 0x18(%rcx,%rax), %eax
testl %eax, %eax
sete %dl
movl 0x1a0(%rsp), %ecx
incl %ecx
movl %ecx, 0x1d8(%rsp)
movslq 0x311c(%rsp), %rcx
testl %eax, %eax
je 0x25d41
movb %dl, 0x28(%rsp)
movq %rcx, 0x70(%rsp)
movq 0x18(%rsp), %r13
movl 0x24(%r13), %eax
movl %eax, 0x88(%rsp)
movl 0x14(%rsp), %ebp
movl %ebp, (%rsp)
leaq 0x3130(%rsp), %rdi
leaq 0x17f0(%rsp), %r12
movq %r12, %rsi
xorl %edx, %edx
movq 0x40(%rsp), %rcx
leaq 0x39a361(%rip), %r8     # 0x3bfa40
leaq 0x1d8(%rsp), %r9
callq 0x1b664
movq $0x0, 0x3998(%rsp)
movq 0x208(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x39a0(%rsp)
leaq 0xb0(%rsp), %rdi
movq %r12, %rsi
callq 0x1cac8
movl $0x0, 0x1e8(%rsp)
movl 0x1fc(%rsp), %eax
addl 0x1f8(%rsp), %eax
movl %eax, 0x4c(%rsp)
leaq 0x38(%r13), %rdi
movq %rdi, 0x20(%rsp)
callq 0x55f0
movl 0x6c(%r13), %eax
movl %eax, 0x10(%rsp)
cmpl %ebp, %eax
jge 0x25d0f
movb 0x28(%rsp), %al
orb %al, 0x58(%rsp)
imulq $0x560, 0x70(%rsp), %rax # imm = 0x560
leaq 0x39c321(%rip), %rcx    # 0x3c1a90
addq %rcx, %rax
addq $0x40, %rax
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %rdx
movl %edx, %eax
shrl $0x1f, %eax
addl %edx, %eax
sarl %eax
movl %edx, %esi
shrl %esi
andl $0x7f, %esi
cmpl $0x7e, %edx
movl $0x3f, %ecx
cmovgel %ecx, %eax
leal -0x2(%rdx), %edx
movl %edx, 0x68(%rsp)
movslq %eax, %rdx
cmovael %ecx, %esi
shll $0x6, %esi
leaq 0x396f7e(%rip), %rax    # 0x3bc730
addq %rax, %rsi
movq %rsi, 0xa0(%rsp)
shlq $0x6, %rdx
addq %rax, %rdx
movq %rdx, 0x80(%rsp)
movq 0x39a0(%rsp), %rdi
callq 0x1bb3a
testl %eax, %eax
je 0x25d0f
movl %eax, %r13d
movq 0x38(%rsp), %rdi
callq 0x291f8
testb %al, %al
jne 0x25d0f
movq 0x18(%rsp), %rax
movl 0x70(%rax), %ecx
incl %ecx
movl %ecx, 0x28(%rsp)
movl %ecx, 0x70(%rax)
movq 0x20(%rsp), %rdi
callq 0x52e0
movq %r12, %rdi
movl %r13d, %esi
leaq 0xb0(%rsp), %rdx
callq 0x1eee6
movl %r13d, %ecx
notl %ecx
testl $0x1f000, %r13d         # imm = 0x1F000
movl %ecx, 0x78(%rsp)
je 0x2583e
testl $0xc000, %ecx           # imm = 0xC000
jmp 0x2584c
movl %r13d, %ecx
andl $0x3f, %ecx
cmpl $0x10, 0x17f0(%rsp,%rcx,4)
setne %r12b
movzbl %r12b, %ebp
movzbl %al, %ecx
leaq 0x17f0(%rsp), %rdi
movl %r13d, %esi
movl %ebp, %edx
movl %ecx, 0x34(%rsp)
leaq 0xb(%rsp), %r8
callq 0x28cb3
movl %r13d, 0x1dc(%rsp)
orb 0x58(%rsp), %bpl
jne 0x2592a
xorl %r12d, %r12d
testl $0xc000, 0x78(%rsp)     # imm = 0xC000
je 0x2592a
cmpb $0x0, 0xb(%rsp)
jne 0x2592a
movq %rax, %rbp
movl $0x100, %eax            # imm = 0x100
movq 0x40(%rsp), %rcx
cmpl $0x1f, %ecx
jg 0x258bd
leaq 0x399e76(%rip), %rax    # 0x3bf730
movl (%rax,%rcx,4), %eax
cmpl %eax, 0x28(%rsp)
leaq 0x17f0(%rsp), %r12
jl 0x25976
movl 0x88(%rsp), %edx
testl %edx, %edx
je 0x258f9
movq %r12, %rdi
movl %r13d, %esi
callq 0x28dae
cmpl $0xffff8b35, 0x10(%rsp) # imm = 0xFFFF8B35
jl 0x25976
testb %al, %al
je 0x25903
jmp 0x25976
cmpl $0xffff8b35, 0x10(%rsp) # imm = 0xFFFF8B35
jl 0x25976
movq 0x20(%rsp), %rdi
callq 0x55f0
movq 0x39a0(%rsp), %rdi
callq 0x1bb3a
movl %eax, %r13d
testl %eax, %eax
jne 0x257e4
jmp 0x25d0f
addl 0x68(%rsp), %eax
movq %rax, 0x50(%rsp)
movq 0x40(%rsp), %rax
cmpl $0x5, %eax
jg 0x25a2c
leaq 0x17f0(%rsp), %rbp
movq %rbp, %rdi
movl %r13d, %esi
leaq 0x100(%rsp), %rdx
leaq 0xb0(%rsp), %rcx
movl 0x34(%rsp), %r8d
callq 0x1f424
movq 0x18(%rsp), %rax
movl 0x68(%rax), %eax
jmp 0x25ae6
addl 0x68(%rsp), %ebp
movl 0x28(%rsp), %ecx
cmpl $0x3f, %ecx
movl $0x3f, %eax
cmovll %ecx, %eax
movslq %eax, %rcx
movq 0x80(%rsp), %rax
movsbl (%rcx,%rax), %edx
movq %rbp, 0x50(%rsp)
movl %ebp, %eax
subl %edx, %eax
movl $0xea62, %ebp           # imm = 0xEA62
cmpl $0xd, %eax
jg 0x259c7
cmpl $0x2, %eax
movl $0x1, %edx
cmovgel %eax, %edx
shlq $0x8, %rdx
leaq 0x398d6f(%rip), %rsi    # 0x3be730
addq %rsi, %rdx
movl (%rdx,%rcx,4), %ebp
addl 0x4c(%rsp), %ebp
movl %r13d, %ecx
shrl $0x4, %ecx
andl $0xfc, %ecx
movl 0x17f0(%rsp,%rcx), %ecx
movl %r13d, %edx
andl $0x3f, %edx
shlq $0x8, %rcx
leaq 0x39a051(%rip), %rsi    # 0x3bfa40
addq %rsi, %rcx
addl 0x1000(%rcx,%rdx,4), %ebp
cmpl 0x14(%rsp), %ebp
jge 0x25ba2
movq 0x20(%rsp), %rdi
callq 0x55f0
movq 0x18(%rsp), %rax
cmpl 0x6c(%rax), %ebp
jle 0x25be1
movq 0x18(%rsp), %rax
movl %ebp, 0x6c(%rax)
movl %ebp, 0x10(%rsp)
jmp 0x25be1
cmpl $0x10, %eax
setae %al
movl %r12d, %ecx
xorb $0x1, %cl
orb %al, %cl
movq 0x18(%rsp), %rbp
jne 0x25a4c
cmpb $0x0, 0xb(%rsp)
je 0x25cb1
xorl %eax, %eax
movl %eax, 0xc(%rsp)
leaq 0x17f0(%rsp), %rdi
movl %r13d, %esi
leaq 0x100(%rsp), %rdx
leaq 0xb0(%rsp), %rcx
movl 0x34(%rsp), %r8d
callq 0x1f424
movl 0x68(%rbp), %esi
testb %r12b, %r12b
je 0x25bf4
cmpb $0x0, 0xc(%rsp)
leaq 0x17f0(%rsp), %rbp
je 0x25ae6
movl $0x6, 0x1f4(%rsp)
leal -0x12c(%rsi), %eax
movl %eax, 0xc(%rsp)
movq 0x50(%rsp), %rax
leal -0x6(%rax), %r8d
movl $0x12b, %edx            # imm = 0x12B
subl %esi, %edx
movl $0x12c, %ecx            # imm = 0x12C
subl %esi, %ecx
movq %rbp, %rdi
leaq 0x210(%rsp), %rsi
callq 0x270ed
movl %eax, %r12d
negl %r12d
movl $0x0, 0x1f4(%rsp)
cmpl %r12d, 0xc(%rsp)
jge 0x25b0f
movq 0x18(%rsp), %rax
movl 0x68(%rax), %ecx
movl %ecx, %edx
notl %edx
negl %ecx
movq %rbp, %rdi
leaq 0x210(%rsp), %rsi
movq 0x50(%rsp), %r8
callq 0x270ed
movl %eax, %r12d
negl %r12d
movq %rbp, %rdi
movl %r13d, %esi
callq 0x2051a
movq 0x20(%rsp), %rdi
callq 0x55f0
movq 0x18(%rsp), %rbp
movl 0x6c(%rbp), %ecx
movl 0x68(%rbp), %eax
movl %eax, 0xc(%rsp)
movl %ecx, 0x10(%rsp)
cmpl %ecx, %r12d
jle 0x25b87
movq 0x38(%rsp), %rdi
callq 0x291f8
testb %al, %al
jne 0x25b87
movl %r12d, 0x6c(%rbp)
cmpl 0xc(%rsp), %r12d
jle 0x25b82
movb $0x1, 0x74(%rbp)
movl $0x752f, %eax           # imm = 0x752F
subl 0x1d8(%rsp), %eax
cmpl %eax, %r12d
jne 0x25b72
movl %r13d, 0x1e0(%rsp)
movl %r13d, 0x1e8(%rsp)
movq 0x30(%rbp), %rax
movl %r13d, 0x10(%rax)
movl %r12d, 0x10(%rsp)
movl 0x10(%rsp), %eax
cmpl 0x14(%rsp), %eax
leaq 0x17f0(%rsp), %r12
jl 0x257cc
jmp 0x25d0f
xorl %r12d, %r12d
cmpl $0xffff8b35, 0x10(%rsp) # imm = 0xFFFF8B35
jl 0x25933
cmpl $0x3, %eax
jg 0x25933
leaq 0x17f0(%rsp), %r12
movq %r12, %rdi
movl %r13d, %esi
callq 0x20bf8
testl %eax, %eax
jns 0x25d07
movq 0x20(%rsp), %rdi
callq 0x55f0
movl 0x10(%rsp), %eax
cmpl 0x14(%rsp), %eax
jl 0x257cc
jmp 0x25d0f
testl $0xc000, 0x78(%rsp)     # imm = 0xC000
je 0x25a83
cmpb $0x0, 0xb(%rsp)
jne 0x25a83
cmpl %r13d, 0x1ec(%rsp)
je 0x25a83
cmpl %r13d, 0x1f0(%rsp)
je 0x25a83
movl 0x28(%rsp), %ecx
cmpl $0x3f, %ecx
movl $0x3f, %eax
cmovgel %eax, %ecx
movslq %ecx, %rax
movq 0xa0(%rsp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, 0x1f4(%rsp)
testl %eax, %eax
je 0x25cf7
movq 0x50(%rsp), %rcx
movl %ecx, %r8d
subl %eax, %r8d
movl %esi, %edx
notl %edx
movl %esi, %ecx
negl %ecx
leaq 0x17f0(%rsp), %rbp
movq %rbp, %rdi
movq %rsi, %r12
leaq 0x210(%rsp), %rsi
callq 0x270ed
movq %r12, %rsi
movl $0x0, 0x1f4(%rsp)
cmpb $0x0, 0xc(%rsp)
jne 0x25a92
movl %eax, %r12d
negl %r12d
cmpl %r12d, %esi
jl 0x25ae6
jmp 0x25b0f
movl %r13d, %ecx
andl $0xc000, %ecx           # imm = 0xC000
movl 0xc(%rsp), %edx
movl %edx, %esi
negl %esi
cmovsl %edx, %esi
xorl %eax, %eax
cmpl $0x4000, %ecx           # imm = 0x4000
je 0x25a4e
cmpl $0x74cb, %esi           # imm = 0x74CB
ja 0x25a4e
leaq 0x17f0(%rsp), %rdi
movl %r13d, %esi
callq 0x20bf8
shrl $0x1f, %eax
jmp 0x25a4e
movl $0x0, 0x1f4(%rsp)
jmp 0x25a83
xorl %r12d, %r12d
jmp 0x25933
movq 0x18(%rsp), %rcx
movq 0x70(%rsp), %rax
movb $0x0, 0x75(%rcx,%rax)
movq 0x3120(%rsp), %rax
addq %rax, 0x60(%rcx)
movq 0x20(%rsp), %rdi
callq 0x52e0
movl 0x64(%rsp), %r12d
movq 0x98(%rsp), %r13
movq 0x18(%rsp), %rbp
movl $0x2, (%r15)
cmpb $0x1, 0x30(%r14)
jne 0x25d85
movslq 0x20(%rbp), %rax
cmpl %r12d, %eax
je 0x25d85
imulq $0x560, %rax, %rdi      # imm = 0x560
movq 0x90(%rsp), %rax
movl 0x88(%rax,%rdi), %eax
cmpl $0x2, %eax
jne 0x25d85
addq 0x90(%rsp), %rdi
callq 0x291ca
testq %rbx, %rbx
setne %cl
movl 0x34(%r14), %edx
movl %edx, %eax
testl %edx, %edx
setg %dl
andb %cl, %dl
xorl %ecx, %ecx
cmpb $0x1, %dl
jne 0x25db0
xorl %ecx, %ecx
cmpb $0x0, 0x75(%rbx,%rcx)
jne 0x25db0
incq %rcx
cmpq %rax, %rcx
jb 0x25da1
cmpl %eax, %ecx
jne 0x24fcb
addq $0x38, %rbx
movq %rbx, %rdi
callq 0x55f0
movq %rbx, %rdi
callq 0x52e0
movl $0x1, (%r15)
jmp 0x25ddc
movl $0x5, (%r15)
addq $0x39a8, %rsp           # imm = 0x39A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq