MiAweViewInserter

INT64 __fastcall MiAweViewInserter(INT64 a1, RTL_BALANCED_NODE *a2){
  _ETHREAD *CurrentThread; 
  __int64 v4; 
  bool v5; 
  _QWORD *v6; 
  unsigned __int64 v7; 
  __int64 v8; 
  _QWORD *v9; 
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  v4 = *(_QWORD *)(a1 + 1680);
  MiLockAweVadsExclusive((INT64)CurrentThread);
  v5 = 0;
  v6 = *(_QWORD **)(v4 + 400);
  v7 = LODWORD(a2[1].Children[0][1].Children[0]) | ((unsigned __int64)LOBYTE(a2[1].Children[0][1].Right) << 32);
  if( v6 )
  {
    while( 1 )
    {
      v8 = v6[3];
      if( v7 > (*(unsigned int *)(v8 + 28) | ((unsigned __int64)*(unsigned __int8 *)(v8 + 33) << 32))
        || v7 >= (*(unsigned int *)(v8 + 24) | ((unsigned __int64)*(unsigned __int8 *)(v8 + 32) << 32)) )
      {
        v9 = (_QWORD *)v6[1];
        if( !v9 )
        {
          v5 = 1;
          break;
        }
      }
      else
      {
        v9 = (_QWORD *)*v6;
        if( !*v6 )
          break;
      }
      v6 = v9;
    }
  }
  RtlAvlInsertNodeEx((unsigned __int64 *)(v4 + 400), (__int64)v6, v5, a2);
  return MiUnlockAweVadsExclusive((__int64)CurrentThread);
}

Referenced by:

MiInsertVad