// File: /workspace/github_cpp_makefile_star2_O2/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, %ebp
movq %rdi, %r15
leaq 0x40(%rdi), %rax
movq %rax, 0x80(%rsp)
movslq %esi, %rax
imulq $0x560, %rax, %rax      # imm = 0x560
leaq (%rdi,%rax), %r14
addq $0xc8, %r14
leaq 0x70(%rdi,%rax), %r12
leaq 0x98(%rdi,%rax), %r13
movq %r14, 0x98(%rsp)
movl %esi, 0x5c(%rsp)
movq %rdi, 0x90(%rsp)
movq %r12, 0x88(%rsp)
movq %r13, 0x18(%rsp)
cmpb $0x0, 0x38(%r15)
jne 0x1e8ea
cmpl %ebp, 0x34(%r15)
jle 0x1db6c
cmpl $0x0, (%r14)
je 0x1db6c
cmpb $0x1, 0x30(%r15)
jne 0x1dbd5
movl (%r14), %eax
cmpl $0x2, %eax
jne 0x1dbd5
cmpl $0x0, (%r14)
jne 0x1db79
movl $0x2, (%r14)
movq %r12, %rdi
callq 0x55d0
movslq 0x34(%r15), %rcx
movl %ecx, %eax
xorl %edx, %edx
testq %rbx, %rbx
je 0x1db9f
cmpq %rcx, %rdx
jge 0x1db9f
cmpb $0x0, 0x75(%rbx,%rdx)
jne 0x1db9f
incq %rdx
jmp 0x1db89
cmpl %edx, %eax
je 0x1dbcd
movb 0x38(%r15), %cl
cmpb $0x1, %cl
je 0x1dbcd
cmpl %ebp, %eax
jle 0x1dbb8
movl (%r14), %eax
cmpl $0x2, %eax
jne 0x1dbc3
movq %r13, %rdi
movq %r12, %rsi
callq 0x5600
movq %r12, %rdi
callq 0x52d0
jmp 0x1db51
movq %r12, %rdi
callq 0x52d0
movl (%r14), %eax
cmpl $0x4, %eax
jne 0x1e8a9
movl $0x1, (%r14)
movq 0x8(%r14), %r13
movq 0x8(%r13), %rsi
leaq 0x17f0(%rsp), %rdi
movl %ebp, %edx
callq 0x1734e
movq 0x30(%r13), %rsi
addq $-0x38, %rsi
movl $0xe0, %edx
leaq 0x1a0(%rsp), %rdi
callq 0x5310
movq %r13, 0x208(%rsp)
movl 0x68(%r13), %eax
movl %eax, 0x4(%rsp)
movl 0x18(%r13), %eax
movl %eax, 0x20(%rsp)
movslq 0x10(%r13), %rax
movq %rax, 0x50(%rsp)
movq %r13, 0x8(%rsp)
cmpb $0x1, 0x14(%r13)
jne 0x1e11f
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)
movq 0x18(%rsp), %r13
je 0x1e866
movq %rdi, 0x68(%rsp)
imulq $0x560, %rdi, %rdx      # imm = 0x560
leaq 0x39bdf7(%rip), %rsi    # 0x3b9a90
addq %rsi, %rdx
addq $0x40, %rdx
movq %rdx, 0x40(%rsp)
cmpl %ecx, 0x28(%rdx)
jg 0x1dcb2
movq 0x40(%rsp), %rcx
movl %eax, 0x28(%rcx)
movl $0xffff8acf, 0x28(%rsp) # imm = 0xFFFF8ACF
leaq 0x3130(%rsp), %rdi
leaq 0x17f0(%rsp), %r14
movq %r14, %rsi
movq 0x50(%rsp), %r12
movl %r12d, %edx
leaq 0x1d8(%rsp), %rcx
movl $0xffff8acf, %r8d       # imm = 0xFFFF8ACF
callq 0x2176e
leaq 0xb0(%rsp), %rdi
movq %r14, %rsi
callq 0x17248
andl $0x0, 0x1e8(%rsp)
movq 0x8(%rsp), %r15
leaq 0x38(%r15), %rdi
movq %rdi, 0x10(%rsp)
callq 0x55d0
movl 0x6c(%r15), %ebp
leal -0x2(%r12), %eax
movl %eax, 0x4c(%rsp)
cmpl $0x6, %r12d
setge %al
cmpl $0x10, %r12d
setb %dl
movl %r12d, %esi
shrl %esi
andl $0x7f, %esi
cmpl $0x7e, %r12d
pushq $0x3f
popq %rcx
cmovael %ecx, %esi
movl 0x20(%rsp), %ecx
negl %ecx
movl %ecx, 0x3c(%rsp)
andb %al, %dl
movb %dl, 0x38(%rsp)
shll $0x6, %esi
leaq 0x3969d6(%rip), %rax    # 0x3b4730
addq %rax, %rsi
movq %rsi, 0x70(%rsp)
movl 0x4(%rsp), %r15d
cmpl 0x20(%rsp), %ebp
jge 0x1e7df
movq 0x39a0(%rsp), %rdi
callq 0x1651c
testl %eax, %eax
je 0x1e7df
movl %eax, %r12d
movq 0x40(%rsp), %rdi
callq 0x21c10
testb %al, %al
jne 0x1e7df
movq 0x8(%rsp), %rax
movl 0x70(%rax), %ebp
leal 0x1(%rbp), %ecx
movq %rcx, 0x78(%rsp)
movl %ecx, 0x70(%rax)
movq 0x10(%rsp), %rdi
callq 0x52d0
movq %r14, %rdi
movl %r12d, %esi
leaq 0xb0(%rsp), %rdx
callq 0x18d4a
movl %r12d, %r13d
notl %r13d
testl $0x1f000, %r12d         # imm = 0x1F000
movl %r15d, 0x4(%rsp)
movq %rbp, 0x60(%rsp)
je 0x1ddec
testw $0xc000, %r13w          # imm = 0xC000
jmp 0x1ddfa
movl %r12d, %ecx
andl $0x3f, %ecx
cmpl $0x10, 0x17f0(%rsp,%rcx,4)
setne %r14b
movzbl %r14b, %ebp
movzbl %al, %r15d
leaq 0x17f0(%rsp), %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
leaq 0x3(%rsp), %r8
callq 0x1f934
movl %eax, %r8d
movl %r12d, 0x1dc(%rsp)
andb 0x38(%rsp), %bpl
cmpb $0x1, %bpl
jne 0x1de41
cmpb $0x0, 0x3(%rsp)
je 0x1df57
xorl %ebp, %ebp
addl 0x4c(%rsp), %r8d
movq %r8, 0x30(%rsp)
leaq 0x17f0(%rsp), %rdi
movl %r12d, %esi
leaq 0x100(%rsp), %rdx
leaq 0xb0(%rsp), %rcx
movl %r15d, %r8d
callq 0x19162
cmpl $0x0, 0x60(%rsp)
jle 0x1de9e
cmpl $0x6, 0x50(%rsp)
setl %al
movq 0x8(%rsp), %rcx
movl 0x68(%rcx), %r15d
orb %r14b, %al
movb $0x1, %al
movq 0x30(%rsp), %r8
je 0x1deb8
movl 0x28(%rsp), %r13d
jmp 0x1dfae
movl 0x4(%rsp), %r15d
negl %r15d
leaq 0x17f0(%rsp), %r14
movq 0x30(%rsp), %r8
jmp 0x1e058
testw $0xc000, %r13w          # imm = 0xC000
movl 0x28(%rsp), %r13d
je 0x1dfae
cmpb $0x0, 0x3(%rsp)
jne 0x1dfae
cmpl %r12d, 0x1ec(%rsp)
je 0x1dfae
cmpl %r12d, 0x1f0(%rsp)
je 0x1dfae
movq 0x78(%rsp), %rdx
cmpl $0x3f, %edx
pushq $0x3f
popq %rax
cmovael %eax, %edx
movq 0x70(%rsp), %rax
movsbl 0x1000(%rdx,%rax), %eax
movl %eax, 0x1f4(%rsp)
testl %eax, %eax
je 0x1dfa4
movq 0x30(%rsp), %rcx
movl %ecx, %r8d
subl %eax, %r8d
movl %r15d, %edx
notl %edx
movl %r15d, %ecx
negl %ecx
leaq 0x17f0(%rsp), %rdi
leaq 0x210(%rsp), %rsi
callq 0x1fa26
movq 0x30(%rsp), %r8
movl %eax, %r13d
negl %r13d
cmpl %r13d, %r15d
setl %al
jmp 0x1dfa6
movl %r12d, %ecx
andl $0xc000, %ecx           # imm = 0xC000
movl 0x4(%rsp), %edx
movl %edx, %eax
negl %eax
cmovsl %edx, %eax
xorl %ebp, %ebp
cmpl $0x4000, %ecx           # imm = 0x4000
je 0x1de43
cmpl $0x74cb, %eax           # imm = 0x74CB
ja 0x1de43
leaq 0x17f0(%rsp), %rdi
movl %r12d, %esi
movq %r8, %rbp
callq 0x1a668
movq %rbp, %r8
movl %eax, %ebp
shrl $0x1f, %ebp
jmp 0x1de43
movb $0x1, %al
andl $0x0, 0x1f4(%rsp)
testb %bpl, %bpl
je 0x1e010
movl $0x6, 0x1f4(%rsp)
leal -0x12c(%r15), %ebp
movq 0x30(%rsp), %rax
leal -0x6(%rax), %r8d
movl $0x12b, %edx            # imm = 0x12B
subl %r15d, %edx
movl $0x12c, %ecx            # imm = 0x12C
subl %r15d, %ecx
leaq 0x17f0(%rsp), %r14
movq %r14, %rdi
leaq 0x210(%rsp), %rsi
callq 0x1fa26
movq 0x30(%rsp), %r8
movl %eax, %r13d
negl %r13d
andl $0x0, 0x1f4(%rsp)
cmpl %r13d, %ebp
jl 0x1e01c
jmp 0x1e075
testb %al, %al
leaq 0x17f0(%rsp), %r14
je 0x1e075
movq 0x8(%rsp), %rax
movl 0x68(%rax), %ebp
movl %ebp, %edx
notl %edx
movl %ebp, %r15d
negl %r15d
movq %r14, %rdi
leaq 0x210(%rsp), %rsi
movl %r15d, %ecx
callq 0x1fa26
movl %eax, %r13d
negl %r13d
cmpl %r13d, %ebp
jge 0x1e075
cmpl %r13d, 0x20(%rsp)
movq 0x30(%rsp), %r8
jle 0x1e075
movq %r14, %rdi
leaq 0x210(%rsp), %rsi
movl 0x3c(%rsp), %edx
movl %r15d, %ecx
callq 0x1ef9c
movl %eax, %r13d
negl %r13d
movq %r14, %rdi
movl %r12d, %esi
callq 0x1a056
movq 0x10(%rsp), %rdi
callq 0x55d0
movq 0x8(%rsp), %rax
movl 0x6c(%rax), %ebp
movl 0x68(%rax), %r15d
movl %r13d, 0x28(%rsp)
cmpl %ebp, %r13d
jle 0x1dd67
movq 0x40(%rsp), %rdi
callq 0x21c10
testb %al, %al
jne 0x1dd67
movq 0x8(%rsp), %rax
movl 0x28(%rsp), %ecx
movl %ecx, 0x6c(%rax)
movl %ecx, %ebp
cmpl %r15d, %ecx
jle 0x1dd67
movl 0x28(%rsp), %ebp
cmpl 0x20(%rsp), %ebp
jge 0x1e0e4
movq 0x8(%rsp), %rax
movl %ebp, 0x68(%rax)
movl %ebp, %r15d
jmp 0x1e0ed
movq 0x8(%rsp), %rax
movb $0x1, 0x74(%rax)
movl $0x752f, %eax           # imm = 0x752F
subl 0x1d8(%rsp), %eax
cmpl %eax, %ebp
jne 0x1e105
movl %r12d, 0x1e0(%rsp)
movl %r12d, 0x1e8(%rsp)
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rax
movl %r12d, 0x10(%rax)
jmp 0x1dd67
movq 0x3128(%rsp), %rax
cmpq $0x0, 0x40(%rax)
setne %sil
movl 0x2880(%rsp), %eax
shlq $0x5, %rax
leaq 0x1940(%rsp), %rcx
movl 0x18(%rcx,%rax), %ecx
testl %ecx, %ecx
sete %al
movl 0x1a0(%rsp), %edx
incl %edx
movl %edx, 0x1d8(%rsp)
movslq 0x311c(%rsp), %rdx
testl %ecx, %ecx
movq 0x18(%rsp), %r13
je 0x1e866
orb %al, %sil
movb %sil, 0x78(%rsp)
movq 0x8(%rsp), %r15
movl 0x24(%r15), %eax
movl %eax, 0x4c(%rsp)
leaq 0x3130(%rsp), %rdi
leaq 0x17f0(%rsp), %r14
movq %r14, %rsi
movq 0x50(%rsp), %r12
movq %rdx, %r13
movl %r12d, %edx
leaq 0x1d8(%rsp), %rcx
movl 0x20(%rsp), %r8d
callq 0x2176e
leaq 0xb0(%rsp), %rdi
movq %r14, %rsi
callq 0x17248
andl $0x0, 0x1e8(%rsp)
movl 0x1fc(%rsp), %eax
addl 0x1f8(%rsp), %eax
movl %eax, 0x68(%rsp)
leaq 0x38(%r15), %r14
movq %r14, %rdi
callq 0x55d0
movl 0x6c(%r15), %eax
movl %eax, 0x10(%rsp)
movq %r13, 0x70(%rsp)
imulq $0x560, %r13, %rax      # imm = 0x560
movq 0x18(%rsp), %r13
leaq 0x39b884(%rip), %rcx    # 0x3b9a90
addq %rcx, %rax
addq $0x40, %rax
movq %rax, 0x60(%rsp)
leal -0x2(%r12), %eax
movl %eax, 0x38(%rsp)
movl %r12d, %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
cmpl $0x6, %r12d
setge %cl
cmpl $0x10, %r12d
setb %sil
movl %r12d, %edi
shrl %edi
andl $0x7f, %edi
cmpl $0x7e, %r12d
pushq $0x3f
popq %rdx
cmovgel %edx, %eax
movslq %eax, %r8
cmovael %edx, %edi
andb %cl, %sil
movb %sil, 0x27(%rsp)
movl $0xffff8acf, %r15d      # imm = 0xFFFF8ACF
shll $0x6, %edi
leaq 0x3964c7(%rip), %rax    # 0x3b4730
addq %rax, %rdi
movq %rdi, 0xa0(%rsp)
shlq $0x6, %r8
addq %rax, %r8
movq %r8, 0xa8(%rsp)
movl 0x4(%rsp), %ebp
movq %r14, 0x40(%rsp)
movl %ebp, 0x4(%rsp)
movl %r15d, 0x3c(%rsp)
movl 0x10(%rsp), %eax
cmpl 0x20(%rsp), %eax
leaq 0x17f0(%rsp), %r15
jge 0x1e827
movq 0x39a0(%rsp), %rdi
callq 0x1651c
testl %eax, %eax
je 0x1e827
movl %eax, %r12d
movq 0x60(%rsp), %rdi
callq 0x21c10
testb %al, %al
jne 0x1e827
movq 0x8(%rsp), %rax
movl 0x70(%rax), %ecx
incl %ecx
movl %ecx, 0x30(%rsp)
movl %ecx, 0x70(%rax)
movq %r14, %rdi
callq 0x52d0
movq %r15, %rdi
movl %r12d, %esi
leaq 0xb0(%rsp), %rdx
callq 0x18d4a
movl %r12d, %r14d
notl %r14d
testl $0x1f000, %r12d         # imm = 0x1F000
je 0x1e318
testw $0xc000, %r14w          # imm = 0xC000
jmp 0x1e326
movl %r12d, %ecx
andl $0x3f, %ecx
cmpl $0x10, 0x17f0(%rsp,%rcx,4)
setne %r13b
movzbl %r13b, %r15d
movzbl %al, %ebp
leaq 0x17f0(%rsp), %rdi
movl %r12d, %esi
movl %r15d, %edx
movl %ebp, %ecx
leaq 0x3(%rsp), %r8
callq 0x2161d
movl %r12d, 0x1dc(%rsp)
orb 0x78(%rsp), %r15b
jne 0x1e4f5
testw $0xc000, %r14w          # imm = 0xC000
leaq 0x17f0(%rsp), %r15
je 0x1e524
cmpb $0x0, 0x3(%rsp)
jne 0x1e524
movq %rax, 0x28(%rsp)
movl $0x100, %eax            # imm = 0x100
cmpl $0x1f, 0x50(%rsp)
movl 0x30(%rsp), %r13d
jg 0x1e3a2
leaq 0x399396(%rip), %rax    # 0x3b7730
movq 0x50(%rsp), %rcx
movl (%rax,%rcx,4), %eax
cmpl %eax, %r13d
jl 0x1e3eb
movl 0x4c(%rsp), %edx
testl %edx, %edx
je 0x1e3ca
movq %r15, %rdi
movl %r12d, %esi
callq 0x2170f
cmpl $0xffff8b35, 0x10(%rsp) # imm = 0xFFFF8B35
jl 0x1e3eb
testb %al, %al
je 0x1e3d4
jmp 0x1e3eb
cmpl $0xffff8b35, 0x10(%rsp) # imm = 0xFFFF8B35
jl 0x1e3eb
movq 0x40(%rsp), %r14
movq %r14, %rdi
callq 0x55d0
movq 0x18(%rsp), %r13
jmp 0x1e2ab
movq 0x28(%rsp), %rsi
addl 0x38(%rsp), %esi
cmpl $0x3f, %r13d
pushq $0x3f
popq %rax
cmovll %r13d, %eax
movslq %eax, %rcx
movq 0xa8(%rsp), %rax
movsbl (%rcx,%rax), %edx
movq %rsi, 0x28(%rsp)
movl %esi, %eax
subl %edx, %eax
movl $0xea62, %r15d          # imm = 0xEA62
cmpl $0xd, %eax
jg 0x1e43d
cmpl $0x2, %eax
pushq $0x1
popq %rdx
cmovgel %eax, %edx
shlq $0x8, %rdx
leaq 0x3982fa(%rip), %rsi    # 0x3b6730
addq %rsi, %rdx
movl (%rdx,%rcx,4), %r15d
addl 0x68(%rsp), %r15d
movl %r12d, %ecx
shrl $0x4, %ecx
andl $0xfc, %ecx
movl 0x17f0(%rsp,%rcx), %ecx
movl %r12d, %edx
andl $0x3f, %edx
shlq $0x8, %rcx
leaq 0x3995da(%rip), %rsi    # 0x3b7a40
addq %rsi, %rcx
addl 0x1000(%rcx,%rdx,4), %r15d
cmpl 0x20(%rsp), %r15d
jge 0x1e4ac
movq 0x40(%rsp), %r14
movq %r14, %rdi
callq 0x55d0
movq 0x8(%rsp), %rax
cmpl 0x6c(%rax), %r15d
movq 0x18(%rsp), %r13
jle 0x1e295
movq 0x8(%rsp), %rax
movl %r15d, 0x6c(%rax)
movl %r15d, 0x10(%rsp)
jmp 0x1e295
cmpl $0xffff8b35, 0x10(%rsp) # imm = 0xFFFF8B35
leaq 0x17f0(%rsp), %r15
jl 0x1e7ca
cmpl $0x3, %eax
jg 0x1e7ca
movq %r15, %rdi
movl %r12d, %esi
callq 0x1a668
testl %eax, %eax
jns 0x1e7ca
movq 0x40(%rsp), %r14
movq %r14, %rdi
callq 0x55d0
movq 0x18(%rsp), %r13
jmp 0x1e295
addl 0x38(%rsp), %eax
movq %rax, 0x28(%rsp)
movb 0x27(%rsp), %al
andb %r13b, %al
cmpb $0x1, %al
leaq 0x17f0(%rsp), %r15
jne 0x1e537
cmpb $0x0, 0x3(%rsp)
je 0x1e62a
movb $0x1, %al
movl %eax, 0x10(%rsp)
jmp 0x1e53c
addl 0x38(%rsp), %eax
movq %rax, 0x28(%rsp)
movl $0x0, 0x10(%rsp)
jmp 0x1e53c
movl %r13d, 0x10(%rsp)
movl $0x0, 0x4(%rsp)
movl 0x30(%rsp), %r13d
movq %r15, %rdi
movl %r12d, %esi
leaq 0x100(%rsp), %rdx
leaq 0xb0(%rsp), %rcx
movl %ebp, %r8d
callq 0x19162
movq 0x8(%rsp), %rax
movl 0x68(%rax), %r15d
movb $0x1, %al
cmpl $0x6, 0x50(%rsp)
jl 0x1e618
cmpb $0x0, 0x10(%rsp)
jne 0x1e618
testw $0xc000, %r14w          # imm = 0xC000
je 0x1e618
cmpb $0x0, 0x3(%rsp)
movl 0x4(%rsp), %ebp
jne 0x1e623
cmpl %r12d, 0x1ec(%rsp)
je 0x1e623
cmpl %r12d, 0x1f0(%rsp)
je 0x1e623
cmpl $0x3f, %r13d
pushq $0x3f
popq %rax
cmovgel %eax, %r13d
movslq %r13d, %rax
movq 0xa0(%rsp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, 0x1f4(%rsp)
testl %eax, %eax
je 0x1e67f
movq 0x28(%rsp), %rcx
movl %ecx, %r8d
subl %eax, %r8d
movl %r15d, %edx
notl %edx
movl %r15d, %ecx
negl %ecx
leaq 0x17f0(%rsp), %rdi
leaq 0x210(%rsp), %rsi
callq 0x1fa26
negl %eax
movl %eax, 0x3c(%rsp)
cmpl %eax, %r15d
setl %al
jmp 0x1e681
movq 0x18(%rsp), %r13
movl 0x4(%rsp), %ebp
jmp 0x1e68e
movq 0x18(%rsp), %r13
jmp 0x1e68e
movl %r12d, %ecx
andl $0xc000, %ecx           # imm = 0xC000
movl 0x4(%rsp), %edx
movl %edx, %eax
negl %eax
cmovsl %edx, %eax
movl $0x0, 0x4(%rsp)
cmpl $0x4000, %ecx           # imm = 0x4000
movl 0x30(%rsp), %r13d
je 0x1e7bf
movb $0x1, %cl
movl %ecx, 0x10(%rsp)
cmpl $0x74cb, %eax           # imm = 0x74CB
ja 0x1e549
movq %r15, %rdi
movl %r12d, %esi
callq 0x1a668
shrl $0x1f, %eax
movl %eax, 0x4(%rsp)
jmp 0x1e549
movb $0x1, %al
movq 0x18(%rsp), %r13
andl $0x0, 0x1f4(%rsp)
testb %bpl, %bpl
je 0x1e6eb
movl $0x6, 0x1f4(%rsp)
leal -0x12c(%r15), %ebp
movq 0x28(%rsp), %rax
leal -0x6(%rax), %r8d
movl $0x12b, %edx            # imm = 0x12B
subl %r15d, %edx
movl $0x12c, %ecx            # imm = 0x12C
subl %r15d, %ecx
leaq 0x17f0(%rsp), %r14
movq %r14, %rdi
leaq 0x210(%rsp), %rsi
callq 0x1fa26
movl %eax, %r15d
negl %r15d
andl $0x0, 0x1f4(%rsp)
cmpl %r15d, %ebp
jl 0x1e6fc
jmp 0x1e725
testb %al, %al
leaq 0x17f0(%rsp), %r14
movl 0x3c(%rsp), %r15d
je 0x1e725
movq 0x8(%rsp), %rax
movl 0x68(%rax), %ecx
movl %ecx, %edx
notl %edx
negl %ecx
movq %r14, %rdi
leaq 0x210(%rsp), %rsi
movq 0x28(%rsp), %r8
callq 0x1fa26
movl %eax, %r15d
negl %r15d
movq %r14, %rdi
movl %r12d, %esi
callq 0x1a056
movq 0x40(%rsp), %r14
movq %r14, %rdi
callq 0x55d0
movq 0x8(%rsp), %rax
movl 0x6c(%rax), %ecx
movl 0x68(%rax), %ebp
movl %ecx, 0x10(%rsp)
cmpl %ecx, %r15d
jle 0x1e28c
movq 0x60(%rsp), %rdi
callq 0x21c10
testb %al, %al
jne 0x1e28c
movq 0x8(%rsp), %rax
movl %r15d, 0x6c(%rax)
movl %r15d, 0x10(%rsp)
cmpl %ebp, %r15d
jle 0x1e28c
movq 0x8(%rsp), %rax
movb $0x1, 0x74(%rax)
movl $0x752f, %eax           # imm = 0x752F
subl 0x1d8(%rsp), %eax
cmpl %eax, %r15d
jne 0x1e7a0
movl %r12d, 0x1e0(%rsp)
movl %r12d, 0x1e8(%rsp)
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rax
movl %r12d, 0x10(%rax)
movl %r15d, 0x10(%rsp)
jmp 0x1e28c
movb $0x1, %al
movl %eax, 0x10(%rsp)
jmp 0x1e549
movl $0x0, 0x10(%rsp)
movl $0x0, 0x4(%rsp)
jmp 0x1e549
movq 0x8(%rsp), %rcx
movq 0x68(%rsp), %rax
movb $0x0, 0x75(%rcx,%rax)
movq 0x3120(%rsp), %rax
addq %rax, 0x60(%rcx)
movq 0x10(%rsp), %rdi
callq 0x52d0
movq 0x98(%rsp), %r14
movl 0x5c(%rsp), %ebp
movq 0x90(%rsp), %r15
movq 0x88(%rsp), %r12
movq 0x18(%rsp), %r13
jmp 0x1e866
movq 0x8(%rsp), %rcx
movq 0x70(%rsp), %rax
movb $0x0, 0x75(%rcx,%rax)
movq 0x3120(%rsp), %rax
addq %rax, 0x60(%rcx)
movq %r14, %rdi
callq 0x52d0
movq 0x98(%rsp), %r14
movl 0x5c(%rsp), %ebp
movq 0x90(%rsp), %r15
movq 0x88(%rsp), %r12
movl $0x2, (%r14)
cmpb $0x1, 0x30(%r15)
jne 0x1e8a9
movq 0x8(%rsp), %rax
movslq 0x20(%rax), %rax
cmpl %ebp, %eax
je 0x1e8a9
imulq $0x560, %rax, %rdi      # imm = 0x560
movq 0x80(%rsp), %rax
movl 0x88(%rax,%rdi), %eax
cmpl $0x2, %eax
jne 0x1e8a9
addq 0x80(%rsp), %rdi
callq 0x21be2
movslq 0x34(%r15), %rax
xorl %ecx, %ecx
testq %rbx, %rbx
je 0x1e8c5
cmpq %rax, %rcx
jge 0x1e8c5
cmpb $0x0, 0x75(%rbx,%rcx)
jne 0x1e8c5
incq %rcx
jmp 0x1e8af
cmpl %ecx, %eax
jne 0x1db46
addq $0x38, %rbx
movq %rbx, %rdi
callq 0x55d0
movq %rbx, %rdi
callq 0x52d0
movl $0x1, (%r14)
jmp 0x1e8f1
movl $0x5, (%r14)
addq $0x39a8, %rsp           # imm = 0x39A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop