RtlpFindRegTziForCurrentYear

__int64 __fastcall RtlpFindRegTziForCurrentYear(__int64 a1, const WCHAR *a2, __int16 a3){
  int v3; 
  int v6; 
  __int16 v7; 
  int v9; 
  int v10; 
  _RTL_QUERY_REGISTRY_TABLE result; 
  int v12; 
  const wchar_t *v13; 
  int *v14; 
  int v15; 
  _RTL_QUERY_REGISTRY_TABLE QueryTable; 
  wchar_t DstBuf[8]; 
  v3 = a3;
  *(_OWORD *)a1 = 0i64;
  *(_OWORD *)(a1 + 16) = 0i64;
  *(_QWORD *)(a1 + 32) = 0i64;
  *(_DWORD *)(a1 + 40) = 0;
  v6 = -1073741811;
  if( !itow_s(a3, DstBuf, 5ui64, 10) )
  {
    memset((INT64)&result, 0i64);
    result.Name = L"FirstEntry";
    result.Flags = 292;
    result.DefaultType = 0x4000000;
    result.EntryContext = &v9;
    v15 = 0x4000000;
    v13 = L"LastEntry";
    v9 = -4;
    v14 = &v10;
    v12 = 292;
    QueryTable.Name = DstBuf;
    v10 = -4;
    QueryTable.Flags = 288;
    QueryTable.EntryContext = (void *)a1;
    QueryTable.DefaultType = 50331648;
    *(_DWORD *)a1 = -44;
    v6 = RtlQueryRegistryValuesEx(0x40000000ui64, a2, &result, 0i64, 0i64);
    if( v6 >= 0 )
    {
      v7 = v9;
      if( v10 == -4 || v9 == -4 )
        v6 = -1073741762;
      if( v6 >= 0 && (v3 > v10 || v3 < v9) )
      {
        if( v3 > v10 )
          v7 = v10;
        if( itow_s(v7, DstBuf, 5ui64, 10) )
        {
          return(unsigned int)-1073741762;
        }
        else
        {
          QueryTable.Flags = 292;
          QueryTable.DefaultType = 50331648;
          *(_DWORD *)a1 = -44;
          return(unsigned int)RtlQueryRegistryValuesEx(0x40000000ui64, a2, &QueryTable, 0i64, 0i64);
        }
      }
    }
  }
  return(unsigned int)v6;
}

Referenced by:

RtlpCheckDynamicTimeZoneInformation
RtlpUpdateDynamicTimeZones