WbReEncryptWarbirdEncryptionSegment

INT64 __fastcall WbReEncryptWarbirdEncryptionSegment(
        INT64 a1,
        struct wil_details_FeatureReportingCache *a2,
        INT64 a3,
        INT64 a4){
  struct wil_details_FeatureReportingCache *v5; 
  __int64 v6; 
  __int64 v7; 
  int v8; 
  int v9; 
  int v11; 
  v5 = 0i64;
  v6 = *(_QWORD *)(a1 + 64);
  if( v6 )
  {
    v7 = v6 - 1;
    *(_QWORD *)(a1 + 64) = v7;
    if( !v7 )
    {
      v8 = *(_DWORD *)(a1 + 72);
      while( --v8 >= 0 )
      {
        if( *(_DWORD *)(a1 + 48) == 1 )
        {
          v9 = sub_140963E88(a1, (UINT64 *)(16i64 * v8 + *(_QWORD *)(a1 + 56) + 248i64));
        }
        else
        {
          v11 = 3;
          if( (unsigned int)wil_details_FeatureReporting_ReportUsageToServiceDirect(
                               v5,
                               a2,
                               a3,
                               a4,
                               wil_details_ServiceReportingKind_PotentialDeviceUsage)
            && g_wil_details_pfnFeatureLoggingHook )
          {
            g_wil_details_pfnFeatureLoggingHook(
              0xE67B5Au,
              &Feature_PdttSupport_logged_traits,
              0i64,
              0,
              (const enum wil_ReportingKind *)&v11,
              0i64,
              0,
              1ui64);
          }
          if( *(_DWORD *)(a1 + 48) )
          {
            LODWORD(v5) = -1073741811;
            return(unsigned int)v5;
          }
          v9 = sub_1405D27A4(a1, (UINT64 *)(*(_QWORD *)(a1 + 56) + 4 * (3i64 * v8 + 61)));
        }
        v5 = (struct wil_details_FeatureReportingCache *)(unsigned int)v9;
        if( v9 < 0 )
          return(unsigned int)v5;
        --*(_DWORD *)(a1 + 72);
      }
    }
  }
  return(unsigned int)v5;
}

Referenced by:

WbReEncryptEncryptionSegment