WbDecryptWarbirdEncryptionSegment

INT64 __fastcall WbDecryptWarbirdEncryptionSegment(
        INT64 a1,
        struct wil_details_FeatureReportingCache *a2,
        INT64 a3,
        INT64 a4){
  __int64 v4; 
  unsigned int v5; 
  __int64 v7; 
  __int64 v8; 
  unsigned int v9; 
  unsigned int v10; 
  unsigned int v11; 
  __int64 v12; 
  int v13; 
  int v15; 
  v4 = *(_QWORD *)(a1 + 64);
  v5 = 0;
  if( v4 != -1 )
  {
    v7 = v4 + 1;
    *(_QWORD *)(a1 + 64) = v7;
    if( v7 == 1 )
    {
      if( *(_DWORD *)(a1 + 48) == 1 )
      {
        v8 = *(_QWORD *)(a1 + 56);
      }
      else
      {
        v15 = 3;
        if( (unsigned int)wil_details_FeatureReporting_ReportUsageToServiceDirect(
                             (struct wil_details_FeatureReportingCache *)a1,
                             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 *)&v15,
            0i64,
            0,
            1ui64);
        }
        if( *(_DWORD *)(a1 + 48) )
          return(unsigned int)-1073741811;
        v8 = *(_QWORD *)(a1 + 56);
      }
      v9 = *(_DWORD *)(v8 + 240);
      v10 = *(_DWORD *)(a1 + 72);
      if( v10 < v9 )
      {
        v11 = *(_DWORD *)(a1 + 76);
        while( 1 )
        {
          v12 = v10 >= v11;
          if( *(_DWORD *)(a1 + 48) == 1 )
          {
            v13 = sub_140963C98((INT64 *)a1, v10 >= v11, (_DWORD *)(16i64 * v10 + *(_QWORD *)(a1 + 56) + 248i64));
          }
          else
          {
            v15 = 3;
            if( (unsigned int)wil_details_FeatureReporting_ReportUsageToServiceDirect(
                                 (struct wil_details_FeatureReportingCache *)a1,
                                 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 *)&v15,
                0i64,
                0,
                1ui64);
            }
            if( *(_DWORD *)(a1 + 48) )
              return(unsigned int)-1073741811;
            v13 = WbDecryptWarbirdEncryptionSegmentBlockV0(
                    (INT64 *)a1,
                    (unsigned int)v12,
                    (_DWORD *)(*(_QWORD *)(a1 + 56) + 4 * (3i64 * v10 + 61)));
          }
          v5 = v13;
          if( v13 >= 0 )
          {
            *(_DWORD *)(a1 + 76) += v12;
            ++v10;
            ++*(_DWORD *)(a1 + 72);
            v11 = *(_DWORD *)(a1 + 76);
            if( v10 < v9 )
              continue;
          }
          return v5;
        }
      }
    }
  }
  return v5;
}

Referenced by:

WbDecryptEncryptionSegment