Phase1InitializationDiscard

UINT8 __fastcall Phase1InitializationDiscard(VOID *Context){
  __int64 v2; 
  char *PoolWithTag; 
  _ETHREAD *CurrentThread; 
  char *v5; 
  char *v6; 
  CHAR *v7; 
  CHAR *v8; 
  CHAR *v9; 
  CHAR *v10; 
  __int16 v11; 
  int v12; 
  CHAR v13; 
  CHAR *v14; 
  CHAR *v15; 
  CHAR *v16; 
  __int64 v17; 
  CHAR v18; 
  CHAR **v19; 
  NTSTATUS Message; 
  NTSTRSAFE_PSTR v21; 
  int v22; 
  int v23; 
  UINT64 v24; 
  char *v25; 
  int v26; 
  int v27; 
  NTSTATUS v28; 
  int v29; 
  _OWORD *v30; 
  char *v31; 
  __int64 v32; 
  __int128 v33; 
  int v34; 
  CHAR *v35; 
  CHAR *v36; 
  __int16 v37; 
  WCHAR v38; 
  CHAR *v39; 
  CHAR *v40; 
  CHAR *v41; 
  CHAR *v42; 
  CHAR *v43; 
  CHAR *v44; 
  CHAR *v45; 
  CHAR *v46; 
  CHAR *v47; 
  CHAR *v48; 
  PVOID v49; 
  const char *v50; 
  INT8 v51; 
  UINT64 v52; 
  NTSTATUS v53; 
  __int64 v54; 
  __int64 v55; 
  UINT8 *v56; 
  INT8 *Text; 
  int v58; 
  int inited; 
  int v60; 
  int SystemRootLink; 
  _NLSTABLEINFO *v62; 
  NTSTATUS v63; 
  NTSTATUS v64; 
  ULONG_PTR v65; 
  NTSTATUS v66; 
  UINT8 *v67; 
  UINT8 *v68; 
  UINT16 *v69; 
  UINT16 *v70; 
  _NLSTABLEINFO *v71; 
  BOOL v72; 
  int v73; 
  NTSTATUS(__stdcall *DisplayContext)(PDEVICE_OBJECT, PVOID, PDEVICE_CHANGE_COMPLETE_CALLBACK, PVOID); 
  ULONG_PTR v75; 
  NTSTATUS v76; 
  NTSTATUS v77; 
  INT64 v78; 
  int v79; 
  int v80; 
  const INT8 *v81; 
  CHAR *v82; 
  CHAR *v83; 
  __int64 v84; 
  INT8 *v85; 
  const INT8 *v86; 
  int v87; 
  int v88; 
  UINT64 v89; 
  NTSTATUS v90; 
  NTSTATUS v91; 
  int v92; 
  PMESSAGE_RESOURCE_ENTRY *MessageResourceEntry; 
  PMESSAGE_RESOURCE_ENTRY *MessageResourceEntrya; 
  struct _STRING *pszFormat; 
  char v97; 
  union _LARGE_INTEGER Time; 
  int v99; 
  PMESSAGE_RESOURCE_ENTRY v100; 
  UINT64 ResultDataSize; 
  LARGE_INTEGER SystemTime; 
  int v103; 
  char *EndPtr; 
  size_t pcbRemaining; 
  NTSTRSAFE_PSTR ppszDestEnd; 
  void *SectionHandle; 
  _LARGE_INTEGER OldTime; 
  PMESSAGE_RESOURCE_ENTRY v109; 
  union _LARGE_INTEGER MaximumSize; 
  PVOID Object; 
  PVOID MappedBase; 
  PMESSAGE_RESOURCE_ENTRY v113; 
  struct _STRING v114; 
  __int64 v115; 
  ULONG_PTR ViewSize; 
  struct _TIME_FIELDS TimeFields; 
  struct _UNICODE_STRING DestinationString; 
  INT64 result[5]; 
  __int128 v120; 
  __int128 v121; 
  INT8 pszDest[24]; 
  Time.QuadPart = 0i64;
  SystemTime.QuadPart = 0i64;
  OldTime.QuadPart = 0i64;
  v114 = 0i64;
  SectionHandle = 0i64;
  MaximumSize.QuadPart = 0i64;
  v100 = 0i64;
  v109 = 0i64;
  TimeFields = 0i64;
  LOBYTE(v99) = 0;
  ResultDataSize = 0i64;
  DestinationString = 0i64;
  v2 = PsGetCurrentServerSiloGlobals()[133];
  v115 = v2;
  PoolWithTag = (char *)ExAllocatePoolWithTag(NonPagedPoolNx, 0x200ui64, 0x74696E49ui64);
  if( !PoolWithTag )
    KeBugCheck(0x31ui64);
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  *(_DWORD *)InitializationPhase = 1;
  v97 = 0;
  KeSetPriorityThread((PKTHREAD)CurrentThread, 31);
  v5 = (char *)*((_QWORD *)Context + 27);
  if( v5 )
    v6 = strupr(v5);
  else
    v6 = 0i64;
  if( v6 )
  {
    v7 = strstr(v6, " HYPERVISORROOTPROC=");
    if( v7 )
    {
      v8 = strstr(v7, "=");
      if( v8 )
        KeRootProcSpecified = atol(v8 + 1);
    }
    v9 = strstr(v6, " HYPERVISORROOTPROCNUMANODES=");
    if( v9 )
    {
      v10 = strstr(v9, "=");
      if( v10 )
      {
        do
        {
          if( (unsigned int)KeRootProcNumaNodesSpecified >= 0x40 )
            break;
          v11 = atol(++v10);
          v12 = KeRootProcNumaNodesSpecified;
          KeRootProcNumaNodes[KeRootProcNumaNodesSpecified] = v11;
          KeRootProcNumaNodesSpecified = v12 + 1;
          while( 1 )
          {
            v13 = *v10;
            if( *v10 == 44 )
              break;
            if( v13 == 32 )
              goto LABEL_19;
            if( !v13 )
              break;
            ++v10;
          }
        }
        while( v13 != 32 && v13 );
      }
    }
LABEL_19:
    v14 = strstr(v6, " HYPERVISORROOTPROCNUMANODELPS=");
    if( v14 )
    {
      v15 = strstr(v14, "=");
      KeRootProcNumaNodeLpsSpecified = 1;
      v16 = v15;
      KeRootProcNumaNodesSpecified = 0;
      KeRootProcSpecified = 0;
      if( v15 )
      {
        do
        {
          ++v16;
          EndPtr = 0i64;
          v17 = (unsigned int)strtoul(v16, &EndPtr, 10i64);
          if( v16 != EndPtr && *EndPtr == 61 && (unsigned int)v17 < 0x40 )
          {
            v16 = EndPtr + 1;
            KeRootProcNumaNodeLps[v17] = strtoui64(EndPtr + 1, &EndPtr, 16);
          }
          while( 1 )
          {
            v18 = *v16;
            if( *v16 == 44 )
              break;
            if( v18 == 32 )
              goto LABEL_31;
            if( !v18 )
              break;
            ++v16;
          }
        }
        while( v18 != 32 && v18 );
LABEL_31:
        v2 = v115;
      }
    }
  }
  KePerformGroupConfiguration((_LOADER_PARAMETER_BLOCK *)Context);
  if( !HalInitSystem(*(unsigned int *)InitializationPhase, (_LOADER_PARAMETER_BLOCK *)Context) )
    goto LABEL_177;
  KeInitializeClock(*(unsigned int *)InitializationPhase, (_LOADER_PARAMETER_BLOCK *)Context);
  if( !v6 || !strstr(v6, "NOGUIBOOT") )
  {
    InbvEnableDisplayString(0);
    BgkDisplayProgressIndicator();
    BgkDisplayBackgroundUpdate();
    InbvInstallDisplayStringFilter(DisplayFilter, v19);
    InbvDriverInitialize(1i64, (_LOADER_PARAMETER_BLOCK *)Context, 7ui64);
    DisplayBootBitmap(0);
  }
  if( v6 && strstr(v6, "MININT") )
  {
    InitIsWinPEMode = 1;
    if( strstr(v6, "INRAM") )
      InitWinPEModeType |= 0x80000000;
    else
      InitWinPEModeType |= 1u;
  }
  Message = RtlFindMessage((PVOID)0x140000000i64, 0xBui64, 0i64, 0x4000007Eui64, (INT64)&v100);
  v21 = PoolWithTag;
  ppszDestEnd = PoolWithTag;
  v22 = Message;
  pcbRemaining = 256i64;
  if( CmCSDVersionString.Length )
  {
    v23 = RtlStringCbPrintfExA(PoolWithTag, 0xFFui64, &ppszDestEnd, &pcbRemaining, 0i64, (INT8 *)": %wZ");
    if( v23 < 0 )
      KeBugCheckEx(0x32u, v23, 7ui64, 0i64, 0i64);
    v21 = ppszDestEnd;
    v24 = pcbRemaining;
  }
  else
  {
    v24 = 255i64;
    pcbRemaining = 255i64;
  }
  *v21 = 0;
  v25 = v21 + 1;
  ppszDestEnd = v25;
  v26 = RtlStringCbPrintfA(pszDest, 0x18ui64, (INT8 *)"%u.%u");
  if( v26 < 0 )
    KeBugCheckEx(0x32u, v26, 7ui64, 1ui64, 0i64);
  if( v22 < 0 )
  {
    v28 = RtlStringCbCopyA(v25, v24, (PSTR)"MICROSOFT(R) WINDOWS(TM)\n");
    if( v28 < 0 )
      KeBugCheckEx(0x32u, v28, 7ui64, 3ui64, 0i64);
  }
  else
  {
    v27 = RtlStringCbPrintfA(v25, v24, (INT8 *)v100->Text);
    if( v27 < 0 )
      KeBugCheckEx(0x32u, v27, 7ui64, 2ui64, 0i64);
  }
  InbvDisplayString(v25);
  v29 = 2;
  v30 = PoolWithTag + 256;
  v31 = PoolWithTag;
  v32 = 2i64;
  do
  {
    *v30 = *(_OWORD *)v31;
    v30[1] = *((_OWORD *)v31 + 1);
    v30[2] = *((_OWORD *)v31 + 2);
    v30[3] = *((_OWORD *)v31 + 3);
    v30[4] = *((_OWORD *)v31 + 4);
    v30[5] = *((_OWORD *)v31 + 5);
    v30[6] = *((_OWORD *)v31 + 6);
    v30 += 8;
    v33 = *((_OWORD *)v31 + 7);
    v31 += 128;
    *(v30 - 1) = v33;
    --v32;
  }
  while( v32 );
  if( !PoInitSystem(0i64, (_LOADER_PARAMETER_BLOCK *)Context) )
LABEL_210:
    KeBugCheck(0xA0ui64);
  if( !ExpRealTimeIsUniversal )
  {
    v34 = *(_DWORD *)(v2 + 436);
    if( v34 == -1 )
    {
      v34 = ExpAltTimeZoneBias;
      *(_DWORD *)(v2 + 436) = ExpAltTimeZoneBias;
      v97 = 1;
    }
    *(_QWORD *)(v2 + 440) = 600000000i64 * v34;
    KUSER_SHARED_DATA.TimeZoneBiasStamp = 0;
    ExpWriteTimeZoneBias((UINT64 *)(v2 + 440));
  }
  GetBootSystemTime(*((_LOADER_PARAMETER_EXTENSION **)Context + 30), &Time);
  if( v6 )
  {
    v35 = strstr(v6, "YEAR");
    if( v35 )
    {
      v36 = strstr(v35, "=");
      if( v36 )
      {
        v37 = atol(v36 + 1);
        RtlTimeToTimeFields(&Time, &TimeFields);
        TimeFields.Year = v37;
        RtlTimeFieldsToTime(&TimeFields, &Time);
      }
    }
  }
  if( ExpRealTimeIsUniversal )
    SystemTime = Time;
  else
    ExSystemTimeToLocalTime(&Time, &SystemTime);
  KeSetSystemTime(&Time, &OldTime, 4ui64);
  PoNotifySystemTimeSet(&Time, &OldTime, 0i64);
  RtlInitUnicodeString(&DestinationString, L"Kernel-RegisteredProcessors", v38);
  if( ZwQueryLicenseValue(
         &DestinationString,
         (UINT64 *)((char *)&ResultDataSize + 4),
         &KeRegisteredProcessors,
         4ui64,
         &ResultDataSize) < 0
    || ResultDataSize != 0x400000004i64 )
  {
    LODWORD(KeRegisteredProcessors) = 1;
  }
  if( v6 )
  {
    v39 = strstr(v6, " BOOTPROC=");
    if( v39 )
    {
      v40 = strstr(v39, "=");
      if( v40 )
        KeBootprocSpecified = atol(v40 + 1);
    }
    v41 = strstr(v6, " NUMPROC=");
    if( v41 )
    {
      v42 = strstr(v41, "=");
      if( v42 )
        KeNumprocSpecified = atol(v42 + 1);
    }
    v43 = strstr(v6, " HYPERVISORNUMPROC=");
    if( v43 )
    {
      v44 = strstr(v43, "=");
      if( v44 )
        KeHypervisorNumprocSpecified = atol(v44 + 1);
    }
    if( !KeRootProcNumaNodeLpsSpecified )
    {
      v45 = strstr(v6, " HYPERVISORROOTPROCPERNODE=");
      if( v45 )
      {
        v46 = strstr(v45, "=");
        if( v46 )
          KeRootProcPerNodeSpecified = atol(v46 + 1);
      }
      v47 = strstr(v6, " HYPERVISORROOTPROCPERCORE=");
      if( v47 )
      {
        v48 = strstr(v47, "=");
        if( v48 )
          KeRootProcPerCoreSpecified = atol(v48 + 1);
      }
    }
    if( strstr(v6, " MAXPROC") )
      LODWORD(KeMaximumProcessors) = 1280;
  }
  qword_140D577B8 = KeQueryPerformanceCounter(0i64).QuadPart;
  KeStartAllProcessors(v49);
  qword_140D577C0 = KeQueryPerformanceCounter(0i64).QuadPart;
  KeSetAffinityProcess(*((_QWORD *)KeGetCurrentThread() + 23), 0, &KeActiveProcessors.Count);
  MakeGdtReadOnly();
  v50 = RtlFindMessage((PVOID)0x140000000i64, 0xBui64, 0i64, 0x40000089ui64, (INT64)&v109) < 0 ? "MultiProcessor Kernel\r\n" : (const char *)v109->Text;
  if( !HalAllProcessorsStarted() )
LABEL_177:
    KeBugCheck(0x61ui64);
  RtlInitAnsiString(&v114, v50, v51);
  if( v114.Length >= 2u )
    v114.Length -= 2;
  v52 = 1073741960i64;
  if( (unsigned int)KeNumberProcessors_0 > 1 )
    v52 = 1073741981i64;
  v53 = RtlFindMessage((PVOID)0x140000000i64, 0xBui64, 0i64, v52, (INT64)&v100);
  v54 = 0i64;
  v55 = *(unsigned int *)MmPhysicalMemoryBlock;
  if( (_DWORD)v55 )
  {
    v56 = MmPhysicalMemoryBlock + 24;
    do
    {
      v54 += *(_QWORD *)v56;
      v56 += 16;
      --v55;
    }
    while( v55 );
  }
  if( v53 < 0 )
    Text = (INT8 *)"%u System Processor [%u MB Memory] %Z\n";
  else
    Text = (INT8 *)v100->Text;
  pszFormat = &v114;
  MessageResourceEntry = (PMESSAGE_RESOURCE_ENTRY *)((unsigned __int64)(v54 + 255) >> 8);
  v58 = RtlStringCbPrintfA(PoolWithTag, 0x100ui64, Text);
  if( v58 < 0 )
    KeBugCheckEx(0x32u, v58, 7ui64, 4ui64, 0i64);
  InbvDisplayString(PoolWithTag);
  ExFreePoolWithTag(PoolWithTag, 0);
  if( !(unsigned __int8)ObInitSystem() )
    KeBugCheck(0x62ui64);
  if( !ExInitSystem() )
    KeBugCheckEx(0x32u, 0xFFFFFFFFC0000001ui64, 0i64, 1ui64, 0i64);
  HalReportResourceUsage(0xFFFFFFFFui64);
  if( !IoCreateObjectTypes() )
    KeBugCheckEx(0x32u, 0xFFFFFFFFC0000001ui64, 0i64, 4ui64, 0i64);
  if( !KeInitSystem(1ui64) )
    KeBugCheckEx(0x32u, 0xFFFFFFFFC0000001ui64, 0i64, 2ui64, 0i64);
  if( !KdInitSystem(*(unsigned int *)InitializationPhase, 0i64) )
    KeBugCheckEx(0x32u, 0xFFFFFFFFC0000001ui64, 0i64, 3ui64, 0i64);
  inited = TmInitSystem(
             &TmResourceManagerObjectType,
             &TmEnlistmentObjectType,
             &TmTransactionManagerObjectType,
             &TmTransactionObjectType);
  if( (int)(inited + 0x80000000) >= 0 && inited != -1073741637 )
    KeBugCheckEx(0x32u, 0i64, 0i64, 0i64, 0i64);
  v60 = DbgkInitialize();
  if( v60 < 0 )
    KeBugCheckEx(0x32u, v60, 0i64, 0i64, 0i64);
  BcdInitializeBcdSyncMutant();
  VerifierInitSystem(0i64);
  if( !(unsigned __int8)SeInitSystem() )
    KeBugCheck(0x63ui64);
  PsInitSystem(1ui64, (_LOADER_PARAMETER_BLOCK *)Context);
  ExInitLicenseCallback();
  SystemRootLink = CreateSystemRootLink((_LOADER_PARAMETER_BLOCK *)Context);
  if( SystemRootLink < 0 )
    KeBugCheckEx(0x64u, SystemRootLink, 0i64, 0i64, 0i64);
  qword_140D577D8 = KeQueryPerformanceCounter(0i64).QuadPart;
  if( !MmInitSystem(1ui64, (_LOADER_PARAMETER_BLOCK *)Context) )
    KeBugCheck(0x65ui64);
  qword_140D577E0 = KeQueryPerformanceCounter(0i64).QuadPart;
  if( InitNlsTableSize )
  {
    LODWORD(pszFormat) = 0x8000000;
    LODWORD(MessageResourceEntry) = 4;
    MaximumSize.QuadPart = InitNlsTableSize;
    v63 = ZwCreateSection(
            &SectionHandle,
            0xF001Fui64,
            0i64,
            &MaximumSize,
            (UINT64)MessageResourceEntry,
            (UINT64)pszFormat,
            0i64);
    if( v63 < 0 )
      KeBugCheckEx(0x32u, v63, 1ui64, 0i64, 0i64);
    Object = 0i64;
    v64 = ObReferenceObjectByHandle(SectionHandle, 0xF001Fu, MmSectionObjectType, 0, &Object, 0i64);
    InitNlsSectionPointer = Object;
    v65 = v64;
    ZwClose(SectionHandle);
    if( (v65 & 0x80000000) != 0i64 )
      KeBugCheckEx(0x32u, v65, 2ui64, 0i64, 0i64);
    MappedBase = 0i64;
    ViewSize = 0i64;
    v66 = MmMapViewInSystemSpace(InitNlsSectionPointer, &MappedBase, &ViewSize);
    if( v66 < 0 )
      KeBugCheckEx(0x32u, v66, 3ui64, 0i64, 0i64);
    v67 = (UINT8 *)MappedBase;
    memmove((UINT8 *)MappedBase, InitNlsTableBase, InitNlsTableSize);
    InitNlsTableBase = v67;
  }
  if( !InitNlsTableBase )
  {
    v68 = 0i64;
LABEL_119:
    v69 = 0i64;
    v70 = 0i64;
    goto LABEL_123;
  }
  if( !InitUnicodeCaseTableDataOffset )
  {
    v68 = InitNlsTableBase;
    goto LABEL_119;
  }
  v68 = &InitNlsTableBase[InitUnicodeCaseTableDataOffset];
  v69 = (UINT16 *)&InitNlsTableBase[InitOemCodePageDataOffset];
  v70 = (UINT16 *)&InitNlsTableBase[InitAnsiCodePageDataOffset];
LABEL_123:
  RtlInitNlsTables(v70, v69, (UINT16 *)v68, v62);
  RtlResetRtlTranslations(v71);
  if( !(unsigned __int8)CcInitializeCacheManager(v72) )
    KeBugCheck(0x66ui64);
  if( !CmInitSystem1((_LOADER_PARAMETER_BLOCK *)Context) )
    KeBugCheck(0x67ui64);
  v73 = ExInitializeLeapSecondData();
  if( v73 < 0 )
    KeBugCheckEx(0x32u, v73, 0xCui64, 0i64, 0i64);
  InitSkuSessionParameters();
  qword_140D577A8 = KeQueryPerformanceCounter(0i64).QuadPart;
  memset((INT64)result, 0i64);
  LODWORD(result[0]) = 72;
  result[1] = (INT64)MmMapLockedRestartPages;
  result[2] = (INT64)MmUnmapLockedRestartPages;
  result[3] = (INT64)KeRemoveEnclavePage;
  result[4] = (INT64)KdPullRemoteFileEx;
  VslGetKsrContext();
  DisplayContext = BgGetDisplayContext();
  v75 = (int)KsrInitSystem(Context, result, DisplayContext);
  qword_140D577B0 = KeQueryPerformanceCounter(0i64).QuadPart;
  if( (int)(v75 + 0x80000000) >= 0 && (_DWORD)v75 != -1073741637 )
    KeBugCheckEx(0x32u, v75, 0i64, 1ui64, 0i64);
  ExKsrInterface = v120;
  *(_OWORD *)&xmmword_140C19550 = v121;
  v76 = EmInitSystem(0i64, (_LOADER_PARAMETER_BLOCK *)Context);
  if( v76 < 0 )
    KeBugCheckEx(0x32u, v76, 8ui64, 0i64, 0i64);
  v77 = MfgInitSystem((_LOADER_PARAMETER_BLOCK *)Context);
  if( v77 < 0 )
    KeBugCheckEx(0x32u, v77, 9ui64, 0i64, 0i64);
  PfInitializeSuperfetch();
  SmInitSystem(0i64);
  v79 = VmInitSystem(0i64, v78);
  if( v79 < 0 )
    KeBugCheckEx(0x32u, v79, 0xAui64, 0i64, 0i64);
  if( (*(_BYTE *)(*((_QWORD *)Context + 30) + 2624i64) & 2) == 0 || strstr(v6, "FORCETIMESYNC") )
  {
    MessageResourceEntry = 0i64;
    ZwUpdateWnfStateData();
  }
  HvlWnfUpdateStartupState();
  v103 = 0;
  FsRtlSendModernAppTermination((__int64)&v103, 1u, 1);
  ExInitializeTimeRefresh();
  ExAcquireTimeRefreshLock(1u);
  ExInitializeUtcTimeZoneBias(&SystemTime);
  v80 = *(_DWORD *)(v2 + 436);
  ExpRefreshTimeZoneInformation();
  ExReleaseTimeRefreshLock();
  if( v97 )
  {
    ExLocalTimeToSystemTime(&SystemTime, &Time);
    KeSetSystemTime(&Time, &OldTime, 4ui64);
  }
  else if( v80 != *(_DWORD *)(v2 + 436) )
  {
    ZwSetSystemTime(0i64, 0i64);
  }
  if( !(unsigned __int8)FsRtlInitSystem() )
    KeBugCheck(0x68ui64);
  RtlInitializeCompression();
  RtlInitializeRangeListPackage();
  HvlDebuggerSupportInitialize((_LOADER_PARAMETER_BLOCK *)Context);
  HalReportResourceUsage(0i64);
  KdInitialize(1i64, Context, &KdpContext);
  if( !PpInitSystem() )
    KeBugCheck(0x90ui64);
  if( !LpcInitSystem() )
    KeBugCheck(0x6Aui64);
  if( v6 )
    v82 = strstr(v6, "SAFEBOOT:");
  else
    v82 = 0i64;
  v83 = v82;
  if( v82 )
  {
    v84 = 9i64;
    v85 = v82 + 9;
    if( !(unsigned int)strncmp(v85, (size_t)"MINIMAL", 7ui64, v81, (va_list)MessageResourceEntry) )
    {
      InitSafeBootMode = 1;
      v84 = 16i64;
    }
    else
    {
      if( !(unsigned int)strncmp(v85, (size_t)"NETWORK", 7ui64, v86, (va_list)MessageResourceEntrya) )
      {
        v84 = 16i64;
      }
      else if( !(unsigned int)strncmp(v85, (size_t)"DSREPAIR", 8ui64, v86, (va_list)MessageResourceEntrya) )
      {
        v29 = 3;
        v84 = 17i64;
      }
      else
      {
        v29 = 0;
      }
      InitSafeBootMode = v29;
    }
    if( v83[v84] )
    {
      v87 = strncmp(&v83[v84], (size_t)"(ALTERNATESHELL)", 0x10ui64, v86, (va_list)MessageResourceEntrya);
      v88 = (unsigned __int8)v99;
      if( !v87 )
        v88 = 1;
      v99 = v88;
    }
    if( InitSafeBootMode )
    {
      v113 = 0i64;
      v89 = 0i64;
      switch( InitSafeBootMode )
      {
        case 1:
          v89 = 168i64;
          break;
        case 2:
          v89 = 169i64;
          break;
        case 3:
          v89 = 170i64;
          break;
      }
      if( RtlFindMessage((PVOID)0x140000000i64, 0xBui64, 0i64, v89, (INT64)&v113) >= 0 )
        InbvDisplayString((PSTR)v113->Text);
    }
  }
  if( (*(_DWORD *)(*((_QWORD *)Context + 30) + 132i64) & 0x800) != 0 )
  {
    if( RtlFindMessage((PVOID)0x140000000i64, 0xBui64, 0i64, 0xB7ui64, (INT64)&v100) >= 0 )
      InbvDisplayString((PSTR)v100->Text);
    IopInitializeBootLogging((_LOADER_PARAMETER_BLOCK *)Context, PoolWithTag + 256);
  }
  ExInitSystemPhase2();
  KUSER_SHARED_DATA.CyclesPerYield = ExpComputeCyclesPerYield();
  if( InitIsWinPEMode )
    CreateMiniNtBootKey();
  v90 = SeCodeIntegrityInitializePolicy((_LOADER_PARAMETER_BLOCK *)Context);
  if( v90 < 0 )
    KeBugCheckEx(0x32u, v90, 0x69436553ui64, 0i64, 0i64);
  KdpTimeSlipPending = 0;
  v91 = ExInitializeNls();
  if( v91 < 0 )
    KeBugCheckEx(0x32u, v91, 7ui64, 0i64, 0i64);
  v92 = ExInitializeExternalBootSupport();
  if( v92 < 0 )
    KeBugCheckEx(0x32u, v92, 8ui64, 0i64, 0i64);
  if( !PoInitSystem(1ui64, (_LOADER_PARAMETER_BLOCK *)Context) )
    goto LABEL_210;
  return v99;
}

Referenced by:

Phase1Initialization