MiSearchChannelTable

NTSTATUS __stdcall MiSearchChannelTable(PVOID BugCheckParameter2){
  int v1; 
  _QWORD *v3; 
  int v4; 
  int v5; 
  _QWORD *v6; 

  v1 = *(&stru_140C4DB30 + 41);
  if( *(&stru_140C4DB30 + 40) > *(&stru_140C4DB30 + 41)
    || (v3 = (_QWORD *)(*(&stru_140C4DB30 + 28) + 16i64 * *(&stru_140C4DB30 + 40)),
        (unsigned __int64)BugCheckParameter2 < *v3)
    || *(&stru_140C4DB30 + 40) != *(&stru_140C4DB30 + 41) && (unsigned __int64)BugCheckParameter2 >= v3[2] )
  {
    v4 = 0;
    if( *(&stru_140C4DB30 + 41) < 0 )
LABEL_13:
      KeBugCheckEx(0x1Au, (PVOID)0x6202, BugCheckParameter2, 0i64, 0i64);
    while( 1 )
    {
      v5 = (v4 + v1) >> 1;
      v6 = (_QWORD *)(*(&stru_140C4DB30 + 28) + 16i64 * v5);
      if( (unsigned __int64)BugCheckParameter2 >= *v6 )
      {
        if( v5 == *(&stru_140C4DB30 + 41) || (unsigned __int64)BugCheckParameter2 < v6[2] )
        {
          *(&stru_140C4DB30 + 40) = (v4 + v1) >> 1;
          LODWORD(v3) = *(&stru_140C4DB30 + 56) + 16 * v5;
          return(int)v3;
        }
        v4 = v5 + 1;
      }
      else
      {
        if( !v5 )
          KeBugCheckEx(0x1Au, (PVOID)0x6200, BugCheckParameter2, v6, 0i64);
        v1 = v5 - 1;
      }
      if( v1 < v4 )
        goto LABEL_13;
    }
  }
  return(int)v3;
}

Referenced by:

MiPageToChannel
MiRestrictRangeToNode
MxPageAlwaysHot