SshpStopBlockerAccounting

UINT64 __fastcall SshpStopBlockerAccounting(INT64 a1, UINT64 a2, INT64 a3){
  UINT64 result; 
  int v4; 
  UINT64 v5; 
  unsigned __int64 v6; 
  UINT64 v7; 
  NTSTATUS *(__stdcall *v8)(HANDLE); 
  unsigned int v9; 
  result = *(_QWORD *)(a1 + 16);
  v4 = a3;
  v5 = a2;
  v6 = a1 + ((unsigned __int64)((*(_DWORD *)(a1 + 8) & 1) == 0) << 7);
  if( a2 >= result )
  {
    v7 = a2 - result;
    *(_QWORD *)(v6 + 24) += v7;
    v8 = SshpAccountingBucketLimits;
    v9 = 0;
    while( 1 )
    {
      if( v7 >= *(_QWORD *)v8 )
      {
        result = v9 + 1;
        if( v7 < *((_QWORD *)SshpAccountingBucketLimits + result) )
          break;
      }
      ++v9;
      v8 = (NTSTATUS *(__stdcall *)(HANDLE))((char *)v8 + 8);
      if( v9 >= 5 )
        goto LABEL_10;
    }
    result = v9;
    if( v4 )
    {
      ++*(_DWORD *)(v6 + 4i64 * v9 + 132);
      *(_QWORD *)(v6 + 8i64 * v9 + 72) += v7;
    }
    else
    {
      ++*(_DWORD *)(v6 + 4i64 * v9 + 112);
      *(_QWORD *)(v6 + 8i64 * v9 + 32) += v7;
    }
  }
LABEL_10:
  if( v4 == 1 )
    v5 = 0i64;
  *(_QWORD *)(a1 + 16) = v5;
  return result;
}

Referenced by:

SshpSetBlockerActive
SshpSetCollectionActive
SshpWriteBlocker