// File: Altius[P]hotspot2/src/hotspot2_part1.cpp
// Function: BackgroundRegionManager::findCutoff()
void BackgroundRegionManager::findCutoff()
{
  // In all three noise models employed (negative binomial (NB), binomial, and Poisson,
  // though the NB is essentially always used because the data essentially always has variance > mean),
  // the distribution monotonically decreases beyond its mode.
  // Our idea is to identify a cutoff, when one exists,
  // which essentially marks the upper bound of observed monotonic decrease.
  // (Observations beyond the cutoff are then "predominantly signal," rather than noise.)
  // We do this by starting just beyond the mode of the
  // moving averages (MAs) of occurrence counts.
  // Whenever we encounter a global minimum (among values seen so far) in the MAs,
  // we measure whether a subsequent MA is substantially greater,
  // i.e. above some threshold (e.g., an increase of 33.3% or more).
  // If such an extreme increase is observed,
  // then we declare that "global minimum so far" to be the cutoff value.
  // If we exhaust the set of observations and no such increase is detected,
  // the highest observation is returned, i.e., no points are actually "cut off."
  // If a new "global minimum so far" is observed, below the previous "global minimum so far,"
  // the previous global minimum is ignored and the search process begins anew at the new local minimum.
  //
  // If no "trend reversal" is detected, but we detect a contiguous set of empty histogram bins,
  // we set the cutoff at the value immediately preceding those empty histogram bins.

  int kcutoff_uponEntry = m_kcutoff;

  if (m_sampledDataDistnSize < m_MAlength)
    {
      // Too few distinct count values were observed to compute a moving average of length MAlength;
      // set the "cutoff" to the largest observed count, i.e., use all data, don't "cut off" any points.
      m_kcutoff = m_sampledDataDistnSize - 1;
      m_minMAxN = m_kTrendReversal = -1;
      m_modeXval = m_modeYval = -1;
      m_kvalsWithMinMAxN.clear();
      m_needToUpdate_kcutoff = false;

      if (m_kcutoff != kcutoff_uponEntry)
        {
        UpdateNullRegionStatsAndExit:
          // The boundary of the null region has changed.
          // Recompute the running sums and the number of observations in the null region.
          if (kcutoff_uponEntry <= 0)
            {
              // Compute from scratch.
              m_runningSum_count = m_runningSum_countSquared = 0;
              m_numPtsInNullRegion = 0;
              for (long kk = 0; kk <= static_cast<long>(m_kcutoff); kk++)
                {
                  m_runningSum_count += static_cast<long>(m_distn[kk].numOccs) * kk;
                  m_runningSum_countSquared += static_cast<long>(m_distn[kk].numOccs) * kk * kk;
                  m_numPtsInNullRegion += m_distn[kk].numOccs;
                }
            }
          else
            {
              if (m_kcutoff > kcutoff_uponEntry)
                {
                  // The null region has expanded; increase the values accordingly.
                  for (long kk = static_cast<long>(kcutoff_uponEntry + 1);
		       kk <= static_cast<long>(m_kcutoff); kk++)
                    {
                      m_runningSum_count += static_cast<long>(m_distn[kk].numOccs) * kk;
                      m_runningSum_countSquared += static_cast<long>(m_distn[kk].numOccs) * kk * kk;
                      m_numPtsInNullRegion += m_distn[kk].numOccs;
                    }
                }
              else
                {
                  // The null region has contracted; decrease the values accordingly.
                  for (long kk = static_cast<long>(kcutoff_uponEntry); kk > static_cast<long>(m_kcutoff); kk--)
                    {
                      m_runningSum_count -= static_cast<long>(m_distn[kk].numOccs) * kk;
                      m_runningSum_countSquared -= static_cast<long>(m_distn[kk].numOccs) * kk * kk;
                      m_numPtsInNullRegion -= m_distn[kk].numOccs;
                    }
                }
            }
        }

      return;
    }

  int sum(0), idxL(m_modeXval + 1), idxR(m_modeXval + 1 + m_MAlength - 1); // these idxL and idxR values will be ignored/replaced if !m_sliding
  int idxC = m_modeXval + 1 + m_MAlength / 2; // integer division; see commendt directly above re: idxL and idxR
  pair<int, int> xyCurMAxN;
  bool useGlobMin(false);

  if (!m_sliding)
    {
      // Need to compute the moving averages (MAs).
      // Technically, these aren't moving averages, they're sums,
      // because we're not dividing sums by the number of terms.
      // But these "MA x N" values function as MAs.
      // Benefits:  No unnecessary division and casting from int to double,
      // and we gain the ability to perform exact tests for equality
      // (int == int instead of double == double).
      idxL = 0;
      idxC = idxL + m_MAlength / 2;
      idxR = idxL + m_MAlength - 1;
      // Compute the initial moving average (times the number of terms).
      for (int i = idxL; i <= idxR; i++)
        sum += m_distn[i].numOccs;
      m_distn[idxC].MAxN = sum;
      if (-1 == m_modeYval || m_distn[idxC].MAxN > m_modeYval)
        {
          m_modeXval = idxC;
          m_modeYval = m_distn[idxC].MAxN;
        }
      while (idxR < m_sampledDataDistnSize - 1)
        {
          idxC++;
          idxR++;
          sum -= m_distn[idxL].numOccs;
          sum += m_distn[idxR].numOccs;
          m_distn[idxC].MAxN = sum;
          if (m_distn[idxC].MAxN > m_modeYval)
            {
              m_modeXval = idxC;
              m_modeYval = m_distn[idxC].MAxN;
            }
          idxL++;
        }
      if (idxL > m_modeXval + 1)
        {
          idxL = m_modeXval + 1;
          idxC = idxL + m_MAlength / 2;
          idxR = idxL + m_MAlength - 1;
        }
      // else the "while" loop below won't get executed
    }
  m_kvalsWithMinMAxN.clear();
  if (idxR != m_sampledDataDistnSize - 1)
    {
      m_kvalsWithMinMAxN.insert(idxC); // idxC == m_modeXval+1 + m_MAlength/2 here, whether !m_sliding or m_sliding==true
      m_minMAxN = m_distn[idxC].MAxN;
    }
  long double minMAxN = static_cast<long double>(m_minMAxN);

  idxR++;
  while (idxR < m_sampledDataDistnSize)
    {
      idxC++;
      xyCurMAxN.first = idxC;
      xyCurMAxN.second = m_distn[idxC].MAxN;
      if (static_cast<long double>(xyCurMAxN.second) > m_thresholdRatio * minMAxN)
        {
          useGlobMin = true;
          break;
        }
      else
        {
          if (0 == xyCurMAxN.second)
            {
              // We've detected a contiguous stretch of at least m_MAlength empty histogram bins.
              // Set the global minimum here, and break out of the loop.
              // m_kcutoff will be set following the exit from the loop.
              m_kvalsWithMinMAxN.clear();
              m_kvalsWithMinMAxN.insert(xyCurMAxN.first); // k == idxC
              m_minMAxN = 0;
              useGlobMin = true;
              break;
            }
        }
      if (xyCurMAxN.second <= m_minMAxN)
        {
          if (xyCurMAxN.second < m_minMAxN)
            {
              // This is a unique, new minimum.
              m_kvalsWithMinMAxN.clear();
              m_minMAxN = xyCurMAxN.second;
              minMAxN = static_cast<long double>(m_minMAxN);
            } // else it's a duplicate occurrence of the existing minimum
          m_kvalsWithMinMAxN.insert(xyCurMAxN.first); // k == idxC
        }
      idxL++;
      idxR++;
    }

  // If useGlobMin is false, then we exhausted all observed values
  // without finding an "extreme" global minimum in the moving averages.
  // Return the maximum observed count as the "cutoff."
  if (!useGlobMin)
    {
      m_kcutoff = m_sampledDataDistnSize - 1;
      m_kTrendReversal = -1;
      m_kvalsWithMinMAxN.clear();
      m_minMAxN = -1;
      m_needToUpdate_kcutoff = false;
      if (m_kcutoff != kcutoff_uponEntry)
        goto UpdateNullRegionStatsAndExit;
      return;
    }
  // Otherwise, return the "global minimum so far" as the cutoff.
  // If there are ties (multiple k values with the same MAxN values), return the highest of these k values.
  set<int>::const_iterator it = m_kvalsWithMinMAxN.end();
  int k = *(--it);
  m_kcutoff = k;

  if (m_minMAxN > 0)
    m_kTrendReversal = xyCurMAxN.first; // where we determined the monotonically decreasing trend to have reversed
  else
    m_kTrendReversal = -1;

  m_needToUpdate_kcutoff = false;
  if (m_kcutoff != kcutoff_uponEntry)
    goto UpdateNullRegionStatsAndExit;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0xb0(%rbp)
movl 0x110(%rcx), %eax
movl %eax, -0xc(%rbp)
movl 0x160(%rcx), %eax
cmpl 0x3c(%rcx), %eax
jge 0x494f
movq -0xb0(%rbp), %rdi
movl 0x160(%rdi), %eax
subl $0x1, %eax
movl %eax, 0x110(%rdi)
movl $0xffffffff, 0x114(%rdi) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x150(%rdi) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x10c(%rdi) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x108(%rdi) # imm = 0xFFFFFFFF
addq $0x120, %rdi            # imm = 0x120
callq 0xaa40
movq -0xb0(%rbp), %rax
movb $0x0, 0x119(%rax)
movl 0x110(%rax), %eax
cmpl -0xc(%rbp), %eax
je 0x494a
jmp 0x46fb
cmpl $0x0, -0xc(%rbp)
jg 0x47cf
movq -0xb0(%rbp), %rax
movq $0x0, 0x18(%rax)
movq $0x0, 0x10(%rax)
movl $0x0, 0x20(%rax)
movq $0x0, -0x18(%rbp)
movq -0xb0(%rbp), %rcx
movq -0x18(%rbp), %rax
movslq 0x110(%rcx), %rcx
cmpq %rcx, %rax
jg 0x47ca
movq -0xb0(%rbp), %rdi
addq $0x50, %rdi
movq -0x18(%rbp), %rsi
callq 0xa950
movq -0xb0(%rbp), %rdi
movslq (%rax), %rax
imulq -0x18(%rbp), %rax
addq 0x10(%rdi), %rax
movq %rax, 0x10(%rdi)
addq $0x50, %rdi
movq -0x18(%rbp), %rsi
callq 0xa950
movq -0xb0(%rbp), %rdi
movslq (%rax), %rax
imulq -0x18(%rbp), %rax
imulq -0x18(%rbp), %rax
addq 0x18(%rdi), %rax
movq %rax, 0x18(%rdi)
addq $0x50, %rdi
movq -0x18(%rbp), %rsi
callq 0xa950
movq %rax, %rcx
movq -0xb0(%rbp), %rax
movl (%rcx), %ecx
addl 0x20(%rax), %ecx
movl %ecx, 0x20(%rax)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x472b
jmp 0x4948
movq -0xb0(%rbp), %rax
movl 0x110(%rax), %eax
cmpl -0xc(%rbp), %eax
jle 0x4895
movl -0xc(%rbp), %eax
addl $0x1, %eax
cltq
movq %rax, -0x20(%rbp)
movq -0xb0(%rbp), %rcx
movq -0x20(%rbp), %rax
movslq 0x110(%rcx), %rcx
cmpq %rcx, %rax
jg 0x4890
movq -0xb0(%rbp), %rdi
addq $0x50, %rdi
movq -0x20(%rbp), %rsi
callq 0xa950
movq -0xb0(%rbp), %rdi
movslq (%rax), %rax
imulq -0x20(%rbp), %rax
addq 0x10(%rdi), %rax
movq %rax, 0x10(%rdi)
addq $0x50, %rdi
movq -0x20(%rbp), %rsi
callq 0xa950
movq -0xb0(%rbp), %rdi
movslq (%rax), %rax
imulq -0x20(%rbp), %rax
imulq -0x20(%rbp), %rax
addq 0x18(%rdi), %rax
movq %rax, 0x18(%rdi)
addq $0x50, %rdi
movq -0x20(%rbp), %rsi
callq 0xa950
movq %rax, %rcx
movq -0xb0(%rbp), %rax
movl (%rcx), %ecx
addl 0x20(%rax), %ecx
movl %ecx, 0x20(%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x47f1
jmp 0x4946
movslq -0xc(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0xb0(%rbp), %rcx
movq -0x28(%rbp), %rax
movslq 0x110(%rcx), %rcx
cmpq %rcx, %rax
jle 0x4944
movq -0xb0(%rbp), %rdi
addq $0x50, %rdi
movq -0x28(%rbp), %rsi
callq 0xa950
movq -0xb0(%rbp), %rdi
movslq (%rax), %rcx
imulq -0x28(%rbp), %rcx
movq 0x10(%rdi), %rax
subq %rcx, %rax
movq %rax, 0x10(%rdi)
addq $0x50, %rdi
movq -0x28(%rbp), %rsi
callq 0xa950
movq -0xb0(%rbp), %rdi
movslq (%rax), %rcx
imulq -0x28(%rbp), %rcx
imulq -0x28(%rbp), %rcx
movq 0x18(%rdi), %rax
subq %rcx, %rax
movq %rax, 0x18(%rdi)
addq $0x50, %rdi
movq -0x28(%rbp), %rsi
callq 0xa950
movq %rax, %rcx
movq -0xb0(%rbp), %rax
movl (%rcx), %edx
movl 0x20(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x20(%rax)
movq -0x28(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x489d
jmp 0x4946
jmp 0x4948
jmp 0x494a
jmp 0x4ef8
movq -0xb0(%rbp), %rax
movl $0x0, -0x2c(%rbp)
movl 0x108(%rax), %ecx
addl $0x1, %ecx
movl %ecx, -0x30(%rbp)
movl 0x108(%rax), %ecx
addl $0x1, %ecx
addl 0x3c(%rax), %ecx
subl $0x1, %ecx
movl %ecx, -0x34(%rbp)
movl 0x108(%rax), %ecx
addl $0x1, %ecx
movl %ecx, -0xb4(%rbp)
movl 0x3c(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0xb4(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x38(%rbp)
leaq -0x40(%rbp), %rdi
callq 0xaa60
movq -0xb0(%rbp), %rax
movb $0x0, -0x41(%rbp)
testb $0x1, 0x118(%rax)
jne 0x4c0f
movq -0xb0(%rbp), %rcx
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0xb8(%rbp)
movl 0x3c(%rcx), %eax
movl $0x2, %esi
cltd
idivl %esi
movl %eax, %edx
movl -0xb8(%rbp), %eax
addl %edx, %eax
movl %eax, -0x38(%rbp)
movl -0x30(%rbp), %eax
addl 0x3c(%rcx), %eax
subl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x34(%rbp), %eax
jg 0x4a33
movq -0xb0(%rbp), %rdi
addq $0x50, %rdi
movslq -0x48(%rbp), %rsi
callq 0xa950
movl (%rax), %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x4a04
movq -0xb0(%rbp), %rdi
movl -0x2c(%rbp), %eax
movl %eax, -0xbc(%rbp)
addq $0x50, %rdi
movslq -0x38(%rbp), %rsi
callq 0xa950
movl -0xbc(%rbp), %edx
movq -0xb0(%rbp), %rcx
movl %edx, 0x30(%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x10c(%rcx), %eax
je 0x4a93
movq -0xb0(%rbp), %rdi
addq $0x50, %rdi
movslq -0x38(%rbp), %rsi
callq 0xa950
movq -0xb0(%rbp), %rcx
movl 0x30(%rax), %eax
cmpl 0x10c(%rcx), %eax
jle 0x4ac3
movq -0xb0(%rbp), %rdi
movl -0x38(%rbp), %eax
movl %eax, 0x108(%rdi)
addq $0x50, %rdi
movslq -0x38(%rbp), %rsi
callq 0xa950
movq %rax, %rcx
movq -0xb0(%rbp), %rax
movl 0x30(%rcx), %ecx
movl %ecx, 0x10c(%rax)
jmp 0x4ac5
movq -0xb0(%rbp), %rcx
movl -0x34(%rbp), %eax
movl 0x160(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x4bb6
movq -0xb0(%rbp), %rdi
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
addq $0x50, %rdi
movslq -0x30(%rbp), %rsi
callq 0xa950
movq -0xb0(%rbp), %rdi
movl (%rax), %ecx
movl -0x2c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
addq $0x50, %rdi
movslq -0x34(%rbp), %rsi
callq 0xa950
movq -0xb0(%rbp), %rdi
movl (%rax), %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0xc0(%rbp)
addq $0x50, %rdi
movslq -0x38(%rbp), %rsi
callq 0xa950
movl -0xc0(%rbp), %ecx
movq -0xb0(%rbp), %rdi
movl %ecx, 0x30(%rax)
addq $0x50, %rdi
movslq -0x38(%rbp), %rsi
callq 0xa950
movq -0xb0(%rbp), %rcx
movl 0x30(%rax), %eax
cmpl 0x10c(%rcx), %eax
jle 0x4ba8
movq -0xb0(%rbp), %rdi
movl -0x38(%rbp), %eax
movl %eax, 0x108(%rdi)
addq $0x50, %rdi
movslq -0x38(%rbp), %rsi
callq 0xa950
movq %rax, %rcx
movq -0xb0(%rbp), %rax
movl 0x30(%rcx), %ecx
movl %ecx, 0x10c(%rax)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x4ac5
movq -0xb0(%rbp), %rcx
movl -0x30(%rbp), %eax
movl 0x108(%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jle 0x4c0d
movq -0xb0(%rbp), %rcx
movl 0x108(%rcx), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0xc4(%rbp)
movl 0x3c(%rcx), %eax
movl $0x2, %esi
cltd
idivl %esi
movl %eax, %edx
movl -0xc4(%rbp), %eax
addl %edx, %eax
movl %eax, -0x38(%rbp)
movl -0x30(%rbp), %eax
addl 0x3c(%rcx), %eax
subl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x4c0f
movq -0xb0(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
callq 0xaa40
movq -0xb0(%rbp), %rcx
movl -0x34(%rbp), %eax
movl 0x160(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
je 0x4c7e
movq -0xb0(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
leaq -0x38(%rbp), %rsi
callq 0xaa80
movq -0xb0(%rbp), %rdi
movq %rax, -0x58(%rbp)
movb %dl, -0x50(%rbp)
addq $0x50, %rdi
movslq -0x38(%rbp), %rsi
callq 0xa950
movq %rax, %rcx
movq -0xb0(%rbp), %rax
movl 0x30(%rcx), %ecx
movl %ecx, 0x150(%rax)
movq -0xb0(%rbp), %rax
movl 0x150(%rax), %eax
movl %eax, -0xa0(%rbp)
fildl -0xa0(%rbp)
fstpt -0x70(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0xb0(%rbp), %rcx
movl -0x34(%rbp), %eax
cmpl 0x160(%rcx), %eax
jge 0x4e03
movq -0xb0(%rbp), %rdi
movl -0x38(%rbp), %eax
incl %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x40(%rbp)
addq $0x50, %rdi
movslq -0x38(%rbp), %rsi
callq 0xa950
movq %rax, %rcx
movq -0xb0(%rbp), %rax
movl 0x30(%rcx), %ecx
movl %ecx, -0x3c(%rbp)
movl -0x3c(%rbp), %ecx
movl %ecx, -0xa4(%rbp)
fildl -0xa4(%rbp)
fldt 0x40(%rax)
fldt -0x70(%rbp)
fmulp %st, %st(1)
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jbe 0x4d15
jmp 0x4d0c
movb $0x1, -0x41(%rbp)
jmp 0x4e03
xorl %eax, %eax
cmpl -0x3c(%rbp), %eax
jne 0x4d6a
movq -0xb0(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
callq 0xaa40
movq -0xb0(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
leaq -0x40(%rbp), %rsi
callq 0xaa80
movq %rax, %rcx
movq -0xb0(%rbp), %rax
movq %rcx, -0x80(%rbp)
movb %dl, -0x78(%rbp)
movl $0x0, 0x150(%rax)
movb $0x1, -0x41(%rbp)
jmp 0x4e03
jmp 0x4d6c
movq -0xb0(%rbp), %rcx
movl -0x3c(%rbp), %eax
cmpl 0x150(%rcx), %eax
jg 0x4dec
movq -0xb0(%rbp), %rcx
movl -0x3c(%rbp), %eax
cmpl 0x150(%rcx), %eax
jge 0x4dc8
movq -0xb0(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
callq 0xaa40
movq -0xb0(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl %ecx, 0x150(%rax)
movl 0x150(%rax), %eax
movl %eax, -0xa8(%rbp)
fildl -0xa8(%rbp)
fstpt -0x70(%rbp)
movq -0xb0(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
leaq -0x40(%rbp), %rsi
callq 0xaa80
movq %rax, -0x90(%rbp)
movb %dl, -0x88(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x4ca3
testb $0x1, -0x41(%rbp)
jne 0x4e62
movq -0xb0(%rbp), %rdi
movl 0x160(%rdi), %eax
subl $0x1, %eax
movl %eax, 0x110(%rdi)
movl $0xffffffff, 0x114(%rdi) # imm = 0xFFFFFFFF
addq $0x120, %rdi            # imm = 0x120
callq 0xaa40
movq -0xb0(%rbp), %rax
movl $0xffffffff, 0x150(%rax) # imm = 0xFFFFFFFF
movb $0x0, 0x119(%rax)
movl 0x110(%rax), %eax
cmpl -0xc(%rbp), %eax
je 0x4e5d
jmp 0x46fb
jmp 0x4ef8
movq -0xb0(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
callq 0xaad0
movq %rax, -0x98(%rbp)
leaq -0x98(%rbp), %rdi
callq 0xab00
movq %rax, %rdi
callq 0xab30
movq %rax, %rcx
movq -0xb0(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, -0x9c(%rbp)
movl -0x9c(%rbp), %ecx
movl %ecx, 0x110(%rax)
cmpl $0x0, 0x150(%rax)
jle 0x4ec9
movq -0xb0(%rbp), %rax
movl -0x40(%rbp), %ecx
movl %ecx, 0x114(%rax)
jmp 0x4eda
movq -0xb0(%rbp), %rax
movl $0xffffffff, 0x114(%rax) # imm = 0xFFFFFFFF
movq -0xb0(%rbp), %rax
movb $0x0, 0x119(%rax)
movl 0x110(%rax), %eax
cmpl -0xc(%rbp), %eax
je 0x4ef8
jmp 0x46fb
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)