// UncoreInitPeim - Part: Indices 501-1000
// Generated from original UncoreInitPeim.c
// Total functions in this part: 31696

#include "UncoreInitPeim.h"

// Index: 500/2560

int __cdecl ProcCommonFuncCE02(unsigned __int8 *n6, int n4, int n6a, int n2, _DWORD *buf, int n1543, char *a7)
{
  int SocketInfo; // edi
  int n2_1; // eax
  unsigned __int8 i; // bl
  int v11; // eax
  __int16 v12; // ax
  unsigned __int8 *v13; // edx
  int *v14; // edi
  unsigned __int8 *v15; // esi
  int v16; // esi
  int v17; // edx
  int v18; // eax
  bool v20; // [esp+12h] [ebp-1Ah]
  int v21; // [esp+14h] [ebp-18h]
  unsigned int v22; // [esp+18h] [ebp-14h]
  int v23[2]; // [esp+24h] [ebp-8h] BYREF
  unsigned int v24; // [esp+3Ch] [ebp+10h]

  v21 = 0; /*0xffc3ce15*/
  v20 = 0; /*0xffc3ce19*/
  SocketInfo = GetSocketInfo((int)n6, n4); /*0xffc3ce26*/
  if ( !*(_BYTE *)(1379 * (unsigned __int8)n2 + GetCpuCount((int)n6, n4, n6a) + 1) ) /*0xffc3ce49*/
    return 1; /*0xffc3ce49*/
  n2_1 = *(_DWORD *)(7688 * (unsigned __int8)n6a + SocketInfo + 7497); /*0xffc3ce5e*/
  if ( n2_1 > 0 ) /*0xffc3ce67*/
    v20 = n2_1 > 2 && n2_1 <= 4; /*0xffc3ce7a*/
  for ( i = 0; i < 0x41u; ++i ) /*0xffc3ce83*/
  {
    if ( n1543 == dword_FFD5BF6C[5 * i] ) /*0xffc3ce91*/
      break; /*0xffc3ce91*/
  }
  if ( i >= 0x41u || (v23[0] = 20 * i, !*(int *)((char *)dword_FFD5BF6C + v23[0])) ) /*0xffc3ceb7*/
  {
    KtiFunc211E((int)n6, 40, 4, n4, n6a, n2, 255); /*0xffc3d090*/
    KtiFunc8A8E((int)n6, n4, n6a); /*0xffc3d09f*/
    return 1; /*0xffc3d09f*/
  }
  v22 = KtiFunc9B5((int)n6); /*0xffc3cecf*/
  while ( 1 )
  {
    v11 = v20
        ? ProcCommonFuncE35E((int)n6, n4, n6a, n2, 0x5004204u)
        : ProcCommonFuncE35E((int)n6, n4, n6a, n2, 0x5044804u);
    if ( (v11 & 0x10000) == 0 ) /*0xffc3cefb*/
      break; /*0xffc3cefb*/
    if ( KtiFunc9F7((int)n6, v22) > 0xAAE60 ) /*0xffc3cf0e*/
      goto LABEL_17; /*0xffc3cf0e*/
  }
  if ( v20 ) /*0xffc3cf2e*/
    v12 = ProcCommonFuncE35E((int)n6, n4, n6a, n2, 0x5004298u); /*0xffc3cf35*/
  else
    v12 = ProcCommonFuncE35E((int)n6, n4, n6a, n2, 0x5044898u); /*0xffc3cf40*/
  *a7 = HIBYTE(v12); /*0xffc3cf54*/
  if ( (v12 & 1) == 0 ) /*0xffc3cf58*/
  {
LABEL_17:
    KtiFunc211E((int)n6, 15, 1, n4, n6a, n2, 255); /*0xffc3cf10*/
    KtiFunc8A8E((int)n6, n4, n6a); /*0xffc3cf24*/
    return 1; /*0xffc3cf24*/
  }
  if ( (n6[246408] & 4) == 0 && HIBYTE(v12) == 20 ) /*0xffc3cf66*/
    return 1; /*0xffc3cf66*/
  if ( ProcCommonFuncF30B((int)n6, n4, n6a, n2, HIBYTE(v12), n1543) == 1 ) /*0xffc3cf80*/
  {
    v13 = &n6[50813 * (unsigned __int8)n4 + 8077 * (unsigned __int8)n6a]; /*0xffc3cfa7*/
    v14 = (int *)&v13[2688 * (unsigned __int8)n2 + 15222]; /*0xffc3cfaf*/
    v15 = &v13[2688 * (unsigned __int8)n2 + 15218]; /*0xffc3cfb1*/
    ProcCommonFuncE302((int)n6, n4, n6a, n2, v15, v14); /*0xffc3cfbf*/
    DebugPrint((int)n6, 3, n4, n6a, n2, 255, 255, 255, "BSR 0x%X%08X\n", *v14, *(_DWORD *)v15); /*0xffc3cfe1*/
    return 1; /*0xffc3d0a9*/
  }
  v24 = *(int *)((char *)&dword_FFD5BF74 + v23[0]); /*0xffc3cff8*/
  if ( v24 ) /*0xffc3cffe*/
  {
    v16 = 0; /*0xffc3d000*/
    do /*0xffc3d07a*/
    {
      if ( v20 ) /*0xffc3d007*/
      {
        ProcCommonFuncE493(n6, n4, n6a, n2, (4 * v16 + 83903136) & 0xFFFF8FFF, v23); /*0xffc3d022*/
        v17 = v21; /*0xffc3d02e*/
        LOBYTE(v17) = v21 + 1; /*0xffc3d036*/
        buf[v16] = v23[0]; /*0xffc3d038*/
        buf[(unsigned __int8)(v21 + 1)] = v23[1]; /*0xffc3d046*/
      }
      else
      {
        v18 = ProcCommonFuncE35E((int)n6, n4, n6a, n2, 4 * v16 + 84166816); /*0xffc3d05a*/
        v17 = v21; /*0xffc3d066*/
        buf[v16] = v18; /*0xffc3d06a*/
      }
      LOBYTE(v17) = v17 + 1; /*0xffc3d06d*/
      v16 = (unsigned __int8)v17; /*0xffc3d06f*/
      v21 = v17; /*0xffc3d072*/
    }
    while ( (unsigned __int8)v17 < v24 ); /*0xffc3d07a*/
  }
  return 0; /*0xffc3d0aa*/
}

// Function: ProcCommonFuncD0B2 @ 0xffc3d0b2 (0x27a bytes)
// Index: 501/2560

int __cdecl ProcCommonFuncD0B2(unsigned __int8 *n6, int n4, int n6a, int n2, _DWORD *buf, int n1543)
{
  int n4_1; // ebp
  int SocketInfo; // esi
  int n2_1; // eax
  unsigned __int8 i; // cl
  int n6_1; // esi
  int n6_3; // eax
  int n6_4; // ecx
  char v13; // cl
  int v14; // edx
  __int64 v16; // [esp-8h] [ebp-2Ch]
  bool v17; // [esp+12h] [ebp-12h]
  unsigned __int8 v18; // [esp+13h] [ebp-11h]
  int n6_2; // [esp+14h] [ebp-10h]
  int n6_5; // [esp+18h] [ebp-Ch]
  unsigned int v21; // [esp+1Ch] [ebp-8h]
  int v22; // [esp+20h] [ebp-4h]
  unsigned int v23; // [esp+20h] [ebp-4h]

  n4_1 = n4; /*0xffc3d0b7*/
  v17 = 0; /*0xffc3d0c3*/
  SocketInfo = GetSocketInfo((int)n6, n4); /*0xffc3d0d1*/
  if ( !*(_BYTE *)(1379 * (unsigned __int8)n2 + GetCpuCount((int)n6, n4, n6a) + 1) ) /*0xffc3d0f0*/
    return 1; /*0xffc3d323*/
  n2_1 = *(_DWORD *)(7688 * (unsigned __int8)n6a + SocketInfo + 7497); /*0xffc3d0ff*/
  if ( n2_1 > 0 ) /*0xffc3d108*/
    v17 = n2_1 > 2 && n2_1 <= 4; /*0xffc3d11b*/
  for ( i = 0; i < 0x41u; ++i ) /*0xffc3d124*/
  {
    if ( n1543 == dword_FFD5BF6C[5 * i] ) /*0xffc3d132*/
      break; /*0xffc3d132*/
  }
  if ( i >= 0x41u || (v22 = 5 * i, !dword_FFD5BF6C[v22]) ) /*0xffc3d14e*/
  {
    KtiFunc211E((int)n6, 40, 0, n4, n6a, n2, 255); /*0xffc3d311*/
LABEL_33:
    KtiFunc8A8E((int)n6, n4, n6a); /*0xffc3d316*/
    return 1; /*0xffc3d319*/
  }
  n6_1 = n6_2; /*0xffc3d161*/
  v21 = KtiFunc9B5((int)n6); /*0xffc3d166*/
  while ( 1 ) /*0xffc3d16f*/
  {
    if ( v17 ) /*0xffc3d16f*/
    {
      n6_3 = ProcCommonFuncE35E((int)n6, n4, n6a, n2, 0x5004204u); /*0xffc3d17d*/
      n6_4 = n6_3; /*0xffc3d182*/
      n6_5 = n6_3; /*0xffc3d184*/
    }
    else
    {
      n6_3 = ProcCommonFuncE35E((int)n6, n4, n6a, n2, 0x5044804u); /*0xffc3d196*/
      n6_4 = n6_5; /*0xffc3d19b*/
      n6_1 = n6_3; /*0xffc3d19f*/
      n6_2 = n6_3; /*0xffc3d1a1*/
    }
    if ( (n6_3 & 0x10000) == 0 ) /*0xffc3d1ad*/
      break; /*0xffc3d1ad*/
    if ( KtiFunc9F7((int)n6, v21) > 0x2BC ) /*0xffc3d1c0*/
    {
      KtiFunc211E((int)n6, 15, 1, n4, n6a, n2, 255); /*0xffc3d1d1*/
      goto LABEL_33; /*0xffc3d1d1*/
    }
  }
  if ( v17 ) /*0xffc3d1db*/
  {
    LOWORD(n6_5) = n1543; /*0xffc3d1f8*/
    ProcCommonFuncF5EF(n6, n4, n6a, n2, 0x5004204u, (unsigned __int16)n1543 | (unsigned __int64)(n6_4 & 0x10000)); /*0xffc3d1ff*/
  }
  else
  {
    n6_1 ^= (unsigned __int16)(n1543 ^ n6_1); /*0xffc3d212*/
    n6_2 = n6_1; /*0xffc3d21e*/
    ProcCommonFuncF4C7(n6, n4, n6a, n2, 84166660, n6_1); /*0xffc3d225*/
  }
  v13 = 0; /*0xffc3d231*/
  v18 = 0; /*0xffc3d233*/
  v23 = dword_FFD5BF70[v22]; /*0xffc3d23d*/
  if ( v23 ) /*0xffc3d243*/
  {
    v14 = 0; /*0xffc3d249*/
    do /*0xffc3d2b3*/
    {
      if ( v17 ) /*0xffc3d250*/
      {
        v18 = v13 + 1; /*0xffc3d264*/
        HIDWORD(v16) = buf[(unsigned __int8)(v13 + 1)]; /*0xffc3d26b*/
        n4_1 = n4; /*0xffc3d271*/
        LODWORD(v16) = buf[v14]; /*0xffc3d275*/
        ProcCommonFuncF5EF(n6, n4, n6a, n2, (4 * v14 + 83903000) & 0xFFFF8FFF, v16); /*0xffc3d27d*/
      }
      else
      {
        ProcCommonFuncF4C7(n6, n4_1, n6a, n2, 4 * v14 + 84166680, buf[v14]); /*0xffc3d29a*/
      }
      v13 = ++v18; /*0xffc3d2a6*/
      v14 = v18; /*0xffc3d2a8*/
    }
    while ( v18 < v23 ); /*0xffc3d2b3*/
    n6_1 = n6_2; /*0xffc3d2b5*/
  }
  if ( v17 ) /*0xffc3d2be*/
    ProcCommonFuncF5EF(n6, n4_1, n6a, n2, 0x5004204u, (unsigned __int16)n6_5 | 0x10000LL); /*0xffc3d2db*/
  else
    ProcCommonFuncF4C7(n6, n4_1, n6a, n2, 84166660, n6_1 | 0x10000); /*0xffc3d2f8*/
  return 0; /*0xffc3d324*/
}

// Function: ProcCommonFuncD32C @ 0xffc3d32c (0x2cc bytes)
// Index: 502/2560

int __cdecl ProcCommonFuncD32C(_BYTE *__return_address, int n4, int n0x80000)
{
  unsigned __int8 n4_1; // si
  int SocketInfo; // eax
  unsigned __int8 n6_2; // cl
  unsigned __int8 *v6; // edi
  int v7; // eax
  int n6_1; // ebp
  unsigned __int8 n2_3; // al
  int CpuCount_1; // esi
  int v11; // edx
  __int64 v12; // kr00_8
  int v13; // eax
  int v14; // eax
  unsigned int v15; // eax
  bool p_n2_1; // al
  int n2_2; // esi
  unsigned __int8 p_n2_2; // al
  int v19; // eax
  int n2_1; // [esp-1Ch] [ebp-50h]
  bool p_n2; // [esp+13h] [ebp-21h] BYREF
  int v23; // [esp+14h] [ebp-20h]
  int n2; // [esp+18h] [ebp-1Ch]
  int v25; // [esp+1Ch] [ebp-18h]
  int n6; // [esp+20h] [ebp-14h]
  int CpuCount; // [esp+24h] [ebp-10h]
  unsigned __int8 *v28; // [esp+28h] [ebp-Ch]
  unsigned int v29; // [esp+2Ch] [ebp-8h]
  int v30; // [esp+30h] [ebp-4h]

  n4_1 = n4; /*0xffc3d33c*/
  v29 = ProcCommonFuncD768(n0x80000); /*0xffc3d346*/
  SocketInfo = GetSocketInfo((int)__return_address, n4); /*0xffc3d34a*/
  n6_2 = 0; /*0xffc3d34f*/
  v25 = 0; /*0xffc3d354*/
  LOBYTE(n6) = 0; /*0xffc3d359*/
  v6 = (unsigned __int8 *)(SocketInfo + 3); /*0xffc3d35d*/
  v7 = 0; /*0xffc3d360*/
  v28 = v6; /*0xffc3d364*/
  do /*0xffc3d5e8*/
  {
    if ( !*(v6 - 3) ) /*0xffc3d36c*/
      goto LABEL_32; /*0xffc3d36c*/
    n6_1 = n6; /*0xffc3d372*/
    CpuCount = GetCpuCount((int)__return_address, n4_1, n6); /*0xffc3d37e*/
    n2_3 = 0; /*0xffc3d385*/
    LOBYTE(n2) = 0; /*0xffc3d387*/
    if ( !*v6 ) /*0xffc3d38d*/
      goto LABEL_31; /*0xffc3d38d*/
    CpuCount_1 = CpuCount; /*0xffc3d393*/
    do /*0xffc3d5ba*/
    {
      v11 = 1379 * n2_3; /*0xffc3d39a*/
      v30 = v11; /*0xffc3d3a0*/
      if ( *(_BYTE *)(v11 + CpuCount_1) /*0xffc3d3cb*/
        && *(_BYTE *)(v11 + CpuCount_1 + 107)
        && (*(_BYTE *)(v11 + CpuCount_1 + 196) || n0x80000 != 402653184) )
      {
        p_n2 = 0; /*0xffc3d3e5*/
        v23 = v25 + 50813 * (unsigned __int8)n4 + 2688 * n2_3; /*0xffc3d3f0*/
        v12 = KtiFunc9D6(); /*0xffc3d3fc*/
        while ( 1 ) /*0xffc3d40d*/
        {
          v13 = ProcCommonFuncE35E((int)__return_address, n4, n6_1, n2, 0x5044000u); /*0xffc3d40d*/
          n2_1 = n2; /*0xffc3d41b*/
          *(_DWORD *)&__return_address[v23 + 15218] = v13; /*0xffc3d424*/
          v14 = ProcCommonFuncE35E((int)__return_address, n4, n6_1, n2_1, 0x5044004u); /*0xffc3d42c*/
          *(_DWORD *)&__return_address[v23 + 15222] = v14; /*0xffc3d438*/
          v15 = KtiFuncA21((int)__return_address, v12, SHIDWORD(v12)); /*0xffc3d43f*/
          if ( v15 > v29 ) /*0xffc3d44b*/
            break; /*0xffc3d44b*/
          if ( !ProcCommonFuncC233(n0x80000, *(_DWORD *)&__return_address[v23 + 15218], &p_n2) ) /*0xffc3d461*/
          {
            p_n2_1 = p_n2; /*0xffc3d46d*/
            n2_2 = n2; /*0xffc3d476*/
            goto LABEL_14; /*0xffc3d47a*/
          }
        }
        n2_2 = n2; /*0xffc3d47c*/
        ProcCommonFuncEF57((int)__return_address, n4, n6_1, n2); /*0xffc3d487*/
        KtiFunc211E((int)__return_address, 57, 3, n4, n6_1, n2_2, 255); /*0xffc3d49d*/
        p_n2_1 = 1; /*0xffc3d4a5*/
LABEL_14:
        p_n2 = p_n2_1; /*0xffc3d4a7*/
        if ( !p_n2_1 ) /*0xffc3d4ad*/
          goto LABEL_28; /*0xffc3d4ad*/
        ProcCommonFuncEF57((int)__return_address, n4, n6_1, n2_2); /*0xffc3d4ba*/
        if ( n0x80000 == 196608 ) /*0xffc3d4ca*/
        {
          KtiFunc12A4(__return_address, 57, 2, n4, n6_1, n2_2, 255, 1, *(_DWORD *)&__return_address[v23 + 15218]); /*0xffc3d573*/
          p_n2_2 = 0; /*0xffc3d57b*/
        }
        else
        {
          if ( n0x80000 == 0x40000 ) /*0xffc3d4d8*/
          {
            KtiFunc12A4(__return_address, 57, 1, n4, n6_1, n2_2, 255, 1, *(_DWORD *)&__return_address[v23 + 15218]); /*0xffc3d54e*/
          }
          else if ( n0x80000 != 0x100000 ) /*0xffc3d4e2*/
          {
            if ( n0x80000 == 402653184 ) /*0xffc3d4ec*/
            {
              p_n2 = 0; /*0xffc3d4f2*/
              KtiFunc12A4(__return_address, 57, 5, n4, n6_1, n2_2, 255, 1, *(_DWORD *)&__return_address[v23 + 15218]); /*0xffc3d50c*/
            }
            p_n2_2 = p_n2; /*0xffc3d514*/
            goto LABEL_21; /*0xffc3d514*/
          }
          p_n2_2 = 2; /*0xffc3d556*/
        }
LABEL_21:
        v19 = p_n2_2 - 1; /*0xffc3d518*/
        if ( v19 ) /*0xffc3d51e*/
        {
          if ( v19 == 1 ) /*0xffc3d523*/
            KtiFunc8A8E((int)__return_address, n4, n6_1); /*0xffc3d52b*/
        }
        else
        {
          KtiFunc8B24(__return_address, n4, n6_1, n2_2); /*0xffc3d586*/
        }
LABEL_28:
        CpuCount_1 = CpuCount; /*0xffc3d58e*/
        v6 = v28; /*0xffc3d59a*/
        *(_BYTE *)(v30 + CpuCount + 1) = (*(_DWORD *)&__return_address[v23 + 15218] & 0x100000) != 0; /*0xffc3d5aa*/
        n2_3 = n2; /*0xffc3d5ae*/
      }
      LOBYTE(n2) = ++n2_3; /*0xffc3d5b4*/
    }
    while ( n2_3 < *v6 ); /*0xffc3d5ba*/
    n4_1 = n4; /*0xffc3d5c0*/
LABEL_31:
    v7 = v25; /*0xffc3d5c4*/
    n6_2 = n6; /*0xffc3d5c8*/
LABEL_32:
    ++n6_2; /*0xffc3d5cc*/
    v6 += 7688; /*0xffc3d5ce*/
    v7 += 8077; /*0xffc3d5d4*/
    LOBYTE(n6) = n6_2; /*0xffc3d5d9*/
    v28 = v6; /*0xffc3d5dd*/
    v25 = v7; /*0xffc3d5e1*/
  }
  while ( n6_2 < 6u ); /*0xffc3d5e8*/
  return 0; /*0xffc3d5ee*/
}

// Function: ProcCommonFuncD5F8 @ 0xffc3d5f8 (0x154 bytes)
// Index: 503/2560

int __cdecl ProcCommonFuncD5F8(_BYTE *__return_address, int n2, int n6, int n0x80000)
{
  _BYTE *CpuCount; // ecx
  unsigned __int8 n2_3; // al
  int v6; // esi
  unsigned int v7; // eax
  int n2_1; // eax
  bool p_n2; // [esp+13h] [ebp-11h] BYREF
  int n2_2; // [esp+14h] [ebp-10h]
  _BYTE *CpuCount_1; // [esp+18h] [ebp-Ch]
  unsigned int v13; // [esp+1Ch] [ebp-8h]
  unsigned int v14; // [esp+20h] [ebp-4h]

  v14 = ProcCommonFuncD768(n0x80000); /*0xffc3d617*/
  CpuCount = (_BYTE *)GetCpuCount((int)__return_address, n2, n6); /*0xffc3d620*/
  n2_3 = 0; /*0xffc3d625*/
  CpuCount_1 = CpuCount; /*0xffc3d627*/
  LOBYTE(n2_2) = 0; /*0xffc3d62b*/
  do /*0xffc3d73c*/
  {
    if ( *CpuCount && CpuCount[107] ) /*0xffc3d638*/
    {
      p_n2 = 0; /*0xffc3d643*/
      v13 = KtiFunc9B5((int)__return_address); /*0xffc3d64e*/
      while ( 1 ) /*0xffc3d667*/
      {
        v6 = ProcCommonFuncE35E((int)__return_address, n2, n6, n2_2, 0x5044000u); /*0xffc3d667*/
        v7 = KtiFunc9F7((int)__return_address, v13); /*0xffc3d66a*/
        if ( v7 > v14 ) /*0xffc3d676*/
          break; /*0xffc3d676*/
        if ( !ProcCommonFuncC233(n0x80000, v6, &p_n2) ) /*0xffc3d682*/
          goto LABEL_9; /*0xffc3d68c*/
      }
      ProcCommonFuncEF57((int)__return_address, n2, n6, n2_2); /*0xffc3d697*/
      KtiFunc211E((int)__return_address, 57, 3, n2, n6, n2_2, 255); /*0xffc3d6ac*/
      KtiFunc8A8E((int)__return_address, n2, n6); /*0xffc3d6b4*/
LABEL_9:
      if ( p_n2 ) /*0xffc3d6c1*/
      {
        ProcCommonFuncEF57((int)__return_address, n2, n6, n2_2); /*0xffc3d6ca*/
        LOBYTE(n2_1) = ProcCommonFuncD74C(n0x80000); /*0xffc3d6d3*/
        if ( (_BYTE)n2_1 ) /*0xffc3d6dd*/
          KtiFunc12A4(__return_address, 57, n2_1, n2, n6, n2_2, 255, 1, v6); /*0xffc3d6f1*/
        else
          KtiFunc211E((int)__return_address, 57, 0, n2, n6, n2_2, 255); /*0xffc3d70b*/
        KtiFunc8B24(__return_address, n2, n6, n2_2); /*0xffc3d71a*/
      }
      CpuCount = CpuCount_1; /*0xffc3d722*/
      n2_3 = n2_2; /*0xffc3d726*/
    }
    ++n2_3; /*0xffc3d72a*/
    CpuCount += 1379; /*0xffc3d72c*/
    LOBYTE(n2_2) = n2_3; /*0xffc3d732*/
    CpuCount_1 = CpuCount; /*0xffc3d736*/
  }
  while ( n2_3 < 2u ); /*0xffc3d73c*/
  return 0; /*0xffc3d742*/
}

// Function: ProcCommonFuncD74C @ 0xffc3d74c (0x1c bytes)
// Index: 504/2560

char __cdecl ProcCommonFuncD74C(int n0x80000)
{
  if ( n0x80000 == 196608 ) /*0xffc3d756*/
    return 2; /*0xffc3d765*/
  else
    return n0x80000 == 0x40000; /*0xffc3d762*/
}

// Function: ProcCommonFuncD768 @ 0xffc3d768 (0x48 bytes)
// Index: 505/2560

int __cdecl ProcCommonFuncD768(int n0x80000)
{
  int result; // eax

  result = 0; /*0xffc3d76c*/
  switch ( n0x80000 ) /*0xffc3d784*/
  {
    case 196608: /*0xffc3d784*/
    case 262144: /*0xffc3d784*/
    case 524288: /*0xffc3d784*/
      return 500000; /*0xffc3d784*/
    case 1048576: /*0xffc3d784*/
      return 5000000; /*0xffc3d7a9*/
    case 8388608: /*0xffc3d784*/
      return 500000; /*0xffc3d7aa*/
    case 402653184: /*0xffc3d784*/
      return 60000000; /*0xffc3d79e*/
  }
  return result; /*0xffc3d7a3*/
}

// Function: ProcCommonFuncD7B0 @ 0xffc3d7b0 (0x58 bytes)
// Index: 506/2560

int __cdecl ProcCommonFuncD7B0(unsigned __int8 *n4, int n4_1, int n2, int a4, _BYTE *buf_, _BYTE *a6, char *a7)
{
  int result; // eax
  char v8; // edx^2
  _DWORD buf_1[32]; // [esp+0h] [ebp-100h] BYREF
  _DWORD buf[32]; // [esp+80h] [ebp-80h] BYREF

  KtiFunc7D83(buf, 0, 0x80u); /*0xffc3d7c4*/
  result = ProcCommonFuncCCA8(n4, n4_1, n2, a4, buf_1, buf, 772, a7); /*0xffc3d7e8*/
  if ( !result ) /*0xffc3d7f2*/
  {
    v8 = BYTE2(buf[0]); /*0xffc3d7f7*/
    *buf_ = buf[0]; /*0xffc3d7fa*/
    *a6 = v8; /*0xffc3d802*/
  }
  return result; /*0xffc3d804*/
}

// Function: ProcCommonFuncD808 @ 0xffc3d808 (0xb6 bytes)
// Index: 507/2560

int __cdecl ProcCommonFuncD808(unsigned __int8 *n6, int n4, int n6a, int n2, int a5, char *p_n20)
{
  int v6; // esi
  int v7; // ecx
  _DWORD buf_1[32]; // [esp+Ch] [ebp-100h] BYREF
  _DWORD buf[32]; // [esp+8Ch] [ebp-80h] BYREF

  KtiFunc7D83(buf, 0, 0x80u); /*0xffc3d81f*/
  v6 = ProcCommonFuncCCA8(n6, n4, n6a, n2, buf_1, buf, 518, p_n20); /*0xffc3d84c*/
  if ( !v6 ) /*0xffc3d853*/
  {
    v7 = 60 * ((unsigned __int8)n2 + 2 * ((unsigned __int8)n6a + 6 * (unsigned __int8)n4)); /*0xffc3d86f*/
    *(_DWORD *)(v7 + a5 + 3264) = buf[0]; /*0xffc3d872*/
    *(_DWORD *)(v7 + a5 + 3268) = buf[2]; /*0xffc3d87c*/
    *(_DWORD *)(v7 + a5 + 3272) = buf[3]; /*0xffc3d886*/
    *(_DWORD *)(v7 + a5 + 3276) = buf[4]; /*0xffc3d890*/
    *(_DWORD *)(v7 + a5 + 3280) = buf[6]; /*0xffc3d89a*/
    *(_DWORD *)(v7 + a5 + 3284) = buf[7]; /*0xffc3d8a4*/
    *(_DWORD *)(v7 + a5 + 3296) = buf[8]; /*0xffc3d8ae*/
  }
  return v6; /*0xffc3d8b5*/
}

// Function: ProcCommonFuncD8BE @ 0xffc3d8be (0xc0 bytes)
// Index: 508/2560

char __cdecl ProcCommonFuncD8BE(
        int __return_address,
        unsigned __int8 n4,
        unsigned __int8 n6,
        unsigned __int8 n2,
        int n84033584)
{
  unsigned __int8 v5; // bl
  unsigned __int8 v6; // dl
  char result; // al
  int v8; // ecx
  int v9; // eax
  int v10; // eax
  _DWORD v11[6]; // [esp+8h] [ebp-18h] BYREF

  v5 = 0; /*0xffc3d8c5*/
  v11[0] = 84689304; /*0xffc3d8c7*/
  v6 = 0; /*0xffc3d8d2*/
  v11[1] = 84164620; /*0xffc3d8d4*/
  v11[2] = 84101120; /*0xffc3d8db*/
  memset(&v11[3], 0, 12); /*0xffc3d8e2*/
  while ( n84033584 != v11[v6] ) /*0xffc3d8f2*/
  {
    if ( ++v6 >= 6u ) /*0xffc3d8f9*/
      return -1; /*0xffc3d8fd*/
  }
  v8 = 2688 * n2 + 50813 * n4 + __return_address + 8077 * n6; /*0xffc3d925*/
  while ( 1 ) /*0xffc3d92a*/
  {
    v9 = 9 * v5; /*0xffc3d92a*/
    if ( (*(_BYTE *)(v9 + v8 + 13562) & 2) == 0 ) /*0xffc3d935*/
      break; /*0xffc3d935*/
    if ( *(_DWORD *)(v9 + v8 + 13563) == n84033584 ) /*0xffc3d93e*/
      return v5; /*0xffc3d950*/
    if ( ++v5 >= 6u ) /*0xffc3d945*/
      return -1; /*0xffc3d94c*/
  }
  v10 = 9 * v5; /*0xffc3d955*/
  *(_BYTE *)(v10 + v8 + 13562) |= 2u; /*0xffc3d958*/
  *(_DWORD *)(v10 + v8 + 13563) = n84033584; /*0xffc3d960*/
  result = v5; /*0xffc3d967*/
  if ( *(_BYTE *)(__return_address + 244272) < v5 ) /*0xffc3d96f*/
    *(_BYTE *)(__return_address + 244272) = v5; /*0xffc3d971*/
  return result; /*0xffc3d978*/
}

// Function: ProcCommonFuncD97E @ 0xffc3d97e (0xdc bytes)
// Index: 509/2560

unsigned int __cdecl ProcCommonFuncD97E(_BYTE *__return_address, unsigned __int8 n2, unsigned int n84033584)
{
  int v4; // esi
  unsigned int n84033584a; // [esp+18h] [ebp+Ch]

  v4 = 0; /*0xffc3d985*/
  n84033584a = HIWORD(n84033584); /*0xffc3d991*/
  if ( HIBYTE(n84033584) != 5 )
  {
    AssertPrint(
      __return_address,
      255,
      (int)"\n\nRC_ASSERT! %s: %u   %s ",
      "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Mem\\FnvAccess.c",
      160,
      "BoxType == 5");
    ProcMemInitCheck((int)__return_address, 242, 31); /*0xffc3d9c7*/
  }
  if ( n2 <= 1u ) /*0xffc3d9e5*/
    return n84033584 & 0xFFF | ((n84033584a & 7 | (8 * ((n84033584a & 8) != 0))) << 12); /*0xffc3da52*/
  if ( n2 == 2 ) /*0xffc3d9ea*/
    return 8 * (n84033584 & 0xFF8 | ((n84033584a & 7 | (8 * ((n84033584a & 8) != 0))) << 12)); /*0xffc3da04*/
  AssertPrint(
    __return_address,
    255,
    (int)"\n\nRC_ASSERT! %s: %u   %s ",
    "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Mem\\FnvAccess.c",
    180,
    "FALSE");
  ProcMemInitCheck((int)__return_address, 242, 32); /*0xffc3da32*/
  return v4; /*0xffc3da54*/
}

// Function: ProcCommonFuncDA5A @ 0xffc3da5a (0xa bytes)
// Index: 510/2560

int __cdecl ProcCommonFuncDA5A(int a1)
{
  return a1 + 3264; /*0xffc3da63*/
}

// Function: ProcCommonFuncDA64 @ 0xffc3da64 (0xbf bytes)
// Index: 511/2560

int __cdecl ProcCommonFuncDA64(unsigned __int8 *__return_address, int n4, int n6, int a4, int a5, char *a6)
{
  unsigned int v6; // esi
  int v7; // ebx
  unsigned int buf_2; // edx
  char v9; // ah
  unsigned int v10; // ecx
  unsigned int v11; // ecx
  unsigned int v12; // eax
  int v13; // ecx
  int n40; // edx
  _DWORD buf_1[32]; // [esp+8h] [ebp-100h] BYREF
  unsigned int buf; // [esp+88h] [ebp-80h] BYREF
  _BYTE v18[12]; // [esp+8Ch] [ebp-7Ch]
  unsigned int v19; // [esp+98h] [ebp-70h]
  int v20; // [esp+9Ch] [ebp-6Ch]
  _DWORD v21[24]; // [esp+A8h] [ebp-60h]

  v6 = 0; /*0xffc3da77*/
  KtiFunc7D83(&buf, 0, 0x80u); /*0xffc3da7b*/
  v7 = ProcCommonFuncCCA8(__return_address, n4, n6, a4, buf_1, &buf, 264, a6); /*0xffc3daa4*/
  if ( !v7 ) /*0xffc3daab*/
  {
    buf_2 = buf; /*0xffc3daad*/
    v9 = v18[1]; /*0xffc3dab2*/
    v10 = HIWORD(buf); /*0xffc3dab9*/
    *(_BYTE *)a5 = v18[0]; /*0xffc3dabe*/
    *(_BYTE *)(a5 + 2) = v10; /*0xffc3dac3*/
    v11 = v19; /*0xffc3dac6*/
    *(_BYTE *)(a5 + 5) = v9; /*0xffc3dac9*/
    *(_WORD *)(a5 + 10) = v11; /*0xffc3dace*/
    v12 = HIWORD(v11); /*0xffc3dad2*/
    *(_BYTE *)(a5 + 8) = HIBYTE(v11); /*0xffc3dad8*/
    v13 = v20; /*0xffc3dadb*/
    *(_BYTE *)(a5 + 9) = v12; /*0xffc3dade*/
    *(_WORD *)(a5 + 3) = buf_2; /*0xffc3dae3*/
    *(_BYTE *)(a5 + 7) = v13; /*0xffc3daed*/
    *(_BYTE *)(a5 + 1) = HIBYTE(buf_2); /*0xffc3daf3*/
    *(_BYTE *)(a5 + 12) = BYTE1(v13); /*0xffc3daf6*/
    *(_BYTE *)(a5 + 13) = BYTE2(v13); /*0xffc3daf9*/
    n40 = 40; /*0xffc3dafc*/
    do /*0xffc3db18*/
    {
      *(_BYTE *)(v6 + a5 + 14) = v21[v6 >> 2] >> (8 * (v6 & 3)); /*0xffc3db10*/
      ++v6; /*0xffc3db14*/
      --n40; /*0xffc3db15*/
    }
    while ( n40 ); /*0xffc3db18*/
  }
  return v7; /*0xffc3db1b*/
}

// Function: ProcCommonFuncDB23 @ 0xffc3db23 (0x118 bytes)
// Index: 512/2560

int __cdecl ProcCommonFuncDB23(
        unsigned __int8 *n6,
        int n4,
        int n6a,
        int n2,
        unsigned __int8 a5,
        unsigned __int8 a6,
        unsigned int a7,
        int a8,
        char *a9)
{
  int n2_1; // eax
  int v11; // ebx
  _DWORD buf_1[32]; // [esp+4h] [ebp-B4h] BYREF
  _DWORD buf[13]; // [esp+84h] [ebp-34h] BYREF
  int v15; // [esp+104h] [ebp+4Ch] BYREF
  unsigned int v16; // [esp+108h] [ebp+50h] BYREF

  KtiFunc7D83(buf, 0, 0x80u); /*0xffc3db3b*/
  KtiFunc7D83(buf_1, 0, 0x80u); /*0xffc3db4a*/
  ProcCommonFuncE302((int)n6, n4, n6a, n2, &v16, &v15); /*0xffc3db63*/
  if ( (v16 & 0x1000000) != 0 ) /*0xffc3db73*/
    return 3; /*0xffc3db78*/
  n2_1 = HIWORD(v16) & 3; /*0xffc3db80*/
  if ( n2_1 == 1 ) /*0xffc3db87*/
  {
    buf[1] = HIWORD(a7); /*0xffc3dbb0*/
    buf[0] = a5 | ((a6 | (a7 << 7)) << 9) | 0x100; /*0xffc3dbc3*/
    v11 = ProcCommonFuncCCA8(n6, n4, n6a, n2, buf, buf_1, 262, a9); /*0xffc3dbd8*/
    if ( !v11 ) /*0xffc3dbdf*/
    {
      if ( a6 == 1 ) /*0xffc3dbe5*/
        *(_DWORD *)(a8 + 6656) = buf_1[0]; /*0xffc3dbf0*/
      else
        qmemcpy((void *)(a8 + 6528), buf_1, 0x80u); /*0xffc3dc0b*/
      return v11; /*0xffc3dbf6*/
    }
    if ( *a9 != 20 && *a9 != 3 ) /*0xffc3dc18*/
      return v11; /*0xffc3dc18*/
    return 3; /*0xffc3dc1a*/
  }
  else
  {
    if ( n2_1 ) /*0xffc3dc20*/
      return (n2_1 != 2) + 3; /*0xffc3dc2f*/
    return 2; /*0xffc3dc22*/
  }
}

// Function: ProcCommonFuncDC3B @ 0xffc3dc3b (0x5f bytes)
// Index: 513/2560

int __cdecl ProcCommonFuncDC3B(unsigned __int8 *n6, int n4, int n6a, int n2, __int16 *p_n20000, unsigned __int8 *p_n20)
{
  int v6; // edi
  unsigned int v7; // edx
  __int16 v8; // ax
  _DWORD buf[32]; // [esp+4h] [ebp-100h] BYREF
  unsigned int buf_; // [esp+84h] [ebp-80h] BYREF
  int v12; // [esp+88h] [ebp-7Ch]

  v6 = ProcCommonFuncCCA8(n6, n4, n6a, n2, buf, &buf_, 516, (char *)p_n20); /*0xffc3dc69*/
  if ( !v6 ) /*0xffc3dc70*/
  {
    v7 = HIBYTE(buf_); /*0xffc3dc81*/
    v8 = (_WORD)v12 << 8; /*0xffc3dc84*/
    *p_n20000 = buf_ >> 8; /*0xffc3dc87*/
    p_n20000[1] = v8 | v7; /*0xffc3dc8e*/
  }
  return v6; /*0xffc3dc95*/
}

// Function: ProcCommonFuncDC9A @ 0xffc3dc9a (0x67 bytes)
// Index: 514/2560

int __cdecl ProcCommonFuncDC9A(unsigned __int8 *n4, int n4_1, int n6, int n2, _DWORD *a5, _DWORD *p_n4, char *p_n20)
{
  int result; // eax
  _DWORD buf[32]; // [esp+4h] [ebp-100h] BYREF
  _DWORD buf_1[32]; // [esp+84h] [ebp-80h] BYREF

  KtiFunc7D83(buf, 0, 0x80u); /*0xffc3dcb3*/
  KtiFunc7D83(buf_1, 0, 0x80u); /*0xffc3dcbf*/
  result = ProcCommonFuncCCA8(n4, n4_1, n6, n2, buf, buf_1, 2, p_n20); /*0xffc3dce0*/
  if ( !result ) /*0xffc3dceb*/
  {
    *a5 = buf_1[0]; /*0xffc3dcf3*/
    *p_n4 = buf_1[1]; /*0xffc3dcfb*/
  }
  return result; /*0xffc3dce8*/
}

// Function: ProcCommonFuncDD01 @ 0xffc3dd01 (0x186 bytes)
// Index: 515/2560

int __cdecl ProcCommonFuncDD01(
        unsigned __int8 *__return_address,
        int n4,
        int n6,
        int n2,
        unsigned int a5,
        int *p_n6,
        unsigned __int8 a7,
        __int16 a8,
        char a9)
{
  unsigned __int8 n6_1; // al
  int n1618018304; // esi
  unsigned int n6_3; // esi
  int v12; // eax
  unsigned int v13; // esi
  int n6_2; // [esp+10h] [ebp-4h]
  __int16 v16; // [esp+34h] [ebp+20h]
  int v17; // [esp+34h] [ebp+20h]

  if ( (_BYTE)a8 == 1 ) /*0xffc3dd17*/
    ProcCommonFuncF4C7(__return_address, n4, n6, n2, 84164656, *p_n6); /*0xffc3dd2b*/
  if ( BYTE2(a5) == 14 ) /*0xffc3dd40*/
  {
    n6_1 = 0; /*0xffc3dd4f*/
  }
  else if ( BYTE2(a5) == 15 ) /*0xffc3dd45*/
  {
    n6_1 = 1; /*0xffc3dd4b*/
  }
  else
  {
    n6_1 = 6; /*0xffc3dd47*/
  }
  n6_2 = n6_1; /*0xffc3dd5e*/
  ProcCommonFuncF4C7(__return_address, n4, n6, n2, 84164664, (n6_1 | (unsigned __int16)(a7 << 11)) & 0xD4F | 0x2B0); /*0xffc3dd79*/
  n1618018304 = ((a8 & 1) << 30) | 0x710000; /*0xffc3dd8c*/
  if ( (_BYTE)a8 == 1 ) /*0xffc3dd97*/
    n1618018304 = 1618018304; /*0xffc3dd99*/
  n6_3 = (a5 >> 2) & 0x3FF | ((n6_2 | ((a9 & 0xF | 0xFFFFFF80) << 14)) << 10) | n1618018304; /*0xffc3ddc3*/
  ProcCommonFuncF4C7(__return_address, n4, n6, n2, 84164660, n6_3); /*0xffc3ddd2*/
  if ( (n6_3 & 0x20000000) != 0 ) /*0xffc3dde0*/
    return 0; /*0xffc3de7f*/
  v12 = KtiFunc9B5((int)__return_address); /*0xffc3dde7*/
  v13 = v12 + 100000; /*0xffc3ddf4*/
  if ( (__return_address[246408] & 4) != 0 ) /*0xffc3ddfa*/
    v13 = v12 + 100; /*0xffc3ddfc*/
  if ( (_BYTE)a8 ) /*0xffc3de04*/
  {
    while ( 1 ) /*0xffc3de65*/
    {
      v17 = ProcCommonFuncE35E((int)__return_address, n4, n6, n2, 0x5044040u); /*0xffc3de65*/
      if ( KtiFunc9B5((int)__return_address) >= v13 ) /*0xffc3de73*/
        break; /*0xffc3de73*/
      if ( (v17 & 0x1000000) != 0 ) /*0xffc3de7d*/
        return 0; /*0xffc3de7d*/
    }
  }
  else
  {
    while ( 1 ) /*0xffc3de18*/
    {
      v16 = ProcCommonFuncE35E((int)__return_address, n4, n6, n2, 0x5044040u); /*0xffc3de18*/
      if ( KtiFunc9B5((int)__return_address) >= v13 ) /*0xffc3de26*/
        break; /*0xffc3de26*/
      if ( (v16 & 0x100) != 0 ) /*0xffc3de30*/
      {
        *p_n6 = ProcCommonFuncE35E((int)__return_address, n4, n6, n2, 0x5044044u); /*0xffc3de4a*/
        return 0; /*0xffc3de4c*/
      }
    }
  }
  return 1; /*0xffc3de81*/
}

// Function: ProcCommonFuncDE87 @ 0xffc3de87 (0x7e bytes)
// Index: 516/2560

int __cdecl ProcCommonFuncDE87(unsigned __int8 *n6, int n4, int n6a, int n2, char *a5, unsigned __int8 *p_n20)
{
  int v6; // edi
  unsigned __int16 v7; // cx
  unsigned __int16 v8; // si
  _DWORD buf[32]; // [esp+4h] [ebp-100h] BYREF
  int buf_; // [esp+84h] [ebp-80h] BYREF
  unsigned __int16 v12; // [esp+88h] [ebp-7Ch]
  unsigned __int16 v13; // [esp+8Ch] [ebp-78h]

  v6 = ProcCommonFuncCCA8(n6, n4, n6a, n2, buf, &buf_, 257, (char *)p_n20); /*0xffc3deb5*/
  if ( !v6 ) /*0xffc3debc*/
  {
    v7 = v13; /*0xffc3dec1*/
    v8 = v12; /*0xffc3dec6*/
    *((_WORD *)a5 + 4) = v13; /*0xffc3deca*/
    *((_WORD *)a5 + 2) = v8; /*0xffc3dee0*/
    DebugPrint((int)n6, 3, n4, n6a, n2, 255, 255, 255, "MTSTT = %x, CTSTT = %x\n", v8, v7); /*0xffc3def5*/
  }
  return v6; /*0xffc3df00*/
}

// Function: ProcCommonFuncDF05 @ 0xffc3df05 (0x1cf bytes)
// Index: 517/2560

int __cdecl ProcCommonFuncDF05(unsigned __int8 *n6, int n4, int n6a, int n2, char *buf, unsigned __int8 *p_n20)
{
  unsigned int v6; // edi
  int v7; // ebp
  int buf__1; // ecx
  __int16 v9; // eax^2
  int v10; // ecx
  int v11; // eax
  int n2_1; // ebx
  int n2_2; // edx
  int n2_3; // edx
  int n4_1; // edi
  int n2_4; // edx
  int n20; // edi
  char v18; // cl
  __int16 v19; // ax
  int n9; // edx
  int CpuCount; // eax
  int v22; // edx
  int buf_; // [esp+Ch] [ebp-100h] BYREF
  __int16 v25; // [esp+10h] [ebp-FCh]
  __int16 v26; // [esp+12h] [ebp-FAh]
  int v27; // [esp+14h] [ebp-F8h]
  char v28; // [esp+18h] [ebp-F4h]
  char v29; // [esp+1Ah] [ebp-F2h]
  __int16 v30; // [esp+1Ch] [ebp-F0h]
  int v31; // [esp+28h] [ebp-E4h]
  int v32; // [esp+2Ch] [ebp-E0h]
  _DWORD v33[6]; // [esp+30h] [ebp-DCh]
  int v34; // [esp+48h] [ebp-C4h]
  char v35; // [esp+4Ch] [ebp-C0h]
  __int16 v36; // [esp+4Eh] [ebp-BEh]
  _WORD v37[30]; // [esp+50h] [ebp-BCh]
  _DWORD bufa[32]; // [esp+8Ch] [ebp-80h] BYREF

  v6 = 0; /*0xffc3df1a*/
  KtiFunc7D83(bufa, 0, 0x80u); /*0xffc3df1f*/
  KtiFunc7D83(&buf_, 0, 0x80u); /*0xffc3df2b*/
  v7 = ProcCommonFuncCCA8(n6, n4, n6a, n2, bufa, &buf_, 1, (char *)p_n20); /*0xffc3df67*/
  if ( !v7 ) /*0xffc3df6e*/
  {
    buf__1 = buf_; /*0xffc3df7b*/
    v9 = v26; /*0xffc3df7f*/
    *((_WORD *)buf + 2) = v25; /*0xffc3df84*/
    *(_WORD *)buf = buf__1; /*0xffc3df8b*/
    *((_WORD *)buf + 3) = v9; /*0xffc3df91*/
    *((_WORD *)buf + 1) = HIWORD(buf__1); /*0xffc3df95*/
    v10 = v27; /*0xffc3df99*/
    buf[10] = BYTE2(v27); /*0xffc3dfa2*/
    LOBYTE(v9) = v29; /*0xffc3dfa5*/
    buf[8] = v28; /*0xffc3dfa9*/
    *(_WORD *)(buf + 11) = v10; /*0xffc3dfac*/
    buf[13] = v9; /*0xffc3dfb6*/
    *((_WORD *)buf + 7) = v30; /*0xffc3dfbe*/
    *((_DWORD *)buf + 4) = v31; /*0xffc3dfc8*/
    v11 = v32; /*0xffc3dfcb*/
    n2_1 = 2; /*0xffc3dfcf*/
    buf[9] = HIBYTE(v10); /*0xffc3dfd0*/
    n2_2 = 2; /*0xffc3dfd3*/
    *((_DWORD *)buf + 5) = v11; /*0xffc3dfd5*/
    do /*0xffc3dff3*/
    {
      buf[v6 + 24] = v33[v6 >> 2] >> (8 * (v6 & 3)); /*0xffc3dfeb*/
      ++v6; /*0xffc3dfef*/
      --n2_2; /*0xffc3dff0*/
    }
    while ( n2_2 ); /*0xffc3dff3*/
    n2_3 = 2; /*0xffc3dff7*/
    n4_1 = 4; /*0xffc3dff9*/
    do /*0xffc3e015*/
    {
      buf[n2_3 + 24] = *(_DWORD *)((char *)v33 + (n2_3 & 0xFFFFFFFC)) >> (8 * (n2_3 & 3)); /*0xffc3e00d*/
      ++n2_3; /*0xffc3e011*/
      --n4_1; /*0xffc3e012*/
    }
    while ( n4_1 ); /*0xffc3e015*/
    n2_4 = 2; /*0xffc3e019*/
    n20 = 20; /*0xffc3e01b*/
    do /*0xffc3e037*/
    {
      buf[n2_4 + 28] = *(_DWORD *)((char *)&v33[1] + (n2_4 & 0xFFFFFFFC)) >> (8 * (n2_4 & 3)); /*0xffc3e02f*/
      ++n2_4; /*0xffc3e033*/
      --n20; /*0xffc3e034*/
    }
    while ( n20 ); /*0xffc3e037*/
    v18 = (16 * (v35 & 3)) | BYTE2(v34) & 0xF; /*0xffc3e04e*/
    v19 = v37[0]; /*0xffc3e053*/
    *((_WORD *)buf + 30) = v36; /*0xffc3e05a*/
    buf[50] = v18; /*0xffc3e05e*/
    *((_WORD *)buf + 31) = v19; /*0xffc3e061*/
    n9 = 9; /*0xffc3e065*/
    do /*0xffc3e081*/
    {
      buf[n2_1 + 49] = *(_DWORD *)((char *)v37 + (n2_1 & 0xFFFFFFFC)) >> (8 * (n2_1 & 3)); /*0xffc3e079*/
      ++n2_1; /*0xffc3e07d*/
      --n9; /*0xffc3e07e*/
    }
    while ( n9 ); /*0xffc3e081*/
    CpuCount = GetCpuCount((int)n6, n4, n6a); /*0xffc3e098*/
    v22 = 1379 * (unsigned __int8)n2; /*0xffc3e0aa*/
    *(_WORD *)(v22 + CpuCount + 1366) = *(_WORD *)buf; /*0xffc3e0b4*/
    *(_WORD *)(v22 + CpuCount + 1368) = *((_WORD *)buf + 1); /*0xffc3e0c0*/
  }
  return v7; /*0xffc3e0c8*/
}

// Function: ProcCommonFuncE0D4 @ 0xffc3e0d4 (0x22e bytes)
// Index: 518/2560

char __cdecl ProcCommonFuncE0D4(_BYTE *n6, int n4)
{
  _BYTE *n6_1; // edi
  int SocketInfo; // eax
  unsigned __int8 n6_2; // cl
  _DWORD *v5; // ebp
  int CpuCount; // edx
  int v7; // ecx
  int v8; // eax
  int v9; // eax
  unsigned int v10; // eax
  int v11; // eax
  int n2; // [esp+10h] [ebp-Ch]
  int v14; // [esp+14h] [ebp-8h]
  int CpuCount_1; // [esp+18h] [ebp-4h]

  n6_1 = n6; /*0xffc3e0df*/
  ProcCommonFunc3AF0(n6, n4, 0); /*0xffc3e0e7*/
  SocketInfo = GetSocketInfo((int)n6, n4); /*0xffc3e0ee*/
  n6_2 = 0; /*0xffc3e0f6*/
  LOBYTE(n6) = 0; /*0xffc3e0f8*/
  v5 = (_DWORD *)(SocketInfo + 7497); /*0xffc3e0fc*/
  do /*0xffc3e2b0*/
  {
    if ( *((_BYTE *)v5 - 7497) ) /*0xffc3e102*/
    {
      CpuCount = GetCpuCount((int)n6_1, n4, (unsigned __int8)n6); /*0xffc3e11a*/
      LOBYTE(SocketInfo) = 0; /*0xffc3e11f*/
      CpuCount_1 = CpuCount; /*0xffc3e121*/
      LOBYTE(n2) = 0; /*0xffc3e125*/
      if ( *((_BYTE *)v5 - 7494) ) /*0xffc3e129*/
      {
        do /*0xffc3e297*/
        {
          v7 = 1379 * (unsigned __int8)SocketInfo; /*0xffc3e138*/
          if ( *(_BYTE *)(v7 + CpuCount) && *(_BYTE *)(v7 + CpuCount + 107) && (*(_DWORD *)(n6_1 + 130) & 0x800) != 0 ) /*0xffc3e15d*/
          {
            v14 = *v5; /*0xffc3e166*/
            v8 = *((_DWORD *)n6_1 + 61601); /*0xffc3e16a*/
            if ( !v8 && *(_DWORD *)(n6_1 + 9405) == 10 || v8 == 1 ) /*0xffc3e180*/
              *v5 = 1; /*0xffc3e182*/
            else
              *v5 = 2; /*0xffc3e18b*/
            ProcCommonFuncF4C7(n6_1, n4, (int)n6, n2, 84033808, *(unsigned __int16 *)(n6_1 + 257317)); /*0xffc3e1aa*/
            ProcCommonFuncF4C7(n6_1, n4, (int)n6, n2, 84033800, 0); /*0xffc3e1bd*/
            ProcCommonFuncF4C7(n6_1, n4, (int)n6, n2, 84033796, 0xFFFF); /*0xffc3e1d3*/
            ProcCommonFuncF4C7(n6_1, n4, (int)n6, n2, 84033800, 0x20000); /*0xffc3e1ec*/
            ProcCommonFuncF4C7(n6_1, n4, (int)n6, n2, 84033796, 196607); /*0xffc3e202*/
            ProcCommonFuncF4C7(n6_1, n4, (int)n6, n2, 84033800, 196608); /*0xffc3e218*/
            ProcCommonFuncF4C7(n6_1, n4, (int)n6, n2, 84033796, 0x3FFFF); /*0xffc3e231*/
            *v5 = v14; /*0xffc3e243*/
            v9 = MiscConfigCheck(n6_1, n4, (unsigned __int8)n6, 184631776) | 0x100; /*0xffc3e250*/
            if ( *((_BYTE *)v5 - 7491) == 2 ) /*0xffc3e25c*/
              v10 = v9 & 0xFFFFFF7F; /*0xffc3e265*/
            else
              v10 = v9 | 0x80; /*0xffc3e25e*/
            MiscIoCheck(n6_1, n4, (int)n6, 0xB0141E0u, v10 | 0x200); /*0xffc3e27b*/
            LOBYTE(SocketInfo) = n2; /*0xffc3e280*/
            CpuCount = CpuCount_1; /*0xffc3e287*/
          }
          LOBYTE(SocketInfo) = SocketInfo + 1; /*0xffc3e28b*/
          LOBYTE(n2) = SocketInfo; /*0xffc3e28d*/
        }
        while ( (unsigned __int8)SocketInfo < *((_BYTE *)v5 - 7494) ); /*0xffc3e297*/
      }
      n6_2 = (unsigned __int8)n6; /*0xffc3e29d*/
    }
    ++n6_2; /*0xffc3e2a1*/
    v5 += 1922; /*0xffc3e2a3*/
    LOBYTE(n6) = n6_2; /*0xffc3e2a9*/
  }
  while ( n6_2 < 6u ); /*0xffc3e2b0*/
  if ( !*((_DWORD *)n6_1 + 61601) ) /*0xffc3e2b6*/
  {
    SocketInfo = *(_DWORD *)(n6_1 + 9405); /*0xffc3e2bf*/
    if ( SocketInfo == 8 || SocketInfo == 11 ) /*0xffc3e2cd*/
    {
      ProcCommonFuncC421(n6_1, n4, 3); /*0xffc3e2d3*/
      v11 = CpuIoRead((int)n6_1, n4, 0, 318914720); /*0xffc3e2e2*/
      LOBYTE(SocketInfo) = CpuIoCfgWrite((int)n6_1, n4, 0, 318914720, v11 & 0xFFFFFDFF); /*0xffc3e2f2*/
    }
  }
  return SocketInfo; /*0xffc3e2fa*/
}

// Function: ProcCommonFuncE302 @ 0xffc3e302 (0x5c bytes)
// Index: 519/2560

int __cdecl ProcCommonFuncE302(int a1, int a2, int a3, int a4, _DWORD *a5, int *a6)
{
  int result; // eax

  *a5 = ProcCommonFuncE35E(a1, a2, a3, a4, 84164608); /*0xffc3e329*/
  result = ProcCommonFuncE35E(a1, a2, a3, a4, 84164612); /*0xffc3e331*/
  *a6 = result; /*0xffc3e33c*/
  return result; /*0xffc3e33e*/
}

// Function: ProcCommonFuncE35E @ 0xffc3e35e (0x135 bytes)
// Index: 520/2560

int __cdecl ProcCommonFuncE35E(int __return_address, int n4, int n6, int n2, unsigned int n84033584)
{
  int v6; // ebx
  int n3; // esi
  unsigned __int8 n6_1; // al
  int v9; // ecx
  int v10; // ecx
  int v11; // eax
  int v13[2]; // [esp+Ch] [ebp-8h] BYREF
  unsigned __int8 n6_2; // [esp+1Fh] [ebp+Bh]

  v13[0] = 0; /*0xffc3e366*/
  v6 = 50813 * (unsigned __int8)n4 + __return_address + 2688 * (unsigned __int8)n2 + 8077 * (unsigned __int8)n6; /*0xffc3e399*/
  n3 = *(_DWORD *)(7688 * (unsigned __int8)n6 + GetSocketInfo(__return_address, n4) + 7497); /*0xffc3e3b3*/
  n6_1 = ProcCommonFuncD8BE(__return_address, n4, n6, n2, n84033584); /*0xffc3e3ba*/
  n6_2 = n6_1; /*0xffc3e3c2*/
  if ( n6_1 < 6u ) /*0xffc3e3c7*/
  {
    v9 = 9 * n6_1; /*0xffc3e3cc*/
    if ( (*(_BYTE *)(v9 + v6 + 13562) & 1) != 0 && !*(_BYTE *)(__return_address + 453594) ) /*0xffc3e3d9*/
    {
      v10 = *(_DWORD *)(v9 + v6 + 13567); /*0xffc3e3e2*/
      ++*(_DWORD *)(__return_address + 244273); /*0xffc3e3e9*/
      return v10; /*0xffc3e3ef*/
    }
  }
  if ( n3 <= 0 ) /*0xffc3e3f6*/
  {
LABEL_9:
    DebugPrint(__return_address, 2, n4, n6, n2, 255, 255, 255, "Invalid FNV Access mode.  Using SMBUS\n"); /*0xffc3e41a*/
    KtiFunc1162((_BYTE *)__return_address, 139, 1, n4, n6, n2, 255); /*0xffc3e44a*/
    goto LABEL_10; /*0xffc3e44a*/
  }
  if ( n3 > 2 ) /*0xffc3e3fb*/
  {
    if ( n3 == 3 ) /*0xffc3e400*/
    {
      ProcCommonFuncE493((unsigned __int8 *)__return_address, n4, n6, n2, n84033584, v13); /*0xffc3e413*/
      goto LABEL_11; /*0xffc3e418*/
    }
    goto LABEL_9; /*0xffc3e400*/
  }
LABEL_10:
  ProcCommonFuncE56B((_BYTE *)__return_address, n4, n6, n2, n84033584, (unsigned int *)v13); /*0xffc3e452*/
LABEL_11:
  v10 = v13[0]; /*0xffc3e468*/
  if ( n6_2 < 6u ) /*0xffc3e473*/
  {
    v11 = 9 * n6_2; /*0xffc3e478*/
    *(_BYTE *)(v11 + v6 + 13562) |= 1u; /*0xffc3e47b*/
    *(_DWORD *)(v11 + v6 + 13567) = v10; /*0xffc3e483*/
  }
  return v10; /*0xffc3e48a*/
}

// Function: ProcCommonFuncE493 @ 0xffc3e493 (0xd8 bytes)
// Index: 521/2560

int __cdecl ProcCommonFuncE493(
        unsigned __int8 *__return_address,
        int n4,
        int n6,
        unsigned __int8 n2,
        unsigned int n84033584,
        int *a6)
{
  char n84033584_1; // bl
  unsigned int v7; // ebp
  unsigned int n84033584a_1; // eax
  int n2_1; // ebp
  char v10; // bl
  __int64 v11; // rax
  __int64 v12; // rax
  __int64 v13; // rdi
  int v14; // edx
  int v15; // eax
  int v17[2]; // [esp+8h] [ebp-8h] BYREF
  unsigned int n84033584a; // [esp+24h] [ebp+14h]

  n84033584_1 = n84033584; /*0xffc3e496*/
  v7 = n84033584 >> 12; /*0xffc3e4a4*/
  n84033584a_1 = ProcCommonFuncD97E(__return_address, 2u, n84033584); /*0xffc3e4a7*/
  n84033584a = n84033584a_1; /*0xffc3e4af*/
  n2_1 = v7 & 7; /*0xffc3e4b3*/
  if ( n2_1 ) /*0xffc3e4b6*/
  {
    v10 = 8 * (n84033584_1 & 7); /*0xffc3e4c6*/
    LODWORD(v11) = RmtFunc6EA8(1, 8 * n2_1); /*0xffc3e4d6*/
    v12 = RmtFunc7025(v11, 1); /*0xffc3e4e0*/
    LODWORD(v13) = RmtFunc6EA8(v12, v10); /*0xffc3e4ef*/
    HIDWORD(v13) = v14; /*0xffc3e4f1*/
    ProcCommonFuncC2CD(__return_address, n4, n6, n2, n84033584a, v17); /*0xffc3e50c*/
    v15 = RmtFunc6F34(*(_QWORD *)v17 & v13, v10); /*0xffc3e51c*/
    if ( n2_1 == 4 ) /*0xffc3e52b*/
    {
      *a6 = v15; /*0xffc3e531*/
    }
    else if ( n2_1 == 2 ) /*0xffc3e53c*/
    {
      *(_WORD *)a6 = v15; /*0xffc3e53e*/
    }
    else
    {
      *(_BYTE *)a6 = v15; /*0xffc3e543*/
    }
  }
  else
  {
    ProcCommonFuncC2CD(__return_address, n4, n6, n2, n84033584a_1, a6); /*0xffc3e55c*/
  }
  return 0; /*0xffc3e564*/
}

// Function: ProcCommonFuncE56B @ 0xffc3e56b (0x117 bytes)
// Index: 522/2560

int __cdecl ProcCommonFuncE56B(
        _BYTE *__return_address,
        int n4,
        int n6,
        int n2,
        unsigned int n84033584,
        unsigned int *a6)
{
  char n2_1; // bl
  unsigned int v7; // eax
  unsigned int *v8; // esi
  unsigned int v9; // eax
  int v10; // edx
  unsigned int n84033584_1; // eax
  int n4_1; // [esp+Ch] [ebp-18h] BYREF
  unsigned __int16 v14; // [esp+10h] [ebp-14h]
  int v15; // [esp+14h] [ebp-10h]
  unsigned int v16; // [esp+18h] [ebp-Ch]
  char n2_2; // [esp+1Fh] [ebp-5h]
  char v18; // [esp+23h] [ebp-1h]

  n2_1 = (n84033584 >> 12) & 7; /*0xffc3e588*/
  n2_2 = n2_1; /*0xffc3e58e*/
  v18 = 8 * (n84033584 & 3); /*0xffc3e591*/
  v7 = ProcCommonFuncD97E(__return_address, 0, n84033584); /*0xffc3e594*/
  v8 = a6; /*0xffc3e59f*/
  v16 = v7 & 0xFFFFFFFC; /*0xffc3e5a8*/
  v14 = v14 & 0xF0F | 0xB0; /*0xffc3e5b3*/
  *a6 = -1; /*0xffc3e5b8*/
  LOWORD(n4_1) = 1; /*0xffc3e5bb*/
  DdrTrainFunc466A((int)__return_address, n4, n6, n2, (int)&n4_1); /*0xffc3e5cd*/
  a6 = (unsigned int *)(KtiFunc9B5((int)__return_address) + 700000); /*0xffc3e5e0*/
  do /*0xffc3e625*/
  {
    n84033584 = 0; /*0xffc3e5e9*/
    v15 = ProcCommonFuncE682(__return_address, n4, v16, n4_1, v14, (unsigned __int8 *)&n84033584); /*0xffc3e60f*/
    v9 = KtiFunc9B5((int)__return_address); /*0xffc3e612*/
    if ( v9 > (unsigned int)a6 ) /*0xffc3e61d*/
    {
      KtiFunc211E((int)__return_address, 61, 2, n4, n6, n2, 255); /*0xffc3e664*/
      KtiFunc8A8E((int)__return_address, n4, n6); /*0xffc3e670*/
      return 1; /*0xffc3e67a*/
    }
    v10 = v15; /*0xffc3e61f*/
  }
  while ( v15 == 1 ); /*0xffc3e625*/
  n84033584 >>= v18; /*0xffc3e62f*/
  if ( n2_1 == 4 ) /*0xffc3e635*/
  {
    n84033584_1 = n84033584; /*0xffc3e637*/
  }
  else if ( n2_1 == 2 ) /*0xffc3e63f*/
  {
    n84033584_1 = (unsigned __int16)n84033584; /*0xffc3e641*/
  }
  else
  {
    n84033584_1 = (unsigned __int8)n84033584; /*0xffc3e647*/
  }
  *v8 = n84033584_1; /*0xffc3e64b*/
  return v10; /*0xffc3e67b*/
}

// Function: ProcCommonFuncE682 @ 0xffc3e682 (0x1b7 bytes)
// Index: 523/2560

int __cdecl ProcCommonFuncE682(
        _BYTE *__return_address,
        int n4,
        unsigned int a3,
        int n4_1,
        unsigned __int16 a5,
        unsigned __int8 *p_n84033584)
{
  int result; // eax
  unsigned __int8 v7; // [esp+11h] [ebp-3h] BYREF
  unsigned __int8 v8; // [esp+12h] [ebp-2h] BYREF
  unsigned __int8 v9; // [esp+13h] [ebp-1h] BYREF

  v8 = 0; /*0xffc3e691*/
  v9 = 0; /*0xffc3e695*/
  v7 = 0; /*0xffc3e699*/
  result = DdrTrainFunc5231(__return_address, n4, n4_1, a5, 128, &v9); /*0xffc3e6bc*/
  if ( !result ) /*0xffc3e6c6*/
  {
    v8 = (a3 >> 12) & 0xF; /*0xffc3e6d9*/
    result = DdrTrainFunc5231(__return_address, n4, n4_1, a5, 0, &v8); /*0xffc3e6f8*/
    if ( !result ) /*0xffc3e702*/
    {
      v7 = BYTE1(a3) & 0xF; /*0xffc3e70f*/
      result = DdrTrainFunc5231(__return_address, n4, n4_1, a5, 0, &v7); /*0xffc3e72e*/
      if ( !result ) /*0xffc3e738*/
      {
        v7 = a3; /*0xffc3e742*/
        result = DdrTrainFunc5231(__return_address, n4, n4_1, a5, 64, &v7); /*0xffc3e75e*/
        if ( !result ) /*0xffc3e768*/
        {
          result = DdrTrainFunc4A71(__return_address, n4, n4_1, a5, 128, &v9); /*0xffc3e78d*/
          if ( !result ) /*0xffc3e797*/
          {
            result = DdrTrainFunc4A71(__return_address, n4, n4_1, a5, 0, p_n84033584 + 3); /*0xffc3e7bb*/
            if ( !result ) /*0xffc3e7c5*/
            {
              result = DdrTrainFunc4A71(__return_address, n4, n4_1, a5, 0, p_n84033584 + 2); /*0xffc3e7e1*/
              if ( !result ) /*0xffc3e7eb*/
              {
                result = DdrTrainFunc4A71(__return_address, n4, n4_1, a5, 0, p_n84033584 + 1); /*0xffc3e807*/
                if ( !result ) /*0xffc3e811*/
                  return DdrTrainFunc4A71(__return_address, n4, n4_1, a5, 64, p_n84033584); /*0xffc3e82b*/
              }
            }
          }
        }
      }
    }
  }
  return result; /*0xffc3e833*/
}

// Function: ProcCommonFuncE839 @ 0xffc3e839 (0xbc bytes)
// Index: 524/2560

int __cdecl ProcCommonFuncE839(unsigned __int8 *n4, int n4_1, int n6, int n2, int buf, char *a6)
{
  int *buf_3; // edi
  unsigned __int8 v7; // bl
  int n8; // ebp
  int v9; // ecx
  _DWORD buf_1[32]; // [esp+10h] [ebp-100h] BYREF
  _DWORD buf_2[32]; // [esp+90h] [ebp-80h] BYREF

  KtiFunc7D83(buf_1, 0, 0x80u); /*0xffc3e84f*/
  KtiFunc7D83(buf_2, 0, 0x80u); /*0xffc3e85f*/
  buf_3 = buf_1; /*0xffc3e86b*/
  v7 = 0; /*0xffc3e872*/
  n8 = 8; /*0xffc3e876*/
  do /*0xffc3e8a7*/
  {
    v9 = v7; /*0xffc3e877*/
    v7 += 4; /*0xffc3e87a*/
    *buf_3++ = *(unsigned __int8 *)(v9 + buf) /*0xffc3e89f*/
             | ((*(unsigned __int8 *)(buf + v9 + 1) | (*(unsigned __int16 *)(buf + v9 + 2) << 8)) << 8);
    --n8; /*0xffc3e8a4*/
  }
  while ( n8 ); /*0xffc3e8a7*/
  buf_1[8] = 0; /*0xffc3e8b0*/
  return ProcCommonFuncCCA8(n4, n4_1, n6, n2, buf_1, buf_2, 62723, a6); /*0xffc3e8ea*/
}

// Function: DimmCommTest @ 0xffc3e8f5 (0x1e5 bytes)
// Index: 525/2560

int __cdecl DimmCommTest(unsigned __int8 *__return_address, int n4, int n6, int n2, int buf, char *a6)
{
  unsigned int v6; // edi
  int v7; // ebp
  int buf__2; // ecx
  __int16 v9; // eax^2
  int n2_1; // ebx
  int n2_2; // edx
  int v12; // ecx
  int v13; // eax
  int n2_3; // edx
  int n4_1; // edi
  int n2_4; // edx
  int n20; // edi
  char v18; // cl
  __int16 v19; // ax
  int n9; // edx
  int CpuCount; // eax
  int v22; // edx
  int buf_; // [esp+8h] [ebp-100h] BYREF
  __int16 v25; // [esp+Ch] [ebp-FCh]
  __int16 v26; // [esp+Eh] [ebp-FAh]
  int v27; // [esp+10h] [ebp-F8h]
  char v28; // [esp+14h] [ebp-F4h]
  char v29; // [esp+16h] [ebp-F2h]
  __int16 v30; // [esp+18h] [ebp-F0h]
  int v31; // [esp+24h] [ebp-E4h]
  int v32; // [esp+28h] [ebp-E0h]
  _DWORD v33[6]; // [esp+2Ch] [ebp-DCh]
  int v34; // [esp+44h] [ebp-C4h]
  char v35; // [esp+48h] [ebp-C0h]
  __int16 v36; // [esp+4Ah] [ebp-BEh]
  _WORD v37[30]; // [esp+4Ch] [ebp-BCh]
  int buf__1; // [esp+88h] [ebp-80h] BYREF
  int bufa[31]; // [esp+8Ch] [ebp-7Ch] BYREF

  v6 = 0; /*0xffc3e8ff*/
  KtiFunc7D83(bufa, 0, 0x7Cu); /*0xffc3e90a*/
  KtiFunc7D83(&buf_, 0, 0x80u); /*0xffc3e91a*/
  buf__1 = -1412567126; /*0xffc3e92a*/
  bufa[0] = 277; /*0xffc3e93f*/
  v7 = ProcCommonFuncCCA8(__return_address, n4, n6, n2, &buf__1, &buf_, 1, a6); /*0xffc3e96c*/
  if ( !v7 ) /*0xffc3e973*/
  {
    buf__2 = buf_; /*0xffc3e979*/
    v9 = v26; /*0xffc3e97d*/
    n2_1 = 2; /*0xffc3e98c*/
    n2_2 = 2; /*0xffc3e98d*/
    *(_WORD *)(buf + 4) = v25; /*0xffc3e98f*/
    *(_WORD *)buf = buf__2; /*0xffc3e996*/
    *(_WORD *)(buf + 6) = v9; /*0xffc3e99c*/
    *(_WORD *)(buf + 2) = HIWORD(buf__2); /*0xffc3e9a0*/
    v12 = v27; /*0xffc3e9a4*/
    *(_BYTE *)(buf + 10) = BYTE2(v27); /*0xffc3e9ad*/
    LOBYTE(v9) = v29; /*0xffc3e9b0*/
    *(_BYTE *)(buf + 8) = v28; /*0xffc3e9b4*/
    *(_WORD *)(buf + 11) = v12; /*0xffc3e9b7*/
    *(_BYTE *)(buf + 13) = v9; /*0xffc3e9c1*/
    *(_WORD *)(buf + 14) = v30; /*0xffc3e9c9*/
    *(_DWORD *)(buf + 16) = v31; /*0xffc3e9d1*/
    v13 = v32; /*0xffc3e9d4*/
    *(_BYTE *)(buf + 9) = HIBYTE(v12); /*0xffc3e9d8*/
    *(_DWORD *)(buf + 20) = v13; /*0xffc3e9db*/
    do /*0xffc3e9f9*/
    {
      *(_BYTE *)(v6 + buf + 24) = v33[v6 >> 2] >> (8 * (v6 & 3)); /*0xffc3e9f1*/
      ++v6; /*0xffc3e9f5*/
      --n2_2; /*0xffc3e9f6*/
    }
    while ( n2_2 ); /*0xffc3e9f9*/
    n2_3 = 2; /*0xffc3e9fd*/
    n4_1 = 4; /*0xffc3e9ff*/
    do /*0xffc3ea1b*/
    {
      *(_BYTE *)(buf + n2_3 + 24) = *(_DWORD *)((char *)v33 + (n2_3 & 0xFFFFFFFC)) >> (8 * (n2_3 & 3)); /*0xffc3ea13*/
      ++n2_3; /*0xffc3ea17*/
      --n4_1; /*0xffc3ea18*/
    }
    while ( n4_1 ); /*0xffc3ea1b*/
    n2_4 = 2; /*0xffc3ea1f*/
    n20 = 20; /*0xffc3ea21*/
    do /*0xffc3ea3d*/
    {
      *(_BYTE *)(buf + n2_4 + 28) = *(_DWORD *)((char *)&v33[1] + (n2_4 & 0xFFFFFFFC)) >> (8 * (n2_4 & 3)); /*0xffc3ea35*/
      ++n2_4; /*0xffc3ea39*/
      --n20; /*0xffc3ea3a*/
    }
    while ( n20 ); /*0xffc3ea3d*/
    v18 = (16 * (v35 & 3)) | BYTE2(v34) & 0xF; /*0xffc3ea54*/
    v19 = v37[0]; /*0xffc3ea59*/
    *(_WORD *)(buf + 60) = v36; /*0xffc3ea60*/
    *(_BYTE *)(buf + 50) = v18; /*0xffc3ea64*/
    *(_WORD *)(buf + 62) = v19; /*0xffc3ea67*/
    n9 = 9; /*0xffc3ea6b*/
    do /*0xffc3ea87*/
    {
      *(_BYTE *)(buf + n2_1 + 49) = *(_DWORD *)((char *)v37 + (n2_1 & 0xFFFFFFFC)) >> (8 * (n2_1 & 3)); /*0xffc3ea7f*/
      ++n2_1; /*0xffc3ea83*/
      --n9; /*0xffc3ea84*/
    }
    while ( n9 ); /*0xffc3ea87*/
    CpuCount = GetCpuCount((int)__return_address, n4, n6); /*0xffc3ea9e*/
    v22 = 1379 * (unsigned __int8)n2; /*0xffc3eab0*/
    *(_WORD *)(v22 + CpuCount + 1366) = *(_WORD *)buf; /*0xffc3eab9*/
    *(_WORD *)(v22 + CpuCount + 1368) = *(_WORD *)(buf + 2); /*0xffc3eac6*/
  }
  return v7; /*0xffc3eacf*/
}

// Function: ProcCommonFuncEADA @ 0xffc3eada (0x48 bytes)
// Index: 526/2560

int __cdecl ProcCommonFuncEADA(unsigned __int8 *n4, int n4_1, int n2, int a4, unsigned __int8 buf_, char *a6)
{
  _DWORD buf_1[32]; // [esp+0h] [ebp-100h] BYREF
  int buf__1; // [esp+80h] [ebp-80h] BYREF
  _BYTE buf[124]; // [esp+84h] [ebp-7Ch] BYREF

  KtiFunc7D83(buf, 0, 0x7Cu); /*0xffc3eaeb*/
  buf__1 = buf_; /*0xffc3eafc*/
  return ProcCommonFuncCCA8(n4, n4_1, n2, a4, &buf__1, buf_1, 773, a6); /*0xffc3eb1e*/
}

// Function: ProcCommonFuncEB22 @ 0xffc3eb22 (0x1d4 bytes)
// Index: 527/2560

int __cdecl ProcCommonFuncEB22(
        unsigned __int8 *n6,
        int n4,
        int n6a,
        int n2,
        unsigned int a5,
        unsigned int n0x40000,
        _BYTE *a7,
        char *p_n20)
{
  int v8; // ecx
  int v10; // [esp+10h] [ebp-108h] BYREF
  int p_n4; // [esp+14h] [ebp-104h] BYREF
  _DWORD buf[32]; // [esp+18h] [ebp-100h] BYREF
  _DWORD buf_1[32]; // [esp+98h] [ebp-80h] BYREF

  KtiFunc7D83(buf, 0, 0x80u); /*0xffc3eb38*/
  if ( ProcCommonFuncDC9A(n6, n4, n6a, n2, &v10, &p_n4, p_n20) == 1 ) /*0xffc3eb79*/
  {
    DebugPrint((int)n6, 2, n4, n6a, n2, 255, 255, 255, aGetsecuritysta, p_n20); /*0xffc3eb95*/
  }
  else if ( (v10 & 4) != 0 ) /*0xffc3eba7*/
  {
    DebugPrint((int)n6, 3, n4, n6a, n2, 255, 255, 255, aSecurityStateL); /*0xffc3ebbc*/
  }
  else
  {
    buf[0] = a5; /*0xffc3ebd7*/
    buf[1] = n0x40000; /*0xffc3ebe7*/
    if ( ProcCommonFuncCCA8(n6, n4, n6a, n2, buf, buf_1, 519, p_n20) == 1 ) /*0xffc3ec0e*/
    {
      DebugPrint((int)n6, 2, n4, n6a, n2, 255, 255, 255, aSetdimmpartiti, p_n20); /*0xffc3ec15*/
    }
    else if ( ProcCommonFuncD808(n6, n4, n6a, n2, (int)a7, p_n20) == 1 ) /*0xffc3ec30*/
    {
      DebugPrint((int)n6, 2, n4, n6a, n2, 255, 255, 255, aGetdimmpartiti, p_n20); /*0xffc3ec3e*/
    }
    else
    {
      v8 = 60 * ((unsigned __int8)n2 + 2 * ((unsigned __int8)n6a + 6 * (unsigned __int8)n4)); /*0xffc3ec69*/
      if ( *(_DWORD *)&a7[v8 + 3264] == a5 && *(_DWORD *)&a7[v8 + 3276] == n0x40000 ) /*0xffc3ec8a*/
      {
        DebugPrint((int)n6, 2, n4, n6a, n2, 255, 255, 255, aSetdimmpartiti_0); /*0xffc3eca5*/
        return 0; /*0xffc3ecaf*/
      }
      DebugPrint( /*0xffc3ece0*/
        (int)n6,
        3,
        n4,
        n6a,
        n2,
        255,
        255,
        255,
        aSetdimmpartiti_1,
        a5,
        n0x40000,
        *(_DWORD *)&a7[v8 + 3264],
        *(_DWORD *)&a7[v8 + 3276]);
    }
  }
  return 1; /*0xffc3eceb*/
}

// Function: ProcCommonFuncECF6 @ 0xffc3ecf6 (0x49 bytes)
// Index: 528/2560

int __cdecl ProcCommonFuncECF6(unsigned __int8 *n4, int n4_1, int n6, int n2, char *p_n20)
{
  _DWORD buf_1[32]; // [esp+0h] [ebp-100h] BYREF
  _DWORD buf[32]; // [esp+80h] [ebp-80h] BYREF

  KtiFunc7D83(buf, 0, 0x80u); /*0xffc3ed0a*/
  buf[0] = KtiFuncA48(); /*0xffc3ed17*/
  return ProcCommonFuncCCA8(n4, n4_1, n6, n2, buf, buf_1, 7, p_n20); /*0xffc3ed3b*/
}

// Function: ProcCommonFuncED3F @ 0xffc3ed3f (0x7a bytes)
// Index: 529/2560

int __cdecl ProcCommonFuncED3F(
        unsigned __int8 *__return_address,
        int n4,
        int n6,
        int a4,
        unsigned __int8 a5,
        int *p___return_address)
{
  _DWORD buf_2[32]; // [esp+4h] [ebp-A4h] BYREF
  _DWORD buf_1[32]; // [esp+84h] [ebp-24h] BYREF
  int buf; // [esp+104h] [ebp+5Ch] BYREF

  KtiFunc7D83(buf_1, 0, 0x80u); /*0xffc3ed57*/
  KtiFunc7D83(buf_2, 0, 0x80u); /*0xffc3ed66*/
  memset_save_flags(&buf, 0, 4u); /*0xffc3ed73*/
  buf ^= ((unsigned __int8)buf ^ a5) & 1; /*0xffc3ed8e*/
  buf_1[0] = buf; /*0xffc3ed91*/
  return ProcCommonFuncCCA8(__return_address, n4, n6, a4, buf_1, buf_2, 2311, (char *)p___return_address); /*0xffc3edb4*/
}

// Function: ProcCommonFuncEDB9 @ 0xffc3edb9 (0x9e bytes)
// Index: 530/2560

int __cdecl ProcCommonFuncEDB9(unsigned __int8 *n6, int n4, int n6a, int n2, unsigned __int8 *a5, char *p_n20)
{
  int v6; // esi
  _DWORD buf_1[32]; // [esp+8h] [ebp-100h] BYREF
  int buf_; // [esp+88h] [ebp-80h] BYREF
  _BYTE buf[124]; // [esp+8Ch] [ebp-7Ch] BYREF

  KtiFunc7D83(buf, 0, 0x7Cu); /*0xffc3edcc*/
  buf_ = *a5 | (*((unsigned __int16 *)a5 + 1) << 8); /*0xffc3edf1*/
  DebugPrint((int)n6, 3, n4, n6a, n2, 255, 255, 255, "InputPayload[0]=%x\n", buf_); /*0xffc3edff*/
  v6 = ProcCommonFuncCCA8(n6, n4, n6a, n2, &buf_, buf_1, 2053, p_n20); /*0xffc3ee28*/
  if ( !v6 ) /*0xffc3ee2f*/
    DebugPrint((int)n6, 3, n4, n6a, n2, 255, 255, 255, "Set Performance Knob value is set via MB\n"); /*0xffc3ee47*/
  return v6; /*0xffc3ee4f*/
}

// Function: ProcCommonFuncEE57 @ 0xffc3ee57 (0x9e bytes)
// Index: 531/2560

int __cdecl ProcCommonFuncEE57(unsigned __int8 *n6, int n4, int n6a, int n2, __int16 *p_n20000, unsigned __int8 *p_n20)
{
  int v6; // edx
  int v7; // esi
  int CpuCount; // eax
  int v9; // edx
  _DWORD buf_1[32]; // [esp+Ch] [ebp-100h] BYREF
  int buf_; // [esp+8Ch] [ebp-80h] BYREF
  int buf[31]; // [esp+90h] [ebp-7Ch] BYREF

  KtiFunc7D83(buf, 0, 0x7Cu); /*0xffc3ee6b*/
  v6 = HIBYTE(p_n20000[1]); /*0xffc3ee8c*/
  buf_ = *(_DWORD *)p_n20000 << 8; /*0xffc3ee9c*/
  buf[0] = v6; /*0xffc3eea4*/
  v7 = ProcCommonFuncCCA8(n6, n4, n6a, n2, &buf_, buf_1, 517, (char *)p_n20); /*0xffc3eeb2*/
  if ( !v7 ) /*0xffc3eeb9*/
  {
    CpuCount = GetCpuCount((int)n6, n4, n6a); /*0xffc3eec4*/
    v9 = 1379 * (unsigned __int8)n2; /*0xffc3eecf*/
    *(_WORD *)(v9 + CpuCount + 1352) = *p_n20000; /*0xffc3eed8*/
    *(_WORD *)(v9 + CpuCount + 1354) = p_n20000[1]; /*0xffc3eee4*/
  }
  return v7; /*0xffc3eeec*/
}

// Function: ProcCommonFuncEEF5 @ 0xffc3eef5 (0x62 bytes)
// Index: 532/2560

int __cdecl ProcCommonFuncEEF5(unsigned __int8 *n6, int n4, int n6a, int n2, char n2a, unsigned __int8 *p_n20)
{
  _DWORD buf_1[32]; // [esp+0h] [ebp-100h] BYREF
  _DWORD buf[32]; // [esp+80h] [ebp-80h] BYREF

  KtiFunc7D83(buf, 0, 0x80u); /*0xffc3ef09*/
  if ( n2a == 2 ) /*0xffc3ef16*/
  {
    buf[0] = 2; /*0xffc3ef18*/
  }
  else if ( n2a == 1 ) /*0xffc3ef23*/
  {
    buf[0] = 1; /*0xffc3ef25*/
  }
  return ProcCommonFuncCCA8(n6, n4, n6a, n2, buf, buf_1, 255, (char *)p_n20); /*0xffc3ef53*/
}

// Function: ProcCommonFuncEF57 @ 0xffc3ef57 (0x3b4 bytes)
// Index: 533/2560

int __cdecl ProcCommonFuncEF57(int a1, int a2, int a3, int a4)
{
  unsigned int v4; // esi
  unsigned int v6; // [esp+10h] [ebp-8h] BYREF
  unsigned int v7; // [esp+14h] [ebp-4h] BYREF

  ProcCommonFuncE302(a1, a2, a3, a4, &v6, (int *)&v7); /*0xffc3ef7b*/
  DebugPrint(a1, 3, a2, a3, a4, 255, 255, 255, "FW_STATUS / Boot Status Register(BSR):\n"); /*0xffc3ef93*/
  DebugPrint(a1, 3, a2, a3, a4, 255, 255, 255, "============================================\n"); /*0xffc3efab*/
  DebugPrint(a1, 3, a2, a3, a4, 255, 255, 255, "FW_STATUS   = 0x%08X\n", v6); /*0xffc3efca*/
  v4 = v7; /*0xffc3efcf*/
  DebugPrint(a1, 3, a2, a3, a4, 255, 255, 255, "FW_STATUS_H = 0x%08X\n", v7); /*0xffc3efea*/
  DebugPrint(a1, 3, a2, a3, a4, 255, 255, 255, "============================================\n"); /*0xffc3f008*/
  DebugPrint( /*0xffc3f02b*/
    a1,
    3,
    a2,
    a3,
    a4,
    255,
    255,
    255,
    "  [07:00] MajorCheckpoint -------------------------------- = 0x%02X\n",
    (unsigned __int8)v6);
  DebugPrint( /*0xffc3f054*/
    a1,
    3,
    a2,
    a3,
    a4,
    255,
    255,
    255,
    "  [15:08] MinorCheckpoint -------------------------------- = 0x%02X\n",
    BYTE1(v6));
  DebugPrint( /*0xffc3f07a*/
    a1,
    3,
    a2,
    a3,
    a4,
    255,
    255,
    255,
    "  [17:16] MR (Media Ready) ------------------------------- = 0x%1X (0:Not Ready, 1:Ready, 2:Error, 3:Rsvd)\n",
    HIWORD(v6) & 3);
  DebugPrint( /*0xffc3f0a3*/
    a1,
    3,
    a2,
    a3,
    a4,
    255,
    255,
    255,
    "  [18:18] DT (DDRT IO Init Cmpl) ------------------------- = 0x%1X (0:Not Ready, 1:Ready)\n",
    (v6 >> 18) & 1);
  DebugPrint( /*0xffc3f0c9*/
    a1,
    3,
    a2,
    a3,
    a4,
    255,
    255,
    255,
    "  [19:19] PCR (PCR Access Locked) ------------------------ = 0x%1X (0:Unlocked, 1:Locked)\n",
    (v6 >> 19) & 1);
  DebugPrint( /*0xffc3f0f2*/
    a1,
    3,
    a2,
    a3,
    a4,
    255,
    255,
    255,
    "  [20:20] MBR (Mailbox Ready) ---------------------------- = 0x%1X (0:Not Ready, 1:Ready)\n",
    (v6 >> 20) & 1);
  DebugPrint( /*0xffc3f118*/
    a1,
    3,
    a2,
    a3,
    a4,
    255,
    255,
    255,
    "  [21:21] WTS -------------------------------------------- = 0x%1X (0:No Change, 1:WDT NMI Generated)\n",
    (v6 >> 21) & 1);
  DebugPrint( /*0xffc3f141*/
    a1,
    3,
    a2,
    a3,
    a4,
    255,
    255,
    255,
    "  [22:22] FRCF ------------------------------------------- = 0x%1X (0:No Change, 1:First Refresh Cycle Completed)\n",
    (v6 >> 22) & 1);
  DebugPrint( /*0xffc3f167*/
    a1,
    3,
    a2,
    a3,
    a4,
    255,
    255,
    255,
    "  [23:23] CR (Credit Ready) ------------------------------ = 0x%1X (0:WDB Not Flushed, 1:WDB Flushed)\n",
    (v6 >> 23) & 1);
  DebugPrint( /*0xffc3f190*/
    a1,
    3,
    a2,
    a3,
    a4,
    255,
    255,
    255,
    "  [24:24] MD (Media Disabled) ---------------------------- = 0x%1X (0:Media Normal, 1:Media Disabled)\n",
    HIBYTE(v6) & 1);
  DebugPrint( /*0xffc3f1b6*/
    a1,
    3,
    a2,
    a3,
    a4,
    255,
    255,
    255,
    "  [25:25] SVNDE (SVN Downgrade Downgrade Enable)---------- = 0x%1X (0:Not Enabled, 1:Enabled)\n",
    (v6 >> 25) & 1);
  DebugPrint( /*0xffc3f1df*/
    a1,
    3,
    a2,
    a3,
    a4,
    255,
    255,
    255,
    "  [26:26] SVNCOIS (SVN Downgrade Capability Opt-In Status) = 0x%1X (0:Never Enabled, 1:Has Been Enabled)\n",
    (v6 >> 26) & 1);
  DebugPrint( /*0xffc3f205*/
    a1,
    3,
    a2,
    a3,
    a4,
    255,
    255,
    255,
    "  [28:27] DR (Dram Ready (AIT)) -------------------------- = 0x%1X (0:Not Trained, 1:Not Loaded, 2:Error, 3:Loaded)\n",
    (v6 >> 27) & 3);
  DebugPrint( /*0xffc3f22e*/
    a1,
    3,
    a2,
    a3,
    a4,
    255,
    255,
    255,
    "  [29:29] RR (Reboot Required) --------------------------- = 0x%1X (0:No Reset needed, 1:Required platform power cycle)\n",
    (v6 >> 29) & 1);
  DebugPrint( /*0xffc3f254*/
    a1,
    3,
    a2,
    a3,
    a4,
    255,
    255,
    255,
    "  [30:30] LFOPB (Link Failure On Previous Boot) ---------- = 0x%1X (0:No Error, 1:Fatal Link Error)\n",
    (v6 >> 30) & 1);
  DebugPrint( /*0xffc3f27a*/
    a1,
    3,
    a2,
    a3,
    a4,
    255,
    255,
    255,
    "  [31:31] SVNWC (SVN Opt-In Window Closed ---------------- = 0x%1X (0:Window Open, 1:Window Closed)\n",
    v6 >> 31);
  DebugPrint( /*0xffc3f29b*/
    a1,
    3,
    a2,
    a3,
    a4,
    255,
    255,
    255,
    "  [32:32] Assertion -------------------------------------- = 0x%1X (1:FW Hit Assert - debug only)\n",
    v4 & 1);
  DebugPrint( /*0xffc3f2c1*/
    a1,
    3,
    a2,
    a3,
    a4,
    255,
    255,
    255,
    "  [33:33] MI_Stalled ------------------------------------- = 0x%1X (1:Media Interface Stalled - debug only)\n",
    (v4 >> 1) & 1);
  DebugPrint( /*0xffc3f2e3*/
    a1,
    3,
    a2,
    a3,
    a4,
    255,
    255,
    255,
    "  [35:34] DTS (DDRT Training Status)---------------------- = 0x%1X (0:Training Not Complete, 1:Training Complete, 2:"
    "Training Failure, 3:S3 Complete)\n",
    (v4 >> 2) & 3);
  return DebugPrint(a1, 3, a2, a3, a4, 255, 255, 255, "  [63:36] Reserved\n\n"); /*0xffc3f304*/
}

// Function: ProcCommonFuncF30B @ 0xffc3f30b (0x15e bytes)
// Index: 534/2560

int __cdecl ProcCommonFuncF30B(int n6, int n4, int n6a, int n2, int a5, int n1543)
{
  int v6; // esi
  const char *NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n; // [esp-4h] [ebp-8h]

  v6 = 1; /*0xffc3f314*/
  switch ( a5 )
  {
    case 0:
      v6 = 0; /*0xffc3f32f*/
      DebugPrint(n6, 2, n4, n6a, n2, 255, 255, 255, "NVMCTL Mailbox SUCCESS\n"); /*0xffc3f342*/
      return v6; /*0xffc3f34a*/
    case 1:
      NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Failure Invalid Command Parameter\n"; /*0xffc3f34f*/
      goto LABEL_4; /*0xffc3f34f*/
    case 2:
      NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Failure Data Transfer Error\n"; /*0xffc3f369*/
      goto LABEL_4; /*0xffc3f36e*/
    case 3:
      if ( n1543 == 1032 ) /*0xffc3f37c*/
        goto LABEL_7; /*0xffc3f37c*/
      NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Failure Internal Device Error\n"; /*0xffc3f385*/
      goto LABEL_4; /*0xffc3f38a*/
    case 4:
      NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Failure Unsupported Command\n"; /*0xffc3f38c*/
      goto LABEL_4; /*0xffc3f391*/
    case 5:
      NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Failure Device Busy\n"; /*0xffc3f393*/
      goto LABEL_4; /*0xffc3f398*/
    case 6:
      NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Failure Incorrect Passphrase/Security Nonce\n"; /*0xffc3f39a*/
      goto LABEL_4; /*0xffc3f39f*/
    case 7:
      NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Failure Security Check Fail\n"; /*0xffc3f3a1*/
      goto LABEL_4; /*0xffc3f3a6*/
    case 8:
      NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Failure Invalid Security State\n"; /*0xffc3f3a8*/
      goto LABEL_4; /*0xffc3f3ad*/
    case 9:
      NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Failure System Time Not Set\n"; /*0xffc3f3af*/
      goto LABEL_4; /*0xffc3f3b4*/
    case 10:
      if ( n1543 == 1032 )
LABEL_7:
        NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox: No Long Operation Started Yet\n";
      else
        NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Failure Data Not Set\n"; /*0xffc3f3c4*/
      goto LABEL_4; /*0xffc3f3c9*/
    case 11:
      NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Failure Aborted\n"; /*0xffc3f3cb*/
      goto LABEL_4; /*0xffc3f3d0*/
    case 12:
      NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Failure No New FW to Execute\n"; /*0xffc3f3d2*/
      goto LABEL_4; /*0xffc3f3d7*/
    case 13:
      NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Revision Failure\n"; /*0xffc3f3dc*/
      goto LABEL_4; /*0xffc3f3e1*/
    case 14:
      NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Failure Injection Not Enabled\n"; /*0xffc3f3e6*/
      goto LABEL_4; /*0xffc3f3eb*/
    case 15:
      NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Failure Config Locked Command Invalid\n"; /*0xffc3f3f0*/
      goto LABEL_4; /*0xffc3f3f5*/
    case 16:
      NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Failure Invalid Alignment\n"; /*0xffc3f3fa*/
      goto LABEL_4; /*0xffc3f3ff*/
    case 17:
      NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Failure Incompatible DIMM Type\n"; /*0xffc3f404*/
      goto LABEL_4; /*0xffc3f409*/
    case 18:
      NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Failure Timeout Occurred\n"; /*0xffc3f40e*/
      goto LABEL_4; /*0xffc3f413*/
    case 19:
      NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Failure Invalid Commmand Version\n"; /*0xffc3f418*/
      goto LABEL_4; /*0xffc3f41d*/
    case 20:
      NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Failure Media Disabled\n"; /*0xffc3f422*/
      goto LABEL_4; /*0xffc3f427*/
    case 21:
      NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Failure FW Update Already Occurred\n"; /*0xffc3f42c*/
      goto LABEL_4; /*0xffc3f431*/
    case 22:
      NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n = "NVMCTL Mailbox Failure No Resources Available\n"; /*0xffc3f436*/
LABEL_4:
      DebugPrint(n6, 3, n4, n6a, n2, 255, 255, 255, NVMCTL_Mailbox_Failure_Invalid_Command_Parameter_n); /*0xffc3f359*/
      break; /*0xffc3f367*/
    default:
      DebugPrint(n6, 3, n4, n6a, n2, 255, 255, 255, "NVMCTL Mailbox Failure No Status Message: 0x%x\n", a5);
      break; /*0xffc3f45c*/
  }
  return v6; /*0xffc3f466*/
}

// Function: ProcCommonFuncF4C7 @ 0xffc3f4c7 (0x128 bytes)
// Index: 535/2560

int __cdecl ProcCommonFuncF4C7(unsigned __int8 *__return_address, int n4, int n6, int n2, int n84033584, int n6_2)
{
  unsigned __int8 n6_1; // al
  int v9; // eax
  unsigned __int8 n4_1; // [esp-4h] [ebp-1Ch]
  unsigned int v12; // [esp+14h] [ebp-4h]
  unsigned __int8 *SocketInfo; // [esp+1Ch] [ebp+4h]
  unsigned __int8 *n4a; // [esp+20h] [ebp+8h]

  n4_1 = n4; /*0xffc3f500*/
  n4a = &__return_address[50813 * (unsigned __int8)n4 + 13562 + 8077 * (unsigned __int8)n6 + 2688 * (unsigned __int8)n2]; /*0xffc3f509*/
  SocketInfo = (unsigned __int8 *)GetSocketInfo((int)__return_address, n4_1); /*0xffc3f51b*/
  n6_1 = ProcCommonFuncD8BE((int)__return_address, n4, n6, n2, n84033584); /*0xffc3f525*/
  if ( n6_1 < 6u ) /*0xffc3f533*/
  {
    v9 = 9 * n6_1; /*0xffc3f53c*/
    n4a[v9] |= 1u; /*0xffc3f53f*/
    *(_DWORD *)&n4a[v9 + 5] = n6_2; /*0xffc3f543*/
  }
  if ( *(_DWORD *)&SocketInfo[7688 * (unsigned __int8)n6 + 7497] != 1 ) /*0xffc3f55d*/
  {
    if ( *(_DWORD *)&SocketInfo[7688 * (unsigned __int8)n6 + 7497] == 2 ) /*0xffc3f562*/
    {
      ProcCommonFuncF6F3(__return_address, n4, n6, n2, n84033584, n6_2); /*0xffc3f5e8*/
      return 0; /*0xffc3f5ed*/
    }
    if ( *(_DWORD *)&SocketInfo[7688 * (unsigned __int8)n6 + 7497] == 3 ) /*0xffc3f567*/
    {
      ProcCommonFuncF5EF(__return_address, n4, n6, n2, n84033584, __SPAIR64__(v12, n6_2)); /*0xffc3f5d2*/
      return 0; /*0xffc3f5da*/
    }
    DebugPrint((int)__return_address, 2, n4, n6, n2, 255, 255, 255, "Invalid FNV Access mode.  Using SMBUS\n"); /*0xffc3f582*/
    KtiFunc1162(__return_address, 139, 1, n4, n6, n2, 255); /*0xffc3f59d*/
  }
  ProcCommonFuncF7F6(__return_address, n4, n6, n2, n84033584, n6_2); /*0xffc3f5b1*/
  return 0; /*0xffc3f5b9*/
}

// Function: ProcCommonFuncF5EF @ 0xffc3f5ef (0x104 bytes)
// Index: 536/2560

int __cdecl ProcCommonFuncF5EF(
        unsigned __int8 *__return_address,
        int n4,
        int n6a,
        char n2,
        unsigned int n83902980,
        __int64 a6)
{
  unsigned int n84033584a_1; // eax
  unsigned int v7; // esi
  __int64 v8; // rax
  int v9; // ebx
  int v10; // ebp
  __int64 v11; // rax
  int v12; // esi
  int v13; // edx
  int v14; // edi
  unsigned int n84033584a; // [esp+4h] [ebp-Ch]
  int v17; // [esp+8h] [ebp-8h] BYREF
  int v18; // [esp+Ch] [ebp-4h]

  n84033584a_1 = ProcCommonFuncD97E(__return_address, 2u, n83902980); /*0xffc3f603*/
  n84033584a = n84033584a_1; /*0xffc3f60b*/
  v7 = (n83902980 >> 12) & 7; /*0xffc3f60f*/
  if ( v7 ) /*0xffc3f612*/
  {
    LODWORD(v8) = RmtFunc6EA8(-1, 8 * v7); /*0xffc3f625*/
    v9 = ~HIDWORD(v8); /*0xffc3f63d*/
    v10 = ~(_DWORD)v8; /*0xffc3f644*/
    LODWORD(v11) = RmtFunc6EA8(~v8 & a6, 8 * (n83902980 & 7)); /*0xffc3f653*/
    a6 = v11; /*0xffc3f65b*/
    v12 = ~RmtFunc6EA8(__SPAIR64__(v9, v10), 8 * (n83902980 & 7)); /*0xffc3f67a*/
    v14 = ~v13; /*0xffc3f67c*/
    ProcCommonFuncC2CD(__return_address, n4, n6a, n2, n84033584a, &v17); /*0xffc3f68a*/
    v17 = a6 | v12 & v17; /*0xffc3f699*/
    v18 = HIDWORD(a6) | v14 & v18; /*0xffc3f6a7*/
    ProcCommonFuncC34D(__return_address, n4, n6a, n2, n84033584a, &v17); /*0xffc3f6c1*/
  }
  else
  {
    ProcCommonFuncC34D(__return_address, n4, n6a, n2, n84033584a_1, (int *)&a6); /*0xffc3f6e4*/
  }
  return 0; /*0xffc3f6ee*/
}

// Function: ProcCommonFuncF6F3 @ 0xffc3f6f3 (0x103 bytes)
// Index: 537/2560

int __cdecl ProcCommonFuncF6F3(
        unsigned __int8 *__return_address,
        int n4,
        int n6,
        unsigned __int8 n2,
        unsigned int n84033584,
        int a6)
{
  int SocketInfo; // esi
  unsigned __int16 n84033584a_1; // ax
  unsigned __int8 v8; // bl
  int v10; // [esp+10h] [ebp-8h]
  int v11; // [esp+14h] [ebp-4h]
  unsigned __int16 n84033584a; // [esp+2Ch] [ebp+14h]
  unsigned int v13; // [esp+30h] [ebp+18h]

  v10 = a6; /*0xffc3f707*/
  SocketInfo = GetSocketInfo((int)__return_address, n4); /*0xffc3f714*/
  v11 = MiscConfigCheck(__return_address, n4, n6, 184566276); /*0xffc3f72c*/
  MiscIoCheck( /*0xffc3f748*/
    __return_address,
    n4,
    n6,
    0xB004204u,
    v11 & 0x3FFFFFFF | (*(unsigned __int8 *)(7688 * (unsigned __int8)n6 + SocketInfo + 7) << 30));
  v13 = (n84033584 >> 12) & 0xFFFFFF07; /*0xffc3f760*/
  n84033584a_1 = ProcCommonFuncD97E(__return_address, 0, n84033584); /*0xffc3f764*/
  v8 = 0; /*0xffc3f76d*/
  for ( n84033584a = n84033584a_1; v8 < (unsigned __int8)v13; ++v8 ) /*0xffc3f77a*/
  {
    if ( !v8 ) /*0xffc3f77e*/
      RmtFunc669(__return_address, n4, n6, n2, 0, n84033584a_1 >> 4, 8, 0); /*0xffc3f796*/
    RmtFunc669( /*0xffc3f7c5*/
      __return_address,
      n4,
      n6,
      n2,
      0,
      *((unsigned __int8 *)&v10 + v8) | ((v8 + n84033584a) << 8) & 0xF00,
      9,
      0);
    n84033584a_1 = n84033584a; /*0xffc3f7ca*/
  }
  MiscIoCheck(__return_address, n4, n6, 0xB004204u, v11); /*0xffc3f7e5*/
  return 0; /*0xffc3f7ef*/
}

// Function: ProcCommonFuncF7F6 @ 0xffc3f7f6 (0x10d bytes)
// Index: 538/2560

int __cdecl ProcCommonFuncF7F6(_BYTE *__return_address, int n4, int n2, int a4, unsigned int n84033584, int n2a)
{
  char n2b_1; // bl
  unsigned int v7; // ebp
  int v8; // ebx
  unsigned __int8 v10[4]; // [esp+Ch] [ebp-10h] BYREF
  unsigned int v11; // [esp+10h] [ebp-Ch]
  int n4_1; // [esp+14h] [ebp-8h] BYREF
  int v13; // [esp+18h] [ebp-4h]
  char n2b; // [esp+34h] [ebp+18h]

  n2b_1 = (n84033584 >> 12) & 7; /*0xffc3f811*/
  *(_DWORD *)v10 = n2a; /*0xffc3f814*/
  n2b = n2b_1; /*0xffc3f819*/
  v11 = ProcCommonFuncD97E(__return_address, 0, n84033584); /*0xffc3f825*/
  if ( n2b_1 == 4 ) /*0xffc3f82c*/
    LOBYTE(n84033584) = 12; /*0xffc3f82e*/
  else
    LOBYTE(n84033584) = 4 * (n2b_1 == 2) + 4; /*0xffc3f842*/
  LOWORD(n4_1) = 1; /*0xffc3f849*/
  LOWORD(v13) = v13 & 0xF0F | 0xB0; /*0xffc3f85c*/
  DdrTrainFunc466A((int)__return_address, n4, n2, a4, (int)&n4_1); /*0xffc3f873*/
  v7 = KtiFunc9B5((int)__return_address) + 700000; /*0xffc3f881*/
  while ( 1 ) /*0xffc3f8b6*/
  {
    v8 = ProcCommonFuncF903(__return_address, n4, v11, n4_1, v13, v10, n2b, n84033584); /*0xffc3f8b6*/
    if ( KtiFunc9B5((int)__return_address) > v7 ) /*0xffc3f8c2*/
      break; /*0xffc3f8c2*/
    if ( v8 != 1 ) /*0xffc3f8c7*/
      return v8; /*0xffc3f8cb*/
  }
  KtiFunc211E((int)__return_address, 61, 1, n4, n2, a4, 255); /*0xffc3f8e3*/
  KtiFunc8A8E((int)__return_address, n4, n2); /*0xffc3f8f1*/
  return 1; /*0xffc3f8fc*/
}

// Function: ProcCommonFuncF903 @ 0xffc3f903 (0x1a1 bytes)
// Index: 539/2560

int __cdecl ProcCommonFuncF903(
        _BYTE *__return_address,
        unsigned __int8 n4,
        unsigned int a3,
        int n4a,
        unsigned __int16 a5,
        unsigned __int8 *a6,
        char n2,
        unsigned int n84033584)
{
  int result; // eax
  unsigned __int8 v9; // [esp+11h] [ebp-3h] BYREF
  unsigned __int8 v10; // [esp+12h] [ebp-2h] BYREF
  unsigned __int8 v11; // [esp+13h] [ebp-1h] BYREF

  v10 = 0; /*0xffc3f911*/
  v11 = 0; /*0xffc3f915*/
  v9 = 0; /*0xffc3f919*/
  result = DdrTrainFunc5231(__return_address, n4, n4a, a5, (unsigned __int8)n84033584 | 0x80, &v11); /*0xffc3f944*/
  if ( !result ) /*0xffc3f94e*/
  {
    v10 = (a3 >> 12) & 0xF; /*0xffc3f95f*/
    result = DdrTrainFunc5231(__return_address, n4, n4a, a5, n84033584, &v10); /*0xffc3f97e*/
    if ( !result ) /*0xffc3f988*/
    {
      v9 = BYTE1(a3) & 0xF; /*0xffc3f995*/
      result = DdrTrainFunc5231(__return_address, n4, n4a, a5, n84033584, &v9); /*0xffc3f9b4*/
      if ( !result ) /*0xffc3f9be*/
      {
        v9 = a3; /*0xffc3f9c6*/
        result = DdrTrainFunc5231(__return_address, n4, n4a, a5, n84033584, &v9); /*0xffc3f9e5*/
        if ( !result ) /*0xffc3f9ef*/
        {
          if ( n2 == 4 ) /*0xffc3f9ff*/
          {
            result = DdrTrainFunc5231(__return_address, n4, n4a, a5, n84033584, a6 + 3); /*0xffc3fa1b*/
            if ( result ) /*0xffc3fa25*/
              return result; /*0xffc3fa25*/
            result = DdrTrainFunc5231(__return_address, n4, n4a, a5, n84033584, a6 + 2); /*0xffc3fa41*/
            if ( result ) /*0xffc3fa4b*/
              return result; /*0xffc3fa4b*/
          }
          else if ( n2 != 2 ) /*0xffc3fa51*/
          {
            return DdrTrainFunc5231(__return_address, n4, n4a, a5, (unsigned __int8)n84033584 | 0x40, a6); /*0xffc3fa96*/
          }
          result = DdrTrainFunc5231(__return_address, n4, n4a, a5, n84033584, a6 + 1); /*0xffc3fa6d*/
          if ( result ) /*0xffc3fa77*/
            return result; /*0xffc3fa77*/
          return DdrTrainFunc5231(__return_address, n4, n4a, a5, (unsigned __int8)n84033584 | 0x40, a6); /*0xffc3fa77*/
        }
      }
    }
  }
  return result; /*0xffc3fa9e*/
}

// Function: ProcCommonFuncFAA4 @ 0xffc3faa4 (0xa6 bytes)
// Index: 540/2560

char __cdecl ProcCommonFuncFAA4(int a1, char a2, char a3)
{
  int v4; // ebx
  unsigned int v5; // esi
  int v6; // eax
  unsigned int v7; // eax
  unsigned __int8 v9; // [esp+14h] [ebp+8h]
  int v10; // [esp+18h] [ebp+Ch]

  v4 = 4 * (a2 != 0) + 318915088; /*0xffc3fabb*/
  v9 = *(_BYTE *)(a1 + 453660); /*0xffc3fac3*/
  v10 = *(unsigned __int8 *)(a1 + 246425); /*0xffc3fad2*/
  v5 = ((v10 & 7) << 24) | CpuIoRead(a1, v9, 0, v4) & 0xF8FFFFFF; /*0xffc3faef*/
  LOBYTE(v6) = a3; /*0xffc3faf1*/
  if ( !a3 ) /*0xffc3faf6*/
  {
    v5 &= ~2u; /*0xffc3faf8*/
    CpuIoCfgWrite(a1, v9, 0, v4, v5); /*0xffc3fb03*/
    LOBYTE(v6) = 0; /*0xffc3fb08*/
  }
  if ( (_BYTE)v6 == 1 ) /*0xffc3fb10*/
  {
    CpuIoCfgWrite(a1, v9, 0, v4, v5 | 2); /*0xffc3fb1d*/
    do /*0xffc3fb43*/
    {
      do /*0xffc3fb39*/
        v7 = CpuIoRead(a1, v9, 0, v4); /*0xffc3fb2f*/
      while ( (v7 & 2) == 0 ); /*0xffc3fb39*/
      v6 = (v7 >> 2) & 7; /*0xffc3fb3e*/
    }
    while ( v6 != v10 ); /*0xffc3fb43*/
  }
  return v6; /*0xffc3fb45*/
}

// Function: ProcCommonFuncFB4A @ 0xffc3fb4a (0x12 bytes)
// Index: 541/2560

bool __cdecl ProcCommonFuncFB4A(int a1, unsigned __int8 a2)
{
  return (a2 & *(_BYTE *)(a1 + 9479)) != 0; /*0xffc3fb5b*/
}

// Function: DebugPrint @ 0xffc3fb5c (0x2c bytes)
// Index: 542/2560

int DebugPrint(int a1, char a2, int a3, int a4, int a5, int a6, int a7, int a8, const char *a9, ...)
{
  va_list va; // [esp+2Ch] [ebp+2Ch] BYREF

  va_start(va, a9);
  return ProcCommonFuncFB88(a1, a2, a3, a4, a5, a6, a7, a8, a9, (char *)va); /*0xffc3fb86*/
}

// Function: ProcCommonFuncFB88 @ 0xffc3fb88 (0x69 bytes)
// Index: 543/2560

void __cdecl ProcCommonFuncFB88(
        _BYTE *__return_address,
        char a2,
        char n4,
        char n6,
        char n2,
        char n4a,
        char n255,
        char n72,
        char *a9,
        char *va)
{
  char v10; // bl

  v10 = 0; /*0xffc3fb90*/
  if ( __return_address && ((unsigned __int8)a2 & __return_address[9479]) != 0 ) /*0xffc3fb9f*/
  {
    if ( __return_address[246736] ) /*0xffc3fba1*/
      v10 = KtiFunc8014((int)__return_address); /*0xffc3fbb0*/
    RmtFunc479D(__return_address, n4, n6, n2, n4a, n255, n72); /*0xffc3fbc5*/
    LogFormatString(__return_address, (unsigned __int8 *)a9, va); /*0xffc3fbd1*/
    if ( __return_address[246736] ) /*0xffc3fbd9*/
    {
      if ( v10 ) /*0xffc3fbe4*/
        KtiFunc834D((int)__return_address); /*0xffc3fbe7*/
    }
  }
}

// Function: ProcCommonFuncFBF1 @ 0xffc3fbf1 (0xc bytes)
// Index: 544/2560

int __cdecl ProcCommonFuncFBF1(int a1)
{
  *(_BYTE *)(a1 + 9479) = 0; /*0xffc3fbf5*/
  return a1; /*0xffc3fbfc*/
}

// Function: ProcCommonFuncFBFD @ 0xffc3fbfd (0x3f bytes)
// Index: 545/2560

int __cdecl ProcCommonFuncFBFD(int __return_address)
{
  char SocketNumber; // al
  int result; // eax

  SocketNumber = GetSocketNumber(__return_address); /*0xffc3fc05*/
  *(_BYTE *)(__return_address + 9479) = *(_BYTE *)(__return_address + 1494); /*0xffc3fc1f*/
  result = CpuIoRead(__return_address, SocketNumber, 0, 318914720); /*0xffc3fc26*/
  if ( (result & 0x10) != 0 ) /*0xffc3fc30*/
    *(_BYTE *)(__return_address + 9479) |= 2u; /*0xffc3fc32*/
  return result; /*0xffc3fc39*/
}

// Function: ProcCommonFuncFC3C @ 0xffc3fc3c (0x16 bytes)
// Index: 546/2560

unsigned int __cdecl ProcCommonFuncFC3C(int __return_address, unsigned __int8 SocketNumber)
{
  return (unsigned int)ProcCommonFunc226E(__return_address, SocketNumber, 6u) >> 16; /*0xffc3fc51*/
}

// Function: ProcCommonFuncFC52 @ 0xffc3fc52 (0x18 bytes)
// Index: 547/2560

int __cdecl ProcCommonFuncFC52(int buf, unsigned __int8 a2)
{
  return CpuIoRead(buf, a2, 0, 318914708); /*0xffc3fc69*/
}

// Function: ProcCommonFuncFC6A @ 0xffc3fc6a (0x45 bytes)
// Index: 548/2560

int __cdecl ProcCommonFuncFC6A(int __return_address, unsigned __int8 SocketNumber, char a3, int *a4)
{
  if ( a3 ) /*0xffc3fc72*/
    CpuIoCfgWrite(__return_address, SocketNumber, 0, 318914740, *a4); /*0xffc3fca2*/
  else
    *a4 = CpuIoRead(__return_address, SocketNumber, 0, 318914740); /*0xffc3fc8c*/
  return *a4; /*0xffc3fcac*/
}

// Function: ProcCommonFuncFCAF @ 0xffc3fcaf (0xe1 bytes)
// Index: 549/2560

int __cdecl ProcCommonFuncFCAF(_BYTE *__return_address, unsigned __int8 n4)
{
  unsigned int n0x297B1; // ebp
  unsigned int n13; // edi
  int *v5; // eax
  unsigned int n13_1; // ebp
  unsigned int n0x297B1_1; // [esp+10h] [ebp-8h]
  int v9; // [esp+1Ch] [ebp+4h]

  LogDebugString(__return_address, (int)" host structure : %x  dword num:%x \n", 679616, 169905);
  n0x297B1 = 0; /*0xffc3fcd6*/
  n0x297B1_1 = 0; /*0xffc3fcd8*/
  do /*0xffc3fd58*/
  {
    while ( CpuIoRead((int)__return_address, n4, 0, 318914708) ) /*0xffc3fce5*/
      ; /*0xffc3fcdc*/
    n13 = 169905 - n0x297B1; /*0xffc3fcf1*/
    if ( 169905 - n0x297B1 >= 0xD ) /*0xffc3fcf6*/
      n13 = 13; /*0xffc3fcfa*/
    if ( n13 ) /*0xffc3fd02*/
    {
      v5 = (int *)&__return_address[4 * n0x297B1]; /*0xffc3fd04*/
      n13_1 = 0; /*0xffc3fd07*/
      v9 = (int)v5; /*0xffc3fd0b*/
      do /*0xffc3fd32*/
      {
        CpuIoCfgWrite((int)__return_address, n4, 0, dword_FFD52124[n13_1++], *v5); /*0xffc3fd1c*/
        v5 = (int *)(v9 + 4); /*0xffc3fd29*/
        v9 += 4; /*0xffc3fd2c*/
      }
      while ( n13_1 < n13 ); /*0xffc3fd32*/
      n0x297B1 = n0x297B1_1; /*0xffc3fd34*/
    }
    CpuIoCfgWrite((int)__return_address, n4, 0, 318914708, 1); /*0xffc3fd43*/
    n0x297B1 += n13; /*0xffc3fd48*/
    n0x297B1_1 = n0x297B1; /*0xffc3fd52*/
  }
  while ( n0x297B1 < 0x297B1 ); /*0xffc3fd58*/
  while ( CpuIoRead((int)__return_address, n4, 0, 318914708) ) /*0xffc3fd64*/
    ; /*0xffc3fd5f*/
  CpuIoCfgWrite((int)__return_address, n4, 0, 318914708, 1); /*0xffc3fd76*/
  return LogDebugString(__return_address, (int)"Transfer complete\n"); /*0xffc3fd89*/
}

// Function: ProcCommonFuncFD90 @ 0xffc3fd90 (0x2e bytes)
// Index: 550/2560

int __cdecl ProcCommonFuncFD90(int __return_address, unsigned __int8 SocketNumber, int a3)
{
  unsigned __int8 v3; // al

  v3 = ProcCommonFunc226E(__return_address, SocketNumber, 6u); /*0xffc3fd9b*/
  return ProcCommonFunc4CD7(__return_address, SocketNumber, 6u, (a3 << 16) + v3); /*0xffc3fdbc*/
}

// Function: ProcCommonFuncFDBE @ 0xffc3fdbe (0x27 bytes)
// Index: 551/2560

int __cdecl ProcCommonFuncFDBE(int __return_address, unsigned __int8 a2, unsigned __int16 a3, unsigned __int16 a4)
{
  ProcCommonFunc44C0(__return_address, a2, 7u, a4 | (a3 << 16)); /*0xffc3fdd9*/
  return a4 | (a3 << 16); /*0xffc3fde3*/
}

// Function: ProcCommonFuncFDE5 @ 0xffc3fde5 (0x1c bytes)
// Index: 552/2560

int __cdecl ProcCommonFuncFDE5(int buf, unsigned __int8 a2, int a3)
{
  return CpuIoCfgWrite(buf, a2, 0, 318914708, a3); /*0xffc3fe00*/
}

// Function: ProcCommonFuncFE01 @ 0xffc3fe01 (0x1a bytes)
// Index: 553/2560

int __cdecl ProcCommonFuncFE01(int a1, int a2)
{
  return CpuIoCfgWrite(a1, 0, 0, 318783732, a2); /*0xffc3fe1a*/
}

// Function: ProcCommonFuncFE1B @ 0xffc3fe1b (0x1a bytes)
// Index: 554/2560

int __cdecl ProcCommonFuncFE1B(int a1, int a2)
{
  return CpuIoCfgWrite(a1, 0, 0, 318783736, a2); /*0xffc3fe34*/
}

// Function: ProcCommonFuncFE35 @ 0xffc3fe35 (0x1a8 bytes)
// Index: 555/2560

int __cdecl ProcCommonFuncFE35(int __return_address, int __return_address_1)
{
  unsigned __int8 n4_1; // bl
  unsigned __int8 n4; // bh
  int v4; // ebp
  unsigned __int8 v6; // [esp+14h] [ebp-8h]

  n4_1 = 0; /*0xffc3fe3f*/
  v6 = 0; /*0xffc3fe46*/
  do /*0xffc3ffcd*/
  {
    if ( ((1 << n4_1) & *(_DWORD *)(__return_address + 246468)) != 0 && *(_BYTE *)(__return_address + 257255) ) /*0xffc3fe60*/
    {
      RcAssertPrint((_BYTE *)__return_address, 4u, (int)"\nSocket %d", n4_1); /*0xffc3fe76*/
      if ( *(_BYTE *)(__return_address + 246411) != 4 ) /*0xffc3fe85*/
        ProcCommonFuncCCED(__return_address, __return_address_1, v6); /*0xffc3fee0*/
      n4 = 0; /*0xffc3fe8a*/
      v4 = 5 * (n4_1 + 16); /*0xffc3fe8c*/
      do /*0xffc3fed3*/
      {
        if ( (*(_BYTE *)(__return_address_1 + 400) & 0x7F) != n4_1 || n4 ) /*0xffc3fe9d*/
          *(_DWORD *)(__return_address_1 + 4 * (v4 + n4)) = 4; /*0xffc3feaa*/
        else
          *(_DWORD *)(__return_address_1 + 20 * (n4_1 + 16)) = 0; /*0xffc3fe9f*/
        RcAssertPrint( /*0xffc3fec6*/
          (_BYTE *)__return_address,
          4u,
          (int)"\n  SNC_Base_%d = %04d GB",
          n4 + 1,
          *(_DWORD *)(__return_address_1 + 4 * (n4 + v4)));
        ++n4; /*0xffc3fece*/
      }
      while ( n4 <= 4u ); /*0xffc3fed3*/
    }
    v6 = ++n4_1; /*0xffc3ffc6*/
  }
  while ( n4_1 < 4u ); /*0xffc3ffcd*/
  return 0; /*0xffc3ffd5*/
}

// Function: ProcCommonFuncFFDD @ 0xffc3ffdd (0x21a bytes)
// Index: 556/2560

int __cdecl ProcCommonFuncFFDD(int __return_address, _BYTE *buf)
{
  unsigned __int8 n4_2; // bl
  unsigned __int8 n4_1; // dl
  int v5; // ecx
  _BYTE *buf_1; // ebp
  _BYTE *v7; // esi
  unsigned __int8 v8; // dl
  int v9; // esi
  int v10; // esi
  char v12; // si
  int v13; // [esp-20h] [ebp-58h]
  int v14; // [esp-Ch] [ebp-44h]
  int v15; // [esp-8h] [ebp-40h]
  char v16; // [esp+Fh] [ebp-29h] BYREF
  unsigned __int8 n4[4]; // [esp+10h] [ebp-28h]
  int v18; // [esp+14h] [ebp-24h]
  int v19; // [esp+18h] [ebp-20h]
  int v20; // [esp+1Ch] [ebp-1Ch]
  int n3; // [esp+20h] [ebp-18h]
  int v22; // [esp+24h] [ebp-14h]
  int v23; // [esp+28h] [ebp-10h] BYREF
  _BYTE *buf_2; // [esp+2Ch] [ebp-Ch]
  _BYTE *v25; // [esp+30h] [ebp-8h]
  int v26; // [esp+34h] [ebp-4h]
  unsigned __int8 v27; // [esp+3Ch] [ebp+4h]

  n4_2 = 0; /*0xffc3ffe7*/
  if ( *(_BYTE *)(__return_address + 246411) == 4 ) /*0xffc3fff0*/
  {
    n4_1 = 0; /*0xffc3fffa*/
    v5 = 0; /*0xffc3fffd*/
    n4[0] = 0; /*0xffc3ffff*/
    buf_1 = buf; /*0xffc40003*/
    v18 = 0; /*0xffc40005*/
    v7 = buf + 296; /*0xffc40009*/
    v20 = 0; /*0xffc4000f*/
    buf_2 = buf; /*0xffc40013*/
    v25 = buf + 296; /*0xffc40017*/
    while ( 1 ) /*0xffc4001b*/
    {
      if ( ((1 << v5) & *(_DWORD *)(__return_address + 246468)) != 0 ) /*0xffc40026*/
      {
        LOBYTE(v19) = 0; /*0xffc4002c*/
        if ( *(_BYTE *)(__return_address + 244317) ) /*0xffc40030*/
        {
          v8 = 0; /*0xffc40040*/
          do /*0xffc40148*/
          {
            LOBYTE(n3) = 0; /*0xffc40042*/
            v27 = v8; /*0xffc40046*/
            v22 = 0; /*0xffc4004a*/
            do /*0xffc40132*/
            {
              v9 = 7688 * v8; /*0xffc40055*/
              v23 = 0; /*0xffc4005b*/
              v26 = v8; /*0xffc4005f*/
              RcAssertPrint( /*0xffc40078*/
                (_BYTE *)__return_address,
                4u,
                (int)"\nSocket %d channel %d enabled %d",
                v5,
                v8,
                *(unsigned __int8 *)(v9 + v20 + __return_address + 258722));
              if ( *(_BYTE *)(v9 + v20 + __return_address + 258722) ) /*0xffc40086*/
              {
                ProcCommonFunc9DD1((_BYTE *)__return_address, n4[0], v19, n3, &v23, &v16); /*0xffc400aa*/
                v13 = (unsigned __int16)v23; /*0xffc400bd*/
                v10 = 37 * ((unsigned __int8)v19 + 2 * v18); /*0xffc400c8*/
                *(_DWORD *)&buf[v10 + 5 + v22] = (unsigned __int16)v23 >> 4; /*0xffc400d7*/
                RcAssertPrint((_BYTE *)__return_address, 4u, (int)"\n  Memory Size = 0x%x", v13); /*0xffc400db*/
                buf[v10] = 1; /*0xffc400e3*/
                if ( !buf[400] ) /*0xffc400e7*/
                {
                  v15 = v26; /*0xffc400ef*/
                  v14 = v18; /*0xffc400f7*/
                  buf[400] = n4[0] | 0x80; /*0xffc40105*/
                  RcAssertPrint( /*0xffc4010b*/
                    (_BYTE *)__return_address,
                    4u,
                    (int)"\nSocket %d has 1st 4G memory on Channel %d",
                    v14,
                    v15);
                }
              }
              v22 += 4; /*0xffc4011d*/
              v8 = v27 + 1; /*0xffc40122*/
              v5 = v18; /*0xffc40124*/
              LOBYTE(n3) = n3 + 1; /*0xffc40128*/
              ++v27; /*0xffc4012c*/
            }
            while ( (unsigned __int8)n3 < 3u ); /*0xffc40132*/
            LOBYTE(v19) = v19 + 1; /*0xffc4013e*/
          }
          while ( (unsigned __int8)v19 < *(_BYTE *)(__return_address + 244317) ); /*0xffc40148*/
          n4_1 = n4[0]; /*0xffc4014e*/
          buf_1 = buf_2; /*0xffc40152*/
          v7 = v25; /*0xffc40156*/
        }
        if ( *buf_1 == 1 ) /*0xffc4015e*/
        {
          if ( buf_1[37] != 1 ) /*0xffc40164*/
            goto LABEL_17; /*0xffc40164*/
          *v7 = 2; /*0xffc40166*/
        }
        else if ( buf_1[37] == 1 ) /*0xffc4016f*/
        {
LABEL_17:
          *v7 = 1; /*0xffc40171*/
        }
      }
      v20 += 48704; /*0xffc40174*/
      ++n4_1; /*0xffc4017c*/
      ++v5; /*0xffc4017e*/
      n4[0] = n4_1; /*0xffc4017f*/
      buf_1 += 74; /*0xffc40183*/
      v18 = v5; /*0xffc40186*/
      v7 += 6; /*0xffc4018a*/
      buf_2 = buf_1; /*0xffc4018d*/
      v25 = v7; /*0xffc40191*/
      if ( n4_1 >= 4u ) /*0xffc40198*/
        return ProcCommonFunc1C7F(__return_address, (int)buf); /*0xffc401ac*/
    }
  }
  n4[0] = 0; /*0xffc401ae*/
  v12 = 0; /*0xffc401b2*/
  do /*0xffc401ec*/
  {
    if ( ((1 << v12) & *(_DWORD *)(__return_address + 246468)) != 0 ) /*0xffc401c1*/
    {
      ProcCommonFunc2766(__return_address, (int)buf, n4[0]); /*0xffc401cc*/
      ProcCommonFunc2621((_BYTE *)__return_address, (int)buf, n4[0]); /*0xffc401da*/
    }
    ++n4_2; /*0xffc401e2*/
    ++v12; /*0xffc401e4*/
    n4[0] = n4_2; /*0xffc401e5*/
  }
  while ( n4_2 < 4u ); /*0xffc401ec*/
  return 0; /*0xffc401f0*/
}

// Function: ProcCommonFunc1F7 @ 0xffc401f7 (0x9a bytes)
// Index: 557/2560

int __cdecl ProcCommonFunc1F7(_BYTE *__return_address, char *n3, int buf)
{
  char v3; // dl
  unsigned __int8 i; // cl
  int v5; // ebp
  char v6; // al
  unsigned __int8 v7; // ch
  unsigned __int8 v8; // bl
  bool v9; // zf
  int n0xF; // eax

  v3 = 0; /*0xffc401fc*/
  for ( i = 0; i < 4u; ++i ) /*0xffc40203*/
  {
    v5 = 13 * i; /*0xffc4020a*/
    v6 = n3[v5]; /*0xffc4020d*/
    if ( (v6 & 1) != 0 && (v6 & 0x60) == 0 ) /*0xffc40216*/
    {
      v7 = __return_address[255496]; /*0xffc40218*/
      v8 = 0; /*0xffc4021e*/
      if ( v7 ) /*0xffc40222*/
      {
        while ( (n3[4 * v8 + 1 + v5] & 1) != 0 ) /*0xffc40235*/
        {
          if ( ++v8 >= v7 ) /*0xffc4023b*/
            goto LABEL_9; /*0xffc4023b*/
        }
        v3 = 1; /*0xffc4023f*/
      }
LABEL_9:
      if ( v3 == 1 ) /*0xffc40244*/
        break; /*0xffc40244*/
    }
  }
  if ( v3 ) /*0xffc40251*/
  {
    LOBYTE(n0xF) = RcAssertPrint(__return_address, 4u, (int)"\n\n  Degraded 4S topology is detected."); /*0xffc40277*/
    MailBoxPcodeComm(n0xF, __return_address, n3, buf, 0); /*0xffc40284*/
  }
  else
  {
    v9 = __return_address[255496] == 2; /*0xffc40253*/
    __return_address[257105] = 4; /*0xffc4025a*/
    if ( v9 ) /*0xffc40261*/
      *(_WORD *)(buf + 122) = 257; /*0xffc40267*/
  }
  return 0; /*0xffc4024d*/
}

// Function: ProcCommonFunc291 @ 0xffc40291 (0x14b bytes)
// Index: 558/2560

int __cdecl ProcCommonFunc291(int __return_address, _BYTE *n4, int buf)
{
  _BYTE *n4_1; // edi
  int n4_2; // ebp
  int v6; // esi
  char v7; // dl
  unsigned __int8 v8; // dh
  int v9; // edi
  unsigned __int8 v10; // al
  int v11; // ecx
  unsigned __int8 v13; // [esp+13h] [ebp-5h]
  unsigned __int8 v14; // [esp+1Ch] [ebp+4h]

  if ( *(_DWORD *)(__return_address + 246404) )
  {
    v7 = 0; /*0xffc402f2*/
    if ( !*(_BYTE *)(__return_address + 246400) )
    {
      if ( *(_DWORD *)(__return_address + 453710) != *(_DWORD *)(buf + 100) /*0xffc40320*/
        || *(_DWORD *)(__return_address + 453714) != *(_DWORD *)(buf + 4 * *(unsigned __int8 *)(buf + 1) + 14) )
      {
        v7 = 1; /*0xffc40322*/
      }
      v8 = 0; /*0xffc40328*/
      while ( v7 != 1 ) /*0xffc4032c*/
      {
        v9 = 13 * v8; /*0xffc40331*/
        if ( (n4[v9] & 1) != 0 ) /*0xffc40337*/
        {
          v10 = 0; /*0xffc4033f*/
          v14 = 0; /*0xffc40341*/
          v13 = *(_BYTE *)(__return_address + 255496); /*0xffc40345*/
          if ( v13 ) /*0xffc4034b*/
          {
            v11 = 3 * v8; /*0xffc4034d*/
            while ( ((n4[4 * v10 + 1 + v9] ^ *(_BYTE *)(__return_address + 4 * (v10 + v11) + 453718)) & 1) == 0 ) /*0xffc40369*/
            {
              v11 = 3 * v8; /*0xffc4036f*/
              v10 = v14 + 1; /*0xffc40373*/
              v14 = v10; /*0xffc40375*/
              if ( v10 >= v13 ) /*0xffc4037d*/
                goto LABEL_20; /*0xffc4037d*/
            }
            v7 = 1; /*0xffc40381*/
          }
        }
LABEL_20:
        if ( ++v8 >= 4u ) /*0xffc40388*/
        {
          if ( v7 != 1 ) /*0xffc4038c*/
            return 0; /*0xffc4038c*/
          break; /*0xffc4038c*/
        }
      }
      KtiDebugPrint(255, 255, 255, 222, 1, __return_address); /*0xffc4038e*/
      RcAssertPrint((_BYTE *)__return_address, 1u, (int)"\n Topology Doesn't Match - S3 Resume Failed."); /*0xffc403a8*/
      RcAssertPrint(
        (_BYTE *)__return_address,
        1u,
        (int)"\n\n %s: %u   %s ",
        "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiMain.c",
        7550,
        "FALSE");
      KtiDebugAssert(__return_address, 222, 1); /*0xffc403cb*/
    }
  }
  else
  {
    n4_1 = n4; /*0xffc402aa*/
    n4_2 = 4; /*0xffc402b0*/
    *(_DWORD *)(__return_address + 453710) = *(_DWORD *)(buf + 100); /*0xffc402b4*/
    *(_DWORD *)(__return_address + 453714) = *(_DWORD *)(buf + 4 * *(unsigned __int8 *)(buf + 1) + 14); /*0xffc402c2*/
    v6 = __return_address + 453718; /*0xffc402c8*/
    do /*0xffc402eb*/
    {
      if ( (*n4_1 & 1) != 0 ) /*0xffc402d1*/
        AutoGenFunc8E72(v6, n4_1 + 1, 12); /*0xffc402da*/
      n4_1 += 13; /*0xffc402e2*/
      v6 += 12; /*0xffc402e5*/
      --n4_2; /*0xffc402e8*/
    }
    while ( n4_2 ); /*0xffc402eb*/
  }
  return 0; /*0xffc403d3*/
}

// Function: ProcCommonFunc3DC @ 0xffc403dc (0x100 bytes)
// Index: 559/2560

char __cdecl ProcCommonFunc3DC(_BYTE *__return_address, int buf, unsigned __int8 a3, unsigned __int8 a4)
{
  char v4; // bl
  int v5; // edi
  char v6; // bh
  char n2; // cl
  char n2_1; // al
  int v10; // [esp+20h] [ebp+10h]

  v4 = 0; /*0xffc403e7*/
  v5 = a4; /*0xffc403ea*/
  v6 = 0; /*0xffc403ef*/
  v10 = 351 * a4; /*0xffc403f7*/
  n2 = __return_address[v10 + 255724]; /*0xffc403fb*/
  if ( n2 == 1 || (n2_1 = __return_address[351 * a3 + 255724], n2_1 == 1) || n2 == 2 || n2_1 == 2 ) /*0xffc40422*/
    v6 = 1; /*0xffc40424*/
  if ( *(_BYTE *)(v5 + buf + 10) != *(_BYTE *)(buf + a3 + 10) ) /*0xffc40435*/
  {
    KtiDebugPrint((unsigned __int8)(1 << v5), 0, 0, 220, 3, (int)__return_address); /*0xffc4044d*/
    v4 = 1; /*0xffc4045c*/
    RcAssertPrint(__return_address, 1u, (int)"\n Cbo Count/List mismatch between SBSP (CPU%u) and CPU%u", a3, v5); /*0xffc4045e*/
  }
  if ( !v6 && __return_address[v10 + 255718] != __return_address[351 * a3 + 255718] )
  {
    KtiDebugPrint((unsigned __int8)(1 << v5), 0, 0, 220, 5, (int)__return_address); /*0xffc4049a*/
    v4 = 1; /*0xffc404a2*/
    if ( __return_address[1569] )
    {
      v4 = 0; /*0xffc404b9*/
      RcAssertPrint(__return_address, 8u, (int)"\nDBG PPV: %s() skip FeatureMismatch\n", "CheckThisSocketInfoWithSbsp");
    }
    RcAssertPrint(__return_address, 1u, (int)"\n M3KTI Count mismatch between SBSP (CPU%u) and CPU%u", a3, v5); /*0xffc404cd*/
  }
  return v4; /*0xffc404d5*/
}

// Function: MemFunc04DC @ 0xffc404dc (0x3d7 bytes)
// Index: 560/2560

int __cdecl MemFunc04DC(_BYTE *__return_address, _BYTE *n4)
{
  unsigned __int8 n4_2; // cl
  int v3; // eax
  _BYTE *v4; // esi
  _BYTE *n4_1; // edx
  int *v6; // ebp
  char v7; // al
  int v8; // eax
  int v9; // eax
  int v10; // eax
  int v11; // eax
  int v12; // eax
  int v13; // eax
  int v14; // eax
  unsigned __int8 n5; // dl
  char v16; // bp
  int v17; // eax
  int v18; // eax
  int v19; // eax
  unsigned __int8 v20; // al
  int v21; // ebp
  int v22; // eax
  int v23; // eax
  unsigned int v24; // eax
  int v25; // eax
  unsigned int v26; // eax
  int v27; // eax
  unsigned __int8 v29; // [esp+10h] [ebp-1Ch]
  unsigned __int8 n5_1; // [esp+10h] [ebp-1Ch]
  int *v31; // [esp+14h] [ebp-18h]
  unsigned __int8 n4_3; // [esp+18h] [ebp-14h]
  _BYTE *v33; // [esp+1Ch] [ebp-10h]
  unsigned __int8 v34; // [esp+20h] [ebp-Ch]
  int v35; // [esp+24h] [ebp-8h]

  n4_2 = 0; /*0xffc404e7*/
  v3 = 0; /*0xffc404e9*/
  n4_3 = 0; /*0xffc404eb*/
  v35 = 0; /*0xffc404f4*/
  v4 = __return_address + 255501; /*0xffc404fa*/
  n4_1 = n4; /*0xffc40504*/
  v6 = (int *)(__return_address + 256044); /*0xffc40508*/
  v33 = __return_address + 255501; /*0xffc4050e*/
  v31 = (int *)(__return_address + 256044); /*0xffc40512*/
  do /*0xffc40897*/
  {
    v7 = n4_1[v3]; /*0xffc40516*/
    if ( (v7 & 1) != 0 && (v7 & 0x60) == 0 ) /*0xffc40523*/
    {
      v29 = 0; /*0xffc40534*/
      if ( *((_BYTE *)v6 - 326) ) /*0xffc40529*/
      {
        do /*0xffc4064d*/
        {
          v8 = j_CpuIoWrite((int)__return_address, n4_3, v29, 167788832); /*0xffc4054b*/
          *(v6 - 5) = v8; /*0xffc40559*/
          j_PciCfgWrite_0((int)__return_address, n4_3, v29, 167788832, v8); /*0xffc4055c*/
          v9 = j_CpuIoWrite((int)__return_address, n4_3, v29, 167788836); /*0xffc40569*/
          *(v6 - 4) = v9; /*0xffc40577*/
          j_PciCfgWrite_0((int)__return_address, n4_3, v29, 167788836, v9); /*0xffc4057a*/
          v10 = j_CpuIoWrite((int)__return_address, n4_3, v29, 167788896); /*0xffc4058a*/
          *(v6 - 3) = v10; /*0xffc40598*/
          j_PciCfgWrite_0((int)__return_address, n4_3, v29, 167788896, v10); /*0xffc4059b*/
          v11 = j_CpuIoWrite((int)__return_address, n4_3, v29, 167788900); /*0xffc405a8*/
          *(v6 - 2) = v11; /*0xffc405b6*/
          j_PciCfgWrite_0((int)__return_address, n4_3, v29, 167788900, v11); /*0xffc405b9*/
          v12 = j_CpuIoWrite((int)__return_address, n4_3, v29, 167788904); /*0xffc405c9*/
          *(v6 - 2) = v12; /*0xffc405d7*/
          j_PciCfgWrite_0((int)__return_address, n4_3, v29, 167788904, v12); /*0xffc405da*/
          if ( !__return_address[246412] && __return_address[246424] >= 3u ) /*0xffc405f2*/
          {
            v13 = j_CpuIoWrite((int)__return_address, n4_3, v29, 167788888); /*0xffc405fc*/
            j_PciCfgWrite_0((int)__return_address, n4_3, v29, 167788888, v13 & 0x7FFFFFF3 | 0xC); /*0xffc40612*/
            v14 = j_CpuIoWrite((int)__return_address, n4_3, v29, 167788892); /*0xffc4061f*/
            j_PciCfgWrite_0((int)__return_address, n4_3, v29, 167788892, v14 & 0x7FFFFFF3 | 0xC); /*0xffc40635*/
          }
          ++v29; /*0xffc40643*/
        }
        while ( v29 < *((_BYTE *)v6 - 326) ); /*0xffc4064d*/
        v4 = v33; /*0xffc40653*/
      }
      n5 = 0; /*0xffc40657*/
      v16 = 0; /*0xffc40659*/
      n5_1 = 0; /*0xffc4065b*/
      do /*0xffc406e9*/
      {
        if ( ((unsigned __int8)(1 << v16) & *v4) != 0 ) /*0xffc40668*/
        {
          v17 = j_CpuIoWrite((int)__return_address, n4_3, n5_1, 201343152); /*0xffc40676*/
          *(v31 - 1) = v17; /*0xffc40688*/
          j_PciCfgWrite_0((int)__return_address, n4_3, n5_1, 201343152, v17); /*0xffc4068b*/
          v18 = j_CpuIoWrite((int)__return_address, n4_3, n5_1, 201343052); /*0xffc40698*/
          *v31 = v18; /*0xffc406aa*/
          j_PciCfgWrite_0((int)__return_address, n4_3, n5_1, 201343052, v18); /*0xffc406ac*/
          v19 = j_CpuIoWrite((int)__return_address, n4_3, n5_1, 201343056); /*0xffc406bc*/
          j_PciCfgWrite_0((int)__return_address, n4_3, n5_1, 201343056, v19 | 0x400); /*0xffc406cf*/
          n5 = n5_1; /*0xffc406d4*/
          v4 = v33; /*0xffc406db*/
        }
        ++n5; /*0xffc406df*/
        ++v16; /*0xffc406e1*/
        n5_1 = n5; /*0xffc406e2*/
      }
      while ( n5 < 5u ); /*0xffc406e9*/
      v20 = 0; /*0xffc406ef*/
      v34 = 0; /*0xffc406f1*/
      if ( __return_address[255496] ) /*0xffc406f5*/
      {
        do /*0xffc4085e*/
        {
          v21 = v20; /*0xffc40710*/
          if ( (n4[v21 * 4 + 1 + v35] & 1) == 0 ) /*0xffc4071a*/
          {
            j_PciCfgWrite_0((int)__return_address, n4_3, v34, 151011524, -1); /*0xffc40726*/
            j_PciCfgWrite_0((int)__return_address, n4_3, v34, 151011528, -1); /*0xffc40735*/
          }
          if ( (*((_BYTE *)&v31[v21 - 84] - 3) & 1) != 0 ) /*0xffc40751*/
          {
            v22 = j_CpuIoWrite((int)__return_address, n4_3, v34, 151143340); /*0xffc4075c*/
            j_PciCfgWrite_0((int)__return_address, n4_3, v34, 151143340, v22 & 0xFF001FFF); /*0xffc4076b*/
            if ( !__return_address[246412] && __return_address[246424] < 3u && __return_address[257188] == 1 ) /*0xffc4078c*/
              j_PciCfgWrite_0((int)__return_address, n4_3, v34, 151011524, 196611); /*0xffc4079b*/
          }
          v23 = j_CpuIoWrite((int)__return_address, n4_3, v34, 151011536); /*0xffc407ac*/
          if ( __return_address[246412] || __return_address[246424] >= 3u ) /*0xffc407c4*/
            v24 = v23 & 0xFFC00000 | 0x1000; /*0xffc407d7*/
          else
            v24 = ((unsigned int)&loc_FFCFFFFE + 2) & v23 | 0x100000; /*0xffc407cb*/
          j_PciCfgWrite_0((int)__return_address, n4_3, v34, 151011536, v24); /*0xffc407e1*/
          v25 = j_CpuIoWrite((int)__return_address, n4_3, v34, 151011544); /*0xffc407ef*/
          if ( __return_address[246412] || __return_address[246424] >= 3u ) /*0xffc40807*/
            v26 = (unsigned int)"uired!\n" & v25 | 0x13C000; /*0xffc4081a*/
          else
            v26 = v25 & 0xFFC00000 | 0x3C000; /*0xffc4080e*/
          j_PciCfgWrite_0((int)__return_address, n4_3, v34, 151011544, v26); /*0xffc40824*/
          v27 = j_CpuIoWrite((int)__return_address, n4_3, v34, 151011552); /*0xffc40832*/
          j_PciCfgWrite_0((int)__return_address, n4_3, v34, 151011552, v27 & 0xFFC00000 | 0x9E7); /*0xffc40846*/
          v20 = v34 + 1; /*0xffc40852*/
          v34 = v20; /*0xffc40854*/
        }
        while ( v20 < __return_address[255496] ); /*0xffc4085e*/
        v4 = v33; /*0xffc40864*/
      }
      n4_1 = n4; /*0xffc40868*/
      n4_2 = n4_3; /*0xffc4086c*/
      v6 = v31; /*0xffc40870*/
    }
    ++n4_2; /*0xffc40878*/
    ++v4; /*0xffc4087a*/
    n4_3 = n4_2; /*0xffc4087b*/
    v3 = v35 + 13; /*0xffc4087f*/
    v33 = v4; /*0xffc40882*/
    v6 = (int *)((char *)v6 + 351); /*0xffc40886*/
    v35 += 13; /*0xffc4088c*/
    v31 = v6; /*0xffc40890*/
  }
  while ( n4_2 < 4u ); /*0xffc40897*/
  DdrTrainFunc61EE((int)__return_address, n4_1, 0); /*0xffc408a1*/
  return 0; /*0xffc408ab*/
}

// Function: ProcCommonFunc8B3 @ 0xffc408b3 (0x6b bytes)
// Index: 561/2560

int __cdecl ProcCommonFunc8B3(int __return_address, int buf, int n4, int i, unsigned int *p___return_address, char a6)
{
  unsigned int v6; // ecx
  char n5; // al
  unsigned int v8; // ecx

  if ( *(_BYTE *)(buf + 114) ) /*0xffc408ba*/
  {
    v6 = *p___return_address & 0xFFE00FFF | 0x41000; /*0xffc408d9*/
    *p___return_address = v6; /*0xffc408df*/
    n5 = *(_BYTE *)(__return_address + 257105); /*0xffc408e1*/
    if ( n5 == 4 ) /*0xffc408e9*/
    {
      if ( *(_BYTE *)(buf + 122) ) /*0xffc408eb*/
      {
        v8 = v6 & 0xFFFC1FFF | 0x4000; /*0xffc408f7*/
LABEL_10:
        *p___return_address = v8; /*0xffc40917*/
        return 0; /*0xffc40917*/
      }
      if ( !a6 ) /*0xffc40903*/
        return 0; /*0xffc40903*/
    }
    else if ( n5 != 5 ) /*0xffc40909*/
    {
      return 0; /*0xffc40909*/
    }
    v8 = v6 & 0xFFFC1FFF | 0x2000; /*0xffc40911*/
    goto LABEL_10; /*0xffc40911*/
  }
  *p___return_address &= ~0x1000u; /*0xffc408c3*/
  return 0; /*0xffc4091b*/
}

// Function: ProcCommonFunc91E @ 0xffc4091e (0x38d bytes)
// Index: 562/2560

int __cdecl ProcCommonFunc91E(_BYTE *__return_address, int __return_address_2, int n2)
{
  int __return_address_1; // ebx
  unsigned __int8 v4; // dl
  int v5; // eax
  int v6; // ebp
  int v7; // ebp
  unsigned __int8 v8; // al
  int v9; // ecx
  int v10; // eax
  char n6; // dl
  char v12; // bp
  int v13; // eax
  bool v14; // zf
  unsigned __int8 v15; // bl
  int v16; // eax
  unsigned int v17; // eax
  unsigned __int8 v18; // bl
  int v19; // eax
  _DWORD *v20; // ebx
  int *v21; // ebp
  int v22; // eax
  char v24; // [esp+13h] [ebp-25h]
  unsigned __int8 v25; // [esp+14h] [ebp-24h]
  unsigned __int8 n6_1; // [esp+14h] [ebp-24h]
  unsigned __int8 v27; // [esp+14h] [ebp-24h]
  unsigned __int8 v28; // [esp+14h] [ebp-24h]
  unsigned __int8 n4; // [esp+18h] [ebp-20h]
  int v30; // [esp+1Ch] [ebp-1Ch]
  int v31; // [esp+20h] [ebp-18h]
  int n80; // [esp+24h] [ebp-14h]
  int v33; // [esp+28h] [ebp-10h]
  _DWORD *v34; // [esp+2Ch] [ebp-Ch]
  unsigned __int8 *v35; // [esp+30h] [ebp-8h]
  int n5; // [esp+34h] [ebp-4h]
  int n5_1; // [esp+34h] [ebp-4h]

  v24 = -1; /*0xffc40933*/
  RcAssertPrint(__return_address, 4u, (int)"\n"); /*0xffc40937*/
  __return_address_1 = __return_address_2; /*0xffc4093c*/
  v4 = 0; /*0xffc40943*/
  *(_BYTE *)(__return_address_2 + 401) = 1; /*0xffc40945*/
  while ( ((1 << v4) & *((_DWORD *)__return_address + 61617)) == 0 ) /*0xffc4095e*/
  {
LABEL_6:
    if ( ++v4 >= 4u ) /*0xffc40987*/
      goto LABEL_9; /*0xffc40987*/
  }
  v5 = 6 * v4; /*0xffc40964*/
  if ( v24 == -1 ) /*0xffc4096a*/
  {
    v24 = *(_BYTE *)(v5 + __return_address_2 + 301); /*0xffc40973*/
    goto LABEL_6; /*0xffc40977*/
  }
  if ( v24 == *(_BYTE *)(v5 + __return_address_2 + 301) ) /*0xffc40980*/
    goto LABEL_6; /*0xffc40980*/
  *(_BYTE *)(__return_address_2 + 401) = 0; /*0xffc4098b*/
LABEL_9:
  n4 = 0; /*0xffc40992*/
  v6 = 0; /*0xffc4099d*/
  v34 = (_DWORD *)(__return_address_2 + 320); /*0xffc4099f*/
  v33 = 0; /*0xffc409a3*/
  v30 = 0; /*0xffc409ad*/
  n80 = 80; /*0xffc409b1*/
  v35 = (unsigned __int8 *)(__return_address_2 + 297); /*0xffc409b9*/
  while ( 2 ) /*0xffc409d0*/
  {
    if ( ((1 << v6) & *((_DWORD *)__return_address + 61617)) == 0 || !__return_address[257255] ) /*0xffc409d0*/
      goto LABEL_47; /*0xffc409d7*/
    if ( __return_address[246411] == 4 ) /*0xffc409e8*/
    {
LABEL_50:
      ProcCommonFunc8A71(__return_address, __return_address_1, n4, 0); /*0xffc40c95*/
      goto LABEL_42; /*0xffc40c9a*/
    }
    if ( n2 ) /*0xffc409f3*/
    {
      if ( n2 != 2 ) /*0xffc40c93*/
      {
        ProcCommonFunc8A71(__return_address, __return_address_1, n4, 1); /*0xffc40ca9*/
        goto LABEL_42; /*0xffc40ca9*/
      }
      goto LABEL_50; /*0xffc40c93*/
    }
    v7 = 0; /*0xffc409f9*/
    n5 = 5; /*0xffc409fb*/
    v31 = 0; /*0xffc40a03*/
    do /*0xffc40af2*/
    {
      v8 = 0; /*0xffc40a07*/
      v25 = 0; /*0xffc40a09*/
      if ( __return_address[255496] ) /*0xffc40a0d*/
      {
        v9 = v33; /*0xffc40a15*/
        do /*0xffc40a75*/
        {
          if ( (__return_address[4 * v8 + 255705 + v9] & 1) != 0 ) /*0xffc40a27*/
          {
            v10 = j_CpuIoWrite((int)__return_address, n4, v25, dword_FFD52180[v7]); /*0xffc40a36*/
            j_PciCfgWrite_0( /*0xffc40a59*/
              (int)__return_address,
              n4,
              v25,
              dword_FFD52180[v7],
              v10 ^ (unsigned __int16)(v10 ^ *(_DWORD *)(__return_address_1 + 4 * (v7 + n80))));
            v9 = v33; /*0xffc40a5e*/
          }
          v8 = v25 + 1; /*0xffc40a69*/
          v25 = v8; /*0xffc40a6b*/
        }
        while ( v8 < __return_address[255496] ); /*0xffc40a75*/
      }
      n6 = 1; /*0xffc40a77*/
      n6_1 = 1; /*0xffc40a7b*/
      v12 = 1; /*0xffc40a7f*/
      do /*0xffc40ae2*/
      {
        if ( ((unsigned __int8)(1 << v12) & __return_address[v30 + 255497]) != 0 ) /*0xffc40a92*/
        {
          v13 = j_CpuIoWrite((int)__return_address, n4, n6_1, dword_FFD5216C[v31]); /*0xffc40aa5*/
          j_PciCfgWrite_0( /*0xffc40acc*/
            (int)__return_address,
            n4,
            n6_1,
            dword_FFD5216C[v31],
            v13 ^ (unsigned __int16)(v13 ^ *(_DWORD *)(__return_address_1 + 4 * (v31 + n80))));
          n6 = n6_1; /*0xffc40ad1*/
        }
        ++n6; /*0xffc40ad8*/
        ++v12; /*0xffc40ada*/
        n6_1 = n6; /*0xffc40adb*/
      }
      while ( (unsigned __int8)n6 < 6u ); /*0xffc40ae2*/
      v7 = v31 + 1; /*0xffc40ae8*/
      v14 = n5-- == 1; /*0xffc40ae9*/
      ++v31; /*0xffc40aee*/
    }
    while ( !v14 ); /*0xffc40af2*/
    if ( !__return_address[246412] && __return_address[246424] >= 3u ) /*0xffc40b0c*/
    {
      v27 = 0; /*0xffc40b15*/
      if ( __return_address[244317] ) /*0xffc40b0e*/
      {
        v15 = 0; /*0xffc40b1c*/
        do /*0xffc40b85*/
        {
          v16 = j_CpuIoWrite((int)__return_address, n4, v27, 100679816); /*0xffc40b2f*/
          if ( v35[1] == 1 ) /*0xffc40b3b*/
            v17 = v16 & 0xFFFFFBFF; /*0xffc40b3d*/
          else
            v17 = ((unsigned __int16)v16 ^ (unsigned __int16)(v15 << 10)) & 0x400 ^ v16; /*0xffc40b52*/
          j_PciCfgWrite_0((int)__return_address, n4, v27, 100679816, v17 ^ (v17 ^ (*v35 << 13)) & 0x7E000); /*0xffc40b71*/
          v27 = ++v15; /*0xffc40b7b*/
        }
        while ( v15 < __return_address[244317] ); /*0xffc40b85*/
        __return_address_1 = __return_address_2; /*0xffc40b87*/
      }
    }
    v28 = 0; /*0xffc40b92*/
    if ( __return_address[244317] ) /*0xffc40b8b*/
    {
      v18 = 0; /*0xffc40b99*/
      do /*0xffc40bd4*/
      {
        v19 = j_CpuIoWrite((int)__return_address, n4, v28, 100679928); /*0xffc40ba9*/
        j_PciCfgWrite_0((int)__return_address, n4, v28, 100679928, v19 & 0xFC000000 | 0x182030A); /*0xffc40bc0*/
        v28 = ++v18; /*0xffc40bca*/
      }
      while ( v18 < __return_address[244317] ); /*0xffc40bd4*/
      __return_address_1 = __return_address_2; /*0xffc40bd6*/
    }
    if ( __return_address[257243] || __return_address[8307] ) /*0xffc40be3*/
      ProcCommonFunc9A41(__return_address, n4, __return_address_1); /*0xffc40bef*/
    v6 = v30; /*0xffc40bf7*/
LABEL_42:
    if ( __return_address[257255] && n2 != 2 ) /*0xffc40c09*/
    {
      v20 = v34; /*0xffc40c0b*/
      v21 = (int *)&unk_FFD52158; /*0xffc40c0f*/
      n5_1 = 5; /*0xffc40c14*/
      do /*0xffc40c4c*/
      {
        v22 = j_CpuIoWrite((int)__return_address, n4, 0, *v21); /*0xffc40c23*/
        j_PciCfgWrite_0((int)__return_address, n4, 0, *v21, v22 ^ (unsigned __int16)(v22 ^ *v20++)); /*0xffc40c39*/
        v14 = n5_1-- == 1; /*0xffc40c44*/
        ++v21; /*0xffc40c49*/
      }
      while ( !v14 ); /*0xffc40c4c*/
      __return_address_1 = __return_address_2; /*0xffc40c4e*/
      v6 = v30; /*0xffc40c52*/
    }
LABEL_47:
    n80 += 5; /*0xffc40c56*/
    v34 += 5; /*0xffc40c61*/
    ++v6; /*0xffc40c66*/
    v33 += 351; /*0xffc40c67*/
    v35 += 6; /*0xffc40c6f*/
    ++n4; /*0xffc40c74*/
    v30 = v6; /*0xffc40c78*/
    if ( n4 < 4u ) /*0xffc40c7e*/
      continue; /*0xffc40c7e*/
    return 0; /*0xffc40c84*/
  }
}

// Function: ProcMemInitCommon @ 0xffc40cab (0xaf3 bytes)
// Index: 563/2560

unsigned __int8 __cdecl ProcMemInitCommon(int __return_address)
{
  int v2; // edi
  int n4_1; // ebx
  unsigned __int8 v4; // cl
  const char *SLOW; // eax
  unsigned __int8 n3; // cl
  const char *UNKNOWN; // ebx
  const char *_104GT; // eax
  unsigned __int8 n2; // cl
  const char *DISABLED; // edi
  const char *ENABLED; // ebp
  const char *ENABLED_1; // eax
  unsigned __int8 n2_1; // cl
  const char *ENABLED_2; // eax
  unsigned __int8 n2_2; // al
  unsigned __int8 n5; // al
  int v17; // edi
  int n4_2; // ebp
  unsigned __int8 n2_3; // al
  unsigned __int8 v20; // cl
  const char *_4S; // eax
  int v22; // edi
  int v23; // ebp
  unsigned __int8 i; // bl
  int v25; // edi
  int v26; // ebp
  unsigned __int8 j; // bl
  int v28; // edi
  int n8334; // ebp
  unsigned __int8 k; // bl
  int v31; // edi
  int n8334_1; // ebp
  unsigned __int8 m; // bl
  unsigned __int8 n2_4; // cl
  const char *AUTO; // eax
  unsigned __int8 n2_5; // cl
  const char *AUTO_1; // eax
  unsigned __int8 n... [21729 chars total]

// Function: ProcCommonFunc179E @ 0xffc4179e (0x4a5 bytes)
// Index: 564/2560

unsigned __int8 __cdecl ProcCommonFunc179E(_BYTE *__return_address, unsigned __int8 *buf)
{
  unsigned __int8 n6; // cl
  const char *BASIC; // eax
  unsigned __int8 n5; // cl
  const char *DISABLED; // ebx
  const char *AUTO; // esi
  const char *AUTO_1; // eax
  unsigned __int8 v9; // cl
  const char *SLOW; // eax
  unsigned __int8 n3; // cl
  const char *_104GT; // eax
  unsigned __int8 n2; // cl
  const char *ENABLED; // eax
  unsigned __int8 n2_1; // cl
  const char *ENABLED_1; // eax
  unsigned __int8 n2_2; // al
  unsigned __int8 n2_3; // al
  int v19; // ebx
  int v20; // esi
  int v21; // ebp
  int v22; // esi
  int n4_1; // ebp
  int n4_2; // ebp
  int n4; // [esp+10h] [ebp-8h]

  RcAssertPrint(__return_address, 8u, (int)"\n\n\n******* KTI Output Structure *******"); /*0xffc417b2*/
  RcAssertPrint(__return_address, 8u, (int)"\nOutLegacyVgaSoc: %u", (unsigned __int8)__return_address[257170]);
  RcAssertPrint(__return_address, 8u, (int)"\nOutLegacyVgaStack: %u", (unsigned __int... [8597 chars total]

// Function: ProcCommonFunc1C43 @ 0xffc41c43 (0x3c bytes)
// Index: 565/2560

int __cdecl ProcCommonFunc1C43(int __return_address, char *n3, int buf)
{
  unsigned __int8 i; // bl

  for ( i = 0; i < 4u; ++i ) /*0xffc41c49*/
  {
    if ( i != *(_BYTE *)(buf + 1) ) /*0xffc41c53*/
      *n3 &= 0xF0u; /*0xffc41c55*/
    memset_save_flags(n3 + 1, 0, 0xCu); /*0xffc41c60*/
    *(_DWORD *)(buf + 100) = 1; /*0xffc41c68*/
    n3 += 13; /*0xffc41c71*/
  }
  return 0; /*0xffc41c79*/
}

// Function: ProcCommonFunc1C7F @ 0xffc41c7f (0x19e bytes)
// Index: 566/2560

int __cdecl ProcCommonFunc1C7F(int __return_address, int a2)
{
  char n2_2; // dh
  unsigned __int8 v3; // dl
  int v4; // eax
  unsigned __int8 n4; // al
  int n4_1; // edx
  int v7; // ecx
  char v8; // al
  unsigned __int8 n3; // al
  int v11; // esi
  char n2_1; // al
  char n2; // [esp+Dh] [ebp-3h]
  unsigned __int8 n4_2; // [esp+Eh] [ebp-2h]
  unsigned __int8 n3_1; // [esp+Fh] [ebp-1h]

  n2_2 = -1; /*0xffc41c87*/
  v3 = 0; /*0xffc41c8f*/
  n2 = -1; /*0xffc41c91*/
  while ( ((1 << v3) & *(_DWORD *)(__return_address + 246468)) == 0 )
  {
LABEL_6:
    if ( ++v3 >= 4u )
    {
      n4 = 0; /*0xffc41cca*/
      n4_2 = 0; /*0xffc41ccc*/
      while ( 1 ) /*0xffc41ccf*/
      {
        n4_1 = n4; /*0xffc41ccf*/
        if ( ((1 << n4) & *(_DWORD *)(__return_address + 246468)) != 0 ) /*0xffc41cdf*/
          break; /*0xffc41cdf*/
LABEL_28:
        n4 = n4_2 + 1; /*0xffc41de5*/
        n4_2 = n4; /*0xffc41dea*/
        if ( n4 >= 4u ) /*0xffc41def*/
          return 0; /*0xffc41dfd*/
      }
      if ( n2 == 2 ) /*0xffc41cea*/
      {
        if ( *(_BYTE *)(__return_address + 1364) != 1 ) /*0xffc41cf3*/
        {
          n3 = 0; /*0xffc41d29*/
          n3_1 = 0; /*0xffc41d2e*/
          while ( *(_DWORD *)(74 * n4_1 + 4 * n3 + a2 + 5) == *(_DWORD *)(74 * n4_1 + 4 * n3 + a2 + 42) ) /*0xffc41d3f*/
          {
            n3 = n3_1 + 1; /*0xffc41d48*/
            n3_1 = n3; /*0xffc41d4a*/
            if ( n3 >= 3u ) /*0xffc41d4f*/
              goto LABEL_19; /*0xffc41d4f*/
          }
          RcAssertPrint( /*0xffc41e10*/
            (_BYTE *)__return_address,
            4u,
            (int)"\n Interleave Enable -> Socket %d channel %d has different size between MC",
            n4_2,
            n3_1);
          return -1; /*0xffc41e18*/
        }
        v7 = 6 * n4; /*0xffc41cfb*/
        v8 = *(_BYTE *)(351 * n4 + __return_address + 255719) >> 1; /*0xffc41d05*/
        *(_BYTE *)(6 * n4_1 + a2 + 298) = 2; /*0xffc41d07*/
LABEL_20:
        *(_BYTE *)(v7 + a2 + 297) = v8; /*0xffc41d6f*/
      }
      else if ( n2 == 1 ) /*0xffc41d55*/
      {
LABEL_19:
        v7 = 6 * n4_1; /*0xffc41d57*/
        v8 = *(_BYTE *)(351 * n4_1 + __return_address + 255719); /*0xffc41d60*/
        *(_BYTE *)(6 * n4_1 + a2 + 298) = 1; /*0xffc41d67*/
        goto LABEL_20; /*0xffc41d67*/
      }
      v11 = 6 * n4_1; /*0xffc41d76*/
      RcAssertPrint( /*0xffc41d9c*/
        (_BYTE *)__return_address,
        4u,
        (int)"\nSocket %d Snc Enable = %d, Num of Cha Per Cluster = %d, Num of Cluster = %d",
        n4_1,
        *(unsigned __int8 *)(__return_address + 257197),
        *(unsigned __int8 *)(6 * n4_1 + a2 + 297),
        *(unsigned __int8 *)(6 * n4_1 + a2 + 298));
      n2_1 = *(_BYTE *)(v11 + a2 + 298); /*0xffc41da1*/
      if ( n2_1 == 1 )
      {
        if ( !*(_BYTE *)(__return_address + 8307) && !*(_BYTE *)(__return_address + 257243)
          || *(_BYTE *)(__return_address + 257197) == 1 )
        {
          RcAssertPrint(
            (_BYTE *)__return_address,
            4u,
            (int)"\nWARN: Cannot enable SNC_IND - all prefetch knobs are disabled!!!\n");
          return -1; /*0xffc41dcf*/
        }
      }
      else if ( n2_1 == 2 && !*(_BYTE *)(__return_address + 257197) ) /*0xffc41ddf*/
      {
        return -1; /*0xffc41ddf*/
      }
      goto LABEL_28; /*0xffc41dc8*/
    }
  }
  v4 = 6 * v3; /*0xffc41ca6*/
  if ( n2_2 == -1 ) /*0xffc41cac*/
  {
    n2_2 = *(_BYTE *)(v4 + a2 + 296); /*0xffc41cae*/
    n2 = n2_2; /*0xffc41cb5*/
    goto LABEL_6; /*0xffc41cb8*/
  }
  if ( n2_2 == *(_BYTE *)(v4 + a2 + 296) ) /*0xffc41cc1*/
    goto LABEL_6; /*0xffc41cc1*/
  RcAssertPrint((_BYTE *)__return_address, 4u, (int)"\nDifferent Mc numbers on existing sockets. Disable SNC!!"); /*0xffc41d19*/
  return -1; /*0xffc41df7*/
}

// Function: ProcCommonFunc1E1D @ 0xffc41e1d (0x7e bytes)
// Index: 567/2560

int __cdecl ProcCommonFunc1E1D(int __return_address, unsigned __int8 n4)
{
  int v3; // eax
  int result; // eax
  unsigned __int8 i_1; // bl
  int v6; // eax
  unsigned __int8 i; // [esp+Ch] [ebp+4h]

  v3 = j_CpuIoWrite(__return_address, n4, 0, 50479248); /*0xffc41e30*/
  result = j_PciCfgWrite_0(__return_address, n4, 0, 50479248, v3 | 1); /*0xffc41e41*/
  i_1 = 0; /*0xffc41e46*/
  for ( i = 0; i_1 < *(_BYTE *)(__return_address + 244317); i = i_1 ) /*0xffc41e4f*/
  {
    v6 = j_CpuIoWrite(__return_address, n4, i, 100679904); /*0xffc41e67*/
    result = j_PciCfgWrite_0(__return_address, n4, i, 100679904, v6 | 8); /*0xffc41e7a*/
    ++i_1; /*0xffc41e82*/
  }
  *(_BYTE *)(__return_address + 257243) = 0; /*0xffc41e91*/
  return result; /*0xffc41e98*/
}

// Function: ProcCommonFunc1E9B @ 0xffc41e9b (0x83 bytes)
// Index: 568/2560

unsigned __int8 __cdecl ProcCommonFunc1E9B(_BYTE *__return_address)
{
  int v2; // eax
  unsigned __int8 result; // al
  char SocketNumber; // [esp+10h] [ebp+8h]

  RcAssertPrint(__return_address, 4u, (int)"\nFail to boot in SNC mode!\n"); /*0xffc41eab*/
  __return_address[257197] = 0; /*0xffc41eb1*/
  SocketNumber = GetSocketNumber((int)__return_address); /*0xffc41ec2*/
  v2 = j_CpuIoWrite((int)__return_address, SocketNumber, 0, 318914748); /*0xffc41ecc*/
  result = j_PciCfgWrite_0((int)__return_address, SocketNumber, 0, 318914748, v2 | 0x40000000); /*0xffc41ede*/
  if ( !__return_address[246412]
    && __return_address[246424] < 3u
    && __return_address[257105]
    && __return_address[8302] == 1 )
  {
    return RcAssertPrint(
             __return_address,
             4u,
             (int)"WARNING MESSAGE: The platform doesn't  the SNC and Prefetch mode, please disable the SNCEN and XPT/KTI"
                  " Prefetch in SETUP\n");
  }
  return result; /*0xffc41f1a*/
}

// Function: ProcCommonFunc1F1E @ 0xffc41f1e (0xbd bytes)
// Index: 569/2560

unsigned __int8 __cdecl ProcCommonFunc1F1E(_BYTE *__return_address, _BYTE *n4, char a3)
{
  unsigned __int8 *v4; // edi
  int v5; // ebx
  int n4_1; // [esp+10h] [ebp-4h]

  RcAssertPrint(__return_address, 8u, (int)"\nCurrent bus numbers:"); /*0xffc41f2f*/
  RcAssertPrint( /*0xffc41f3c*/
    __return_address,
    8u,
    (int)"\nSocket | Stack0 | Stack1 | Stack2 | Stack3 | Stack4 | Stack5 | LastBus | Seg");
  RcAssertPrint( /*0xffc41f49*/
    __return_address,
    8u,
    (int)"\n--------------------------------------------------------------------------------");
  v4 = __return_address + 255509; /*0xffc41f52*/
  n4_1 = 4; /*0xffc41f5b*/
  v5 = 0; /*0xffc41f63*/
  do /*0xffc41fc3*/
  {
    if ( a3 || (*n4 & 1) != 0 && (*n4 & 0x60) == 0 ) /*0xffc41f75*/
      RcAssertPrint( /*0xffc41faf*/
        __return_address,
        8u,
        (int)"\n  %u    |  0x%02X  |  0x%02X  |  0x%02X  |  0x%02X  |  0x%02X  |  0x%02X  |   0x%02X  |  %1u",
        v5,
        *(v4 - 4),
        *(v4 - 3),
        *(v4 - 2),
        *(v4 - 1),
        *v4,
        v4[1],
        (unsigned __int8)__return_address[v5 + 255529],
        (unsigned __int8)__return_address[v5 + 255537]);
    ++v5; /*0xffc41fb7*/
    n4 += 13; /*0xffc41fb8*/
    v4 += 6; /*0xffc41fbb*/
    --n4_1; /*0xffc41fbe*/
  }
  while ( n4_1 ); /*0xffc41fc3*/
  return RcAssertPrint( /*0xffc41fd5*/
           __return_address,
           8u,
           (int)"\n--------------------------------------------------------------------------------\n");
}

// Function: ProcCommonFunc1FDB @ 0xffc41fdb (0x7d bytes)
// Index: 570/2560

int __cdecl ProcCommonFunc1FDB(_BYTE *__return_address, _BYTE *__return_address_1)
{
  int n2; // eax
  int n2_1; // edi

  if ( ProcCommonFuncFFDD((int)__return_address, __return_address_1) == -1 && __return_address[246411] == 4 ) /*0xffc41ff8*/
  {
    ProcCommonFunc1E9B(__return_address); /*0xffc41ffb*/
    return -1; /*0xffc42005*/
  }
  n2 = ProcCommonFuncFE35((int)__return_address, (int)__return_address_1); /*0xffc4200c*/
  n2_1 = n2; /*0xffc42011*/
  if ( n2 == -1 ) /*0xffc42018*/
  {
    ProcCommonFunc1E9B(__return_address); /*0xffc4201b*/
    RcAssertPrint(__return_address, 4u, (int)"\nRequest disable SNC and issue WARM RESET RESET!"); /*0xffc42027*/
LABEL_8:
    __return_address[246400] |= 2u; /*0xffc4203b*/
    goto LABEL_9; /*0xffc4203e*/
  }
  if ( n2 == 2 ) /*0xffc4202c*/
  {
    RcAssertPrint(__return_address, 4u, (int)"\nRequest to change number of snc cluster and issue WARM RESET RESET!"); /*0xffc42036*/
    goto LABEL_8; /*0xffc42036*/
  }
LABEL_9:
  ProcCommonFunc91E(__return_address, (int)__return_address_1, n2_1); /*0xffc42045*/
  return n2_1; /*0xffc42004*/
}

// Function: ProcCommonFunc2058 @ 0xffc42058 (0x5c9 bytes)
// Index: 571/2560

int __cdecl ProcCommonFunc2058(_BYTE *__return_address, int n4, char *buf)
{
  unsigned __int8 v4; // bl
  char v6; // al
  char v7; // dl
  unsigned __int8 n6; // cl
  _BYTE *v9; // eax
  _BYTE *v10; // edi
  unsigned __int8 SocketNumber_3; // dl
  _BYTE *v12; // esi
  unsigned __int8 SocketNumber_2; // al
  char n32; // cl
  unsigned __int8 n6_1; // ah
  _BYTE *v16; // ebp
  char v17; // al
  unsigned int n0x10000000; // eax
  unsigned int n0x10000000_1; // eax
  int n0x4000000; // eax
  int n1879048192; // eax
  int n1610612736; // eax
  unsigned int v24; // ecx
  unsigned int v25; // eax
  _BYTE *v26; // ecx
  _BYTE *v27; // edx
  int n4_1; // edi
  char *v29; // eax
  int n3; // eax
  const char *Slow_Speed; // ecx
  const char *Cold_Reset; // eax
  unsigned __int8 SocketNumber; // [esp+14h] [ebp-Ch]
  int SocketNumber_1; // [esp+1Ch] [ebp-4h]
  unsigned __int8 v36; // [esp+24h] [ebp+4h]

  v4 = 0; /*0xffc42062*/
  KtiDebugPrint(255, 255, 255, 161, 0, (int)__return_address); /*0xf... [12248 chars total]

// Function: ProcCommonFunc2621 @ 0xffc42621 (0x145 bytes)
// Index: 572/2560

unsigned __int8 __cdecl ProcCommonFunc2621(_BYTE *__return_address, int buf, unsigned __int8 n4)
{
  int n4_1; // edx
  _BYTE *v4; // ebp
  unsigned __int8 result; // al
  unsigned __int8 n4a_1; // cl
  int v7; // edi
  int v8; // edx
  unsigned int *i_1; // eax
  int n4a_2; // edx
  int v11; // ecx
  unsigned int v12; // esi
  unsigned int v13; // ebp
  int v14; // eax
  bool v15; // zf
  unsigned __int8 v16; // [esp+Bh] [ebp-21h]
  _BYTE *v17; // [esp+Ch] [ebp-20h]
  int v18; // [esp+10h] [ebp-1Ch]
  unsigned int *i; // [esp+14h] [ebp-18h]
  unsigned int v20; // [esp+18h] [ebp-14h]
  int n3; // [esp+1Ch] [ebp-10h]
  int v22; // [esp+20h] [ebp-Ch]
  int v23; // [esp+24h] [ebp-8h]
  int n4_2; // [esp+28h] [ebp-4h]
  char n4a; // [esp+38h] [ebp+Ch]

  n4_1 = n4; /*0xffc42624*/
  n4_2 = n4; /*0xffc42635*/
  v4 = &__return_address[50813 * n4 + 10239]; /*0xffc4263f*/
  result = 0; /*0xffc42641*/
  v17 = v4; /*0xffc42643*/
  v16 = 0; /*0xffc42647*/
  if ( __return_address[244317] ) /*0xffc4264b*/
  {
    n4a_1 = 0; /*0xffc42659*/
    do /*0xffc42758*/
    {
      v7 = 0; /*0xffc4265e*/
      v18 = 0; /*0xffc42660*/
      v23 = result; /*0xffc42664*/
      n4a = n4a_1; /*0xffc42668*/
      n3 = 3; /*0xffc4266f*/
      v8 = 37 * (result + 2 * n4_1); /*0xffc42677*/
      i_1 = (unsigned int *)(v8 + buf + 5); /*0xffc42681*/
      v22 = v8; /*0xffc42683*/
      for ( i = i_1; ; i_1 = i ) /*0xffc42687*/
      {
        n4a_2 = n4a_1; /*0xffc42695*/
        v11 = 8077 * n4a_1; /*0xffc42698*/
        v12 = *(_DWORD *)&v4[v11 + 2]; /*0xffc4269e*/
        v13 = *(_DWORD *)&v17[v11 + 22] + *(_DWORD *)&v4[v11 + 10]; /*0xffc426a6*/
        *i_1 = v12; /*0xffc426aa*/
        v20 = v12 >> 4; /*0xffc426b1*/
        RcAssertPrint( /*0xffc426da*/
          __return_address,
          4u,
          (int)"\n  channel %d DDR4 Size = %dG volSize = %dG perSize = %dG",
          n4a_2,
          v12 >> 4,
          *(_DWORD *)&v17[v11 + 10] >> 4,
          *(_DWORD *)&v17[v11 + 22] >> 4);
        v14 = v18; /*0xffc426df*/
        if ( v12 ) /*0xffc426e8*/
        {
          v14 = v20 + v18; /*0xffc426ea*/
          v18 += v20; /*0xffc426ee*/
        }
        if ( v13 ) /*0xffc426f4*/
          v7 += v13 >> 4; /*0xffc426f9*/
        ++i; /*0xffc426ff*/
        n4a_1 = n4a + 1; /*0xffc42704*/
        v15 = n3-- == 1; /*0xffc42706*/
        v4 = v17; /*0xffc4270b*/
        ++n4a; /*0xffc4270f*/
        if ( v15 ) /*0xffc42713*/
          break; /*0xffc42713*/
      }
      if ( !v7 ) /*0xffc4271b*/
        v7 = v14; /*0xffc4271d*/
      *(_DWORD *)(v22 + buf + 1) = v7; /*0xffc42734*/
      RcAssertPrint(__return_address, 4u, (int)"\n  Mc %d MemorySize = %dG", v23, v7); /*0xffc42738*/
      n4a_1 = n4a; /*0xffc42744*/
      result = v16 + 1; /*0xffc42748*/
      n4_1 = n4_2; /*0xffc4274a*/
      v16 = result; /*0xffc4274e*/
    }
    while ( result < __return_address[244317] ); /*0xffc42758*/
  }
  return result; /*0xffc42760*/
}

// Function: ProcCommonFunc2766 @ 0xffc42766 (0x56b bytes)
// Index: 573/2560

unsigned __int8 __cdecl ProcCommonFunc2766(int __return_address, int buf, unsigned __int8 n4)
{
  int n4_1; // ebp
  _BYTE *__return_address_1; // esi
  unsigned int n8; // eax
  int buf_1; // edi
  unsigned __int8 v7; // bl
  unsigned __int8 v8; // al
  int v9; // edx
  int v10; // eax
  int v11; // ebp
  _DWORD *v12; // ebx
  int n20; // eax
  int v14; // ecx
  unsigned __int8 n0x18; // dl
  int v16; // ecx
  int v17; // edx
  int v18; // eax
  int n2; // ecx
  int v20; // edx
  char v21; // cl
  unsigned __int8 v22; // cl
  int v23; // ecx
  int v24; // edx
  int v25; // eax
  int v26; // eax
  unsigned __int8 n2_1; // cl
  int n4_2; // eax
  int v29; // ecx
  char v30; // al
  unsigned __int8 v32; // [esp+11h] [ebp-27h]
  unsigned __int8 v33; // [esp+12h] [ebp-26h]
  unsigned __int8 n0x18_2; // [esp+12h] [ebp-26h]
  char v35; // [esp+13h] [ebp-25h]
  int n20_1; // [esp+14h] [ebp-24h]
  int v37; // [esp+14h] [ebp-24h]
  unsigned int n8_1; // [esp+1Ch] [ebp-1Ch]
  int v39; // [esp+20... [11138 chars total]

// Function: MailBoxPcodeComm @ 0xffc42cd1 (0x9c2 bytes)
// Index: 574/2560

int __usercall MailBoxPcodeComm@<eax>(int n0xF@<eax>, _BYTE *__return_address, char *n3, int buf, int a5)
{
  _BYTE *__return_address_1; // esi
  char n2; // al
  int v7; // ebp
  char *n3_1; // eax
  int n4; // edi
  int v10; // edi
  unsigned int *v11; // esi
  unsigned int v12; // eax
  int v13; // eax
  int buf_1; // ebp
  int v15; // edi
  char v16; // al
  unsigned __int8 n4_3; // al
  unsigned __int8 n4_4; // al
  int n4_16; // ecx
  char v20; // al
  char v21; // ah
  char *n3_4; // edi
  unsigned __int8 v23; // dl
  unsigned int v24; // eax
  char v25; // cl
  unsigned int v26; // ebp
  int n3_5; // eax
  int buf_2; // ebp
  unsigned __int8 n4_5; // bl
  int v30; // ecx
  unsigned __int8 i; // bh
  unsigned __int8 v32; // ch
  unsigned __int8 v33; // cl
  int v34; // eax
  unsigned int j_4; // ecx
  char n3_6; // bl
  unsigned __int8 n3_7; // cl
  int buf_3; // eax
  int v39; // ebp
  unsigned __int8 j; // ch
  char v41; // bl
  int v42; // eax
  int v43; // edx
  unsigned int... [22078 chars total]

// Function: ProcCommonFunc3693 @ 0xffc43693 (0x18a bytes)
// Index: 575/2560

int __cdecl ProcCommonFunc3693(int __return_address, unsigned __int8 n4, unsigned __int8 i, int buf)
{
  int v4; // esi
  int buf_1; // eax
  unsigned int v6; // esi
  int v7; // eax
  int v8; // esi
  int v9; // eax
  int v10; // eax
  int v11; // eax
  int v12; // eax
  char n2; // al
  int v14; // eax

  v4 = j_CpuIoWrite(__return_address, n4, i, 100679904); /*0xffc436b0*/
  buf_1 = buf; /*0xffc436b5*/
  if ( *(_BYTE *)(buf + 118) == 1 ) /*0xffc436bd*/
  {
    v6 = v4 & 0xFFFFFFFB; /*0xffc436bf*/
    if ( !*(_BYTE *)(__return_address + 246412) && *(_BYTE *)(__return_address + 246424) < 3u ) /*0xffc436d2*/
    {
      v7 = j_CpuIoWrite(__return_address, n4, i, 100679836); /*0xffc436dc*/
      j_PciCfgWrite_0(__return_address, n4, i, 100679836, v7 & 0x9FFFFFFF); /*0xffc436ef*/
      buf_1 = buf; /*0xffc436f4*/
    }
  }
  else
  {
    v6 = v4 | 4; /*0xffc436fd*/
  }
  if ( *(_BYTE *)(buf_1 + 117) == 1 ) /*0xffc43704*/
    v8 = v6 & 0xFFFFFFFD; /*0xffc43706*/
  else
    v8 = v6 | 2; /*0xffc4370b*/
  if ( !*(_BYTE *)(__return_address + 257105) && !*(_DWORD *)(buf_1 + 104) ) /*0xffc43717*/
    v8 |= 0x20u; /*0xffc4371d*/
  if ( !*(_BYTE *)(buf_1 + 115) ) /*0xffc43720*/
    v8 |= 0x10u; /*0xffc43726*/
  j_PciCfgWrite_0(__return_address, n4, i, 100679904, v8); /*0xffc43732*/
  v9 = j_CpuIoWrite(__return_address, n4, i, 100679808); /*0xffc43740*/
  if ( *(_BYTE *)(__return_address + 257172) == 1 ) /*0xffc4374f*/
    v10 = v9 | 0x10; /*0xffc43751*/
  else
    v10 = v9 & 0xFFFFFFEF; /*0xffc43756*/
  j_PciCfgWrite_0(__return_address, n4, i, 100679808, v10); /*0xffc4375e*/
  v11 = j_CpuIoWrite(__return_address, n4, i, 100679816); /*0xffc4376c*/
  j_PciCfgWrite_0(__return_address, n4, i, 100679816, n4 & 0xF | v11 & 0xFFF81FF0 | 0x400); /*0xffc43788*/
  if ( !*(_BYTE *)(__return_address + 246412) /*0xffc437a2*/
    && *(_BYTE *)(__return_address + 246424) >= 3u
    && *(_DWORD *)(__return_address + 255356) )
  {
    v12 = j_CpuIoWrite(__return_address, n4, i, 100679908); /*0xffc437b2*/
    j_PciCfgWrite_0(__return_address, n4, i, 100679908, v12 | 0x80000800); /*0xffc437c1*/
  }
  n2 = *(_BYTE *)(__return_address + 257105); /*0xffc437c9*/
  if ( (n2 == 1 || n2 == 2 || n2 == 3) && *(_BYTE *)(buf + 118) && !KtiFuncE78(__return_address, 0, 9u) ) /*0xffc437ea*/
  {
    v14 = j_CpuIoWrite(__return_address, n4, i, 100679912); /*0xffc437ff*/
    j_PciCfgWrite_0(__return_address, n4, i, 100679912, v14 | 0x10000000); /*0xffc4380e*/
  }
  return 0; /*0xffc43816*/
}

// Function: ProcCommonFunc381D @ 0xffc4381d (0x50 bytes)
// Index: 576/2560

int __cdecl ProcCommonFunc381D(char *buf)
{
  int v1; // ebx
  char *v2; // esi
  int n4; // ebp
  int *v4; // edi
  int v5; // eax
  int v6; // edx
  int v7; // edx

  v1 = 0; /*0xffc43824*/
  memset_save_flags(buf, 0, 0x18Cu); /*0xffc4382e*/
  v2 = buf + 216; /*0xffc43836*/
  n4 = 4; /*0xffc4383e*/
  do /*0xffc43864*/
  {
    v4 = (int *)v2; /*0xffc43844*/
    v5 = 3 << v1; /*0xffc43846*/
    v6 = 3 << (v1 + 16); /*0xffc4384e*/
    v1 += 2; /*0xffc43850*/
    v7 = v5 | v6; /*0xffc43853*/
    *((_DWORD *)v2 - 9) = v7; /*0xffc43855*/
    *((_DWORD *)v2 - 8) = v7; /*0xffc43858*/
    v2 += 56; /*0xffc4385b*/
    *v4++ = v5; /*0xffc4385e*/
    *v4 = v5; /*0xffc4385f*/
    v4[1] = v5; /*0xffc43860*/
    --n4; /*0xffc43861*/
  }
  while ( n4 ); /*0xffc43864*/
  return 0; /*0xffc43866*/
}

// Function: ProcCommonFunc386D @ 0xffc4386d (0x9e bytes)
// Index: 577/2560

char __cdecl ProcCommonFunc386D(_BYTE *__return_address)
{
  unsigned __int8 v1; // bl
  char n5; // al
  int n2; // eax
  int v4; // ecx
  char result; // al
  _DWORD v6[7]; // [esp+8h] [ebp-20h]
  __int16 n2058; // [esp+24h] [ebp-4h]

  v6[0] = 119480095; /*0xffc4387d*/
  v1 = __return_address[8323]; /*0xffc43884*/
  v6[1] = 119473695; /*0xffc4388a*/
  v6[2] = 522127135; /*0xffc43891*/
  v6[3] = 117704455; /*0xffc43898*/
  v6[4] = 151652103; /*0xffc4389f*/
  v6[5] = 117907231; /*0xffc438a6*/
  v6[6] = 117901060; /*0xffc438ad*/
  n2058 = 2058; /*0xffc438b4*/
  if ( v1 && (n5 = __return_address[257105]) != 0 ) /*0xffc438c4*/
  {
    if ( n5 == 4 && __return_address[257262] ) /*0xffc438ca*/
    {
      n2 = 1; /*0xffc438d5*/
    }
    else if ( n5 == 5 ) /*0xffc438da*/
    {
      n2 = 2; /*0xffc438de*/
    }
    else
    {
      n2 = 0; /*0xffc438e1*/
    }
  }
  else
  {
    v1 = 0; /*0xffc438e5*/
    n2 = 0; /*0xffc438e7*/
  }
  v4 = v1 + 5 * n2; /*0xffc438f1*/
  __return_address[257253] = *((_BYTE *)v6 + 2 * v4); /*0xffc438f7*/
  result = *((_BYTE *)v6 + 2 * v4 + 1); /*0xffc438fd*/
  __return_address[257252] = result; /*0xffc43901*/
  return result; /*0xffc438ef*/
}

// Function: ProcCommonFunc390B @ 0xffc4390b (0x175 bytes)
// Index: 578/2560

int __cdecl ProcCommonFunc390B(int __return_address, _BYTE *n4a, int buf, unsigned __int8 n4)
{
  unsigned __int8 n3; // dl
  int n0x1000000; // ebp
  int v6; // edi
  char v7; // cl
  unsigned __int8 v8; // bl
  int v9; // ecx
  _BYTE *n4a_1; // edx
  char v12; // [esp+13h] [ebp-19h]
  int n6; // [esp+18h] [ebp-14h]
  int v14; // [esp+20h] [ebp-Ch]
  int v15; // [esp+24h] [ebp-8h]
  int v16; // [esp+28h] [ebp-4h]
  int bufa; // [esp+38h] [ebp+Ch]
  unsigned __int8 bufb; // [esp+38h] [ebp+Ch]
  unsigned __int8 bufc; // [esp+38h] [ebp+Ch]

  n3 = 0; /*0xffc43919*/
  v16 = 0; /*0xffc4391b*/
  n0x1000000 = 0; /*0xffc43920*/
  v12 = 0; /*0xffc43922*/
  if ( n4 == *(_BYTE *)(buf + 1) ) /*0xffc4392b*/
    n0x1000000 = 0x1000000; /*0xffc4392d*/
  v6 = 0; /*0xffc43936*/
  n6 = 6; /*0xffc43947*/
  v15 = *(unsigned __int8 *)(351 * n4 + __return_address + 255743); /*0xffc4395f*/
  v14 = *(unsigned __int8 *)(n4 + __return_address + 255497); /*0xffc4396b*/
  do /*0xffc439f2*/
  {
    if ( ((1 << v6) & v14) != 0 ) /*0xffc4397a*/
    {
      bufa = 39 * (v6 + 9 * n4); /*0xffc43984*/
      if ( *(_BYTE *)(bufa + __return_address + 255791) != 0xFF ) /*0xffc43990*/
      {
        n0x1000000 |= v6 << (3 * n3); /*0xffc439a4*/
        bufb = *(_BYTE *)(bufa + __return_address + 255792); /*0xffc439b1*/
        if ( n3 >= 3u ) /*0xffc439ba*/
          v7 = 8 * n3 - 24; /*0xffc439c5*/
        else
          v7 = 8 * n3 + 8; /*0xffc439bc*/
        *(&v15 + n3 / 3u) |= bufb << v7; /*0xffc439e0*/
        n3 = ++v12; /*0xffc439e6*/
      }
    }
    ++v6; /*0xffc439ec*/
    --n6; /*0xffc439ed*/
  }
  while ( n6 ); /*0xffc439f2*/
  v8 = 0; /*0xffc439f8*/
  bufc = 0; /*0xffc439fa*/
  if ( *(_BYTE *)(__return_address + 255496) ) /*0xffc439fe*/
  {
    v9 = 13 * n4; /*0xffc43a06*/
    n4a_1 = n4a; /*0xffc43a0f*/
    do /*0xffc43a74*/
    {
      if ( (n4a_1[4 * v8 + 1 + v9] & 1) != 0 ) /*0xffc43a22*/
      {
        j_PciCfgWrite_0(__return_address, n4, bufc, 151011664, n0x1000000); /*0xffc43a30*/
        j_PciCfgWrite_0(__return_address, n4, bufc, 151011668, v15); /*0xffc43a44*/
        j_PciCfgWrite_0(__return_address, n4, bufc, 151011672, v16); /*0xffc43a58*/
        v9 = 13 * n4; /*0xffc43a5d*/
        n4a_1 = n4a; /*0xffc43a64*/
      }
      bufc = ++v8; /*0xffc43a6a*/
    }
    while ( v8 < *(_BYTE *)(__return_address + 255496) ); /*0xffc43a74*/
  }
  return 0; /*0xffc43a76*/
}

// Function: KtiMainSocketCheck @ 0xffc43a80 (0x3f7 bytes)
// Index: 579/2560

int __cdecl KtiMainSocketCheck(_BYTE *__return_address, char *n4a, int buf)
{
  unsigned __int8 n4; // al
  unsigned int n0x10000000; // ebp
  unsigned int n32; // ebp
  char *n4a_1; // ecx
  unsigned __int8 *v9; // edx
  int v10; // ebx
  char v11; // ah
  char v12; // al
  unsigned __int8 v13; // cl
  bool v14; // al
  int n8; // edx
  bool v16; // zf
  unsigned __int8 n4_7; // bl
  unsigned __int8 n4_4; // dl
  _BYTE *v19; // ecx
  char v20; // dh
  int n5000; // ebp
  unsigned int v22; // ebp
  unsigned __int8 n4_5; // dl
  _BYTE *v24; // ecx
  char v25; // dh
  int n5000_1; // ebp
  char v27; // bp
  char v29; // [esp+12h] [ebp-22h]
  unsigned int v30; // [esp+14h] [ebp-20h]
  char *n4a_2; // [esp+18h] [ebp-1Ch]
  int n8_1; // [esp+1Ch] [ebp-18h]
  unsigned __int8 *v33; // [esp+20h] [ebp-14h]
  unsigned __int8 v34; // [esp+24h] [ebp-10h]
  unsigned int n32_1; // [esp+28h] [ebp-Ch]
  int n4_2; // [esp+2Ch] [ebp-8h]
  char v37; // [esp+38h] [ebp+4h]
  _BYTE *v38; // [esp+38h] [ebp+4h]
  _BYTE *v39; // [esp+38h] [ebp+4h]
  unsigned __int8 n4_1; // [esp+40h] [ebp+Ch]
  unsigned __int8 v41; // [esp+40h] [ebp+Ch]
  unsigned __int8 n4_3; // [esp+40h] [ebp+Ch]
  unsigned __int8 n4_8; // [esp+40h] [ebp+Ch]
  unsigned __int8 n4_6; // [esp+40h] [ebp+Ch]

  v34 = 0; /*0xffc43a97*/
  if ( *(_BYTE *)(buf + 128) == 1 ) /*0xffc43aa2*/
    n4 = 4 * (__return_address[8321] != 0) + 4; /*0xffc43aad*/
  else
    n4 = 4; /*0xffc43ab6*/
  n4_1 = n4; /*0xffc43ab8*/
  if ( n4 > 4u )
  {
    RcAssertPrint(
      __return_address,
      1u,
      (int)"\n\n %s: %u   %s ",
      "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiMain.c",
      7730,
      "(TmpTotCpu <= MAX_SOCKET)");
    KtiDebugAssert((int)__return_address, 223, 123); /*0xffc43ae4*/
    n4 = n4_1; /*0xffc43ae9*/
  }
  n0x10000000 = *((_DWORD *)__return_address + 382); /*0xffc43af0*/
  if ( n0x10000000 > 0x10000000 ) /*0xffc43afc*/
    n32 = n0x10000000 >> 23; /*0xffc43b03*/
  else
    n32 = 32; /*0xffc43b00*/
  n4a_1 = n4a; /*0xffc43b06*/
  v9 = __return_address + 255743; /*0xffc43b0a*/
  v30 = 0; /*0xffc43b13*/
  v41 = 0; /*0xffc43b17*/
  n8_1 = 0; /*0xffc43b1b*/
  LOBYTE(v10) = 0; /*0xffc43b1f*/
  n32_1 = n32; /*0xffc43b23*/
  n4a_2 = n4a; /*0xffc43b27*/
  v33 = __return_address + 255743; /*0xffc43b2b*/
  n4_2 = n4; /*0xffc43b2f*/
  do /*0xffc43c01*/
  {
    v29 = *n4a_1; /*0xffc43b35*/
    if ( (*n4a_1 & 1) != 0 || *(_BYTE *)(buf + 128) == 1 ) /*0xffc43b48*/
    {
      v11 = (v9[1] - (unsigned int)*v9 + 1) / n32; /*0xffc43b5c*/
      v37 = v11; /*0xffc43b5e*/
      if ( v11 ) /*0xffc43b64*/
      {
        v12 = *n4a_1 & 1; /*0xffc43b66*/
        v13 = v41; /*0xffc43b6e*/
        do /*0xffc43bd9*/
        {
          if ( v12 ) /*0xffc43b74*/
          {
            if ( (v29 & 0x60) == 0 || (v14 = ProcCommonFuncACEC((int)__return_address, buf), v13 = v41, v14) ) /*0xffc43b8c*/
            {
              v10 = (unsigned __int8)v10 | (1 << v13); /*0xffc43b94*/
              v34 = v10; /*0xffc43b97*/
            }
            v11 = v37; /*0xffc43b9b*/
          }
          v29 = *n4a_2; /*0xffc43ba2*/
          v12 = *n4a_2 & 1; /*0xffc43ba6*/
          if ( v12 || *(_BYTE *)(buf + 128) ) /*0xffc43baa*/
            n8 = n8_1; /*0xffc43bb7*/
          else
            n8 = 8; /*0xffc43bb4*/
          --v11; /*0xffc43bc3*/
          v30 |= n8 << (4 * v13); /*0xffc43bc9*/
          v13 = v41 + 1; /*0xffc43bcd*/
          v37 = v11; /*0xffc43bcf*/
          ++v41; /*0xffc43bd3*/
        }
        while ( v11 ); /*0xffc43bd9*/
        n32 = n32_1; /*0xffc43bdb*/
      }
      v9 = v33; /*0xffc43bdf*/
      n4a_1 = n4a_2; /*0xffc43be3*/
    }
    ++n8_1; /*0xffc43be7*/
    v9 += 351; /*0xffc43beb*/
    n4a_1 += 13; /*0xffc43bf1*/
    v33 = v9; /*0xffc43bf4*/
    v16 = n4_2-- == 1; /*0xffc43bf8*/
    n4a_2 = n4a_1; /*0xffc43bfd*/
  }
  while ( !v16 ); /*0xffc43c01*/
  n4_7 = 0; /*0xffc43c07*/
  n4_4 = 0; /*0xffc43c09*/
  v19 = 0; /*0xffc43c0b*/
  n4_3 = 0; /*0xffc43c0d*/
  v38 = 0; /*0xffc43c11*/
  do
  {
    v20 = __return_address[257257]; /*0xffc43c15*/
    if ( (!v20 && ((1 << (char)v19) & *(_DWORD *)(buf + 100)) != 0 || v20 == 1 && __return_address[257259] == n4_4)
      && *(_BYTE *)(buf + 1) != n4_4 )
    {
      n5000 = 5000; /*0xffc43c51*/
      if ( j_CpuIoWrite((int)__return_address, n4_3, 0, 318914708) != -1412567295 )
      {
        while ( n5000 ) /*0xffc43c68*/
        {
          ProcCommonFunc9382((int)__return_address, 0x3E8u); /*0xffc43c70*/
          --n5000; /*0xffc43c7f*/
          if ( j_CpuIoWrite((int)__return_address, n4_3, 0, 318914708) == -1412567295 ) /*0xffc43c8e*/
          {
            if ( n5000 ) /*0xffc43c92*/
              goto LABEL_38; /*0xffc43c92*/
            break; /*0xffc43c92*/
          }
        }
        RcAssertPrint(
          __return_address,
          1u,
          (int)"\n\n %s: %u   %s ",
          "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiMain.c",
          7781,
          "WaitTime");
        KtiDebugAssert((int)__return_address, 216, n4_3 | 0x80); /*0xffc43cc0*/
      }
LABEL_38:
      v22 = v30; /*0xffc43cc8*/
      MemInitiateSktUpdate((int)__return_address, (int)n4a, buf, v34, v30, n4_3); /*0xffc43cdb*/
      n4_4 = n4_3; /*0xffc43ce0*/
      v19 = v38; /*0xffc43ce7*/
    }
    else
    {
      v22 = v30; /*0xffc43ced*/
    }
    ++n4_4; /*0xffc43cf1*/
    ++v19; /*0xffc43cf3*/
    n4_3 = n4_4; /*0xffc43cf4*/
    v38 = v19; /*0xffc43cf8*/
  }
  while ( n4_4 < 4u );
  ProcCommonFunc3E77((int)__return_address, n4a, buf); /*0xffc43d0b*/
  ProcCommonFunc43CF((int)__return_address, n4a, buf, v34, v22, *(_BYTE *)(buf + 1)); /*0xffc43d20*/
  ProcCommonFunc1F1E(__return_address, n4a, 0); /*0xffc43d2b*/
  ProcCommonFunc390B((int)__return_address, n4a, buf, *(_BYTE *)(buf + 1)); /*0xffc43d3b*/
  n4_5 = 0; /*0xffc43d40*/
  v24 = 0; /*0xffc43d42*/
  n4_8 = 0; /*0xffc43d47*/
  v39 = 0; /*0xffc43d4b*/
  do
  {
    v25 = __return_address[257257]; /*0xffc43d4f*/
    if ( (!v25 && ((1 << (char)v24) & *(_DWORD *)(buf + 100)) != 0 || v25 == 1 && __return_address[257259] == n4_5)
      && *(_BYTE *)(buf + 1) != n4_5 )
    {
      RcAssertPrint(__return_address, 4u, (int)"\n Wait for S%u to update\n", v24); /*0xffc43d8a*/
      n5000_1 = 5000; /*0xffc43d99*/
      if ( j_CpuIoWrite((int)__return_address, n4_8, 0, 318914708) != -1412567293 )
      {
        while ( n5000_1 ) /*0xffc43db0*/
        {
          ProcCommonFunc9382((int)__return_address, 0x3E8u); /*0xffc43db8*/
          --n5000_1; /*0xffc43dc7*/
          if ( j_CpuIoWrite((int)__return_address, n4_8, 0, 318914708) == -1412567293 ) /*0xffc43dd6*/
          {
            if ( n5000_1 ) /*0xffc43dda*/
              goto LABEL_52; /*0xffc43dda*/
            break; /*0xffc43dda*/
          }
        }
        RcAssertPrint(
          __return_address,
          1u,
          (int)"\n\n %s: %u   %s ",
          "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiMain.c",
          7816,
          "WaitTime");
        KtiDebugAssert((int)__return_address, 223, 110); /*0xffc43e00*/
      }
LABEL_52:
      j_PciCfgWrite_0((int)__return_address, n4_8, 0, 318914708, 0); /*0xffc43e08*/
      n4_5 = n4_8; /*0xffc43e19*/
      v24 = v39; /*0xffc43e20*/
    }
    ++n4_5; /*0xffc43e24*/
    ++v24; /*0xffc43e26*/
    n4_8 = n4_5; /*0xffc43e27*/
    v39 = v24; /*0xffc43e2b*/
  }
  while ( n4_5 < 4u );
  n4_6 = 0; /*0xffc43e38*/
  v27 = 0; /*0xffc43e3c*/
  do /*0xffc43e6b*/
  {
    if ( ((1 << v27) & *(_DWORD *)(buf + 100)) != 0 && *(_BYTE *)(buf + 1) != n4_7 ) /*0xffc43e4d*/
      ProcCommonFunc390B((int)__return_address, n4a, buf, n4_6); /*0xffc43e59*/
    ++n4_7; /*0xffc43e61*/
    ++v27; /*0xffc43e63*/
    n4_6 = n4_7; /*0xffc43e64*/
  }
  while ( n4_7 < 4u ); /*0xffc43e6b*/
  return 0; /*0xffc43e6d*/
}

// Function: ProcCommonFunc3E77 @ 0xffc43e77 (0x12b bytes)
// Index: 580/2560

int __cdecl ProcCommonFunc3E77(int __return_address, char *n4a, int buf)
{
  int __return_address_1; // esi
  char *n4a_1; // eax
  _BYTE *v5; // edx
  unsigned __int8 n4; // bl
  _DWORD *v7; // ecx
  int v8; // ebp
  unsigned __int8 *v9; // edi
  char v10; // al
  char *v11; // ecx
  _BYTE *v12; // esi
  int n6; // edx
  char v14; // al
  unsigned __int8 n4_1; // [esp+4h] [ebp-Ch]
  _DWORD *v17; // [esp+8h] [ebp-8h]
  _BYTE *v18; // [esp+Ch] [ebp-4h]

  __return_address_1 = __return_address; /*0xffc43e7f*/
  if ( ProcCommonFuncACEC(__return_address, buf) ) /*0xffc43e84*/
  {
    n4a_1 = n4a; /*0xffc43e93*/
    v5 = (_BYTE *)(__return_address + 255505); /*0xffc43e97*/
    n4 = 0; /*0xffc43e9f*/
    v18 = (_BYTE *)(__return_address + 255505); /*0xffc43ea1*/
    v7 = (_DWORD *)(__return_address + 255560); /*0xffc43ea5*/
    n4_1 = 0; /*0xffc43eab*/
    v8 = 0; /*0xffc43eb0*/
    v17 = (_DWORD *)(__return_address + 255560); /*0xffc43eb2*/
    v9 = (unsigned __int8 *)(__return_address + 255743); /*0xffc43eb6*/
    do /*0xffc43f92*/
    {
      v10 = *n4a_1; /*0xffc43ebc*/
      if ( (v10 & 1) != 0 && (v10 & 0x60) == 0x20 ) /*0xffc43eca*/
      {
        *(_DWORD *)(__return_address_1 + 246472) |= 1 << v8; /*0xffc43ed9*/
        AutoGenFuncE81E(__return_address_1, __return_address_1 + 255608); /*0xffc43ee7*/
        j_CpuIoWrite(__return_address_1, n4_1, 0, 335561280); /*0xffc43ef8*/
        j_PciCfgWrite_0(__return_address_1, n4_1, 0, 335561280, *v9 | 0x80000000); /*0xffc43f12*/
        *(_BYTE *)(__return_address_1 + v8 + 255533) = *v9; /*0xffc43f20*/
        *(_BYTE *)(__return_address_1 + v8 + 255529) = v9[1]; /*0xffc43f2a*/
        *(v17 - 4) = *(_DWORD *)(v9 + 42); /*0xffc43f34*/
        *v17 = *(_DWORD *)(v9 + 38); /*0xffc43f3a*/
        v11 = (char *)(v9 + 48); /*0xffc43f3c*/
        *(_BYTE *)(__return_address_1 + v8 + 255537) = *(v9 - 2); /*0xffc43f44*/
        v12 = v18; /*0xffc43f4b*/
        n6 = 6; /*0xffc43f4f*/
        do /*0xffc43f5b*/
        {
          v14 = *v11; /*0xffc43f50*/
          v11 += 39; /*0xffc43f52*/
          *v12++ = v14; /*0xffc43f55*/
          --n6; /*0xffc43f58*/
        }
        while ( n6 ); /*0xffc43f5b*/
        __return_address_1 = __return_address; /*0xffc43f5d*/
        v7 = v17; /*0xffc43f61*/
        v5 = v18; /*0xffc43f65*/
      }
      ++n4; /*0xffc43f6d*/
      ++v7; /*0xffc43f6f*/
      n4_1 = n4; /*0xffc43f72*/
      n4a_1 = n4a + 13; /*0xffc43f76*/
      v17 = v7; /*0xffc43f79*/
      v5 += 6; /*0xffc43f7d*/
      n4a += 13; /*0xffc43f80*/
      ++v8; /*0xffc43f84*/
      v18 = v5; /*0xffc43f85*/
      v9 += 351; /*0xffc43f89*/
    }
    while ( n4 < 4u ); /*0xffc43f92*/
  }
  return 0; /*0xffc43f9d*/
}

// Function: MemInitiateSktUpdate @ 0xffc43fa2 (0x42d bytes)
// Index: 581/2560

int __cdecl MemInitiateSktUpdate(
        int __return_address,
        int n4a,
        int buf,
        unsigned __int8 a4,
        unsigned int a5,
        unsigned __int8 n4)
{
  int n6_1; // esi
  int n2; // ebx
  int v8; // eax
  char v10; // cl
  int n8; // edx
  unsigned __int8 n3; // dl
  int v13; // ebp
  unsigned int v14; // eax
  int v15; // edi
  unsigned __int8 *v16; // esi
  int n6_2; // ecx
  int v18; // ebx
  unsigned __int8 v19; // dh
  unsigned int v20; // eax
  int v21; // eax
  unsigned __int8 *v22; // edx
  unsigned __int8 n4_2; // al
  char v24; // si
  int v25; // ebp
  bool v26; // cf
  int v27; // eax
  int bufa_1; // ecx
  unsigned int v29; // esi
  char *v30; // ebp
  _BYTE *v31; // ecx
  char v32; // al
  int n4_1; // [esp-4h] [ebp-3Ch]
  int n2_1; // [esp+10h] [ebp-28h]
  int v36; // [esp+14h] [ebp-24h]
  unsigned int v37; // [esp+14h] [ebp-24h]
  int v38; // [esp+1Ch] [ebp-1Ch]
  int n6_3; // [esp+24h] [ebp-14h]
  int n6; // [esp+30h] [ebp-8h]
  int v41; // [esp+34h] [ebp-4h]
  int bufa; // [esp+44h] [ebp+Ch]
  int n8_1; // [esp+48h] [ebp+10h]
  unsigned __int8 n4_3; // [esp+48h] [ebp+10h]
  unsigned int v45; // [esp+4Ch] [ebp+14h]

  v38 = 0; /*0xffc43fb2*/
  n6_1 = 0; /*0xffc43fb6*/
  v36 = 0; /*0xffc43fc1*/
  n2_1 = 0; /*0xffc43fc5*/
  n6 = 6; /*0xffc43fc9*/
  if ( *(_DWORD *)(__return_address + 1528) >> 20 == 64 ) /*0xffc43fd0*/
  {
    n6_1 = 6; /*0xffc44011*/
    n2 = 2; /*0xffc44013*/
  }
  else
  {
    if ( *(_DWORD *)(__return_address + 1528) >> 20 != 128 ) /*0xffc43fd5*/
    {
      if ( *(_DWORD *)(__return_address + 1528) >> 20 == 256 ) /*0xffc43fdc*/
      {
        n4_1 = 4; /*0xffc43ffe*/
      }
      else
      {
        if ( *(_DWORD *)(__return_address + 1528) >> 20 != 512 ) /*0xffc43fe3*/
        {
          if ( *(_DWORD *)(__return_address + 1528) >> 20 == 1024 ) /*0xffc43fea*/
          {
            n6_1 = 1; /*0xffc43ff7*/
          }
          else if ( *(_DWORD *)(__return_address + 1528) >> 20 != 2048 ) /*0xffc43ff1*/
          {
            goto LABEL_16; /*0xffc43ff1*/
          }
          goto LABEL_12; /*0xffc43ff1*/
        }
        n4_1 = 2; /*0xffc43ffa*/
      }
      n6_1 = n4_1; /*0xffc44000*/
LABEL_12:
      n2_1 = 0; /*0xffc44001*/
      goto LABEL_16; /*0xffc44005*/
    }
    n6_1 = 5; /*0xffc4400b*/
    n2 = 1; /*0xffc4400c*/
  }
  n2_1 = n2; /*0xffc44014*/
LABEL_16:
  v8 = j_CpuIoWrite(__return_address, n4, 0, 50413760); /*0xffc44018*/
  j_PciCfgWrite_0( /*0xffc4405d*/
    __return_address,
    n4,
    0,
    50413760,
    (2 * n6_1) & 0x3FFC03F | v8 & 0x3FFC030 | (a4 << 6) | *(_DWORD *)(buf + 129) & 0xFC000000);
  j_PciCfgWrite_0(__return_address, n4, 0, 50413764, 0); /*0xffc4406b*/
  v10 = 0; /*0xffc4407c*/
  n8 = 8; /*0xffc44087*/
  n8_1 = 8; /*0xffc44088*/
  do /*0xffc440b7*/
  {
    if ( ((a5 >> v10) & 0xF) == n4 ) /*0xffc44095*/
    {
      n8 = n8_1; /*0xffc440a7*/
      a5 = ((n4 | 8) << v10) | ~(15 << v10) & a5; /*0xffc440ab*/
    }
    v10 += 4; /*0xffc440ad*/
    n8_1 = --n8; /*0xffc440b3*/
  }
  while ( n8 ); /*0xffc440b7*/
  j_PciCfgWrite_0(__return_address, n4, 0, 50413804, a5); /*0xffc440c6*/
  n3 = 0; /*0xffc440e5*/
  v41 = 351 * n4; /*0xffc440eb*/
  v13 = 0; /*0xffc440f7*/
  v14 = 0; /*0xffc440ff*/
  v15 = *(unsigned __int8 *)(v41 + __return_address + 255791); /*0xffc44101*/
  v16 = (unsigned __int8 *)(v41 + __return_address + 255792); /*0xffc44105*/
  n6_2 = 6; /*0xffc44107*/
  v45 = 0; /*0xffc44108*/
  v18 = 0; /*0xffc4410c*/
  n6_3 = 6; /*0xffc4410e*/
  do /*0xffc4417a*/
  {
    v19 = *v16; /*0xffc44112*/
    if ( *v16 >= *(v16 - 1) ) /*0xffc44117*/
    {
      if ( n3 >= 3u ) /*0xffc44123*/
        v13 |= v19 << (8 * n3 - 24); /*0xffc44141*/
      else
        v15 |= v19 << (8 * n3 + 8); /*0xffc44131*/
      v20 = v45 << (4 * n3); /*0xffc4414e*/
      v38 |= v20; /*0xffc44150*/
      v18 |= v20; /*0xffc44154*/
      v14 = v45; /*0xffc4415a*/
      v36 |= 1 << v45; /*0xffc44161*/
      ++n3; /*0xffc44165*/
      n6_2 = n6_3; /*0xffc44167*/
    }
    ++v14; /*0xffc4416b*/
    v16 += 39; /*0xffc4416c*/
    --n6_2; /*0xffc4416f*/
    v45 = v14; /*0xffc44172*/
    n6_3 = n6_2; /*0xffc44176*/
  }
  while ( n6_2 ); /*0xffc4417a*/
  v21 = 12 * n4; /*0xffc4417c*/
  *(_DWORD *)(v21 + buf + 59) = v38; /*0xffc441a2*/
  *(_DWORD *)(v21 + buf + 51) = v15; /*0xffc441af*/
  *(_DWORD *)(v21 + buf + 55) = v13; /*0xffc441b3*/
  j_PciCfgWrite_0(__return_address, n4, 0, 50413768, v15); /*0xffc441b7*/
  j_PciCfgWrite_0(__return_address, n4, 0, 50413772, v13); /*0xffc441c8*/
  j_PciCfgWrite_0(__return_address, n4, 0, 67387540, v15); /*0xffc441df*/
  j_PciCfgWrite_0(__return_address, n4, 0, 67387544, v13); /*0xffc441f3*/
  v37 = v36 | 0x80000000; /*0xffc441ff*/
  j_PciCfgWrite_0(__return_address, n4, 0, 50413796, v18 | 0x3F000000); /*0xffc44218*/
  v22 = (unsigned __int8 *)(351 * n4 + __return_address + 255791); /*0xffc4421d*/
  n4_2 = 0; /*0xffc44221*/
  v24 = 0; /*0xffc44223*/
  bufa = 0; /*0xffc44225*/
  n4_3 = 0; /*0xffc44230*/
  v25 = 0; /*0xffc44234*/
  do /*0xffc44274*/
  {
    if ( v22[1] ) /*0xffc44236*/
    {
      v26 = n4_2 < 4u; /*0xffc4423c*/
      v27 = *v22; /*0xffc4423e*/
      if ( v26 ) /*0xffc44241*/
      {
        bufa_1 = (v27 << v24) | bufa; /*0xffc4424b*/
        n4_2 = n4_3; /*0xffc4424d*/
        bufa = bufa_1; /*0xffc44251*/
        goto LABEL_33; /*0xffc44255*/
      }
      v25 |= v27 << (v24 - 32); /*0xffc4425c*/
      n4_2 = n4_3; /*0xffc4425e*/
    }
    bufa_1 = bufa; /*0xffc44262*/
LABEL_33:
    ++n4_2; /*0xffc44266*/
    v22 += 39; /*0xffc44268*/
    v24 += 8; /*0xffc4426b*/
    n4_3 = n4_2; /*0xffc4426e*/
  }
  while ( n4_2 < 6u ); /*0xffc44274*/
  j_PciCfgWrite_0(__return_address, n4, 0, 318914764, bufa_1); /*0xffc44284*/
  j_PciCfgWrite_0(__return_address, n4, 0, 318914768, v25); /*0xffc44295*/
  j_PciCfgWrite_0(__return_address, n4, 0, 83902624, bufa); /*0xffc442ad*/
  j_PciCfgWrite_0(__return_address, n4, 0, 83902628, v25); /*0xffc442c1*/
  v29 = j_CpuIoWrite(__return_address, n4, 0, 318914780) & 0xFFFFFFFE; /*0xffc442dc*/
  j_PciCfgWrite_0(__return_address, n4, 0, 318914780, v29); /*0xffc442e8*/
  j_PciCfgWrite_0(__return_address, n4, 0, 318914780, v29 & 0xFFFFFFF9 | (2 * n2_1) | 1); /*0xffc44303*/
  j_PciCfgWrite_0(__return_address, n4, 0, 83902632, v37); /*0xffc44315*/
  j_PciCfgWrite_0(__return_address, n4, 0, 318914716, *(_DWORD *)(__return_address + v41 + 255781)); /*0xffc44333*/
  RcAssertPrint((_BYTE *)__return_address, 4u, (int)"\n Initiate S%u update\n", n4); /*0xffc44345*/
  j_PciCfgWrite_0(__return_address, n4, 0, 318914708, -1412567294); /*0xffc44358*/
  *(_BYTE *)(n4 + __return_address + 255533) = *(_BYTE *)(__return_address + v41 + 255743); /*0xffc4436d*/
  *(_BYTE *)(n4 + __return_address + 255529) = *(_BYTE *)(__return_address + v41 + 255744); /*0xffc4437b*/
  *(_DWORD *)(__return_address + 4 * n4 + 255544) = *(_DWORD *)(__return_address + v41 + 255785); /*0xffc44389*/
  *(_DWORD *)(__return_address + 4 * n4 + 255560) = *(_DWORD *)(__return_address + v41 + 255781); /*0xffc44397*/
  v30 = (char *)(351 * n4 + __return_address + 255791); /*0xffc443a5*/
  *(_BYTE *)(n4 + __return_address + 255537) = *(_BYTE *)(__return_address + v41 + 255741); /*0xffc443a9*/
  v31 = (_BYTE *)(6 * n4 + __return_address + 255505); /*0xffc443b3*/
  do /*0xffc443c3*/
  {
    v32 = *v30; /*0xffc443b5*/
    v30 += 39; /*0xffc443b8*/
    *v31++ = v32; /*0xffc443bb*/
    --n6; /*0xffc443be*/
  }
  while ( n6 ); /*0xffc443c3*/
  return 0; /*0xffc443c5*/
}

// Function: ProcCommonFunc43CF @ 0xffc443cf (0x5ef bytes)
// Index: 582/2560

int __cdecl ProcCommonFunc43CF(
        int __return_address,
        _BYTE *n4a,
        int buf,
        unsigned __int8 a4,
        unsigned int a5,
        unsigned __int8 a6)
{
  int n2; // ebp
  unsigned int v7; // esi
  int v8; // eax
  unsigned __int32 v9; // eax
  char v11; // cl
  int n8; // edx
  unsigned int v13; // eax
  unsigned int v14; // edi
  unsigned __int8 n3; // dl
  unsigned __int8 *v16; // ebp
  int v17; // ebx
  unsigned int v18; // esi
  int n6_1; // ecx
  unsigned __int8 v20; // dh
  unsigned int v21; // eax
  int v22; // eax
  unsigned __int8 *v23; // edx
  char v24; // bp
  unsigned int v25; // edi
  unsigned __int8 n4_1; // al
  int n4; // ebx
  bool v28; // cf
  int v29; // eax
  unsigned __int32 v31; // eax
  void *v32; // ecx
  int v33; // eax
  _BYTE *n4a_1; // eax
  _DWORD *v35; // ebp
  int v36; // esi
  int n4_4; // ecx
  int v38; // eax
  char *v39; // edx
  _BYTE *v40; // ecx
  int n6_3; // esi
  char v42; // al
  _BYTE *n4a_3; // eax
  int v44; //... [11258 chars total]

// Function: ProcCommonFunc49BE @ 0xffc449be (0x52b bytes)
// Index: 583/2560

int __cdecl ProcCommonFunc49BE(char *__return_address)
{
  char n4_1; // al
  char n4[396]; // [esp+Ch] [ebp-1F4h] BYREF
  char buf[104]; // [esp+198h] [ebp-68h] BYREF
  char v5; // [esp+210h] [ebp+10h]
  _BYTE v6[78]; // [esp+226h] [ebp+26h] BYREF

  ProcMemInitCommon((int)__return_address); /*0xffc449d0*/
  ProcCommonFunc381D(n4); /*0xffc449dc*/
  memset_save_flags(buf, 0, 0xDCu); /*0xffc449ec*/
  AutoGenFunc8E72((int)v6, __return_address + 8328, 72); /*0xffc449fe*/
  ProcCommonFunc1F1E(__return_address, n4, 1); /*0xffc44a0d*/
  RcAssertPrint(__return_address, 4u, (int)"\n\n\n******* Collecting Early System Information - START *******"); /*0xffc44a1c*/
  ProcCommonFunc2058(__return_address, (int)n4, buf); /*0xffc44a2d*/
  RcAssertPrint(__return_address, 4u, (int)"\n******* Collecting Early System Information - END   *******"); /*0xffc44a3c*/
  RcAssertPrint(__return_address, 4u, (int)"\n\n\n******* Setting up Minimum Path - START *******\n"); /*0xffc44a48*/
  KtiFunc77FB((int)__retur... [9200 chars total]

// Function: DebugLogPrint_6 @ 0xffc44ee9 (0x134 bytes)
// Index: 584/2560

void __cdecl DebugLogPrint_6(char *__return_address, char *buf)
{
  char *v2; // [esp-Ch] [ebp-10h]
  char *v3; // [esp-8h] [ebp-Ch]

  if ( *((_DWORD *)__return_address + 61601) )
  {
    RcAssertPrint(__return_address, 4u, (int)"\n---------- Verify Kti Nvram in S3 Resume ---------\n"); /*0xffc44faf*/
    if ( AutoGenFunc8E45((int)(__return_address + 453772), __return_address + 8299, 28) )
    {
      KtiDebugPrint(255, 255, 255, 222, 2, (int)__return_address); /*0xffc44fe0*/
      RcAssertPrint(__return_address, 1u, (int)"\n Kti Setup Doesn't Match - S3 Resume Failed."); /*0xffc44fed*/
      RcAssertPrint(
        __return_address,
        1u,
        (int)"\n\n %s: %u   %s ",
        "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiMain.c",
        1330,
        "FALSE");
      KtiDebugAssert((int)__return_address, 222, 2); /*0xffc45012*/
    }
  }
  else
  {
    if ( *buf == 4 ) /*0xffc44f04*/
    {
      RcAssertPrint(__return_address, 4u, (int)"\n----------Update Kti Nvram in COLD BOOT ----------\n"); /*0xffc44f0e*/
      AutoGenFunc8E72((int)(__return_address + 453772), __return_address + 8299, 28); /*0xffc44f23*/
      return; /*0xffc44f2c*/
    }
    if ( *buf == 2 ) /*0xffc44f2f*/
    {
      if ( (j_CpuIoWrite((int)__return_address, 0, 0, 318914720) & 2) == 0 ) /*0xffc44f47*/
      {
        v3 = __return_address + 8299; /*0xffc44f51*/
        v2 = __return_address + 453772; /*0xffc44f58*/
LABEL_7:
        AutoGenFunc8E72((int)v2, v3, 28); /*0xffc44f59*/
        return; /*0xffc44f62*/
      }
      v3 = __return_address + 8299; /*0xffc44f74*/
      v2 = __return_address + 453772; /*0xffc44f7b*/
      if ( !KtiFunc79E2((int)__return_address) ) /*0xffc44f7c*/
        goto LABEL_7; /*0xffc44f7c*/
      if ( AutoGenFunc8E45((int)v2, v3, 28) ) /*0xffc44f7e*/
      {
        RcAssertPrint(__return_address, 4u, (int)"\n Kti setup has been changed in warm boot, request a cold boot!!!\n"); /*0xffc44f96*/
        __return_address[246400] |= 4u; /*0xffc44f9e*/
      }
    }
  }
}

// Function: MailBoxPcuMiscConfigRead @ 0xffc4501d (0x79 bytes)
// Index: 585/2560

int __cdecl MailBoxPcuMiscConfigRead(char *__return_address, char *n4)
{
  unsigned __int8 n4_1; // bl
  int v4; // esi
  int v6; // [esp+Ch] [ebp-4h]

  n4_1 = 0; /*0xffc45023*/
  LOBYTE(v6) = 0; /*0xffc45029*/
  do /*0xffc4508b*/
  {
    if ( (*n4 & 1) != 0 && (*n4 & 0x60) == 0 ) /*0xffc45034*/
    {
      ProcCommonFuncA61D(__return_address, v6, 5, 0); /*0xffc45040*/
      v4 = j_CpuIoWrite((int)__return_address, v6, 0, 67190924); /*0xffc45057*/
      RcAssertPrint(__return_address, 4u, (int)"\nMAILBOX_BIOS_CMD_READ_PCU_MISC_CONFIG returned %u", v4); /*0xffc45064*/
      ProcCommonFuncA61D(__return_address, v6, 6, v4 | 0x4000000); /*0xffc45078*/
    }
    ++n4_1; /*0xffc45080*/
    n4 += 13; /*0xffc45082*/
    LOBYTE(v6) = n4_1; /*0xffc45085*/
  }
  while ( n4_1 < 4u ); /*0xffc4508b*/
  return 0; /*0xffc4508d*/
}

// Function: MailBoxPcuFuncEnables @ 0xffc45096 (0xa0 bytes)
// Index: 586/2560

int __cdecl MailBoxPcuFuncEnables(char *__return_address, char *n4, char *buf)
{
  char *__return_address_1; // edi
  unsigned __int8 n4_1; // bl
  char v5; // bp
  char v6; // dl

  __return_address_1 = __return_address; /*0xffc45097*/
  if ( !__return_address[246412] ) /*0xffc4509b*/
  {
    n4_1 = 0; /*0xffc450a9*/
    LOBYTE(__return_address) = 0; /*0xffc450ac*/
    v5 = 0; /*0xffc450b0*/
    do /*0xffc45127*/
    {
      v6 = __return_address_1[257257]; /*0xffc450b2*/
      if ( !v6 && ((1 << v5) & *((_DWORD *)buf + 25)) != 0 || v6 == 1 && __return_address_1[257259] == n4_1 ) /*0xffc450d7*/
      {
        ProcCommonFuncA61D(__return_address_1, (int)__return_address, 125, 1); /*0xffc450e2*/
        ProcCommonFuncA61D(__return_address_1, (int)__return_address, 381, 1); /*0xffc450f3*/
        ProcCommonFuncA61D(__return_address_1, (int)__return_address, 637, 1); /*0xffc45104*/
        ProcCommonFuncA61D(__return_address_1, (int)__return_address, 893, 1); /*0xffc45115*/
      }
      ++n4_1; /*0xffc4511d*/
      ++v5; /*0xffc4511f*/
      LOBYTE(__return_address) = n4_1; /*0xffc45120*/
    }
    while ( n4_1 < 4u ); /*0xffc45127*/
    __return_address_1[246400] |= 2u; /*0xffc45129*/
  }
  return 0; /*0xffc45134*/
}

// Function: KtiTopoBusMapDetect @ 0xffc45136 (0x6e bytes)
// Index: 587/2560

int __cdecl KtiTopoBusMapDetect(char *__return_address, char *n4, char *buf)
{
  char *n4_1; // ecx
  int v4; // esi
  char v5; // dl
  int n4_2; // edi

  n4_1 = n4; /*0xffc45136*/
  v4 = 0; /*0xffc4513e*/
  v5 = 0; /*0xffc45140*/
  n4_2 = 4; /*0xffc45142*/
  do /*0xffc45159*/
  {
    if ( (*n4_1 & 1) != 0 && (*n4_1 & 0x60) == 0x20 ) /*0xffc4514d*/
      v4 |= 1 << v5; /*0xffc4514f*/
    ++v5; /*0xffc45152*/
    n4_1 += 13; /*0xffc45153*/
    --n4_2; /*0xffc45156*/
  }
  while ( n4_2 ); /*0xffc45159*/
  if ( (unsigned __int8)__return_address[257105] >= 4u && v4 ) /*0xffc4516f*/
  {
    ProcCommonFunc1C43((int)__return_address, n4, (int)buf); /*0xffc45177*/
    __return_address[257105] = 0; /*0xffc4517f*/
  }
  if ( ProcCommonFuncACEC((int)__return_address, (int)buf) ) /*0xffc45188*/
    *((_DWORD *)buf + 26) = v4; /*0xffc45194*/
  if ( v4 ) /*0xffc45199*/
    buf[108] = 1; /*0xffc4519b*/
  return 0; /*0xffc4519f*/
}

// Function: ProcMemFunc51A4 @ 0xffc451a4 (0x4bf bytes)
// Index: 588/2560

int __cdecl ProcMemFunc51A4(char *__return_address, char *n4, char *buf)
{
  unsigned int n0x10; // eax
  char n4_3; // cl
  char v6; // bp
  char *n4_2; // edx
  bool v8; // zf
  unsigned __int8 n3_2; // ch
  char n3; // dl
  char n3_1; // cl
  char *v12; // eax
  int n3_3; // ebp
  char *v14; // ecx
  int n2; // ebp
  char *v16; // eax
  int n2_1; // edx
  char *v18; // eax
  int n2_2; // ecx
  int v20; // eax
  char *n4_4; // ecx
  char v22; // dl
  int n4_5; // ebp
  int v24; // eax
  char *v25; // ebp
  char *n4_6; // ebx
  int n4_7; // ecx
  int v28; // ecx
  int v29; // eax
  char *n4_9; // edx
  char *v31; // edi
  char v32; // bp
  char v34; // [esp+10h] [ebp-30h]
  unsigned int n0x10_1; // [esp+14h] [ebp-2Ch]
  int v36; // [esp+18h] [ebp-28h]
  char _1S[6]; // [esp+1Ch] [ebp-24h] BYREF
  char _2S1L[6]; // [esp+22h] [ebp-1Eh] BYREF
  char _2S2L[6]; // [esp+28h] [ebp-18h] BYREF
  _BYTE _2S3L[9]; // [esp+2Eh] [ebp-12h] BYREF
  __int16 v41; // [esp+37h] [ebp-9h]
  char v42; // [e... [9519 chars total]

// Function: ProcCommonFunc5663 @ 0xffc45663 (0x1ce bytes)
// Index: 589/2560

unsigned __int8 __cdecl ProcCommonFunc5663(int __return_address, unsigned __int8 n4, int a3, char a4)
{
  unsigned __int8 i_1; // al
  unsigned __int8 n4_1; // dl
  int n4_2; // ecx
  int v8; // ebp
  int v9; // edi
  int v10; // esi
  unsigned int v11; // esi
  int v12; // eax
  int v13; // edi
  char v14; // al
  unsigned int v15; // esi
  int v16; // esi
  bool v17; // zf
  int v18; // eax
  unsigned __int8 i; // [esp+4h] [ebp-14h]
  int n4_3; // [esp+8h] [ebp-10h]
  int v21; // [esp+Ch] [ebp-Ch]
  char v22; // [esp+1Ch] [ebp+4h]

  i_1 = 0; /*0xffc4566b*/
  i = 0; /*0xffc4566d*/
  if ( *(_BYTE *)(__return_address + 244317) ) /*0xffc45671*/
  {
    n4_1 = n4; /*0xffc4567d*/
    n4_2 = n4; /*0xffc45682*/
    v8 = 48704 * n4; /*0xffc45685*/
    do /*0xffc45823*/
    {
      if ( *(_BYTE *)(v8 + 29 * i_1 + __return_address + 304850) ) /*0xffc456a1*/
      {
        v9 = 0; /*0xffc456b3*/
        if ( *(_BYTE *)(6 * n4_2 + a3 + 299) == 1 ) /*0xffc456c0*/
          v10 = 74 * n4_2; /*0xffc456c2*/
        else
          v10 = 37 * (i_1 + 2 * n4_2); /*0xffc456ca*/
        v11 = (*(_DWORD *)(v10 + a3 + 25) & 7) << 10; /*0xffc456da*/
        if ( *(_BYTE *)(6 * (n4_2 + 50) + a3) == 1 ) /*0xffc456e1*/
          v11 |= 0x100u; /*0xffc456e3*/
        v12 = 37 * (i_1 + 2 * n4_2); /*0xffc456f0*/
        v21 = v12; /*0xffc456f3*/
        if ( *(_DWORD *)(v12 + a3 + 33) ) /*0xffc456f7*/
        {
          if ( a4 == 1 ) /*0xffc45713*/
            v13 = *(unsigned __int16 *)(__return_address + 246756); /*0xffc45715*/
          else
            v13 = *(_DWORD *)(__return_address + 9522); /*0xffc4571e*/
          v9 = *(_DWORD *)(v12 + a3 + 29) & 7 | (8 * (*(_DWORD *)(v12 + a3 + 33) & 7)) | (16 * (v13 & 0xFFFFC)); /*0xffc4572d*/
        }
        v14 = 0; /*0xffc45733*/
        v22 = 0; /*0xffc45735*/
        n4_3 = 4; /*0xffc45739*/
        while ( 1 ) /*0xffc45750*/
        {
          v15 = (4 * (v14 & 0xF)) | v11 & 0xFFFFFFC2; /*0xffc45750*/
          j_PciCfgWrite_0(__return_address, n4_1, i, 100679888, v15); /*0xffc4575b*/
          if ( *(_DWORD *)(v21 + a3 + 33) ) /*0xffc4576b*/
            j_PciCfgWrite_0(__return_address, n4, i, 100679892, v9); /*0xffc4577e*/
          v16 = v15 | 0x40; /*0xffc45786*/
          j_PciCfgWrite_0(__return_address, n4, i, 100679888, v16); /*0xffc45795*/
          v16 |= 1u; /*0xffc4579a*/
          j_PciCfgWrite_0(__return_address, n4, i, 100679888, v16); /*0xffc457a9*/
          v11 = v16 & 0xFFFFFFFE; /*0xffc457ae*/
          j_PciCfgWrite_0(__return_address, n4, i, 100679888, v11); /*0xffc457bd*/
          v14 = v22 + 1; /*0xffc457c9*/
          v17 = n4_3-- == 1; /*0xffc457ca*/
          ++v22; /*0xffc457cf*/
          if ( v17 ) /*0xffc457d3*/
            break; /*0xffc457d3*/
          n4_1 = n4; /*0xffc45743*/
        }
        v18 = j_CpuIoWrite(__return_address, n4, i, 100679904); /*0xffc457e6*/
        j_PciCfgWrite_0(__return_address, n4, i, 100679904, v18 & 0xFFFFFFF7); /*0xffc457f3*/
        DdrTrainFn_FFC66AE8(__return_address, n4, i, 0, 0xBu, 8u); /*0xffc45801*/
        n4_2 = n4; /*0xffc45806*/
        v8 = 48704 * n4; /*0xffc4580d*/
        n4_1 = n4; /*0xffc45811*/
      }
      i_1 = i + 1; /*0xffc45817*/
      i = i_1; /*0xffc45819*/
    }
    while ( i_1 < *(_BYTE *)(__return_address + 244317) ); /*0xffc45823*/
  }
  return i_1; /*0xffc4582c*/
}

// Function: ProcCommonFunc5831 @ 0xffc45831 (0x5d bytes)
// Index: 590/2560

unsigned __int8 __cdecl ProcCommonFunc5831(int __return_address)
{
  unsigned int v1; // ecx
  unsigned int v2; // edx
  unsigned __int8 v3; // bl

  v1 = *(unsigned __int8 *)(__return_address + 1557); /*0xffc45836*/
  v2 = *(_DWORD *)(__return_address + 9518); /*0xffc4583d*/
  if ( v1 > v2 || *(_DWORD *)(__return_address + 9490) < 0x20u )
    v3 = v1 > *(_DWORD *)(__return_address + 9526) ? 0 : 2;
  else
    v3 = 1; /*0xffc45850*/
  RcAssertPrint( /*0xffc45882*/
    (_BYTE *)__return_address,
    4u,
    (int)"Option %d lowGap %x total_memSize %x lowMemSize %x  highMemBase %x highMemSize %x )\n",
    v3,
    v1,
    *(_DWORD *)(__return_address + 9490),
    v2,
    *(_DWORD *)(__return_address + 9522),
    *(_DWORD *)(__return_address + 9526));
  return v3; /*0xffc4588c*/
}

// Function: ProcCommonFunc588E @ 0xffc4588e (0x297 bytes)
// Index: 591/2560

int __cdecl ProcCommonFunc588E(_BYTE *__return_address, _BYTE *n4, int buf)
{
  unsigned __int8 n4_1; // al
  _BYTE *v4; // edx
  int *v5; // ebx
  int v6; // ecx
  int n4_2; // ebp
  int v8; // eax
  unsigned __int8 n4_3; // al
  unsigned __int8 n6; // cl
  bool v11; // zf
  unsigned int n5; // eax

  n4_1 = *(_BYTE *)(buf + 99); /*0xffc4589a*/
  __return_address[246427] = n4_1; /*0xffc4589d*/
  if ( n4_1 > 4u )
  {
    RcAssertPrint(
      __return_address,
      1u,
      (int)"\n\n %s: %u   %s ",
      "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiMain.c",
      3595,
      "( host->var.common.numCpus <= MAX_SOCKET)");
    KtiDebugAssert((int)__return_address, 220, 9); /*0xffc458cb*/
  }
  v4 = __return_address + 255719; /*0xffc458d6*/
  *((_DWORD *)__return_address + 61617) = *(_DWORD *)(buf + 100); /*0xffc458de*/
  v5 = (int *)(buf + 14); /*0xffc458e4*/
  v6 = 0; /*0xffc458e7*/
  n4_2 = 4; /*0xffc458e9*/
  do /*0xffc4591c*/
  {
    if ( ((1 << v6) & *(_DWORD *)(buf + 100)) == 0 ) /*0xffc458f2*/
    {
      __return_address[v6 + 255533] = 0; /*0xffc458f4*/
      __return_address[v6 + 255529] = 0; /*0xffc458fc*/
    }
    v8 = *v5++; /*0xffc45904*/
    *(_DWORD *)(v4 + 1) = v8; /*0xffc45909*/
    LOBYTE(v8) = *(_BYTE *)(v6 + buf + 10); /*0xffc4590c*/
    ++v6; /*0xffc45910*/
    *v4 = v8; /*0xffc45911*/
    v4 += 351; /*0xffc45913*/
    --n4_2; /*0xffc45919*/
  }
  while ( n4_2 ); /*0xffc4591c*/
  if ( __return_address[257257] != 1 ) /*0xffc45925*/
  {
    __return_address[257170] = __return_address[8297]; /*0xffc4592d*/
    __return_address[257171] = __return_address[8298]; /*0xffc45939*/
    __return_address[257174] = __return_address[8314]; /*0xffc45945*/
    __return_address[257187] = __return_address[8315]; /*0xffc45951*/
    __return_address[257188] = __return_address[8316]; /*0xffc4595d*/
    __return_address[257172] = __return_address[1561]; /*0xffc45969*/
    __return_address[257192] = __return_address[8319]; /*0xffc45975*/
    __return_address[257189] = __return_address[8317]; /*0xffc45981*/
  }
  __return_address[257190] = *(_BYTE *)(buf + 128); /*0xffc45996*/
  n4_3 = __return_address[257170]; /*0xffc4599c*/
  if ( n4_3 >= 4u || (n4[13 * n4_3] & 1) == 0 )
  {
    ProcCommonFunc940C(__return_address, 0xFFu, 0xFFu, 0xFFu, 0xEu); /*0xffc459b8*/
    RcAssertPrint(
      __return_address,
      2u,
      (int)"\n WARNING:  Legacy VGA range target not populated; assiging the range to Legacy CPU socket. ");
    __return_address[257170] = *(_BYTE *)(buf + 1); /*0xffc459d0*/
  }
  n6 = __return_address[257171]; /*0xffc459d6*/
  if ( n6 >= 6u
    || ((unsigned __int8)(1 << n6) & __return_address[(unsigned __int8)__return_address[257170] + 255497]) == 0 )
  {
    ProcCommonFunc940C(__return_address, 0xFFu, 0xFFu, 0xFFu, 0xFu); /*0xffc459fc*/
    RcAssertPrint(
      __return_address,
      2u,
      (int)"\n WARNING:  Legacy VGA range target stack not present; assiging the range to Legacy Cstack. ");
    __return_address[257171] = 0; /*0xffc45a11*/
  }
  v11 = *(_BYTE *)(buf + 99) == 1; /*0xffc45a18*/
  *(_BYTE *)(buf + 140) = 0; /*0xffc45a1c*/
  if ( !v11 || __return_address[257190] == 1 ) /*0xffc45a2c*/
    *(_BYTE *)(buf + 140) = 1; /*0xffc45a2e*/
  ProcCommonFunc5DE3((int)__return_address, (int)n4, buf); /*0xffc45a38*/
  ProcCommonFunc6154((int)__return_address, n4, buf); /*0xffc45a40*/
  if ( __return_address[246412] )
  {
    KtiDebugPrint(255, 255, 255, 220, 1, (int)__return_address); /*0xffc45a70*/
    RcAssertPrint(__return_address, 1u, (int)"\n Unknown Cpu Type"); /*0xffc45a7c*/
    RcAssertPrint(
      __return_address,
      1u,
      (int)"\n\n %s: %u   %s ",
      "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiMain.c",
      3669,
      "FALSE");
    KtiDebugAssert((int)__return_address, 220, 1); /*0xffc45aa3*/
  }
  else
  {
    ProcCommonFunc5E35((int)__return_address, (int)n4, (unsigned __int8 *)buf); /*0xffc45a54*/
  }
  ProcCommonFunc5B25(__return_address, n4, buf); /*0xffc45ab3*/
  KtiSelectFreq(__return_address, n4, buf); /*0xffc45abb*/
  __return_address[257194] = *(_BYTE *)(buf + 123); /*0xffc45ac6*/
  n5 = *(unsigned __int16 *)(__return_address + 1559); /*0xffc45acc*/
  *(_WORD *)(buf + 126) = n5; /*0xffc45ad3*/
  if ( n5 > 5 )
  {
    ProcCommonFunc940C(__return_address, 0xFFu, 0xFFu, 0xFFu, 0xAu); /*0xffc45ae2*/
    RcAssertPrint(__return_address, 2u, (int)"\n WARNING:  MMIOH size requested is invalid. Forcing it to 1GB.\n");
    *(_WORD *)(buf + 126) = 0; /*0xffc45af9*/
  }
  __return_address[257242] = 0; /*0xffc45afe*/
  ProcCommonFunc386D(__return_address); /*0xffc45b05*/
  *(_BYTE *)(buf + 214) = __return_address[8324]; /*0xffc45b11*/
  __return_address[257264] = 1; /*0xffc45b1a*/
  return 0; /*0xffc45b19*/
}

// Function: ProcCommonFunc5B25 @ 0xffc45b25 (0x2be bytes)
// Index: 592/2560

int __cdecl ProcCommonFunc5B25(_BYTE *__return_address, _BYTE *n4, int buf)
{
  unsigned __int8 n4a_1; // al
  _BYTE *n4_1; // edi
  _BYTE *v5; // esi
  bool v6; // zf
  int v7; // esi
  _BYTE *v8; // edx
  int v9; // edi
  int v10; // eax
  char v11; // ch
  unsigned __int8 v12; // cl
  _BYTE *n4_3; // esi
  unsigned int v14; // ecx
  int v15; // edi
  unsigned int v16; // esi
  int v17; // edx
  int v18; // esi
  unsigned int v19; // ecx
  char n2; // cl
  char v22; // [esp+12h] [ebp-26h]
  char v23; // [esp+13h] [ebp-25h]
  unsigned __int8 n4a; // [esp+14h] [ebp-24h]
  unsigned __int8 n4b[4]; // [esp+14h] [ebp-24h]
  int v26; // [esp+18h] [ebp-20h]
  int v27; // [esp+1Ch] [ebp-1Ch]
  int v28; // [esp+20h] [ebp-18h]
  _BYTE *v29; // [esp+24h] [ebp-14h]
  int v30; // [esp+28h] [ebp-10h]
  int v31; // [esp+2Ch] [ebp-Ch]
  int n4_2; // [esp+30h] [ebp-8h]

  n4a_1 = 0; /*0xffc45b2d*/
  n4_1 = n4; /*0xffc45b36*/
  v5 = __return_address + 257248; /*0xffc45b3a*/
  v22 = 0; /*0xffc45b40*/
  n4a = 0; /*0xffc45b45*/
  do /*0xffc45b7a*/
  {
    if ( (*n4_1 & 1) != 0 && (*n4_1 & 0x60) == 0 ) /*0xffc45b53*/
    {
      v6 = !ProcCommonFunc9160((int)__return_address, n4a); /*0xffc45b63*/
      n4a_1 = n4a; /*0xffc45b65*/
      if ( !v6 ) /*0xffc45b69*/
        *v5 = 1; /*0xffc45b6b*/
    }
    ++n4a_1; /*0xffc45b6e*/
    n4_1 += 13; /*0xffc45b70*/
    ++v5; /*0xffc45b73*/
    n4a = n4a_1; /*0xffc45b74*/
  }
  while ( n4a_1 < 4u ); /*0xffc45b7a*/
  v7 = 0; /*0xffc45b7c*/
  n4_2 = 4; /*0xffc45b7e*/
  v27 = 0; /*0xffc45b86*/
  v8 = __return_address + 255829; /*0xffc45b8a*/
  v9 = 0; /*0xffc45b90*/
  v28 = 0; /*0xffc45b92*/
  v10 = 0; /*0xffc45b96*/
  v31 = 0; /*0xffc45b98*/
  v26 = 0; /*0xffc45b9c*/
  v11 = 0; /*0xffc45ba0*/
  v29 = __return_address + 255829; /*0xffc45ba2*/
  do /*0xffc45dd3*/
  {
    v12 = 0; /*0xffc45ba6*/
    v23 = 0; /*0xffc45ba8*/
    if ( __return_address[255496] ) /*0xffc45bac*/
    {
      n4_3 = n4; /*0xffc45bb8*/
      do /*0xffc45d39*/
      {
        v30 = v12; /*0xffc45bbf*/
        *(_DWORD *)n4b = v10 + 4 * v12; /*0xffc45bc6*/
        v8 = v29; /*0xffc45bd5*/
        if ( (*(_DWORD *)&n4_3[*(_DWORD *)n4b + 1] & 1) != 0 ) /*0xffc45bd9*/
        {
          if ( (n4_3[v10] & 0x60) == 0x20 ) /*0xffc45be6*/
          {
            __return_address[((*(_DWORD *)&n4_3[*(_DWORD *)n4b + 1] >> 1) & 7) + 257244] = 1; /*0xffc45bfd*/
            RcAssertPrint(__return_address, 8u, (int)"\n  Fpga detected, switching to Per Link Freq"); /*0xffc45c05*/
            __return_address[257174] = 3; /*0xffc45c12*/
            *(_DWORD *)(v27 + 4 * v30 + buf + 148) &= 0xFFFFFFF8; /*0xffc45c23*/
            v14 = *(_DWORD *)&n4_3[*(_DWORD *)n4b + 1]; /*0xffc45c34*/
            *(_DWORD *)(buf + 18 * ((v14 >> 1) & 7) + 4 * ((v14 >> 6) & 0xF) + 148) &= 0xFFFFFFF8; /*0xffc45c46*/
            RcAssertPrint(__return_address, 8u, (int)"\n  Fpga detected, disable L1, L0p, Failover on FPGA link"); /*0xffc45c4e*/
            v15 = v28 + 4 * v30; /*0xffc45c63*/
            *(_DWORD *)&__return_address[v15 + 8418] &= 0xFFFFFFC3; /*0xffc45c68*/
            __return_address[v30 + 8430 + v28] &= 0xFCu; /*0xffc45c70*/
            v16 = *(_DWORD *)&n4_3[*(_DWORD *)n4b + 1]; /*0xffc45c80*/
            v17 = (v16 >> 1) & 7; /*0xffc45c84*/
            v18 = (v16 >> 6) & 0xF; /*0xffc45c8d*/
            *(_DWORD *)&__return_address[15 * v17 + 8418 + 4 * v18] &= 0xFFFFFFCF; /*0xffc45c93*/
            *(_DWORD *)&__return_address[15 * v17 + 8418 + 4 * v18] &= 0xFFFFFFF3; /*0xffc45c9e*/
            __return_address[15 * v17 + 8430 + v18] &= 0xFCu; /*0xffc45cb1*/
            RcAssertPrint(__return_address, 8u, (int)"\n  Fpga detected, disable CRC on FPGA link"); /*0xffc45cb5*/
            *(_DWORD *)&__return_address[v15 + 8418] &= 0xFFFFFFFC; /*0xffc45cba*/
            n4_3 = n4; /*0xffc45cc5*/
            v8 = v29; /*0xffc45ccd*/
            v9 = v31; /*0xffc45cd1*/
            v22 = 1; /*0xffc45cd5*/
            v19 = *(_DWORD *)&n4[*(_DWORD *)n4b + 1]; /*0xffc45cde*/
            *(_DWORD *)&__return_address[15 * ((v19 >> 1) & 7) + 8418 + 4 * ((v19 >> 6) & 0xF)] &= 0xFFFFFFFC; /*0xffc45cf0*/
            v12 = v23; /*0xffc45cf8*/
            *(_BYTE *)(buf + 140) = 1; /*0xffc45cfc*/
            *(v29 - 39) = 0; /*0xffc45d03*/
            *v29 = 8; /*0xffc45d07*/
            v29[39] = 8; /*0xffc45d0a*/
            v29[78] = 8; /*0xffc45d0e*/
            v29[117] = 8; /*0xffc45d12*/
            v29[156] = 8; /*0xffc45d16*/
            __return_address[v31 + 255497] |= 1u; /*0xffc45d1d*/
            *(v29 - 87) = 0; /*0xffc45d25*/
          }
          v10 = v26; /*0xffc45d29*/
        }
        v23 = ++v12; /*0xffc45d2f*/
      }
      while ( v12 < __return_address[255496] ); /*0xffc45d39*/
      v7 = v28; /*0xffc45d3f*/
      v11 = v22; /*0xffc45d43*/
    }
    if ( v11 ) /*0xffc45d49*/
    {
      *(_BYTE *)(buf + 115) = 1; /*0xffc45d4b*/
      *(_BYTE *)(buf + 141) = 1; /*0xffc45d4f*/
      __return_address[257195] = 0; /*0xffc45d56*/
      *(_BYTE *)(buf + 116) = 0; /*0xffc45d5d*/
      *(_BYTE *)(buf + 114) = 0; /*0xffc45d61*/
      n2 = __return_address[257105]; /*0xffc45d65*/
      __return_address[257196] = 0; /*0xffc45d6b*/
      if ( n2 == 1 || n2 == 2 ) /*0xffc45d7a*/
        *(_BYTE *)(buf + 123) = 1; /*0xffc45d7c*/
      if ( __return_address[257105] == 2 ) /*0xffc45d87*/
      {
        if ( __return_address[257197] == 1 ) /*0xffc45d90*/
        {
          *(_BYTE *)(buf + 135) = 0; /*0xffc45d92*/
          *(_WORD *)(buf + 117) = 0; /*0xffc45d99*/
        }
        else
        {
          *(_BYTE *)(buf + 135) = 1; /*0xffc45da1*/
          *(_BYTE *)(buf + 118) = 0; /*0xffc45da8*/
        }
      }
    }
    v27 += 18; /*0xffc45dac*/
    ++v9; /*0xffc45db1*/
    v10 += 13; /*0xffc45db2*/
    v31 = v9; /*0xffc45db5*/
    v7 += 15; /*0xffc45db9*/
    v26 = v10; /*0xffc45dbc*/
    v8 += 351; /*0xffc45dc0*/
    v28 = v7; /*0xffc45dc6*/
    v6 = n4_2-- == 1; /*0xffc45dca*/
    v29 = v8; /*0xffc45dcf*/
  }
  while ( !v6 ); /*0xffc45dd3*/
  return 0; /*0xffc45dd9*/
}

// Function: ProcCommonFunc5DE3 @ 0xffc45de3 (0x52 bytes)
// Index: 593/2560

int __cdecl ProcCommonFunc5DE3(int __return_address, int n4, int buf)
{
  char n2; // al

  n2 = *(_BYTE *)(__return_address + 257105); /*0xffc45deb*/
  if ( n2 && n2 != 2 ) /*0xffc45df7*/
    *(_BYTE *)(__return_address + 257172) = 0; /*0xffc45df9*/
  if ( *(_BYTE *)(buf + 128) == 1 ) /*0xffc45e0a*/
    *(_BYTE *)(__return_address + 257172) = 0; /*0xffc45e0c*/
  if ( j_CpuIoWrite(__return_address, *(_BYTE *)(buf + 1), 0, 318914748) < 0 ) /*0xffc45e28*/
    *(_BYTE *)(__return_address + 257172) = 0; /*0xffc45e2a*/
  return 0; /*0xffc45e30*/
}

// Function: ProcCommonFunc5E35 @ 0xffc45e35 (0x31f bytes)
// Index: 594/2560

int __cdecl ProcCommonFunc5E35(int __return_address, int n4, unsigned __int8 *buf)
{
  char n2; // al
  unsigned __int8 v4; // al
  unsigned __int8 n2_1; // al
  bool v6; // zf
  unsigned __int8 n2_2; // al
  unsigned __int8 n4_1; // al
  bool v9; // cc
  unsigned __int8 n4_2; // al
  bool v11; // cc
  unsigned __int8 n2_3; // al
  unsigned __int8 n2_4; // al
  unsigned __int8 n2_5; // al
  char n2_6; // al
  char v16; // cl
  char v17; // al

  n2 = *(_BYTE *)(__return_address + 8306); /*0xffc45e41*/
  if ( n2 == 2 ) /*0xffc45e4c*/
    *(_BYTE *)(__return_address + 257243) = *(_BYTE *)(__return_address + 246412) /*0xffc45e67*/
                                         || *(_BYTE *)(__return_address + 246424) >= 9u;
  else
    *(_BYTE *)(__return_address + 257243) = n2; /*0xffc45e6f*/
  if ( *(_BYTE *)(__return_address + 257105) ) /*0xffc45e79*/
  {
    v4 = *(_BYTE *)(__return_address + 8305); /*0xffc45e81*/
    buf[115] = v4; /*0xffc45e87*/
    buf[114] = v4 == 1; /*0xffc45e8e*/
  }
  else
  {
    *((_WORD *)buf + 57) = 0; /*0xffc45e98*/
  }
  n2_1 = *(_BYTE *)(__return_address + 8409); /*0xffc45e9c*/
  if ( n2_1 < 2u ) /*0xffc45ea4*/
    buf[114] = n2_1; /*0xffc45ea6*/
  if ( buf[115] ) /*0xffc45ea9*/
    *(_BYTE *)(__return_address + 257196) = *(_BYTE *)(__return_address + 8303); /*0xffc45ebc*/
  else
    *(_BYTE *)(__return_address + 257196) = 0; /*0xffc45eae*/
  if ( buf[115] == 1 ) /*0xffc45ec5*/
  {
    v6 = *(_BYTE *)(__return_address + 8415) == 0; /*0xffc45ec7*/
    *(_BYTE *)(__return_address + 257195) = 1; /*0xffc45ecd*/
    buf[117] = !v6; /*0xffc45ed6*/
    buf[118] = *(_BYTE *)(__return_address + 8416) != 0; /*0xffc45ee2*/
  }
  else
  {
    *(_BYTE *)(__return_address + 257195) = 0; /*0xffc45ee7*/
    *(_WORD *)(buf + 117) = 0; /*0xffc45eed*/
  }
  buf[135] = 2; /*0xffc45ef1*/
  if ( *(_BYTE *)(__return_address + 257105) == 2 ) /*0xffc45efd*/
  {
    n2_2 = *(_BYTE *)(__return_address + 8412); /*0xffc45eff*/
    if ( n2_2 < 2u ) /*0xffc45f07*/
      buf[135] = n2_2; /*0xffc45f09*/
  }
  if ( !*(_BYTE *)(__return_address + 257105) ) /*0xffc45f0f*/
    buf[117] = 1; /*0xffc45f17*/
  if ( *(_BYTE *)(__return_address + 257105) == 3 /*0xffc45f32*/
    && !*(_BYTE *)(__return_address + 246412)
    && *(_BYTE *)(__return_address + 246424) < 3u )
  {
    buf[117] = 0; /*0xffc45f34*/
  }
  n4_1 = *(_BYTE *)(__return_address + 257105); /*0xffc45f37*/
  v9 = n4_1 <= 4u; /*0xffc45f3d*/
  if ( n4_1 == 4 ) /*0xffc45f3f*/
  {
    if ( buf[122] ) /*0xffc45f41*/
      goto LABEL_33; /*0xffc45f44*/
    v9 = 1; /*0xffc45f46*/
  }
  if ( v9 ) /*0xffc45f48*/
    goto LABEL_35; /*0xffc45f48*/
LABEL_33:
  if ( *(_BYTE *)(__return_address + 246412) || *(_BYTE *)(__return_address + 246424) >= 3u ) /*0xffc45f59*/
  {
LABEL_35:
    if ( buf[135] ) /*0xffc45f5b*/
      goto LABEL_37; /*0xffc45f61*/
  }
  buf[117] = 0; /*0xffc45f63*/
LABEL_37:
  buf[116] = 0; /*0xffc45f66*/
  n4_2 = *(_BYTE *)(__return_address + 257105); /*0xffc45f69*/
  v11 = n4_2 <= 4u; /*0xffc45f6f*/
  if ( n4_2 == 4 ) /*0xffc45f71*/
  {
    if ( buf[122] ) /*0xffc45f73*/
    {
LABEL_41:
      buf[116] = 1; /*0xffc45f7c*/
      goto LABEL_42; /*0xffc45f7c*/
    }
    v11 = 1; /*0xffc45f78*/
  }
  if ( !v11 ) /*0xffc45f7a*/
    goto LABEL_41; /*0xffc45f7a*/
LABEL_42:
  if ( !*(_BYTE *)(__return_address + 246412) && *(_BYTE *)(__return_address + 246424) < 3u ) /*0xffc45f8e*/
    buf[116] = 0; /*0xffc45f90*/
  n2_3 = *(_BYTE *)(__return_address + 8405); /*0xffc45f93*/
  if ( n2_3 < 2u ) /*0xffc45f9b*/
    buf[116] = n2_3; /*0xffc45f9d*/
  v6 = *(_BYTE *)(__return_address + 257105) == 5; /*0xffc45fa0*/
  *(_BYTE *)(__return_address + 257193) = 0; /*0xffc45fa7*/
  if ( v6 ) /*0xffc45fad*/
    *(_BYTE *)(__return_address + 257193) = 1; /*0xffc45faf*/
  n2_4 = *(_BYTE *)(__return_address + 8406); /*0xffc45fb5*/
  if ( n2_4 < 2u ) /*0xffc45fbd*/
    *(_BYTE *)(__return_address + 257195) = n2_4; /*0xffc45fbf*/
  n2_5 = *(_BYTE *)(__return_address + 8414); /*0xffc45fc5*/
  if ( n2_5 < 2u ) /*0xffc45fcd*/
    *(_BYTE *)(__return_address + 257193) = n2_5; /*0xffc45fcf*/
  if ( *(_BYTE *)(__return_address + 257193) == 1 ) /*0xffc45fdb*/
    buf[118] = 0; /*0xffc45fdd*/
  n2_6 = *(_BYTE *)(__return_address + 8302); /*0xffc45fe0*/
  if ( n2_6 == 2 ) /*0xffc45fe8*/
    *(_BYTE *)(__return_address + 257197) = 0; /*0xffc45fea*/
  else
    *(_BYTE *)(__return_address + 257197) = n2_6; /*0xffc45ff2*/
  v16 = *(_BYTE *)(__return_address + 257197); /*0xffc45ff8*/
  if ( v16 == 1 )
  {
    if ( (*(_DWORD *)(__return_address + 130) & 0x4000) != 0 ) /*0xffc46015*/
    {
      if ( (*(_DWORD *)(__return_address + 1524) & 0x3FFFFFFF) != 0 ) /*0xffc4601d*/
        goto LABEL_64; /*0xffc4601d*/
      if ( buf[135] != 1 ) /*0xffc46025*/
      {
        v17 = *(_BYTE *)(__return_address + 257243) | *(_BYTE *)(__return_address + 8307) | 1; /*0xffc46033*/
LABEL_86:
        *(_BYTE *)(__return_address + 257255) = v17; /*0xffc46149*/
        goto LABEL_67; /*0xffc4614f*/
      }
    }
    if ( (*(_DWORD *)(__return_address + 1524) & 0x3FFFFFFF) == 0 ) /*0xffc46040*/
    {
LABEL_65:
      *(_BYTE *)(__return_address + 257197) = 0; /*0xffc46055*/
      goto LABEL_66; /*0xffc46055*/
    }
LABEL_64:
    RcAssertPrint(
      (_BYTE *)__return_address,
      2u,
      (int)"\n WARNING:  MMCFG Base is not aligned on 1G boundary. Forcing SNC to disabled.\n");
    goto LABEL_65; /*0xffc4604a*/
  }
  if ( (*(_DWORD *)(__return_address + 130) & 0x4000) != 0 /*0xffc46135*/
    && (*(_DWORD *)(__return_address + 1524) & 0x3FFFFFFF) == 0
    && buf[135] != 1 )
  {
    v17 = *(_BYTE *)(__return_address + 257243) | v16 | *(_BYTE *)(__return_address + 8307); /*0xffc46143*/
    goto LABEL_86; /*0xffc46143*/
  }
LABEL_66:
  *(_BYTE *)(__return_address + 257255) = 0; /*0xffc4605b*/
LABEL_67:
  if ( buf[buf[1] + 10] < 0xCu && *(_BYTE *)(__return_address + 257197) == 1 ) /*0xffc46072*/
  {
    *(_BYTE *)(__return_address + 257197) = 0; /*0xffc46074*/
    *(_BYTE *)(__return_address + 257255) = 0; /*0xffc4607a*/
  }
  RcAssertPrint( /*0xffc46090*/
    (_BYTE *)__return_address,
    4u,
    (int)"\n   OutSncPrefetchEn=%x\n",
    *(unsigned __int8 *)(__return_address + 257255));
  if ( (j_CpuIoWrite(__return_address, buf[1], 0, 318914748) & 0x40000000) != 0 ) /*0xffc460ae*/
  {
    *(_BYTE *)(__return_address + 257197) = 0; /*0xffc460b0*/
    *(_BYTE *)(__return_address + 257255) = 0; /*0xffc460b6*/
  }
  if ( !*(_BYTE *)(__return_address + 246412) /*0xffc460e5*/
    && *(_BYTE *)(__return_address + 246424) < 3u
    && *(_BYTE *)(__return_address + 257105)
    && (*(_BYTE *)(__return_address + 257243) == 1 || *(_BYTE *)(__return_address + 8307) == 1) )
  {
    *(_WORD *)(buf + 117) = 0; /*0xffc460e7*/
  }
  if ( buf[135] == 1 && *(_BYTE *)(__return_address + 257105) == 2 ) /*0xffc460fb*/
    buf[118] = 0; /*0xffc460fd*/
  *(_BYTE *)(__return_address + 257256) = buf[118]; /*0xffc46104*/
  return 0; /*0xffc46103*/
}

// Function: ProcCommonFunc6154 @ 0xffc46154 (0x125 bytes)
// Index: 595/2560

int __cdecl ProcCommonFunc6154(int __return_address, _BYTE *n4, int buf)
{
  _BYTE *n4_1; // ebp
  char v4; // dh
  unsigned __int8 n4a_1; // dl
  int v6; // esi
  _BYTE *v7; // ebx
  int buf_1; // ecx
  _BYTE *v9; // ebp
  unsigned __int8 n4_2; // dl
  int v11; // ecx
  char v13; // [esp+12h] [ebp-Ah]
  unsigned __int8 n4_3; // [esp+13h] [ebp-9h]
  unsigned __int8 n4a; // [esp+14h] [ebp-8h]
  int v16; // [esp+18h] [ebp-4h]

  n4_1 = n4; /*0xffc46159*/
  v4 = 0; /*0xffc4615d*/
  n4a_1 = 0; /*0xffc46165*/
  v13 = 0; /*0xffc46167*/
  v6 = 0; /*0xffc4616b*/
  n4a = 0; /*0xffc4616d*/
  v7 = (_BYTE *)(__return_address + 255742); /*0xffc46171*/
  do
  {
    buf_1 = buf; /*0xffc4617e*/
    if ( ((1 << v6) & *(_DWORD *)(buf + 100)) != 0 )
    {
      *(_BYTE *)(v6 + __return_address + 255497) |= 1u; /*0xffc4618b*/
      v9 = v7 + 48; /*0xffc46193*/
      n4_2 = 0; /*0xffc46196*/
      *v7 = 0; /*0xffc46198*/
      v11 = 0; /*0xffc4619b*/
      n4_3 = 0; /*0xffc4619d*/
      v16 = 0; /*0xffc461a1*/
      do
      {
        if ( ((unsigned __int8)(1 << v11) & *(_BYTE *)(v6 + __return_address + 255497)) != 0 )
        {
          if ( n4_2 >= 4u ) /*0xffc461b6*/
          {
            if ( ProcCommonFunc9160(__return_address, n4a) ) /*0xffc461c7*/
              *v9 = 3; /*0xffc461d3*/
            else
              *v9 = !ProcCommonFunc9118(__return_address, n4a) + 1; /*0xffc461ec*/
            v11 = v16; /*0xffc461ef*/
            v4 = v13; /*0xffc461f3*/
            n4_2 = n4_3; /*0xffc461f7*/
          }
          else
          {
            *v9 = 1; /*0xffc461b8*/
          }
          ++v4; /*0xffc461fb*/
          ++*v7; /*0xffc461fd*/
          v13 = v4; /*0xffc461ff*/
        }
        else
        {
          *v9 = n4_2 < 4u ? 0 : 8;
        }
        ++n4_2; /*0xffc46212*/
        v9 += 39; /*0xffc46214*/
        ++v11; /*0xffc46217*/
        n4_3 = n4_2; /*0xffc46218*/
        v16 = v11; /*0xffc4621c*/
      }
      while ( n4_2 < 6u );
      n4a_1 = n4a; /*0xffc46225*/
      buf_1 = buf; /*0xffc46229*/
      n4_1 = n4; /*0xffc4622d*/
    }
    if ( (*n4_1 & 0x60) == 0x20 ) /*0xffc46238*/
    {
      *(_BYTE *)(v6 + __return_address + 255497) |= 1u; /*0xffc4623a*/
      v7[47] = *(_BYTE *)(v6 + __return_address + 255497); /*0xffc46249*/
      *v7 = 1; /*0xffc4624c*/
    }
    ++n4a_1; /*0xffc4624f*/
    n4_1 += 13; /*0xffc46251*/
    ++v6; /*0xffc46254*/
    n4a = n4a_1; /*0xffc46255*/
    v7 += 351; /*0xffc46259*/
    n4 = n4_1; /*0xffc4625f*/
  }
  while ( n4a_1 < 4u );
  *(_BYTE *)(buf_1 + 50) = v4; /*0xffc4626f*/
  return 0; /*0xffc4626c*/
}

// Function: ProcCommonFunc6279 @ 0xffc46279 (0x1e4 bytes)
// Index: 596/2560

int __cdecl ProcCommonFunc6279(_BYTE *__return_address, unsigned __int8 n4, char a3)
{
  unsigned __int8 v4; // bl
  int n510; // esi
  int n63; // ebp
  int v7; // ebp
  int v8; // eax
  int v9; // eax
  int v10; // ecx
  int v11; // eax
  int v12; // eax
  int n4_1; // ebx
  char n6; // dl
  int v15; // ecx
  int result; // eax
  int v17; // eax
  int v18; // eax
  int v19; // [esp+14h] [ebp-4h]
  int v20; // [esp+1Ch] [ebp+4h]
  char v21; // [esp+24h] [ebp+Ch]
  char n6_1; // [esp+24h] [ebp+Ch]

  RcAssertPrint(__return_address, 4u, (int)"\nConfigure  Socket %d 2LM Hash ", n4); /*0xffc46297*/
  v4 = 0; /*0xffc4629f*/
  if ( a3 == 1 ) /*0xffc462a6*/
  {
    RcAssertPrint(__return_address, 4u, (int)"-Enabled\n"); /*0xffc462b0*/
    n510 = 510; /*0xffc462b8*/
    n63 = 63; /*0xffc462bf*/
  }
  else
  {
    RcAssertPrint(__return_address, 4u, (int)"-Disabled\n"); /*0xffc462ca*/
    n63 = 0; /*0xffc462d2*/
    n510 = 0; /*0xffc462d4*/
  }
  v7 = n63 << 16; /*0xffc462e0*/
  v8 = j_CpuIoWrite((int)__return_address, n4, 0, 50545712); /*0xffc462e4*/
  j_PciCfgWrite_0((int)__return_address, n4, 0, 50545712, v7 | v8 & 0xFFC0FFFF); /*0xffc462fc*/
  v20 = n510 << 20; /*0xffc4630f*/
  v9 = j_CpuIoWrite((int)__return_address, n4, 0, 50545716); /*0xffc46313*/
  j_PciCfgWrite_0((int)__return_address, n4, 0, 50545716, (n510 << 20) | v9 & 0xE00FFFFF); /*0xffc4632b*/
  v21 = 0; /*0xffc46333*/
  if ( __return_address[255496] ) /*0xffc46337*/
  {
    v10 = 351 * n4; /*0xffc46343*/
    do /*0xffc463c8*/
    {
      if ( (__return_address[4 * v4 + 255705 + v10] & 1) != 0 ) /*0xffc4635d*/
      {
        v11 = j_CpuIoWrite((int)__return_address, n4, v21, 151011716); /*0xffc4636e*/
        j_PciCfgWrite_0((int)__return_address, n4, v21, 151011716, v7 | v11 & 0xFFC0FFFF); /*0xffc46386*/
        v12 = j_CpuIoWrite((int)__return_address, n4, v21, 151011720); /*0xffc46396*/
        j_PciCfgWrite_0((int)__return_address, n4, v21, 151011720, v20 | v12 & 0xE00FFFFF); /*0xffc463b0*/
        v10 = 351 * n4; /*0xffc463b5*/
      }
      v21 = ++v4; /*0xffc463be*/
    }
    while ( v4 < __return_address[255496] ); /*0xffc463c8*/
  }
  n4_1 = n4; /*0xffc463ca*/
  n6 = 1; /*0xffc463d0*/
  v15 = 1; /*0xffc463d2*/
  n6_1 = 1; /*0xffc463d3*/
  v19 = 1; /*0xffc463d7*/
  do /*0xffc46454*/
  {
    result = 1 << v15; /*0xffc463de*/
    if ( ((unsigned __int8)(1 << v15) & __return_address[n4_1 + 255497]) != 0 ) /*0xffc463e7*/
    {
      v17 = j_CpuIoWrite((int)__return_address, n4, n6_1, 285230128); /*0xffc463f9*/
      j_PciCfgWrite_0((int)__return_address, n4, n6_1, 285230128, v7 | v17 & 0xFFC0FFFF); /*0xffc4640e*/
      v18 = j_CpuIoWrite((int)__return_address, n4, n6_1, 285230132); /*0xffc4641b*/
      result = j_PciCfgWrite_0((int)__return_address, n4, n6_1, 285230132, v20 | v18 & 0xE00FFFFF); /*0xffc46432*/
      n6 = n6_1; /*0xffc46437*/
      v15 = v19; /*0xffc4643e*/
      n4_1 = n4; /*0xffc46442*/
    }
    ++n6; /*0xffc46446*/
    ++v15; /*0xffc46448*/
    n6_1 = n6; /*0xffc46449*/
    v19 = v15; /*0xffc4644d*/
  }
  while ( (unsigned __int8)n6 < 6u ); /*0xffc46454*/
  return result; /*0xffc46456*/
}

// Function: ProcCommonFunc645D @ 0xffc4645d (0x1e6 bytes)
// Index: 597/2560

int __cdecl ProcCommonFunc645D(_BYTE *__return_address, _BYTE *n4, int buf, unsigned __int8 n4a)
{
  unsigned __int8 n4a_1; // dl
  unsigned int n0x20; // ebx
  int v6; // ecx
  _BYTE *v7; // esi
  _BYTE *n4_1; // eax
  unsigned __int8 n6; // dh
  int v10; // ebp
  unsigned int v11; // esi
  unsigned int v12; // eax
  unsigned int i_1; // eax
  int v14; // esi
  int v15; // edx
  int n4_3; // ebx
  int v17; // esi
  unsigned __int8 n6_1; // [esp+12h] [ebp-32h]
  unsigned __int8 n4a_2; // [esp+13h] [ebp-31h]
  _BYTE *v21; // [esp+14h] [ebp-30h]
  int v22; // [esp+18h] [ebp-2Ch]
  unsigned int i; // [esp+1Ch] [ebp-28h]
  _BYTE *n4_2; // [esp+20h] [ebp-24h]
  int v25[4]; // [esp+24h] [ebp-20h] BYREF
  int v26[4]; // [esp+34h] [ebp-10h]

  n4a_1 = 0; /*0xffc4646c*/
  memset(v25, 136, sizeof(v25)); /*0xffc4646e*/
  LOBYTE(n0x20) = 0; /*0xffc46472*/
  v6 = 0; /*0xffc4647c*/
  v7 = __return_address + 255497; /*0xffc46482*/
  n4_1 = n4; /*0xffc46488*/
  v26[0] = 50413780; /*0xffc4648c*/
  v26[1] = 50413784; /*0xffc46494*/
  v26[2] = 50413788; /*0xffc4649c*/
  v26[3] = 50413792; /*0xffc464a4*/
  n4a_2 = 0; /*0xffc464ac*/
  v22 = 0; /*0xffc464b0*/
  v21 = __return_address + 255497; /*0xffc464b4*/
  n4_2 = n4; /*0xffc464b8*/
  do
  {
    if ( (*n4_1 & 1) != 0 )
    {
      n6 = 0; /*0xffc464c6*/
      v10 = 0; /*0xffc464c8*/
      n6_1 = 0; /*0xffc464ca*/
      do
      {
        if ( ((unsigned __int8)(1 << v10) & *v7) != 0 )
        {
          v11 = *(_DWORD *)&__return_address[39 * v10 + 255797 + 39 * v22]; /*0xffc464e6*/
          v12 = *(_DWORD *)&__return_address[39 * v10 + 255801 + 39 * v22]; /*0xffc464f6*/
          if ( v11 >= v12 )
          {
            if ( (unsigned __int8)n0x20 >= 0x20u )
            {
              RcAssertPrint(
                __return_address,
                1u,
                (int)"\nERR_SW_CHECK: 0x%X!!!!  TargetIndex: 0x%X is greater or equal to MAX_SAD_TARGETS: 0x%X\n",
                82,
                (unsigned __int8)n0x20,
                32);
              RcAssertPrint(
                __return_address,
                1u,
                (int)"\n\n %s: %u   %s ",
                "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiMain.c",
                5048,
                "FALSE");
              KtiDebugAssert((int)__return_address, 223, 82); /*0xffc465b0*/
              n6 = n6_1; /*0xffc465b5*/
            }
            LOBYTE(n0x20) = n0x20 + 1; /*0xffc465bc*/
          }
          else
          {
            n0x20 = (v11 + 20971520) >> 15; /*0xffc46505*/
            i_1 = (v12 - v11 + 1) >> 15; /*0xffc46509*/
            for ( i = i_1; (unsigned __int8)n0x20 < 0x20u; i = i_1 ) /*0xffc46513*/
            {
              if ( !(_BYTE)i_1 ) /*0xffc4651b*/
                break; /*0xffc4651b*/
              if ( n4a_1 == n4a ) /*0xffc46525*/
                n4a_1 = n6 | 8; /*0xffc46529*/
              v14 = (unsigned __int8)n0x20 >> 3; /*0xffc46540*/
              v15 = v25[v14] & ~(15 << (4 * n0x20)) | (n4a_1 << (4 * (n0x20 & 7))); /*0xffc46551*/
              i_1 = i; /*0xffc46553*/
              LOBYTE(n0x20) = n0x20 + 1; /*0xffc46557*/
              v25[v14] = v15; /*0xffc46559*/
              n4a_1 = n4a_2; /*0xffc4655d*/
              LOBYTE(i_1) = i - 1; /*0xffc46561*/
              n6 = n6_1; /*0xffc46563*/
            }
          }
          v7 = v21; /*0xffc465be*/
        }
        n4a_1 = n4a_2; /*0xffc465c2*/
        ++n6; /*0xffc465c6*/
        ++v10; /*0xffc465c8*/
        n6_1 = n6; /*0xffc465c9*/
      }
      while ( n6 < 6u );
      n4_1 = n4_2; /*0xffc465d6*/
      v6 = v22; /*0xffc465da*/
    }
    ++n4a_1; /*0xffc465de*/
    n4_1 += 13; /*0xffc465e0*/
    ++v7; /*0xffc465e3*/
    n4a_2 = n4a_1; /*0xffc465e4*/
    v6 += 9; /*0xffc465e8*/
    n4_2 = n4_1; /*0xffc465eb*/
    v21 = v7; /*0xffc465ef*/
    v22 = v6; /*0xffc465f3*/
  }
  while ( n4a_1 < 4u );
  n4_3 = 4; /*0xffc46602*/
  v17 = 0; /*0xffc46603*/
  do /*0xffc46623*/
  {
    j_PciCfgWrite_0((int)__return_address, n4a, 0, v26[v17], v25[v17]); /*0xffc46615*/
    ++v17; /*0xffc4661d*/
    --n4_3; /*0xffc46620*/
  }
  while ( n4_3 ); /*0xffc46623*/
  ProcCommonFunc6643((int)__return_address, n4, buf, n4a); /*0xffc46632*/
  return 0; /*0xffc4663c*/
}

// Function: ProcCommonFunc6643 @ 0xffc46643 (0x14f bytes)
// Index: 598/2560

int __cdecl ProcCommonFunc6643(int __return_address, _BYTE *n4, int buf, unsigned __int8 n4a)
{
  int n4a_1; // edx
  unsigned __int8 n3; // bl
  int v7; // edi
  int v8; // ebp
  int v9; // ebp
  int v10; // ebp
  char v11; // cl
  unsigned __int8 v12; // bl
  int v13; // edi
  int v15; // [esp+14h] [ebp-18h]
  int v16; // [esp+18h] [ebp-14h]
  int n6; // [esp+1Ch] [ebp-10h]
  int v18; // [esp+24h] [ebp-8h]
  int v19; // [esp+28h] [ebp-4h]
  unsigned __int8 v20; // [esp+30h] [ebp+4h]

  n4a_1 = n4a; /*0xffc4664a*/
  n3 = 0; /*0xffc46655*/
  v19 = 0; /*0xffc4665d*/
  v7 = 0; /*0xffc46661*/
  v15 = 0; /*0xffc46663*/
  v8 = *(unsigned __int8 *)(n4a + __return_address + 255497); /*0xffc46667*/
  v16 = v8; /*0xffc46680*/
  v18 = (*(_DWORD *)(351 * n4a + __return_address + 255749) >> 15) & 0x1F; /*0xffc46684*/
  n6 = 6; /*0xffc46688*/
  do /*0xffc4670e*/
  {
    if ( ((1 << v7) & v8) != 0 ) /*0xffc46699*/
    {
      v9 = v7 + 9 * n4a_1; /*0xffc4669e*/
      if ( *(_DWORD *)(39 * v9 + __return_address + 255797) != -1 ) /*0xffc466ab*/
      {
        v15 |= v7 << (3 * n3); /*0xffc466bd*/
        v10 = (*(_DWORD *)(39 * (v9 + 6559) + __return_address) >> 15) & 0x1F; /*0xffc466db*/
        if ( n3 >= 3u ) /*0xffc466e8*/
          v11 = 8 * n3 - 24; /*0xffc466f3*/
        else
          v11 = 8 * n3 + 8; /*0xffc466ea*/
        n4a_1 = n4a; /*0xffc466fa*/
        *(&v18 + n3 / 3u) |= v10 << v11; /*0xffc46700*/
        ++n3; /*0xffc46702*/
      }
      v8 = v16; /*0xffc46704*/
    }
    ++v7; /*0xffc46708*/
    --n6; /*0xffc46709*/
  }
  while ( n6 ); /*0xffc4670e*/
  v12 = 0; /*0xffc46710*/
  v20 = 0; /*0xffc46712*/
  if ( *(_BYTE *)(__return_address + 255496) ) /*0xffc46716*/
  {
    v13 = 13 * n4a_1; /*0xffc46722*/
    do /*0xffc46786*/
    {
      if ( (n4[4 * v12 + 1 + v13] & 1) != 0 ) /*0xffc46730*/
      {
        j_PciCfgWrite_0(__return_address, n4a, v20, 151011692, v15); /*0xffc46744*/
        j_PciCfgWrite_0(__return_address, n4a, v20, 151011696, v18); /*0xffc4675b*/
        j_PciCfgWrite_0(__return_address, n4a, v20, 151011700, v19); /*0xffc46772*/
      }
      v20 = ++v12; /*0xffc4677c*/
    }
    while ( v12 < *(_BYTE *)(__return_address + 255496) ); /*0xffc46786*/
  }
  return 0; /*0xffc46788*/
}

// Function: ProcCommonFunc6792 @ 0xffc46792 (0x199 bytes)
// Index: 599/2560

int __cdecl ProcCommonFunc6792(_BYTE *__return_address, _BYTE *n4, int buf, unsigned __int8 n4a)
{
  unsigned __int8 n4a_1; // bl
  int v5; // edx
  unsigned __int8 *v6; // ecx
  _BYTE *n4_1; // eax
  int v8; // esi
  unsigned __int8 n6; // bh
  int v10; // ebp
  int v11; // eax
  int v12; // ecx
  int v13; // eax
  int v14; // eax
  __int16 n0x20; // cx
  int v16; // eax
  unsigned __int8 v17; // dl
  int v18; // esi
  int v19; // edx
  int n4_3; // ebx
  int v21; // esi
  __int16 n0x20_1; // [esp+12h] [ebp-36h]
  int v24; // [esp+14h] [ebp-34h]
  int v25; // [esp+18h] [ebp-30h]
  _BYTE *n4_2; // [esp+1Ch] [ebp-2Ch]
  unsigned __int8 *v27; // [esp+20h] [ebp-28h]
  int v28; // [esp+24h] [ebp-24h]
  int v29[4]; // [esp+28h] [ebp-20h] BYREF
  int v30[4]; // [esp+38h] [ebp-10h]

  n4a_1 = 0; /*0xffc467a1*/
  memset(v29, 136, sizeof(v29)); /*0xffc467a3*/
  v5 = 0; /*0xffc467ab*/
  v6 = __return_address + 255497; /*0xffc467b5*/
  n4_1 = n4; /*0xffc467bb*/
  v30[0] = 50348720; /*0xffc467bf*/
  v30[1] = 50348724; /*0xffc467c7*/
  v30[2] = 50348728; /*0xffc467cf*/
  v30[3] = 50348732; /*0xffc467d7*/
  v24 = 0; /*0xffc467df*/
  v27 = __return_address + 255497; /*0xffc467e3*/
  n4_2 = n4; /*0xffc467e7*/
  do
  {
    if ( (*n4_1 & 1) != 0 )
    {
      v8 = *v6; /*0xffc467f5*/
      n6 = 0; /*0xffc467f8*/
      v28 = v8; /*0xffc467fa*/
      v10 = 0; /*0xffc467fe*/
      do
      {
        if ( ((1 << v10) & v8) != 0 )
        {
          v11 = 39 * (v5 + v10); /*0xffc46812*/
          v12 = *(unsigned __int16 *)&__return_address[v11 + 255793]; /*0xffc46815*/
          v13 = *(unsigned __int16 *)&__return_address[v11 + 255795]; /*0xffc4681d*/
          if ( (unsigned __int16)v12 < (unsigned __int16)v13 )
          {
            v14 = v13 - v12 + 1; /*0xffc46837*/
            n0x20_1 = (unsigned __int16)v12 >> 11; /*0xffc46838*/
            n0x20 = (unsigned __int16)v12 >> 11; /*0xffc4683d*/
            v16 = v14 / 2048; /*0xffc46849*/
            v25 = v16; /*0xffc4684c*/
            if ( (unsigned __int8)n0x20 < 0x20u )
            {
              do
              {
                if ( !(_BYTE)v16 ) /*0xffc46857*/
                  break; /*0xffc46857*/
                v17 = n4a_1 == n4a ? n6 | 8 : n4a_1;
                v18 = (unsigned __int8)n0x20 >> 3; /*0xffc4687f*/
                HIBYTE(n0x20) = HIBYTE(n0x20_1); /*0xffc46887*/
                v19 = v29[v18] & ~(15 << (4 * n0x20)) | (v17 << (4 * (n0x20 & 7))); /*0xffc46892*/
                v16 = v25; /*0xffc46894*/
                LOBYTE(n0x20) = n0x20_1 + 1; /*0xffc46898*/
                v29[v18] = v19; /*0xffc4689a*/
                LOBYTE(v16) = v25 - 1; /*0xffc4689e*/
                n0x20_1 = n0x20; /*0xffc468a0*/
                v25 = v16; /*0xffc468a5*/
              }
              while ( (unsigned __int8)n0x20 < 0x20u );
              v8 = v28; /*0xffc468ae*/
            }
            v5 = v24; /*0xffc468b2*/
          }
        }
        ++n6; /*0xffc468b6*/
        ++v10; /*0xffc468b8*/
      }
      while ( n6 < 6u );
      n4_1 = n4_2; /*0xffc468c2*/
      v6 = v27; /*0xffc468c6*/
    }
    n4_1 += 13; /*0xffc468ca*/
    ++n4a_1; /*0xffc468cd*/
    ++v6; /*0xffc468cf*/
    n4_2 = n4_1; /*0xffc468d0*/
    v5 += 9; /*0xffc468d4*/
    v27 = v6; /*0xffc468d7*/
    v24 = v5; /*0xffc468db*/
  }
  while ( n4a_1 < 4u );
  n4_3 = 4; /*0xffc468ea*/
  v21 = 0; /*0xffc468eb*/
  do /*0xffc4690b*/
  {
    j_PciCfgWrite_0((int)__return_address, n4a, 0, v30[v21], v29[v21]); /*0xffc468fd*/
    ++v21; /*0xffc46905*/
    --n4_3; /*0xffc46908*/
  }
  while ( n4_3 ); /*0xffc4690b*/
  ProcCommonFunc692B(__return_address, n4, buf, n4a); /*0xffc4691a*/
  return 0; /*0xffc46924*/
}

// Function: ProcCommonFunc692B @ 0xffc4692b (0x1ae bytes)
// Index: 600/2560

int __cdecl ProcCommonFunc692B(_BYTE *__return_address, _BYTE *n4, int buf, unsigned __int8 n4a)
{
  unsigned __int8 n3; // dl
  int v6; // edi
  int n6; // ebx
  char v8; // cl
  unsigned __int8 n4a_1; // cl
  unsigned int v10; // edi
  _BYTE *n4_1; // edx
  char v13; // [esp+13h] [ebp-19h]
  int v14; // [esp+14h] [ebp-18h]
  int v15; // [esp+1Ch] [ebp-10h]
  unsigned __int16 v16; // [esp+1Ch] [ebp-10h]
  int v17; // [esp+20h] [ebp-Ch]
  int v18; // [esp+24h] [ebp-8h]
  int v19; // [esp+28h] [ebp-4h]
  unsigned __int8 n6_1; // [esp+30h] [ebp+4h]

  n3 = 0; /*0xffc4693f*/
  v19 = 0; /*0xffc46949*/
  v6 = 0; /*0xffc4694d*/
  v14 = 0; /*0xffc4694f*/
  v13 = 0; /*0xffc46953*/
  v18 = *(unsigned __int16 *)&__return_address[351 * n4a + 255745] >> 10; /*0xffc46962*/
  v17 = (unsigned __int8)__return_address[n4a + 255497]; /*0xffc4696e*/
  n6 = 6; /*0xffc46972*/
  do /*0xffc46a11*/
  {
    if ( ((1 << v6) & v17) != 0 ) /*0xffc46986*/
    {
      v15 = 39 * (v6 + 9 * n4a); /*0xffc46999*/
      if ( *(_WORD *)&__return_address[v15 + 255793] != 0xFFFF ) /*0xffc469a5*/
      {
        v14 |= v6 << (3 * n3); /*0xffc469b5*/
        v16 = *(_WORD *)&__return_address[v15 + 255795] >> 10; /*0xffc469d0*/
        if ( n3 >= 3u ) /*0xffc469d9*/
          v8 = 8 * n3 - 24; /*0xffc469e4*/
        else
          v8 = 8 * n3 + 8; /*0xffc469db*/
        *(&v18 + n3 / 3u) |= v16 << v8; /*0xffc46a01*/
        n3 = ++v13; /*0xffc46a07*/
      }
    }
    ++v6; /*0xffc46a0d*/
    --n6; /*0xffc46a0e*/
  }
  while ( n6 ); /*0xffc46a11*/
  n4a_1 = n4a; /*0xffc46a17*/
  if ( __return_address[246412] || __return_address[246424] >= 3u || __return_address[257170] != n4a ) /*0xffc46a32*/
  {
    v10 = v18; /*0xffc46a4b*/
  }
  else
  {
    v10 = v18 & 0xFFFFFFC0; /*0xffc46a38*/
    if ( (v18 & 0x3F00) == 0 ) /*0xffc46a41*/
      v10 = v18 & 0xFFFFFEC0 | 0x100; /*0xffc46a43*/
  }
  n6_1 = 0; /*0xffc46a56*/
  if ( __return_address[255496] ) /*0xffc46a4f*/
  {
    n4_1 = n4; /*0xffc46a5c*/
    do /*0xffc46acd*/
    {
      if ( (n4_1[13 * n4a + 1 + 4 * (unsigned __int8)n6] & 1) != 0 ) /*0xffc46a74*/
      {
        j_PciCfgWrite_0((int)__return_address, n4a_1, n6_1, 151011680, v14); /*0xffc46a85*/
        j_PciCfgWrite_0((int)__return_address, n4a, n6_1, 151011684, v10); /*0xffc46a9a*/
        j_PciCfgWrite_0((int)__return_address, n4a, n6_1, 151011688, v19); /*0xffc46ab1*/
        n4_1 = n4; /*0xffc46ab6*/
      }
      n4a_1 = n4a; /*0xffc46abd*/
      LOBYTE(n6) = n6 + 1; /*0xffc46ac1*/
      n6_1 = n6; /*0xffc46ac3*/
    }
    while ( (unsigned __int8)n6 < __return_address[255496] ); /*0xffc46acd*/
  }
  return 0; /*0xffc46acf*/
}

// Function: ProcCommonFunc6AD9 @ 0xffc46ad9 (0x228 bytes)
// Index: 601/2560

int __cdecl ProcCommonFunc6AD9(_BYTE *__return_address, int n4, int buf, unsigned __int8 a4)
{
  int v5; // eax
  unsigned __int8 v6; // cl
  unsigned int v7; // eax
  char v8; // cl
  unsigned int v9; // eax
  char v10; // di
  unsigned __int8 n6; // dl
  int v12; // eax
  char v13; // cl
  unsigned int v14; // eax
  unsigned __int8 v15; // cl
  unsigned int v16; // eax
  unsigned int v17; // eax
  int v18; // eax
  int bufa_1; // eax
  int v20; // eax
  int v21; // eax
  int bufa_2; // [esp+10h] [ebp-4h]
  unsigned __int8 bufa; // [esp+20h] [ebp+Ch]
  unsigned __int8 n6_1; // [esp+24h] [ebp+10h]

  bufa_2 = 0; /*0xffc46aed*/
  v5 = j_CpuIoWrite((int)__return_address, a4, 0, 50413808); /*0xffc46af5*/
  v6 = __return_address[257170]; /*0xffc46afa*/
  if ( a4 == v6 ) /*0xffc46b05*/
    v7 = ((__return_address[257171] & 7 | 8) << 8) | v5 & 0xFFFFF8FF; /*0xffc46b1c*/
  else
    v7 = ((unsigned __int16)v5 ^ (unsigned __int16)(v6 << 8)) & 0xF00 ^ v5; /*0xffc46b2e*/
  v8 = *(_BYTE *)(buf + 1); /*0xffc46b34*/
  if ( a4 == v8 ) /*0xffc46b39*/
    v9 = v7 & 0xFFFFFF0F | 0x80; /*0xffc46b3e*/
  else
    v9 = ((unsigned __int8)v7 ^ (unsigned __int8)(16 * v8)) & 0xF0 ^ v7; /*0xffc46b53*/
  v10 = 0; /*0xffc46b6c*/
  j_PciCfgWrite_0((int)__return_address, a4, 0, 50413808, v9 & 0xFFFF8FFF | ((a4 & 7 | 8) << 12)); /*0xffc46b71*/
  j_PciCfgWrite_0((int)__return_address, a4, 0, 50413812, a4); /*0xffc46b7f*/
  n6 = 0; /*0xffc46b89*/
  n6_1 = 0; /*0xffc46b8b*/
  do /*0xffc46c74*/
  {
    if ( ((unsigned __int8)(1 << v10) & __return_address[a4 + 255497]) != 0 ) /*0xffc46b9d*/
    {
      v12 = j_CpuIoWrite((int)__return_address, a4, n6_1, 285230064); /*0xffc46bae*/
      v13 = *(_BYTE *)(buf + 1); /*0xffc46bba*/
      if ( a4 == v13 ) /*0xffc46bbf*/
        v14 = v12 & 0xFFFFFF0F | 0x80; /*0xffc46bc4*/
      else
        v14 = ((unsigned __int8)v12 ^ (unsigned __int8)(16 * v13)) & 0xF0 ^ v12; /*0xffc46bd9*/
      v15 = __return_address[257170]; /*0xffc46bdb*/
      v16 = ((unsigned int)&loc_FFC7FFFE + 1) & v14; /*0xffc46be1*/
      if ( a4 == v15 ) /*0xffc46be8*/
        v17 = ((__return_address[257171] & 7 | 8) << 8) | v16 & 0xFFFFF8FF; /*0xffc46bff*/
      else
        v17 = ((unsigned __int16)v16 ^ (unsigned __int16)(v15 << 8)) & 0xF00 ^ v16; /*0xffc46c11*/
      j_PciCfgWrite_0( /*0xffc46c33*/
        (int)__return_address,
        a4,
        n6_1,
        285230064,
        v17 ^ (v17 ^ ((unsigned __int8)__return_address[257171] << 16)) & 0x70000);
      v18 = j_CpuIoWrite((int)__return_address, a4, n6_1, 285230068); /*0xffc46c43*/
      j_PciCfgWrite_0((int)__return_address, a4, n6_1, 285230068, a4 & 0xF | v18 & 0xFFFFFFF0); /*0xffc46c5e*/
      n6 = n6_1; /*0xffc46c63*/
    }
    ++n6; /*0xffc46c6a*/
    ++v10; /*0xffc46c6c*/
    n6_1 = n6; /*0xffc46c6d*/
  }
  while ( n6 < 6u ); /*0xffc46c74*/
  LOBYTE(bufa_1) = 0; /*0xffc46c7a*/
  bufa = 0; /*0xffc46c7c*/
  if ( __return_address[255496] ) /*0xffc46c80*/
  {
    do /*0xffc46cf7*/
    {
      if ( (*(_BYTE *)(13 * a4 + 4 * (unsigned __int8)bufa_1 + n4 + 1) & 1) != 0 ) /*0xffc46c9a*/
      {
        v20 = j_CpuIoWrite((int)__return_address, a4, bufa, 151011676); /*0xffc46ca7*/
        if ( a4 == __return_address[257170] ) /*0xffc46cb5*/
          v21 = ((unsigned __int8)v20 ^ (unsigned __int8)(2 * __return_address[257171])) & 0xE ^ v20 | 1; /*0xffc46cc7*/
        else
          v21 = v20 & 0xFFFFFFF0; /*0xffc46ccc*/
        j_PciCfgWrite_0((int)__return_address, a4, bufa, 151011676, v21); /*0xffc46cdb*/
      }
      bufa_1 = bufa_2; /*0xffc46ce3*/
      LOBYTE(bufa_1) = bufa_2 + 1; /*0xffc46ce7*/
      bufa_2 = bufa_1; /*0xffc46ce9*/
      bufa = bufa_1; /*0xffc46ced*/
    }
    while ( (unsigned __int8)bufa_1 < __return_address[255496] ); /*0xffc46cf7*/
  }
  return 0; /*0xffc46cf9*/
}

// Function: ProcCommonFunc6D01 @ 0xffc46d01 (0x7e8 bytes)
// Index: 602/2560

int __cdecl ProcCommonFunc6D01(_BYTE *__return_address, _BYTE *n4, int buf, unsigned __int8 n4a)
{
  bool v4; // zf
  char n4_1; // al
  int v6; // edx
  int v7; // edi
  char v8; // si
  unsigned int v9; // edx
  unsigned __int8 n4a_1; // al
  int v11; // eax
  unsigned __int8 n4a_3; // dl
  unsigned __int8 n6; // al
  _BYTE *v14; // esi
  unsigned int v15; // ecx
  unsigned int v16; // edi
  __int64 v17; // rax
  int v18; // ebp
  int v19; // eax
  int buf_1; // ebp
  unsigned __int8 n4_6; // cl
  _BYTE *n4_3; // edx
  _DWORD *v23; // esi
  unsigned __int8 n4_4; // al
  _DWORD *v25; // ebx
  unsigned __int8 n6_1; // al
  unsigned int v27; // ecx
  unsigned int v28; // edi
  __int64 v29; // rax
  int v30; // ebp
  int v31; // eax
  _BYTE *__return_address_1; // ebx
  int v33; // edi
  int v34; // eax
  unsigned __int8 n4a_5; // dl
  unsigned __int8 n4_9; // al
  unsigned __int8 n4a_6; // cl
  int v38; // edx
  int v39; // ebp
  int v40; // ebx
  int v41; // ecx
  int v42; // edx
  int... [13249 chars total]

// Function: KtiMainCheckMaxSocket @ 0xffc474e9 (0x43e bytes)
// Index: 603/2560

int __cdecl KtiMainCheckMaxSocket(_BYTE *__return_address, _BYTE *n4, int buf, unsigned __int8 n4a)
{
  _BYTE *__return_address_1; // ebx
  bool v5; // zf
  unsigned __int8 n4_1; // dl
  char v7; // ch
  unsigned __int8 n4a_1; // cl
  unsigned int v9; // esi
  unsigned int v10; // ebp
  int buf_1; // eax
  unsigned int *v12; // edi
  _BYTE *n4_3; // ebx
  unsigned __int8 n4_4; // cl
  bool v15; // al
  int v16; // esi
  int v17; // edi
  int v18; // ecx
  unsigned __int8 n8_1; // ch
  int v20; // ebp
  int n4_5; // edi
  unsigned __int8 n6; // dl
  int v23; // ecx
  int v24; // ebp
  int n4_6; // edi
  int v26; // eax
  int v27; // eax
  unsigned __int8 n4_7; // [esp+12h] [ebp-46h]
  char n8; // [esp+13h] [ebp-45h]
  unsigned __int8 n4_2; // [esp+14h] [ebp-44h]
  int v32; // [esp+14h] [ebp-44h]
  unsigned int v33; // [esp+18h] [ebp-40h]
  int v34; // [esp+1Ch] [ebp-3Ch]
  int v35; // [esp+1Ch] [ebp-3Ch]
  int v36; // [esp+24h] [ebp-34h]
  int v37[4]; // [esp+28h] [ebp-30h] BYREF
  int v38[4]; // [esp+38h] [ebp-20h]
  int v39[4]; // [esp+48h] [ebp-10h]
  unsigned __int8 n6_1; // [esp+5Ch] [ebp+4h]

  __return_address_1 = __return_address; /*0xffc474ed*/
  v39[0] = 285229968; /*0xffc474fd*/
  v5 = *(_BYTE *)(buf + 128) == 1; /*0xffc47505*/
  v39[1] = 285229972; /*0xffc4750c*/
  v39[2] = 285229976; /*0xffc47514*/
  v39[3] = 285229980; /*0xffc4751c*/
  v38[0] = 50414084; /*0xffc47524*/
  v38[1] = 50414088; /*0xffc4752c*/
  v38[2] = 50414092; /*0xffc47534*/
  v38[3] = 50414096; /*0xffc4753c*/
  memset(v37, 136, sizeof(v37)); /*0xffc47544*/
  n8 = 8; /*0xffc47554*/
  if ( v5 ) /*0xffc47559*/
    n4_1 = 4 * (__return_address[8321] != 0) + 4; /*0xffc47565*/
  else
    n4_1 = 4; /*0xffc4756e*/
  n4_2 = n4_1; /*0xffc47570*/
  if ( n4_1 > 4u )
  {
    RcAssertPrint(
      __return_address,
      1u,
      (int)"\n\n %s: %u   %s ",
      "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiMain.c",
      5921,
      "(MaxSocket <= MAX_SOCKET)");
    KtiDebugAssert((int)__return_address, 223, 122); /*0xffc4759d*/
    n4_1 = n4_2; /*0xffc475a2*/
  }
  v7 = *(_BYTE *)(buf + 134); /*0xffc475a9*/
  if ( v7 ) /*0xffc475b1*/
    n4a_1 = n4a; /*0xffc475b8*/
  else
    n4a_1 = *(_BYTE *)(buf + 1); /*0xffc475b3*/
  v34 = 351 * n4a_1; /*0xffc475c5*/
  v9 = *(_DWORD *)&__return_address[v34 + 255773]; /*0xffc475d0*/
  v10 = *(_DWORD *)&__return_address[v34 + 255777]; /*0xffc475d7*/
  v33 = (8 /*0xffc47607*/
       * (*(_WORD *)(buf + 126) & 7
        | (32
         * (((unsigned __int8)__return_address[v34 + 255768] | (*(_DWORD *)&__return_address[v34 + 255769] << 8))
          & 0x3FFFFF))))
      | 5;
  if ( v7 ) /*0xffc4760d*/
  {
    n8_1 = *(_BYTE *)(buf + 1); /*0xffc476bf*/
    n8 = n8_1; /*0xffc476c7*/
    v16 = (*(unsigned __int16 *)&__return_address[v34 + 255775] | (*(_DWORD *)&__return_address[v34 + 255777] << 16)) /*0xffc476da*/
        & 0x3FFFFF00
        | 4;
    if ( n4a_1 == n8_1 ) /*0xffc476fc*/
    {
      n4a_1 = 0; /*0xffc47702*/
      do /*0xffc47721*/
      {
        if ( n4a_1 != n8_1 && ((n4[13 * n4a_1] & 1) != 0 || *(_BYTE *)(buf + 128) == 1) ) /*0xffc4771b*/
          break; /*0xffc4771b*/
        ++n4a_1; /*0xffc4771d*/
      }
      while ( n4a_1 < n4_1 ); /*0xffc47721*/
      __return_address_1 = __return_address; /*0xffc47723*/
      n8 = n4a_1; /*0xffc47727*/
    }
    v17 = ((((unsigned __int8)__return_address[351 * n8_1 + 255768] /*0xffc4772e*/
           | (*(_DWORD *)&__return_address[351 * n8_1 + 255769] << 8))
          & 0x3FFFFF) << 8)
        | 3;
    v18 = *(unsigned __int16 *)&__return_address_1[351 * n4a_1 + 255775] /*0xffc47749*/
        | (*(_DWORD *)&__return_address_1[351 * n4a_1 + 255777] << 16);
  }
  else
  {
    buf_1 = buf; /*0xffc47613*/
    v12 = (unsigned int *)(__return_address + 255773); /*0xffc47617*/
    n4_3 = n4; /*0xffc4761d*/
    n4_4 = 0; /*0xffc47621*/
    n4_7 = 0; /*0xffc47623*/
    do /*0xffc47673*/
    {
      if ( n4_4 != *(_BYTE *)(buf_1 + 1) && ((*n4_3 & 1) != 0 || *(_BYTE *)(buf_1 + 128) == 1) ) /*0xffc47638*/
      {
        v15 = ProcCommonFunc919A(*v12, v12[1], *(v12 - 2), *(v12 - 1)); /*0xffc47645*/
        n4_1 = n4_2; /*0xffc4764a*/
        n4_4 = n4_7; /*0xffc47651*/
        v5 = !v15; /*0xffc47655*/
        buf_1 = buf; /*0xffc47657*/
        if ( !v5 ) /*0xffc4765b*/
        {
          v9 = *v12; /*0xffc4765d*/
          v10 = v12[1]; /*0xffc4765f*/
        }
      }
      ++n4_4; /*0xffc47662*/
      n4_3 += 13; /*0xffc47664*/
      v12 = (unsigned int *)((char *)v12 + 351); /*0xffc47667*/
      n4_7 = n4_4; /*0xffc4766d*/
    }
    while ( n4_4 < n4_1 ); /*0xffc47673*/
    __return_address_1 = __return_address; /*0xffc4767f*/
    v16 = (((v9 & 0xFF00FFFF | 0x40000) >> 16) /*0xffc4769c*/
         ^ (((v9 & 0xFF00FFFF | 0x40000) >> 16) | (v10 << 16)))
        & 0x3FFFFF00
        ^ ((v9 & 0xFF00FFFF | 0x40000) >> 16);
    v17 = v33 & 0x3FFFFF00 | 1; /*0xffc4769e*/
    v18 = v16; /*0xffc476a1*/
  }
  v32 = v17; /*0xffc47752*/
  v36 = v18 & 0x3FFFFF00; /*0xffc4775d*/
  if ( !__return_address_1[246412] && __return_address_1[246424] < 3u ) /*0xffc4776a*/
    v32 = ((unsigned __int8)v16 ^ (unsigned __int8)v17) & 6 ^ v17; /*0xffc47775*/
  v20 = 0; /*0xffc4777b*/
  n4_5 = 4; /*0xffc4777d*/
  do /*0xffc4779b*/
  {
    v37[v20] = j_CpuIoWrite((int)__return_address_1, n4a, 0, v38[v20]); /*0xffc47791*/
    ++v20; /*0xffc47795*/
    --n4_5; /*0xffc47798*/
  }
  while ( n4_5 ); /*0xffc4779b*/
  n6 = 0; /*0xffc477a1*/
  v23 = 0; /*0xffc477a6*/
  n6_1 = 0; /*0xffc477a8*/
  v35 = 0; /*0xffc477b0*/
  do /*0xffc47917*/
  {
    if ( ((unsigned __int8)(1 << v23) & __return_address_1[n4a + 255497]) != 0 ) /*0xffc477c4*/
    {
      v24 = 0; /*0xffc477cc*/
      n4_6 = 4; /*0xffc477ce*/
      do /*0xffc477ee*/
      {
        j_PciCfgWrite_0((int)__return_address_1, n4a, n6_1, v39[v24], v37[v24]); /*0xffc477e0*/
        ++v24; /*0xffc477e8*/
        --n4_6; /*0xffc477eb*/
      }
      while ( n4_6 ); /*0xffc477ee*/
      if ( __return_address_1[257264] ) /*0xffc477f0*/
      {
        v16 = v16 & 0xFFFFFFF9 | 2; /*0xffc4780e*/
        v33 = v33 & 0xFFFFFFF9 | 2; /*0xffc47811*/
      }
      j_PciCfgWrite_0((int)__return_address_1, n4a, n6_1, 285229900, v16); /*0xffc47824*/
      j_PciCfgWrite_0((int)__return_address_1, n4a, n6_1, 285229896, v33); /*0xffc4783e*/
      v26 = j_CpuIoWrite((int)__return_address_1, n4a, n6_1, 285229956); /*0xffc47857*/
      j_PciCfgWrite_0((int)__return_address_1, n4a, n6_1, 285229956, ((n8 & 0xF) << 16) | v26 & 0xFFF0FFFF); /*0xffc47883*/
      j_PciCfgWrite_0((int)__return_address_1, n4a, n6_1, 285229892, v36); /*0xffc4789d*/
      j_PciCfgWrite_0((int)__return_address_1, n4a, n6_1, 285229888, v32); /*0xffc478b4*/
      v27 = j_CpuIoWrite((int)__return_address_1, n4a, 0, 285230068); /*0xffc478c8*/
      j_PciCfgWrite_0( /*0xffc478f6*/
        (int)__return_address_1,
        n4a,
        n6_1,
        285230068,
        v27 ^ (v27 ^ ((*(unsigned __int8 *)(buf + 125) + 8) << 24)) & 0x1F000000);
      n6 = n6_1; /*0xffc478fb*/
      v23 = v35; /*0xffc47905*/
    }
    ++n6; /*0xffc47909*/
    ++v23; /*0xffc4790b*/
    n6_1 = n6; /*0xffc4790c*/
    v35 = v23; /*0xffc47910*/
  }
  while ( n6 < 6u ); /*0xffc47917*/
  return 0; /*0xffc4791d*/
}

// Function: ProcCommonFunc7927 @ 0xffc47927 (0x163 bytes)
// Index: 604/2560

int __cdecl ProcCommonFunc7927(int __return_address, _BYTE *n4, int buf, unsigned __int8 n4a)
{
  unsigned __int8 v4; // bl
  int v6; // esi
  int n6; // edx
  int v8; // eax
  __int16 v9; // ax
  unsigned __int8 v10; // bl
  _BYTE *n4_1; // ecx
  int v13; // [esp+14h] [ebp-18h]
  int v14; // [esp+18h] [ebp-14h]
  int bufa[3]; // [esp+20h] [ebp-Ch] BYREF
  int n6_1; // [esp+30h] [ebp+4h]
  unsigned __int8 v17; // [esp+30h] [ebp+4h]

  v4 = 0; /*0xffc4792e*/
  v13 = 0; /*0xffc47938*/
  memset_save_flags(bufa, 0, 0xCu); /*0xffc4793c*/
  v6 = 0; /*0xffc4794c*/
  n6 = 6; /*0xffc47953*/
  v14 = *(unsigned __int8 *)(__return_address + n4a + 255497); /*0xffc4795c*/
  n6_1 = 6; /*0xffc47960*/
  do /*0xffc479df*/
  {
    if ( ((1 << v6) & v14) != 0 ) /*0xffc4796f*/
    {
      v8 = 39 * (v6 + 9 * n4a); /*0xffc47976*/
      if ( *(_DWORD *)(v8 + __return_address + 255817) != -1 && *(_DWORD *)(v8 + __return_address + 255813) != -1 ) /*0xffc4798f*/
      {
        v13 |= v6 << (3 * v4); /*0xffc4799b*/
        v9 = *(__int64 *)(v8 + __return_address + 255821) >> 30; /*0xffc479b9*/
        if ( (v4 & 1) != 0 ) /*0xffc479bf*/
          HIWORD(bufa[v4 >> 1]) = v9; /*0xffc479c3*/
        else
          LOWORD(bufa[v4 >> 1]) = v9; /*0xffc479cc*/
        n6 = n6_1; /*0xffc479d1*/
        ++v4; /*0xffc479d5*/
      }
    }
    ++v6; /*0xffc479d7*/
    n6_1 = --n6; /*0xffc479db*/
  }
  while ( n6 ); /*0xffc479df*/
  v10 = 0; /*0xffc479e1*/
  v17 = 0; /*0xffc479e3*/
  if ( *(_BYTE *)(__return_address + 255496) ) /*0xffc479e7*/
  {
    n4_1 = n4; /*0xffc479f3*/
    do /*0xffc47a7a*/
    {
      if ( (n4_1[13 * n4a + 1 + 4 * v10] & 1) != 0 ) /*0xffc47a0b*/
      {
        j_PciCfgWrite_0(__return_address, n4a, v17, 151011632, v13); /*0xffc47a20*/
        j_PciCfgWrite_0(__return_address, n4a, v17, 151011636, bufa[0]); /*0xffc47a34*/
        j_PciCfgWrite_0(__return_address, n4a, v17, 151011640, bufa[1]); /*0xffc47a48*/
        j_PciCfgWrite_0(__return_address, n4a, v17, 151011644, bufa[2]); /*0xffc47a5f*/
        n4_1 = n4; /*0xffc47a64*/
      }
      v17 = ++v10; /*0xffc47a70*/
    }
    while ( v10 < *(_BYTE *)(__return_address + 255496) ); /*0xffc47a7a*/
  }
  return 0; /*0xffc47a80*/
}

// Function: KtiMainCheckTotalCpu @ 0xffc47a8a (0x49b bytes)
// Index: 605/2560

int __cdecl KtiMainCheckTotalCpu(int __return_address, _BYTE *n4, int buf, unsigned __int8 n8)
{
  _BYTE *buf_1; // esi
  bool v5; // zf
  unsigned __int8 n4_1; // al
  _BYTE *n4_3; // edx
  unsigned __int8 n8_4; // cl
  unsigned int *v9; // edi
  unsigned __int8 n8_1; // bl
  _BYTE *v11; // edx
  int v12; // ecx
  int n6; // esi
  int v14; // eax
  unsigned int v15; // edx
  unsigned int v16; // edi
  unsigned int v17; // esi
  unsigned int v18; // ecx
  unsigned int v19; // edx
  unsigned int v20; // edi
  unsigned int v21; // esi
  unsigned __int8 n8_2; // al
  int v23; // esi
  int v24; // edi
  unsigned int v25; // ebx
  unsigned __int8 n8_5; // al
  int v27; // edi
  int n2; // esi
  int v30; // [esp-38h] [ebp-DCh]
  unsigned __int8 v31; // [esp+12h] [ebp-92h]
  unsigned __int8 n8_3; // [esp+13h] [ebp-91h]
  _BYTE *v33; // [esp+14h] [ebp-90h]
  _BYTE *n4_4; // [esp+18h] [ebp-8Ch]
  unsigned __int8 n4_2; // [esp+1Ch] [ebp-88h]
  int v36; // [esp+20h] [ebp-84h]
  unsigned int v37; // [esp+24h] [ebp-80h]
  int v38; // [esp+28h] [ebp-7Ch]
  int v39; // [esp+2Ch] [ebp-78h]
  unsigned int *v40; // [esp+30h] [ebp-74h]
  int n6_1; // [esp+34h] [ebp-70h]
  unsigned int v42; // [esp+38h] [ebp-6Ch]
  int v43[2]; // [esp+3Ch] [ebp-68h]
  int n50413632; // [esp+44h] [ebp-60h]
  int v45[23]; // [esp+48h] [ebp-5Ch]

  buf_1 = (_BYTE *)buf; /*0xffc47a9f*/
  n50413632 = 50413632; /*0xffc47aa7*/
  v45[0] = 50413636; /*0xffc47aaf*/
  v5 = *(_BYTE *)(buf + 128) == 1; /*0xffc47ab7*/
  v45[1] = 50413640; /*0xffc47abe*/
  v45[2] = 50413644; /*0xffc47ac6*/
  v45[3] = 50413648; /*0xffc47ace*/
  v45[4] = 50413652; /*0xffc47ad6*/
  v45[5] = 50413656; /*0xffc47ade*/
  v45[6] = 50413660; /*0xffc47ae6*/
  v45[7] = 50413664; /*0xffc47aee*/
  v45[8] = 50413668; /*0xffc47af6*/
  v45[9] = 50413672; /*0xffc47afe*/
  v45[10] = 50413676; /*0xffc47b06*/
  v45[11] = 50413680; /*0xffc47b0e*/
  v45[12] = 50413684; /*0xffc47b16*/
  v45[13] = 50413688; /*0xffc47b1e*/
  v45[14] = 50413692; /*0xffc47b26*/
  v45[15] = 50413696; /*0xffc47b31*/
  v45[16] = 50413700; /*0xffc47b3c*/
  v45[17] = 50413704; /*0xffc47b47*/
  v45[18] = 50413708; /*0xffc47b52*/
  v45[19] = 50413712; /*0xffc47b5d*/
  v45[20] = 50413716; /*0xffc47b68*/
  v45[21] = 50413720; /*0xffc47b73*/
  v45[22] = 50413724; /*0xffc47b7e*/
  v43[0] = 50413800; /*0xffc47b89*/
  v43[1] = 50413816; /*0xffc47b91*/
  v36 = -2004318072; /*0xffc47b99*/
  v37 = -2004318072; /*0xffc47b9d*/
  v31 = 0; /*0xffc47ba1*/
  if ( v5 ) /*0xffc47ba6*/
    n4_1 = 4 * (*(_BYTE *)(__return_address + 8321) != 0) + 4; /*0xffc47bb2*/
  else
    n4_1 = 4; /*0xffc47bbb*/
  n4_2 = n4_1; /*0xffc47bbd*/
  if ( n4_1 > 4u )
  {
    RcAssertPrint(
      (_BYTE *)__return_address,
      1u,
      (int)"\n\n %s: %u   %s ",
      "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiMain.c",
      5199,
      "(TmpTotCpu <= MAX_SOCKET)");
    KtiDebugAssert(__return_address, 223, 119); /*0xffc47be9*/
    n4_1 = n4_2; /*0xffc47bee*/
  }
  n4_3 = n4; /*0xffc47bf5*/
  n8_4 = 0; /*0xffc47c02*/
  v33 = (_BYTE *)(__return_address + 255497); /*0xffc47c04*/
  v39 = 0; /*0xffc47c08*/
  v9 = (unsigned int *)(__return_address + 255757); /*0xffc47c0d*/
  n8_1 = n8; /*0xffc47c13*/
  n8_3 = 0; /*0xffc47c1a*/
  n4_4 = n4; /*0xffc47c1e*/
  v40 = (unsigned int *)(__return_address + 255757); /*0xffc47c22*/
  do /*0xffc47e09*/
  {
    if ( (*n4_3 & 1) != 0 || buf_1[128] == 1 ) /*0xffc47c32*/
    {
      if ( n8_4 == n8 ) /*0xffc47c3a*/
      {
        v11 = v33; /*0xffc47c40*/
        v12 = 0; /*0xffc47c44*/
        n6 = 6; /*0xffc47c48*/
        v38 = 0; /*0xffc47c49*/
        n6_1 = 6; /*0xffc47c4d*/
        do /*0xffc47d25*/
        {
          if ( ((unsigned __int8)(1 << v12) & *v11) != 0 ) /*0xffc47c58*/
          {
            v14 = 39 * (v12 + v39); /*0xffc47c64*/
            v15 = *(_DWORD *)(v14 + __return_address + 255805); /*0xffc47c67*/
            v42 = *(_DWORD *)(v14 + __return_address + 255809); /*0xffc47c75*/
            if ( v15 < v42 ) /*0xffc47c7b*/
            {
              v16 = v31; /*0xffc47c87*/
              v17 = v42 & 0xFF000001 | ((v15 & 0x3000000 | ((v15 | 0x2000000) >> 22)) >> 3); /*0xffc47cb9*/
              j_PciCfgWrite_0(__return_address, n8, 0, v45[2 * v31], (v42 & 0xC00000 | (v15 >> 2) & 0x300000) >> 6); /*0xffc47cc7*/
              j_PciCfgWrite_0(__return_address, n8, 0, v45[2 * v31 - 1], v17); /*0xffc47cd5*/
              v12 = v38; /*0xffc47cfd*/
              ++v31; /*0xffc47d09*/
              *(&v36 + (v16 >> 3)) = *(&v36 + (v16 >> 3)) & ~(15 << (4 * v16)) | ((v38 | 8) << (4 * (v16 & 7))); /*0xffc47d0d*/
              n6 = n6_1; /*0xffc47d11*/
            }
            v11 = v33; /*0xffc47d15*/
          }
          ++v12; /*0xffc47d19*/
          --n6; /*0xffc47d1a*/
          v38 = v12; /*0xffc47d1d*/
          n6_1 = n6; /*0xffc47d21*/
        }
        while ( n6 ); /*0xffc47d25*/
      }
      else
      {
        v18 = *v9; /*0xffc47d30*/
        v19 = v9[1]; /*0xffc47d32*/
        if ( *v9 >= v19 ) /*0xffc47d37*/
        {
LABEL_22:
          n8_4 = n8_3; /*0xffc47ddf*/
          n4_3 = n4_4; /*0xffc47de3*/
          goto LABEL_23; /*0xffc47de3*/
        }
        v20 = v31; /*0xffc47d3d*/
        v21 = v19 & 0xFF000001 | ((v18 & 0x3000000 | ((v18 | 0x2000000) >> 22)) >> 3); /*0xffc47d74*/
        j_PciCfgWrite_0(__return_address, n8, 0, v45[2 * v31], (v19 & 0xC00000 | (v18 >> 2) & 0x300000) >> 6); /*0xffc47d7f*/
        j_PciCfgWrite_0(__return_address, n8, 0, v45[2 * v31 - 1], v21); /*0xffc47d8d*/
        n8_2 = 8; /*0xffc47d9c*/
        if ( (*n4_4 & 1) != 0 ) /*0xffc47d9e*/
          n8_2 = n8_3; /*0xffc47da0*/
        ++v31; /*0xffc47dc8*/
        *(&v36 + (v20 >> 3)) = *(&v36 + (v20 >> 3)) & ~(15 << (4 * v20)) | (n8_2 << (4 * (v20 & 7))); /*0xffc47dcc*/
      }
      v9 = v40; /*0xffc47dd0*/
      n4_1 = n4_2; /*0xffc47dd4*/
      buf_1 = (_BYTE *)buf; /*0xffc47dd8*/
      goto LABEL_22; /*0xffc47dd8*/
    }
LABEL_23:
    v39 += 9; /*0xffc47de7*/
    ++n8_4; /*0xffc47dec*/
    ++v33; /*0xffc47dee*/
    v9 = (unsigned int *)((char *)v9 + 351); /*0xffc47df2*/
    n4_3 += 13; /*0xffc47df8*/
    n8_3 = n8_4; /*0xffc47dfb*/
    v40 = v9; /*0xffc47dff*/
    n4_4 = n4_3; /*0xffc47e03*/
  }
  while ( n8_4 < n4_1 ); /*0xffc47e09*/
  if ( buf_1[133] == 1 ) /*0xffc47e16*/
  {
    v23 = j_CpuIoWrite(__return_address, n8, 0, 50413720); /*0xffc47e33*/
    v24 = j_CpuIoWrite(__return_address, n8, 0, 50413724); /*0xffc47e40*/
    v25 = *(_DWORD *)(__return_address + 1528) + 1 + *(_DWORD *)(buf + 129); /*0xffc47e56*/
    j_PciCfgWrite_0( /*0xffc47e81*/
      __return_address,
      n8,
      0,
      50413720,
      v23 & 0xFF800001 | ((v25 & 0x3000000 | (v25 >> 22) & 0x3F0) >> 3));
    v30 = v24 ^ ((unsigned __int16)v24 ^ (unsigned __int16)(v25 >> 8)) & 0xC000; /*0xffc47e93*/
    n8_1 = n8; /*0xffc47e94*/
    j_PciCfgWrite_0(__return_address, n8, 0, 50413724, v30); /*0xffc47ea4*/
    buf_1 = (_BYTE *)buf; /*0xffc47ea9*/
  }
  n8_5 = buf_1[1]; /*0xffc47eb3*/
  if ( n8_1 != n8_5 ) /*0xffc47eb8*/
    v37 = v37 & 0xFFFF0FFF | (n8_5 << 12); /*0xffc47ecb*/
  v27 = 0; /*0xffc47ed1*/
  n2 = 2; /*0xffc47ed3*/
  do /*0xffc47eee*/
  {
    j_PciCfgWrite_0(__return_address, n8_1, 0, v43[v27], *(int *)((char *)&v36 + v27 * 4)); /*0xffc47ee0*/
    ++v27; /*0xffc47ee8*/
    --n2; /*0xffc47eeb*/
  }
  while ( n2 ); /*0xffc47eee*/
  ProcCommonFunc7F25(__return_address, n4, buf, n8_1); /*0xffc47f01*/
  ProcCommonFunc840C(__return_address, n4, buf, n8_1); /*0xffc47f10*/
  return 0; /*0xffc47f1a*/
}

// Function: ProcCommonFunc7F25 @ 0xffc47f25 (0x4e7 bytes)
// Index: 606/2560

int __cdecl ProcCommonFunc7F25(int __return_address, _BYTE *n4, int buf, unsigned __int8 n8)
{
  unsigned __int8 n4_1; // al
  unsigned __int8 *v5; // edi
  unsigned __int8 n8_2; // ch
  int *v7; // esi
  int v8; // edx
  int buf_1; // ebp
  int v10; // edx
  int v11; // ebp
  int n6; // esi
  int v13; // eax
  unsigned int v14; // edx
  int v15; // edi
  int v16; // esi
  int v17; // edx
  int v18; // esi
  int v19; // ebp
  int n6_2; // edx
  int v21; // eax
  unsigned int v22; // esi
  int v23; // edi
  unsigned int v24; // edx
  int v25; // esi
  int v26; // edx
  int v27; // edx
  unsigned int v28; // ecx
  int v29; // eax
  int v30; // edi
  unsigned __int8 n8_1; // al
  unsigned int v32; // edx
  bool v33; // zf
  unsigned __int8 n8_5; // cl
  unsigned __int8 n8_4; // al
  unsigned __int8 n6_4; // dl
  int n8_6; // esi
  int v38; // ebp
  int v39; // esi
  int n12; // ebp
  int v41; // esi
  int v42; // eax
  unsigned __int8 v44; // [esp+12h] [ebp-92h]
  unsigned __int8 n8_3; //... [9346 chars total]

// Function: ProcCommonFunc840C @ 0xffc4840c (0x16c bytes)
// Index: 607/2560

int __cdecl ProcCommonFunc840C(int __return_address, _BYTE *n4, int buf, unsigned __int8 n8)
{
  unsigned __int8 v4; // bl
  int v6; // esi
  int n6; // edx
  int v8; // eax
  unsigned __int8 v9; // bl
  _BYTE *n4_1; // ecx
  int v12; // [esp+14h] [ebp-18h]
  int v13; // [esp+18h] [ebp-14h]
  int v14; // [esp+1Ch] [ebp-10h]
  int bufa[3]; // [esp+20h] [ebp-Ch] BYREF
  int n6_1; // [esp+30h] [ebp+4h]
  unsigned __int8 v17; // [esp+30h] [ebp+4h]

  v4 = 0; /*0xffc48413*/
  v12 = 0; /*0xffc4841d*/
  memset_save_flags(bufa, 0, 0xCu); /*0xffc48421*/
  v6 = 0; /*0xffc48431*/
  n6 = 6; /*0xffc48438*/
  v13 = *(unsigned __int8 *)(__return_address + n8 + 255497); /*0xffc48441*/
  n6_1 = 6; /*0xffc48445*/
  do /*0xffc484c9*/
  {
    if ( ((1 << v6) & v13) != 0 ) /*0xffc48454*/
    {
      v14 = 39 * (v6 + 9 * n8); /*0xffc4845e*/
      if ( *(_DWORD *)(v14 + __return_address + 255805) != -1 ) /*0xffc4846a*/
      {
        v12 |= v6 << (3 * v4); /*0xffc48476*/
        v8 = *(_DWORD *)(v14 + __return_address + 255809) >> 22; /*0xffc48485*/
        if ( (v4 & 1) != 0 ) /*0xffc4848b*/
          bufa[v4 >> 1] = bufa[v4 >> 1] & 0x3FFFFF | ((unsigned __int16)v8 << 22); /*0xffc484a0*/
        else
          bufa[v4 >> 1] ^= (bufa[v4 >> 1] ^ ((unsigned __int16)v8 << 6)) & 0xFFC0; /*0xffc484b7*/
        n6 = n6_1; /*0xffc484bb*/
        ++v4; /*0xffc484bf*/
      }
    }
    ++v6; /*0xffc484c1*/
    n6_1 = --n6; /*0xffc484c5*/
  }
  while ( n6 ); /*0xffc484c9*/
  v9 = 0; /*0xffc484cf*/
  v17 = 0; /*0xffc484d1*/
  if ( *(_BYTE *)(__return_address + 255496) ) /*0xffc484d5*/
  {
    n4_1 = n4; /*0xffc484e1*/
    do /*0xffc48568*/
    {
      if ( (n4_1[13 * n8 + 1 + 4 * v9] & 1) != 0 ) /*0xffc484f9*/
      {
        j_PciCfgWrite_0(__return_address, n8, v17, 151011648, v12); /*0xffc4850e*/
        j_PciCfgWrite_0(__return_address, n8, v17, 151011652, bufa[0]); /*0xffc48522*/
        j_PciCfgWrite_0(__return_address, n8, v17, 151011656, bufa[1]); /*0xffc48536*/
        j_PciCfgWrite_0(__return_address, n8, v17, 151011660, bufa[2]); /*0xffc4854d*/
        n4_1 = n4; /*0xffc48552*/
      }
      v17 = ++v9; /*0xffc4855e*/
    }
    while ( v9 < *(_BYTE *)(__return_address + 255496) ); /*0xffc48568*/
  }
  return 0; /*0xffc4856e*/
}

// Function: ProcCommonFunc8578 @ 0xffc48578 (0x113 bytes)
// Index: 608/2560

char __cdecl ProcCommonFunc8578(_BYTE *__return_address, unsigned __int8 n4, char a3, int n286326784)
{
  unsigned __int8 n4_1; // cl
  int v5; // eax
  unsigned __int8 v6; // bl
  int v7; // ebp
  int v8; // eax
  int v9; // eax
  unsigned __int8 n2; // cl
  int v11; // eax
  unsigned __int8 v13; // [esp+10h] [ebp-4h]
  unsigned __int8 v14; // [esp+10h] [ebp-4h]

  n4_1 = n4; /*0xffc48579*/
  LOBYTE(v5) = n4; /*0xffc4857f*/
  v6 = 0; /*0xffc48582*/
  v7 = 351 * n4; /*0xffc48584*/
  v13 = 0; /*0xffc48590*/
  if ( __return_address[v7 + 255718] ) /*0xffc48594*/
  {
    do /*0xffc485f9*/
    {
      v8 = j_CpuIoWrite((int)__return_address, n4, v13, 167788768); /*0xffc485b1*/
      j_PciCfgWrite_0((int)__return_address, n4, v13, 167788768, a3 & 7 | v8 & 0xFFFFFE58 | 0x40); /*0xffc485cc*/
      j_PciCfgWrite_0((int)__return_address, n4, v13, 167788772, n286326784); /*0xffc485e0*/
      LOBYTE(v5) = v13 + 1; /*0xffc485ec*/
      v13 = v5; /*0xffc485ee*/
    }
    while ( (unsigned __int8)v5 < __return_address[v7 + 255718] ); /*0xffc485f9*/
    n4_1 = n4; /*0xffc485fb*/
    v6 = 0; /*0xffc485ff*/
  }
  v14 = 0; /*0xffc48608*/
  if ( __return_address[255496] ) /*0xffc48601*/
  {
    do /*0xffc48683*/
    {
      v5 = v7 + 4 * v6; /*0xffc4861d*/
      if ( (__return_address[v5 + 255705] & 1) != 0 ) /*0xffc48627*/
      {
        v9 = j_CpuIoWrite((int)__return_address, n4_1, v14, 151011568); /*0xffc48630*/
        n2 = __return_address[8308]; /*0xffc48635*/
        v11 = v9 | 0x1000000; /*0xffc4863e*/
        __return_address[257242] = 1; /*0xffc48643*/
        if ( n2 < 2u ) /*0xffc4864d*/
        {
          if ( n2 == 1 ) /*0xffc48652*/
            v11 &= ~0x4000000u; /*0xffc48654*/
          else
            v11 |= 0x4000000u; /*0xffc4865b*/
        }
        LOBYTE(v5) = j_PciCfgWrite_0((int)__return_address, n4, v14, 151011568, v11); /*0xffc4866b*/
      }
      n4_1 = n4; /*0xffc48673*/
      v14 = ++v6; /*0xffc48679*/
    }
    while ( v6 < __return_address[255496] ); /*0xffc48683*/
  }
  return v5; /*0xffc48685*/
}

// Function: ProcCommonFunc868B @ 0xffc4868b (0x53 bytes)
// Index: 609/2560

int __cdecl ProcCommonFunc868B(
        int __return_address,
        unsigned __int8 i,
        unsigned __int8 a3,
        char a4,
        unsigned __int8 ia)
{
  int v6; // [esp+8h] [ebp-4h] BYREF

  v6 = j_CpuIoWrite(__return_address, a3, i >> 1, 167788672); /*0xffc486ad*/
  ProcCommonFunc8272(i, ia, a4, &v6); /*0xffc486bd*/
  j_PciCfgWrite_0(__return_address, a3, i >> 1, 167788672, v6); /*0xffc486cf*/
  return 0; /*0xffc486d9*/
}

// Function: ProcCommonFunc86DE @ 0xffc486de (0x8e bytes)
// Index: 610/2560

int __cdecl ProcCommonFunc86DE(int __return_address, _BYTE *n4, int buf)
{
  int v3; // ebx
  int v4; // eax
  unsigned int v6; // ecx
  unsigned __int8 n4_1; // al
  char v8; // si
  unsigned __int8 n4_2; // [esp+1Ch] [ebp+Ch]

  LOBYTE(v3) = 0; /*0xffc486ef*/
  v4 = j_CpuIoWrite(__return_address, *(_BYTE *)(buf + 1), 0, 285230388); /*0xffc486fa*/
  n4_2 = *(_BYTE *)(buf + 1); /*0xffc4870c*/
  v6 = v4 & 0xFFFFFFC0 | *(_BYTE *)(n4_2 + __return_address + 255497) & 0x3E; /*0xffc4871e*/
  n4_1 = 0; /*0xffc48720*/
  v8 = 0; /*0xffc48722*/
  do /*0xffc48744*/
  {
    if ( (*n4 & 1) != 0 && n4_1 != n4_2 && (*n4 & 0x60) == 0 ) /*0xffc48734*/
      v3 = (unsigned __int8)v3 | (1 << v8); /*0xffc48739*/
    ++n4_1; /*0xffc4873c*/
    n4 += 13; /*0xffc4873e*/
    ++v8; /*0xffc48741*/
  }
  while ( n4_1 < 4u ); /*0xffc48744*/
  j_PciCfgWrite_0(__return_address, n4_2, 0, 285230388, v6 & 0xFFFFC03F | ((unsigned __int8)v3 << 6)); /*0xffc4875d*/
  return 0; /*0xffc48767*/
}

// Function: ProcCommonFunc876C @ 0xffc4876c (0x79 bytes)
// Index: 611/2560

int __cdecl ProcCommonFunc876C(int __return_address, unsigned __int8 a2, unsigned __int8 n6, unsigned int a4)
{
  int v4; // eax
  unsigned int v5; // ecx
  unsigned int v6; // ecx
  unsigned int v7; // eax

  v4 = j_CpuIoWrite(__return_address, a2, n6, 285230412); /*0xffc48783*/
  v5 = (a4 >> 1) & 7; /*0xffc48790*/
  if ( v5 ) /*0xffc48796*/
  {
    v6 = v5 - 1; /*0xffc48798*/
    if ( v6 ) /*0xffc4879b*/
    {
      if ( v6 == 1 ) /*0xffc487a0*/
        v7 = v4 & 0xFFFFFFF3 | 4; /*0xffc487aa*/
      else
        v7 = v4 & 0xFFFFFFF3; /*0xffc487a2*/
    }
    else
    {
      v7 = v4 & 0xFFFFFFF3 | 8; /*0xffc487b2*/
    }
  }
  else
  {
    v7 = v4 | 0xC; /*0xffc487b7*/
  }
  j_PciCfgWrite_0( /*0xffc487d6*/
    __return_address,
    a2,
    n6,
    285230412,
    v7 ^ ((unsigned __int8)v7 ^ (unsigned __int8)(16 * *(_BYTE *)(a2 + __return_address + 255537))) & 0x70);
  return 0; /*0xffc487e0*/
}

// Function: ProcCommonFunc87E5 @ 0xffc487e5 (0x157 bytes)
// Index: 612/2560

int __cdecl ProcCommonFunc87E5(int __return_address, _BYTE *n4)
{
  _BYTE *n4_1; // ecx
  unsigned __int8 n4_2; // al
  int v4; // edx
  char v5; // bl
  int v6; // esi
  unsigned int v7; // edi
  int v8; // eax
  int v9; // esi
  unsigned int v10; // edi
  unsigned __int8 n4_3; // [esp+10h] [ebp-8h]
  int v13; // [esp+14h] [ebp-4h]

  n4_1 = n4; /*0xffc487e7*/
  n4_2 = 0; /*0xffc487eb*/
  v4 = 0; /*0xffc487f3*/
  n4_3 = 0; /*0xffc487f7*/
  v13 = 0; /*0xffc487fb*/
  do /*0xffc4892d*/
  {
    if ( (*n4_1 & 1) != 0 && (*n4_1 & 0x60) == 0 ) /*0xffc4880d*/
    {
      v5 = *(_BYTE *)(__return_address + 257257); /*0xffc48813*/
      if ( !v5 ) /*0xffc4881b*/
      {
        if ( ((1 << v4) & *(_DWORD *)(__return_address + 246468)) != 0 ) /*0xffc4882a*/
          goto LABEL_9; /*0xffc4882a*/
        n4_2 = n4_3; /*0xffc4882c*/
        n4_1 = n4; /*0xffc48830*/
      }
      if ( v5 == 1 && *(_BYTE *)(__return_address + 257259) == n4_2 ) /*0xffc48843*/
      {
LABEL_9:
        v6 = j_CpuIoWrite(__return_address, n4_3, 0, 50348636); /*0xffc48849*/
        v7 = j_CpuIoWrite(__return_address, n4_3, 0, 50348640) & 0xFFFFFFE0 | 0x16; /*0xffc48884*/
        j_PciCfgWrite_0(__return_address, n4_3, 0, 50348636, v6 & 0xE0000000 | 0x16B5AD6D); /*0xffc4888a*/
        j_PciCfgWrite_0(__return_address, n4_3, 0, 50348640, v7); /*0xffc48898*/
        v8 = j_CpuIoWrite(__return_address, n4_3, 0, 302139108); /*0xffc488a9*/
        j_PciCfgWrite_0(__return_address, n4_3, 0, 302139108, v8 | 0x20000); /*0xffc488b8*/
        v9 = j_CpuIoWrite(__return_address, n4_3, 0, 285230496); /*0xffc488d3*/
        v10 = j_CpuIoWrite(__return_address, n4_3, 0, 285230500) & 0xFFFFFFE7 | 0x10; /*0xffc488eb*/
        j_PciCfgWrite_0(__return_address, n4_3, 0, 285230496, v9 & 0x7FFFFF80 | 0x8000002E); /*0xffc488f8*/
        j_PciCfgWrite_0(__return_address, n4_3, 0, 285230500, v10); /*0xffc48907*/
        n4_1 = n4; /*0xffc4890c*/
        v4 = v13; /*0xffc48913*/
        n4_2 = n4_3; /*0xffc48917*/
      }
    }
    ++n4_2; /*0xffc48919*/
    n4_1 += 13; /*0xffc4891b*/
    ++v4; /*0xffc4891e*/
    n4_3 = n4_2; /*0xffc4891f*/
    v13 = v4; /*0xffc48923*/
    n4 = n4_1; /*0xffc48927*/
  }
  while ( n4_2 < 4u ); /*0xffc4892d*/
  return 0; /*0xffc48933*/
}

// Function: ProcCommonFunc893C @ 0xffc4893c (0x135 bytes)
// Index: 613/2560

void __cdecl ProcCommonFunc893C(int __return_address)
{
  char SocketNumber; // al
  int v3; // eax
  unsigned __int8 n4; // bl
  int v5; // ebp
  unsigned __int8 n5; // bh
  int v7; // ecx
  int v8; // esi
  unsigned int v9; // esi
  int v10; // esi
  unsigned __int8 n4_1; // [esp+4h] [ebp-Ch]
  int v12; // [esp+8h] [ebp-8h]
  unsigned int v13; // [esp+Ch] [ebp-4h]
  unsigned __int8 n5_1; // [esp+14h] [ebp+4h]

  if ( (*(_BYTE *)(__return_address + 246412) || *(_BYTE *)(__return_address + 246424) >= 9u)
    && *(_BYTE *)(__return_address + 1480) )
  {
    SocketNumber = GetSocketNumber(__return_address); /*0xffc48972*/
    v3 = j_CpuIoWrite(__return_address, SocketNumber, 0, 318914748); /*0xffc4897d*/
    v13 = (unsigned int)v3 >> 31; /*0xffc48996*/
    RcAssertPrint((_BYTE *)__return_address, 4u, (int)"\n AepPresent:%u \n", v3 < 0); /*0xffc4899a*/
    n4 = 0; /*0xffc4899f*/
    n4_1 = 0; /*0xffc489a4*/
    v5 = 0; /*0xffc489a8*/
    do
    {
      if ( ((1 << v5) & *(_DWORD *)(__return_address + 246468)) != 0 )
      {
        n5 = 0; /*0xffc489bd*/
        v7 = 0; /*0xffc489bf*/
        n5_1 = 0; /*0xffc489c1*/
        v12 = 0; /*0xffc489c5*/
        do
        {
          if ( ((unsigned __int8)(1 << v7) & *(_BYTE *)(__return_address + v5 + 255501)) != 0 )
          {
            v8 = j_CpuIoWrite(__return_address, n4_1, n5_1, 201343088); /*0xffc489ea*/
            RcAssertPrint((_BYTE *)__return_address, 4u, (int)"\n read: SpareCsrClx.Data:%d \n", v8);
            v9 = v8 & 0xFFFC0000 | 0x1C40; /*0xffc48a03*/
            if ( (_BYTE)v13 ) /*0xffc48a0e*/
              v9 |= 0x20000u; /*0xffc48a10*/
            v10 = v9 | 0x40000; /*0xffc48a16*/
            j_PciCfgWrite_0(__return_address, n4_1, n5_1, 201343088, v10); /*0xffc48a2b*/
            RcAssertPrint((_BYTE *)__return_address, 4u, (int)"\n write: SpareCsrClx.Data:%d \n", v10);
            v7 = v12; /*0xffc48a3e*/
          }
          ++n5; /*0xffc48a45*/
          ++v7; /*0xffc48a47*/
          n5_1 = n5; /*0xffc48a48*/
          v12 = v7; /*0xffc48a4c*/
        }
        while ( n5 < 5u );
      }
      ++n4; /*0xffc48a59*/
      ++v5; /*0xffc48a5b*/
      n4_1 = n4; /*0xffc48a5c*/
    }
    while ( n4 < 4u );
  }
}

// Function: ProcCommonFunc8A71 @ 0xffc48a71 (0x25a bytes)
// Index: 614/2560

int __cdecl ProcCommonFunc8A71(_BYTE *__return_address, int __return_address_2, unsigned __int8 n4, char a4)
{
  int v4; // eax
  unsigned __int8 n2; // bl
  char v6; // di
  BOOL v7; // edx
  unsigned int v8; // esi
  unsigned __int8 n4_1; // bl
  _BYTE *__return_address_1; // ebp
  int v11; // eax
  int v12; // eax
  unsigned __int8 v13; // al
  int v14; // ecx
  char n6; // dl
  int v16; // ecx
  int v18; // [esp+10h] [ebp-14h]
  int n4_2; // [esp+14h] [ebp-10h]
  int v20; // [esp+18h] [ebp-Ch]
  int v21; // [esp+1Ch] [ebp-8h] BYREF
  int v22; // [esp+20h] [ebp-4h] BYREF
  int v23; // [esp+28h] [ebp+4h]
  unsigned __int8 i; // [esp+34h] [ebp+10h]
  char v25; // [esp+34h] [ebp+10h]
  char n6_1; // [esp+34h] [ebp+10h]

  if ( a4 ) /*0xffc48a7d*/
  {
    n4_1 = n4; /*0xffc48b3f*/
    __return_address_1 = __return_address; /*0xffc48b47*/
    v8 = 0; /*0xffc48b50*/
    n4_2 = n4; /*0xffc48b52*/
    v20 = 0; /*0xffc48b61*/
    v18 = 351 * n4; /*0xffc48b66*/
    DdrTrainFunc612D(__return_address, n4, __return_address[v18 + 255719], &v21, &v22); /*0xffc48b75*/
    for ( i = 0; i < __return_address[v18 + 255719]; ++i ) /*0xffc48b86*/
    {
      v11 = j_CpuIoWrite((int)__return_address, n4, i, 16540); /*0xffc48ba2*/
      j_PciCfgWrite_0((int)__return_address, n4, i, 16540, v21 | v11 & 0xFFFFFF00); /*0xffc48bbc*/
      v12 = j_CpuIoWrite((int)__return_address, n4, i, 16660); /*0xffc48bcc*/
      n4_1 = n4; /*0xffc48be1*/
      j_PciCfgWrite_0((int)__return_address, n4, i, 16660, v22 | v12 & 0xFFFFFF00); /*0xffc48be7*/
    }
  }
  else
  {
    v4 = 6 * n4; /*0xffc48a90*/
    n4_2 = n4; /*0xffc48a93*/
    n2 = *(_BYTE *)(v4 + __return_address_2 + 298); /*0xffc48a97*/
    v6 = *(_BYTE *)(v4 + __return_address_2 + 297); /*0xffc48a9e*/
    v7 = n2 == 2; /*0xffc48aad*/
    v18 = 351 * n4; /*0xffc48ab6*/
    v8 = v7 /*0xffc48ae2*/
       | (16 * (v6 & 0x1F | ((__return_address[v18 + 255719] & 0x1F) << 10)))
       | 2
       | ((v7 | (16 * (v6 & 0x1F | ((__return_address[v18 + 255719] & 0x1F) << 10))) | 2u) >> 5) & 0x3E00;
    v20 = v7 | (16 * ((v6 - 1) & 0x3F)) | 2; /*0xffc48b01*/
    RcAssertPrint( /*0xffc48b22*/
      __return_address,
      4u,
      (int)aSocketDSncDMod,
      n4,
      n2,
      v8,
      0,
      (v8 >> 4) & 0x1F,
      (v8 >> 9) & 0x1F,
      v8 >> 14);
    n4_1 = n4; /*0xffc48b27*/
    __return_address_1 = __return_address; /*0xffc48b2d*/
    DdrTrainFn_FFC6748C(__return_address, __return_address_2, n4); /*0xffc48b32*/
  }
  j_PciCfgWrite_0((int)__return_address_1, n4_1, 0, 50545708, v8); /*0xffc48c0c*/
  v13 = 0; /*0xffc48c11*/
  v25 = 0; /*0xffc48c16*/
  if ( __return_address_1[255496] ) /*0xffc48c1a*/
  {
    v14 = v18; /*0xffc48c22*/
    do /*0xffc48c5e*/
    {
      if ( (__return_address_1[4 * v13 + 255705 + v14] & 1) != 0 ) /*0xffc48c34*/
      {
        j_PciCfgWrite_0((int)__return_address_1, n4_1, v25, 151011712, v8); /*0xffc48c42*/
        v14 = v18; /*0xffc48c47*/
      }
      v13 = v25 + 1; /*0xffc48c52*/
      v25 = v13; /*0xffc48c54*/
    }
    while ( v13 < __return_address_1[255496] ); /*0xffc48c5e*/
  }
  n6 = 1; /*0xffc48c66*/
  v16 = 1; /*0xffc48c68*/
  n6_1 = 1; /*0xffc48c69*/
  v23 = 1; /*0xffc48c6d*/
  do /*0xffc48ca9*/
  {
    if ( ((unsigned __int8)(1 << v16) & __return_address_1[n4_2 + 255497]) != 0 ) /*0xffc48c7d*/
    {
      j_PciCfgWrite_0((int)__return_address_1, n4_1, n6_1, 285230124, v8); /*0xffc48c8b*/
      n6 = n6_1; /*0xffc48c90*/
      v16 = v23; /*0xffc48c97*/
    }
    ++n6; /*0xffc48c9b*/
    ++v16; /*0xffc48c9d*/
    n6_1 = n6; /*0xffc48c9e*/
    v23 = v16; /*0xffc48ca2*/
  }
  while ( (unsigned __int8)n6 < 6u ); /*0xffc48ca9*/
  j_PciCfgWrite_0((int)__return_address_1, n4_1, 0, 50348576, v20); /*0xffc48cb9*/
  return 0; /*0xffc48cc3*/
}

// Function: ProcCommonFunc8CCB @ 0xffc48ccb (0x2d6 bytes)
// Index: 615/2560

int __cdecl ProcCommonFunc8CCB(int __return_address, _BYTE *n4, int buf, unsigned __int8 a4)
{
  unsigned int n0x10000000; // edi
  unsigned int n32; // edi
  unsigned __int8 *v7; // ebx
  int v8; // esi
  int n4_1; // ecx
  int v11; // edi
  int v12; // ecx
  int n6_1; // edx
  int v14; // ecx
  int v15; // eax
  int v16; // eax
  int v17; // eax
  int v18; // eax
  int v19; // eax
  int n4_2; // [esp+10h] [ebp-24h]
  int n6_2; // [esp+14h] [ebp-20h]
  unsigned __int8 n6; // [esp+18h] [ebp-1Ch]
  int v24; // [esp+1Ch] [ebp-18h]
  int v25; // [esp+20h] [ebp-14h]
  int v26; // [esp+24h] [ebp-10h]
  int v27; // [esp+28h] [ebp-Ch]
  int v28; // [esp+2Ch] [ebp-8h]
  int v29; // [esp+30h] [ebp-4h]
  int v30; // [esp+38h] [ebp+4h]

  n0x10000000 = *(_DWORD *)(__return_address + 1528); /*0xffc48cd6*/
  if ( n0x10000000 > 0x10000000 ) /*0xffc48ce2*/
    n32 = n0x10000000 >> 23; /*0xffc48ce9*/
  else
    n32 = 32; /*0xffc48ce6*/
  n6_2 = 0; /*0xffc48cf8*/
  v7 = (unsigned __int8 *)(__return_address + 255743); /*0xffc48d13*/
  v24 = j_CpuIoWrite(__return_address, a4, 0, 50413760) & 0x3FFFFFF; /*0xffc48d1a*/
  v8 = v24; /*0xffc48d1e*/
  n4_1 = 4; /*0xffc48d22*/
  n4_2 = 4; /*0xffc48d23*/
  do /*0xffc48d65*/
  {
    if ( (*n4 & 1) != 0 && (*n4 & 0x60) == 0x20 ) /*0xffc48d32*/
    {
      v8 &= ((unsigned __int8)~(1 << (*v7 / n32)) << 6) | 0xFFFFC03F; /*0xffc48d4f*/
      n4_1 = n4_2; /*0xffc48d51*/
    }
    n4 += 13; /*0xffc48d55*/
    v7 += 351; /*0xffc48d58*/
    n4_2 = --n4_1; /*0xffc48d61*/
  }
  while ( n4_1 ); /*0xffc48d65*/
  v26 = j_CpuIoWrite(__return_address, a4, 0, 50413804); /*0xffc48d84*/
  v11 = a4; /*0xffc48d8c*/
  v12 = 12 * a4; /*0xffc48d93*/
  v27 = *(_DWORD *)(v12 + buf + 51); /*0xffc48d9e*/
  v29 = *(_DWORD *)(v12 + buf + 59); /*0xffc48daa*/
  v28 = *(_DWORD *)(v12 + buf + 55); /*0xffc48dbd*/
  n6_1 = 0; /*0xffc48dc1*/
  v25 = *(_DWORD *)(buf + 129) - 1 + *(_DWORD *)(__return_address + 1528); /*0xffc48dc3*/
  v14 = 0; /*0xffc48dc7*/
  n6 = 0; /*0xffc48dc9*/
  v30 = 0; /*0xffc48dcd*/
  do /*0xffc48f91*/
  {
    if ( ((unsigned __int8)(1 << v14) & *(_BYTE *)(v11 + __return_address + 255497)) != 0 ) /*0xffc48ddd*/
    {
      v15 = j_CpuIoWrite(__return_address, a4, n6, 285229200); /*0xffc48df2*/
      j_PciCfgWrite_0( /*0xffc48e1b*/
        __return_address,
        a4,
        n6,
        285229200,
        *(_DWORD *)(buf + 129) ^ (v15 ^ *(_DWORD *)(buf + 129)) & 0x3FFFFFF);
      v16 = j_CpuIoWrite(__return_address, a4, n6, 285229204); /*0xffc48e2b*/
      j_PciCfgWrite_0(__return_address, a4, n6, 285229204, v16 & 0xFFF80000); /*0xffc48e44*/
      v17 = j_CpuIoWrite(__return_address, a4, n6, 285229208); /*0xffc48e57*/
      j_PciCfgWrite_0(__return_address, a4, n6, 285229208, v25 ^ (v25 ^ v17) & 0x3FFFFFF); /*0xffc48e75*/
      v18 = j_CpuIoWrite(__return_address, a4, n6, 285229212); /*0xffc48e85*/
      j_PciCfgWrite_0(__return_address, a4, n6, 285229212, v18 & 0xFFF80000); /*0xffc48e9e*/
      j_PciCfgWrite_0(__return_address, a4, n6, 285230048, v8); /*0xffc48eb2*/
      j_PciCfgWrite_0(__return_address, a4, n6, 285230052, v26); /*0xffc48ec6*/
      j_PciCfgWrite_0(__return_address, a4, n6, 285230032, v27); /*0xffc48eda*/
      j_PciCfgWrite_0(__return_address, a4, n6, 285230036, v28); /*0xffc48ef1*/
      j_PciCfgWrite_0(__return_address, a4, n6, 285230040, v29); /*0xffc48f08*/
      v19 = j_CpuIoWrite(__return_address, a4, n6, 285229320); /*0xffc48f18*/
      j_PciCfgWrite_0( /*0xffc48f5c*/
        __return_address,
        a4,
        n6,
        285229320,
        ((*(unsigned __int8 *)(39 * (v30 + 9 * a4) + __return_address + 255792) | 0x100) << 8)
      | v19 & 0xFFFF0000
      | *(unsigned __int8 *)(39 * (v30 + 9 * a4) + __return_address + 255791));
      ProcCommonFunc876C(__return_address, a4, n6, v24); /*0xffc48f6b*/
      n6_1 = n6_2; /*0xffc48f70*/
      v14 = v30; /*0xffc48f77*/
      v11 = a4; /*0xffc48f7b*/
    }
    LOBYTE(n6_1) = n6_1 + 1; /*0xffc48f7f*/
    ++v14; /*0xffc48f81*/
    n6_2 = n6_1; /*0xffc48f82*/
    n6 = n6_1; /*0xffc48f86*/
    v30 = v14; /*0xffc48f8a*/
  }
  while ( (unsigned __int8)n6_1 < 6u ); /*0xffc48f91*/
  return 0; /*0xffc48f97*/
}

// Function: DdrTrainingFunc48FA1 @ 0xffc48fa1 (0xaa0 bytes)
// Index: 616/2560

int __usercall DdrTrainingFunc48FA1@<eax>(unsigned int n5@<ebx>, char *__return_address, char *n4, char *buf)
{
  char *__return_address_1; // ebp
  char *buf_2; // ecx
  char *n4_1; // edi
  unsigned __int8 n4_3; // bl
  int v8; // edx
  char *v9; // eax
  int v10; // esi
  int v11; // eax
  char *v12; // eax
  unsigned int v13; // eax
  unsigned int v14; // eax
  int v15; // esi
  char v16; // di
  int v17; // eax
  int v18; // eax
  int *v19; // esi
  unsigned __int8 n4_6; // bl
  char *n4_4; // eax
  char *v22; // edi
  char v23; // al
  char *v24; // edx
  int v25; // ebp
  char *v26; // eax
  char *v27; // ecx
  unsigned int v28; // esi
  int v29; // eax
  char n2; // al
  char n5_2; // dl
  int v32; // edi
  int v33; // esi
  char n3; // al
  unsigned int v35; // eax
  int v36; // edi
  int v37; // eax
  bool v38; // cf
  int v39; // eax
  char v40; // cl
  unsigned int v41; // eax
  int v42; // edi
  int v43; // eax
  int v44; // eax
  char *buf_3; // eax
  unsigned int v46; //... [21438 chars total]

// Function: ProcCommonFunc9A41 @ 0xffc49a41 (0x23e bytes)
// Index: 617/2560

char __cdecl ProcCommonFunc9A41(_BYTE *__return_address, unsigned __int8 n4, int __return_address_1)
{
  unsigned __int8 v4; // al
  int v5; // ecx
  char n3; // al
  char SocketNumber; // al
  int n286326784; // ebp
  int v9; // eax
  int n3_1; // eax
  unsigned int v11; // eax
  unsigned int v12; // eax
  int v14; // [esp+14h] [ebp-8h]
  char v15; // [esp+18h] [ebp-4h]
  _BYTE *v16; // [esp+20h] [ebp+4h]
  BOOL v17; // [esp+20h] [ebp+4h]

  v4 = ProcCommonFunc5831((int)__return_address); /*0xffc49a4d*/
  v15 = v4; /*0xffc49a5e*/
  if ( !__return_address[257255] /*0xffc49a90*/
    || (v5 = 6 * n4, v16 = (_BYTE *)v5, !*(_BYTE *)(v5 + __return_address_1 + 301))
    || !v4
    || !*(_BYTE *)(__return_address_1 + 401) )
  {
    RcAssertPrint(__return_address, 4u, (int)"\nSocket %d XPT and KTI Disabled", n4); /*0xffc49c68*/
    LOBYTE(v12) = ProcCommonFunc1E1D((int)__return_address, n4); /*0xffc49c6f*/
    return v12; /*0xffc49c6f*/
  }
  if ( (__return_address[257309] & 0x63) != 0 )
  {
    RcAssertPrint(__return_address, 2u, (int)"\n WARNING:  KTI Disabled - cannot enable KTI and Mirror together");
    goto LABEL_32; /*0xffc49c4b*/
  }
  n3 = __return_address[246424]; /*0xffc49aaa*/
  if ( n3 == 3 || n3 == 4 || n3 == 5 )
  {
    SocketNumber = GetSocketNumber((int)__return_address); /*0xffc49ac4*/
    if ( j_CpuIoWrite((int)__return_address, SocketNumber, 0, 318914748) < 0 )
    {
      RcAssertPrint(__return_address, 2u, (int)"\n Workaround: XptPrefetch disabled to support DDRT on B step");
LABEL_32:
      LOBYTE(v12) = ProcCommonFunc1E1D((int)__return_address, n4); /*0xffc49c50*/
      return v12; /*0xffc49c5a*/
    }
    v5 = (int)v16; /*0xffc49ae5*/
  }
  v14 = 6 * (n4 + 50); /*0xffc49aef*/
  RcAssertPrint( /*0xffc49b0a*/
    __return_address,
    4u,
    (int)"\nSocket %d XPT or KTI Enabled(Interleave En = %d, Interleave 256B = %d)\n",
    n4,
    *(unsigned __int8 *)(v5 + __return_address_1 + 299),
    *(unsigned __int8 *)(v14 + __return_address_1));
  if ( v16[__return_address_1 + 299] ) /*0xffc49b16*/
  {
    if ( (__return_address[246412] || __return_address[246424] < 3u) /*0xffc49b7f*/
      && ((n3_1 = *(_DWORD *)(74 * n4 + __return_address_1 + 25), n3_1 == 3) || n3_1 == 6 || n3_1 == 5) )
    {
      n286326784 = 286326784; /*0xffc49b81*/
      v9 = -1717991288; /*0xffc49b86*/
    }
    else
    {
      n286326784 = 269488144; /*0xffc49b5f*/
      v9 = -1734829928; /*0xffc49b64*/
    }
    v17 = *(_BYTE *)(v14 + __return_address_1) == 1; /*0xffc49b98*/
  }
  else
  {
    n286326784 = 285217024; /*0xffc49b25*/
    v9 = -1719101048; /*0xffc49b2a*/
    if ( !*(_BYTE *)(74 * n4 + __return_address_1) && *(_BYTE *)(74 * n4 + __return_address_1 + 37) == 1 ) /*0xffc49b3a*/
    {
      n286326784 = 1114129; /*0xffc49b3c*/
      v9 = -2003203943; /*0xffc49b41*/
    }
    v17 = 0; /*0xffc49b46*/
  }
  j_PciCfgWrite_0((int)__return_address, n4, 0, 50479228, v9); /*0xffc49ba6*/
  v11 = (v17 << 17) | j_CpuIoWrite((int)__return_address, n4, 0, 50479252) & 0xFFE186A0 | 0x186A0; /*0xffc49bca*/
  if ( __return_address[257243] == 1 ) /*0xffc49bd6*/
    j_PciCfgWrite_0((int)__return_address, n4, 0, 50479252, v11); /*0xffc49be2*/
  ProcCommonFunc5663((int)__return_address, n4, __return_address_1, v15); /*0xffc49bf1*/
  v12 = j_CpuIoWrite((int)__return_address, n4, 0, 50479248) & 0xFC000000 | 0x40280; /*0xffc49c0d*/
  if ( __return_address[257243] == 1 ) /*0xffc49c19*/
    LOBYTE(v12) = j_PciCfgWrite_0((int)__return_address, n4, 0, 50479248, v12); /*0xffc49c21*/
  if ( __return_address[8307] ) /*0xffc49c29*/
    LOBYTE(v12) = ProcCommonFunc8578(__return_address, n4, v17, n286326784); /*0xffc49c39*/
  return v12; /*0xffc49c77*/
}

// Function: ProcCommonFunc9C7F @ 0xffc49c7f (0x71 bytes)
// Index: 618/2560

void __cdecl ProcCommonFunc9C7F(int __return_address)
{
  int __return_address_1; // esi
  unsigned __int8 n4; // bl
  char v3; // di
  int v4; // eax
  int v5; // edx
  unsigned __int64 v6; // [esp-1Ch] [ebp-20h]

  __return_address_1 = __return_address; /*0xffc49c83*/
  if ( !*(_BYTE *)(__return_address + 246412) && *(_BYTE *)(__return_address + 246424) > 5u ) /*0xffc49c96*/
  {
    n4 = 0; /*0xffc49c99*/
    LOBYTE(__return_address) = 0; /*0xffc49c9c*/
    v3 = 0; /*0xffc49c9f*/
    do /*0xffc49ce9*/
    {
      if ( ((1 << v3) & *(_DWORD *)(__return_address_1 + 246468)) != 0 /*0xffc49cb7*/
        && (*(_BYTE *)(__return_address_1 + 246408) & 4) == 0 )
      {
        v4 = KtiFunc2C7D(__return_address_1, __return_address, 0x64u); /*0xffc49cbf*/
        HIDWORD(v6) = v5; /*0xffc49cce*/
        LODWORD(v6) = v4 & 0xFFFFFFE0 | *(unsigned __int8 *)(__return_address_1 + 257253); /*0xffc49cd1*/
        KtiFunc35EC(__return_address_1, __return_address, 0x64u, v6); /*0xffc49cd8*/
      }
      ++n4; /*0xffc49ce0*/
      ++v3; /*0xffc49ce2*/
      LOBYTE(__return_address) = n4; /*0xffc49ce3*/
    }
    while ( n4 < 4u ); /*0xffc49ce9*/
  }
}

// Function: ProcCommonFunc9CF0 @ 0xffc49cf0 (0xe1 bytes)
// Index: 619/2560

void __cdecl ProcCommonFunc9CF0(int __return_address)
{
  int v2; // ecx
  int v3; // edi
  int n4; // edx
  unsigned __int8 n4_1; // bl
  unsigned __int8 *v6; // edi
  int v7; // ebp
  unsigned __int8 v8; // bh
  int v9; // eax
  unsigned __int8 v10; // [esp+4h] [ebp-10h]
  unsigned __int8 n4_2; // [esp+8h] [ebp-Ch]
  int v12; // [esp+Ch] [ebp-8h]
  unsigned __int8 n2; // [esp+18h] [ebp+4h]

  if ( *(_BYTE *)(__return_address + 246412) || *(_BYTE *)(__return_address + 246424) >= 9u ) /*0xffc49d08*/
  {
    v2 = 0; /*0xffc49d12*/
    v3 = *(_DWORD *)(__return_address + 246468); /*0xffc49d16*/
    n2 = *(_BYTE *)(__return_address + 120); /*0xffc49d1e*/
    n4 = 4; /*0xffc49d22*/
    do /*0xffc49d3c*/
    {
      if ( ((1 << v2) & v3) != 0 && *(_BYTE *)(__return_address + v2 + 93) ) /*0xffc49d2c*/
        n2 = 2; /*0xffc49d33*/
      ++v2; /*0xffc49d38*/
      --n4; /*0xffc49d39*/
    }
    while ( n4 ); /*0xffc49d3c*/
    n4_1 = 0; /*0xffc49d3e*/
    v6 = (unsigned __int8 *)(__return_address + 255719); /*0xffc49d40*/
    v7 = 0; /*0xffc49d46*/
    n4_2 = 0; /*0xffc49d48*/
    v12 = 0; /*0xffc49d4c*/
    do /*0xffc49dc7*/
    {
      if ( ((1 << v7) & *(_DWORD *)(__return_address + 246468)) != 0 ) /*0xffc49d5d*/
      {
        v8 = 0; /*0xffc49d5f*/
        v10 = 0; /*0xffc49d61*/
        if ( *v6 ) /*0xffc49d65*/
        {
          do /*0xffc49dad*/
          {
            v9 = j_CpuIoWrite(__return_address, n4_2, v10, 16793852); /*0xffc49d84*/
            j_PciCfgWrite_0(__return_address, n4_2, v10, 16793852, (2 * n2) | v9 & 0xFFFFFFF9); /*0xffc49d9d*/
            v10 = ++v8; /*0xffc49da7*/
          }
          while ( v8 < *v6 ); /*0xffc49dad*/
          v7 = v12; /*0xffc49daf*/
        }
      }
      ++n4_1; /*0xffc49db3*/
      v6 += 351; /*0xffc49db5*/
      ++v7; /*0xffc49dbb*/
      n4_2 = n4_1; /*0xffc49dbc*/
      v12 = v7; /*0xffc49dc0*/
    }
    while ( n4_1 < 4u ); /*0xffc49dc7*/
  }
}

// Function: ProcCommonFunc9DD1 @ 0xffc49dd1 (0x16b bytes)
// Index: 620/2560

int __cdecl ProcCommonFunc9DD1(
        _BYTE *__return_address,
        unsigned __int8 n4,
        unsigned __int8 a3,
        unsigned __int8 n3,
        int *a5,
        char *a6)
{
  int v6; // ecx
  unsigned __int8 v8; // bl
  int result; // eax
  int v10; // ebp
  unsigned __int8 v11; // cl
  _BYTE *v12; // ebp
  int v13; // esi
  unsigned __int8 v14; // cl
  unsigned __int8 v15; // al
  unsigned __int16 v16; // si
  _BYTE *v17; // [esp+10h] [ebp-Ch]
  int n4_1; // [esp+14h] [ebp-8h]
  __int16 n4a; // [esp+24h] [ebp+8h]
  int v20; // [esp+28h] [ebp+Ch]

  v6 = 48704 * n4; /*0xffc49dd9*/
  v8 = 0; /*0xffc49de4*/
  n4_1 = n4; /*0xffc49de6*/
  result = (unsigned __int8)(n3 + 3 * a3); /*0xffc49dfb*/
  v17 = &__return_address[v6 + 258722]; /*0xffc49e0c*/
  v20 = 7688 * result; /*0xffc49e10*/
  v10 = v6 + 7688 * result; /*0xffc49e14*/
  v11 = v17[7688 * result + 3]; /*0xffc49e17*/
  v12 = &__return_address[v10]; /*0xffc49e1b*/
  if ( v11 ) /*0xffc49e1f*/
  {
    result *= 7688; /*0xffc49e25*/
    do /*0xffc49f2e*/
    {
      v13 = 1379 * v8; /*0xffc49e2f*/
      if ( v12[v13 + 259118] ) /*0xffc49e35*/
      {
        RcAssertPrint( /*0xffc49e71*/
          __return_address,
          4u,
          (int)"\n Socket %d Mc %d Ch %d maxDimm %d Dimm = %d numDramRanks= %d ",
          n4_1,
          a3,
          n3,
          v11,
          v8,
          (unsigned __int8)v17[v13 + 416 + result]);
        if ( v12[v13 + 259225] ) /*0xffc49e79*/
        {
          *a6 = 1; /*0xffc49e8f*/
          RcAssertPrint(__return_address, 4u, (int)"Aep TechIndex = "); /*0xffc49e92*/
          v14 = v12[v13 + 259140]; /*0xffc49e97*/
          n4a = 0; /*0xffc49ea1*/
        }
        else
        {
          RcAssertPrint(__return_address, 4u, (int)"    TechIndex = "); /*0xffc49eb0*/
          v14 = v12[v13 + 259139]; /*0xffc49eb5*/
          n4a = word_FFD299E0[v14]; /*0xffc49eca*/
        }
        RcAssertPrint(__return_address, 4u, (int)"%d", v14); /*0xffc49eda*/
        v15 = v12[v13 + 259138]; /*0xffc49edf*/
        if ( v15 ) /*0xffc49eeb*/
          v16 = n4a * v15; /*0xffc49efa*/
        else
          v16 = 0; /*0xffc49eff*/
        RcAssertPrint(__return_address, 4u, (int)" DimmSize 0x%x", v16); /*0xffc49f0f*/
        *(_WORD *)a5 += v16; /*0xffc49f1b*/
        result = v20; /*0xffc49f1e*/
      }
      ++v8; /*0xffc49f26*/
      v11 = v17[result + 3]; /*0xffc49f28*/
    }
    while ( v8 < v11 ); /*0xffc49f2e*/
  }
  return result; /*0xffc49f34*/
}

// Function: ProcCommonFunc9F3C @ 0xffc49f3c (0x179 bytes)
// Index: 621/2560

void __usercall ProcCommonFunc9F3C(unsigned int a1@<ebx>, int __return_address)
{
  char SocketNumber; // al
  unsigned __int8 n4_1; // dl
  int v5; // ecx
  unsigned __int8 *v6; // ebp
  unsigned __int8 i; // bl
  int v8; // eax
  bool v9; // zf
  char v10; // di
  unsigned __int8 v11; // bl
  int v12; // edi
  int v13; // eax
  unsigned __int8 p_i; // [esp+7h] [ebp-11h] BYREF
  int v15; // [esp+8h] [ebp-10h]
  unsigned __int8 v16[4]; // [esp+Ch] [ebp-Ch]
  unsigned __int8 v17[4]; // [esp+10h] [ebp-8h]
  unsigned int v18; // [esp+14h] [ebp-4h]
  unsigned __int8 n4; // [esp+1Ch] [ebp+4h]

  p_i = 0; /*0xffc49f44*/
  if ( *(_BYTE *)(__return_address + 257105) ) /*0xffc49f49*/
  {
    if ( *(_BYTE *)(__return_address + 8325) == 2 ) /*0xffc49f61*/
    {
      SocketNumber = GetSocketNumber(__return_address); /*0xffc49f6b*/
      a1 = (unsigned int)j_CpuIoWrite(__return_address, SocketNumber, 0, 318914748) >> 31; /*0xffc49f83*/
    }
    else
    {
      LOBYTE(a1) = *(_BYTE *)(__return_address + 8325); /*0xffc49f8b*/
    }
    n4_1 = 0; /*0xffc49f8d*/
    v18 = a1; /*0xffc49f8f*/
    v5 = 0; /*0xffc49f93*/
    n4 = 0; /*0xffc49f95*/
    v15 = 0; /*0xffc49f99*/
    v6 = (unsigned __int8 *)(__return_address + 255719); /*0xffc49f9d*/
    do /*0xffc4a0a7*/
    {
      if ( ((1 << v5) & *(_DWORD *)(__return_address + 246468)) != 0 ) /*0xffc49fae*/
      {
        if ( (_BYTE)a1 == 1 ) /*0xffc49fb7*/
        {
          if ( !KtiFuncE78(__return_address, 0, 9u) ) /*0xffc49fbe*/
          {
            ProcCommonFunc8B33(__return_address, n4, &p_i); /*0xffc49fd4*/
            v16[0] = 0; /*0xffc49fdc*/
            if ( p_i ) /*0xffc49fe6*/
            {
              for ( i = v16[0]; i < p_i; v16[0] = i ) /*0xffc49fe8*/
              {
                v8 = j_CpuIoWrite(__return_address, n4, v16[0], 100679912); /*0xffc49ffa*/
                j_PciCfgWrite_0(__return_address, n4, v16[0], 100679912, v8 & 0xEFFFFFFF); /*0xffc4a013*/
                ++i; /*0xffc4a01b*/
              }
              LOBYTE(a1) = v18; /*0xffc4a027*/
            }
          }
          n4_1 = n4; /*0xffc4a02b*/
          v5 = v15; /*0xffc4a02f*/
        }
        v9 = *v6 == 0; /*0xffc4a033*/
        v17[0] = 0; /*0xffc4a037*/
        if ( !v9 ) /*0xffc4a03c*/
        {
          v10 = a1; /*0xffc4a03e*/
          v11 = v17[0]; /*0xffc4a041*/
          v12 = (v10 & 1) << 12; /*0xffc4a048*/
          do /*0xffc4a085*/
          {
            v13 = j_CpuIoWrite(__return_address, n4, v17[0], 16668); /*0xffc4a059*/
            j_PciCfgWrite_0(__return_address, n4, v17[0], 16668, v12 | v13 & 0xFFFFEFFF); /*0xffc4a074*/
            v17[0] = ++v11; /*0xffc4a07e*/
          }
          while ( v11 < *v6 ); /*0xffc4a085*/
          LOBYTE(a1) = v18; /*0xffc4a087*/
          n4_1 = n4; /*0xffc4a08b*/
          v5 = v15; /*0xffc4a08f*/
        }
      }
      ++n4_1; /*0xffc4a093*/
      v6 += 351; /*0xffc4a095*/
      ++v5; /*0xffc4a09b*/
      n4 = n4_1; /*0xffc4a09c*/
      v15 = v5; /*0xffc4a0a0*/
    }
    while ( n4_1 < 4u ); /*0xffc4a0a7*/
  }
}

// Function: ProcCommonFuncA0B5 @ 0xffc4a0b5 (0x17 bytes)
// Index: 622/2560

int __cdecl ProcCommonFuncA0B5(_BYTE *__return_address, int n4, int buf)
{
  ProcCommonFuncA0CC(__return_address, n4, buf); /*0xffc4a0c1*/
  return 0; /*0xffc4a0cb*/
}

// Function: ProcCommonFuncA0CC @ 0xffc4a0cc (0x6d0 bytes)
// Index: 623/2560

int __cdecl ProcCommonFuncA0CC(_BYTE *__return_address, int n4, int buf)
{
  int v3; // edx
  unsigned __int8 n4_1; // bl
  int v5; // edi
  char v6; // bp
  int buf_1; // edx
  unsigned __int8 n4a_3; // bh
  unsigned __int8 *v9; // ebp
  int v10; // eax
  unsigned __int8 *v11; // edi
  unsigned __int8 n4a_1; // bp
  unsigned __int8 n6; // bl
  unsigned int v14; // eax
  unsigned int v15; // eax
  unsigned int v16; // eax
  unsigned int v17; // eax
  int v18; // eax
  int v19; // eax
  int v20; // eax
  int v21; // eax
  int v22; // edi
  char n4a_2; // al
  int v24; // ecx
  int v25; // edi
  int v26; // eax
  int v27; // eax
  int v28; // eax
  unsigned __int8 *v29; // edi
  unsigned __int8 i_1; // bl
  int v31; // eax
  int v32; // eax
  unsigned __int8 j; // dl
  int v34; // eax
  int v35; // eax
  unsigned int v36; // eax
  unsigned int v37; // eax
  unsigned __int8 k_1; // bl
  int v39; // eax
  unsigned __int8 m_1; // bl
  unsigned __int8 v41; // al
  unsigned __int8 *v42; // ed... [11236 chars total]

// Function: DebugLogPrint_17 @ 0xffc4a79c (0x38d bytes)
// Index: 624/2560

int __cdecl DebugLogPrint_17(
        char *__return_address,
        char *n4,
        char *buf,
        unsigned int *p_p_i,
        unsigned int i,
        unsigned __int8 a6)
{
  unsigned int *i_1; // ebp
  char *n4_1; // esi
  unsigned int p_i_1; // eax
  unsigned __int8 j_1; // bl
  unsigned int p_i_2; // ecx
  int v11; // edx
  unsigned __int8 i_2; // si
  int v13; // eax
  int v14; // eax
  unsigned __int8 v15; // bl
  unsigned int v16; // ecx
  int v17; // eax
  int v19; // [esp-4h] [ebp-38h]
  unsigned __int8 p_i_3; // [esp+10h] [ebp-24h]
  int p_i_4; // [esp+14h] [ebp-20h]
  unsigned int p_i; // [esp+18h] [ebp-1Ch] BYREF
  unsigned int j; // [esp+1Ch] [ebp-18h]
  int v24; // [esp+20h] [ebp-14h]
  unsigned __int8 v25[4]; // [esp+24h] [ebp-10h]
  int v26; // [esp+28h] [ebp-Ch]
  int v27; // [esp+2Ch] [ebp-8h]
  char v28[4]; // [esp+30h] [ebp-4h]
  int n4a; // [esp+3Ch] [ebp+8h]

  i_1 = (unsigned int *)i; /*0xffc4a7a5*/
  v19 = (*(_DWORD *)i >> 1) & 7; /*0xffc4a7bf*/
  v28[0] = buf[1]; /*0xffc4a7c8*/
  RcAssertPrint(__return_address, 8u, (int)"\n Setting boot path for CPU%u ", v19); /*0xffc4a7cc*/
  p_i_2 = *i_1; /*0xffc4a7d8*/
  n4_1 = n4; /*0xffc4a7db*/
  p_i_1 = *p_p_i; /*0xffc4a7e2*/
  j_1 = 0; /*0xffc4a7e4*/
  v24 = (unsigned __int8)v28[0]; /*0xffc4a7e8*/
  p_i = p_i_2; /*0xffc4a7ee*/
  LOBYTE(p_i_2) = a6; /*0xffc4a7f2*/
  i = p_i_1; /*0xffc4a7f6*/
  v26 = 2 * (unsigned __int8)v28[0]; /*0xffc4a7fa*/
LABEL_2:
  p_i_3 = p_i_2; /*0xffc4a7fe*/
  for ( j = p_i_2; ; LOBYTE(p_i_2) = j )
  {
    v11 = (p_i_1 >> 1) & 7; /*0xffc4a80a*/
    if ( v11 == v24 && (p_i_1 & 0x30) == 0 ) /*0xffc4a815*/
      break; /*0xffc4a815*/
    if ( ((p_i_1 >> 4) & 3) != 0 )
    {
      KtiDebugPrint((unsigned __int8)(1 << v11), (p_i_1 >> 4) & 3, 0, 220, 1, (int)__return_address); /*0xffc4a994*/
      RcAssertPrint(__return_address, 1u, (int)"\n Unknown Intermediate Socket Type found. Topology not supported"); /*0xffc4a9a1*/
      RcAssertPrint(
        __return_address,
        1u,
        (int)"\n\n %s: %u   %s ",
        "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiMain.c",
        2058,
        "FALSE");
      KtiDebugAssert((int)__return_address, 220, 1); /*0xffc4a9ca*/
    }
    else
    {
      j_1 = BYTE1(p_i_1) & 0xF; /*0xffc4a838*/
      p_i_4 = (unsigned __int8)p_i_2; /*0xffc4a83b*/
      v25[0] = BYTE1(p_i_1) & 0xF; /*0xffc4a84c*/
      v27 = BYTE1(p_i_1) & 0xF; /*0xffc4a850*/
      RcAssertPrint( /*0xffc4a854*/
        __return_address,
        8u,
        (int)"\n    In CPU%u connecting port %u to %u. \n",
        v11,
        v27,
        (unsigned __int8)p_i_2);
      if ( (_BYTE)j == j_1 )
      {
        RcAssertPrint(
          __return_address,
          1u,
          (int)"\n\n %s: %u   %s ",
          "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiMain.c",
          2032,
          "(cLocalPort != pLocalPort)");
        KtiDebugAssert((int)__return_address, 223, 113); /*0xffc4a886*/
      }
      i_2 = v25[0]; /*0xffc4a892*/
      v13 = j_CpuIoWrite((int)__return_address, (i >> 1) & 7, v25[0], 151011576); /*0xffc4a8a5*/
      j_PciCfgWrite_0( /*0xffc4a8d9*/
        (int)__return_address,
        (i >> 1) & 7,
        i_2,
        151011576,
        (p_i_4 << (2 * ((*i_1 >> 1) & 7))) | v13 & ~(3 << (2 * ((*i_1 >> 1) & 7))));
      v14 = j_CpuIoWrite((int)__return_address, (i >> 1) & 7, p_i_3, 151011576); /*0xffc4a8f4*/
      j_PciCfgWrite_0((int)__return_address, (i >> 1) & 7, p_i_3, 151011576, (v27 << v26) | ~(3 << v26) & v14); /*0xffc4a928*/
      ProcCommonFunc868B((int)__return_address, i_2, (i >> 1) & 7, (*i_1 >> 1) & 7, p_i_3); /*0xffc4a94d*/
      ProcCommonFunc868B((int)__return_address, p_i_3, (i >> 1) & 7, v28[0], i_2); /*0xffc4a968*/
      n4_1 = n4; /*0xffc4a96d*/
    }
    p_i = i; /*0xffc4a9d6*/
    ProcCommonFunc8C88(__return_address, (int)(n4_1 + 52), &p_i, &i); /*0xffc4a9e9*/
    p_i_1 = i; /*0xffc4a9ee*/
    if ( (i & 0x30) == 0 ) /*0xffc4a9f7*/
    {
      p_i_2 = (*(_DWORD *)&n4_1[13 * ((p_i >> 1) & 7) + 1 + 4 * j_1] >> 6) & 0xFFFFFF0F; /*0xffc4aa11*/
      goto LABEL_2; /*0xffc4aa17*/
    }
    RcAssertPrint(
      __return_address,
      1u,
      (int)"\n\n %s: %u   %s ",
      "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiMain.c",
      2068,
      "FALSE");
    KtiDebugAssert((int)__return_address, 223, 114); /*0xffc4aa40*/
    p_i_1 = i; /*0xffc4aa45*/
  }
  n4a = (*(_DWORD *)&n4_1[13 * ((*p_p_i >> 1) & 7) + 1 + 4 * a6] >> 6) & 0xF; /*0xffc4aa77*/
  RcAssertPrint(__return_address, 8u, (int)"\n    In CPU%u setting Cbo route to port %u\n", (*i_1 >> 1) & 7, n4a); /*0xffc4aa8c*/
  v15 = 0; /*0xffc4aa94*/
  v16 = *i_1 >> 1; /*0xffc4aa9d*/
  a6 = 0; /*0xffc4aaa1*/
  if ( buf[(v16 & 7) + 10] ) /*0xffc4aaa8*/
  {
    do /*0xffc4ab0d*/
    {
      v17 = j_CpuIoWrite((int)__return_address, v16 & 7, a6, 16793844); /*0xffc4aabf*/
      j_PciCfgWrite_0( /*0xffc4aaf1*/
        (int)__return_address,
        (*i_1 >> 1) & 7,
        a6,
        16793844,
        (n4a << (2 * buf[1])) | v17 & ~(3 << (2 * buf[1])));
      v16 = *i_1 >> 1; /*0xffc4aafc*/
      a6 = ++v15; /*0xffc4ab02*/
    }
    while ( v15 < (unsigned __int8)buf[(v16 & 7) + 10] ); /*0xffc4ab0d*/
  }
  RcAssertPrint(__return_address, 4u, (int)"\n"); /*0xffc4ab17*/
  return 0; /*0xffc4ab21*/
}

// Function: DebugLogPrint_12 @ 0xffc4ab29 (0x4c8 bytes)
// Index: 625/2560

int __usercall DebugLogPrint_12@<eax>(
        unsigned int i@<ebx>,
        char *__return_address,
        char *n4,
        char *buf,
        unsigned int *p_p_n66588417,
        unsigned int *p_n66588417,
        unsigned __int8 ia)
{
  const char *PGA; // eax
  char *n4_1; // esi
  unsigned int p_n66588417_1; // eax
  unsigned int i_4; // ecx
  int v11; // edx
  unsigned __int8 i_3; // si
  int v13; // eax
  int v14; // eax
  const char *PGA_1; // eax
  int i_5; // esi
  unsigned int p_n66588417_3; // eax
  unsigned int v18; // edx
  unsigned int *p_n66588417_4; // ebp
  int v20; // eax
  int ib_1; // eax
  unsigned __int8 ib_3; // bl
  int v23; // eax
  int v24; // esi
  int v25; // esi
  int v26; // eax
  unsigned int p_n66588417_2; // [esp+10h] [ebp-2Ch] BYREF
  unsigned int i_1; // [esp+14h] [ebp-28h]
  unsigned int p_i; // [esp+18h] [ebp-24h] BYREF
  unsigned int i_2; // [esp+1Ch] [ebp-20h]
  int ib_2; // [esp+20h] [ebp-1Ch]
  char v33[4]; // [esp+24h] [ebp-18h]
  int v34; // [esp+28h] [ebp-14h]
  unsigned __int8 v35[4]; // [esp+2Ch] [ebp-10h]
  int v36; // [esp+30h] [ebp-Ch]
  int i_6; // [esp+34h] [ebp-8h]
  unsigned int v38; // [esp+38h] [ebp-4h]
  unsigned int *p_p_n66588417a; // [esp+4Ch] [ebp+10h]
  unsigned __int8 ib; // [esp+54h] [ebp+18h]

  ib_2 = 0; /*0xffc4ab2e*/
  LOBYTE(i_2) = 0; /*0xffc4ab32*/
  v33[0] = buf[1]; /*0xffc4ab43*/
  PGA = "PGA"; /*0xffc4ab51*/
  if ( (*p_n66588417 & 0x30) != 0x10 ) /*0xffc4ab57*/
    PGA = "CPU"; /*0xffc4ab59*/
  RcAssertPrint(__return_address, 8u, (int)"\n   Setting path between SBSP and %s%u. ", PGA, (*p_n66588417 >> 1) & 7); /*0xffc4ab71*/
  LOBYTE(i) = ia; /*0xffc4ab80*/
  n4_1 = n4; /*0xffc4ab84*/
  p_n66588417_1 = *p_p_n66588417; /*0xffc4ab88*/
  p_i = *p_n66588417; /*0xffc4ab8a*/
  p_n66588417_2 = p_n66588417_1; /*0xffc4ab95*/
  i_1 = i; /*0xffc4aba1*/
  v38 = (*(_DWORD *)&n4[13 * ((p_n66588417_1 >> 1) & 7) + 1 + 4 * ia] >> 6) & 0xFFFFFF0F; /*0xffc4abb9*/
  v34 = (unsigned __int8)v33[0]; /*0xffc4abc2*/
  v36 = 2 * (unsigned __int8)v33[0]; /*0xffc4abc8*/
LABEL_4:
  LOBYTE(i_4) = i_1; /*0xffc4abcc*/
  while ( 1 )
  {
    v11 = (p_n66588417_1 >> 1) & 7; /*0xffc4abd4*/
    if ( v11 == v34 && (p_n66588417_1 & 0x30) == 0 ) /*0xffc4abdf*/
      break; /*0xffc4abdf*/
    if ( ((p_n66588417_1 >> 4) & 3) != 0 )
    {
      KtiDebugPrint((unsigned __int8)(1 << v11), (p_n66588417_1 >> 4) & 3, 0, 220, 1, (int)__return_address); /*0xffc4ad64*/
      RcAssertPrint(__return_address, 1u, (int)"\n Unknown Intermediate Socket Type found. Topology not supported"); /*0xffc4ad71*/
      RcAssertPrint(
        __return_address,
        1u,
        (int)"\n\n %s: %u   %s ",
        "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiMain.c",
        1949,
        "FALSE");
      KtiDebugAssert((int)__return_address, 220, 9); /*0xffc4ad9a*/
    }
    else
    {
      i_2 = (p_n66588417_1 >> 8) & 0xFFFFFF0F; /*0xffc4ac05*/
      v35[0] = BYTE1(p_n66588417_1) & 0xF; /*0xffc4ac09*/
      p_p_n66588417a = (unsigned int *)(unsigned __int8)i_4; /*0xffc4ac1a*/
      i_6 = (unsigned __int8)i_2; /*0xffc4ac1e*/
      RcAssertPrint( /*0xffc4ac22*/
        __return_address,
        8u,
        (int)"\n    In CPU%u connecting port %u to %u.\n",
        v11,
        (unsigned __int8)i_2,
        (unsigned __int8)i_4);
      if ( (_BYTE)i_2 == (_BYTE)i_1 )
      {
        RcAssertPrint(
          __return_address,
          1u,
          (int)"\n\n %s: %u   %s ",
          "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiMain.c",
          1922,
          "(pLocalPort != cLocalPort)");
        KtiDebugAssert((int)__return_address, 223, 111); /*0xffc4ac58*/
      }
      i_3 = v35[0]; /*0xffc4ac64*/
      v13 = j_CpuIoWrite((int)__return_address, (p_n66588417_2 >> 1) & 7, v35[0], 151011576); /*0xffc4ac77*/
      j_PciCfgWrite_0( /*0xffc4acaa*/
        (int)__return_address,
        (p_n66588417_2 >> 1) & 7,
        i_3,
        151011576,
        ((_DWORD)p_p_n66588417a << (2 * ((*p_n66588417 >> 1) & 7))) | v13 & ~(3 << (2 * ((*p_n66588417 >> 1) & 7))));
      v14 = j_CpuIoWrite((int)__return_address, (p_n66588417_2 >> 1) & 7, ia, 151011576); /*0xffc4acc5*/
      j_PciCfgWrite_0((int)__return_address, (p_n66588417_2 >> 1) & 7, ia, 151011576, (i_6 << v36) | ~(3 << v36) & v14); /*0xffc4acf8*/
      ProcCommonFunc868B((int)__return_address, i_3, (p_n66588417_2 >> 1) & 7, (*p_n66588417 >> 1) & 7, ia); /*0xffc4ad1d*/
      ProcCommonFunc868B((int)__return_address, ia, (p_n66588417_2 >> 1) & 7, v33[0], i_3); /*0xffc4ad38*/
      n4_1 = n4; /*0xffc4ad3d*/
    }
    p_i = p_n66588417_2; /*0xffc4ada6*/
    ProcCommonFunc8C88(__return_address, (int)(n4_1 + 52), &p_i, &p_n66588417_2); /*0xffc4adb9*/
    p_n66588417_1 = p_n66588417_2; /*0xffc4adbe*/
    if ( (p_n66588417_2 & 0x30) != 0 )
    {
      RcAssertPrint(
        __return_address,
        1u,
        (int)"\n\n %s: %u   %s ",
        "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiMain.c",
        1959,
        "FALSE");
      KtiDebugAssert((int)__return_address, 223, 112); /*0xffc4ae1c*/
      p_n66588417_1 = p_n66588417_2; /*0xffc4ae21*/
      goto LABEL_4; /*0xffc4ae28*/
    }
    i_4 = (*(_DWORD *)&n4_1[13 * ((p_i >> 1) & 7) + 1 + 4 * (unsigned __int8)i_2] >> 6) & 0xFFFFFF0F; /*0xffc4ade5*/
    i_1 = i_4; /*0xffc4adeb*/
    ia = i_4; /*0xffc4adef*/
  }
  PGA_1 = "PGA"; /*0xffc4ae36*/
  if ( (*p_n66588417 & 0x30) != 0x10 ) /*0xffc4ae3b*/
    PGA_1 = "CPU"; /*0xffc4ae3d*/
  i_5 = (unsigned __int8)i_4; /*0xffc4ae42*/
  RcAssertPrint( /*0xffc4ae55*/
    __return_address,
    8u,
    (int)"\n   In SBSP setting route to %s%u using port %u.\n",
    PGA_1,
    (*p_n66588417 >> 1) & 7,
    (unsigned __int8)i_4);
  p_n66588417_3 = p_n66588417_2; /*0xffc4ae5a*/
  v18 = p_n66588417_2 >> 1; /*0xffc4ae67*/
  ib = 0; /*0xffc4ae6b*/
  p_n66588417_4 = p_n66588417; /*0xffc4ae78*/
  if ( buf[((p_n66588417_2 >> 1) & 7) + 10] ) /*0xffc4ae73*/
  {
    do /*0xffc4aef7*/
    {
      v20 = j_CpuIoWrite((int)__return_address, v18 & 7, ib, 16793844); /*0xffc4ae8f*/
      j_PciCfgWrite_0( /*0xffc4aec3*/
        (int)__return_address,
        (p_n66588417_2 >> 1) & 7,
        ib,
        16793844,
        (i_5 << (2 * ((*p_n66588417_4 >> 1) & 7))) | v20 & ~(3 << (2 * ((*p_n66588417_4 >> 1) & 7))));
      ib_1 = ib_2; /*0xffc4aec8*/
      LOBYTE(ib_1) = ib_2 + 1; /*0xffc4aed3*/
      ib_2 = ib_1; /*0xffc4aed5*/
      ib_3 = ib_1; /*0xffc4aed9*/
      ib = ib_1; /*0xffc4aedb*/
      p_n66588417_3 = p_n66588417_2; /*0xffc4aedf*/
      v18 = p_n66588417_2 >> 1; /*0xffc4aee5*/
      p_n66588417_4 = p_n66588417; /*0xffc4aef2*/
    }
    while ( ib_3 < (unsigned __int8)buf[((p_n66588417_2 >> 1) & 7) + 10] ); /*0xffc4aef7*/
  }
  v23 = j_CpuIoWrite((int)__return_address, (p_n66588417_3 >> 1) & 7, 1u, 201334848); /*0xffc4af09*/
  j_PciCfgWrite_0( /*0xffc4af39*/
    (int)__return_address,
    (p_n66588417_2 >> 1) & 7,
    1u,
    201334848,
    (i_5 << (2 * ((*p_n66588417_4 >> 1) & 7))) | v23 & ~(3 << (2 * ((*p_n66588417_4 >> 1) & 7))));
  if ( (*p_n66588417_4 & 0x30) == 0 ) /*0xffc4af46*/
  {
    v24 = (unsigned __int8)v38; /*0xffc4af50*/
    RcAssertPrint( /*0xffc4af62*/
      __return_address,
      8u,
      (int)"\n   In CPU%u using port %u to set the M2UPCIe0 route.\n",
      (*p_n66588417_4 >> 1) & 7,
      (unsigned __int8)v38);
    if ( __return_address[246412] || (unsigned __int8)__return_address[246424] >= 3u ) /*0xffc4af7a*/
    {
      v26 = j_CpuIoWrite((int)__return_address, (*p_n66588417_4 >> 1) & 7, 1u, 201334848); /*0xffc4af9e*/
      v25 = v26 & ~(3 << (2 * ((p_n66588417_2 >> 1) & 7))) | (v24 << (2 * ((p_n66588417_2 >> 1) & 7))); /*0xffc4afb9*/
    }
    else
    {
      v25 = v24 << (2 * ((p_n66588417_2 >> 1) & 7)); /*0xffc4af87*/
    }
    j_PciCfgWrite_0((int)__return_address, (*p_n66588417_4 >> 1) & 7, 1u, 201334848, v25); /*0xffc4afcf*/
  }
  RcAssertPrint(__return_address, 8u, (int)"\n"); /*0xffc4afdf*/
  return 0; /*0xffc4afe9*/
}

// Function: ProcMemInitFuncAFF1 @ 0xffc4aff1 (0x92b bytes)
// Index: 626/2560

int __cdecl ProcMemInitFuncAFF1(char *__return_address, char *n4, char *buf)
{
  char *buf_1; // edi
  unsigned int n216; // ebx
  char *n216_1; // eax
  unsigned int p_n66588417_1; // ecx
  int v8; // eax
  unsigned int p_n5000_1; // edi
  unsigned int p_n66588417_2; // ecx
  char v11; // bl
  unsigned int v12; // ecx
  int v13; // edi
  char n3; // bl
  unsigned int n66588417_2; // eax
  char *v16; // edx
  int v17; // ecx
  bool v18; // zf
  const char *PGA; // ecx
  const char *PGA_1; // ecx
  unsigned int n66588417_1; // ecx
  char *v22; // eax
  unsigned __int8 v23; // bl
  int v24; // edi
  unsigned int v25; // ecx
  int v26; // edx
  char v28; // [esp+13h] [ebp-25h] BYREF
  unsigned int p_n66588417; // [esp+14h] [ebp-24h] BYREF
  unsigned int n66588417; // [esp+18h] [ebp-20h] BYREF
  int v31; // [esp+1Ch] [ebp-1Ch]
  unsigned __int8 v32[4]; // [esp+20h] [ebp-18h]
  int p_n5000; // [esp+24h] [ebp-14h] BYREF
  unsigned int p_i; // [esp+28h] [ebp-10h] BYREF
  unsigned __int8 i[4];... [15804 chars total]

// Function: KtiPortCfgWrite @ 0xffc4b91c (0x100 bytes)
// Index: 627/2560

int __cdecl KtiPortCfgWrite(char *__return_address, char *n4, char *buf)
{
  unsigned int v4; // eax
  char v5; // dl
  int n4_1; // ebx
  int v7; // ecx
  char *v8; // esi
  unsigned int v9; // eax
  unsigned __int8 n4_2; // bl
  unsigned __int8 i_1; // bh
  unsigned __int8 i; // [esp+4h] [ebp-Ch]
  unsigned __int8 n4_3; // [esp+8h] [ebp-8h]
  unsigned int v15; // [esp+Ch] [ebp-4h]

  if ( ProcCommonFuncACEC((int)__return_address, (int)buf) && buf[141] == 1 ) /*0xffc4b93f*/
  {
    v4 = 0; /*0xffc4b94b*/
    v5 = 0; /*0xffc4b94f*/
    n4_1 = 4; /*0xffc4b951*/
    do /*0xffc4b988*/
    {
      if ( (*n4 & 1) != 0 && (*n4 & 0x60) == 0x20 ) /*0xffc4b95f*/
      {
        v7 = v5 & 7; /*0xffc4b963*/
        if ( (v4 & 8) != 0 ) /*0xffc4b968*/
          v4 = (16 * (v7 | 8)) | v4 & 0xFFFFFF8F; /*0xffc4b97f*/
        else
          v4 = v4 & 0xFFFFFFF8 | v7 | 8; /*0xffc4b972*/
      }
      ++v5; /*0xffc4b981*/
      n4 += 13; /*0xffc4b982*/
      --n4_1; /*0xffc4b985*/
    }
    while ( n4_1 ); /*0xffc4b988*/
    if ( (v4 & 8) != 0 ) /*0xffc4b98c*/
    {
      v8 = buf + 10; /*0xffc4b998*/
      v9 = v4 & 0xFFFFF8FF | 0x100; /*0xffc4b99d*/
      n4_2 = 0; /*0xffc4b9a2*/
      v15 = v9; /*0xffc4b9a5*/
      n4_3 = 0; /*0xffc4b9ab*/
      do /*0xffc4ba10*/
      {
        if ( ((1 << ((_BYTE)v8 + -10 - (_BYTE)buf)) & *((_DWORD *)buf + 25)) != 0 ) /*0xffc4b9ba*/
        {
          i_1 = 0; /*0xffc4b9bc*/
          for ( i = 0; i_1 < (unsigned __int8)*v8; i = i_1 ) /*0xffc4b9c2*/
          {
            j_PciCfgWrite_0((int)__return_address, n4_3, i, 17024, v9); /*0xffc4b9d8*/
            j_PciCfgWrite_0((int)__return_address, n4_3, i, 16793736, 0); /*0xffc4b9f0*/
            v9 = v15; /*0xffc4b9f5*/
            ++i_1; /*0xffc4b9fc*/
          }
        }
        ++n4_2; /*0xffc4ba06*/
        ++v8; /*0xffc4ba08*/
        n4_3 = n4_2; /*0xffc4ba09*/
      }
      while ( n4_2 < 4u ); /*0xffc4ba10*/
    }
  }
  return 0; /*0xffc4ba17*/
}

// Function: KtiPortCfgSetup @ 0xffc4ba1c (0x4dd bytes)
// Index: 628/2560

int __cdecl KtiPortCfgSetup(char *__return_address, char *n4, char *buf)
{
  char *__return_address_1; // ebx
  char *buf_1; // ebp
  unsigned __int8 n4_3; // al
  char *n4_1; // edi
  bool v7; // zf
  char v8; // al
  unsigned __int8 n4_7; // cl
  unsigned __int8 *v10; // esi
  int v11; // eax
  char v12; // al
  unsigned __int8 n4_6; // di
  int v14; // eax
  char v15; // ch
  int v16; // eax
  char n3; // cl
  char v18; // dl
  unsigned int v19; // eax
  char v20; // cl
  unsigned __int8 n2; // cl
  char n2_1; // cl
  int v23; // eax
  int v24; // eax
  char n2_2; // cl
  int v26; // eax
  char *__return_address_2; // eax
  int v28; // eax
  int v29; // eax
  char n2_3; // cl
  int v31; // eax
  unsigned int v32; // eax
  unsigned int v33; // eax
  int v34; // eax
  unsigned __int8 n2_4; // cl
  unsigned __int8 v36; // cl
  int v37; // eax
  int v38; // eax
  unsigned __int8 v39; // al
  char *n4_5; // ecx
  int v41; // edx
  int v42; // edi
  int v43; // esi
  int v44; // edi
  int v4... [10304 chars total]

// Function: DebugLogPrint_9 @ 0xffc4bef9 (0xf3 bytes)
// Index: 629/2560

int __cdecl DebugLogPrint_9(char *__return_address, char *n4, char *buf)
{
  unsigned __int8 n4_4; // al
  int v5; // edx
  char *n4_1; // ecx
  int v8; // [esp+10h] [ebp-8h]
  char *n4_2; // [esp+14h] [ebp-4h]
  unsigned __int8 n4_3; // [esp+1Ch] [ebp+4h]

  KtiDebugPrint(255, 255, 255, 169, 2, (int)__return_address); /*0xffc4bf13*/
  n4_4 = 0; /*0xffc4bf1c*/
  v5 = 0; /*0xffc4bf25*/
  n4_3 = 0; /*0xffc4bf27*/
  n4_1 = n4; /*0xffc4bf2b*/
  v8 = 0; /*0xffc4bf2d*/
  n4_2 = n4; /*0xffc4bf31*/
  do /*0xffc4bfc0*/
  {
    if ( (*n4_1 & 1) != 0 && (*n4_1 & 0x60) == 0 ) /*0xffc4bf3f*/
    {
      KtiDebugPrint((unsigned __int8)(1 << v5), 0, 255, 169, 3, (int)__return_address); /*0xffc4bf56*/
      ProcCommonFunc6792(__return_address, n4, (int)buf, n4_3); /*0xffc4bf63*/
      ProcCommonFunc645D(__return_address, n4, (int)buf, n4_3); /*0xffc4bf6c*/
      KtiMainCheckTotalCpu((int)__return_address, n4, (int)buf, n4_3); /*0xffc4bf75*/
      ProcCommonFunc6D01(__return_address, n4, (int)buf, n4_3); /*0xffc4bf81*/
      ProcCommonFunc6AD9(__return_address, (int)n4, (int)buf, n4_3); /*0xffc4bf8a*/
      ProcCommonFunc8CCB((int)__return_address, n4, (int)buf, n4_3); /*0xffc4bf93*/
      n4_4 = n4_3; /*0xffc4bf98*/
      n4_1 = n4_2; /*0xffc4bf9f*/
      v5 = v8; /*0xffc4bfa8*/
    }
    ++n4_4; /*0xffc4bfac*/
    n4_1 += 13; /*0xffc4bfae*/
    ++v5; /*0xffc4bfb1*/
    n4_3 = n4_4; /*0xffc4bfb2*/
    v8 = v5; /*0xffc4bfb6*/
    n4_2 = n4_1; /*0xffc4bfba*/
  }
  while ( n4_4 < 4u ); /*0xffc4bfc0*/
  if ( !__return_address[246412] && (unsigned __int8)__return_address[246424] >= 6u ) /*0xffc4bfd6*/
    ProcCommonFunc86DE((int)__return_address, n4, (int)buf); /*0xffc4bfdb*/
  return 0; /*0xffc4bfe3*/
}

// Function: KtiPortStatusCheck @ 0xffc4bfec (0xb3 bytes)
// Index: 630/2560

int __cdecl KtiPortStatusCheck(char *__return_address, char *n4)
{
  unsigned __int8 n4_3; // bl
  unsigned __int8 n4_1; // al
  char *v5; // edi
  char v7; // al
  char v8; // di
  unsigned __int8 n4_4; // [esp+10h] [ebp+4h]
  unsigned __int8 n4_2; // [esp+10h] [ebp+4h]

  n4_3 = 0; /*0xffc4bff2*/
  if ( __return_address[257255] ) /*0xffc4bff5*/
  {
    n4_1 = 0; /*0xffc4bffd*/
    v5 = __return_address + 257199; /*0xffc4bfff*/
    n4_4 = 0; /*0xffc4c00a*/
    do /*0xffc4c00e*/
    {
      if ( (*n4 & 1) == 0 || (*n4 & 0x60) != 0 ) /*0xffc4c019*/
        goto LABEL_12; /*0xffc4c019*/
      v7 = j_CpuIoWrite((int)__return_address, n4_4, 0, 50545708); /*0xffc4c026*/
      if ( (v7 & 2) != 0 ) /*0xffc4c030*/
      {
        __return_address[257254] = 1; /*0xffc4c032*/
        if ( (v7 & 1) != 0 ) /*0xffc4c03b*/
        {
          *v5 = 2; /*0xffc4c03d*/
LABEL_10:
          __return_address[257198] = *v5; /*0xffc4c049*/
          goto LABEL_11; /*0xffc4c04b*/
        }
        *v5 = 1; /*0xffc4c042*/
      }
      if ( *v5 ) /*0xffc4c045*/
        goto LABEL_10; /*0xffc4c047*/
LABEL_11:
      n4_1 = n4_4; /*0xffc4c051*/
LABEL_12:
      ++n4_1; /*0xffc4c055*/
      n4 += 13; /*0xffc4c057*/
      ++v5; /*0xffc4c05a*/
      n4_4 = n4_1; /*0xffc4c05b*/
    }
    while ( n4_1 < 4u ); /*0xffc4c00e*/
  }
  if ( !__return_address[257243] ) /*0xffc4c064*/
  {
    n4_2 = 0; /*0xffc4c06c*/
    v8 = 0; /*0xffc4c070*/
    do /*0xffc4c097*/
    {
      if ( ((1 << v8) & *((_DWORD *)__return_address + 61617)) != 0 ) /*0xffc4c07f*/
        ProcCommonFunc1E1D((int)__return_address, n4_2); /*0xffc4c086*/
      ++n4_3; /*0xffc4c08d*/
      ++v8; /*0xffc4c08f*/
      n4_2 = n4_3; /*0xffc4c090*/
    }
    while ( n4_3 < 4u ); /*0xffc4c097*/
  }
  return 0; /*0xffc4c099*/
}

// Function: ProcMemFuncC09F @ 0xffc4c09f (0x733 bytes)
// Index: 631/2560

int __cdecl ProcMemFuncC09F(char *__return_address, char *n4, char *buf, char n4_6)
{
  char *__return_address_1; // esi
  int v5; // ebx
  char *buf_1; // edi
  char *n4_1; // ecx
  int v8; // eax
  int n4_2; // ebp
  int v10; // edi
  int p_n5000_2; // eax
  _BYTE *v12; // edx
  char v13; // bp
  int v14; // edi
  char *n4_4; // ebp
  unsigned __int8 n4_5; // al
  char *n4_7; // ebp
  unsigned __int8 n4_14; // al
  int v19; // ecx
  char *n4_8; // edx
  int v21; // eax
  int v22; // eax
  int v23; // eax
  unsigned __int8 n4_13; // al
  char *n4_11; // ecx
  int v26; // eax
  int v27; // eax
  int p_n5000_3; // eax
  unsigned int p_n5000_5; // edx
  char v30; // al
  int *p_n4; // edi
  unsigned __int8 n4_15; // cl
  char v33; // al
  unsigned int p_n5000_4; // ecx
  unsigned __int8 n4_18; // al
  char *n4_17; // edi
  int v37; // eax
  char n4_20; // al
  int n4_19; // edx
  int v40; // edi
  char v41; // si
  char *n4_21; // ecx
  unsigned __int8 n4_23; // al
  int v44; // ebp
  ch... [15078 chars total]

// Function: ProcCommonFuncC7D2 @ 0xffc4c7d2 (0x19b bytes)
// Index: 632/2560

int __usercall ProcCommonFuncC7D2@<eax>(unsigned int a1@<ebx>, _BYTE *__return_address)
{
  unsigned __int8 n4_1; // dl
  _BYTE *__return_address_1; // ebp
  char v5; // di
  unsigned __int8 v6; // al
  unsigned __int8 n3_1; // cl
  char n2; // cl
  char i; // di
  int v10; // eax
  unsigned __int8 v12; // [esp+Fh] [ebp-11h] BYREF
  unsigned __int8 n4[4]; // [esp+10h] [ebp-10h]
  int n3; // [esp+14h] [ebp-Ch]
  int v15; // [esp+18h] [ebp-8h]
  int v16; // [esp+1Ch] [ebp-4h] BYREF
  unsigned __int8 v17; // [esp+24h] [ebp+4h]
  char v18; // [esp+24h] [ebp+4h]

  if ( __return_address[246411] != 4 ) /*0xffc4c7e3*/
  {
    n4[0] = 0; /*0xffc4c8e0*/
    for ( i = 0; ; ++i ) /*0xffc4c8e5*/
    {
      if ( ((1 << i) & *((_DWORD *)__return_address + 61617)) != 0 ) /*0xffc4c8f4*/
      {
        v18 = CpuIoRead((int)__return_address, n4[0], 0, 16793836); /*0xffc4c911*/
        v10 = j_CpuIoWrite((int)__return_address, n4[0], 0, 50545716); /*0xffc4c915*/
        if ( (v18 & 8) != 0 ) /*0xffc4c922*/
        {
          if ( (v10 & 0x1FF00000) == 0 ) /*0xffc4c939*/
          {
            ProcCommonFunc6279(__return_address, n4[0], 1); /*0xffc4c93f*/
            goto LABEL_26; /*0xffc4c93f*/
          }
        }
        else if ( (v10 & 0x1FF00000) == 0x1FE00000 ) /*0xffc4c92e*/
        {
          ProcCommonFunc6279(__return_address, n4[0], 0); /*0xffc4c932*/
LABEL_26:
          __return_address[246400] |= 2u; /*0xffc4c944*/
        }
      }
      if ( ++n4[0] >= 4u ) /*0xffc4c95b*/
      {
        ProcCommonFunc9F3C(a1, (int)__return_address); /*0xffc4c95e*/
        return 0; /*0xffc4c95e*/
      }
    }
  }
  n4_1 = 0; /*0xffc4c7e9*/
  __return_address_1 = __return_address; /*0xffc4c7eb*/
  n4[0] = 0; /*0xffc4c7ed*/
  v5 = 0; /*0xffc4c7f1*/
  do /*0xffc4c8d5*/
  {
    if ( ((1 << v5) & *((_DWORD *)__return_address + 61617)) != 0 ) /*0xffc4c800*/
    {
      v6 = 0; /*0xffc4c806*/
      v12 = 0; /*0xffc4c808*/
      LOBYTE(v15) = 0; /*0xffc4c80c*/
      if ( __return_address[244317] ) /*0xffc4c810*/
      {
        do /*0xffc4c882*/
        {
          n3_1 = 0; /*0xffc4c818*/
          v17 = v6; /*0xffc4c81a*/
          LOBYTE(n3) = 0; /*0xffc4c81e*/
          do /*0xffc4c870*/
          {
            v16 = 0; /*0xffc4c822*/
            if ( __return_address_1[7688 * v6 + 258722] ) /*0xffc4c830*/
            {
              ProcCommonFunc9DD1(__return_address, n4[0], v15, n3, &v16, (char *)&v12); /*0xffc4c851*/
              n3_1 = n3; /*0xffc4c856*/
            }
            ++n3_1; /*0xffc4c861*/
            v6 = v17 + 1; /*0xffc4c863*/
            LOBYTE(n3) = n3_1; /*0xffc4c865*/
            ++v17; /*0xffc4c869*/
          }
          while ( n3_1 < 3u ); /*0xffc4c870*/
          LOBYTE(v15) = v15 + 1; /*0xffc4c878*/
        }
        while ( (unsigned __int8)v15 < __return_address[244317] ); /*0xffc4c882*/
        v6 = v12; /*0xffc4c884*/
        n4_1 = n4[0]; /*0xffc4c888*/
      }
      n2 = __return_address[1401]; /*0xffc4c88c*/
      if ( (n2 == 1 || n2 == 2) /*0xffc4c8a9*/
        && v6 == 1
        && (*((_DWORD *)__return_address + 61601) != 1 || *((_DWORD *)__return_address + 113411)) )
      {
        ProcCommonFunc6279(__return_address, n4[0], 1); /*0xffc4c8b9*/
        n4_1 = n4[0]; /*0xffc4c8be*/
      }
    }
    ++n4_1; /*0xffc4c8c5*/
    __return_address_1 += 48704; /*0xffc4c8c7*/
    ++v5; /*0xffc4c8cd*/
    n4[0] = n4_1; /*0xffc4c8ce*/
  }
  while ( n4_1 < 4u ); /*0xffc4c8d5*/
  return 0; /*0xffc4c964*/
}

// Function: ProcCommonFuncC96D @ 0xffc4c96d (0x2c2 bytes)
// Index: 633/2560

unsigned __int8 __usercall ProcCommonFuncC96D@<al>(unsigned int a1@<ebx>, _BYTE *__return_address)
{
  char v2; // bl
  char n3; // al
  char SocketNumber; // al
  unsigned __int8 n4_1; // dl
  char v6; // si
  unsigned __int8 n4a_1; // dl
  int v8; // ecx
  int v9; // ebp
  unsigned __int8 v10; // al
  char v11; // bl
  int v12; // eax
  char v13; // bp
  unsigned int v14; // esi
  unsigned __int8 n4b_1; // cl
  char n2; // cl
  char v17; // al
  char v18; // al
  unsigned __int8 n4; // [esp+Ch] [ebp-1A8h]
  unsigned __int8 n4a; // [esp+Ch] [ebp-1A8h]
  unsigned __int8 n4b; // [esp+Ch] [ebp-1A8h]
  unsigned __int8 v23; // [esp+10h] [ebp-1A4h]
  int v24; // [esp+14h] [ebp-1A0h]
  int v25; // [esp+18h] [ebp-19Ch]
  char v26; // [esp+1Ch] [ebp-198h]
  _BYTE buf[404]; // [esp+20h] [ebp-194h] BYREF

  RcAssertPrint(__return_address, 4u, (int)"\n\n******* Configure Mesh Mode - START *******\n"); /*0xffc4c985*/
  ProcCommonFuncC7D2(a1, __return_address); /*0xffc4c98b*/
  v2 = 0; /*0xffc4c995*/
  memset_save_flags(buf, 0, 0x192u); /*0xffc4c99d*/
  if ( __return_address[257255] && __return_address[1545] == 1 )
  {
    ProcCommonFunc1FDB(__return_address, buf); /*0xffc4c9bc*/
  }
  else
  {
    n3 = __return_address[246424]; /*0xffc4c9c5*/
    if ( n3 == 3 || n3 == 4 || n3 == 5 )
    {
      SocketNumber = GetSocketNumber((int)__return_address); /*0xffc4c9de*/
      if ( j_CpuIoWrite((int)__return_address, SocketNumber, 0, 318914748) < 0 )
      {
        RcAssertPrint(__return_address, 2u, (int)"\n Workaround: XptPrefetch disabled to support DDRT on B step");
        n4_1 = 0; /*0xffc4ca02*/
        n4 = 0; /*0xffc4ca07*/
        v6 = 0; /*0xffc4ca0b*/
        do /*0xffc4ca36*/
        {
          if ( ((1 << v6) & *((_DWORD *)__return_address + 61617)) != 0 ) /*0xffc4ca1a*/
          {
            ProcCommonFunc1E1D((int)__return_address, n4); /*0xffc4ca21*/
            n4_1 = n4; /*0xffc4ca26*/
          }
          ++n4_1; /*0xffc4ca2c*/
          ++v6; /*0xffc4ca2e*/
          n4 = n4_1; /*0xffc4ca2f*/
        }
        while ( n4_1 < 4u ); /*0xffc4ca36*/
      }
    }
  }
  if ( __return_address[246424] < 6u ) /*0xffc4ca3f*/
  {
    n4a_1 = 0; /*0xffc4ca46*/
    v8 = 0; /*0xffc4ca48*/
    v9 = 0; /*0xffc4ca4a*/
    n4a = 0; /*0xffc4ca4c*/
    v24 = 0; /*0xffc4ca50*/
    v25 = 0; /*0xffc4ca54*/
    do /*0xffc4cb6e*/
    {
      if ( ((1 << v8) & *((_DWORD *)__return_address + 61617)) != 0 ) /*0xffc4ca63*/
      {
        v10 = 0; /*0xffc4ca70*/
        v23 = 0; /*0xffc4ca72*/
        if ( __return_address[244317] ) /*0xffc4ca69*/
        {
          do /*0xffc4cb46*/
          {
            if ( __return_address[v9 + 10189 + v10] ) /*0xffc4ca81*/
            {
              v11 = j_CpuIoWrite((int)__return_address, n4a, v23, 100679908); /*0xffc4caad*/
              v26 = j_CpuIoWrite((int)__return_address, n4a, 0, 50479248); /*0xffc4cabe*/
              v12 = j_CpuIoWrite((int)__return_address, n4a, v23, 100679940); /*0xffc4cac7*/
              v13 = v12; /*0xffc4cace*/
              v14 = v12 & 0xFFFFFFFD; /*0xffc4cad0*/
              j_PciCfgWrite_0((int)__return_address, n4a, v23, 100679940, v12 & 0xFFFFFFFD); /*0xffc4cae2*/
              if ( (v11 & 4) == 0 && ((v26 & 1) == 0 || __return_address[257242] == 1) ) /*0xffc4cafd*/
                v14 &= ~1u; /*0xffc4caff*/
              j_PciCfgWrite_0((int)__return_address, n4a, v23, 100679940, v14); /*0xffc4cb11*/
              j_PciCfgWrite_0((int)__return_address, n4a, v23, 100679940, v14 | v13 & 2); /*0xffc4cb2a*/
              v9 = v25; /*0xffc4cb2f*/
            }
            v10 = v23 + 1; /*0xffc4cb3a*/
            v23 = v10; /*0xffc4cb3c*/
          }
          while ( v10 < __return_address[244317] ); /*0xffc4cb46*/
          n4a_1 = n4a; /*0xffc4cb4c*/
          v2 = 0; /*0xffc4cb50*/
          v8 = v24; /*0xffc4cb52*/
        }
      }
      ++n4a_1; /*0xffc4cb56*/
      v9 += 50813; /*0xffc4cb58*/
      ++v8; /*0xffc4cb5e*/
      n4a = n4a_1; /*0xffc4cb5f*/
      v24 = v8; /*0xffc4cb63*/
      v25 = v9; /*0xffc4cb67*/
    }
    while ( n4a_1 < 4u ); /*0xffc4cb6e*/
  }
  n4b_1 = 0; /*0xffc4cb75*/
  n4b = 0; /*0xffc4cb77*/
  while ( ((1 << n4b_1) & *((_DWORD *)__return_address + 61617)) == 0 /*0xffc4cb9d*/
       || (CpuIoRead((int)__return_address, n4b, 0, 16793836) & 8) == 0 )
  {
    ProcCommonFunc2766((int)__return_address, (int)buf, n4b); /*0xffc4cba9*/
    n4b_1 = n4b + 1; /*0xffc4cbb5*/
    n4b = n4b_1; /*0xffc4cbb7*/
    if ( n4b_1 >= 4u ) /*0xffc4cbbe*/
      goto LABEL_31; /*0xffc4cbbe*/
  }
  v2 = 1; /*0xffc4cbc2*/
LABEL_31:
  if ( __return_address[246424] == 9 && v2 ) /*0xffc4cbcf*/
  {
    __return_address[257253] &= 0xE0u; /*0xffc4cbd1*/
    n2 = __return_address[257105]; /*0xffc4cbd8*/
    v17 = __return_address[257253]; /*0xffc4cbde*/
    if ( n2 == 2 ) /*0xffc4cbe7*/
    {
      v18 = v17 | 8; /*0xffc4cbe9*/
LABEL_37:
      __return_address[257253] = v18; /*0xffc4cbf4*/
      goto LABEL_38; /*0xffc4cbf4*/
    }
    if ( n2 == 3 ) /*0xffc4cbf0*/
    {
      v18 = v17 | 4; /*0xffc4cbf2*/
      goto LABEL_37; /*0xffc4cbf2*/
    }
  }
LABEL_38:
  RcAssertPrint(__return_address, 8u, (int)aOutirqthreshol, (unsigned __int8)__return_address[257253]); /*0xffc4cbfa*/
  ProcCommonFunc9C7F((int)__return_address); /*0xffc4cc10*/
  return RcAssertPrint(__return_address, 4u, (int)aConfigureMeshM_0); /*0xffc4cc25*/
}

// Function: ProcCommonFuncCC2F @ 0xffc4cc2f (0xbe bytes)
// Index: 634/2560

int __cdecl ProcCommonFuncCC2F(_BYTE *__return_address, char *buf, unsigned __int8 n4)
{
  ProcCommonFunc8EC5((int)__return_address, n4, &buf[n4 + 2]); /*0xffc4cc4a*/
  ProcCommonFunc8688((int)__return_address, n4, &buf[n4 + 10], &buf[4 * n4 + 14]); /*0xffc4cc62*/
  ProcCommonFunc8A3C((int)__return_address, n4, &buf[n4 + 30]); /*0xffc4cc6f*/
  ProcCommonFunc8B33((int)__return_address, n4, &buf[n4 + 34]); /*0xffc4cc7c*/
  ProcCommonFunc8B81((int)__return_address, n4, (int)buf); /*0xffc4cc84*/
  ProcCommonFunc8C3A((int)__return_address, n4, &__return_address[351 * n4 + 255718]); /*0xffc4cc9c*/
  ProcCommonFunc8AD2((int)__return_address, n4, &buf[n4 + 38]); /*0xffc4cca9*/
  ProcCommonFunc8D7B(__return_address, n4, (int)buf); /*0xffc4ccb1*/
  buf[128] = __return_address[257191] == 6 && __return_address[8320] == 1; /*0xffc4cccb*/
  ProcCommonFunc87D2((int)__return_address, (int)buf, n4); /*0xffc4ccde*/
  return 0; /*0xffc4cce8*/
}

// Function: ProcCommonFuncCCED @ 0xffc4cced (0x123 bytes)
// Index: 635/2560

void __cdecl __noreturn ProcCommonFuncCCED(int __return_address, int a2, unsigned __int8 a3)
{
  unsigned __int8 v3; // bl
  int v4; // ecx
  char v5; // dl
  int v6; // eax

  v3 = 0; /*0xffc4ccf4*/
  if ( !(unsigned __int16)j_CpuIoWrite(__return_address, a3, 0, 50545712) && (*(_BYTE *)(a2 + 400) & 0x7F) != a3 ) /*0xffc4cd21*/
  {
    RcAssertPrint((_BYTE *)__return_address, 4u, -2961896); /*0xffc4cd2b*/
    return; /*0xffc4cd36*/
  }
  v4 = 6 * a3; /*0xffc4cd42*/
  if ( *(_BYTE *)(v4 + a2 + 298) != *(_BYTE *)(a3 + __return_address + 257199) ) /*0xffc4cd53*/
  {
    RcAssertPrint((_BYTE *)__return_address, 4u, -2961852, a3); /*0xffc4cd5e*/
    v5 = -1; /*0xffc4cd6c*/
    while ( 1 ) /*0xffc4cd6f*/
    {
      if ( ((1 << v3) & *(_DWORD *)(__return_address + 246468)) != 0 ) /*0xffc4cd79*/
      {
        v6 = 6 * v3; /*0xffc4cd7b*/
        if ( v5 == -1 ) /*0xffc4cd81*/
        {
          v5 = *(_BYTE *)(v6 + a2 + 298); /*0xffc4cd83*/
        }
        else if ( v5 != *(_BYTE *)(v6 + a2 + 298) ) /*0xffc4cd93*/
        {
          RcAssertPrint((_BYTE *)__return_address, 4u, -2961808); /*0xffc4cda6*/
          return; /*0xffc4cda6*/
        }
      }
      if ( ++v3 >= 4u ) /*0xffc4cd9a*/
        return; /*0xffc4cd9a*/
    }
  }
  if ( *(_BYTE *)(v4 + a2 + 299) == 1 /*0xffc4cdc5*/
    && (*(_DWORD *)(__return_address + 130) & 0x4000) != 0
    && *(_BYTE *)(__return_address + 1364) == 2 )
  {
    while ( *(_DWORD *)(50813 * a3 + 8077 * v3 + __return_address + 10241) == *(_DWORD *)(50813 * a3 /*0xffc4cde6*/
                                                                                        + 8077 * v3
                                                                                        + __return_address
                                                                                        + 34472) )
    {
      if ( ++v3 >= 3u ) /*0xffc4cded*/
        return; /*0xffc4cded*/
    }
    RcAssertPrint((_BYTE *)__return_address, 4u, -2963092, a3, v3); /*0xffc4ce03*/
  }
}

// Function: MemInitFuncCE10 @ 0xffc4ce10 (0x43f bytes)
// Index: 636/2560

int __cdecl MemInitFuncCE10(unsigned __int8 *n6, int n4)
{
  int n6a_1; // ebx
  unsigned __int8 *n6_1; // edi
  unsigned __int8 n6_3; // al
  int v5; // ecx
  int *v6; // esi
  unsigned int v7; // eax
  int *v8; // ebx
  unsigned int v9; // eax
  unsigned int v10; // eax
  unsigned int v11; // eax
  unsigned int v12; // eax
  unsigned __int8 *n6_2; // esi
  int CpuCount; // eax
  unsigned __int8 n2_3; // cl
  _BYTE *v16; // eax
  unsigned __int8 n2_2; // al
  int v18; // ecx
  int v19; // eax
  int v20; // eax
  unsigned int v21; // eax
  int v22; // eax
  unsigned __int8 n4_1; // cl
  int SocketInfo_1; // eax
  int v25; // esi
  int v26; // eax
  int v27; // eax
  int n2_1; // [esp+10h] [ebp-3Ch]
  int n2; // [esp+14h] [ebp-38h]
  unsigned __int8 n2a; // [esp+14h] [ebp-38h]
  int v32; // [esp+18h] [ebp-34h]
  int v33; // [esp+1Ch] [ebp-30h]
  int v34; // [esp+20h] [ebp-2Ch]
  _BYTE *v35; // [esp+24h] [ebp-28h]
  int *v36; // [esp+28h] [ebp-24h]
  int v37; // [esp+2Ch] [ebp-20h]
  __int16 v38[2]; // [esp+30h] [ebp-1Ch] BYREF
  int v39; // [esp+34h] [ebp-18h]
  unsigned __int16 p_n60[2]; // [esp+38h] [ebp-14h] BYREF
  int v41; // [esp+3Ch] [ebp-10h] BYREF
  int n255; // [esp+40h] [ebp-Ch] BYREF
  int SocketInfo; // [esp+44h] [ebp-8h]
  int v44; // [esp+48h] [ebp-4h]
  unsigned __int8 n6a; // [esp+50h] [ebp+4h]

  n6a_1 = 0; /*0xffc4ce19*/
  n6_1 = n6; /*0xffc4ce1d*/
  n255 = 255; /*0xffc4ce23*/
  v41 = 0; /*0xffc4ce2b*/
  *(_DWORD *)p_n60 = 0; /*0xffc4ce2f*/
  *(_DWORD *)v38 = 0; /*0xffc4ce33*/
  SocketInfo = GetSocketInfo((int)n6, n4); /*0xffc4ce40*/
  v44 = KtiFunc8F8C((int)n6, n4); /*0xffc4ce4c*/
  n6_3 = 0; /*0xffc4ce50*/
  v5 = 0; /*0xffc4ce52*/
  v6 = (int *)(SocketInfo + 303); /*0xffc4ce54*/
  LOBYTE(n6) = 0; /*0xffc4ce5a*/
  v37 = 0; /*0xffc4ce5e*/
  v36 = (int *)(SocketInfo + 303); /*0xffc4ce62*/
  do /*0xffc4d1c4*/
  {
    if ( *((_BYTE *)v6 - 303) ) /*0xffc4ce66*/
    {
      v7 = MailBoxFunc4CB2((int)n6_1, 0, 0x80042E8u); /*0xffc4ce7a*/
      *(v6 - 73) = MiscConfigCheck(n6_1, n4, (unsigned __int8)n6, v7); /*0xffc4ce94*/
      n2a = 0; /*0xffc4cea1*/
      *v6 = MiscConfigCheck(n6_1, n4, (unsigned __int8)n6, 134302224); /*0xffc4cea8*/
      v8 = v6 - 54; /*0xffc4ceaa*/
      do /*0xffc4cf38*/
      {
        v9 = MailBoxFunc4CB2((int)n6_1, n2a, 0x80042ECu); /*0xffc4cebb*/
        *(v8 - 18) = MiscConfigCheck(n6_1, n4, (unsigned __int8)n6, v9); /*0xffc4ced3*/
        v10 = MailBoxFunc4CB2((int)n6_1, n2a, 0x80042F0u); /*0xffc4ced6*/
        *v8 = MiscConfigCheck(n6_1, n4, (unsigned __int8)n6, v10); /*0xffc4ceee*/
        v11 = MailBoxFunc4CB2((int)n6_1, n2a, 0x80042CCu); /*0xffc4cef0*/
        v8[18] = MiscConfigCheck(n6_1, n4, (unsigned __int8)n6, v11); /*0xffc4cf0b*/
        v12 = MailBoxFunc4CB2((int)n6_1, n2a, 0x80042F4u); /*0xffc4cf0e*/
        n6_2 = n6; /*0xffc4cf13*/
        v8[36] = MiscConfigCheck(n6_1, n4, (unsigned __int8)n6, v12); /*0xffc4cf20*/
        ++v8; /*0xffc4cf26*/
        ++n2a; /*0xffc4cf32*/
      }
      while ( n2a < 0x12u ); /*0xffc4cf38*/
      MailBoxFunc6596(n6_1, n4, (int)n6, 40, 19, v38, (unsigned __int16 *)&n255, (unsigned __int16 *)&v41); /*0xffc4cf54*/
      *(int *)((char *)v36 + 6438) = MiscConfigCheck(n6_1, n4, (unsigned __int8)n6, 184631424); /*0xffc4cf72*/
      *(int *)((char *)v36 + 6442) = MiscConfigCheck(n6_1, n4, (unsigned __int8)n6, 184631428); /*0xffc4cf87*/
      CpuCount = GetCpuCount((int)n6_1, n4, (unsigned __int8)n6); /*0xffc4cf8d*/
      n6a_1 = 0; /*0xffc4cf92*/
      n2_3 = 0; /*0xffc4cf97*/
      v16 = (_BYTE *)(CpuCount + 19); /*0xffc4cf99*/
      LOBYTE(n2_1) = 0; /*0xffc4cf9c*/
      v35 = v16; /*0xffc4cfa0*/
      do /*0xffc4d196*/
      {
        if ( *(v16 - 19) ) /*0xffc4cfa4*/
        {
          v33 = KtiFunc91AF((int)n6_1, n4, (unsigned __int8)n6_2, n2_1); /*0xffc4cfb9*/
          v16 = v35; /*0xffc4cfc0*/
          LOBYTE(v32) = 0; /*0xffc4cfc4*/
          if ( *v35 ) /*0xffc4cfc8*/
          {
            do /*0xffc4d178*/
            {
              if ( !KtiFunc89E9((int)n6_1, n4, (char)n6_2, n2_1, v32, 0) ) /*0xffc4cfdc*/
              {
                v39 = 242 * (unsigned __int8)v32; /*0xffc4d00c*/
                MailBoxFunc6CF5( /*0xffc4d01c*/
                  n6_1,
                  n4,
                  (int)n6_2,
                  *(unsigned __int8 *)(v39 + v33 + 5) + 45,
                  19,
                  v38,
                  (unsigned __int16 *)&n255,
                  (unsigned __int16 *)&v41);
                MailBoxFunc5B6A(n6_1, n4, (int)n6_2, *(_BYTE *)(v39 + v33 + 4), 19, v38); /*0xffc4d039*/
                n2_2 = 0; /*0xffc4d03e*/
                v18 = 0; /*0xffc4d040*/
                LOBYTE(n2) = 0; /*0xffc4d045*/
                v34 = 0; /*0xffc4d049*/
                do /*0xffc4d162*/
                {
                  if ( n6_1[257312] || n2_2 != 8 && n2_2 != 17 ) /*0xffc4d05f*/
                  {
                    v19 = MailBoxFunc4C47((int)n6_1, *(_BYTE *)(v39 + v33 + 3), n2, 0x8004280u); /*0xffc4d07e*/
                    v20 = MiscConfigCheck(n6_1, n4, (unsigned __int8)n6, v19); /*0xffc4d08a*/
                    *(_DWORD *)(SocketInfo + 4 * (v37 + v34 + 18 * *(unsigned __int8 *)(v39 + v33 + 1)) + 5614) = v20; /*0xffc4d0b2*/
                    v21 = MailBoxFunc4CB2((int)n6_1, n2, 0x80042DCu); /*0xffc4d0b9*/
                    v22 = MiscConfigCheck(n6_1, n4, (unsigned __int8)n6, v21); /*0xffc4d0c8*/
                    *(_DWORD *)(SocketInfo + 4 * (v34 + v37) + 6601) = v22; /*0xffc4d0dc*/
                    SmbusInit(n6_1, n4, (int)n6, n2_1, v32, n2, 0, 0, 22, 19, p_n60); /*0xffc4d100*/
                    MrcHooksChipServices(n6_1, n4, (int)n6, n2_1, v32, n2, 0, 0, 2, 19, p_n60); /*0xffc4d122*/
                    n6_2 = n6; /*0xffc4d137*/
                    MailBoxFunc71F(n6_1, n4, (int)n6, n2_1, v32, n2, 0, 0, 5, 19, p_n60); /*0xffc4d145*/
                    n2_2 = n2; /*0xffc4d14a*/
                    v18 = v34; /*0xffc4d151*/
                  }
                  ++n2_2; /*0xffc4d155*/
                  ++v18; /*0xffc4d157*/
                  LOBYTE(n2) = n2_2; /*0xffc4d158*/
                  v34 = v18; /*0xffc4d15c*/
                }
                while ( n2_2 < 0x12u ); /*0xffc4d162*/
              }
              LOBYTE(v32) = v32 + 1; /*0xffc4d172*/
            }
            while ( (unsigned __int8)v32 < *v35 ); /*0xffc4d178*/
            v16 = v35; /*0xffc4d17e*/
          }
          n2_3 = n2_1; /*0xffc4d180*/
        }
        ++n2_3; /*0xffc4d184*/
        v16 += 1379; /*0xffc4d186*/
        LOBYTE(n2_1) = n2_3; /*0xffc4d18b*/
        v35 = v16; /*0xffc4d18f*/
      }
      while ( n2_3 < 2u ); /*0xffc4d196*/
      v6 = v36; /*0xffc4d19c*/
      n6_3 = (unsigned __int8)n6; /*0xffc4d1a0*/
      v5 = v37; /*0xffc4d1a4*/
    }
    ++n6_3; /*0xffc4d1a8*/
    v6 += 1922; /*0xffc4d1aa*/
    v5 += 1922; /*0xffc4d1b0*/
    LOBYTE(n6) = n6_3; /*0xffc4d1b6*/
    v36 = v6; /*0xffc4d1ba*/
    v37 = v5; /*0xffc4d1be*/
  }
  while ( n6_3 < 6u ); /*0xffc4d1c4*/
  n6a = 0; /*0xffc4d1d1*/
  if ( n6_1[244317] ) /*0xffc4d1ca*/
  {
    n4_1 = n4; /*0xffc4d1d7*/
    SocketInfo_1 = 50813 * (unsigned __int8)n4; /*0xffc4d1de*/
    SocketInfo = SocketInfo_1; /*0xffc4d1e4*/
    do /*0xffc4d243*/
    {
      if ( n6_1[(unsigned __int8)n6a_1 + 10189 + SocketInfo_1] ) /*0xffc4d1ed*/
      {
        v25 = 29 * (unsigned __int8)n6a_1; /*0xffc4d200*/
        v26 = MailBoxFunc8E0B(n6a_1, (int)n6_1, n4_1, n6a, 134303536); /*0xffc4d205*/
        *(_DWORD *)(v25 + v44 + 25) = v26; /*0xffc4d21b*/
        v27 = MailBoxFunc8E0B(n6a_1, (int)n6_1, n4, n6a, 134303512); /*0xffc4d221*/
        *(_DWORD *)(v25 + v44 + 19) = v27; /*0xffc4d22d*/
        n4_1 = n4; /*0xffc4d231*/
      }
      SocketInfo_1 = SocketInfo; /*0xffc4d233*/
      LOBYTE(n6a_1) = n6a_1 + 1; /*0xffc4d237*/
      n6a = n6a_1; /*0xffc4d239*/
    }
    while ( (unsigned __int8)n6a_1 < n6_1[244317] ); /*0xffc4d243*/
  }
  return 0; /*0xffc4d245*/
}

// Function: ProcCommonFuncD24F @ 0xffc4d24f (0x49 bytes)
// Index: 637/2560

int __cdecl ProcCommonFuncD24F(__int16 n60, char a2)
{
  if ( a2 ) /*0xffc4d254*/
    return (unsigned __int16)((((0xF4240 / ((unsigned int)(unsigned __int16)(2 * n60) + 100)) >> 1 << 8) - 320000) /*0xffc4d294*/
                            / 0x2710
                            + (((0xF4240 / ((unsigned int)(unsigned __int16)(2 * n60) + 100)) >> 1 << 8) - 320000)
                            % 0x2710
                            / 0x1388);
  else
    return 50; /*0xffc4d258*/
}

// Function: ProcCommonFuncD298 @ 0xffc4d298 (0x6e bytes)
// Index: 638/2560

int __cdecl ProcCommonFuncD298(__int16 n60, char a2)
{
  int result; // eax

  if ( a2 ) /*0xffc4d29e*/
    LOWORD(result) = (((0x15F90 / ((unsigned int)(unsigned __int16)(3 * n60) + 90)) >> 1 << 8) - 32000) / 0x3E8 /*0xffc4d300*/
                   + (((0x15F90 / ((unsigned int)(unsigned __int16)(3 * n60) + 90)) >> 1 << 8) - 32000) % 0x3E8 / 0x1F4;
  else
    LOWORD(result) = (unsigned __int16)(0x15F90u / (2 * ((unsigned __int16)(1000 * n60) >> 8) + 250) - 90) / 3u; /*0xffc4d2c7*/
  return (unsigned __int16)result; /*0xffc4d305*/
}

// Function: ProcCommonFuncD306 @ 0xffc4d306 (0xf0 bytes)
// Index: 639/2560

bool __cdecl ProcCommonFuncD306(int n6, int n4, int a3, int n2)
{
  int CpuCount; // esi
  int v5; // eax
  char n6_1; // cl
  int v7; // ecx
  unsigned __int16 n6439; // cx

  CpuCount = GetCpuCount(n6, n4, a3); /*0xffc4d329*/
  if ( *(_WORD *)(n6 + 257315) != 12 /*0xffc4d359*/
    || ProcCommonFunc24FA(n6, n4, a3, n2) == 1
    || (v5 = 1379 * (unsigned __int8)n2, *(_BYTE *)(v5 + CpuCount + 107) == 1)
    || *(_BYTE *)(n6 + 257313) )
  {
    DebugPrint(n6, 2, n4, a3, n2, 255, 255, 255, "DIMM Tech does not support CTLE\n"); /*0xffc4d3e7*/
  }
  else
  {
    n6_1 = *(_BYTE *)(v5 + CpuCount + 118); /*0xffc4d362*/
    if ( n6_1 != 5 ) /*0xffc4d369*/
      return n6_1 == 6; /*0xffc4d3ce*/
    v7 = *(unsigned __int16 *)(v5 + CpuCount + 147); /*0xffc4d36b*/
    switch ( v7 ) /*0xffc4d379*/
    {
      case 2819: /*0xffc4d379*/
        n6439 = 6439; /*0xffc4d3ae*/
        return __ROL2__(*(_WORD *)(v5 + CpuCount + 145), 8) >= n6439; /*0xffc4d3ae*/
      case 11264: /*0xffc4d379*/
        return *(_DWORD *)(v5 + CpuCount + 4) <= 682000; /*0xffc4d3ac*/
      case 44288: /*0xffc4d379*/
        n6439 = 6168; /*0xffc4d39a*/
        return __ROL2__(*(_WORD *)(v5 + CpuCount + 145), 8) >= n6439; /*0xffc4d39f*/
      case 52736: /*0xffc4d379*/
        n6439 = 6406; /*0xffc4d393*/
        return __ROL2__(*(_WORD *)(v5 + CpuCount + 145), 8) >= n6439; /*0xffc4d3c6*/
    }
  }
  return 0; /*0xffc4d3f1*/
}

// Function: ProcCommonFuncD3F6 @ 0xffc4d3f6 (0x132 bytes)
// Index: 640/2560

void __cdecl ProcCommonFuncD3F6(int n6, unsigned __int8 n4)
{
  unsigned __int8 v2; // cl
  unsigned __int8 n4_1; // dl
  int v4; // ebp
  int v5; // edi
  unsigned int v6; // esi
  unsigned int v7; // esi
  unsigned __int8 v8; // [esp+4h] [ebp-4h]

  v2 = 0; /*0xffc4d3fc*/
  v8 = 0; /*0xffc4d3fe*/
  if ( *(_BYTE *)(n6 + 244317) ) /*0xffc4d402*/
  {
    n4_1 = n4; /*0xffc4d40e*/
    v4 = 50813 * n4; /*0xffc4d416*/
    do /*0xffc4d51c*/
    {
      if ( *(_BYTE *)(v4 + v2 + n6 + 10189) ) /*0xffc4d42c*/
      {
        v5 = MailBoxFunc8E0B(n6, n6, n4_1, v8, 117459168); /*0xffc4d44a*/
        MailBoxFunc8FC5(n6, n4, v8, 117459168, v5 & 0xFFFFF7FF); /*0xffc4d459*/
        v6 = MailBoxFunc8E0B(n6, n6, n4, v8, 117459136) & 0xBFFF0000 | 0xED0; /*0xffc4d476*/
        MailBoxFunc8FC5(n6, n4, v8, 117459136, v6); /*0xffc4d488*/
        v7 = v6 | 0x40000000; /*0xffc4d490*/
        MailBoxFunc8FC5(n6, n4, v8, 117459136, v7); /*0xffc4d4a2*/
        do /*0xffc4d4d6*/
        {
          if ( v7 < 0x80000000 && (v7 & 0x10000) != 0 ) /*0xffc4d4b8*/
            break; /*0xffc4d4b8*/
          v7 = MailBoxFunc8E0B(n6, n6, n4, v8, 117459136); /*0xffc4d4cd*/
        }
        while ( (*(_BYTE *)(n6 + 246408) & 4) == 0 ); /*0xffc4d4d6*/
        MailBoxFunc8FC5(n6, n4, v8, 117459136, v7 & 0xBFFFFFFF); /*0xffc4d4ea*/
        MailBoxFunc8FC5(n6, n4, v8, 117459168, v5); /*0xffc4d4fc*/
        v2 = v8; /*0xffc4d501*/
        n4_1 = n4; /*0xffc4d508*/
        v4 = 50813 * n4; /*0xffc4d50c*/
      }
      v8 = ++v2; /*0xffc4d512*/
    }
    while ( v2 < *(_BYTE *)(n6 + 244317) ); /*0xffc4d51c*/
  }
}

// Function: j_MailBoxPcodeCmd @ 0xffc4d528 (0x5 bytes)
// Index: 641/2560

// attributes: thunk
int __cdecl j_MailBoxPcodeCmd(unsigned __int8 *n2, int n4, int n2_1, unsigned __int8 a4)
{
  return MailBoxPcodeCmd(n2, n4, n2_1, a4);
}

// Function: ProcCommonFuncD52D @ 0xffc4d52d (0x146 bytes)
// Index: 642/2560

int __cdecl ProcCommonFuncD52D(int a1, int a2, int n38, __int16 *a4, __int16 *a5, __int16 *a6)
{
  int v6; // ecx
  __int16 *v7; // eax
  __int16 n127_2; // dx
  __int16 v9; // dx
  __int16 n127_1; // [esp-4h] [ebp-Ch]
  __int16 n127; // [esp-4h] [ebp-Ch]
  __int16 n73; // [esp-4h] [ebp-Ch]

  v6 = 0; /*0xffc4d530*/
  if ( !a2 ) /*0xffc4d537*/
  {
    if ( n38 > 19 ) /*0xffc4d543*/
    {
      if ( n38 > 25 ) /*0xffc4d5ad*/
      {
        if ( n38 < 38 ) /*0xffc4d5e0*/
          return 5; /*0xffc4d5e0*/
        if ( n38 > 39 ) /*0xffc4d5e5*/
        {
          if ( n38 != 61 ) /*0xffc4d5ea*/
            return 5; /*0xffc4d5ea*/
LABEL_22:
          n127 = 127; /*0xffc4d5ec*/
          *a4 = 0; /*0xffc4d5f3*/
          v7 = a5; /*0xffc4d5f6*/
          goto LABEL_23; /*0xffc4d5f6*/
        }
        goto LABEL_14; /*0xffc4d5e5*/
      }
      if ( n38 == 23 ) /*0xffc4d5b2*/
      {
        n127 = 41; /*0xffc4d5c4*/
        *a5 = 114; /*0xffc4d5c6*/
        v7 = a4; /*0xffc4d5c9*/
LABEL_23:
        *v7 = n127; /*0xffc4d5f9*/
        v9 = 1; /*0xffc4d5ff*/
LABEL_37:
        *a6 = v9; /*0xffc4d662*/
        return v6; /*0xffc4d668*/
      }
    }
    else
    {
      if ( n38 == 19 ) /*0xffc4d54e*/
        goto LABEL_11; /*0xffc4d54e*/
      if ( n38 <= 5 ) /*0xffc4d553*/
      {
        if ( n38 != 5 ) /*0xffc4d555*/
        {
          if ( n38 < 0 ) /*0xffc4d55d*/
            return 5; /*0xffc4d66c*/
          if ( n38 != 2 ) /*0xffc4d562*/
            goto LABEL_18; /*0xffc4d562*/
          *a4 = 0; /*0xffc4d579*/
          *a5 = 7; /*0xffc4d57f*/
          *a6 = 0; /*0xffc4d584*/
LABEL_11:
          *a4 = 0; /*0xffc4d587*/
          *a5 = 119; /*0xffc4d58f*/
          *a6 = 0; /*0xffc4d594*/
          return 5; /*0xffc4d597*/
        }
        goto LABEL_22; /*0xffc4d555*/
      }
      if ( n38 != 6 ) /*0xffc4d59c*/
      {
        if ( n38 != 18 ) /*0xffc4d5a1*/
          return 5; /*0xffc4d5a1*/
LABEL_14:
        n127_1 = 127; /*0xffc4d5a3*/
LABEL_35:
        *a4 = 0; /*0xffc4d651*/
        n127_2 = n127_1; /*0xffc4d659*/
        goto LABEL_36; /*0xffc4d659*/
      }
    }
LABEL_18:
    *a4 = 0; /*0xffc4d5ce*/
    n127_2 = 511; /*0xffc4d5d6*/
LABEL_36:
    *a5 = n127_2; /*0xffc4d65a*/
    v9 = 0; /*0xffc4d660*/
    goto LABEL_37; /*0xffc4d660*/
  }
  if ( a2 != 1 ) /*0xffc4d608*/
    return 4; /*0xffc4d66a*/
  if ( n38 == 1 ) /*0xffc4d60f*/
    goto LABEL_34; /*0xffc4d60f*/
  if ( n38 <= 2 ) /*0xffc4d614*/
    return 5; /*0xffc4d614*/
  if ( n38 <= 4 ) /*0xffc4d61d*/
    goto LABEL_34; /*0xffc4d61d*/
  if ( n38 == 5 ) /*0xffc4d622*/
  {
    n73 = 73; /*0xffc4d636*/
    goto LABEL_33; /*0xffc4d636*/
  }
  if ( n38 == 22 ) /*0xffc4d627*/
  {
LABEL_34:
    n127_1 = 30; /*0xffc4d64f*/
    goto LABEL_35; /*0xffc4d64f*/
  }
  if ( n38 != 23 ) /*0xffc4d62c*/
    return 5; /*0xffc4d62c*/
  n73 = 50; /*0xffc4d632*/
LABEL_33:
  *a5 = n73; /*0xffc4d638*/
  *a4 = 0; /*0xffc4d644*/
  *a6 = 1; /*0xffc4d64a*/
  return v6; /*0xffc4d66d*/
}

// Function: ProcCommonFuncD673 @ 0xffc4d673 (0xc7 bytes)
// Index: 643/2560

_BYTE *__cdecl ProcCommonFuncD673(int n20, _BYTE *a2)
{
  char *TxDqsDelay; // [esp-4h] [ebp-8h]

  if ( n20 > 20 ) /*0xffc4d67d*/
  {
    switch ( n20 ) /*0xffc4d6df*/
    {
      case 21: /*0xffc4d6df*/
        TxDqsDelay = "TxDqsDelay"; /*0xffc4d725*/
        goto LABEL_31; /*0xffc4d725*/
      case 22: /*0xffc4d6df*/
        TxDqsDelay = "TxDqDelay"; /*0xffc4d71e*/
        goto LABEL_31; /*0xffc4d723*/
      case 23: /*0xffc4d6df*/
        TxDqsDelay = "TxVref"; /*0xffc4d717*/
        goto LABEL_31; /*0xffc4d71c*/
      case 25: /*0xffc4d6df*/
        TxDqsDelay = "TxDqBitDelay"; /*0xffc4d710*/
        goto LABEL_31; /*0xffc4d715*/
      case 38: /*0xffc4d6df*/
        TxDqsDelay = "RxDqsPBitDelay"; /*0xffc4d709*/
        goto LABEL_31; /*0xffc4d70e*/
      case 39: /*0xffc4d6df*/
        TxDqsDelay = "RxDqsNBitDelay"; /*0xffc4d702*/
        goto LABEL_31; /*0xffc4d707*/
    }
    goto LABEL_24; /*0xffc4d6f9*/
  }
  switch ( n20 ) /*0xffc4d67f*/
  {
    case 20: /*0xffc4d67f*/
      TxDqsDelay = "WrLvlDelay"; /*0xffc4d6d5*/
      goto LABEL_31; /*0xffc4d6da*/
    case 0: /*0xffc4d67f*/
      TxDqsDelay = "RecEnDelay"; /*0xffc4d6ce*/
      goto LABEL_31; /*0xffc4d6d3*/
    case 1: /*0xffc4d67f*/
      TxDqsDelay = "RxDqsDelay"; /*0xffc4d6c7*/
      goto LABEL_31; /*0xffc4d6cc*/
    case 2: /*0xffc4d67f*/
      TxDqsDelay = "RxDqDelay"; /*0xffc4d6c0*/
      goto LABEL_31; /*0xffc4d6c5*/
    case 3: /*0xffc4d67f*/
      TxDqsDelay = "RxDqsPDelay"; /*0xffc4d6b9*/
      goto LABEL_31; /*0xffc4d6be*/
    case 4: /*0xffc4d67f*/
      TxDqsDelay = "RxDqsNDelay"; /*0xffc4d6b2*/
      goto LABEL_31; /*0xffc4d6b7*/
    case 5: /*0xffc4d67f*/
      TxDqsDelay = "RxVref"; /*0xffc4d6ab*/
      goto LABEL_31; /*0xffc4d6b0*/
  }
  if ( n20 != 18 ) /*0xffc4d6a2*/
  {
LABEL_24:
    TxDqsDelay = "Unknown group"; /*0xffc4d6fb*/
    goto LABEL_31; /*0xffc4d700*/
  }
  TxDqsDelay = "RxDqsBitDelay"; /*0xffc4d6a4*/
LABEL_31:
  RmtFunc8B50(a2, TxDqsDelay); /*0xffc4d72a*/
  return a2; /*0xffc4d737*/
}

// Function: ProcCommonFuncD73A @ 0xffc4d73a (0x26 bytes)
// Index: 644/2560

char __cdecl ProcCommonFuncD73A(unsigned __int8 *a1, unsigned __int8 a2, unsigned __int8 a3, char a4)
{
  return ((unsigned int)MiscConfigCheck(a1, a2, a3, 184631436) >> (4 * a4)) & 0xF; /*0xffc4d75f*/
}

// Function: ProcCommonFuncD760 @ 0xffc4d760 (0x39 bytes)
// Index: 645/2560

void __cdecl ProcCommonFuncD760(
        unsigned __int8 *__return_address,
        unsigned __int8 a2,
        unsigned __int8 n6,
        char n2,
        char a5,
        char a6,
        _BYTE *a7)
{
  unsigned __int8 n4; // al

  if ( !a6 ) /*0xffc4d767*/
  {
    n4 = KtiFunc88D1((int)__return_address, a2, n6, n2, a5); /*0xffc4d778*/
    *a7 = ProcCommonFuncD799(__return_address, a2, n6, n4); /*0xffc4d795*/
  }
}

// Function: ProcCommonFuncD799 @ 0xffc4d799 (0x48 bytes)
// Index: 646/2560

unsigned int __cdecl ProcCommonFuncD799(
        unsigned __int8 *a1,
        unsigned __int8 a2,
        unsigned __int8 a3,
        unsigned __int8 n4)
{
  unsigned __int8 n4_1; // bl
  unsigned int v5; // eax

  n4_1 = n4; /*0xffc4d79d*/
  if ( n4 >= 4u ) /*0xffc4d7a3*/
  {
    v5 = MiscConfigCheck(a1, a2, a3, 184631428); /*0xffc4d7cb*/
    n4_1 = n4 - 4; /*0xffc4d7d3*/
  }
  else
  {
    v5 = MiscConfigCheck(a1, a2, a3, 184631424); /*0xffc4d7b3*/
  }
  return v5 >> (8 * n4_1); /*0xffc4d7de*/
}

// Function: ProcCommonFuncD7E1 @ 0xffc4d7e1 (0x174 bytes)
// Index: 647/2560

int __cdecl ProcCommonFuncD7E1(
        int n6,
        unsigned __int8 n4,
        char a3,
        int n2,
        int a5,
        int n0x12,
        int a7,
        int a8,
        int n25,
        char n19,
        unsigned __int16 *p_n60)
{
  unsigned __int16 n3; // di
  unsigned int v12; // ebx
  unsigned __int8 v13; // al
  unsigned int v14; // esi
  unsigned __int16 v15; // ax
  unsigned __int16 v16; // dx
  char n19_1; // cl
  unsigned __int8 v18; // bl
  unsigned __int16 n3_1; // ax
  int v20; // edx
  unsigned __int8 v22; // [esp+10h] [ebp-8h]
  int v23; // [esp+14h] [ebp-4h]

  n3 = 0; /*0xffc4d7ef*/
  LOWORD(v12) = 0; /*0xffc4d7f2*/
  v23 = KtiFunc8F8C(n6, n4); /*0xffc4d7fd*/
  v13 = DdrTrainFunc45AB(n6, n4, a3); /*0xffc4d806*/
  v22 = v13; /*0xffc4d80e*/
  if ( (n19 & 1) != 0 ) /*0xffc4d817*/
    v14 = MailBoxFunc8E0B(0, n6, n4, v13, 134303512); /*0xffc4d82f*/
  else
    v14 = *(_DWORD *)(29 * v13 + v23 + 19); /*0xffc4d83d*/
  if ( n25 == 9 ) /*0xffc4d846*/
  {
    v12 = v14 >> 25; /*0xffc4d871*/
    v15 = RmtFuncC4C(n6, 9, v14 >> 25, 0, 0); /*0xffc4d877*/
    goto LABEL_7; /*0xffc4d877*/
  }
  if ( n25 == 26 ) /*0xffc4d84d*/
  {
    v12 = (v14 >> 11) & 0x7F; /*0xffc4d856*/
    v15 = RmtFuncC4C(n6, 26, (v14 >> 11) & 0x7F, 0, 0); /*0xffc4d85d*/
LABEL_7:
    v16 = v15; /*0xffc4d862*/
    goto LABEL_10; /*0xffc4d868*/
  }
  v16 = 0; /*0xffc4d879*/
LABEL_10:
  n19_1 = n19; /*0xffc4d87b*/
  if ( (n19 & 2) != 0 ) /*0xffc4d886*/
  {
    v18 = v22; /*0xffc4d888*/
    *p_n60 = v16; /*0xffc4d88c*/
LABEL_25:
    v20 = v23; /*0xffc4d939*/
    goto LABEL_26; /*0xffc4d939*/
  }
  if ( (n19 & 4) != 0 ) /*0xffc4d897*/
  {
    if ( (__int16)(v12 + *p_n60) > 0 ) /*0xffc4d8a2*/
      n3 = v12 + *p_n60; /*0xffc4d8a4*/
    if ( n3 > 3u ) /*0xffc4d8ad*/
      n3 = 3; /*0xffc4d8af*/
  }
  else
  {
    n3_1 = RmtFuncC4C(n6, n25, *p_n60, 1, 0); /*0xffc4d8bf*/
    n19_1 = n19; /*0xffc4d8c4*/
    n3 = n3_1; /*0xffc4d8cb*/
  }
  if ( n25 == 9 ) /*0xffc4d8d3*/
  {
    v14 = (n3 << 25) | v14 & 0x1FFFFFF; /*0xffc4d8f9*/
  }
  else if ( n25 == 26 ) /*0xffc4d8da*/
  {
    v14 ^= (v14 ^ (n3 << 11)) & 0x3F800; /*0xffc4d8e9*/
  }
  v18 = v22; /*0xffc4d8fb*/
  v20 = v23; /*0xffc4d8ff*/
  if ( v14 != *(_DWORD *)(29 * v22 + v23 + 19) || (n19_1 & 8) != 0 ) /*0xffc4d912*/
  {
    MailBoxFunc8FC5(n6, n4, v22, 134303512, v14); /*0xffc4d923*/
    ProcCommonFuncD3F6(n6, n4); /*0xffc4d92d*/
    n19_1 = n19; /*0xffc4d932*/
    goto LABEL_25; /*0xffc4d932*/
  }
LABEL_26:
  if ( (n19_1 & 0x10) != 0 ) /*0xffc4d940*/
    *(_DWORD *)(29 * v18 + v20 + 19) = v14; /*0xffc4d948*/
  return 0; /*0xffc4d94c*/
}

// Function: ProcCommonFuncD955 @ 0xffc4d955 (0x24e bytes)
// Index: 648/2560

int __cdecl ProcCommonFuncD955(
        unsigned __int8 *n6,
        unsigned __int8 n4,
        int a3,
        int n2,
        int a5,
        unsigned __int8 n9,
        int a7,
        int a8,
        int n25,
        char n19,
        __int16 *p_n60)
{
  unsigned __int8 *n6_1; // edi
  __int16 v12; // bp
  unsigned __int8 n9_1; // bl
  int SocketInfo; // esi
  unsigned __int8 n9_3; // al
  int n9_4; // edx
  unsigned int v18; // eax
  unsigned int v19; // esi
  unsigned int v20; // eax
  int v21; // eax
  int v22; // edi
  int v23; // edi
  unsigned int v24; // ebp
  __int16 n3; // ax
  int v26; // ecx
  int v27; // eax
  unsigned __int8 v28; // cl
  int v29; // eax
  int SocketInfo_2; // edx
  unsigned int v31; // eax
  unsigned int v32; // eax
  int v33; // eax
  int SocketInfo_1; // [esp+10h] [ebp-Ch]
  char n9_2; // [esp+14h] [ebp-8h]

  n6_1 = n6; /*0xffc4d960*/
  v12 = 0; /*0xffc4d964*/
  n9_1 = n9; /*0xffc4d96c*/
  SocketInfo = GetSocketInfo((int)n6, n4); /*0xffc4d970*/
  n9_2 = 9; /*0xffc4d976*/
  SocketInfo_1 = SocketInfo; /*0xffc4d97f*/
  KtiFunc208D((int)n6, n9, 9u); /*0xffc4d983*/
  if ( n9 == 0xFF ) /*0xffc4d98e*/
  {
    n9_1 = 0; /*0xffc4d990*/
    n9 = 0; /*0xffc4d994*/
    n9_3 = 9; /*0xffc4d998*/
LABEL_6:
    while ( !n6_1[257312] && (n9_1 == 8 || n9_1 == 17) ) /*0xffc4d9d2*/
    {
LABEL_38:
      n9 = ++n9_1; /*0xffc4db8d*/
      if ( n9_1 >= n9_3 ) /*0xffc4db93*/
        return 0; /*0xffc4db93*/
    }
    n9_4 = n9_1; /*0xffc4d9d8*/
    if ( (unsigned int)n9_1 + 9 >= 0x12 ) /*0xffc4d9e5*/
      return 1; /*0xffc4d9e5*/
    if ( (n19 & 1) != 0 ) /*0xffc4d9ea*/
    {
      v18 = MailBoxFunc4CB2((int)n6_1, n9, 0x80042F4u); /*0xffc4d9f6*/
      v19 = MiscConfigCheck(n6_1, n4, a3, v18); /*0xffc4da0a*/
      v20 = MailBoxFunc4CB2((int)n6_1, n9_1 + 9, 0x80042F4u); /*0xffc4da19*/
      v21 = MiscConfigCheck(n6_1, n4, a3, v20); /*0xffc4da28*/
      n9_4 = n9_1; /*0xffc4da2d*/
      v22 = v21; /*0xffc4da34*/
    }
    else
    {
      v23 = n9_1 + 1922 * (unsigned __int8)a3; /*0xffc4da4c*/
      v19 = *(_DWORD *)(SocketInfo + 4 * v23 + 231); /*0xffc4da4e*/
      v22 = *(_DWORD *)(SocketInfo_1 + 4 * v23 + 267); /*0xffc4da55*/
    }
    if ( n25 == 36 ) /*0xffc4da63*/
    {
      v24 = v19 >> 23; /*0xffc4da73*/
    }
    else
    {
      if ( n25 != 37 ) /*0xffc4da68*/
        goto LABEL_18; /*0xffc4da68*/
      v24 = v19 >> 21; /*0xffc4da6c*/
    }
    v12 = v24 & 3; /*0xffc4da76*/
LABEL_18:
    if ( (n19 & 2) != 0 ) /*0xffc4da7f*/
    {
      *p_n60 = v12; /*0xffc4da81*/
      goto LABEL_34; /*0xffc4da84*/
    }
    if ( (n19 & 4) != 0 ) /*0xffc4da8c*/
    {
      n3 = v12 + *p_n60; /*0xffc4da91*/
      if ( n3 <= 0 ) /*0xffc4da97*/
        n3 = 0; /*0xffc4da9e*/
      if ( (unsigned __int16)n3 > 3u ) /*0xffc4daa3*/
        LOBYTE(n3) = 3; /*0xffc4daa5*/
    }
    else
    {
      n3 = *p_n60; /*0xffc4daa9*/
    }
    if ( n25 == 36 ) /*0xffc4dab3*/
    {
      v26 = -25165825; /*0xffc4daca*/
      v27 = (n3 & 3) << 23; /*0xffc4dacf*/
    }
    else
    {
      if ( n25 != 37 ) /*0xffc4dab8*/
        goto LABEL_31; /*0xffc4dab8*/
      v26 = -6291457; /*0xffc4dabd*/
      v27 = (n3 & 3) << 21; /*0xffc4dac2*/
    }
    v19 = v27 | v26 & v19; /*0xffc4dad6*/
    v22 = v27 | v26 & v22; /*0xffc4dad8*/
LABEL_31:
    v28 = a3; /*0xffc4dada*/
    v29 = n9_4 + 1922 * (unsigned __int8)a3; /*0xffc4dae7*/
    SocketInfo_2 = SocketInfo_1; /*0xffc4dae9*/
    if ( v19 == *(_DWORD *)(SocketInfo_1 + 4 * v29 + 231) && (n19 & 8) == 0 ) /*0xffc4daf9*/
    {
LABEL_35:
      if ( (n19 & 0x10) != 0 ) /*0xffc4db61*/
      {
        v33 = n9_1 + 1922 * v28; /*0xffc4db6c*/
        *(_DWORD *)(SocketInfo_2 + 4 * v33 + 231) = v19; /*0xffc4db70*/
        *(_DWORD *)(SocketInfo_2 + 4 * v33 + 267) = v22; /*0xffc4db77*/
      }
      SocketInfo = SocketInfo_1; /*0xffc4db7e*/
      n9_3 = n9_2; /*0xffc4db82*/
      n6_1 = n6; /*0xffc4db86*/
      goto LABEL_38; /*0xffc4db86*/
    }
    v31 = MailBoxFunc4CB2((int)n6, n9, 0x80042F4u); /*0xffc4db09*/
    MiscIoCheck(n6, n4, a3, v31, v19); /*0xffc4db1e*/
    v32 = MailBoxFunc4CB2((int)n6, n9_1 + 9, 0x80042F4u); /*0xffc4db37*/
    MiscIoCheck(n6, n4, a3, v32, v22); /*0xffc4db4c*/
LABEL_34:
    SocketInfo_2 = SocketInfo_1; /*0xffc4db54*/
    v28 = a3; /*0xffc4db58*/
    goto LABEL_35; /*0xffc4db58*/
  }
  n9_3 = n9 + 1; /*0xffc4d99b*/
  n9_2 = n9 + 1; /*0xffc4d99e*/
  if ( (unsigned __int8)(n9 + 1) > 9u ) /*0xffc4d9a4*/
    return 1; /*0xffc4d9a6*/
  if ( n9 < n9_3 ) /*0xffc4d9b0*/
    goto LABEL_6; /*0xffc4d9b0*/
  return 0; /*0xffc4db9b*/
}

// Function: ProcCommonFuncDBA3 @ 0xffc4dba3 (0x622 bytes)
// Index: 649/2560

int __cdecl ProcCommonFuncDBA3(
        unsigned __int8 *n6,
        int n4,
        int n6_1,
        int n2,
        unsigned __int8 a5,
        char n0x12,
        int n3,
        int a8,
        int n33,
        char n19,
        _WORD *p_n60)
{
  unsigned __int8 n0x12_2; // bl
  unsigned __int16 n60; // di
  __int16 v13; // ax
  __int16 v14; // cx
  int v15; // edi
  unsigned __int8 n6_2; // bl
  __int16 n0xF; // ax
  int n33_1; // edi
  int n60_1; // edi
  unsigned __int8 v21; // bl
  int v22; // edx
  int v23; // ecx
  unsigned __int16 v24; // ax
  int v25; // edx
  int v26; // ecx
  unsigned __int16 v27; // ax
  unsigned __int16 v28; // ax
  int v29; // edx
  int v30; // ecx
  int v31; // edx
  unsigned __int16 v32; // cx
  unsigned __int16 v33; // ax
  unsigned __int16 n60_2; // [esp-Ch] [ebp-2Ch]
  unsigned __int8 v35; // [esp-Ch] [ebp-2Ch]
  unsigned int v36; // [esp-8h] [ebp-28h]
  char n9; // [esp-4h] [ebp-24h]
  char n9_1; // [esp-4h] [ebp-24h]
  char n9_2; // [esp-4h] [e... [9635 chars total]

// Function: MrcMarginGroupTrain @ 0xffc4e1c5 (0x42b bytes)
// Index: 650/2560

int __cdecl MrcMarginGroupTrain(
        unsigned __int8 *n6,
        int n4,
        _BYTE *n6a,
        int n2,
        int a5,
        int n0x12,
        int n3,
        int a8,
        int n25,
        char n19,
        unsigned __int16 *p_n60)
{
  int result; // eax
  int n0x12_1; // edi
  int CpuCount; // [esp+10h] [ebp-4h]
  int v14; // [esp+10h] [ebp-4h]

  CpuCount = GetCpuCount((int)n6, n4, (unsigned __int8)n6a); /*0xffc4e1e7*/
  if ( ProcCommonFuncEBF8(n6, n4, (unsigned __int8)n6a, n2, a8, n25) == 4 ) /*0xffc4e1fd*/
  {
    DebugPrint( /*0xffc4e21e*/
      (int)n6,
      3,
      n4,
      (int)n6a,
      n2,
      a5,
      n0x12,
      n3,
      "Level = %d, Group = %d,  MRC Margin Group Not Supported\n",
      a8,
      n25);
    return 4; /*0xffc4e229*/
  }
  if ( n25 <= 25 ) /*0xffc4e239*/
  {
    if ( n25 == 25 ) /*0xffc4e23f*/
    {
      n0x12_1 = n0x12; /*0xffc4e3b1*/
      result = MailBoxFunc1B7F(n6, n4, (int)n6a, n2, a5, n0x12, n3, a8, 25, n19, p_n60); /*0xffc4e3cc*/
      goto LABEL_43; /*0xffc4e3d1*/
    }
    if ( n25 <= 18 ) /*0xffc4e248*/
    {
      if ( n25 != 18 ) /*0xffc4e24e*/
      {
        if ( n25 < 0 ) /*0xffc4e256*/
          goto LABEL_39; /*0xffc4e256*/
        if ( n25 > 4 ) /*0xffc4e25f*/
        {
          if ( n25 == 5 ) /*0xffc4e268*/
          {
            n0x12_1 = n0x12; /*0xffc4e2cf*/
            result = MailBoxFunc71F(n6, n4, (int)n6a, n2, a5, n0x12, n3, a8, 5, n19, p_n60); /*0xffc4e2ea*/
            goto LABEL_43; /*0xffc4e2ef*/
          }
          if ( n25 == 6 ) /*0xffc4e26d*/
          {
            n0x12_1 = n0x12; /*0xffc4e2ad*/
            result = MailBoxFunc400(n6, n4, (int)n6a, n0x12, 6, n19, p_n60); /*0xffc4e2be*/
            goto LABEL_43; /*0xffc4e2c6*/
          }
          if ( n25 != 9 ) /*0xffc4e272*/
          {
            if ( n25 == 12 ) /*0xffc4e27b*/
            {
LABEL_13:
              n0x12_1 = n0x12; /*0xffc4e281*/
              result = ProcCommonFuncDBA3(n6, n4, (int)n6a, n2, a5, n0x12, n3, a8, n25, n19, p_n60); /*0xffc4e29f*/
              goto LABEL_43; /*0xffc4e2a4*/
            }
            goto LABEL_39; /*0xffc4e27b*/
          }
          goto LABEL_33; /*0xffc4e272*/
        }
        goto LABEL_42; /*0xffc4e25f*/
      }
LABEL_34:
      n0x12_1 = n0x12; /*0xffc4e47d*/
      result = ProcCommonFuncFB38(n6, n4, (int)n6a, n2, a5, n0x12, n3, a8, n25, n19, p_n60); /*0xffc4e49b*/
      goto LABEL_43; /*0xffc4e4a0*/
    }
    if ( n25 != 19 ) /*0xffc4e2f7*/
    {
      if ( n25 == 23 ) /*0xffc4e306*/
      {
        if ( *(_BYTE *)(1379 * (unsigned __int8)n2 + CpuCount + 107) && a8 == 1 ) /*0xffc4e35b*/
        {
          n0x12_1 = n0x12; /*0xffc4e361*/
          result = MailBoxFunc27EA(n6, n4, (int)n6a, n2, a5, n0x12, n3, 1, 23, n19, p_n60); /*0xffc4e37a*/
        }
        else
        {
          n0x12_1 = n0x12; /*0xffc4e388*/
          result = MailBoxFunc21DE(n6, n4, n6a, n2, a5, n0x12, n3, a8, 23, n19, p_n60); /*0xffc4e3a3*/
        }
        goto LABEL_43; /*0xffc4e37f*/
      }
      goto LABEL_18; /*0xffc4e306*/
    }
LABEL_42:
    n0x12_1 = n0x12; /*0xffc4e562*/
    result = MrcHooksChipServices(n6, n4, (int)n6a, n2, a5, n0x12, n3, a8, n25, n19, p_n60); /*0xffc4e580*/
    goto LABEL_43; /*0xffc4e580*/
  }
  if ( n25 > 39 ) /*0xffc4e3d9*/
  {
    switch ( n25 ) /*0xffc4e4aa*/
    {
      case 'C': /*0xffc4e4aa*/
        goto LABEL_42; /*0xffc4e4aa*/
      case 'D': /*0xffc4e4aa*/
LABEL_18:
        n0x12_1 = n0x12; /*0xffc4e316*/
        result = SmbusInit(n6, n4, (int)n6a, n2, a5, n0x12, n3, a8, n25, n19, p_n60); /*0xffc4e334*/
        break; /*0xffc4e339*/
      case 'b': /*0xffc4e4aa*/
        n0x12_1 = n0x12; /*0xffc4e540*/
        result = ProcCommonFuncE5F0(n6, n4, (int)n6a, n2, a5, n0x12, n3, a8, 98, n19, p_n60); /*0xffc4e55b*/
        break;
      case 'g': /*0xffc4e4aa*/
        n0x12_1 = n0x12; /*0xffc4e51a*/
        result = ProcCommonFuncEC3A(n6, n4, (int)n6a, n2, a5, n0x12, n3, a8, 103, n19, p_n60); /*0xffc4e535*/
        break;
      default:
        goto LABEL_39; /*0xffc4e4c1*/
    }
  }
  else
  {
    if ( n25 >= 38 ) /*0xffc4e3e2*/
      goto LABEL_34; /*0xffc4e3e2*/
    if ( n25 == 26 ) /*0xffc4e3eb*/
    {
LABEL_33:
      n0x12_1 = n0x12; /*0xffc4e455*/
      result = ProcCommonFuncD7E1((int)n6, n4, (char)n6a, n2, a5, n0x12, n3, a8, n25, n19, p_n60); /*0xffc4e473*/
      goto LABEL_43; /*0xffc4e478*/
    }
    if ( n25 == 30 ) /*0xffc4e3f0*/
    {
      n0x12_1 = n0x12; /*0xffc4e439*/
      result = ProcCommonFuncE8B0(n6, n4, (int)n6a, n0x12, n19, p_n60); /*0xffc4e448*/
    }
    else
    {
      if ( n25 <= 30 ) /*0xffc4e3f2*/
        goto LABEL_39; /*0xffc4e3f2*/
      if ( n25 <= 33 ) /*0xffc4e3fb*/
        goto LABEL_13; /*0xffc4e3fb*/
      if ( (unsigned int)(n25 - 36) > 1 ) /*0xffc4e407*/
      {
LABEL_39:
        DebugPrint((int)n6, 2, n4, (int)n6a, n2, a5, n0x12, 255, "GetSetDataGroup called unknown group!\n"); /*0xffc4e4c3*/
        AssertPrint( /*0xffc4e4fa*/
          n6,
          255,
          -2817780,
          "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Mem\\MemIOControl.c",
          1659,
          "FALSE");
        ProcMemInitCheck((int)n6, 242, 53); /*0xffc4e507*/
        return 0; /*0xffc4e511*/
      }
      n0x12_1 = n0x12; /*0xffc4e411*/
      result = ProcCommonFuncD955(n6, n4, (int)n6a, n2, a5, n0x12, n3, a8, n25, n19, (__int16 *)p_n60); /*0xffc4e42b*/
    }
  }
LABEL_43:
  v14 = result; /*0xffc4e588*/
  if ( result )
  {
    DebugPrint( /*0xffc4e5af*/
      (int)n6,
      3,
      n4,
      (int)n6a,
      n2,
      a5,
      n0x12_1,
      n3,
      "Level = %d, Group = %d,  MRC Margin Group training failed.\n",
      a8,
      n25);
    AssertPrint(
      n6,
      255,
      (int)"\n\nRC_ASSERT! %s: %u   %s ",
      "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Mem\\MemIOControl.c",
      1667,
      "FALSE");
    ProcMemInitCheck((int)n6, 242, 85); /*0xffc4e5de*/
    return v14; /*0xffc4e5e3*/
  }
  return result; /*0xffc4e5ea*/
}

// Function: ProcCommonFuncE5F0 @ 0xffc4e5f0 (0x29a bytes)
// Index: 651/2560

int __cdecl ProcCommonFuncE5F0(
        unsigned __int8 *n6,
        int n4,
        int n6_1,
        int n2,
        unsigned __int8 a5,
        unsigned __int8 n0x12,
        int n4a,
        int a8,
        int n98,
        char n19,
        unsigned __int16 *p_n60)
{
  unsigned __int16 n60; // si
  unsigned __int16 v12; // cx
  unsigned __int16 v13; // ax
  char n0x12_1; // al
  int v15; // edi
  unsigned int v16; // ecx
  __int16 v17; // ax
  __int16 v18; // si
  __int16 n448; // ax
  __int16 v20; // ax
  __int16 v21; // si
  __int16 n448_1; // ax
  unsigned __int16 v24; // [esp+10h] [ebp-10h]
  int CpuCount; // [esp+14h] [ebp-Ch]
  int v26; // [esp+1Ch] [ebp-4h]

  n60 = 0; /*0xffc4e5ff*/
  GetSocketInfo((int)n6, n4); /*0xffc4e603*/
  CpuCount = GetCpuCount((int)n6, n4, n6_1); /*0xffc4e618*/
  KtiFunc91AF((int)n6, n4, n6_1, n2); /*0xffc4e61f*/
  v26 = KtiFunc91DE((int)n6, n4, n6_1, n2); /*0xffc4e634*/
  if ( ProcCommonFuncD306((int)n6, n4, n6_1, n2) )
  {
    v24 = KtiFunc8FA3(n6, n4, n6_1, n2, a5, n0x12, 1); /*0xffc4e686*/
    v12 = RmtFunc6F65(0x2060u, v24); /*0xffc4e68f*/
    if ( (n19 & 2) != 0 ) /*0xffc4e6a3*/
    {
      *p_n60 = v12; /*0xffc4e6a9*/
    }
    else
    {
      if ( (n19 & 4) != 0 ) /*0xffc4e6b7*/
        n60 = v12 + *p_n60; /*0xffc4e6bf*/
      else
        n60 = *p_n60; /*0xffc4e6c4*/
      v13 = v24 & 0xDF9F | RmtFunc6E09(0x2060u, n60); /*0xffc4e6de*/
      v24 = v13; /*0xffc4e6eb*/
      if ( (n6[134] & 0x20) != 0 && n6[9478] ) /*0xffc4e6f1*/
      {
        if ( *(_BYTE *)(1379 * (unsigned __int8)n2 + CpuCount + 104) ) /*0xffc4e70b*/
        {
          if ( n0x12 < 9u ) /*0xffc4e718*/
            n0x12_1 = 2 * n0x12; /*0xffc4e720*/
          else
            n0x12_1 = 2 * n0x12 - 17; /*0xffc4e71c*/
          DdrTrainFunc2C34(n6, n4, n6_1, n2, a5, n0x12_1, v24, 1); /*0xffc4e726*/
        }
        else
        {
          DdrTrainFunc2C34(n6, n4, n6_1, n2, a5, n0x12 % 9u, v13, 1); /*0xffc4e748*/
        }
      }
      else
      {
        RmtFunc349(n6, n4, n6_1, n2, a5, v13, 1); /*0xffc4e763*/
      }
    }
    if ( (n19 & 0x10) != 0 )
    {
      v15 = v26 + 244 * a5; /*0xffc4e78f*/
      *(_WORD *)(v15 + 2) = v24 & 0xDF9F; /*0xffc4e793*/
      v16 = n0x12 < 9u ? 0xFFFFFFFA : 0;
      switch ( n0x12 % 9u )
      {
        case 0u:
          v17 = ((unsigned __int8)n60 ^ (unsigned __int8)*(_WORD *)(v15 + v16 + 54)) & 7; /*0xffc4e7c1*/
          goto LABEL_21; /*0xffc4e7c1*/
        case 1u:
          v17 = (*(_WORD *)(v15 + v16 + 54) ^ (8 * n60)) & 0x38; /*0xffc4e7d9*/
LABEL_21:
          *(_WORD *)(v15 + v16 + 54) ^= v17; /*0xffc4e7c5*/
          return 0; /*0xffc4e7ca*/
        case 2u:
          v18 = n60 << 6; /*0xffc4e7df*/
          n448 = 448; /*0xffc4e7e2*/
          goto LABEL_24; /*0xffc4e7e2*/
        case 3u:
          v18 = n60 << 9; /*0xffc4e7f9*/
          n448 = 3584; /*0xffc4e7fc*/
          goto LABEL_24; /*0xffc4e801*/
        case 4u:
          v18 = n60 << 12; /*0xffc4e803*/
          n448 = 28672; /*0xffc4e806*/
LABEL_24:
          *(_WORD *)(v15 + v16 + 54) ^= n448 & (*(_WORD *)(v15 + v16 + 54) ^ v18); /*0xffc4e7e7*/
          return 0; /*0xffc4e7f4*/
        case 5u:
          v20 = ((unsigned __int8)n60 ^ (unsigned __int8)*(_WORD *)(v15 + v16 + 56)) & 7; /*0xffc4e815*/
          goto LABEL_28; /*0xffc4e815*/
        case 6u:
          v20 = (*(_WORD *)(v15 + v16 + 56) ^ (8 * n60)) & 0x38; /*0xffc4e82a*/
LABEL_28:
          *(_WORD *)(v15 + v16 + 56) ^= v20; /*0xffc4e819*/
          return 0; /*0xffc4e81e*/
        case 7u:
          v21 = n60 << 6; /*0xffc4e830*/
          n448_1 = 448; /*0xffc4e833*/
          goto LABEL_31; /*0xffc4e833*/
        case 8u:
          v21 = n60 << 9; /*0xffc4e847*/
          n448_1 = 3584; /*0xffc4e84a*/
LABEL_31:
          *(_WORD *)(v15 + v16 + 56) ^= n448_1 & (*(_WORD *)(v15 + v16 + 56) ^ v21); /*0xffc4e838*/
          break; /*0xffc4e845*/
        default:
          AssertPrint(
            n6,
            255,
            (int)"\n\nRC_ASSERT! %s: %u   %s ",
            "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Mem\\MemIOControl.c",
            1980,
            "FALSE");
          ProcMemInitCheck((int)n6, 242, 86); /*0xffc4e878*/
          break; /*0xffc4e878*/
      }
    }
  }
  else
  {
    DebugPrint((int)n6, 3, n4, n6_1, n2, 255, 255, 255, "Dimm does not support programmable CTLE\n"); /*0xffc4e65d*/
  }
  return 0; /*0xffc4e880*/
}

// Function: ProcCommonFuncE8B0 @ 0xffc4e8b0 (0x348 bytes)
// Index: 652/2560

int __cdecl ProcCommonFuncE8B0(
        unsigned __int8 *n6,
        unsigned __int8 n4,
        int a3,
        unsigned __int8 n0x12,
        char n19,
        unsigned __int16 *p_n60)
{
  unsigned __int8 *n6_1; // ebp
  unsigned __int8 n0x12_1; // bl
  int SocketInfo; // esi
  unsigned __int8 n9_1; // al
  unsigned int v10; // eax
  unsigned __int8 n2; // bl
  unsigned int v12; // esi
  unsigned int v13; // eax
  int v14; // edi
  unsigned int v15; // eax
  unsigned int v16; // eax
  int v17; // ecx
  int v18; // eax
  int v20; // ecx
  int v21; // edx
  unsigned __int8 v22; // bl
  int v23; // ecx
  unsigned __int16 n0xF; // dx
  int v25; // edx
  unsigned int v26; // eax
  unsigned __int8 n2_1; // bl
  unsigned int v28; // eax
  unsigned int v29; // eax
  unsigned int v30; // eax
  int v31; // [esp+10h] [ebp-18h]
  unsigned int v32; // [esp+14h] [ebp-14h]
  int SocketInfo_1; // [esp+18h] [ebp-10h]
  __int16 n60; // [esp+1Ch] [ebp-Ch]
  char n9; // [esp+20h] [ebp-8h]
  int n0x12_2; // [esp+24h] [ebp-4h]

  n6_1 = n6; /*0xffc4e8b5*/
  n0x12_1 = n0x12; /*0xffc4e8c5*/
  SocketInfo = GetSocketInfo((int)n6, n4); /*0xffc4e8c9*/
  n9 = 9; /*0xffc4e8cf*/
  SocketInfo_1 = SocketInfo; /*0xffc4e8d8*/
  KtiFunc208D((int)n6, n0x12, 9u); /*0xffc4e8dc*/
  if ( n0x12 == 0xFF ) /*0xffc4e8e7*/
  {
    n0x12_1 = 0; /*0xffc4e8ed*/
    n0x12 = 0; /*0xffc4e8f1*/
    n9_1 = 9; /*0xffc4e8f5*/
    while ( 1 ) /*0xffc4e8f6*/
    {
      if ( !n6_1[257312] && (n0x12_1 == 8 || n0x12_1 == 17) ) /*0xffc4e90b*/
        goto LABEL_35; /*0xffc4e90b*/
      n0x12_2 = n0x12_1; /*0xffc4e914*/
      if ( (unsigned int)n0x12_1 + 9 >= 0x12 ) /*0xffc4e91e*/
        return 1; /*0xffc4e91e*/
      if ( (n19 & 1) != 0 ) /*0xffc4e92b*/
      {
        v10 = MailBoxFunc4CB2((int)n6_1, n0x12, 0x80042F0u); /*0xffc4e93b*/
        n2 = n0x12_1 + 9; /*0xffc4e955*/
        v12 = MiscConfigCheck(n6_1, n4, a3, v10); /*0xffc4e958*/
        v13 = MailBoxFunc4CB2((int)n6_1, n2, 0x80042F0u); /*0xffc4e95c*/
        v14 = MiscConfigCheck(n6_1, n4, a3, v13); /*0xffc4e979*/
        v15 = MailBoxFunc4CB2((int)n6_1, n0x12, 0x80042F4u); /*0xffc4e97c*/
        v31 = MiscConfigCheck(n6_1, n4, a3, v15); /*0xffc4e99a*/
        v16 = MailBoxFunc4CB2((int)n6_1, n2, 0x80042F4u); /*0xffc4e99e*/
        n0x12_1 = n0x12; /*0xffc4e9b2*/
        v17 = MiscConfigCheck(n6_1, n4, a3, v16); /*0xffc4e9b6*/
        v32 = v17; /*0xffc4e9b8*/
        v18 = v31; /*0xffc4e9bf*/
      }
      else
      {
        v20 = n0x12_1 + 1922 * (unsigned __int8)a3; /*0xffc4e9e9*/
        v18 = *(_DWORD *)(SocketInfo_1 + 4 * v20 + 231); /*0xffc4e9ef*/
        v12 = *(_DWORD *)(SocketInfo + 4 * v20 + 87); /*0xffc4e9f6*/
        v14 = *(_DWORD *)(SocketInfo_1 + 4 * v20 + 123); /*0xffc4e9fa*/
        v17 = *(_DWORD *)(SocketInfo_1 + 4 * v20 + 267); /*0xffc4e9fe*/
        v31 = v18; /*0xffc4ea05*/
        v32 = v17; /*0xffc4ea09*/
      }
      v21 = (v12 >> 18) & 0xF; /*0xffc4ea12*/
      if ( (n19 & 2) != 0 ) /*0xffc4ea18*/
      {
        *p_n60 = v21; /*0xffc4ea1e*/
      }
      else
      {
        if ( (n19 & 4) != 0 ) /*0xffc4ea69*/
        {
          n60 = *p_n60; /*0xffc4ea72*/
          if ( (__int16)(v21 + *p_n60) <= 0 ) /*0xffc4ea7b*/
            n0xF = 0; /*0xffc4ea82*/
          else
            n0xF = v21 + *p_n60; /*0xffc4ea7d*/
          v17 = v32; /*0xffc4ea8a*/
          if ( n0xF > 0xFu ) /*0xffc4ea8e*/
            LOBYTE(n0xF) = 15; /*0xffc4ea92*/
        }
        else
        {
          n60 = *p_n60; /*0xffc4ea9c*/
          LOBYTE(n0xF) = *p_n60; /*0xffc4eaa0*/
        }
        v25 = (n0xF & 0xF) << 18; /*0xffc4eaad*/
        v12 = v25 | (unsigned int)&loc_FFC3FFFF & v12; /*0xffc4eab4*/
        v14 = v25 | (unsigned int)&loc_FFC3FFFF & v14; /*0xffc4eaba*/
        n6_1 = n6; /*0xffc4ead1*/
        if ( v12 != *(_DWORD *)(SocketInfo_1 + 4 * (n0x12_2 + 1922 * (unsigned __int8)a3) + 87) || (n19 & 8) != 0 ) /*0xffc4eada*/
        {
          if ( (v12 & 0x8000) != 0 ) /*0xffc4eaea*/
            goto LABEL_30; /*0xffc4eaea*/
          if ( n60 ) /*0xffc4eaef*/
          {
            v18 |= 0x4000u; /*0xffc4eaf1*/
            v12 |= 0x8400u; /*0xffc4eaf6*/
            v14 |= 0x8400u; /*0xffc4eafc*/
            v31 = v18; /*0xffc4eb02*/
            v17 |= 0x4000u; /*0xffc4eb06*/
            v32 = v17; /*0xffc4eb0c*/
          }
          if ( (v12 & 0x8000) != 0 ) /*0xffc4eb16*/
          {
LABEL_30:
            if ( !n60 ) /*0xffc4eb1b*/
            {
              v12 &= 0xFFFF7BFF; /*0xffc4eb22*/
              v14 &= 0xFFFF7BFF; /*0xffc4eb24*/
              v31 = v18 & 0xFFFFBFFF; /*0xffc4eb2f*/
              v32 = v17 & 0xFFFFBFFF; /*0xffc4eb33*/
            }
          }
          v26 = MailBoxFunc4CB2((int)n6, n0x12, 0x80042F0u); /*0xffc4eb42*/
          MiscIoCheck(n6, n4, a3, v26, v12); /*0xffc4eb54*/
          n2_1 = n0x12_1 + 9; /*0xffc4eb5c*/
          v28 = MailBoxFunc4CB2((int)n6, n2_1, 0x80042F0u); /*0xffc4eb67*/
          MiscIoCheck(n6, n4, a3, v28, v14); /*0xffc4eb79*/
          v29 = MailBoxFunc4CB2((int)n6, n0x12, 0x80042F4u); /*0xffc4eb8f*/
          MiscIoCheck(n6, n4, a3, v29, v31); /*0xffc4eba1*/
          v30 = MailBoxFunc4CB2((int)n6, n2_1, 0x80042F4u); /*0xffc4ebb4*/
          v22 = a3; /*0xffc4ebb9*/
          MiscIoCheck(n6, n4, a3, v30, v32); /*0xffc4ebc7*/
          goto LABEL_15; /*0xffc4ebcf*/
        }
      }
      v22 = a3; /*0xffc4ea21*/
LABEL_15:
      if ( (n19 & 0x10) != 0 ) /*0xffc4ea2a*/
      {
        v23 = n0x12_2 + 1922 * v22; /*0xffc4ea3d*/
        *(_DWORD *)(SocketInfo_1 + 4 * v23 + 87) = v12; /*0xffc4ea41*/
        SocketInfo = SocketInfo_1; /*0xffc4ea45*/
        *(_DWORD *)(SocketInfo_1 + 4 * v23 + 231) = v31; /*0xffc4ea4b*/
        *(_DWORD *)(SocketInfo_1 + 4 * v23 + 123) = v14; /*0xffc4ea56*/
        *(_DWORD *)(SocketInfo_1 + 4 * v23 + 267) = v32; /*0xffc4ea5a*/
      }
      else
      {
        SocketInfo = SocketInfo_1; /*0xffc4ebd4*/
      }
      n9_1 = n9; /*0xffc4ebd8*/
      n0x12_1 = n0x12; /*0xffc4ebdc*/
LABEL_35:
      n0x12 = ++n0x12_1; /*0xffc4ebe2*/
LABEL_36:
      if ( n0x12_1 >= n9_1 ) /*0xffc4ebe8*/
        return 0; /*0xffc4ebee*/
    }
  }
  n9_1 = n0x12 + 1; /*0xffc4e9c5*/
  n9 = n0x12 + 1; /*0xffc4e9c8*/
  if ( (unsigned __int8)(n0x12 + 1) <= 9u ) /*0xffc4e9ce*/
    goto LABEL_36; /*0xffc4e9ce*/
  return 1; /*0xffc4ebf0*/
}

// Function: ProcCommonFuncEBF8 @ 0xffc4ebf8 (0x42 bytes)
// Index: 653/2560

int __cdecl ProcCommonFuncEBF8(
        unsigned __int8 *n6,
        unsigned __int8 n4,
        unsigned __int8 a3,
        unsigned __int8 n2,
        int a5,
        int n25)
{
  if ( a5 == 1 && (n25 == 40 || n25 == 44 || n25 == 53) )
    return KtiFuncCB2E((int)n6, n4, a3, n2) ? 0 : 4;
  else
    return 0; /*0xffc4ec36*/
}

// Function: ProcCommonFuncEC3A @ 0xffc4ec3a (0x1d0 bytes)
// Index: 654/2560

int __cdecl ProcCommonFuncEC3A(
        unsigned __int8 *n6,
        unsigned __int8 n4,
        int a3,
        int n2,
        int a5,
        unsigned __int8 n0x12,
        int n3,
        int a8,
        int n103,
        char n19,
        unsigned __int16 *p_n60)
{
  unsigned __int8 n0x12_1; // bl
  int SocketInfo; // esi
  unsigned __int8 n9_1; // al
  int n0x12_2; // edx
  unsigned int v16; // eax
  int v17; // esi
  unsigned int v18; // eax
  int v19; // eax
  unsigned __int8 v20; // cl
  unsigned int v21; // edi
  int v22; // edi
  int v23; // eax
  int v24; // eax
  int SocketInfo_2; // ecx
  unsigned int v26; // eax
  unsigned int v27; // eax
  int v28; // eax
  int SocketInfo_1; // [esp+10h] [ebp-Ch]
  char n9; // [esp+14h] [ebp-8h]

  n0x12_1 = n0x12; /*0xffc4ec4f*/
  SocketInfo = GetSocketInfo((int)n6, n4); /*0xffc4ec53*/
  n9 = 9; /*0xffc4ec59*/
  SocketInfo_1 = SocketInfo; /*0xffc4ec62*/
  KtiFunc208D((int)n6, n0x12, 9u); /*0xffc4ec66*/
  if ( n0x12 == 0xFF ) /*0xffc4ec71*/
  {
    n0x12_1 = 0; /*0xffc4ec73*/
    n0x12 = 0; /*0xffc4ec77*/
    n9_1 = 9; /*0xffc4ec7b*/
LABEL_6:
    while ( !n6[257312] && (n0x12_1 == 8 || n0x12_1 == 17) ) /*0xffc4ecb2*/
    {
LABEL_22:
      n0x12 = ++n0x12_1; /*0xffc4edf4*/
      if ( n0x12_1 >= n9_1 ) /*0xffc4edfa*/
        return 0; /*0xffc4edfa*/
    }
    n0x12_2 = n0x12_1; /*0xffc4ecb8*/
    if ( (unsigned int)n0x12_1 + 9 >= 0x12 ) /*0xffc4ecc5*/
      return 1; /*0xffc4ecc5*/
    if ( (n19 & 1) != 0 ) /*0xffc4ecca*/
    {
      v16 = MailBoxFunc4CB2((int)n6, n0x12, 0x80042ECu); /*0xffc4ecd6*/
      v17 = MiscConfigCheck(n6, n4, a3, v16); /*0xffc4eceb*/
      v18 = MailBoxFunc4CB2((int)n6, n0x12_1 + 9, 0x80042ECu); /*0xffc4ecfa*/
      v19 = MiscConfigCheck(n6, n4, a3, v18); /*0xffc4ed06*/
      v20 = a3; /*0xffc4ed0b*/
      n0x12_2 = n0x12_1; /*0xffc4ed12*/
      v21 = v19; /*0xffc4ed16*/
    }
    else
    {
      v20 = a3; /*0xffc4ed1a*/
      v22 = n0x12_1 + 1922 * (unsigned __int8)a3; /*0xffc4ed2b*/
      v17 = *(_DWORD *)(SocketInfo + 4 * v22 + 15); /*0xffc4ed2d*/
      v21 = *(_DWORD *)(SocketInfo_1 + 4 * v22 + 51); /*0xffc4ed31*/
    }
    if ( (n19 & 2) != 0 ) /*0xffc4ed3c*/
    {
      *p_n60 = 0; /*0xffc4ed40*/
    }
    else
    {
      v23 = (*p_n60 & 7) << 10; /*0xffc4ed5a*/
      v17 = v23 | v17 & 0xFFFFE3FF; /*0xffc4ed5d*/
      v21 = v23 | v21 & 0xFFFFE3FF; /*0xffc4ed5f*/
      v24 = v20; /*0xffc4ed61*/
      SocketInfo_2 = SocketInfo_1; /*0xffc4ed64*/
      if ( v17 == *(_DWORD *)(SocketInfo_1 + 4 * (n0x12_2 + 1922 * v24) + 15) && (n19 & 8) == 0 ) /*0xffc4ed79*/
      {
LABEL_19:
        if ( (n19 & 0x10) != 0 ) /*0xffc4edcf*/
        {
          v28 = n0x12_1 + 1922 * (unsigned __int8)a3; /*0xffc4edde*/
          *(_DWORD *)(SocketInfo_2 + 4 * v28 + 15) = v17; /*0xffc4ede2*/
          *(_DWORD *)(SocketInfo_2 + 4 * v28 + 51) = v21; /*0xffc4ede6*/
        }
        SocketInfo = SocketInfo_1; /*0xffc4edea*/
        n9_1 = n9; /*0xffc4edee*/
        goto LABEL_22; /*0xffc4edee*/
      }
      v26 = MailBoxFunc4CB2((int)n6, n0x12, 0x80042ECu); /*0xffc4ed86*/
      MiscIoCheck(n6, n4, a3, v26, v17); /*0xffc4ed98*/
      v27 = MailBoxFunc4CB2((int)n6, n0x12_1 + 9, 0x80042ECu); /*0xffc4edae*/
      MiscIoCheck(n6, n4, a3, v27, v21); /*0xffc4edc0*/
    }
    SocketInfo_2 = SocketInfo_1; /*0xffc4edc8*/
    goto LABEL_19; /*0xffc4edc8*/
  }
  n9_1 = n0x12 + 1; /*0xffc4ec7e*/
  n9 = n0x12 + 1; /*0xffc4ec81*/
  if ( (unsigned __int8)(n0x12 + 1) > 9u ) /*0xffc4ec87*/
    return 1; /*0xffc4ec89*/
  if ( n0x12 < n9_1 ) /*0xffc4ec93*/
    goto LABEL_6; /*0xffc4ec93*/
  return 0; /*0xffc4ee02*/
}

// Function: MrcHooksChipServices @ 0xffc4ee0a (0xd2e bytes)
// Index: 655/2560

int __cdecl MrcHooksChipServices(
        unsigned __int8 *n6,
        int n4,
        int n6_2,
        int n2,
        int a5,
        int n8,
        int n4a,
        int a8,
        int n25,
        char n19,
        unsigned __int16 *p_n60)
{
  unsigned __int8 *n6_1; // ebp
  int v12; // edi
  int CpuCount; // ebx
  unsigned int v14; // esi
  int n2_1; // ecx
  unsigned __int8 v16; // bh
  char v17; // al
  unsigned __int8 n8_1; // bl
  char v20; // ah
  int n8_2; // edx
  int n25_1; // edx
  unsigned int v23; // eax
  unsigned __int8 v24; // dl
  unsigned __int8 n0x10; // al
  int v26; // eax
  int v27; // eax
  unsigned __int8 n6_3; // dl
  unsigned __int16 n60_1; // cx
  int n60; // eax
  int n60_4; // ebx
  const char *v32; // eax
  const char *v33; // eax
  int n25_2; // edx
  unsigned __int16 n60_7; // ax
  const char *v36; // eax
  char n60_8; // cl
  const char *v38; // eax
  int v39; // ecx
  unsigned int v40; // esi
  unsigned int v41; // eax
  int v42; // eax
  unsigned... [21681 chars total]

// Function: ProcCommonFuncFB38 @ 0xffc4fb38 (0x8c8 bytes)
// Index: 656/2560

int __cdecl ProcCommonFuncFB38(
        unsigned __int8 *n6,
        int n4,
        int n6a,
        int n4a,
        int a5,
        int n8,
        int n4_1,
        int a8,
        int n25,
        char n12,
        unsigned __int16 *p_n60)
{
  unsigned __int8 *n6_1; // ebp
  unsigned __int8 n6a_1; // di
  int SocketInfo; // esi
  unsigned __int8 n8_1; // bl
  unsigned __int8 n18; // bh
  unsigned __int8 n4_6; // cl
  char v17; // ah
  int n8_2; // edx
  int v19; // eax
  int v20; // eax
  unsigned int v21; // esi
  int v22; // eax
  int v23; // edi
  unsigned int v24; // eax
  int v26; // edi
  __int16 v27; // cx
  unsigned int v28; // ecx
  unsigned int v29; // eax
  int *v30; // eax
  int n4_3; // edx
  __int16 v32; // cx
  unsigned int v33; // ecx
  unsigned int v34; // eax
  int *v35; // eax
  int n4_2; // edx
  unsigned __int16 v37; // cx
  __int16 n60; // ax
  int n6a_2; // ebx
  const char *v40; // eax
  __int16 n60_2; // cx
  const char *v42; // eax
  unsigned __int16 *v43... [15946 chars total]

// Function: MailBoxFunc400 @ 0xffc50400 (0x31f bytes)
// Index: 657/2560

int __cdecl MailBoxFunc400(
        unsigned __int8 *n6,
        unsigned __int8 n4,
        int a3,
        unsigned __int8 n0x12,
        int n6a,
        char n19,
        unsigned __int16 *p_n60)
{
  char v7; // bp
  int CpuCount; // esi
  unsigned __int8 n2_1; // al
  _BYTE *v10; // esi
  unsigned __int8 n0x12_2; // cl
  int n0x12_3; // edx
  unsigned __int8 n9_1; // al
  int v14; // eax
  unsigned int v15; // esi
  int v16; // eax
  int v17; // eax
  unsigned __int8 v18; // dl
  int SocketInfo_1; // ebp
  unsigned int v20; // edi
  int v22; // edi
  char n19_1; // cl
  int v24; // eax
  int v25; // eax
  unsigned __int16 n3; // ax
  int v27; // eax
  int v28; // eax
  unsigned int v29; // eax
  unsigned int v30; // eax
  unsigned __int8 n0x12_1; // [esp+Fh] [ebp-1Dh]
  unsigned __int8 v32; // [esp+10h] [ebp-1Ch]
  unsigned __int8 n9; // [esp+14h] [ebp-18h]
  int n0x12_4; // [esp+18h] [ebp-14h]
  char v35; // [esp+1Ch] [ebp-10h]
  unsigned __int8 n2; // [esp+20h] [ebp-Ch]
  int SocketInfo; // [esp+24h] [ebp-8h]
  _BYTE *v38; // [esp+28h] [ebp-4h]
  unsigned __int8 n0x12a; // [esp+3Ch] [ebp+10h]

  v7 = a3; /*0xffc50414*/
  SocketInfo = GetSocketInfo((int)n6, n4); /*0xffc5041d*/
  CpuCount = GetCpuCount((int)n6, n4, a3); /*0xffc50429*/
  n9 = 9; /*0xffc5042d*/
  n0x12_1 = n0x12; /*0xffc5043a*/
  KtiFunc208D((int)n6, n0x12, 9u); /*0xffc5043e*/
  if ( n0x12 == 0xFF ) /*0xffc5044c*/
  {
    n0x12_1 = 0; /*0xffc50454*/
  }
  else
  {
    n9 = n0x12 + 1; /*0xffc5055c*/
    if ( (unsigned __int8)(n0x12 + 1) > 0x12u ) /*0xffc50562*/
      return 1; /*0xffc5056b*/
  }
  n2_1 = 0; /*0xffc50458*/
  v10 = (_BYTE *)(CpuCount + 19); /*0xffc5045a*/
  n2 = 0; /*0xffc5045d*/
  v38 = v10; /*0xffc50461*/
  do /*0xffc5063c*/
  {
    if ( *(v10 - 19) ) /*0xffc50466*/
    {
      v35 = 0; /*0xffc50473*/
      if ( *v10 ) /*0xffc50470*/
      {
        while ( 1 ) /*0xffc5048e*/
        {
          if ( !KtiFunc89E9((int)n6, n4, v7, n2, v35, 0) ) /*0xffc5048e*/
          {
            v32 = KtiFunc88D1((int)n6, n4, v7, n2, v35); /*0xffc504b1*/
            n0x12_2 = n0x12_1; /*0xffc504bc*/
            n0x12a = n0x12_1; /*0xffc504be*/
            if ( n0x12_1 < n9 ) /*0xffc504c6*/
              break; /*0xffc504c6*/
          }
LABEL_27:
          if ( (unsigned __int8)++v35 >= *v10 ) /*0xffc50620*/
          {
            n2_1 = n2; /*0xffc50626*/
            goto LABEL_29; /*0xffc50626*/
          }
        }
        n0x12_3 = n0x12_1; /*0xffc504cc*/
        n9_1 = n9; /*0xffc504cf*/
        n0x12_4 = n0x12_1; /*0xffc504d3*/
        while ( 1 ) /*0xffc504d7*/
        {
          if ( !n6[257312] && (n0x12_2 == 8 || n0x12_2 == 17) ) /*0xffc504ec*/
            goto LABEL_25; /*0xffc504ec*/
          if ( (unsigned int)(n0x12_3 + 9) < 0x12 ) /*0xffc504f8*/
            break; /*0xffc504f8*/
LABEL_24:
          n9_1 = n9; /*0xffc505f9*/
LABEL_25:
          ++n0x12_2; /*0xffc505fd*/
          ++n0x12_3; /*0xffc505ff*/
          n0x12a = n0x12_2; /*0xffc50600*/
          n0x12_4 = n0x12_3; /*0xffc50604*/
          if ( n0x12_2 >= n9_1 ) /*0xffc5060a*/
          {
            v10 = v38; /*0xffc50610*/
            goto LABEL_27; /*0xffc50610*/
          }
        }
        if ( (n19 & 1) != 0 ) /*0xffc50503*/
        {
          v14 = MailBoxFunc4C47((int)n6, v32, n0x12a, 0x8004200u); /*0xffc50513*/
          v15 = MiscConfigCheck(n6, n4, v7, v14); /*0xffc50524*/
          v16 = MailBoxFunc4C47((int)n6, v32, n0x12a + 9, 0x8004200u); /*0xffc5053a*/
          v17 = MiscConfigCheck(n6, n4, v7, v16); /*0xffc50546*/
          v18 = a3; /*0xffc5054b*/
          SocketInfo_1 = SocketInfo; /*0xffc50552*/
          v20 = v17; /*0xffc50556*/
        }
        else
        {
          v18 = a3; /*0xffc50570*/
          SocketInfo_1 = SocketInfo; /*0xffc50574*/
          v22 = n0x12_4 + 1922 * (unsigned __int8)a3 + 18 * v32; /*0xffc5058d*/
          v15 = *(_DWORD *)(SocketInfo + 4 * v22 + 4462); /*0xffc5058f*/
          v20 = *(_DWORD *)(SocketInfo + 4 * v22 + 4498); /*0xffc50596*/
        }
        n19_1 = n19; /*0xffc5059d*/
        v24 = (v15 >> 27) & 7; /*0xffc505a6*/
        if ( (n19 & 2) != 0 ) /*0xffc505ac*/
        {
          *p_n60 = v24; /*0xffc505b6*/
          n0x12_3 = n0x12_4; /*0xffc505b9*/
        }
        else
        {
          if ( (n19 & 4) != 0 ) /*0xffc5064f*/
          {
            if ( (__int16)(v24 + *p_n60) <= 0 ) /*0xffc5065e*/
              n3 = 0; /*0xffc50665*/
            else
              n3 = v24 + *p_n60; /*0xffc50660*/
            if ( n3 > 3u ) /*0xffc5066d*/
              LOBYTE(n3) = 3; /*0xffc5066f*/
          }
          else
          {
            n3 = *p_n60; /*0xffc50677*/
          }
          v27 = (n3 & 7) << 27; /*0xffc50682*/
          v15 = v27 | v15 & 0xC7FFFFFF; /*0xffc50689*/
          v20 = v27 | v20 & 0xC7FFFFFF; /*0xffc5068b*/
          v28 = v18; /*0xffc5068d*/
          n0x12_3 = n0x12_4; /*0xffc50690*/
          if ( v15 != *(_DWORD *)(SocketInfo_1 + 4 * (n0x12_4 + 1922 * v28 + 18 * v32) + 4462) /*0xffc506b6*/
            || (n19_1 = n19, (n19 & 8) != 0) )
          {
            v29 = MailBoxFunc4C47((int)n6, v32, n0x12a, 0x8004200u); /*0xffc506cb*/
            v7 = a3; /*0xffc506d0*/
            MiscIoCheck(n6, n4, a3, v29, v15); /*0xffc506de*/
            v30 = MailBoxFunc4C47((int)n6, v32, n0x12a + 9, 0x8004200u); /*0xffc506fb*/
            MiscIoCheck(n6, n4, a3, v30, v20); /*0xffc5070a*/
            n0x12_3 = n0x12_4; /*0xffc5070f*/
            n19_1 = n19; /*0xffc50716*/
            goto LABEL_21; /*0xffc5071a*/
          }
        }
        v7 = a3; /*0xffc505bd*/
LABEL_21:
        if ( (n19_1 & 0x10) != 0 ) /*0xffc505c4*/
        {
          v7 = a3; /*0xffc505ca*/
          v25 = n0x12_3 + 1922 * (unsigned __int8)a3 + 18 * v32; /*0xffc505e1*/
          *(_DWORD *)(SocketInfo + 4 * v25 + 4462) = v15; /*0xffc505e7*/
          *(_DWORD *)(SocketInfo + 4 * v25 + 4498) = v20; /*0xffc505ee*/
        }
        n0x12_2 = n0x12a; /*0xffc505f5*/
        goto LABEL_24; /*0xffc505f5*/
      }
    }
LABEL_29:
    ++n2_1; /*0xffc5062a*/
    v10 += 1379; /*0xffc5062c*/
    n2 = n2_1; /*0xffc50632*/
    v38 = v10; /*0xffc50636*/
  }
  while ( n2_1 < 2u ); /*0xffc5063c*/
  return 0; /*0xffc50645*/
}

// Function: MailBoxFunc71F @ 0xffc5071f (0x641 bytes)
// Index: 658/2560

int __cdecl MailBoxFunc71F(
        unsigned __int8 *n6,
        int n4,
        int n6_2,
        int n2,
        int a5,
        unsigned __int8 n8,
        char n3,
        int a8,
        int n5,
        char n19,
        unsigned __int16 *p_n60)
{
  unsigned __int8 *n6_1; // ebx
  unsigned __int16 v12; // bp
  unsigned int v13; // edi
  unsigned int v14; // esi
  unsigned __int8 n8_1; // cl
  unsigned __int8 n0x12; // al
  char n19_1; // dl
  char v19; // ch
  unsigned int n8_2; // eax
  unsigned int n8_4; // ecx
  unsigned int v22; // ebx
  unsigned int v23; // eax
  unsigned __int8 n2_1; // al
  unsigned int v25; // eax
  int v26; // eax
  unsigned int v27; // edx
  unsigned int v28; // ebp
  unsigned int v29; // ebp
  unsigned int v30; // ebp
  unsigned __int16 n60; // dx
  int v32; // ecx
  int v33; // eax
  int v34; // eax
  int v35; // ecx
  unsigned int v36; // eax
  unsigned int v37; // eax
  unsigned int v38; // eax
  unsigned int v39; // edx
  int SocketInfo_1; // eax
  ... [11467 chars total]

// Function: SmbusInit @ 0xffc50d60 (0xe1f bytes)
// Index: 659/2560

int __cdecl SmbusInit(
        unsigned __int8 *n6,
        int n4,
        int n6_2,
        int n2,
        int a5,
        int n8,
        int n4a,
        int a8,
        int n25,
        char n19,
        unsigned __int16 *p_n60)
{
  unsigned __int8 *n6_1; // ebp
  unsigned int v12; // esi
  unsigned int v13; // edi
  int n25_1; // ebx
  int CpuCount_1; // edx
  char v16; // al
  unsigned __int8 n8_1; // cl
  int n60_10; // ecx
  unsigned __int8 n8_2; // dl
  char v21; // al
  unsigned __int8 v22; // dl
  unsigned __int8 n0x10; // al
  int v24; // eax
  int v25; // eax
  int v26; // eax
  int v27; // edx
  int v28; // eax
  int v29; // eax
  int v30; // eax
  unsigned int v31; // edx
  __int16 v32; // dx
  __int16 n60; // ax
  const char *v34; // eax
  unsigned __int16 n60_2; // bx
  const char *v36; // eax
  int n25_2; // eax
  unsigned __int16 n60_4; // ax
  const char *v39; // eax
  const char *v40; // eax
  int v41; // eax
  int n46; // eax
  unsigned int v43; // edx
  int v44... [22023 chars total]

// Function: MailBoxFunc1B7F @ 0xffc51b7f (0x65f bytes)
// Index: 660/2560

int __cdecl MailBoxFunc1B7F(
        unsigned __int8 *n6,
        int n4,
        int a3,
        int n2,
        int a5,
        int n0x12,
        int n4a,
        int a8,
        int n25,
        char n19,
        unsigned __int16 *p_n60)
{
  unsigned __int8 *n6_1; // ebx
  unsigned __int8 v12; // bp
  int SocketInfo; // esi
  unsigned __int8 n4a_1; // cl
  char v15; // ah
  int n0x12_1; // edx
  int v17; // eax
  unsigned int v18; // esi
  int v19; // eax
  unsigned int v20; // edi
  int v22; // edi
  __int16 n512_4; // cx
  int v24; // eax
  int v25; // ebp
  int n4_1; // edx
  unsigned __int16 v27; // ax
  unsigned __int16 v28; // cx
  __int16 n60; // ax
  int n4a_3; // ebp
  const char *v31; // eax
  __int16 n60_2; // cx
  const char *v33; // eax
  __int16 *v34; // edx
  __int16 n512; // si
  int n4_3; // ebx
  unsigned __int16 *v37; // edi
  unsigned __int16 v38; // bp
  int n512_1; // ecx
  unsigned __int8 n4_4; // dl
  unsigned int v41; // esi
  unsigned __int16 n4_6; // ax
 ... [11455 chars total]

// Function: MailBoxFunc21DE @ 0xffc521de (0x60c bytes)
// Index: 661/2560

int __cdecl MailBoxFunc21DE(
        unsigned __int8 *n6,
        int n4,
        _BYTE *n6a,
        int n2,
        int a5,
        unsigned __int8 n0x12,
        int n4a,
        int a8,
        int n23,
        char n19,
        unsigned __int16 *p_n60)
{
  unsigned __int8 *n6_1; // esi
  int v12; // ebx
  int v13; // edi
  unsigned __int8 n0x12_1; // bh
  unsigned __int8 n0x12_4; // al
  int n0x12_2; // edx
  int v17; // ecx
  unsigned __int8 v18; // al
  _BYTE *n6a_1; // edx
  int v21; // ebp
  int v22; // eax
  int n60_1; // eax
  __int16 n0x32_1; // cx
  int v25; // eax
  int v26; // eax
  int v27; // edx
  int v28; // ebp
  int v29; // eax
  unsigned __int8 v30; // al
  int n18; // edx
  int v32; // ecx
  __int16 n60; // dx
  int v34; // eax
  int v35; // edi
  int v36; // ebx
  int n18_2; // ecx
  int v38; // eax
  int buf_1; // eax
  _DWORD *v40; // esi
  int v41; // edx
  char n0x32_2; // [esp-4h] [ebp-44h]
  unsigned __int8 n0x12_5; // [esp+13h] [ebp-2Dh]
  int v44; // [es... [11223 chars total]

// Function: MailBoxFunc27EA @ 0xffc527ea (0x354 bytes)
// Index: 662/2560

int __cdecl MailBoxFunc27EA(
        unsigned __int8 *n6,
        int n4,
        int n6a,
        int n2,
        unsigned __int8 a5,
        unsigned __int8 n18,
        char n4a,
        int a8,
        int n23,
        char n19,
        unsigned __int16 *p_n60)
{
  unsigned __int16 v11; // di
  int v12; // ebp
  unsigned __int8 n18_1; // bl
  unsigned __int8 n18_2; // bh
  char n19_1; // dl
  char v17; // cl
  char v18; // dh
  unsigned int v19; // eax
  unsigned int p_n6_1; // eax
  unsigned int v21; // edi
  unsigned __int8 v22; // dl
  int v23; // ecx
  unsigned __int16 n60; // dx
  int v25; // ecx
  int v26; // esi
  unsigned int v27; // eax
  char v28; // [esp-8h] [ebp-34h]
  char v29; // [esp-8h] [ebp-34h]
  int p_n6; // [esp+10h] [ebp-1Ch] BYREF
  __int16 p_n127[2]; // [esp+14h] [ebp-18h] BYREF
  __int16 p_n127a[2]; // [esp+18h] [ebp-14h] BYREF
  char v33[4]; // [esp+1Ch] [ebp-10h]
  int v34; // [esp+20h] [ebp-Ch]
  __int16 v35[2]; // [esp+24h] [ebp-8h] BYREF
  int v36; // [esp+28h] [ebp-4h]

  *(_DWORD *)p_n127a = 127; /*0xffc527f2*/
  v11 = 0; /*0xffc527fb*/
  *(_DWORD *)p_n127 = 0; /*0xffc527fd*/
  *(_DWORD *)v35 = 1; /*0xffc52808*/
  KtiFunc41B3((int)n6, 7u, 1); /*0xffc5280c*/
  v34 = KtiFunc91AF((int)n6, n4, n6a, n2); /*0xffc5282a*/
  p_n6 = 0; /*0xffc52846*/
  v12 = KtiFunc91DE((int)n6, n4, n6a, n2); /*0xffc5284a*/
  v36 = v12; /*0xffc5284c*/
  if ( n4a == -1 ) /*0xffc52853*/
    v33[0] = 15; /*0xffc52855*/
  else
    v33[0] = 1 << n4a; /*0xffc52860*/
  ProcCommonFuncD52D((int)n6, a8, n23, p_n127, p_n127a, v35); /*0xffc5287f*/
  ProcCommonFunc5807((int)n6, n4, n6a, n2, a8, n23, p_n127, p_n127a); /*0xffc528a6*/
  n18_1 = n18; /*0xffc528ab*/
  if ( n18 == 0xFF ) /*0xffc528b5*/
  {
    n18_1 = 0; /*0xffc528b7*/
    n18_2 = 18; /*0xffc528b9*/
    n18 = 0; /*0xffc528bb*/
LABEL_9:
    n19_1 = n19; /*0xffc528da*/
    v17 = n19 & 1; /*0xffc528e2*/
    v18 = n19 & 2; /*0xffc528e5*/
    while ( 1 ) /*0xffc528f9*/
    {
      if ( v17 ) /*0xffc528fb*/
      {
        v28 = v33[0]; /*0xffc528fd*/
        v19 = MailBoxFunc4CB2((int)n6, n18, 0x50E42A4u); /*0xffc52917*/
        ProcCommonFuncDD01(n6, n4, n6a, n2, v19, &p_n6, 0, 0, v28); /*0xffc52930*/
        p_n6_1 = p_n6; /*0xffc52935*/
        n19_1 = n19; /*0xffc5293c*/
        v18 = n19 & 2; /*0xffc52940*/
      }
      else
      {
        p_n6_1 = *(_DWORD *)(v12 + 4 * (n18_1 + 61 * a5) + 82); /*0xffc52953*/
        p_n6 = p_n6_1; /*0xffc52957*/
      }
      switch ( n4a ) /*0xffc5296a*/
      {
        case -1: /*0xffc5296a*/
        case 0: /*0xffc5296a*/
          LOBYTE(v21) = p_n6_1; /*0xffc52990*/
          break;
        case 1: /*0xffc5296a*/
          v21 = p_n6_1 >> 8; /*0xffc5298b*/
          break;
        case 2: /*0xffc5296a*/
          v21 = HIWORD(p_n6_1); /*0xffc52984*/
          break;
        case 3: /*0xffc5296a*/
          v21 = HIBYTE(p_n6_1); /*0xffc5297d*/
          break;
        default:
          goto LABEL_23; /*0xffc52979*/
      }
      v11 = v21 & 0x7F; /*0xffc52992*/
LABEL_23:
      if ( !v18 ) /*0xffc52997*/
      {
        if ( (n19_1 & 4) != 0 ) /*0xffc529b4*/
        {
          n60 = v11 + *p_n60; /*0xffc529c9*/
          if ( (__int16)n60 <= (int)(unsigned __int16)p_n127[0] ) /*0xffc529cb*/
            n60 = p_n127[0]; /*0xffc529cd*/
          if ( n60 > (unsigned int)p_n127a[0] ) /*0xffc529d9*/
            n60 = p_n127a[0]; /*0xffc529db*/
        }
        else
        {
          n60 = *p_n60; /*0xffc529e0*/
        }
        if ( n4a == -1 ) /*0xffc529ea*/
        {
          p_n6_1 = n60 & 0x7F | ((n60 & 0x7F | ((n60 & 0x7F | ((n60 & 0x7F) << 8)) << 8)) << 8) | p_n6_1 & 0x80808080; /*0xffc52a05*/
          goto LABEL_42; /*0xffc52a07*/
        }
        if ( n4a ) /*0xffc52a0f*/
        {
          switch ( n4a ) /*0xffc52a14*/
          {
            case 1: /*0xffc52a14*/
              v25 = ((unsigned __int16)p_n6_1 ^ (unsigned __int16)(n60 << 8)) & 0x7F00; /*0xffc52a4a*/
              break;
            case 2: /*0xffc52a14*/
              v25 = (p_n6_1 ^ (n60 << 16)) & 0x7F0000; /*0xffc52a3a*/
              break;
            case 3: /*0xffc52a14*/
              v25 = (p_n6_1 ^ (n60 << 24)) & 0x7F000000; /*0xffc52a28*/
              break; /*0xffc52a28*/
            default:
LABEL_43:
              v22 = a5; /*0xffc52a5d*/
              v23 = v34; /*0xffc52a6a*/
              v26 = v34 + 242 * a5; /*0xffc52a71*/
              if ( p_n6_1 != *(_DWORD *)(v26 + 4 * n18_1 + 80) || (n19 & 8) != 0 ) /*0xffc52a7e*/
              {
                v29 = v33[0]; /*0xffc52a80*/
                v27 = MailBoxFunc4CB2((int)n6, n18, 0x50E42A4u); /*0xffc52a9a*/
                ProcCommonFuncDD01(n6, n4, n6a, n2, v27, &p_n6, 0, 1, v29); /*0xffc52ab3*/
                ProcCommonFunc2441((int)n6, n4, n6a, n2); /*0xffc52ac8*/
                *(_DWORD *)(v26 + 4 * n18_1 + 80) = p_n6; /*0xffc52ad1*/
                KtiFunc8C4((int)n6, (unsigned __int16)v35[0]); /*0xffc52ae1*/
                v22 = a5; /*0xffc52ae6*/
                v23 = v34; /*0xffc52af0*/
              }
              v12 = v36; /*0xffc52af4*/
              goto LABEL_47; /*0xffc52af4*/
          }
          p_n6_1 ^= v25; /*0xffc52a2e*/
        }
        else
        {
          p_n6_1 ^= ((unsigned __int8)p_n6_1 ^ (unsigned __int8)n60) & 0x7F; /*0xffc52a57*/
        }
LABEL_42:
        p_n6 = p_n6_1; /*0xffc52a59*/
        goto LABEL_43; /*0xffc52a59*/
      }
      v22 = a5; /*0xffc5299d*/
      v23 = v34; /*0xffc529a1*/
      *p_n60 = v11; /*0xffc529a5*/
LABEL_47:
      if ( (n19 & 0x10) != 0 ) /*0xffc52afd*/
        *(_DWORD *)(v12 + 4 * (n18_1 + 61 * v22) + 82) = *(_DWORD *)(v23 + 242 * v22 + 4 * n18_1 + 80); /*0xffc52b16*/
      n19_1 = n19; /*0xffc52b1a*/
      ++n18_1; /*0xffc52b1e*/
      v17 = n19 & 1; /*0xffc52b20*/
      v18 = n19 & 2; /*0xffc52b24*/
      n18 = n18_1; /*0xffc52b28*/
      if ( n18_1 >= n18_2 ) /*0xffc52b2e*/
        return 0; /*0xffc52b2e*/
    }
  }
  n18_2 = n18 + 1; /*0xffc528c3*/
  if ( (unsigned __int8)(n18 + 1) > 0x12u ) /*0xffc528c8*/
    return 1; /*0xffc528cc*/
  if ( n18 < n18_2 ) /*0xffc528d4*/
    goto LABEL_9; /*0xffc528d4*/
  return 0; /*0xffc52b37*/
}

// Function: MailBoxFunc2B3E @ 0xffc52b3e (0x1d bytes)
// Index: 663/2560

char __cdecl MailBoxFunc2B3E(int a1, unsigned __int8 n0x29)
{
  char result; // al

  if ( n0x29 >= 0x40u ) /*0xffc52b44*/
  {
    result = n0x29 - 64; /*0xffc52b52*/
    if ( (unsigned __int8)(n0x29 - 64) > 0x32u ) /*0xffc52b56*/
      return 50; /*0xffc52b58*/
  }
  else if ( n0x29 <= 0x29u ) /*0xffc52b48*/
  {
    return 64; /*0xffc52b4f*/
  }
  else
  {
    return (n0x29 - 41) | 0x40; /*0xffc52b4c*/
  }
  return result; /*0xffc52b4e*/
}

// Function: MailBoxFunc2B5B @ 0xffc52b5b (0x133 bytes)
// Index: 664/2560

int __cdecl MailBoxFunc2B5B(int a1, int a2)
{
  unsigned __int8 v2; // bl
  unsigned __int8 v3; // cl
  int v4; // edi
  int v5; // eax
  unsigned __int8 v6; // cl
  int v7; // ecx
  char v9; // [esp+Ch] [ebp-Ch]
  char v10; // [esp+Ch] [ebp-Ch]
  char v11; // [esp+Ch] [ebp-Ch]
  _DWORD v12[2]; // [esp+10h] [ebp-8h]

  v2 = 0; /*0xffc52b64*/
  v3 = 0; /*0xffc52b66*/
  v9 = 0; /*0xffc52b69*/
  if ( *(_BYTE *)(a1 + 244317) ) /*0xffc52b6d*/
  {
    do /*0xffc52bba*/
    {
      v4 = v3; /*0xffc52b83*/
      if ( *(_BYTE *)(v3 + 50813 * (unsigned __int8)a2 + a1 + 10189) ) /*0xffc52b89*/
      {
        v5 = MailBoxFunc8E0B(a1, a2, v9, 117459124); /*0xffc52b9e*/
        v3 = v9; /*0xffc52ba3*/
        v12[v4] = v5; /*0xffc52baa*/
      }
      v9 = ++v3; /*0xffc52bb0*/
    }
    while ( v3 < *(_BYTE *)(a1 + 244317) ); /*0xffc52bba*/
    v2 = 0; /*0xffc52bbc*/
  }
  v6 = 0; /*0xffc52bc6*/
  v10 = 0; /*0xffc52bc8*/
  if ( *(_BYTE *)(a1 + 244317) ) /*0xffc52bbf*/
  {
    do /*0xffc52c17*/
    {
      if ( *(_BYTE *)(v6 + 50813 * (unsigned __int8)a2 + a1 + 10189) ) /*0xffc52be1*/
      {
        v12[v6] |= 0x20u; /*0xffc52beb*/
        MailBoxFunc8FC5(a1, a2, v10, 117459124, v12[v6]); /*0xffc52bff*/
        v6 = v10; /*0xffc52c04*/
      }
      v10 = ++v6; /*0xffc52c0d*/
    }
    while ( v6 < *(_BYTE *)(a1 + 244317) ); /*0xffc52c17*/
    v2 = 0; /*0xffc52c19*/
  }
  KtiFunc8D9F(a1, 20); /*0xffc52c1e*/
  v11 = 0; /*0xffc52c2c*/
  if ( *(_BYTE *)(a1 + 244317) ) /*0xffc52c23*/
  {
    v7 = a2; /*0xffc52c32*/
    do /*0xffc52c7b*/
    {
      if ( *(_BYTE *)(v2 + 50813 * (unsigned __int8)a2 + a1 + 10189) ) /*0xffc52c45*/
      {
        v12[v2] &= ~0x20u; /*0xffc52c4f*/
        MailBoxFunc8FC5(a1, v7, v11, 117459124, v12[v2]); /*0xffc52c63*/
        v7 = a2; /*0xffc52c68*/
      }
      v11 = ++v2; /*0xffc52c71*/
    }
    while ( v2 < *(_BYTE *)(a1 + 244317) ); /*0xffc52c7b*/
  }
  return KtiFunc8D9F(a1, 20); /*0xffc52c87*/
}

// Function: ProcMemInitMain @ 0xffc52c8e (0x1493 bytes)
// Index: 665/2560

int __cdecl ProcMemInitMain(unsigned __int8 *n6)
{
  unsigned __int8 *n6_1; // ebx
  int n4_1; // edi
  int n4_3; // ebp
  int SocketInfo; // eax
  bool v5; // zf
  _BYTE *SocketInfo_1; // esi
  _BYTE *v7; // eax
  _BYTE *SocketInfo_3; // edx
  int v9; // esi
  int v10; // eax
  unsigned int v11; // esi
  int n2_1; // edi
  int n3; // ecx
  int CpuCount; // eax
  unsigned __int8 v15; // dl
  int v16; // ecx
  unsigned __int8 n6a_1; // al
  _BYTE *SocketInfo_4; // edi
  int v19; // esi
  unsigned __int16 v20; // ax
  unsigned __int8 n6a_2; // cl
  unsigned int *v22; // eax
  unsigned int v23; // esi
  unsigned int v24; // esi
  unsigned __int8 n8; // al
  unsigned int v26; // eax
  _BYTE *SocketInfo_5; // esi
  unsigned __int8 n6a_4; // al
  int n3_2; // edi
  _BYTE *v30; // esi
  unsigned __int8 n2_2; // al
  unsigned int v32; // edx
  int v33; // ecx
  int v34; // eax
  int v35; // edi
  char v36; // cl
  int v37; // edx
  int v38; // edx
  int v39; // eax
  int v40; // ebx
  char v41... [44171 chars total]

// Function: SmbusFunc4121 @ 0xffc54121 (0x3d7 bytes)
// Index: 666/2560

int __cdecl SmbusFunc4121(
        unsigned __int8 *n6,
        int n4,
        _BYTE *n6a,
        int n2,
        int a5,
        unsigned __int8 n0x12,
        int a7,
        unsigned __int8 n0x32)
{
  int n4_1; // esi
  int v9; // eax
  int v10; // edx
  int v11; // ecx
  int v12; // ebp
  int n9; // ebx
  char v14; // al
  unsigned int n0x12a_1; // ecx
  bool v16; // zf
  int v17; // ebp
  int n9_1; // ebx
  _BYTE *n6a_1; // ebx
  int n2_1; // ebp
  int v21; // esi
  unsigned int v22; // eax
  int v23; // ecx
  unsigned __int16 v24; // ax
  char n0x12_1; // dl
  char n0x32_1; // [esp+10h] [ebp-20h]
  int v28; // [esp+14h] [ebp-1Ch]
  int v29; // [esp+14h] [ebp-1Ch]
  int SocketInfo; // [esp+18h] [ebp-18h]
  int CpuCount; // [esp+1Ch] [ebp-14h]
  unsigned __int8 v32[12]; // [esp+24h] [ebp-Ch] BYREF
  int n0x12a; // [esp+48h] [ebp+18h]

  n4_1 = n4; /*0xffc54127*/
  SocketInfo = GetSocketInfo((int)n6, n4); /*0xffc54143*/
  v28 = KtiFunc91DE((int)n6, n4, (unsigned __int8)n6a, n2); /*0xffc5414f*/
  CpuCount = GetCpuCount((int)n6, n4, (unsigned __int8)n6a); /*0xffc5415b*/
  if ( n0x12 >= 0x12u ) /*0xffc54164*/
    return 1; /*0xffc544ef*/
  if ( a7 == 1 ) /*0xffc5416f*/
  {
    n0x32_1 = n0x32; /*0xffc54175*/
    if ( n0x32 > 0x32u ) /*0xffc5417b*/
      n0x32_1 = 50; /*0xffc5417d*/
  }
  else
  {
    n0x32_1 = MailBoxFunc2B3E((int)n6, n0x32); /*0xffc54190*/
  }
  if ( ProcCommonFunc24FA((int)n6, n4, (unsigned __int8)n6a, n2) ) /*0xffc54198*/
  {
    if ( a7 ) /*0xffc541ad*/
    {
      v21 = n0x12 + 122 * (unsigned __int8)a5; /*0xffc54349*/
      *(_WORD *)(v28 + 2 * v21 + 12) = *(_WORD *)(v28 + 2 * v21 + 12) & 0xFF80 | n0x32_1 & 0x7F; /*0xffc5436f*/
      nullsub_5(); /*0xffc54374*/
      RmtFunc349(n6, n4, (int)n6a, n2, a5, *(unsigned __int16 *)(v28 + 2 * v21 + 12) | 0x80, 6); /*0xffc54395*/
      RmtFunc349(n6, n4, (int)n6a, n2, a5, *(unsigned __int16 *)(v28 + 2 * v21 + 12) | 0x80, 6); /*0xffc543b6*/
      n2_1 = n2; /*0xffc543c2*/
      v22 = *(unsigned __int16 *)(v28 + 2 * v21 + 12); /*0xffc543c6*/
      n4_1 = n4; /*0xffc543cb*/
      n6a_1 = n6a; /*0xffc543d3*/
      RmtFunc349(n6, n4, (int)n6a, n2, a5, v22, 6); /*0xffc543db*/
      nullsub_5(); /*0xffc543e6*/
    }
    else
    {
      v9 = KtiFunc91AF((int)n6, n4, (unsigned __int8)n6a, n2); /*0xffc541b7*/
      v10 = 242 * (unsigned __int8)a5; /*0xffc541c6*/
      v11 = 7688 * (unsigned __int8)n6a; /*0xffc541cf*/
      v12 = 0; /*0xffc541d5*/
      v29 = v9; /*0xffc541d9*/
      n9 = 9; /*0xffc541e1*/
      do /*0xffc54222*/
      {
        v14 = MailBoxFunc2B3E( /*0xffc54200*/
                (int)n6,
                *(_BYTE *)(v11 + v12 + 18 * *(unsigned __int8 *)(v10 + v9 + 1) + SocketInfo + 6425));
        v10 = 242 * (unsigned __int8)a5; /*0xffc54205*/
        v32[v12++] = (unsigned __int8)(v14 & 0x40 | 0x20) >> 5; /*0xffc54211*/
        v9 = v29; /*0xffc54216*/
        v11 = 7688 * (unsigned __int8)n6a; /*0xffc5421b*/
        --n9; /*0xffc5421f*/
      }
      while ( n9 ); /*0xffc54222*/
      n0x12a_1 = n0x12 % 9u; /*0xffc5423e*/
      n0x12a = n0x12a_1; /*0xffc54242*/
      v16 = (n6[134] & 0x20) == 0; /*0xffc54249*/
      v32[n0x12a_1] = (unsigned __int8)(n0x32_1 & 0x40 | 0x20) >> 5; /*0xffc54250*/
      if ( v16 || !n6[453592] ) /*0xffc54256*/
        KtiFuncFC62((int)n6, n4, (int)n6a, n2, 0, v32[0], 6u, 0x40u); /*0xffc54289*/
      else
        KtiFuncFD65(n6, n4, (int)n6a, n2, a5, v32, 6u, 0x40u, n0x12a_1); /*0xffc54271*/
      v17 = 0; /*0xffc54293*/
      n9_1 = 9; /*0xffc54295*/
      do /*0xffc542cb*/
      {
        v32[v17] = MailBoxFunc2B3E( /*0xffc542c1*/
                     (int)n6,
                     *(_BYTE *)(7688 * (unsigned __int8)n6a
                              + v17
                              + 18 * *(unsigned __int8 *)(242 * (unsigned __int8)a5 + v29 + 1)
                              + SocketInfo
                              + 6425))
                 & 0x3F;
        ++v17; /*0xffc542c5*/
        --n9_1; /*0xffc542c8*/
      }
      while ( n9_1 ); /*0xffc542cb*/
      n6a_1 = n6a; /*0xffc542d5*/
      v16 = (n6[134] & 0x20) == 0; /*0xffc542db*/
      n2_1 = n2; /*0xffc542e2*/
      v32[n0x12a] = n0x32_1 & 0x3F; /*0xffc542e6*/
      if ( v16 || !n6[453592] ) /*0xffc542ec*/
        KtiFuncFC62((int)n6, n4, (int)n6a, n2, 0, v32[0], 5u, 0x50u); /*0xffc54322*/
      else
        KtiFuncFD65(n6, n4, (int)n6a, n2, a5, v32, 5u, 0x50u, n0x12a); /*0xffc54307*/
    }
    KtiFuncFC19(n6, n4_1, (int)n6a_1, n2_1, 0, 0, 0, 0x70u); /*0xffc543f9*/
  }
  v23 = n0x12 + 122 * (unsigned __int8)a5; /*0xffc54446*/
  *(_WORD *)(v28 + 2 * v23 + 12) &= 0xFF80u; /*0xffc54448*/
  v24 = *(_WORD *)(v28 + 2 * v23 + 12) | n0x32_1 & 0x7F; /*0xffc54456*/
  *(_WORD *)(v28 + 2 * v23 + 12) = v24; /*0xffc5445e*/
  if ( (n6[134] & 0x20) != 0 && n6[453592] ) /*0xffc54474*/
  {
    if ( *(_BYTE *)(1379 * (unsigned __int8)n2 + CpuCount + 104) ) /*0xffc5448e*/
    {
      if ( n0x12 < 9u ) /*0xffc54498*/
        n0x12_1 = 2 * n0x12; /*0xffc544a1*/
      else
        n0x12_1 = 2 * n0x12 - 17; /*0xffc5449c*/
    }
    else
    {
      n0x12_1 = n0x12 % 9u; /*0xffc544ae*/
    }
    DdrTrainFunc2C34(n6, n4, (int)n6a, n2, a5, n0x12_1, v24, 6); /*0xffc544c6*/
  }
  else
  {
    DdrTrainFunc271A(n6, n4, n6a, n2, a5, v24, 6); /*0xffc544e1*/
  }
  return 0; /*0xffc544f0*/
}

// Function: MailBoxFunc44F8 @ 0xffc544f8 (0x292 bytes)
// Index: 667/2560

unsigned __int8 __cdecl MailBoxFunc44F8(unsigned __int8 *n6, int n4)
{
  unsigned __int16 n0x7F_1; // bp
  unsigned __int8 result; // al
  int v5; // edx
  int n4_1; // ecx
  unsigned __int8 n3; // dl
  unsigned __int16 n0x7F; // si
  unsigned int v9; // eax
  int n4_3; // esi
  unsigned int v11; // eax
  unsigned int n0x960; // ecx
  unsigned int v13; // eax
  unsigned __int16 n1300; // bp
  char n127; // al
  int n127_1; // esi
  int v17; // eax
  unsigned int v18; // esi
  int v19; // [esp+10h] [ebp-24h]
  unsigned __int16 n0x7F_2; // [esp+18h] [ebp-1Ch]
  unsigned __int8 v21; // [esp+20h] [ebp-14h]
  int n4_2; // [esp+24h] [ebp-10h]
  int v23; // [esp+24h] [ebp-10h]
  int SocketInfo; // [esp+2Ch] [ebp-8h]
  char n6a; // [esp+38h] [ebp+4h]

  n0x7F_2 = 0; /*0xffc5450b*/
  n0x7F_1 = 0; /*0xffc5450f*/
  SocketInfo = GetSocketInfo((int)n6, n4); /*0xffc54516*/
  result = 0; /*0xffc5451a*/
  v21 = 0; /*0xffc5451e*/
  if ( n6[244317] ) /*0xffc54522*/
  {
    n4_1 = (unsigned __int8)n4; /*0xffc5452e*/
    v5 = 50813 * (unsigned __int8)n4; /*0xffc54531*/
    LOBYTE(n4_1) = 0; /*0xffc5453b*/
    n6a = 0; /*0xffc5453d*/
    while ( 1 ) /*0xffc54558*/
    {
      v19 = result; /*0xffc54558*/
      if ( n6[v5 + 10189 + result] ) /*0xffc5455e*/
        break; /*0xffc5455e*/
LABEL_26:
      LOBYTE(n4_1) = n4_1 + 3; /*0xffc54765*/
      result = v21 + 1; /*0xffc5476c*/
      n6a = n4_1; /*0xffc5476e*/
      v21 = result; /*0xffc54772*/
      if ( result >= n6[244317] ) /*0xffc5477c*/
        return result; /*0xffc5477c*/
    }
    n3 = 0; /*0xffc5456c*/
    n4_2 = n4_1; /*0xffc5456e*/
    while ( 1 ) /*0xffc54583*/
    {
      n0x7F = n0x7F_2; /*0xffc54583*/
      if ( *(_BYTE *)(7688 * (unsigned __int8)n4_1 + SocketInfo) ) /*0xffc5457f*/
        break; /*0xffc5457f*/
      ++n3; /*0xffc54589*/
      LOBYTE(n4_1) = n4_1 + 1; /*0xffc5458b*/
      n4_2 = n4_1; /*0xffc5458d*/
      if ( n3 >= 3u ) /*0xffc54594*/
        goto LABEL_21; /*0xffc54594*/
    }
    v9 = MailBoxFunc4CB2((int)n6, 0, 0x80042F8u); /*0xffc545a3*/
    n4_3 = n4_2; /*0xffc545a8*/
    v11 = ((unsigned int)MiscConfigCheck(n6, n4, n4_2, v9) >> 10) & 7; /*0xffc545bb*/
    if ( !v11 ) /*0xffc545be*/
    {
      n0x960 = 2 * *(unsigned __int16 *)&n6[48704 * (unsigned __int8)n4 + 258695]; /*0xffc545d0*/
LABEL_14:
      v13 = 0xF4240 / n0x960; /*0xffc5462c*/
LABEL_15:
      n1300 = 1300; /*0xffc54635*/
      v23 = (unsigned __int16)v13; /*0xffc54648*/
      n0x7F_2 = 0x41EB00 / (356 * (unsigned int)(unsigned __int16)v13); /*0xffc54661*/
      if ( DimmConfigPerSocket(n6, n4, 178, v19) ) /*0xffc54665*/
      {
        DebugPrint( /*0xffc546d8*/
          (int)n6,
          2,
          n4,
          n4_3,
          255,
          255,
          255,
          255,
          "Panic Up/Down multiplier for MC:%d; vccp is fixed value of 1.3V \n",
          v19);
      }
      else
      {
        n1300 = (1000 * (unsigned int)(unsigned __int16)CpuIoRead((int)n6, n4, 0, 67190924)) >> 13; /*0xffc54694*/
        if ( (n6[246408] & 4) != 0 ) /*0xffc54697*/
          n1300 = 1300; /*0xffc54699*/
        DebugPrint( /*0xffc546b8*/
          (int)n6,
          2,
          n4,
          n4_3,
          255,
          255,
          255,
          255,
          "Panic Up/Down multiplier for MC:%d; vccp read from FIVR via PCODE:%d; (vccp value/1000 = value in volts)\n",
          v19,
          n1300);
      }
      n0x7F = n0x7F_2; /*0xffc546ee*/
      n0x7F_1 = 0x41EB00 / (v23 * ((unsigned int)n1300 - 356)); /*0xffc546fb*/
LABEL_21:
      n127 = n0x7F; /*0xffc546fe*/
      if ( n0x7F >= 0x7Fu ) /*0xffc54708*/
        n127 = 127; /*0xffc5470a*/
      n127_1 = n0x7F_1; /*0xffc5470e*/
      v17 = (n127 & 0x7F) << 18; /*0xffc54711*/
      if ( n0x7F_1 >= 0x7Fu ) /*0xffc54717*/
        n127_1 = 127; /*0xffc54719*/
      v18 = v17 | (n127_1 << 25); /*0xffc5471e*/
      MailBoxFunc8FC5((int)n6, n4, v21, 134303556, v18); /*0xffc5472c*/
      DebugPrint( /*0xffc54755*/
        (int)n6,
        2,
        n4,
        255,
        255,
        255,
        255,
        255,
        "Panic Up/Down multiplier for MC:%d; paniccompupmult:%d; paniccompdnmult:%d \n",
        v19,
        (v18 >> 18) & 0x7F,
        v18 >> 25);
      LOBYTE(n4_1) = n6a; /*0xffc5475a*/
      v5 = 50813 * (unsigned __int8)n4; /*0xffc54761*/
      goto LABEL_26; /*0xffc54761*/
    }
    if ( v11 == 1 ) /*0xffc545d7*/
    {
      n0x960 = 2 * *(unsigned __int16 *)&n6[48704 * (unsigned __int8)n4 + 258695]; /*0xffc545e9*/
    }
    else
    {
      DebugPrint( /*0xffc5460a*/
        (int)n6,
        3,
        n4,
        n4_2,
        255,
        255,
        255,
        255,
        "Warning!!! Invalid setting for VSSHIORVREFCONTROLNx_y.VssHiOrVrefCtl, (SampleDivider) should be either 0x0 or 0x1\n");
      n0x960 = 2 * *(unsigned __int16 *)&n6[48704 * (unsigned __int8)n4 + 258695]; /*0xffc54622*/
      if ( n0x960 < 0x960 ) /*0xffc5462a*/
        goto LABEL_14; /*0xffc5462a*/
    }
    v13 = 2 * (0xF4240 / n0x960); /*0xffc545f4*/
    goto LABEL_15; /*0xffc545f6*/
  }
  return result; /*0xffc54782*/
}

// Function: MailBoxFunc478A @ 0xffc5478a (0x1cd bytes)
// Index: 668/2560

char __cdecl MailBoxFunc478A(unsigned __int8 *n6, int n4)
{
  unsigned __int8 *n6_1; // edi
  int SocketInfo; // esi
  unsigned __int8 v4; // bl
  int n6_2; // eax
  int *v6; // esi
  unsigned int v7; // eax
  int *v8; // ebx
  unsigned int v9; // eax
  unsigned int v10; // eax
  unsigned int v11; // eax
  unsigned int v12; // eax
  unsigned __int8 n4_1; // cl
  int v15; // [esp-4h] [ebp-20h]
  int v16; // [esp-4h] [ebp-20h]
  int v17; // [esp-4h] [ebp-20h]
  int v18; // [esp-4h] [ebp-20h]
  int v19; // [esp-4h] [ebp-20h]
  unsigned __int8 n2; // [esp+10h] [ebp-Ch]
  int *v21; // [esp+14h] [ebp-8h]
  int v22; // [esp+18h] [ebp-4h]
  unsigned __int8 n6a; // [esp+20h] [ebp+4h]

  n6_1 = n6; /*0xffc54795*/
  SocketInfo = GetSocketInfo((int)n6, n4); /*0xffc547a2*/
  v4 = 0; /*0xffc547a9*/
  v22 = KtiFunc8F8C((int)n6, n4); /*0xffc547ab*/
  LOBYTE(n6_2) = 0; /*0xffc547b2*/
  v6 = (int *)(SocketInfo + 11); /*0xffc547b4*/
  LOBYTE(n6) = 0; /*0xffc547b7*/
  v21 = v6; /*0xffc547bb*/
  do /*0xffc548d2*/
  {
    if ( *((_BYTE *)v6 - 11) ) /*0xffc547bf*/
    {
      MiscIoCheck(n6_1, n4, (int)n6, 0x8014A10u, v6[73]); /*0xffc547da*/
      v15 = *v6; /*0xffc547e2*/
      v7 = MailBoxFunc4CB2((int)n6_1, 0, 0x80042E8u); /*0xffc547eb*/
      MiscIoCheck(n6_1, n4, (int)n6, v7, v15); /*0xffc547fa*/
      n2 = 0; /*0xffc547ff*/
      v8 = v6 + 19; /*0xffc54806*/
      do /*0xffc548a2*/
      {
        v16 = *(v8 - 18); /*0xffc54809*/
        v9 = MailBoxFunc4CB2((int)n6_1, n2, 0x80042ECu); /*0xffc54817*/
        MiscIoCheck(n6_1, n4, (int)n6, v9, v16); /*0xffc54826*/
        v17 = *v8; /*0xffc5482e*/
        v10 = MailBoxFunc4CB2((int)n6_1, n2, 0x80042F0u); /*0xffc54837*/
        MiscIoCheck(n6_1, n4, (int)n6, v10, v17); /*0xffc54846*/
        v18 = v8[18]; /*0xffc5484e*/
        v11 = MailBoxFunc4CB2((int)n6_1, n2, 0x80042CCu); /*0xffc54858*/
        MiscIoCheck(n6_1, n4, (int)n6, v11, v18); /*0xffc54867*/
        v19 = v8[36]; /*0xffc5486f*/
        v12 = MailBoxFunc4CB2((int)n6_1, n2, 0x80042F4u); /*0xffc5487c*/
        MiscIoCheck(n6_1, n4, (int)n6, v12, v19); /*0xffc5488b*/
        ++v8; /*0xffc54894*/
        ++n2; /*0xffc5489c*/
      }
      while ( n2 < 0x12u ); /*0xffc548a2*/
      RmtFunc8780(n6_1, n4, (int)n6); /*0xffc548ae*/
      v6 = v21; /*0xffc548b3*/
      LOBYTE(n6_2) = (_BYTE)n6; /*0xffc548ba*/
      v4 = 0; /*0xffc548be*/
    }
    LOBYTE(n6_2) = n6_2 + 1; /*0xffc548c0*/
    v6 += 1922; /*0xffc548c2*/
    LOBYTE(n6) = n6_2; /*0xffc548c8*/
    v21 = v6; /*0xffc548cc*/
  }
  while ( (unsigned __int8)n6_2 < 6u ); /*0xffc548d2*/
  n6a = 0; /*0xffc548df*/
  if ( n6_1[244317] ) /*0xffc548d8*/
  {
    n4_1 = n4; /*0xffc548e5*/
    n6_2 = 50813 * (unsigned __int8)n4; /*0xffc548ec*/
    do /*0xffc5494d*/
    {
      if ( n6_1[v4 + 10189 + n6_2] ) /*0xffc548fb*/
      {
        MailBoxFunc8FC5((int)n6_1, n4_1, n6a, 134303536, *(_DWORD *)(29 * v4 + v22 + 25)); /*0xffc5491b*/
        MailBoxFunc8FC5((int)n6_1, n4, n6a, 134303512, *(_DWORD *)(29 * v4 + v22 + 19)); /*0xffc54933*/
        n4_1 = n4; /*0xffc5493b*/
      }
      n6_2 = 50813 * (unsigned __int8)n4; /*0xffc5493d*/
      n6a = ++v4; /*0xffc54943*/
    }
    while ( v4 < n6_1[244317] ); /*0xffc5494d*/
  }
  return n6_2; /*0xffc5494f*/
}

// Function: MailBoxFunc4957 @ 0xffc54957 (0x73 bytes)
// Index: 669/2560

int __cdecl MailBoxFunc4957(unsigned __int8 *a1, unsigned __int8 a2, int a3, char a4, int a5)
{
  int SocketInfo; // ebp
  int v6; // esi
  int result; // eax

  SocketInfo = GetSocketInfo((int)a1, a2); /*0xffc5496c*/
  v6 = (a5 << (4 * a4)) | ~(15 << (4 * a4)) & MiscConfigCheck(a1, a2, a3, 184631436); /*0xffc5499c*/
  MiscIoCheck(a1, a2, a3, 0xB01408Cu, v6); /*0xffc549ad*/
  result = 7688 * (unsigned __int8)a3; /*0xffc549b8*/
  *(_DWORD *)(result + SocketInfo + 6749) = v6; /*0xffc549bf*/
  return result; /*0xffc549be*/
}

// Function: MailBoxFunc49CA @ 0xffc549ca (0xc1 bytes)
// Index: 670/2560

unsigned __int8 __cdecl MailBoxFunc49CA(
        unsigned __int8 *a1,
        unsigned __int8 a2,
        int a3,
        unsigned __int8 n4,
        unsigned __int8 a5)
{
  unsigned __int8 n4_1; // al
  int v6; // esi
  int n184631428; // [esp-4h] [ebp-18h]
  int SocketInfo; // [esp+10h] [ebp-4h]

  SocketInfo = GetSocketInfo((int)a1, a2); /*0xffc549e1*/
  n4_1 = n4; /*0xffc549e5*/
  if ( n4 >= 4u ) /*0xffc549ed*/
  {
    n4_1 = n4 - 4; /*0xffc549f6*/
    n184631428 = 184631428; /*0xffc549f8*/
  }
  else
  {
    n184631428 = 184631424; /*0xffc549ef*/
  }
  v6 = (a5 << (8 * n4_1)) | ~(255 << (8 * n4_1)) & MiscConfigCheck(a1, a2, a3, n184631428); /*0xffc54a27*/
  if ( n4 >= 4u ) /*0xffc54a2f*/
  {
    MiscIoCheck(a1, a2, a3, 0xB014084u, v6); /*0xffc54a65*/
    *(_DWORD *)(7688 * (unsigned __int8)a3 + SocketInfo + 6745) = v6; /*0xffc54a7a*/
  }
  else
  {
    MiscIoCheck(a1, a2, a3, 0xB014080u, v6); /*0xffc54a3c*/
    *(_DWORD *)(7688 * (unsigned __int8)a3 + SocketInfo + 6741) = v6; /*0xffc54a51*/
  }
  return a5; /*0xffc54a85*/
}

// Function: MailBoxFunc4A8B @ 0xffc54a8b (0x1bc bytes)
// Index: 671/2560

int __cdecl MailBoxFunc4A8B(unsigned __int8 *a1, char a2, unsigned __int8 a3, unsigned __int8 a4, int a5)
{
  int n64_1; // esi
  int SocketInfo; // edx
  unsigned __int8 n6; // bh
  int SocketInfo_2; // ebp
  int result; // eax
  unsigned __int8 n8; // bl
  int v11; // ecx
  unsigned int v12; // eax
  unsigned int v13; // eax
  unsigned int v14; // eax
  int n64; // [esp-4h] [ebp-28h]
  int v16; // [esp-4h] [ebp-28h]
  int v17; // [esp-4h] [ebp-28h]
  int v18; // [esp-4h] [ebp-28h]
  int n33554436; // [esp+10h] [ebp-14h]
  unsigned __int8 n2; // [esp+14h] [ebp-10h]
  int v21; // [esp+18h] [ebp-Ch]
  int v22; // [esp+1Ch] [ebp-8h]
  int SocketInfo_1; // [esp+20h] [ebp-4h]

  n33554436 = 0; /*0xffc54aa0*/
  n64_1 = 0; /*0xffc54aa5*/
  SocketInfo = GetSocketInfo((int)a1, a2); /*0xffc54aae*/
  SocketInfo_1 = SocketInfo; /*0xffc54ab0*/
  if ( !(_BYTE)a5 ) /*0xffc54ab6*/
  {
    n33554436 = 33554436; /*0xffc54aef*/
    n64 = 64; /*0xffc54af3*/
    goto LABEL_9; /*0xffc54af3*/
  }
  switch ( (unsigned __int8)a5 ) /*0xffc54abb*/
  {
    case 1u: /*0xffc54abb*/
      n33554436 = 130; /*0xffc54ade*/
      n64 = 32; /*0xffc54ae6*/
      goto LABEL_9; /*0xffc54ae8*/
    case 3u: /*0xffc54abb*/
      n33554436 = 1; /*0xffc54ad4*/
      break;
    case 0xBu: /*0xffc54abb*/
      n33554436 = 301989896; /*0xffc54ac8*/
      n64 = 96; /*0xffc54ad0*/
LABEL_9:
      n64_1 = n64; /*0xffc54af5*/
      break;
  }
  n6 = 0; /*0xffc54af6*/
  SocketInfo_2 = SocketInfo; /*0xffc54af8*/
  result = 0; /*0xffc54afa*/
  LOBYTE(a5) = 0; /*0xffc54afc*/
  v21 = 0; /*0xffc54b00*/
  do /*0xffc54c39*/
  {
    if ( *(_BYTE *)SocketInfo_2 ) /*0xffc54b04*/
    {
      if ( !KtiFunc89E9((int)a1, a2, a5, a3, a4, 0) ) /*0xffc54b21*/
      {
        n8 = 0; /*0xffc54b31*/
        v11 = 0; /*0xffc54b33*/
        n2 = 0; /*0xffc54b35*/
        v22 = 0; /*0xffc54b39*/
        do /*0xffc54c17*/
        {
          if ( a1[257312] || n8 != 8 && n8 != 17 ) /*0xffc54b52*/
          {
            if ( (n33554436 & 0xF) != 0 ) /*0xffc54b5e*/
            {
              v18 = n64_1 | *(_DWORD *)(SocketInfo_1 + 4 * (v11 + v21) + 87); /*0xffc54bb4*/
              v14 = MailBoxFunc4CB2((int)a1, n2, 0x80042F0u); /*0xffc54bbf*/
              MiscIoCheck(a1, a2, a5, v14, v18); /*0xffc54bd1*/
              v17 = n33554436 | *(_DWORD *)(SocketInfo_2 + 11); /*0xffc54be0*/
              v13 = MailBoxFunc4CB2((int)a1, n2, 0x80042E8u); /*0xffc54beb*/
            }
            else
            {
              v16 = n33554436 | *(_DWORD *)(SocketInfo_2 + 11); /*0xffc54b65*/
              v12 = MailBoxFunc4CB2((int)a1, n2, 0x80042E8u); /*0xffc54b70*/
              MiscIoCheck(a1, a2, a5, v12, v16); /*0xffc54b82*/
              v17 = n64_1 | *(_DWORD *)(SocketInfo_1 + 4 * (v22 + v21) + 87); /*0xffc54b9c*/
              v13 = MailBoxFunc4CB2((int)a1, n2, 0x80042F0u); /*0xffc54ba2*/
            }
            MiscIoCheck(a1, a2, a5, v13, v17); /*0xffc54bfd*/
            v11 = v22; /*0xffc54c02*/
          }
          ++n8; /*0xffc54c09*/
          ++v11; /*0xffc54c0b*/
          n2 = n8; /*0xffc54c0c*/
          v22 = v11; /*0xffc54c10*/
        }
        while ( n8 < 0x12u ); /*0xffc54c17*/
      }
      result = v21; /*0xffc54c1d*/
    }
    ++n6; /*0xffc54c21*/
    result += 1922; /*0xffc54c23*/
    SocketInfo_2 += 7688; /*0xffc54c28*/
    LOBYTE(a5) = n6; /*0xffc54c2e*/
    v21 = result; /*0xffc54c32*/
  }
  while ( n6 < 6u ); /*0xffc54c39*/
  return result; /*0xffc54c3f*/
}

// Function: MailBoxFunc4C47 @ 0xffc54c47 (0x6b bytes)
// Index: 672/2560

int __cdecl MailBoxFunc4C47(int a1, unsigned __int8 a2, unsigned __int8 n2, unsigned int a4)
{
  unsigned int v4; // esi
  int v5; // esi

  v4 = a4; /*0xffc54c4d*/
  KtiFunc208D(a1, n2, 0x12u); /*0xffc54c5c*/
  if ( n2 < 2u || n2 == 9 || n2 == 10 ) /*0xffc54c75*/
    v4 = (a4 ^ ((a4 & 0xFFFF0000) + 0x10000)) & 0xFF0000 ^ a4; /*0xffc54c8a*/
  v5 = (v4 ^ (v4 + dword_FFD2D14C[n2])) & 0xFFF ^ v4; /*0xffc54c9e*/
  return v5 ^ (v5 ^ (v5 + 4 * a2)) & 0xFFF; /*0xffc54ca5*/
}

// Function: MailBoxFunc4CB2 @ 0xffc54cb2 (0x5b bytes)
// Index: 673/2560

unsigned int __cdecl MailBoxFunc4CB2(int a1, unsigned __int8 n2, unsigned int a3)
{
  unsigned int v3; // esi

  v3 = a3; /*0xffc54cb8*/
  KtiFunc208D(a1, n2, 0x12u); /*0xffc54cc7*/
  if ( n2 < 2u || n2 == 9 || n2 == 10 ) /*0xffc54ce0*/
    v3 = (a3 ^ ((a3 & 0xFFFF0000) + 0x10000)) & 0xFF0000 ^ a3; /*0xffc54cf5*/
  return v3 ^ ((unsigned __int16)v3 ^ (unsigned __int16)(v3 + dword_FFD2D14C[n2])) & 0xFFF; /*0xffc54d07*/
}

// Function: MailBoxFunc4D0D @ 0xffc54d0d (0x144 bytes)
// Index: 674/2560

void __cdecl MailBoxFunc4D0D(int n6, int n4)
{
  int n6_1; // ebx
  unsigned __int8 v3; // cl
  unsigned __int8 n4_1; // dl
  int v5; // ebp
  unsigned int v6; // esi
  int v7; // eax
  int v8; // edi
  int v9; // ebx
  unsigned int v10; // esi
  unsigned int v11; // edi
  unsigned __int8 v12; // [esp+4h] [ebp-10h]
  int v13; // [esp+8h] [ebp-Ch]
  int v14; // [esp+Ch] [ebp-8h]

  n6_1 = n6; /*0xffc54d11*/
  v3 = 0; /*0xffc54d15*/
  v12 = 0; /*0xffc54d17*/
  if ( *(_BYTE *)(n6 + 244317) ) /*0xffc54d1b*/
  {
    n4_1 = n4; /*0xffc54d27*/
    v5 = 50813 * (unsigned __int8)n4; /*0xffc54d2f*/
    do /*0xffc54e43*/
    {
      v14 = v3; /*0xffc54d3e*/
      if ( *(_BYTE *)(v5 + v3 + n6_1 + 10189) ) /*0xffc54d44*/
      {
        v6 = MailBoxFunc8E0B(n6_1, n6_1, n4_1, v12, 134303496); /*0xffc54d67*/
        v7 = MailBoxFunc8E0B(n6_1, n6_1, n4, v12, 134303528); /*0xffc54d71*/
        MailBoxFunc8FC5(n6_1, n4, v12, 134303528, v7 | 0x600000); /*0xffc54d84*/
        v8 = MailBoxFunc8E0B(n6_1, n6_1, n4, v12, 134301764); /*0xffc54d99*/
        v9 = ((v6 >> 18) & 0xF | (v6 >> 22) & 0x3F0) << 15; /*0xffc54dc7*/
        v13 = (v6 >> 7) & 0x7FE0; /*0xffc54dca*/
        v10 = v9 | MailBoxFunc8E0B(v9, n6, n4, v12, 134303300) & 0xFE00001F; /*0xffc54de0*/
        v11 = v13 | v9 | v8 & 0xFE00001F; /*0xffc54de2*/
        n6_1 = n6; /*0xffc54de6*/
        MailBoxFunc8FC5(n6, n4, v12, 134301764, v11); /*0xffc54dfb*/
        MailBoxFunc8FC5(n6, n4, v12, 134303300, v13 | v10); /*0xffc54e09*/
        DebugPrint(n6, 2, n4, 255, 255, 255, 255, 255, "Updated Panic Up/Down codes for MC:%d \n", v14); /*0xffc54e25*/
        v3 = v12; /*0xffc54e2a*/
        v5 = 50813 * (unsigned __int8)n4; /*0xffc54e31*/
        n4_1 = n4; /*0xffc54e35*/
      }
      v12 = ++v3; /*0xffc54e39*/
    }
    while ( v3 < *(_BYTE *)(n6_1 + 244317) ); /*0xffc54e43*/
  }
}

// Function: MailBoxFunc4E51 @ 0xffc54e51 (0x280 bytes)
// Index: 675/2560

unsigned __int8 __cdecl MailBoxFunc4E51(unsigned __int8 *__return_address, int n4, int a3)
{
  int SocketInfo; // ecx
  unsigned __int8 n6; // al
  int v5; // ebp
  int CpuCount; // eax
  unsigned __int8 *v7; // ebx
  unsigned __int8 n2_1; // al
  int n2; // ebp
  unsigned __int8 v10; // bl
  unsigned __int8 n8; // bh
  unsigned __int8 p_n60_5; // dl
  unsigned __int8 p_n60_2; // al
  unsigned __int8 p_n60_1; // bl
  unsigned __int8 n8_1; // dl
  unsigned int v16; // ecx
  char n8_2; // [esp+11h] [ebp-27h]
  unsigned __int8 p_n60_3; // [esp+12h] [ebp-26h]
  unsigned __int8 p_n60_4; // [esp+13h] [ebp-25h]
  unsigned __int16 p_n60; // [esp+14h] [ebp-24h] BYREF
  unsigned __int8 v21[4]; // [esp+18h] [ebp-20h]
  unsigned __int8 v22[4]; // [esp+1Ch] [ebp-1Ch]
  int v23; // [esp+20h] [ebp-18h]
  unsigned __int8 *v24; // [esp+24h] [ebp-14h]
  int v25; // [esp+28h] [ebp-10h]
  int SocketInfo_1; // [esp+2Ch] [ebp-Ch]
  int n0x12; // [esp+30h] [ebp-8h]
  int v28; // [esp+34h] [ebp-4h]

  SocketInfo = GetSocketInfo((int)__return_address, n4); /*0xffc54e69*/
  n6 = 0; /*0xffc54e6b*/
  v5 = 0; /*0xffc54e6d*/
  SocketInfo_1 = SocketInfo; /*0xffc54e6f*/
  v21[0] = 0; /*0xffc54e73*/
  v25 = 0; /*0xffc54e77*/
  do /*0xffc550c3*/
  {
    if ( *(_BYTE *)(SocketInfo + v5) ) /*0xffc54e7b*/
    {
      CpuCount = GetCpuCount((int)__return_address, n4, v21[0]); /*0xffc54e8b*/
      v22[0] = 0; /*0xffc54e90*/
      v7 = (unsigned __int8 *)(CpuCount + 19); /*0xffc54e98*/
      n2_1 = 0; /*0xffc54e9b*/
      v24 = v7; /*0xffc54e9f*/
      do /*0xffc5509f*/
      {
        if ( *(v7 - 19) && (!v7[88] || a3 != 1) ) /*0xffc54eb8*/
        {
          n2 = *(_DWORD *)v22; /*0xffc54ec3*/
          if ( a3 != 1 || ProcCommonFunc24FA((int)__return_address, n4, v21[0], v22[0]) ) /*0xffc54ed0*/
          {
            n8_2 = ProcCommonFunc1DB2((int)__return_address, n4, v21[0], n2, 0x17u, a3); /*0xffc54ef7*/
            v10 = 0; /*0xffc54f06*/
            v28 = KtiFunc91AF((int)__return_address, n4, v21[0], n2); /*0xffc54f0b*/
            for ( LOBYTE(v23) = 0; v10 < *v24; LOBYTE(v23) = v10 ) /*0xffc54f13*/
            {
              if ( !KtiFunc89E9((int)__return_address, n4, v21[0], n2, v23, 0) /*0xffc54f4d*/
                && (!ProcCommonFunc24FA((int)__return_address, n4, v21[0], n2) || !v10) )
              {
                n8 = 0; /*0xffc54f53*/
                p_n60_5 = -1; /*0xffc54f55*/
                p_n60_2 = 0; /*0xffc54f58*/
                p_n60_3 = 0; /*0xffc54f5e*/
                LOBYTE(n0x12) = 0; /*0xffc54f62*/
                if ( n8_2 ) /*0xffc54f6a*/
                {
                  p_n60_1 = -1; /*0xffc54f70*/
                  n8_1 = n8_2; /*0xffc54f72*/
                  do /*0xffc54fe4*/
                  {
                    if ( __return_address[257312] || n8 != 8 && n8 != 17 ) /*0xffc54f87*/
                    {
                      MrcMarginGroupTrain(__return_address, n4, *(_BYTE **)v21, n2, v23, n0x12, 255, a3, 23, 2, &p_n60); /*0xffc54faa*/
                      if ( p_n60_1 > (__int16)p_n60 ) /*0xffc54fbf*/
                        p_n60_1 = p_n60; /*0xffc54fc1*/
                      n8_1 = n8_2; /*0xffc54fca*/
                      if ( p_n60_3 >= (__int16)p_n60 ) /*0xffc54fce*/
                      {
                        p_n60_2 = p_n60_3; /*0xffc54fd8*/
                      }
                      else
                      {
                        p_n60_2 = p_n60; /*0xffc54fd0*/
                        p_n60_3 = p_n60; /*0xffc54fd2*/
                      }
                    }
                    LOBYTE(n0x12) = ++n8; /*0xffc54fde*/
                  }
                  while ( n8 < n8_1 ); /*0xffc54fe4*/
                  p_n60_4 = p_n60_1; /*0xffc54fe6*/
                  v10 = v23; /*0xffc54fea*/
                  p_n60_5 = p_n60_4; /*0xffc54fee*/
                }
                v16 = (p_n60_5 + (unsigned int)p_n60_2) >> 1; /*0xffc54ffa*/
                if ( a3 ) /*0xffc55001*/
                {
                  if ( a3 == 1 ) /*0xffc5502b*/
                    *(_BYTE *)(v25 + *(unsigned __int8 *)(242 * v10 + v28 + 1) + SocketInfo_1 + 6273) = v16; /*0xffc55047*/
                }
                else
                {
                  *(_BYTE *)(v25 + *(unsigned __int8 *)(242 * v10 + v28 + 1) + SocketInfo_1 + 6264) = v16; /*0xffc5501d*/
                }
                DebugPrint( /*0xffc5506b*/
                  (int)__return_address,
                  2,
                  n4,
                  *(int *)v21,
                  n2,
                  v23,
                  255,
                  255,
                  aTxvrefsafe0xX,
                  (unsigned __int8)v16);
              }
              ++v10; /*0xffc55077*/
            }
            v7 = v24; /*0xffc55085*/
          }
          n2_1 = v22[0]; /*0xffc55089*/
        }
        ++n2_1; /*0xffc5508d*/
        v7 += 1379; /*0xffc5508f*/
        v22[0] = n2_1; /*0xffc55095*/
        v24 = v7; /*0xffc55099*/
      }
      while ( n2_1 < 2u ); /*0xffc5509f*/
      n6 = v21[0]; /*0xffc550a5*/
      v5 = v25; /*0xffc550a9*/
      SocketInfo = SocketInfo_1; /*0xffc550ad*/
    }
    ++n6; /*0xffc550b1*/
    v5 += 7688; /*0xffc550b3*/
    v21[0] = n6; /*0xffc550b9*/
    v25 = v5; /*0xffc550bd*/
  }
  while ( n6 < 6u ); /*0xffc550c3*/
  return n6; /*0xffc550c9*/
}

// Function: MailBoxFunc50D1 @ 0xffc550d1 (0x7c2 bytes)
// Index: 676/2560

char *__cdecl MailBoxFunc50D1(
        unsigned __int8 *n6,
        int n6_2,
        _BYTE *n6a,
        int *a4,
        int *a5,
        __int16 *buf,
        __int16 *a7,
        char *p_n40,
        char *a9,
        char *n4)
{
  unsigned __int8 *n6_1; // edi
  char v11; // cl
  char *p_n40_1; // edx
  unsigned __int8 n4_2; // al
  __int16 *v14; // esi
  int v15; // ecx
  _BYTE *n6a_1; // ebp
  int v17; // eax
  int v18; // eax
  unsigned __int16 v19; // cx
  int v20; // eax
  int *p_n40_4; // edx
  __int16 *buf_1; // edi
  int v23; // esi
  int n4_4; // ecx
  int *v25; // eax
  int v26; // eax
  __int16 *n4_6; // ecx
  bool v28; // zf
  char *n4_7; // eax
  __int16 *v30; // edx
  int *v31; // ecx
  int v32; // esi
  int v33; // ecx
  int v34; // ebp
  __int16 *p_n60_1; // esi
  int v36; // edx
  int *v37; // ecx
  __int16 *v38; // eax
  int v39; // ecx
  int n24_1; // edi
  __int16 v41; // dx
  int v42; // eax
  _BYTE *v43; // ecx
  unsigned __int8 n4_8; // [esp+13h] [ebp-115h]
... [13482 chars total]

// Function: MailBoxFunc5893 @ 0xffc55893 (0x182 bytes)
// Index: 677/2560

int __cdecl MailBoxFunc5893(_BYTE *a1, char a2, char a3, _BYTE *a4)
{
  int n134301240; // ebx

  n134301240 = 0; /*0xffc5589b*/
  switch ( a2 )
  {
    case 0:
    case 1:
    case 2:
      *a4 = a3 == 0 ? 0 : 3;
      n134301240 = a3 == 0 ? 134301192 : 134301704;
      break; /*0xffc558da*/
    case 3:
    case 4:
    case 5:
      *a4 = a3 != 0 ? 4 : 1;
      n134301240 = a3 == 0 ? 134301236 : 134301748;
      break; /*0xffc55908*/
    case 6:
      if ( a3 )
      {
        AssertPrint(
          a1,
          255,
          (int)"\n\nRC_ASSERT! %s: %u   %s ",
          "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Mem\\MemCmdControl.c",
          821,
          "FALSE");
        ProcMemInitCheck((int)a1, 242, 38); /*0xffc55945*/
      }
      else
      {
        n134301240 = 134301240; /*0xffc55915*/
        *a4 = 2; /*0xffc5591a*/
      }
      break; /*0xffc5591d*/
    case 7:
    case 8:
    case 9:
      *a4 = a3 != 1 ? 9 : 6;
      n134301240 = a3 == 1 ? 134303240 : 134302728;
      break; /*0xffc55974*/
    case 10:
    case 11:
    case 12:
      *a4 = a3 != 1 ? 10 : 7;
      n134301240 = a3 == 1 ? 134303284 : 134302772;
      break; /*0xffc559a3*/
    case 13:
      if ( a3 == 1 )
      {
        AssertPrint(
          a1,
          255,
          (int)"\n\nRC_ASSERT! %s: %u   %s ",
          "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Mem\\MemCmdControl.c",
          855,
          "FALSE");
        ProcMemInitCheck((int)a1, 242, 39); /*0xffc559ce*/
      }
      else
      {
        n134301240 = 134302776; /*0xffc559d3*/
        *a4 = 11; /*0xffc559d8*/
      }
      break; /*0xffc559ce*/
    default:
      AssertPrint(
        a1,
        255,
        (int)"\n\nRC_ASSERT! %s: %u   %s ",
        "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Mem\\MemCmdControl.c",
        864,
        "FALSE");
      ProcMemInitCheck((int)a1, 242, 40); /*0xffc55a08*/
      break; /*0xffc55a08*/
  }
  return n134301240; /*0xffc55a12*/
}

// Function: MailBoxFunc5A3D @ 0xffc55a3d (0x24 bytes)
// Index: 678/2560

int __cdecl MailBoxFunc5A3D(int __return_address, int n4, int a3, int n52, _WORD *p_n127, __int16 *p_n0x7FFF)
{
  __int16 n127; // cx

  *p_n127 = 0; /*0xffc55a48*/
  if ( n52 == 52 ) /*0xffc55a4f*/
    n127 = 127; /*0xffc55a53*/
  else
    n127 = 255; /*0xffc55a56*/
  *p_n0x7FFF = n127; /*0xffc55a5b*/
  return 0; /*0xffc55a60*/
}

// Function: MailBoxFunc5A61 @ 0xffc55a61 (0x4f bytes)
// Index: 679/2560

_BYTE *__cdecl MailBoxFunc5A61(int n3, _BYTE *a2)
{
  _BYTE *v2; // esi
  char *DdrLevel; // [esp-4h] [ebp-8h]

  switch ( n3 ) /*0xffc55a6b*/
  {
    case 0: /*0xffc55a6b*/
      DdrLevel = "DdrLevel"; /*0xffc55a9b*/
      goto LABEL_10; /*0xffc55a9b*/
    case 1: /*0xffc55a6b*/
      DdrLevel = "LrbufLevel"; /*0xffc55a94*/
      goto LABEL_10; /*0xffc55a99*/
    case 2: /*0xffc55a6b*/
      DdrLevel = "RegALevel"; /*0xffc55a8d*/
LABEL_10:
      v2 = a2; /*0xffc55aa0*/
      RmtFunc8B50(a2, DdrLevel); /*0xffc55aa4*/
      return v2; /*0xffc55aa4*/
  }
  v2 = a2; /*0xffc55a77*/
  if ( n3 == 3 ) /*0xffc55a7d*/
    RmtFunc8B50(a2, "RegBLevel"); /*0xffc55a8b*/
  else
    RmtFunc8B50(a2, "Unknown level"); /*0xffc55a84*/
  return v2; /*0xffc55aad*/
}

// Function: MailBoxFunc5AB0 @ 0xffc55ab0 (0xba bytes)
// Index: 680/2560

_BYTE *__cdecl MailBoxFunc5AB0(_BYTE *n6, int n49, _BYTE *a3)
{
  char *CtlGrp5; // [esp-4h] [ebp-8h]

  if ( n49 > 49 ) /*0xffc55aba*/
  {
    switch ( n49 ) /*0xffc55b10*/
    {
      case '2': /*0xffc55b10*/
        CtlGrp5 = "CtlGrp5"; /*0xffc55b55*/
        goto LABEL_29; /*0xffc55b55*/
      case '3': /*0xffc55b10*/
        CtlGrp5 = "CmdCtlAll"; /*0xffc55b4e*/
        goto LABEL_29; /*0xffc55b53*/
      case '4': /*0xffc55b10*/
        CtlGrp5 = "CkAll"; /*0xffc55b47*/
        goto LABEL_29; /*0xffc55b4c*/
      case 'G': /*0xffc55b10*/
        CtlGrp5 = "CmdGrp0"; /*0xffc55b40*/
        goto LABEL_29; /*0xffc55b45*/
      case 'H': /*0xffc55b10*/
        CtlGrp5 = "CmdGrp1"; /*0xffc55b39*/
        goto LABEL_29; /*0xffc55b3e*/
      case 'I': /*0xffc55b10*/
        CtlGrp5 = "CmdGrp2"; /*0xffc55b32*/
        goto LABEL_29; /*0xffc55b37*/
    }
    goto LABEL_22; /*0xffc55b29*/
  }
  switch ( n49 ) /*0xffc55abc*/
  {
    case '1': /*0xffc55abc*/
      CtlGrp5 = "CtlGrp4"; /*0xffc55b06*/
      goto LABEL_29; /*0xffc55b0b*/
    case '(': /*0xffc55abc*/
      CtlGrp5 = "CmdAll"; /*0xffc55aff*/
      goto LABEL_29; /*0xffc55b04*/
    case ',': /*0xffc55abc*/
      CtlGrp5 = "CtlAll"; /*0xffc55af8*/
      goto LABEL_29; /*0xffc55afd*/
    case '-': /*0xffc55abc*/
      CtlGrp5 = "CtlGrp0"; /*0xffc55af1*/
      goto LABEL_29; /*0xffc55af6*/
    case '.': /*0xffc55abc*/
      CtlGrp5 = "CtlGrp1"; /*0xffc55aea*/
      goto LABEL_29; /*0xffc55aef*/
    case '/': /*0xffc55abc*/
      CtlGrp5 = "CtlGrp2"; /*0xffc55ae3*/
      goto LABEL_29; /*0xffc55ae8*/
  }
  if ( n49 != 48 ) /*0xffc55ada*/
  {
LABEL_22:
    CtlGrp5 = "Unknown platform group"; /*0xffc55b2b*/
    goto LABEL_29; /*0xffc55b30*/
  }
  CtlGrp5 = "CtlGrp3"; /*0xffc55adc*/
LABEL_29:
  RmtFunc8B50(a3, CtlGrp5); /*0xffc55b5a*/
  return a3; /*0xffc55b67*/
}

// Function: MailBoxFunc5B6A @ 0xffc55b6a (0x264 bytes)
// Index: 681/2560

int __cdecl MailBoxFunc5B6A(unsigned __int8 *__return_address, int n4, int n6, char n2, char a5, __int16 *a6)
{
  char n2_1; // bl
  unsigned __int8 *v8; // ebp
  unsigned int n2a_1; // eax
  bool v10; // dl
  unsigned __int8 v11; // cl
  unsigned int v12; // ecx
  __int16 v13; // dx
  unsigned int n2a_2; // esi
  unsigned __int8 n6_1; // bl
  __int16 n0x80_1; // dx
  unsigned int n0x80; // ecx
  unsigned int v18; // edx
  char v19; // cl
  int v20; // edx
  unsigned int v21; // eax
  int v23; // [esp+14h] [ebp-4h]
  char n2_2; // [esp+1Ch] [ebp+4h]
  int n2a; // [esp+28h] [ebp+10h]

  n2_1 = n2; /*0xffc55b71*/
  n2_2 = n2; /*0xffc55b85*/
  v8 = &__return_address[48704 * (unsigned __int8)n4 + 258689]; /*0xffc55b8f*/
  v23 = 50813 * (unsigned __int8)n4; /*0xffc55b9b*/
  if ( __return_address[v23 + 61000] ) /*0xffc55b9f*/
    goto LABEL_7; /*0xffc55ba7*/
  if ( n2 == 1 ) /*0xffc55baf*/
  {
    n2_1 = 2; /*0xffc55bba*/
  }
  else
  {
    if ( n2 != 2 ) /*0xffc55bb4*/
      goto LABEL_7; /*0xffc55bb4*/
    n2_1 = 1; /*0xffc55bb6*/
  }
  n2_2 = n2_1; /*0xffc55bbc*/
LABEL_7:
  if ( (a5 & 1) != 0 ) /*0xffc55bcb*/
    n2a_1 = MiscConfigCheck(__return_address, n4, n6, 134302220); /*0xffc55bd5*/
  else
    n2a_1 = *(_DWORD *)&v8[7688 * (unsigned __int8)n6 + 3263]; /*0xffc55be8*/
  n2a = n2a_1; /*0xffc55bf4*/
  if ( n2_1 ) /*0xffc55bfb*/
  {
    switch ( n2_1 ) /*0xffc55c00*/
    {
      case 1: /*0xffc55c00*/
        v10 = (n2a_1 & 0x4000) != 0; /*0xffc55c37*/
        v12 = n2a_1 >> 8; /*0xffc55c3a*/
        break;
      case 2: /*0xffc55c00*/
        v10 = (n2a_1 & 0x400000) != 0; /*0xffc55c28*/
        v12 = HIWORD(n2a_1); /*0xffc55c2b*/
        break;
      case 3: /*0xffc55c00*/
        v10 = (n2a_1 & 0x40000000) != 0; /*0xffc55c19*/
        v12 = HIBYTE(n2a_1); /*0xffc55c1c*/
        break;
      default:
        v10 = 0; /*0xffc55c0c*/
        v11 = 0; /*0xffc55c0e*/
        goto LABEL_20; /*0xffc55c10*/
    }
  }
  else
  {
    v10 = (n2a_1 & 0x40) != 0; /*0xffc55c47*/
    LOBYTE(v12) = n2a_1; /*0xffc55c49*/
  }
  v11 = v12 & 0x3F; /*0xffc55c4b*/
LABEL_20:
  v13 = v11 + (v10 << 6); /*0xffc55c4e*/
  if ( (a5 & 2) != 0 ) /*0xffc55c61*/
  {
    n2a_2 = n2a_1; /*0xffc55c67*/
    n6_1 = n6; /*0xffc55c6b*/
    *a6 = v13; /*0xffc55c6f*/
    goto LABEL_47; /*0xffc55c72*/
  }
  if ( (a5 & 4) != 0 ) /*0xffc55c7e*/
    n0x80_1 = v13 + *a6; /*0xffc55c86*/
  else
    n0x80_1 = *a6; /*0xffc55c8b*/
  if ( n0x80_1 < 0 ) /*0xffc55c91*/
    n0x80 = (unsigned __int16)(n0x80_1 + 128); /*0xffc55c9e*/
  else
    n0x80 = (unsigned __int8)n0x80_1; /*0xffc55c93*/
  if ( (unsigned __int16)n0x80 > 0x80u ) /*0xffc55ca9*/
    n0x80 = (unsigned __int16)(n0x80_1 - 128); /*0xffc55cae*/
  v18 = n0x80 >> 6; /*0xffc55cb6*/
  v19 = n0x80 & 0x3F; /*0xffc55cb9*/
  switch ( n2_1 ) /*0xffc55cbe*/
  {
    case 0: /*0xffc55cbe*/
      v20 = v19 & 0x3F | ((v18 & 1) << 6); /*0xffc55d2b*/
      v21 = n2a_1 & 0xFFFFFF80; /*0xffc55d2d*/
      goto LABEL_38; /*0xffc55d2d*/
    case 1: /*0xffc55cbe*/
      v20 = (v19 & 0x3F | ((v18 & 1) << 6)) << 8; /*0xffc55d13*/
      v21 = n2a_1 & 0xFFFF80FF; /*0xffc55d16*/
      goto LABEL_38; /*0xffc55d1b*/
    case 2: /*0xffc55cbe*/
      v20 = (v19 & 0x3F | ((v18 & 1) << 6)) << 16; /*0xffc55cf9*/
      v21 = n2a_1 & 0xFF80FFFF; /*0xffc55cfc*/
      goto LABEL_38; /*0xffc55d01*/
    case 3: /*0xffc55cbe*/
      v20 = (v19 & 0x3F | ((v18 & 1) << 6)) << 24; /*0xffc55cdf*/
      v21 = n2a_1 & 0x80FFFFFF; /*0xffc55ce2*/
LABEL_38:
      n2a = v20 | v21; /*0xffc55d30*/
      break;
  }
  n6_1 = n6; /*0xffc55d36*/
  if ( __return_address[v23 + 61001] == 1 ) /*0xffc55d4a*/
    MailBoxFunc7375(__return_address, n4, n6, n2_2); /*0xffc55d53*/
  n2a_2 = n2a; /*0xffc55d5f*/
  if ( *(_DWORD *)&__return_address[48704 * (unsigned __int8)n4 + 261952 + 7688 * (unsigned __int8)n6] != n2a /*0xffc55d7a*/
    || (a5 & 8) != 0 )
  {
    MiscIoCheck(__return_address, n4, n6, 0x8014A0Cu, n2a); /*0xffc55d85*/
  }
  if ( __return_address[v23 + 61001] == 1 ) /*0xffc55d99*/
    MailBoxFunc72BF(__return_address, n4, n6, n2_2); /*0xffc55da2*/
  v8 = &__return_address[48704 * (unsigned __int8)n4 + 258689]; /*0xffc55daa*/
LABEL_47:
  if ( (a5 & 0x10) != 0 ) /*0xffc55db3*/
    *(_DWORD *)&v8[7688 * n6_1 + 3263] = n2a_2; /*0xffc55dbe*/
  return 0; /*0xffc55dc5*/
}

// Function: MailBoxFunc5DCE @ 0xffc55dce (0x145 bytes)
// Index: 682/2560

int __cdecl MailBoxFunc5DCE(unsigned __int8 *n6, int n4, int n6a, int n2, char n28, __int16 *p_n64)
{
  int n6a_1; // ebx
  unsigned __int8 *n6_1; // edi
  unsigned __int8 *v8; // ebp
  unsigned int n6_2; // eax
  __int16 v10; // dx
  __int16 n64; // cx
  char n28_1; // cl
  int n4_1; // esi

  n6a_1 = n6a; /*0xffc55dd3*/
  n6_1 = n6; /*0xffc55de3*/
  v8 = &n6[48704 * (unsigned __int8)n4]; /*0xffc55de9*/
  if ( (n28 & 1) != 0 ) /*0xffc55df0*/
  {
    ProcCommonFuncDD01(n6, n4, n6a, n2, 0x50F4C08u, (int *)&n6, 0, 0, 15); /*0xffc55e07*/
    n6_2 = (unsigned int)n6; /*0xffc55e0c*/
  }
  else
  {
    n6_2 = *(_DWORD *)&v8[7688 * (unsigned __int8)n6a + 261944]; /*0xffc55e1e*/
  }
  v10 = ((n6_2 >> 18) & 0x3F) + ((HIBYTE(n6_2) & 3) << 6); /*0xffc55e46*/
  if ( (n28 & 2) != 0 ) /*0xffc55e4c*/
  {
    *p_n64 = v10; /*0xffc55e52*/
LABEL_16:
    n28_1 = n28; /*0xffc55ef3*/
    goto LABEL_17; /*0xffc55ef3*/
  }
  if ( (n28 & 4) != 0 ) /*0xffc55e61*/
    n64 = v10 + *p_n64; /*0xffc55e69*/
  else
    n64 = *p_n64; /*0xffc55e6e*/
  if ( n64 <= 0 ) /*0xffc55e77*/
    n64 = 0; /*0xffc55e79*/
  if ( (unsigned __int16)n64 > 0x7Fu ) /*0xffc55e81*/
    LOBYTE(n64) = 127; /*0xffc55e83*/
  n6_2 = ((n64 & 0x3F | ((unsigned __int8)n64 >> 6 << 6)) << 18) | n6_2 & 0xFC03FFFF; /*0xffc55ea9*/
  n6 = (unsigned __int8 *)n6_2; /*0xffc55eab*/
  if ( *(_DWORD *)&v8[7688 * (unsigned __int8)n6a_1 + 261944] != n6_2 || (n28_1 = n28, (n28 & 8) != 0) ) /*0xffc55ebf*/
  {
    n4_1 = n4; /*0xffc55ec6*/
    ProcCommonFuncDD01(n6_1, n4, n6a_1, n2, 0x50F4C08u, (int *)&n6, 0, 1, 15); /*0xffc55edb*/
    ProcCommonFunc2441((int)n6_1, n4_1, n6a_1, n2); /*0xffc55ee7*/
    n6_2 = (unsigned int)n6; /*0xffc55eec*/
    goto LABEL_16; /*0xffc55eec*/
  }
LABEL_17:
  if ( (n28_1 & 0x10) != 0 ) /*0xffc55efa*/
    *(_DWORD *)&v8[7688 * (unsigned __int8)n6a_1 + 261944] = n6_2; /*0xffc55f05*/
  return 0; /*0xffc55f0c*/
}

// Function: MailBoxFunc5F13 @ 0xffc55f13 (0x4d1 bytes)
// Index: 683/2560

int __cdecl MailBoxFunc5F13(
        unsigned __int8 *a1,
        unsigned __int8 a2,
        int a3,
        unsigned __int8 a4,
        char a5,
        char a6,
        __int16 *a7)
{
  unsigned __int8 *v7; // ebp
  unsigned int v8; // eax
  unsigned int v9; // ecx
  signed int n2; // edx
  unsigned int v11; // edx
  unsigned int v12; // edx
  unsigned int n6; // ebp
  unsigned int v14; // edx
  unsigned __int8 v15; // bl
  unsigned int v16; // eax
  unsigned __int8 v17; // dl
  unsigned int v18; // eax
  int v19; // ecx
  __int16 v20; // di
  unsigned int v21; // esi
  unsigned __int8 *v22; // ebp
  unsigned int v23; // edi
  __int16 n255_2; // si
  int n255; // ebx
  unsigned int n255_1; // esi
  char v27; // bl
  unsigned int v28; // esi
  unsigned int v29; // ebp
  unsigned int v30; // ebp
  unsigned int v31; // ebp
  unsigned int v32; // ebp
  unsigned int v33; // ebp
  int v34; // esi
  unsigned int v35; // eax
  int v36; // edx
  unsigned int v37; // ecx
  unsigned int v38; // edx
  unsigned int v39; // edx
  int v40; // edx
  unsigned __int8 v41; // cl
  unsigned int v42; // edx
  unsigned int v43; // edx
  unsigned __int8 v45; // [esp+13h] [ebp-1Dh] BYREF
  unsigned int v46; // [esp+14h] [ebp-1Ch]
  unsigned int v47; // [esp+18h] [ebp-18h]
  unsigned int v48; // [esp+1Ch] [ebp-14h]
  unsigned int n3; // [esp+20h] [ebp-10h]
  unsigned int v50; // [esp+24h] [ebp-Ch]
  unsigned __int8 *v51; // [esp+28h] [ebp-8h]
  unsigned int v52; // [esp+2Ch] [ebp-4h]
  unsigned __int8 v53; // [esp+40h] [ebp+10h]

  v50 = 0; /*0xffc55f1e*/
  v7 = &a1[48704 * a2 + 258689]; /*0xffc55f3a*/
  v51 = v7; /*0xffc55f45*/
  v8 = MailBoxFunc5893(a1, a4, a5, &v45); /*0xffc55f4b*/
  v52 = v8; /*0xffc55f52*/
  v9 = 0; /*0xffc55f56*/
  v46 = 0; /*0xffc55f58*/
  v48 = 0; /*0xffc55f5e*/
  v47 = 0; /*0xffc55f65*/
  n3 = 3; /*0xffc55f73*/
  if ( (a6 & 1) != 0 )
  {
    v9 = MiscConfigCheck(a1, a2, a3, v8); /*0xffc55f98*/
    v50 = v9; /*0xffc55f9f*/
    n2 = a4 % 7u; /*0xffc55fa6*/
    if ( n2 >= 0 ) /*0xffc55faa*/
    {
      if ( n2 <= 2 ) /*0xffc55faf*/
      {
        v48 = v9; /*0xffc55fcb*/
        goto LABEL_17; /*0xffc55fcf*/
      }
      if ( n2 <= 5 ) /*0xffc55fb4*/
      {
        v46 = v9; /*0xffc55fc5*/
        goto LABEL_10; /*0xffc55fc9*/
      }
      if ( n2 == 6 ) /*0xffc55fb9*/
      {
        v47 = v9; /*0xffc55fbd*/
LABEL_10:
        v9 = v48; /*0xffc55fff*/
        goto LABEL_17; /*0xffc56003*/
      }
    }
    AssertPrint(
      a1,
      255,
      (int)"\n\nRC_ASSERT! %s: %u   %s ",
      "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Mem\\MemCmdControl.c",
      953,
      "FALSE");
    ProcMemInitCheck((int)a1, 242, 41); /*0xffc55ff7*/
    goto LABEL_10; /*0xffc55ff7*/
  }
  v11 = v45 % n3; /*0xffc5600e*/
  if ( v11 ) /*0xffc56016*/
  {
    v12 = v11 - 1; /*0xffc56018*/
    if ( v12 ) /*0xffc5601b*/
    {
      if ( v12 == 1 ) /*0xffc56020*/
        v47 = *(_DWORD *)&v7[7688 * (unsigned __int8)a3 + 7576 + 4 * v45]; /*0xffc56038*/
    }
    else
    {
      v46 = *(_DWORD *)&v7[7688 * (unsigned __int8)a3 + 7576 + 4 * v45]; /*0xffc56054*/
    }
  }
  else
  {
    v9 = *(_DWORD *)&v7[7688 * (unsigned __int8)a3 + 7576 + 4 * v45]; /*0xffc56069*/
    v48 = v9; /*0xffc56070*/
  }
LABEL_17:
  n6 = a4 % 7u; /*0xffc56075*/
  if ( n6 ) /*0xffc5608a*/
  {
    if ( n6 == 1 ) /*0xffc56093*/
    {
      v53 = (v9 >> 15) & 3; /*0xffc5614b*/
      v18 = v9 >> 9; /*0xffc56151*/
    }
    else
    {
      if ( n6 != 2 ) /*0xffc5609c*/
      {
        switch ( n6 ) /*0xffc560a5*/
        {
          case 3u: /*0xffc560a5*/
            v16 = v46; /*0xffc56112*/
            v17 = (v46 >> 6) & 3; /*0xffc5611b*/
            v15 = v46 & 0x3F; /*0xffc5611e*/
            break;
          case 4u: /*0xffc560a5*/
            v16 = v46; /*0xffc560f9*/
            v53 = (v46 >> 15) & 3; /*0xffc56105*/
            v15 = (v46 >> 9) & 0x3F; /*0xffc5610e*/
LABEL_30:
            v14 = v47; /*0xffc56124*/
            goto LABEL_37; /*0xffc56128*/
          case 5u: /*0xffc560a5*/
            v16 = v46; /*0xffc560e1*/
            v17 = HIBYTE(v46) & 3; /*0xffc560ed*/
            v15 = (v46 >> 18) & 0x3F; /*0xffc560f4*/
            break;
          default:
            v14 = v47; /*0xffc560b1*/
            if ( n6 == 6 ) /*0xffc560b8*/
            {
              v53 = (v47 >> 6) & 3; /*0xffc560d2*/
              v15 = v47 & 0x3F; /*0xffc560d6*/
            }
            else
            {
              v53 = 0; /*0xffc560ba*/
              v15 = 0; /*0xffc560bf*/
            }
            goto LABEL_36; /*0xffc560c1*/
        }
        v53 = v17; /*0xffc56120*/
        goto LABEL_30; /*0xffc56120*/
      }
      v53 = HIBYTE(v9) & 3; /*0xffc56134*/
      v18 = v9 >> 18; /*0xffc5613a*/
    }
    v15 = v18 & 0x3F; /*0xffc5613d*/
  }
  else
  {
    v15 = v9 & 0x3F; /*0xffc56160*/
    v53 = (v9 >> 6) & 3; /*0xffc56162*/
  }
  v14 = v47; /*0xffc56166*/
LABEL_36:
  v16 = v46; /*0xffc5616a*/
LABEL_37:
  v19 = v48; /*0xffc5616e*/
  v20 = v15 + (v53 << 6); /*0xffc56188*/
  if ( (a6 & 2) != 0 ) /*0xffc5618b*/
  {
    v21 = v46; /*0xffc56191*/
    v22 = v51; /*0xffc56195*/
    *a7 = v20; /*0xffc56199*/
    v23 = v47; /*0xffc5619c*/
LABEL_73:
    v41 = a3; /*0xffc56375*/
    goto LABEL_74; /*0xffc56375*/
  }
  if ( (a6 & 4) != 0 ) /*0xffc561ae*/
    n255_2 = v20 + *a7; /*0xffc561b6*/
  else
    n255_2 = *a7; /*0xffc561bb*/
  if ( n255_2 <= 0 ) /*0xffc561c1*/
    n255 = 0; /*0xffc561c8*/
  else
    n255 = (unsigned __int16)n255_2; /*0xffc561c3*/
  if ( (unsigned __int16)n255 > 0xFFu ) /*0xffc561d2*/
    n255 = 255; /*0xffc561d4*/
  n255_1 = n255; /*0xffc561d6*/
  v27 = n255 & 0x3F; /*0xffc561d8*/
  v28 = n255_1 >> 6; /*0xffc561db*/
  if ( !n6 ) /*0xffc561e5*/
  {
    v36 = v27 & 0x3F | ((v28 & 3) << 6); /*0xffc562fa*/
    v37 = v48 & 0xFFFFFF00; /*0xffc562fc*/
    goto LABEL_62; /*0xffc562fc*/
  }
  v29 = n6 - 1; /*0xffc561eb*/
  if ( !v29 ) /*0xffc561ee*/
  {
    v36 = (v27 & 0x3F | ((v28 & 3) << 6)) << 9; /*0xffc562da*/
    v37 = v48 & 0xFFFE01FF; /*0xffc562dd*/
    goto LABEL_62; /*0xffc562e3*/
  }
  v30 = v29 - 1; /*0xffc561f4*/
  if ( !v30 ) /*0xffc561f7*/
  {
    v36 = (v27 & 0x3F | ((v28 & 3) << 6)) << 18; /*0xffc562b8*/
    v37 = v48 & 0xFC03FFFF; /*0xffc562bb*/
LABEL_62:
    v19 = v36 | v37; /*0xffc56302*/
    v48 = v19; /*0xffc56304*/
    goto LABEL_63; /*0xffc56304*/
  }
  v31 = v30 - 1; /*0xffc561fd*/
  if ( !v31 ) /*0xffc56200*/
  {
    v34 = v27 & 0x3F | ((v28 & 3) << 6); /*0xffc56292*/
    v35 = v16 & 0xFFFFFF00; /*0xffc56294*/
    goto LABEL_58; /*0xffc56294*/
  }
  v32 = v31 - 1; /*0xffc56202*/
  if ( !v32 ) /*0xffc56205*/
  {
    v34 = (v27 & 0x3F | ((v28 & 3) << 6)) << 9; /*0xffc56273*/
    v35 = v16 & 0xFFFE01FF; /*0xffc56276*/
    goto LABEL_58; /*0xffc5627b*/
  }
  v33 = v32 - 1; /*0xffc56207*/
  if ( !v33 ) /*0xffc5620a*/
  {
    v34 = (v27 & 0x3F | ((v28 & 3) << 6)) << 18; /*0xffc56252*/
    v35 = v16 & 0xFC03FFFF; /*0xffc56255*/
LABEL_58:
    v46 = v34 | v35; /*0xffc56299*/
    goto LABEL_63; /*0xffc5629f*/
  }
  if ( v33 == 1 ) /*0xffc5620f*/
    v47 = v27 & 0x3F | ((v28 & 3) << 6) | v14 & 0xFFFFFF00; /*0xffc56232*/
LABEL_63:
  v23 = v47; /*0xffc56308*/
  v38 = v45 % n3; /*0xffc56315*/
  v21 = v46; /*0xffc56319*/
  if ( v38 ) /*0xffc56320*/
  {
    v39 = v38 - 1; /*0xffc56322*/
    if ( v39 ) /*0xffc56325*/
    {
      if ( v39 == 1 ) /*0xffc5632a*/
        v40 = v47; /*0xffc5632c*/
      else
        v40 = v50; /*0xffc56338*/
    }
    else
    {
      v40 = v46; /*0xffc56330*/
    }
  }
  else
  {
    v40 = v19; /*0xffc56334*/
  }
  v41 = a3; /*0xffc5633c*/
  v22 = v51; /*0xffc56340*/
  if ( *(_DWORD *)&v51[7688 * (unsigned __int8)a3 + 7576 + 4 * v45] != v40 || (a6 & 8) != 0 ) /*0xffc5635d*/
  {
    MiscIoCheck(a1, a2, a3, v52, v40); /*0xffc5636d*/
    goto LABEL_73; /*0xffc5636d*/
  }
LABEL_74:
  if ( (a6 & 0x10) != 0 ) /*0xffc5637e*/
  {
    v42 = v45 % n3; /*0xffc56389*/
    if ( v42 ) /*0xffc56390*/
    {
      v43 = v42 - 1; /*0xffc56392*/
      if ( v43 ) /*0xffc56395*/
      {
        if ( v43 == 1 ) /*0xffc5639a*/
          *(_DWORD *)&v22[7688 * v41 + 7576 + 4 * v45] = v23; /*0xffc563a7*/
      }
      else
      {
        *(_DWORD *)&v22[7688 * v41 + 7576 + 4 * v45] = v21; /*0xffc563bb*/
      }
    }
    else
    {
      *(_DWORD *)&v22[7688 * v41 + 7576 + 4 * v45] = v48; /*0xffc563d3*/
    }
  }
  return 0; /*0xffc563da*/
}

// Function: MailBoxFunc63E4 @ 0xffc563e4 (0x1b2 bytes)
// Index: 684/2560

int __cdecl MailBoxFunc63E4(
        unsigned __int8 *__return_address,
        int n4,
        int n6,
        int a4,
        unsigned int n75,
        char a6,
        _WORD *a7)
{
  int n6_1; // ebx
  unsigned __int8 *__return_address_1; // ebp
  unsigned __int8 *v9; // edx
  unsigned int __return_address_2; // eax
  unsigned int n75_1; // edi
  unsigned __int8 v12; // dl
  unsigned __int8 v13; // cl
  unsigned int v14; // ecx
  __int16 v15; // si
  char v16; // dl
  unsigned __int8 *v17; // edi
  int n127; // ecx
  unsigned int n127_1; // esi
  char v20; // cl
  unsigned int n75_2; // esi
  unsigned int v22; // edi
  unsigned int v23; // edx
  unsigned int v24; // eax
  int n4_1; // esi
  unsigned __int8 *v27; // [esp+Ch] [ebp-4h]

  n6_1 = n6; /*0xffc563ea*/
  __return_address_1 = __return_address; /*0xffc563ef*/
  v9 = &__return_address[48704 * (unsigned __int8)n4 + 258689]; /*0xffc56403*/
  v27 = v9; /*0xffc5640a*/
  if ( (a6 & 1) != 0 ) /*0xffc5640e*/
  {
    ProcCommonFuncDD01(__return_address, n4, n6, a4, 0x50F4C34u, (int *)&__return_address, 0, 0, 15); /*0xffc56427*/
    __return_address_2 = (unsigned int)__return_address; /*0xffc5642c*/
  }
  else
  {
    __return_address_2 = *(_DWORD *)&v9[7688 * (unsigned __int8)n6 + 3259]; /*0xffc5643e*/
    __return_address = (unsigned __int8 *)__return_address_2; /*0xffc56445*/
  }
  n75_1 = n75; /*0xffc56449*/
  if ( n75 == 74 ) /*0xffc56452*/
  {
    v12 = (__return_address_2 >> 6) & 3; /*0xffc56476*/
    LOBYTE(v14) = __return_address_2; /*0xffc56478*/
  }
  else
  {
    if ( n75 != 75 ) /*0xffc56457*/
    {
      v12 = 0; /*0xffc56459*/
      v13 = 0; /*0xffc5645b*/
      goto LABEL_10; /*0xffc5645d*/
    }
    v12 = (__return_address_2 >> 15) & 3; /*0xffc56466*/
    v14 = __return_address_2 >> 9; /*0xffc56469*/
  }
  v13 = v14 & 0x3F; /*0xffc5647a*/
LABEL_10:
  v15 = v13 + (v12 << 6); /*0xffc5647d*/
  v16 = a6; /*0xffc56492*/
  if ( (a6 & 2) != 0 ) /*0xffc56499*/
  {
    v17 = v27; /*0xffc5649b*/
    *a7 = v15; /*0xffc5649f*/
    goto LABEL_28; /*0xffc564a2*/
  }
  if ( (a6 & 4) != 0 ) /*0xffc564aa*/
    LOWORD(n127) = v15 + *a7; /*0xffc564b2*/
  else
    LOWORD(n127) = *a7; /*0xffc564b7*/
  if ( (__int16)n127 <= 0 ) /*0xffc564bd*/
    n127 = 0; /*0xffc564c4*/
  else
    n127 = (unsigned __int16)n127; /*0xffc564bf*/
  if ( (unsigned __int16)n127 > 0x7Fu ) /*0xffc564cc*/
    n127 = 127; /*0xffc564ce*/
  n127_1 = n127; /*0xffc564d0*/
  v20 = n127 & 0x3F; /*0xffc564d2*/
  n75_2 = n127_1 >> 6; /*0xffc564d5*/
  n75 = n75_2; /*0xffc564d8*/
  v22 = n75_1 - 74; /*0xffc564dc*/
  if ( !v22 ) /*0xffc564df*/
  {
    v23 = v20 & 0x3F | ((n75 & 3) << 6); /*0xffc56516*/
    v24 = __return_address_2 & 0xFFFFFF00; /*0xffc56518*/
    goto LABEL_24; /*0xffc56518*/
  }
  if ( v22 == 1 ) /*0xffc564e4*/
  {
    v23 = (v20 & 0x3F | ((n75_2 & 3) << 6)) << 9; /*0xffc564f9*/
    v24 = __return_address_2 & 0xFFFE01FF; /*0xffc564fc*/
LABEL_24:
    __return_address_2 = v23 | v24; /*0xffc5651d*/
    v16 = a6; /*0xffc5651f*/
    __return_address = (unsigned __int8 *)__return_address_2; /*0xffc56523*/
  }
  v17 = v27; /*0xffc56527*/
  if ( *(_DWORD *)&v27[7688 * (unsigned __int8)n6_1 + 3259] != __return_address_2 || (v16 & 8) != 0 ) /*0xffc56540*/
  {
    n4_1 = n4; /*0xffc56542*/
    ProcCommonFuncDD01(__return_address_1, n4, n6_1, a4, 0x50F4C34u, (int *)&__return_address, 0, 1, 15); /*0xffc5655d*/
    ProcCommonFunc2441((int)__return_address_1, n4_1, n6_1, a4); /*0xffc56569*/
    __return_address_2 = (unsigned int)__return_address; /*0xffc5656e*/
    v16 = a6; /*0xffc56575*/
  }
LABEL_28:
  if ( (v16 & 0x10) != 0 ) /*0xffc5657d*/
    *(_DWORD *)&v17[7688 * (unsigned __int8)n6_1 + 3259] = __return_address_2; /*0xffc56588*/
  return 0; /*0xffc5658f*/
}

// Function: MailBoxFunc6596 @ 0xffc56596 (0x9d bytes)
// Index: 685/2560

int __cdecl MailBoxFunc6596(
        unsigned __int8 *a1,
        unsigned __int8 a2,
        int a3,
        int a4,
        char a5,
        __int16 *a6,
        unsigned __int16 *a7,
        unsigned __int16 *a8)
{
  int v8; // edi
  unsigned __int8 n13; // al
  char *v10; // esi
  int n13_1; // ebx

  switch ( a4 ) /*0xffc565a0*/
  {
    case '(': /*0xffc565a0*/
      n13 = 13; /*0xffc565d1*/
      v10 = byte_FFD5237C; /*0xffc565d3*/
      break;
    case 'G': /*0xffc565a0*/
      n13 = 6; /*0xffc565c8*/
      v10 = (char *)&unk_FFD52360; /*0xffc565ca*/
      break;
    case 'H': /*0xffc565a0*/
      n13 = 3; /*0xffc565bf*/
      v10 = (char *)&unk_FFD5236C; /*0xffc565c1*/
      break;
    case 'I': /*0xffc565a0*/
      n13 = 4; /*0xffc565b6*/
      v10 = (char *)&unk_FFD52374; /*0xffc565b8*/
      break;
    default:
      return 5; /*0xffc565b4*/
  }
  n13_1 = n13; /*0xffc565de*/
  do /*0xffc56629*/
  {
    v8 = MailBoxFunc5F13(a1, a2, a3, *v10, v10[1], a5, a6); /*0xffc56614*/
    MailBoxFunc8CAD(*a6, a7, a8); /*0xffc5661b*/
    v10 += 2; /*0xffc56623*/
    --n13_1; /*0xffc56626*/
  }
  while ( n13_1 ); /*0xffc56629*/
  return v8; /*0xffc5662f*/
}

// Function: MailBoxFunc6633 @ 0xffc56633 (0x85 bytes)
// Index: 686/2560

int __cdecl MailBoxFunc6633(
        unsigned __int8 *__return_address,
        int n4,
        int n6,
        int a4,
        int n40,
        char a6,
        __int16 *a7,
        unsigned __int16 *a8,
        unsigned __int16 *a9)
{
  unsigned __int8 n2; // dl
  int v10; // esi
  unsigned int *p_n75; // edi
  int n2_1; // ebx
  _DWORD p_n75_1[2]; // [esp+4h] [ebp-8h] BYREF

  if ( n40 == 40 ) /*0xffc5663d*/
  {
    p_n75_1[0] = 74; /*0xffc56654*/
    n2 = 2; /*0xffc5665c*/
    p_n75_1[1] = 75; /*0xffc5665e*/
  }
  else
  {
    n2 = 1; /*0xffc56644*/
    if ( (unsigned int)(n40 - 74) > 1 ) /*0xffc56647*/
      return 5; /*0xffc56652*/
    p_n75_1[0] = n40; /*0xffc56649*/
  }
  p_n75 = p_n75_1; /*0xffc5666d*/
  n2_1 = n2; /*0xffc56671*/
  do /*0xffc566ad*/
  {
    v10 = MailBoxFunc63E4(__return_address, n4, n6, a4, *p_n75, a6, a7); /*0xffc56698*/
    MailBoxFunc8CAD(*a7, a8, a9); /*0xffc5669f*/
    ++p_n75; /*0xffc566a7*/
    --n2_1; /*0xffc566aa*/
  }
  while ( n2_1 ); /*0xffc566ad*/
  return v10; /*0xffc566b4*/
}

// Function: MailBoxFunc66B8 @ 0xffc566b8 (0x61 bytes)
// Index: 687/2560

int __cdecl MailBoxFunc66B8(int a1, int a2, int a3, int a4, int a5, char a6, int a7)
{
  if ( !*(_BYTE *)(1379 * (unsigned __int8)a4 + GetCpuCount(a1, a2, a3) + 107) ) /*0xffc566de*/
    return MailBoxFunc69D6(a1, a2, a3, a6, a7); /*0xffc5670f*/
  if ( a5 == 1 ) /*0xffc566f3*/
    return MailBoxFunc689A(a1, a2, a3, a4, a6, a7); /*0xffc566f5*/
  return MailBoxFunc6719(a1, a2, a3, a4, a6, a7); /*0xffc56704*/
}

// Function: MailBoxFunc6719 @ 0xffc56719 (0x181 bytes)
// Index: 688/2560

int __cdecl MailBoxFunc6719(int a1, int a2, int a3, int a4, char a5, __int16 *a6)
{
  char v6; // cl
  int v7; // ebx
  int v8; // ebp
  int v9; // edi
  int v10; // esi
  unsigned int v11; // eax
  int v12; // edx
  __int16 v13; // cx
  __int16 v14; // si
  int v15; // ecx
  char v16; // cl
  int v17; // esi
  unsigned __int16 v19; // [esp+10h] [ebp-8h]
  int v20; // [esp+14h] [ebp-4h]

  v6 = a5; /*0xffc5671f*/
  v7 = a3; /*0xffc56724*/
  v8 = a4; /*0xffc56729*/
  v9 = a1; /*0xffc5672f*/
  v10 = 48704 * (unsigned __int8)a2 + a1 + 258689; /*0xffc56742*/
  v20 = v10; /*0xffc5674b*/
  v19 = *(unsigned __int8 *)(a1 + 244281); /*0xffc5674f*/
  if ( (a5 & 1) != 0 ) /*0xffc56756*/
  {
    ProcCommonFuncDD01(a1, a2, a3, a4, 0x50F4D0Cu, &a1, 0, 0, 15); /*0xffc5676c*/
    v11 = a1; /*0xffc56771*/
    v6 = a5; /*0xffc56778*/
  }
  else
  {
    v11 = *(_DWORD *)(7688 * (unsigned __int8)a3 + v10 + 3247); /*0xffc56787*/
  }
  v12 = (v11 >> 21) & 0x7F; /*0xffc56793*/
  if ( (v6 & 2) != 0 ) /*0xffc56799*/
  {
    *a6 = v12; /*0xffc5679f*/
LABEL_17:
    v16 = a5; /*0xffc56878*/
    goto LABEL_18; /*0xffc56878*/
  }
  if ( (v6 & 4) != 0 ) /*0xffc567ae*/
    v13 = v12 + *a6; /*0xffc567b6*/
  else
    v13 = *a6; /*0xffc567bb*/
  if ( v13 <= 0 ) /*0xffc567c1*/
    v14 = 0; /*0xffc567c8*/
  else
    v14 = v13; /*0xffc567c3*/
  if ( v14 > (int)v19 ) /*0xffc567d6*/
    v14 = v19; /*0xffc567dc*/
  v15 = v14; /*0xffc567df*/
  v10 = v20; /*0xffc567e2*/
  v11 ^= (v11 ^ (v15 << 21)) & 0xFE00000; /*0xffc567f1*/
  a1 = v11; /*0xffc567fc*/
  if ( *(_DWORD *)(7688 * (unsigned __int8)v7 + v20 + 3247) != v11 || (v16 = a5, (a5 & 8) != 0) ) /*0xffc56810*/
  {
    v17 = a2; /*0xffc56812*/
    ProcCommonFuncDD01(v9, a2, v7, v8, 0x50F4D0Cu, &a1, 0, 1, 15); /*0xffc5682a*/
    ProcCommonFuncDD01(v9, v17, v7, v8, 0x50F4F0Cu, &a1, 0, 1, 15); /*0xffc56843*/
    ProcCommonFuncDD01(v9, v17, v7, v8, 0x50F4E0Cu, &a1, 0, 1, 15); /*0xffc5685f*/
    ProcCommonFunc2441(v9, v17, v7, v8); /*0xffc56868*/
    v11 = a1; /*0xffc5686d*/
    v10 = v20; /*0xffc56874*/
    goto LABEL_17; /*0xffc56874*/
  }
LABEL_18:
  if ( (v16 & 0x10) != 0 ) /*0xffc5687f*/
    *(_DWORD *)(7688 * (unsigned __int8)v7 + v10 + 3247) = v11; /*0xffc5688a*/
  return 0; /*0xffc56891*/
}

// Function: MailBoxFunc689A @ 0xffc5689a (0x13c bytes)
// Index: 689/2560

int __cdecl MailBoxFunc689A(int a1, int a2, int a3, int a4, char a5, __int16 *a6)
{
  char v6; // cl
  int v7; // ebx
  int v8; // edi
  int v9; // ebp
  unsigned int v10; // eax
  __int16 v11; // dx
  char v12; // cl
  __int16 v13; // cx
  __int16 v14; // si
  int v15; // esi
  unsigned __int16 v17; // [esp+Ch] [ebp-4h]

  v6 = a5; /*0xffc5689f*/
  v7 = a3; /*0xffc568a4*/
  v8 = a1; /*0xffc568b3*/
  v9 = a1 + 48704 * (unsigned __int8)a2; /*0xffc568b7*/
  v17 = *(unsigned __int8 *)(a1 + 244280); /*0xffc568c0*/
  if ( (a5 & 1) != 0 ) /*0xffc568c7*/
  {
    ProcCommonFuncDD01(a1, a2, a3, a4, 0x50E4130u, &a1, 0, 0, 15); /*0xffc568e0*/
    v10 = a1; /*0xffc568e5*/
    v6 = a5; /*0xffc568ec*/
  }
  else
  {
    v10 = *(_DWORD *)(7688 * (unsigned __int8)a3 + v9 + 261940); /*0xffc568fb*/
  }
  v11 = (unsigned __int8)v10 >> 1; /*0xffc56906*/
  if ( (v6 & 2) != 0 ) /*0xffc5690c*/
  {
    *a6 = v11; /*0xffc56912*/
    v12 = a5; /*0xffc56915*/
  }
  else
  {
    if ( (v6 & 4) != 0 ) /*0xffc56925*/
      v13 = v11 + *a6; /*0xffc5692d*/
    else
      v13 = *a6; /*0xffc56932*/
    if ( v13 <= 0 ) /*0xffc56939*/
      v14 = 0; /*0xffc56940*/
    else
      v14 = v13; /*0xffc5693b*/
    if ( v14 > (int)v17 ) /*0xffc5694e*/
      LOBYTE(v14) = v17; /*0xffc56954*/
    v10 = (2 * (v14 & 0x7F)) | v10 & 0xFFFFFF00; /*0xffc5696a*/
    a1 = v10; /*0xffc5696c*/
    if ( *(_DWORD *)(7688 * (unsigned __int8)v7 + v9 + 261940) != v10 || (v12 = a5, (a5 & 8) != 0) ) /*0xffc56980*/
    {
      v15 = a2; /*0xffc56982*/
      ProcCommonFuncDD01(v8, a2, v7, a4, 0x50E4130u, &a1, 0, 1, 15); /*0xffc5699d*/
      ProcCommonFunc2441(v8, v15, v7, a4); /*0xffc569a9*/
      v10 = a1; /*0xffc569ae*/
      v12 = a5; /*0xffc569b5*/
    }
  }
  if ( (v12 & 0x10) != 0 ) /*0xffc569bd*/
    *(_DWORD *)(7688 * (unsigned __int8)v7 + v9 + 261940) = v10; /*0xffc569c8*/
  return 0; /*0xffc569cf*/
}

// Function: MailBoxFunc69D6 @ 0xffc569d6 (0x1bd bytes)
// Index: 690/2560

int __cdecl MailBoxFunc69D6(unsigned __int8 *a1, unsigned __int8 a2, int a3, char a4, __int16 *a5)
{
  int v7; // ebp
  unsigned __int16 v8; // ax
  char v9; // al
  unsigned int v10; // esi
  unsigned int v11; // ebp
  unsigned int v12; // eax
  unsigned int v13; // ecx
  __int16 v14; // cx
  int v15; // ebp
  __int16 v16; // ax
  __int16 v17; // dx
  unsigned int v18; // ebp
  int v19; // edx
  unsigned int v20; // esi
  char v21; // al
  char v22; // al
  int v24; // [esp-4h] [ebp-14h]
  int v25; // [esp+14h] [ebp+4h]
  unsigned __int16 v26; // [esp+18h] [ebp+8h]

  v7 = (int)&a1[48704 * a2 + 258689]; /*0xffc569f1*/
  v8 = a1[244280]; /*0xffc569f8*/
  v25 = v7; /*0xffc569ff*/
  v26 = v8; /*0xffc56a03*/
  if ( (a4 & 1) != 0 ) /*0xffc56a07*/
  {
    v9 = DdrTrainFunc45AB(a1, a2, a3, 134303536); /*0xffc56a14*/
    v10 = MiscConfigCheck(a1, a2, a1[9475] * v9, v24); /*0xffc56a37*/
  }
  else
  {
    v10 = *(_DWORD *)(29 * (unsigned __int8)DdrTrainFunc45AB(a1, a2, a3) + v7 + 46186); /*0xffc56a4f*/
  }
  v11 = (unsigned __int8)a3 % 3u; /*0xffc56a64*/
  if ( v11 ) /*0xffc56a6b*/
  {
    if ( v11 == 1 ) /*0xffc56a70*/
    {
      v13 = v10 >> 17; /*0xffc56a7b*/
      goto LABEL_10; /*0xffc56a7e*/
    }
    v12 = v10 >> 9; /*0xffc56a74*/
  }
  else
  {
    v12 = v10 >> 1; /*0xffc56a82*/
  }
  LOBYTE(v13) = v12; /*0xffc56a84*/
LABEL_10:
  v14 = v13 & 0x7F; /*0xffc56a87*/
  if ( (a4 & 2) != 0 ) /*0xffc56a90*/
  {
    v15 = v25; /*0xffc56a96*/
    *a5 = v14; /*0xffc56a9a*/
LABEL_30:
    v21 = a4; /*0xffc56b69*/
    goto LABEL_31; /*0xffc56b69*/
  }
  if ( (a4 & 4) != 0 ) /*0xffc56aa8*/
    v16 = v14 + *a5; /*0xffc56ab0*/
  else
    v16 = *a5; /*0xffc56ab5*/
  if ( v16 <= 0 ) /*0xffc56abb*/
    v17 = 0; /*0xffc56ac2*/
  else
    v17 = v16; /*0xffc56abd*/
  if ( v17 > (int)v26 ) /*0xffc56ad0*/
    LOBYTE(v17) = v26; /*0xffc56ad6*/
  if ( !v11 ) /*0xffc56adc*/
  {
    v19 = 2 * (v17 & 0x7F); /*0xffc56b07*/
    v20 = v10 & 0xFFFFFF00; /*0xffc56b09*/
    goto LABEL_26; /*0xffc56b09*/
  }
  v18 = v11 - 1; /*0xffc56ade*/
  if ( !v18 ) /*0xffc56ae1*/
  {
    v19 = (v17 & 0x7F) << 17; /*0xffc56af9*/
    v20 = v10 & 0xFF00FFFF; /*0xffc56afc*/
    goto LABEL_26; /*0xffc56b02*/
  }
  if ( v18 == 1 ) /*0xffc56ae6*/
  {
    v19 = (v17 & 0x7F) << 9; /*0xffc56aeb*/
    v20 = v10 & 0xFFFF00FF; /*0xffc56aee*/
LABEL_26:
    v10 = v19 | v20; /*0xffc56b0f*/
  }
  v15 = v25; /*0xffc56b11*/
  if ( *(_DWORD *)(29 * (unsigned __int8)DdrTrainFunc45AB(a1, a2, a3) + v25 + 46186) != v10 || (v21 = a4, (a4 & 8) != 0) ) /*0xffc56b38*/
  {
    v22 = DdrTrainFunc45AB(a1, a2, a3); /*0xffc56b46*/
    MiscIoCheck(a1, a2, (unsigned __int8)(a1[9475] * v22), 0x8014F30u, v10); /*0xffc56b61*/
    goto LABEL_30; /*0xffc56b61*/
  }
LABEL_31:
  if ( (v21 & 0x10) != 0 ) /*0xffc56b6f*/
    *(_DWORD *)(29 * (unsigned __int8)DdrTrainFunc45AB(a1, a2, a3) + v15 + 46186) = v10; /*0xffc56b85*/
  return 0; /*0xffc56b8c*/
}

// Function: MailBoxFunc6B93 @ 0xffc56b93 (0x162 bytes)
// Index: 691/2560

int __cdecl MailBoxFunc6B93(
        unsigned __int8 *__return_address,
        int n4,
        int n6,
        int a4,
        char a5,
        _WORD *a6,
        _WORD *a7,
        _WORD *a8)
{
  int n6_1; // ebx
  unsigned __int8 *__return_address_1; // ebp
  unsigned __int8 *v10; // edi
  unsigned int __return_address_2; // eax
  _WORD *v12; // esi
  char v13; // cl
  __int16 v14; // dx
  __int16 n0x7F; // cx
  int n4_1; // edi
  unsigned __int8 *v18; // [esp+10h] [ebp-4h]

  n6_1 = n6; /*0xffc56b99*/
  __return_address_1 = __return_address; /*0xffc56b9e*/
  v10 = &__return_address[48704 * (unsigned __int8)n4 + 258689]; /*0xffc56bb3*/
  v18 = v10; /*0xffc56bba*/
  if ( (a5 & 1) != 0 ) /*0xffc56bbe*/
  {
    ProcCommonFuncDD01(__return_address, n4, n6, a4, 0x50F4C08u, (int *)&__return_address, 0, 0, 15); /*0xffc56bd7*/
    __return_address_2 = (unsigned int)__return_address; /*0xffc56bdc*/
  }
  else
  {
    __return_address_2 = *(_DWORD *)&v10[7688 * (unsigned __int8)n6 + 3255]; /*0xffc56bee*/
  }
  v12 = a6; /*0xffc56bf5*/
  v13 = a5; /*0xffc56c13*/
  v14 = (__return_address_2 & 0x3F) + (((__return_address_2 >> 6) & 3) << 6); /*0xffc56c17*/
  if ( (a5 & 2) != 0 ) /*0xffc56c1d*/
  {
    *a6 = v14; /*0xffc56c1f*/
  }
  else
  {
    if ( (a5 & 4) != 0 ) /*0xffc56c2a*/
      n0x7F = v14 + *a6; /*0xffc56c32*/
    else
      n0x7F = *a6; /*0xffc56c37*/
    if ( n0x7F <= 0 ) /*0xffc56c3d*/
      n0x7F = 0; /*0xffc56c44*/
    if ( (unsigned __int16)n0x7F > 0x7Fu ) /*0xffc56c4c*/
      LOBYTE(n0x7F) = 127; /*0xffc56c4e*/
    __return_address_2 = n0x7F & 0x3F | ((unsigned __int8)n0x7F >> 6 << 6) | __return_address_2 & 0xFFFFFF00; /*0xffc56c71*/
    __return_address = (unsigned __int8 *)__return_address_2; /*0xffc56c73*/
    if ( *(_DWORD *)&v10[7688 * (unsigned __int8)n6_1 + 3255] != __return_address_2 || (v13 = a5, (a5 & 8) != 0) ) /*0xffc56c87*/
    {
      n4_1 = n4; /*0xffc56c89*/
      ProcCommonFuncDD01(__return_address_1, n4, n6_1, a4, 0x50F4C08u, (int *)&__return_address, 0, 1, 15); /*0xffc56ca4*/
      ProcCommonFunc2441((int)__return_address_1, n4_1, n6_1, a4); /*0xffc56cb0*/
      __return_address_2 = (unsigned int)__return_address; /*0xffc56cb5*/
      v13 = a5; /*0xffc56cbc*/
      v10 = v18; /*0xffc56cc0*/
    }
  }
  if ( (v13 & 0x10) != 0 ) /*0xffc56cc7*/
    *(_DWORD *)&v10[7688 * (unsigned __int8)n6_1 + 3255] = __return_address_2; /*0xffc56cd2*/
  *a7 = *v12; /*0xffc56ce1*/
  *a8 = *v12; /*0xffc56ced*/
  return 0; /*0xffc56ce0*/
}

// Function: MailBoxFunc6CF5 @ 0xffc56cf5 (0x135 bytes)
// Index: 692/2560

int __cdecl MailBoxFunc6CF5(
        unsigned __int8 *a1,
        unsigned __int8 a2,
        int a3,
        int n45,
        char a5,
        __int16 *a6,
        unsigned __int16 *a7,
        unsigned __int16 *a8)
{
  int n45_1; // ebx
  int v9; // ebp
  unsigned __int8 n45_3; // al
  unsigned __int8 *v11; // esi
  unsigned __int8 n4; // al
  int n4_1; // ebx
  int n45_2; // [esp+10h] [ebp-4h]

  n45_1 = n45; /*0xffc56cf8*/
  v9 = 0; /*0xffc56d02*/
  n45_3 = n45 + 1; /*0xffc56d04*/
  if ( !a1[257313] && (n45 == 45 || n45 == 47) ) /*0xffc56d18*/
    n45_3 = n45 + 2; /*0xffc56d1a*/
  n45_2 = n45_3; /*0xffc56d1f*/
  if ( n45 < n45_3 )
  {
    do
    {
      if ( n45_1 != 44 )
      {
        switch ( n45_1 ) /*0xffc56d36*/
        {
          case '-': /*0xffc56d36*/
            n4 = 4; /*0xffc56e1e*/
            v11 = (unsigned __int8 *)&unk_FFD52398; /*0xffc56e20*/
            goto LABEL_13; /*0xffc56e25*/
          case '.': /*0xffc56d36*/
            n4 = 2; /*0xffc56e12*/
            v11 = (unsigned __int8 *)&unk_FFD523A0; /*0xffc56e14*/
            goto LABEL_13; /*0xffc56e19*/
          case '/': /*0xffc56d36*/
            n4 = 3; /*0xffc56e06*/
            v11 = (unsigned __int8 *)&unk_FFD523A4; /*0xffc56e08*/
            goto LABEL_13; /*0xffc56e0d*/
          case '0': /*0xffc56d36*/
            n4 = 2; /*0xffc56dfd*/
            v11 = (unsigned __int8 *)&unk_FFD523AC; /*0xffc56dff*/
            goto LABEL_13; /*0xffc56e04*/
        }
        AssertPrint(
          a1,
          255,
          (int)"\n\nRC_ASSERT! %s: %u   %s ",
          "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Mem\\MemCmdControl.c",
          427,
          "FALSE");
        ProcMemInitCheck((int)a1, 242, 37); /*0xffc56d7e*/
      }
      v11 = (unsigned __int8 *)&unk_FFD523B0; /*0xffc56d86*/
      n4 = 11; /*0xffc56d8b*/
LABEL_13:
      if ( !v9 ) /*0xffc56d8f*/
      {
        n4_1 = n4; /*0xffc56d91*/
        do /*0xffc56ddf*/
        {
          v9 = MailBoxFunc5F13(a1, a2, a3, *v11, v11[1], a5, a6); /*0xffc56dc3*/
          MailBoxFunc8CAD(*a6, a7, a8); /*0xffc56dd1*/
          v11 += 2; /*0xffc56dd9*/
          --n4_1; /*0xffc56ddc*/
        }
        while ( n4_1 ); /*0xffc56ddf*/
        n45_1 = n45; /*0xffc56de1*/
      }
      n45 = ++n45_1; /*0xffc56de6*/
    }
    while ( n45_1 < n45_2 );
  }
  return v9; /*0xffc56df5*/
}

// Function: MailBoxFunc6E2A @ 0xffc56e2a (0x124 bytes)
// Index: 693/2560

int __cdecl MailBoxFunc6E2A(unsigned __int8 *__return_address, unsigned __int8 n4, int n6, char n2, __int16 *p_p_n60)
{
  int SocketInfo; // ebp
  unsigned int v6; // esi
  int v7; // ecx
  __int16 p_n60; // dx
  __int16 p_n60_1; // [esp+10h] [ebp-Ch] BYREF
  __int16 p_n60_2; // [esp+14h] [ebp-8h] BYREF
  __int16 i; // [esp+18h] [ebp-4h] BYREF

  SocketInfo = GetSocketInfo((int)__return_address, n4); /*0xffc56e3f*/
  ProcCommonFuncD52D((int)__return_address, 0, 61, &p_n60_1, &p_n60_2, &i); /*0xffc56e55*/
  if ( (n2 & 1) != 0 ) /*0xffc56e66*/
    v6 = MiscConfigCheck(__return_address, n4, n6, 134302224); /*0xffc56e7b*/
  else
    v6 = *(_DWORD *)(7688 * (unsigned __int8)n6 + SocketInfo + 303); /*0xffc56e88*/
  v7 = (v6 >> 21) & 0x7F; /*0xffc56e98*/
  if ( (n2 & 2) != 0 ) /*0xffc56e9d*/
  {
    *p_p_n60 = v7; /*0xffc56ea3*/
  }
  else
  {
    if ( (n2 & 4) != 0 ) /*0xffc56eb1*/
    {
      p_n60 = v7 + *p_p_n60; /*0xffc56eb9*/
      if ( p_n60 < (int)(unsigned __int16)p_n60_1 ) /*0xffc56ec6*/
        p_n60 = p_n60_1; /*0xffc56ec8*/
      if ( p_n60 > (int)(unsigned __int16)p_n60_2 ) /*0xffc56ed7*/
        p_n60 = p_n60_2; /*0xffc56ed9*/
    }
    else
    {
      p_n60 = *p_p_n60; /*0xffc56ee0*/
    }
    v6 ^= (v6 ^ (p_n60 << 21)) & 0xFE00000; /*0xffc56ef0*/
    if ( v6 != *(_DWORD *)(7688 * (unsigned __int8)n6 + SocketInfo + 303) || (n2 & 8) != 0 ) /*0xffc56f09*/
      MiscIoCheck(__return_address, n4, n6, 0x8014A10u, v6); /*0xffc56f17*/
    KtiFunc8C4((int)__return_address, (unsigned __int16)i); /*0xffc56f26*/
  }
  if ( (n2 & 0x10) != 0 ) /*0xffc56f32*/
    *(_DWORD *)(7688 * (unsigned __int8)n6 + SocketInfo + 303) = v6; /*0xffc56f3d*/
  return 0; /*0xffc56f44*/
}

// Function: MailBoxFunc6F4E @ 0xffc56f4e (0x3d bytes)
// Index: 694/2560

int __cdecl MailBoxFunc6F4E(unsigned __int8 *n6, unsigned __int8 a2, int a3, int a4, int a5, char a6, __int16 *a7)
{
  int result; // eax
  int v8; // [esp+0h] [ebp-10h] BYREF
  char v9; // [esp+8h] [ebp-8h]
  char v10; // [esp+9h] [ebp-7h]

  result = MailBoxFunc8C37(n6, a5, &v8); /*0xffc56f5e*/
  if ( !result ) /*0xffc56f68*/
    return MailBoxFunc5F13(n6, a2, a3, v9, v10, a6, a7); /*0xffc56f7f*/
  return result; /*0xffc56f87*/
}

// Function: MailBoxFunc6F8B @ 0xffc56f8b (0x244 bytes)
// Index: 695/2560

_BYTE *__cdecl MailBoxFunc6F8B(int a1, _BYTE *a2)
{
  char *RAS_N; // [esp-4h] [ebp-8h]

  switch ( a1 ) /*0xffc56f9b*/
  {
    case 0: /*0xffc56f9b*/
      RAS_N = "RAS_N"; /*0xffc56fb6*/
      break; /*0xffc56fbb*/
    case 1: /*0xffc56f9b*/
      RAS_N = "CAS_N"; /*0xffc56fc0*/
      break; /*0xffc56fc5*/
    case 2: /*0xffc56f9b*/
      RAS_N = "WE_N"; /*0xffc56fca*/
      break; /*0xffc56fcf*/
    case 3: /*0xffc56f9b*/
      RAS_N = "BA0"; /*0xffc56fd4*/
      break; /*0xffc56fd9*/
    case 4: /*0xffc56f9b*/
      RAS_N = "BA1"; /*0xffc56fde*/
      break; /*0xffc56fe3*/
    case 5: /*0xffc56f9b*/
      RAS_N = "BA2"; /*0xffc56fe8*/
      break; /*0xffc56fed*/
    case 6: /*0xffc56f9b*/
      RAS_N = "A0"; /*0xffc57006*/
      break; /*0xffc5700b*/
    case 7: /*0xffc56f9b*/
      RAS_N = "A1"; /*0xffc57010*/
      break; /*0xffc57015*/
    case 8: /*0xffc56f9b*/
      RAS_N = "A2"; /*0xffc5701a*/
      break; /*0xffc5701f*/
    case 9: /*0xffc56f9b*/
      RAS_N = "A3"; /*0xffc57024*/
      break; /*0xffc57029*/
    case 10: /*0xffc56f9b*/
      RAS_N = "A4"; /*0xffc5702e*/
      break; /*0xffc57033*/
    case 11: /*0xffc56f9b*/
      RAS_N = "A5"; /*0xffc57038*/
      break; /*0xffc5703d*/
    case 12: /*0xffc56f9b*/
      RAS_N = "A6"; /*0xffc57042*/
      break; /*0xffc57047*/
    case 13: /*0xffc56f9b*/
      RAS_N = "A7"; /*0xffc5704c*/
      break; /*0xffc57051*/
    case 14: /*0xffc56f9b*/
      RAS_N = "A8"; /*0xffc57056*/
      break; /*0xffc5705b*/
    case 15: /*0xffc56f9b*/
      RAS_N = "A9"; /*0xffc57060*/
      break; /*0xffc57065*/
    case 16: /*0xffc56f9b*/
      RAS_N = "A10"; /*0xffc5706a*/
      break; /*0xffc5706f*/
    case 17: /*0xffc56f9b*/
      RAS_N = "A11"; /*0xffc57074*/
      break; /*0xffc57079*/
    case 18: /*0xffc56f9b*/
      RAS_N = "A12"; /*0xffc5707e*/
      break; /*0xffc57083*/
    case 19: /*0xffc56f9b*/
      RAS_N = "A13"; /*0xffc57088*/
      break; /*0xffc5708d*/
    case 20: /*0xffc56f9b*/
      RAS_N = "A14"; /*0xffc57092*/
      break; /*0xffc57097*/
    case 21: /*0xffc56f9b*/
      RAS_N = "A15"; /*0xffc5709c*/
      break; /*0xffc570a1*/
    case 22: /*0xffc56f9b*/
      RAS_N = "A16"; /*0xffc570a6*/
      break; /*0xffc570ab*/
    case 23: /*0xffc56f9b*/
      RAS_N = "A17"; /*0xffc570b0*/
      break; /*0xffc570b5*/
    case 24: /*0xffc56f9b*/
      RAS_N = "CS0_N"; /*0xffc570ba*/
      break; /*0xffc570bf*/
    case 25: /*0xffc56f9b*/
      RAS_N = "CS1_N"; /*0xffc570c4*/
      break; /*0xffc570c9*/
    case 26: /*0xffc56f9b*/
      RAS_N = "CS2_N/C0"; /*0xffc570ce*/
      break; /*0xffc570d3*/
    case 27: /*0xffc56f9b*/
      RAS_N = "CS3_N/C1"; /*0xffc570d8*/
      break; /*0xffc570dd*/
    case 28: /*0xffc56f9b*/
      RAS_N = "CS4_N"; /*0xffc570e2*/
      break; /*0xffc570e7*/
    case 29: /*0xffc56f9b*/
      RAS_N = "CS5_N"; /*0xffc570ec*/
      break; /*0xffc570f1*/
    case 30: /*0xffc56f9b*/
      RAS_N = "CS6_N/C0"; /*0xffc570f6*/
      break; /*0xffc570fb*/
    case 31: /*0xffc56f9b*/
      RAS_N = "CS7_N/C1"; /*0xffc57100*/
      break; /*0xffc57105*/
    case 32: /*0xffc56f9b*/
      RAS_N = "CS8_N"; /*0xffc5710a*/
      break; /*0xffc5710f*/
    case 33: /*0xffc56f9b*/
      RAS_N = "CS9_N"; /*0xffc57114*/
      break; /*0xffc57119*/
    case 34: /*0xffc56f9b*/
      RAS_N = "CKE0"; /*0xffc5711e*/
      break; /*0xffc57123*/
    case 35: /*0xffc56f9b*/
      RAS_N = "CKE1"; /*0xffc57128*/
      break; /*0xffc5712d*/
    case 36: /*0xffc56f9b*/
      RAS_N = "CKE2"; /*0xffc57132*/
      break; /*0xffc57137*/
    case 37: /*0xffc56f9b*/
      RAS_N = "CKE3"; /*0xffc5713c*/
      break; /*0xffc57141*/
    case 38: /*0xffc56f9b*/
      RAS_N = "CKE4"; /*0xffc57143*/
      break; /*0xffc57148*/
    case 39: /*0xffc56f9b*/
      RAS_N = "CKE5"; /*0xffc5714a*/
      break; /*0xffc5714f*/
    case 40: /*0xffc56f9b*/
      RAS_N = "ODT0"; /*0xffc57151*/
      break; /*0xffc57156*/
    case 41: /*0xffc56f9b*/
      RAS_N = "ODT1"; /*0xffc57158*/
      break; /*0xffc5715d*/
    case 42: /*0xffc56f9b*/
      RAS_N = "ODT2"; /*0xffc5715f*/
      break; /*0xffc57164*/
    case 43: /*0xffc56f9b*/
      RAS_N = "ODT3"; /*0xffc57166*/
      break; /*0xffc5716b*/
    case 44: /*0xffc56f9b*/
      RAS_N = "ODT4"; /*0xffc5716d*/
      break; /*0xffc57172*/
    case 45: /*0xffc56f9b*/
      RAS_N = "ODT5"; /*0xffc57174*/
      break; /*0xffc57179*/
    case 46: /*0xffc56f9b*/
      RAS_N = "PAR"; /*0xffc56fa2*/
      break; /*0xffc56fa7*/
    case 48: /*0xffc56f9b*/
      RAS_N = "BG0"; /*0xffc56ff2*/
      break; /*0xffc56ff7*/
    case 49: /*0xffc56f9b*/
      RAS_N = "BG1"; /*0xffc56ffc*/
      break; /*0xffc57001*/
    case 50: /*0xffc56f9b*/
      RAS_N = "ACT_N"; /*0xffc56fac*/
      break; /*0xffc56fb1*/
    case 51: /*0xffc56f9b*/
      RAS_N = "C0"; /*0xffc571a5*/
      break; /*0xffc571aa*/
    case 52: /*0xffc56f9b*/
      RAS_N = "C1"; /*0xffc571ac*/
      break; /*0xffc571b1*/
    case 53: /*0xffc56f9b*/
      RAS_N = "C2"; /*0xffc571b3*/
      break; /*0xffc571b8*/
    case 54: /*0xffc56f9b*/
      RAS_N = "CK0"; /*0xffc5717b*/
      break; /*0xffc57180*/
    case 55: /*0xffc56f9b*/
      RAS_N = "CK1"; /*0xffc57182*/
      break; /*0xffc57187*/
    case 56: /*0xffc56f9b*/
      RAS_N = "CK2"; /*0xffc57189*/
      break; /*0xffc5718e*/
    case 57: /*0xffc56f9b*/
      RAS_N = "CK3"; /*0xffc57190*/
      break; /*0xffc57195*/
    case 58: /*0xffc56f9b*/
      RAS_N = "CK4"; /*0xffc57197*/
      break; /*0xffc5719c*/
    case 59: /*0xffc56f9b*/
      RAS_N = "CK5"; /*0xffc5719e*/
      break; /*0xffc571a3*/
    default:
      RAS_N = "Unknown signal"; /*0xffc571ba*/
      break; /*0xffc571ba*/
  }
  RmtFunc8B50(a2, RAS_N); /*0xffc571c3*/
  return a2; /*0xffc571cc*/
}

// Function: MailBoxFunc72BF @ 0xffc572bf (0xb6 bytes)
// Index: 696/2560

_BYTE *__cdecl MailBoxFunc72BF(unsigned __int8 *__return_address, int n4, int n6, char n2)
{
  _BYTE *result; // eax
  unsigned __int8 n2_2; // bl
  _BYTE *v6; // edi
  int n6_1; // esi
  int n2_1; // [esp+10h] [ebp-4h]

  result = (_BYTE *)GetCpuCount((int)__return_address, n4, n6); /*0xffc572d1*/
  n2_2 = 0; /*0xffc572dd*/
  v6 = result; /*0xffc572df*/
  LOBYTE(n2_1) = 0; /*0xffc572e1*/
  do /*0xffc57369*/
  {
    if ( *v6 && v6[107] && n2 != 1 && n2 != 3 ) /*0xffc572f8*/
    {
      n6_1 = ProcCommonFuncE35E((int)__return_address, n4, n6, n2_1, 0x50C4198u) | 0x3000; /*0xffc57313*/
      ProcCommonFuncF4C7(__return_address, n4, n6, n2_1, 84689304, n6_1); /*0xffc5732c*/
      KtiFunc8C4((int)__return_address, 0xAu); /*0xffc57334*/
      result = (_BYTE *)ProcCommonFuncF4C7(__return_address, n4, n6, n2_1, 84689304, n6_1 & 0x7FFFFFFF); /*0xffc57352*/
    }
    ++n2_2; /*0xffc5735a*/
    v6 += 1379; /*0xffc5735c*/
    LOBYTE(n2_1) = n2_2; /*0xffc57362*/
  }
  while ( n2_2 < 2u ); /*0xffc57369*/
  return result; /*0xffc5736f*/
}

// Function: MailBoxFunc7375 @ 0xffc57375 (0x131 bytes)
// Index: 697/2560

unsigned __int8 __cdecl MailBoxFunc7375(unsigned __int8 *__return_address, int n4, int n6, char n2)
{
  _BYTE *CpuCount; // ebp
  unsigned __int8 n2_2; // al
  unsigned int n6_1; // esi
  int n6_2; // edi
  int n2_1; // [esp+10h] [ebp-4h]

  CpuCount = (_BYTE *)GetCpuCount((int)__return_address, n4, n6); /*0xffc5738e*/
  n2_2 = 0; /*0xffc57390*/
  LOBYTE(n2_1) = 0; /*0xffc57392*/
  do /*0xffc5749a*/
  {
    if ( *CpuCount && CpuCount[107] && n2 != 1 && n2 != 3 ) /*0xffc573ba*/
    {
      n6_1 = ProcCommonFuncE35E((int)__return_address, n4, n6, n2_1, 0x50C4198u) & 0xFFFFCFFF; /*0xffc573f4*/
      n6_2 = ProcCommonFuncE35E((int)__return_address, n4, n6, n2_1, 0x50C4188u); /*0xffc573fa*/
      ProcCommonFuncF4C7(__return_address, n4, n6, n2_1, 84689304, n6_1); /*0xffc5740f*/
      KtiFunc8C4((int)__return_address, 2u); /*0xffc5741d*/
      ProcCommonFuncF4C7(__return_address, n4, n6, n2_1, 84689304, n6_1 | 0x80000000); /*0xffc5743b*/
      n6_2 |= 0x40000000u; /*0xffc57440*/
      ProcCommonFuncF4C7(__return_address, n4, n6, n2_1, 84689288, n6_2); /*0xffc5745a*/
      KtiFunc8C4((int)__return_address, 2u); /*0xffc57465*/
      ProcCommonFuncF4C7(__return_address, n4, n6, n2_1, 84689288, n6_2 & 0xBFFFFFFF); /*0xffc57482*/
      n2_2 = n2_1; /*0xffc5748a*/
    }
    ++n2_2; /*0xffc5748c*/
    CpuCount += 1379; /*0xffc5748e*/
    LOBYTE(n2_1) = n2_2; /*0xffc57494*/
  }
  while ( n2_2 < 2u ); /*0xffc5749a*/
  return n2_2; /*0xffc574a0*/
}

// Function: MailBoxFunc74A6 @ 0xffc574a6 (0x234 bytes)
// Index: 698/2560

int __cdecl MailBoxFunc74A6(unsigned __int8 *n6, int n4, int n6a, unsigned __int16 n26, _DWORD *a5)
{
  unsigned __int8 *n6_1; // ebx
  int n4_1; // ebp
  int result; // eax
  unsigned __int8 n2_1; // cl
  _WORD *v9; // edi
  __int16 n63; // si
  unsigned __int8 n26_1; // dl
  int v12; // ebx
  int v13; // eax
  __int16 n63_1; // ax
  int v15; // eax
  __int16 v16; // ax
  int n2; // [esp+10h] [ebp-24h]
  unsigned __int8 i; // [esp+14h] [ebp-20h]
  int v19; // [esp+18h] [ebp-1Ch]
  int p_n64; // [esp+1Ch] [ebp-18h] BYREF
  unsigned __int16 v21[2]; // [esp+20h] [ebp-14h] BYREF
  unsigned __int16 v22[2]; // [esp+24h] [ebp-10h] BYREF
  __int16 v23[2]; // [esp+28h] [ebp-Ch] BYREF
  _WORD *v24; // [esp+2Ch] [ebp-8h]
  int v25; // [esp+30h] [ebp-4h]

  *(_DWORD *)v21 = 0; /*0xffc574ad*/
  n6_1 = n6; /*0xffc574b3*/
  n4_1 = n4; /*0xffc574b8*/
  *(_DWORD *)v22 = 255; /*0xffc574c1*/
  result = GetCpuCount((int)n6, n4, n6a); /*0xffc574c9*/
  n2_1 = 0; /*0xffc574d1*/
  LOBYTE(n2) = 0; /*0xffc574d3*/
  v9 = (_WORD *)(result + 1255); /*0xffc574d7*/
  v24 = (_WORD *)(result + 1255); /*0xffc574dd*/
  do /*0xffc576cc*/
  {
    if ( *((_BYTE *)v9 - 1255) && n6_1[257313] != 1 && *((_BYTE *)v9 - 1148) != 1 && *((_BYTE *)v9 - 1224) ) /*0xffc57508*/
    {
      v19 = 0; /*0xffc57515*/
      n63 = 63; /*0xffc5751c*/
      v25 = KtiFunc91AF((int)n6_1, n4_1, n6a, n2); /*0xffc5752f*/
      for ( i = 0; i < *((_BYTE *)v9 - 1236); ++i ) /*0xffc57533*/
      {
        if ( !KtiFunc89E9((int)n6_1, n4_1, n6a, n2, i, 0) ) /*0xffc57555*/
        {
          n26_1 = 0; /*0xffc57563*/
          if ( n26 ) /*0xffc5756a*/
          {
            v12 = v19; /*0xffc57575*/
            do /*0xffc575be*/
            {
              v13 = 26 * (*(unsigned __int8 *)(242 * i + v25 + 1) + 8 * (unsigned __int8)n6a) + n26_1; /*0xffc5759a*/
              if ( (__int16)v12 < SLOWORD(a5[2 * v13 + 1]) ) /*0xffc575a4*/
                v12 = LOWORD(a5[2 * v13 + 1]); /*0xffc575a6*/
              n63_1 = HIWORD(a5[2 * v13 + 1]); /*0xffc575a8*/
              if ( n63 > n63_1 ) /*0xffc575b0*/
                n63 = n63_1; /*0xffc575b2*/
              ++n26_1; /*0xffc575b4*/
            }
            while ( n26_1 < n26 ); /*0xffc575be*/
            v9 = v24; /*0xffc575c0*/
            n4_1 = n4; /*0xffc575c4*/
            v19 = v12; /*0xffc575c8*/
            n6_1 = n6; /*0xffc575cc*/
          }
        }
      }
      v15 = (n63 + (__int16)v19 - 62) / 2; /*0xffc575fe*/
      *v9 = v15; /*0xffc57600*/
      DebugPrint( /*0xffc5761b*/
        (int)n6_1,
        2,
        n4_1,
        n6a,
        n2,
        255,
        255,
        255,
        "RCD QxCA Final Trained Value = %d, composite_le = %d, composite_re = %d\n",
        (__int16)v15,
        (__int16)v19,
        n63);
      v16 = *v9; /*0xffc57620*/
      if ( (__int16)*v9 >= 0 ) /*0xffc57629*/
      {
        p_n64 = 0; /*0xffc5763b*/
        *(_DWORD *)v23 = (unsigned __int16)*v9; /*0xffc57643*/
      }
      else
      {
        *(_DWORD *)v23 = 0; /*0xffc5762d*/
        p_n64 = (unsigned __int16)-v16; /*0xffc57635*/
      }
      ProcCommonFuncFBF1((int)n6_1); /*0xffc57648*/
      KtiFuncB990(n6_1, n4_1, n6a, n2, 1, 0, 24, (__int16 *)&p_n64); /*0xffc5765f*/
      KtiFuncBF1D(n6_1, n4_1, n6a, n2, 1, 44, 24, (__int16 *)&p_n64, v22, v21); /*0xffc57683*/
      KtiFuncBB42(n6_1, n4_1, n6a, n2, 1, 40, 24, v23, v22, v21); /*0xffc576a7*/
      result = ProcCommonFuncFBFD((int)n6_1); /*0xffc576ad*/
      n2_1 = n2; /*0xffc576b2*/
    }
    ++n2_1; /*0xffc576b9*/
    v9 = (_WORD *)((char *)v9 + 1379); /*0xffc576bb*/
    LOBYTE(n2) = n2_1; /*0xffc576c1*/
    v24 = v9; /*0xffc576c5*/
  }
  while ( n2_1 < 2u ); /*0xffc576cc*/
  return result; /*0xffc576d2*/
}

// Function: PciAccessInit @ 0xffc576da (0xdad bytes)
// Index: 699/2560

int __cdecl PciAccessInit(
        unsigned __int8 *n6,
        int n6_2,
        _BYTE *n6a,
        int a4,
        char n32,
        char n2,
        unsigned __int16 n27,
        _DWORD *a8)
{
  unsigned __int8 *n6_1; // ebp
  int n0xD_5; // ebx
  _BYTE *n6a_1; // esi
  unsigned __int8 *v11; // edi
  int v12; // eax
  int v13; // ecx
  unsigned __int8 *v14; // eax
  int v15; // edx
  unsigned __int8 v16; // cl
  const char *v17; // eax
  char *v18; // ecx
  unsigned __int8 n6_3; // al
  unsigned __int8 n0xD; // dl
  int n0xD_2; // esi
  int v22; // edx
  int v23; // ecx
  bool v24; // zf
  unsigned __int8 *v25; // edi
  unsigned __int8 v26; // cl
  int v27; // edi
  char *v28; // edx
  unsigned __int8 n6_5; // al
  unsigned __int8 v30; // cl
  int *v31; // eax
  int v32; // edi
  int n13_1; // ecx
  unsigned __int8 *v34; // edi
  unsigned __int8 v35; // dl
  int v36; // eax
  int v37; // ecx
  int v38; // ecx
  const char *v39; // eax
  bool v40; // cf
  unsigned __int8 *v41; // ed... [25600 chars total]

// Function: MailBoxFunc8487 @ 0xffc58487 (0x306 bytes)
// Index: 700/2560

int __cdecl MailBoxFunc8487(unsigned __int8 *n6, int a2, int a3, unsigned __int16 n0x10, int a5)
{
  unsigned __int8 n2; // bh
  unsigned __int8 *v6; // esi
  int v7; // edi
  unsigned __int8 v8; // bl
  unsigned __int8 n0x10_1; // cl
  int v10; // esi
  int v11; // eax
  int v12; // eax
  unsigned __int8 i; // bl
  int v14; // ecx
  int v15; // esi
  int v16; // edi
  __int16 v17; // dx
  int v18; // ecx
  const char *v19; // eax
  int *v20; // edi
  __int16 *buf_3; // esi
  int n24; // ebx
  int result; // eax
  int v24; // [esp-14h] [ebp-1C0h]
  int v25; // [esp-10h] [ebp-1BCh]
  int v26; // [esp-8h] [ebp-1B4h]
  int v27; // [esp-4h] [ebp-1B0h]
  unsigned __int8 n0x10_3; // [esp+13h] [ebp-199h]
  unsigned __int8 n2_1; // [esp+14h] [ebp-198h]
  int v30; // [esp+18h] [ebp-194h]
  int v31; // [esp+1Ch] [ebp-190h]
  unsigned __int8 v32; // [esp+20h] [ebp-18Ch]
  int v33; // [esp+24h] [ebp-188h]
  int n0x10_2; // [esp+28h] [ebp-184h]
  unsigned __int8 *v35; // [esp+2Ch] [ebp-180h]
  int v36; // [esp+30h] [ebp-17Ch] BYREF
  char v37; // [esp+38h] [ebp-174h]
  char v38; // [esp+39h] [ebp-173h]
  __int16 buf[24]; // [esp+3Ch] [ebp-170h] BYREF
  __int16 buf_1[24]; // [esp+6Ch] [ebp-140h] BYREF
  _WORD buf_2[24]; // [esp+9Ch] [ebp-110h] BYREF
  _DWORD v42[24]; // [esp+CCh] [ebp-E0h] BYREF
  char v43[128]; // [esp+12Ch] [ebp-80h] BYREF

  v33 = 0; /*0xffc584a3*/
  memset(buf, 0, sizeof(buf)); /*0xffc584a7*/
  memset32(buf_1, 33489407, 0xCu); /*0xffc584b3*/
  memset(buf_2, 0, sizeof(buf_2)); /*0xffc584cf*/
  n2 = 0; /*0xffc584da*/
  n2_1 = 0; /*0xffc584dc*/
  v6 = (unsigned __int8 *)(GetCpuCount((int)n6, a2, a3) + 19); /*0xffc584e0*/
  v35 = v6; /*0xffc584e3*/
  do
  {
    v7 = KtiFunc91AF((int)n6, a2, a3, n2_1); /*0xffc58504*/
    v8 = 0; /*0xffc58506*/
    v30 = v7; /*0xffc58508*/
    v32 = 0; /*0xffc5850c*/
    if ( *v6 )
    {
      do
      {
        if ( !KtiFunc89E9((int)n6, a2, a3, n2_1, v32, 0) )
        {
          n0x10_1 = 0; /*0xffc58540*/
          n0x10_3 = 0; /*0xffc58544*/
          if ( n0x10 )
          {
            v10 = a5; /*0xffc58556*/
            v11 = 242 * v8; /*0xffc58560*/
            v31 = v11; /*0xffc58566*/
            do
            {
              n0x10_2 = n0x10_1; /*0xffc58577*/
              v12 = 12 * (n0x10_1 + 16 * *(unsigned __int8 *)(v11 + v7 + 1)); /*0xffc5857b*/
              if ( *(_BYTE *)(v12 + v10 + 8) )
              {
                v33 = MailBoxFunc8C37(n6, *(_DWORD *)(v12 + v10), &v36); /*0xffc5859e*/
                for ( i = 0; i < 0x18u; ++i ) /*0xffc585a2*/
                {
                  if ( v37 == byte_FFD523C8[2 * i] && v38 == byte_FFD523C9[2 * i] ) /*0xffc585bb*/
                    break; /*0xffc585bb*/
                }
                if ( i == 24 )
                {
                  AssertPrint(
                    n6,
                    255,
                    (int)"\n\nRC_ASSERT! %s: %u   %s ",
                    "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Mem\\MemCmdControl.c",
                    2643,
                    "ctlPiGroup != MAX_CMDCTL_GROUPALL");
                  ProcMemInitCheck((int)n6, 242, 42); /*0xffc585f0*/
                }
                v14 = 12 * (n0x10_2 + 16 * *(unsigned __int8 *)(v31 + v30 + 1)); /*0xffc58624*/
                KtiFunc9984(*(_WORD *)(v14 + a5 + 4), *(_WORD *)(v14 + a5 + 6), &buf_2[i], &buf_1[i]); /*0xffc58638*/
                v15 = buf_1[i]; /*0xffc5863d*/
                v16 = (__int16)buf_2[i]; /*0xffc58643*/
                v17 = (v16 + v15) / 2 % 256; /*0xffc5865f*/
                buf[i] = v17; /*0xffc58668*/
                v18 = 12 * (n0x10_2 + 16 * *(unsigned __int8 *)(v31 + v30 + 1)); /*0xffc58680*/
                v42[i] = *(_DWORD *)(v18 + a5); /*0xffc58686*/
                v27 = v17; /*0xffc58690*/
                v26 = v15; /*0xffc58691*/
                v10 = a5; /*0xffc58692*/
                v25 = *(__int16 *)(v18 + a5 + 6); /*0xffc5869f*/
                v24 = *(__int16 *)(v18 + a5 + 4); /*0xffc586a5*/
                v19 = MailBoxFunc6F8B(v36, v43); /*0xffc586b3*/
                DebugPrint(
                  (int)n6,
                  2,
                  a2,
                  a3,
                  255,
                  255,
                  255,
                  255,
                  "%s:\t CTL Pi Group %d: le = %d re = %d, ctlLeft = %d ctlRight = %d ctlValue = %d\n",
                  v19,
                  i,
                  v24,
                  v25,
                  v16,
                  v26,
                  v27);
                n0x10_1 = n0x10_3; /*0xffc586df*/
                v7 = v30; /*0xffc586e6*/
              }
              ++n0x10_1; /*0xffc586ea*/
              v11 = v31; /*0xffc586f7*/
              n0x10_3 = n0x10_1; /*0xffc586fb*/
            }
            while ( n0x10_1 < n0x10 );
            v8 = v32; /*0xffc58705*/
            v6 = v35; /*0xffc58709*/
          }
        }
        v32 = ++v8; /*0xffc58711*/
      }
      while ( v8 < *v6 );
      n2 = n2_1; /*0xffc5871e*/
    }
    ++n2; /*0xffc58722*/
    v6 += 1379; /*0xffc58724*/
    n2_1 = n2; /*0xffc5872a*/
    v35 = v6; /*0xffc5872e*/
  }
  while ( n2 < 2u );
  v20 = v42; /*0xffc5873d*/
  buf_3 = buf; /*0xffc58744*/
  n24 = 24; /*0xffc58748*/
  do /*0xffc58780*/
  {
    if ( *buf_3 ) /*0xffc58749*/
    {
      result = MailBoxFunc6F4E(n6, a2, a3, 0, *v20, 24, buf_3); /*0xffc58763*/
      v33 = result; /*0xffc5876b*/
    }
    else
    {
      result = v33; /*0xffc58773*/
    }
    ++buf_3; /*0xffc58777*/
    ++v20; /*0xffc5877a*/
    --n24; /*0xffc5877d*/
  }
  while ( n24 ); /*0xffc58780*/
  return result; /*0xffc58782*/
}

// Function: MailBoxFunc878D @ 0xffc5878d (0x4aa bytes)
// Index: 701/2560

void __cdecl MailBoxFunc878D(unsigned __int8 *n6, int n4)
{
  unsigned __int8 *n6_1; // edi
  int SocketInfo; // eax
  int v4; // ecx
  _BYTE *SocketInfo_1; // esi
  int n2_2; // eax
  unsigned __int8 n2_1; // bl
  int n2_3; // ebp
  int n4_1; // ebx
  unsigned __int8 n255_13; // cl
  int n255_2; // edi
  _BYTE *v12; // ebp
  __int16 n255_1; // ax
  int n66; // edx
  _BYTE *v15; // esi
  _BYTE *v16; // esi
  __int16 n255_4; // bx
  _BYTE *v18; // ebp
  int n78; // edx
  int n2_5; // ebp
  int n255_5; // esi
  int n255_6; // ecx
  int n255_7; // eax
  char n255_8; // cl
  _BYTE *v25; // esi
  int n66_2; // ebp
  int n191; // ecx
  int n191_1; // eax
  _BYTE *v29; // esi
  int n78_1; // ebp
  int CpuCount; // eax
  _WORD *v32; // ecx
  unsigned __int8 n2_6; // dl
  int n255_12; // eax
  _BYTE *v35; // esi
  int n24; // ecx
  unsigned __int16 *v37; // ebp
  char n255_11; // dl
  char n24_1; // dl
  int v40; // ecx
  unsigned __int8 v41; // [esp+13h] [ebp-31h]
  int n255_10; // [esp+14h] [... [10359 chars total]

// Function: MailBoxFunc8C37 @ 0xffc58c37 (0x76 bytes)
// Index: 702/2560

int __cdecl MailBoxFunc8C37(_BYTE *n6, int a2, _DWORD *a3)
{
  int v3; // edx
  unsigned __int8 n46; // cl
  char *v5; // esi
  const char *v6; // eax
  _BYTE v8[128]; // [esp+4h] [ebp-80h] BYREF

  v3 = 0; /*0xffc58c40*/
  n46 = 0; /*0xffc58c42*/
  while ( *(int *)((char *)&dword_FFD52194 + 10 * n46) != a2 ) /*0xffc58c54*/
  {
    if ( ++n46 >= 0x2Eu ) /*0xffc58c5b*/
      goto LABEL_6; /*0xffc58c5b*/
  }
  v5 = (char *)&dword_FFD52194 + 10 * n46; /*0xffc58c6a*/
  *a3 = *(_DWORD *)v5; /*0xffc58c70*/
  v5 += 4; /*0xffc58c70*/
  a3[1] = *(_DWORD *)v5; /*0xffc58c71*/
  *((_WORD *)a3 + 4) = *((_WORD *)v5 + 2); /*0xffc58c72*/
LABEL_6:
  if ( n46 == 46 ) /*0xffc58c79*/
  {
    v6 = MailBoxFunc6F8B(a2, v8); /*0xffc58c80*/
    DebugPrint((int)n6, 2, 255, 255, 255, 255, 255, 255, "Unable to find signal %s\n", v6); /*0xffc58c9b*/
    return 6; /*0xffc58ca5*/
  }
  return v3; /*0xffc58ca8*/
}

// Function: MailBoxFunc8CAD @ 0xffc58cad (0x1e bytes)
// Index: 703/2560

unsigned __int16 __cdecl MailBoxFunc8CAD(unsigned __int16 a1, unsigned __int16 *a2, unsigned __int16 *a3)
{
  unsigned __int16 result; // ax

  result = a1; /*0xffc58cb1*/
  if ( a1 < *a2 ) /*0xffc58cb9*/
    *a2 = a1; /*0xffc58cbb*/
  if ( a1 > *a3 ) /*0xffc58cc5*/
    *a3 = a1; /*0xffc58cc7*/
  return result; /*0xffc58cca*/
}

// Function: MailBoxFunc8CCB @ 0xffc58ccb (0x77 bytes)
// Index: 704/2560

unsigned __int8 MailBoxFunc8CCB(
        int a1,
        char a2,
        unsigned __int8 a3,
        unsigned __int8 a4,
        unsigned __int8 a5,
        int a6,
        unsigned __int8 a7,
        ...)
{
  char v7; // bl

  v7 = -1; /*0xffc58cd5*/
  switch ( a3 )
  {
    case 7u:
      if ( a5 > 1u ) /*0xffc58d2f*/
        return 3 * a2; /*0xffc58d38*/
      return a4; /*0xffc58d2f*/
    case 8u:
      if ( a5 > 1u && (unsigned __int8)(a5 - 4) > 1u )
      {
        AutoGenFuncE5EA(a1, "Invalid FuncBlk: 0x%08x passed with BOX_MCIO\n", a5);
        return v7; /*0xffc58d29*/
      }
      return a4; /*0xffc58d3a*/
    case 0xBu:
      if ( a4 >= a7 )
        AutoGenFuncE5EA(a1, "Wrong Channel ID parameter: 0x%08x passed with BOX_MCDDC\n", a4);
      else
        return a4; /*0xffc58d02*/
      break;
    default:
      AutoGenFuncE5EA(a1, "Invalid BoxType: 0x%08x passed\n", a3);
      break;
  }
  return v7; /*0xffc58d3f*/
}

// Function: MiscConfigCheck @ 0xffc58d42 (0xc9 bytes)
// Index: 705/2560

int __cdecl MiscConfigCheck(unsigned __int8 *a1, unsigned __int8 a2, unsigned __int8 a3, int a4)
{
  unsigned __int8 v4; // dl
  int v5; // ebp
  int v6; // eax
  char v8; // [esp+10h] [ebp-4h]
  unsigned __int8 v9; // [esp+20h] [ebp+Ch]

  v4 = a3; /*0xffc58d47*/
  v5 = a4; /*0xffc58d4d*/
  v8 = a1[6 * a2 + 255677 + a3]; /*0xffc58d75*/
  if ( (a4 & 0x8000) != 0 ) /*0xffc58d88*/
  {
    v6 = AutoGenFuncEF4E(a1, a4); /*0xffc58d91*/
    v4 = a3; /*0xffc58d96*/
    v5 = v6; /*0xffc58d9d*/
  }
  if ( HIBYTE(a4) == 7 || HIBYTE(a4) == 11 || HIBYTE(a4) == 8 ) /*0xffc58dac*/
  {
    if ( v4 >= a1[255666] ) /*0xffc58db7*/
    {
      AutoGenFuncE5EA(a1, "Assert on access to ch >= maxCh\n"); /*0xffc58dbf*/
      v4 = a3; /*0xffc58dc4*/
    }
    v9 = MailBoxFunc8CCB(a1, v8, SHIBYTE(a4), v4, SBYTE2(a4), a1[255652], a1[255666], a1[255668]); /*0xffc58def*/
  }
  else
  {
    v9 = v4; /*0xffc58dae*/
  }
  return CpuIoRead((int)a1, a2, v9, v5); /*0xffc58e05*/
}

// Function: MailBoxFunc8E0B @ 0xffc58e0b (0x60 bytes)
// Index: 706/2560

int __usercall MailBoxFunc8E0B@<eax>(int a1@<ebx>, int a2, unsigned __int8 a3, unsigned __int8 a4, int a5)
{
  unsigned __int8 v7; // [esp+Ch] [ebp+8h]

  if ( HIBYTE(a5) == 7 || HIBYTE(a5) == 11 || HIBYTE(a5) == 8 ) /*0xffc58e22*/
  {
    if ( a4 >= *(_BYTE *)(a2 + 255667) ) /*0xffc58e36*/
      AutoGenFuncE5EA(a2, "Assert on access to mc >= MAX_IMC\n", a1); /*0xffc58e3e*/
    v7 = a4 * *(_BYTE *)(a2 + 255668); /*0xffc58e53*/
  }
  else
  {
    v7 = a4; /*0xffc58e27*/
  }
  return CpuIoRead(a2, a3, v7, a5); /*0xffc58e68*/
}

// Function: MailBoxFunc8E6B @ 0xffc58e6b (0x48 bytes)
// Index: 707/2560

int __cdecl MailBoxFunc8E6B(int a1, int a2, unsigned __int8 a3, int a4, int a5)
{
  return MailBoxFunc8E0B( /*0xffc58eaf*/
           a2,
           a1,
           a2,
           *(_BYTE *)(a3 + 6 * (unsigned __int8)a2 + a1 + 255677),
           a4 + a5 * (unsigned __int8)(a3 % *(_BYTE *)(a1 + 255668)));
}

// Function: MailBoxFunc8EB3 @ 0xffc58eb3 (0x58 bytes)
// Index: 708/2560

int __cdecl MailBoxFunc8EB3(int a1, unsigned __int8 a2, int a3)
{
  int v4; // ecx
  unsigned __int8 v5; // bl
  unsigned __int8 v6; // dl
  int v7; // eax
  unsigned __int8 v9; // [esp+10h] [ebp+8h]

  v4 = 0; /*0xffc58ebb*/
  v5 = 0; /*0xffc58ebd*/
  v9 = 0; /*0xffc58ebf*/
  if ( *(_BYTE *)(a1 + 255667) ) /*0xffc58ec2*/
  {
    v6 = a2; /*0xffc58eca*/
    do /*0xffc58f02*/
    {
      if ( *(_BYTE *)(2 * a2 + v5 + a1 + 255669) ) /*0xffc58ed8*/
      {
        v7 = MailBoxFunc8E0B(v5, a1, v6, v9, a3); /*0xffc58eea*/
        v6 = a2; /*0xffc58eef*/
        v4 = v7; /*0xffc58ef5*/
      }
      v9 = ++v5; /*0xffc58ef9*/
    }
    while ( v5 < *(_BYTE *)(a1 + 255667) ); /*0xffc58f02*/
  }
  return v4; /*0xffc58f05*/
}

// Function: MiscIoCheck @ 0xffc58f0b (0xba bytes)
// Index: 709/2560

int __cdecl MiscIoCheck(unsigned __int8 *a1, unsigned __int8 a2, int a3, unsigned int a4, int a5)
{
  unsigned __int8 v5; // dl
  int v6; // edi
  int v7; // ecx
  int result; // eax
  char v9; // [esp+10h] [ebp-4h]

  v5 = a3; /*0xffc58f10*/
  v6 = a4; /*0xffc58f25*/
  v7 = (int)&a1[6 * a2 + 255608]; /*0xffc58f2f*/
  v9 = *(_BYTE *)((unsigned __int8)a3 + v7 + 69); /*0xffc58f3e*/
  result = HIWORD(a4); /*0xffc58f44*/
  if ( (a4 & 0x8000) != 0 ) /*0xffc58f51*/
  {
    result = AutoGenFuncEF4E(a1, a4); /*0xffc58f5a*/
    v5 = a3; /*0xffc58f5f*/
    v6 = result; /*0xffc58f66*/
  }
  if ( HIBYTE(a4) == 7 || HIBYTE(a4) == 11 || HIBYTE(a4) == 8 ) /*0xffc58f75*/
  {
    LOBYTE(v7) = a1[255666]; /*0xffc58f7d*/
    if ( v5 >= (unsigned __int8)v7 ) /*0xffc58f82*/
      return result; /*0xffc58f82*/
    LOBYTE(a3) = MailBoxFunc8CCB(a1, v9, SHIBYTE(a4), v5, SBYTE2(a4), a1[255652], v7, a1[255668]); /*0xffc58fa5*/
  }
  else
  {
    LOBYTE(a3) = v5; /*0xffc58f77*/
  }
  return CpuIoCfgWrite(a1, a2, a3, v6, a5); /*0xffc58fbf*/
}

// Function: MailBoxFunc8FC5 @ 0xffc58fc5 (0x68 bytes)
// Index: 710/2560

int __cdecl MailBoxFunc8FC5(int a1, unsigned __int8 a2, unsigned __int8 a3, int a4, int a5)
{
  unsigned __int8 v7; // [esp+Ch] [ebp+8h]

  if ( HIBYTE(a4) == 7 || HIBYTE(a4) == 11 || HIBYTE(a4) == 8 ) /*0xffc58fdc*/
  {
    if ( a3 >= *(_BYTE *)(a1 + 255667) ) /*0xffc58ff0*/
      AutoGenFuncE5EA(a1, "Assert on access to mc >= MAX_IMC\n", a3); /*0xffc58ffc*/
    v7 = a3 * *(_BYTE *)(a1 + 255668); /*0xffc59012*/
  }
  else
  {
    v7 = a3; /*0xffc58fe1*/
  }
  return CpuIoCfgWrite(a1, a2, v7, a4, a5); /*0xffc5902a*/
}

// Function: MailBoxFunc902D @ 0xffc5902d (0x49 bytes)
// Index: 711/2560

int __cdecl MailBoxFunc902D(int a1, unsigned __int8 a2, unsigned __int8 a3, int a4, int a5, int a6)
{
  return MailBoxFunc8FC5( /*0xffc59072*/
           a1,
           a2,
           *(_BYTE *)(a3 + 6 * a2 + a1 + 255677),
           a4 + a5 * (unsigned __int8)(a3 % *(_BYTE *)(a1 + 255668)),
           a6);
}

// Function: MailBoxFunc9076 @ 0xffc59076 (0x55 bytes)
// Index: 712/2560

int __cdecl MailBoxFunc9076(int a1, unsigned __int8 a2, int a3, int a4)
{
  unsigned __int8 v5; // bl
  unsigned __int8 v6; // cl
  int result; // eax
  unsigned __int8 v8; // [esp+10h] [ebp+8h]

  v5 = 0; /*0xffc5907e*/
  v8 = 0; /*0xffc59080*/
  if ( *(_BYTE *)(a1 + 255667) ) /*0xffc59083*/
  {
    v6 = a2; /*0xffc5908b*/
    do /*0xffc590c4*/
    {
      result = 2 * a2 + v5; /*0xffc59097*/
      if ( *(_BYTE *)(result + a1 + 255669) ) /*0xffc59099*/
      {
        result = MailBoxFunc8FC5(a1, v6, v8, a3, a4); /*0xffc590ae*/
        v6 = a2; /*0xffc590b3*/
      }
      v8 = ++v5; /*0xffc590bb*/
    }
    while ( v5 < *(_BYTE *)(a1 + 255667) ); /*0xffc590c4*/
  }
  return result; /*0xffc590c7*/
}

// Function: MailBoxFunc90CB @ 0xffc590cb (0x2d bytes)
// Index: 713/2560

_WORD *__cdecl MailBoxFunc90CB(_WORD *a1, unsigned __int16 n0x10)
{
  unsigned __int16 v2; // cx
  _WORD *result; // eax
  __int16 v4; // cx

  v2 = n0x10 >= 0x10u ? n0x10 - 16 : 0;
  result = a1; /*0xffc590df*/
  if ( ((unsigned __int8)(n0x10 - 16) & (unsigned __int8)-(n0x10 >= 0x10u) & 0x7F) != 0 ) /*0xffc590e6*/
    v4 = (v2 >> 7) + 1; /*0xffc590ec*/
  else
    v4 = v2 >> 7; /*0xffc590f0*/
  *a1 = v4; /*0xffc590f4*/
  return result; /*0xffc590f7*/
}

// Function: MailBoxFunc90F8 @ 0xffc590f8 (0x1bb bytes)
// Index: 714/2560

unsigned __int16 __cdecl MailBoxFunc90F8(unsigned __int8 *__return_address, int n2, int n3, _BYTE *a4)
{
  unsigned __int8 n2_3; // bl
  _BYTE *v5; // esi
  char n2_1; // cl
  unsigned __int8 v7; // bh
  char n3_1; // al
  int v9; // esi
  unsigned __int8 n4; // al
  unsigned __int8 v11; // cl
  _BYTE *v12; // ecx
  unsigned __int8 v14; // cl
  unsigned __int8 v15; // cl
  __int16 v16; // dx
  __int16 v17; // si
  unsigned __int16 v18; // si
  unsigned __int8 v20; // [esp+10h] [ebp-1Ch]
  unsigned __int8 n2_2; // [esp+14h] [ebp-18h]
  _BYTE *v22; // [esp+18h] [ebp-14h]
  _DWORD v23[2]; // [esp+1Ch] [ebp-10h]
  char v24; // [esp+24h] [ebp-8h]
  int v25; // [esp+25h] [ebp-7h]
  char v26; // [esp+29h] [ebp-3h]
  unsigned __int8 n3a; // [esp+38h] [ebp+Ch]

  n2_3 = 0; /*0xffc59101*/
  v24 = 0; /*0xffc59110*/
  v25 = 0; /*0xffc59114*/
  v26 = 0; /*0xffc59118*/
  n2_2 = 0; /*0xffc59123*/
  v5 = (_BYTE *)(GetCpuCount((int)__return_address, n2, n3) + 1215); /*0xffc5912b*/
  v22 = v5; /*0xffc59131*/
  do /*0xffc59211*/
  {
    if ( *(v5 - 1215) ) /*0xffc59135*/
    {
      n2_1 = n2; /*0xffc59142*/
      v7 = 0; /*0xffc59146*/
      v20 = 0; /*0xffc59151*/
      v23[0] = 50813 * (unsigned __int8)n2; /*0xffc59155*/
      if ( __return_address[v23[0] + 10194] ) /*0xffc59159*/
      {
        n3_1 = n3; /*0xffc59166*/
        v9 = v23[0]; /*0xffc5916a*/
        while ( 1 ) /*0xffc59180*/
        {
          if ( KtiFunc89E9((int)__return_address, n2_1, n3_1, n2_2, v20, 1) ) /*0xffc59180*/
          {
            n3_1 = n3; /*0xffc591cc*/
          }
          else
          {
            n4 = KtiFunc88D1((int)__return_address, n2, n3, n2_2, v20); /*0xffc5919e*/
            v11 = ProcCommonFuncD799(__return_address, n2, n3, n4); /*0xffc591b2*/
            n3_1 = n3; /*0xffc591b7*/
            *((_BYTE *)v23 + (unsigned __int8)n3) = v11; /*0xffc591bc*/
            if ( (unsigned __int8)*(&v24 + (unsigned __int8)n3) < v11 ) /*0xffc591c4*/
              *(&v24 + (unsigned __int8)n3) = v11; /*0xffc591c6*/
          }
          v20 = ++v7; /*0xffc591d4*/
          if ( v7 >= __return_address[v9 + 10194] ) /*0xffc591e0*/
            break; /*0xffc591e0*/
          n2_1 = n2; /*0xffc59170*/
        }
        v5 = v22; /*0xffc591e2*/
      }
      v12 = a4; /*0xffc591ed*/
      if ( *(v5 - 1108) == 1 ) /*0xffc591f1*/
        a4[13] = *v5; /*0xffc591f5*/
    }
    else
    {
      v12 = a4; /*0xffc591fa*/
    }
    ++n2_3; /*0xffc591fe*/
    v5 += 1379; /*0xffc59200*/
    n2_2 = n2_3; /*0xffc59206*/
    v22 = v5; /*0xffc5920a*/
  }
  while ( n2_3 < 2u ); /*0xffc59211*/
  n3a = MailBoxFunc96DD((int)__return_address, n2, n3, v12); /*0xffc5922f*/
  v14 = *(&v24 + (unsigned __int8)n3); /*0xffc5923c*/
  if ( (v14 & 1) != 0 ) /*0xffc59243*/
    v15 = (v14 >> 1) - 3; /*0xffc5924e*/
  else
    v15 = (v14 >> 1) - 4; /*0xffc59247*/
  v16 = v15 - (unsigned __int8)(a4[13] + 6) + 1; /*0xffc5925f*/
  if ( v16 < 1 ) /*0xffc59265*/
    v16 = 1; /*0xffc59267*/
  v17 = n3a + 5; /*0xffc59274*/
  if ( (unsigned __int16)v17 < v16 ) /*0xffc5927e*/
    v17 = v16; /*0xffc59280*/
  v18 = v17 - 4; /*0xffc59283*/
  DebugPrint((int)__return_address, 2, n2, n3, 255, 255, 255, 255, "t_DDRT_GNTGNT_DD = %d\n", v18); /*0xffc592a0*/
  return v18; /*0xffc592ab*/
}

// Function: MailBoxFunc92B3 @ 0xffc592b3 (0x8e bytes)
// Index: 715/2560

char __cdecl MailBoxFunc92B3(int __return_address, unsigned int n2, int n3, unsigned __int8 a4, _BYTE *a5)
{
  unsigned __int8 v5; // bl
  unsigned int v6; // eax
  int v7; // edx
  unsigned int n5; // ebx
  unsigned int v9; // ebx

  v5 = RmtFunc73F8(__return_address, n2, n3, a5); /*0xffc592d1*/
  v6 = KtiFuncC1A5((unsigned __int8 *)__return_address, n2, n3); /*0xffc592d8*/
  v7 = v5; /*0xffc592f1*/
  if ( (*(_DWORD *)(__return_address + 134) & 0x800000) != 0 ) /*0xffc592f4*/
    n5 = v5 - a4 + v6 + 7; /*0xffc592fd*/
  else
    n5 = v5 - a4 + v6 + 6; /*0xffc59308*/
  if ( n5 < 5 ) /*0xffc5930d*/
    n5 = 5; /*0xffc59311*/
  v9 = n5 - 5; /*0xffc59315*/
  DebugPrint( /*0xffc59332*/
    __return_address,
    2,
    n2,
    n3,
    255,
    255,
    255,
    255,
    "RWDD (DDR4 to DDRT)[%d] = (tCLDDR4[%d] - tCWLDDRT[%d]) +  tRWDD[%d] + 6/7 - 3 - 2\n",
    v9,
    v6,
    a4,
    v7);
  return v9; /*0xffc5933c*/
}

// Function: MailBoxFunc9341 @ 0xffc59341 (0x8e bytes)
// Index: 716/2560

char __cdecl MailBoxFunc9341(int __return_address, unsigned int n2, int n3, unsigned __int8 a4, _BYTE *a5)
{
  unsigned __int8 v5; // bl
  unsigned int v6; // eax
  int v7; // edx
  unsigned int n5; // ebx
  unsigned int v9; // ebx

  v5 = RmtFunc756C(__return_address, n2, n3, a5); /*0xffc59364*/
  v6 = KtiFuncC1E1((unsigned __int8 *)__return_address, n2, n3); /*0xffc5936b*/
  v7 = v5; /*0xffc59373*/
  if ( (*(_DWORD *)(__return_address + 134) & 0x800000) != 0 ) /*0xffc59382*/
    n5 = v5 - a4 + v6 + 7; /*0xffc5938b*/
  else
    n5 = v5 - a4 + v6 + 6; /*0xffc59396*/
  if ( n5 < 5 ) /*0xffc5939b*/
    n5 = 5; /*0xffc5939f*/
  v9 = n5 - 4; /*0xffc593a3*/
  DebugPrint( /*0xffc593c0*/
    __return_address,
    2,
    n2,
    n3,
    255,
    255,
    255,
    255,
    "WRDD (DDR4 to DDRT)[%d] = (tCWLDDR4[%d] - tCLDDRT[%d]) +  tWRDD[%d] + 6/7 - 2 - 2\n",
    v9,
    v6,
    a4,
    v7);
  return v9; /*0xffc593ca*/
}

// Function: MailBoxFunc93CF @ 0xffc593cf (0x197 bytes)
// Index: 717/2560

unsigned __int8 __cdecl MailBoxFunc93CF(unsigned __int8 *__return_address, int n2, int n3, _BYTE *a4)
{
  unsigned __int8 n2_3; // bl
  _BYTE *v5; // edi
  char n2_1; // cl
  unsigned __int8 v7; // bh
  char n3_1; // al
  int v9; // edi
  unsigned __int8 n4; // al
  unsigned __int8 v11; // cl
  _BYTE *v12; // ecx
  unsigned __int8 v13; // bl
  unsigned __int8 v14; // al
  char v15; // al
  char v16; // dl
  char v17; // bl
  unsigned __int8 v18; // bl
  unsigned __int8 v20; // [esp+10h] [ebp-1Ch]
  unsigned __int8 n2_2; // [esp+14h] [ebp-18h]
  _BYTE *v22; // [esp+18h] [ebp-14h]
  _DWORD v23[2]; // [esp+1Ch] [ebp-10h]
  char v24; // [esp+24h] [ebp-8h]
  int v25; // [esp+25h] [ebp-7h]
  char v26; // [esp+29h] [ebp-3h]

  n2_3 = 0; /*0xffc593d8*/
  v24 = 0; /*0xffc593e7*/
  v25 = 0; /*0xffc593eb*/
  v26 = 0; /*0xffc593ef*/
  n2_2 = 0; /*0xffc593fb*/
  v5 = (_BYTE *)(GetCpuCount((int)__return_address, n2, n3) + 1215); /*0xffc593ff*/
  v22 = v5; /*0xffc59405*/
  do /*0xffc594df*/
  {
    if ( *(v5 - 1215) ) /*0xffc59409*/
    {
      n2_1 = n2; /*0xffc59416*/
      v7 = 0; /*0xffc5941a*/
      v20 = 0; /*0xffc59425*/
      v23[0] = 50813 * (unsigned __int8)n2; /*0xffc59429*/
      if ( __return_address[v23[0] + 10194] ) /*0xffc5942d*/
      {
        n3_1 = n3; /*0xffc59436*/
        v9 = v23[0]; /*0xffc5943a*/
        while ( 1 ) /*0xffc59451*/
        {
          if ( KtiFunc89E9((int)__return_address, n2_1, n3_1, n2_2, v20, 1) ) /*0xffc59451*/
          {
            n3_1 = n3; /*0xffc5949d*/
          }
          else
          {
            n4 = KtiFunc88D1((int)__return_address, n2, n3, n2_2, v20); /*0xffc5946f*/
            v11 = ProcCommonFuncD799(__return_address, n2, n3, n4); /*0xffc59483*/
            n3_1 = n3; /*0xffc59488*/
            *((_BYTE *)v23 + (unsigned __int8)n3) = v11; /*0xffc5948d*/
            if ( (unsigned __int8)*(&v24 + (unsigned __int8)n3) < v11 ) /*0xffc59495*/
              *(&v24 + (unsigned __int8)n3) = v11; /*0xffc59497*/
          }
          v20 = ++v7; /*0xffc594a3*/
          if ( v7 >= __return_address[v9 + 10194] ) /*0xffc594ae*/
            break; /*0xffc594ae*/
          n2_1 = n2; /*0xffc59440*/
        }
        v5 = v22; /*0xffc594b0*/
      }
      v12 = a4; /*0xffc594bb*/
      if ( *(v5 - 1108) == 1 ) /*0xffc594bf*/
        a4[13] = *v5; /*0xffc594c3*/
    }
    else
    {
      v12 = a4; /*0xffc594c8*/
    }
    ++n2_3; /*0xffc594cc*/
    v5 += 1379; /*0xffc594ce*/
    n2_2 = n2_3; /*0xffc594d4*/
    v22 = v5; /*0xffc594d8*/
  }
  while ( n2_3 < 2u ); /*0xffc594df*/
  v13 = MailBoxFunc96DD((int)__return_address, n2, n3, v12); /*0xffc594f5*/
  v14 = *(&v24 + (unsigned __int8)n3); /*0xffc5950b*/
  if ( (v14 & 1) != 0 ) /*0xffc59511*/
    v15 = (v14 >> 1) - 10; /*0xffc5951b*/
  else
    v15 = (v14 >> 1) - 11; /*0xffc59515*/
  v16 = a4[13] + 6 - v15 + 1; /*0xffc5951f*/
  if ( v16 < 1 ) /*0xffc59524*/
    v16 = 1; /*0xffc59526*/
  v17 = v13 + 5; /*0xffc59528*/
  if ( (unsigned __int8)v17 < v16 ) /*0xffc59533*/
    v17 = v16; /*0xffc59535*/
  v18 = v17 + 4; /*0xffc59537*/
  DebugPrint((int)__return_address, 2, n2, n3, 255, 255, 255, 255, "DDRTRD_to_DDR4RD = %d\n", v18); /*0xffc59554*/
  return v18; /*0xffc5955e*/
}

// Function: MailBoxFunc9566 @ 0xffc59566 (0x82 bytes)
// Index: 718/2560

char __cdecl MailBoxFunc9566(int __return_address, unsigned int n2, int n3, unsigned __int8 a4, _BYTE *a5)
{
  int v6; // edi
  unsigned int v7; // eax
  unsigned int v8; // ebx
  int v9; // eax
  unsigned __int8 v11; // [esp+17h] [ebp+Bh]
  char v12; // [esp+20h] [ebp+14h]

  v6 = a4; /*0xffc59581*/
  v11 = RmtFunc73F8(__return_address, n2, n3, a5); /*0xffc59588*/
  v7 = KtiFuncC1E1((unsigned __int8 *)__return_address, n2, n3); /*0xffc5958c*/
  v8 = v7; /*0xffc595a2*/
  if ( (*(_DWORD *)(__return_address + 134) & 0x800000) != 0 ) /*0xffc595a4*/
    v9 = v11 - v7 + a4 + 7; /*0xffc595ad*/
  else
    v9 = a4 + v11 - v7 + 6; /*0xffc595b8*/
  v12 = v9; /*0xffc595c3*/
  DebugPrint( /*0xffc595d8*/
    __return_address,
    2,
    n2,
    n3,
    255,
    255,
    255,
    255,
    "RWDD (DDRT to DDR4)[%d] = (tCLDDRT[%d] - tCWLDDR4[%d]) +  tRWDD[%d] + 6/7 - 3\n",
    v9,
    v6,
    v8,
    v11);
  return v12; /*0xffc595e3*/
}

// Function: MailBoxFunc95E8 @ 0xffc595e8 (0x82 bytes)
// Index: 719/2560

char __cdecl MailBoxFunc95E8(int __return_address, unsigned int n2, int n3, unsigned __int8 a4, _BYTE *a5)
{
  unsigned int v6; // eax
  unsigned int v7; // edi
  int v8; // eax
  int v10; // [esp-Ch] [ebp-18h]
  unsigned __int8 v11; // [esp+17h] [ebp+Bh]
  char v12; // [esp+20h] [ebp+14h]

  v11 = RmtFunc756C(__return_address, n2, n3, a5); /*0xffc59603*/
  v6 = KtiFuncC1A5((unsigned __int8 *)__return_address, n2, n3); /*0xffc5960a*/
  v7 = v6; /*0xffc59620*/
  if ( (*(_DWORD *)(__return_address + 134) & 0x800000) != 0 ) /*0xffc59626*/
    v8 = v11 - v6 + a4 + 7; /*0xffc5962f*/
  else
    v8 = a4 + v11 - v6 + 6; /*0xffc5963a*/
  v10 = a4; /*0xffc5963e*/
  v12 = v8; /*0xffc59645*/
  DebugPrint( /*0xffc5965a*/
    __return_address,
    2,
    n2,
    n3,
    255,
    255,
    255,
    255,
    "WRDD (DDRT to DDR4) [%d] = (tCWLDDRT[%d] - tCLDDR4[%d]) +  tWRDD[%d] + 6/7 - 2\n",
    v8,
    v10,
    v7,
    v11);
  return v12; /*0xffc59665*/
}

// Function: MailBoxFunc966A @ 0xffc5966a (0x73 bytes)
// Index: 720/2560

char __cdecl MailBoxFunc966A(
        int __return_address,
        int n2,
        int n3,
        unsigned __int8 a4,
        unsigned __int8 a5,
        unsigned int a6,
        unsigned __int8 *a7)
{
  int v7; // ecx
  int v8; // ebx
  unsigned int n5; // ebx

  v7 = RmtFunc74DB(__return_address, n2, n3, a6, a7); /*0xffc59690*/
  v8 = a4 + 4; /*0xffc59697*/
  if ( (*(_DWORD *)(__return_address + 134) & 0x800000) == 0 ) /*0xffc596a4*/
    v8 = a4 + 3; /*0xffc596a6*/
  n5 = v7 - a5 + v8; /*0xffc596ac*/
  DebugPrint( /*0xffc596c6*/
    __return_address,
    2,
    n2,
    n3,
    255,
    255,
    255,
    255,
    "RWSR (DDRT to DDRT)[%d] = (tCLDDR4[%d] - tCWLDDRT[%d]) +  tRWSR[%d] + 6/7 - 3\n",
    n5,
    a4,
    a5,
    v7);
  if ( n5 < 5 ) /*0xffc596d1*/
    LOBYTE(n5) = 5; /*0xffc596d5*/
  return n5; /*0xffc596d6*/
}

// Function: MailBoxFunc96DD @ 0xffc596dd (0x73 bytes)
// Index: 721/2560

unsigned __int8 __cdecl MailBoxFunc96DD(int __return_address, int n2, int n3, _BYTE *a4)
{
  unsigned __int8 v4; // dl
  char v5; // al
  unsigned __int8 n2_1; // bl

  v4 = a4[8]; /*0xffc596e1*/
  if ( v4 > 1u || a4[7] ) /*0xffc596e9*/
    v5 = v4 + a4[7] - 1; /*0xffc596f8*/
  else
    v5 = 0; /*0xffc596ef*/
  n2_1 = v5 + a4[4] + a4[12] + 1; /*0xffc59703*/
  if ( n2_1 < 2u ) /*0xffc59708*/
    n2_1 = 2; /*0xffc5970a*/
  if ( *(_BYTE *)(__return_address + 1008) == 1 && n2_1 < 3u ) /*0xffc5971c*/
    n2_1 = 3; /*0xffc5971e*/
  if ( n2_1 > 7u ) /*0xffc59723*/
    n2_1 = 7; /*0xffc59725*/
  DebugPrint(__return_address, 2, n2, n3, 255, 255, 255, 255, "tRRDD = %d\n", n2_1); /*0xffc59744*/
  return n2_1; /*0xffc5974f*/
}

// Function: MailBoxFunc9750 @ 0xffc59750 (0xb5 bytes)
// Index: 722/2560

unsigned __int8 __cdecl MailBoxFunc9750(int __return_address, int n2, int n3, _BYTE *a4)
{
  int SocketInfo; // edi
  unsigned __int8 v5; // ch
  char v6; // cl
  unsigned __int8 n2_1; // bl

  SocketInfo = GetSocketInfo(__return_address, n2); /*0xffc59765*/
  v5 = a4[8]; /*0xffc59769*/
  if ( v5 > 1u || a4[7] ) /*0xffc59774*/
    v6 = v5 + a4[7] - 1; /*0xffc59783*/
  else
    v6 = 0; /*0xffc5977a*/
  n2_1 = v6 + a4[11] + 1 + a4[3]; /*0xffc59792*/
  if ( *(_BYTE *)(48704 * (unsigned __int8)n2 + __return_address + 258703) ) /*0xffc5979d*/
  {
    if ( n2_1 >= 2u ) /*0xffc597aa*/
      goto LABEL_11; /*0xffc597aa*/
    if ( *(_BYTE *)(7688 * (unsigned __int8)n3 + SocketInfo + 6675) == 1 ) /*0xffc597bd*/
    {
LABEL_10:
      n2_1 = 2; /*0xffc597c6*/
      goto LABEL_11; /*0xffc597c6*/
    }
    n2_1 = 2; /*0xffc597bf*/
  }
  if ( n2_1 < 2u ) /*0xffc597c4*/
    goto LABEL_10; /*0xffc597c4*/
LABEL_11:
  if ( *(_BYTE *)(__return_address + 1008) == 1 && n2_1 < 3u ) /*0xffc597d4*/
    n2_1 = 3; /*0xffc597d6*/
  if ( n2_1 > 7u ) /*0xffc597db*/
    n2_1 = 7; /*0xffc597dd*/
  DebugPrint(__return_address, 2, n2, n3, 255, 255, 255, 255, "tRRDR = %d\n", n2_1); /*0xffc597f6*/
  return n2_1; /*0xffc59800*/
}

// Function: MailBoxFunc9805 @ 0xffc59805 (0x79 bytes)
// Index: 723/2560

char __cdecl MailBoxFunc9805(_BYTE *a1, int n9, unsigned int *a3)
{
  char result; // al
  unsigned int n7; // edi

  if ( n9 == 9 && (result = KtiFuncE78((int)a1, 0, 9u)) != 0 ) /*0xffc59822*/
  {
    n7 = 7; /*0xffc59826*/
  }
  else
  {
    result = 16 * n9; /*0xffc5982b*/
    n7 = dword_FFD52404[4 * n9]; /*0xffc5982e*/
  }
  if ( *a3 > n7 ) /*0xffc5983b*/
  {
    LogDebugString(a1, (int)(&off_FFD52408)[4 * n9]);// "tREFI" /*0xffc5984a*/
    LogDebugString(a1, (int)" -- Register Overflow! maxVal = 0x%x, value = 0x%x\n", n7, *a3); /*0xffc5985c*/
    *a3 = n7; /*0xffc59863*/
    return KtiFunc211E((int)a1, 54, 1, 0, 0, 0, 0); /*0xffc59872*/
  }
  return result; /*0xffc5987a*/
}

// Function: MailBoxFunc987E @ 0xffc5987e (0x3d6 bytes)
// Index: 724/2560

int __cdecl MailBoxFunc987E(unsigned __int8 *__return_address, int n2)
{
  int n2_1; // ebx
  int CpuCount; // eax
  int CpuCount_1; // edi
  unsigned __int8 n2_4; // dl
  unsigned __int8 *v7; // edi
  unsigned __int8 v8; // bl
  __int16 v9; // dx
  __int16 n127_2; // cx
  unsigned __int16 v11; // di
  int v12; // esi
  unsigned int n0x1F; // esi
  unsigned __int8 v15; // [esp+7h] [ebp-25h]
  int n6; // [esp+8h] [ebp-24h]
  char n4; // [esp+Ch] [ebp-20h]
  char n4a; // [esp+Ch] [ebp-20h]
  unsigned __int8 n2_3; // [esp+10h] [ebp-1Ch]
  unsigned __int8 i; // [esp+14h] [ebp-18h]
  __int16 n127; // [esp+18h] [ebp-14h]
  __int16 n127_1; // [esp+1Ch] [ebp-10h]
  char n2_2; // [esp+20h] [ebp-Ch]
  unsigned __int8 v24; // [esp+30h] [ebp+4h]
  unsigned __int8 *n0x23; // [esp+30h] [ebp+4h]

  n2_2 = 0; /*0xffc59886*/
  if ( __return_address[1008] == 2 ) /*0xffc59892*/
  {
    n2_1 = n2; /*0xffc59899*/
    DebugPrint((int)__return_address, 3, n2, 255, 255, 255, 255, 255, "DcpmmTurnaroundEquationCheck Start\n"); /*0xffc598b2*/
    GetSocketInfo((int)__return_address, n2); /*0xffc598b9*/
    LOBYTE(n6) = 0; /*0xffc598c1*/
    do /*0xffc59c2e*/
    {
      if ( MailBoxFuncA738(__return_address, n2_1, n6) ) /*0xffc598cd*/
      {
        CpuCount = GetCpuCount((int)__return_address, n2_1, n6); /*0xffc598f7*/
        CpuCount_1 = CpuCount; /*0xffc598ff*/
        n2_4 = 0; /*0xffc59901*/
        while ( *(_BYTE *)(1379 * n2_4 + CpuCount + 107) != 1 ) /*0xffc59911*/
        {
          if ( ++n2_4 >= 2u ) /*0xffc59918*/
            goto LABEL_10; /*0xffc59918*/
        }
        n2_2 = n2_4; /*0xffc5991c*/
LABEL_10:
        n4 = KtiFunc88D1((int)__return_address, n2_1, n6, n2_2, 0); /*0xffc59920*/
        v15 = ProcCommonFuncD73A(__return_address, n2_1, n6, n4); /*0xffc59942*/
        v24 = ProcCommonFuncD799(__return_address, n2_1, n6, n4); /*0xffc59951*/
        n2_3 = 0; /*0xffc59955*/
        v7 = (unsigned __int8 *)(CpuCount_1 + 19); /*0xffc5995a*/
        n127 = 127; /*0xffc59960*/
        n127_1 = 127; /*0xffc59964*/
        do /*0xffc59a52*/
        {
          KtiFunc91AF((int)__return_address, n2_1, n6, n2_3); /*0xffc5996f*/
          if ( v7[88] != 1 ) /*0xffc5997b*/
          {
            for ( i = 0; i < *v7; ++i ) /*0xffc59981*/
            {
              if ( !KtiFunc89E9((int)__return_address, n2_1, n6, n2_3, i, 0) ) /*0xffc5999c*/
              {
                n4a = KtiFunc88D1((int)__return_address, n2_1, n6, n2_3, i); /*0xffc599bc*/
                v8 = ProcCommonFuncD73A(__return_address, n2_1, n6, n4a); /*0xffc599d0*/
                v9 = (unsigned __int8)ProcCommonFuncD799(__return_address, n2, n6, n4a); /*0xffc599dd*/
                if ( (__int16)(v9 + v15 - v8 - v24) < n127 ) /*0xffc59a0e*/
                  n127 = v9 + v15 - v8 - v24; /*0xffc59a10*/
                n127_2 = v24 + v8 - v15 - v9; /*0xffc59a1a*/
                n2_1 = n2; /*0xffc59a1c*/
                if ( n127_2 < n127_1 ) /*0xffc59a28*/
                  n127_1 = n127_2; /*0xffc59a2a*/
              }
            }
          }
          v7 += 1379; /*0xffc59a44*/
          ++n2_3; /*0xffc59a4c*/
        }
        while ( n2_3 < 2u ); /*0xffc59a52*/
        v11 = MiscConfigCheck(__return_address, n2_1, n6, 117516816); /*0xffc59a6d*/
        v12 = MiscConfigCheck(__return_address, n2_1, n6, 184566616); /*0xffc59a78*/
        if ( n127 <= (__int16)(2 * (11 - (v12 & 0x3F))) ) /*0xffc59aa4*/
        {
          n0x23 = (unsigned __int8 *)((14 - n127) % 2 + (14 - n127) / 2 + 5); /*0xffc59ad2*/
          DebugPrint( /*0xffc59af2*/
            (int)__return_address,
            2,
            n2_1,
            n6,
            255,
            255,
            255,
            255,
            "t_RDRD_DD old value = %d, new value = %d\n",
            v12 & 0x3F,
            n0x23);
          if ( (unsigned int)n0x23 > 0x23 || (unsigned int)n0x23 < 0xB ) /*0xffc59b06*/
          {
            DebugPrint( /*0xffc59b1e*/
              (int)__return_address,
              3,
              n2_1,
              n6,
              255,
              255,
              255,
              255,
              "Calculated DDRT to DDR4 Roundtrip not in valid range\n");
            KtiFunc211E((int)__return_address, 226, 1, n2_1, n6, 255, 255); /*0xffc59b37*/
          }
          MiscIoCheck( /*0xffc59b56*/
            __return_address,
            n2_1,
            n6,
            0xB004358u,
            v12 ^ ((unsigned __int8)n0x23 ^ (unsigned __int8)v12) & 0x3F);
        }
        if ( n127_1 <= (__int16)(2 * (3 - HIBYTE(v11))) ) /*0xffc59b67*/
        {
          n0x1F = (14 - n127_1) % 2 + (14 - n127_1) / 2 - 3; /*0xffc59b95*/
          DebugPrint( /*0xffc59bb2*/
            (int)__return_address,
            2,
            n2_1,
            n6,
            255,
            255,
            255,
            255,
            "t_GNTGNT_DD old value = %d, new value = %d\n",
            HIBYTE(v11),
            n0x1F);
          if ( n0x1F > 0x1F || n0x1F < 3 ) /*0xffc59bc2*/
          {
            DebugPrint( /*0xffc59bda*/
              (int)__return_address,
              3,
              n2_1,
              n6,
              255,
              255,
              255,
              255,
              "Calculated DDR4 to DDRT Roundtrip not in valid range\n");
            KtiFunc211E((int)__return_address, 226, 2, n2_1, n6, 255, 255); /*0xffc59bf3*/
          }
          MiscIoCheck( /*0xffc59c15*/
            __return_address,
            n2_1,
            n6,
            0x7012A10u,
            (unsigned __int8)v11 | (unsigned __int16)((_WORD)n0x1F << 8));
        }
      }
      else
      {
        DebugPrint((int)__return_address, 2, n2_1, n6, 255, 255, 255, 255, "Skipping DcpmmTurnaroundEquationCheck\n"); /*0xffc598e7*/
      }
      LOBYTE(n6) = n6 + 1; /*0xffc59c28*/
    }
    while ( (unsigned __int8)n6 < 6u ); /*0xffc59c2e*/
    DebugPrint((int)__return_address, 3, n2_1, 255, 255, 255, 255, 255, "DcpmmTurnaroundEquationCheck End\n"); /*0xffc59c42*/
  }
  return 0; /*0xffc59c4f*/
}

// Function: MailBoxFunc9C54 @ 0xffc59c54 (0x34 bytes)
// Index: 725/2560

int __cdecl MailBoxFunc9C54(unsigned __int8 *__return_address, unsigned __int8 n2, int n3)
{
  int v3; // eax

  v3 = MiscConfigCheck(__return_address, n2, n3, 184566340); /*0xffc59c67*/
  return MiscIoCheck(__return_address, n2, n3, 0xB004244u, v3 & 0xFFFFFFF0 | 8); /*0xffc59c85*/
}

// Function: MailBoxFunc9C88 @ 0xffc59c88 (0x7a bytes)
// Index: 726/2560

char __cdecl MailBoxFunc9C88(int __return_address, unsigned __int8 n2, unsigned __int8 n3)
{
  int CpuCount; // eax
  char v4; // cl
  unsigned __int8 n2_1; // bl
  _BYTE *v6; // esi
  unsigned __int8 n2_2; // [esp+8h] [ebp-8h]
  char v9; // [esp+Ch] [ebp-4h]

  CpuCount = GetCpuCount(__return_address, n2, n3); /*0xffc59c98*/
  v4 = 0; /*0xffc59ca0*/
  n2_1 = 0; /*0xffc59ca2*/
  v9 = 0; /*0xffc59ca4*/
  n2_2 = 0; /*0xffc59ca7*/
  v6 = (_BYTE *)(CpuCount + 112); /*0xffc59caa*/
  do /*0xffc59cf8*/
  {
    if ( *(v6 - 112) && v6[6] == 6 ) /*0xffc59cb7*/
    {
      if ( (*v6 & 3) == 2 ) /*0xffc59cbf*/
        goto LABEL_7; /*0xffc59cbf*/
      if ( *(v6 - 92) <= 2u ) /*0xffc59cc5*/
        goto LABEL_9; /*0xffc59cc5*/
      if ( ProcCommonFunc24FA(__return_address, n2, n3, n2_2) ) /*0xffc59cd3*/
      {
LABEL_7:
        v4 = 1; /*0xffc59ce1*/
        v9 = 1; /*0xffc59ce2*/
      }
      else
      {
        v4 = v9; /*0xffc59ce7*/
      }
    }
LABEL_9:
    ++n2_1; /*0xffc59cea*/
    v6 += 1379; /*0xffc59cec*/
    n2_2 = n2_1; /*0xffc59cf2*/
  }
  while ( n2_1 < 2u ); /*0xffc59cf8*/
  return v4; /*0xffc59cfa*/
}

// Function: MailBoxFunc9D02 @ 0xffc59d02 (0x97 bytes)
// Index: 727/2560

int __cdecl MailBoxFunc9D02(int __return_address, unsigned __int8 n2, unsigned __int8 n3, _BYTE *a4, _BYTE *a5)
{
  int SocketInfo; // edi
  unsigned __int8 v6; // bl
  int n2_1; // eax
  int v8; // edx

  SocketInfo = GetSocketInfo(__return_address, n2); /*0xffc59d17*/
  ++*a5; /*0xffc59d1e*/
  v6 = a4[8]; /*0xffc59d20*/
  if ( v6 > 1u || a4[9] > 1u ) /*0xffc59d2e*/
    *a5 += v6 + a4[9] - 2; /*0xffc59d39*/
  if ( a4[12] ) /*0xffc59d3b*/
    ++*a5; /*0xffc59d41*/
  n2_1 = n2; /*0xffc59d46*/
  v8 = 48704 * n2; /*0xffc59d49*/
  if ( *(_BYTE *)(v8 + __return_address + 258703) ) /*0xffc59d4f*/
  {
    n2_1 = 7688 * n3; /*0xffc59d5d*/
    if ( *(int *)(n2_1 + SocketInfo + 11) < 0 ) /*0xffc59d6b*/
    {
      n2_1 = *(unsigned __int8 *)(v8 + __return_address + 258694); /*0xffc59d6d*/
      if ( *a5 < 5u ) /*0xffc59d81*/
        *a5 = 5; /*0xffc59d83*/
    }
  }
  return n2_1; /*0xffc59d94*/
}

// Function: MailBoxFunc9D99 @ 0xffc59d99 (0xe2 bytes)
// Index: 728/2560

char __cdecl MailBoxFunc9D99(int __return_address, unsigned __int8 n2, unsigned __int8 n3, int a4, _BYTE *a5)
{
  char n2_1; // bl
  int SocketInfo; // ebp
  unsigned __int8 n3_1; // cl
  _BYTE *v9; // eax
  int v10; // edi
  char v11; // al
  bool v12; // zf
  char v14; // [esp+13h] [ebp-9h]
  char n2_2; // [esp+14h] [ebp-8h]
  int CpuCount; // [esp+18h] [ebp-4h]
  _BYTE *v17; // [esp+30h] [ebp+14h]

  n2_1 = 0; /*0xffc59da4*/
  n2_2 = 0; /*0xffc59daa*/
  v14 = 0; /*0xffc59dae*/
  SocketInfo = GetSocketInfo(__return_address, n2); /*0xffc59dbb*/
  CpuCount = GetCpuCount(__return_address, n2, n3); /*0xffc59dd5*/
  ++*a5; /*0xffc59dd9*/
  if ( *(_BYTE *)(a4 + 11) ) /*0xffc59ddd*/
    ++*a5; /*0xffc59de4*/
  n3_1 = n3; /*0xffc59de6*/
  ++*a5; /*0xffc59dea*/
  LOBYTE(v9) = n3; /*0xffc59dec*/
  v10 = 7688 * n3; /*0xffc59def*/
  if ( *(_BYTE *)(v10 + SocketInfo + 3) > 1u ) /*0xffc59dfa*/
  {
    v9 = (_BYTE *)(CpuCount + 107); /*0xffc59e00*/
    v17 = (_BYTE *)(CpuCount + 107); /*0xffc59e03*/
    do /*0xffc59e49*/
    {
      if ( *v9 ) /*0xffc59e07*/
      {
        v14 = 1; /*0xffc59e0e*/
        v11 = ProcCommonFunc24FA(__return_address, n2, n3_1, n2_1 ^ 1); /*0xffc59e22*/
        n3_1 = n3; /*0xffc59e27*/
        v12 = v11 == 0; /*0xffc59e2e*/
        v9 = v17; /*0xffc59e30*/
        if ( v12 ) /*0xffc59e34*/
          n2_2 = 1; /*0xffc59e36*/
      }
      ++n2_1; /*0xffc59e3b*/
      v9 += 1379; /*0xffc59e3d*/
      v17 = v9; /*0xffc59e42*/
    }
    while ( (unsigned __int8)n2_1 < 2u ); /*0xffc59e49*/
    n2_1 = n2_2; /*0xffc59e4b*/
  }
  if ( ((unsigned __int8)n2_1 & (unsigned __int8)v14) == 0 && *(_BYTE *)(v10 + SocketInfo + 6673) && *a5 < 7u ) /*0xffc59e62*/
  {
    LOBYTE(v9) = (*(_BYTE *)(v10 + SocketInfo + 6675) != 1) + 6; /*0xffc59e6f*/
    *a5 = (_BYTE)v9; /*0xffc59e71*/
  }
  return (char)v9; /*0xffc59e73*/
}

// Function: MailBoxFunc9E7B @ 0xffc59e7b (0x71 bytes)
// Index: 729/2560

int __cdecl MailBoxFunc9E7B(int __return_address, unsigned __int8 n2, unsigned __int8 n3, int a4, _BYTE *a5)
{
  int result; // eax
  int v6; // edi
  int v7; // ecx

  result = GetSocketInfo(__return_address, n2); /*0xffc59e89*/
  v6 = result; /*0xffc59e91*/
  ++*a5; /*0xffc59e98*/
  v7 = 48704 * n2; /*0xffc59e9a*/
  if ( *(_BYTE *)(v7 + __return_address + 258703) ) /*0xffc59ea0*/
  {
    result = 7688 * n3; /*0xffc59eae*/
    if ( *(int *)(result + v6 + 11) < 0 ) /*0xffc59ebc*/
    {
      result = *(unsigned __int8 *)(v7 + __return_address + 258694); /*0xffc59ebe*/
      if ( *a5 < 5u ) /*0xffc59ed4*/
        *a5 = 5; /*0xffc59ed6*/
    }
  }
  return result; /*0xffc59ee7*/
}

// Function: MailBoxFunc9EEC @ 0xffc59eec (0x73 bytes)
// Index: 730/2560

char __cdecl MailBoxFunc9EEC(int __return_address, int n2, int n3, _BYTE *a4, _BYTE *a5)
{
  int SocketInfo; // eax
  char v6; // al
  unsigned __int8 v7; // bl
  char result; // al

  SocketInfo = GetSocketInfo(__return_address, n2); /*0xffc59ef8*/
  *a5 = 1; /*0xffc59f11*/
  if ( *(_BYTE *)(7688 * (unsigned __int8)n3 + SocketInfo + 3) > 1u && ((v6 = a4[10]) != 0 || a4[7]) ) /*0xffc59f22*/
    v7 = v6 + a4[7]; /*0xffc59f2a*/
  else
    v7 = 0; /*0xffc59f2e*/
  DebugPrint(__return_address, 2, n2, n3, 255, 255, 255, 255, "odtStretch = %d\n", v7); /*0xffc59f4b*/
  result = v7 + a4[12]; /*0xffc59f56*/
  *a5 += result; /*0xffc59f58*/
  return result; /*0xffc59f5a*/
}

// Function: MailBoxFunc9F5F @ 0xffc59f5f (0x121 bytes)
// Index: 731/2560

char __cdecl MailBoxFunc9F5F(int __return_address, int n2, int n3, _BYTE *a4, char *a5)
{
  unsigned __int8 v5; // bl
  int SocketInfo; // ebp
  int v8; // esi
  char v9; // al
  unsigned __int8 n2_1; // bh
  _BYTE *v11; // esi
  char result; // al
  char v13; // [esp+13h] [ebp-9h]
  char v14; // [esp+14h] [ebp-8h]
  int CpuCount; // [esp+18h] [ebp-4h]
  char *v16; // [esp+30h] [ebp+14h]

  v5 = 0; /*0xffc59f6a*/
  v14 = 0; /*0xffc59f70*/
  v13 = 0; /*0xffc59f74*/
  SocketInfo = GetSocketInfo(__return_address, n2); /*0xffc59f81*/
  CpuCount = GetCpuCount(__return_address, n2, n3); /*0xffc59f97*/
  v8 = 7688 * (unsigned __int8)n3; /*0xffc59fa2*/
  *a5 = 1; /*0xffc59fa8*/
  v16 = (char *)v8; /*0xffc59fab*/
  if ( *(_BYTE *)(v8 + SocketInfo + 3) > 1u ) /*0xffc59fb6*/
  {
    v9 = a4[10]; /*0xffc59fbc*/
    if ( v9 || a4[7] ) /*0xffc59fc3*/
      v5 = v9 + a4[7]; /*0xffc59fcb*/
    n2_1 = 0; /*0xffc59fd6*/
    v11 = (_BYTE *)(CpuCount + 107); /*0xffc59fd8*/
    do /*0xffc5a015*/
    {
      if ( *v11 ) /*0xffc59fdb*/
      {
        v13 = 1; /*0xffc59fe2*/
        if ( !ProcCommonFunc24FA(__return_address, n2, n3, n2_1 ^ 1) ) /*0xffc59ff9*/
          v14 = 1; /*0xffc5a005*/
      }
      ++n2_1; /*0xffc5a00a*/
      v11 += 1379; /*0xffc5a00c*/
    }
    while ( n2_1 < 2u ); /*0xffc5a015*/
    v8 = (int)v16; /*0xffc5a017*/
  }
  DebugPrint(__return_address, 2, n2, n3, 255, 255, 255, 255, "odtStretch = %d\n", v5); /*0xffc5a03b*/
  *a5 += v5 + a4[11]; /*0xffc5a04c*/
  result = v14; /*0xffc5a04e*/
  if ( ((unsigned __int8)v14 & (unsigned __int8)v13) == 0 /*0xffc5a067*/
    && *(_BYTE *)(v8 + SocketInfo + 6673)
    && (unsigned __int8)*a5 < 2u )
  {
    result = (*(_BYTE *)(v8 + SocketInfo + 6675) != 1) + 1; /*0xffc5a074*/
    *a5 = result; /*0xffc5a076*/
  }
  return result; /*0xffc5a078*/
}

// Function: MailBoxFuncA080 @ 0xffc5a080 (0x77 bytes)
// Index: 732/2560

int __cdecl MailBoxFuncA080(int __return_address, int n2, int n3, _BYTE *a4, _BYTE *a5)
{
  unsigned __int8 v5; // bl
  int result; // eax

  if ( *(_BYTE *)(7688 * (unsigned __int8)n3 + GetSocketInfo(__return_address, n2) + 3) <= 1u /*0xffc5a0b3*/
    || *(_WORD *)(a4 + 9) <= 1u )
  {
    v5 = 0; /*0xffc5a0be*/
  }
  else
  {
    v5 = a4[10] + a4[9] - 1; /*0xffc5a0ba*/
  }
  result = DebugPrint(__return_address, 2, n2, n3, 255, 255, 255, 255, "odtStretch = %d\n", v5); /*0xffc5a0db*/
  ++*a5; /*0xffc5a0e6*/
  *a5 += v5 + a4[12] + 1; /*0xffc5a0f2*/
  return result; /*0xffc5a0f1*/
}

// Function: MailBoxFuncA0F7 @ 0xffc5a0f7 (0x12d bytes)
// Index: 733/2560

char __cdecl MailBoxFuncA0F7(int __return_address, int n2, int n3, _BYTE *a4, _BYTE *p_n2a)
{
  unsigned __int8 v5; // bl
  int SocketInfo; // ebp
  int CpuCount; // eax
  _BYTE *p_n2a_1; // esi
  int v9; // eax
  char v10; // bl
  unsigned __int8 n2_1; // al
  _BYTE *v12; // edi
  bool v13; // zf
  char v15; // [esp+13h] [ebp-9h]
  int v16; // [esp+14h] [ebp-8h]
  int CpuCount_1; // [esp+18h] [ebp-4h]
  unsigned __int8 n2_2; // [esp+2Ch] [ebp+10h]

  v5 = 0; /*0xffc5a102*/
  v15 = 0; /*0xffc5a108*/
  SocketInfo = GetSocketInfo(__return_address, n2); /*0xffc5a115*/
  CpuCount = GetCpuCount(__return_address, n2, n3); /*0xffc5a11f*/
  p_n2a_1 = p_n2a; /*0xffc5a12b*/
  *p_n2a = 1; /*0xffc5a13c*/
  CpuCount_1 = CpuCount; /*0xffc5a13f*/
  v16 = 7688 * (unsigned __int8)n3; /*0xffc5a143*/
  if ( *(_BYTE *)(v16 + SocketInfo + 3) > 1u && *(_WORD *)(a4 + 9) > 1u ) /*0xffc5a159*/
    v5 = a4[10] + a4[9] - 1; /*0xffc5a160*/
  DebugPrint(__return_address, 2, n2, n3, 255, 255, 255, 255, "odtStretch = %d\n", v5); /*0xffc5a17f*/
  *p_n2a += a4[5]; /*0xffc5a18a*/
  v9 = 7688 * (unsigned __int8)n3; /*0xffc5a191*/
  *p_n2a += v5 + a4[11]; /*0xffc5a197*/
  v10 = 0; /*0xffc5a199*/
  if ( *(_BYTE *)(v16 + SocketInfo + 3) > 1u ) /*0xffc5a1a0*/
  {
    n2_1 = 0; /*0xffc5a1a6*/
    v12 = (_BYTE *)(CpuCount_1 + 107); /*0xffc5a1ac*/
    n2_2 = 0; /*0xffc5a1af*/
    do /*0xffc5a1ec*/
    {
      if ( *v12 ) /*0xffc5a1b3*/
      {
        v15 = 1; /*0xffc5a1ba*/
        v13 = ProcCommonFunc24FA(__return_address, n2, n3, n2_1 ^ 1) == 0; /*0xffc5a1d4*/
        n2_1 = n2_2; /*0xffc5a1d6*/
        if ( v13 ) /*0xffc5a1da*/
          v10 = 1; /*0xffc5a1dc*/
      }
      ++n2_1; /*0xffc5a1de*/
      v12 += 1379; /*0xffc5a1e0*/
      n2_2 = n2_1; /*0xffc5a1e6*/
    }
    while ( n2_1 < 2u ); /*0xffc5a1ec*/
    p_n2a_1 = p_n2a; /*0xffc5a1ee*/
    v9 = 7688 * (unsigned __int8)n3; /*0xffc5a1f2*/
  }
  if ( ((unsigned __int8)v10 & (unsigned __int8)v15) == 0 && *(_BYTE *)(v9 + SocketInfo + 6673) && *p_n2a_1 < 2u ) /*0xffc5a209*/
  {
    LOBYTE(v9) = (*(_BYTE *)(v9 + SocketInfo + 6675) != 1) + 1; /*0xffc5a216*/
    *p_n2a_1 = v9; /*0xffc5a218*/
  }
  ++*p_n2a_1; /*0xffc5a21a*/
  return v9; /*0xffc5a21c*/
}

// Function: MailBoxFuncA224 @ 0xffc5a224 (0xc6 bytes)
// Index: 734/2560

_WORD *__cdecl MailBoxFuncA224(
        unsigned __int8 *__return_address,
        unsigned __int8 n2,
        unsigned __int8 n3,
        _WORD *a4,
        _DWORD *a5,
        _WORD *a6,
        _DWORD *a7)
{
  unsigned int v7; // esi
  unsigned int v8; // esi
  int v9; // ecx
  int v10; // eax
  int SocketInfo; // [esp+8h] [ebp-4h]

  SocketInfo = GetSocketInfo((int)__return_address, n2); /*0xffc5a23d*/
  GetCpuCount((int)__return_address, n2, n3); /*0xffc5a245*/
  v7 = MiscConfigCheck(__return_address, n2, n3, 184566284); /*0xffc5a267*/
  v8 = ((v7 >> 8) & 7) - (((unsigned int)MiscConfigCheck(__return_address, n2, n3, 184566424) >> 20) & 3); /*0xffc5a285*/
  *a4 = v8; /*0xffc5a287*/
  *a4 = (_WORD)v8 << 7; /*0xffc5a29c*/
  v9 = 7688 * n3; /*0xffc5a2a8*/
  v10 = *(_DWORD *)(v9 + SocketInfo + 6753); /*0xffc5a2af*/
  *a7 = *(_DWORD *)(v9 + SocketInfo + 11) >> 31; /*0xffc5a2c1*/
  *a5 = (unsigned __int8)v10 << 6; /*0xffc5a2d4*/
  *a6 = 512; /*0xffc5a2e5*/
  return a6; /*0xffc5a298*/
}

// Function: MailBoxFuncA2EA @ 0xffc5a2ea (0x70 bytes)
// Index: 735/2560

char __cdecl MailBoxFuncA2EA(unsigned __int8 *__return_address, unsigned __int8 n2, unsigned __int8 n3, _BYTE *a4)
{
  unsigned int v4; // ecx
  char result; // al
  unsigned int v6; // [esp+8h] [ebp-4h]

  v6 = MiscConfigCheck(__return_address, n2, n3, 184566376); /*0xffc5a30b*/
  v4 = MiscConfigCheck(__return_address, n2, n3, 184566392); /*0xffc5a31c*/
  *a4 = BYTE2(v6) & 3; /*0xffc5a333*/
  a4[1] = (v6 >> 20) & 3; /*0xffc5a33a*/
  result = BYTE2(v4) & 3; /*0xffc5a342*/
  a4[2] = BYTE2(v4) & 3; /*0xffc5a346*/
  a4[3] = (v4 >> 20) & 3; /*0xffc5a349*/
  if ( (v4 & 0x30000) == 0 ) /*0xffc5a34e*/
    a4[2] = 1; /*0xffc5a350*/
  return result; /*0xffc5a354*/
}

// Function: MailBoxFuncA35A @ 0xffc5a35a (0x2f bytes)
// Index: 736/2560

char __cdecl MailBoxFuncA35A(
        unsigned __int8 *__return_address,
        unsigned __int8 n4,
        unsigned __int8 n6,
        int *p_n3,
        int *a5)
{
  unsigned int v5; // eax
  char v6; // dl
  char result; // al

  v5 = MiscConfigCheck(__return_address, n4, n6, 184566280); /*0xffc5a36b*/
  v6 = v5 & 7; /*0xffc5a375*/
  result = (v5 >> 3) & 7; /*0xffc5a37e*/
  *(_BYTE *)p_n3 = v6; /*0xffc5a380*/
  *(_BYTE *)a5 = result; /*0xffc5a385*/
  return result; /*0xffc5a387*/
}

// Function: MailBoxFuncA389 @ 0xffc5a389 (0x48 bytes)
// Index: 737/2560

int __cdecl MailBoxFuncA389(unsigned __int8 *n6, unsigned __int8 n6a, int a3, int a4, _WORD *a5)
{
  int v5; // eax

  v5 = MiscConfigCheck(n6, n6a, a3, 184566292); /*0xffc5a39d*/
  *a5 = v5 & 0x7FFF; /*0xffc5a3ae*/
  return MiscIoCheck(n6, n6a, a3, 0xB004214u, v5 ^ (v5 ^ a4) & 0x7FFF); /*0xffc5a3cd*/
}

// Function: MailBoxFuncA3D1 @ 0xffc5a3d1 (0x63 bytes)
// Index: 738/2560

unsigned int __cdecl MailBoxFuncA3D1(_BYTE *__return_address, int a2, unsigned int n2)
{
  unsigned int v3; // esi

  if ( (_BYTE)n2 ) /*0xffc5a3db*/
    v3 = KtiFuncC0FC((int)__return_address) + 102999900; /*0xffc5a401*/
  else
    v3 = KtiFuncC0FC((int)__return_address) + 142999900; /*0xffc5a3ed*/
  n2 = v3 / KtiFuncC0FC((int)__return_address); /*0xffc5a41b*/
  MailBoxFunc9805(__return_address, 23, &n2); /*0xffc5a425*/
  return n2; /*0xffc5a430*/
}

// Function: MailBoxFuncA434 @ 0xffc5a434 (0x183 bytes)
// Index: 739/2560

int __cdecl MailBoxFuncA434(unsigned __int8 *__return_address, unsigned __int8 n2, int n3, int a4, int *p_n2)
{
  int SocketInfo_1; // eax
  int SocketInfo_2; // edi
  unsigned int v7; // esi
  unsigned int v8; // edi
  unsigned __int8 n0xC; // al
  unsigned int v10; // edi
  __int16 v11; // ax
  unsigned __int8 n3_1; // dl
  unsigned __int8 v13; // cl
  int v14; // esi
  char v15; // al
  int SocketInfo; // [esp+10h] [ebp-8h]
  int v17; // [esp+14h] [ebp-4h]
  unsigned __int8 v18; // [esp+28h] [ebp+10h]

  SocketInfo = GetSocketInfo((int)__return_address, n2); /*0xffc5a450*/
  SocketInfo_1 = GetCpuCount((int)__return_address, n2, n3); /*0xffc5a454*/
  SocketInfo_2 = SocketInfo_1; /*0xffc5a460*/
  switch ( a4 ) /*0xffc5a465*/
  {
    case 1: /*0xffc5a465*/
      SocketInfo_1 = KtiFuncC7FE((unsigned int)__return_address, n2); /*0xffc5a59c*/
      *p_n2 ^= ((unsigned __int8)SocketInfo_1 ^ (unsigned __int8)*p_n2) & 0x3F; /*0xffc5a5ae*/
      break;
    case 2: /*0xffc5a465*/
      n3_1 = n3; /*0xffc5a51b*/
      v13 = 0; /*0xffc5a51f*/
      SocketInfo_1 = SocketInfo; /*0xffc5a52a*/
      v18 = 0; /*0xffc5a52e*/
      v17 = 7688 * (unsigned __int8)n3; /*0xffc5a532*/
      if ( *(_BYTE *)(v17 + SocketInfo + 3) ) /*0xffc5a536*/
      {
        do /*0xffc5a596*/
        {
          v14 = 1379 * v13; /*0xffc5a53f*/
          if ( *(_BYTE *)(v14 + SocketInfo_2) ) /*0xffc5a545*/
          {
            if ( *(_BYTE *)(v14 + SocketInfo_2 + 19) == 4 ) /*0xffc5a550*/
            {
              v15 = ProcCommonFunc24FA((int)__return_address, n2, n3_1, v18); /*0xffc5a559*/
              v13 = v18; /*0xffc5a55e*/
              n3_1 = n3; /*0xffc5a565*/
              if ( !v15 && (*(_BYTE *)(v14 + SocketInfo_2 + 131) & 3) == 2 ) /*0xffc5a578*/
                *p_n2 &= 0xF0FFFFFF; /*0xffc5a57e*/
            }
          }
          SocketInfo_1 = SocketInfo; /*0xffc5a584*/
          v18 = ++v13; /*0xffc5a58e*/
        }
        while ( v13 < *(_BYTE *)(v17 + SocketInfo + 3) ); /*0xffc5a596*/
      }
      break;
    case 3: /*0xffc5a465*/
      v7 = MiscConfigCheck(__return_address, n2, n3, 184566296) & 0xFC00FFFF | 0x2000000; /*0xffc5a494*/
      v8 = v7 & 0x7FFFFFF | (KtiFuncC3FF((unsigned int)__return_address) << 27); /*0xffc5a4b6*/
      n0xC = __return_address[48704 * n2 + 258694]; /*0xffc5a4b8*/
      if ( n0xC > 8u ) /*0xffc5a4c1*/
      {
        if ( n0xC > 0xCu ) /*0xffc5a4d3*/
          v10 = v8 & 0xFFFFF000 | 0x400; /*0xffc5a4e9*/
        else
          v10 = v8 & 0xFFFFF000 | 0x300; /*0xffc5a4db*/
      }
      else
      {
        v10 = v8 & 0xFFFFF000 | 0x255; /*0xffc5a4c9*/
      }
      v11 = KtiFuncC874((unsigned int)__return_address); /*0xffc5a4f1*/
      return MiscIoCheck( /*0xffc5a50e*/
               __return_address,
               n2,
               n3,
               0xB004218u,
               v10 ^ ((unsigned __int16)v10 ^ (unsigned __int16)(v11 << 12)) & 0xF000);
  }
  return SocketInfo_1; /*0xffc5a5b0*/
}

// Function: MailBoxFuncA5B7 @ 0xffc5a5b7 (0x181 bytes)
// Index: 740/2560

int __cdecl MailBoxFuncA5B7(
        unsigned __int8 *__return_address,
        unsigned int n2,
        int n3,
        char p_n2,
        int *p_n2a,
        unsigned int *p_p_n2,
        unsigned int *a7)
{
  int SocketInfo; // eax
  int *v8; // edx
  int v9; // eax
  int v10; // ecx
  int v11; // eax
  unsigned int v12; // ecx
  unsigned int v13; // ecx
  int v14; // eax
  int SocketInfo_1; // [esp+10h] [ebp-4h]

  SocketInfo = GetSocketInfo((int)__return_address, n2); /*0xffc5a5c6*/
  *p_n2a &= 0xC7FFFFFF; /*0xffc5a5d5*/
  SocketInfo_1 = SocketInfo; /*0xffc5a5f6*/
  *p_n2a = *p_n2a & 0xF8E3F000 | 0x100B64; /*0xffc5a608*/
  v8 = (int *)a7; /*0xffc5a60c*/
  *p_p_n2 = *p_p_n2 & 0xFFF00000 | 0x23DEF; /*0xffc5a61a*/
  *a7 ^= (*a7 ^ *p_n2a) & 0x38000000; /*0xffc5a625*/
  v9 = *v8 ^ (*v8 ^ *p_n2a) & 7; /*0xffc5a62e*/
  *a7 = v9; /*0xffc5a630*/
  v10 = v9 ^ ((unsigned __int8)v9 ^ (unsigned __int8)((unsigned int)*p_n2a >> 3)) & 0x38; /*0xffc5a63c*/
  *a7 = v10; /*0xffc5a63e*/
  v11 = v10 ^ ((unsigned __int16)v10 ^ (unsigned __int16)((unsigned __int16)*p_p_n2 << 6)) & 0x7C0; /*0xffc5a64c*/
  *a7 = v11; /*0xffc5a64e*/
  v12 = v11 & 0xFFFF07FF | ((unsigned int)*p_n2a >> 7) & 0x3800; /*0xffc5a660*/
  *a7 = v12; /*0xffc5a666*/
  if ( *(_BYTE *)(7688 * (unsigned __int8)n3 + SocketInfo_1 + 6262) == 2 ) /*0xffc5a674*/
  {
    v13 = v12 | 0xFFC0; /*0xffc5a676*/
    *a7 = v13; /*0xffc5a67e*/
    DebugPrint( /*0xffc5a6a4*/
      (int)__return_address,
      2,
      n2,
      n3,
      255,
      255,
      255,
      255,
      "t_rwds = %d, t_wrds = %d\n",
      (v13 >> 6) & 0x1F,
      (unsigned __int16)v13 >> 11);
    v8 = (int *)a7; /*0xffc5a6a9*/
  }
  MiscIoCheck(__return_address, n2, n3, 0xB004290u, *v8); /*0xffc5a6bd*/
  v14 = MiscConfigCheck(__return_address, n2, n3, 184566420); /*0xffc5a6cd*/
  MiscIoCheck(__return_address, n2, n3, 0xB004294u, v14 & 0xFFFFFFC0 | *p_n2a & 7 | ((unsigned int)*p_n2a >> 3) & 0x38); /*0xffc5a6f2*/
  *(_DWORD *)(7688 * (unsigned __int8)n3 + SocketInfo_1 + 6757) = *p_n2a; /*0xffc5a701*/
  MiscIoCheck(__return_address, n2, n3, 0xB004208u, *p_n2a); /*0xffc5a715*/
  return MiscIoCheck(__return_address, n2, n3, 0xB004298u, *p_p_n2); /*0xffc5a732*/
}

// Function: MailBoxFuncA738 @ 0xffc5a738 (0x73 bytes)
// Index: 741/2560

bool __cdecl MailBoxFuncA738(unsigned __int8 *__return_address, unsigned __int8 n2, unsigned __int8 n6)
{
  int SocketInfo; // esi
  _BYTE *CpuCount; // eax
  char v5; // dl
  int v6; // edi
  int v7; // ecx

  SocketInfo = GetSocketInfo((int)__return_address, n2); /*0xffc5a751*/
  CpuCount = (_BYTE *)GetCpuCount((int)__return_address, n2, n6); /*0xffc5a75a*/
  v5 = 0; /*0xffc5a75f*/
  v6 = 7688 * n6; /*0xffc5a768*/
  LOBYTE(v7) = *(_BYTE *)(v6 + SocketInfo + 3); /*0xffc5a76e*/
  if ( (_BYTE)v7 ) /*0xffc5a774*/
  {
    v7 = (unsigned __int8)v7; /*0xffc5a776*/
    do /*0xffc5a78e*/
    {
      if ( *CpuCount && CpuCount[107] != 1 ) /*0xffc5a782*/
        v5 = 1; /*0xffc5a784*/
      CpuCount += 1379; /*0xffc5a786*/
      --v7; /*0xffc5a78b*/
    }
    while ( v7 ); /*0xffc5a78e*/
  }
  return *(_BYTE *)(v6 + SocketInfo + 6716) == 1 && v5; /*0xffc5a798*/
}

// Function: MailBoxFuncA7AB @ 0xffc5a7ab (0x4a bytes)
// Index: 742/2560

int __cdecl MailBoxFuncA7AB(unsigned __int8 *__return_address, unsigned __int8 n2, int n3, unsigned int *p_n2)
{
  int v4; // eax
  unsigned int v6; // [esp-4h] [ebp-Ch]

  v4 = MiscConfigCheck(__return_address, n2, n3, 184566532); /*0xffc5a7c0*/
  *p_n2 = v4; /*0xffc5a7cb*/
  v6 = v4 & 0xC0FFFFFF | 0x25000000; /*0xffc5a7de*/
  *p_n2 = v6; /*0xffc5a7e3*/
  return MiscIoCheck(__return_address, n2, n3, 0xB004304u, v6); /*0xffc5a7f1*/
}

// Function: MailBoxSendRecv @ 0xffc5a7f5 (0xb09 bytes)
// Index: 743/2560

int __cdecl MailBoxSendRecv(unsigned int __return_address, unsigned int n2, int n3)
{
  unsigned __int8 *__return_address_1; // ebx
  unsigned int n2_1; // ebp
  int SocketInfo; // eax
  int n3_1; // esi
  int v7; // edi
  unsigned __int8 n0x14; // al
  __int16 v9; // si
  int v10; // edi
  unsigned int v11; // eax
  unsigned __int8 n3_2; // bp
  unsigned int n2_2; // edi
  int v14; // esi
  int v15; // ecx
  int p_p_n2_1; // eax
  char v17; // bl
  _BYTE *v18; // edx
  bool v19; // zf
  int v20; // esi
  int v21; // esi
  unsigned int v22; // esi
  int v23; // esi
  char v24; // bp
  char v25; // bl
  unsigned int v26; // edi
  char v27; // al
  unsigned int v28; // edi
  unsigned __int8 n2_3; // bp
  int SocketInfo_2; // esi
  unsigned __int8 v31; // al
  int CpuCount_1; // ecx
  int v33; // esi
  int v34; // eax
  int v35; // esi
  char v36; // di
  unsigned int v37; // eax
  unsigned int p_p_n2_3; // eax
  bool v39; // al
  int SocketInfo_3; // ecx
  unsigned int p_n2_1; // edi
  u... [17384 chars total]

// Function: MailBoxFuncB2FE @ 0xffc5b2fe (0x88 bytes)
// Index: 744/2560

int __cdecl MailBoxFuncB2FE(unsigned __int8 *n6, unsigned __int8 n4, int n6a)
{
  int SocketInfo; // edi
  int v4; // esi

  SocketInfo = GetSocketInfo((int)n6, n4); /*0xffc5b314*/
  v4 = 7688 * (unsigned __int8)n6a; /*0xffc5b319*/
  MiscIoCheck(n6, n4, n6a, 0xB00420Cu, *(_DWORD *)(v4 + SocketInfo + 6765)); /*0xffc5b331*/
  MiscIoCheck(n6, n4, n6a, 0xB004298u, *(_DWORD *)(v4 + SocketInfo + 6769)); /*0xffc5b348*/
  MiscIoCheck(n6, n4, n6a, 0x7014A20u, *(_DWORD *)(v4 + SocketInfo + 7489)); /*0xffc5b35f*/
  return MiscIoCheck(n6, n4, n6a, 0x7014A24u, *(_DWORD *)(v4 + SocketInfo + 7493)); /*0xffc5b381*/
}

// Function: MailBoxFuncB386 @ 0xffc5b386 (0x3c bytes)
// Index: 745/2560

int __cdecl MailBoxFuncB386(int __return_address, unsigned __int8 n2, unsigned __int8 n3, char a4)
{
  int result; // eax

  result = GetSocketInfo(__return_address, n2); /*0xffc5b392*/
  *(_BYTE *)(48704 * n2 + __return_address + 304925) = a4; /*0xffc5b3a6*/
  *(_BYTE *)(7688 * n3 + result + 7631) = a4; /*0xffc5b3ba*/
  return result; /*0xffc5b3b8*/
}

// Function: MailBoxFuncB3C2 @ 0xffc5b3c2 (0x4c bytes)
// Index: 746/2560

char __cdecl MailBoxFuncB3C2(
        int __return_address,
        unsigned __int8 n2,
        unsigned __int8 n3,
        unsigned __int8 a4,
        int *p_n31)
{
  int CpuCount; // esi
  int v6; // eax

  CpuCount = GetCpuCount(__return_address, n2, n3); /*0xffc5b3d8*/
  LOBYTE(v6) = ProcCommonFunc24FA(__return_address, n2, n3, a4); /*0xffc5b3e4*/
  if ( (_BYTE)v6 ) /*0xffc5b3ee*/
  {
    v6 = 1379 * a4; /*0xffc5b3f3*/
    if ( *(_BYTE *)(v6 + CpuCount + 126) > 1u ) /*0xffc5b3fe*/
    {
      v6 = *p_n31 | (1 << a4); /*0xffc5b405*/
      *p_n31 = v6; /*0xffc5b408*/
    }
  }
  return v6; /*0xffc5b40a*/
}

// Function: MailBoxFuncB40E @ 0xffc5b40e (0x49 bytes)
// Index: 747/2560

int __cdecl MailBoxFuncB40E(unsigned __int8 *__return_address, unsigned __int8 n4, int n6, int a4)
{
  int result; // eax

  MiscIoCheck(__return_address, n4, n6, 0xB00422Cu, a4 & 0xFFFFFEFF); /*0xffc5b42c*/
  result = 7688 * (unsigned __int8)n6; /*0xffc5b443*/
  *(_DWORD *)&__return_address[48704 * n4 + 265503 + result] = a4 & 0xFFFFFEFF; /*0xffc5b44c*/
  return result; /*0xffc5b453*/
}

// Function: MailBoxFuncB457 @ 0xffc5b457 (0xd9 bytes)
// Index: 748/2560

int __cdecl MailBoxFuncB457(int __return_address, unsigned __int8 n4, int n6, unsigned __int8 n2, __int16 a5)
{
  int v6; // eax
  unsigned int v7; // eax
  unsigned int v8; // eax
  unsigned int v9; // esi
  int result; // eax
  int n6a; // [esp+1Ch] [ebp+Ch]

  n6a = GetCpuCount(__return_address, n4, n6); /*0xffc5b477*/
  v6 = MiscConfigCheck((unsigned __int8 *)__return_address, n4, n6, 184566300); /*0xffc5b47b*/
  if ( *(_BYTE *)(__return_address + 257313) == 1 || *(_WORD *)(__return_address + 257315) != 12 ) /*0xffc5b494*/
    v7 = v6 & 0x7FFFFFFF; /*0xffc5b49d*/
  else
    v7 = v6 | 0x80000000; /*0xffc5b496*/
  if ( *(_BYTE *)(1379 * n2 + n6a + 37) ) /*0xffc5b4b1*/
    v8 = (v7 ^ (v7 | (0x1000000 << n2))) & 0x7000000 ^ v7; /*0xffc5b4cb*/
  else
    v8 = (((~(1 << n2) & 7) << 24) | 0xF8FFFFFF) & v7; /*0xffc5b4de*/
  v9 = a5 & 0x3F | v8 & 0xFF00FFC0 | ((a5 & 0xFF00) << 8); /*0xffc5b4f9*/
  MiscIoCheck((unsigned __int8 *)__return_address, n4, n6, 0xB00421Cu, v9); /*0xffc5b504*/
  result = 7688 * (unsigned __int8)n6; /*0xffc5b51c*/
  *(_DWORD *)(result + __return_address + 48704 * n4 + 265507) = v9; /*0xffc5b525*/
  return result; /*0xffc5b524*/
}

// Function: MailBoxFuncB530 @ 0xffc5b530 (0x43 bytes)
// Index: 749/2560

int __cdecl MailBoxFuncB530(unsigned __int8 *__return_address, unsigned __int8 n4, int n6, int a4)
{
  int result; // eax

  MiscIoCheck(__return_address, n4, n6, 0xB004228u, a4); /*0xffc5b548*/
  result = 7688 * (unsigned __int8)n6; /*0xffc5b55f*/
  *(_DWORD *)&__return_address[48704 * n4 + 265511 + result] = a4; /*0xffc5b568*/
  return result; /*0xffc5b56f*/
}

// Function: MailBoxFuncB573 @ 0xffc5b573 (0x43 bytes)
// Index: 750/2560

int __cdecl MailBoxFuncB573(unsigned __int8 *__return_address, unsigned __int8 n4, int n6, int a4)
{
  int result; // eax

  MiscIoCheck(__return_address, n4, n6, 0xB004230u, a4); /*0xffc5b58b*/
  result = 7688 * (unsigned __int8)n6; /*0xffc5b5a2*/
  *(_DWORD *)&__return_address[48704 * n4 + 265515 + result] = a4; /*0xffc5b5ab*/
  return result; /*0xffc5b5b2*/
}

// Function: MailBoxFuncB5B6 @ 0xffc5b5b6 (0xd8 bytes)
// Index: 751/2560

int __cdecl MailBoxFuncB5B6(unsigned __int8 *__return_address, unsigned __int8 n2, int n3)
{
  int v4; // edi
  unsigned int v5; // esi
  unsigned int v6; // eax
  int v7; // edi
  int v8; // esi
  int v9; // esi
  int SocketInfo; // [esp+14h] [ebp+4h]

  SocketInfo = GetSocketInfo((int)__return_address, n2); /*0xffc5b5d6*/
  v4 = MiscConfigCheck(__return_address, n2, n3, 184567364); /*0xffc5b5e4*/
  v5 = KtiFuncC0FC(__return_address) + 4999500; /*0xffc5b5f1*/
  v6 = KtiFuncC0FC(__return_address); /*0xffc5b5f7*/
  v7 = (v4 ^ (RmtFunc7016(4095, v5 / v6) << 10)) & 0x3FFC00 ^ v4; /*0xffc5b624*/
  v8 = MiscConfigCheck(__return_address, n2, n3, 184567408); /*0xffc5b62e*/
  if ( (__return_address[130] & 0x10) == 0 || *(_BYTE *)(7688 * (unsigned __int8)n3 + SocketInfo + 6673) ) /*0xffc5b648*/
    v9 = v8 & 0xFFBFFFFF; /*0xffc5b65a*/
  else
    v9 = v8 | 0x400000; /*0xffc5b652*/
  MiscIoCheck(__return_address, n2, n3, 0xB004644u, v7); /*0xffc5b66c*/
  return MiscIoCheck(__return_address, n2, n3, 0xB004670u, v9); /*0xffc5b689*/
}

// Function: MailBoxFuncB68E @ 0xffc5b68e (0x4e bytes)
// Index: 752/2560

int __cdecl MailBoxFuncB68E(unsigned __int8 *__return_address, unsigned __int8 n2, int n3, int *p_n2)
{
  int v4; // eax
  int v5; // eax

  v4 = MiscConfigCheck(__return_address, n2, n3, 117525076); /*0xffc5b6a1*/
  if ( (*p_n2 & 0xC0000000) == 0x80000000 ) /*0xffc5b6bb*/
    v5 = v4 | 0x80000000; /*0xffc5b6bd*/
  else
    v5 = v4 & 0x7FFFFFFF; /*0xffc5b6c1*/
  return MiscIoCheck(__return_address, n2, n3, 0x7014A54u, v5); /*0xffc5b6d9*/
}

// Function: MailBoxFuncB6DC @ 0xffc5b6dc (0x60 bytes)
// Index: 753/2560

int __cdecl MailBoxFuncB6DC(int __return_address, int *p_n31, char a3, unsigned int n2)
{
  unsigned __int16 v4; // ax
  int result; // eax

  if ( (*(_DWORD *)(__return_address + 1388) & 0x100000) != 0 ) /*0xffc5b6f0*/
    *p_n31 = *p_n31 & 0xFFFFFFF0 | 0xC; /*0xffc5b6fa*/
  else
    *p_n31 ^= (*p_n31 ^ 4) & 0xF; /*0xffc5b70a*/
  if ( a3 ) /*0xffc5b717*/
    v4 = MailBoxFuncA3D1((_BYTE *)__return_address, *(unsigned __int8 *)(__return_address + 9402), n2); /*0xffc5b71e*/
  else
    v4 = KtiFuncC6BD(__return_address); /*0xffc5b72a*/
  result = v4 << 12; /*0xffc5b734*/
  *p_n31 += result; /*0xffc5b737*/
  return result; /*0xffc5b739*/
}

// Function: MailBoxFuncB73C @ 0xffc5b73c (0x46 bytes)
// Index: 754/2560

int __cdecl MailBoxFuncB73C(unsigned __int8 *__return_address, unsigned __int8 n6, int a3, char n3, char a5)
{
  int v5; // eax

  v5 = MiscConfigCheck(__return_address, n6, a3, 184566280); /*0xffc5b74f*/
  return MiscIoCheck(__return_address, n6, a3, 0xB004208u, n3 & 7 | (8 * (a5 & 7)) | v5 & 0xFFFFFFC0); /*0xffc5b77f*/
}

// Function: MailBoxFuncB782 @ 0xffc5b782 (0x88 bytes)
// Index: 755/2560

int __cdecl MailBoxFuncB782(unsigned __int8 *n6, unsigned __int8 n4, int n6a)
{
  int SocketInfo; // edi
  int v4; // esi

  SocketInfo = GetSocketInfo((int)n6, n4); /*0xffc5b798*/
  v4 = 7688 * (unsigned __int8)n6a; /*0xffc5b79d*/
  MiscIoCheck(n6, n4, n6a, 0xB014080u, *(_DWORD *)(v4 + SocketInfo + 6741)); /*0xffc5b7b5*/
  MiscIoCheck(n6, n4, n6a, 0xB014084u, *(_DWORD *)(v4 + SocketInfo + 6745)); /*0xffc5b7cc*/
  MiscIoCheck(n6, n4, n6a, 0xB01408Cu, *(_DWORD *)(v4 + SocketInfo + 6749)); /*0xffc5b7e3*/
  return MiscIoCheck(n6, n4, n6a, 0xB014090u, *(_DWORD *)(v4 + SocketInfo + 6753)); /*0xffc5b805*/
}

// Function: MailBoxFuncB80A @ 0xffc5b80a (0x33 bytes)
// Index: 756/2560

int __cdecl MailBoxFuncB80A(unsigned __int8 *__return_address, unsigned __int8 n2, int n3)
{
  int v3; // eax

  v3 = MiscConfigCheck(__return_address, n2, n3, 184567552); /*0xffc5b81d*/
  return MiscIoCheck(__return_address, n2, n3, 0xB004700u, v3 | 0x80000); /*0xffc5b83a*/
}

// Function: MailBoxFuncB83D @ 0xffc5b83d (0x73 bytes)
// Index: 757/2560

unsigned int __cdecl MailBoxFuncB83D(
        unsigned int __return_address,
        unsigned __int8 n2,
        int *p_n2,
        unsigned int __return_address_2,
        unsigned int a5)
{
  unsigned int __return_address_1; // eax
  unsigned int v6; // edi

  __return_address_1 = __return_address; /*0xffc5b848*/
  if ( *(_BYTE *)(48704 * n2 + __return_address + 258703) ) /*0xffc5b84c*/
  {
    __return_address_1 = __return_address_2; /*0xffc5b856*/
    v6 = (a5 >> 9) & 0x1F; /*0xffc5b874*/
    if ( (unsigned __int8)HIBYTE(*(_WORD *)p_n2) >> 4 < ((__return_address_2 >> 18) & 7) - v6 + 2 /*0xffc5b88f*/
      && ((__return_address_2 >> 18) & 7) >= v6 - 2 )
    {
      __return_address_1 = (*p_n2 ^ (((2 - v6) << 12) + ((__return_address_2 >> 6) & 0x7000))) & 0xF000; /*0xffc5b8a3*/
      *p_n2 ^= __return_address_1; /*0xffc5b8a8*/
    }
  }
  return __return_address_1; /*0xffc5b8af*/
}

// Function: MailBoxFuncB8B0 @ 0xffc5b8b0 (0x52f bytes)
// Index: 758/2560

int __cdecl MailBoxFuncB8B0(int __return_address, unsigned int n2)
{
  unsigned int v2; // esi
  unsigned __int8 n2_1; // di
  unsigned __int8 *__return_address_1; // ebx
  int SocketInfo; // eax
  unsigned __int8 n3_1; // cl
  int v7; // ebp
  unsigned int v8; // esi
  int v9; // edi
  unsigned __int8 v10; // bh
  unsigned __int8 v11; // bl
  unsigned __int8 v12; // bl
  unsigned int v13; // eax
  int v14; // esi
  unsigned int v15; // edi
  unsigned int n0x1F_1; // edx
  unsigned int v17; // esi
  unsigned __int16 n0x1F; // ax
  unsigned int v19; // ecx
  unsigned int v20; // esi
  _BYTE *v21; // ecx
  int n2_2; // edx
  int v24; // [esp-4h] [ebp-40h]
  unsigned __int8 v25; // [esp+10h] [ebp-2Ch]
  unsigned int v26; // [esp+10h] [ebp-2Ch]
  __int16 v27; // [esp+10h] [ebp-2Ch]
  unsigned int n3; // [esp+14h] [ebp-28h]
  unsigned int v29; // [esp+18h] [ebp-24h]
  unsigned int v30; // [esp+1Ch] [ebp-20h]
  unsigned int v31; // [esp+1Ch] [ebp-20h]
  int v32; // [esp+20h] [ebp-1Ch]
  int CpuCount; // [esp+24h] [ebp-18h]
  int v34; // [esp+28h] [ebp-14h]
  unsigned __int8 v35[16]; // [esp+2Ch] [ebp-10h] BYREF

  n3 = KtiFuncC0FC(__return_address); /*0xffc5b8ce*/
  v2 = 20000 * (((*(_DWORD *)(__return_address + 134) >> 23) & 1) + 4); /*0xffc5b906*/
  n2_1 = n2; /*0xffc5b92c*/
  __return_address_1 = (unsigned __int8 *)__return_address; /*0xffc5b931*/
  v29 = ((v2 >> 1)
       - 33000
       + (*(_BYTE *)(__return_address + 1006) != 0 ? 0x2710 : 0)
       + ((unsigned int)(*(_BYTE *)(__return_address + 1007) != 0 ? 0x2710 : 0) >> 1)
       + 2 * (0x9F437C0 / n3 + 2500))
      / 0x2710;
  DebugPrint(
    __return_address,
    2,
    n2,
    255,
    255,
    255,
    255,
    255,
    "(x10000) tck = %d, tPDM_RD=%d, tPDM_WR=%d, tWRPRE=%d, tRPRE=%d, BL=%d, specMin=%d\n",
    n3,
    0x9F437C0 / n3 + 2500,
    0x9F437C0 / n3 + 2500,
    *(_BYTE *)(__return_address + 1006) != 0 ? 0x2710 : 0,
    *(_BYTE *)(__return_address + 1007) != 0 ? 0x2710 : 0,
    v2,
    v29);
  SocketInfo = GetSocketInfo(__return_address, n2); /*0xffc5b95b*/
  n3_1 = 0; /*0xffc5b962*/
  LOBYTE(n3) = 0; /*0xffc5b964*/
  v7 = SocketInfo + 6262; /*0xffc5b968*/
  do /*0xffc5bdcf*/
  {
    if ( *(_BYTE *)(v7 - 6262) ) /*0xffc5b96e*/
    {
      CpuCount = GetCpuCount((int)__return_address_1, n2_1, n3); /*0xffc5b98f*/
      v8 = MiscConfigCheck(__return_address_1, n2_1, n3, 184566280); /*0xffc5b9a3*/
      v34 = MiscConfigCheck(__return_address_1, n2_1, n3, 184566284); /*0xffc5b9b5*/
      v9 = MiscConfigCheck(__return_address_1, n2_1, n3, 184566424); /*0xffc5b9c9*/
      v32 = MiscConfigCheck(__return_address_1, n2, n3, 184566416); /*0xffc5b9db*/
      if ( *(_BYTE *)(v7 - 6259) > 2u && *(_BYTE *)(v7 + 411) && *(_BYTE *)v7 == 2 ) /*0xffc5b9f5*/
      {
        v8 ^= (v8 ^ ((v8 & 0xF8000000) + 0x10000000)) & 0x38000000; /*0xffc5ba0a*/
        *(_WORD *)(v7 - 5906) = (v8 >> 27) & 7; /*0xffc5ba14*/
      }
      RmtFunc85F1(__return_address_1, n2, n3, v35, 0); /*0xffc5ba2b*/
      v25 = MailBoxFunc9750((int)__return_address_1, n2, n3, v35); /*0xffc5ba43*/
      v10 = MailBoxFunc96DD((int)__return_address_1, n2, n3, v35); /*0xffc5ba5a*/
      v11 = RmtFunc7684(__return_address, n2, n3, 2u, v35); /*0xffc5ba7d*/
      v30 = v8 & 0xFFFFF000 /*0xffc5bac8*/
          | v25 & 7
          | (8 * (v10 & 7 | (8 * (v11 & 7 | (8 * (RmtFunc75F8(__return_address, n2, n3, 2u, v35) & 7))))));
      v12 = RmtFunc74DB(__return_address, n2, n3, v29, v35); /*0xffc5bae3*/
      v13 = v9 & 0xFFFF83E0 | ((v12 & 0x1F) << 10) | RmtFunc7442(__return_address, n2, n3, v29, v35) & 0x1F; /*0xffc5bb14*/
      v26 = v13; /*0xffc5bb1a*/
      if ( (*(_BYTE *)v7 || *(_BYTE *)(v7 + 414)) && ((v13 >> 10) & 0x1F) < (v13 & 0x1F) ) /*0xffc5bb36*/
        v26 = ((v13 & 0x1F) << 10) | v13 & 0xFFFF83FF; /*0xffc5bb42*/
      __return_address_1 = (unsigned __int8 *)__return_address; /*0xffc5bb46*/
      v14 = ((unsigned __int16)v26 /*0xffc5bb6e*/
           ^ (unsigned __int16)(32 * (unsigned __int8)RmtFunc73F8(__return_address, n2, n3, v35)))
          & 0x3E0
          ^ v26;
      v15 = (v30 ^ (RmtFunc75B2(__return_address, n2, n3, v35) << 18)) & 0x1C0000 ^ v30; /*0xffc5bb94*/
      v31 = v14 & 0xFFF07C1F /*0xffc5bbd0*/
          | ((v14 & 0xFFE0) + 32) & 0x3E0
          | ((RmtFunc756C(__return_address, n2, n3, v35) & 0x1F) << 15);
      n0x1F_1 = v14 & 0x1F; /*0xffc5bbda*/
      v17 = v15 & 7 | v32 & 0xFFFF0000 | (n0x1F_1 << 6) | ((v15 & 0x1C0 | (v15 >> 4) & 0x1C000) >> 3); /*0xffc5bc05*/
      if ( *(_BYTE *)v7 == 2 ) /*0xffc5bc0b*/
      {
        n0x1F = *(unsigned __int8 *)(v7 - 5955) - *(unsigned __int8 *)(v7 - 5942); /*0xffc5bc1f*/
        v27 = *(unsigned __int8 *)(v7 - 5942); /*0xffc5bc22*/
        if ( n0x1F > n0x1F_1 ) /*0xffc5bc2e*/
        {
          if ( n0x1F >= 0x1Fu ) /*0xffc5bc36*/
            v17 |= 0x7C0u; /*0xffc5bc46*/
          else
            v17 ^= ((unsigned __int16)v17 ^ (unsigned __int16)(n0x1F << 6)) & 0x7C0; /*0xffc5bc42*/
        }
        v19 = (unsigned __int16)(v27 + *(unsigned __int8 *)(v7 - 5948) - 1); /*0xffc5bc62*/
        if ( v19 > ((v15 >> 18) & 7) ) /*0xffc5bc69*/
        {
          if ( (unsigned __int16)(v27 + *(unsigned __int8 *)(v7 - 5948) - 1) >= 0x1Fu ) /*0xffc5bc71*/
            v17 |= 0xF800u; /*0xffc5bc82*/
          else
            v17 ^= ((unsigned __int16)v17 ^ (unsigned __int16)((_WORD)v19 << 11)) & 0xF800; /*0xffc5bc7e*/
        }
        DebugPrint( /*0xffc5bcb4*/
          __return_address,
          2,
          n2,
          n3,
          255,
          255,
          255,
          255,
          "t_rwds = %d, t_wrds = %d\n",
          (v17 >> 6) & 0x1F,
          (unsigned __int16)v17 >> 11);
      }
      v20 = (v15 ^ v17) & 0x38000000 ^ v17; /*0xffc5bccb*/
      v21 = (_BYTE *)(CpuCount + 218); /*0xffc5bccd*/
      n2_2 = 2; /*0xffc5bcd3*/
      do /*0xffc5bd1f*/
      {
        if ( *(v21 - 218) /*0xffc5bd08*/
          && *((_WORD *)v21 - 39) == 12806
          && *v21 == 1
          && *(v21 - 1) == 16
          && *(_BYTE *)(v7 + 411)
          && (v20 & 0x38000000) < 0x10000000 )
        {
          v20 = v20 & 0xC7FFFFFF | 0x10000000; /*0xffc5bd10*/
        }
        v21 += 1379; /*0xffc5bd16*/
        --n2_2; /*0xffc5bd1c*/
      }
      while ( n2_2 ); /*0xffc5bd1f*/
      if ( (*(_DWORD *)(__return_address + 134) & 0x800000) != 0 ) /*0xffc5bd2b*/
        v20 ^= (v20 ^ ((v20 & 0xF8000000) + 0x10000000)) & 0x38000000; /*0xffc5bd40*/
      v24 = v15; /*0xffc5bd42*/
      *(_DWORD *)(v7 + 495) = v15; /*0xffc5bd4e*/
      n2_1 = n2; /*0xffc5bd54*/
      *(_WORD *)(v7 - 5904) = (v20 >> 27) & 7; /*0xffc5bd60*/
      MiscIoCheck((unsigned __int8 *)__return_address, n2, n3, 0xB004208u, v24); /*0xffc5bd67*/
      *(_DWORD *)(v7 + 503) = v34; /*0xffc5bd7a*/
      MiscIoCheck((unsigned __int8 *)__return_address, n2, n3, 0xB00420Cu, v34); /*0xffc5bd82*/
      *(_DWORD *)(v7 + 507) = v31; /*0xffc5bd95*/
      MiscIoCheck((unsigned __int8 *)__return_address, n2, n3, 0xB004298u, v31); /*0xffc5bd9d*/
      *(_DWORD *)(v7 + 511) = v20; /*0xffc5bdac*/
      MiscIoCheck((unsigned __int8 *)__return_address, n2, n3, 0xB004290u, v20); /*0xffc5bdb4*/
      n3_1 = n3; /*0xffc5bdb9*/
    }
    ++n3_1; /*0xffc5bdc0*/
    v7 += 7688; /*0xffc5bdc2*/
    LOBYTE(n3) = n3_1; /*0xffc5bdc8*/
  }
  while ( n3_1 < 6u ); /*0xffc5bdcf*/
  return 0; /*0xffc5bdd5*/
}

// Function: MailBoxFuncBDDF @ 0xffc5bddf (0x4c7 bytes)
// Index: 759/2560

int __cdecl MailBoxFuncBDDF(unsigned __int8 *__return_address, int n2)
{
  int v2; // ebx
  unsigned int v3; // edi
  int n2_1; // esi
  int SocketInfo; // eax
  unsigned __int8 n3_2; // cl
  _BYTE *v8; // eax
  int n3_1; // ebx
  unsigned int v10; // edi
  _BYTE *CpuCount_1; // ecx
  char n2_2; // al
  char v13; // bl
  char v14; // al
  char v15; // cl
  unsigned __int8 v16; // al
  unsigned __int16 v17; // si
  unsigned int v18; // edi
  unsigned int v20; // [esp-10h] [ebp-54h]
  unsigned int v21; // [esp+10h] [ebp-34h]
  int n3; // [esp+14h] [ebp-30h]
  char p_n0xE[4]; // [esp+18h] [ebp-2Ch] BYREF
  unsigned __int8 v24[4]; // [esp+1Ch] [ebp-28h] BYREF
  char v25[4]; // [esp+20h] [ebp-24h]
  int CpuCount; // [esp+24h] [ebp-20h]
  unsigned int v27; // [esp+28h] [ebp-1Ch]
  int v28; // [esp+2Ch] [ebp-18h]
  __int16 v29; // [esp+30h] [ebp-14h]
  unsigned __int8 v30[16]; // [esp+34h] [ebp-10h] BYREF
  unsigned int v31; // [esp+48h] [ebp+4h]

  v27 = KtiFuncC0FC((int)__return_address); /*0xffc5bdfd*/
  v2 = __return_address[1006] != 0 ? 0x2710 : 0;
  v3 = __return_address[1007] != 0 ? 0x2710 : 0;
  v20 = 20000 * (((*(_DWORD *)(__return_address + 134) >> 23) & 1) + 4); /*0xffc5be58*/
  n2_1 = n2; /*0xffc5be5a*/
  v28 = ((v20 >> 1) - 33000 + v2 + (v3 >> 1) + 2 * (0x9F437C0 / v27 + 2500)) / 0x2710; /*0xffc5be6e*/
  DebugPrint( /*0xffc5be80*/
    (int)__return_address,
    2,
    n2,
    255,
    255,
    255,
    255,
    255,
    "(x10000) tck = %d, tPDM_RD=%d, tPDM_WR=%d, tWRPRE=%d, tRPRE=%d, BL=%d, specMin=%d\n",
    v27,
    0x9F437C0 / v27 + 2500,
    0x9F437C0 / v27 + 2500,
    v2,
    v3,
    v20,
    v28);
  SocketInfo = GetSocketInfo((int)__return_address, n2); /*0xffc5be8a*/
  n3_2 = 0; /*0xffc5be91*/
  v8 = (_BYTE *)(SocketInfo + 6716); /*0xffc5be93*/
  LOBYTE(n3) = 0; /*0xffc5be98*/
  v27 = (unsigned int)v8; /*0xffc5be9c*/
  do
  {
    if ( *(v8 - 6716) && *v8 )
    {
      n3_1 = n3; /*0xffc5beb6*/
      CpuCount = GetCpuCount((int)__return_address, n2_1, n3); /*0xffc5bec4*/
      RmtFunc85F1(__return_address, n2_1, n3, v30, 1); /*0xffc5bed0*/
      v29 = MiscConfigCheck(__return_address, n2_1, n3, 117516816); /*0xffc5beea*/
      v10 = MiscConfigCheck(__return_address, n2_1, n3, 184566616); /*0xffc5bef7*/
      v21 = MiscConfigCheck(__return_address, n2_1, n3, 117525004); /*0xffc5bf0e*/
      v31 = MiscConfigCheck(__return_address, n2_1, n3, 117525000); /*0xffc5bf2b*/
      DebugPrint(
        (int)__return_address,
        2,
        n2,
        n3,
        255,
        255,
        255,
        255,
        "t_ddrt_wrgnt_dd before calculation: %d\n",
        HIBYTE(v21));
      DebugPrint(
        (int)__return_address,
        2,
        n2,
        n3,
        255,
        255,
        255,
        255,
        "t_ddrt_gntwr_dd before calculation: %d\n",
        HIBYTE(v31));
      DebugPrint(
        (int)__return_address,
        2,
        n2,
        n3,
        255,
        255,
        255,
        255,
        "ddrtwr_to_ddr4rd before calculation: %d\n",
        HIWORD(v10) & 0x3F);
      DebugPrint(
        (int)__return_address,
        2,
        n2,
        n3,
        255,
        255,
        255,
        255,
        "ddrtrd_to_ddr4wr before calculation: %d\n",
        (v10 >> 8) & 0x3F);
      DebugPrint(
        (int)__return_address,
        2,
        n2,
        n3,
        255,
        255,
        255,
        255,
        "t_ddrt_gntwr_s before calculation: %d\n",
        BYTE2(v31));
      CpuCount_1 = (_BYTE *)CpuCount; /*0xffc5bfda*/
      n2_2 = 0; /*0xffc5bfe1*/
      v25[0] = 0; /*0xffc5bfe3*/
      do
      {
        if ( *CpuCount_1 && CpuCount_1[107] == 1 )
        {
          ProcCommonFunc1B0D((int)__return_address, n2, n3_1, v25[0], v24, p_n0xE); /*0xffc5c00b*/
          DebugPrint((int)__return_address, 2, n2, n3_1, 255, 255, 255, 255, "DDRTCL: %d\n", v24[0]);
          DebugPrint(
            (int)__return_address,
            2,
            n2,
            n3_1,
            255,
            255,
            255,
            255,
            "DDRTCWL: %d\n",
            (unsigned __int8)p_n0xE[0]);
          if ( *(_BYTE *)(v27 - 6713) == 2 ) /*0xffc5c05d*/
          {
            v21 = ((unsigned __int8)MailBoxFunc9341((int)__return_address, n2, n3_1, v24[0], v30) << 24) /*0xffc5c085*/
                | v21 & 0xFFFFFF;
            v31 = ((unsigned __int8)MailBoxFunc92B3((int)__return_address, n2, n3_1, p_n0xE[0], v30) << 24) /*0xffc5c0ab*/
                | v31 & 0xFFFFFF;
            v13 = MailBoxFunc95E8((int)__return_address, n2, n3_1, p_n0xE[0], v30); /*0xffc5c0c0*/
            v14 = MailBoxFunc9566((int)__return_address, n2, n3, v24[0], v30); /*0xffc5c0d1*/
            v15 = v13; /*0xffc5c0d6*/
            n3_1 = n3; /*0xffc5c0dc*/
            v10 = ((((v15 & 0x3F) << 8) | v14 & 0x3F) << 8) | v10 & 0xFFC0C0FF; /*0xffc5c0f4*/
          }
          v16 = MailBoxFunc966A((int)__return_address, n2, n3_1, v24[0], p_n0xE[0], v28, v30); /*0xffc5c10a*/
          CpuCount_1 = (_BYTE *)CpuCount; /*0xffc5c123*/
          v31 = (v16 << 16) | v31 & 0xFF00FFFF; /*0xffc5c127*/
          n2_2 = v25[0]; /*0xffc5c12b*/
        }
        ++n2_2; /*0xffc5c12f*/
        CpuCount_1 += 1379; /*0xffc5c131*/
        v25[0] = n2_2; /*0xffc5c137*/
        CpuCount = (int)CpuCount_1; /*0xffc5c13b*/
      }
      while ( (unsigned __int8)n2_2 < 2u );
      v17 = MailBoxFunc90F8(__return_address, n2, n3_1, v30); /*0xffc5c154*/
      v18 = ((unsigned __int8)v10 ^ MailBoxFunc93CF(__return_address, n2, n3_1, v30)) & 0x3F ^ v10; /*0xffc5c16c*/
      MiscIoCheck(__return_address, n2, n3_1, 0xB004358u, v18); /*0xffc5c17a*/
      MiscIoCheck(__return_address, n2, n3_1, 0x7012A10u, (unsigned __int8)v29 | (unsigned __int16)(v17 << 8)); /*0xffc5c19b*/
      MiscIoCheck(__return_address, n2, n3_1, 0x7014A08u, v31); /*0xffc5c1b6*/
      MiscIoCheck(__return_address, n2, n3_1, 0x7014A0Cu, v21); /*0xffc5c1ca*/
      DebugPrint(
        (int)__return_address,
        2,
        n2,
        n3_1,
        255,
        255,
        255,
        255,
        "t_ddrt_wrgnt_dd after calculation: %d\n",
        HIBYTE(v21));
      n2_1 = n2; /*0xffc5c201*/
      DebugPrint(
        (int)__return_address,
        2,
        n2,
        n3_1,
        255,
        255,
        255,
        255,
        "t_ddrt_gntwr_dd after calculation: %d\n",
        HIBYTE(v31));
      DebugPrint(
        (int)__return_address,
        2,
        n2,
        n3_1,
        255,
        255,
        255,
        255,
        "ddrtwr_to_ddr4rd after calculation: %d\n",
        HIWORD(v18) & 0x3F);
      DebugPrint(
        (int)__return_address,
        2,
        n2,
        n3_1,
        255,
        255,
        255,
        255,
        "ddrtrd_to_ddr4wr after calculation: %d\n",
        (v18 >> 8) & 0x3F);
      DebugPrint(
        (int)__return_address,
        2,
        n2,
        n3_1,
        255,
        255,
        255,
        255,
        "t_ddrt_gntwr_s after calculation: %d\n",
        BYTE2(v31));
      v8 = (_BYTE *)v27; /*0xffc5c279*/
      n3_2 = n3; /*0xffc5c280*/
    }
    ++n3_2; /*0xffc5c284*/
    v8 += 7688; /*0xffc5c286*/
    LOBYTE(n3) = n3_2; /*0xffc5c28b*/
    v27 = (unsigned int)v8; /*0xffc5c28f*/
  }
  while ( n3_2 < 6u );
  return 0; /*0xffc5c29c*/
}

// Function: MailBoxFuncC2A6 @ 0xffc5c2a6 (0x109 bytes)
// Index: 760/2560

int __cdecl MailBoxFuncC2A6(unsigned __int8 *__return_address, unsigned int n2)
{
  _BYTE *SocketInfo; // ebp
  unsigned __int8 n3_1; // al
  int v4; // esi
  unsigned __int16 v5; // di
  unsigned __int8 v6; // al
  int n3; // [esp+10h] [ebp-18h]
  unsigned __int8 v9; // [esp+14h] [ebp-14h]
  _BYTE v10[16]; // [esp+18h] [ebp-10h] BYREF

  SocketInfo = (_BYTE *)GetSocketInfo((int)__return_address, n2); /*0xffc5c2ba*/
  n3_1 = 0; /*0xffc5c2bc*/
  LOBYTE(n3) = 0; /*0xffc5c2c0*/
  do /*0xffc5c39f*/
  {
    if ( *SocketInfo && SocketInfo[6716] ) /*0xffc5c2ce*/
    {
      RmtFunc85F1(__return_address, n2, n3, v10, 1); /*0xffc5c2ef*/
      v9 = MiscConfigCheck(__return_address, n2, n3, 117516816); /*0xffc5c311*/
      v4 = MiscConfigCheck(__return_address, n2, n3, 184566616); /*0xffc5c31f*/
      v5 = MailBoxFunc90F8(__return_address, n2, n3, v10); /*0xffc5c337*/
      v6 = MailBoxFunc93CF(__return_address, n2, n3, v10); /*0xffc5c348*/
      MiscIoCheck(__return_address, n2, n3, 0xB004358u, v4 ^ ((unsigned __int8)v4 ^ v6) & 0x3F); /*0xffc5c366*/
      MiscIoCheck(__return_address, n2, n3, 0x7012A10u, v9 | (unsigned __int16)(v5 << 8)); /*0xffc5c387*/
      n3_1 = n3; /*0xffc5c38f*/
    }
    ++n3_1; /*0xffc5c391*/
    SocketInfo += 7688; /*0xffc5c393*/
    LOBYTE(n3) = n3_1; /*0xffc5c399*/
  }
  while ( n3_1 < 6u ); /*0xffc5c39f*/
  return 0; /*0xffc5c3a5*/
}

// Function: MailBoxFuncC3AF @ 0xffc5c3af (0x86 bytes)
// Index: 761/2560

int __cdecl MailBoxFuncC3AF(unsigned __int8 *n6, char n4, int n6a, char n4a, unsigned __int8 a5, unsigned __int8 n2)
{
  int SocketInfo; // ebx
  int v7; // eax
  int v8; // esi
  unsigned int v9; // eax
  int v11; // [esp-4h] [ebp-10h]

  SocketInfo = GetSocketInfo((int)n6, n4); /*0xffc5c3c3*/
  v7 = KtiFunc91AF((int)n6, n4, n6a, n4a); /*0xffc5c3ce*/
  v8 = 242 * a5; /*0xffc5c3df*/
  v11 = *(_DWORD *)(SocketInfo + 4 * (n2 + 1922 * (unsigned __int8)n6a + 18 * *(unsigned __int8 *)(v8 + v7 + 1)) + 5614); /*0xffc5c405*/
  v9 = MailBoxFunc4C47((int)n6, *(_BYTE *)(v8 + v7 + 3), n2, 0x8004280u); /*0xffc5c416*/
  return MiscIoCheck(n6, n4, n6a, v9, v11); /*0xffc5c430*/
}

// Function: MailBoxFuncC435 @ 0xffc5c435 (0xa9 bytes)
// Index: 762/2560

__int16 __cdecl MailBoxFuncC435(int a1, char *a2)
{
  int v2; // ebx
  char *v3; // ebp
  unsigned __int8 n0x10; // dl
  int v5; // esi
  int v6; // ecx
  int v7; // eax
  _BYTE *v8; // edi
  int v9; // eax
  int v10; // ebx
  char *v11; // edx
  int v12; // ecx
  int v13; // eax
  _BYTE *v14; // esi
  int v15; // edi
  bool v16; // zf
  __int16 result; // ax
  int n16; // [esp+14h] [ebp-D4h]
  _DWORD v19[24]; // [esp+18h] [ebp-D0h] BYREF
  _BYTE v20[112]; // [esp+78h] [ebp-70h] BYREF

  v2 = a1; /*0xffc5c443*/
  v3 = a2; /*0xffc5c451*/
  n0x10 = 0; /*0xffc5c453*/
  do /*0xffc5c48b*/
  {
    v5 = v2; /*0xffc5c45b*/
    v6 = (n0x10 - 4) & 0xF; /*0xffc5c45d*/
    v7 = 7 * v6; /*0xffc5c464*/
    v2 += 7; /*0xffc5c467*/
    v6 *= 6; /*0xffc5c46a*/
    v8 = &v20[v7]; /*0xffc5c46d*/
    v9 = *(_DWORD *)v3; /*0xffc5c46f*/
    ++n0x10; /*0xffc5c472*/
    v3 += 6; /*0xffc5c474*/
    *(_DWORD *)v8 = *(_DWORD *)v5; /*0xffc5c477*/
    v5 += 4; /*0xffc5c477*/
    v8 += 4; /*0xffc5c477*/
    *(_DWORD *)((char *)v19 + v6) = v9; /*0xffc5c478*/
    *(_WORD *)((char *)&v19[1] + v6) = *((_WORD *)v3 - 1); /*0xffc5c480*/
    *(_WORD *)v8 = *(_WORD *)v5; /*0xffc5c485*/
    v8[2] = *(_BYTE *)(v5 + 2); /*0xffc5c487*/
  }
  while ( n0x10 < 0x10u ); /*0xffc5c48b*/
  v10 = a1; /*0xffc5c48d*/
  v11 = a2; /*0xffc5c498*/
  n16 = 16; /*0xffc5c4a5*/
  v12 = (char *)v19 - a2; /*0xffc5c4ad*/
  do /*0xffc5c4d1*/
  {
    v13 = *(_DWORD *)&v11[v12]; /*0xffc5c4af*/
    v14 = &v20[v10 - a1]; /*0xffc5c4b2*/
    v15 = v10; /*0xffc5c4b5*/
    v10 += 7; /*0xffc5c4b7*/
    v16 = n16-- == 1; /*0xffc5c4ba*/
    *(_DWORD *)v15 = *(_DWORD *)v14; /*0xffc5c4bf*/
    v14 += 4; /*0xffc5c4bf*/
    v15 += 4; /*0xffc5c4bf*/
    *(_WORD *)v15 = *(_WORD *)v14; /*0xffc5c4c0*/
    *(_BYTE *)(v15 + 2) = v14[2]; /*0xffc5c4c2*/
    *(_DWORD *)v11 = v13; /*0xffc5c4c3*/
    v11 += 6; /*0xffc5c4c5*/
    result = *(_WORD *)&v11[v12 - 2]; /*0xffc5c4c8*/
    *((_WORD *)v11 - 1) = result; /*0xffc5c4cd*/
  }
  while ( !v16 ); /*0xffc5c4d1*/
  return result; /*0xffc5c4d3*/
}

// Function: MailBoxFuncC4DE @ 0xffc5c4de (0x96 bytes)
// Index: 763/2560

int __cdecl MailBoxFuncC4DE(int SocketInfo, int a2, int a3, unsigned __int8 a4)
{
  char v4; // cl
  int v5; // eax
  unsigned __int8 v6; // si
  char v7; // al
  char v8; // dl
  char v9; // bl
  char v10; // bl

  v4 = 0; /*0xffc5c4e3*/
  v5 = 7688 * a4; /*0xffc5c4e9*/
  v6 = 0; /*0xffc5c4f6*/
  if ( *(_BYTE *)(v5 + SocketInfo + 6262) == 2 ) /*0xffc5c500*/
  {
    v7 = *(_BYTE *)(v5 + SocketInfo + 6263); /*0xffc5c502*/
    if ( (v7 & 4) != 0 ) /*0xffc5c50b*/
      v6 = (*(_BYTE *)(a2 + 4) & 4) != 0; /*0xffc5c513*/
    if ( (v7 & 2) != 0 && (*(_BYTE *)(a2 + 4) & 2) != 0 ) /*0xffc5c51c*/
    {
      v8 = 1; /*0xffc5c520*/
    }
    else
    {
      v8 = 0; /*0xffc5c523*/
      v4 = 1; /*0xffc5c527*/
    }
    if ( (v7 & 1) == 0 || (*(_BYTE *)(a2 + 4) & 1) == 0 ) /*0xffc5c530*/
      v4 = v8; /*0xffc5c532*/
    v6 ^= v4; /*0xffc5c534*/
  }
  v9 = MailBoxFuncC574(*(_BYTE *)(a2 + 5) & 0xF); /*0xffc5c547*/
  v10 = MailBoxFuncC574(*(_BYTE *)(a3 + 2) & 0xF) ^ v9; /*0xffc5c558*/
  return (v6 ^ (unsigned __int8)(v10 ^ MailBoxFuncC574(*(_DWORD *)a2 & 0x3FFFF))) & 1; /*0xffc5c570*/
}

// Function: MailBoxFuncC574 @ 0xffc5c574 (0x15 bytes)
// Index: 764/2560

unsigned int __cdecl MailBoxFuncC574(unsigned int a1)
{
  unsigned int n16; // ecx

  n16 = 16; /*0xffc5c57a*/
  do /*0xffc5c583*/
  {
    a1 ^= a1 >> n16; /*0xffc5c57f*/
    n16 >>= 1; /*0xffc5c581*/
  }
  while ( n16 ); /*0xffc5c583*/
  return a1 & 1; /*0xffc5c588*/
}

// Function: MailBoxFuncC589 @ 0xffc5c589 (0x8c bytes)
// Index: 765/2560

char __cdecl MailBoxFuncC589(unsigned __int8 *__return_address, char n6)
{
  unsigned __int8 n2_1; // bh
  unsigned __int8 n4_1; // bl
  char result; // al
  _BYTE v5[432]; // [esp+4h] [ebp-1BCh] BYREF
  int n6_1; // [esp+1B4h] [ebp-Ch]
  int n2; // [esp+1B8h] [ebp-8h]
  unsigned __int8 n4; // [esp+1BCh] [ebp-4h]

  RmtFunc9414((int)__return_address, n6, (int)v5); /*0xffc5c5a0*/
  LOBYTE(n6_1) = 0; /*0xffc5c5aa*/
  do /*0xffc5c60e*/
  {
    n2_1 = 0; /*0xffc5c5ad*/
    LOBYTE(n2) = 0; /*0xffc5c5af*/
    do /*0xffc5c601*/
    {
      n4_1 = 0; /*0xffc5c5b2*/
      n4 = 0; /*0xffc5c5b4*/
      do /*0xffc5c5f7*/
      {
        result = KtiFunc89E9((int)__return_address, n6, n6_1, n2, n4, 0); /*0xffc5c5c8*/
        if ( !result ) /*0xffc5c5d2*/
          result = DdrTrainFunc135C(__return_address, n6, n2, n4, (int)v5); /*0xffc5c5e7*/
        n4 = ++n4_1; /*0xffc5c5f1*/
      }
      while ( n4_1 < 4u ); /*0xffc5c5f7*/
      LOBYTE(n2) = ++n2_1; /*0xffc5c5fb*/
    }
    while ( n2_1 < 2u ); /*0xffc5c601*/
    LOBYTE(n6_1) = n6_1 + 1; /*0xffc5c608*/
  }
  while ( (unsigned __int8)n6_1 < 6u ); /*0xffc5c60e*/
  return result; /*0xffc5c610*/
}

// Function: MailBoxFuncC615 @ 0xffc5c615 (0x804 bytes)
// Index: 766/2560

int __usercall MailBoxFuncC615@<eax>(
        int a1@<eax>,
        unsigned __int8 *__return_address,
        int buf,
        int n6,
        int n1021,
        int a6,
        int n20,
        int a8)
{
  int SocketInfo; // esi
  int n6_4; // edi
  unsigned int n0x70; // ebx
  unsigned int v11; // edx
  _DWORD *v12; // edi
  int v13; // ecx
  _DWORD *v14; // edi
  int v15; // ecx
  char *v16; // esi
  __int16 v17; // cx
  int v18; // ecx
  _DWORD *v19; // edi
  int v20; // ecx
  int v21; // ecx
  _BYTE *v22; // edi
  char *v23; // esi
  int n6_1; // edi
  unsigned __int8 buf_1; // si
  bool v26; // cc
  _DWORD *src_4; // eax
  unsigned int v28; // eax
  int v29; // eax
  unsigned __int8 n6_2; // al
  _DWORD *v32; // edi
  int v33; // ecx
  int v34; // eax
  int v35; // eax
  char v36; // [esp+13h] [ebp-4F5h]
  int n6_3; // [esp+14h] [ebp-4F4h]
  int SocketInfo_1; // [esp+18h] [ebp-4F0h]
  int v39; // [esp+18h] [ebp-4F0h]
  __int16 v40; // [esp+20h] [ebp-4E8h] BYREF
  bool v41; // [e... [12855 chars total]

// Function: MailBoxFuncCE19 @ 0xffc5ce19 (0x2d4 bytes)
// Index: 767/2560

int __cdecl MailBoxFuncCE19(unsigned __int8 *__return_address, int n4, int n6, int a4, char a5)
{
  int v6; // edi
  unsigned int n67092735; // esi
  int n3_1; // ecx
  unsigned __int8 *v9; // esi
  unsigned __int8 v10; // ch
  unsigned __int8 v11; // cl
  int v12; // eax
  int v13; // eax
  unsigned int v14; // eax
  unsigned __int8 n2; // cl
  unsigned int v16; // eax
  int v17; // eax
  int n3; // [esp-8h] [ebp-28h]
  __int16 v20; // [esp+Ch] [ebp-14h] BYREF
  char v21; // [esp+Eh] [ebp-12h]
  int v22; // [esp+Fh] [ebp-11h]
  int n66559; // [esp+13h] [ebp-Dh]
  int v24; // [esp+17h] [ebp-9h]
  __int16 n255; // [esp+1Bh] [ebp-5h]
  char v26; // [esp+24h] [ebp+4h]
  int n251658488; // [esp+34h] [ebp+14h]

  DebugPrint((int)__return_address, 32, n4, n6, 255, a4, 255, 255, "CpgcAdvCmdPatternSetup\n"); /*0xffc5ce41*/
  KtiFunc8C4((int)__return_address, 0x32u); /*0xffc5ce49*/
  v21 = a5; /*0xffc5ce52*/
  v26 = 0; /*0xffc5ce58*/
  v20 = 0; /*0xffc5ce5c*/
  v22 = -3668735; /*0xffc5ce69*/
  n66559 = 66559; /*0xffc5ce71*/
  v24 = -16777216; /*0xffc5ce79*/
  n255 = 255; /*0xffc5ce81*/
  MailBoxFuncDB89(__return_address, n4, n6, (unsigned __int8 *)&v20); /*0xffc5ce88*/
  DdrTrainFuncE35((int)__return_address, n4, n6, 1 << a4, 0, 0); /*0xffc5cea0*/
  if ( !DdrTrainFunc30F((int)__return_address, n4, n6, a4) || (n251658488 = 201326840, __return_address[246412]) ) /*0xffc5cebb*/
    n251658488 = 251658488; /*0xffc5cecc*/
  v6 = KtiFunc9CA7(__return_address, n4, n6, a4) ? 0x3FFFF : 0x1FFFF;
  n67092735 = (DdrTrainFunc30F((int)__return_address, n4, n6, a4) != 0 ? 8235 : 25452587) | 0x80000000;
  if ( *(_WORD *)(__return_address + 257315) == 11 ) /*0xffc5cf26*/
  {
    n3_1 = 1; /*0xffc5cf2a*/
  }
  else
  {
    if ( !DdrTrainFunc30F((int)__return_address, n4, n6, a4) || __return_address[246412] ) /*0xffc5cf43*/
      n3 = 3; /*0xffc5cf50*/
    else
      n3 = 4; /*0xffc5cf4c*/
    n3_1 = n3; /*0xffc5cf52*/
  }
  MailBoxFuncF745(__return_address, n4, n6, 5, 0, 0, 7, 1, 3, n67092735, n3_1 | 0x200, 0, 0, n251658488, v6, 0); /*0xffc5cf76*/
  MailBoxFuncD972(__return_address, n4, n6, 1); /*0xffc5cf80*/
  if ( *(_WORD *)(__return_address + 257315) == 11 ) /*0xffc5cf98*/
    DdrTrainFunc4EE(__return_address, n4, n6, 0, 0x10u, (int)&unk_FFD52F1C, (int)&unk_FFD52F8C); /*0xffc5cf9f*/
  else
    DdrTrainFunc4EE(__return_address, n4, n6, 0, 0x10u, (int)&unk_FFD52EAC, (int)&unk_FFD52F8C); /*0xffc5cfae*/
  v9 = &__return_address[48704 * (unsigned __int8)n4 + 7688 * (unsigned __int8)n6]; /*0xffc5cfd7*/
  v10 = v9[258725]; /*0xffc5cfda*/
  if ( v10 ) /*0xffc5cfe3*/
  {
    v11 = 0; /*0xffc5cfe5*/
    while ( 1 ) /*0xffc5cfec*/
    {
      v12 = 1379 * v11; /*0xffc5cfec*/
      if ( v9[v12 + 259118] ) /*0xffc5cff2*/
      {
        if ( v9[v12 + 259225] ) /*0xffc5cffc*/
          break; /*0xffc5cffc*/
      }
      if ( ++v11 >= v10 ) /*0xffc5d00a*/
        goto LABEL_21; /*0xffc5d00a*/
    }
    v26 = 1; /*0xffc5d00e*/
  }
LABEL_21:
  v13 = MiscConfigCheck(__return_address, n4, n6, 184567040); /*0xffc5d013*/
  if ( v26 ) /*0xffc5d02d*/
    v14 = v13 & 0xFFFFFFFE; /*0xffc5d02f*/
  else
    v14 = v13 | 1; /*0xffc5d034*/
  n2 = __return_address[257313]; /*0xffc5d037*/
  v16 = v14 & 0xFFFFFFF5; /*0xffc5d03d*/
  if ( n2 == 1 || n2 == 2 ) /*0xffc5d048*/
    v17 = v16 | 4; /*0xffc5d04f*/
  else
    v17 = v16 & 0xFFFFFFFB; /*0xffc5d04a*/
  MiscIoCheck(__return_address, n4, n6, 0xB004500u, v17); /*0xffc5d05e*/
  MiscIoCheck(__return_address, n4, n6, 0xB00450Cu, 21845); /*0xffc5d073*/
  MiscIoCheck(__return_address, n4, n6, 0xB004510u, 13107); /*0xffc5d088*/
  MiscIoCheck(__return_address, n4, n6, 0xB004514u, 3855); /*0xffc5d09d*/
  MiscIoCheck(__return_address, n4, n6, 0xB004518u, 255); /*0xffc5d0b5*/
  MiscIoCheck(__return_address, n4, n6, 0xB004508u, 8738); /*0xffc5d0ca*/
  DdrTrainFunc2300(__return_address, n4, n6, 0xE0u, 1u); /*0xffc5d0dc*/
  return 0; /*0xffc5d0e6*/
}

// Function: MailBoxFuncD0ED @ 0xffc5d0ed (0xe4 bytes)
// Index: 768/2560

int __cdecl MailBoxFuncD0ED(unsigned __int8 *__return_address, int n4, int n6, int a4, char a5, char a6)
{
  __int16 v7; // [esp+Ch] [ebp-14h] BYREF
  char v8; // [esp+Eh] [ebp-12h]
  __int16 n1281; // [esp+Fh] [ebp-11h]
  char v10; // [esp+11h] [ebp-Fh]
  int n17039359; // [esp+12h] [ebp-Eh]
  int n0x10000; // [esp+16h] [ebp-Ah]
  __int16 v13; // [esp+1Ah] [ebp-6h]
  char v14; // [esp+1Ch] [ebp-4h]

  DebugPrint((int)__return_address, 32, n4, n6, 255, a4, 255, 255, "CpgcAdvDqSetup\n"); /*0xffc5d114*/
  v8 = a6; /*0xffc5d122*/
  v7 = 0; /*0xffc5d125*/
  n1281 = 1281; /*0xffc5d12b*/
  n17039359 = 17039359; /*0xffc5d138*/
  n0x10000 = 0x10000; /*0xffc5d13f*/
  v13 = -1; /*0xffc5d148*/
  v10 = DdrTrainFunc30F((int)__return_address, n4, n6, a4) != 0 ? -56 : 4;
  v14 = 0; /*0xffc5d157*/
  MailBoxFuncDB89(__return_address, n4, n6, (unsigned __int8 *)&v7); /*0xffc5d161*/
  DdrTrainFuncE35((int)__return_address, n4, n6, 1 << a4, 0, a5); /*0xffc5d17c*/
  MailBoxFuncF745(__return_address, n4, n6, 5, 0, 0, 7, 1, 2, 8193, 4, 0, 0, 117444600, 0xFFFF, 0); /*0xffc5d1a4*/
  MailBoxFuncD972(__return_address, n4, n6, 0); /*0xffc5d1b1*/
  MiscIoCheck(__return_address, n4, n6, 0xB004500u, 0); /*0xffc5d1c0*/
  return 0; /*0xffc5d1ca*/
}

// Function: MailBoxFuncD1D1 @ 0xffc5d1d1 (0xf4 bytes)
// Index: 769/2560

int __cdecl MailBoxFuncD1D1(unsigned __int8 *a1, int a2, int a3, int a4)
{
  unsigned __int8 n6; // bl
  char v5; // bp
  int *v6; // esi
  int v8; // [esp+10h] [ebp-4h]

  n6 = 0; /*0xffc5d1d9*/
  v5 = 0; /*0xffc5d1e0*/
  LOBYTE(v8) = 0; /*0xffc5d1e2*/
  v6 = (int *)(a4 + 16); /*0xffc5d1e6*/
  do
  {
    if ( ((1 << v5) & a3) != 0 )
    {
      *(v6 - 4) = MiscConfigCheck(a1, a2, v8, 184567128); /*0xffc5d216*/
      *(v6 - 3) = MiscConfigCheck(a1, a2, v8, 184567132); /*0xffc5d22c*/
      *(v6 - 2) = MiscConfigCheck(a1, a2, v8, 184567136); /*0xffc5d242*/
      *(v6 - 1) = MiscConfigCheck(a1, a2, v8, 184567140); /*0xffc5d252*/
      if ( a1[257312] ) /*0xffc5d255*/
        *v6 = MiscConfigCheck(a1, a2, v8, 184567312); /*0xffc5d274*/
      else
        *v6 = 0; /*0xffc5d278*/
      DebugPrint(
        (int)a1,
        32,
        a2,
        v8,
        255,
        255,
        255,
        255,
        "CpgcAdvTrainingErrorStatus: cpgcErr0 = 0x%x, cpgcErr1 = 0x%x, cpgcErr2 = 0x%x, cpgcErr3 = 0x%x, cpgcErrEccS = 0x%x\n",
        *(v6 - 4),
        *(v6 - 3),
        *(v6 - 2),
        *(v6 - 1),
        *v6);
    }
    ++n6; /*0xffc5d2aa*/
    v6 += 5; /*0xffc5d2ac*/
    ++v5; /*0xffc5d2af*/
    LOBYTE(v8) = n6; /*0xffc5d2b0*/
  }
  while ( n6 < 6u );
  return 0; /*0xffc5d2bd*/
}

// Function: MailBoxFuncD2C5 @ 0xffc5d2c5 (0x1a1 bytes)
// Index: 770/2560

int __cdecl MailBoxFuncD2C5(unsigned __int8 *src_, int n6, int n63a, int a4)
{
  unsigned __int8 n6_1; // dl
  int v5; // ecx
  int n63a_1; // esi
  int *v7; // edi
  unsigned __int8 v8; // al
  unsigned __int8 v9; // al
  unsigned int v10; // eax
  int v12; // [esp-34h] [ebp-50h]
  int v13; // [esp-30h] [ebp-4Ch]
  int v14; // [esp-2Ch] [ebp-48h]
  int v15; // [esp-28h] [ebp-44h]
  int v16; // [esp-24h] [ebp-40h]
  int n6_2; // [esp+10h] [ebp-Ch]
  int v18; // [esp+14h] [ebp-8h]
  int v19; // [esp+18h] [ebp-4h]

  n6_1 = 0; /*0xffc5d2cd*/
  v5 = 0; /*0xffc5d2d4*/
  n63a_1 = n63a; /*0xffc5d2d7*/
  LOBYTE(n6_2) = 0; /*0xffc5d2e0*/
  v7 = (int *)(a4 + 36); /*0xffc5d2e4*/
  v18 = 0; /*0xffc5d2e7*/
  do
  {
    if ( ((1 << v5) & n63a_1) != 0 )
    {
      *(v7 - 9) = MiscConfigCheck(src_, n6, n6_2, 184567128); /*0xffc5d311*/
      *(v7 - 8) = MiscConfigCheck(src_, n6, n6_2, 184567132); /*0xffc5d321*/
      *(v7 - 7) = MiscConfigCheck(src_, n6, n6_2, 184567136); /*0xffc5d331*/
      *(v7 - 6) = MiscConfigCheck(src_, n6, n6_2, 184567140); /*0xffc5d33c*/
      if ( src_[257312] ) /*0xffc5d33f*/
        *(v7 - 5) = MiscConfigCheck(src_, n6, n6_2, 184567312); /*0xffc5d358*/
      else
        *(v7 - 5) = 0; /*0xffc5d35d*/
      LOBYTE(v19) = DdrTrainFunc45AB((int)src_, n6, n6_2); /*0xffc5d369*/
      v8 = DdrTrainFunc459C(v19, n6_2); /*0xffc5d373*/
      v7[1] = MailBoxFunc8E0B((int)src_, (int)src_, n6, v19, 4 * v8 + 117460304) & 7; /*0xffc5d393*/
      v9 = DdrTrainFunc459C(v19, n6_2); /*0xffc5d396*/
      *v7 = MailBoxFunc8E0B((int)src_, (int)src_, n6, v19, 4 * v9 + 117459884) & 7; /*0xffc5d3bd*/
      *(v7 - 4) = MiscConfigCheck(src_, n6, n6_2, 184567144); /*0xffc5d3c7*/
      *(v7 - 2) = MiscConfigCheck(src_, n6, n6_2, 184567152) & 0x3FFFF; /*0xffc5d3e4*/
      v10 = MiscConfigCheck(src_, n6, n6_2, 184567156); /*0xffc5d3e7*/
      v16 = *(v7 - 5); /*0xffc5d3ec*/
      v15 = *(v7 - 6); /*0xffc5d3f1*/
      v14 = *(v7 - 7); /*0xffc5d3fa*/
      *(v7 - 3) = v10 & 0x2FFC; /*0xffc5d3fd*/
      v13 = *(v7 - 8); /*0xffc5d402*/
      v12 = *(v7 - 9); /*0xffc5d40d*/
      *(v7 - 1) = (v10 & 0x3000000 | (v10 >> 4) & 0xC00000) >> 22; /*0xffc5d42e*/
      DebugPrint(
        (int)src_,
        32,
        n6,
        n6_2,
        255,
        255,
        255,
        255,
        "CpgcAdvTrainingErrorStatusMATS: cpgcErr0 = 0x%x, cpgcErr1 = 0x%x, cpgcErr2 = 0x%x, cpgcErr3 = 0x%x, cpgcErrEccS = 0x%x\n",
        v12,
        v13,
        v14,
        v15,
        v16);
      n6_1 = n6_2; /*0xffc5d436*/
      v5 = v18; /*0xffc5d43d*/
      n63a_1 = n63a; /*0xffc5d441*/
    }
    ++n6_1; /*0xffc5d445*/
    v7 += 11; /*0xffc5d447*/
    ++v5; /*0xffc5d44a*/
    LOBYTE(n6_2) = n6_1; /*0xffc5d44b*/
    v18 = v5; /*0xffc5d44f*/
  }
  while ( n6_1 < 6u );
  return 0; /*0xffc5d45c*/
}

// Function: MailBoxFuncD466 @ 0xffc5d466 (0x48 bytes)
// Index: 771/2560

int __usercall MailBoxFuncD466@<eax>(int a1@<edi>, int __return_address, int a3, int a4, unsigned __int16 a5)
{
  DebugPrint(
    __return_address,
    32,
    a3,
    255,
    255,
    255,
    255,
    255,
    "CpgcAdvTrainingExecuteTest: ChEnMap = 0x%x, pattern = %d\n",
    a4,
    a5);
  MailBoxFuncDA23(__return_address, a3, a4); /*0xffc5d496*/
  return CpgcChannelInit(a1, __return_address, a3, a4); /*0xffc5d4ac*/
}

// Function: MailBoxFuncD4AE @ 0xffc5d4ae (0x17 bytes)
// Index: 772/2560

int __usercall MailBoxFuncD4AE@<eax>(int n6@<edi>, int __return_address, int a3, int n6a)
{
  return MailBoxFuncD466(n6, __return_address, a3, n6a, 0); /*0xffc5d4c4*/
}

// Function: MailBoxFuncD4C5 @ 0xffc5d4c5 (0xfe bytes)
// Index: 773/2560

int __cdecl MailBoxFuncD4C5(
        unsigned __int8 *__return_address,
        int n4,
        int a3,
        int a4,
        char a5,
        int n40,
        int a7,
        char a8)
{
  int SocketInfo; // eax
  unsigned __int8 n6_1; // bl
  char v10; // cl
  _BYTE *SocketInfo_1; // ebp
  int n6; // [esp+Ch] [ebp-8h]
  int v14; // [esp+10h] [ebp-4h]

  DebugPrint(
    (int)__return_address,
    32,
    n4,
    255,
    255,
    a4,
    255,
    255,
    "CpgcAdvTrainingSetup: ChEnMap = 0x%x, pattern = %d\n",
    a3,
    a7);
  SocketInfo = GetSocketInfo((int)__return_address, n4); /*0xffc5d4f9*/
  n6_1 = 0; /*0xffc5d4fe*/
  v10 = 0; /*0xffc5d503*/
  LOBYTE(n6) = 0; /*0xffc5d505*/
  SocketInfo_1 = (_BYTE *)SocketInfo; /*0xffc5d509*/
  v14 = 0; /*0xffc5d50b*/
  do
  {
    if ( ((1 << v10) & a3) != 0 && *SocketInfo_1 )
    {
      if ( (a7 & 0xF) != 0 )
      {
        if ( (a7 & 0xF) == 1 )
        {
          MailBoxFuncCE19(__return_address, n4, n6, a4, a8); /*0xffc5d577*/
        }
        else
        {
          AssertPrint(
            __return_address,
            255,
            (int)"\n\nRC_ASSERT! %s: %u   %s ",
            "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Mem\\MemCpgc.c",
            3471,
            "FALSE");
          ProcMemInitCheck((int)__return_address, 242, 47); /*0xffc5d55c*/
        }
      }
      else
      {
        MailBoxFuncD0ED(__return_address, n4, n6, a4, a5, a8); /*0xffc5d596*/
      }
    }
    ++n6_1; /*0xffc5d59e*/
    SocketInfo_1 += 7688; /*0xffc5d5a0*/
    v10 = ++v14; /*0xffc5d5aa*/
    LOBYTE(n6) = n6_1; /*0xffc5d5ae*/
  }
  while ( n6_1 < 6u );
  return 0; /*0xffc5d5bb*/
}

// Function: MailBoxFuncD5C3 @ 0xffc5d5c3 (0x310 bytes)
// Index: 774/2560

int __cdecl MailBoxFuncD5C3(unsigned __int8 *__return_address, int n6, int n6a, int a4)
{
  int n2_2; // edx
  unsigned int n0x70; // ebp
  unsigned int v6; // ecx
  int v7; // eax
  int v8; // eax
  int SocketInfo_1; // ecx
  int v10; // eax
  int n2_1; // [esp-4h] [ebp-10Ch]
  char n2; // [esp+11h] [ebp-F7h]
  char v14; // [esp+12h] [ebp-F6h]
  char v15; // [esp+13h] [ebp-F5h]
  unsigned __int8 v16; // [esp+14h] [ebp-F4h] BYREF
  int n33620224; // [esp+15h] [ebp-F3h]
  int v18; // [esp+19h] [ebp-EFh]
  int v19; // [esp+1Dh] [ebp-EBh]
  int n16776960; // [esp+21h] [ebp-E7h]
  int v21; // [esp+28h] [ebp-E0h]
  int n1023; // [esp+2Ch] [ebp-DCh]
  int n3; // [esp+30h] [ebp-D8h]
  int SocketInfo; // [esp+34h] [ebp-D4h]
  _DWORD v25[24]; // [esp+38h] [ebp-D0h] BYREF
  _DWORD v26[28]; // [esp+98h] [ebp-70h] BYREF

  DebugPrint((int)__return_address, 2, n6, n6a, 255, 255, 255, 255, "CpgcAdvCtlPattern\n"); /*0xffc5d5f4*/
  SocketInfo = GetSocketInfo((int)__return_address, n6); /*0xffc5d606*/
  v16 = 0; /*0xffc5d60c*/
  v18 = 0; /*0xffc5d610*/
  n33620224 = 33620224; /*0xffc5d622*/
  v19 = 1; /*0xffc5d62a*/
  n16776960 = 16776960; /*0xffc5d632*/
  MailBoxFuncDB89(__return_address, n6, n6a, &v16); /*0xffc5d63a*/
  n3 = 3; /*0xffc5d66d*/
  MailBoxFuncF745(__return_address, n6, n6a, 0, 0, 0, 3, 1, 2, -2147287040, 516, 0, 0, 117444600, 4096, 0); /*0xffc5d674*/
  n2_2 = 0; /*0xffc5d680*/
  n2 = 0; /*0xffc5d685*/
  v14 = 0; /*0xffc5d689*/
  n1023 = 1023; /*0xffc5d68d*/
  v15 = 0; /*0xffc5d698*/
  switch ( a4 ) /*0xffc5d6ac*/
  {
    case 3: /*0xffc5d6ac*/
      n2 = 1; /*0xffc5d746*/
      break; /*0xffc5d74b*/
    case 4: /*0xffc5d6ac*/
      n2 = 2; /*0xffc5d74d*/
      break; /*0xffc5d752*/
    case 6: /*0xffc5d6ac*/
      n2_2 = 1; /*0xffc5d6da*/
      break; /*0xffc5d6db*/
    case 7: /*0xffc5d6ac*/
      n2_1 = 2; /*0xffc5d6e0*/
      goto LABEL_6; /*0xffc5d6e0*/
    case 8: /*0xffc5d6ac*/
      n2_1 = 4; /*0xffc5d6e8*/
      goto LABEL_6; /*0xffc5d6ea*/
    case 9: /*0xffc5d6ac*/
      n2_1 = 8; /*0xffc5d6ec*/
      goto LABEL_6; /*0xffc5d6ee*/
    case 10: /*0xffc5d6ac*/
      n2_1 = 16; /*0xffc5d6f0*/
      goto LABEL_6; /*0xffc5d6f2*/
    case 11: /*0xffc5d6ac*/
      n2_1 = 32; /*0xffc5d6f4*/
      goto LABEL_6; /*0xffc5d6f6*/
    case 12: /*0xffc5d6ac*/
      n2_1 = 64; /*0xffc5d6f8*/
LABEL_6:
      n2_2 = n2_1; /*0xffc5d6e2*/
      break; /*0xffc5d6e3*/
    case 13: /*0xffc5d6ac*/
      n2_2 = 128; /*0xffc5d6fc*/
      break; /*0xffc5d701*/
    case 14: /*0xffc5d6ac*/
      n2_2 = 256; /*0xffc5d703*/
      break; /*0xffc5d708*/
    case 15: /*0xffc5d6ac*/
      n2_2 = 512; /*0xffc5d70a*/
      break; /*0xffc5d70f*/
    case 16: /*0xffc5d6ac*/
      n2_2 = 1024; /*0xffc5d711*/
      break; /*0xffc5d716*/
    case 17: /*0xffc5d6ac*/
      n2_2 = 2048; /*0xffc5d718*/
      break; /*0xffc5d71d*/
    case 18: /*0xffc5d6ac*/
      n2_2 = 4096; /*0xffc5d71f*/
      break; /*0xffc5d721*/
    case 19: /*0xffc5d6ac*/
      n2_2 = 0x2000; /*0xffc5d723*/
      break; /*0xffc5d728*/
    case 20: /*0xffc5d6ac*/
      n2_2 = 0x4000; /*0xffc5d72a*/
      break; /*0xffc5d72f*/
    case 21: /*0xffc5d6ac*/
      n2_2 = 0x8000; /*0xffc5d731*/
      break; /*0xffc5d736*/
    case 22: /*0xffc5d6ac*/
      n2_2 = 0x10000; /*0xffc5d738*/
      break; /*0xffc5d73d*/
    case 23: /*0xffc5d6ac*/
      n2_2 = 0x20000; /*0xffc5d73f*/
      break; /*0xffc5d744*/
    case 26: /*0xffc5d6ac*/
    case 27: /*0xffc5d6ac*/
    case 30: /*0xffc5d6ac*/
    case 31: /*0xffc5d6ac*/
      n1023 = (unsigned __int16)(1 << (a4 - 24)); /*0xffc5d6bf*/
      break; /*0xffc5d6c3*/
    case 46: /*0xffc5d6ac*/
      v15 = 1; /*0xffc5d762*/
      break; /*0xffc5d767*/
    case 48: /*0xffc5d6ac*/
      n2 = 4; /*0xffc5d754*/
      break; /*0xffc5d759*/
    case 49: /*0xffc5d6ac*/
      n2 = 8; /*0xffc5d75b*/
      break; /*0xffc5d760*/
    case 50: /*0xffc5d6ac*/
      LOBYTE(n3) = 8; /*0xffc5d769*/
      break; /*0xffc5d769*/
    case 51: /*0xffc5d6ac*/
    case 52: /*0xffc5d6ac*/
    case 53: /*0xffc5d6ac*/
      v14 = 1 << (a4 - 51); /*0xffc5d6cf*/
      break; /*0xffc5d6d3*/
    default:
      break;
  }
  v21 = 0; /*0xffc5d76e*/
  n0x70 = 0; /*0xffc5d772*/
  v6 = 0; /*0xffc5d778*/
  do /*0xffc5d7ef*/
  {
    *(_DWORD *)((char *)v25 + v6) = *(int *)((char *)&dword_FFD5263C + v6); /*0xffc5d78d*/
    *(_WORD *)((char *)&v25[1] + v6) = word_FFD52640[v6 / 2]; /*0xffc5d79e*/
    v7 = v21; /*0xffc5d7a3*/
    *(_DWORD *)((char *)v26 + n0x70) = *(_DWORD *)&byte_FFD63A44[n0x70]; /*0xffc5d7a7*/
    *(_WORD *)((char *)&v26[1] + n0x70) = *(_WORD *)&byte_FFD63A44[n0x70 + 4]; /*0xffc5d7a8*/
    *((_BYTE *)&v26[1] + n0x70 + 2) = byte_FFD63A44[n0x70 + 6]; /*0xffc5d7aa*/
    if ( (v7 & 1) == 0 ) /*0xffc5d7ad*/
    {
      *(_WORD *)((char *)v25 + v6) = n1023; /*0xffc5d7b3*/
      *((_BYTE *)&v25[1] + v6 + 1) = v15; /*0xffc5d7bc*/
      *((_BYTE *)v25 + v6 + 2) = n3; /*0xffc5d7c4*/
      v7 = v21; /*0xffc5d7c8*/
      *(_DWORD *)((char *)v26 + n0x70) = n2_2; /*0xffc5d7cc*/
      *((_BYTE *)&v26[1] + n0x70 + 1) = n2; /*0xffc5d7d3*/
      *((_BYTE *)&v26[1] + n0x70) = v14; /*0xffc5d7da*/
    }
    n0x70 += 7; /*0xffc5d7e2*/
    v6 += 6; /*0xffc5d7e5*/
    v21 = v7 + 1; /*0xffc5d7e8*/
  }
  while ( n0x70 < 0x70 ); /*0xffc5d7ef*/
  DdrTrainFunc4EE(__return_address, n6, n6a, 0, 2u, (int)v26, (int)v25); /*0xffc5d81a*/
  v8 = MiscConfigCheck(__return_address, n6, n6a, 184567040); /*0xffc5d828*/
  MiscIoCheck(__return_address, n6, n6a, 0xB004500u, v8 & 0xFFFFFFF4 | 2); /*0xffc5d838*/
  MiscIoCheck(__return_address, n6, n6a, 0xB00450Cu, 21845); /*0xffc5d84d*/
  MiscIoCheck(__return_address, n6, n6a, 0xB004510u, 0); /*0xffc5d85d*/
  MiscIoCheck(__return_address, n6, n6a, 0xB004514u, 0); /*0xffc5d86b*/
  MiscIoCheck(__return_address, n6, n6a, 0xB004518u, 0); /*0xffc5d879*/
  SocketInfo_1 = SocketInfo; /*0xffc5d87e*/
  v10 = 7688 * (unsigned __int8)n6a; /*0xffc5d88b*/
  *(_DWORD *)(v10 + SocketInfo + 7607) = 21845; /*0xffc5d89e*/
  *(_DWORD *)(v10 + SocketInfo_1 + 7611) = 0; /*0xffc5d8a9*/
  *(_DWORD *)(v10 + SocketInfo_1 + 7615) = 0; /*0xffc5d8b0*/
  *(_DWORD *)(v10 + SocketInfo_1 + 7619) = 0; /*0xffc5d8b7*/
  MiscIoCheck(__return_address, n6, n6a, 0xB004508u, 4369); /*0xffc5d8be*/
  return 0; /*0xffc5d8c8*/
}

// Function: MailBoxFuncD972 @ 0xffc5d972 (0xb1 bytes)
// Index: 775/2560

int __cdecl MailBoxFuncD972(unsigned __int8 *__return_address, int n4, int n6, char a4)
{
  char *v4; // ecx
  int v5; // esi
  int n8; // ebp
  unsigned int v7; // edx
  int n64; // ebx
  char v9; // al
  char v11[2048]; // [esp+10h] [ebp-800h] BYREF

  DebugPrint((int)__return_address, 32, n4, n6, 255, 255, 255, 255, "CpgcFillWdbDqVa\n"); /*0xffc5d9a2*/
  v4 = v11; /*0xffc5d9aa*/
  v5 = 0; /*0xffc5d9ae*/
  n8 = 8; /*0xffc5d9b2*/
  do /*0xffc5d9f5*/
  {
    v7 = 0; /*0xffc5d9b5*/
    n64 = 64; /*0xffc5d9b7*/
    do /*0xffc5d9ed*/
    {
      if ( a4 == 1 && *(_WORD *)(__return_address + 257315) == 12 ) /*0xffc5d9ca*/
        v9 = byte_FFD2EBE4[(v7 >> 3) + v5]; /*0xffc5d9d1*/
      else
        v9 = byte_FFD2EBA4[(v7 >> 3) + v5]; /*0xffc5d9df*/
      ++v7; /*0xffc5d9e6*/
      *v4++ = v9; /*0xffc5d9e7*/
      --n64; /*0xffc5d9ea*/
    }
    while ( n64 ); /*0xffc5d9ed*/
    v5 += 8; /*0xffc5d9ef*/
    --n8; /*0xffc5d9f2*/
  }
  while ( n8 ); /*0xffc5d9f5*/
  RmtFunc71F8(__return_address, n4, n6, v11, 8u, 0); /*0xffc5da0e*/
  return 0; /*0xffc5da18*/
}

// Function: MailBoxFuncDA23 @ 0xffc5da23 (0xb9 bytes)
// Index: 776/2560

int __cdecl MailBoxFuncDA23(int a1, unsigned __int8 a2, int a3)
{
  unsigned __int8 n6; // bl
  char v4; // si
  char v5; // al
  char v6; // bp
  int v7; // eax
  unsigned __int8 v9; // [esp+Ch] [ebp-10h]
  unsigned __int8 v10; // [esp+10h] [ebp-Ch]
  unsigned __int8 n6_1; // [esp+14h] [ebp-8h]

  KtiFunc41B3(a1, 8u, 1); /*0xffc5da31*/
  n6 = 0; /*0xffc5da3b*/
  v10 = 0; /*0xffc5da3d*/
  n6_1 = 0; /*0xffc5da41*/
  v4 = 0; /*0xffc5da45*/
  do /*0xffc5dacd*/
  {
    if ( ((1 << v4) & a3) != 0 ) /*0xffc5da52*/
    {
      v5 = DdrTrainFunc45AB(a1, a2, n6_1); /*0xffc5da60*/
      v6 = v5; /*0xffc5da65*/
      v9 = v5; /*0xffc5da6b*/
      if ( ((1 << v5) & v10) == 0 ) /*0xffc5da83*/
      {
        v7 = MailBoxFunc8E0B(n6, a1, a2, v5, 117459712); /*0xffc5da96*/
        MailBoxFunc8FC5(a1, a2, v9, 117459712, v7 | 5); /*0xffc5dab0*/
        v10 |= 1 << v6; /*0xffc5dabf*/
      }
    }
    ++n6; /*0xffc5dac3*/
    ++v4; /*0xffc5dac5*/
    n6_1 = n6; /*0xffc5dac6*/
  }
  while ( n6 < 6u ); /*0xffc5dacd*/
  return 0; /*0xffc5dad3*/
}

// Function: MailBoxFuncDADC @ 0xffc5dadc (0xad bytes)
// Index: 777/2560

int __cdecl MailBoxFuncDADC(int a1, unsigned __int8 a2, int a3)
{
  unsigned __int8 n6; // bl
  char v4; // si
  char v5; // al
  char v6; // di
  int v7; // eax
  unsigned __int8 v9; // [esp+10h] [ebp-10h]
  unsigned __int8 v10; // [esp+14h] [ebp-Ch]
  unsigned __int8 n6_1; // [esp+18h] [ebp-8h]

  n6 = 0; /*0xffc5dae8*/
  v10 = 0; /*0xffc5daea*/
  n6_1 = 0; /*0xffc5daef*/
  v4 = 0; /*0xffc5daf3*/
  do /*0xffc5db79*/
  {
    if ( ((1 << v4) & a3) != 0 ) /*0xffc5dafe*/
    {
      v5 = DdrTrainFunc45AB(a1, a2, n6_1); /*0xffc5db0c*/
      v6 = v5; /*0xffc5db11*/
      v9 = v5; /*0xffc5db17*/
      if ( ((1 << v5) & v10) == 0 ) /*0xffc5db2f*/
      {
        v7 = MailBoxFunc8E0B(n6, a1, a2, v5, 117459712); /*0xffc5db42*/
        MailBoxFunc8FC5(a1, a2, v9, 117459712, v7 | 2); /*0xffc5db5c*/
        v10 |= 1 << v6; /*0xffc5db6b*/
      }
    }
    ++n6; /*0xffc5db6f*/
    ++v4; /*0xffc5db71*/
    n6_1 = n6; /*0xffc5db72*/
  }
  while ( n6 < 6u ); /*0xffc5db79*/
  return 0; /*0xffc5db7f*/
}

// Function: MailBoxFuncDB89 @ 0xffc5db89 (0x2a9 bytes)
// Index: 778/2560

int __cdecl MailBoxFuncDB89(unsigned __int8 *a1, int a2, int a3, unsigned __int8 *a4)
{
  unsigned __int8 v4; // bl
  unsigned __int8 v5; // bh
  int v6; // esi
  int v7; // edi
  char v8; // al
  int v9; // edi
  int v10; // eax
  int v11; // eax
  char v12; // al
  int v13; // edx
  unsigned __int8 v15; // [esp+11h] [ebp-17h]
  unsigned __int8 v16; // [esp+12h] [ebp-16h]
  unsigned __int8 v17; // [esp+13h] [ebp-15h]
  unsigned __int8 v18; // [esp+14h] [ebp-14h]
  unsigned __int8 v19; // [esp+15h] [ebp-13h]
  unsigned __int8 v20; // [esp+16h] [ebp-12h]
  unsigned __int8 v21; // [esp+17h] [ebp-11h]
  unsigned __int8 v22; // [esp+18h] [ebp-10h]
  unsigned __int8 v23; // [esp+19h] [ebp-Fh]
  unsigned __int8 v24; // [esp+1Ah] [ebp-Eh]
  unsigned __int8 v25; // [esp+1Bh] [ebp-Dh]
  int v26; // [esp+1Ch] [ebp-Ch]
  int v27; // [esp+20h] [ebp-8h]
  unsigned __int8 v28; // [esp+24h] [ebp-4h]

  v28 = DdrTrainFunc45AB(a1, a2, a3); /*0xffc5dba8*/
  DebugPrint((int)a1, 32, a2, a3, 255, 255, 255, 255, "CpgcGlobalTrainingSetup\n"); /*0xffc5dbbd*/
  v18 = *a4; /*0xffc5dbd1*/
  v20 = a4[1]; /*0xffc5dbd8*/
  v19 = a4[2]; /*0xffc5dbdf*/
  v4 = a4[14]; /*0xffc5dbe6*/
  v5 = a4[15]; /*0xffc5dbe9*/
  v23 = a4[3]; /*0xffc5dbec*/
  v22 = a4[4]; /*0xffc5dbf3*/
  v21 = a4[5]; /*0xffc5dbfa*/
  v16 = a4[6]; /*0xffc5dc01*/
  v24 = a4[7]; /*0xffc5dc08*/
  v25 = a4[8]; /*0xffc5dc0f*/
  v17 = a4[9]; /*0xffc5dc16*/
  v15 = a4[10]; /*0xffc5dc1f*/
  v6 = MiscConfigCheck(a1, a2, a3, 184567108); /*0xffc5dc2b*/
  v7 = MiscConfigCheck(a1, a2, a3, 184567096); /*0xffc5dc46*/
  v26 = MiscConfigCheck(a1, a2, a3, 184567100); /*0xffc5dc5b*/
  v27 = MiscConfigCheck(a1, a2, a3, 184567104) & 0x7FFFFFC0; /*0xffc5dc82*/
  MiscIoCheck(a1, a2, a3, 0xB004544u, v6 & 0xFFFFFF00); /*0xffc5dc88*/
  MiscIoCheck(a1, a2, a3, 0xB004538u, v4 | v7 & 0xFFFFFF00); /*0xffc5dca7*/
  MiscIoCheck(a1, a2, a3, 0xB00453Cu, v5 | v26 & 0xFFFFFF00); /*0xffc5dcc7*/
  MiscIoCheck(a1, a2, a3, 0xB004540u, v27); /*0xffc5dcd8*/
  v8 = MailBoxFunc8E6B((int)a1, a2, a3, 117459720, 4); /*0xffc5dce8*/
  MailBoxFunc902D( /*0xffc5dd2e*/
    (int)a1,
    a2,
    a3,
    117459720,
    4,
    (16 * (v20 & 1 | ((v19 & 0x1F | (((16 * v18) | v17 & 0xF) << 9)) << 6) | 0x18)) | v8 & 0x67);
  v9 = v22 & 0x7F; /*0xffc5dd4b*/
  v10 = MailBoxFunc8E6B((int)a1, a2, a3, 117459984, 80); /*0xffc5dd4e*/
  MailBoxFunc902D((int)a1, a2, a3, 117459984, 80, v9 | ((v21 | ((v23 & 0xF | 0x40) << 12)) << 8) | v10 & 0xFF000000); /*0xffc5dd7c*/
  if ( v15 != 0xFF ) /*0xffc5dd89*/
  {
    v11 = MailBoxFunc8E6B((int)a1, a2, a3, 117459992, 80); /*0xffc5dd95*/
    MailBoxFunc902D((int)a1, a2, a3, 117459992, 80, v9 | ((v21 | ((v15 & 0xF | 0x40) << 12)) << 8) | v11 & 0xFF000000); /*0xffc5ddc3*/
  }
  v12 = MailBoxFunc8E0B(a3, (int)a1, a2, v28, 117459712); /*0xffc5ddde*/
  v13 = v16; /*0xffc5dde3*/
  if ( (v12 & 0x20) != 0 ) /*0xffc5dded*/
    v13 = v16 & 3; /*0xffc5ddef*/
  MiscIoCheck(a1, a2, a3, 0xB004548u, (v13 << 16) | (v24 << 24) | ((a4[16] & 1 | ((v25 & 7) << 6)) << 6) | 1); /*0xffc5de20*/
  return 0; /*0xffc5de2a*/
}

// Function: MailBoxPcodeCmd @ 0xffc5de32 (0x1a5 bytes)
// Index: 779/2560

int __cdecl MailBoxPcodeCmd(unsigned __int8 *__return_address, int n4, int n2, unsigned __int8 a4)
{
  int n2_1; // ebp
  int v6; // esi
  _BYTE *CpuCount_1; // ecx
  unsigned __int8 n2_2; // al
  int v9; // eax
  int CpuCount; // [esp+8h] [ebp-10h]
  unsigned __int8 v11; // [esp+Ch] [ebp-Ch]
  int v12; // [esp+10h] [ebp-8h]
  int v13; // [esp+14h] [ebp-4h]

  v12 = 0; /*0xffc5de43*/
  if ( !*(_BYTE *)(7688 * (unsigned __int8)n2 + GetSocketInfo((int)__return_address, n4)) ) /*0xffc5de5d*/
    return 0; /*0xffc5de63*/
  n2_1 = n2; /*0xffc5de79*/
  v6 = MiscConfigCheck(__return_address, n4, n2, 184566276); /*0xffc5de85*/
  if ( a4 ) /*0xffc5de8c*/
    DebugPrint((int)__return_address, 2, n4, n2, 255, 255, 255, 255, "Issue ZQCL\n"); /*0xffc5dea3*/
  else
    DebugPrint((int)__return_address, 2, n4, n2, 255, 255, 255, 255, "Issue ZQCS\n"); /*0xffc5de93*/
  CpuCount = GetCpuCount((int)__return_address, n4, n2); /*0xffc5deb3*/
  CpuCount_1 = (_BYTE *)CpuCount; /*0xffc5deba*/
  n2_2 = 0; /*0xffc5debe*/
  LOBYTE(n2) = 0; /*0xffc5dec0*/
  do /*0xffc5dfb4*/
  {
    if ( *CpuCount_1 ) /*0xffc5dec4*/
    {
      if ( AutoGenFuncFA19((int)__return_address, n4, n2_1, n2) ) /*0xffc5ded4*/
      {
        v11 = 0; /*0xffc5deed*/
        v13 = 50813 * (unsigned __int8)n4; /*0xffc5def2*/
        if ( __return_address[v13 + 10194] ) /*0xffc5def6*/
        {
          do /*0xffc5df94*/
          {
            if ( !KtiFunc89E9((int)__return_address, n4, n2_1, n2, v11, 0) ) /*0xffc5df11*/
            {
              if ( *(_BYTE *)(CpuCount + 107) ) /*0xffc5df21*/
              {
                if ( (v6 & 0xC0000000) == 0xC0000000 ) /*0xffc5df32*/
                  KtiFuncFC19(__return_address, n4, n2_1, n2, 0, 1u, 0, 6u); /*0xffc5df4f*/
                v9 = a4 | 0x80; /*0xffc5df39*/
              }
              else
              {
                v9 = a4 << 10; /*0xffc5df5e*/
              }
              v12 = DdrTrainFunc236F((int)__return_address, n4, n2_1, n2, v11, 6, 0, v9, 1u); /*0xffc5df78*/
            }
            ++v11; /*0xffc5df89*/
          }
          while ( v11 < __return_address[v13 + 10194] ); /*0xffc5df94*/
        }
      }
      n2_2 = n2; /*0xffc5df9a*/
      CpuCount_1 = (_BYTE *)CpuCount; /*0xffc5df9e*/
    }
    ++n2_2; /*0xffc5dfa2*/
    CpuCount_1 += 1379; /*0xffc5dfa4*/
    LOBYTE(n2) = n2_2; /*0xffc5dfaa*/
    CpuCount = (int)CpuCount_1; /*0xffc5dfae*/
  }
  while ( n2_2 < 2u ); /*0xffc5dfb4*/
  if ( a4 == 1 ) /*0xffc5dfc1*/
    KtiFunc8C4((int)__return_address, 1u); /*0xffc5dfc6*/
  return v12; /*0xffc5dfd1*/
}

// Function: MailBoxFuncDFD7 @ 0xffc5dfd7 (0x163 bytes)
// Index: 780/2560

int MailBoxFuncDFD7(
        unsigned __int8 *__return_address,
        int buf,
        int n6,
        int a4,
        char a5,
        char n8,
        char n2,
        int a8,
        _DWORD *a9,
        int a10,
        char n0x20,
        ...)
{
  char v11; // al
  __int16 v13; // [esp+Ch] [ebp-14h] BYREF
  char v14; // [esp+Eh] [ebp-12h]
  char v15; // [esp+Fh] [ebp-11h]
  int v16; // [esp+10h] [ebp-10h]
  char v17; // [esp+14h] [ebp-Ch]
  __int16 n257; // [esp+15h] [ebp-Bh]
  int n256; // [esp+17h] [ebp-9h]
  __int16 v20; // [esp+1Bh] [ebp-5h]
  char n8a; // [esp+38h] [ebp+18h]

  DebugPrint( /*0xffc5e00e*/
    (int)__return_address,
    32,
    buf,
    n6,
    255,
    a4,
    255,
    255,
    "CpgcMemTestSetupMATS:\n  pattern[0] = 0x%08x%08x\n  pattern[1] = 0x%08x%08x\n",
    a9[1],
    *a9,
    a9[3],
    a9[2]);
  v14 = a5; /*0xffc5e01a*/
  v13 = 0; /*0xffc5e025*/
  v15 = 1; /*0xffc5e02a*/
  if ( n2 == 1 || n2 == 2 ) /*0xffc5e036*/
    v15 = 0; /*0xffc5e038*/
  v16 = -65536; /*0xffc5e041*/
  n257 = 257; /*0xffc5e04c*/
  v17 = 2 * (n8 == 8) + 1; /*0xffc5e05f*/
  if ( n2 != 1 ) /*0xffc5e063*/
    n257 = -256; /*0xffc5e065*/
  v20 = 0; /*0xffc5e06c*/
  n256 = 256; /*0xffc5e079*/
  MailBoxFuncDB89(__return_address, buf, n6, (unsigned __int8 *)&v13); /*0xffc5e081*/
  if ( n8 == 12 ) /*0xffc5e08e*/
  {
    v11 = DdrTrainFunc45AB((int)__return_address, buf, n6); /*0xffc5e093*/
    n8a = ((MailBoxFunc8E0B((int)__return_address, (int)__return_address, buf, v11, 117459712) & 0x20) != 0) + 7; /*0xffc5e0b6*/
  }
  else
  {
    n8a = 0; /*0xffc5e0c0*/
  }
  MailBoxFuncF986(__return_address, buf, n6, n8a, 0, 0, n0x20 - 1, 1, 1, 0, 0, 0, 0, 0, 0, 0); /*0xffc5e0e6*/
  MiscIoCheck(__return_address, buf, n6, 0xB004500u, 0); /*0xffc5e0f5*/
  if ( n2 == 1 && *(_BYTE *)(a8 + 1) == 1 ) /*0xffc5e10c*/
  {
    DdrTrainFunc5C9(__return_address, buf, 1); /*0xffc5e112*/
    DdrTrainFunc6CF(__return_address, buf, n6, 1); /*0xffc5e119*/
  }
  else
  {
    DdrTrainFunc5C9(__return_address, buf, 0); /*0xffc5e11f*/
    DdrTrainFunc6CF(__return_address, buf, n6, 0); /*0xffc5e129*/
  }
  return 0; /*0xffc5e133*/
}

// Function: SmbusReadBlock @ 0xffc5e13a (0x6be bytes)
// Index: 781/2560

unsigned __int8 __cdecl SmbusReadBlock(
        unsigned __int8 *__return_address,
        int buf,
        int n63a,
        int n8,
        char a5,
        unsigned __int8 *a6,
        int a7,
        int a8,
        char n2,
        char a10,
        unsigned __int8 a11,
        unsigned __int8 a12,
        unsigned __int8 a13,
        int *a14,
        int bufa,
        int a16,
        int a17,
        int a18)
{
  unsigned __int8 buf_1; // bp
  unsigned __int8 *v19; // esi
  int v20; // esi
  int v21; // edx
  unsigned __int8 n2_1; // dh
  unsigned __int8 n0x20; // dl
  char v24; // cl
  char v25; // al
  unsigned __int8 v26; // cl
  unsigned __int8 n0x20_3; // cl
  unsigned __int8 v28; // dl
  char v29; // dl
  int v30; // ecx
  unsigned int v31; // ecx
  unsigned int v32; // eax
  unsigned int v33; // eax
  unsigned int v34; // esi
  unsigned int v35; // esi
  unsigned int v36; // esi
  int v37; // eax
  int v38; // edi
  int v39; // esi
  int v40; // eax
  int v41; // eax
  i... [10124 chars total]

// Function: CpgcChannelInit @ 0xffc5e7f8 (0x481 bytes)
// Index: 782/2560

int __cdecl CpgcChannelInit(unsigned __int8 *__return_address, int n4, int a3)
{
  unsigned int n3_2; // ebx
  unsigned int n3; // esi
  char n3_6; // cl
  int v7; // eax
  int v8; // eax
  __int64 v9; // rax
  int v10; // edi
  int v11; // eax
  unsigned int v12; // esi
  unsigned __int8 n3_3; // dl
  unsigned int n3_7; // ecx
  unsigned int v15; // eax
  unsigned __int16 v16; // cx
  __int64 v17; // kr00_8
  unsigned __int8 v18; // bl
  unsigned int i; // eax
  int v20; // esi
  int v21; // eax
  unsigned __int8 n2_1; // bl
  char v24; // [esp+Dh] [ebp-27h]
  char v25; // [esp+Eh] [ebp-26h]
  unsigned __int8 v26; // [esp+Fh] [ebp-25h]
  int n6; // [esp+10h] [ebp-24h]
  unsigned __int8 v28; // [esp+14h] [ebp-20h]
  int v29; // [esp+18h] [ebp-1Ch]
  int v30; // [esp+18h] [ebp-1Ch]
  unsigned int n3_1; // [esp+1Ch] [ebp-18h]
  char n3_8; // [esp+20h] [ebp-14h]
  int v33; // [esp+24h] [ebp-10h]
  unsigned int n3_5; // [esp+28h] [ebp-Ch]
  int n2; // [esp+2Ch] [ebp-8h]
  int v36; // [esp+... [8745 chars total]

// Function: MailBoxFuncEC79 @ 0xffc5ec79 (0x2f8 bytes)
// Index: 783/2560

char __cdecl MailBoxFuncEC79(int __return_address, int buf, int i, int a4, unsigned __int16 n0x64)
{
  __int16 j_2; // bx
  __int64 v7; // rax
  int v8; // ecx
  __int64 v9; // kr00_8
  int v10; // eax
  int v11; // eax
  unsigned int n3_1; // ecx
  unsigned int v13; // esi
  unsigned int j; // eax
  unsigned int v15; // edx
  unsigned int v16; // eax
  unsigned int v17; // eax
  char v18; // al
  unsigned int v19; // eax
  int v20; // eax
  __int64 v21; // kr08_8
  char v22; // bl
  char v24; // [esp+11h] [ebp-1Bh]
  char v25; // [esp+12h] [ebp-1Ah]
  char v26; // [esp+13h] [ebp-19h]
  unsigned __int8 v27; // [esp+14h] [ebp-18h]
  int v28; // [esp+18h] [ebp-14h]
  int n3; // [esp+1Ch] [ebp-10h]
  int v30; // [esp+24h] [ebp-8h]
  unsigned __int8 j_1; // [esp+30h] [ebp+4h]

  v26 = 0; /*0xffc5ec86*/
  *(_WORD *)(__return_address + 244428) = 0; /*0xffc5ec8e*/
  LOBYTE(j_2) = 0; /*0xffc5ec95*/
  v27 = 0; /*0xffc5ec97*/
  v25 = 0; /*0xffc5ec9c*/
  j_1 = 0; /*0xffc5eca1*/
  n3 = 3; /*0xffc5eca9*/
  do
  {
    v24 = 0; /*0xffc5ecb0*/
    v7 = KtiFunc9D6(); /*0xffc5ecb4*/
    v8 = HIDWORD(v7); /*0xffc5ecba*/
    v9 = v7; /*0xffc5ecbe*/
    while ( 1 )
    {
      HIBYTE(j_2) = 1; /*0xffc5ecc5*/
      if ( (unsigned int)KtiFuncA21(__return_address, v9, v8) > 0xE4E1C0 ) /*0xffc5ecd4*/
        break; /*0xffc5ecd4*/
LABEL_6:
      v11 = MailBoxFunc8E0B(j_2, __return_address, buf, v27, 117459716); /*0xffc5ed74*/
      n3_1 = n3; /*0xffc5ed87*/
      v13 = v11; /*0xffc5ed8b*/
      for ( j = j_1; ; j = (unsigned __int8)j_2 )
      {
        LOBYTE(v30) = j_2; /*0xffc5ee0a*/
        if ( j >= n3_1 ) /*0xffc5ee10*/
          break; /*0xffc5ee10*/
        if ( (_BYTE)i != (_BYTE)j_2 ) /*0xffc5ed9b*/
          goto LABEL_20; /*0xffc5ed9b*/
        v15 = j % 3; /*0xffc5ed9f*/
        v16 = j % 3; /*0xffc5eda3*/
        if ( !v16 ) /*0xffc5eda8*/
        {
          v19 = HIWORD(v13); /*0xffc5edf2*/
          goto LABEL_15; /*0xffc5edf2*/
        }
        v17 = v16 - 1; /*0xffc5edaa*/
        if ( !v17 ) /*0xffc5edad*/
        {
          v19 = v13 >> 17; /*0xffc5edeb*/
          goto LABEL_15; /*0xffc5edee*/
        }
        if ( v17 == 1 ) /*0xffc5edb2*/
        {
          v19 = v13 >> 18; /*0xffc5ede4*/
LABEL_15:
          v18 = v19 & 1; /*0xffc5edf5*/
          goto LABEL_16; /*0xffc5edf5*/
        }
        DebugPrint(__return_address, 34, buf, v30, 255, 255, 255, 255, "Invalid channel: %d\n", v15);
        n3_1 = n3; /*0xffc5edd3*/
        v18 = 1; /*0xffc5edd7*/
        v25 = 1; /*0xffc5eddc*/
LABEL_16:
        HIBYTE(j_2) = HIBYTE(j_2) && v18; /*0xffc5edff*/
LABEL_20:
        LOBYTE(j_2) = j_2 + 1; /*0xffc5ee05*/
      }
      v28 = MailBoxFunc8E0B(j_2, __return_address, buf, v27, 117459712); /*0xffc5ee2a*/
      KtiFunc41B3(__return_address, 6u, 1); /*0xffc5ee2e*/
      v20 = v28; /*0xffc5ee33*/
      v8 = HIDWORD(v9); /*0xffc5ee3a*/
      LOBYTE(j_2) = j_1; /*0xffc5ee3e*/
      if ( (v28 & 4) == 0 && HIBYTE(j_2) ) /*0xffc5ee4c*/
        goto LABEL_26; /*0xffc5ee4c*/
    }
    LOBYTE(j_2) = *(_BYTE *)(__return_address + 9479); /*0xffc5ecdf*/
    *(_BYTE *)(__return_address + 9479) = 2; /*0xffc5ecf0*/
    DebugPrint(__return_address, 34, buf, i, 255, a4, 255, 255, "CPGC read poll timeout #1 retry %d\n", n0x64); /*0xffc5ed09*/
    *(_BYTE *)(__return_address + 9479) = j_2; /*0xffc5ed13*/
    v10 = MiscConfigCheck((unsigned __int8 *)__return_address, buf, i, 184567096); /*0xffc5ed23*/
    MiscIoCheck( /*0xffc5ed47*/
      (unsigned __int8 *)__return_address,
      buf,
      i,
      0xB004538u,
      v10 & 0xFFFFFF00 | (unsigned __int8)v10 & ~(1 << a4));
    v24 = 1; /*0xffc5ed4f*/
    if ( n0x64 < 0x64u ) /*0xffc5ed5a*/
    {
      LOBYTE(j_2) = j_1; /*0xffc5ed65*/
      v9 = KtiFunc9D6(); /*0xffc5ed6c*/
      v26 = 1; /*0xffc5ed70*/
      goto LABEL_6; /*0xffc5ed70*/
    }
    *(_BYTE *)(__return_address + 246400) |= 4u; /*0xffc5ee53*/
    CheckResetRequest(__return_address); /*0xffc5ee5a*/
    v20 = v28; /*0xffc5ee5f*/
LABEL_26:
    if ( v24 ) /*0xffc5ee6a*/
    {
      v28 = v20 & 0xFFFFFFFC | 2; /*0xffc5ee7c*/
      MailBoxFunc8FC5(__return_address, buf, v27, 117459712, v28); /*0xffc5ee85*/
    }
    else
    {
      v21 = KtiFunc9D6(); /*0xffc5eed7*/
      while ( 1 ) /*0xffc5eeef*/
      {
        v28 = MailBoxFunc8E0B(j_2, __return_address, buf, v27, 117459712); /*0xffc5eeef*/
        if ( (unsigned int)KtiFuncA21(__return_address, v21, SHIDWORD(v21)) > 0xE4E1C0 ) /*0xffc5ef00*/
          break; /*0xffc5ef00*/
        if ( (v28 & 1) == 0 ) /*0xffc5ef08*/
          goto LABEL_28; /*0xffc5ef08*/
      }
      v22 = *(_BYTE *)(__return_address + 9479); /*0xffc5ef0c*/
      *(_BYTE *)(__return_address + 9479) = 2; /*0xffc5ef25*/
      DebugPrint(__return_address, 34, buf, 255, 255, 255, 255, 255, "\nCPGC read poll timeout #2\n"); /*0xffc5ef2f*/
      *(_BYTE *)(__return_address + 246400) |= 4u; /*0xffc5ef34*/
      *(_BYTE *)(__return_address + 9479) = v22; /*0xffc5ef3c*/
      CheckResetRequest(__return_address); /*0xffc5ef42*/
    }
LABEL_28:
    ++v27; /*0xffc5ee92*/
    LOBYTE(j_2) = j_1 + 3; /*0xffc5ee9a*/
    n3 += 3; /*0xffc5eea0*/
    j_1 = j_2; /*0xffc5eea4*/
  }
  while ( (unsigned __int8)j_2 < 6u );
  if ( v25 )
    DebugPrint(__return_address, 34, 255, 255, 255, 255, 255, 255, "CpgcPollReadDone: Exit -- Return FAILURE\n");
  else
    DebugPrint(__return_address, 32, 255, 255, 255, 255, 255, 255, "CpgcPollReadDone: Exit -- Return SUCCESS\n");
  return v26; /*0xffc5ef69*/
}

// Function: MailBoxFuncEF71 @ 0xffc5ef71 (0xa4 bytes)
// Index: 784/2560

int __cdecl MailBoxFuncEF71(unsigned __int8 *n6, unsigned __int8 n2, int n63)
{
  int SocketInfo; // eax
  int n63_1; // edx
  unsigned __int8 n6_1; // bl
  int v6; // ecx
  _BYTE *SocketInfo_1; // ebp
  int v9; // [esp+8h] [ebp-8h]
  int v10; // [esp+Ch] [ebp-4h]

  SocketInfo = GetSocketInfo((int)n6, n2); /*0xffc5ef7d*/
  n63_1 = n63; /*0xffc5ef82*/
  n6_1 = 0; /*0xffc5ef86*/
  v6 = 0; /*0xffc5ef8a*/
  LOBYTE(v9) = 0; /*0xffc5ef8c*/
  SocketInfo_1 = (_BYTE *)SocketInfo; /*0xffc5ef90*/
  v10 = 0; /*0xffc5ef92*/
  do /*0xffc5f00c*/
  {
    if ( ((1 << v6) & n63_1) != 0 && *SocketInfo_1 ) /*0xffc5ef9f*/
    {
      MiscIoCheck(n6, n2, v9, 0xB014524u, 0); /*0xffc5efb8*/
      MiscIoCheck(n6, n2, v9, 0xB014528u, 0); /*0xffc5efd0*/
      MiscIoCheck(n6, n2, v9, 0xB01452Cu, 0); /*0xffc5efe8*/
      v6 = v10; /*0xffc5efed*/
      n63_1 = n63; /*0xffc5eff4*/
    }
    ++n6_1; /*0xffc5eff8*/
    SocketInfo_1 += 7688; /*0xffc5effa*/
    ++v6; /*0xffc5f000*/
    LOBYTE(v9) = n6_1; /*0xffc5f001*/
    v10 = v6; /*0xffc5f005*/
  }
  while ( n6_1 < 6u ); /*0xffc5f00c*/
  return 0; /*0xffc5f00e*/
}

// Function: MailBoxFuncF015 @ 0xffc5f015 (0x220 bytes)
// Index: 785/2560

int __cdecl MailBoxFuncF015(
        unsigned __int8 *__return_address,
        int buf,
        int n6,
        int n2,
        int a5,
        char a6,
        int a7,
        char a8,
        int a9,
        int a10)
{
  int n256_1; // edi
  char v11; // al
  int v12; // esi
  char v13; // al
  int v14; // eax
  int CpuCount; // [esp+10h] [ebp-1Ch]
  char v17; // [esp+14h] [ebp-18h]
  unsigned __int8 v18; // [esp+18h] [ebp-14h] BYREF
  __int16 n256; // [esp+19h] [ebp-13h]
  bool v20; // [esp+1Bh] [ebp-11h]
  char v21; // [esp+1Ch] [ebp-10h]
  int n67108608; // [esp+1Dh] [ebp-Fh]
  char v23; // [esp+21h] [ebp-Bh]
  char v24; // [esp+22h] [ebp-Ah]
  int v25; // [esp+23h] [ebp-9h]
  __int16 n255; // [esp+27h] [ebp-5h]

  DebugPrint((int)__return_address, 32, buf, n6, n2, a5, 255, 255, "CpgcPprTestSetup: pattern = 0x%x\n", a10);
  n256_1 = a10 & 0x300; /*0xffc5f059*/
  CpuCount = GetCpuCount((int)__return_address, buf, n6); /*0xffc5f05f*/
  n256 = 256; /*0xffc5f069*/
  v18 = 0; /*0xffc5f074*/
  v20 = n256_1 != 256; /*0xffc5f07f*/
  v17 = DdrTrainFunc45AB((int)__return_address, buf, n6); /*0xffc5f08b*/
  if ( (MailBoxFunc8E0B(buf, (int)__return_address, buf, v17, 117459712) & 0x20) != 0 ) /*0xffc5f0af*/
    v11 = byte_FFD40B50[*(unsigned __int8 *)(1379 * (unsigned __int8)n2 + CpuCount + 21)] - 2; /*0xffc5f0c2*/
  else
    v11 = byte_FFD40B50[*(unsigned __int8 *)(1379 * (unsigned __int8)n2 + CpuCount + 21)] - 3; /*0xffc5f0d7*/
  v21 = v11; /*0xffc5f0d9*/
  v23 = 0; /*0xffc5f0df*/
  n67108608 = 67108608; /*0xffc5f0ed*/
  v25 = -16776960; /*0xffc5f0fa*/
  n255 = 255; /*0xffc5f104*/
  v24 = (n256_1 == 768) - 1; /*0xffc5f10d*/
  MailBoxFuncDB89(__return_address, buf, n6, &v18); /*0xffc5f111*/
  DdrTrainFunc5C9(__return_address, buf, 0); /*0xffc5f11a*/
  v12 = KtiFunc9CA7(__return_address, buf, n6, a5) ? 0x3FFFF : 0x1FFFF;
  v13 = KtiFunc88D1((int)__return_address, buf, n6, n2, a5); /*0xffc5f16e*/
  DdrTrainFuncE35((int)__return_address, buf, n6, 1 << v13, 0, a6); /*0xffc5f186*/
  MailBoxFuncF745(__return_address, buf, n6, 0, 0, 0, 0, 1, 1, 1, 0, (a8 & 0xF) << 24, a9 & 0x3FFFF, 251659256, v12, 0); /*0xffc5f1ab*/
  MiscIoCheck(__return_address, buf, n6, 0xB004500u, 0); /*0xffc5f1bd*/
  if ( (~a10 & 0x2000) != 0 ) /*0xffc5f1d2*/
  {
    v14 = 0; /*0xffc5f1d4*/
    if ( (a10 & 0x800) == 0 && (a10 & 0x1000) != 0 ) /*0xffc5f1e4*/
      v14 = -1515870811; /*0xffc5f1e6*/
    if ( (a10 & 0x400) != 0 ) /*0xffc5f1f1*/
      v14 = ~v14; /*0xffc5f1f3*/
    RmtFunc7372(__return_address, buf, n6, v14, 8, 0); /*0xffc5f1fd*/
  }
  else if ( (a10 & 0x400) != 0 ) /*0xffc5f20d*/
  {
    MailBoxFuncFD1D(__return_address, buf, n6, n2, ~a7); /*0xffc5f216*/
  }
  else
  {
    MailBoxFuncFD1D(__return_address, buf, n6, n2, a7); /*0xffc5f223*/
  }
  return 0; /*0xffc5f22b*/
}

// Function: MailBoxFuncF235 @ 0xffc5f235 (0x34b bytes)
// Index: 786/2560

int __cdecl MailBoxFuncF235(
        unsigned __int8 *__return_address,
        int n4,
        int n6,
        unsigned __int8 n2,
        unsigned int n84033584a,
        char a6,
        unsigned __int8 a7,
        int *a8)
{
  unsigned __int8 n6_1; // al
  unsigned __int8 n6_2; // cl
  int v10; // edi
  int v11; // esi
  int v12; // ecx
  int v13; // eax
  int v14; // edi
  unsigned int v15; // esi
  int v16; // eax
  unsigned __int8 v18; // [esp+13h] [ebp-9h]
  unsigned __int8 n6_3; // [esp+14h] [ebp-8h]
  char v20; // [esp+14h] [ebp-8h]
  int CpuCount; // [esp+18h] [ebp-4h]
  unsigned int v22; // [esp+34h] [ebp+18h]
  _DWORD *v23; // [esp+3Ch] [ebp+20h]

  n6_1 = n6; /*0xffc5f238*/
  n6_2 = 0; /*0xffc5f23c*/
  n6_3 = 0; /*0xffc5f24a*/
  do /*0xffc5f27a*/
  {
    if ( n6_2 != n6_1 ) /*0xffc5f250*/
    {
      MailBoxFunc902D((int)__return_address, n4, n6_3, 117459720, 4, 0); /*0xffc5f261*/
      n6_1 = n6; /*0xffc5f266*/
      n6_2 = n6_3; /*0xffc5f26d*/
    }
    n6_3 = ++n6_2; /*0xffc5f273*/
  }
  while ( n6_2 < 6u ); /*0xffc5f27a*/
  CpuCount = GetCpuCount((int)__return_address, n4, n6_1); /*0xffc5f28b*/
  v20 = DdrTrainFunc45AB((int)__return_address, n4, n6); /*0xffc5f29a*/
  v18 = KtiFunc88D1((int)__return_address, n4, n6, n2, 0); /*0xffc5f2b0*/
  MiscIoCheck(__return_address, n4, n6, 0xB014530u, 0); /*0xffc5f2b4*/
  MiscIoCheck(__return_address, n4, n6, 0xB014550u, *a8); /*0xffc5f2ca*/
  MiscIoCheck(__return_address, n4, n6, 0xB014554u, a8[1]); /*0xffc5f2da*/
  MailBoxFunc902D((int)__return_address, n4, n6, 117459720, 4, 16778624); /*0xffc5f2ef*/
  MailBoxFunc902D((int)__return_address, n4, n6, 117459720, 4, 16778628); /*0xffc5f302*/
  if ( a6 ) /*0xffc5f30f*/
    MailBoxFunc902D((int)__return_address, n4, n6, 117459984, 80, 68157569); /*0xffc5f327*/
  else
    MailBoxFunc902D((int)__return_address, n4, n6, 117459984, 80, 67108993); /*0xffc5f316*/
  MailBoxFunc902D((int)__return_address, n4, n6, 117459772, 4, (n84033584a >> 3) & 0x7FFF8); /*0xffc5f34c*/
  MailBoxFunc902D((int)__return_address, n4, n6, 117460328, 4, n84033584a >> 22); /*0xffc5f362*/
  MailBoxFunc902D((int)__return_address, n4, n6, 117459788, 4, (n84033584a >> 3) & 0x7FFF8); /*0xffc5f37c*/
  MailBoxFunc902D((int)__return_address, n4, n6, 117460344, 4, n84033584a >> 22); /*0xffc5f38f*/
  MailBoxFunc902D((int)__return_address, n4, n6, 117459820, 4, 0); /*0xffc5f3a1*/
  MailBoxFunc902D((int)__return_address, n4, n6, 117459836, 8, 0); /*0xffc5f3b1*/
  MailBoxFunc902D((int)__return_address, n4, n6, 117459840, 8, 0); /*0xffc5f3c4*/
  MiscIoCheck(__return_address, n4, n6, 0xB0044A0u, 0); /*0xffc5f3d2*/
  MiscIoCheck(__return_address, n4, n6, 0xB014534u, 146); /*0xffc5f3e4*/
  if ( !a6 ) /*0xffc5f3f1*/
  {
    MiscIoCheck(__return_address, n4, n6, 0xB004548u, (a7 << 16) | 0xFF001001); /*0xffc5f409*/
    MiscIoCheck(__return_address, n4, n6, 0xB00454Cu, 0); /*0xffc5f417*/
    MiscIoCheck(__return_address, n4, n6, 0xB004550u, 0); /*0xffc5f425*/
  }
  v23 = (_DWORD *)MiscConfigCheck(__return_address, n4, n6, 117457036); /*0xffc5f443*/
  v10 = MailBoxFunc8E0B(n4, (int)__return_address, n4, v20, 117459068); /*0xffc5f456*/
  v11 = MiscConfigCheck(__return_address, n4, n6, 117525076); /*0xffc5f466*/
  v12 = MailBoxFunc8E0B(n4, (int)__return_address, n4, v20, 117459712); /*0xffc5f473*/
  if ( *(_BYTE *)(1379 * n2 + CpuCount + 107) ) /*0xffc5f48b*/
  {
    v13 = 1 << ((unsigned __int8)n6 % 3u); /*0xffc5f4ab*/
    v14 = (v10 ^ (v10 | (v13 << 25))) & 0xE000000 ^ v10; /*0xffc5f4bc*/
    v15 = v11 & 0xFFFF3FFF | 0x4000; /*0xffc5f4ce*/
    v22 = (v12 ^ (v12 | (v13 << 15))) & 0x38000 ^ v12; /*0xffc5f4d4*/
  }
  else
  {
    v16 = ~(1 << ((unsigned __int8)n6 % 3u)) & 7; /*0xffc5f4eb*/
    v14 = ((v16 << 25) | 0xF1FFFFFF) & v10; /*0xffc5f500*/
    v22 = ((v16 << 15) | 0xFFFC7FFF) & v12; /*0xffc5f502*/
    v15 = v11 & 0xFFFF3FFF | 0x8000; /*0xffc5f506*/
  }
  MiscIoCheck(__return_address, n4, n6, 0x700408Cu, (int)v23); /*0xffc5f51f*/
  MailBoxFunc8FC5((int)__return_address, n4, v20, 117459068, v14); /*0xffc5f530*/
  MiscIoCheck(__return_address, n4, n6, 0x7014A54u, v15); /*0xffc5f541*/
  MailBoxFunc8FC5((int)__return_address, n4, v20, 117459712, v22); /*0xffc5f555*/
  return MailBoxFunc902D((int)__return_address, n4, n6, 117459884, 4, v18); /*0xffc5f578*/
}

// Function: MailBoxFuncF580 @ 0xffc5f580 (0xb9 bytes)
// Index: 787/2560

int __cdecl MailBoxFuncF580(
        unsigned __int8 *__return_address,
        int buf,
        int n6,
        int n67092735,
        int a5,
        int a6,
        int a7,
        int a8,
        int a9,
        int n228)
{
  DebugPrint((int)__return_address, 32, buf, n6, 255, 255, 255, 255, "CpgcSetupAddrGen\n"); /*0xffc5f5a3*/
  MailBoxFunc902D((int)__return_address, buf, n6, 117459772, 4, a6); /*0xffc5f5b8*/
  MailBoxFunc902D((int)__return_address, buf, n6, 117460328, 4, a7); /*0xffc5f5ca*/
  MailBoxFunc902D((int)__return_address, buf, n6, 117459788, 4, a8); /*0xffc5f5df*/
  MailBoxFunc902D((int)__return_address, buf, n6, 117460344, 4, a9); /*0xffc5f5f1*/
  MailBoxFunc902D((int)__return_address, buf, n6, 117459836, 8, n67092735); /*0xffc5f604*/
  MailBoxFunc902D((int)__return_address, buf, n6, 117459840, 8, a5); /*0xffc5f61a*/
  return MailBoxFunc902D((int)__return_address, buf, n6, 117459820, 4, n228); /*0xffc5f634*/
}

// Function: MailBoxFuncF639 @ 0xffc5f639 (0x10c bytes)
// Index: 788/2560

int __cdecl MailBoxFuncF639(
        unsigned __int8 *__return_address,
        int n4,
        int n6,
        char n2,
        char a5,
        char a6,
        int a7,
        char a8,
        int a9)
{
  int v9; // esi
  char v10; // al
  unsigned __int8 v12; // [esp+10h] [ebp-14h] BYREF
  int n65792; // [esp+11h] [ebp-13h]
  int n67108608; // [esp+15h] [ebp-Fh]
  int n16842496; // [esp+19h] [ebp-Bh]
  int n16776960; // [esp+1Dh] [ebp-7h]

  v12 = 0; /*0xffc5f64a*/
  n65792 = 65792; /*0xffc5f657*/
  n67108608 = 67108608; /*0xffc5f661*/
  n16842496 = 16842496; /*0xffc5f669*/
  n16776960 = 16776960; /*0xffc5f671*/
  MailBoxFuncDB89(__return_address, n4, n6, &v12); /*0xffc5f679*/
  v9 = KtiFunc9CA7(__return_address, n4, n6, a5) ? 0x3FFFF : 0x1FFFF;
  v10 = KtiFunc88D1((int)__return_address, n4, n6, n2, a5); /*0xffc5f6d0*/
  DdrTrainFuncE35((int)__return_address, n4, n6, 1 << v10, 0, a6); /*0xffc5f6e8*/
  MailBoxFuncF745(__return_address, n4, n6, 0, 0, 0, 0, 1, 1, 0, 0, (a8 & 0xF) << 24, a9 & 0x3FFFF, 251659256, v9, 0); /*0xffc5f70b*/
  MiscIoCheck(__return_address, n4, n6, 0xB004500u, 0); /*0xffc5f720*/
  MailBoxFuncFD1D(__return_address, n4, n6, n2, a7); /*0xffc5f733*/
  return 0; /*0xffc5f73d*/
}

// Function: MailBoxFuncF745 @ 0xffc5f745 (0x241 bytes)
// Index: 789/2560

int __cdecl MailBoxFuncF745(
        unsigned __int8 *__return_address,
        int buf,
        int n6,
        char a4,
        char a5,
        char a6,
        char a7,
        char a8,
        char n2,
        int n67092735,
        int a11,
        int a12,
        int a13,
        int a14,
        int a15,
        int n228)
{
  char v16; // dl
  int n11184810; // ebx
  int n15790320; // edi
  int n138; // eax
  int v21; // ecx
  int n13421772; // [esp+14h] [ebp-4h]

  DebugPrint((int)__return_address, 32, buf, n6, 255, 255, 255, 255, "CpgcSetupWdb\n"); /*0xffc5f768*/
  v16 = n6 & 1; /*0xffc5f778*/
  n11184810 = 11184810; /*0xffc5f77f*/
  n13421772 = 13421772; /*0xffc5f784*/
  n15790320 = 15790320; /*0xffc5f78c*/
  if ( n2 == 2 )
  {
    n15790320 = *(_DWORD *)(__return_address + 10014); /*0xffc5f79a*/
    *(_DWORD *)(__return_address + 10014) = n15790320 + 1; /*0xffc5f7b3*/
    n11184810 = n15790320 + (v16 != 0 ? 5591040 : 16776960);
    n13421772 = n15790320 + ((n6 & 1) != 0 ? 1365 : 0xFFFF);
LABEL_3:
    n138 = n2 & 3 | (8 * (n2 & 3 | (8 * (n2 & 3)))); /*0xffc5f7db*/
    goto LABEL_4; /*0xffc5f7eb*/
  }
  if ( n2 != 3 ) /*0xffc5f92d*/
    goto LABEL_3; /*0xffc5f92d*/
  v21 = *(_DWORD *)(__return_address + 10014); /*0xffc5f933*/
  n13421772 = 0xFFFFFF; /*0xffc5f93d*/
  *(_DWORD *)(__return_address + 10014) = v21 + 1; /*0xffc5f952*/
  n11184810 = v21 + (v16 != 0 ? 5591040 : 16776960);
  n138 = 138; /*0xffc5f978*/
  n15790320 = v21 + (v16 != 0 ? 1365 : 0xFFFF);
LABEL_4:
  MiscIoCheck(__return_address, buf, n6, 0xB014534u, n138 | 0x4000); /*0xffc5f7ed*/
  MiscIoCheck( /*0xffc5f842*/
    __return_address,
    buf,
    n6,
    0xB0044A0u,
    a4 & 0x1F | (32 * (a5 & 1 | (8 * (a6 & 0x3F | ((a7 & 0x3F) << 8))))));
  if ( a8 ) /*0xffc5f84f*/
  {
    MiscIoCheck(__return_address, buf, n6, 0xB01450Cu, n11184810 & 0xFFFFFF); /*0xffc5f864*/
    MiscIoCheck(__return_address, buf, n6, 0xB014510u, n13421772 & 0xFFFFFF); /*0xffc5f87e*/
    MiscIoCheck(__return_address, buf, n6, 0xB014514u, n15790320 & 0xFFFFFF); /*0xffc5f896*/
  }
  MiscIoCheck(__return_address, buf, n6, 0xB014518u, n11184810 & 0xFFFFFF); /*0xffc5f8b5*/
  MiscIoCheck(__return_address, buf, n6, 0xB01451Cu, n13421772 & 0xFFFFFF); /*0xffc5f8cc*/
  MiscIoCheck(__return_address, buf, n6, 0xB014520u, n15790320 & 0xFFFFFF); /*0xffc5f8df*/
  return MailBoxFuncF580(__return_address, buf, n6, n67092735, a11, a12, a13, a14, a15, n228); /*0xffc5f923*/
}

// Function: MailBoxFuncF986 @ 0xffc5f986 (0x143 bytes)
// Index: 790/2560

int __cdecl MailBoxFuncF986(
        unsigned __int8 *__return_address,
        int buf,
        int n6,
        char n8a,
        char a5,
        char a6,
        char a7,
        char a8,
        char a9,
        int n67092735,
        int a11,
        int a12,
        int a13,
        int a14,
        int a15,
        int n228)
{
  DebugPrint((int)__return_address, 32, buf, n6, 255, 255, 255, 255, "CpgcSetupWdbMATS\n"); /*0xffc5f9a9*/
  MiscIoCheck(__return_address, buf, n6, 0xB014534u, a9 & 3 | (8 * (a9 & 3 | (8 * (a9 & 3 | 0x100))))); /*0xffc5f9d0*/
  MiscIoCheck( /*0xffc5fa0d*/
    __return_address,
    buf,
    n6,
    0xB0044A0u,
    n8a & 0x1F | (32 * (a5 & 1 | (8 * (a6 & 0x3F | ((a7 & 0x3F) << 8))))));
  if ( a8 ) /*0xffc5fa1f*/
  {
    MiscIoCheck(__return_address, buf, n6, 0xB01450Cu, 11184810); /*0xffc5fa2a*/
    MiscIoCheck(__return_address, buf, n6, 0xB014510u, 13421772); /*0xffc5fa3c*/
    MiscIoCheck(__return_address, buf, n6, 0xB014514u, 15790320); /*0xffc5fa4e*/
  }
  MiscIoCheck(__return_address, buf, n6, 0xB014518u, 11184810); /*0xffc5fa5f*/
  MiscIoCheck(__return_address, buf, n6, 0xB01451Cu, 13421772); /*0xffc5fa71*/
  MiscIoCheck(__return_address, buf, n6, 0xB014520u, 15790320); /*0xffc5fa83*/
  return MailBoxFuncF580(__return_address, buf, n6, n67092735, a11, a12, a13, a14, a15, n228); /*0xffc5fac4*/
}

// Function: MailBoxFuncFAC9 @ 0xffc5fac9 (0x53 bytes)
// Index: 791/2560

void __cdecl MailBoxFuncFAC9(int __return_address, int n4, unsigned __int8 n6, _BYTE *p_n2, unsigned int *a5)
{
  int v5; // esi

  v5 = *a5; /*0xffc5fad8*/
  if ( *p_n2 == 7 && (DdrTrainFunc4512(__return_address, n4, n6) || DdrTrainFunc4543(__return_address, n4, n6)) ) /*0xffc5fafa*/
  {
    *p_n2 = 0; /*0xffc5fb0c*/
    *a5 = v5 & 0xFF87FFFF | 0x80000; /*0xffc5fb15*/
  }
}

// Function: MailBoxFuncFB1C @ 0xffc5fb1c (0x31 bytes)
// Index: 792/2560

int __cdecl MailBoxFuncFB1C(unsigned __int8 *__return_address, unsigned __int8 n6, int a3)
{
  int v3; // eax

  v3 = MiscConfigCheck(__return_address, n6, a3, 184567040); /*0xffc5fb2f*/
  return MiscIoCheck(__return_address, n6, a3, 0xB004500u, v3 & 0xFFFFFFF5); /*0xffc5fb4a*/
}

// Function: MailBoxFuncFB4D @ 0xffc5fb4d (0xf bytes)
// Index: 793/2560

void __cdecl __noreturn MailBoxFuncFB4D(int __return_address, unsigned __int8 n6)
{
  DdrTrainFunc14AF(__return_address, n6, 0); /*0xffc5fb57*/
}

// Function: MailBoxFuncFB60 @ 0xffc5fb60 (0x1bd bytes)
// Index: 794/2560

int __cdecl MailBoxFuncFB60(int __return_address, unsigned __int8 n6, int n6a, __int16 a4)
{
  int SocketInfo; // eax
  unsigned __int8 n6_1; // dl
  int v6; // ecx
  int SocketInfo_1; // edi
  int v8; // ebp
  int result; // eax
  unsigned __int8 v10; // cl
  int v11; // eax
  int v12; // edx
  unsigned __int8 v13; // ch
  int v14; // eax
  int v15; // eax
  unsigned int v16; // eax
  char n2; // cl
  unsigned int v18; // eax
  int v19; // eax
  char v20; // [esp+13h] [ebp-Dh]
  int n6_2; // [esp+14h] [ebp-Ch]
  int v22; // [esp+18h] [ebp-8h]
  int SocketInfo_2; // [esp+1Ch] [ebp-4h]

  SocketInfo = GetSocketInfo(__return_address, n6); /*0xffc5fb71*/
  n6_1 = 0; /*0xffc5fb78*/
  v6 = 0; /*0xffc5fb7a*/
  SocketInfo_1 = SocketInfo; /*0xffc5fb7c*/
  LOBYTE(n6_2) = 0; /*0xffc5fb7e*/
  SocketInfo_2 = SocketInfo; /*0xffc5fb82*/
  v8 = 0; /*0xffc5fb86*/
  v22 = 0; /*0xffc5fb88*/
  do /*0xffc5fd0f*/
  {
    result = 1 << v6; /*0xffc5fb93*/
    if ( ((1 << v6) & n6a) != 0 && *(_BYTE *)(SocketInfo_1 + v8) ) /*0xffc5fb9f*/
    {
      if ( (a4 & 0x800) != 0 ) /*0xffc5fbb8*/
      {
        if ( *(_WORD *)(__return_address + 257315) == 11 ) /*0xffc5fbc6*/
          DdrTrainFunc4EE( /*0xffc5fbcd*/
            (unsigned __int8 *)__return_address,
            n6,
            n6_2,
            0,
            0x10u,
            (int)&unk_FFD52F1C,
            (int)&unk_FFD52F8C);
        else
          DdrTrainFunc4EE( /*0xffc5fbd4*/
            (unsigned __int8 *)__return_address,
            n6,
            n6_2,
            0,
            0x10u,
            (int)&unk_FFD52EAC,
            (int)&unk_FFD52F8C);
      }
      else if ( *(_WORD *)(__return_address + 257315) == 11 ) /*0xffc5fbe2*/
      {
        DdrTrainFunc4EE((unsigned __int8 *)__return_address, n6, n6_2, 0, 0x10u, (int)&unk_FFD530BC, (int)&unk_FFD5305C); /*0xffc5fbe9*/
      }
      else
      {
        DdrTrainFunc4EE((unsigned __int8 *)__return_address, n6, n6_2, 0, 0x10u, (int)&unk_FFD52FEC, (int)&unk_FFD5305C); /*0xffc5fbf7*/
      }
      v10 = 0; /*0xffc5fc0e*/
      v20 = 0; /*0xffc5fc10*/
      v11 = v8 + 48704 * n6; /*0xffc5fc15*/
      v12 = v11 + __return_address + 259118; /*0xffc5fc17*/
      v13 = *(_BYTE *)(v11 + __return_address + 258725); /*0xffc5fc19*/
      if ( v13 ) /*0xffc5fc22*/
      {
        while ( 1 ) /*0xffc5fc27*/
        {
          v14 = 1379 * v10; /*0xffc5fc27*/
          if ( *(_BYTE *)(v14 + v12) ) /*0xffc5fc2d*/
          {
            if ( *(_BYTE *)(v14 + v12 + 107) ) /*0xffc5fc33*/
              break; /*0xffc5fc33*/
          }
          if ( ++v10 >= v13 ) /*0xffc5fc3e*/
            goto LABEL_17; /*0xffc5fc3e*/
        }
        v20 = 1; /*0xffc5fc42*/
      }
LABEL_17:
      v15 = MiscConfigCheck((unsigned __int8 *)__return_address, n6, n6_2, 184567040); /*0xffc5fc47*/
      if ( v20 ) /*0xffc5fc5c*/
        v16 = v15 & 0xFFFFFFFE; /*0xffc5fc5e*/
      else
        v16 = v15 | 1; /*0xffc5fc63*/
      n2 = *(_BYTE *)(__return_address + 257313); /*0xffc5fc66*/
      v18 = v16 & 0xFFFFFFF5; /*0xffc5fc6c*/
      if ( n2 == 1 || n2 == 2 ) /*0xffc5fc77*/
        v19 = v18 | 4; /*0xffc5fc7e*/
      else
        v19 = v18 & 0xFFFFFFFB; /*0xffc5fc79*/
      MiscIoCheck((unsigned __int8 *)__return_address, n6, n6_2, 0xB004500u, v19); /*0xffc5fc8a*/
      MiscIoCheck((unsigned __int8 *)__return_address, n6, n6_2, 0xB00450Cu, 21845); /*0xffc5fc9c*/
      MiscIoCheck((unsigned __int8 *)__return_address, n6, n6_2, 0xB004510u, 13107); /*0xffc5fcae*/
      MiscIoCheck((unsigned __int8 *)__return_address, n6, n6_2, 0xB004514u, 3855); /*0xffc5fcc0*/
      MiscIoCheck((unsigned __int8 *)__return_address, n6, n6_2, 0xB004518u, 255); /*0xffc5fcd5*/
      result = MiscIoCheck((unsigned __int8 *)__return_address, n6, n6_2, 0xB004508u, 8738); /*0xffc5fce7*/
      n6_1 = n6_2; /*0xffc5fcec*/
      v6 = v22; /*0xffc5fcf3*/
      SocketInfo_1 = SocketInfo_2; /*0xffc5fcf7*/
    }
    ++n6_1; /*0xffc5fcfb*/
    v8 += 7688; /*0xffc5fcfd*/
    ++v6; /*0xffc5fd03*/
    LOBYTE(n6_2) = n6_1; /*0xffc5fd04*/
    v22 = v6; /*0xffc5fd08*/
  }
  while ( n6_1 < 6u ); /*0xffc5fd0f*/
  return result; /*0xffc5fd15*/
}

// Function: MailBoxFuncFD1D @ 0xffc5fd1d (0x17b bytes)
// Index: 795/2560

char __cdecl MailBoxFuncFD1D(unsigned __int8 *__return_address, unsigned __int8 n4, int n6, char n2, int a5)
{
  int v5; // esi
  int v6; // edi
  int n18; // ebx
  char result; // al
  int v9; // eax
  unsigned __int8 n8; // bl
  char i; // si
  int v12; // ecx
  char v13; // [esp+13h] [ebp-809h]
  int n64; // [esp+14h] [ebp-808h]
  char v15[2048]; // [esp+1Ch] [ebp-800h] BYREF
  int v16; // [esp+830h] [ebp+14h]

  v16 = ~a5; /*0xffc5fd4d*/
  n64 = 64; /*0xffc5fd61*/
  v13 = *(_BYTE *)(1379 * (unsigned __int8)n2 + GetCpuCount((int)__return_address, n4, n6) + 104); /*0xffc5fd6f*/
  v5 = 0; /*0xffc5fd83*/
  do /*0xffc5fdd8*/
  {
    v15[v5] = -1; /*0xffc5fd87*/
    v6 = 0; /*0xffc5fd8c*/
    n18 = 18; /*0xffc5fd8e*/
    do /*0xffc5fdd0*/
    {
      if ( ((1 << v6) & v16) == 0 && (v6 * (unsigned int)(unsigned __int8)(4 * (v13 == 0) + 4)) >> 3 == (v5 & 7) ) /*0xffc5fdae*/
      {
        if ( v13 ) /*0xffc5fdb4*/
          v15[v5] ^= 15 << (4 * (v6 & 1)); /*0xffc5fdc2*/
        else
          v15[v5] = 0; /*0xffc5fdc8*/
      }
      ++v6; /*0xffc5fdcc*/
      --n18; /*0xffc5fdcd*/
    }
    while ( n18 ); /*0xffc5fdd0*/
    ++v5; /*0xffc5fdd2*/
    --n64; /*0xffc5fdd3*/
  }
  while ( n64 ); /*0xffc5fdd8*/
  result = RmtFunc71F8(__return_address, n4, n6, v15, 1u, 0); /*0xffc5fdf8*/
  if ( __return_address[257312] ) /*0xffc5fe00*/
  {
    v9 = 0; /*0xffc5fe13*/
    n8 = 0; /*0xffc5fe15*/
    for ( i = 0; ; ++i ) /*0xffc5fe17*/
    {
      if ( ((1 << i) & v16) == 0 ) /*0xffc5fe22*/
      {
        if ( v13 ) /*0xffc5fe2a*/
        {
          if ( n8 >> 1 && n8 >> 1 != 8 ) /*0xffc5fe35*/
            goto LABEL_21; /*0xffc5fe35*/
          v12 = (unsigned __int8)(15 << (4 * (i & 1))); /*0xffc5fe44*/
        }
        else
        {
          if ( n8 && n8 != 8 ) /*0xffc5fe54*/
            goto LABEL_21; /*0xffc5fe54*/
          v12 = (unsigned __int8)(v9 ^ ~(_BYTE)v9); /*0xffc5fe5c*/
        }
        v9 ^= v12; /*0xffc5fe5f*/
      }
LABEL_21:
      if ( ++n8 >= 0x12u ) /*0xffc5fe67*/
        return MiscIoCheck(__return_address, n4, n6, 0xB014524u, v9); /*0xffc5fe85*/
    }
  }
  return result; /*0xffc5fe8d*/
}

// Function: MailBoxFuncFE98 @ 0xffc5fe98 (0x148 bytes)
// Index: 796/2560

char __cdecl MailBoxFuncFE98(unsigned __int8 *__return_address, int n20, _BYTE *p_n4, _DWORD *dst)
{
  int v4; // eax
  _BYTE *v5; // ebp
  _BYTE *v6; // edi
  unsigned int n0x11; // ecx
  unsigned int n2; // edx
  _BYTE *v9; // ebx
  __int16 v10; // cx
  int n16; // [esp+10h] [ebp-4h]
  _DWORD v13[4]; // [esp+14h] [ebp+0h] BYREF

  LOBYTE(v4) = 0; /*0xffc5fea0*/
  v5 = v13; /*0xffc5fea8*/
  v6 = (char *)dst + 2; /*0xffc5feb1*/
  v13[0] = 0; /*0xffc5feb4*/
  v13[1] = 1; /*0xffc5feb8*/
  n0x11 = n20 - 6; /*0xffc5fec0*/
  v13[2] = 16843008; /*0xffc5fec3*/
  n2 = n20 - 3; /*0xffc5fecb*/
  v13[3] = 16843008; /*0xffc5fece*/
  v9 = p_n4 + 5; /*0xffc5fed6*/
  n16 = 16; /*0xffc5fed9*/
  do /*0xffc5ffd2*/
  {
    if ( n0x11 > 0x11 ) /*0xffc5fee4*/
    {
      *(_DWORD *)(v9 - 5) = 0; /*0xffc5fef1*/
    }
    else
    {
      v4 = (unsigned __int8)*v5 << n0x11; /*0xffc5feea*/
      *(_DWORD *)(v9 - 5) = v4; /*0xffc5feec*/
    }
    if ( n2 > 2 ) /*0xffc5fef8*/
    {
      *v9 = 0; /*0xffc5ff05*/
    }
    else
    {
      LOBYTE(v4) = *v5 << n2; /*0xffc5feff*/
      *v9 = v4; /*0xffc5ff01*/
    }
    if ( (unsigned int)(n20 - 48) > 1 ) /*0xffc5ff0e*/
    {
      *v9 &= 3u; /*0xffc5ff1c*/
    }
    else
    {
      LOBYTE(v4) = 4 * (*v5 << (n20 - 48)); /*0xffc5ff15*/
      *v9 = v4; /*0xffc5ff18*/
    }
    if ( (unsigned int)(n20 - 51) > 2 ) /*0xffc5ff25*/
    {
      *(v9 - 1) = 0; /*0xffc5ff31*/
    }
    else
    {
      LOBYTE(v4) = *v5 << (n20 - 51); /*0xffc5ff2a*/
      *(v9 - 1) = v4; /*0xffc5ff2c*/
    }
    if ( n20 ) /*0xffc5ff37*/
    {
      *v6 &= ~4u; /*0xffc5ff50*/
      if ( n20 == 1 ) /*0xffc5ff56*/
      {
        LOBYTE(v4) = 2 * *v5; /*0xffc5ff5b*/
        *v6 = v4; /*0xffc5ff5d*/
        goto LABEL_20; /*0xffc5ff5d*/
      }
    }
    else
    {
      LOBYTE(v4) = 4 * *v5; /*0xffc5ff3c*/
      *v6 = v4; /*0xffc5ff3f*/
    }
    *v6 &= ~2u; /*0xffc5ff41*/
    if ( n20 == 2 ) /*0xffc5ff47*/
    {
      LOBYTE(v4) = *v5; /*0xffc5ff49*/
      *v6 = *v5; /*0xffc5ff4c*/
      goto LABEL_29; /*0xffc5ff4e*/
    }
LABEL_20:
    *v6 &= ~1u; /*0xffc5ff5f*/
    if ( n20 == 26 || n20 == 27 || n20 == 30 || n20 == 31 ) /*0xffc5ff74*/
    {
      v10 = ((unsigned __int8)*v5 << (n20 - 24)) | *((_WORD *)v6 - 1) & 0x3FF & ~(1 << (n20 - 24)); /*0xffc5ff90*/
      *((_WORD *)v6 - 1) = v10; /*0xffc5ff93*/
      if ( n20 == 26 || n20 == 30 ) /*0xffc5ff9f*/
        LOBYTE(v4) = n20 - 23; /*0xffc5ffb0*/
      else
        LOBYTE(v4) = n20 - 25; /*0xffc5ffab*/
      *((_WORD *)v6 - 1) = v10 & 0x3FF & ~(1 << v4); /*0xffc5ffbc*/
      n2 = n20 - 3; /*0xffc5ffc0*/
    }
LABEL_29:
    v9 += 7; /*0xffc5ffc3*/
    n0x11 = n20 - 6; /*0xffc5ffc6*/
    ++v5; /*0xffc5ffc9*/
    v6 += 6; /*0xffc5ffca*/
    --n16; /*0xffc5ffcd*/
  }
  while ( n16 ); /*0xffc5ffd2*/
  return v4; /*0xffc5ffd8*/
}

// Function: MailBoxFuncFFE0 @ 0xffc5ffe0 (0x140 bytes)
// Index: 797/2560

int __cdecl MailBoxFuncFFE0(unsigned __int8 *__return_address, int n20, _BYTE *p_n4, _DWORD *dst)
{
  unsigned int n0xD; // ebp
  int n16; // eax
  unsigned int n2; // edi
  int v9; // edi
  char v10; // al
  int n16_1; // [esp+10h] [ebp-4h]

  n0xD = n20 - 6; /*0xffc5fff0*/
  n16 = 16; /*0xffc5fff6*/
  n2 = n20 - 3; /*0xffc5fff7*/
  n16_1 = 16; /*0xffc5fffa*/
  do /*0xffc60114*/
  {
    if ( *(_DWORD *)p_n4 == 1 ) /*0xffc60001*/
    {
      if ( n0xD <= 0xD ) /*0xffc6000a*/
        *(_DWORD *)p_n4 = 1 << n0xD; /*0xffc60013*/
      if ( n20 == 23 ) /*0xffc60018*/
        *(_DWORD *)p_n4 = 1 << n0xD; /*0xffc60021*/
      if ( n2 <= 2 ) /*0xffc60026*/
      {
        *(_DWORD *)p_n4 = 0; /*0xffc6002e*/
        p_n4[5] = 1 << n2; /*0xffc60031*/
      }
      if ( (unsigned int)(n20 - 48) <= 1 ) /*0xffc6003a*/
      {
        *(_DWORD *)p_n4 = 0; /*0xffc60040*/
        p_n4[5] = 4 << (n20 - 48); /*0xffc60043*/
      }
      if ( (unsigned int)(n20 - 51) <= 2 ) /*0xffc6004c*/
      {
        *(_DWORD *)p_n4 = 0; /*0xffc60052*/
        p_n4[4] = 1 << (n20 - 51); /*0xffc60055*/
      }
      if ( n20 == 26 || n20 == 27 || n20 == 30 || n20 == 31 ) /*0xffc6006a*/
      {
        v9 = *(_WORD *)dst & 0x3FF & (unsigned __int16)~(1 << (n20 - 24)) | (1 << (n20 - 24)); /*0xffc6007d*/
        *(_WORD *)dst = v9; /*0xffc60080*/
        if ( n20 == 26 || n20 == 30 ) /*0xffc6008b*/
          v10 = n20 - 23; /*0xffc6009c*/
        else
          v10 = n20 - 25; /*0xffc60097*/
        *(_WORD *)dst = v9 & 0x3FF & ~(1 << v10); /*0xffc600a8*/
        *(_DWORD *)p_n4 = 0; /*0xffc600ab*/
        n2 = n20 - 3; /*0xffc600ae*/
      }
      n16 = n16_1; /*0xffc600b1*/
    }
    if ( *(_DWORD *)p_n4 == 0x4000 ) /*0xffc600bb*/
    {
      if ( n20 == 20 ) /*0xffc600c0*/
        *(_DWORD *)p_n4 = 0x4000; /*0xffc600c2*/
      if ( n20 == 21 ) /*0xffc600cb*/
        *(_DWORD *)p_n4 = 0x8000; /*0xffc600cd*/
      if ( n20 == 22 ) /*0xffc600d6*/
        *(_DWORD *)p_n4 = 0x10000; /*0xffc600d8*/
    }
    if ( *(_DWORD *)p_n4 == 98304 ) /*0xffc600e4*/
    {
      if ( n20 == 20 ) /*0xffc600e9*/
        *(_DWORD *)p_n4 = 98304; /*0xffc600eb*/
      if ( n20 == 21 ) /*0xffc600f4*/
        *(_DWORD *)p_n4 = 81920; /*0xffc600f6*/
      if ( n20 == 22 ) /*0xffc600ff*/
        *(_DWORD *)p_n4 = 49152; /*0xffc60101*/
    }
    dst = (_DWORD *)((char *)dst + 6); /*0xffc60107*/
    p_n4 += 7; /*0xffc6010a*/
    n16_1 = --n16; /*0xffc60110*/
  }
  while ( n16 ); /*0xffc60114*/
  return n16; /*0xffc6011a*/
}

// Function: DdrTrainFunc120 @ 0xffc60120 (0x4c bytes)
// Index: 798/2560

int __cdecl DdrTrainFunc120(unsigned __int8 n1021, int a2, _BYTE *p_n4, _DWORD *dst)
{
  int n16; // esi
  int n1021_1; // eax

  n16 = 16; /*0xffc6012c*/
  do /*0xffc60167*/
  {
    n1021_1 = *(unsigned __int16 *)dst; /*0xffc6012d*/
    if ( (_WORD)n1021_1 == 1022 ) /*0xffc60138*/
    {
      n1021_1 = n1021; /*0xffc6013a*/
      *(_WORD *)dst = ~(1 << n1021) & 0x3FF; /*0xffc60141*/
    }
    else if ( (_WORD)n1021_1 == 1021 ) /*0xffc6014e*/
    {
      n1021_1 = ~(1 << (n1021 ^ 1)) & 0x3FF; /*0xffc6015b*/
      *(_WORD *)dst = n1021_1; /*0xffc6015e*/
    }
    dst = (_DWORD *)((char *)dst + 6); /*0xffc60161*/
    --n16; /*0xffc60164*/
  }
  while ( n16 ); /*0xffc60167*/
  return n1021_1; /*0xffc60169*/
}

// Function: DdrTrainFunc16C @ 0xffc6016c (0x73 bytes)
// Index: 799/2560

unsigned __int8 __cdecl DdrTrainFunc16C(unsigned __int8 a1, unsigned __int8 a2, int a3, _WORD *a4, char n2)
{
  _BYTE *v6; // ebx
  int n16; // ebp
  unsigned __int8 result; // al

  v6 = (_BYTE *)(a3 + 4); /*0xffc6017d*/
  n16 = 16; /*0xffc60182*/
  do /*0xffc601d8*/
  {
    if ( *a4 != 1023 ) /*0xffc6018a*/
    {
      result = a1; /*0xffc6018c*/
      *a4 = ~(1 << a1) & 0x3FF; /*0xffc60192*/
    }
    if ( n2 == 2 ) /*0xffc6019a*/
    {
      result = a2; /*0xffc601c1*/
      *a4 = *a4 & ~(12 << (a1 & 0xFC)) | (a2 << ((a1 & 0xFC) + 2)); /*0xffc601c5*/
      *v6 = a2; /*0xffc601c8*/
    }
    a4 += 3; /*0xffc601ca*/
    v6 += 7; /*0xffc601cd*/
    --n16; /*0xffc601d5*/
  }
  while ( n16 ); /*0xffc601d8*/
  return result; /*0xffc601da*/
}

// Function: DdrTrainFunc1DF @ 0xffc601df (0xcd bytes)
// Index: 800/2560

unsigned int __cdecl DdrTrainFunc1DF(_BYTE *a1, int a2, int a3, unsigned int n117459712)
{
  unsigned __int8 v4; // dl

  v4 = (unsigned __int8)a3 % a1[9475]; /*0xffc601f7*/
  LOBYTE(a3) = v4; /*0xffc601fe*/
  if ( n117459712 <= 0x7004B7C ) /*0xffc60203*/
  {
    if ( n117459712 != 117459836 ) /*0xffc60205*/
    {
      if ( n117459712 == 117459712 || n117459712 == 117459716 ) /*0xffc60217*/
        return n117459712; /*0xffc6022d*/
      if ( n117459712 == 117459720 || n117459712 == 117459820 ) /*0xffc60221*/
        return n117459712 + 4 * v4; /*0xffc60221*/
      goto LABEL_13; /*0xffc60221*/
    }
    return n117459712 + 8 * v4; /*0xffc60205*/
  }
  if ( n117459712 == 117459840 ) /*0xffc60236*/
    return n117459712 + 8 * v4; /*0xffc602a5*/
  if ( n117459712 == 117459884 ) /*0xffc6023b*/
    return n117459712 + 4 * v4; /*0xffc60229*/
  if ( n117459712 != 117459984 && n117459712 != 117459992 )
  {
LABEL_13:
    DebugPrint((int)a1, 1, a2, a3, 255, 255, 255, 255, "ERROR: GetCpgcRegOffset - Invalid offset 0x%8X\n", n117459712);
    AssertPrint(
      a1,
      255,
      (int)"\n\nRC_ASSERT! %s: %u   %s ",
      "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Mem\\MemCpgc.c",
      6842,
      "FALSE");
    ProcMemInitCheck((int)a1, 242, 50); /*0xffc6028b*/
    return n117459712; /*0xffc60296*/
  }
  return n117459712 + 80 * v4; /*0xffc602a8*/
}

// Function: DdrTrainFunc2AC @ 0xffc602ac (0x46 bytes)
// Index: 801/2560

int __cdecl DdrTrainFunc2AC(unsigned __int8 *__return_address, unsigned __int8 n4, int n6)
{
  int v3; // eax

  v3 = MiscConfigCheck(__return_address, n4, n6, 184565992); /*0xffc602bf*/
  MiscIoCheck(__return_address, n4, n6, 0xB0040E8u, v3 | 0x20000); /*0xffc602d4*/
  return MiscConfigCheck(__return_address, n4, n6, 184565952); /*0xffc602ef*/
}

// Function: DdrTrainFunc2F2 @ 0xffc602f2 (0x1d bytes)
// Index: 802/2560

int __cdecl DdrTrainFunc2F2(int __return_address)
{
  return *(_WORD *)(__return_address + 257315) == 12 ? -1515870811 : -1431655766;
}

// Function: DdrTrainFunc30F @ 0xffc6030f (0x29 bytes)
// Index: 803/2560

char __cdecl DdrTrainFunc30F(int a1, unsigned __int8 a2, unsigned __int8 a3, unsigned __int8 a4)
{
  return *(_BYTE *)(1379 * (a4 >> 2) + GetCpuCount(a1, a2, a3) + 107); /*0xffc60337*/
}

// Function: DdrTrainFunc338 @ 0xffc60338 (0x14 bytes)
// Index: 804/2560

int __cdecl DdrTrainFunc338(unsigned int a1)
{
  int v1; // ecx

  v1 = -1; /*0xffc60338*/
  do /*0xffc60346*/
    ++v1; /*0xffc6033d*/
  while ( a1 >= (1 << v1) + 1 ); /*0xffc60346*/
  return v1 + 1; /*0xffc6034b*/
}

// Function: DdrTrainFunc34C @ 0xffc6034c (0x1a2 bytes)
// Index: 805/2560

char __cdecl DdrTrainFunc34C(
        int a1,
        unsigned __int8 a2,
        unsigned __int8 a3,
        unsigned __int8 a4,
        unsigned __int8 a5,
        char a6,
        unsigned int a7,
        char a8,
        char a9,
        char a10,
        int a11,
        int a12)
{
  int CpuCount; // ebp
  unsigned int v14; // ebp
  char v15; // al
  int v16; // ecx
  int v17; // eax
  int SocketInfo; // [esp+10h] [ebp-8h]
  int CpuCount_1; // [esp+14h] [ebp-4h]
  int v21; // [esp+28h] [ebp+10h]

  SocketInfo = GetSocketInfo(a1, a2); /*0xffc60369*/
  CpuCount = GetCpuCount(a1, a2, a3); /*0xffc60377*/
  CpuCount_1 = CpuCount; /*0xffc6037f*/
  v21 = KtiFunc91AF(a1, a2, a3, a4); /*0xffc6038c*/
  if ( (a5 & 1) != 0 && *(_BYTE *)(1379 * a4 + CpuCount + 37) ) /*0xffc603a0*/
  {
    v14 = IioTailX_FFD059F0(a1, a7); /*0xffc603b5*/
    a7 = v14; /*0xffc603b8*/
    v15 = KtiFuncEAE2(a1, a6); /*0xffc603bc*/
    a6 = v15; /*0xffc603c4*/
  }
  else
  {
    v14 = a7; /*0xffc603ca*/
    v15 = a6; /*0xffc603ce*/
  }
  if ( a8 == 1 ) /*0xffc603db*/
  {
    a7 = KtiFuncCA54(v14); /*0xffc603e7*/
    v15 = KtiFuncCA63(a6); /*0xffc603eb*/
  }
  *(_BYTE *)(a11 + 5) = v15; /*0xffc60400*/
  *(_DWORD *)a11 = a7; /*0xffc60408*/
  *(_BYTE *)(a11 + 6) = a9; /*0xffc6040b*/
  *(_BYTE *)(a11 + 4) = 0; /*0xffc6040e*/
  if ( ProcCommonFunc24FA(a1, a2, a3, a4) && *(_BYTE *)(7688 * a3 + SocketInfo + 6262) ) /*0xffc6042f*/
    *(_BYTE *)(a11 + 4) = (unsigned __int8)(a5 | 0xC) >> 1; /*0xffc60441*/
  v16 = ~(1 << *(_BYTE *)(242 * a5 + v21 + 8)) & 0x7FF; /*0xffc60461*/
  *(_WORD *)a12 = v16; /*0xffc6046d*/
  if ( *(_BYTE *)(7688 * a3 + SocketInfo + 6262) == 2 ) /*0xffc60480*/
    *(_WORD *)a12 = v16 & ~(12 << (4 * a4)); /*0xffc60496*/
  *(_BYTE *)(a12 + 2) = a10 | 8; /*0xffc604a6*/
  *(_BYTE *)(a12 + 5) = MailBoxFuncC4DE(SocketInfo, a11, a12, a3); /*0xffc604b5*/
  v17 = 1379 * a4; /*0xffc604bb*/
  *(_BYTE *)(a12 + 4) = 63; /*0xffc604c1*/
  if ( *(_BYTE *)(v17 + CpuCount_1 + 107) == 1 && *(_DWORD *)(a1 + 246404) == 1 )
  {
    LOBYTE(v17) = a4 != 0 ? 4 : 1;
    *(_BYTE *)(a12 + 4) = v17; /*0xffc604e0*/
  }
  *(_BYTE *)(a12 + 3) = 0; /*0xffc604e4*/
  return v17; /*0xffc604e3*/
}

// Function: DdrTrainFunc4EE @ 0xffc604ee (0xdb bytes)
// Index: 806/2560

int __cdecl DdrTrainFunc4EE(
        unsigned __int8 *a1,
        unsigned __int8 a2,
        int a3,
        unsigned __int8 a4,
        unsigned __int8 a5,
        int a6,
        int a7)
{
  int result; // eax
  unsigned __int8 *v8; // esi
  unsigned __int8 *v9; // edi
  int v10; // ebx

  result = MiscIoCheck(a1, a2, a3, 0xB00452Cu, a4); /*0xffc60507*/
  if ( a4 < a5 ) /*0xffc60514*/
  {
    v8 = (unsigned __int8 *)(a7 + 5); /*0xffc60522*/
    v9 = (unsigned __int8 *)(a6 + 6); /*0xffc60525*/
    v10 = (unsigned __int8)(a5 - a4); /*0xffc6052a*/
    do /*0xffc605be*/
    {
      MiscIoCheck( /*0xffc60564*/
        a1,
        a2,
        a3,
        0xB004530u,
        *(_DWORD *)(v9 - 6) & 0x3FFFF | ((*(v9 - 2) & 7 | (16 * ((*v9 << 6) | *(v9 - 1) & 0xF))) << 20));
      result = MiscIoCheck( /*0xffc605ad*/
                 a1,
                 a2,
                 a3,
                 0xB004534u,
                 *(_WORD *)(v8 - 5) & 0x3FF
               | ((*(v8 - 3) & 0xF | (16 * (*(v8 - 2) & 0x3F | (((*v8 << 7) | *(v8 - 1) & 0x3F) << 8)))) << 12));
      v9 += 7; /*0xffc605b5*/
      v8 += 6; /*0xffc605b8*/
      --v10; /*0xffc605bb*/
    }
    while ( v10 ); /*0xffc605be*/
  }
  return result; /*0xffc605c6*/
}

// Function: DdrTrainFunc5C9 @ 0xffc605c9 (0x106 bytes)
// Index: 807/2560

unsigned __int8 __cdecl DdrTrainFunc5C9(_BYTE *__return_address, int buf, char a3)
{
  _BYTE *SocketInfo; // esi
  int v4; // eax
  int v5; // esi
  int v6; // eax
  int v7; // edi
  int v8; // esi
  int v9; // edi
  int v10; // eax
  int v11; // eax
  unsigned __int8 n6; // al
  int v13; // [esp+10h] [ebp-Ch]
  char v14; // [esp+14h] [ebp-8h]
  _BYTE *SocketInfo_1; // [esp+18h] [ebp-4h]

  SocketInfo = (_BYTE *)GetSocketInfo((int)__return_address, buf); /*0xffc605e0*/
  LOBYTE(v13) = 0; /*0xffc605e2*/
  SocketInfo_1 = SocketInfo; /*0xffc605e8*/
  do /*0xffc606c1*/
  {
    v14 = DdrTrainFunc45AB((int)__return_address, buf, v13); /*0xffc605fa*/
    if ( *SocketInfo ) /*0xffc605fe*/
    {
      v4 = DdrTrainFunc1DF(__return_address, buf, v13, 0x7004C10u); /*0xffc60612*/
      v5 = MailBoxFunc8E0B(buf, (int)__return_address, buf, v14, v4); /*0xffc6062c*/
      v6 = DdrTrainFunc1DF(__return_address, buf, v13, 0x7004C18u); /*0xffc60630*/
      v7 = MailBoxFunc8E0B(buf, (int)__return_address, buf, v14, v6); /*0xffc60644*/
      if ( a3 ) /*0xffc6064b*/
      {
        v8 = v5 | 0x40000000; /*0xffc60652*/
        v9 = v7 | 0x40000000; /*0xffc60654*/
      }
      else
      {
        v8 = v5 & 0xBFFFFFFF; /*0xffc6065d*/
        v9 = v7 & 0xBFFFFFFF; /*0xffc6065f*/
      }
      v10 = DdrTrainFunc1DF(__return_address, buf, v13, 0x7004C10u); /*0xffc6066d*/
      MailBoxFunc8FC5((int)__return_address, buf, v14, v10, v8); /*0xffc6067c*/
      v11 = DdrTrainFunc1DF(__return_address, buf, v13, 0x7004C18u); /*0xffc60690*/
      MailBoxFunc8FC5((int)__return_address, buf, v14, v11, v9); /*0xffc6069f*/
      SocketInfo = SocketInfo_1; /*0xffc606a4*/
    }
    SocketInfo += 7688; /*0xffc606af*/
    n6 = v13 + 1; /*0xffc606b5*/
    SocketInfo_1 = SocketInfo; /*0xffc606b7*/
    LOBYTE(v13) = n6; /*0xffc606bb*/
  }
  while ( n6 < 6u ); /*0xffc606c1*/
  return n6; /*0xffc606c7*/
}

// Function: DdrTrainFunc6CF @ 0xffc606cf (0x96 bytes)
// Index: 808/2560

int __cdecl DdrTrainFunc6CF(unsigned __int8 *__return_address, unsigned __int8 buf, int n6, char a4)
{
  int v4; // esi
  int v5; // esi
  int v6; // edi

  v4 = MiscConfigCheck(__return_address, buf, n6, 184632612); /*0xffc606f6*/
  MiscConfigCheck(__return_address, buf, n6, 184632616); /*0xffc606f8*/
  MiscConfigCheck(__return_address, buf, n6, 184632620); /*0xffc60708*/
  if ( a4 ) /*0xffc60715*/
  {
    v5 = v4 | 0xFF; /*0xffc60717*/
    v6 = -1; /*0xffc6071d*/
  }
  else
  {
    v5 = v4 & 0xFFFFFF00; /*0xffc60722*/
    v6 = 0; /*0xffc60728*/
  }
  MiscIoCheck(__return_address, buf, n6, 0xB014524u, v5); /*0xffc60736*/
  MiscIoCheck(__return_address, buf, n6, 0xB014528u, v6); /*0xffc60747*/
  return MiscIoCheck(__return_address, buf, n6, 0xB01452Cu, v6); /*0xffc60760*/
}

// Function: DdrTrainFunc765 @ 0xffc60765 (0x266 bytes)
// Index: 809/2560

int __cdecl DdrTrainFunc765(unsigned __int8 *__return_address, int n4, int n6, int n2, char n4a)
{
  int v5; // esi
  int n6_1; // eax
  int v7; // esi
  int v8; // eax
  char v9; // al
  int v10; // esi
  int v11; // eax
  int v12; // esi
  char n2_1; // [esp-4h] [ebp-F0h]
  int SocketInfo; // [esp+10h] [ebp-DCh]
  _WORD src[48]; // [esp+1Ch] [ebp-D0h] BYREF
  _BYTE p_n4[112]; // [esp+7Ch] [ebp-70h] BYREF

  SocketInfo = GetSocketInfo((int)__return_address, n4); /*0xffc60789*/
  if ( SocketPresentCheck((int)__return_address, 0, 2u) ) /*0xffc6078d*/
  {
    DebugPrint((int)__return_address, 2, n4, n6, n2, 255, 255, 255, "B0 Fix for RPQ drain\n"); /*0xffc607b9*/
    v5 = MiscConfigCheck(__return_address, n4, n6, 117525792) | 0x40000; /*0xffc607cd*/
    MiscIoCheck(__return_address, n4, n6, 0x7014D20u, v5); /*0xffc607dc*/
    return MiscIoCheck(__return_address, n4, n6, 0x7014D20u, v5 & 0xFFFBFFFF); /*0xffc607f3*/
  }
  else
  {
    v7 = DdrTrainFunc2AC(__return_address, n4, n6); /*0xffc60808*/
    n6_1 = DebugPrint((int)__return_address, 2, n4, n6, n2, 255, 255, 255, "RPQ occupancy count is 0x%x\n", v7); /*0xffc60824*/
    if ( v7 ) /*0xffc6082e*/
    {
      LOBYTE(n6_1) = n6; /*0xffc60834*/
      do /*0xffc609ba*/
      {
        v8 = MiscConfigCheck(__return_address, n4, n6_1, 184567040); /*0xffc60859*/
        MiscIoCheck(__return_address, n4, n6, 0xB004500u, v8 & 0xFFFFFFF4); /*0xffc60871*/
        qmemcpy(src, &src__3, sizeof(src)); /*0xffc60890*/
        KtiFunc7D6A(p_n4, &byte_FFD5312C, 112); /*0xffc60893*/
        n2_1 = *(_BYTE *)(7688 * (unsigned __int8)n6 + SocketInfo + 6262); /*0xffc608ab*/
        v9 = DdrTrainFunc4CEE(n2, n4a); /*0xffc608c9*/
        DdrTrainFunc16C(v9, 0, (int)p_n4, src, n2_1); /*0xffc608d4*/
        DdrTrainFunc4EE(__return_address, n4, n6, 0, 0x10u, (int)p_n4, (int)src); /*0xffc608f4*/
        MiscIoCheck(__return_address, n4, n6, 0xB004504u, 4); /*0xffc60903*/
        v10 = MailBoxFunc8E6B((int)__return_address, n4, n6, 117459720, 4); /*0xffc60929*/
        MailBoxFunc902D((int)__return_address, n4, n6, 117459720, 4, 512); /*0xffc6092b*/
        MailBoxFunc902D((int)__return_address, n4, n6, 117459720, 4, 517); /*0xffc6093f*/
        CpgcChannelInit(__return_address, n4, 1 << n6); /*0xffc6094d*/
        v11 = MailBoxFunc8E6B((int)__return_address, n4, n6, 117459720, 4); /*0xffc6095c*/
        MailBoxFunc902D((int)__return_address, n4, n6, 117459720, 4, v11 & 0xFFFFFFFA | 4); /*0xffc60972*/
        MailBoxFunc902D((int)__return_address, n4, n6, 117459720, 4, v10); /*0xffc60982*/
        v12 = DdrTrainFunc2AC(__return_address, n4, n6); /*0xffc60992*/
        DebugPrint((int)__return_address, 2, n4, n6, n2, 255, 255, 255, "RPQ occupancy count is 0x%x\n", v12); /*0xffc609ae*/
        n6_1 = n6; /*0xffc609b6*/
      }
      while ( v12 ); /*0xffc609ba*/
    }
  }
  return n6_1; /*0xffc609c0*/
}

// Function: DdrTrainFunc9CB @ 0xffc609cb (0x165 bytes)
// Index: 810/2560

char __cdecl DdrTrainFunc9CB(
        unsigned __int8 *__return_address,
        int buf,
        int n6,
        int a4,
        char a5,
        unsigned __int16 n0x64)
{
  unsigned __int8 n6_2; // al
  char result; // al
  unsigned __int8 v8; // [esp+Ch] [ebp-18h] BYREF
  int n16777472; // [esp+Dh] [ebp-17h]
  int n67108608; // [esp+11h] [ebp-13h]
  int n16842496; // [esp+15h] [ebp-Fh]
  char v12; // [esp+19h] [ebp-Bh]
  char v13; // [esp+1Ah] [ebp-Ah]
  __int16 n255; // [esp+1Bh] [ebp-9h]
  int n6_1; // [esp+20h] [ebp-4h]
  char v16; // [esp+3Fh] [ebp+1Bh]

  n6_2 = 0; /*0xffc609d5*/
  LOBYTE(n6_1) = 0; /*0xffc609dc*/
  do /*0xffc609fb*/
  {
    if ( n6_2 != (_BYTE)n6 ) /*0xffc609e2*/
    {
      IioTailFuncC131(__return_address, buf, n6_1); /*0xffc609e9*/
      n6_2 = n6_1; /*0xffc609ee*/
    }
    LOBYTE(n6_1) = ++n6_2; /*0xffc609f6*/
  }
  while ( n6_2 < 6u ); /*0xffc609fb*/
  GetCpuCount((int)__return_address, buf, n6); /*0xffc60a02*/
  n16777472 = 16777472; /*0xffc60a0c*/
  v8 = 0; /*0xffc60a15*/
  LOBYTE(n6_1) = DdrTrainFunc45AB((int)__return_address, buf, n6); /*0xffc60a22*/
  MailBoxFunc8E0B(buf, (int)__return_address, buf, n6_1, 117459712); /*0xffc60a2a*/
  v12 = 0; /*0xffc60a34*/
  n67108608 = 67108608; /*0xffc60a3e*/
  n16842496 = 16842496; /*0xffc60a47*/
  v13 = a5; /*0xffc60a4e*/
  n255 = 255; /*0xffc60a51*/
  MailBoxFuncDB89(__return_address, buf, n6, &v8); /*0xffc60a57*/
  DdrTrainFuncE35((int)__return_address, buf, n6, 1 << a4, 0, 0); /*0xffc60a70*/
  MailBoxFuncF745(__return_address, buf, n6, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0); /*0xffc60a8e*/
  MiscIoCheck(__return_address, buf, n6, 0xB004500u, 0); /*0xffc60a9e*/
  MailBoxFuncDA23((int)__return_address, buf, 1 << n6); /*0xffc60ab1*/
  result = MailBoxFuncEC79((int)__return_address, buf, n6, a4, n0x64); /*0xffc60ac1*/
  v16 = result; /*0xffc60ac9*/
  if ( result != 1 ) /*0xffc60ace*/
  {
    MiscIoCheck(__return_address, buf, n6, 0xB004558u, 0); /*0xffc60adb*/
    MiscIoCheck(__return_address, buf, n6, 0xB004560u, 0); /*0xffc60aeb*/
    MiscIoCheck(__return_address, buf, n6, 0xB00455Cu, 0); /*0xffc60afb*/
    MiscIoCheck(__return_address, buf, n6, 0xB004564u, 0); /*0xffc60b0b*/
    MiscIoCheck(__return_address, buf, n6, 0xB004610u, 0); /*0xffc60b1e*/
    return v16; /*0xffc60b23*/
  }
  return result; /*0xffc60b29*/
}

// Function: DdrTrainFuncB30 @ 0xffc60b30 (0x305 bytes)
// Index: 811/2560

char __cdecl DdrTrainFuncB30(unsigned __int8 *__return_address, int n4, int a3, char n2, int a5, int a6, char a7)
{
  char n2_1; // bl
  int v8; // esi
  int n4_1; // edi
  unsigned __int8 n0x1F; // bh
  char v11; // al
  int v12; // esi
  unsigned __int8 n6_2; // bh
  char v14; // cl
  int n6_1; // esi
  int v16; // ebx
  int v17; // edi
  unsigned int v18; // esi
  int v19; // eax
  int n1024; // eax
  int v22; // [esp-40h] [ebp-8Ch]
  int v23; // [esp-4h] [ebp-50h]
  char v24; // [esp+13h] [ebp-39h]
  int n6; // [esp+14h] [ebp-38h]
  unsigned __int8 n4a; // [esp+18h] [ebp-34h]
  int v27; // [esp+1Ch] [ebp-30h]
  char v28; // [esp+20h] [ebp-2Ch]
  int v29; // [esp+24h] [ebp-28h]
  unsigned __int8 n8; // [esp+28h] [ebp-24h]
  char v31; // [esp+2Ch] [ebp-20h]
  char v32; // [esp+30h] [ebp-1Ch]
  _DWORD v33[2]; // [esp+34h] [ebp-18h]
  _WORD _t_t_t_t_t_t_t_t[6]; // [esp+3Ch] [ebp-10h] BYREF
  int v35; // [esp+48h] [ebp-4h]

  n2_1 = n2; /*0xffc60b34*/
  v33[0] = 16843009; /*0xffc60b3a*/
  v33[1] = 16843009; /*0xffc60b42*/
  HIBYTE(_t_t_t_t_t_t_t_t[4]) = 0; /*0xffc60b4a*/
  _t_t_t_t_t_t_t_t[5] = 0; /*0xffc60b4a*/
  v35 = 0; /*0xffc60b4e*/
  strcpy((char *)_t_t_t_t_t_t_t_t, "\t\t\t\t\t\t\t\t"); /*0xffc60b52*/
  v24 = 1; /*0xffc60b62*/
  n4a = 1; /*0xffc60b67*/
  switch ( n2 ) /*0xffc60b72*/
  {
    case 1: /*0xffc60b72*/
      v33[0] = 169023769; /*0xffc60b74*/
      _t_t_t_t_t_t_t_t[5] = 2570; /*0xffc60b7c*/
      _t_t_t_t_t_t_t_t[1] = 16191; /*0xffc60b83*/
LABEL_8:
      n4a = 4; /*0xffc60ba9*/
      break; /*0xffc60ba9*/
    case 2: /*0xffc60b72*/
      n4a = 7; /*0xffc60b91*/
      break;
    case 5: /*0xffc60b72*/
      n4a = 8; /*0xffc60b9d*/
      break;
    case 6: /*0xffc60b72*/
      goto LABEL_8; /*0xffc60ba7*/
  }
  v8 = 0; /*0xffc60bae*/
  n4_1 = n4; /*0xffc60bb4*/
  n8 = 0; /*0xffc60bb8*/
  v27 = 0; /*0xffc60bbc*/
  do /*0xffc60e25*/
  {
    n0x1F = *((_BYTE *)v33 + v8); /*0xffc60bc0*/
    v11 = RmtFunc6ED9(n0x1F - 1); /*0xffc60bc9*/
    if ( n0x1F <= 0x1Fu ) /*0xffc60bd2*/
      *((_BYTE *)v33 + v8) = n0x1F + 31; /*0xffc60bdd*/
    else
      *((_BYTE *)v33 + v8) = v11; /*0xffc60bd4*/
    v12 = a3; /*0xffc60be1*/
    n6_2 = 0; /*0xffc60be5*/
    v14 = 0; /*0xffc60be7*/
    LOBYTE(n6) = 0; /*0xffc60be9*/
    v28 = 0; /*0xffc60bed*/
    v29 = 0; /*0xffc60bf1*/
    do /*0xffc60de3*/
    {
      if ( ((1 << v14) & v12) != 0 ) /*0xffc60bfc*/
      {
        n6_1 = n6; /*0xffc60c02*/
        MiscConfigCheck(__return_address, n4_1, n6, 184567112); /*0xffc60c0e*/
        if ( (a7 & 2) != 0 ) /*0xffc60c1b*/
        {
          v16 = __ROR4__(-1160772527, v28); /*0xffc60c2a*/
          v17 = v16 ^ 0xEA10CA1; /*0xffc60c2e*/
          MiscIoCheck(__return_address, n4, n6, 0xB01450Cu, v16 ^ 0xEA10CA1); /*0xffc60c40*/
          v18 = v16 ^ 0xDEAD0A1E; /*0xffc60c47*/
          MiscIoCheck(__return_address, n4, n6, 0xB014510u, v16 ^ 0xDEAD0A1E); /*0xffc60c5c*/
          v16 ^= 0xBEEF0D08; /*0xffc60c61*/
          MiscIoCheck(__return_address, n4, n6, 0xB014514u, v16); /*0xffc60c79*/
          v22 = v17; /*0xffc60c7e*/
          n4_1 = n4; /*0xffc60c7f*/
          MiscIoCheck(__return_address, n4, n6, 0xB014518u, v22); /*0xffc60c91*/
          v23 = v18; /*0xffc60c99*/
          n6_1 = n6; /*0xffc60c9a*/
          MiscIoCheck(__return_address, n4, n6, 0xB01451Cu, v23); /*0xffc60ca6*/
          MiscIoCheck(__return_address, n4, n6, 0xB014520u, v16); /*0xffc60cb4*/
          n2_1 = n2; /*0xffc60cb9*/
          n6_2 = n6; /*0xffc60cc3*/
        }
        if ( n2_1 == 1 ) /*0xffc60cca*/
        {
          MiscIoCheck( /*0xffc60cff*/
            __return_address,
            n4_1,
            n6_1,
            0xB0044A0u,
            *((_BYTE *)v33 + v27) & 0x1F
          | ((*((_BYTE *)&_t_t_t_t_t_t_t_t[4] + v27) & 0x3F | ((*((_BYTE *)_t_t_t_t_t_t_t_t + v27) & 0x3F) << 8)) << 8));
          v31 = DdrTrainFunc45AB((int)__return_address, n4_1, n6_1); /*0xffc60d16*/
          n6_1 = MailBoxFunc8E6B((int)__return_address, n4_1, n6_1, 117459720, 4); /*0xffc60d2a*/
          MailBoxFunc8FC5((int)__return_address, n4_1, v31, 117459712, 4); /*0xffc60d2e*/
          v19 = n6_1 /*0xffc60d50*/
              ^ ((unsigned __int16)n6_1
               ^ (unsigned __int16)((*(unsigned __int8 *)(v27 + a5) + 1) << 10))
              & 0x7C00;
          LOBYTE(n6_1) = n6; /*0xffc60d52*/
          MailBoxFunc902D((int)__return_address, n4_1, n6, 117459720, 4, v19); /*0xffc60d61*/
        }
        else if ( n2_1 == 2 ) /*0xffc60d6b*/
        {
          DdrTrainFunc17A4(__return_address, n4_1, n6_1, n4a, n8, 0); /*0xffc60d7a*/
        }
        v32 = MailBoxFunc8E6B((int)__return_address, n4_1, n6_1, 117459984, 80); /*0xffc60d94*/
        DdrTrainFunc45AB((int)__return_address, n4_1, n6_1); /*0xffc60d98*/
        n1024 = MailBoxFunc8E6B((int)__return_address, n4_1, n6_1, 117459720, 4) & 0x7C00; /*0xffc60daf*/
        if ( !n1024 || (v32 & 0x7F) == 0 && n1024 == 1024 ) /*0xffc60dc2*/
          v24 = 0; /*0xffc60dc4*/
        v12 = a3; /*0xffc60dc9*/
      }
      v28 += 9; /*0xffc60dcd*/
      ++n6_2; /*0xffc60dd2*/
      v14 = ++v29; /*0xffc60dd8*/
      LOBYTE(n6) = n6_2; /*0xffc60ddc*/
    }
    while ( n6_2 < 6u ); /*0xffc60de3*/
    MailBoxFunc2B5B((int)__return_address, n4_1); /*0xffc60deb*/
    MailBoxFuncDA23((int)__return_address, n4_1, v12); /*0xffc60df3*/
    if ( v24 ) /*0xffc60e01*/
      CpgcChannelInit(__return_address, n4_1, v12); /*0xffc60e06*/
    v8 = v27 + 1; /*0xffc60e18*/
    ++n8; /*0xffc60e19*/
    ++v27; /*0xffc60e1d*/
  }
  while ( n8 < n4a ); /*0xffc60e25*/
  return 0; /*0xffc60e2b*/
}

// Function: DdrTrainFuncE35 @ 0xffc60e35 (0x527 bytes)
// Index: 812/2560

char __cdecl DdrTrainFuncE35(int a1, int a2, int a3, unsigned __int8 a4, unsigned __int8 a5, char a6)
{
  char v6; // al
  unsigned __int8 v8; // dl
  int v9; // eax
  int v10; // eax
  char v11; // bh
  unsigned int v12; // edi
  int n8; // esi
  char v14; // bl
  int v15; // ebx
  int v16; // edi
  int v17; // esi
  int v18; // edi
  unsigned int v19; // esi
  int v20; // eax
  unsigned __int8 n8_1; // dl
  char v22; // cl
  int v23; // esi
  int v24; // edx
  unsigned int n0x2000000; // eax
  char n16; // cl
  int n15; // edx
  int v28; // eax
  int v29; // eax
  unsigned __int8 v30; // al
  int v31; // eax
  int v32; // eax
  char v34; // [esp+13h] [ebp-1Dh]
  unsigned __int8 n8_2; // [esp+13h] [ebp-1Dh]
  int v36; // [esp+14h] [ebp-1Ch]
  int v37; // [esp+14h] [ebp-1Ch]
  int v38; // [esp+14h] [ebp-1Ch]
  unsigned __int8 v39; // [esp+18h] [ebp-18h]
  int v40; // [esp+18h] [ebp-18h]
  int v41; // [esp+1Ch] [ebp-14h]
  int v42; // [esp+20h] [ebp-10h]
  int SocketInfo; // [esp+24h] [ebp-Ch]
  int CpuCount; // [esp+28h] [ebp-8h]
  char v45; // [esp+40h] [ebp+10h]
  unsigned __int8 v46; // [esp+44h] [ebp+14h]

  SocketInfo = GetSocketInfo(a1, a2); /*0xffc60e54*/
  CpuCount = GetCpuCount(a1, a2, a3); /*0xffc60e60*/
  v6 = DdrTrainFunc45AB(a1, a2, a3); /*0xffc60e64*/
  v39 = v6; /*0xffc60e70*/
  if ( !a4 ) /*0xffc60e76*/
  {
    MailBoxFunc902D(a1, a2, a3, 117459884, 4, 0); /*0xffc60e86*/
    v8 = a3; /*0xffc60e8e*/
    if ( *(_BYTE *)(7688 * (unsigned __int8)a3 + a1 + 48704 * (unsigned __int8)a2 + 265395) ) /*0xffc60ea4*/
    {
      MailBoxFunc902D(a1, a2, a3, 117460304, 4, 0); /*0xffc60eb9*/
      v8 = a3; /*0xffc60ec1*/
    }
    v9 = MailBoxFunc8E6B(a1, a2, v8, 117459720, 4); /*0xffc60ecd*/
    MailBoxFunc902D(a1, a2, a3, 117459720, 4, v9 & 0xFFFFFF7F); /*0xffc60ee1*/
    LOBYTE(v10) = 0; /*0xffc60ee9*/
    return v10; /*0xffc60eeb*/
  }
  v42 = 0; /*0xffc60ef0*/
  v11 = 0; /*0xffc60ef5*/
  v12 = 0; /*0xffc60efe*/
  v45 = 0; /*0xffc60f00*/
  v41 = a4; /*0xffc60f05*/
  n8 = 8; /*0xffc60f0a*/
  v14 = 0; /*0xffc60f0b*/
  do
  {
    if ( ((1 << v12) & v41) != 0 )
    {
      if ( *(_BYTE *)(1379 * (v12 >> 2) + CpuCount + 107) )
      {
        if ( !v11 || v14 )
        {
          v14 = 1; /*0xffc60f5e*/
        }
        else
        {
          AssertPrint(
            (_BYTE *)a1,
            255,
            (int)"\n\nRC_ASSERT! %s: %u   %s ",
            "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Mem\\MemCpgc.c",
            1740,
            "FALSE");
          ProcMemInitCheck(a1, 242, 45); /*0xffc60f5c*/
        }
      }
      else if ( v11 && v14 == 1 )
      {
        AssertPrint(
          (_BYTE *)a1,
          255,
          (int)"\n\nRC_ASSERT! %s: %u   %s ",
          "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Mem\\MemCpgc.c",
          1746,
          "FALSE");
        ProcMemInitCheck(a1, 242, 46); /*0xffc60f91*/
      }
      else
      {
        v14 = 0; /*0xffc60f9e*/
      }
      v11 = 1; /*0xffc60faa*/
      v42 |= v12 << (4 * v45++); /*0xffc60fae*/
    }
    ++v12; /*0xffc60fb6*/
    --n8; /*0xffc60fb7*/
  }
  while ( n8 );
  v34 = v14; /*0xffc60fc9*/
  v15 = a2; /*0xffc60fcd*/
  v16 = MailBoxFunc8E0B(a2, a1, a2, v39, 117459068); /*0xffc60fe1*/
  v36 = MailBoxFunc8E0B(v15, a1, v15, v39, 117459712); /*0xffc60ff6*/
  v17 = MiscConfigCheck((unsigned __int8 *)a1, a2, a3, 117525076); /*0xffc60fff*/
  if ( v34 ) /*0xffc6101a*/
  {
    v18 = (v16 ^ (v16 | (1 << ((unsigned __int8)a3 % 3u) << 25))) & 0xE000000 ^ v16; /*0xffc6103c*/
    v15 = a2; /*0xffc6104e*/
    v37 = (v36 ^ (v36 | (1 << ((unsigned __int8)a3 % 3u) << 15))) & 0x38000 ^ v36; /*0xffc61052*/
    v19 = v17 & 0xFFFF3FFF | 0x4000; /*0xffc61056*/
  }
  else
  {
    v20 = ~(1 << ((unsigned __int8)a3 % 3u)) & 7; /*0xffc6106c*/
    v37 = ((v20 << 15) | 0xFFFC7FFF) & v36; /*0xffc6107a*/
    v18 = ((v20 << 25) | 0xF1FFFFFF) & v16; /*0xffc61083*/
    v19 = v17 & 0xFFFF3FFF | 0x8000; /*0xffc61085*/
  }
  MailBoxFunc8FC5(a1, v15, v39, 117459068, v18); /*0xffc61097*/
  MailBoxFunc8FC5(a1, v15, v39, 117459712, v37); /*0xffc610ac*/
  MiscIoCheck((unsigned __int8 *)a1, v15, a3, 0x7014A54u, v19); /*0xffc610bd*/
  MailBoxFunc902D(a1, v15, a3, 117459884, 4, v42); /*0xffc610d8*/
  v40 = GetCpuCount(a1, v15, a3); /*0xffc610f0*/
  n8_1 = 0; /*0xffc610f4*/
  v22 = 0; /*0xffc610f6*/
  n8_2 = 0; /*0xffc610f8*/
  v38 = 0; /*0xffc610fc*/
  do /*0xffc61238*/
  {
    if ( ((1 << v22) & v41) != 0 ) /*0xffc61109*/
    {
      if ( *(_BYTE *)(7688 * (unsigned __int8)a3 + SocketInfo + 6262) ) /*0xffc6111f*/
      {
        v23 = 1379 * (n8_1 >> 2); /*0xffc6113d*/
        if ( *(_BYTE *)(v23 + v40) ) /*0xffc61143*/
        {
          if ( ProcCommonFunc24FA(a1, v15, a3, n8_1 >> 2) && !*(_BYTE *)(v23 + v40 + 107) ) /*0xffc6116c*/
          {
            v24 = 7688 * (unsigned __int8)a3; /*0xffc61186*/
          }
          else
          {
            v24 = 7688 * (unsigned __int8)a3; /*0xffc6116e*/
            if ( *(_BYTE *)(v24 + SocketInfo + 6262) != 2 ) /*0xffc6117e*/
            {
LABEL_45:
              n8_1 = n8_2; /*0xffc61222*/
              goto LABEL_46; /*0xffc61222*/
            }
          }
          n0x2000000 = 0; /*0xffc6118a*/
          if ( *(_WORD *)(a1 + 257315) == 11 ) /*0xffc61194*/
          {
            n15 = *(unsigned __int8 *)(v23 + v40 + 119) - (*(unsigned __int8 *)(v23 + v40 + 126) >> 1); /*0xffc611eb*/
            if ( n15 == 16 ) /*0xffc611f0*/
            {
              n0x2000000 = 0x2000000; /*0xffc611f2*/
            }
            else if ( n15 == 15 ) /*0xffc611fc*/
            {
              n0x2000000 = 0x1000000; /*0xffc611fe*/
            }
          }
          else
          {
            n16 = *(_BYTE *)(v23 + v40 + 119); /*0xffc61196*/
            switch ( n16 ) /*0xffc6119d*/
            {
              case 17: /*0xffc6119d*/
                n0x2000000 = 0x4000000; /*0xffc6119f*/
                break;
              case 16: /*0xffc6119d*/
                n0x2000000 = 0x2000000; /*0xffc611ab*/
                break;
              case 15: /*0xffc6119d*/
                n0x2000000 = 0x1000000; /*0xffc611b7*/
                break;
            }
            if ( *(_BYTE *)(v24 + SocketInfo + 6262) == 2 && n16 == 16 ) /*0xffc611cd*/
              n0x2000000 = n0x2000000 & 0xF8FFFFFF | 0x2000000; /*0xffc611d4*/
          }
          MailBoxFunc902D(a1, v15, a3, 117460304, 4, n0x2000000 | a6 & 7); /*0xffc6121a*/
          goto LABEL_45; /*0xffc6121a*/
        }
      }
    }
LABEL_46:
    ++n8_1; /*0xffc61226*/
    v22 = v38 + 1; /*0xffc6122c*/
    n8_2 = n8_1; /*0xffc6122d*/
    ++v38; /*0xffc61231*/
  }
  while ( n8_1 < 8u ); /*0xffc61238*/
  v28 = MailBoxFunc8E6B(a1, v15, a3, 117460344, 4); /*0xffc6124b*/
  MailBoxFunc902D(a1, v15, a3, 117460344, 4, (((v45 - 1) & 7) << 24) | v28 & 0xF8FFFFFF); /*0xffc6126c*/
  v29 = MailBoxFunc8E6B(a1, v15, a3, 117459720, 4); /*0xffc6127e*/
  MailBoxFunc902D(a1, v15, a3, 117459720, 4, v29 | 0x80); /*0xffc61294*/
  if ( a5 ) /*0xffc612a1*/
  {
    MiscIoCheck((unsigned __int8 *)a1, v15, a3, 0xB004538u, 0); /*0xffc612b4*/
    v30 = (a5 >> 2) & 3; /*0xffc612c3*/
    if ( v30 == 1 ) /*0xffc612ca*/
      LOBYTE(v31) = v41; /*0xffc612cc*/
    else
      v31 = -(v30 > 1u); /*0xffc612d2*/
    MiscIoCheck((unsigned __int8 *)a1, v15, a3, 0xB00453Cu, ~(_BYTE)v31 & 0xF); /*0xffc612e5*/
    v46 = (a5 >> 4) & 3; /*0xffc612ff*/
    v32 = MiscConfigCheck((unsigned __int8 *)a1, v15, a3, 184567108) | 0x7F8000; /*0xffc61312*/
    if ( v46 == 1 ) /*0xffc61319*/
    {
      v32 = (unsigned __int8)~(_BYTE)v41 | ((unsigned __int8)~(_BYTE)v41 << 15) | v32 & 0xFF807F00; /*0xffc61330*/
    }
    else if ( v46 > 1u ) /*0xffc61334*/
    {
      v32 |= 0x7F80FFu; /*0xffc61336*/
    }
    MiscIoCheck((unsigned __int8 *)a1, v15, a3, 0xB004544u, v32); /*0xffc61343*/
  }
  return 1 << a3; /*0xffc61354*/
}

// Function: DdrTrainFunc135C @ 0xffc6135c (0x153 bytes)
// Index: 813/2560

char __cdecl DdrTrainFunc135C(
        unsigned __int8 *__return_address,
        unsigned __int8 n6,
        unsigned __int8 n2,
        char n4,
        int a5)
{
  _BYTE *SocketInfo; // ebp
  int n6_1; // eax
  int v7; // ecx
  int v8; // edi
  int v9; // esi
  int v10; // ecx
  int v11; // ecx
  int v13; // [esp+Ch] [ebp-Ch]
  int v14; // [esp+10h] [ebp-8h]
  int n6_2; // [esp+14h] [ebp-4h]

  SocketInfo = (_BYTE *)GetSocketInfo((int)__return_address, n6); /*0xffc61370*/
  n6_1 = 0; /*0xffc61372*/
  n6_2 = 0; /*0xffc61375*/
  v7 = 0; /*0xffc61379*/
  LOBYTE(v13) = 0; /*0xffc6137b*/
  v14 = 0; /*0xffc6137f*/
  do /*0xffc614a2*/
  {
    if ( *SocketInfo ) /*0xffc61383*/
    {
      v8 = KtiFunc91AF((int)__return_address, n6, v13, n2); /*0xffc613a7*/
      v9 = 242 * (unsigned __int8)n4; /*0xffc613ad*/
      v10 = 9 * (v14 + *(unsigned __int8 *)(v9 + v8 + 1)); /*0xffc613bc*/
      MiscIoCheck( /*0xffc613fb*/
        __return_address,
        n6,
        v13,
        0xB00454Cu,
        *(unsigned __int8 *)(v10 + a5)
      | ((*(unsigned __int8 *)(v10 + a5 + 1) | (*(unsigned __int16 *)(v10 + a5 + 2) << 8)) << 8));
      v11 = 9 * (v14 + *(unsigned __int8 *)(v9 + v8 + 1)); /*0xffc61409*/
      MiscIoCheck( /*0xffc6144d*/
        __return_address,
        n6,
        v13,
        0xB004550u,
        *(unsigned __int8 *)(v11 + a5 + 4)
      | ((*(unsigned __int8 *)(v11 + a5 + 5) | (*(unsigned __int16 *)(v11 + a5 + 6) << 8)) << 8));
      MiscIoCheck( /*0xffc61479*/
        __return_address,
        n6,
        v13,
        0xB004554u,
        *(unsigned __int8 *)(9 * (v14 + *(unsigned __int8 *)(v9 + v8 + 1)) + a5 + 8));
      n6_1 = n6_2; /*0xffc6147e*/
      v7 = v14; /*0xffc61485*/
    }
    LOBYTE(n6_1) = n6_1 + 1; /*0xffc61489*/
    v7 += 8; /*0xffc6148b*/
    SocketInfo += 7688; /*0xffc6148e*/
    n6_2 = n6_1; /*0xffc61494*/
    LOBYTE(v13) = n6_1; /*0xffc61498*/
    v14 = v7; /*0xffc6149c*/
  }
  while ( (unsigned __int8)n6_1 < 6u ); /*0xffc614a2*/
  return n6_1; /*0xffc614a8*/
}

// Function: DdrTrainFunc14AF @ 0xffc614af (0xdf bytes)
// Index: 814/2560

void __cdecl __noreturn DdrTrainFunc14AF(int __return_address, unsigned __int8 n6, int n32)
{
  unsigned __int8 n6_1; // bl
  _BYTE *SocketInfo; // ebp
  char v5; // di
  int CpuCount; // eax
  unsigned __int8 v7; // dh
  unsigned __int8 v8; // dl
  int v9; // eax
  int v10; // eax
  int v11; // eax
  int v12; // [esp+4h] [ebp-4h]

  if ( !KtiFuncE78(__return_address, 0, 9u) ) /*0xffc614ba*/
  {
    n6_1 = 0; /*0xffc614d7*/
    SocketInfo = (_BYTE *)GetSocketInfo(__return_address, n6); /*0xffc614d9*/
    LOBYTE(v12) = 0; /*0xffc614dd*/
    v5 = 0; /*0xffc614e1*/
    do /*0xffc61582*/
    {
      if ( *SocketInfo ) /*0xffc614e3*/
      {
        CpuCount = GetCpuCount(__return_address, n6, v12); /*0xffc614f6*/
        v7 = SocketInfo[3]; /*0xffc614fb*/
        v8 = 0; /*0xffc61501*/
        if ( v7 ) /*0xffc61505*/
        {
          while ( !*(_BYTE *)(1379 * v8 + CpuCount + 107) ) /*0xffc61515*/
          {
            if ( ++v8 >= v7 ) /*0xffc6151b*/
              goto LABEL_12; /*0xffc6151b*/
          }
          v9 = MiscConfigCheck((unsigned __int8 *)__return_address, n6, v12, 117525952); /*0xffc6152d*/
          MiscIoCheck((unsigned __int8 *)__return_address, n6, v12, 0x7014DC0u, n32 & 0x7F | v9 & 0xFFFFFF80); /*0xffc6154d*/
          v10 = *(unsigned __int16 *)(__return_address + 244426); /*0xffc61552*/
          if ( n32 ) /*0xffc61561*/
            v11 = v10 | (1 << v5); /*0xffc61563*/
          else
            v11 = v10 & ~(1 << v5); /*0xffc61568*/
          *(_WORD *)(__return_address + 244426) = v11; /*0xffc6156b*/
        }
      }
LABEL_12:
      ++n6_1; /*0xffc61572*/
      SocketInfo += 7688; /*0xffc61574*/
      ++v5; /*0xffc6157a*/
      LOBYTE(v12) = n6_1; /*0xffc6157b*/
    }
    while ( n6_1 < 6u ); /*0xffc61582*/
  }
}

// Function: DdrTrainFunc158E @ 0xffc6158e (0xf bytes)
// Index: 815/2560

void __cdecl __noreturn DdrTrainFunc158E(int __return_address, unsigned __int8 n6)
{
  DdrTrainFunc14AF(__return_address, n6, 32); /*0xffc61598*/
}

// Function: DdrTrainFunc15A1 @ 0xffc615a1 (0x203 bytes)
// Index: 816/2560

int __cdecl DdrTrainFunc15A1(unsigned __int8 *n6, int n2, unsigned int a3)
{
  unsigned __int8 n2_1; // cl
  unsigned __int8 n6a_1; // dl
  unsigned int v5; // esi
  unsigned __int8 *v6; // eax
  int CpuCount; // eax
  unsigned __int8 n2_3; // cl
  _BYTE *v9; // edx
  char v10; // al
  int v11; // eax
  int result; // eax
  char v13; // [esp+10h] [ebp-24h]
  unsigned __int8 n2_2; // [esp+14h] [ebp-20h]
  int n6a; // [esp+18h] [ebp-1Ch]
  unsigned __int16 n0x64; // [esp+1Ch] [ebp-18h]
  int v17; // [esp+20h] [ebp-14h]
  int v18; // [esp+24h] [ebp-10h]
  _BYTE *v19; // [esp+28h] [ebp-Ch]
  unsigned __int8 *v20; // [esp+2Ch] [ebp-8h]

  n2_1 = n2; /*0xffc615a4*/
  n6a_1 = 0; /*0xffc615a8*/
  v17 = 0; /*0xffc615aa*/
  n0x64 = 0; /*0xffc615af*/
  v5 = a3; /*0xffc615c4*/
  v6 = &n6[48704 * (unsigned __int8)n2 + 258722]; /*0xffc615d2*/
  LOBYTE(n6a) = 0; /*0xffc615d4*/
  v20 = v6; /*0xffc615d8*/
  do /*0xffc61775*/
  {
    if ( *v6 ) /*0xffc615dc*/
    {
      ProcCommonFunc49AC(n6, n2_1, n6a, (_BYTE)a3 == 0); /*0xffc615f9*/
      KtiFunc8C4((int)n6, 0x64u); /*0xffc61604*/
      if ( (_BYTE)a3 == 0xFF ) /*0xffc61615*/
      {
        v5 = MiscConfigCheck(n6, n2, n6a, 184567096); /*0xffc6162b*/
        CpuCount = GetCpuCount((int)n6, n2, n6a); /*0xffc6162d*/
        n2_3 = 0; /*0xffc61635*/
        n2_2 = 0; /*0xffc61637*/
        v9 = (_BYTE *)(CpuCount + 19); /*0xffc6163b*/
        v19 = (_BYTE *)(CpuCount + 19); /*0xffc6163e*/
        do /*0xffc61705*/
        {
          v13 = 0; /*0xffc61644*/
          if ( *v9 ) /*0xffc61648*/
          {
            do /*0xffc616e8*/
            {
              LOBYTE(v18) = KtiFunc88D1((int)n6, n2, n6a, n2_2, v13); /*0xffc61666*/
              v5 ^= (unsigned __int8)(v5 ^ (v5 | (1 << v18))); /*0xffc6167e*/
              if ( KtiFunc89E9((int)n6, n2, n6a, n2_2, v13, 0) /*0xffc616b5*/
                || DdrTrainFunc30F((int)n6, n2, n6a, v18)
                || DdrTrainFunc9CB(n6, n2, n6a, v18, v5, n0x64) != 1 )
              {
                v10 = v13; /*0xffc616d8*/
              }
              else
              {
                ++n0x64; /*0xffc616bb*/
                KtiFunc967((int)n6, (unsigned __int16)v17); /*0xffc616c4*/
                v17 += 10; /*0xffc616cd*/
                v10 = v13 - 1; /*0xffc616d2*/
              }
              v9 = v19; /*0xffc616dc*/
              v13 = v10 + 1; /*0xffc616e2*/
            }
            while ( (unsigned __int8)(v10 + 1) < *v19 ); /*0xffc616e8*/
            n2_3 = n2_2; /*0xffc616ee*/
          }
          ++n2_3; /*0xffc616f2*/
          v9 += 1379; /*0xffc616f4*/
          n2_2 = n2_3; /*0xffc616fa*/
          v19 = v9; /*0xffc616fe*/
        }
        while ( n2_3 < 2u ); /*0xffc61705*/
      }
      else
      {
        v5 = (unsigned __int8)a3 | v5 & 0xFFFFFF00; /*0xffc61716*/
      }
      MiscIoCheck(n6, n2, n6a, 0xB004538u, v5); /*0xffc61721*/
      v11 = MiscConfigCheck(n6, n2, n6a, 184567108); /*0xffc6172e*/
      MiscIoCheck(n6, n2, n6a, 0xB004544u, (((_BYTE)a3 == 0) << 8) | v11 & 0xFFFFFEFF); /*0xffc6174f*/
      n2_1 = n2; /*0xffc61754*/
      n6a_1 = n6a; /*0xffc6175b*/
      v6 = v20; /*0xffc6175f*/
    }
    ++n6a_1; /*0xffc61763*/
    v6 += 7688; /*0xffc61765*/
    LOBYTE(n6a) = n6a_1; /*0xffc6176a*/
    v20 = v6; /*0xffc6176e*/
  }
  while ( n6a_1 < 6u ); /*0xffc61775*/
  result = 50813 * (unsigned __int8)n2; /*0xffc6177b*/
  if ( (_BYTE)a3 ) /*0xffc61788*/
    n6[result + 58726] = 0; /*0xffc61794*/
  else
    n6[result + 58726] = 1; /*0xffc6178a*/
  return result; /*0xffc6179c*/
}

// Function: DdrTrainFunc17A4 @ 0xffc617a4 (0x179 bytes)
// Index: 817/2560

int __cdecl DdrTrainFunc17A4(
        unsigned __int8 *__return_address,
        unsigned __int8 n4,
        int n6,
        unsigned __int8 n4a,
        char n8,
        char a6)
{
  unsigned __int8 n8_1; // al
  char n0x10; // ch
  int v8; // ebp
  int v9; // esi
  unsigned int v10; // edi
  char n0x10_2; // al
  int v12; // edx
  __int64 v14; // [esp-Ch] [ebp-2Ch]
  char n0x10_1; // [esp+12h] [ebp-Eh]
  unsigned __int8 n8_2; // [esp+13h] [ebp-Dh]
  int v17; // [esp+18h] [ebp-8h]
  int v18; // [esp+1Ch] [ebp-4h]

  MiscIoCheck(__return_address, n4, n6, 0xB00452Cu, 0); /*0xffc617c1*/
  n8_1 = 0; /*0xffc617ce*/
  n8_2 = 0; /*0xffc617d4*/
  do /*0xffc61885*/
  {
    n0x10 = 0; /*0xffc617e3*/
    v8 = 0; /*0xffc617eb*/
    v9 = 0; /*0xffc617ed*/
    n0x10_1 = 0; /*0xffc617ef*/
    v17 = n8_1 & 1; /*0xffc617f3*/
    v10 = 0; /*0xffc617f7*/
    v18 = n8_1 >> 1; /*0xffc617f9*/
    do /*0xffc61845*/
    {
      n0x10_2 = n0x10; /*0xffc61805*/
      if ( (unsigned __int8)n0x10 < 0x13u ) /*0xffc6180a*/
      {
        if ( (unsigned __int8)n0x10 >= 0x10u ) /*0xffc61813*/
          n0x10_2 = n0x10 + 8; /*0xffc61815*/
      }
      else
      {
        n0x10_2 = n0x10 + 21; /*0xffc6180c*/
      }
      HIDWORD(v14) = 0; /*0xffc6181b*/
      if ( v10 % n4a == n8 ) /*0xffc6181f*/
        LODWORD(v14) = v17; /*0xffc61821*/
      else
        LODWORD(v14) = v18; /*0xffc61827*/
      v8 |= RmtFunc6EA8(v14, n0x10_2); /*0xffc61837*/
      v9 |= v12; /*0xffc61839*/
      n0x10 = n0x10_1 + 1; /*0xffc6183b*/
      ++v10; /*0xffc6183d*/
      n0x10_1 = n0x10; /*0xffc6183e*/
    }
    while ( (unsigned __int8)n0x10 < 0x16u ); /*0xffc61845*/
    MiscIoCheck(__return_address, n4, n6, 0xB004530u, v8); /*0xffc61860*/
    MiscIoCheck(__return_address, n4, n6, 0xB004534u, v9); /*0xffc61871*/
    n8_1 = n8_2 + 1; /*0xffc6187d*/
    n8_2 = n8_1; /*0xffc6187f*/
  }
  while ( n8_1 < 8u ); /*0xffc61885*/
  MiscIoCheck(__return_address, n4, n6, 0xB004508u, a6 == 0 ? 34 : 2);
  MiscIoCheck(__return_address, n4, n6, 0xB00451Cu, 0); /*0xffc618b3*/
  MiscIoCheck(__return_address, n4, n6, 0xB004520u, 100729090); /*0xffc618c5*/
  MiscIoCheck(__return_address, n4, n6, 0xB004524u, 0); /*0xffc618d4*/
  MiscIoCheck(__return_address, n4, n6, 0xB00450Cu, 3745); /*0xffc618e9*/
  MiscIoCheck(__return_address, n4, n6, 0xB004510u, 48879); /*0xffc618fb*/
  return MiscIoCheck(__return_address, n4, n6, 0xB004514u, 57005); /*0xffc61915*/
}

// Function: DdrTrainFunc191D @ 0xffc6191d (0x80a bytes)
// Index: 818/2560

unsigned __int8 __cdecl DdrTrainFunc191D(
        unsigned __int8 *n6,
        int n4,
        int a3,
        char n2,
        int a5,
        int a6,
        int a7,
        char a8,
        unsigned __int16 *a9,
        char a10,
        int a11,
        int n255)
{
  unsigned __int16 *v12; // ebx
  unsigned __int8 v13; // cl
  unsigned __int16 v14; // ax
  int n557056; // esi
  unsigned __int8 *n6_1; // ebx
  unsigned __int8 n4_1; // cl
  unsigned int v18; // ebp
  int v19; // edi
  unsigned __int8 v20; // cl
  int v21; // eax
  unsigned __int8 v22; // ch
  unsigned __int8 *v23; // edx
  int v24; // eax
  int v25; // eax
  int v26; // eax
  unsigned int v27; // esi
  unsigned __int8 n6_2; // si
  unsigned __int16 n255_1; // ax
  unsigned int v30; // edi
  unsigned __int8 v31; // al
  unsigned __int8 v32; // al
  unsigned __int8 v33; // al
  int v34; // edx
  unsigned int n0x1F; // ecx
  char v36; // al
  int v37; // eax
  unsigned int n0x1F_1; // ecx
  char v39; // al
  int v40; //... [12726 chars total]

// Function: DdrTrainFunc2127 @ 0xffc62127 (0xb9 bytes)
// Index: 819/2560

int __cdecl DdrTrainFunc2127(unsigned __int8 *n6, int n4, int a3, int n7, char a5, char a6, int a7, int n10)
{
  int result; // eax
  int v9[13]; // [esp+8h] [ebp-4Ch] BYREF
  __int16 v10; // [esp+3Ch] [ebp-18h]
  int v11; // [esp+3Eh] [ebp-16h]
  __int16 v12; // [esp+42h] [ebp-12h]
  unsigned __int16 n16; // [esp+44h] [ebp-10h] BYREF
  int v14; // [esp+48h] [ebp-Ch]
  int v15; // [esp+4Ch] [ebp-8h]
  char v16; // [esp+50h] [ebp-4h]

  v11 = 0; /*0xffc6213b*/
  n16 = 16; /*0xffc62145*/
  memset(v9, 0, 28); /*0xffc62151*/
  v15 = n10 - 1; /*0xffc62154*/
  v9[7] = 1023; /*0xffc6217f*/
  v9[8] = 0; /*0xffc62186*/
  v9[9] = 511; /*0xffc62189*/
  memset(&v9[10], 0, 12); /*0xffc62190*/
  v10 = 1; /*0xffc62199*/
  v12 = 1; /*0xffc6219d*/
  v14 = 0; /*0xffc621a1*/
  v16 = 0; /*0xffc621a4*/
  DdrTrainFunc191D(n6, n4, a3, 0, 8, n7, (int)v9, a5, &n16, a6, a7, 0); /*0xffc621a7*/
  result = 50813 * (unsigned __int8)n4; /*0xffc621b8*/
  n6[result + 58722] = n7 - 7; /*0xffc621be*/
  if ( (_BYTE)n7 == 7 ) /*0xffc621c8*/
    n6[result + 58722] = 1; /*0xffc621ca*/
  n6[result + 58721] = 0; /*0xffc621d2*/
  return result; /*0xffc621da*/
}

// Function: DdrTrainFunc21E0 @ 0xffc621e0 (0x97 bytes)
// Index: 820/2560

int __cdecl DdrTrainFunc21E0(unsigned __int8 *n6, int n4, int a3, int a4, char a5, char a6, int a7)
{
  int result; // eax
  int v8[14]; // [esp+8h] [ebp-4Ch] BYREF
  __int16 v9; // [esp+40h] [ebp-14h]
  __int16 v10; // [esp+42h] [ebp-12h]
  unsigned __int16 n32; // [esp+44h] [ebp-10h] BYREF
  int v12; // [esp+48h] [ebp-Ch]
  int v13; // [esp+4Ch] [ebp-8h]
  char v14; // [esp+50h] [ebp-4h]

  v9 = 0; /*0xffc621ff*/
  v10 = 1; /*0xffc62204*/
  memset(v8, 0, 28); /*0xffc62212*/
  v8[7] = 1023; /*0xffc62233*/
  memset(&v8[8], 0, 24); /*0xffc6223a*/
  n32 = 32; /*0xffc62249*/
  v12 = 0; /*0xffc6224d*/
  v13 = 0; /*0xffc62250*/
  v14 = 0; /*0xffc62253*/
  DdrTrainFunc191D(n6, n4, a3, 2, 32, a4, (int)v8, a5, &n32, a6, a7, 0); /*0xffc62256*/
  result = 50813 * (unsigned __int8)n4; /*0xffc62261*/
  *(_WORD *)&n6[result + 58721] = 256; /*0xffc62267*/
  return result; /*0xffc62271*/
}

// Function: DdrTrainFunc2277 @ 0xffc62277 (0x89 bytes)
// Index: 821/2560

int __cdecl DdrTrainFunc2277(unsigned __int8 *__return_address, unsigned __int8 n4, int n6, char n277, int *a5)
{
  int v5; // eax

  v5 = MiscConfigCheck(__return_address, n4, n6, 184632628); /*0xffc6228f*/
  MiscIoCheck( /*0xffc622bd*/
    __return_address,
    n4,
    n6,
    0xB014534u,
    n277 & 3 | v5 & 0xFFFFFF24 | (2 * (n277 & 0xC | (2 * (n277 & 0x30)))));
  MiscIoCheck(__return_address, n4, n6, 0xB014518u, *a5); /*0xffc622d0*/
  MiscIoCheck(__return_address, n4, n6, 0xB01451Cu, a5[1]); /*0xffc622e0*/
  return MiscIoCheck(__return_address, n4, n6, 0xB014520u, a5[2]); /*0xffc622fb*/
}

// Function: DdrTrainFunc2300 @ 0xffc62300 (0x6f bytes)
// Index: 822/2560

int __cdecl DdrTrainFunc2300(
        unsigned __int8 *__return_address,
        unsigned __int8 n4,
        int n6,
        unsigned __int8 n224,
        unsigned __int8 a5)
{
  MiscIoCheck(__return_address, n4, n6, 0xB0040A0u, 0); /*0xffc62314*/
  MiscIoCheck(__return_address, n4, n6, 0xB0040C0u, 0); /*0xffc62329*/
  MiscIoCheck(__return_address, n4, n6, 0xB0040D8u, n224 | ((a5 | 0x4000) << 8)); /*0xffc62350*/
  return MiscIoCheck(__return_address, n4, n6, 0xB0040E8u, n224 | ((a5 | 0x4000) << 8)); /*0xffc6236c*/
}

// Function: DdrTrainFunc236F @ 0xffc6236f (0x3ab bytes)
// Index: 823/2560

int __cdecl DdrTrainFunc236F(
        int __return_address,
        int n4,
        int a3,
        unsigned __int8 a4,
        unsigned __int8 a5,
        char n8,
        char a7,
        int a8,
        unsigned __int8 n6)
{
  int n4_1; // ebx
  int v11; // eax
  int v12; // eax
  char n8_1; // ch
  int v14; // eax
  __int16 v15; // si
  unsigned int v16; // eax
  int v17; // esi
  char v18; // al
  char v19; // cl
  unsigned __int8 n6_1; // al
  int n9; // eax
  int v22; // esi
  int v23; // eax
  unsigned __int8 v25; // [esp+10h] [ebp-20h]
  int v26; // [esp+14h] [ebp-1Ch]
  _BYTE v27[5]; // [esp+18h] [ebp-18h] BYREF
  char v28; // [esp+1Dh] [ebp-13h]
  int CpuCount; // [esp+20h] [ebp-10h]
  int v30; // [esp+24h] [ebp-Ch]
  int v31; // [esp+28h] [ebp-8h] BYREF
  char v32; // [esp+2Ch] [ebp-4h]
  char v33; // [esp+2Dh] [ebp-3h]
  char v34; // [esp+2Eh] [ebp-2h]
  int SocketInfo; // [esp+34h] [ebp+4h]
  char n8_2; // [esp+4Ch] [ebp+1Ch]
  char v37; // [esp+4Ch] [ebp+1Ch]

  n4_1 = n4; /*0xffc62373*/
  *(_DWORD *)v27 = KtiFunc91AF(__return_address, n4, a3, a4); /*0xffc62391*/
  SocketInfo = GetSocketInfo(__return_address, n4); /*0xffc6239d*/
  CpuCount = GetCpuCount(__return_address, n4, a3); /*0xffc623a6*/
  v11 = a3; /*0xffc623ac*/
  v25 = 0; /*0xffc623ae*/
  v30 = (unsigned __int8)a3; /*0xffc623be*/
  v26 = 7688 * (unsigned __int8)a3; /*0xffc623c6*/
  if ( *(_BYTE *)(SocketInfo + v26 + 6262) == 2 && !*(_BYTE *)(__return_address + 453595) ) /*0xffc623d4*/
  {
    ProcCommonFunc5183((unsigned __int8 *)__return_address, n4, a3, 0); /*0xffc623e0*/
    v11 = a3; /*0xffc623e5*/
  }
  MiscIoCheck((unsigned __int8 *)__return_address, n4, v11, 0xB00452Cu, 0); /*0xffc623f7*/
  v12 = MiscConfigCheck((unsigned __int8 *)__return_address, n4, a3, 184567040); /*0xffc62408*/
  MiscIoCheck((unsigned __int8 *)__return_address, n4, a3, 0xB004500u, v12 & 0xFFFFFFF4); /*0xffc62419*/
  v32 = 0; /*0xffc6242b*/
  v31 = a8 & 0x1FFFF; /*0xffc62431*/
  v33 = a7; /*0xffc6243e*/
  if ( ProcCommonFunc24FA(__return_address, n4, a3, a4) && *(_BYTE *)(v26 + SocketInfo + 6262) == 1 ) /*0xffc62465*/
    v32 = (unsigned __int8)(a5 | 0xC) >> 1; /*0xffc6246d*/
  n8_1 = n8; /*0xffc62471*/
  v14 = 242 * a5; /*0xffc6247c*/
  v34 = 0; /*0xffc62482*/
  if ( n8 == 8 ) /*0xffc6248a*/
  {
    v15 = ~((1 << *(_BYTE *)(v14 + *(_DWORD *)v27 + 8)) + (1 << (*(_BYTE *)(v14 + *(_DWORD *)v27 + 8) + 1))); /*0xffc624a7*/
    n8_1 = 0; /*0xffc624aa*/
  }
  else
  {
    v15 = ~(1 << *(_BYTE *)(v14 + *(_DWORD *)v27 + 8)); /*0xffc624bb*/
  }
  n8_2 = n8_1; /*0xffc624c2*/
  *(_WORD *)v27 = v15; /*0xffc624ca*/
  if ( *(_BYTE *)(v26 + SocketInfo + 6262) == 2 ) /*0xffc624d7*/
    *(_WORD *)v27 = ~(12 << (4 * a4)) & v15; /*0xffc624ef*/
  *(_WORD *)&v27[3] = 0; /*0xffc624fc*/
  v16 = MiscConfigCheck((unsigned __int8 *)__return_address, n4, a3, 184567108); /*0xffc62503*/
  if ( !(_BYTE)v16 || ((unsigned __int8)(v16 >> 15) & (unsigned __int8)v16) != 0 ) /*0xffc62516*/
    v27[4] = 63; /*0xffc62518*/
  if ( *(_DWORD *)(__return_address + 246404) == 1
    && *(_BYTE *)(1379 * a4 + CpuCount + 107) == 1
    && (v16 & 0x7F8000) != 0 )
  {
    v27[4] = a4 != 0 ? 4 : 1;
  }
  v27[2] = n8_2 | 8; /*0xffc6255a*/
  v28 = MailBoxFuncC4DE(SocketInfo, (int)&v31, (int)v27, a3); /*0xffc62572*/
  v17 = 50813 * (unsigned __int8)n4; /*0xffc6257c*/
  if ( *(_BYTE *)(v17 + __return_address + 58726) && (n8 == 8 || !n8 || n8 == 6) ) /*0xffc6259a*/
  {
    DdrTrainFunc4EE((unsigned __int8 *)__return_address, n4, a3, 0, 1u, (int)&v31, (int)&src__0); /*0xffc625ad*/
    v18 = 1; /*0xffc625b2*/
    v25 = 1; /*0xffc625b7*/
  }
  else
  {
    v18 = 0; /*0xffc625bd*/
  }
  v37 = v18 + 1; /*0xffc625ca*/
  DdrTrainFunc4EE((unsigned __int8 *)__return_address, n4, a3, v25, v18 + 1, (int)&v31, (int)v27); /*0xffc625d7*/
  v19 = v37; /*0xffc625dc*/
  if ( *(_BYTE *)(v17 + __return_address + 58726) && (n8 == 8 || !n8 || n8 == 6) ) /*0xffc625ff*/
  {
    DdrTrainFunc4EE((unsigned __int8 *)__return_address, n4, a3, v37, v37 + 1, (int)&v31, (int)&src__0); /*0xffc62619*/
    v19 = v37 + 1; /*0xffc6261e*/
    n4_1 = n4; /*0xffc62623*/
  }
  n6_1 = n6; /*0xffc62627*/
  if ( n6 < 6u ) /*0xffc6262d*/
    n6_1 = 6; /*0xffc6262f*/
  if ( *(_BYTE *)(v17 + __return_address + 58726) == 1 ) /*0xffc62639*/
    n9 = 9; /*0xffc6263d*/
  else
    n9 = n6_1 & 0xF; /*0xffc62643*/
  MiscIoCheck((unsigned __int8 *)__return_address, n4_1, a3, 0xB004504u, n9 | (((v19 - 1) & 0xF) << 16)); /*0xffc6265b*/
  v22 = MailBoxFunc8E6B(__return_address, n4_1, a3, 117459720, 4); /*0xffc6267e*/
  MailBoxFunc902D(__return_address, n4_1, a3, 117459720, 4, 512); /*0xffc62680*/
  MailBoxFunc902D(__return_address, n4_1, a3, 117459720, 4, 517); /*0xffc62697*/
  CpgcChannelInit((unsigned __int8 *)__return_address, n4_1, 1 << v30); /*0xffc626a8*/
  v23 = MailBoxFunc8E6B(__return_address, n4_1, a3, 117459720, 4); /*0xffc626b7*/
  MailBoxFunc902D(__return_address, n4_1, a3, 117459720, 4, v23 & 0xFFFFFFFA | 4); /*0xffc626cd*/
  MailBoxFunc902D(__return_address, n4_1, a3, 117459720, 4, v22); /*0xffc626e0*/
  if ( *(_BYTE *)(v26 + SocketInfo + 6262) == 2 && !*(_BYTE *)(__return_address + 453595) ) /*0xffc626fa*/
    ProcCommonFunc5183((unsigned __int8 *)__return_address, n4_1, a3, 1); /*0xffc62708*/
  return 0; /*0xffc62710*/
}

// Function: DdrTrainFunc271A @ 0xffc6271a (0x51a bytes)
// Index: 824/2560

char __cdecl DdrTrainFunc271A(
        unsigned __int8 *n2,
        int n4,
        _BYTE *n6,
        int n2_1,
        unsigned __int8 a5,
        unsigned __int16 a6,
        char n6a)
{
  int v7; // esi
  unsigned __int16 v8; // di
  int v9; // eax
  int v10; // eax
  unsigned __int8 n6_1; // al
  int n512; // esi
  int v13; // eax
  unsigned int v14; // edx
  unsigned __int8 v15; // al
  int v16; // eax
  unsigned __int8 v18; // [esp+Ah] [ebp-106h]
  unsigned __int8 v19; // [esp+Ah] [ebp-106h]
  unsigned __int8 i_1; // [esp+Bh] [ebp-105h]
  unsigned __int8 i; // [esp+Ch] [ebp-104h]
  unsigned __int8 v22; // [esp+10h] [ebp-100h]
  char v23; // [esp+14h] [ebp-FCh]
  int SocketInfo; // [esp+1Ch] [ebp-F4h]
  int v25; // [esp+20h] [ebp-F0h]
  int v26; // [esp+2Ch] [ebp-E4h]
  int v27; // [esp+30h] [ebp-E0h]
  int v28; // [esp+34h] [ebp-DCh]
  int v29; // [esp+38h] [ebp-D8h]
  int v30; // [esp+3Ch] [ebp-D4h]
  _BYTE v31[112]; // [esp+40h] [ebp-D0h] BYREF
  _WORD v32[48]; // [esp+B0h] [ebp-60h] BYREF

  v25 = 50813 * (unsigned __int8)n4; /*0xffc62739*/
  if ( n2[v25 + 58726] == 1 ) /*0xffc62745*/
    KtiFunc8C4((int)n2, 0xAu); /*0xffc6274a*/
  SocketInfo = GetSocketInfo((int)n2, n4); /*0xffc62776*/
  v7 = KtiFunc91AF((int)n2, n4, (unsigned __int8)n6, n2_1); /*0xffc62787*/
  v29 = KtiFunc91DE((int)n2, n4, (unsigned __int8)n6, n2_1); /*0xffc627aa*/
  v30 = 244 * a5; /*0xffc627ae*/
  v8 = *(_WORD *)(v30 + v29 + 10) & 0xFE3F; /*0xffc627bf*/
  v9 = *(unsigned __int16 *)(242 * a5 + v7 + 10) >> 9; /*0xffc627cd*/
  if ( v9 ) /*0xffc627d3*/
  {
    v10 = v9 - 1; /*0xffc627d5*/
    if ( v10 ) /*0xffc627d8*/
    {
      if ( v10 == 1 ) /*0xffc627dd*/
        v8 |= 0x100u; /*0xffc627df*/
    }
    else
    {
      v8 |= 0x80u; /*0xffc627e7*/
    }
  }
  RmtFunc349(n2, n4, (int)n6, n2_1, a5, v8, 5); /*0xffc6280a*/
  n6_1 = (unsigned __int8)n6; /*0xffc6280f*/
  v28 = 7688 * (unsigned __int8)n6; /*0xffc6282a*/
  if ( *(_BYTE *)(v28 + SocketInfo + 6262) == 2 && !n2[453595] ) /*0xffc62838*/
  {
    ProcCommonFunc5183(n2, n4, (int)n6, 0); /*0xffc6284c*/
    n6_1 = (unsigned __int8)n6; /*0xffc62851*/
  }
  v23 = DdrTrainFunc45AB((int)n2, n4, n6_1); /*0xffc6286e*/
  v27 = MailBoxFunc8E0B((int)n2, (int)n2, n4, v23, 117459068); /*0xffc62886*/
  MailBoxFunc8FC5((int)n2, n4, v23, 117459068, v27 & 0xF1FFFFFF); /*0xffc6289e*/
  MiscIoCheck(n2, n4, (int)n6, 0xB00452Cu, 0); /*0xffc628ba*/
  n512 = 512; /*0xffc628d8*/
  v26 = MailBoxFunc8E6B((int)n2, n4, (unsigned __int8)n6, 117459720, 4); /*0xffc628dd*/
  MailBoxFunc902D((int)n2, n4, (unsigned __int8)n6, 117459720, 4, 512); /*0xffc628ee*/
  v13 = MiscConfigCheck(n2, n4, (unsigned __int8)n6, 184567040); /*0xffc62902*/
  MiscIoCheck(n2, n4, (int)n6, 0xB004500u, v13 & 0xFFFFFFF4); /*0xffc62915*/
  if ( n2[257313] || (i_1 = 1, n6a == 7) ) /*0xffc62933*/
    i_1 = 0; /*0xffc62935*/
  v14 = a6 | 0x80; /*0xffc62955*/
  for ( i = 0; i <= i_1; ++i ) /*0xffc6295d*/
  {
    v18 = n2[v25 + 58726] != 0; /*0xffc6297b*/
    DdrTrainFunc34C( /*0xffc629bb*/
      (int)n2,
      n4,
      (unsigned __int8)n6,
      n2_1,
      a5,
      n6a,
      v14,
      i,
      0,
      0,
      (int)&v31[7 * v18],
      (int)&v32[3 * v18]);
    ++v18; /*0xffc629d0*/
    DdrTrainFunc34C( /*0xffc62a0e*/
      (int)n2,
      n4,
      (unsigned __int8)n6,
      n2_1,
      a5,
      n6a,
      a6 | 0x80,
      i,
      0,
      0,
      (int)&v31[7 * v18],
      (int)&v32[3 * v18]);
    ++v18; /*0xffc62a26*/
    DdrTrainFunc34C( /*0xffc62a64*/
      (int)n2,
      n4,
      (unsigned __int8)n6,
      n2_1,
      a5,
      n6a,
      a6 & 0xFF7F,
      i,
      0,
      0,
      (int)&v31[7 * v18],
      (int)&v32[3 * v18]);
    v15 = v18 + 1; /*0xffc62a70*/
    v19 = v15; /*0xffc62a7a*/
    v22 = v15; /*0xffc62a7e*/
    if ( n2[v25 + 58726] ) /*0xffc62a72*/
    {
      v19 = v15 + 1; /*0xffc62a86*/
      v22 = v15 + 1; /*0xffc62a8a*/
    }
    DdrTrainFunc4EE(n2, n4, (int)n6, 0, v22, (int)v31, (int)v32); /*0xffc62aaa*/
    if ( n2[v25 + 58726] ) /*0xffc62ab2*/
    {
      DdrTrainFunc4EE(n2, n4, (int)n6, 0, 1u, (int)v31, (int)&src__0); /*0xffc62ad3*/
      DdrTrainFunc4EE(n2, n4, (int)n6, v19 - 1, v22, (int)v31, (int)&src__0); /*0xffc62af9*/
    }
    MiscIoCheck(n2, n4, (int)n6, 0xB004504u, (((v19 - 1) & 0xF) << 16) | 9); /*0xffc62b1f*/
    n512 |= 5u; /*0xffc62b24*/
    MailBoxFunc902D((int)n2, n4, (unsigned __int8)n6, 117459720, 4, n512); /*0xffc62b38*/
    CpgcChannelInit(n2, n4, 1 << (char)n6); /*0xffc62b49*/
    v14 = a6 | 0x80; /*0xffc62b55*/
  }
  v16 = MailBoxFunc8E6B((int)n2, n4, (unsigned __int8)n6, 117459720, 4); /*0xffc62b7c*/
  MailBoxFunc902D((int)n2, n4, (unsigned __int8)n6, 117459720, 4, v16 & 0xFFFFFFFA | 4); /*0xffc62b92*/
  MailBoxFunc902D((int)n2, n4, (unsigned __int8)n6, 117459720, 4, v26); /*0xffc62ba6*/
  MailBoxFunc8FC5((int)n2, n4, v23, 117459068, v27); /*0xffc62bc4*/
  if ( *(_BYTE *)(v28 + SocketInfo + 6262) == 2 && !n2[453595] ) /*0xffc62be0*/
    ProcCommonFunc5183(n2, n4, (int)n6, 1); /*0xffc62bf4*/
  return RmtFunc349(n2, n4, (int)n6, n2_1, a5, *(unsigned __int16 *)(v30 + v29 + 10), 5); /*0xffc62c2b*/
}

// Function: DdrTrainFunc2C34 @ 0xffc62c34 (0x661 bytes)
// Index: 825/2560

char __cdecl DdrTrainFunc2C34(
        unsigned __int8 *n6,
        int n4,
        int n6_1,
        int n2,
        unsigned __int8 a5,
        char n0x12,
        unsigned __int16 a7,
        char n6a)
{
  int n4_1; // ebx
  int SocketInfo; // edi
  unsigned __int16 v11; // cx
  int v12; // eax
  int v13; // eax
  unsigned __int8 n6_2; // al
  int n512; // edi
  int v16; // eax
  unsigned int v17; // eax
  unsigned int v18; // esi
  unsigned int v19; // esi
  int v20; // ecx
  unsigned __int8 v21; // al
  int v22; // eax
  _BYTE *v23; // [esp-14h] [ebp-B4h]
  _WORD *v24; // [esp-10h] [ebp-B0h]
  bool v25; // [esp+6h] [ebp-9Ah]
  unsigned __int8 v26; // [esp+6h] [ebp-9Ah]
  unsigned __int8 v27; // [esp+6h] [ebp-9Ah]
  unsigned __int8 v28; // [esp+6h] [ebp-9Ah]
  unsigned __int8 v29; // [esp+6h] [ebp-9Ah]
  unsigned __int8 i_1; // [esp+7h] [ebp-99h]
  unsigned __int8 i; // [esp+8h] [ebp-98h]
  unsigned int v32; // [esp+Ch] [ebp-94h]
  int v33; // [esp+10h] [ebp-90h]
  unsigned __int8 v34; // [esp+14h] [ebp-8Ch]
  char v35; // [esp+18h] [ebp-88h]
  int v36; // [esp+1Ch] [ebp-84h]
  int v37; // [esp+20h] [ebp-80h]
  int v38; // [esp+24h] [ebp-7Ch]
  int v39; // [esp+28h] [ebp-78h]
  int v40; // [esp+30h] [ebp-70h]
  int v41; // [esp+34h] [ebp-6Ch]
  int v42; // [esp+38h] [ebp-68h]
  int SocketInfo_1; // [esp+3Ch] [ebp-64h]
  _BYTE v44[52]; // [esp+40h] [ebp-60h] BYREF
  _WORD v45[20]; // [esp+74h] [ebp-2Ch] BYREF

  if ( KtiFuncE78((int)n6, 0, 3u) ) /*0xffc62c47*/
    return NetInit(n6, n4, n6_1, n2, a5, n0x12, a7, n6a); /*0xffc62c85*/
  n4_1 = n4; /*0xffc62c93*/
  v33 = 50813 * (unsigned __int8)n4; /*0xffc62ca4*/
  if ( n6[v33 + 58726] == 1 ) /*0xffc62cb0*/
    KtiFunc8C4((int)n6, 0xAu); /*0xffc62cb5*/
  SocketInfo = GetSocketInfo((int)n6, n4); /*0xffc62cd2*/
  SocketInfo_1 = SocketInfo; /*0xffc62cd7*/
  v38 = KtiFunc91AF((int)n6, n4, n6_1, n2); /*0xffc62ce7*/
  v36 = KtiFunc91DE((int)n6, n4, n6_1, n2); /*0xffc62d06*/
  v37 = 244 * a5; /*0xffc62d10*/
  v39 = 242 * a5; /*0xffc62d14*/
  v11 = *(_WORD *)(v37 + v36 + 10) & 0xFE3F; /*0xffc62d29*/
  v12 = *(unsigned __int16 *)(v39 + v38 + 10) >> 9; /*0xffc62d31*/
  if ( v12 ) /*0xffc62d37*/
  {
    v13 = v12 - 1; /*0xffc62d39*/
    if ( v13 ) /*0xffc62d3c*/
    {
      if ( v13 == 1 ) /*0xffc62d41*/
        v11 |= 0x100u; /*0xffc62d43*/
    }
    else
    {
      v11 |= 0x80u; /*0xffc62d4b*/
    }
  }
  RmtFunc349(n6, n4, n6_1, n2, a5, v11, 5); /*0xffc62d68*/
  n6_2 = n6_1; /*0xffc62d6d*/
  v42 = 7688 * (unsigned __int8)n6_1; /*0xffc62d84*/
  if ( *(_BYTE *)(v42 + SocketInfo + 6262) == 2 && !n6[453595] ) /*0xffc62d92*/
  {
    ProcCommonFunc5183(n6, n4, n6_1, 0); /*0xffc62da0*/
    n6_2 = n6_1; /*0xffc62da5*/
  }
  v35 = DdrTrainFunc45AB((int)n6, n4, n6_2); /*0xffc62dbc*/
  v41 = MailBoxFunc8E0B(n4, (int)n6, n4, v35, 117459068); /*0xffc62dcc*/
  MailBoxFunc8FC5((int)n6, n4, v35, 117459068, v41 & 0xF1FFFFFF); /*0xffc62ddd*/
  MiscIoCheck(n6, n4, n6_1, 0xB00452Cu, 0); /*0xffc62df3*/
  n512 = 512; /*0xffc62e0a*/
  v40 = MailBoxFunc8E6B((int)n6, n4, n6_1, 117459720, 4); /*0xffc62e0f*/
  MailBoxFunc902D((int)n6, n4, n6_1, 117459720, 4, 512); /*0xffc62e1e*/
  v16 = MiscConfigCheck(n6, n4, n6_1, 184567040); /*0xffc62e2b*/
  MiscIoCheck(n6, n4, n6_1, 0xB004500u, v16 & 0xFFFFFFF4); /*0xffc62e3c*/
  if ( n6[257313] || (i_1 = 1, n6a == 7) ) /*0xffc62e5a*/
    i_1 = 0; /*0xffc62e5c*/
  v17 = 0; /*0xffc62e67*/
  v18 = 0; /*0xffc62e6a*/
  for ( i = 0; i <= i_1; ++i ) /*0xffc62e6c*/
  {
    if ( n0x12 == -1 ) /*0xffc62e80*/
      v19 = v18 & 0xFFFC0000; /*0xffc62e82*/
    else
      v19 = (v18 ^ ~(1 << n0x12) & 0x3FFFF) & 0x3FFFF ^ v18; /*0xffc62e9d*/
    v20 = (*(_BYTE *)(v39 + v38 + 3) & 7) << 20; /*0xffc62eb6*/
    v18 = v20 | v19 & 0xFF8FFFFF; /*0xffc62ebb*/
    v32 = v20 | v17 & 0xFF8FFFFF; /*0xffc62ecc*/
    MiscIoCheck(n6, n4_1, n6_1, 0xB014168u, v18); /*0xffc62ed2*/
    MiscIoCheck(n6, n4_1, n6_1, 0xB004248u, v32); /*0xffc62ee9*/
    v25 = n6[v33 + 58726] != 0; /*0xffc62f07*/
    DdrTrainFunc34C( /*0xffc62f4d*/
      (int)n6,
      n4_1,
      n6_1,
      n2,
      a5,
      3,
      *(unsigned __int16 *)(v37 + v36 + 6) | 0x10,
      i,
      1,
      0,
      (int)&v44[7 * v25],
      (int)&v45[3 * v25]);
    v26 = v25 + 1; /*0xffc62f65*/
    v24 = &v45[3 * v26]; /*0xffc62f6e*/
    v23 = &v44[7 * v26]; /*0xffc62f80*/
    if ( n6a == 6 ) /*0xffc62f89*/
    {
      DdrTrainFunc34C((int)n6, n4, n6_1, n2, a5, 6, a7 | 0x80, i, 1, 0, (int)v23, (int)v24); /*0xffc62fbd*/
      v27 = v26 + 1; /*0xffc62fd2*/
      n4_1 = n4; /*0xffc62ff2*/
      DdrTrainFunc34C((int)n6, n4, n6_1, n2, a5, 6, a7 | 0x80, i, 1, 0, (int)&v44[7 * v27], (int)&v45[3 * v27]); /*0xffc63012*/
      v26 = v27 + 1; /*0xffc6302a*/
      DdrTrainFunc34C((int)n6, n4, n6_1, n2, a5, 6, a7 & 0xFF7F, i, 1, 0, (int)&v44[7 * v26], (int)&v45[3 * v26]); /*0xffc63056*/
    }
    else
    {
      DdrTrainFunc34C((int)n6, n4_1, n6_1, n2, a5, n6a, a7, i, 1, 0, (int)v23, (int)v24); /*0xffc6307f*/
    }
    v28 = v26 + 1; /*0xffc63097*/
    DdrTrainFunc34C( /*0xffc630da*/
      (int)n6,
      n4_1,
      n6_1,
      n2,
      a5,
      3,
      *(unsigned __int16 *)(v37 + v36 + 6),
      i,
      2,
      0,
      (int)&v44[7 * v28],
      (int)&v45[3 * v28]);
    v21 = v28 + 1; /*0xffc630ea*/
    v29 = v21; /*0xffc630ec*/
    v34 = v21; /*0xffc630f8*/
    if ( n6[v33 + 58726] ) /*0xffc630f0*/
    {
      v29 = v21 + 1; /*0xffc63100*/
      v34 = v21 + 1; /*0xffc63104*/
    }
    DdrTrainFunc4EE(n6, n4_1, n6_1, 0, v34, (int)v44, (int)v45); /*0xffc63124*/
    if ( n6[v33 + 58726] ) /*0xffc63130*/
    {
      DdrTrainFunc4EE(n6, n4_1, n6_1, 0, 1u, (int)v44, (int)&src__0); /*0xffc63151*/
      DdrTrainFunc4EE(n6, n4_1, n6_1, v29 - 1, v34, (int)v44, (int)&src__0); /*0xffc63177*/
    }
    MiscIoCheck(n6, n4_1, n6_1, 0xB004504u, (((v29 - 1) & 0xF) << 16) | 9); /*0xffc6319d*/
    n512 |= 5u; /*0xffc631a2*/
    MailBoxFunc902D((int)n6, n4_1, n6_1, 117459720, 4, n512); /*0xffc631b6*/
    CpgcChannelInit(n6, n4_1, 1 << n6_1); /*0xffc631c1*/
    v17 = v32; /*0xffc631cd*/
  }
  v22 = MailBoxFunc8E6B((int)n6, n4_1, n6_1, 117459720, 4); /*0xffc631f4*/
  MailBoxFunc902D((int)n6, n4_1, n6_1, 117459720, 4, v22 & 0xFFFFFFFA | 4); /*0xffc63208*/
  MailBoxFunc902D((int)n6, n4_1, n6_1, 117459720, 4, v40); /*0xffc6321a*/
  MailBoxFunc8FC5((int)n6, n4_1, v35, 117459068, v41); /*0xffc63231*/
  if ( *(_BYTE *)(v42 + SocketInfo_1 + 6262) == 2 && !n6[453595] ) /*0xffc6324c*/
    ProcCommonFunc5183(n6, n4_1, n6_1, 1); /*0xffc6325a*/
  return RmtFunc349(n6, n4_1, n6_1, n2, a5, *(unsigned __int16 *)(v37 + v36 + 10), 5); /*0xffc6328d*/
}

// Function: NetInit @ 0xffc63295 (0x72f bytes)
// Index: 826/2560

char __cdecl NetInit(
        unsigned __int8 *n6,
        int n4,
        int n6_1,
        int n2,
        unsigned __int8 a5,
        char n0x12,
        unsigned __int16 a7,
        char n6a)
{
  unsigned __int8 n4_1; // bl
  int SocketInfo; // edi
  unsigned __int16 v10; // cx
  int v11; // eax
  int v12; // eax
  unsigned __int8 n6_2; // al
  int n512; // edi
  int v15; // eax
  unsigned int v16; // eax
  unsigned int v17; // esi
  int v18; // ecx
  unsigned __int8 v19; // al
  unsigned __int8 v20; // al
  int v21; // edi
  int v22; // eax
  unsigned __int8 v24; // [esp+Dh] [ebp-11Fh]
  unsigned __int8 v25; // [esp+Dh] [ebp-11Fh]
  unsigned __int8 v26; // [esp+Dh] [ebp-11Fh]
  unsigned __int8 v27; // [esp+Dh] [ebp-11Fh]
  unsigned __int8 v28; // [esp+Eh] [ebp-11Eh]
  unsigned __int8 v29; // [esp+Fh] [ebp-11Dh]
  unsigned __int8 v30; // [esp+10h] [ebp-11Ch]
  int v31; // [esp+14h] [ebp-118h]
  int v32; // [esp+18h] [ebp-114h]
  int v33; // [esp+1Ch] [ebp-110h]
  unsigned int v34; // [esp+20h] [ebp-10Ch]
  unsigned __int8 v35; // [esp+24h] [ebp-108h]
  unsigned __int8 v36; // [esp+28h] [ebp-104h]
  unsigned __int8 v37; // [esp+2Ch] [ebp-100h]
  char v38; // [esp+30h] [ebp-FCh]
  int v39; // [esp+34h] [ebp-F8h]
  unsigned int v40; // [esp+38h] [ebp-F4h]
  int v41; // [esp+3Ch] [ebp-F0h]
  int v42; // [esp+40h] [ebp-ECh]
  unsigned int v43; // [esp+48h] [ebp-E4h]
  int v44; // [esp+4Ch] [ebp-E0h]
  int v45; // [esp+50h] [ebp-DCh]
  int v46; // [esp+54h] [ebp-D8h]
  int SocketInfo_1; // [esp+58h] [ebp-D4h]
  _BYTE v48[112]; // [esp+5Ch] [ebp-D0h] BYREF
  _WORD v49[48]; // [esp+CCh] [ebp-60h] BYREF

  n4_1 = n4; /*0xffc6329c*/
  v35 = 0; /*0xffc632b5*/
  v36 = 0; /*0xffc632ba*/
  v31 = 50813 * (unsigned __int8)n4; /*0xffc632bf*/
  if ( n6[v31 + 58726] == 1 ) /*0xffc632cb*/
    KtiFunc8C4((int)n6, 0xAu); /*0xffc632d0*/
  SocketInfo = GetSocketInfo((int)n6, n4); /*0xffc632ed*/
  SocketInfo_1 = SocketInfo; /*0xffc632f2*/
  v39 = KtiFunc91AF((int)n6, n4, n6_1, n2); /*0xffc63302*/
  v32 = KtiFunc91DE((int)n6, n4, n6_1, n2); /*0xffc63321*/
  v33 = 244 * a5; /*0xffc6332b*/
  v42 = 242 * a5; /*0xffc6332f*/
  v10 = *(_WORD *)(v33 + v32 + 10) & 0xFE3F; /*0xffc63344*/
  v11 = *(unsigned __int16 *)(v42 + v39 + 10) >> 9; /*0xffc6334c*/
  if ( v11 ) /*0xffc63352*/
  {
    v12 = v11 - 1; /*0xffc63354*/
    if ( v12 ) /*0xffc63357*/
    {
      if ( v12 == 1 ) /*0xffc6335c*/
        v10 |= 0x100u; /*0xffc6335e*/
    }
    else
    {
      v10 |= 0x80u; /*0xffc63366*/
    }
  }
  RmtFunc349(n6, n4, n6_1, n2, a5, v10, 5); /*0xffc63383*/
  n6_2 = n6_1; /*0xffc63388*/
  v46 = 7688 * (unsigned __int8)n6_1; /*0xffc6339f*/
  if ( *(_BYTE *)(v46 + SocketInfo + 6262) == 2 && !n6[453595] ) /*0xffc633ad*/
  {
    ProcCommonFunc5183(n6, n4, n6_1, 0); /*0xffc633bb*/
    n6_2 = n6_1; /*0xffc633c0*/
  }
  v38 = DdrTrainFunc45AB((int)n6, n4, n6_2); /*0xffc633d7*/
  v45 = MailBoxFunc8E0B(n4, (int)n6, n4, v38, 117459068); /*0xffc633e7*/
  MailBoxFunc8FC5((int)n6, n4, v38, 117459068, v45 & 0xF1FFFFFF); /*0xffc633f8*/
  MiscIoCheck(n6, n4, n6_1, 0xB00452Cu, 0); /*0xffc6340e*/
  n512 = 512; /*0xffc63425*/
  v44 = MailBoxFunc8E6B((int)n6, n4, n6_1, 117459720, 4); /*0xffc6342a*/
  MailBoxFunc902D((int)n6, n4, n6_1, 117459720, 4, 512); /*0xffc63439*/
  v15 = MiscConfigCheck(n6, n4, n6_1, 184567040); /*0xffc63446*/
  MiscIoCheck(n6, n4, n6_1, 0xB004500u, v15 & 0xFFFFFFF4); /*0xffc63457*/
  if ( n6[257313] || (v29 = 1, n6a == 7) ) /*0xffc63475*/
    v29 = 0; /*0xffc63477*/
  v16 = 0; /*0xffc63484*/
  v30 = 0; /*0xffc63488*/
  v40 = a7 | 0x80; /*0xffc63498*/
  v17 = 0; /*0xffc6349c*/
  v41 = 1 << n6_1; /*0xffc634ab*/
  do /*0xffc6390a*/
  {
    if ( n0x12 != -1 ) /*0xffc634b9*/
      v17 |= ~(1 << n0x12) & 0x3FFFF; /*0xffc634cc*/
    v18 = (*(_BYTE *)(v42 + v39 + 3) & 7) << 20; /*0xffc634e5*/
    v43 = v18 | v17 & 0xFF8FFFFF; /*0xffc634f4*/
    v34 = v18 | v16 & 0xFF8FFFFF; /*0xffc63502*/
    MiscIoCheck(n6, n4_1, n6_1, 0xB014168u, v43); /*0xffc63506*/
    MiscIoCheck(n6, n4_1, n6_1, 0xB004248u, v34); /*0xffc63517*/
    v24 = n6[v31 + 58726] != 0; /*0xffc63535*/
    DdrTrainFunc34C( /*0xffc63578*/
      (int)n6,
      n4_1,
      n6_1,
      n2,
      a5,
      3,
      *(unsigned __int16 *)(v33 + v32 + 6) | 0x10,
      v30,
      1,
      0,
      (int)&v48[7 * v24],
      (int)&v49[3 * v24]);
    ++v24; /*0xffc63590*/
    DdrTrainFunc34C((int)n6, n4_1, n6_1, n2, a5, n6a, v40, v30, 1, 0, (int)&v48[7 * v24], (int)&v49[3 * v24]); /*0xffc635c8*/
    ++v24; /*0xffc635d3*/
    DdrTrainFunc34C((int)n6, n4_1, n6_1, n2, a5, n6a, v40, v30, 1, 0, (int)&v48[7 * v24], (int)&v49[3 * v24]); /*0xffc6361b*/
    ++v24; /*0xffc63633*/
    DdrTrainFunc34C((int)n6, n4_1, n6_1, n2, a5, n6a, a7 & 0xFF7F, v30, 1, 0, (int)&v48[7 * v24], (int)&v49[3 * v24]); /*0xffc6366b*/
    v19 = v24 + 1; /*0xffc6367b*/
    v25 = v19; /*0xffc6367d*/
    v28 = v19; /*0xffc63689*/
    if ( n6[v31 + 58726] ) /*0xffc63681*/
    {
      v35 = v19 + 1; /*0xffc63691*/
      v28 = v19 + 1; /*0xffc63695*/
      v19 += 2; /*0xffc63699*/
      v25 = v19; /*0xffc6369b*/
      v36 = v19; /*0xffc6369f*/
    }
    DdrTrainFunc34C( /*0xffc636e6*/
      (int)n6,
      n4_1,
      n6_1,
      n2,
      a5,
      3,
      *(unsigned __int16 *)(v33 + v32 + 6),
      v30,
      1,
      0,
      (int)&v48[7 * v19],
      (int)&v49[3 * v19]);
    v26 = v25 + 1; /*0xffc636fb*/
    DdrTrainFunc34C( /*0xffc6373b*/
      (int)n6,
      n4_1,
      n6_1,
      n2,
      a5,
      3,
      *(unsigned __int16 *)(v33 + v32 + 6),
      v30,
      1,
      0,
      (int)&v48[7 * v26],
      (int)&v49[3 * v26]);
    v20 = v26 + 1; /*0xffc6374b*/
    v27 = v20; /*0xffc6374d*/
    v37 = v20; /*0xffc63759*/
    if ( n6[v31 + 58726] ) /*0xffc63751*/
    {
      v27 = v20 + 1; /*0xffc63761*/
      v37 = v20 + 1; /*0xffc63765*/
    }
    DdrTrainFunc4EE(n6, n4_1, n6_1, 0, v37, (int)v48, (int)v49); /*0xffc6377f*/
    if ( n6[v31 + 58726] ) /*0xffc6378b*/
    {
      DdrTrainFunc4EE(n6, n4_1, n6_1, 0, 1u, (int)v48, (int)&src__0); /*0xffc637aa*/
      DdrTrainFunc4EE(n6, n4_1, n6_1, v35 - 1, v35, (int)v48, (int)&src__0); /*0xffc637cd*/
      DdrTrainFunc4EE(n6, n4_1, n6_1, v36 - 1, v36, (int)v48, (int)&src__0); /*0xffc637f0*/
      DdrTrainFunc4EE(n6, n4_1, n6_1, v27 - 1, v37, (int)v48, (int)&src__0); /*0xffc63813*/
    }
    MiscIoCheck(n6, n4, n6_1, 0xB004504u, (((v28 - 1) & 0xF) << 16) | 9); /*0xffc63841*/
    v21 = n512 | 5; /*0xffc63846*/
    MailBoxFunc902D((int)n6, n4, n6_1, 117459720, 4, v21); /*0xffc63860*/
    CpgcChannelInit(n6, n4, v41); /*0xffc63871*/
    n4_1 = n4; /*0xffc6388d*/
    MiscIoCheck(n6, n4, n6_1, 0xB004504u, ((v28 & 0xF | (((v27 - 1) & 0xF) << 8)) << 8) | 9); /*0xffc638a8*/
    v17 = v43 & 0xFFFC0000; /*0xffc638b7*/
    MiscIoCheck(n6, n4, n6_1, 0xB014168u, v43 & 0xFFFC0000); /*0xffc638cc*/
    n512 = v21 | 5; /*0xffc638d1*/
    MailBoxFunc902D((int)n6, n4, n6_1, 117459720, 4, n512); /*0xffc638e5*/
    CpgcChannelInit(n6, n4, v41); /*0xffc638f0*/
    v16 = v34; /*0xffc638fc*/
    ++v30; /*0xffc63902*/
  }
  while ( v30 <= v29 ); /*0xffc6390a*/
  v22 = MailBoxFunc8E6B((int)n6, n4, n6_1, 117459720, 4); /*0xffc63923*/
  MailBoxFunc902D((int)n6, n4, n6_1, 117459720, 4, v22 & 0xFFFFFFFA | 4); /*0xffc63937*/
  MailBoxFunc902D((int)n6, n4, n6_1, 117459720, 4, v44); /*0xffc63949*/
  MailBoxFunc8FC5((int)n6, n4, v38, 117459068, v45); /*0xffc63960*/
  if ( *(_BYTE *)(v46 + SocketInfo_1 + 6262) == 2 && !n6[453595] ) /*0xffc6397b*/
    ProcCommonFunc5183(n6, n4, n6_1, 1); /*0xffc63989*/
  return RmtFunc349(n6, n4, n6_1, n2, a5, *(unsigned __int16 *)(v33 + v32 + 10), 5); /*0xffc639ba*/
}

// Function: DdrTrainFunc39C4 @ 0xffc639c4 (0x748 bytes)
// Index: 827/2560

unsigned __int8 __cdecl DdrTrainFunc39C4(
        unsigned __int8 *__return_address,
        int n4,
        int n6,
        int n2,
        unsigned __int8 a5,
        int a6,
        unsigned __int8 a7,
        unsigned __int8 n0x10,
        unsigned __int8 n9)
{
  int v9; // esi
  unsigned __int8 n2a_1; // al
  unsigned int v11; // eax
  int v12; // eax
  int v13; // esi
  int n517; // edi
  unsigned __int8 n9_1; // cl
  unsigned __int8 n9_4; // al
  unsigned __int8 n9_2; // dl
  int v18; // ecx
  int n0x10_1; // eax
  unsigned __int8 n2b_1; // al
  bool v21; // cf
  int v22; // eax
  int v23; // eax
  int v24; // esi
  unsigned int v25; // eax
  unsigned __int8 n9_5; // [esp+12h] [ebp-7Eh]
  char n9_3; // [esp+13h] [ebp-7Dh]
  int n9_6; // [esp+14h] [ebp-7Ch]
  int v29; // [esp+14h] [ebp-7Ch]
  unsigned __int8 n2a; // [esp+18h] [ebp-78h]
  unsigned __int8 n2b; // [esp+18h] [ebp-78h]
  int CpuCount; // [esp+1Ch] [ebp-74h]
  int v33; // [esp+20h] [ebp-70h]
  int v34; // [esp+20h] [eb... [9272 chars total]

// Function: CpgcSktInit @ 0xffc6410c (0x406 bytes)
// Index: 828/2560

char __cdecl CpgcSktInit(
        unsigned __int8 *__return_address,
        int n4,
        int n6,
        char n2,
        _BYTE *a5,
        int a6,
        unsigned __int8 *a7,
        unsigned __int8 n0x20,
        unsigned __int8 n0x10,
        unsigned __int8 a10,
        char a11,
        int a12,
        int a13)
{
  unsigned __int8 n0x20_1; // dl
  char *v14; // esi
  unsigned __int8 *v15; // edi
  unsigned int v16; // edx
  int v17; // eax
  int v18; // edx
  unsigned __int8 *__return_address_1; // ebp
  unsigned __int8 n0x10_1; // ch
  char *v21; // edi
  unsigned int v22; // esi
  int n16_1; // ebp
  unsigned __int8 v24; // bh
  unsigned __int8 v25; // cl
  int v26; // edx
  int v27; // ecx
  int v28; // eax
  int v29; // edx
  char *v30; // esi
  unsigned __int8 n0x10_2; // al
  unsigned int v32; // edx
  int v33; // ecx
  int v34; // eax
  unsigned __int8 n0x20_4; // al
  char *v36; // esi
  unsigned __int8 n0x10_3; // al
  unsigned int v38; // edx
  int v39; // ecx
  int v40; // eax
  __int64 v42; // [esp-Ch] [ebp-8ACh]
  unsigned __int8 n0x20_2; // [esp+13h] [ebp-88Dh]
  unsigned __int8 n0x10_4; // [esp+13h] [ebp-88Dh]
  unsigned __int8 n0x10_5; // [esp+13h] [ebp-88Dh]
  int v46; // [esp+14h] [ebp-88Ch]
  int v47; // [esp+14h] [ebp-88Ch]
  int v48; // [esp+14h] [ebp-88Ch]
  int n0x20_3; // [esp+18h] [ebp-888h]
  unsigned int v50; // [esp+18h] [ebp-888h]
  int n16; // [esp+1Ch] [ebp-884h]
  unsigned int v52; // [esp+1Ch] [ebp-884h]
  int n0x20_5; // [esp+1Ch] [ebp-884h]
  _DWORD v54[32]; // [esp+20h] [ebp-880h] BYREF
  char v55[2048]; // [esp+A0h] [ebp-800h] BYREF

  if ( n0x10 > 0x10u || (n0x20_1 = n0x20, n0x20 > 0x20u) )
  {
    AssertPrint(
      __return_address,
      255,
      (int)"\n\nRC_ASSERT! %s: %u   %s ",
      "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Mem\\MemCpgc.c",
      4373,
      "FALSE");
    ProcMemInitCheck((int)__return_address, 242, 48); /*0xffc6415a*/
    n0x20_1 = n0x20; /*0xffc6415f*/
  }
  v14 = (char *)v54; /*0xffc64171*/
  v15 = a7; /*0xffc6417c*/
  n16 = 16; /*0xffc6418d*/
  do /*0xffc6421c*/
  {
    *(_DWORD *)v14 = *(_DWORD *)&v14[a6 - (_DWORD)v54]; /*0xffc641ae*/
    *(_DWORD *)((char *)&v54[1] + v14 - (char *)v54) = *(_DWORD *)&v14[a6 - (_DWORD)v54 + 4]; /*0xffc641b3*/
    if ( a11 == 1 ) /*0xffc641b6*/
    {
      *(_DWORD *)v14 = RmtFunc6FAC(*(_QWORD *)v14, *v15 * (8 * n0x20_1 - 8)); /*0xffc641d3*/
      v17 = RmtFunc6FDC(*(_DWORD *)v14, v16, 8 * a10 * *v15); /*0xffc641e4*/
    }
    else
    {
      v17 = RmtFunc6FAC(*(_QWORD *)v14, 8 * a10 * *v15); /*0xffc641ff*/
    }
    *((_DWORD *)v14 + 1) = v18; /*0xffc64207*/
    ++v15; /*0xffc6420a*/
    n0x20_1 = n0x20; /*0xffc6420b*/
    *(_DWORD *)v14 = v17; /*0xffc64212*/
    v14 += 8; /*0xffc64214*/
    --n16; /*0xffc64217*/
  }
  while ( n16 ); /*0xffc6421c*/
  __return_address_1 = __return_address; /*0xffc6421e*/
  n0x20_2 = 0; /*0xffc64229*/
  if ( n0x20 ) /*0xffc6422f*/
  {
    n0x10_1 = n0x10; /*0xffc64235*/
    v21 = v55; /*0xffc6423c*/
    do /*0xffc64344*/
    {
      v22 = 0; /*0xffc6424e*/
      v46 = 0; /*0xffc64252*/
      n16_1 = 16; /*0xffc64256*/
      do /*0xffc6432d*/
      {
        v24 = (int)(v22 >> 1) % n0x10; /*0xffc64260*/
        if ( n0x20_2 ) /*0xffc64264*/
        {
          if ( a11 == 1 ) /*0xffc6426e*/
          {
            v25 = 0; /*0xffc64270*/
            if ( n0x10_1 ) /*0xffc64274*/
            {
              while ( v22 != 2 * v25 ) /*0xffc6427d*/
              {
                if ( ++v25 >= n0x10_1 ) /*0xffc64283*/
                  goto LABEL_19; /*0xffc64283*/
              }
              v54[2 * v24] = RmtFunc6FDC(v54[2 * v24], v54[2 * v24 + 1], 16 * a7[v24]); /*0xffc642a6*/
              v54[2 * v24 + 1] = v26; /*0xffc642ad*/
              LOBYTE(v22) = v46; /*0xffc642b1*/
            }
          }
        }
LABEL_19:
        if ( (v22 & 1) != 0 ) /*0xffc642bd*/
        {
          v27 = a13 & ~v54[2 * v24 + 1]; /*0xffc642cc*/
          v28 = v54[2 * v24 + 1] & ~a13; /*0xffc642d0*/
        }
        else
        {
          v27 = a12 & ~v54[2 * v24]; /*0xffc642e3*/
          v28 = v54[2 * v24] & ~a12; /*0xffc642e7*/
        }
        *(_DWORD *)v21 = v28 | v27; /*0xffc642ed*/
        if ( (v22 & 1) != 0 ) /*0xffc642f1*/
        {
          HIDWORD(v42) = v54[2 * v24 + 1]; /*0xffc642ff*/
          LODWORD(v42) = v54[2 * v24]; /*0xffc64303*/
          v54[2 * v24] = RmtFunc6FAC(v42, a7[v24]); /*0xffc6430f*/
          v54[2 * v24 + 1] = v29; /*0xffc64313*/
        }
        v21 += 4; /*0xffc6431b*/
        n0x10_1 = n0x10; /*0xffc6431e*/
        v22 = ++v46; /*0xffc64325*/
        --n16_1; /*0xffc6432a*/
      }
      while ( n16_1 ); /*0xffc6432d*/
      ++n0x20_2; /*0xffc64335*/
    }
    while ( n0x20_2 < n0x20 ); /*0xffc64344*/
    __return_address_1 = __return_address; /*0xffc6434a*/
  }
  if ( n2 ) /*0xffc64367*/
    DebugPrint((int)__return_address_1, 2, n4, n6, 255, 255, 255, 255, "Subseq0 Read pattern:\n"); /*0xffc6438c*/
  else
    DebugPrint((int)__return_address_1, 2, n4, n6, 255, 255, 255, 255, "Subseq0 Write pattern:\n"); /*0xffc64377*/
  if ( n0x20 ) /*0xffc6439d*/
  {
    v47 = 0; /*0xffc643a3*/
    v30 = v55; /*0xffc643a8*/
    n0x20_3 = n0x20; /*0xffc643b2*/
    do /*0xffc64428*/
    {
      n0x10_2 = 0; /*0xffc643b6*/
      v32 = 0; /*0xffc643b8*/
      n0x10_4 = 0; /*0xffc643ba*/
      v52 = 0; /*0xffc643be*/
      do /*0xffc6441d*/
      {
        if ( (n0x10_2 & 1) != 0 && n0x10_2 ) /*0xffc643c8*/
        {
          v33 = *((_DWORD *)v30 - 1); /*0xffc643d1*/
          v34 = *(_DWORD *)v30; /*0xffc643d7*/
          if ( *a5 ) /*0xffc643d4*/
          {
            v34 = ~v34; /*0xffc643db*/
            v33 = ~v33; /*0xffc643dd*/
          }
          DebugPrint( /*0xffc643fd*/
            (int)__return_address_1,
            2,
            n4,
            n6,
            255,
            255,
            255,
            255,
            "CL%2d UI%d 0x%08x%08x\n",
            v47,
            v32 >> 1,
            v34,
            v33);
          n0x10_2 = n0x10_4; /*0xffc64402*/
          v32 = v52; /*0xffc64409*/
        }
        ++n0x10_2; /*0xffc6440d*/
        v30 += 4; /*0xffc6440f*/
        ++v32; /*0xffc64412*/
        n0x10_4 = n0x10_2; /*0xffc64413*/
        v52 = v32; /*0xffc64417*/
      }
      while ( n0x10_2 < 0x10u ); /*0xffc6441d*/
      ++v47; /*0xffc6441f*/
      --n0x20_3; /*0xffc64423*/
    }
    while ( n0x20_3 ); /*0xffc64428*/
  }
  if ( n2 != 1 ) /*0xffc64432*/
    goto LABEL_51; /*0xffc64432*/
  DebugPrint((int)__return_address_1, 2, n4, n6, 255, 255, 255, 255, "Subseq1 Write pattern:\n"); /*0xffc6444b*/
  n0x20_4 = n0x20; /*0xffc64450*/
  if ( n0x20 ) /*0xffc6445c*/
  {
    v48 = 0; /*0xffc64462*/
    v36 = v55; /*0xffc64467*/
    n0x20_5 = n0x20; /*0xffc64471*/
    do /*0xffc644e8*/
    {
      n0x10_3 = 0; /*0xffc64475*/
      v38 = 0; /*0xffc64477*/
      n0x10_5 = 0; /*0xffc64479*/
      v50 = 0; /*0xffc6447d*/
      do /*0xffc644dd*/
      {
        if ( (n0x10_3 & 1) != 0 && n0x10_3 ) /*0xffc64487*/
        {
          v39 = *((_DWORD *)v36 - 1); /*0xffc64490*/
          v40 = *(_DWORD *)v36; /*0xffc64497*/
          if ( a5[1] ) /*0xffc64493*/
          {
            v40 = ~v40; /*0xffc6449b*/
            v39 = ~v39; /*0xffc6449d*/
          }
          DebugPrint( /*0xffc644bd*/
            (int)__return_address_1,
            2,
            n4,
            n6,
            255,
            255,
            255,
            255,
            "CL%2d UI%d 0x%08x%08x\n",
            v48,
            v38 >> 1,
            v40,
            v39);
          n0x10_3 = n0x10_5; /*0xffc644c2*/
          v38 = v50; /*0xffc644c9*/
        }
        ++n0x10_3; /*0xffc644cd*/
        v36 += 4; /*0xffc644cf*/
        ++v38; /*0xffc644d2*/
        n0x10_5 = n0x10_3; /*0xffc644d3*/
        v50 = v38; /*0xffc644d7*/
      }
      while ( n0x10_3 < 0x10u ); /*0xffc644dd*/
      ++v48; /*0xffc644df*/
      --n0x20_5; /*0xffc644e3*/
    }
    while ( n0x20_5 ); /*0xffc644e8*/
LABEL_51:
    n0x20_4 = n0x20; /*0xffc644ea*/
  }
  return RmtFunc71F8(__return_address_1, n4, n6, v55, n0x20_4, 0); /*0xffc64507*/
}

// Function: DdrTrainFunc4512 @ 0xffc64512 (0x31 bytes)
// Index: 829/2560

char __cdecl DdrTrainFunc4512(int a1, int a2, unsigned __int8 a3)
{
  char v3; // al

  v3 = MailBoxFunc8E6B(a1, a2, a3, 117459884, 4); /*0xffc64525*/
  return DdrTrainFunc30F(a1, a2, a3, v3 & 7); /*0xffc64541*/
}

// Function: DdrTrainFunc4543 @ 0xffc64543 (0x77 bytes)
// Index: 830/2560

bool __cdecl DdrTrainFunc4543(int __return_address, int n4, unsigned __int8 n6)
{
  int CpuCount; // esi
  int v4; // eax
  unsigned __int8 v6; // [esp+4h] [ebp-4h]

  CpuCount = GetCpuCount(__return_address, n4, n6); /*0xffc64560*/
  v6 = (MailBoxFunc8E6B(__return_address, n4, n6, 117459884, 4) & 4) != 0; /*0xffc6457a*/
  v4 = 1379 * v6; /*0xffc64580*/
  return *(_WORD *)(v4 + CpuCount + 147) == 0xAD00 /*0xffc645b5*/
      && (*(_BYTE *)(v4 + CpuCount + 32) & 0xC0) == 0
      && !ProcCommonFunc24FA(__return_address, n4, n6, v6);
}

// Function: DdrTrainFunc45BA @ 0xffc645ba (0xb0 bytes)
// Index: 831/2560

int __cdecl DdrTrainFunc45BA(int __return_address, unsigned __int8 a2, char a3, char a4)
{
  int v4; // ebx
  char v5; // di
  unsigned int v6; // esi
  char v7; // al
  unsigned int v8; // eax
  int v10; // [esp+1Ch] [ebp+Ch]

  v4 = 0; /*0xffc645bd*/
  v5 = *(_BYTE *)(__return_address + 246425); /*0xffc645cd*/
  v10 = 4 * (a3 != 0) + 318915088; /*0xffc645e1*/
  v6 = ((v5 & 7) << 24) | CpuIoRead(__return_address, a2, 0, v10) & 0xF8FFFFFF; /*0xffc64606*/
  v7 = a4; /*0xffc64608*/
  if ( !a4 ) /*0xffc6460e*/
  {
    v6 &= ~2u; /*0xffc64610*/
    CpuIoCfgWrite(__return_address, a2, 0, v10, v6); /*0xffc6461b*/
    v7 = 0; /*0xffc64620*/
    *(_BYTE *)(__return_address + 246738) = 0; /*0xffc64627*/
  }
  if ( v7 == 1 ) /*0xffc6462f*/
  {
    CpuIoCfgWrite(__return_address, a2, 0, v10, v6 | 2); /*0xffc6463c*/
    v8 = CpuIoRead(__return_address, a2, 0, v10); /*0xffc64648*/
    if ( (v8 & 2) == 0 || ((v8 >> 2) & 7) != v5 ) /*0xffc6465e*/
      return 1; /*0xffc64662*/
  }
  return v4; /*0xffc64663*/
}

// Function: DdrTrainFunc466A @ 0xffc6466a (0x57 bytes)
// Index: 832/2560

unsigned int __cdecl DdrTrainFunc466A(int a1, char a2, int a3, char a4, int a5)
{
  __int16 v5; // dx
  unsigned int result; // eax

  *(_BYTE *)(a5 + 2) = DdrTrainFunc45AB(a1, a2, a3); /*0xffc64686*/
  result = (((unsigned __int8)a3 / 3u) & 0xF) << 8; /*0xffc6469d*/
  v5 = result | (2 * (a4 + 2 * ((unsigned __int8)a3 % 3u))) & 0xE; /*0xffc646ac*/
  LOWORD(result) = *(_WORD *)(a5 + 4) & 0xF0F1; /*0xffc646b3*/
  *(_WORD *)(a5 + 4) = result | v5; /*0xffc646b9*/
  return result; /*0xffc646bd*/
}

// Function: DdrTrainFunc46C1 @ 0xffc646c1 (0x85 bytes)
// Index: 833/2560

char __cdecl DdrTrainFunc46C1(int __return_address, unsigned __int8 a2)
{
  if ( *(char *)(__return_address + 130) < 0 && *(_BYTE *)(__return_address + 246737) )
  {
    if ( !*(_DWORD *)(__return_address + 255488) )
    {
      if ( DdrTrainFunc45BA(__return_address, a2, 0, 1) )
      {
        AssertPrint(
          (_BYTE *)__return_address,
          255,
          (int)"\n\nRC_ASSERT! %s: %u   %s ",
          "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Common\\Smbus.c",
          400,
          "FALSE");
        ProcMemInitCheck(__return_address, 242, 30); /*0xffc6471e*/
      }
      *(_BYTE *)(__return_address + 246738) = 1; /*0xffc64726*/
    }
    if ( (*(_DWORD *)(__return_address + 255488))++ == -1 ) /*0xffc6472d*/
      KtiFunc1EF9(__return_address); /*0xffc64739*/
  }
  return 1; /*0xffc64744*/
}

// Function: DdrTrainFunc4746 @ 0xffc64746 (0x2ee bytes)
// Index: 834/2560

int __cdecl DdrTrainFunc4746(_DWORD *p_n42, int n4)
{
  int n4_1; // ebx
  _DWORD *p_n42_1; // edi
  int n8; // eax
  int v5; // eax
  unsigned __int8 n4_2; // cl
  unsigned int i; // esi
  int v8; // esi
  char v9; // al
  unsigned int v10; // esi
  unsigned __int8 n2; // cl
  char v12; // al
  int v13; // ebp
  unsigned int v14; // esi
  int v15; // eax
  __int16 v16; // si
  int result; // eax
  unsigned __int8 v18; // bl
  char v19; // [esp+13h] [ebp-5h] BYREF
  int v20; // [esp+14h] [ebp-4h]

  n4_1 = n4; /*0xffc64749*/
  p_n42_1 = p_n42; /*0xffc64750*/
  if ( !p_n42[61601] ) /*0xffc64759*/
  {
    n8 = *(_DWORD *)((char *)p_n42 + 9405); /*0xffc64766*/
    if ( n8 == 8 || n8 == 9 && (*(_DWORD *)((char *)p_n42 + 130) & 0x40000000) == 0 ) /*0xffc64784*/
    {
      v5 = MailBoxFunc8E0B(n4, (int)p_n42, n4, 0, 117459124); /*0xffc64793*/
      n4_2 = 0; /*0xffc6479a*/
      LOBYTE(n4) = 0; /*0xffc6479f*/
      for ( i = v5 & 0xFFFFFFFD; n4_2 < *((_BYTE *)p_n42_1 + 244317); LOBYTE(n4) = n4_2 ) /*0xffc647a6*/
      {
        if ( *((_BYTE *)p_n42_1 + 50813 * (unsigned __int8)n4_1 + n4_2 + 10189) ) /*0xffc647bc*/
        {
          MailBoxFunc8FC5((int)p_n42_1, n4_1, n4, 117459124, i); /*0xffc647d2*/
          n4_2 = n4; /*0xffc647d7*/
        }
        ++n4_2; /*0xffc647de*/
      }
      DebugPrint( /*0xffc64805*/
        (int)p_n42_1,
        3,
        255,
        255,
        255,
        255,
        255,
        255,
        "ddr_reset asserted at subbootmode = %d\n",
        *(_DWORD *)((char *)p_n42_1 + 9405));
    }
  }
  DdrTrainFunc4439(p_n42_1, n4_1, (bool *)&v19, (unsigned __int8 *)&p_n42); /*0xffc64819*/
  if ( (p_n42_1[61602] & 4) == 0 && !(_BYTE)p_n42 ) /*0xffc6482f*/
  {
    if ( ProcCommonFuncFB4A((int)p_n42_1, 2u) ) /*0xffc64834*/
    {
      LogDebugString(p_n42_1, (int)"MC_BIOS_REQ.REQ_DATA = 0\n"); /*0xffc64845*/
      LogDebugString(p_n42_1, (int)"Req Data = %d and Req Type = %d \n", (unsigned __int8)p_n42, (unsigned __int8)v19); /*0xffc6485c*/
    }
    LOBYTE(p_n42) = 8; /*0xffc64864*/
  }
  v8 = CpuIoRead((int)p_n42_1, n4_1, 0, 67453040); /*0xffc64877*/
  v9 = *((_BYTE *)p_n42_1 + 269); /*0xffc6487c*/
  switch ( v9 ) /*0xffc64884*/
  {
    case 0: /*0xffc64884*/
      goto LABEL_20; /*0xffc64884*/
    case 1: /*0xffc64884*/
      v10 = v8 & 0xFF000000 | 0x130064; /*0xffc64890*/
      break; /*0xffc64896*/
    case 2: /*0xffc64884*/
      v10 = v8 & 0xFF000000 | 0x2303E8; /*0xffc648a2*/
      break;
    default:
LABEL_20:
      v10 = v8 & 0xFF000000 | 0x2300FA; /*0xffc648b0*/
      break;
  }
  DebugPrint((int)p_n42_1, 2, n4_1, 255, 255, 255, 255, 255, "SMB Clock Period = %d\n", (unsigned __int16)v10); /*0xffc648b6*/
  CpuIoCfgWrite((int)p_n42_1, n4_1, 0, 67453040, v10); /*0xffc648d7*/
  if ( LOBYTE(p_n42_1[12176 * (unsigned __int8)n4_1 + 76848]) == 1 ) /*0xffc648f0*/
    CpuIoCfgWrite((int)p_n42_1, n4_1, 0, 67453044, v10); /*0xffc648fc*/
  n2 = 0; /*0xffc64904*/
  LOBYTE(n4) = 0; /*0xffc64906*/
  do /*0xffc649b1*/
  {
    v20 = 4 * (n2 != 0) + 67453084; /*0xffc64918*/
    v12 = CpuIoRead((int)p_n42_1, n4_1, 0, 4 * (n2 != 0) + 67453096); /*0xffc6492f*/
    v13 = v20; /*0xffc64934*/
    if ( (v12 & 1) != 0 ) /*0xffc6493d*/
    {
      v14 = CpuIoRead((int)p_n42_1, n4_1, 0, v20) & 0xDEFFFFFF | 0x1000000; /*0xffc64951*/
      CpuIoCfgWrite((int)p_n42_1, n4_1, 0, v13, v14); /*0xffc6495d*/
      KtiFunc8C4((int)p_n42_1, 0x88B8u); /*0xffc64968*/
      CpuIoCfgWrite((int)p_n42_1, n4_1, 0, v13, v14 & 0xDEFFFFFF | 0x20000000); /*0xffc6497f*/
    }
    v15 = CpuIoRead((int)p_n42_1, n4_1, 0, v13); /*0xffc6498c*/
    CpuIoCfgWrite((int)p_n42_1, n4_1, 0, v13, v15 & 0xFFEFFFFF); /*0xffc6499c*/
    n2 = n4 + 1; /*0xffc649a8*/
    LOBYTE(n4) = n2; /*0xffc649aa*/
  }
  while ( n2 < 2u ); /*0xffc649b1*/
  v16 = PciCfgRead((int)p_n42_1, 0, 0x402FB020u); /*0xffc649cd*/
  result = PciCfgRead((int)p_n42_1, 0, 0x102FB004u); /*0xffc649cf*/
  v18 = result; /*0xffc649d4*/
  if ( (result & 1) != 0 ) /*0xffc649dc*/
  {
    *((_WORD *)p_n42_1 + 123377) = v16 & 0xFFE0; /*0xffc649e4*/
  }
  else
  {
    *((_WORD *)p_n42_1 + 123377) = 1792; /*0xffc649fb*/
    PciCfgWrite((int)p_n42_1, 0, 0x402FB020u, 1793); /*0xffc64a02*/
    PciCfgWrite((int)p_n42_1, 0, 0x102FB004u, v18 | 1); /*0xffc64a16*/
    return PciCfgWrite((int)p_n42_1, 0, 0x102FB040u, 1); /*0xffc64a25*/
  }
  return result; /*0xffc64a2d*/
}

// Function: DdrTrainFunc4A34 @ 0xffc64a34 (0x3d bytes)
// Index: 835/2560

char __cdecl DdrTrainFunc4A34(_BYTE *__return_address, unsigned __int8 a2)
{
  char __return_address_1; // al
  char v3; // cl
  char v4; // dl

  __return_address_1 = (char)__return_address; /*0xffc64a37*/
  v3 = __return_address[246425]; /*0xffc64a3a*/
  v4 = __return_address[453660]; /*0xffc64a40*/
  if ( v3 == v4 ) /*0xffc64a48*/
  {
    if ( a2 == v4 ) /*0xffc64a4d*/
    {
LABEL_3:
      __return_address[246737] = 0; /*0xffc64a4f*/
      return __return_address_1; /*0xffc64a57*/
    }
  }
  else if ( a2 != v3 ) /*0xffc64a5b*/
  {
    goto LABEL_3; /*0xffc64a5b*/
  }
  __return_address[246737] = 1; /*0xffc64a60*/
  return DdrTrainFunc46C1((int)__return_address, a2); /*0xffc64a56*/
}

// Function: DdrTrainFunc4A71 @ 0xffc64a71 (0xeb bytes)
// Index: 836/2560

int __cdecl DdrTrainFunc4A71(_BYTE *__return_address, int a2, int n5, unsigned __int16 a4, int a5, unsigned __int8 *a6)
{
  int n2; // esi
  int v7; // ebx
  unsigned int v8; // esi

  DdrTrainFunc4A34(__return_address, a2); /*0xffc64a7f*/
  n2 = DdrTrainFunc4B5C(__return_address, a2, n5, a4, a5, a6); /*0xffc64aa8*/
  if ( n2 == 2 ) /*0xffc64ab0*/
  {
    v7 = 4 * ((a4 & 0xF00) != 0) + 67453084; /*0xffc64ac6*/
    v8 = CpuIoRead((int)__return_address, a2, 0, v7) & 0xDEFFFFFF | 0x1000000; /*0xffc64adf*/
    CpuIoCfgWrite((int)__return_address, a2, 0, v7, v8); /*0xffc64aeb*/
    KtiFunc8C4((int)__return_address, 0x88B8u); /*0xffc64af6*/
    CpuIoCfgWrite((int)__return_address, a2, 0, v7, v8 & 0xDEFFFFFF | 0x20000000); /*0xffc64b0d*/
    n2 = DdrTrainFunc4B5C(__return_address, a2, n5, a4, a5, a6); /*0xffc64b3a*/
  }
  if ( __return_address[246738] == 1 ) /*0xffc64b43*/
  {
    DdrTrainFunc4E3E((int)__return_address, a2); /*0xffc64b47*/
    __return_address[246737] = 0; /*0xffc64b4e*/
  }
  return n2; /*0xffc64b55*/
}

// Function: DdrTrainFunc4B5C @ 0xffc64b5c (0x2e2 bytes)
// Index: 837/2560

int __cdecl DdrTrainFunc4B5C(_BYTE *__return_address, int a2, int n5, unsigned __int16 a4, int a5, unsigned __int8 *a6)
{
  int n0x14; // ebx
  int v7; // eax
  unsigned __int16 v8; // dx
  int n67453088; // eax
  int v10; // esi
  __int64 v11; // kr00_8
  int n67453100_1; // esi
  char v13; // al
  __int16 v14; // ax
  unsigned __int8 i; // al
  unsigned __int8 i_1; // [esp+13h] [ebp-19h]
  int n67453100; // [esp+14h] [ebp-18h]
  char v19; // [esp+14h] [ebp-18h]
  int n67453088_1; // [esp+18h] [ebp-14h]
  int n67453112; // [esp+1Ch] [ebp-10h]
  char n68; // [esp+1Ch] [ebp-10h]
  __int64 v23; // [esp+24h] [ebp-8h]

  n0x14 = 0; /*0xffc64b6a*/
  KtiFunc41B3((int)__return_address, 1u, 1); /*0xffc64b6f*/
  v7 = (unsigned __int8)KtiFunc2787(__return_address, a2, n5, a4, a5, a6) - 1; /*0xffc64ba4*/
  if ( !v7 ) /*0xffc64ba7*/
    return 0; /*0xffc64e34*/
  if ( v7 == 1 ) /*0xffc64bb0*/
    return 1; /*0xffc64e31*/
  v8 = a4; /*0xffc64bb6*/
  if ( a4 >> 12 )
  {
    if ( a4 >> 12 == 1 )
    {
      if ( (_WORD)n5 != 3 )
      {
        n68 = (_WORD)n5 != 5 ? 72 : 84;
        goto LABEL_34; /*0xffc64dc7*/
      }
      n68 = 68; /*0xffc64db1*/
      for ( i = DdrTrainFunc4E82( /*0xffc64db6*/
                  __return_address,
                  a5,
                  (2 * ((8 * (a4 >> 4)) | ((unsigned __int8)a4 >> 1) & 7)) | 1,
                  68,
                  a6);
            ;
            i = DdrTrainFunc4E82(
                  __return_address,
                  a5,
                  (2 * ((8 * (v8 >> 4)) | ((unsigned __int8)v8 >> 1) & 7)) | 1,
                  n68,
                  a6) )
      {
        i_1 = i; /*0xffc64df8*/
        if ( (i & 0x19) == 0 ) /*0xffc64dfe*/
          break; /*0xffc64dfe*/
        KtiFunc8C4((int)__return_address, 0x186A0u); /*0xffc64e06*/
        LOBYTE(n0x14) = n0x14 + 1; /*0xffc64e0b*/
        if ( (unsigned __int8)n0x14 >= 0x14u ) /*0xffc64e12*/
        {
          i = i_1; /*0xffc64e1b*/
          return (i & 0x1D) != 0; /*0xffc64e1b*/
        }
        v8 = a4; /*0xffc64e14*/
LABEL_34:
        ; /*0xffc64dcb*/
      }
      return (i & 0x1D) != 0; /*0xffc64e1f*/
    }
    else
    {
      return 1; /*0xffc64e29*/
    }
  }
  else
  {
    if ( (a4 & 0xF00) != 0 ) /*0xffc64bd3*/
    {
      n67453088 = 67453088; /*0xffc64bec*/
      n67453100 = 67453100; /*0xffc64bf1*/
      n67453112 = 67453112; /*0xffc64bf9*/
    }
    else
    {
      n67453088 = 67453084; /*0xffc64bd5*/
      n67453100 = 67453096; /*0xffc64bda*/
      n67453112 = 67453108; /*0xffc64be2*/
    }
    n67453088_1 = n67453088; /*0xffc64c05*/
    if ( (CpuIoRead((int)__return_address, a2, 0, n67453088) & 0x100000) != 0 ) /*0xffc64c16*/
    {
      if ( ProcCommonFuncFB4A((int)__return_address, 3u) ) /*0xffc64c1b*/
        LogDebugString(__return_address, (int)"trying to read PROCESSOR SMBUS with TSOD polling enabled...halting!"); /*0xffc64c2c*/
      ProcMemInitCheck((int)__return_address, 246, 1); /*0xffc64c3b*/
    }
    v10 = (unsigned __int8)a5 | ((a4 & 0xFE | 0x400000) << 7); /*0xffc64c5e*/
    if ( (_WORD)n5 == 4 ) /*0xffc64c68*/
      v10 |= 0x20000u; /*0xffc64c6a*/
    v11 = KtiFunc9D6(); /*0xffc64c89*/
    do /*0xffc64cc6*/
    {
      if ( (CpuIoRead((int)__return_address, a2, 0, n67453100) & 1) == 0 ) /*0xffc64c9b*/
        break; /*0xffc64c9b*/
      if ( (__return_address[246408] & 4) != 0 ) /*0xffc64ca4*/
        break; /*0xffc64ca4*/
      KtiFunc41B3((int)__return_address, 6u, 1); /*0xffc64cab*/
    }
    while ( (unsigned int)KtiFuncA21((int)__return_address, v11, SHIDWORD(v11)) < 0x186A0 ); /*0xffc64cc6*/
    CpuIoCfgWrite((int)__return_address, a2, 0, n67453088_1, v10 | 0x80000); /*0xffc64cd4*/
    n67453100_1 = n67453100; /*0xffc64cdf*/
    v23 = KtiFunc9D6(); /*0xffc64ce6*/
    do /*0xffc64d2b*/
    {
      v13 = CpuIoRead((int)__return_address, a2, 0, n67453100_1); /*0xffc64cf2*/
      v19 = v13; /*0xffc64cfa*/
      if ( (v13 & 1) == 0 || (__return_address[246408] & 4) != 0 ) /*0xffc64d09*/
        goto LABEL_25; /*0xffc64d09*/
      KtiFunc41B3((int)__return_address, 6u, 1); /*0xffc64d10*/
    }
    while ( (unsigned int)KtiFuncA21((int)__return_address, v23, SHIDWORD(v23)) < 0x186A0 ); /*0xffc64d2b*/
    while ( 1 ) /*0xffc64d4d*/
    {
      v13 = v19; /*0xffc64d4d*/
LABEL_25:
      if ( (v13 & 4) != 0 || (v13 & 2) != 0 ) /*0xffc64d31*/
        break; /*0xffc64d31*/
      v19 = CpuIoRead((int)__return_address, a2, 0, n67453100_1); /*0xffc64d41*/
      KtiFunc41B3((int)__return_address, 6u, 1); /*0xffc64d45*/
    }
    if ( (v13 & 6) == 4 ) /*0xffc64d59*/
    {
      v14 = CpuIoRead((int)__return_address, a2, 0, n67453112); /*0xffc64d62*/
      *a6 = v14; /*0xffc64d7e*/
      if ( (_WORD)n5 == 4 ) /*0xffc64d80*/
        a6[1] = HIBYTE(v14); /*0xffc64d8d*/
    }
    else
    {
      return 2; /*0xffc64d97*/
    }
  }
  return n0x14; /*0xffc64e36*/
}

// Function: DdrTrainFunc4E3E @ 0xffc64e3e (0x44 bytes)
// Index: 838/2560

void __cdecl DdrTrainFunc4E3E(int __return_address, unsigned __int8 a2)
{
  int v2; // eax

  if ( *(char *)(__return_address + 130) < 0 && *(_BYTE *)(__return_address + 246737) ) /*0xffc64e4c*/
  {
    if ( *(_DWORD *)(__return_address + 255488) == 1 ) /*0xffc64e5c*/
      DdrTrainFunc45BA(__return_address, a2, 0, 0); /*0xffc64e67*/
    v2 = *(_DWORD *)(__return_address + 255488); /*0xffc64e6f*/
    if ( v2 ) /*0xffc64e77*/
      *(_DWORD *)(__return_address + 255488) = v2 - 1; /*0xffc64e7a*/
  }
}

// Function: DdrTrainFunc4E82 @ 0xffc64e82 (0x3af bytes)
// Index: 839/2560

unsigned __int8 __cdecl DdrTrainFunc4E82(
        _BYTE *__return_address,
        unsigned __int8 a2,
        unsigned __int8 a3,
        char n68,
        unsigned __int8 *a5)
{
  __int64 v6; // kr00_8
  unsigned __int8 result; // al
  bool v8; // zf
  unsigned __int8 n68_1; // al
  __int64 v10; // kr08_8
  unsigned __int8 v11; // al
  unsigned __int8 v12; // al
  unsigned __int8 v13; // cl
  __int16 v14; // ax
  unsigned __int8 v15; // al
  int v16; // edx
  int v17; // ecx
  unsigned __int8 v18; // [esp+Fh] [ebp-9h]
  unsigned __int8 v19; // [esp+10h] [ebp-8h]
  int v20; // [esp+14h] [ebp-4h]
  unsigned __int8 v21; // [esp+1Ch] [ebp+4h]
  unsigned __int8 v22; // [esp+1Ch] [ebp+4h]
  char v23; // [esp+1Ch] [ebp+4h]
  char v24; // [esp+24h] [ebp+Ch]

  v20 = 1; /*0xffc64e8c*/
  if ( (__return_address[246408] & 4) != 0 ) /*0xffc64e9b*/
  {
    result = KtiFunc105B(__return_address, *((_WORD *)__return_address + 123377)); /*0xffc64ee1*/
  }
  else
  {
    v6 = KtiFunc9D6(); /*0xffc64ea6*/
    while ( 1 ) /*0xffc64eb1*/
    {
      result = KtiFunc105B(__return_address, *((_WORD *)__return_address + 123377)); /*0xffc64eb1*/
      v21 = result; /*0xffc64eb6*/
      if ( (result & 1) == 0 ) /*0xffc64ebe*/
        break; /*0xffc64ebe*/
      if ( (unsigned int)KtiFuncA21((int)__return_address, v6, SHIDWORD(v6)) >= 0x186A0 ) /*0xffc64ed0*/
      {
        result = v21; /*0xffc64ed2*/
        break; /*0xffc64ed6*/
      }
    }
  }
  if ( (result & 0x11) == 0 ) /*0xffc64eea*/
  {
    UncoreInitDelayUs(__return_address, *((_WORD *)__return_address + 123377), 0xFFu); /*0xffc64eff*/
    UncoreInitDelayUs(__return_address, *((_WORD *)__return_address + 123377) + 3, a2); /*0xffc64f1a*/
    UncoreInitDelayUs(__return_address, *((_WORD *)__return_address + 123377) + 4, a3); /*0xffc64f33*/
    v8 = (a3 & 1) == 0; /*0xffc64f3f*/
    v24 = a3 & 1; /*0xffc64f3f*/
    n68_1 = n68; /*0xffc64f44*/
    if ( v8 ) /*0xffc64f4b*/
    {
      if ( n68 == 76 ) /*0xffc64f53*/
      {
        UncoreInitDelayUs(__return_address, *((_WORD *)__return_address + 123377) + 5, a5[1]); /*0xffc64f6d*/
        UncoreInitDelayUs(__return_address, *((_WORD *)__return_address + 123377) + 6, *a5); /*0xffc64f89*/
LABEL_11:
        n68_1 = n68; /*0xffc64f91*/
        goto LABEL_12; /*0xffc64f91*/
      }
      if ( n68 == 68 ) /*0xffc65050*/
      {
        UncoreInitDelayUs(__return_address, *((_WORD *)__return_address + 123377) + 3, *a5); /*0xffc65066*/
        goto LABEL_11; /*0xffc65066*/
      }
      if ( n68 != 84 ) /*0xffc65075*/
      {
        UncoreInitDelayUs(__return_address, *((_WORD *)__return_address + 123377) + 5, *a5); /*0xffc6512d*/
        goto LABEL_11; /*0xffc6512d*/
      }
      v19 = *a5; /*0xffc6507e*/
      UncoreInitDelayUs(__return_address, *((_WORD *)__return_address + 123377) + 5, *a5); /*0xffc65095*/
      UncoreInitDelayUs(__return_address, *((_WORD *)__return_address + 123377) + 13, 2u); /*0xffc650ae*/
      KtiFunc105B(__return_address, *((_WORD *)__return_address + 123377) + 2); /*0xffc650c5*/
      v13 = 1; /*0xffc650d0*/
      v23 = 1; /*0xffc650d2*/
      if ( v19 ) /*0xffc650da*/
      {
        do /*0xffc65110*/
        {
          UncoreInitDelayUs(__return_address, *((_WORD *)__return_address + 123377) + 7, a5[v13]); /*0xffc650fa*/
          v13 = v23 + 1; /*0xffc65106*/
          v23 = v13; /*0xffc65108*/
        }
        while ( v13 <= v19 ); /*0xffc65110*/
        n68_1 = n68; /*0xffc65112*/
LABEL_12:
        UncoreInitDelayUs(__return_address, *((_WORD *)__return_address + 123377) + 2, n68_1); /*0xffc64f98*/
        if ( (__return_address[246408] & 4) != 0 ) /*0xffc64fb7*/
        {
          v11 = KtiFunc105B(__return_address, *((_WORD *)__return_address + 123377)); /*0xffc6517f*/
          v22 = v11; /*0xffc65186*/
        }
        else
        {
          v10 = KtiFunc9D6(); /*0xffc64fc6*/
          while ( 1 ) /*0xffc64fd1*/
          {
            v11 = KtiFunc105B(__return_address, *((_WORD *)__return_address + 123377)); /*0xffc64fd1*/
            v22 = v11; /*0xffc64fd6*/
            if ( (v11 & 0x1E) != 0 ) /*0xffc64fde*/
              break; /*0xffc64fde*/
            if ( (unsigned int)KtiFuncA21((int)__return_address, v10, SHIDWORD(v10)) >= 0x186A0 ) /*0xffc64ff0*/
            {
              v11 = v22; /*0xffc64ff2*/
              break; /*0xffc64ff2*/
            }
          }
        }
        if ( (v11 & 2) == 0 || !v24 ) /*0xffc65006*/
          goto LABEL_39; /*0xffc65006*/
        if ( n68 == 76 ) /*0xffc65012*/
        {
          a5[1] = KtiFunc105B(__return_address, *((_WORD *)__return_address + 123377) + 5); /*0xffc6502c*/
          v12 = KtiFunc105B(__return_address, *((_WORD *)__return_address + 123377) + 6); /*0xffc65041*/
        }
        else
        {
          v14 = *((_WORD *)__return_address + 123377); /*0xffc65191*/
          if ( n68 == 84 ) /*0xffc65198*/
          {
            KtiFunc105B(__return_address, v14 + 2); /*0xffc651a5*/
            v18 = KtiFunc105B(__return_address, *((_WORD *)__return_address + 123377) + 5); /*0xffc651c1*/
            *a5 = v18; /*0xffc651c5*/
            if ( v18 ) /*0xffc651ca*/
            {
              do /*0xffc651f9*/
              {
                v15 = KtiFunc105B(__return_address, *((_WORD *)__return_address + 123377) + 7); /*0xffc651de*/
                v16 = v20; /*0xffc651e3*/
                v17 = (unsigned __int8)v20; /*0xffc651e9*/
                LOBYTE(v16) = v20 + 1; /*0xffc651ec*/
                v20 = v16; /*0xffc651ee*/
                a5[v17] = v15; /*0xffc651f2*/
              }
              while ( (unsigned __int8)v16 <= v18 ); /*0xffc651f9*/
            }
            goto LABEL_39; /*0xffc651f9*/
          }
          v12 = KtiFunc105B(__return_address, v14 + 5); /*0xffc65205*/
        }
        *a5 = v12; /*0xffc6520c*/
LABEL_39:
        UncoreInitDelayUs(__return_address, *((_WORD *)__return_address + 123377), 0xFFu); /*0xffc6520f*/
        return v22; /*0xffc65222*/
      }
    }
    else
    {
      if ( n68 != 84 ) /*0xffc65134*/
        goto LABEL_12; /*0xffc65134*/
      UncoreInitDelayUs(__return_address, *((_WORD *)__return_address + 123377) + 13, 2u); /*0xffc6514e*/
      KtiFunc105B(__return_address, *((_WORD *)__return_address + 123377) + 2); /*0xffc65165*/
    }
    n68_1 = n68; /*0xffc6516d*/
    goto LABEL_12; /*0xffc65171*/
  }
  return result; /*0xffc6522a*/
}

// Function: DdrTrainFunc5231 @ 0xffc65231 (0x2b8 bytes)
// Index: 840/2560

int __cdecl DdrTrainFunc5231(
        _BYTE *__return_address,
        unsigned __int8 a2,
        int n4,
        unsigned __int16 a4,
        int a5,
        unsigned __int8 *a6)
{
  int v6; // eax
  unsigned __int16 v7; // dx
  int n67453088; // eax
  int v9; // esi
  int v10; // edi
  int v11; // ebp
  unsigned __int8 v12; // al
  char v14; // [esp+12h] [ebp-22h]
  unsigned __int8 v15; // [esp+13h] [ebp-21h]
  int n67453100; // [esp+14h] [ebp-20h]
  BOOL v17; // [esp+18h] [ebp-1Ch]
  int n67453112; // [esp+20h] [ebp-14h]
  int n67453088_1; // [esp+24h] [ebp-10h]
  char n68; // [esp+24h] [ebp-10h]
  __int64 v21; // [esp+28h] [ebp-Ch]
  char v22; // [esp+30h] [ebp-4h]

  v17 = 0; /*0xffc65234*/
  DdrTrainFunc4A34(__return_address, a2); /*0xffc65246*/
  v6 = (unsigned __int8)KtiFunc27B1(__return_address, n4, a4, a5, a6) - 1; /*0xffc65275*/
  if ( !v6 ) /*0xffc65278*/
    return 0; /*0xffc654df*/
  if ( v6 == 1 ) /*0xffc65281*/
    return 1; /*0xffc654dd*/
  v7 = a4; /*0xffc65287*/
  if ( !(a4 >> 12) ) /*0xffc6528f*/
  {
    if ( (a4 & 0xF00) != 0 ) /*0xffc652a4*/
    {
      n67453088 = 67453088; /*0xffc652bd*/
      n67453100 = 67453100; /*0xffc652c2*/
      n67453112 = 67453112; /*0xffc652ca*/
    }
    else
    {
      n67453088 = 67453084; /*0xffc652a6*/
      n67453100 = 67453096; /*0xffc652ab*/
      n67453112 = 67453108; /*0xffc652b3*/
    }
    n67453088_1 = n67453088; /*0xffc652d9*/
    if ( (CpuIoRead((int)__return_address, a2, 0, n67453088) & 0x100000) != 0 ) /*0xffc652eb*/
    {
      if ( ProcCommonFuncFB4A((int)__return_address, 3u) ) /*0xffc652f0*/
        LogDebugString(__return_address, (int)"trying to write to PROCESSOR SMBUS with TSOD polling enabled...halting!"); /*0xffc65301*/
      ProcMemInitCheck((int)__return_address, 246, 2); /*0xffc65310*/
    }
    v9 = (unsigned __int8)a5 | ((a4 & 0xFE | 0x400100) << 7); /*0xffc65333*/
    if ( (_WORD)n4 == 4 ) /*0xffc6533d*/
    {
      v9 |= 0x20000u; /*0xffc6533f*/
      v10 = *a6 + (a6[1] << 8); /*0xffc65361*/
    }
    else
    {
      v10 = *a6; /*0xffc65365*/
    }
    v21 = KtiFunc9D6(); /*0xffc6537d*/
    do /*0xffc653c1*/
    {
      if ( (CpuIoRead((int)__return_address, a2, 0, n67453100) & 1) == 0 ) /*0xffc6539a*/
        break; /*0xffc6539a*/
      if ( (__return_address[246408] & 4) != 0 ) /*0xffc653a3*/
        break; /*0xffc653a3*/
      KtiFunc41B3((int)__return_address, 6u, 1); /*0xffc653a9*/
    }
    while ( (unsigned int)KtiFuncA21((int)__return_address, v21, SHIDWORD(v21)) < 0x186A0 ); /*0xffc653c1*/
    CpuIoCfgWrite((int)__return_address, a2, 0, n67453112, v10 << 16); /*0xffc653d4*/
    CpuIoCfgWrite((int)__return_address, a2, 0, n67453088_1, v9 | 0x80000); /*0xffc653e8*/
    do /*0xffc65414*/
    {
      v22 = CpuIoRead((int)__return_address, a2, 0, n67453100); /*0xffc65403*/
      KtiFunc41B3((int)__return_address, 6u, 1); /*0xffc65407*/
    }
    while ( (v22 & 0xA) == 0 ); /*0xffc65414*/
LABEL_31:
    v11 = v17; /*0xffc654b6*/
    goto LABEL_32; /*0xffc654b6*/
  }
  v11 = 1; /*0xffc6541d*/
  if ( a4 >> 12 == 1 )
  {
    if ( (_WORD)n4 == 3 )
      n68 = 68; /*0xffc6542f*/
    else
      n68 = (_WORD)n4 != 5 ? 72 : 84;
    v14 = 0; /*0xffc6544d*/
    while ( 1 ) /*0xffc65474*/
    {
      v12 = DdrTrainFunc4E82(__return_address, a5, 2 * ((8 * (v7 >> 4)) | ((unsigned __int8)v7 >> 1) & 7), n68, a6); /*0xffc65474*/
      v15 = v12; /*0xffc6547c*/
      if ( (v12 & 0x19) == 0 ) /*0xffc65482*/
        break; /*0xffc65482*/
      KtiFunc8C4((int)__return_address, 0x186A0u); /*0xffc6548a*/
      if ( (unsigned __int8)++v14 >= 0x14u ) /*0xffc6549d*/
      {
        v12 = v15; /*0xffc654a6*/
        break; /*0xffc654a6*/
      }
      v7 = a4; /*0xffc6549f*/
    }
    v17 = (v12 & 0x1D) != 0; /*0xffc654aa*/
    goto LABEL_31; /*0xffc654b2*/
  }
LABEL_32:
  if ( __return_address[246738] == 1 ) /*0xffc654c1*/
  {
    DdrTrainFunc4E3E((int)__return_address, a2); /*0xffc654c8*/
    __return_address[246737] = 0; /*0xffc654cf*/
  }
  return v11; /*0xffc654e1*/
}

// Function: DdrTrainFunc54E9 @ 0xffc654e9 (0x8d bytes)
// Index: 841/2560

unsigned int __cdecl DdrTrainFunc54E9(unsigned __int8 n0xF, unsigned __int64 a2, _BYTE *a3)
{
  unsigned int v4; // ebx
  unsigned __int8 n0x20; // di
  unsigned __int8 n0xF_1; // al
  int n8; // ebp
  __int64 v8; // rax
  _BYTE *v9; // ecx
  unsigned __int64 v11; // [esp+10h] [ebp-8h]
  _BYTE *v12; // [esp+28h] [ebp+10h]

  v4 = 0; /*0xffc654f6*/
  n0x20 = 0; /*0xffc65503*/
  v11 = a2; /*0xffc65507*/
  n0xF_1 = n0xF; /*0xffc6550b*/
  *a3 = 0; /*0xffc6550f*/
  v12 = 0; /*0xffc65511*/
  n8 = 8; /*0xffc65515*/
  do /*0xffc65561*/
  {
    if ( (n0xF_1 & 1) != 0 ) /*0xffc65518*/
    {
      ++*a3; /*0xffc65521*/
      LODWORD(v8) = DdrTrainFunc6101((unsigned __int8)a2, n0x20); /*0xffc65525*/
      v9 = (_BYTE *)((v8 + __PAIR64__((unsigned int)v12, v4)) >> 32); /*0xffc65534*/
      v4 += v8; /*0xffc65534*/
      v12 = v9; /*0xffc6553e*/
      LODWORD(v11) = v11 >> 8; /*0xffc65545*/
      LOBYTE(a2) = v11; /*0xffc65549*/
      n0xF_1 = n0xF; /*0xffc6554d*/
      HIDWORD(v11) >>= 8; /*0xffc65551*/
    }
    n0xF_1 >>= 1; /*0xffc65555*/
    n0x20 += 8; /*0xffc65557*/
    n0xF = n0xF_1; /*0xffc6555a*/
    --n8; /*0xffc6555e*/
  }
  while ( n8 ); /*0xffc65561*/
  if ( !*a3 ) /*0xffc65563*/
    *a3 = 1; /*0xffc65568*/
  return v4; /*0xffc6556b*/
}

// Function: DdrTrainFunc5576 @ 0xffc65576 (0x131 bytes)
// Index: 842/2560

int __cdecl DdrTrainFunc5576(int a1, unsigned __int8 n6, _DWORD *a3)
{
  int SocketInfo; // eax
  int v4; // ecx
  __int16 v5; // dx
  __int16 v6; // bx
  __int16 v7; // si
  __int16 v8; // bp
  char v9; // di
  int v10; // edx
  int v11; // ecx
  int v12; // edx
  int v13; // eax
  int v14; // ecx
  int v15; // ecx

  SocketInfo = GetSocketInfo(a1, *(_BYTE *)(a1 + 9402)); /*0xffc6558d*/
  v4 = 7688 * n6; /*0xffc6559d*/
  v5 = *(_WORD *)(v4 + SocketInfo + 7485); /*0xffc655a5*/
  v6 = *(_WORD *)(v4 + SocketInfo + 7481); /*0xffc655ad*/
  v7 = *(_WORD *)(v4 + SocketInfo + 7483); /*0xffc655b5*/
  v8 = *(_WORD *)(v4 + SocketInfo + 7487); /*0xffc655bd*/
  *a3 = 0; /*0xffc655c7*/
  *(_DWORD *)((char *)a3 + 5) = 1 << v8; /*0xffc655cf*/
  v9 = v5; /*0xffc655d5*/
  *(_DWORD *)((char *)a3 + 10) = 1 << v5; /*0xffc655df*/
  *(_DWORD *)((char *)a3 + 15) = (2 << v5) | (1 << v8); /*0xffc655ea*/
  a3[5] = 1 << v7; /*0xffc655f2*/
  v10 = (2 << v7) | (1 << v5); /*0xffc65603*/
  *(_DWORD *)((char *)a3 + 25) = (2 << v7) | (1 << v8); /*0xffc65606*/
  *(_DWORD *)((char *)a3 + 30) = v10; /*0xffc65609*/
  *(_DWORD *)((char *)a3 + 35) = (2 * v10) | (1 << v8); /*0xffc65615*/
  a3[10] = 1 << v6; /*0xffc65620*/
  v11 = 2 * (1 << v6); /*0xffc65623*/
  v12 = (1 << v6 << 10) | (1 << v7); /*0xffc6562b*/
  v13 = v11 | (1 << v8); /*0xffc6562e*/
  a3[15] = v12; /*0xffc65631*/
  v14 = v11 | (1 << v9); /*0xffc65634*/
  *(_DWORD *)((char *)a3 + 45) = v13; /*0xffc65637*/
  *(_DWORD *)((char *)a3 + 50) = v14; /*0xffc6563a*/
  *(_DWORD *)((char *)a3 + 55) = (2 * v14) | (1 << v8); /*0xffc65643*/
  v15 = (2 * v12) | (1 << v9); /*0xffc6564b*/
  *(_DWORD *)((char *)a3 + 70) = v15; /*0xffc65651*/
  *(_DWORD *)((char *)a3 + 65) = (2 * v12) | (1 << v8); /*0xffc65654*/
  *(_DWORD *)((char *)a3 + 75) = (2 * v15) | (1 << v8); /*0xffc6565d*/
  *((_BYTE *)a3 + 4) = 0; /*0xffc65663*/
  *((_BYTE *)a3 + 9) = 1; /*0xffc65669*/
  *((_BYTE *)a3 + 14) = 1; /*0xffc6566d*/
  *((_BYTE *)a3 + 19) = 1; /*0xffc65671*/
  *((_BYTE *)a3 + 24) = 2; /*0xffc65675*/
  *((_BYTE *)a3 + 29) = 2; /*0xffc65679*/
  *((_BYTE *)a3 + 34) = 2; /*0xffc6567d*/
  *((_BYTE *)a3 + 39) = 2; /*0xffc65681*/
  *((_BYTE *)a3 + 44) = 1; /*0xffc65685*/
  *((_BYTE *)a3 + 49) = 1; /*0xffc65689*/
  *((_BYTE *)a3 + 54) = 1; /*0xffc6568d*/
  *((_BYTE *)a3 + 59) = 1; /*0xffc65691*/
  *((_BYTE *)a3 + 64) = 2; /*0xffc65695*/
  *((_BYTE *)a3 + 69) = 2; /*0xffc65699*/
  *((_BYTE *)a3 + 74) = 2; /*0xffc6569d*/
  *((_BYTE *)a3 + 79) = 2; /*0xffc656a1*/
  return 0; /*0xffc65660*/
}

// Function: DdrTrainFunc56A7 @ 0xffc656a7 (0xa bytes)
// Index: 843/2560

int __usercall DdrTrainFunc56A7@<eax>(__m64 a1@<mm3>)
{
  return _mm_cvtsi64_si32(a1); /*0xffc656b0*/
}

// Function: DdrTrainFunc56B1 @ 0xffc656b1 (0x1d5 bytes)
// Index: 844/2560

int __cdecl DdrTrainFunc56B1(_BYTE *__return_address)
{
  _BYTE *__return_address_1; // esi
  int v2; // ebx
  unsigned __int8 *p_n183; // edi
  unsigned __int8 v4; // al
  int SocketInfo_1; // ecx
  unsigned __int8 n6; // al
  int SocketInfo; // [esp+Ch] [ebp-8h]
  unsigned __int8 n6_1; // [esp+10h] [ebp-4h]

  __return_address_1 = __return_address; /*0xffc656b8*/
  v2 = 0; /*0xffc656bb*/
  LOBYTE(__return_address) = __return_address[9402]; /*0xffc656c4*/
  p_n183 = (unsigned __int8 *)&unk_FFD543E4; /*0xffc656d0*/
  SocketInfo = GetSocketInfo((int)__return_address_1, (unsigned __int8)__return_address); /*0xffc656d5*/
  if ( off_FFD543E8 )
  {
    do
    {
      if ( (p_n183[1] & __return_address_1[255576]) != 0 )
      {
        KtiFunc40A2((int)__return_address_1, *p_n183, 0); /*0xffc656fc*/
        KtiFunc4541((int)__return_address_1, 0xB6u, *p_n183, (unsigned __int8)__return_address); /*0xffc65712*/
        v4 = p_n183[11]; /*0xffc65717*/
        if ( v4 == 0xFF ) /*0xffc6571f*/
          goto LABEL_14; /*0xffc6571f*/
        if ( v4 == 0xE0 )
        {
          if ( !__return_address_1[244342] )
          {
LABEL_14:
            SocketInfo_1 = SocketInfo; /*0xffc657ea*/
            n6 = 0; /*0xffc657ed*/
            n6_1 = 0; /*0xffc657ef*/
            while ( 1 )
            {
              if ( *(_BYTE *)(7688 * n6 + SocketInfo_1) )
              {
                if ( *((_WORD *)p_n183 + 4) == 254 )
                {
                  KtiFunc8014((int)__return_address_1); /*0xffc6580d*/
                  DebugPrint(
                    (int)__return_address_1,
                    3,
                    (int)__return_address,
                    255,
                    255,
                    255,
                    255,
                    255,
                    " Task: %s External\n",
                    (const char *)*(&off_FFD54284 + p_n183[10]));
                  KtiFunc834D((int)__return_address_1); /*0xffc65838*/
                }
                __return_address_1[244343] = 0; /*0xffc65843*/
                v2 = (*((int (__cdecl **)(_BYTE *, _DWORD, _DWORD, unsigned __int8))p_n183 + 1))( /*0xffc65858*/
                       __return_address_1,
                       *((unsigned __int16 *)p_n183 + 4),
                       p_n183[10],
                       n6_1);
                if ( v2 ) /*0xffc6585f*/
                  return v2; /*0xffc6585f*/
                SocketInfo_1 = SocketInfo; /*0xffc65861*/
              }
              n6 = n6_1 + 1; /*0xffc65867*/
              n6_1 = n6; /*0xffc65869*/
              if ( n6 >= 6u ) /*0xffc6586e*/
                goto LABEL_21; /*0xffc6586e*/
            }
          }
          if ( *((_WORD *)p_n183 + 4) == 254 )
          {
            KtiFunc8014((int)__return_address_1); /*0xffc65746*/
            DebugPrint(
              (int)__return_address_1,
              3,
              (int)__return_address,
              255,
              255,
              255,
              255,
              255,
              " Task: %s External\n",
              (const char *)*(&off_FFD54284 + p_n183[10]));
            KtiFunc834D((int)__return_address_1); /*0xffc65771*/
          }
          __return_address_1[244343] = 1; /*0xffc65779*/
        }
        else
        {
          if ( *((_WORD *)p_n183 + 4) == 254 )
          {
            KtiFunc8014((int)__return_address_1); /*0xffc6578e*/
            DebugPrint(
              (int)__return_address_1,
              3,
              (int)__return_address,
              255,
              255,
              255,
              255,
              255,
              " Task: %s External\n",
              (const char *)*(&off_FFD54284 + p_n183[10]));
            KtiFunc834D((int)__return_address_1); /*0xffc657b9*/
          }
          __return_address_1[244343] = 0; /*0xffc657c1*/
        }
        v2 = (*((int (__cdecl **)(_BYTE *, _DWORD, _DWORD, _DWORD))p_n183 + 1))( /*0xffc657d8*/
               __return_address_1,
               *((unsigned __int16 *)p_n183 + 4),
               p_n183[10],
               0);
        if ( v2 ) /*0xffc657df*/
          break; /*0xffc657df*/
      }
LABEL_21:
      p_n183 += 12; /*0xffc65870*/
    }
    while ( *((_DWORD *)p_n183 + 1) );
  }
  return v2; /*0xffc6587d*/
}

// Function: PcieAddressEarlyInit @ 0xffc65886 (0x875 bytes)
// Index: 845/2560

int __usercall PcieAddressEarlyInit@<eax>(__m64 a1@<mm3>, int a2, unsigned __int16 a3, __int16 a4, unsigned __int8 n6)
{
  int v5; // esi
  char v6; // bl
  unsigned __int8 n6_1; // bh
  int SocketInfo; // ecx
  char v9; // al
  _BYTE *v10; // ebp
  char v11; // bl
  unsigned __int8 *v12; // edi
  __int16 n2; // dx
  int v14; // ecx
  int n2_2; // eax
  int n2_3; // eax
  __int16 n2_4; // ax
  __int16 v18; // cx
  int v19; // eax
  unsigned __int8 v20; // dl
  unsigned __int16 v21; // ax
  unsigned __int8 v22; // al
  int v23; // esi
  unsigned __int64 v24; // rax
  unsigned __int16 v25; // di
  unsigned __int8 v26; // cl
  char v27; // dl
  unsigned __int8 v28; // cl
  unsigned __int8 n2_5; // bh
  char v30; // dl
  int v31; // esi
  int v32; // eax
  int v33; // eax
  char v34; // ch
  __int16 v35; // cx
  unsigned __int64 v36; // rax
  int v37; // eax
  int v38; // edi
  unsigned __int8 j_1; // cl
  int j_2; // edx
  unsigned __int8 j_3; // al
  char v42; // bl
  int v43; // ebx
  b... [19600 chars total]

// Function: DdrTrainFunc60FB @ 0xffc660fb (0x6 bytes)
// Index: 846/2560

void DdrTrainFunc60FB()
{
  ; /*0xffc660fb*/
}

// Function: DdrTrainFunc6101 @ 0xffc66101 (0x15 bytes)
// Index: 847/2560

int __usercall DdrTrainFunc6101@<eax>(__int64 a1@<edx:eax>, unsigned __int8 n0x20@<cl>)
{
  __int64 v2; // rax

  if ( n0x20 >= 0x20u ) /*0xffc66104*/
    LODWORD(v2) = 0; /*0xffc6610e*/
  else
    return a1 << (n0x20 & 0x1F); /*0xffc66109*/
  return v2; /*0xffc6610b*/
}

// Function: nullsub_7 @ 0xffc66116 (0x1 bytes)
// Index: 848/2560

void nullsub_7()
{
  ; /*0xffc66116*/
}

// Function: DdrTrainFunc6117 @ 0xffc66117 (0x15 bytes)
// Index: 849/2560

int __usercall DdrTrainFunc6117@<eax>(unsigned __int64 a1@<edx:eax>, unsigned __int8 n0x20@<cl>)
{
  if ( n0x20 >= 0x20u ) /*0xffc6611a*/
    LODWORD(a1) = HIDWORD(a1) >> (n0x20 - 32); /*0xffc66129*/
  else
    a1 >>= n0x20 & 0x1F; /*0xffc6611f*/
  return a1; /*0xffc66121*/
}

// Function: nullsub_8 @ 0xffc6612c (0x1 bytes)
// Index: 850/2560

void nullsub_8()
{
  ; /*0xffc6612c*/
}

// Function: DdrTrainFunc612D @ 0xffc6612d (0x76 bytes)
// Index: 851/2560

int __cdecl DdrTrainFunc612D(_BYTE *__return_address, unsigned __int8 n4, unsigned __int8 n2, int *a4, int *a5)
{
  int v5; // edi
  unsigned int n15; // edx
  int n2_1; // ebx
  unsigned int v8; // eax

  v5 = 0; /*0xffc66141*/
  n15 = 0x38u / n2; /*0xffc66147*/
  *a4 = 0; /*0xffc66149*/
  *a5 = 0; /*0xffc6614c*/
  if ( n15 > 0xF ) /*0xffc66151*/
    n15 = 15; /*0xffc66155*/
  n2_1 = 2; /*0xffc66158*/
  do /*0xffc6616a*/
  {
    v8 = n15 << v5; /*0xffc6615d*/
    v5 += 4; /*0xffc6615f*/
    *a4 |= v8; /*0xffc66162*/
    *a5 |= v8; /*0xffc66165*/
    --n2_1; /*0xffc66167*/
  }
  while ( n2_1 ); /*0xffc6616a*/
  if ( !__return_address[246412] && __return_address[246424] < 3u && __return_address[351 * n4 + 255719] > 0x10u ) /*0xffc66194*/
    *a5 = 17; /*0xffc66196*/
  return 0; /*0xffc6619c*/
}

// Function: DdrTrainFunc61A3 @ 0xffc661a3 (0x4b bytes)
// Index: 852/2560

char __cdecl DdrTrainFunc61A3(int __return_address, unsigned __int8 n4)
{
  unsigned __int8 v2; // bl
  char v3; // cl
  _BYTE *v4; // eax
  int v5; // edx

  if ( *(_BYTE *)(__return_address + 257190) ) /*0xffc661a8*/
    return *(_BYTE *)(__return_address + 255496); /*0xffc661e4*/
  v2 = *(_BYTE *)(__return_address + 255496); /*0xffc661b1*/
  v3 = 0; /*0xffc661b7*/
  if ( v2 ) /*0xffc661bb*/
  {
    v4 = (_BYTE *)(__return_address + 255705 + 351 * n4); /*0xffc661ce*/
    v5 = v2; /*0xffc661d0*/
    do /*0xffc661e0*/
    {
      if ( (*v4 & 1) != 0 ) /*0xffc661d6*/
        ++v3; /*0xffc661d8*/
      v4 += 4; /*0xffc661da*/
      --v5; /*0xffc661dd*/
    }
    while ( v5 ); /*0xffc661e0*/
  }
  return v3; /*0xffc661ec*/
}

// Function: DdrTrainFunc61EE @ 0xffc661ee (0x7a bytes)
// Index: 853/2560

char __cdecl DdrTrainFunc61EE(int __return_address, _BYTE *n4, char a3)
{
  unsigned __int8 n4_1; // bl
  _BYTE *v5; // ebp
  int v6; // eax
  unsigned __int8 n5; // bh
  unsigned __int8 n4_2; // [esp+10h] [ebp-8h]

  n4_1 = 0; /*0xffc661f7*/
  n4_2 = 0; /*0xffc661fe*/
  v5 = (_BYTE *)(__return_address + 255501); /*0xffc66202*/
  do /*0xffc6625f*/
  {
    LOBYTE(v6) = *n4; /*0xffc66208*/
    if ( (*n4 & 1) != 0 && (v6 & 0x60) == 0 ) /*0xffc66210*/
    {
      n5 = 5; /*0xffc66216*/
      do /*0xffc6624c*/
      {
        v6 = 1 << --n5; /*0xffc66223*/
        if ( ((unsigned __int8)(1 << n5) & *v5) != 0 ) /*0xffc66228*/
        {
          if ( a3 ) /*0xffc6622c*/
            LOBYTE(v6) = j_PciCfgWrite_0(__return_address, n4_2, n5, 201343104, -1); /*0xffc66230*/
          else
            LOBYTE(v6) = j_PciCfgWrite_0(__return_address, n4_2, n5, 201343104, 0); /*0xffc66242*/
        }
      }
      while ( n5 ); /*0xffc6624c*/
      n4_1 = n4_2; /*0xffc6624e*/
    }
    ++n4_1; /*0xffc66252*/
    n4 += 13; /*0xffc66254*/
    ++v5; /*0xffc66257*/
    n4_2 = n4_1; /*0xffc66258*/
  }
  while ( n4_1 < 4u ); /*0xffc6625f*/
  return v6; /*0xffc66261*/
}

// Function: DdrTrainFunc6268 @ 0xffc66268 (0x32c bytes)
// Index: 854/2560

int __cdecl DdrTrainFunc6268(_BYTE *__return_address, int buf, unsigned __int8 n4)
{
  unsigned __int8 v3; // bl
  unsigned int n0xF; // esi
  int v5; // edi
  char n3_1; // al
  char n5; // dl
  unsigned __int8 n3; // dh
  unsigned int v9; // eax
  unsigned int v10; // eax
  int n5_1; // edx
  int v12; // ecx
  unsigned int n0x60; // edi
  _BYTE *__return_address_1; // edi
  unsigned int n0xF_1; // edx
  int n2376772; // ebp
  unsigned __int8 v17; // cl
  unsigned int v18; // eax
  int v19; // ebx
  unsigned int v20; // esi
  int v21; // eax
  int v22; // eax
  int v24; // [esp-24h] [ebp-60h]
  int n15; // [esp+14h] [ebp-28h]
  unsigned __int8 n2; // [esp+18h] [ebp-24h]
  unsigned __int8 n2a[4]; // [esp+18h] [ebp-24h]
  unsigned __int8 v28; // [esp+1Ch] [ebp-20h]
  unsigned int v29; // [esp+24h] [ebp-18h]
  int v30; // [esp+28h] [ebp-14h]
  unsigned int v31; // [esp+2Ch] [ebp-10h]
  int v32; // [esp+30h] [ebp-Ch] BYREF
  int v33; // [esp+34h] [ebp-8h] BYREF
  int v34; // [esp+38h] [ebp-4h]

  v3 = 0; /*0xffc66277*/
  LOBYTE(n0xF) = 0; /*0xffc66280*/
  v31 = 0; /*0xffc66282*/
  v5 = 0; /*0xffc66286*/
  v30 = 0; /*0xffc66288*/
  n2 = *(_BYTE *)(n4 + buf + 10); /*0xffc66290*/
  if ( n2 < 2u ) /*0xffc66296*/
    n2 = 2; /*0xffc6629a*/
  n3_1 = DdrTrainFunc61A3((int)__return_address, n4); /*0xffc662a4*/
  n5 = __return_address[257105]; /*0xffc662a9*/
  n3 = n3_1; /*0xffc662af*/
  if ( n5 || *(_BYTE *)(buf + 108) )
  {
    if ( *(_BYTE *)(buf + 123) == 1 )
    {
      v9 = __return_address[257193] == 1 ? 0 : 0xFFFFFFFD;
      if ( n5 == 5 || n3 == 3 ) /*0xffc662e2*/
        v10 = v9 + 15; /*0xffc662e9*/
      else
        v10 = v9 + 18; /*0xffc662e4*/
      v5 = v10 * (n3 - 1); /*0xffc662f0*/
    }
    n5_1 = 5; /*0xffc662f9*/
    v12 = 0; /*0xffc662fe*/
    do /*0xffc66318*/
    {
      if ( ((1 << v12) & *(unsigned __int8 *)(n4 + buf + 42)) != 0 ) /*0xffc6630c*/
        v3 += byte_FFD531FC[v12]; /*0xffc6630e*/
      ++v12; /*0xffc66314*/
      --n5_1; /*0xffc66315*/
    }
    while ( n5_1 ); /*0xffc66318*/
    n0x60 = v3 + v5 + 3; /*0xffc66323*/
    if ( n0x60 >= 0x60 )
    {
      RcAssertPrint(
        __return_address,
        1u,
        (int)"\n\n %s: %u   %s ",
        "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiCoh.c",
        471,
        "TOTAL_KTI_AD_CREDIT > RequiredCredit");
      KtiDebugAssert((int)__return_address, 223, 2); /*0xffc6634f*/
    }
    n0xF = (96 - n0x60) / n2; /*0xffc66364*/
    if ( n0xF > 0xF ) /*0xffc66369*/
      LOBYTE(n0xF) = 15; /*0xffc6636d*/
    v30 = 2 - (n2 > 0xEu); /*0xffc66379*/
  }
  __return_address_1 = __return_address; /*0xffc66381*/
  DdrTrainFunc612D(__return_address, n4, n2, &v32, &v33); /*0xffc66392*/
  v29 = 0x1Cu % n2; /*0xffc663a6*/
  n0xF_1 = 0x1Cu / n2; /*0xffc663aa*/
  n15 = n0xF_1; /*0xffc663b0*/
  switch ( n2 ) /*0xffc663b6*/
  {
    case 0x16u: /*0xffc663b6*/
      n2376772 = 2376772; /*0xffc663b8*/
LABEL_26:
      *(_DWORD *)n2a = n2376772; /*0xffc663d3*/
      goto LABEL_28; /*0xffc663d7*/
    case 0x12u: /*0xffc663b6*/
      n2376772 = 225678; /*0xffc663c3*/
      goto LABEL_26; /*0xffc663c8*/
    case 0xAu: /*0xffc663b6*/
      n2376772 = 987; /*0xffc663ce*/
      goto LABEL_26; /*0xffc663ce*/
  }
  n2376772 = 0; /*0xffc663d9*/
  *(_DWORD *)n2a = 0; /*0xffc663db*/
LABEL_28:
  v17 = 0; /*0xffc663df*/
  v28 = 0; /*0xffc663e9*/
  if ( *(_BYTE *)(n4 + buf + 10) ) /*0xffc663ed*/
  {
    v34 = (n0xF & 0xF | (16 * (n0xF & 0xF | (16 * (n0xF & 0xF))))) << 8; /*0xffc6640f*/
    v32 |= 0x1000000u; /*0xffc66419*/
    v33 |= 0x1000000u; /*0xffc66423*/
    do /*0xffc66584*/
    {
      v18 = v29; /*0xffc66427*/
      if ( (_BYTE)v29 ) /*0xffc6642d*/
      {
        v31 = (n2376772 & (unsigned int)(1 << v17)) >> v17; /*0xffc6643b*/
        if ( v31 ) /*0xffc66441*/
        {
          LOBYTE(v18) = v29 - 1; /*0xffc66443*/
          ++n0xF_1; /*0xffc66445*/
          v29 = v18; /*0xffc66446*/
          n15 = n0xF_1; /*0xffc6644a*/
        }
      }
      if ( n0xF_1 > 0xF ) /*0xffc66453*/
        n15 = 15; /*0xffc66455*/
      v19 = n15 & 0xF; /*0xffc6647f*/
      v24 = j_CpuIoWrite((int)__return_address_1, n4, v28, 16793820) | 0x20000; /*0xffc66493*/
      __return_address_1 = __return_address; /*0xffc66494*/
      v20 = v19 | j_CpuIoWrite((int)__return_address, n4, v28, 16793828) & 0xFFFFFFF0 | 0x20000; /*0xffc664a4*/
      j_PciCfgWrite_0((int)__return_address, n4, v28, 16793820, v24); /*0xffc664a7*/
      j_PciCfgWrite_0((int)__return_address, n4, v28, 16793828, v20); /*0xffc664bc*/
      v21 = j_CpuIoWrite((int)__return_address, n4, v28, 16793816); /*0xffc664cc*/
      j_PciCfgWrite_0((int)__return_address, n4, v28, 16793816, v34 | v21 & 0xFFF000FF); /*0xffc664e3*/
      v22 = j_CpuIoWrite((int)__return_address, n4, v28, 16793824); /*0xffc664f0*/
      j_PciCfgWrite_0( /*0xffc6652d*/
        (int)__return_address,
        n4,
        v28,
        16793824,
        v19 | (16 * (v19 | (16 * (v19 | (16 * (v30 | (16 * (v30 | (16 * (v30 | (n15 << 8))))))))))) | v22 & 0xF000000);
      j_PciCfgWrite_0((int)__return_address, n4, v28, 16540, v32); /*0xffc66541*/
      j_PciCfgWrite_0((int)__return_address, n4, v28, 16660, v33); /*0xffc66552*/
      n0xF_1 = n15; /*0xffc66557*/
      if ( v31 ) /*0xffc66563*/
        n0xF_1 = --n15; /*0xffc66565*/
      v17 = v28 + 1; /*0xffc66572*/
      n2376772 = *(_DWORD *)n2a; /*0xffc66578*/
      v28 = v17; /*0xffc6657c*/
    }
    while ( v17 < *(_BYTE *)(n4 + buf + 10) ); /*0xffc66584*/
  }
  return 0; /*0xffc6658a*/
}

// Function: KtiPhyLinkSetup @ 0xffc66594 (0x15c bytes)
// Index: 855/2560

int __cdecl KtiPhyLinkSetup(char *__return_address, char *buf, unsigned __int8 n4)
{
  unsigned __int8 v3; // bl
  unsigned __int8 n4_1; // cl
  int v5; // edx
  int v6; // eax
  int v7; // eax
  int v8; // eax
  char v9; // cl
  unsigned int v10; // eax
  unsigned int v11; // eax
  unsigned int v12; // eax
  unsigned int v13; // eax
  unsigned int v14; // eax
  unsigned __int8 v16; // [esp+8h] [ebp-4h]

  v3 = 0; /*0xffc6659d*/
  v16 = 0; /*0xffc6659f*/
  if ( __return_address[255496] ) /*0xffc665a2*/
  {
    n4_1 = n4; /*0xffc665ae*/
    v5 = 351 * n4; /*0xffc665b4*/
    do /*0xffc666e1*/
    {
      if ( (__return_address[4 * v3 + 255705 + v5] & 1) != 0 && (__return_address[v5 + 255701] & 0x30) == 0 ) /*0xffc665da*/
      {
        v6 = j_CpuIoWrite((int)__return_address, n4_1, v16, 151143340); /*0xffc665ea*/
        if ( __return_address[246412] || (unsigned __int8)__return_address[246424] >= 3u ) /*0xffc66602*/
          v7 = v6 & 0xFF001FFF | 0x2000; /*0xffc66610*/
        else
          v7 = v6 | 0xFFE000; /*0xffc66604*/
        j_PciCfgWrite_0((int)__return_address, n4, v16, 151143340, v7); /*0xffc66623*/
        v8 = j_CpuIoWrite((int)__return_address, n4, v16, 151011572); /*0xffc66632*/
        v9 = __return_address[246412]; /*0xffc66637*/
        v10 = v8 & 0xF803FFFF; /*0xffc66640*/
        if ( v9 || (unsigned __int8)__return_address[246424] >= 3u ) /*0xffc66650*/
          v11 = v10 & 0xFFFE07FF | 0x10000; /*0xffc66663*/
        else
          v11 = v10 & 0xFFFE07FF | 0xF800; /*0xffc66657*/
        if ( __return_address[257193] == 1 ) /*0xffc6666f*/
        {
          if ( v9 || (unsigned __int8)__return_address[246424] >= 3u ) /*0xffc6667c*/
            v12 = v11 & 0xFFFFFFC0 | 0x21; /*0xffc66689*/
          else
            v12 = v11 & 0xFFFFFFC0 | 0x20; /*0xffc66681*/
          v13 = v12 & 0xFFFFF83F | 0x380; /*0xffc66691*/
        }
        else
        {
          if ( v9 || (unsigned __int8)__return_address[246424] >= 3u ) /*0xffc666a3*/
            v14 = v11 & 0xFFFFFFC0 | 0x25; /*0xffc666b0*/
          else
            v14 = v11 & 0xFFFFFFC0 | 0x24; /*0xffc666a8*/
          v13 = v14 & 0xFFFFF83F | 0x480; /*0xffc666b8*/
        }
        j_PciCfgWrite_0((int)__return_address, n4, v16, 151011572, v13); /*0xffc666c8*/
        n4_1 = n4; /*0xffc666cd*/
        v5 = 351 * n4; /*0xffc666d3*/
      }
      v16 = ++v3; /*0xffc666d8*/
    }
    while ( v3 < (unsigned __int8)__return_address[255496] ); /*0xffc666e1*/
  }
  return 0; /*0xffc666e8*/
}

// Function: DdrTrainingFunc66F0 @ 0xffc666f0 (0x3f8 bytes)
// Index: 856/2560

int __cdecl DdrTrainingFunc66F0(char *__return_address, char *buf, unsigned __int8 n4)
{
  int n4_1; // edi
  unsigned __int8 *__return_address_1; // esi
  char n2_3; // al
  char *buf_1; // edx
  unsigned __int8 n4_2; // bp
  char n5; // al
  unsigned __int8 n5_2; // al
  int n5_4; // ebx
  unsigned __int8 n2; // cl
  int v12; // eax
  int v13; // edx
  int v14; // edi
  unsigned __int8 v15; // al
  int v16; // edi
  unsigned __int8 i; // bl
  char v18; // bh
  int v19; // edi
  unsigned __int8 v20; // al
  int v21; // edi
  int v22; // ecx
  unsigned __int8 n0x18; // dl
  unsigned __int8 n0x18_1; // dh
  char v25; // di
  int v26; // eax
  int v27; // eax
  bool v29; // [esp+11h] [ebp-23h]
  unsigned __int8 v30; // [esp+12h] [ebp-22h]
  unsigned __int8 n3_1; // [esp+13h] [ebp-21h]
  unsigned __int8 n3; // [esp+14h] [ebp-20h]
  unsigned __int8 n2_1; // [esp+14h] [ebp-20h]
  char n2_2; // [esp+15h] [ebp-1Fh]
  char v35; // [esp+16h] [ebp-1Eh]
  _BYTE v36[5]; // [esp+17h] [ebp-1Dh]
  int v37; // [esp+18h] [ebp-1Ch]
  int v38; // [esp+20h] [ebp-14h]
  int v39; // [esp+20h] [ebp-14h]
  int v40; // [esp+24h] [ebp-10h]
  int v41; // [esp+24h] [ebp-10h]
  int v42; // [esp+28h] [ebp-Ch]
  int v43; // [esp+28h] [ebp-Ch]
  unsigned __int8 n5_1; // [esp+2Ch] [ebp-8h]
  int n5_3; // [esp+30h] [ebp-4h]

  n4_1 = n4; /*0xffc66701*/
  __return_address_1 = (unsigned __int8 *)__return_address; /*0xffc66706*/
  n3 = buf[n4 + 46]; /*0xffc66715*/
  v35 = 0x12 % ((unsigned int)n3 + 1); /*0xffc6671f*/
  n2_3 = DdrTrainFunc61A3((int)__return_address, n4); /*0xffc66723*/
  buf_1 = buf; /*0xffc66728*/
  n2_2 = n2_3; /*0xffc66730*/
  v29 = 0; /*0xffc66734*/
  if ( !__return_address[246412] && (unsigned __int8)__return_address[246424] < 3u ) /*0xffc66747*/
  {
    v29 = 1; /*0xffc66750*/
    if ( n3 <= 3u && __return_address[257105] != 5 ) /*0xffc6675d*/
      v29 = (unsigned __int8)buf[n4 + 10] > 0x12u; /*0xffc6676a*/
  }
  n4_2 = n4; /*0xffc6676e*/
  n5 = 5; /*0xffc66772*/
  do
  {
    n5_2 = n5 - 1; /*0xffc66774*/
    n5_4 = n5_2; /*0xffc66776*/
    n5_1 = n5_2; /*0xffc66779*/
    n5_3 = n5_2; /*0xffc66781*/
    if ( ((unsigned __int8)(1 << n5_2) & (unsigned __int8)buf_1[n4_1 + 42]) != 0 )
    {
      n3_1 = buf_1[n4_1 + 46]; /*0xffc6679b*/
      n2 = 0; /*0xffc667ab*/
      v36[4] = 0; /*0xffc667ad*/
      v30 = 0x12 / ((unsigned int)n3_1 + 1); /*0xffc667b2*/
      v12 = 0; /*0xffc667b6*/
      v42 = 0; /*0xffc667b8*/
      n2_1 = 0; /*0xffc667bc*/
      *(_DWORD *)v36 = __return_address_1[255496]; /*0xffc667c0*/
      if ( v36[0] )
      {
        v40 = 351 * n4_1; /*0xffc667d2*/
        do
        {
          v13 = 0; /*0xffc667d9*/
          v14 = 0; /*0xffc667de*/
          v38 = 4 * n2; /*0xffc667e0*/
          if ( (__return_address_1[v40 + 255705 + v38] & 1) != 0 || __return_address_1[257190] == 1 )
          {
            if ( n2 == 2 )
            {
              v14 = (unsigned __int8)byte_FFD53204[n5_4]; /*0xffc66834*/
              if ( n3_1 > 3u )
                v15 = byte_FFD53234[n5_4]; /*0xffc66856*/
              else
                v15 = __return_address_1[257105] == 5 ? byte_FFD5322C[n5_4] : byte_FFD53224[n5_4];
            }
            else
            {
              v14 = (unsigned __int8)byte_FFD531FC[n5_4]; /*0xffc66805*/
              if ( n3_1 > 3u )
                v15 = byte_FFD5321C[n5_4]; /*0xffc66827*/
              else
                v15 = __return_address_1[257105] == 5 ? byte_FFD53214[n5_4] : byte_FFD5320C[n5_4];
            }
            v13 = v15 - 1; /*0xffc6685f*/
            if ( v29 ) /*0xffc66865*/
              v13 = v15 - 2; /*0xffc66867*/
          }
          v12 = (v14 << v38) | v42; /*0xffc66874*/
          *(_DWORD *)&v36[1] |= v13 << v38; /*0xffc6687a*/
          n2 = n2_1 + 1; /*0xffc6687e*/
          v42 = v12; /*0xffc66880*/
          n2_1 = n2; /*0xffc66884*/
        }
        while ( n2 < v36[0] );
        n4_2 = n4; /*0xffc66892*/
      }
      j_PciCfgWrite_0((int)__return_address_1, n4_2, n5_1, 201343216, v12); /*0xffc668a3*/
      j_PciCfgWrite_0((int)__return_address_1, n4_2, n5_1, 201343176, *(int *)&v36[1]); /*0xffc668b4*/
      v16 = 0; /*0xffc668c4*/
      for ( i = 0; i < 5u; ++i )
      {
        v18 = byte_FFD53328[i]; /*0xffc668df*/
        if ( ((1 << i) & (unsigned __int8)buf[n4 + 42]) != 0 )
        {
          v19 = ~(15 << v18) & v16; /*0xffc668fd*/
          __return_address_1 = (unsigned __int8 *)__return_address; /*0xffc66908*/
          if ( (unsigned __int8)buf[n4 + 46] > 3u )
          {
            if ( n2_2 )
              v20 = (unsigned __int8)n2_2 > 2u ? byte_FFD532AC[5 * n5_3 + i] : byte_FFD53274[5 * n5_3 + i];
            else
              v20 = byte_FFD53290[5 * n5_3 + i]; /*0xffc66941*/
          }
          else
          {
            v20 = n2_2 == 3 && (unsigned __int8)__return_address[257105] >= 4u
                ? byte_FFD5323C[5 * n5_3 + i]
                : byte_FFD53258[5 * n5_3 + i];
          }
          v16 = (v20 << v18) | v19; /*0xffc6696b*/
          if ( !i ) /*0xffc6696f*/
            v16 = v20 | v16 & 0xFFFFFFF0; /*0xffc66974*/
        }
      }
      n4_2 = n4; /*0xffc66985*/
      j_PciCfgWrite_0((int)__return_address_1, n4, n5_1, 201343168, v16); /*0xffc66992*/
      j_PciCfgWrite_0((int)__return_address_1, n4, n5_1, 201343164, v16); /*0xffc669a0*/
      v21 = 0; /*0xffc669a9*/
      v43 = 0; /*0xffc669ab*/
      v22 = 0; /*0xffc669af*/
      v41 = 0; /*0xffc669b1*/
      v39 = 0; /*0xffc669b8*/
      v37 = 0; /*0xffc669bc*/
      if ( v35 ) /*0xffc669c2*/
      {
        ++v30; /*0xffc669c4*/
        --v35; /*0xffc669ca*/
      }
      n0x18 = 0; /*0xffc669d2*/
      n0x18_1 = buf[n4 + 10]; /*0xffc669d8*/
      __return_address_1 = (unsigned __int8 *)__return_address; /*0xffc669dc*/
      if ( n0x18_1 ) /*0xffc669e2*/
      {
        v25 = 0; /*0xffc669e9*/
        do /*0xffc66a2b*/
        {
          v26 = v30 << (4 * (v25 & 7)); /*0xffc669f5*/
          if ( n0x18 >= 8u ) /*0xffc669fa*/
          {
            if ( n0x18 >= 0x10u ) /*0xffc66a0b*/
            {
              if ( n0x18 >= 0x18u ) /*0xffc66a16*/
                v39 |= v26; /*0xffc66a1e*/
              else
                v43 |= v26; /*0xffc66a18*/
            }
            else
            {
              v41 |= v26; /*0xffc66a0d*/
            }
            v22 = v37; /*0xffc66a22*/
          }
          else
          {
            v22 = v26 | v37; /*0xffc66a00*/
            v37 |= v26; /*0xffc66a02*/
          }
          ++n0x18; /*0xffc66a26*/
          ++v25; /*0xffc66a28*/
        }
        while ( n0x18 < n0x18_1 ); /*0xffc66a2b*/
        n4_2 = n4; /*0xffc66a2d*/
        v21 = v39; /*0xffc66a31*/
      }
      j_PciCfgWrite_0((int)__return_address, n4_2, n5_1, 201343132, v22); /*0xffc66a3e*/
      j_PciCfgWrite_0((int)__return_address, n4_2, n5_1, 201343136, v41); /*0xffc66a4f*/
      j_PciCfgWrite_0((int)__return_address, n4_2, n5_1, 201343140, v43); /*0xffc66a60*/
      j_PciCfgWrite_0((int)__return_address, n4_2, n5_1, 201343148, v21); /*0xffc66a6e*/
      j_PciCfgWrite_0((int)__return_address, n4_2, n5_1, 201343120, 0); /*0xffc66a81*/
      j_PciCfgWrite_0((int)__return_address, n4_2, n5_1, 201343124, 0); /*0xffc66a8f*/
      j_PciCfgWrite_0((int)__return_address, n4_2, n5_1, 201343128, 0); /*0xffc66a9d*/
      v27 = j_CpuIoWrite((int)__return_address, n4_2, n5_1, 201343220); /*0xffc66aab*/
      j_PciCfgWrite_0((int)__return_address, n4_2, n5_1, 201343220, v27 & 0xFFFFF9FF | 0x200); /*0xffc66ac2*/
      n4_1 = n4; /*0xffc66ac7*/
      buf_1 = buf; /*0xffc66ace*/
    }
    n5 = n5_1; /*0xffc66ad2*/
  }
  while ( n5_1 );
  return 0; /*0xffc66ade*/
}

// Function: DdrTrainFn_FFC66AE8 @ 0xffc66ae8 (0x68 bytes)
// Index: 857/2560

int __cdecl DdrTrainFn_FFC66AE8(
        int __return_address,
        unsigned __int8 n4,
        unsigned __int8 i,
        char n2,
        unsigned __int8 n11,
        unsigned __int8 n8)
{
  j_PciCfgWrite_0(__return_address, n4, i, 100679840, n8 | (((n11 | (unsigned __int8)(16 * n2)) & 0x3F) << 10)); /*0xffc66b16*/
  j_PciCfgWrite_0( /*0xffc66b2c*/
    __return_address,
    n4,
    i,
    100679840,
    n8 | (((n11 | (unsigned __int8)(16 * n2)) & 0x3F) << 10) | 0x40000);
  j_PciCfgWrite_0( /*0xffc66b42*/
    __return_address,
    n4,
    i,
    100679840,
    (unsigned __int16)n8 | (((n11 | (unsigned __int8)(16 * n2)) & 0x3F) << 10));
  return 0; /*0xffc66b4c*/
}

// Function: DdrTrainFn_FFC66B50 @ 0xffc66b50 (0x1f3 bytes)
// Index: 858/2560

int __cdecl DdrTrainFn_FFC66B50(_BYTE *__return_address, int buf, unsigned __int8 n4)
{
  _BYTE *__return_address_1; // edi
  int n5; // edx
  char v5; // bl
  int v6; // ecx
  char *v7; // eax
  char v8; // al
  unsigned __int8 n0xE; // al
  char v10; // bl
  unsigned __int8 n0x40; // bl
  unsigned __int8 n4_1; // al
  unsigned __int8 v13; // bh
  unsigned __int8 n3; // bl
  unsigned __int8 n2_2; // bl
  int v16; // ecx
  char n2; // [esp+10h] [ebp-10h]
  char n2_1; // [esp+18h] [ebp-8h]
  unsigned __int8 i; // [esp+1Ch] [ebp-4h]
  unsigned __int8 n8; // [esp+24h] [ebp+4h]

  __return_address_1 = __return_address; /*0xffc66b57*/
  if ( __return_address[257193] )
  {
    n8 = 0; /*0xffc66c40*/
  }
  else
  {
    n5 = 5; /*0xffc66b6e*/
    v5 = 0; /*0xffc66b76*/
    v6 = 0; /*0xffc66b78*/
    do /*0xffc66bd0*/
    {
      __return_address_1 = __return_address; /*0xffc66b95*/
      if ( ((1 << v6) & *(unsigned __int8 *)(n4 + buf + 42)) != 0 ) /*0xffc66ba2*/
      {
        if ( *(_BYTE *)(n4 + buf + 46) > 3u ) /*0xffc66ba9*/
        {
          v8 = byte_FFD5321C[v6]; /*0xffc66bc4*/
        }
        else
        {
          v7 = &byte_FFD53214[v6]; /*0xffc66bb2*/
          if ( __return_address[257105] != 5 ) /*0xffc66bb8*/
            v7 = &byte_FFD5320C[v6]; /*0xffc66bba*/
          v8 = *v7; /*0xffc66bc0*/
        }
        v5 += v8; /*0xffc66bca*/
      }
      ++v6; /*0xffc66bcc*/
      --n5; /*0xffc66bcd*/
    }
    while ( n5 ); /*0xffc66bd0*/
    n0xE = *(_BYTE *)(n4 + buf + 10); /*0xffc66bd2*/
    v10 = 8 * (*(_BYTE *)(buf + 123) == 1) + 4 + v5; /*0xffc66bd6*/
    if ( n0xE <= 0xEu ) /*0xffc66bdc*/
      n0xE *= 2; /*0xffc66bde*/
    n0x40 = n0xE + v10; /*0xffc66be0*/
    if ( n0x40 >= 0x40u )
    {
      RcAssertPrint(
        __return_address,
        1u,
        (int)"\n\n %s: %u   %s ",
        "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiCoh.c",
        1197,
        "TOTAL_KTI_BL_CREDIT > RequiredCredit");
      KtiDebugAssert((int)__return_address, 223, 3); /*0xffc66c0b*/
    }
    n8 = (64 - n0x40) / *(unsigned __int8 *)(n4 + buf + 34); /*0xffc66c23*/
    if ( n8 >= 0x10u ) /*0xffc66c29*/
      n8 = 15; /*0xffc66c2b*/
    if ( __return_address_1[257105] == 3 ) /*0xffc66c37*/
      n8 = 3; /*0xffc66c39*/
  }
  n4_1 = n4; /*0xffc66c45*/
  v13 = 0; /*0xffc66c49*/
  for ( i = 0; v13 < *(_BYTE *)(buf + n4 + 34); n4_1 = n4 ) /*0xffc66c56*/
  {
    DdrTrainFn_FFC66AE8((int)__return_address_1, n4_1, i, 0, 0xDu, 8u); /*0xffc66c6d*/
    n3 = 0; /*0xffc66c75*/
    n2 = 0; /*0xffc66c77*/
    do /*0xffc66cae*/
    {
      DdrTrainFn_FFC66AE8((int)__return_address_1, n4, i, n2, 0xAu, 0x7Eu); /*0xffc66c8a*/
      DdrTrainFn_FFC66AE8((int)__return_address_1, n4, i, n2, 0xEu, 0xAu); /*0xffc66c9d*/
      n2 = ++n3; /*0xffc66ca7*/
    }
    while ( n3 < 3u ); /*0xffc66cae*/
    n2_2 = 0; /*0xffc66cb0*/
    n2_1 = 0; /*0xffc66cb2*/
    if ( __return_address_1[255496] ) /*0xffc66cb6*/
    {
      v16 = 351 * n4; /*0xffc66cbe*/
      do /*0xffc66d1f*/
      {
        if ( (__return_address_1[4 * n2_2 + 255705 + v16] & 1) != 0 ) /*0xffc66cd6*/
        {
          if ( n2_2 != 2 || __return_address_1[246412] || __return_address_1[246424] >= 3u ) /*0xffc66ced*/
            DdrTrainFn_FFC66AE8((int)__return_address_1, n4, i, n2_1, 0xFu, n8); /*0xffc66d07*/
          else
            DdrTrainFn_FFC66AE8((int)__return_address_1, n4, i, 2, 0xFu, 0); /*0xffc66cf5*/
          v16 = 351 * n4; /*0xffc66d0c*/
        }
        n2_1 = ++n2_2; /*0xffc66d15*/
      }
      while ( n2_2 < __return_address_1[255496] ); /*0xffc66d1f*/
    }
    i = ++v13; /*0xffc66d27*/
  }
  return 0; /*0xffc66d39*/
}

// Function: DdrTrainingFunc66D43 @ 0xffc66d43 (0x66a bytes)
// Index: 859/2560

int __cdecl DdrTrainingFunc66D43(char *__return_address, char *buf, unsigned __int8 n4)
{
  char *__return_address_1; // ebx
  int v4; // esi
  unsigned int v5; // edi
  unsigned __int8 n5_1; // cl
  int n4_1; // ebp
  int n5_2; // ebp
  bool v9; // cc
  char *v10; // eax
  char n3_1; // al
  char *p_n2; // ecx
  char *v13; // ebp
  int n6; // edx
  char v15; // al
  unsigned __int8 i_1; // ch
  unsigned __int8 i; // cl
  int n5_4; // ebp
  char v19; // cl
  char n32; // dl
  int n5; // esi
  char v22; // al
  unsigned __int8 *p_n2_1; // eax
  char n32_1; // bl
  int n6_1; // ecx
  unsigned __int8 n32_3; // al
  bool v27; // zf
  char n2_4; // cl
  unsigned int v29; // eax
  int v30; // edx
  unsigned int v31; // esi
  int v32; // ebp
  unsigned __int8 bufa_1; // cl
  int v34; // edi
  int v35; // eax
  int v36; // eax
  int v37; // eax
  int v38; // eax
  int bufb_1; // edx
  int n167788700; // [esp-8h] [ebp-44h]
  int v42; // [esp-4h] [ebp-40h]
  char n32_2; // [esp+10h] [ebp-2Ch]
  ... [10735 chars total]

// Function: DdrTrainingDispatch @ 0xffc673ad (0x44 bytes)
// Index: 860/2560

int __cdecl DdrTrainingDispatch(char *__return_address, char *n4, char *buf)
{
  DdrTrainFunc61EE((int)__return_address, n4, 1); /*0xffc673b9*/
  if ( __return_address[257105] || buf[108] ) /*0xffc673ce*/
    DdrTrainMultiPort(__return_address, n4, buf); /*0xffc673e5*/
  else
    DdrTrainSinglePort(__return_address, buf); /*0xffc673d6*/
  return 0; /*0xffc673ef*/
}

// Function: DdrTrainSinglePort @ 0xffc673f1 (0x2d bytes)
// Index: 861/2560

int __cdecl DdrTrainSinglePort(char *__return_address, char *buf)
{
  unsigned __int8 bufa; // [esp+10h] [ebp+Ch]

  bufa = buf[1]; /*0xffc673fb*/
  DdrTrainFunc6268(__return_address, (int)buf, bufa); /*0xffc67405*/
  DdrTrainingFunc66F0(__return_address, buf, bufa); /*0xffc67411*/
  return 0; /*0xffc6741b*/
}

// Function: DdrTrainMultiPort @ 0xffc6741e (0x6e bytes)
// Index: 862/2560

int __cdecl DdrTrainMultiPort(char *__return_address, char *n4, char *buf)
{
  char *n4_1; // eax
  unsigned __int8 n4_3; // bl
  unsigned __int8 n4_2; // [esp+4h] [ebp-4h]

  n4_1 = n4; /*0xffc67422*/
  n4_3 = 0; /*0xffc67426*/
  n4_2 = 0; /*0xffc67428*/
  do /*0xffc67483*/
  {
    if ( (*n4_1 & 1) != 0 && (*n4_1 & 0x60) == 0 ) /*0xffc67435*/
    {
      DdrTrainingFunc66F0(__return_address, buf, n4_2); /*0xffc67440*/
      DdrTrainFunc6268(__return_address, (int)buf, n4_2); /*0xffc6744e*/
      DdrTrainingFunc66D43(__return_address, buf, n4_2); /*0xffc6745c*/
      KtiPhyLinkSetup(__return_address, buf, n4_2); /*0xffc6746a*/
      n4_1 = n4; /*0xffc6746f*/
    }
    ++n4_3; /*0xffc67475*/
    n4_1 += 13; /*0xffc67477*/
    n4_2 = n4_3; /*0xffc6747a*/
    n4 = n4_1; /*0xffc6747d*/
  }
  while ( n4_3 < 4u ); /*0xffc67483*/
  return 0; /*0xffc67487*/
}

// Function: DdrTrainFn_FFC6748C @ 0xffc6748c (0x18a bytes)
// Index: 863/2560

int __cdecl DdrTrainFn_FFC6748C(_BYTE *__return_address, int a2, unsigned __int8 n4)
{
  int v3; // ecx
  signed int v4; // kr00_4
  int n15; // eax
  unsigned int n15_1; // esi
  unsigned __int8 v7; // bl
  int v8; // ecx
  int v9; // esi
  unsigned int v10; // ebp
  int v11; // eax
  int v12; // ecx
  int v13; // ebp
  unsigned int v14; // eax
  unsigned __int8 v16; // [esp+4h] [ebp-18h]
  unsigned int v17; // [esp+8h] [ebp-14h]
  int v18; // [esp+8h] [ebp-14h]
  int v19; // [esp+Ch] [ebp-10h]
  int v20; // [esp+10h] [ebp-Ch]
  int v21; // [esp+18h] [ebp-4h]

  v3 = 6 * n4; /*0xffc6749b*/
  v20 = v3; /*0xffc674a2*/
  if ( *(_BYTE *)(v3 + a2 + 298) == 2 ) /*0xffc674ae*/
  {
    v4 = 0x38u / *(unsigned __int8 *)(v3 + a2 + 297); /*0xffc674ce*/
    n15 = v4 / 4; /*0xffc674d0*/
    n15_1 = v4 - v4 / 4; /*0xffc674d4*/
    if ( (unsigned int)(v4 / 4) > 0xF ) /*0xffc674d8*/
      n15 = 15; /*0xffc674da*/
    if ( n15_1 > 0xF ) /*0xffc674de*/
      n15_1 = 15; /*0xffc674e0*/
    v7 = 0; /*0xffc674eb*/
    v8 = n15_1 | (16 * n15); /*0xffc674ed*/
    v16 = 0; /*0xffc674ef*/
    v9 = n15 | (16 * n15_1); /*0xffc674f6*/
    v21 = v8; /*0xffc674f8*/
    v19 = 351 * n4; /*0xffc67502*/
    if ( __return_address[v19 + 255719] ) /*0xffc67506*/
    {
      do /*0xffc67606*/
      {
        v17 = j_CpuIoWrite((int)__return_address, n4, v16, 16540) & 0xFFFFFF00; /*0xffc67538*/
        v10 = j_CpuIoWrite((int)__return_address, n4, v16, 16660) & 0xFFFFFF00; /*0xffc6754f*/
        if ( v7 >= *(_BYTE *)(v20 + a2 + 297) || !*(_BYTE *)(74 * n4 + a2) && *(_BYTE *)(74 * n4 + a2 + 37) == 1 ) /*0xffc6756e*/
        {
          v11 = v9; /*0xffc67578*/
          v12 = v9; /*0xffc6757a*/
        }
        else
        {
          v11 = v21; /*0xffc67570*/
          v12 = v21; /*0xffc67574*/
        }
        v13 = v11 | v10; /*0xffc6757c*/
        v18 = v12 | v17; /*0xffc67585*/
        RcAssertPrint(__return_address, 4u, (int)"  Cha%d credit %x\n", v7, v18); /*0xffc67595*/
        j_PciCfgWrite_0((int)__return_address, n4, v16, 16540, v18); /*0xffc675ac*/
        v14 = v13; /*0xffc675b4*/
        if ( !__return_address[246412] && __return_address[246424] < 3u && __return_address[v19 + 255719] > 0x10u ) /*0xffc675d4*/
          v14 = v13 & 0xFFFFFF00 | 0x11; /*0xffc675db*/
        j_PciCfgWrite_0((int)__return_address, n4, v16, 16660, v14); /*0xffc675ed*/
        v16 = ++v7; /*0xffc675fb*/
      }
      while ( v7 < __return_address[v19 + 255719] ); /*0xffc67606*/
    }
  }
  return 0; /*0xffc67611*/
}

// Function: DdrTrainFunc7616 @ 0xffc67616 (0x88 bytes)
// Index: 864/2560

int __cdecl DdrTrainFunc7616(int __return_address, char a2)
{
  char v2; // dh
  unsigned __int8 n4; // dl
  int v4; // esi
  unsigned int v5; // eax
  unsigned int v6; // ebx
  unsigned __int8 n4_1; // [esp+Fh] [ebp-5h]
  char v9; // [esp+13h] [ebp-1h]

  v2 = 0; /*0xffc6761d*/
  n4 = 0; /*0xffc6761f*/
  v4 = 0; /*0xffc67625*/
  v9 = 0; /*0xffc67627*/
  n4_1 = 0; /*0xffc6762a*/
  do /*0xffc6767f*/
  {
    if ( ((1 << v4) & *(_DWORD *)(__return_address + 246468)) != 0 ) /*0xffc6763a*/
    {
      v5 = j_CpuIoWrite(__return_address, n4_1, 0, 67321996); /*0xffc67647*/
      v6 = v5 >> 28; /*0xffc6764e*/
      RcAssertPrint( /*0xffc67660*/
        (_BYTE *)__return_address,
        8u,
        (int)"\n  qpi_allowed_cfclk_ratio_dis of Processor %u == 0x%x",
        v4,
        (v5 & 0x10000000) != 0);
      n4 = n4_1; /*0xffc6766b*/
      v2 = v6 & 1 | v9; /*0xffc67671*/
      v9 = v2; /*0xffc67673*/
    }
    ++n4; /*0xffc67676*/
    ++v4; /*0xffc67678*/
    n4_1 = n4; /*0xffc67679*/
  }
  while ( n4 < 4u ); /*0xffc6767f*/
  if ( a2 && (a2 != 1 || (v2 & 1) != 0) ) /*0xffc67691*/
    return -1; /*0xffc67693*/
  else
    return 0; /*0xffc67698*/
}

// Function: DdrTrainFunc769E @ 0xffc6769e (0xc9 bytes)
// Index: 865/2560

int __cdecl DdrTrainFunc769E(int __return_address, char a2)
{
  unsigned __int8 n4; // bh
  char v3; // bp
  int v4; // edx
  unsigned __int8 v5; // bl
  int v6; // eax
  unsigned __int8 n4_1; // [esp+10h] [ebp-Ch]
  unsigned __int8 v9; // [esp+14h] [ebp-8h]
  int v10; // [esp+18h] [ebp-4h]

  n4 = 0; /*0xffc676a3*/
  v3 = 0; /*0xffc676a5*/
  v4 = 0; /*0xffc676a8*/
  n4_1 = 0; /*0xffc676aa*/
  v10 = 0; /*0xffc676b3*/
  do /*0xffc67757*/
  {
    if ( ((1 << v3) & *(_DWORD *)(__return_address + 246468)) != 0 ) /*0xffc676c4*/
    {
      v5 = 0; /*0xffc676c6*/
      v9 = 0; /*0xffc676c8*/
      if ( *(_BYTE *)(__return_address + 255496) ) /*0xffc676cc*/
      {
        do /*0xffc6773d*/
        {
          if ( (*(_BYTE *)(v4 + 4 * v5 + __return_address + 255705) & 1) != 0 || *(_BYTE *)(__return_address + 8318) ) /*0xffc676e8*/
          {
            v6 = j_CpuIoWrite(__return_address, n4_1, v9, 151144448); /*0xffc67705*/
            j_PciCfgWrite_0(__return_address, n4_1, v9, 151144448, (2 * (a2 & 1 | (2 * (a2 & 1)))) | v6 & 0xFFFFFFF9); /*0xffc67725*/
            v4 = v10; /*0xffc6772a*/
          }
          v9 = ++v5; /*0xffc67733*/
        }
        while ( v5 < *(_BYTE *)(__return_address + 255496) ); /*0xffc6773d*/
        n4 = n4_1; /*0xffc6773f*/
      }
    }
    ++n4; /*0xffc67743*/
    v4 += 351; /*0xffc67745*/
    ++v3; /*0xffc6774b*/
    n4_1 = n4; /*0xffc6774c*/
    v10 = v4; /*0xffc67750*/
  }
  while ( n4 < 4u ); /*0xffc67757*/
  return 0; /*0xffc6775d*/
}

// Function: DdrTrainFunc7767 @ 0xffc67767 (0x189 bytes)
// Index: 866/2560

int __cdecl DdrTrainFunc7767(_BYTE *__return_address, unsigned __int8 n4, unsigned __int8 n2, int a4)
{
  char v6; // cl
  unsigned __int8 *p_n421009174; // edi
  bool v8; // zf
  _DWORD *v9; // edi
  unsigned __int8 n0x14; // bl
  unsigned __int8 *p_n421009174_1; // edx
  char v13; // cl
  unsigned int v14; // edi
  int n20; // ebx
  int n421009174; // [esp+10h] [ebp-10h] BYREF
  int *p_n421009174_2; // [esp+14h] [ebp-Ch]
  int n4_2; // [esp+18h] [ebp-8h]
  int v20; // [esp+1Ch] [ebp-4h]
  unsigned __int8 n2a; // [esp+2Ch] [ebp+Ch]
  unsigned __int8 n2b; // [esp+2Ch] [ebp+Ch]
  int n4_1; // [esp+30h] [ebp+10h]

  n421009174 = 421009174; /*0xffc6778a*/
  RcAssertPrint(__return_address, 8u, (int)"\n  Socket %u Port %u : EPARAM entry programmed\n", n4, n2);
  if ( *(_BYTE *)(a4 + 1) == 1 )
  {
    v6 = 0; /*0xffc677a4*/
    n4_1 = 4; /*0xffc677a6*/
    p_n421009174 = (unsigned __int8 *)&n421009174; /*0xffc677ae*/
    n2a = 0; /*0xffc677b2*/
    do /*0xffc677e6*/
    {
      ProcCommonFunc9618(__return_address, n4, n2, 63, *p_n421009174, (*(_DWORD *)(a4 + 7) >> v6) & 0x3F); /*0xffc677cd*/
      v6 = n2a + 8; /*0xffc677d9*/
      ++p_n421009174; /*0xffc677dc*/
      v8 = n4_1-- == 1; /*0xffc677dd*/
      n2a += 8; /*0xffc677e2*/
    }
    while ( !v8 ); /*0xffc677e6*/
    if ( *(_DWORD *)(a4 + 87) != 63 )
    {
      RcAssertPrint(
        __return_address,
        1u,
        (int)"\n\n %s: %u   %s ",
        "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiLinks.c",
        713,
        "(Ptr->CTLEPEAK[0] == ADAPTIVE_CTLE)");
      KtiDebugAssert((int)__return_address, 221, 4); /*0xffc67816*/
    }
  }
  else
  {
    v9 = (_DWORD *)(a4 + 7); /*0xffc67825*/
    n0x14 = 0; /*0xffc6782c*/
    LOBYTE(v20) = 0; /*0xffc6782e*/
    do /*0xffc67892*/
    {
      p_n421009174_1 = (unsigned __int8 *)&n421009174; /*0xffc67832*/
      n2b = 0; /*0xffc67836*/
      p_n421009174_2 = &n421009174; /*0xffc6783a*/
      v13 = 0; /*0xffc6783e*/
      n4_2 = 4; /*0xffc67840*/
      do /*0xffc67881*/
      {
        ProcCommonFunc9618(__return_address, n4, n2, v20, *p_n421009174_1, (*v9 >> v13) & 0x3F); /*0xffc67860*/
        v13 = n2b + 8; /*0xffc67870*/
        p_n421009174_1 = (unsigned __int8 *)p_n421009174_2 + 1; /*0xffc67873*/
        n2b += 8; /*0xffc67874*/
        v8 = n4_2-- == 1; /*0xffc67878*/
        p_n421009174_2 = (int *)((char *)p_n421009174_2 + 1); /*0xffc6787d*/
      }
      while ( !v8 ); /*0xffc67881*/
      ++n0x14; /*0xffc67883*/
      ++v9; /*0xffc67885*/
      LOBYTE(v20) = n0x14; /*0xffc67888*/
    }
    while ( n0x14 < 0x14u ); /*0xffc67892*/
    v14 = 0; /*0xffc67898*/
    n20 = 20; /*0xffc6789c*/
    do
    {
      if ( (unsigned __int8)(*(_DWORD *)(a4 + 4 * (v14 >> 2) + 87) >> (8 * (v14 & 3))) != 63 )
      {
        RcAssertPrint(
          __return_address,
          1u,
          (int)"\n\n %s: %u   %s ",
          "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiLinks.c",
          731,
          "(Data8 == ADAPTIVE_CTLE)");
        KtiDebugAssert((int)__return_address, 221, 4); /*0xffc678d8*/
      }
      ++v14; /*0xffc678e0*/
      --n20; /*0xffc678e1*/
    }
    while ( n20 );
  }
  return 0; /*0xffc678e6*/
}

// Function: DdrTrainFunc78F0 @ 0xffc678f0 (0x8b bytes)
// Index: 867/2560

int __cdecl DdrTrainFunc78F0(_BYTE *__return_address, int n4)
{
  unsigned __int8 n4_2; // bl
  int v3; // edi
  char v4; // al
  unsigned __int8 i_1; // bh
  unsigned __int8 i; // [esp+10h] [ebp-8h]
  int n4_1; // [esp+14h] [ebp-4h]

  RcAssertPrint(__return_address, 8u, (int)"\n  Force unused links to disabled/low power state."); /*0xffc67902*/
  n4_2 = 0; /*0xffc6790b*/
  LOBYTE(n4_1) = 0; /*0xffc67910*/
  v3 = 0; /*0xffc67914*/
  do /*0xffc67970*/
  {
    v4 = *(_BYTE *)(v3 + n4); /*0xffc67916*/
    if ( (v4 & 1) != 0 && (v4 & 0x60) == 0 ) /*0xffc6791f*/
    {
      i_1 = 0; /*0xffc67921*/
      for ( i = 0; i_1 < __return_address[255496]; i = i_1 ) /*0xffc67927*/
      {
        if ( (*(_BYTE *)(v3 + 4 * i_1 + n4 + 1) & 1) == 0 && !__return_address[8318] ) /*0xffc6793c*/
          DdrTrainFunc797B(__return_address, n4_1, i); /*0xffc6794e*/
        ++i_1; /*0xffc67956*/
      }
    }
    ++n4_2; /*0xffc67964*/
    v3 += 13; /*0xffc67966*/
    LOBYTE(n4_1) = n4_2; /*0xffc67969*/
  }
  while ( n4_2 < 4u ); /*0xffc67970*/
  return 0; /*0xffc67972*/
}

// Function: DdrTrainFunc797B @ 0xffc6797b (0x100 bytes)
// Index: 868/2560

int __cdecl DdrTrainFunc797B(_BYTE *__return_address, int n4, unsigned __int8 i)
{
  unsigned int v3; // esi
  int v4; // esi
  int v5; // esi
  char v7; // [esp+10h] [ebp-4h]

  v7 = j_CpuIoWrite((int)__return_address, n4, i, 151011616); /*0xffc679a1*/
  v3 = j_CpuIoWrite((int)__return_address, n4, i, 151077164) & 0xFFFFFFDF; /*0xffc679b3*/
  if ( (v7 & 0xF) == 3 )
  {
    v4 = v3 | 1; /*0xffc679c4*/
    RcAssertPrint(
      __return_address,
      8u,
      (int)"\n  Socket %u Port %u : KTIREUT_PH_CTR1 write 0x%x\n",
      (unsigned __int8)n4,
      i,
      v4);
    j_PciCfgWrite_0((int)__return_address, n4, i, 151077164, v4); /*0xffc679ea*/
    v5 = j_CpuIoWrite((int)__return_address, n4, i, 151077416) | 1; /*0xffc67a01*/
    RcAssertPrint(
      __return_address,
      8u,
      (int)"\n  Socket %u Port %u : KTIPHYPWRCTRL write 0x%x\n",
      (unsigned __int8)n4,
      i,
      v5);
    j_PciCfgWrite_0((int)__return_address, n4, i, 151077416, v5); /*0xffc67a26*/
  }
  else
  {
    RcAssertPrint(
      __return_address,
      8u,
      (int)"\n  Socket %u Port %u : KTIREUT_PH_CTR1 write 0x%x\n",
      (unsigned __int8)n4,
      i,
      v3);
    j_PciCfgWrite_0((int)__return_address, n4, i, 151077164, v3); /*0xffc67a4f*/
    if ( __return_address[257190] == 1 ) /*0xffc67a5e*/
      ProcCommonFuncA61D(__return_address, n4, (i << 8) | 0x7E, 0); /*0xffc67a6b*/
  }
  return 0; /*0xffc67a73*/
}

// Function: DdrTrainFunc7A7B @ 0xffc67a7b (0xce bytes)
// Index: 869/2560

int __cdecl DdrTrainFunc7A7B(int __return_address, _DWORD *p_n257175, _DWORD *p_buf)
{
  unsigned __int8 n4; // bl
  int v4; // edi
  int v5; // ebp
  unsigned __int8 v6; // bh
  unsigned __int8 v8; // [esp+10h] [ebp-Ch]
  unsigned __int8 n4_1; // [esp+14h] [ebp-8h]
  int v10; // [esp+18h] [ebp-4h]

  *p_n257175 = -1; /*0xffc67a85*/
  n4 = 0; /*0xffc67a88*/
  v4 = 0; /*0xffc67a93*/
  n4_1 = 0; /*0xffc67a95*/
  *p_buf = -1; /*0xffc67a99*/
  v5 = 0; /*0xffc67a9c*/
  v10 = 0; /*0xffc67a9e*/
  do /*0xffc67b39*/
  {
    if ( ((1 << v4) & *(_DWORD *)(__return_address + 246468)) != 0 ) /*0xffc67aaf*/
    {
      v6 = 0; /*0xffc67ab1*/
      v8 = 0; /*0xffc67ab3*/
      if ( *(_BYTE *)(__return_address + 255496) ) /*0xffc67ab7*/
      {
        do /*0xffc67b1f*/
        {
          if ( (*(_BYTE *)(v5 + 4 * v6 + __return_address + 255705) & 1) != 0 || *(_BYTE *)(__return_address + 8318) ) /*0xffc67ad9*/
          {
            *p_n257175 &= j_CpuIoWrite(__return_address, n4_1, v8, 151011456); /*0xffc67af5*/
            *p_buf &= j_CpuIoWrite(__return_address, n4_1, v8, 151077160); /*0xffc67b11*/
          }
          v8 = ++v6; /*0xffc67b15*/
        }
        while ( v6 < *(_BYTE *)(__return_address + 255496) ); /*0xffc67b1f*/
        v4 = v10; /*0xffc67b21*/
      }
    }
    ++n4; /*0xffc67b25*/
    v5 += 351; /*0xffc67b27*/
    ++v4; /*0xffc67b2d*/
    n4_1 = n4; /*0xffc67b2e*/
    v10 = v4; /*0xffc67b32*/
  }
  while ( n4 < 4u ); /*0xffc67b39*/
  return 0; /*0xffc67b3f*/
}

// Function: DdrTrainFunc7B49 @ 0xffc67b49 (0x55 bytes)
// Index: 870/2560

bool __cdecl DdrTrainFunc7B49(int __return_address)
{
  unsigned __int8 n4; // bh
  char v2; // bl
  char v3; // si
  unsigned __int8 n4_1; // [esp+Ch] [ebp-4h]

  n4 = 0; /*0xffc67b4f*/
  v2 = 0; /*0xffc67b51*/
  v3 = 0; /*0xffc67b57*/
  n4_1 = 0; /*0xffc67b59*/
  do /*0xffc67b8e*/
  {
    if ( ((1 << v3) & *(_DWORD *)(__return_address + 246468)) != 0 ) /*0xffc67b69*/
      v2 |= (j_CpuIoWrite(__return_address, n4_1, 0, 67321996) & 0x10000000) != 0; /*0xffc67b83*/
    ++n4; /*0xffc67b85*/
    ++v3; /*0xffc67b87*/
    n4_1 = n4; /*0xffc67b88*/
  }
  while ( n4 < 4u ); /*0xffc67b8e*/
  return (v2 & 1) == 0; /*0xffc67b92*/
}

// Function: DdrTrainFunc7B9E @ 0xffc67b9e (0x13a bytes)
// Index: 871/2560

int __cdecl DdrTrainFunc7B9E(_BYTE *__return_address, int n4)
{
  unsigned __int8 n4_1; // bl
  int v3; // ecx
  int v4; // edi
  char v5; // al
  unsigned __int8 v6; // bh
  int v7; // eax
  int v8; // eax
  int v9; // eax
  unsigned __int8 n4_2; // [esp+10h] [ebp-18h]
  int v12; // [esp+14h] [ebp-14h]
  unsigned __int8 v13; // [esp+18h] [ebp-10h]
  int v14; // [esp+20h] [ebp-8h]
  int v15; // [esp+24h] [ebp-4h]

  n4_1 = 0; /*0xffc67ba8*/
  v3 = 0; /*0xffc67baa*/
  n4_2 = 0; /*0xffc67bac*/
  v12 = 0; /*0xffc67bb1*/
  v4 = 0; /*0xffc67bb5*/
  do
  {
    v5 = *(_BYTE *)(v4 + n4); /*0xffc67bbb*/
    if ( (v5 & 1) != 0 && (v5 & 0x60) == 0 )
    {
      v6 = 0; /*0xffc67bce*/
      v13 = 0; /*0xffc67bd0*/
      if ( __return_address[255496] )
      {
        do
        {
          v15 = v4 + 4 * v6; /*0xffc67bee*/
          if ( (*(_BYTE *)(n4 + v15 + 1) & 1) == 0 && !__return_address[8318] )
          {
            v7 = j_CpuIoWrite((int)__return_address, n4_2, v13, 151077416); /*0xffc67c11*/
            if ( (v7 & 1) == 0 )
            {
              v14 = v7 | 1; /*0xffc67c25*/
              RcAssertPrint(
                __return_address,
                8u,
                (int)"\n  Socket %u Port %u : KTIPHYPWRCTRL write 0x%x\n",
                v12,
                v6,
                v7 | 1);
              j_PciCfgWrite_0((int)__return_address, n4_2, v13, 151077416, v14); /*0xffc67c49*/
            }
          }
          if ( (*(_BYTE *)(v15 + n4 + 1) & 1) != 0 || __return_address[8318] == 1 ) /*0xffc67c67*/
          {
            v8 = j_CpuIoWrite((int)__return_address, n4_2, v13, 151144448); /*0xffc67c74*/
            if ( __return_address[255479] == 1 ) /*0xffc67c83*/
              v9 = v8 & 0xFFFFFFF9; /*0xffc67c85*/
            else
              v9 = v8 | 6; /*0xffc67c8a*/
            j_PciCfgWrite_0((int)__return_address, n4_2, v13, 151144448, v9); /*0xffc67c99*/
          }
          v13 = ++v6; /*0xffc67ca3*/
        }
        while ( v6 < __return_address[255496] );
        v3 = v12; /*0xffc67cb3*/
      }
    }
    ++n4_1; /*0xffc67cb7*/
    v4 += 13; /*0xffc67cb9*/
    ++v3; /*0xffc67cbc*/
    n4_2 = n4_1; /*0xffc67cbd*/
    v12 = v3; /*0xffc67cc1*/
  }
  while ( n4_1 < 4u );
  return 0; /*0xffc67cce*/
}

// Function: DdrTrainFunc7CD8 @ 0xffc67cd8 (0x14e bytes)
// Index: 872/2560

int __cdecl DdrTrainFunc7CD8(_BYTE *__return_address, int n4, int buf)
{
  int n4_1; // ebx
  const char *Single_Socket__no_KTI_Links_to_transition; // eax

  KtiDebugPrint(255, 255, 255, 171, 0, (int)__return_address); /*0xffc67cef*/
  if ( __return_address[8313] == 1 && (*(_BYTE *)(buf + 140) == 1 || __return_address[8318]) ) /*0xffc67d11*/
  {
    RcAssertPrint(__return_address, 8u, (int)"\n\n  Clearing KTI DFX Locks\n"); /*0xffc67d29*/
    DdrTrainFunc769E((int)__return_address, 0); /*0xffc67d31*/
    RcAssertPrint(__return_address, 8u, (int)"\n\n  Setting Late Action Disable bit for each socket/link\n"); /*0xffc67d3d*/
    DdrTrainFn_FFC68653((int)__return_address, 0, 1); /*0xffc67d47*/
    RcAssertPrint(__return_address, 8u, (int)"\n\n  ******       Phy init      - START ******\n"); /*0xffc67d53*/
    KtiDebugPrint(255, 255, 255, 171, 1, (int)__return_address); /*0xffc67d63*/
    n4_1 = n4; /*0xffc67d68*/
    DdrTrainFn_FFC69445(__return_address, n4, buf); /*0xffc67d72*/
    DdrTrainFn_FFC68AB1((int)__return_address, n4, 0); /*0xffc67d7b*/
    RcAssertPrint(__return_address, 8u, (int)"\n\n  ******       Phy init      - END   ******"); /*0xffc67d87*/
    RcAssertPrint(__return_address, 8u, (int)"\n\n  ******       LL init       - START ******\n"); /*0xffc67d93*/
    KtiDebugPrint(255, 255, 255, 171, 2, (int)__return_address); /*0xffc67da8*/
    DdrTrainFn_FFC6872A((int)__return_address, buf); /*0xffc67db4*/
    RcAssertPrint(__return_address, 8u, (int)"\n\n  ******       LL init       - END   ******\n"); /*0xffc67dc0*/
    RcAssertPrint(__return_address, 8u, (int)"\n  Clearing Late Action Disable bit for each socket/link\n"); /*0xffc67dcc*/
    DdrTrainFn_FFC68653((int)__return_address, 0, 0); /*0xffc67dd6*/
    __return_address[246400] |= 2u; /*0xffc67dde*/
  }
  else
  {
    Single_Socket__no_KTI_Links_to_transition = "Single Socket, no KTI Links to transition"; /*0xffc67dec*/
    if ( *(_BYTE *)(buf + 99) != 1 ) /*0xffc67df1*/
      Single_Socket__no_KTI_Links_to_transition = "Full speed transition not requested"; /*0xffc67df3*/
    RcAssertPrint(__return_address, 4u, (int)"\n  %s", Single_Socket__no_KTI_Links_to_transition); /*0xffc67e01*/
    n4_1 = n4; /*0xffc67e06*/
    DdrTrainFunc78F0(__return_address, n4); /*0xffc67e0d*/
  }
  DdrTrainFn_FFC6937D(__return_address, n4_1, buf); /*0xffc67e18*/
  return 0; /*0xffc67e22*/
}

// Function: Assert @ 0xffc67e26 (0x2c8 bytes)
// Index: 873/2560

int __cdecl Assert(_BYTE *__return_address, _BYTE *n4, _BYTE *buf)
{
  _BYTE *n4_1; // edx
  int v4; // ecx
  char v6; // bl
  int v7; // edi
  int n4_2; // eax
  int v9; // ebp
  unsigned __int8 v10; // al
  int v11; // edi
  unsigned __int8 v12; // bl
  int v13; // eax
  int v14; // ebx
  int v15; // ecx
  unsigned int v16; // ecx
  int v17; // ecx
  unsigned int v18; // ecx
  int v19; // ecx
  unsigned int v20; // ecx
  unsigned int v21; // ecx
  unsigned __int8 v22; // bh
  int v23; // ecx
  _BYTE *v24; // eax
  char v26; // [esp+13h] [ebp-15h]
  int v27; // [esp+14h] [ebp-14h]
  int v28; // [esp+18h] [ebp-10h]
  int v29; // [esp+1Ch] [ebp-Ch]
  int n4_3; // [esp+20h] [ebp-8h]
  char v31; // [esp+2Ch] [ebp+4h]

  n4_1 = n4; /*0xffc67e29*/
  v4 = 0; /*0xffc67e2d*/
  v6 = 0; /*0xffc67e36*/
  v7 = 0; /*0xffc67e3b*/
  v26 = 0; /*0xffc67e3d*/
  n4_2 = 4; /*0xffc67e41*/
  v27 = 0; /*0xffc67e42*/
  v9 = 0; /*0xffc67e46*/
  v29 = 0; /*0xffc67e48*/
  n4_3 = 4; /*0xffc67e4c*/
  do /*0xffc680b9*/
  {
    if ( (n4_1[v9] & 1) != 0 ) /*0xffc67e54*/
    {
      v10 = 0; /*0xffc67e5a*/
      v31 = 0; /*0xffc67e5c*/
      if ( __return_address[255496] ) /*0xffc67e60*/
      {
        do /*0xffc6808f*/
        {
          v28 = v10; /*0xffc67e6f*/
          v11 = v9 + 4 * v10; /*0xffc67e7a*/
          if ( (n4_1[v11 + 1] & 1) != 0 ) /*0xffc67e81*/
          {
            v12 = buf[2 * v29 + 142 + 2 * v10]; /*0xffc67e9b*/
            if ( ((v12 /*0xffc67ec3*/
                 ^ buf[18 * ((*(_DWORD *)&n4_1[v11 + 1] >> 1) & 7) + 142 + 2 * ((*(_DWORD *)&n4_1[v11 + 1] >> 6) & 0xF)])
                & 1) != 0 )
            {
              v26 = 1; /*0xffc67ecc*/
              buf[2 * v29 + 142 + 2 * v10] = v12 | 1; /*0xffc67ed1*/
              v13 = ((*(_DWORD *)&n4_1[v11 + 1] >> 6) & 0xF) + 9 * ((*(_DWORD *)&n4_1[v11 + 1] >> 1) & 7); /*0xffc67eec*/
              buf[2 * v13 + 142] |= 1u; /*0xffc67ef2*/
            }
            v14 = v27 + 4 * v28; /*0xffc67f06*/
            v15 = *(_DWORD *)&__return_address[v14 + 8418]; /*0xffc67f22*/
            if ( (((unsigned __int8)v15 /*0xffc67f2d*/
                 ^ __return_address[15 * ((*(_DWORD *)&n4_1[v11 + 1] >> 1) & 7)
                                  + 8418
                                  + 4 * ((*(_DWORD *)&n4_1[v11 + 1] >> 6) & 0xF)])
                & 3) != 0 )
            {
              v26 = 1; /*0xffc67f32*/
              *(_DWORD *)&__return_address[v14 + 8418] = v15 & 0xFFFFFFFC; /*0xffc67f37*/
              v16 = *(_DWORD *)&n4_1[v11 + 1]; /*0xffc67f42*/
              *(_DWORD *)&__return_address[15 * ((v16 >> 1) & 7) + 8418 + 4 * ((v16 >> 6) & 0xF)] &= 0xFFFFFFFC; /*0xffc67f54*/
            }
            v17 = *(_DWORD *)&__return_address[v14 + 8418]; /*0xffc67f79*/
            if ( (((unsigned __int8)v17 /*0xffc67f84*/
                 ^ __return_address[15 * ((*(_DWORD *)&n4_1[v11 + 1] >> 1) & 7)
                                  + 8418
                                  + 4 * ((*(_DWORD *)&n4_1[v11 + 1] >> 6) & 0xF)])
                & 0xC) != 0 )
            {
              v26 = 1; /*0xffc67f89*/
              *(_DWORD *)&__return_address[v14 + 8418] = v17 & 0xFFFFFFF3; /*0xffc67f8e*/
              v18 = *(_DWORD *)&n4_1[v11 + 1]; /*0xffc67f99*/
              *(_DWORD *)&__return_address[15 * ((v18 >> 1) & 7) + 8418 + 4 * ((v18 >> 6) & 0xF)] &= 0xFFFFFFF3; /*0xffc67fab*/
            }
            v19 = *(_DWORD *)&__return_address[v14 + 8418]; /*0xffc67fd0*/
            if ( (((unsigned __int8)v19 /*0xffc67fdb*/
                 ^ __return_address[15 * ((*(_DWORD *)&n4_1[v11 + 1] >> 1) & 7)
                                  + 8418
                                  + 4 * ((*(_DWORD *)&n4_1[v11 + 1] >> 6) & 0xF)])
                & 0x30) != 0 )
            {
              *(_DWORD *)&__return_address[v14 + 8418] = v19 & 0xFFFFFFCF; /*0xffc67fe0*/
              v6 = 1; /*0xffc67fe7*/
              v20 = *(_DWORD *)&n4_1[v11 + 1]; /*0xffc67fed*/
              v26 = 1; /*0xffc67ffd*/
              *(_DWORD *)&__return_address[15 * ((v20 >> 1) & 7) + 8418 + 4 * ((v20 >> 6) & 0xF)] &= 0xFFFFFFCF; /*0xffc68003*/
            }
            else
            {
              v6 = v26; /*0xffc6800d*/
            }
            v21 = *(_DWORD *)&n4_1[v11 + 1]; /*0xffc68019*/
            n4_1 = n4; /*0xffc6801d*/
            v22 = __return_address[v28 + 8430 + v27]; /*0xffc68021*/
            if ( ((v22 ^ __return_address[15 * ((v21 >> 1) & 7) + 8430 + ((v21 >> 6) & 0xF)]) & 3) != 0 ) /*0xffc68046*/
            {
              v6 = 1; /*0xffc68053*/
              v26 = 1; /*0xffc68055*/
              __return_address[v27 + 8430 + v28] = v22 & 0xFC; /*0xffc68059*/
              v23 = (*(_DWORD *)&n4[v11 + 1] >> 6) & 0xF; /*0xffc68073*/
              v24 = &__return_address[15 * ((*(_DWORD *)&n4[v11 + 1] >> 1) & 7) + 8430]; /*0xffc68079*/
              v24[v23] &= 0xFCu; /*0xffc6807b*/
            }
            v10 = v31; /*0xffc6807f*/
          }
          v31 = ++v10; /*0xffc68085*/
        }
        while ( v10 < __return_address[255496] ); /*0xffc6808f*/
        v4 = v27; /*0xffc68095*/
        v7 = v29; /*0xffc68099*/
      }
      n4_2 = n4_3; /*0xffc6809d*/
    }
    v7 += 9; /*0xffc680a1*/
    v4 += 15; /*0xffc680a4*/
    v9 += 13; /*0xffc680a7*/
    v29 = v7; /*0xffc680aa*/
    --n4_2; /*0xffc680ae*/
    v27 = v4; /*0xffc680b1*/
    n4_3 = n4_2; /*0xffc680b5*/
  }
  while ( n4_2 ); /*0xffc680b9*/
  if ( v6 == 1 )
  {
    ProcCommonFunc940C(__return_address, 0xFFu, 0xFFu, 0xFFu, 4u); /*0xffc680cf*/
    RcAssertPrint(
      __return_address,
      2u,
      (int)"\n WARNING:   One or more per Link option mismatch detected. Forcing to common setting.  \n");
  }
  return 0; /*0xffc680e4*/
}

// Function: KtiSelectFreq @ 0xffc680ee (0x467 bytes)
// Index: 874/2560

int __cdecl KtiSelectFreq(_BYTE *__return_address, _BYTE *n4, int buf)
{
  _BYTE *buf_1; // edi
  char n5; // al
  int v5; // edx
  char n2; // al
  _BYTE *n4_1; // ebp
  int v8; // eax
  unsigned __int8 buf_2; // al
  unsigned __int8 n4_3; // cl
  _BYTE *n4_2; // edi
  unsigned __int8 n2_2; // ah
  int v13; // ecx
  char v14; // al
  int n2_4; // edx
  unsigned __int8 n4_4; // cl
  int v17; // edi
  unsigned __int8 v18; // bl
  unsigned __int8 v19; // dl
  unsigned int v20; // eax
  unsigned int v21; // ecx
  unsigned __int8 n2_1; // [esp+6h] [ebp-16h]
  char v24; // [esp+7h] [ebp-15h]
  unsigned __int8 n4_5; // [esp+8h] [ebp-14h]
  unsigned __int8 v26; // [esp+8h] [ebp-14h]
  int v27; // [esp+Ch] [ebp-10h]
  int v28; // [esp+10h] [ebp-Ch]
  int n2_3; // [esp+14h] [ebp-8h]
  int v30; // [esp+14h] [ebp-8h]
  unsigned int p_n257175; // [esp+18h] [ebp-4h] BYREF

  buf_1 = (_BYTE *)buf; /*0xffc680f2*/
  if ( *(_BYTE *)(buf + 140) != 1 ) /*0xffc680fd*/
    return 0; /*0xffc680fd*/
  DdrTra... [8191 chars total]

// Function: DebugLogPrint_7 @ 0xffc68555 (0xfe bytes)
// Index: 875/2560

int __cdecl DebugLogPrint_7(_BYTE *__return_address, int n4, int n2, char a4)
{
  int v5; // [esp+4h] [ebp-84h]
  _BYTE v6[128]; // [esp+8h] [ebp-80h] BYREF

  LOBYTE(v5) = 0; /*0xffc68572*/
  if ( !a4 ) /*0xffc68577*/
    LOBYTE(v5) = __return_address[3 * (unsigned __int8)n4 + 257175 + (unsigned __int8)n2]; /*0xffc68593*/
  if ( KtiFunc7890((int)__return_address, n4, n2, v5, (int)v6) )
  {
    KtiDebugPrint((unsigned __int8)(1 << n4), 0, (unsigned __int8)(1 << n2), 221, 3, (int)__return_address); /*0xffc685eb*/
    RcAssertPrint( /*0xffc685fa*/
      __return_address,
      1u,
      (int)"\n\n***** KTI Electrical Parameters for CPU%u  Link %u is not found**** \n",
      (unsigned __int8)n4,
      (unsigned __int8)n2);
    RcAssertPrint(
      __return_address,
      1u,
      (int)"\n\n %s: %u   %s ",
      "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiLinks.c",
      1654,
      "FALSE");
    KtiDebugAssert((int)__return_address, 221, 3); /*0xffc68622*/
  }
  DdrTrainFunc7767(__return_address, n4, n2, (int)v6); /*0xffc68641*/
  return 0; /*0xffc6864b*/
}

// Function: DdrTrainFn_FFC68653 @ 0xffc68653 (0x97 bytes)
// Index: 876/2560

int __cdecl DdrTrainFn_FFC68653(int __return_address, int i, char a3)
{
  unsigned __int8 n4_1; // bl
  char v4; // di
  int v5; // ebp
  unsigned __int8 ia_1; // bh
  unsigned __int8 n4; // [esp-4h] [ebp-4h]
  unsigned __int8 ia; // [esp+8h] [ebp+8h]

  if ( !i ) /*0xffc68659*/
  {
    n4_1 = 0; /*0xffc68666*/
    v4 = 0; /*0xffc68669*/
    n4 = 0; /*0xffc6866b*/
    v5 = 0; /*0xffc6866f*/
    do /*0xffc686e0*/
    {
      if ( ((1 << v4) & *(_DWORD *)(__return_address + 246468)) != 0 ) /*0xffc6867e*/
      {
        ia_1 = 0; /*0xffc68680*/
        for ( ia = 0; ia_1 < *(_BYTE *)(__return_address + 255496); ia = ia_1 ) /*0xffc68686*/
        {
          if ( (*(_BYTE *)(v5 + 4 * ia_1 + __return_address + 255705) & 1) != 0 || *(_BYTE *)(__return_address + 8318) ) /*0xffc686a4*/
            KtiPhyCtrlBitSet(__return_address, n4, ia, a3); /*0xffc686ba*/
          ++ia_1; /*0xffc686c2*/
        }
      }
      ++n4_1; /*0xffc686d0*/
      v5 += 351; /*0xffc686d2*/
      ++v4; /*0xffc686d8*/
      n4 = n4_1; /*0xffc686d9*/
    }
    while ( n4_1 < 4u ); /*0xffc686e0*/
  }
  return 0; /*0xffc686e9*/
}

// Function: KtiPhyCtrlBitSet @ 0xffc686ea (0x40 bytes)
// Index: 877/2560

int __cdecl KtiPhyCtrlBitSet(int __return_address, unsigned __int8 n4, unsigned __int8 i, char a4)
{
  int v4; // eax

  v4 = j_CpuIoWrite(__return_address, n4, i, 151077164); /*0xffc686fd*/
  j_PciCfgWrite_0(__return_address, n4, i, 151077164, ((a4 & 1) << 12) | v4 & 0xFFFFEFFF); /*0xffc6871d*/
  return 0; /*0xffc68727*/
}

// Function: DdrTrainFn_FFC6872A @ 0xffc6872a (0xfb bytes)
// Index: 878/2560

int __cdecl DdrTrainFn_FFC6872A(int n4, int buf)
{
  unsigned __int8 *v3; // edi
  unsigned __int8 n4a_1; // dl
  char v5; // bl
  char v6; // bp
  int v7; // ebx
  unsigned __int8 v8; // bl
  int v9; // ecx
  unsigned __int8 n2; // [esp+10h] [ebp-10h]
  unsigned __int8 v12; // [esp+14h] [ebp-Ch]
  int v13; // [esp+1Ch] [ebp-4h]
  unsigned __int8 n4a; // [esp+24h] [ebp+4h]

  v3 = (unsigned __int8 *)(n4 + 255718); /*0xffc68743*/
  n4a_1 = 0; /*0xffc6874c*/
  v5 = (*(_BYTE *)(n4 + 257193) == 1) - 1; /*0xffc6874e*/
  n4a = 0; /*0xffc6874f*/
  v6 = 0; /*0xffc68756*/
  v7 = (v5 & 0x12) + 48; /*0xffc68758*/
  v13 = v7; /*0xffc6875d*/
  do /*0xffc68815*/
  {
    if ( ((1 << v6) & *(_DWORD *)(n4 + 246468)) != 0 ) /*0xffc68772*/
    {
      n2 = 0; /*0xffc6877f*/
      if ( *(_BYTE *)(n4 + 255496) ) /*0xffc68778*/
      {
        v8 = 0; /*0xffc68786*/
        v9 = -255718 - n4; /*0xffc6878a*/
        do /*0xffc687c9*/
        {
          if ( (v3[4 * v8 + 255705 + v9 + n4] & 1) != 0 ) /*0xffc6879e*/
          {
            DdrTrainFn_FFC68825((_BYTE *)n4, buf, n4a, n2); /*0xffc687b1*/
            v9 = -255718 - n4; /*0xffc687b6*/
          }
          n2 = ++v8; /*0xffc687bf*/
        }
        while ( v8 < *(_BYTE *)(n4 + 255496) ); /*0xffc687c9*/
        v7 = v13; /*0xffc687cb*/
        n4a_1 = n4a; /*0xffc687cf*/
      }
      v12 = 0; /*0xffc687d6*/
      if ( *v3 ) /*0xffc687d3*/
      {
        do /*0xffc687ff*/
          DdrTrainFn_FFC68996((_BYTE *)n4, buf, n4a, v12++, v7); /*0xffc687eb*/
        while ( v12 < *v3 ); /*0xffc687ff*/
        n4a_1 = n4a; /*0xffc68801*/
      }
    }
    ++n4a_1; /*0xffc68805*/
    v3 += 351; /*0xffc68807*/
    ++v6; /*0xffc6880d*/
    n4a = n4a_1; /*0xffc6880e*/
  }
  while ( n4a_1 < 4u ); /*0xffc68815*/
  return 0; /*0xffc6881b*/
}

// Function: DdrTrainFn_FFC68825 @ 0xffc68825 (0x171 bytes)
// Index: 879/2560

int __cdecl DdrTrainFn_FFC68825(_BYTE *n4, int buf, unsigned __int8 n4a, unsigned __int8 n2)
{
  int v4; // eax
  int v5; // esi
  unsigned int n2_1; // eax
  int v7; // esi
  unsigned __int8 n127; // al
  unsigned int v9; // esi

  v4 = j_CpuIoWrite((int)n4, n4a, n2, 151011460); /*0xffc6883c*/
  v5 = ((unsigned __int16)v4 ^ (unsigned __int16)((unsigned __int8)n4[257192] << 14)) & 0xC000 ^ v4; /*0xffc6885e*/
  n2_1 = *(_DWORD *)&n4[15 * n4a + 8418 + 4 * n2] & 3; /*0xffc68873*/
  if ( n2_1 < 2 ) /*0xffc68879*/
    v5 = (n2_1 << 14) | v5 & 0xFFFF3FFF; /*0xffc68884*/
  RcAssertPrint(n4, 8u, (int)"\n  Socket %u Port %u : KTILCL write 0x%x\n", n4a, n2, v5);
  j_PciCfgWrite_0((int)n4, n4a, n2, 151011460, v5); /*0xffc688a2*/
  v7 = j_CpuIoWrite((int)n4, n4a, n2, 151011464); /*0xffc688ba*/
  n127 = *(_BYTE *)(buf + 2 * (n2 + 9 * n4a) + 142) >> 1; /*0xffc688d0*/
  if ( n127 ) /*0xffc688d4*/
  {
    if ( n127 == 127 ) /*0xffc688d9*/
    {
      if ( n4[257193] == 1 ) /*0xffc68921*/
      {
LABEL_7:
        v9 = v7 & 0xFFFFFF00 | 0x30; /*0xffc688e8*/
        goto LABEL_15; /*0xffc688f1*/
      }
      goto LABEL_10; /*0xffc68921*/
    }
    if ( n127 > 0x30u && n4[257193] == 1 ) /*0xffc688e6*/
      goto LABEL_7; /*0xffc688e6*/
    if ( n127 > 0x42u && !n4[257193] ) /*0xffc688f7*/
    {
LABEL_10:
      v9 = v7 & 0xFFFFFF00 | 0x42; /*0xffc68900*/
      goto LABEL_15; /*0xffc68909*/
    }
    v9 = (*(unsigned __int8 *)(buf + 2 * (n2 + 9 * n4a) + 142) >> 1) | v7 & 0xFFFFFF00; /*0xffc68916*/
  }
  else
  {
    v9 = v7 & 0xFFFFFF00; /*0xffc68925*/
  }
LABEL_15:
  if ( n4[257193] == 1 ) /*0xffc68932*/
    v9 |= 0x4000000u; /*0xffc68934*/
  if ( n4[n4a + 257244] == 1 && n2 == 2 ) /*0xffc68947*/
    v9 = j_CpuIoWrite((int)n4, n4a, 2u, 151011464) & 0xF80FC700 | 0x4B; /*0xffc68965*/
  RcAssertPrint(n4, 8u, (int)"\n  Socket %u Port %u : KTILCCL write 0x%x\n", n4a, n2, v9);
  j_PciCfgWrite_0((int)n4, n4a, n2, 151011464, v9); /*0xffc68987*/
  return 0; /*0xffc68991*/
}

// Function: DdrTrainFn_FFC68996 @ 0xffc68996 (0x11b bytes)
// Index: 880/2560

int __cdecl DdrTrainFn_FFC68996(_BYTE *n4, int buf, unsigned __int8 n4a, unsigned __int8 a4, int a5)
{
  int v5; // eax
  int v6; // eax

  if ( n4[257193] && n4[257105] >= 4u && !n4[246412] && n4[246424] >= 3u ) /*0xffc689c8*/
  {
    v5 = j_CpuIoWrite((int)n4, n4a, a4, 167788888); /*0xffc689d3*/
    j_PciCfgWrite_0((int)n4, n4a, a4, 167788888, v5 | 0x80000000); /*0xffc689e2*/
    v6 = j_CpuIoWrite((int)n4, n4a, a4, 167788892); /*0xffc689ee*/
    j_PciCfgWrite_0((int)n4, n4a, a4, 167788892, v6 | 0x80000000); /*0xffc689fd*/
  }
  j_PciCfgWrite_0((int)n4, n4a, a4, 167788912, a5 | 0x99999980); /*0xffc68a1d*/
  j_PciCfgWrite_0((int)n4, n4a, a4, 167788912, a5 | 0x11111100); /*0xffc68a34*/
  j_PciCfgWrite_0((int)n4, n4a, a4, 167788916, -1717987072); /*0xffc68a49*/
  j_PciCfgWrite_0((int)n4, n4a, a4, 167788916, 286331136); /*0xffc68a5e*/
  j_PciCfgWrite_0((int)n4, n4a, a4, 167788920, a5 | 0x99999980); /*0xffc68a73*/
  j_PciCfgWrite_0((int)n4, n4a, a4, 167788920, a5 | 0x11111100); /*0xffc68a81*/
  j_PciCfgWrite_0((int)n4, n4a, a4, 167788924, -1717987072); /*0xffc68a94*/
  j_PciCfgWrite_0((int)n4, n4a, a4, 167788924, 286331136); /*0xffc68aa2*/
  return 0; /*0xffc68aac*/
}

// Function: DdrTrainFn_FFC68AB1 @ 0xffc68ab1 (0x163 bytes)
// Index: 881/2560

int __cdecl DdrTrainFn_FFC68AB1(int __return_address, int n4, int n2)
{
  int n4_3; // ecx
  unsigned __int8 n4_2; // dl
  int v5; // edi
  int v6; // ebp
  unsigned __int8 v7; // al
  int v8; // ebx
  int n4_1; // [esp-4h] [ebp-4h]

  n4_1 = n4_3; /*0xffc68ab1*/
  if ( !(_BYTE)n2 ) /*0xffc68ab7*/
  {
    n4_2 = 0; /*0xffc68ac4*/
    v5 = 0; /*0xffc68ac7*/
    LOBYTE(n4_1) = 0; /*0xffc68ac9*/
    v6 = 0; /*0xffc68acd*/
    do /*0xffc68c06*/
    {
      if ( ((1 << v5) & *(_DWORD *)(__return_address + 246468)) != 0 ) /*0xffc68adc*/
      {
        v7 = 0; /*0xffc68ae2*/
        LOBYTE(n2) = 0; /*0xffc68ae4*/
        if ( *(_BYTE *)(__return_address + 255496) ) /*0xffc68ae8*/
        {
          do /*0xffc68bec*/
          {
            v8 = v7; /*0xffc68af4*/
            if ( (*(_BYTE *)(v6 + 4 * v7 + __return_address + 255705) & 1) != 0 || *(_BYTE *)(__return_address + 8318) ) /*0xffc68b0a*/
            {
              RcAssertPrint( /*0xffc68b51*/
                (_BYTE *)__return_address,
                8u,
                (int)"\n  ****** S%dp%d Program Eparams - START ******\n",
                v5,
                v7);
              DebugLogPrint_7((_BYTE *)__return_address, n4_1, n2, 0); /*0xffc68b61*/
              RcAssertPrint( /*0xffc68b70*/
                (_BYTE *)__return_address,
                8u,
                (int)"\n  ****** S%dp%d Program Eparams - END ******\n",
                v5,
                v8);
              RcAssertPrint( /*0xffc68b7f*/
                (_BYTE *)__return_address,
                8u,
                (int)"\n  ****** S%dp%d Program Phy Control Regs - START ******\n",
                v5,
                v8);
              KtiPhyCtrlRegWrite((_BYTE *)__return_address, n4, n4_1, n2); /*0xffc68b96*/
              RcAssertPrint( /*0xffc68ba5*/
                (_BYTE *)__return_address,
                8u,
                (int)"\n  ****** S%dp%d Program Phy Control Regs - END ******\n",
                v5,
                v8);
              RcAssertPrint( /*0xffc68bb4*/
                (_BYTE *)__return_address,
                8u,
                (int)"\n  ****** S%dp%d Program UniPhy Recipe - START ******\n",
                v5,
                v8);
              Ddr4SkuCheck((_BYTE *)__return_address, n4_1, n2); /*0xffc68bc2*/
              RcAssertPrint( /*0xffc68bd4*/
                (_BYTE *)__return_address,
                8u,
                (int)"\n  ****** S%dp%d Program UniPhy Recipe - END ******\n",
                v5,
                v8);
            }
            else
            {
              RcAssertPrint( /*0xffc68b1d*/
                (_BYTE *)__return_address,
                8u,
                (int)"\n  ****** S%dp%d Disable and Force Link to Low Power - START ******\n",
                v5,
                v7);
              DdrTrainFunc797B((_BYTE *)__return_address, n4_1, n2); /*0xffc68b2b*/
              RcAssertPrint( /*0xffc68b3a*/
                (_BYTE *)__return_address,
                8u,
                (int)"\n  ****** S%dp%d Disable and Force Link to Low Power - END ******\n",
                v5,
                v8);
            }
            v7 = n2 + 1; /*0xffc68be0*/
            LOBYTE(n2) = v7; /*0xffc68be2*/
          }
          while ( v7 < *(_BYTE *)(__return_address + 255496) ); /*0xffc68bec*/
          n4_2 = n4_1; /*0xffc68bf2*/
        }
      }
      ++n4_2; /*0xffc68bf6*/
      v6 += 351; /*0xffc68bf8*/
      ++v5; /*0xffc68bfe*/
      LOBYTE(n4_1) = n4_2; /*0xffc68bff*/
    }
    while ( n4_2 < 4u ); /*0xffc68c06*/
  }
  return 0; /*0xffc68c13*/
}

// Function: KtiPhyCtrlRegWrite @ 0xffc68c14 (0x2a8 bytes)
// Index: 882/2560

int __cdecl KtiPhyCtrlRegWrite(_BYTE *__return_address, int n4, unsigned __int8 n4a, unsigned __int8 n2)
{
  int v5; // eax
  int v6; // ecx
  int v7; // esi
  int v8; // eax
  unsigned int v9; // edi
  int v10; // eax
  int v11; // eax
  int v12; // eax
  int v13; // esi
  int v14; // esi
  unsigned __int8 v15; // ah
  unsigned __int8 n2_1; // al
  unsigned int v17; // esi
  int v18; // esi
  _BYTE *v21; // [esp+1Ch] [ebp+4h]

  v21 = &__return_address[15 * n4a]; /*0xffc68c41*/
  v5 = j_CpuIoWrite((int)__return_address, n4a, n2, 151077164); /*0xffc68c45*/
  v6 = *(_DWORD *)&v21[4 * n2 + 8418]; /*0xffc68c4a*/
  v7 = ((v5 | 0x30) ^ ((unsigned __int8)__return_address[257187] << 22)) & 0x400000 ^ (v5 | 0x30); /*0xffc68c6c*/
  if ( (v6 & 0xCu) < 8 ) /*0xffc68c74*/
    v7 ^= (v7 ^ (v6 << 20)) & 0x400000; /*0xffc68c7d*/
  v8 = j_CpuIoWrite((int)__return_address, n4a, n2, 151077364); /*0xffc68c8e*/
  v9 = v8 & 0xFF00FFFF | 0x270000; /*0xffc68c9e*/
  if ( __return_address[246412] || __return_address[246424] >= 3u ) /*0xffc68cb4*/
  {
    v12 = j_CpuIoWrite((int)__return_address, n4a, n2, 151077352); /*0xffc68d28*/
    j_PciCfgWrite_0((int)__return_address, n4a, n2, 151077352, v12 & 0xFFFFFF | 0x79000000); /*0xffc68d43*/
  }
  else
  {
    v9 = v8 & 0xFF0000FF | 0x270C00; /*0xffc68cc7*/
    v10 = j_CpuIoWrite((int)__return_address, n4a, n2, 151077356); /*0xffc68ccd*/
    j_PciCfgWrite_0((int)__return_address, n4a, n2, 151077356, v10 & 0xFFFF00FF | 0xC00); /*0xffc68ce8*/
    v11 = j_CpuIoWrite((int)__return_address, n4a, n2, 151077352); /*0xffc68cf8*/
    j_PciCfgWrite_0((int)__return_address, n4a, n2, 151077352, v11 & 0xFFFFFF | 0xA0000000); /*0xffc68d13*/
  }
  j_PciCfgWrite_0((int)__return_address, n4a, n2, 151077364, v9); /*0xffc68d58*/
  v13 = (v7 ^ ((unsigned __int8)__return_address[257188] << 23)) & 0x800000 ^ v7; /*0xffc68d80*/
  if ( (*(_DWORD *)&v21[4 * n2 + 8418] & 0x30u) < 0x20 ) /*0xffc68d88*/
    v13 ^= (v13 ^ (*(_DWORD *)&v21[4 * n2 + 8418] << 19)) & 0x800000; /*0xffc68d95*/
  __return_address[3 * n4a + 257218 + n2] = (v13 & 0x800000) != 0; /*0xffc68da6*/
  v14 = (v13 ^ ((unsigned __int8)__return_address[257189] << 27)) & 0x8000000 ^ v13; /*0xffc68dc2*/
  v15 = __return_address[15 * n4a + 8430 + n2]; /*0xffc68dcf*/
  if ( (v15 & 3u) < 2 ) /*0xffc68dd8*/
    v14 ^= (v14 ^ (v15 << 27)) & 0x8000000; /*0xffc68de7*/
  if ( !__return_address[246412] && __return_address[246424] < 3u ) /*0xffc68df9*/
    v14 &= ~0x8000000u; /*0xffc68dfb*/
  n2_1 = __return_address[8402]; /*0xffc68e01*/
  if ( n2_1 < 2u ) /*0xffc68e09*/
    v14 = (n2_1 << 13) | v14 & 0xFFE01FFF; /*0xffc68e17*/
  RcAssertPrint(__return_address, 8u, (int)"\n  Socket %u Port %u : KTIREUT_PH_CTR1 write 0x%x\n", n4a, n2, v14);
  j_PciCfgWrite_0((int)__return_address, n4a, n2, 151077164, v14); /*0xffc68e32*/
  v17 = j_CpuIoWrite((int)__return_address, n4a, n2, 151077240) & 0xFF8000C0 | 0x804; /*0xffc68e50*/
  RcAssertPrint(__return_address, 8u, (int)"\n  Socket %u Port %u : KTIREUT_PH_LDC write 0x%x\n", n4a, n2, v17);
  j_PciCfgWrite_0((int)__return_address, n4a, n2, 151077240, v17); /*0xffc68e75*/
  v18 = j_CpuIoWrite((int)__return_address, n4a, n2, 151077192) | 0xA; /*0xffc68e89*/
  RcAssertPrint(__return_address, 8u, (int)"\n  Socket %u Port %u : KTIREUT_PH_CIS write 0x%x\n", n4a, n2, v18);
  j_PciCfgWrite_0((int)__return_address, n4a, n2, 151077192, v18); /*0xffc68eab*/
  return 0; /*0xffc68eb5*/
}

// Function: DdrTrainingFunc68EB @ 0xffc68ebc (0x4c1 bytes)
// Index: 883/2560

int __cdecl DdrTrainingFunc68EB(_BYTE *__return_address, _BYTE *n4, _BYTE *buf)
{
  _BYTE *__return_address_1; // edi
  _BYTE *n4_1; // ebp
  bool v5; // dh
  unsigned __int8 n3; // cl
  unsigned __int8 v7; // bl
  int n4_2; // eax
  int v9; // ebx
  int v10; // esi
  unsigned __int8 v11; // dl
  _BYTE *v12; // ecx
  _BYTE *v13; // eax
  _BYTE *v14; // edx
  _BYTE *v15; // esi
  int n4_5; // ebx
  unsigned __int8 v17; // al
  unsigned __int8 v18; // cl
  int v19; // edx
  int v20; // eax
  int n4_6; // ecx
  unsigned __int8 v22; // bl
  int v23; // esi
  unsigned __int8 v24; // dl
  unsigned __int8 v25; // al
  int v26; // esi
  unsigned int v27; // edx
  _BYTE *v28; // eax
  int v29; // edx
  int v30; // ecx
  int n4_8; // ebx
  _BYTE *n4_9; // esi
  unsigned __int8 v33; // bl
  const char *Socket; // ecx
  _BYTE *n4_11; // esi
  int v36; // ebp
  int n4_12; // eax
  unsigned __int8 v38; // dl
  int v39; // ebx
  int v40; // ecx
  int n257175; // eax
  int v42; // esi
  int n4_15; // ... [12105 chars total]

// Function: DdrTrainFn_FFC6937D @ 0xffc6937d (0xc8 bytes)
// Index: 884/2560

int __cdecl DdrTrainFn_FFC6937D(_BYTE *__return_address, int n4, int buf)
{
  int n4_1; // edx
  unsigned __int8 n4_2; // bl
  int v5; // ebp
  int v6; // edi
  char v7; // al
  unsigned __int8 i; // bh
  int n13; // [esp-4h] [ebp-18h]
  int v11; // [esp+10h] [ebp-4h]

  n4_1 = n4; /*0xffc6937e*/
  n4_2 = 0; /*0xffc69389*/
  v5 = 0; /*0xffc6938c*/
  LOBYTE(v11) = 0; /*0xffc6938e*/
  v6 = 0; /*0xffc69392*/
  do /*0xffc69437*/
  {
    v7 = *(_BYTE *)(v6 + n4_1); /*0xffc69394*/
    if ( (v7 & 1) != 0 && (v7 & 0x60) == 0 ) /*0xffc693a1*/
    {
      for ( i = 0; i < __return_address[255496]; ++i ) /*0xffc693a9*/
      {
        if ( (*(_BYTE *)(v6 + 4 * i + n4_1 + 1) & 1) != 0 || __return_address[257190] == 1 ) /*0xffc693c5*/
        {
          if ( (*(_DWORD *)(v5 + 4 * i + buf + 148) & 7) == 1 ) /*0xffc693e1*/
            n13 = 13; /*0xffc693e8*/
          else
            n13 = 12; /*0xffc693ec*/
          if ( i >= 2u ) /*0xffc693f3*/
          {
            ProcCommonFuncA61D(__return_address, v11, 648, n13); /*0xffc69412*/
          }
          else
          {
            ProcCommonFuncA61D(__return_address, v11, 136, n13); /*0xffc693ff*/
            i = 1; /*0xffc69404*/
          }
          n4_1 = n4; /*0xffc69417*/
        }
      }
    }
    ++n4_2; /*0xffc69428*/
    v6 += 13; /*0xffc6942a*/
    v5 += 18; /*0xffc6942d*/
    LOBYTE(v11) = n4_2; /*0xffc69430*/
  }
  while ( n4_2 < 4u ); /*0xffc69437*/
  return 0; /*0xffc6943d*/
}

// Function: DdrTrainFn_FFC69445 @ 0xffc69445 (0x204 bytes)
// Index: 885/2560

void __cdecl DdrTrainFn_FFC69445(_BYTE *__return_address, int n4, int buf)
{
  _BYTE *__return_address_1; // esi
  unsigned __int8 n4_3; // dl
  int v5; // ebx
  int v6; // edi
  unsigned __int8 n2_1; // cl
  int n4_1; // edx
  unsigned __int8 v9; // bp
  int v10; // edi
  int v11; // esi
  char v12; // al
  unsigned int v13; // edi
  int v14; // esi
  int v15; // [esp-40h] [ebp-60h]
  unsigned __int8 v16; // [esp+7h] [ebp-19h]
  unsigned __int8 n4_2; // [esp+8h] [ebp-18h]
  unsigned __int8 n2; // [esp+10h] [ebp-10h]
  int v19; // [esp+14h] [ebp-Ch]
  int v20; // [esp+18h] [ebp-8h]

  __return_address_1 = __return_address; /*0xffc69449*/
  if ( !__return_address[257173] ) /*0xffc6944d*/
  {
    n4_3 = 0; /*0xffc6945c*/
    v5 = 0; /*0xffc6945e*/
    v6 = 0; /*0xffc69461*/
    n4_2 = 0; /*0xffc69463*/
    v19 = 0; /*0xffc69467*/
    v20 = 0; /*0xffc6946b*/
    do /*0xffc6963b*/
    {
      if ( ((1 << v5) & *(_DWORD *)(buf + 100)) != 0 ) /*0xffc6947d*/
      {
        n2_1 = 0; /*0xffc69483*/
        n2 = 0; /*0xffc69485*/
        if ( __return_address_1[255496] ) /*0xffc69489*/
        {
          n4_1 = n4; /*0xffc69495*/
          do /*0xffc69618*/
          {
            if ( (*(_BYTE *)(v6 + 4 * n2_1 + n4_1 + 1) & 1) != 0 ) /*0xffc694a4*/
            {
              v9 = n2_1 & 0xFE; /*0xffc694b2*/
              v10 = j_CpuIoWrite((int)__return_address_1, n4_2, n2_1 & 0xFE, 151208464); /*0xffc694d0*/
              v11 = j_CpuIoWrite((int)__return_address_1, n4_2, v9, 151208472); /*0xffc694dc*/
              v12 = ProcCommonFunc9527(__return_address, n4_2, n2, 0, 28); /*0xffc694eb*/
              ProcCommonFunc9618(__return_address, n4_2, n2, 63, 0x1Cu, v12 & 0xFB); /*0xffc69507*/
              v13 = v10 & 0xC0FFFFFF | 0x17000000; /*0xffc69515*/
              j_PciCfgWrite_0((int)__return_address, n4_2, v9, 151208464, v13); /*0xffc6952a*/
              v16 = ProcCommonFunc9527(__return_address, n4_2, n2, 0, 28) | 4; /*0xffc6954b*/
              ProcCommonFunc9618(__return_address, n4_2, n2, 63, 0x1Cu, v16); /*0xffc6955c*/
              v14 = v11 & 0x3FFFFFFF | 0x40000000; /*0xffc6956a*/
              j_PciCfgWrite_0((int)__return_address, n4_2, v9, 151208472, v14); /*0xffc6957f*/
              v13 |= 0x800000u; /*0xffc69584*/
              j_PciCfgWrite_0((int)__return_address, n4_2, v9, 151208464, v13); /*0xffc69599*/
              ProcCommonFunc9382((int)__return_address, 1u); /*0xffc695a4*/
              v15 = v14 & 0x3FFFFFFF; /*0xffc695af*/
              __return_address_1 = __return_address; /*0xffc695ba*/
              j_PciCfgWrite_0((int)__return_address, n4_2, v9, 151208472, v15); /*0xffc695bf*/
              ProcCommonFunc9382((int)__return_address, 1u); /*0xffc695ca*/
              j_PciCfgWrite_0((int)__return_address, n4_2, v9, 151208464, v13 & 0xFF7FFFFF); /*0xffc695e1*/
              ProcCommonFunc9618(__return_address, n4_2, n2, 63, 0x1Cu, v16 & 0xFB); /*0xffc695fa*/
              v6 = v20; /*0xffc695ff*/
              n4_1 = n4; /*0xffc69606*/
              n2_1 = n2; /*0xffc6960a*/
            }
            n2 = ++n2_1; /*0xffc6960e*/
          }
          while ( n2_1 < __return_address_1[255496] ); /*0xffc69618*/
          n4_3 = n4_2; /*0xffc6961e*/
          v5 = v19; /*0xffc69622*/
        }
      }
      ++n4_3; /*0xffc69626*/
      v6 += 13; /*0xffc69628*/
      ++v5; /*0xffc6962b*/
      n4_2 = n4_3; /*0xffc6962c*/
      v19 = v5; /*0xffc69630*/
      v20 = v6; /*0xffc69634*/
    }
    while ( n4_3 < 4u ); /*0xffc6963b*/
  }
}

// Function: IpInit @ 0xffc69649 (0x329 bytes)
// Index: 886/2560

int __cdecl IpInit(char *__return_address, int buf)
{
  int buf_1; // esi
  unsigned __int8 v3; // bl
  int v4; // eax
  unsigned __int8 v5; // dh
  int v6; // edi
  char *v7; // ebp
  char v8; // ch
  unsigned __int8 v9; // dl
  char v10; // cl
  _BYTE *v11; // edi
  unsigned __int8 v12; // dh
  int v13; // ecx
  unsigned __int8 v14; // dl
  char v15; // cl
  char v16; // dl
  unsigned __int8 n4_2; // dl
  _BYTE *v18; // ebp
  char *v19; // ebp
  int n4_3; // esi
  char v21; // cl
  bool v22; // zf
  int n4_4; // edx
  unsigned __int8 *v24; // ebp
  _BYTE *v25; // esi
  unsigned __int8 n4_6; // cl
  _BYTE *v27; // edx
  int v28; // ecx
  bool v29; // bl
  _BYTE *v30; // edx
  int n4_7; // ebp
  int v32; // eax
  int v33; // ebx
  unsigned __int8 v35; // [esp+10h] [ebp-20h]
  char v36; // [esp+11h] [ebp-1Fh]
  unsigned __int8 v37; // [esp+12h] [ebp-1Eh]
  int v38; // [esp+14h] [ebp-1Ch]
  char v39; // [esp+18h] [ebp-18h]
  int v40; // [esp+1Ch] [ebp-14h]
  int n4_1; // [esp+20h] [ebp-10h]
  int v42; // [esp+20h] [ebp-10h]
  int v43; // [esp+20h] [ebp-10h]
  int v44; // [esp+24h] [ebp-Ch]
  int n4_5; // [esp+24h] [ebp-Ch]
  int v46; // [esp+24h] [ebp-Ch]
  int n4; // [esp+28h] [ebp-8h]

  buf_1 = buf; /*0xffc6964f*/
  v3 = 0; /*0xffc69653*/
  LOBYTE(v4) = 0; /*0xffc69658*/
  v5 = *(_BYTE *)(buf + 5); /*0xffc6965e*/
  LOBYTE(v38) = 0; /*0xffc69661*/
  v35 = 0; /*0xffc69665*/
  v37 = v5; /*0xffc69669*/
  n4 = 4; /*0xffc6966e*/
  if ( v5 ) /*0xffc69674*/
  {
    v6 = 0; /*0xffc6967d*/
    v44 = v5; /*0xffc6967f*/
    do /*0xffc696f4*/
    {
      n4_1 = 4; /*0xffc69686*/
      v7 = (char *)(v6 + buf + 66); /*0xffc6968a*/
      do /*0xffc696e7*/
      {
        v39 = *v7; /*0xffc6969b*/
        v40 = (unsigned __int8)v4; /*0xffc696a0*/
        v36 = *(_BYTE *)(buf + (unsigned __int8)*v7 + 6); /*0xffc696a8*/
        if ( ((1 << *v7) & (unsigned __int8)v4) != 0 || (v8 = *(_BYTE *)(buf + (unsigned __int8)*v7 + 6), v36 == -1) ) /*0xffc696bd*/
        {
LABEL_10:
          LOBYTE(v4) = v38; /*0xffc696dd*/
        }
        else
        {
          v9 = 0; /*0xffc696c3*/
          while ( 1 ) /*0xffc696ca*/
          {
            v10 = *(_BYTE *)(v6 + v9 + buf + 66); /*0xffc696ca*/
            if ( v10 != *v7 && v10 != v36 ) /*0xffc696d4*/
              break; /*0xffc696d4*/
            if ( ++v9 >= 4u ) /*0xffc696db*/
              goto LABEL_10; /*0xffc696db*/
          }
          if ( ((1 << v10) & (unsigned __int8)v4) != 0 ) /*0xffc69748*/
          {
            v8 = *(_BYTE *)(buf + (unsigned __int8)*v7 + 6); /*0xffc69750*/
            BYTE1(v4) = ((v35 >> v10) & 1) == 0; /*0xffc69758*/
          }
          else
          {
            BYTE1(v4) = 0; /*0xffc6975d*/
          }
          v35 |= (unsigned __int8)(BYTE1(v4) << v39) | (unsigned __int8)(BYTE1(v4) << v8); /*0xffc69770*/
          v4 = (unsigned __int8)v4 | (1 << v39) | (1 << v8); /*0xffc6977b*/
          v38 = v40 | (1 << v39) | (1 << v8); /*0xffc6977e*/
        }
        ++v7; /*0xffc696e1*/
        --n4_1; /*0xffc696e2*/
      }
      while ( n4_1 ); /*0xffc696e7*/
      v6 += 5; /*0xffc696e9*/
      --v44; /*0xffc696ec*/
    }
    while ( v44 ); /*0xffc696f4*/
    v11 = (_BYTE *)(buf + 66); /*0xffc69708*/
    v12 = v35; /*0xffc6970b*/
    v13 = -66 - buf; /*0xffc6970f*/
    v42 = v37; /*0xffc69715*/
    do /*0xffc6981c*/
    {
      v14 = 0; /*0xffc69719*/
      while ( 1 ) /*0xffc69725*/
      {
        v15 = v11[v14 + 66 + buf_1 + v13]; /*0xffc69725*/
        if ( ((1 << v15) & (unsigned __int8)v4) != 0 ) /*0xffc69730*/
          break; /*0xffc69730*/
        v13 = -66 - buf; /*0xffc69732*/
        if ( ++v14 >= 4u ) /*0xffc6973b*/
          goto LABEL_23; /*0xffc6973b*/
      }
      v16 = ((v12 >> v15) & 1) == 0; /*0xffc6978d*/
      if ( v16 == -1 ) /*0xffc69793*/
      {
LABEL_23:
        n4_2 = 0; /*0xffc69795*/
        v18 = v11; /*0xffc69797*/
        do /*0xffc697b9*/
        {
          v12 |= n4_2 >> 1 << *v18; /*0xffc697a3*/
          v4 = (unsigned __int8)v38 | (1 << *v18); /*0xffc697ac*/
          ++n4_2; /*0xffc697af*/
          ++v18; /*0xffc697b1*/
          LOBYTE(v38) = v4; /*0xffc697b2*/
        }
        while ( n4_2 < 4u ); /*0xffc697b9*/
        goto LABEL_32; /*0xffc697b9*/
      }
      v19 = v11; /*0xffc697c5*/
      n4_3 = 4; /*0xffc697c7*/
      do /*0xffc69804*/
      {
        v21 = *v19; /*0xffc697cf*/
        if ( ((1 << *v19) & (unsigned __int8)v38) != 0 ) /*0xffc697e7*/
        {
          LOBYTE(v4) = v38; /*0xffc697fc*/
        }
        else
        {
          v12 |= v16 << v21; /*0xffc697ed*/
          v4 = (unsigned __int8)v38 | (1 << v21); /*0xffc697f3*/
          LOBYTE(v38) = v4; /*0xffc697f6*/
        }
        ++v19; /*0xffc69800*/
        --n4_3; /*0xffc69801*/
      }
      while ( n4_3 ); /*0xffc69804*/
      buf_1 = buf; /*0xffc69806*/
      v3 = 0; /*0xffc6980a*/
LABEL_32:
      v13 = -66 - buf; /*0xffc6980c*/
      v11 += 5; /*0xffc69810*/
      v22 = v42-- == 1; /*0xffc69813*/
      v35 = v12; /*0xffc69818*/
    }
    while ( !v22 ); /*0xffc6981c*/
    v5 = v37; /*0xffc69822*/
  }
  if ( v5 )
  {
    v43 = (unsigned __int8)v4; /*0xffc69835*/
    do
    {
      n4_4 = 4; /*0xffc69848*/
      n4_5 = 4; /*0xffc69849*/
      v24 = (unsigned __int8 *)(5 * v3 + buf_1 + 66); /*0xffc6984d*/
      do
      {
        if ( ((1 << *v24) & v43) == 0 )
        {
          RcAssertPrint( /*0xffc69865*/
            __return_address,
            1u,
            (int)"\n  CPU%u VN Allocation Failed - Topology Not Supported!!! \n  System Halted",
            *v24);
          RcAssertPrint(
            __return_address,
            1u,
            (int)"\n\n %s: %u   %s ",
            "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiDisc.c",
            893,
            "FALSE");
          KtiDebugAssert((int)__return_address, 220, 9); /*0xffc6988e*/
          n4_4 = n4_5; /*0xffc69893*/
        }
        ++v24; /*0xffc6989a*/
        n4_5 = --n4_4; /*0xffc6989e*/
      }
      while ( n4_4 );
      buf_1 = buf; /*0xffc698a4*/
      ++v3; /*0xffc698a8*/
    }
    while ( v3 < *(_BYTE *)(buf + 5) );
  }
  v25 = (_BYTE *)(buf_1 + 14); /*0xffc698b5*/
  n4_6 = 0; /*0xffc698b8*/
  v27 = v25; /*0xffc698ba*/
  do /*0xffc698da*/
  {
    if ( (*v27 & 1) != 0 ) /*0xffc698c1*/
      *v27 ^= (*v27 ^ (16 * (v35 >> n4_6))) & 0x10; /*0xffc698d0*/
    ++n4_6; /*0xffc698d2*/
    v27 += 13; /*0xffc698d4*/
  }
  while ( n4_6 < 4u ); /*0xffc698da*/
  v28 = 0; /*0xffc698dc*/
  v29 = 1; /*0xffc698e3*/
  v30 = v25; /*0xffc698e7*/
  v46 = 0; /*0xffc698eb*/
  n4_7 = 4; /*0xffc698ef*/
  do /*0xffc69926*/
  {
    if ( (*v30 & 1) != 0 ) /*0xffc698f4*/
    {
      v32 = 1 << v28; /*0xffc698f9*/
      v28 = v46; /*0xffc69901*/
      if ( ((unsigned __int8)v32 & (unsigned __int8)v38) == 0 ) /*0xffc69905*/
      {
        *v30 ^= (*v30 ^ (16 * v29)) & 0x10; /*0xffc69916*/
        v29 = !v29; /*0xffc69918*/
      }
    }
    ++v28; /*0xffc6991b*/
    v30 += 13; /*0xffc6991c*/
    v46 = v28; /*0xffc6991f*/
    --n4_7; /*0xffc69923*/
  }
  while ( n4_7 ); /*0xffc69926*/
  RcAssertPrint(__return_address, 8u, (int)"\n\n  VN Assignment:"); /*0xffc69930*/
  v33 = 0; /*0xffc69935*/
  do /*0xffc69966*/
  {
    if ( (*v25 & 1) != 0 ) /*0xffc69940*/
      RcAssertPrint(__return_address, 8u, (int)"\n    %u - VN%u", v33, ((unsigned __int8)*v25 >> 4) & 1); /*0xffc69955*/
    ++v33; /*0xffc6995d*/
    v25 += 13; /*0xffc6995e*/
    --n4; /*0xffc69961*/
  }
  while ( n4 ); /*0xffc69966*/
  return 0; /*0xffc69968*/
}

// Function: Assert_0 @ 0xffc69a2a (0x247 bytes)
// Index: 887/2560

int __cdecl Assert_0(char *__return_address, char *n4, char *buf)
{
  char *n4_1; // eax
  int n4_2; // ecx
  unsigned int *n216; // edi
  char v7; // al
  unsigned int *n216_1; // eax
  unsigned int v9; // eax
  int v10; // ecx
  char v12; // [esp+13h] [ebp-11h]
  unsigned int v13; // [esp+14h] [ebp-10h] BYREF
  unsigned int v14; // [esp+18h] [ebp-Ch] BYREF
  int n4_4; // [esp+1Ch] [ebp-8h]
  char *n4_3; // [esp+20h] [ebp-4h]
  unsigned __int8 bufa; // [esp+30h] [ebp+Ch]

  n4_1 = n4; /*0xffc69a32*/
  n4_2 = 4; /*0xffc69a41*/
  n4_3 = n4; /*0xffc69a42*/
  n216 = (unsigned int *)(n4 + 76); /*0xffc69a46*/
  n4_4 = 4; /*0xffc69a49*/
  do /*0xffc69c47*/
  {
    v7 = *n4_1; /*0xffc69a4d*/
    if ( (v7 & 1) != 0 && (v7 & 0x60) == 0 ) /*0xffc69a59*/
    {
      RcAssertPrint(__return_address, 8u, (int)"\n Calculating Route for CPU%u ", (*n216 >> 1) & 7); /*0xffc69a6f*/
      KtiDebugPrint((unsigned __int8)(1 << ((*n216 >> 1) & 7)), (*n216 >> 4) & 3, 0, 167, 4, (int)__return_address); /*0xffc69a98*/
      v12 = 0; /*0xffc69aa0*/
      if ( (*(_BYTE *)n216 & 1) != 0 ) /*0xffc69aa8*/
      {
        n216_1 = n216; /*0xffc69aae*/
        do /*0xffc69c28*/
        {
          v9 = *n216_1; /*0xffc69ab0*/
          if ( (v9 & 0x30) != 0 ) /*0xffc69ab4*/
            break; /*0xffc69ab4*/
          v14 = v9; /*0xffc69abc*/
          v13 = v13 ^ ((unsigned __int16)v13 ^ (unsigned __int16)((v9 & 0xF000) + 4096)) & 0xF000 | 1; /*0xffc69add*/
          for ( bufa = 0; bufa < (unsigned __int8)__return_address[255496]; ++bufa ) /*0xffc69ae9*/
          {
            v10 = *(_DWORD *)&n4[13 * ((v9 >> 1) & 7) + 1 + 4 * bufa]; /*0xffc69b0c*/
            if ( (v10 & 0x401) == 1 && (v10 & 0x800) == 0 ) /*0xffc69b27*/
            {
              v13 = v10 & 0x3E | v13 & 0xFFFFF0C1 | (4 * (v10 & 0x3C0)); /*0xffc69b4f*/
              if ( ProcCommonFunc997A(__return_address, (int)n216, (int *)&v13) == 1 ) /*0xffc69b5d*/
              {
                DdrTrainingFuncB4D5(__return_address, n4, buf, (int)n216, n216, &v14, &v13); /*0xffc69b6e*/
                if ( buf[116] == 1 ) /*0xffc69b7a*/
                {
                  if ( buf[122] == 1 && (((unsigned __int8)v13 ^ *(_BYTE *)n216) & 0xE) != 0 && (v14 & 0xF000) == 0x1000 ) /*0xffc69b9a*/
                    KtiPortConnectionResolve(__return_address, n4, buf, n216, &v14, &v13, 1); /*0xffc69b9e*/
                  else
                    KtiPortConnectionResolve(__return_address, n4, buf, n216, &v14, &v13, 0); /*0xffc69bb0*/
                }
              }
              v9 = v14; /*0xffc69bb8*/
            }
          }
          n216_1 = &n216[(unsigned __int8)++v12]; /*0xffc69c22*/
        }
        while ( (*(_BYTE *)n216_1 & 1) != 0 ); /*0xffc69c28*/
      }
      n4_2 = n4_4; /*0xffc69c2e*/
    }
    n216 += 6; /*0xffc69c36*/
    n4_1 = n4_3 + 13; /*0xffc69c39*/
    --n4_2; /*0xffc69c3c*/
    n4_3 += 13; /*0xffc69c3f*/
    n4_4 = n4_2; /*0xffc69c43*/
  }
  while ( n4_2 ); /*0xffc69c47*/
  if ( buf[116] == 1 ) /*0xffc69c51*/
    KtiPortPhyCheck(__return_address, n4); /*0xffc69c55*/
  ProcCommonFuncA2F0(__return_address, (int)n4); /*0xffc69c5f*/
  return 0; /*0xffc69c69*/
}

// Function: sub_FFC69C71 @ 0xffc69c71 (0x17d bytes)
// Index: 888/2560

// Function: KtiTopologyPathCheck @ 0xffc69dee (0x227 bytes)
// Index: 889/2560

int __cdecl KtiTopologyPathCheck(char *__return_address, int buf, _BYTE *bufa, unsigned __int8 n4)
{
  _BYTE *bufa_1; // edx
  int n4_1; // ebx
  unsigned __int8 n45; // cl
  int buf_1; // edi
  unsigned int v8; // esi
  unsigned __int8 v9; // bl
  int v10; // ebp
  unsigned __int8 v11; // ch
  int v12; // esi
  unsigned __int8 v13; // bl
  unsigned __int8 n45_1; // [esp+Ah] [ebp-16h]
  unsigned __int8 v16; // [esp+Bh] [ebp-15h]
  unsigned __int8 v17; // [esp+18h] [ebp-8h] BYREF
  unsigned __int8 v18; // [esp+19h] [ebp-7h]
  char v19; // [esp+1Ah] [ebp-6h]
  char v20; // [esp+1Bh] [ebp-5h]

  bufa_1 = bufa; /*0xffc69df1*/
  n4_1 = n4; /*0xffc69df6*/
  if ( ((*(_DWORD *)bufa >> 1) & 7) != n4 )
  {
    RcAssertPrint(
      __return_address,
      1u,
      (int)"\n\n %s: %u   %s ",
      "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiDisc.c",
      624,
      "(RingTree[0].Node.SocId == RootSocId)");
    KtiDebugAssert((int)__return_address, 220, 9); /*0xffc69e33*/
    bufa_1 = bufa; /*0xffc69e38*/
  }
  n45 = 45; /*0xffc69e3f*/
  do /*0xffc69e4d*/
  {
    if ( (bufa_1[4 * n45] & 1) != 0 ) /*0xffc69e48*/
      break; /*0xffc69e48*/
    --n45; /*0xffc69e4a*/
  }
  while ( n45 ); /*0xffc69e4d*/
  n45_1 = n45; /*0xffc69e4f*/
  if ( n45 )
  {
    buf_1 = buf; /*0xffc69e5c*/
    do
    {
      v8 = *(_DWORD *)&bufa_1[4 * n45]; /*0xffc69e64*/
      if ( (v8 & 0xF000) != 0x4000 ) /*0xffc69e73*/
        break; /*0xffc69e73*/
      if ( ((v8 >> 1) & 7) == n4_1 )
      {
        v9 = (v8 >> 12) & 0xF; /*0xffc69e8d*/
        if ( v9 )
        {
          v10 = (unsigned __int16)v8 >> 12; /*0xffc69e96*/
          do
          {
            --v9; /*0xffc69ea5*/
            *(&v17 + v10--) = (v8 >> 1) & 7; /*0xffc69ea7*/
            v8 = *(_DWORD *)&bufa_1[4 * ((v8 >> 19) & 0x7F)]; /*0xffc69eac*/
            if ( v10 != (unsigned __int16)v8 >> 12 )
            {
              RcAssertPrint(
                __return_address,
                1u,
                (int)"\n\n %s: %u   %s ",
                "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiDisc.c",
                659,
                "(Idx3 == RingNode.Node.Hop)");
              KtiDebugAssert((int)__return_address, 220, 9); /*0xffc69edf*/
              bufa_1 = bufa; /*0xffc69ee4*/
            }
          }
          while ( v9 );
          n45 = n45_1; /*0xffc69eef*/
          buf_1 = buf; /*0xffc69ef3*/
        }
        *(&v17 + v9) = n4; /*0xffc69efe*/
        if ( v17 != v18 && v17 != v19 && v17 != v20 && v18 != v19 && v18 != v20 && v19 != v20 ) /*0xffc69f3e*/
        {
          v11 = 0; /*0xffc69f48*/
          v16 = __return_address[255496]; /*0xffc69f50*/
          if ( v16 ) /*0xffc69f56*/
          {
            while ( 1 ) /*0xffc69f74*/
            {
              v12 = 4 * v11; /*0xffc69f74*/
              if ( ((*(_DWORD *)(v12 + 13 * v17 + buf_1 + 15) >> 1) & 7) == v19 /*0xffc69f9f*/
                || ((*(_DWORD *)(v12 + 13 * v18 + buf_1 + 15) >> 1) & 7) == v20 )
              {
                break; /*0xffc69f9f*/
              }
              if ( ++v11 >= v16 ) /*0xffc69fa5*/
                goto LABEL_26; /*0xffc69fa5*/
            }
          }
          else
          {
LABEL_26:
            v13 = 0; /*0xffc69fa7*/
            if ( *(_BYTE *)(buf_1 + 5) ) /*0xffc69fa9*/
            {
              while ( !ProcCommonFunc81CE(__return_address, (int)&v17, buf_1 + 5 * v13 + 66) ) /*0xffc69fca*/
              {
                if ( ++v13 >= *(_BYTE *)(buf_1 + 5) ) /*0xffc69fd1*/
                  goto LABEL_29; /*0xffc69fd1*/
              }
            }
            else
            {
LABEL_29:
              AutoGenFunc8E72(buf_1 + 5 * *(unsigned __int8 *)(buf_1 + 5) + 66, (char *)&v17, 5); /*0xffc69fd3*/
              ++*(_BYTE *)(buf_1 + 5); /*0xffc69fef*/
            }
            n45 = n45_1; /*0xffc69ff2*/
          }
        }
        n4_1 = n4; /*0xffc69ff6*/
      }
      bufa_1 = bufa; /*0xffc69ffa*/
      n45_1 = --n45; /*0xffc6a001*/
    }
    while ( n45 );
  }
  return 0; /*0xffc6a00d*/
}

// Function: DebugLogPrint_18 @ 0xffc6a015 (0x1c9 bytes)
// Index: 890/2560

int __cdecl DebugLogPrint_18(char *__return_address, char *buf, int a3)
{
  unsigned int n66588417; // eax
  char v4; // bp
  _BYTE *v5; // ebx
  int v6; // esi
  bool v7; // zf
  bool v9; // al
  unsigned int v10; // ebp
  unsigned __int8 i; // bl
  unsigned __int8 i_1; // al
  int i_2; // edx
  char v14; // al
  unsigned __int8 v15; // cl
  int v16; // eax
  int v17; // edx
  unsigned int *v18; // eax
  unsigned int v19; // eax
  unsigned int p_n66588417; // [esp+10h] [ebp-14h] BYREF
  int v22; // [esp+14h] [ebp-10h]
  int n4; // [esp+18h] [ebp-Ch]
  int v24; // [esp+1Ch] [ebp-8h]
  int v25; // [esp+20h] [ebp-4h]
  bool v26; // [esp+30h] [ebp+Ch]

  RcAssertPrint(__return_address, 8u, (int)"\n\n  Constructing Topology Tree"); /*0xffc6a028*/
  KtiDebugPrint(255, 0, 0, 167, 3, (int)__return_address); /*0xffc6a03e*/
  n66588417 = 66588417; /*0xffc6a04a*/
  n4 = 4; /*0xffc6a04f*/
  v4 = 0; /*0xffc6a057*/
  v5 = (_BYTE *)(a3 + 14); /*0xffc6a05f*/
  v6 = a3 + 132; /*0xffc6a062*/
  do
  {
    if ( (*v5 & 1) != 0 && (*v5 & 0x60) == 0 )
    {
      p_n66588417 = ((unsigned __int8)n66588417 ^ (unsigned __int8)(2 * v4)) & 0xE ^ n66588417; /*0xffc6a07e*/
      v7 = ProcCommonFunc5AA5(__return_address, v6, &p_n66588417) == 0; /*0xffc6a091*/
      n66588417 = p_n66588417; /*0xffc6a093*/
      if ( !v7 )
      {
        RcAssertPrint( /*0xffc6a0a8*/
          __return_address,
          1u,
          (int)"\n  Adding CPU%u to Topology Discovery Tree of CPU%u failed - Data Structure Overflow.",
          (p_n66588417 >> 1) & 7,
          (p_n66588417 >> 1) & 7);
        RcAssertPrint(
          __return_address,
          1u,
          (int)"\n\n %s: %u   %s ",
          "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiDisc.c",
          968,
          "FALSE");
        KtiDebugAssert((int)__return_address, 223, 85); /*0xffc6a0d1*/
        n66588417 = p_n66588417; /*0xffc6a0d6*/
      }
    }
    ++v4; /*0xffc6a0dd*/
    v5 += 13; /*0xffc6a0de*/
    v6 += 24; /*0xffc6a0e1*/
    --n4; /*0xffc6a0e4*/
  }
  while ( n4 );
  v9 = *(_BYTE *)(a3 + 5) == 1 && *(_DWORD *)(a3 + 1) == 15; /*0xffc6a0ff*/
  v26 = v9; /*0xffc6a107*/
  LOBYTE(n4) = 0; /*0xffc6a10b*/
  v10 = 0; /*0xffc6a10f*/
  do /*0xffc6a1ce*/
  {
    for ( i = 0; i < 4u; ++i ) /*0xffc6a115*/
    {
      if ( v26 ) /*0xffc6a11a*/
        i_1 = *(_BYTE *)(i + a3 + 66); /*0xffc6a128*/
      else
        i_1 = i; /*0xffc6a12e*/
      i_2 = i_1; /*0xffc6a130*/
      LOBYTE(v24) = i_1; /*0xffc6a133*/
      v14 = *(_BYTE *)(13 * i_1 + a3 + 14); /*0xffc6a13a*/
      if ( (v14 & 1) != 0 && (v14 & 0x60) == 0 ) /*0xffc6a144*/
      {
        v15 = 0; /*0xffc6a149*/
        LOBYTE(v22) = 0; /*0xffc6a14b*/
        if ( (*(_BYTE *)(24 * i_2 + a3 + 132) & 1) != 0 ) /*0xffc6a157*/
        {
          v25 = 6 * i_2; /*0xffc6a15c*/
          v16 = 6 * i_2 + 33; /*0xffc6a160*/
          v17 = 6 * i_2; /*0xffc6a163*/
          v18 = (unsigned int *)(a3 + 4 * v16); /*0xffc6a167*/
          do /*0xffc6a1b3*/
          {
            p_n66588417 = *v18; /*0xffc6a16c*/
            v19 = (unsigned __int16)p_n66588417 >> 12; /*0xffc6a173*/
            if ( v19 >= v10 ) /*0xffc6a178*/
            {
              if ( v19 > v10 ) /*0xffc6a17a*/
                break; /*0xffc6a17a*/
              KtiTopoDiscoveryAdd(__return_address, a3, v24, &p_n66588417, v22, n4); /*0xffc6a18f*/
              v15 = v22; /*0xffc6a194*/
              v17 = v25; /*0xffc6a19b*/
            }
            LOBYTE(v22) = ++v15; /*0xffc6a1a7*/
            v18 = (unsigned int *)(a3 + 4 * (v17 + v15 + 33)); /*0xffc6a1ad*/
          }
          while ( (*(_BYTE *)v18 & 1) != 0 ); /*0xffc6a1b3*/
        }
      }
    }
    ++v10; /*0xffc6a1c6*/
    LOBYTE(n4) = n4 + 1; /*0xffc6a1c7*/
  }
  while ( (unsigned __int8)n4 < 4u ); /*0xffc6a1ce*/
  return 0; /*0xffc6a1d4*/
}

// Function: KtiRingTreeNodeAdd @ 0xffc6a1de (0x258 bytes)
// Index: 891/2560

int __cdecl KtiRingTreeNodeAdd(char *__return_address, int buf, _BYTE *bufa, unsigned __int8 n4)
{
  int n4_1; // ebp
  int v6; // esi
  _BYTE *bufa_1; // eax
  unsigned __int8 v8; // dl
  unsigned int v9; // eax
  unsigned __int8 bufb_1; // cl
  int v11; // ebp
  int v12; // eax
  unsigned int v14; // [esp+10h] [ebp-Ch] BYREF
  unsigned int v15; // [esp+14h] [ebp-8h] BYREF
  int n4_2; // [esp+18h] [ebp-4h]
  unsigned __int8 bufb; // [esp+28h] [ebp+Ch]
  unsigned __int8 n4a; // [esp+2Ch] [ebp+10h]

  n4_1 = n4; /*0xffc6a1e7*/
  n4_2 = n4; /*0xffc6a1ee*/
  LOBYTE(v6) = 0; /*0xffc6a1fd*/
  v15 = (2 * (n4 & 7)) | 0x3F80F01; /*0xffc6a204*/
  if ( ProcCommonFunc5A0C((int)__return_address, (int)bufa, &v15) )
  {
    RcAssertPrint( /*0xffc6a22e*/
      __return_address,
      1u,
      (int)"\n  Adding CPU%u to Ring Tree of CPU%u failed - Data Structure Overflow.",
      (v15 >> 1) & 7,
      (v15 >> 1) & 7);
    RcAssertPrint(
      __return_address,
      1u,
      (int)"\n\n %s: %u   %s ",
      "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiDisc.c",
      528,
      "FALSE");
    KtiDebugAssert((int)__return_address, 220, 9); /*0xffc6a257*/
  }
  n4a = 0; /*0xffc6a262*/
  if ( (*bufa & 1) != 0 )
  {
    bufa_1 = bufa; /*0xffc6a26d*/
    v8 = 0; /*0xffc6a26f*/
    do
    {
      v9 = *(_DWORD *)bufa_1; /*0xffc6a271*/
      if ( (v9 & 0x30) == 0x10 || (v9 & 0xF000) == 0x4000 ) /*0xffc6a28f*/
        break; /*0xffc6a28f*/
      if ( n4a ) /*0xffc6a29a*/
        v6 = *(_DWORD *)&bufa[4 * ((v9 >> 19) & 0x7F)]; /*0xffc6a2a4*/
      v14 = ((v8 & 0x7F) << 19) | ((v9 & 0xF000) + 4096) & 0xF000 | 1; /*0xffc6a2c6*/
      if ( (v9 & 0x30) != 0 )
      {
        RcAssertPrint(__return_address, 1u, (int)"\n  Unknown Socket Type found in RingTree of CPU%u", n4_1); /*0xffc6a3d5*/
        RcAssertPrint(__return_address, 1u, (int)"\n  Topology not supported\n"); /*0xffc6a3e2*/
        RcAssertPrint(
          __return_address,
          1u,
          (int)"\n\n %s: %u   %s ",
          "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiDisc.c",
          589,
          "FALSE");
        KtiDebugAssert((int)__return_address, 220, 1); /*0xffc6a40b*/
      }
      else
      {
        bufb_1 = 0; /*0xffc6a2d2*/
        bufb = 0; /*0xffc6a2d4*/
        if ( __return_address[255496] )
        {
          v11 = 13 * ((v9 >> 1) & 7); /*0xffc6a2e9*/
          do
          {
            v12 = *(_DWORD *)(v11 + 4 * bufb_1 + buf + 15); /*0xffc6a2fc*/
            if ( (v12 & 0x401) == 1
              && (v12 & 0x800) == 0
              && (!n4a || (((unsigned __int8)v6 ^ (unsigned __int8)v12) & 0xE) != 0) )
            {
              v14 = v12 & 0x3E | v14 & 0xFFFFF0C1 | (4 * (v12 & 0x3C0)); /*0xffc6a353*/
              if ( ProcCommonFunc5A0C((int)__return_address, (int)bufa, &v14) )
              {
                RcAssertPrint( /*0xffc6a37f*/
                  __return_address,
                  1u,
                  (int)"\n  Adding CPU%u to Ring Tree of CPU%u failed - Data Structure Overflow.",
                  (v14 >> 1) & 7,
                  (v15 >> 1) & 7);
                RcAssertPrint(
                  __return_address,
                  1u,
                  (int)"\n\n %s: %u   %s ",
                  "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiDisc.c",
                  580,
                  "FALSE");
                KtiDebugAssert((int)__return_address, 220, 9); /*0xffc6a3a8*/
              }
            }
            bufb_1 = bufb + 1; /*0xffc6a3b4*/
            bufb = bufb_1; /*0xffc6a3b6*/
          }
          while ( bufb_1 < (unsigned __int8)__return_address[255496] );
          n4_1 = n4_2; /*0xffc6a3c6*/
        }
      }
      v8 = ++n4a; /*0xffc6a419*/
      bufa_1 = &bufa[4 * n4a]; /*0xffc6a420*/
    }
    while ( (*bufa_1 & 1) != 0 );
  }
  return 0; /*0xffc6a42c*/
}

// Function: KtiTopoDataCopy @ 0xffc6a436 (0x1c8 bytes)
// Index: 892/2560

int __cdecl KtiTopoDataCopy(char *__return_address, char *n4, char *buf, _BYTE *a4)
{
  _BYTE *v4; // edi
  _BYTE *v5; // ecx
  int v7; // eax
  int n4_1; // ebp
  _DWORD *v9; // edx
  int v10; // ecx
  _BYTE *v11; // esi
  char *n4_4; // ecx
  int n4_5; // ebp
  char *v14; // ebp
  char *n4_6; // edi
  char *v16; // esi
  int n4_7; // eax
  int v18; // ecx
  int v20; // [esp+10h] [ebp-24h]
  int n4_3; // [esp+14h] [ebp-20h]
  int v22; // [esp+18h] [ebp-1Ch]
  _BYTE *v23; // [esp+1Ch] [ebp-18h]
  _BYTE *v24; // [esp+20h] [ebp-14h]
  _BYTE *v25; // [esp+24h] [ebp-10h]
  int n4_2; // [esp+28h] [ebp-Ch]
  _BYTE *v27; // [esp+30h] [ebp-4h]
  char v28; // [esp+44h] [ebp+10h]

  AutoGenFunc8E72((int)(n4 + 76), a4 + 132, 96); /*0xffc6a452*/
  v4 = a4 + 136; /*0xffc6a45d*/
  v27 = a4 + 14; /*0xffc6a463*/
  v5 = a4 + 14; /*0xffc6a467*/
  v24 = a4 + 136; /*0xffc6a469*/
  v7 = 0; /*0xffc6a471*/
  n4_1 = 4; /*0xffc6a475*/
  v9 = a4 + 136; /*0xffc6a476*/
  v20 = 0; /*0xffc6a478*/
  v23 = a4 + 14; /*0xffc6a47c*/
  v25 = a4 + 136; /*0xffc6a480*/
  n4_2 = 4; /*0xffc6a484*/
  n4_3 = 4; /*0xffc6a488*/
  do /*0xffc6a542*/
  {
    if ( (*v5 & 1) != 0 && (*v5 & 0x60) == 0 ) /*0xffc6a4a4*/
    {
      v28 = 1; /*0xffc6a4a9*/
      if ( (*v4 & 1) != 0 ) /*0xffc6a4ae*/
      {
        v10 = *v9; /*0xffc6a4b0*/
        v22 = v7 + 1; /*0xffc6a4bb*/
        do /*0xffc6a509*/
        {
          *(_DWORD *)&n4[4 * v22 + 76] ^= (*(_DWORD *)&n4[4 * v22 + 76] /*0xffc6a4e8*/
                                         ^ ((unsigned __int8)ProcCommonFuncB0C5((int)__return_address, BYTE1(v10) & 0xF) << 8))
                                        & 0xF00;
          v22 = v20 + (unsigned __int8)++v28; /*0xffc6a4fb*/
          v10 = *(_DWORD *)&a4[4 * v22 + 132]; /*0xffc6a4ff*/
        }
        while ( (v10 & 1) != 0 ); /*0xffc6a509*/
        v4 = v24; /*0xffc6a50b*/
        v7 = v20; /*0xffc6a50f*/
        v5 = v23; /*0xffc6a513*/
        v9 = v25; /*0xffc6a517*/
        n4_1 = n4_3; /*0xffc6a51b*/
      }
    }
    v5 += 13; /*0xffc6a51f*/
    v4 += 24; /*0xffc6a522*/
    v7 += 6; /*0xffc6a525*/
    v23 = v5; /*0xffc6a528*/
    v9 += 6; /*0xffc6a52c*/
    v24 = v4; /*0xffc6a52f*/
    --n4_1; /*0xffc6a533*/
    v20 = v7; /*0xffc6a536*/
    v25 = v9; /*0xffc6a53a*/
    n4_3 = n4_1; /*0xffc6a53e*/
  }
  while ( n4_1 ); /*0xffc6a542*/
  v11 = v27; /*0xffc6a548*/
  n4_4 = n4; /*0xffc6a54c*/
  n4_5 = 4; /*0xffc6a550*/
  do /*0xffc6a56b*/
  {
    if ( (*n4_4 & 1) != 0 ) /*0xffc6a556*/
      *n4_4 ^= (*n4_4 ^ *v11) & 0x10; /*0xffc6a560*/
    v11 += 13; /*0xffc6a562*/
    n4_4 += 13; /*0xffc6a565*/
    --n4_5; /*0xffc6a568*/
  }
  while ( n4_5 ); /*0xffc6a56b*/
  v14 = n4 + 76; /*0xffc6a571*/
  n4_6 = n4; /*0xffc6a576*/
  v16 = __return_address + 255701; /*0xffc6a578*/
  n4_7 = 4; /*0xffc6a57e*/
  do /*0xffc6a5df*/
  {
    if ( (*n4_6 & 1) != 0 ) /*0xffc6a584*/
    {
      *(_DWORD *)v16 ^= (*(_DWORD *)v16 ^ (unsigned __int8)*n4_6) & 1; /*0xffc6a58e*/
      v18 = *(_DWORD *)v16 ^ (*(_DWORD *)v16 ^ (unsigned __int8)*n4_6) & 0xE; /*0xffc6a598*/
      *(_DWORD *)v16 = v18; /*0xffc6a59a*/
      *(_DWORD *)v16 = v18 ^ ((unsigned __int8)v18 ^ ((unsigned __int8)*n4_6 >> 1)) & 0x30; /*0xffc6a5a8*/
      AutoGenFunc8E72((int)(v16 + 4), n4_6 + 1, 12); /*0xffc6a5b4*/
      AutoGenFunc8E72((int)(v16 + 24), v14, 16); /*0xffc6a5c0*/
      n4_7 = n4_2; /*0xffc6a5c5*/
    }
    n4_6 += 13; /*0xffc6a5cc*/
    v16 += 351; /*0xffc6a5cf*/
    v14 += 24; /*0xffc6a5d5*/
    n4_2 = --n4_7; /*0xffc6a5db*/
  }
  while ( n4_7 ); /*0xffc6a5df*/
  ProcCommonFuncAD4C(__return_address, n4, (unsigned int *)n4 + 19); /*0xffc6a5ec*/
  return 0; /*0xffc6a5f6*/
}

// Function: DdrTrainingFuncA5FE @ 0xffc6a5fe (0x508 bytes)
// Index: 893/2560

int __cdecl DdrTrainingFuncA5FE(char *__return_address, int buf)
{
  int buf_3; // edx
  char *__return_address_1; // esi
  _BYTE *v4; // ecx
  int n4; // ebx
  _DWORD *v6; // edi
  _DWORD *v7; // eax
  unsigned int v8; // ebp
  char v9; // bh
  unsigned __int8 v10; // bl
  unsigned __int8 v11; // cl
  unsigned __int8 v12; // dl
  int v13; // eax
  char v14; // al
  int v15; // ecx
  unsigned __int8 v16; // cl
  int v17; // edx
  int v18; // eax
  char v19; // al
  unsigned __int8 n0x30; // bl
  unsigned int v21; // edi
  int v22; // ebp
  const char *RX; // eax
  unsigned __int8 v24; // bh
  int v25; // ecx
  unsigned __int8 v26; // cl
  const char *RX_1; // eax
  int v28; // edx
  _BYTE *bufa_1; // ecx
  int n48; // ebp
  unsigned __int8 v31; // bl
  unsigned int v32; // edi
  int v33; // eax
  unsigned __int8 v34; // al
  int n48_1; // ebp
  int n48_2; // eax
  int v37; // edx
  int v38; // ecx
  int v39; // edi
  unsigned __int8 v40; // bl
  unsigned int v41; // edi
  int v42; // e... [10713 chars total]

// Function: KtiTopoDiscoveryAdd @ 0xffc6ab06 (0x135 bytes)
// Index: 894/2560

int __cdecl KtiTopoDiscoveryAdd(char *__return_address, int a2, int a3, unsigned int *p_n66588417, unsigned int i, int n4)
{
  unsigned __int8 v6; // bl
  int v7; // eax

  v6 = 0; /*0xffc6ab19*/
  for ( i = ((i & 0x7F) << 19) | ((*p_n66588417 & 0xF000) + 4096) & 0xF000 | 1;
        v6 < (unsigned __int8)__return_address[255496];
        ++v6 )
  {
    v7 = *(_DWORD *)(a2 + 13 * ((*p_n66588417 >> 1) & 7) + 4 * v6 + 15); /*0xffc6ab5b*/
    if ( (v7 & 0x401) == 1 && (v7 & 0x800) == 0 )
    {
      i = v7 & 0x3E | i & 0xFFFFF0C1 | (4 * (v7 & 0x3C0)); /*0xffc6abaa*/
      if ( ProcCommonFuncA638(__return_address, a2 + 24 * (unsigned __int8)a3 + 132, &i) != 1 )
      {
        if ( sub_FFC69C71(__return_address, a2, a3, p_n66588417, &i, n4) )
        {
          RcAssertPrint( /*0xffc6abf5*/
            __return_address,
            1u,
            (int)"\n  Adding CPU%u to Topology Discovery Tree of CPU%u failed.",
            (i >> 1) & 7,
            (unsigned __int8)a3);
          RcAssertPrint(
            __return_address,
            1u,
            (int)"\n\n %s: %u   %s ",
            "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiDisc.c",
            1103,
            "FALSE");
          KtiDebugAssert((int)__return_address, 223, 91); /*0xffc6ac1e*/
        }
      }
    }
  }
  return 0; /*0xffc6ac35*/
}

// Function: DebugLogPrint_21 @ 0xffc6ac3b (0x92 bytes)
// Index: 895/2560

int __cdecl DebugLogPrint_21(char *__return_address, char *n4, char *buf)
{
  _BYTE buf_1[120]; // [esp+8h] [ebp-78h] BYREF

  KtiTopoTreeInit(__return_address, n4, buf, buf_1); /*0xffc6ac57*/
  Assert_1(__return_address, (int)buf_1); /*0xffc6ac61*/
  if ( __return_address[257193] == 1 ) /*0xffc6ac70*/
    IpInit(__return_address, (int)buf_1); /*0xffc6ac77*/
  DebugLogPrint_18(__return_address, buf, (int)buf_1); /*0xffc6ac84*/
  DdrTrainingFuncA5FE(__return_address, (int)buf_1); /*0xffc6ac8e*/
  KtiTopoDataCopy(__return_address, n4, buf, buf_1); /*0xffc6ac9c*/
  if ( ProcCommonFuncA3F3(__return_address, n4, (int)buf) ) /*0xffc6aca6*/
    return -1; /*0xffc6acb2*/
  Assert_0(__return_address, n4, buf); /*0xffc6acbc*/
  return 0; /*0xffc6acc8*/
}

// Function: Assert_1 @ 0xffc6accd (0x179 bytes)
// Index: 896/2560

int __cdecl Assert_1(char *__return_address, int buf)
{
  int v2; // ebx
  unsigned __int8 n4_1; // al
  _BYTE *v4; // ebp
  _BYTE *v5; // ecx
  unsigned __int8 v6; // al
  int n4_2; // ecx
  unsigned __int8 v8; // al
  _BYTE *v10; // [esp+14h] [ebp-C0h]
  int n4_3; // [esp+14h] [ebp-C0h]
  unsigned __int8 n4; // [esp+18h] [ebp-BCh]
  _BYTE bufa[184]; // [esp+1Ch] [ebp-B8h] BYREF

  KtiDebugPrint(255, 255, 255, 167, 2, (int)__return_address); /*0xffc6acee*/
  RcAssertPrint(__return_address, 4u, (int)"\n\n  Locating the Rings Present in the Topology\n"); /*0xffc6acfb*/
  v2 = 0; /*0xffc6ad0a*/
  n4_1 = 0; /*0xffc6ad0c*/
  n4 = 0; /*0xffc6ad0e*/
  v4 = (_BYTE *)(buf + 14); /*0xffc6ad12*/
  v5 = (_BYTE *)(buf + 14); /*0xffc6ad15*/
  v10 = (_BYTE *)(buf + 14); /*0xffc6ad17*/
  do /*0xffc6ad6a*/
  {
    if ( (*v5 & 1) != 0 ) /*0xffc6ad1e*/
    {
      memset_save_flags(bufa, 0, 0xB8u); /*0xffc6ad2b*/
      KtiRingTreeNodeAdd(__return_address, buf, bufa, n4); /*0xffc6ad3b*/
      KtiTopologyPathCheck(__return_address, buf, bufa, n4); /*0xffc6ad4b*/
      n4_1 = n4; /*0xffc6ad50*/
      v5 = v10; /*0xffc6ad57*/
    }
    ++n4_1; /*0xffc6ad5b*/
    v5 += 13; /*0xffc6ad5d*/
    n4 = n4_1; /*0xffc6ad60*/
    v10 = v5; /*0xffc6ad64*/
  }
  while ( n4_1 < 4u ); /*0xffc6ad6a*/
  v6 = *(_BYTE *)(buf + 5); /*0xffc6ad6c*/
  if ( v6 )
  {
    RcAssertPrint(__return_address, 4u, (int)"\n  %u Ring(s) Found", v6); /*0xffc6ad91*/
    if ( *(_BYTE *)(buf + 5) )
    {
      do
      {
        RcAssertPrint(
          __return_address,
          4u,
          (int)"\n    Ring %u:   CPU%u -> CPU%u -> CPU%u -> CPU%u -> CPU%u",
          (unsigned __int8)v2,
          *(unsigned __int8 *)(5 * (unsigned __int8)v2 + buf + 66),
          *(unsigned __int8 *)(5 * (unsigned __int8)v2 + buf + 67),
          *(unsigned __int8 *)(5 * (unsigned __int8)v2 + buf + 68),
          *(unsigned __int8 *)(5 * (unsigned __int8)v2 + buf + 69),
          *(unsigned __int8 *)(5 * ((unsigned __int8)v2 + 14) + buf));
        LOBYTE(v2) = v2 + 1; /*0xffc6add8*/
      }
      while ( (unsigned __int8)v2 < *(_BYTE *)(buf + 5) );
      v2 = 0; /*0xffc6addf*/
    }
  }
  else
  {
    RcAssertPrint(__return_address, 4u, (int)"\n  No Rings Found"); /*0xffc6ad7b*/
  }
  if ( *(_BYTE *)(buf + 5) ) /*0xffc6ade1*/
  {
    KtiTopoNodeMap(__return_address, buf); /*0xffc6ade9*/
    RcAssertPrint(__return_address, 4u, (int)"\n\n  Ring Pairs:"); /*0xffc6adf6*/
    n4_2 = 4; /*0xffc6ae00*/
    n4_3 = 4; /*0xffc6ae01*/
    do /*0xffc6ae37*/
    {
      if ( (*v4 & 1) != 0 ) /*0xffc6ae09*/
      {
        v8 = *(_BYTE *)(v2 + buf + 6); /*0xffc6ae0b*/
        if ( v8 != 0xFF ) /*0xffc6ae11*/
        {
          RcAssertPrint(__return_address, 4u, (int)"\n    %u  -  %u", v2, v8); /*0xffc6ae20*/
          n4_2 = n4_3; /*0xffc6ae25*/
        }
      }
      ++v2; /*0xffc6ae2c*/
      v4 += 13; /*0xffc6ae2d*/
      n4_3 = --n4_2; /*0xffc6ae33*/
    }
    while ( n4_2 ); /*0xffc6ae37*/
  }
  return 0; /*0xffc6ae39*/
}

// Function: KtiPortPhyCheck @ 0xffc6ae46 (0xf2 bytes)
// Index: 897/2560

int __cdecl KtiPortPhyCheck(char *__return_address, char *n4)
{
  int v2; // ecx
  int n4_1; // edx
  char *v4; // edi
  int v5; // esi
  int __return_address_1; // eax
  unsigned __int8 v7; // bl
  unsigned int v8; // edx
  int v9; // [esp+10h] [ebp-10h]
  int v10; // [esp+14h] [ebp-Ch]
  int n4_2; // [esp+18h] [ebp-8h]

  v2 = 0; /*0xffc6ae4f*/
  n4_1 = 4; /*0xffc6ae55*/
  v9 = 0; /*0xffc6ae56*/
  v4 = n4 + 196; /*0xffc6ae5a*/
  v5 = 0; /*0xffc6ae60*/
  n4_2 = 4; /*0xffc6ae62*/
  do /*0xffc6af2a*/
  {
    LOBYTE(__return_address_1) = n4[v5]; /*0xffc6ae66*/
    if ( (__return_address_1 & 1) != 0 && (__return_address_1 & 0x60) == 0 ) /*0xffc6ae73*/
    {
      __return_address_1 = (int)__return_address; /*0xffc6ae79*/
      v7 = 0; /*0xffc6ae7d*/
      if ( __return_address[255496] ) /*0xffc6ae7f*/
      {
        do /*0xffc6af0a*/
        {
          v8 = *(_DWORD *)&n4[4 * v7 + 1 + v5]; /*0xffc6ae95*/
          if ( (v8 & 1) != 0 ) /*0xffc6ae9c*/
          {
            v10 = (v8 >> 1) & 7; /*0xffc6aeb2*/
            if ( !*(_DWORD *)&n4[56 * v10 + 200 + 8 * (((v8 >> 6) & 0xF) >> 1) + 4 * ((v8 >> 6) & 1)] ) /*0xffc6aec0*/
            {
              *(_DWORD *)v4 &= ~(1 << v7 << (4 * v10)); /*0xffc6aef4*/
              RcAssertPrint( /*0xffc6aef6*/
                __return_address,
                8u,
                (int)"\n CPU%1u CHA Snoop fanout optimized for Link%1u target CPU%1u",
                v9,
                v7,
                v10);
            }
          }
          __return_address_1 = (int)__return_address; /*0xffc6aefe*/
          ++v7; /*0xffc6af02*/
        }
        while ( v7 < (unsigned __int8)__return_address[255496] ); /*0xffc6af0a*/
        v2 = v9; /*0xffc6af10*/
        n4_1 = n4_2; /*0xffc6af14*/
      }
    }
    ++v2; /*0xffc6af18*/
    v5 += 13; /*0xffc6af19*/
    v4 += 56; /*0xffc6af1c*/
    v9 = v2; /*0xffc6af1f*/
    n4_2 = --n4_1; /*0xffc6af26*/
  }
  while ( n4_1 ); /*0xffc6af2a*/
  return __return_address_1; /*0xffc6af30*/
}

// Function: KtiTopoNodeMap @ 0xffc6af38 (0xbe bytes)
// Index: 898/2560

int __cdecl KtiTopoNodeMap(char *__return_address, _BYTE *buf)
{
  unsigned __int8 i; // bl
  unsigned __int8 *v4; // ebp
  int v5; // edx
  unsigned __int8 *v6; // esi
  _BYTE *v7; // edx
  unsigned __int8 j; // bl
  unsigned __int8 j_1; // cl
  char v10; // ch
  int v11; // ebp
  char v12; // ah
  int bufa; // [esp+18h] [ebp+8h]

  for ( i = 0; i < buf[5]; ++i ) /*0xffc6af42*/
  {
    bufa = 4; /*0xffc6af50*/
    v4 = &buf[5 * i + 66]; /*0xffc6af58*/
    do /*0xffc6af7d*/
    {
      v5 = *v4; /*0xffc6af5a*/
      buf[6 * v5 + 97 + (unsigned __int8)buf[6 * v5 + 96]++] = i; /*0xffc6af6d*/
      ++v4; /*0xffc6af77*/
      --bufa; /*0xffc6af78*/
    }
    while ( bufa ); /*0xffc6af7d*/
  }
  v6 = buf + 6; /*0xffc6af88*/
  memset_save_flags(buf + 6, 255, 4u); /*0xffc6af91*/
  v7 = buf + 98; /*0xffc6af99*/
  for ( j = 0; j < 4u; ++j ) /*0xffc6af9c*/
  {
    if ( *(v7 - 2) == 2 ) /*0xffc6afa2*/
    {
      j_1 = 0; /*0xffc6afa4*/
      while ( 1 ) /*0xffc6afa8*/
      {
        if ( j_1 != j && buf[6 * j_1 + 96] == 2 ) /*0xffc6afb7*/
        {
          v10 = *(v7 - 1); /*0xffc6afb9*/
          v11 = 6 * j_1; /*0xffc6afbc*/
          v12 = buf[v11 + 97]; /*0xffc6afbf*/
          if ( v10 == v12 && *v7 == buf[v11 + 98] ) /*0xffc6afcd*/
            break; /*0xffc6afcd*/
          if ( v10 == buf[v11 + 98] && *v7 == v12 ) /*0xffc6afd7*/
            break; /*0xffc6afd7*/
        }
        if ( ++j_1 >= 4u ) /*0xffc6afde*/
          goto LABEL_17; /*0xffc6afde*/
      }
      *v6 = j_1; /*0xffc6afe2*/
    }
LABEL_17:
    v7 += 6; /*0xffc6afe6*/
    ++v6; /*0xffc6afe9*/
  }
  return 0; /*0xffc6afef*/
}

// Function: KtiTopoTreeInit @ 0xffc6aff6 (0x12f bytes)
// Index: 899/2560

int __cdecl KtiTopoTreeInit(char *__return_address, char *n4, char *buf, _BYTE *buf_1)
{
  _BYTE *v5; // ebp
  char n4a_1; // cl
  int v7; // edi
  char v8; // al
  int v9; // eax
  unsigned __int8 j_1; // al
  unsigned int v11; // eax
  unsigned __int8 i; // dl
  unsigned int v13; // eax
  bool v14; // zf
  int n4_1; // [esp+10h] [ebp-Ch]
  int v17; // [esp+18h] [ebp-4h]
  char n4a; // [esp+24h] [ebp+8h]
  unsigned __int8 j; // [esp+2Ch] [ebp+10h]

  memset_save_flags(buf_1, 0, 0xE4u); /*0xffc6b009*/
  v5 = buf_1 + 14; /*0xffc6b014*/
  AutoGenFunc8E72((int)(buf_1 + 14), n4, 52); /*0xffc6b018*/
  n4a_1 = 0; /*0xffc6b021*/
  n4a = 0; /*0xffc6b026*/
  v7 = 0; /*0xffc6b02a*/
  n4_1 = 4; /*0xffc6b02c*/
  do /*0xffc6b115*/
  {
    v8 = v5[v7]; /*0xffc6b034*/
    if ( (v8 & 1) == 0 || (v8 & 0x60) != 0 ) /*0xffc6b03d*/
    {
      if ( (v8 & 0x60) == 0x20 && !ProcCommonFuncACEC((int)__return_address, (int)buf) ) /*0xffc6b0bd*/
      {
        v5[v7] &= ~1u; /*0xffc6b0c8*/
        for ( i = 0; i < (unsigned __int8)__return_address[255496]; ++i ) /*0xffc6b0ce*/
        {
          v13 = *(_DWORD *)&buf_1[4 * i + 15 + v7]; /*0xffc6b0dc*/
          if ( (v13 & 1) != 0 ) /*0xffc6b0e2*/
            *(_DWORD *)&buf_1[13 * ((v13 >> 1) & 7) + 15 + 4 * ((v13 >> 6) & 0xF)] &= ~1u; /*0xffc6b0f6*/
        }
      }
    }
    else
    {
      v9 = *(_DWORD *)(buf_1 + 1); /*0xffc6b03f*/
      ++*buf_1; /*0xffc6b042*/
      *(_DWORD *)(buf_1 + 1) = v9 | (1 << n4a_1); /*0xffc6b047*/
      j_1 = 0; /*0xffc6b04a*/
      for ( j = 0; j_1 < (unsigned __int8)__return_address[255496]; j = j_1 ) /*0xffc6b050*/
      {
        v17 = v7 + 4 * j_1; /*0xffc6b062*/
        v11 = *(_DWORD *)&buf_1[v17 + 15]; /*0xffc6b066*/
        if ( (v11 & 1) != 0 && (v11 & 0x30) == 0 ) /*0xffc6b070*/
          *(_DWORD *)&buf_1[v17 + 15] ^= (*(_DWORD *)&buf_1[v17 + 15] /*0xffc6b09a*/
                                        ^ ((unsigned __int8)ProcCommonFuncB0C5((int)__return_address, (v11 >> 6) & 0xF) << 6))
                                       & 0x3C0;
        j_1 = j + 1; /*0xffc6b0a2*/
      }
    }
    ++n4a; /*0xffc6b105*/
    v7 += 13; /*0xffc6b109*/
    v14 = n4_1-- == 1; /*0xffc6b10c*/
    n4a_1 = n4a; /*0xffc6b111*/
  }
  while ( !v14 ); /*0xffc6b115*/
  return 0; /*0xffc6b11b*/
}

// Function: KtiPortMaskBitSet @ 0xffc6b125 (0x62 bytes)
// Index: 900/2560

int __cdecl KtiPortMaskBitSet(char *n4, char *buf, _BYTE *p_p_i, char a4, int ia_, int a6, int a7, _DWORD *a8)
{
  int v8; // edx
  char v9; // si
  char v10; // di
  char *v11; // ebx
  char *retaddr; // [esp+14h] [ebp+0h]

  v8 = 0; /*0xffc6b12a*/
  v9 = 0; /*0xffc6b132*/
  v10 = 0; /*0xffc6b140*/
  v11 = retaddr; /*0xffc6b142*/
  do /*0xffc6b164*/
  {
    if ( ((1 << v9) & *((_DWORD *)p_p_i + 25)) != 0 ) /*0xffc6b14c*/
      v8 |= 1 << a4 << v10; /*0xffc6b15b*/
    ++v9; /*0xffc6b15d*/
    v10 += 4; /*0xffc6b15e*/
    --v11; /*0xffc6b161*/
  }
  while ( v11 ); /*0xffc6b164*/
  *(_DWORD *)&p_p_i[56 * ((*a8 >> 1) & 7) + 196] |= v8; /*0xffc6b17c*/
  return 0; /*0xffc6b16a*/
}

// Function: sub_FFC6B187 @ 0xffc6b187 (0x14f bytes)
// Index: 901/2560

// Function: KtiPortConnectionResolve @ 0xffc6b2d6 (0x1ff bytes)
// Index: 902/2560

int __cdecl KtiPortConnectionResolve(
        char *__return_address,
        char *n4,
        char *buf,
        unsigned int *n216,
        _DWORD *p_p_i_2,
        _BYTE *p_p_i_3,
        char a7)
{
  _BYTE *p_p_i; // edi
  unsigned int v9; // ecx
  int v10; // eax
  _DWORD *p_p_i_1; // esi
  char v12; // al
  unsigned int p_i; // ecx
  char v14; // dl
  unsigned int p_i_1; // eax
  unsigned int n216a_1; // eax
  int v17; // edx
  unsigned __int8 v19; // [esp+13h] [ebp-5h] BYREF
  int ia_; // [esp+14h] [ebp-4h] BYREF
  char n216a; // [esp+28h] [ebp+10h]

  p_p_i = p_p_i_2; /*0xffc6b2e0*/
  v9 = (*n216 >> 1) & 7; /*0xffc6b2e9*/
  v19 = -1; /*0xffc6b2ec*/
  v10 = (*p_p_i_2 >> 1) & 7; /*0xffc6b2f5*/
  LOBYTE(ia_) = -1; /*0xffc6b2f8*/
  if ( v10 != v9 || ((*(_BYTE *)n216 ^ *(_BYTE *)p_p_i_2) & 0x30) != 0 )
  {
    if ( (*(_BYTE *)p_p_i_2 & 0x30) != 0 )
    {
      RcAssertPrint(__return_address, 1u, (int)"\n Unknown Intermediate Socket Type found in CPU %u Topology Tree.", v9); /*0xffc6b4b5*/
      RcAssertPrint(__return_address, 1u, (int)"\n Topology not supported\n"); /*0xffc6b4c4*/
    }
    else if ( buf[122] != 1 || a7 == 1 )
    {
      v12 = ProcCommonFunc86D1(__return_address, (int)n4, p_p_i_2, p_p_i_3); /*0xffc6b3fa*/
      p_i = *(_DWORD *)p_p_i; /*0xffc6b3ff*/
      v14 = v12; /*0xffc6b401*/
      p_i_1 = *(_DWORD *)p_p_i; /*0xffc6b403*/
      LOBYTE(ia_) = v14; /*0xffc6b405*/
      n216a_1 = (p_i_1 >> 8) & 0xFFFFFF0F; /*0xffc6b40e*/
      n216a = n216a_1; /*0xffc6b417*/
      if ( v14 == -1 )
      {
        RcAssertPrint( /*0xffc6b439*/
          __return_address,
          1u,
          (int)"\n Invalid Port connection between CPU %u and CPU %u.",
          (p_i >> 1) & 7,
          (*(_DWORD *)p_p_i_3 >> 1) & 7);
        RcAssertPrint(
          __return_address,
          1u,
          (int)"\n\n %s: %u   %s ",
          "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiDisc.c",
          2746,
          "FALSE");
        KtiDebugAssert((int)__return_address, 220, 9); /*0xffc6b461*/
        LOBYTE(n216a_1) = n216a; /*0xffc6b466*/
      }
      v17 = (n216a_1 & 1) + 2 * (((unsigned __int8)n216a_1 >> 1) + 7 * ((*(_DWORD *)p_p_i >> 1) & 7)); /*0xffc6b48d*/
      *(_DWORD *)&n4[4 * v17 + 200] |= 1 << ia_ << (3 * ((*n216 >> 1) & 7)); /*0xffc6b49e*/
    }
  }
  else
  {
    p_p_i_1 = p_p_i_3; /*0xffc6b312*/
    if ( ProcCommonFunc8594(__return_address, (int)n4, p_p_i_2, p_p_i_3) )
    {
      ProcCommonFunc882E( /*0xffc6b341*/
        __return_address,
        (int)n4,
        p_p_i,
        p_p_i_1,
        (unsigned __int8 *)&ia_,
        &v19,
        (unsigned __int8 *)&p_p_i_2);
    }
    else
    {
      LOBYTE(ia_) = ProcCommonFunc86D1(__return_address, (int)n4, p_p_i, p_p_i_1); /*0xffc6b357*/
      if ( (_BYTE)ia_ == 0xFF )
      {
        RcAssertPrint( /*0xffc6b379*/
          __return_address,
          1u,
          (int)"\n Invalid Port connection between CPU%u and CPU%u. ",
          (*(_DWORD *)p_p_i >> 1) & 7,
          (*p_p_i_1 >> 1) & 7);
        RcAssertPrint(
          __return_address,
          1u,
          (int)"\n\n %s: %u   %s ",
          "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiDisc.c",
          2732,
          "FALSE");
        KtiDebugAssert((int)__return_address, 220, 9); /*0xffc6b3a1*/
      }
    }
    KtiPortMaskBitSet(n4, buf, p_p_i, (*n216 >> 1) & 7, ia_); /*0xffc6b3c1*/
  }
  return 0; /*0xffc6b4cc*/
}

// Function: DdrTrainingFuncB4D5 @ 0xffc6b4d5 (0x3ab bytes)
// Index: 903/2560

int __cdecl DdrTrainingFuncB4D5(
        char *__return_address,
        char *n4,
        char *buf,
        int n216,
        unsigned int *a5,
        unsigned int *a6,
        _DWORD *a7)
{
  unsigned int *v7; // ebp
  char *__return_address_1; // ebx
  _DWORD *v9; // esi
  char *n4_1; // edi
  bool v11; // al
  unsigned int p_i_1; // eax
  unsigned int v13; // eax
  int v14; // ebx
  int v15; // ebp
  int v16; // esi
  int v17; // ecx
  int v18; // esi
  int v19; // eax
  unsigned int p_i; // [esp+10h] [ebp-2Ch] BYREF
  unsigned int p_i_2; // [esp+14h] [ebp-28h] BYREF
  unsigned __int8 ia[4]; // [esp+18h] [ebp-24h] BYREF
  int v24; // [esp+1Ch] [ebp-20h] BYREF
  int v25; // [esp+20h] [ebp-1Ch] BYREF
  int v26; // [esp+24h] [ebp-18h]
  char v27[4]; // [esp+28h] [ebp-14h]
  char i[4]; // [esp+2Ch] [ebp-10h]
  unsigned int v29; // [esp+30h] [ebp-Ch]
  int p_p_i; // [esp+34h] [ebp-8h] BYREF
  int i_1; // [esp+38h] [ebp-4h] BYREF
  unsigned int v32; // [esp+54h] [ebp+18h]
  unsigned __int8 v33; // [esp+54h] [ebp+18h]

  v7 = a5; /*0xffc6b4da*/
  __return_address_1 = __return_address; /*0xffc6b4de*/
  v9 = a7; /*0xffc6b4e3*/
  n4_1 = n4; /*0xffc6b4f5*/
  v11 = (n4[13 * ((*a5 >> 1) & 7)] & 0x10) != 0; /*0xffc6b4ff*/
  p_i_2 = *a7; /*0xffc6b501*/
  LOBYTE(v26) = v11; /*0xffc6b505*/
  p_i_1 = *a6; /*0xffc6b50d*/
  for ( p_i = *a6; ; p_i_1 = p_i )
  {
    v32 = *v7; /*0xffc6b518*/
    if ( ((p_i_1 >> 1) & 7) == ((*v7 >> 1) & 7) && (((unsigned __int8)p_i_1 ^ (unsigned __int8)v32) & 0x30) == 0 ) /*0xffc6b533*/
      break; /*0xffc6b533*/
    if ( (p_i_1 & 0x30) != 0 )
    {
      RcAssertPrint( /*0xffc6b686*/
        __return_address_1,
        1u,
        (int)"\n Unknown Intermediate Socket Type found in CPU%u Topology Tree. ",
        (v32 >> 1) & 7);
      RcAssertPrint(
        __return_address_1,
        1u,
        (int)"\n\n %s: %u   %s ",
        "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiDisc.c",
        2674,
        "FALSE");
      KtiDebugAssert((int)__return_address_1, 220, 1); /*0xffc6b6af*/
    }
    else
    {
      ProcCommonFunc8C88(__return_address_1, n216, &p_i, &i_1); /*0xffc6b550*/
      v24 = (p_i >> 8) & 0xFFFFFF0F; /*0xffc6b561*/
      i[0] = BYTE1(p_i) & 0xF; /*0xffc6b565*/
      v33 = ProcCommonFunc86D1(__return_address_1, (int)n4_1, &p_i, &p_i_2); /*0xffc6b57d*/
      ia[0] = v33; /*0xffc6b581*/
      if ( v33 == 0xFF )
      {
        RcAssertPrint( /*0xffc6b5a5*/
          __return_address_1,
          1u,
          (int)"\n Invalid Port connection between CPU%u and CPU%u. ",
          (p_i >> 1) & 7,
          (p_i_2 >> 1) & 7);
        RcAssertPrint(
          __return_address_1,
          1u,
          (int)"\n\n %s: %u   %s ",
          "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiDisc.c",
          2669,
          "FALSE");
        KtiDebugAssert((int)__return_address_1, 220, 9); /*0xffc6b5ce*/
        v33 = ia[0]; /*0xffc6b5da*/
      }
      v13 = (*v9 >> 1) & 0xFFFFFF07; /*0xffc6b5ea*/
      v27[0] = (*v9 >> 1) & 7; /*0xffc6b5f1*/
      v29 = v13; /*0xffc6b5f8*/
      v14 = (unsigned __int8)v24; /*0xffc6b600*/
      v15 = 14 * ((p_i >> 1) & 7); /*0xffc6b603*/
      v16 = (unsigned __int8)v24 >> 1; /*0xffc6b608*/
      v24 = *(_DWORD *)&n4[4 * v16 + 180 + 4 * v15]; /*0xffc6b614*/
      ProcCommonFunc8272(i[0], ia[0], v27[0], &v24); /*0xffc6b629*/
      n4_1 = n4; /*0xffc6b638*/
      v17 = v16 + v15; /*0xffc6b63f*/
      v18 = v14 + v15; /*0xffc6b641*/
      __return_address_1 = __return_address; /*0xffc6b644*/
      v7 = a5; /*0xffc6b648*/
      *(_DWORD *)&n4[4 * v17 + 180] = v24; /*0xffc6b64c*/
      *(_DWORD *)&n4[4 * v18 + 216] = (v33 << (2 * v29)) | *(_DWORD *)&n4[4 * v18 + 216] & ~(3 << (2 * v29)); /*0xffc6b670*/
      v9 = a7; /*0xffc6b677*/
    }
    p_i_2 = p_i; /*0xffc6b6bb*/
    ProcCommonFunc8C88(__return_address_1, n216, &p_i_2, &p_i); /*0xffc6b6ce*/
  }
  if ( (p_i_1 & 0x30) != 0 )
  {
    RcAssertPrint( /*0xffc6b845*/
      __return_address_1,
      1u,
      (int)"\n Unknown Socket Type found in CPU%u TopologyTree. \n ",
      (*v7 >> 1) & 7);
    RcAssertPrint(
      __return_address_1,
      1u,
      (int)"\n\n %s: %u   %s ",
      "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiDisc.c",
      2657,
      "FALSE");
    KtiDebugAssert((int)__return_address_1, 220, 1); /*0xffc6b86e*/
  }
  else if ( ProcCommonFunc8594(__return_address_1, (int)n4_1, &p_i, &p_i_2) )
  {
    ProcCommonFunc882E( /*0xffc6b71e*/
      __return_address_1,
      (int)n4_1,
      &p_i,
      &p_i_2,
      ia,
      (unsigned __int8 *)&v25,
      (unsigned __int8 *)&p_p_i);
    if ( ia[0] == 0xFF || (v19 = v25, (_BYTE)v25 == 0xFF) )
    {
      RcAssertPrint( /*0xffc6b751*/
        __return_address_1,
        1u,
        (int)"\n Invalid Dual-Link between CPU%u and CPU%u. ",
        (p_i >> 1) & 7,
        (p_i_2 >> 1) & 7);
      RcAssertPrint(
        __return_address_1,
        1u,
        (int)"\n\n %s: %u   %s ",
        "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiDisc.c",
        2644,
        "FALSE");
      KtiDebugAssert((int)__return_address_1, 220, 9); /*0xffc6b77a*/
      v19 = v25; /*0xffc6b77f*/
    }
    sub_FFC6B187(__return_address_1, n4_1, buf, (p_i >> 1) & 7, (*v9 >> 1) & 7, *(_DWORD *)ia, v19, p_p_i, 1, v26); /*0xffc6b791*/
  }
  else
  {
    ia[0] = ProcCommonFunc86D1(__return_address_1, (int)n4_1, &p_i, &p_i_2); /*0xffc6b7a7*/
    if ( ia[0] == 0xFF )
    {
      RcAssertPrint( /*0xffc6b7cb*/
        __return_address_1,
        1u,
        (int)"\n Invalid Link between CPU%u and CPU%u. ",
        (p_i >> 1) & 7,
        (p_i_2 >> 1) & 7);
      RcAssertPrint(
        __return_address_1,
        1u,
        (int)"\n\n %s: %u   %s ",
        "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiDisc.c",
        2651,
        "FALSE");
      KtiDebugAssert((int)__return_address_1, 220, 9); /*0xffc6b7f4*/
    }
    sub_FFC6B187( /*0xffc6b82a*/
      __return_address_1,
      n4_1,
      buf,
      (p_i >> 1) & 7,
      (*v9 >> 1) & 7,
      *(_DWORD *)ia,
      *(_DWORD *)ia,
      *(_DWORD *)ia,
      0,
      v26);
  }
  return 0; /*0xffc6b876*/
}

// Function: DdrTrainFuncB880 @ 0xffc6b880 (0x11e bytes)
// Index: 904/2560

int __cdecl DdrTrainFuncB880(_BYTE *__return_address, int a2, int a3, unsigned int a4, char a5)
{
  unsigned int v5; // ecx
  unsigned int v6; // eax
  unsigned __int8 n2; // dl
  unsigned int v8; // eax
  int v9; // ecx
  int n2_1; // ebx
  int v11; // eax
  unsigned int v13; // [esp+0h] [ebp-4h] BYREF

  v13 = v5; /*0xffc6b880*/
  v6 = *(_DWORD *)a4; /*0xffc6b885*/
  v13 = v6; /*0xffc6b887*/
  if ( (v6 & 0xF000) != 0 )
  {
    while ( 1 )
    {
      a4 = *(_DWORD *)(a3 + 4 * ((v6 >> 19) & 0x7F)); /*0xffc6b8b1*/
      n2 = ProcCommonFunc86D1(__return_address, a2 + 14, &a4, &v13); /*0xffc6b8c6*/
      if ( n2 > 2u ) /*0xffc6b8ce*/
        break; /*0xffc6b8ce*/
      v8 = a4; /*0xffc6b8e2*/
      if ( a5 )
      {
        n2_1 = n2; /*0xffc6b8ff*/
        if ( !*(_BYTE *)(n2 + 3 * (((a4 >> 1) & 7) + 40) + a2) )
        {
          RcAssertPrint(
            __return_address,
            1u,
            (int)"\n\n %s: %u   %s ",
            "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiDisc.c",
            1236,
            "(DiscEngData->LinkLoad[Parent.Node.SocId][Port0] != 0)");
          KtiDebugAssert((int)__return_address, 223, 92); /*0xffc6b939*/
          v8 = a4; /*0xffc6b93e*/
        }
        v11 = n2_1 + 3 * (((v8 >> 1) & 7) + 40); /*0xffc6b950*/
        --*(_BYTE *)(v11 + a2); /*0xffc6b952*/
      }
      else
      {
        v9 = a2 + 3 * (((a4 >> 1) & 7) + 40); /*0xffc6b8f6*/
        ++*(_BYTE *)(n2 + v9); /*0xffc6b8f8*/
      }
      v6 = a4; /*0xffc6b955*/
      v13 = a4; /*0xffc6b959*/
      if ( (a4 & 0xF000) == 0 ) /*0xffc6b962*/
        return 0; /*0xffc6b962*/
    }
    RcAssertPrint(
      __return_address,
      1u,
      (int)"\n\n %s: %u   %s ",
      "e:\\hs\\PurleySktPkg\\Library\\ProcMemInit\\Chip\\Kti\\KtiDisc.c",
      1230,
      "(Port0 < MAX_KTI_PORTS)");
    KtiDebugAssert((int)__return_address, 223, 89); /*0xffc6b98e*/
  }
  return 0; /*0xffc6b99d*/
}

// Function: DdrTrainFuncB99E @ 0xffc6b99e (0x80 bytes)
// Index: 905/2560

int __cdecl DdrTrainFuncB99E(int __return_address)
{
  int v1; // eax

  v1 = *(_DWORD *)(__return_address + 628656); /*0xffc6b9a3*/
  *(_DWORD *)(__return_address + 243538) = 0; /*0xffc6b9a9*/
  if ( (~(_WORD)v1 & 0x2000) == 0 || !*(_BYTE *)(__return_address + 172) ) /*0xffc6b9b9*/
  {
    if ( (*(_WORD *)(__return_address + 243542) = 0, /*0xffc6b9e5*/
          *(_BYTE *)(__return_address + 243576) = 0,
          CheckAndDispatch(__return_address) == 1)
      && *(_BYTE *)(__return_address + 171)
      || *(_BYTE *)(__return_address + 172) )
    {
      if ( *(_DWORD *)(__return_address + 9405) == 11 /*0xffc6ba00*/
        && (*(_BYTE *)(__return_address + 173) == 1 || *(_BYTE *)(__return_address + 171)) )
      {
        ProcCommonFunc7A5(__return_address, 1); /*0xffc6ba0c*/
      }
      IioFunc156B(__return_address); /*0xffc6ba14*/
    }
  }
  return 0; /*0xffc6ba1c*/
}

// Function: DdrTrainFuncBA1E @ 0xffc6ba1e (0x75 bytes)
// Index: 906/2560

int __cdecl DdrTrainFuncBA1E(int a1)
{
  int v2; // eax
  int v3; // eax
  int v6; // [esp-4h] [ebp-Ch]
  unsigned __int8 v7; // [esp+10h] [ebp+8h]

  v6 = a1 + 255608; /*0xffc6ba32*/
  v7 = *(_BYTE *)(a1 + 9402); /*0xffc6ba34*/
  AutoGenFuncE81E(a1, v6); /*0xffc6ba37*/
  v2 = 48704 * v7; /*0xffc6ba3f*/
  if ( *(_BYTE *)(v2 + a1 + 258689) && *(_BYTE *)(v2 + a1 + 258716) ) /*0xffc6ba51*/
  {
    *(_BYTE *)(v2 + a1 + 258717) = 0; /*0xffc6ba61*/
    v3 = MailBoxFunc8EB3(a1, v7, 117459124); /*0xffc6ba6e*/
    MailBoxFunc9076(a1, v7, 117459124, v3 | 0x1E00); /*0xffc6ba7e*/
    DdrTrainFunc2D59(a1); /*0xffc6ba84*/
  }
  return 0; /*0xffc6ba8d*/
}

// Function: DdrTrainFuncBA93 @ 0xffc6ba93 (0x316 bytes)
// Index: 907/2560

int __cdecl DdrTrainFuncBA93(int a1)
{
  unsigned __int8 v2; // bl
  _DWORD *v3; // ecx
  unsigned __int8 n4; // bh
  int v5; // ebp
  int SocketInfo; // eax
  unsigned __int8 n6; // cl
  unsigned __int8 *v8; // edi
  int v9; // eax
  unsigned __int8 i_1; // al
  int v11; // edx
  int v12; // eax
  unsigned int n100; // edi
  unsigned __int8 n4_1; // bl
  char v15; // di
  int v16; // eax
  char v18; // [esp+13h] [ebp-11h]
  unsigned __int8 n4_2; // [esp+14h] [ebp-10h]
  unsigned __int8 n4_3; // [esp+14h] [ebp-10h]
  int n6_1; // [esp+18h] [ebp-Ch]
  int v22; // [esp+1Ch] [ebp-8h]
  int CpuCount; // [esp+20h] [ebp-4h]
  unsigned __int8 i; // [esp+28h] [ebp+4h]

  v2 = 0; /*0xffc6ba9f*/
  v18 = 0; /*0xffc6baa1*/
  if ( !*(_BYTE *)(a1 + 246400) ) /*0xffc6baab*/
  {
    DebugPrint(a1, 2, 255, 255, 255, 255, 255, 255, "No Pending Reset, clearing the ADR status bit\n"); /*0xffc6bac1*/
    AutoGenFunc105D(v3); /*0xffc6bac9*/
  }
  n4 = 0; /*0xffc6bace*/
  v5 = 0; /*0xffc6bad0*/
  n4_2 = 0; /*0xffc6bad2*/
  do /*0xffc6bbf8*/
  {
    SocketInfo = GetSocketInfo(a1, n4_2); /*0xffc6badb*/
    n6 = 0; /*0xffc6bae2*/
    v22 = 0; /*0xffc6bae4*/
    v8 = (unsigned __int8 *)(SocketInfo + 3); /*0xffc6bae9*/
    LOBYTE(n6_1) = 0; /*0xffc6baec*/
    v9 = 0; /*0xffc6baf0*/
    do /*0xffc6bbd7*/
    {
      if ( *(v8 - 3) ) /*0xffc6baf4*/
      {
        CpuCount = GetCpuCount(a1, n4_2, n6_1); /*0xffc6bb0c*/
        i_1 = 0; /*0xffc6bb13*/
        for ( i = 0; i_1 < *v8; i = i_1 ) /*0xffc6bb19*/
        {
          v11 = 1379 * i_1; /*0xffc6bb24*/
          if ( *(_BYTE *)(v11 + CpuCount) /*0xffc6bb50*/
            && *(_BYTE *)(a1 + 259)
            && *(_BYTE *)(a1 + 244313) <= 1u
            && *(_BYTE *)(v11 + CpuCount + 107) )
          {
            v12 = MiscConfigCheck((unsigned __int8 *)a1, n4_2, n6_1, 184566240); /*0xffc6bb65*/
            MiscIoCheck((unsigned __int8 *)a1, n4_2, n6_1, 0xB0041E0u, v12 & 0xFFFFFFE0 | 0x11); /*0xffc6bb7f*/
            DebugPrint(a1, 2, 255, 255, 255, 255, 255, 255, "%d:%d   Set ddrt_adr_en = 1\n", v5, v22); /*0xffc6bb9c*/
            i_1 = i; /*0xffc6bba1*/
            v18 = 1; /*0xffc6bba8*/
          }
          ++i_1; /*0xffc6bbad*/
        }
        v9 = v22; /*0xffc6bbbb*/
        n6 = n6_1; /*0xffc6bbbf*/
      }
      ++n6; /*0xffc6bbc3*/
      v8 += 7688; /*0xffc6bbc5*/
      ++v9; /*0xffc6bbcb*/
      LOBYTE(n6_1) = n6; /*0xffc6bbcc*/
      v22 = v9; /*0xffc6bbd0*/
    }
    while ( n6 < 6u ); /*0xffc6bbd7*/
    if ( ((1 << v5) & *(_DWORD *)(a1 + 246468)) != 0 ) /*0xffc6bbea*/
      ++v2; /*0xffc6bbec*/
    ++n4; /*0xffc6bbee*/
    ++v5; /*0xffc6bbf0*/
    n4_2 = n4; /*0xffc6bbf1*/
  }
  while ( n4 < 4u ); /*0xffc6bbf8*/
  if ( v18 ) /*0xffc6bc04*/
  {
    DebugPrint(a1, 2, 255, 255, 255, 255, 255, 255, "Reconfigure PCH ADR timer and sources for AEP dimms\n"); /*0xffc6bc1d*/
    if ( *(_BYTE *)(a1 + 260) ) /*0xffc6bc25*/
    {
      n100 = 100; /*0xffc6bccf*/
      DebugPrint(a1, 2, 255, 255, 255, 255, 255, 255, "ADR Legacy mode enabled - PCH ADR timer value = %d us\n", v2); /*0xffc6bce3*/
    }
    else
    {
      switch ( v2 ) /*0xffc6bc3a*/
      {
        case 1u: /*0xffc6bc3a*/
          n100 = 400; /*0xffc6bcb4*/
          break;
        case 2u: /*0xffc6bc3a*/
          n100 = 600; /*0xffc6bcad*/
          break;
        case 4u: /*0xffc6bc3a*/
          n100 = 1200; /*0xffc6bca6*/
          break;
        case 8u: /*0xffc6bc3a*/
          n100 = 2400; /*0xffc6bc9f*/
          break;
        case 3u: /*0xffc6bc3a*/
          n100 = 1200; /*0xffc6bc52*/
          DebugPrint( /*0xffc6bc63*/
            a1,
            2,
            255,
            255,
            255,
            255,
            255,
            255,
            "Number of sockets enabled (%d) - 4S system PCH ADR timer value (%d us) will be used\n",
            3,
            1200);
          break;
        default:
          if ( (unsigned __int8)(v2 - 5) > 2u ) /*0xffc6bc70*/
          {
            n100 = 9600; /*0xffc6bc91*/
            DebugPrint( /*0xffc6bc9d*/
              a1,
              2,
              255,
              255,
              255,
              255,
              255,
              255,
              "Number of sockets enabled (%d) exceed the supported value - max PCH ADR timer value (%d us) will be used\n",
              v2,
              9600);
          }
          else
          {
            n100 = 2400; /*0xffc6bc72*/
            DebugPrint( /*0xffc6bc87*/
              a1,
              2,
              255,
              255,
              255,
              255,
              255,
              255,
              "Number of sockets enabled (%d) - 8S system PCH ADR timer value (%d us) will be used\n",
              v2,
              2400);
          }
          break;
      }
      DebugPrint( /*0xffc6bccb*/
        a1,
        2,
        255,
        255,
        255,
        255,
        255,
        255,
        "Number of sockets enabled (%d) - PCH ADR timer value = %d us\n",
        v2,
        n100);
    }
    AutoGenFunc101D(6, n100, 3); /*0xffc6bcf0*/
  }
  if ( *(_BYTE *)(a1 + 259) ) /*0xffc6bcf8*/
  {
    DebugPrint(a1, 2, 255, 255, 255, 255, 255, 255, "Enabling ADR\n"); /*0xffc6bd18*/
    if ( *(_BYTE *)(a1 + 260) ) /*0xffc6bd20*/
      goto LABEL_43; /*0xffc6bd20*/
    n4_1 = 0; /*0xffc6bd29*/
    n4_3 = 0; /*0xffc6bd30*/
    v15 = 0; /*0xffc6bd34*/
    do /*0xffc6bd72*/
    {
      if ( ((1 << v15) & *(_DWORD *)(a1 + 246468)) != 0 ) /*0xffc6bd43*/
      {
        v16 = CpuIoRead(a1, n4_3, 0, 67322100); /*0xffc6bd4d*/
        CpuIoCfgWrite(a1, n4_3, 0, 67322100, v16 | 0x40000); /*0xffc6bd60*/
      }
      ++n4_1; /*0xffc6bd68*/
      ++v15; /*0xffc6bd6a*/
      n4_3 = n4_1; /*0xffc6bd6b*/
    }
    while ( n4_1 < 4u ); /*0xffc6bd72*/
    if ( *(_BYTE *)(a1 + 260) ) /*0xffc6bd74*/
LABEL_43:
      DebugPrint(a1, 2, 255, 255, 255, 255, 255, 255, "ADR Enabled (LegacyMode)\n"); /*0xffc6bd87*/
    else
      DebugPrint(a1, 2, 255, 255, 255, 255, 255, 255, "ADR Enabled (Non-LegacyMode)\n"); /*0xffc6bd97*/
  }
  return 0; /*0xffc6bd9f*/
}

// Function: Ddr4TrainingMain @ 0xffc6bda9 (0x11be bytes)
// Index: 908/2560

int __cdecl Ddr4TrainingMain(int __return_address)
{
  int v2; // eax
  int n8; // eax
  int n2_2; // ebx
  int SocketInfo; // ebp
  unsigned __int8 n3_1; // cl
  _BYTE *SocketInfo_2; // esi
  int v8; // eax
  unsigned __int8 n3_2; // al
  _BYTE *SocketInfo_3; // esi
  int v11; // eax
  int v12; // eax
  unsigned __int8 v13; // al
  int v14; // ecx
  int v15; // esi
  int v16; // eax
  int v17; // eax
  _BYTE *v18; // edx
  unsigned __int8 n2_3; // cl
  char v20; // ch
  int v21; // eax
  int v22; // eax
  unsigned __int8 n3_3; // cl
  _BYTE *v24; // eax
  unsigned int v25; // esi
  unsigned int v26; // esi
  int v27; // eax
  int n3_6; // ecx
  unsigned __int8 n3_4; // al
  _BYTE *v30; // esi
  int v31; // edx
  int CpuCount; // eax
  char n2_5; // dl
  int n2_11; // eax
  char v35; // cl
  int n0x100000; // eax
  int v37; // edx
  int n2_12; // esi
  unsigned __int8 n9; // cl
  unsigned int v40; // eax
  unsigned __int8 n6; // al
  _BYTE *SocketInfo_4; // esi
  int v43; // ebp
  unsi... [33017 chars total]

// Function: NgnDimmThermalThrottle @ 0xffc6cf67 (0x1c53 bytes)
// Index: 909/2560

int __cdecl NgnDimmThermalThrottle(unsigned __int8 *n6)
{
  unsigned __int8 *n6_1; // ebp
  unsigned __int8 *n3_26; // eax
  int n4_2; // ebx
  unsigned __int8 v4; // al
  int SocketInfo_12; // edx
  char n2_13; // cl
  int v7; // edi
  int SocketInfo; // eax
  int v9; // ebp
  char v10; // dl
  unsigned __int8 n2_12; // al
  int v12; // ecx
  int n3_1; // esi
  _BYTE *v14; // ecx
  int n2_1; // esi
  unsigned int v16; // edi
  int v17; // eax
  char v18; // si
  int v19; // eax
  int v20; // eax
  int SocketInfo_13; // eax
  bool v22; // zf
  _BYTE *SocketInfo_14; // esi
  int n8; // ecx
  unsigned __int8 n6a_1; // al
  _BYTE *CpuCount; // edi
  unsigned __int8 n2_2; // al
  _BYTE *SocketInfo_3; // ecx
  unsigned __int8 n6a_2; // al
  unsigned int v30; // esi
  unsigned int v31; // eax
  unsigned int v32; // eax
  int v33; // esi
  unsigned __int8 n4_1; // al
  unsigned __int8 v35; // al
  char v36; // al
  int v37; // eax
  int v38; // esi
  unsigned __int8 n2_3; // al
  int v40; // ... [52488 chars total]

// Function: NgnDimmPmonInit @ 0xffc6ebba (0x209 bytes)
// Index: 910/2560

int __cdecl NgnDimmPmonInit(int n3)
{
  int n3_1; // edi
  int v2; // esi
  int n3_2; // ebp
  unsigned __int8 n6; // bl
  _BYTE *SocketInfo; // edx
  char v6; // al
  unsigned __int8 n3_3; // cl
  char v8; // al
  int v9; // eax
  int v10; // eax
  int v11; // esi
  unsigned int v12; // esi
  int v13; // eax
  unsigned __int8 n2; // [esp+8h] [ebp-1Ch]
  int v16; // [esp+Ch] [ebp-18h]
  _BYTE *SocketInfo_1; // [esp+10h] [ebp-14h]
  char v18; // [esp+14h] [ebp-10h]
  int v19; // [esp+18h] [ebp-Ch]
  int v20; // [esp+1Ch] [ebp-8h]
  char v21; // [esp+20h] [ebp-4h]

  n3_1 = n3; /*0xffc6ebbf*/
  LOBYTE(n3) = *(_BYTE *)(n3 + 9402); /*0xffc6ebc9*/
  v2 = 48704 * (unsigned __int8)n3; /*0xffc6ebd0*/
  v20 = v2; /*0xffc6ebd6*/
  if ( *(_BYTE *)(v2 + n3_1 + 258689) && *(_BYTE *)(v2 + n3_1 + 258716) ) /*0xffc6ebe8*/
  {
    n3_2 = n3; /*0xffc6ebf8*/
    n6 = 0; /*0xffc6ec03*/
    SocketInfo = (_BYTE *)GetSocketInfo(n3_1, n3); /*0xffc6ec05*/
    SocketInfo_1 = SocketInfo; /*0xffc6ec09*/
    if ( *(char *)(n3_1 + 257309) < 0 ) /*0xffc6ec13*/
    {
      v6 = 0; /*0xffc6ec19*/
      n2 = 0; /*0xffc6ec1b*/
      v16 = 0; /*0xffc6ec1f*/
      do /*0xffc6ec23*/
      {
        n3_3 = 0; /*0xffc6ec23*/
        v19 = 0; /*0xffc6ec25*/
        v8 = v6 & 1; /*0xffc6ec29*/
        LOBYTE(n3) = 0; /*0xffc6ec2c*/
        v21 = v8; /*0xffc6ec30*/
        v18 = 0; /*0xffc6ec34*/
        do /*0xffc6ed2c*/
        {
          v9 = 7688 * (unsigned __int8)(n3_3 + 3 * v8); /*0xffc6ec43*/
          if ( !SocketInfo[v9] ) /*0xffc6ec49*/
          {
            DebugPrint(n3_1, 2, n3_2, n3, 255, 255, 255, 255, "\nChannel not enabled, no SVL \n"); /*0xffc6ec64*/
LABEL_14:
            SocketInfo = SocketInfo_1; /*0xffc6ed13*/
            n3_3 = n3; /*0xffc6ed17*/
            goto LABEL_15; /*0xffc6ed17*/
          }
          v10 = v2 + v9; /*0xffc6ec71*/
          if ( !*(_BYTE *)(v10 + n3_1 + 259225) && !*(_BYTE *)(v10 + n3_1 + 260604) ) /*0xffc6ec80*/
          {
            v11 = MailBoxFunc8E0B(0, n3_1, n3_2, n2, 117459312); /*0xffc6eca1*/
            if ( KtiFuncE78(n3_1, 0, 3u) ) /*0xffc6eca3*/
            {
              v12 = v11 & 0xFFFFF1FF | 0x200; /*0xffc6ecb5*/
            }
            else
            {
              v19 |= 1 << v18; /*0xffc6ecc8*/
              v12 = ((unsigned __int16)v11 ^ (unsigned __int16)((_WORD)v19 << 9)) & 0xE00 ^ v11; /*0xffc6ecd6*/
            }
            MailBoxFunc8FC5(n3_1, n3_2, n2, 117459312, v12); /*0xffc6ece4*/
            DebugPrint( /*0xffc6ed07*/
              n3_1,
              2,
              n3_2,
              255,
              255,
              255,
              255,
              255,
              "IMC[%d].SPARING_CONTROL.virtual_lockstep_en = %d\n",
              v16,
              (v12 >> 9) & 7);
            v2 = v20; /*0xffc6ed0c*/
            goto LABEL_14; /*0xffc6ed0c*/
          }
LABEL_15:
          v8 = v21; /*0xffc6ed1b*/
          ++n3_3; /*0xffc6ed1f*/
          ++v18; /*0xffc6ed21*/
          LOBYTE(n3) = n3_3; /*0xffc6ed25*/
        }
        while ( n3_3 < 3u ); /*0xffc6ed2c*/
        ++v16; /*0xffc6ed38*/
        ++n2; /*0xffc6ed3c*/
        v6 = v16; /*0xffc6ed42*/
      }
      while ( n2 < 2u ); /*0xffc6ec23*/
    }
    LOBYTE(n3) = 0; /*0xffc6ed4c*/
    do /*0xffc6edb7*/
    {
      if ( *SocketInfo && (*(_DWORD *)(n3_1 + 130) & 0x400) != 0 ) /*0xffc6ed64*/
      {
        v13 = MiscConfigCheck((unsigned __int8 *)n3_1, n3_2, n3, 184631776); /*0xffc6ed6d*/
        MiscIoCheck((unsigned __int8 *)n3_1, n3_2, n3, 0xB0141E0u, v13 | 7); /*0xffc6ed7d*/
        DebugPrint(n3_1, 2, n3_2, n3, 255, 255, 255, 255, "\nScrambling Enabled\n"); /*0xffc6ed98*/
        SocketInfo = SocketInfo_1; /*0xffc6ed9d*/
      }
      ++n6; /*0xffc6eda4*/
      SocketInfo += 7688; /*0xffc6eda6*/
      LOBYTE(n3) = n6; /*0xffc6edac*/
      SocketInfo_1 = SocketInfo; /*0xffc6edb0*/
    }
    while ( n6 < 6u ); /*0xffc6edb7*/
  }
  return 0; /*0xffc6edbb*/
}

// Function: NgnDimmCmdControl @ 0xffc6edc3 (0x1b0 bytes)
// Index: 911/2560

int __cdecl NgnDimmCmdControl(_BYTE *n6)
{
  _BYTE *n6_1; // edi
  int v2; // eax
  _BYTE *n6_2; // ebp
  _BYTE *SocketInfo; // ecx
  unsigned __int8 n6_4; // bl
  unsigned __int8 n6_3; // al
  int v7; // eax
  int n8; // eax
  int v9; // esi
  _BYTE *SocketInfo_3; // ecx
  int CpuCount; // eax
  _BYTE *SocketInfo_1; // [esp+4h] [ebp-Ch]
  int v14; // [esp+8h] [ebp-8h]
  _BYTE *SocketInfo_2; // [esp+Ch] [ebp-4h]

  n6_1 = n6; /*0xffc6edc7*/
  LOBYTE(n6) = n6[9402]; /*0xffc6edd1*/
  v2 = 48704 * (unsigned __int8)n6; /*0xffc6edd8*/
  v14 = v2; /*0xffc6edde*/
  if ( n6_1[v2 + 258689] && n6_1[v2 + 258716] && *((_DWORD *)n6_1 + 61601) != 1 && *(_DWORD *)(n6_1 + 9405) != 10 ) /*0xffc6ee12*/
  {
    n6_2 = n6; /*0xffc6ee1a*/
    SocketInfo = (_BYTE *)GetSocketInfo((int)n6_1, (unsigned __int8)n6); /*0xffc6ee28*/
    n6_4 = 0; /*0xffc6ee2a*/
    n6_3 = 0; /*0xffc6ee2c*/
    SocketInfo_1 = SocketInfo; /*0xffc6ee2e*/
    LOBYTE(n6) = 0; /*0xffc6ee32*/
    SocketInfo_2 = SocketInfo; /*0xffc6ee36*/
    do /*0xffc6eeaa*/
    {
      if ( *SocketInfo ) /*0xffc6ee3a*/
      {
        v7 = MiscConfigCheck(n6_1, (unsigned __int8)n6_2, (unsigned __int8)n6, 184566948); /*0xffc6ee4a*/
        MiscIoCheck(n6_1, (unsigned __int8)n6_2, (int)n6, 0xB0044A4u, v7 | 0x80000000); /*0xffc6ee5d*/
        DdrTrainFunc668D(n6_1, (int)n6_2, (int)n6); /*0xffc6ee65*/
        DdrTrainFunc616E(n6_1, (int)n6_2, (int)n6); /*0xffc6ee6d*/
        DdrTrainFunc31DF(n6_1, (int)n6_2, (int)n6); /*0xffc6ee75*/
        DdrTrainFunc7A87(n6_1, (int)n6_2, n6); /*0xffc6ee80*/
        DdrTrainFunc4DD9(n6_1, (int)n6_2, (int)n6); /*0xffc6ee88*/
        n6_3 = (unsigned __int8)n6; /*0xffc6ee8d*/
        SocketInfo = SocketInfo_2; /*0xffc6ee94*/
      }
      ++n6_3; /*0xffc6ee98*/
      SocketInfo += 7688; /*0xffc6ee9a*/
      LOBYTE(n6) = n6_3; /*0xffc6eea0*/
      SocketInfo_2 = SocketInfo; /*0xffc6eea4*/
    }
    while ( n6_3 < 6u ); /*0xffc6eeaa*/
    if ( !*((_DWORD *)n6_1 + 61601) ) /*0xffc6eeac*/
    {
      n8 = *(_DWORD *)(n6_1 + 9405); /*0xffc6eeb4*/
      if ( n8 == 8 || n8 == 11 ) /*0xffc6eec2*/
        ProcCommonFunc6AD(n6_1, (int)n6_2, 1); /*0xffc6eec8*/
    }
    KtiFuncE2C0((int)n6_1, (int)n6_2); /*0xffc6eed2*/
    if ( !*((_DWORD *)n6_1 + 61601) && *(_DWORD *)(n6_1 + 9405) == 11 ) /*0xffc6eee8*/
    {
      ProcCommonFunc52A5(n6_1, (int)n6_2, 0); /*0xffc6eeed*/
      v9 = v14; /*0xffc6eef2*/
      SocketInfo_3 = SocketInfo_1; /*0xffc6eef9*/
      LOBYTE(n6) = 0; /*0xffc6eefd*/
      while ( 1 ) /*0xffc6ef01*/
      {
        if ( SocketInfo_3[7688 * n6_4] ) /*0xffc6ef0a*/
        {
          CpuCount = GetCpuCount((int)n6_1, (unsigned __int8)n6_2, (unsigned __int8)n6); /*0xffc6ef16*/
          if ( n6_1[v14 + 258694] == 14 && *(_BYTE *)(CpuCount + 1249) == 1 && *(_BYTE *)(CpuCount + 1486) == 1 ) /*0xffc6ef38*/
          {
            ProcCommonFunc535F(n6_1, (int)n6_2, (int)n6, 1); /*0xffc6ef53*/
            goto LABEL_25; /*0xffc6ef5b*/
          }
          SocketInfo_3 = SocketInfo_1; /*0xffc6ef3a*/
        }
        LOBYTE(n6) = ++n6_4; /*0xffc6ef40*/
        if ( n6_4 >= 6u ) /*0xffc6ef47*/
          goto LABEL_25; /*0xffc6ef47*/
      }
    }
    v9 = v14; /*0xffc6ef5d*/
LABEL_25:
    *(_DWORD *)&n6_1[v9 + 304938] |= 0x3Fu; /*0xffc6ef61*/
  }
  return 0; /*0xffc6ef6e*/
}

// Function: NgnDimmThermalUpdate @ 0xffc6ef73 (0x3b0 bytes)
// Index: 912/2560

int __cdecl NgnDimmThermalUpdate(unsigned __int8 *__return_address)
{
  unsigned __int8 n6_8; // bl
  int n6_1; // edi
  _BYTE *SocketInfo; // esi
  int n6_6; // eax
  int v6; // ebx
  int v7; // esi
  int n6_4; // ebx
  int v9; // eax
  _BYTE *SocketInfo_2; // ecx
  int v11; // esi
  unsigned __int8 n6_2; // al
  int v13; // edx
  unsigned __int8 n6_3; // al
  unsigned int *v15; // ecx
  int v16; // edx
  unsigned __int8 n2a_1; // al
  unsigned int v18; // edi
  unsigned int v19; // eax
  int v20; // ebx
  unsigned int v21; // esi
  unsigned int v22; // eax
  int v23; // eax
  unsigned __int8 j; // [esp+10h] [ebp-18h]
  unsigned __int8 i; // [esp+10h] [ebp-18h]
  int n6_7; // [esp+10h] [ebp-18h]
  unsigned __int8 n2[4]; // [esp+14h] [ebp-14h]
  unsigned __int8 n2a; // [esp+14h] [ebp-14h]
  _BYTE *SocketInfo_1; // [esp+18h] [ebp-10h]
  int n6; // [esp+1Ch] [ebp-Ch]
  unsigned int n6a; // [esp+1Ch] [ebp-Ch]
  _BYTE *SocketInfo_3; // [esp+20h] [ebp-8h]
  int v34; // [esp+20h] [ebp-8h]
  unsigned int *v35; // [esp+24h] [ebp-4h]
  int n6_5; // [esp+2Ch] [ebp+4h]

  n6_8 = __return_address[9402]; /*0xffc6ef7e*/
  LOBYTE(n6) = n6_8; /*0xffc6ef84*/
  n6_1 = n6; /*0xffc6ef88*/
  SocketInfo = (_BYTE *)GetSocketInfo((int)__return_address, n6_8); /*0xffc6ef93*/
  n6_6 = n6_8; /*0xffc6ef95*/
  v6 = 48704 * n6_8; /*0xffc6ef98*/
  SocketInfo_1 = SocketInfo; /*0xffc6efa0*/
  n6_5 = n6_6; /*0xffc6efa4*/
  if ( __return_address[v6 + 258689] ) /*0xffc6efa8*/
  {
    MailBoxFunc2B5B((int)__return_address, n6); /*0xffc6efb8*/
    if ( __return_address[v6 + 258716] ) /*0xffc6efbd*/
    {
      DdrTrainFunc2AC5(__return_address, n6); /*0xffc6f08b*/
      if ( (__return_address[134] & 0x40) != 0 ) /*0xffc6f099*/
      {
        MailBoxFuncB8B0((int)__return_address, n6); /*0xffc6f09d*/
        AutoGenFuncC3B((int)__return_address, n6); /*0xffc6f0a4*/
      }
      if ( (*(_DWORD *)(__return_address + 134) & 0x40000000) != 0 ) /*0xffc6f0b8*/
        MailBoxFuncBDDF(__return_address, n6); /*0xffc6f0ba*/
      else
        MailBoxFuncC2A6(__return_address, n6); /*0xffc6f0c1*/
      __return_address[50813 * n6_5 + 58786] = 1; /*0xffc6f0d2*/
      IioUniphyInit(__return_address, n6); /*0xffc6f0da*/
      n6_4 = 0; /*0xffc6f0e0*/
      if ( (*(_DWORD *)(__return_address + 130) & 0x1000000) != 0 ) /*0xffc6f0ed*/
      {
        for ( i = 0; i < 2u; ++i ) /*0xffc6f0f3*/
        {
          v9 = MailBoxFunc8E0B(0, (int)__return_address, n6, i, 117459068); /*0xffc6f102*/
          SocketInfo_2 = SocketInfo_1; /*0xffc6f107*/
          v11 = v9; /*0xffc6f10b*/
          n6_2 = 0; /*0xffc6f10d*/
          *(_DWORD *)n2 = 0; /*0xffc6f10f*/
          v13 = 0; /*0xffc6f11a*/
          LOBYTE(n6_5) = 0; /*0xffc6f11e*/
          SocketInfo_3 = SocketInfo_1; /*0xffc6f122*/
          do /*0xffc6f19d*/
          {
            if ( !*SocketInfo_2 ) /*0xffc6f126*/
            {
              if ( i == DdrTrainFunc45AB((int)__return_address, n6, n6_5) ) /*0xffc6f13b*/
              {
                DebugPrint((int)__return_address, 2, n6, n6_5, 255, 255, 255, 255, "\n Disable Channel \n"); /*0xffc6f153*/
                v11 ^= (v11 ^ (v11 | (0x40000 << (*(_DWORD *)n2 % 3u)))) & 0x1C0000; /*0xffc6f178*/
              }
              v13 = *(_DWORD *)n2; /*0xffc6f17a*/
              SocketInfo_2 = SocketInfo_3; /*0xffc6f17e*/
              n6_2 = n6_5; /*0xffc6f182*/
            }
            ++n6_2; /*0xffc6f186*/
            SocketInfo_2 += 7688; /*0xffc6f188*/
            ++v13; /*0xffc6f18e*/
            LOBYTE(n6_5) = n6_2; /*0xffc6f18f*/
            *(_DWORD *)n2 = v13; /*0xffc6f193*/
            SocketInfo_3 = SocketInfo_2; /*0xffc6f197*/
          }
          while ( n6_2 < 6u ); /*0xffc6f19d*/
          n6_4 = 0; /*0xffc6f1a8*/
          if ( (v11 & 0x1C0000) == 0x1C0000 ) /*0xffc6f1ae*/
            v11 &= ~0x40000u; /*0xffc6f1b0*/
          MailBoxFunc8FC5((int)__return_address, n6, i, 117459068, v11); /*0xffc6f1c2*/
        }
        SocketInfo = SocketInfo_1; /*0xffc6f1dc*/
      }
      n6_3 = 0; /*0xffc6f1e0*/
      v15 = (unsigned int *)(SocketInfo + 11); /*0xffc6f1e2*/
      v16 = 0; /*0xffc6f1e5*/
      LOBYTE(n6_5) = 0; /*0xffc6f1e7*/
      v34 = 0; /*0xffc6f1eb*/
      v35 = (unsigned int *)(SocketInfo + 11); /*0xffc6f1ef*/
      do /*0xffc6f2ce*/
      {
        if ( *((_BYTE *)v15 - 11) ) /*0xffc6f1f3*/
        {
          n2a_1 = 0; /*0xffc6f1ff*/
          n2a = 0; /*0xffc6f207*/
          v18 = *v15 & 0xFFFFFE3F | 0x100; /*0xffc6f20b*/
          n6_7 = 0; /*0xffc6f211*/
          do /*0xffc6f29c*/
          {
            if ( __return_address[257312] || n2a_1 != 8 && n2a_1 != 17 ) /*0xffc6f224*/
            {
              v19 = MailBoxFunc4CB2((int)__return_address, n2a, 0x80042E8u); /*0xffc6f231*/
              MiscIoCheck(__return_address, n6, n6_5, v19, v18); /*0xffc6f243*/
              v20 = v34 + n6_4; /*0xffc6f248*/
              v21 = *(_DWORD *)&SocketInfo[4 * v20 + 87] & 0xFFFFFFBF; /*0xffc6f253*/
              v22 = MailBoxFunc4CB2((int)__return_address, n2a, 0x80042F0u); /*0xffc6f261*/
              MiscIoCheck(__return_address, n6, n6_5, v22, v21); /*0xffc6f273*/
              *(_DWORD *)&SocketInfo_1[4 * v20 + 87] = v21; /*0xffc6f27f*/
              n2a_1 = n2a; /*0xffc6f283*/
              SocketInfo = SocketInfo_1; /*0xffc6f287*/
              n6_4 = n6_7; /*0xffc6f28b*/
            }
            ++n2a_1; /*0xffc6f28f*/
            ++n6_4; /*0xffc6f291*/
            n2a = n2a_1; /*0xffc6f292*/
            n6_7 = n6_4; /*0xffc6f296*/
          }
          while ( n2a_1 < 0x12u ); /*0xffc6f29c*/
          v15 = v35; /*0xffc6f2a2*/
          n6_4 = 0; /*0xffc6f2a6*/
          n6_3 = n6_5; /*0xffc6f2a8*/
          v16 = v34; /*0xffc6f2ac*/
          *v35 = v18; /*0xffc6f2b0*/
        }
        ++n6_3; /*0xffc6f2b2*/
        v16 += 1922; /*0xffc6f2b4*/
        v15 += 1922; /*0xffc6f2ba*/
        LOBYTE(n6_5) = n6_3; /*0xffc6f2c0*/
        v34 = v16; /*0xffc6f2c4*/
        v35 = v15; /*0xffc6f2c8*/
      }
      while ( n6_3 < 6u ); /*0xffc6f2ce*/
      LOBYTE(n6_5) = 0; /*0xffc6f2d8*/
      do /*0xffc6f317*/
      {
        if ( *SocketInfo ) /*0xffc6f2dc*/
        {
          v23 = MiscConfigCheck(__return_address, n6, n6_5, 117457036); /*0xffc6f2ec*/
          MiscIoCheck(__return_address, n6, n6_5, 0x700408Cu, v23 | 1); /*0xffc6f300*/
        }
        LOBYTE(n6_4) = n6_4 + 1; /*0xffc6f308*/
        SocketInfo += 7688; /*0xffc6f30a*/
        LOBYTE(n6_5) = n6_4; /*0xffc6f310*/
      }
      while ( (unsigned __int8)n6_4 < 6u ); /*0xffc6f317*/
    }
    else
    {
      for ( j = 0; j < 2u; ++j ) /*0xffc6efcf*/
      {
        LOBYTE(n6_5) = 0; /*0xffc6efe3*/
        n6a = 0; /*0xffc6efea*/
        v7 = MailBoxFunc8E0B(0, (int)__return_address, n6_1, j, 117459068); /*0xffc6efee*/
        do /*0xffc6f053*/
        {
          if ( j == DdrTrainFunc45AB((int)__return_address, n6_1, n6_5) ) /*0xffc6f004*/
          {
            v7 ^= (v7 ^ (v7 | (0x40000 << (n6a % 3)))) & 0x1C0000; /*0xffc6f028*/
            DebugPrint((int)__return_address, 2, n6_1, n6_5, 255, 255, 255, 255, "\n Disable Channel \n"); /*0xffc6f03b*/
          }
          ++n6a; /*0xffc6f049*/
          LOBYTE(n6_5) = n6_5 + 1; /*0xffc6f04d*/
        }
        while ( (unsigned __int8)n6_5 < 6u ); /*0xffc6f053*/
        MailBoxFunc8FC5((int)__return_address, n6_1, j, 117459068, v7 & 0xFFFBFFFF); /*0xffc6f067*/
      }
    }
  }
  return 0; /*0xffc6f319*/
}

// Function: Ddr4DdrtMixedConfig @ 0xffc6f323 (0x458 bytes)
// Index: 913/2560

int __cdecl Ddr4DdrtMixedConfig(int a1)
{
  unsigned __int8 n4; // cl
  _BYTE *v2; // esi
  int v3; // edi
  unsigned __int8 v4; // al
  int v5; // eax
  unsigned __int8 n4_1; // cl
  int v7; // edi
  int v8; // edx
  _BYTE *v9; // ebp
  unsigned __int8 v10; // al
  unsigned __int8 n4_5; // si
  char v12; // cl
  int v13; // eax
  int v14; // eax
  char v15; // si
  unsigned int v16; // edi
  char v17; // al
  unsigned __int8 v18; // cl
  char v19; // al
  int v20; // ebp
  int v21; // eax
  unsigned __int8 v22; // dl
  int v23; // ecx
  unsigned __int8 n4_2; // al
  int v25; // eax
  int v26; // eax
  int v27; // eax
  int v28; // eax
  int v29; // eax
  int v30; // eax
  _DWORD *v31; // edi
  int v32; // esi
  char v34; // [esp+13h] [ebp-71h]
  unsigned __int8 n4_3; // [esp+14h] [ebp-70h]
  unsigned __int8 n4_4; // [esp+14h] [ebp-70h]
  unsigned __int8 n4_6; // [esp+14h] [ebp-70h]
  unsigned __int8 v38; // [esp+18h] [ebp-6Ch]
  unsigned __int8 v39; // [esp+18h] [ebp-6Ch]
  char n6[4]; // [esp+1Ch] [ebp-68h]
  unsigned __int8 n6a; // [esp+1Ch] [ebp-68h]
  int v42; // [esp+20h] [ebp-64h]
  char v43; // [esp+20h] [ebp-64h]
  unsigned __int8 v44; // [esp+24h] [ebp-60h]
  char v45; // [esp+24h] [ebp-60h]
  int v46; // [esp+28h] [ebp-5Ch]
  int v47; // [esp+2Ch] [ebp-58h]
  int n2; // [esp+30h] [ebp-54h]
  _BYTE v49[80]; // [esp+34h] [ebp-50h] BYREF

  if ( (*(_BYTE *)(a1 + 130) & 0x20) != 0 ) /*0xffc6f335*/
  {
    n4 = 0; /*0xffc6f33b*/
    v2 = (_BYTE *)(a1 + 258689); /*0xffc6f33d*/
    n4_3 = 0; /*0xffc6f343*/
    v3 = 0; /*0xffc6f347*/
    do /*0xffc6f3c0*/
    {
      if ( *v2 ) /*0xffc6f34e*/
      {
        v4 = 0; /*0xffc6f353*/
        v38 = 0; /*0xffc6f355*/
        if ( *(_BYTE *)(a1 + 244317) ) /*0xffc6f359*/
        {
          do /*0xffc6f3a5*/
          {
            if ( *(_BYTE *)(v3 + v4 + a1 + 10189) ) /*0xffc6f366*/
            {
              v5 = MailBoxFunc8E0B(a1, a1, n4_3, v38, 117459068); /*0xffc6f37a*/
              MailBoxFunc8FC5(a1, n4_3, v38, 117459068, v5 | 1); /*0xffc6f38d*/
            }
            v4 = v38 + 1; /*0xffc6f399*/
            v38 = v4; /*0xffc6f39b*/
          }
          while ( v4 < *(_BYTE *)(a1 + 244317) ); /*0xffc6f3a5*/
          n4 = n4_3; /*0xffc6f3a7*/
        }
      }
      ++n4; /*0xffc6f3ab*/
      v2 += 48704; /*0xffc6f3ad*/
      v3 += 50813; /*0xffc6f3b3*/
      n4_3 = n4; /*0xffc6f3b9*/
    }
    while ( n4 < 4u ); /*0xffc6f3c0*/
  }
  n4_1 = 0; /*0xffc6f3c2*/
  n2 = 2; /*0xffc6f3c4*/
  v7 = 0; /*0xffc6f3cc*/
  n4_4 = 0; /*0xffc6f3ce*/
  v8 = 0; /*0xffc6f3d2*/
  v47 = 0; /*0xffc6f3d4*/
  *(_DWORD *)n6 = 0; /*0xffc6f3d8*/
  v9 = (_BYTE *)(a1 + 258689); /*0xffc6f3dc*/
  do /*0xffc6f5e1*/
  {
    if ( v9[v7] ) /*0xffc6f3e2*/
    {
      v10 = 0; /*0xffc6f3ec*/
      v39 = 0; /*0xffc6f3ee*/
      if ( *(_BYTE *)(a1 + 244317) ) /*0xffc6f3f2*/
      {
        n4_5 = n4_4; /*0xffc6f3fe*/
        while ( 1 ) /*0xffc6f405*/
        {
          v44 = v10; /*0xffc6f405*/
          if ( *(_BYTE *)(v8 + v10 + a1 + 10189) ) /*0xffc6f40b*/
            break; /*0xffc6f40b*/
LABEL_34:
          v10 = v39 + 1; /*0xffc6f5a4*/
          v39 = v10; /*0xffc6f5aa*/
          if ( v10 >= *(_BYTE *)(a1 + 244317) ) /*0xffc6f5b4*/
          {
            n4_1 = n4_4; /*0xffc6f5ba*/
            v9 = (_BYTE *)(a1 + 258689); /*0xffc6f5be*/
            goto LABEL_36; /*0xffc6f5be*/
          }
        }
        v42 = MailBoxFunc8E0B(a1, a1, n4_5, v39, 100679908); /*0xffc6f42f*/
        if ( KtiFuncE78(a1, 0, 6u) ) /*0xffc6f433*/
        {
          v12 = MailBoxFunc8E0B(a1, a1, n4_5, v39, 100679904); /*0xffc6f44c*/
          v13 = v42; /*0xffc6f451*/
          if ( (v42 & 4) != 0 || (v12 & 8) != 0 ) /*0xffc6f45c*/
            goto LABEL_20; /*0xffc6f45c*/
          v14 = MailBoxFunc8E0B(a1, a1, n4_5, v39, 100679940); /*0xffc6f466*/
          v15 = v14; /*0xffc6f46d*/
          v16 = v14 & 0xFFFFFFFD; /*0xffc6f46f*/
          MailBoxFunc8FC5(a1, n4_4, v39, 100679940, v14 & 0xFFFFFFFD); /*0xffc6f47e*/
          v16 &= ~1u; /*0xffc6f483*/
          MailBoxFunc8FC5(a1, n4_4, v39, 100679940, v16); /*0xffc6f492*/
          v17 = v15 ^ v16; /*0xffc6f499*/
          n4_5 = n4_4; /*0xffc6f49b*/
          MailBoxFunc8FC5(a1, n4_4, v39, 100679940, v16 ^ v17 & 2); /*0xffc6f4ad*/
          v7 = v47; /*0xffc6f4b2*/
        }
        v13 = v42; /*0xffc6f4b9*/
LABEL_20:
        MailBoxFunc8FC5(a1, n4_5, v39, 100679908, v13 | 0x8000000); /*0xffc6f4bd*/
        v43 = MemChipFunc429A(a1, n4_5, v39); /*0xffc6f4de*/
        if ( (v43 & 6) != 0 ) /*0xffc6f4e4*/
        {
          v18 = 0; /*0xffc6f4ea*/
          v34 = 0; /*0xffc6f4ec*/
          if ( *(_BYTE *)(a1 + 9475) ) /*0xffc6f4f0*/
          {
            v19 = v44 & 1; /*0xffc6f500*/
            v45 = v44 & 1; /*0xffc6f503*/
            do /*0xffc6f59a*/
            {
              LOBYTE(v46) = v18 + 3 * v19; /*0xffc6f50f*/
              v20 = v7 + 7688 * (unsigned __int8)v46; /*0xffc6f51c*/
              if ( *(_BYTE *)(a1 + v20 + 258722) ) /*0xffc6f51e*/
              {
                v21 = MiscConfigCheck((unsigned __int8 *)a1, n4_5, v46, 117522704) | 0x20; /*0xffc6f53b*/
                if ( (v43 & 2) != 0 ) /*0xffc6f543*/
                {
                  v22 = 0; /*0xffc6f545*/
                  while ( 1 ) /*0xffc6f550*/
                  {
                    v23 = v20 + 1379 * v22; /*0xffc6f550*/
                    if ( *(_BYTE *)(v23 + a1 + 259118) == 1 && !*(_BYTE *)(v23 + a1 + 259225) ) /*0xffc6f55c*/
                      break; /*0xffc6f55c*/
                    if ( ++v22 >= 2u ) /*0xffc6f56b*/
                      goto LABEL_31; /*0xffc6f56b*/
                  }
                  v21 |= 0xCu; /*0xffc6f56f*/
                }
LABEL_31:
                MiscIoCheck((unsigned __int8 *)a1, n4_5, v46, 0x7014110u, v21); /*0xffc6f572*/
                v18 = v34; /*0xffc6f583*/
              }
              v19 = v45; /*0xffc6f58a*/
              v34 = ++v18; /*0xffc6f590*/
            }
            while ( v18 < *(_BYTE *)(a1 + 9475) ); /*0xffc6f59a*/
          }
        }
        v8 = *(_DWORD *)n6; /*0xffc6f5a0*/
        goto LABEL_34; /*0xffc6f5a0*/
      }
    }
LABEL_36:
    ++n4_1; /*0xffc6f5c4*/
    v8 += 50813; /*0xffc6f5c6*/
    v7 += 48704; /*0xffc6f5cc*/
    n4_4 = n4_1; /*0xffc6f5d2*/
    *(_DWORD *)n6 = v8; /*0xffc6f5d6*/
    v47 = v7; /*0xffc6f5da*/
  }
  while ( n4_1 < 4u ); /*0xffc6f5e1*/
  n4_2 = 0; /*0xffc6f5e7*/
  n4_6 = 0; /*0xffc6f5ee*/
  do /*0xffc6f6de*/
  {
    if ( *v9 ) /*0xffc6f5f2*/
    {
      v25 = CpuIoRead(a1, n4_6, 0, 318914912); /*0xffc6f609*/
      CpuIoCfgWrite(a1, n4_6, 0, 318914912, v25 | 0x400000); /*0xffc6f61a*/
      v26 = CpuIoRead(a1, n4_6, 0, 67518620); /*0xffc6f628*/
      CpuIoCfgWrite(a1, n4_6, 0, 67518620, v26 | 0x400000); /*0xffc6f639*/
      v27 = CpuIoRead(a1, n4_6, 0, 84033900); /*0xffc6f64a*/
      CpuIoCfgWrite(a1, n4_6, 0, 84033900, v27 | 0x400000); /*0xffc6f65b*/
      v28 = CpuIoRead(a1, n4_6, 0, 318914884); /*0xffc6f669*/
      CpuIoCfgWrite(a1, n4_6, 0, 318914884, v28 | 0xC00000); /*0xffc6f67d*/
      v29 = CpuIoRead(a1, n4_6, 0, 67518592); /*0xffc6f68e*/
      CpuIoCfgWrite(a1, n4_6, 0, 67518592, v29 | 0xC00000); /*0xffc6f6a2*/
      v30 = CpuIoRead(a1, n4_6, 0, 84033872); /*0xffc6f6b0*/
      CpuIoCfgWrite(a1, n4_6, 0, 84033872, v30 | 0xC00000); /*0xffc6f6c4*/
      n4_2 = n4_6; /*0xffc6f6c9*/
    }
    ++n4_2; /*0xffc6f6d0*/
    v9 += 48704; /*0xffc6f6d2*/
    n4_6 = n4_2; /*0xffc6f6d8*/
  }
  while ( n4_2 < 4u ); /*0xffc6f6de*/
  *(_BYTE *)(a1 + 257308) = 1; /*0xffc6f6e6*/
  n6a = 6; /*0xffc6f6ed*/
  v31 = (_DWORD *)(a1 + 10195); /*0xffc6f6f2*/
  v32 = 1; /*0xffc6f6f8*/
  do /*0xffc6f76f*/
  {
    if ( ((1 << (v32 - 1)) & *(_DWORD *)(a1 + 246468)) != 0 ) /*0xffc6f707*/
    {
      AutoGenFuncEB71((unsigned int)v49, 0x50u, "CPU Socket %x Active Memory =%6d GB", v32, *v31 >> 4); /*0xffc6f71c*/
      AutoGenFunc7AD(n6a, 0, 7, v49); /*0xffc6f72e*/
    }
    else
    {
      AutoGenFuncEB71((unsigned int)v49, 0x50u, "CPU Socket %x Active Memory =     N/A", v32); /*0xffc6f745*/
      AutoGenFunc7AD(n6a, 0, 7, v49); /*0xffc6f757*/
    }
    v31 = (_DWORD *)((char *)v31 + 50813); /*0xffc6f75f*/
    ++v32; /*0xffc6f765*/
    ++n6a; /*0xffc6f766*/
    --n2; /*0xffc6f76a*/
  }
  while ( n2 ); /*0xffc6f76f*/
  return 0; /*0xffc6f771*/
}

// Function: DdrTimingTraining @ 0xffc6f77b (0x2d30 bytes)
// Index: 914/2560

int __cdecl DdrTimingTraining(unsigned __int8 *__return_address)
{
  unsigned __int8 *__return_address_1; // ebx
  int n2_1; // edi
  int n2_3; // ebp
  _BYTE *SocketInfo; // esi
  unsigned __int8 v5; // al
  int CpuCount_4; // ecx
  int v7; // edi
  int v8; // esi
  int n3_1; // ecx
  _BYTE *v10; // eax
  unsigned __int8 n6_1; // al
  unsigned __int8 n8; // al
  unsigned int v13; // eax
  unsigned int v14; // eax
  unsigned __int8 i_1; // al
  int v16; // eax
  unsigned __int8 n6_5; // al
  unsigned __int8 *n6_34; // edi
  unsigned __int8 *n3_15; // ecx
  int v20; // eax
  int v21; // eax
  int v22; // eax
  int v23; // eax
  int v24; // eax
  int v25; // eax
  unsigned __int8 n8_1; // al
  unsigned int v27; // eax
  unsigned int v28; // eax
  int CpuCount; // ecx
  unsigned __int8 v30; // al
  int v31; // eax
  unsigned int v32; // eax
  unsigned int v33; // eax
  unsigned __int8 n6_14; // al
  unsigned __int8 *n3_16; // esi
  int n6_6; // edi
  int v37; // ecx
  unsigned __int8 v38;... [81548 chars total]

// Function: Ddr4DdrtSwizzleCheck @ 0xffc724ab (0xcf bytes)
// Index: 915/2560

int __cdecl Ddr4DdrtSwizzleCheck(int a1)
{
  int v1; // ebp
  int v2; // eax
  char v3; // bl
  int v5; // eax

  if ( (*(_DWORD *)(a1 + 130) & 0x2000) != 0 && !*(_BYTE *)(a1 + 257314) )
  {
    v1 = CpuIoRead(a1, 0, 0, 318914740); /*0xffc724e7*/
    v2 = CpuIoRead(a1, 0, 0, 318914720); /*0xffc724e9*/
    v3 = v2; /*0xffc724f1*/
    if ( !(_WORD)v1 ) /*0xffc724f6*/
    {
      v3 = v2 | 4; /*0xffc724f8*/
      CpuIoCfgWrite(a1, 0, 0, 318914720, v2 | 4); /*0xffc72504*/
    }
    if ( (v3 & 4) != 0 )
    {
      CpuIoCfgWrite(a1, 0, 0, 318914740, (unsigned __int16)(v1 + 1) + (v1 & 0xFFFF0000)); /*0xffc7252b*/
      DebugPrint(a1, 3, 255, 255, 255, 255, 255, 255, "DDR LC: %d\n", (unsigned __int16)(v1 + 1));
      *(_BYTE *)(a1 + 246400) |= 2u; /*0xffc72549*/
      return 1; /*0xffc72556*/
    }
    v5 = CpuIoRead(a1, 0, 0, 318914740); /*0xffc7255c*/
    CpuIoCfgWrite(a1, 0, 0, 318914740, v5 & 0xFFFF0000); /*0xffc7256b*/
  }
  return 0; /*0xffc72575*/
}

// Function: Ddr4NvdimmInit @ 0xffc7257a (0x2a1 bytes)
// Index: 916/2560

int __cdecl Ddr4NvdimmInit(int n6)
{
  int n6_1; // edi
  unsigned __int8 v2; // bl
  int SocketInfo; // esi
  int n8; // ecx
  int n12; // eax
  int v6; // ebx
  __int16 *v7; // esi
  __int16 n4; // ax
  unsigned int n0xA; // eax
  unsigned int v10; // eax
  unsigned int n4_2; // eax
  __int16 n512; // ax
  unsigned int v13; // eax
  unsigned int v14; // eax
  unsigned int n2; // eax
  unsigned __int8 i_2; // dl
  unsigned __int16 i_1; // ax
  unsigned __int16 i_5; // bp
  unsigned __int16 i_3; // di
  char v20; // cl
  unsigned __int16 i_4; // si
  int v22; // ebx
  unsigned __int8 v23; // al
  int v24; // esi
  int i_6; // [esp-8h] [ebp-34h]
  __int16 n4_1; // [esp+0h] [ebp-2Ch]
  unsigned __int16 i; // [esp+14h] [ebp-18h]
  int n6_2; // [esp+18h] [ebp-14h]
  int v30; // [esp+1Ch] [ebp-10h]
  __int16 *v31; // [esp+24h] [ebp-8h]
  int v32; // [esp+28h] [ebp-4h]

  n6_1 = n6; /*0xffc72581*/
  v2 = *(_BYTE *)(n6 + 9402); /*0xffc72585*/
  LOBYTE(v30) = v2; /*0xffc7258b*/
  SocketInfo = GetSocketInfo(n6, v2); /*0xffc7259a*/
  DdrTrainFunc60FB(); /*0xffc7259c*/
  n8 = *(_DWORD *)(n6 + 246404); /*0xffc725a1*/
  if ( n8 == 1 || (n12 = *(_DWORD *)(n6 + 9405), n12 == 10) )
  {
    *(_BYTE *)(n6 + 255576) = 2; /*0xffc72602*/
  }
  else if ( n12 == 11 )
  {
    *(_BYTE *)(n6 + 255576) = 8; /*0xffc725c7*/
  }
  else if ( n12 == 9 )
  {
    *(_BYTE *)(n6 + 255576) = 4; /*0xffc725d4*/
  }
  else if ( n8 == 8 )
  {
    *(_BYTE *)(n6 + 255576) = 1; /*0xffc725e5*/
  }
  else
  {
    *(_BYTE *)(n6 + 255576) = n12 != 12 ? 1 : 16;
  }
  v6 = 48704 * v2; /*0xffc7260e*/
  v7 = (__int16 *)(SocketInfo + 7483); /*0xffc72614*/
  LOBYTE(n6_2) = 0; /*0xffc7261c*/
  v31 = v7; /*0xffc72621*/
  v32 = v6; /*0xffc72626*/
  do /*0xffc727ca*/
  {
    if ( SocketPresentCheck(n6_1, 0, 8u) ) /*0xffc7262e*/
    {
      *(v7 - 1) = 8; /*0xffc7263f*/
      goto LABEL_20; /*0xffc72644*/
    }
    if ( SocketPresentCheck(n6_1, 0, 5u) ) /*0xffc7264b*/
    {
      n4 = 4; /*0xffc72659*/
    }
    else
    {
      if ( SocketPresentCheck(n6_1, 0, 2u) ) /*0xffc72660*/
      {
        *(v7 - 1) = 2; /*0xffc7266f*/
        goto LABEL_20; /*0xffc72673*/
      }
      n4 = 1; /*0xffc72677*/
    }
    *(v7 - 1) = n4; /*0xffc7267b*/
LABEL_20:
    n0xA = *(unsigned __int8 *)(v6 + n6_1 + 258694); /*0xffc72682*/
    if ( n0xA > 0xA ) /*0xffc7268d*/
    {
      v13 = n0xA - 12; /*0xffc726cb*/
      if ( !v13 ) /*0xffc726ce*/
      {
        *v7 = 8; /*0xffc726ed*/
        goto LABEL_42; /*0xffc726ed*/
      }
      v14 = v13 - 2; /*0xffc726d0*/
      if ( !v14 ) /*0xffc726d2*/
      {
        n4_1 = 4; /*0xffc726e9*/
        goto LABEL_27; /*0xffc726eb*/
      }
      n2 = v14 - 2; /*0xffc726d4*/
      if ( !n2 ) /*0xffc726d6*/
      {
        *v7 = 2; /*0xffc726e4*/
        goto LABEL_42; /*0xffc726e7*/
      }
      if ( n2 == 2 ) /*0xffc726da*/
      {
        *v7 = 1; /*0xffc726df*/
        goto LABEL_42; /*0xffc726e2*/
      }
LABEL_29:
      n4_1 = 64; /*0xffc726ae*/
      goto LABEL_27; /*0xffc726b0*/
    }
    if ( n0xA == 10 ) /*0xffc7268f*/
    {
      n4_1 = 16; /*0xffc726c7*/
      goto LABEL_27; /*0xffc726c9*/
    }
    if ( !*(_BYTE *)(v6 + n6_1 + 258694) ) /*0xffc72694*/
    {
      n512 = 512; /*0xffc726c0*/
      goto LABEL_28; /*0xffc726c5*/
    }
    v10 = n0xA - 2; /*0xffc72696*/
    if ( !v10 ) /*0xffc72698*/
    {
      n512 = 256; /*0xffc726b9*/
      goto LABEL_28; /*0xffc726be*/
    }
    n4_2 = v10 - 2; /*0xffc7269a*/
    if ( !n4_2 ) /*0xffc7269c*/
    {
      n512 = 128; /*0xffc726b2*/
      goto LABEL_28; /*0xffc726b7*/
    }
    if ( n4_2 != 4 ) /*0xffc726a0*/
      goto LABEL_29; /*0xffc726a0*/
    n4_1 = 32; /*0xffc726a6*/
LABEL_27:
    n512 = n4_1; /*0xffc726a8*/
LABEL_28:
    *v7 = n512; /*0xffc726a9*/
LABEL_42:
    i_2 = 0; /*0xffc726f3*/
    i_1 = *(v7 - 1); /*0xffc726fc*/
    i_5 = 1; /*0xffc72700*/
    i_3 = *v7; /*0xffc72702*/
    v20 = 0; /*0xffc72705*/
    v7[1] = 1; /*0xffc72707*/
    v7[2] = 1; /*0xffc7270b*/
    i_4 = 1; /*0xffc7270f*/
    for ( i = i_1; ; i_1 = i ) /*0xffc72711*/
    {
      v22 = 1 << v20; /*0xffc7271f*/
      if ( (i_1 & (1 << v20)) != 0 ) /*0xffc72726*/
        i = i_2; /*0xffc7272b*/
      if ( (i_3 & (unsigned __int16)v22) != 0 ) /*0xffc72734*/
        i_3 = i_2; /*0xffc72736*/
      if ( (i_4 & (unsigned __int16)v22) != 0 ) /*0xffc7273e*/
        i_4 = i_2; /*0xffc72740*/
      if ( (i_5 & (unsigned __int16)v22) != 0 ) /*0xffc72748*/
        i_5 = i_2; /*0xffc7274a*/
      ++i_2; /*0xffc7274d*/
      ++v20; /*0xffc7274f*/
      if ( i_2 >= 0x20u ) /*0xffc72756*/
        break; /*0xffc72756*/
    }
    i_6 = i_3; /*0xffc72771*/
    v31[2] = i_5; /*0xffc72780*/
    *v31 = i_3; /*0xffc7278c*/
    n6_1 = n6; /*0xffc72793*/
    *(v31 - 1) = i; /*0xffc7279c*/
    v31[1] = i_4; /*0xffc727a0*/
    DebugPrint( /*0xffc727a4*/
      n6,
      2,
      v30,
      n6_2,
      255,
      255,
      255,
      255,
      "Platform %d, Frequency %d, Configuration %d, Type %d\n",
      i,
      i_6,
      i_4,
      i_5);
    v7 = v31 + 3844; /*0xffc727b2*/
    LOBYTE(n6_2) = n6_2 + 1; /*0xffc727b8*/
    v6 = v32; /*0xffc727bf*/
    v31 += 3844; /*0xffc727c5*/
  }
  while ( (unsigned __int8)n6_2 < 6u ); /*0xffc727ca*/
  *(_BYTE *)(n6 + 244342) = 0; /*0xffc727d1*/
  DdrTrainFunc54B2((_BYTE *)n6); /*0xffc727d8*/
  DebugPrint(n6, 2, v30, 255, 255, 255, 255, 255, "Calling MmrcEntry()\n"); /*0xffc727f4*/
  v23 = DdrTrainFunc56B1((_BYTE *)n6); /*0xffc727fa*/
  *(_BYTE *)(n6 + 9479) &= ~0x40u; /*0xffc727ff*/
  v24 = v23; /*0xffc72809*/
  ProcCommonFunc655(); /*0xffc7280c*/
  return v24; /*0xffc72811*/
}

// Function: DdrTrainFunc281B @ 0xffc7281b (0x111 bytes)
// Index: 917/2560

unsigned __int8 __cdecl DdrTrainFunc281B(unsigned __int8 *__return_address, unsigned __int8 n2)
{
  int SocketInfo; // ecx
  unsigned __int8 n6_1; // bl
  unsigned __int8 n6; // al
  _DWORD *v5; // edi
  _BYTE *SocketInfo_2; // esi
  int v7; // eax
  int n6_2; // [esp+10h] [ebp-8h]
  _BYTE *SocketInfo_1; // [esp+14h] [ebp-4h]

  SocketInfo = GetSocketInfo((int)__return_address, n2); /*0xffc72831*/
  n6_1 = 0; /*0xffc72833*/
  n6 = 0; /*0xffc72835*/
  SocketInfo_1 = (_BYTE *)SocketInfo; /*0xffc72837*/
  LOBYTE(n6_2) = 0; /*0xffc7283b*/
  v5 = (_DWORD *)(SocketInfo + 7611); /*0xffc7283f*/
  do /*0xffc728d5*/
  {
    if ( *((_BYTE *)v5 - 7611) ) /*0xffc72845*/
    {
      MiscIoCheck(__return_address, n2, n6_2, 0xB00450Cu, 21845); /*0xffc72861*/
      MiscIoCheck(__return_address, n2, n6_2, 0xB004510u, 0); /*0xffc72872*/
      MiscIoCheck(__return_address, n2, n6_2, 0xB004514u, 0); /*0xffc72883*/
      MiscIoCheck(__return_address, n2, n6_2, 0xB004518u, 0); /*0xffc72894*/
      *(v5 - 1) = 21845; /*0xffc7289c*/
      *v5 = 0; /*0xffc728a3*/
      v5[1] = 0; /*0xffc728a5*/
      v5[2] = 0; /*0xffc728a8*/
      MiscIoCheck(__return_address, n2, n6_2, 0xB004508u, 4369); /*0xffc728bb*/
      n6 = n6_2; /*0xffc728c0*/
    }
    ++n6; /*0xffc728c7*/
    v5 += 1922; /*0xffc728c9*/
    LOBYTE(n6_2) = n6; /*0xffc728cf*/
  }
  while ( n6 < 6u ); /*0xffc728d5*/
  SocketInfo_2 = SocketInfo_1; /*0xffc728db*/
  LOBYTE(n6_2) = 0; /*0xffc728e4*/
  do /*0xffc72923*/
  {
    if ( *SocketInfo_2 ) /*0xffc728e8*/
    {
      v7 = MiscConfigCheck(__return_address, n2, n6_2, 184567556); /*0xffc728f7*/
      n6 = MiscIoCheck(__return_address, n2, n6_2, 0xB004704u, v7 | 0x80000000); /*0xffc7290c*/
    }
    ++n6_1; /*0xffc72914*/
    SocketInfo_2 += 7688; /*0xffc72916*/
    LOBYTE(n6_2) = n6_1; /*0xffc7291c*/
  }
  while ( n6_1 < 6u ); /*0xffc72923*/
  return n6; /*0xffc72925*/
}

// Function: DdrTrainFunc292C @ 0xffc7292c (0x173 bytes)
// Index: 918/2560

char __cdecl DdrTrainFunc292C(_BYTE *p_n42, unsigned __int8 n4, unsigned __int8 n6a, char a4)
{
  _BYTE *p_n42_1; // esi
  int CpuCount; // ebp
  int n6a_1; // edi
  unsigned __int8 n6aa_1; // cl
  unsigned __int8 v8; // bl
  unsigned __int8 *v9; // eax
  int n6aa_2; // edx
  char n9; // bh
  unsigned __int8 v12; // bl
  int v13; // ecx
  char v14; // al
  unsigned __int8 v16; // [esp+13h] [ebp-9h]
  int p_n80; // [esp+14h] [ebp-8h] BYREF
  _BYTE *v18; // [esp+18h] [ebp-4h] BYREF
  unsigned __int8 n6aa; // [esp+28h] [ebp+Ch]

  p_n42_1 = p_n42; /*0xffc72932*/
  v16 = 0; /*0xffc72940*/
  v18 = &unk_FFD53334; /*0xffc72947*/
  p_n80 = 80; /*0xffc7294f*/
  KtiFunc78F3(p_n42, &v18, &p_n80); /*0xffc72957*/
  CpuCount = GetCpuCount((int)p_n42, n4, n6a); /*0xffc7296e*/
  n6a_1 = n6a; /*0xffc72977*/
  n6aa_1 = *(_BYTE *)(7688 * n6a + GetSocketInfo((int)p_n42, n4) + 3); /*0xffc72983*/
  n6aa = n6aa_1; /*0xffc72987*/
  if ( n6aa_1 ) /*0xffc7298d*/
  {
    v8 = 0; /*0xffc7298f*/
    v9 = (unsigned __int8 *)(CpuCount + 20); /*0xffc72993*/
    n6aa_2 = n6aa_1; /*0xffc72996*/
    do /*0xffc729b3*/
    {
      if ( *(v9 - 20) && v8 < *v9 ) /*0xffc729a3*/
      {
        v16 = *v9; /*0xffc729a5*/
        v8 = *v9; /*0xffc729a9*/
      }
      v9 += 1379; /*0xffc729ab*/
      --n6aa_2; /*0xffc729b0*/
    }
    while ( n6aa_2 ); /*0xffc729b3*/
  }
  n9 = p_n42[257313]; /*0xffc729b9*/
  if ( p_n42[48704 * n4 + 258703] ) /*0xffc729c8*/
    n9 = 9; /*0xffc729d2*/
  v12 = 0; /*0xffc729d6*/
  if ( !(_WORD)p_n80 ) /*0xffc729dd*/
    return 1; /*0xffc72a90*/
  while ( 1 ) /*0xffc72a08*/
  {
    v13 = 15 * v12; /*0xffc72a08*/
    if ( (*(unsigned __int16 *)&v18[v13] & (1 << p_n42[246424])) != 0 /*0xffc72a29*/
      && *(_DWORD *)&v18[v13 + 2] == *((_DWORD *)p_n42_1 + 61605)
      && v18[v13 + 6] == p_n42_1[255480] )
    {
      p_n42_1 = p_n42; /*0xffc72a3a*/
      if ( v18[v13 + 8] == p_n42[50813 * n4 + 10240 + 8077 * n6a_1] /*0xffc72a58*/
        && v18[v13 + 9] == n6aa
        && v18[v13 + 12] >= v16
        && v18[v13 + 10] == n9 )
      {
        v14 = p_n42[144]; /*0xffc72a5a*/
        if ( !v14 && v18[v13 + 13] == 0xFF || v14 == 1 && v18[v13 + 14] == 0xFF ) /*0xffc72a74*/
          return 1; /*0xffc72a74*/
        if ( ((unsigned __int8)a4 & v18[v13 + 11]) != 0 ) /*0xffc72a7e*/
          break; /*0xffc72a7e*/
      }
    }
    if ( ++v12 >= (unsigned __int16)p_n80 ) /*0xffc72a8a*/
      return 1; /*0xffc72a8a*/
  }
  return 0; /*0xffc72a93*/
}

// Function: DdrTrainFunc2A9F @ 0xffc72a9f (0x26 bytes)
// Index: 919/2560

unsigned __int8 __cdecl DdrTrainFunc2A9F(unsigned __int8 *__return_address)
{
  unsigned __int8 n4; // bl
  unsigned __int8 result; // al
  int n6; // [esp+4h] [ebp-4h]

  n4 = 0; /*0xffc72aa4*/
  LOBYTE(n6) = 0; /*0xffc72aa6*/
  do /*0xffc72abe*/
  {
    result = DdrTrainFunc2AC5(__return_address, n6); /*0xffc72aaf*/
    LOBYTE(n6) = ++n4; /*0xffc72ab6*/
  }
  while ( n4 < 4u ); /*0xffc72abe*/
  return result; /*0xffc72ac0*/
}

// Function: DdrTrainFunc2AC5 @ 0xffc72ac5 (0x260 bytes)
// Index: 920/2560

unsigned __int8 __cdecl DdrTrainFunc2AC5(unsigned __int8 *__return_address, int n6)
{
  unsigned __int8 n6_1; // bl
  unsigned __int8 n6_2; // al
  int v4; // esi
  _BYTE *v6; // ebp
  _BYTE *v7; // ecx
  int n2; // esi
  char v9; // bl
  int v10; // edx
  _BYTE *v11; // eax
  int n117457024; // esi
  unsigned __int8 n6_3; // bp
  int *v14; // ebx
  char v15; // dl
  int v16; // eax
  int v17; // esi
  unsigned __int8 n4; // al
  int v19; // ecx
  char v20; // dh
  bool v21; // zf
  _BYTE *v22; // edx
  int v23; // eax
  int v24; // eax
  unsigned __int8 n4_1; // [esp+Fh] [ebp-25h]
  int v26; // [esp+10h] [ebp-24h]
  _BYTE *v27; // [esp+14h] [ebp-20h]
  int v28; // [esp+18h] [ebp-1Ch]
  int n2_1; // [esp+1Ch] [ebp-18h]
  char v30; // [esp+20h] [ebp-14h]
  unsigned __int8 *v31; // [esp+24h] [ebp-10h]
  int CpuCount; // [esp+28h] [ebp-Ch]
  int v33; // [esp+28h] [ebp-Ch]
  unsigned int n117457024_1; // [esp+2Ch] [ebp-8h]
  _BYTE *v35; // [esp+30h] [ebp-4h]
  char v36; // [esp+38h] [ebp+4h]

  n6_1 = n6; /*0xffc72ac9*/
  n6_2 = n6; /*0xffc72ace*/
  v4 = 48704 * (unsigned __int8)n6; /*0xffc72ad1*/
  if ( __return_address[v4 + 258689] )
  {
    LOBYTE(v26) = 0; /*0xffc72af4*/
    v6 = (_BYTE *)(GetSocketInfo((int)__return_address, n6) + 6716); /*0xffc72af9*/
    v35 = v6; /*0xffc72b05*/
    v31 = &__return_address[v4 + 258722]; /*0xffc72b0b*/
    do
    {
      CpuCount = GetCpuCount((int)__return_address, n6_1, v26); /*0xffc72b1d*/
      v28 = 0; /*0xffc72b23*/
      v36 = 0; /*0xffc72b29*/
      v7 = (_BYTE *)(CpuCount + 15); /*0xffc72b2d*/
      n2 = 2; /*0xffc72b32*/
      v9 = 0; /*0xffc72b33*/
      do /*0xffc72b70*/
      {
        if ( *(v7 - 15) ) /*0xffc72b35*/
        {
          LOBYTE(v10) = v7[5]; /*0xffc72b3b*/
          if ( (_BYTE)v10 ) /*0xffc72b40*/
          {
            v11 = v7; /*0xffc72b42*/
            v10 = (unsigned __int8)v10; /*0xffc72b44*/
            do /*0xffc72b61*/
            {
              if ( !*v11 || !*(v6 - 6715) && *v6 == 1 ) /*0xffc72b59*/
                ++v9; /*0xffc72b5b*/
              ++v11; /*0xffc72b5d*/
              --v10; /*0xffc72b5e*/
            }
            while ( v10 ); /*0xffc72b61*/
            v36 = v9; /*0xffc72b63*/
          }
        }
        v7 += 1379; /*0xffc72b67*/
        --n2; /*0xffc72b6d*/
      }
      while ( n2 ); /*0xffc72b70*/
      v30 = 0; /*0xffc72b72*/
      n117457024 = 117457024; /*0xffc72b76*/
      n6_3 = n6; /*0xffc72b7f*/
      v14 = (int *)(CpuCount + 134); /*0xffc72b83*/
      LOBYTE(n2_1) = 0; /*0xffc72b89*/
      n117457024_1 = 117457024; /*0xffc72b8e*/
      do
      {
        v15 = v36; /*0xffc72b92*/
        if ( v36 ) /*0xffc72b98*/
        {
          v17 = *v14; /*0xffc72bb1*/
        }
        else
        {
          v16 = MiscConfigCheck(__return_address, n6_3, v26, n117457024); /*0xffc72ba1*/
          v15 = 0; /*0xffc72ba6*/
          v17 = v16; /*0xffc72bad*/
        }
        n4 = 0; /*0xffc72bb3*/
        v19 = 0; /*0xffc72bb8*/
        v27 = (char *)v14 - 119; /*0xffc72bba*/
        n6_3 = n6; /*0xffc72bbe*/
        n4_1 = 0; /*0xffc72bc2*/
        v33 = 0; /*0xffc72bc6*/
        do /*0xffc72c84*/
        {
          v20 = *((_BYTE *)v14 - 134); /*0xffc72bca*/
          if ( !v20 || n4 >= *((_BYTE *)v14 - 114) || !v15 ) /*0xffc72bdb*/
          {
            v17 ^= (v17 ^ (v17 | (0x10000 << v19))) & 0xF0000; /*0xffc72bed*/
            n4 = n4_1; /*0xffc72bef*/
          }
          v21 = v20 == 0; /*0xffc72bf3*/
          v22 = v27; /*0xffc72bf5*/
          if ( !v21 && *v27 == 1 ) /*0xffc72bfe*/
          {
            v28 |= 1 << (v19 + v30); /*0xffc72c18*/
            v23 = MiscConfigCheck(__return_address, n6, v26, 117457036); /*0xffc72c1c*/
            v24 = (v23 ^ (v23 | ((unsigned __int8)v28 << 15))) & 0x78000 ^ v23; /*0xffc72c35*/
            MiscIoCheck(__return_address, n6, v26, 0x700408Cu, v24 ^ (v24 ^ (v24 | (BYTE1(v28) << 19))) & 0x780000); /*0xffc72c5a*/
            n4 = n4_1; /*0xffc72c5f*/
            v19 = v33; /*0xffc72c66*/
            v22 = v27; /*0xffc72c6a*/
          }
          ++n4; /*0xffc72c6e*/
          ++v19; /*0xffc72c70*/
          n4_1 = n4; /*0xffc72c72*/
          v27 = v22 + 1; /*0xffc72c76*/
          v15 = v36; /*0xffc72c7a*/
          v33 = v19; /*0xffc72c7e*/
        }
        while ( n4 < 4u ); /*0xffc72c84*/
        *v14 = v17; /*0xffc72c8b*/
        MiscIoCheck(__return_address, n6, v26, n117457024_1, v17); /*0xffc72c98*/
        DebugPrint((int)__return_address, 2, n6, v26, n2_1, 255, 255, 255, "dimmMtr: 0x%08x\n", *v14);
        v30 += 8; /*0xffc72cc4*/
        n117457024 = n117457024_1 + 4; /*0xffc72ccb*/
        LOBYTE(n2_1) = n2_1 + 1; /*0xffc72cce*/
        v14 = (int *)((char *)v14 + 1379); /*0xffc72cd2*/
        n117457024_1 += 4; /*0xffc72cd8*/
      }
      while ( (unsigned __int8)n2_1 < 2u );
      if ( !v36 ) /*0xffc72cee*/
        *v31 = 0; /*0xffc72cf0*/
      n6_2 = v26 + 1; /*0xffc72cff*/
      n6_1 = n6; /*0xffc72d01*/
      v6 = v35 + 7688; /*0xffc72d05*/
      LOBYTE(v26) = n6_2; /*0xffc72d09*/
      v35 += 7688; /*0xffc72d0d*/
      v31 += 7688; /*0xffc72d11*/
    }
    while ( n6_2 < 6u );
  }
  return n6_2; /*0xffc72d1e*/
}

// Function: DdrTrainFunc2D25 @ 0xffc72d25 (0x34 bytes)
// Index: 921/2560

int __cdecl DdrTrainFunc2D25(int __return_address)
{
  int __return_address_1; // eax

  __return_address_1 = __return_address; /*0xffc72d25*/
  if ( (*(_DWORD *)(__return_address + 255244) & 0x100000) != 0 ) /*0xffc72d33*/
  {
    if ( (MEMORY[0xFED30008] & 0x40) != 0 || (MEMORY[0xFED308F0] & 2) != 0 ) /*0xffc72d45*/
      *(_WORD *)(__return_address + 9409) = 1; /*0xffc72d47*/
    else
      *(_BYTE *)(__return_address + 9409) = 0; /*0xffc72d51*/
  }
  return __return_address_1; /*0xffc72d50*/
}

// Function: DdrTrainFunc2D59 @ 0xffc72d59 (0xb0 bytes)
// Index: 922/2560

int __cdecl DdrTrainFunc2D59(int a1)
{
  int result; // eax

  if ( *(_BYTE *)(a1 + 257314) ) /*0xffc72d5e*/
  {
    *(_DWORD *)(a1 + 134) &= ~0x800000u; /*0xffc72d6b*/
    DebugPrint(a1, 3, 255, 255, 255, 255, 255, 255, "NVMDIMM population is discovered. WrCRC disabled!\n"); /*0xffc72d89*/
    if ( *(_BYTE *)(a1 + 1429) ) /*0xffc72d91*/
    {
      if ( *(_BYTE *)(a1 + 1431) ) /*0xffc72d9a*/
        DebugPrint( /*0xffc72db1*/
          a1,
          3,
          255,
          255,
          255,
          255,
          255,
          255,
          "WARNING! Active Power Down (APD) disabled due to the presence of DDRT DIMM(s) in the system.\n");
      if ( *(_BYTE *)(a1 + 1433) ) /*0xffc72db9*/
        DebugPrint( /*0xffc72dd0*/
          a1,
          3,
          255,
          255,
          255,
          255,
          255,
          255,
          "WARNING! DDRT CKE disabled due to the presence of DDRT DIMM(s) in the system.\n");
      if ( *(_BYTE *)(a1 + 1432) ) /*0xffc72dd8*/
        DebugPrint( /*0xffc72def*/
          a1,
          3,
          255,
          255,
          255,
          255,
          255,
          255,
          "WARNING! Precharge Power Down (PPD) disabled due to the presence of DDRT DIMM(s) in the system.\n");
    }
    *(_WORD *)(a1 + 1431) = 0; /*0xffc72df9*/
    *(_BYTE *)(a1 + 1433) = 0; /*0xffc72e00*/
    return 0; /*0xffc72df7*/
  }
  return result; /*0xffc72e07*/
}

// Function: DdrTrainFunc2E09 @ 0xffc72e09 (0x33 bytes)
// Index: 923/2560

int __cdecl DdrTrainFunc2E09(unsigned __int8 *__return_address, unsigned __int8 n2, int n6)
{
  int v3; // eax

  v3 = MiscConfigCheck(__return_address, n2, n6, 184566284); /*0xffc72e1c*/
  return MiscIoCheck(__return_address, n2, n6, 0xB00420Cu, v3 & 0xFFFFFF); /*0xffc72e39*/
}

// Function: DdrTrainFunc2E3C @ 0xffc72e3c (0xec bytes)
// Index: 924/2560

char __cdecl DdrTrainFunc2E3C(int __return_address, char n4)
{
  char result; // al

  if ( *(_DWORD *)(__return_address + 246420) == 20581 ) /*0xffc72e51*/
  {
    if ( *(_BYTE *)(__return_address + 246424) >= 9u ) /*0xffc72e5a*/
      LogDebugString((_BYTE *)__return_address, (int)"CLX", (unsigned __int8)n4); /*0xffc72e68*/
    else
      LogDebugString((_BYTE *)__return_address, (int)"SKX", (unsigned __int8)n4); /*0xffc72e61*/
  }
  else
  {
    LogDebugString((_BYTE *)__return_address, (int)"?", (unsigned __int8)n4); /*0xffc72e70*/
  }
  LogDebugString((_BYTE *)__return_address, (int)" "); /*0xffc72e7e*/
  switch ( *(_BYTE *)(__return_address + 246424) ) /*0xffc72e91*/
  {
    case 0: /*0xffc72e91*/
    case 9: /*0xffc72e91*/
      LogDebugString((_BYTE *)__return_address, (int)" A0"); /*0xffc72e9d*/
      break; /*0xffc72e9d*/
    case 2: /*0xffc72e91*/
      LogDebugString((_BYTE *)__return_address, (int)" A2"); /*0xffc72ea4*/
      break; /*0xffc72ea4*/
    case 3: /*0xffc72e91*/
    case 0xA: /*0xffc72e91*/
      LogDebugString((_BYTE *)__return_address, (int)" B0"); /*0xffc72eab*/
      break; /*0xffc72eab*/
    case 4: /*0xffc72e91*/
      LogDebugString((_BYTE *)__return_address, (int)" L0"); /*0xffc72ec0*/
      break; /*0xffc72ec0*/
    case 5: /*0xffc72e91*/
    case 0xD: /*0xffc72e91*/
      LogDebugString((_BYTE *)__return_address, (int)" B1"); /*0xffc72eb2*/
      break; /*0xffc72eb2*/
    case 6: /*0xffc72e91*/
      LogDebugString((_BYTE *)__return_address, (int)" H0"); /*0xffc72eb9*/
      break; /*0xffc72eb9*/
    case 7: /*0xffc72e91*/
      LogDebugString((_BYTE *)__return_address, (int)" M0"); /*0xffc72ec7*/
      break; /*0xffc72ec7*/
    case 8: /*0xffc72e91*/
      LogDebugString((_BYTE *)__return_address, (int)" U0"); /*0xffc72ece*/
      break; /*0xffc72ece*/
    case 0xB: /*0xffc72e91*/
      LogDebugString((_BYTE *)__return_address, (int)" N0"); /*0xffc72ed5*/
      break; /*0xffc72ed5*/
    case 0xC: /*0xffc72e91*/
      LogDebugString((_BYTE *)__return_address, (int)" V0"); /*0xffc72edc*/
      break; /*0xffc72edc*/
    case 0xE: /*0xffc72e91*/
      LogDebugString((_BYTE *)__return_address, (int)" N1"); /*0xffc72ee3*/
      break; /*0xffc72ee3*/
    case 0xF: /*0xffc72e91*/
      LogDebugString((_BYTE *)__return_address, (int)" V1"); /*0xffc72eea*/
      break; /*0xffc72eea*/
    default:
      LogDebugString((_BYTE *)__return_address, (int)"Unknown"); /*0xffc72ef2*/
      break; /*0xffc72ef2*/
  }
  result = *(_BYTE *)(__return_address + 255480); /*0xffc72ef7*/
  switch ( result ) /*0xffc72f01*/
  {
    case 2: /*0xffc72f01*/
      return LogDebugString((_BYTE *)__return_address, (int)" - Socket HEDT\n"); /*0xffc72f08*/
    case 0: /*0xffc72f01*/
      return LogDebugString((_BYTE *)__return_address, (int)" - Socket 2S\n"); /*0xffc72f13*/
    case 1: /*0xffc72f01*/
      return LogDebugString((_BYTE *)__return_address, (int)" - Socket 4S\n"); /*0xffc72f1f*/
  }
  return result; /*0xffc72f26*/
}

// Function: DdrTrainFunc2F68 @ 0xffc72f68 (0x249 bytes)
// Index: 925/2560

int __cdecl DdrTrainFunc2F68(unsigned __int8 *__return_address)
{
  unsigned __int8 n4; // cl
  int v3; // edi
  unsigned int v4; // esi
  int v5; // eax
  int SocketInfo; // eax
  unsigned __int8 n6; // cl
  int n4_1; // ebp
  int n4_2; // ebp
  int n4_3; // ebp
  int n4_4; // esi
  unsigned __int8 v12; // al
  int n4_5; // esi
  unsigned __int8 v15; // [esp+10h] [ebp-Ch]
  char v16; // [esp+14h] [ebp-8h]
  char v17; // [esp+18h] [ebp-4h]
  unsigned __int8 v18; // [esp+20h] [ebp+4h]

  n4 = 0; /*0xffc72f74*/
  v16 = 0; /*0xffc72f76*/
  v3 = 0; /*0xffc72f7a*/
  v17 = 0; /*0xffc72f7c*/
  v4 = 0; /*0xffc72f80*/
  v15 = 0; /*0xffc72f82*/
  while ( 1 ) /*0xffc72f8a*/
  {
    v5 = 48704 * n4; /*0xffc72f8a*/
    if ( __return_address[v5 + 258689] ) /*0xffc72f90*/
    {
      if ( __return_address[v5 + 258716] ) /*0xffc72f9a*/
        break; /*0xffc72f9a*/
    }
    v15 = ++n4; /*0xffc72fa6*/
    if ( n4 >= 4u ) /*0xffc72fad*/
      goto LABEL_12; /*0xffc72fad*/
  }
  SocketInfo = GetSocketInfo((int)__return_address, v15); /*0xffc72fb7*/
  n6 = 0; /*0xffc72fbe*/
  v18 = 0; /*0xffc72fc2*/
  while ( !*(_BYTE *)(7688 * n6 + SocketInfo) ) /*0xffc72fd3*/
  {
    v18 = ++n6; /*0xffc72fd7*/
    if ( n6 >= 6u ) /*0xffc72fde*/
      goto LABEL_11; /*0xffc72fde*/
  }
  v3 = MiscConfigCheck(__return_address, v15, v18, 184566328); /*0xffc72ffb*/
  v17 = MiscConfigCheck(__return_address, v15, v18, 184631776); /*0xffc73007*/
LABEL_11:
  v4 = MailBoxFunc8EB3((int)__return_address, v15, 117459220); /*0xffc7300b*/
  v16 = MailBoxFunc8E0B((int)__return_address, (int)__return_address, v15, 0, 117459068); /*0xffc7302a*/
LABEL_12:
  LogDebugString(__return_address, (int)"ECC Checking        |"); /*0xffc7302e*/
  n4_1 = 4; /*0xffc7303d*/
  do /*0xffc7304b*/
  {
    RmtFunc696A(__return_address, 0xCu); /*0xffc73041*/
    --n4_1; /*0xffc73048*/
  }
  while ( n4_1 ); /*0xffc7304b*/
  if ( __return_address[257312] ) /*0xffc7304d*/
    LogDebugString(__return_address, (int)"     On     |\n"); /*0xffc7305b*/
  else
    LogDebugString(__return_address, (int)"     Off    |\n"); /*0xffc73063*/
  LogDebugString(__return_address, (int)"Patrol/Demand Scrub |"); /*0xffc73070*/
  n4_2 = 4; /*0xffc73079*/
  do /*0xffc73087*/
  {
    RmtFunc696A(__return_address, 0xCu); /*0xffc7307d*/
    --n4_2; /*0xffc73084*/
  }
  while ( n4_2 ); /*0xffc73087*/
  if ( v4 < 0x80000000 ) /*0xffc7308f*/
    LogDebugString(__return_address, (int)"     Off    |\n"); /*0xffc7309e*/
  else
    LogDebugString(__return_address, (int)"     On     |\n"); /*0xffc73096*/
  LogDebugString(__return_address, (int)"RAS Mode            |"); /*0xffc730ab*/
  n4_3 = 4; /*0xffc730b4*/
  n4_4 = 4; /*0xffc730b5*/
  do /*0xffc730c4*/
  {
    RmtFunc696A(__return_address, 0xCu); /*0xffc730ba*/
    --n4_4; /*0xffc730c1*/
  }
  while ( n4_4 ); /*0xffc730c4*/
  v12 = __return_address[257309]; /*0xffc730c6*/
  if ( v12 ) /*0xffc730ce*/
  {
    switch ( v12 ) /*0xffc730d9*/
    {
      case 1u: /*0xffc730d9*/
        LogDebugString(__return_address, (int)"   1LM Mirror   |\n"); /*0xffc730e0*/
        break;
      case 2u: /*0xffc730d9*/
        LogDebugString(__return_address, (int)"  2LM Mirror   |\n"); /*0xffc730eb*/
        break;
      case 0x80u: /*0xffc730d9*/
        LogDebugString(__return_address, (int)"  Lockstep  |\n"); /*0xffc730f6*/
        break;
      case 8u: /*0xffc730d9*/
        LogDebugString(__return_address, (int)" Rank Spare |\n"); /*0xffc73101*/
        break;
      case 0x40u: /*0xffc730d9*/
        LogDebugString(__return_address, (int)" ADDDC Spare |\n"); /*0xffc7310c*/
        break;
      case 0x88: /*0xffc730d9*/
        LogDebugString(__return_address, (int)"    SP/LK   |\n"); /*0xffc73117*/
        break;
      case 0xBu: /*0xffc730d9*/
        LogDebugString(__return_address, (int)"    MR/SP   |\n"); /*0xffc73123*/
        break;
    }
  }
  else
  {
    LogDebugString(__return_address, (int)"   Indep    |\n"); /*0xffc730d5*/
  }
  LogDebugString(__return_address, (int)"Paging Policy       |"); /*0xffc73130*/
  n4_5 = 4; /*0xffc73137*/
  do /*0xffc73146*/
  {
    RmtFunc696A(__return_address, 0xCu); /*0xffc7313c*/
    --n4_5; /*0xffc73143*/
  }
  while ( n4_5 ); /*0xffc73146*/
  if ( (v16 & 1) != 0 ) /*0xffc7314d*/
  {
    LogDebugString(__return_address, (int)"   Closed   |\n"); /*0xffc73154*/
  }
  else if ( (v3 & 0x10000000) != 0 ) /*0xffc7315c*/
  {
    LogDebugString(__return_address, (int)" Adapt Open |\n"); /*0xffc73163*/
  }
  else
  {
    LogDebugString(__return_address, (int)"    Open    |\n"); /*0xffc7316b*/
  }
  LogDebugString(__return_address, (int)"Data Scrambling     |"); /*0xffc73178*/
  do /*0xffc7318c*/
  {
    RmtFunc696A(__return_address, 0xCu); /*0xffc73182*/
    --n4_3; /*0xffc73189*/
  }
  while ( n4_3 ); /*0xffc7318c*/
  if ( (v17 & 2) != 0 ) /*0xffc73194*/
    return LogDebugString(__return_address, (int)"     On     |\n"); /*0xffc7319b*/
  else
    return LogDebugString(__return_address, (int)"     Off    |\n"); /*0xffc731a3*/
}

// Function: DdrTrainFunc31B1 @ 0xffc731b1 (0x2e bytes)
// Index: 926/2560

int __cdecl DdrTrainFunc31B1(int __return_address, int n2)
{
  __int64 v2; // rax

  v2 = KtiFunc2C7D(__return_address, n2, 1076); /*0xffc731c0*/
  return KtiFunc35EC(__return_address, n2, 1076, v2 | 0x800000, HIDWORD(v2)); /*0xffc731dd*/
}

// Function: DdrTrainFunc31DF @ 0xffc731df (0xce bytes)
// Index: 927/2560

unsigned __int8 __cdecl DdrTrainFunc31DF(unsigned __int8 *n6, int n4, int n6_1)
{
  _BYTE *CpuCount; // ebp
  unsigned __int8 n2_1; // al
  int v5; // esi
  unsigned int n6_2; // edi
  int n2; // [esp+Ch] [ebp-4h]

  CpuCount = (_BYTE *)GetCpuCount((int)n6, n4, n6_1); /*0xffc731f7*/
  n2_1 = 0; /*0xffc731f9*/
  LOBYTE(n2) = 0; /*0xffc731fb*/
  do /*0xffc732a2*/
  {
    if ( *CpuCount ) /*0xffc731ff*/
    {
      if ( CpuCount[107] ) /*0xffc73209*/
      {
        v5 = ProcCommonFuncE35E((int)n6, n4, n6_1, n2, 0x5024108u); /*0xffc73236*/
        n6_2 = ProcCommonFuncE35E((int)n6, n4, n6_1, n2, 0x5024104u) & 0xFFFEFFFF; /*0xffc73252*/
        ProcCommonFuncF4C7(n6, n4, n6_1, n2, 84033800, v5 & 0xFFFEFFFF); /*0xffc7326a*/
        ProcCommonFuncF4C7(n6, n4, n6_1, n2, 84033796, n6_2); /*0xffc73288*/
        n2_1 = n2; /*0xffc7328d*/
      }
    }
    ++n2_1; /*0xffc73294*/
    CpuCount += 1379; /*0xffc73296*/
    LOBYTE(n2) = n2_1; /*0xffc7329c*/
  }
  while ( n2_1 < 2u ); /*0xffc732a2*/
  return n2_1; /*0xffc732a8*/
}

// Function: DdrTrainFunc32AD @ 0xffc732ad (0x43f bytes)
// Index: 928/2560

int __cdecl DdrTrainFunc32AD(int __return_address, int n2)
{
  unsigned __int8 n2_1; // bl
  int result; // eax
  int SocketInfo; // eax
  unsigned __int8 n2_3; // cl
  int v7; // eax
  unsigned int n184566080; // esi
  int v9; // eax
  int v10; // eax
  int v11; // eax
  int v12; // eax
  int v13; // esi
  int v14; // eax
  unsigned int v15; // eax
  int v16; // eax
  int v17; // eax
  int v18; // eax
  int v19; // eax
  int v20; // eax
  int v21; // eax
  unsigned __int8 v22; // al
  int v23; // eax
  int v24; // eax
  int v25; // eax
  int v26; // eax
  int v27; // eax
  int v28; // esi
  int n2_2; // [esp+8h] [ebp-4h]
  unsigned __int8 *v30; // [esp+10h] [ebp+4h]

  n2_1 = n2; /*0xffc732af*/
  result = 48704 * (unsigned __int8)n2; /*0xffc732b6*/
  if ( *(_BYTE *)(result + __return_address + 258704) ) /*0xffc732c1*/
  {
    if ( KtiFuncE34(__return_address, 0, 0) ) /*0xffc732d4*/
      DdrTrainFunc31B1(__return_address, n2); /*0xffc732e2*/
    SocketInfo = GetSocketInfo(__return_address, n2); /*0xffc732eb*/
    n2_3 = 0; /*0xffc732f2*/
    result = SocketInfo + 320; /*0xffc732f4*/
    LOBYTE(n2) = 0; /*0xffc732fa*/
    v30 = (unsigned __int8 *)result; /*0xffc732fe*/
    do /*0xffc736d9*/
    {
      if ( *(_BYTE *)(result - 320) ) /*0xffc73303*/
      {
        v7 = MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 184566024); /*0xffc7331c*/
        MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0xB004108u, v7 & 0x77FF7FFF | 0x8000); /*0xffc73334*/
        n2_2 = 2; /*0xffc7333c*/
        n184566080 = 184566080; /*0xffc73344*/
        do /*0xffc7336c*/
        {
          v9 = MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, n184566080); /*0xffc7334d*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, n184566080, v9 & 0xFFFFDFFF); /*0xffc7335c*/
          n184566080 += 4; /*0xffc73364*/
          --n2_2; /*0xffc73367*/
        }
        while ( n2_2 ); /*0xffc7336c*/
        result = (int)v30; /*0xffc7336e*/
        if ( v30[6396] ) /*0xffc73372*/
        {
          v10 = MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 184566616); /*0xffc73388*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0xB004358u, v10 & 0xC0C0C0C0 | 0xD07100D); /*0xffc7339c*/
          v11 = MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 117524480); /*0xffc733aa*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0x7014800u, v11 & 0xFFFF00FF | 0x600); /*0xffc733be*/
          v12 = MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 117525024); /*0xffc733ce*/
          v13 = (v12 ^ ((*v30 - 9) << 16)) & 0xFF0000 ^ v12; /*0xffc733e9*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0x7014A20u, v13); /*0xffc733f4*/
          v14 = MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 184631884); /*0xffc73401*/
          if ( (*(_DWORD *)(__return_address + 134) & 0x800000) != 0 && (v13 & 0xFF0000u) > 0x70000 ) /*0xffc73421*/
            v15 = v14 & 0xFFF87FFF | 0x18000; /*0xffc73428*/
          else
            v15 = v14 & 0xFFF87FFF | 0x8000; /*0xffc73434*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0xB01424Cu, v15); /*0xffc73442*/
          v16 = MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 117525028); /*0xffc73450*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0x7014A24u, v16); /*0xffc7345a*/
          v17 = MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 117525032); /*0xffc73466*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0x7014A28u, v17 & 0xFF000000 | 0x20000); /*0xffc7347d*/
          v18 = MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 117525036); /*0xffc7348b*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0x7014A2Cu, v18 & 0xFFFF0000); /*0xffc7349a*/
          v19 = MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 117525796); /*0xffc734a8*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0x7014D24u, v19 | 0x744); /*0xffc734ba*/
          MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 117524992); /*0xffc734c8*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0x7014A00u, 101058054); /*0xffc734d6*/
          MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 117524996); /*0xffc734e2*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0x7014A04u, 167839263); /*0xffc734f3*/
          MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 117525000); /*0xffc73501*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0x7014A08u, 252645135); /*0xffc7350f*/
          MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 117525004); /*0xffc7351b*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0x7014A0Cu, 117903135); /*0xffc7352c*/
          MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 117516816); /*0xffc7353a*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0x7012A10u, 1794); /*0xffc73548*/
          v20 = MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 117525012); /*0xffc73556*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0x7014A14u, v20 & 0xFF00FF00 | 0x10001); /*0xffc7356d*/
          v21 = MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 117525016); /*0xffc73579*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0x7014A18u, v21 & 0xFFFFFF00 | 1); /*0xffc7358b*/
          v22 = MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 117525128); /*0xffc73599*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0x7014A88u, v22 | 0x1010100); /*0xffc735ae*/
          v23 = MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 117525076); /*0xffc735ba*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0x7014A54u, v23 & 0xFFFFC000 | 0x884); /*0xffc735ce*/
          v24 = MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 117525792); /*0xffc735dc*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0x7014D20u, v24 & 0xFFFC03F8 | 0x8005); /*0xffc735f3*/
          v25 = MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 117525180); /*0xffc73601*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0x7014ABCu, v25 | 0x1F); /*0xffc7360e*/
          MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 117525116); /*0xffc7361a*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0x7014A7Cu, 8224); /*0xffc73634*/
          v26 = MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 117525072) | 0x3000002; /*0xffc73649*/
          if ( *(_BYTE *)(__return_address + 1435) ) /*0xffc7364e*/
            v27 = v26 & 0xFFEFFFFF; /*0xffc7365e*/
          else
            v27 = v26 | 0x100000; /*0xffc73657*/
          MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0x7014A50u, v27); /*0xffc7366c*/
          if ( SocketPresentCheck(__return_address, 0, 2u) ) /*0xffc73676*/
          {
            v28 = MiscConfigCheck((unsigned __int8 *)__return_address, n2_1, n2, 117525164) | 0x4000000; /*0xffc73696*/
            if ( SocketPresentCheck(__return_address, 0, 3u) ) /*0xffc7369c*/
              v28 |= 0x40000000u; /*0xffc736a8*/
            MiscIoCheck((unsigned __int8 *)__return_address, n2_1, n2, 0x7014AACu, v28); /*0xffc736b7*/
          }
          result = (int)v30; /*0xffc736bf*/
        }
        n2_3 = n2; /*0xffc736c3*/
      }
      ++n2_3; /*0xffc736c7*/
      result += 7688; /*0xffc736c9*/
      LOBYTE(n2) = n2_3; /*0xffc736ce*/
      v30 = (unsigned __int8 *)result; /*0xffc736d2*/
    }
    while ( n2_3 < 6u ); /*0xffc736d9*/
    *(_BYTE *)(__return_address + 453594) = 0; /*0xffc736e0*/
  }
  return result; /*0xffc736e8*/
}

// Function: DdrTrainFunc36EC @ 0xffc736ec (0x3ac bytes)
// Index: 929/2560

char __cdecl DdrTrainFunc36EC(unsigned __int8 *n6, int a2)
{
  int v2; // ebx
  int SocketInfo; // ebp
  _BYTE *SocketInfo_2; // edi
  unsigned __int8 n6_1; // al
  int CpuCount; // eax
  int v7; // edx
  _BYTE *CpuCount_1; // ecx
  unsigned __int8 n6_2; // al
  _BYTE *v10; // ebp
  int n6_5; // edi
  unsigned int v12; // ecx
  unsigned int v13; // eax
  unsigned int v14; // eax
  int v15; // eax
  int v16; // eax
  int n6_3; // eax
  unsigned __int8 v18; // cl
  int v19; // eax
  _BYTE *SocketInfo_3; // ebp
  int n6_6; // edi
  int v22; // eax
  int v23; // eax
  int v24; // eax
  int v25; // eax
  int v26; // eax
  int v27; // eax
  int v28; // eax
  unsigned __int8 v30; // [esp+13h] [ebp-15h]
  _WORD v31[2]; // [esp+14h] [ebp-14h]
  int n6_4; // [esp+18h] [ebp-10h]
  int v33; // [esp+1Ch] [ebp-Ch]
  int n6_7; // [esp+20h] [ebp-8h]
  _BYTE *SocketInfo_1; // [esp+24h] [ebp-4h]

  v2 = a2; /*0xffc736f0*/
  n6_7 = 0; /*0xffc736ff*/
  v31[0] = 0; /*0xffc73703*/
  SocketInfo = GetSocketInfo((int)n6, a2); /*0xffc73712*/
  SocketInfo_1 = (_BYTE *)SocketInfo; /*0xffc73722*/
  DebugPrint((int)n6, 2, a2, 255, 255, 255, 255, 255, "Enabling C/A Parity\n"); /*0xffc73726*/
  SocketInfo_2 = (_BYTE *)SocketInfo; /*0xffc7372e*/
  n6_1 = 0; /*0xffc73730*/
  LOBYTE(n6_4) = 0; /*0xffc73732*/
  do /*0xffc7379b*/
  {
    if ( *SocketInfo_2 ) /*0xffc73736*/
    {
      v30 = DdrTrainFunc45AB((int)n6, v2, n6_4); /*0xffc7374a*/
      CpuCount = GetCpuCount((int)n6, v2, n6_4); /*0xffc73750*/
      LOBYTE(v7) = SocketInfo_2[3]; /*0xffc73755*/
      CpuCount_1 = (_BYTE *)CpuCount; /*0xffc7375b*/
      if ( (_BYTE)v7 ) /*0xffc7375f*/
      {
        v7 = (unsigned __int8)v7; /*0xffc73765*/
        do /*0xffc73783*/
        {
          if ( *CpuCount_1 && CpuCount_1[107] ) /*0xffc7376d*/
            ++*((_BYTE *)v31 + v30); /*0xffc73776*/
          CpuCount_1 += 1379; /*0xffc7377a*/
          --v7; /*0xffc73780*/
        }
        while ( v7 ); /*0xffc73783*/
        v2 = a2; /*0xffc73785*/
      }
      n6_1 = n6_4; /*0xffc73789*/
    }
    ++n6_1; /*0xffc7378d*/
    SocketInfo_2 += 7688; /*0xffc7378f*/
    LOBYTE(n6_4) = n6_1; /*0xffc73795*/
  }
  while ( n6_1 < 6u ); /*0xffc7379b*/
  n6_2 = 0; /*0xffc7379d*/
  v10 = (_BYTE *)(SocketInfo + 6263); /*0xffc7379f*/
  LOBYTE(n6_4) = 0; /*0xffc737a5*/
  do /*0xffc738bd*/
  {
    if ( *(v10 - 6263) ) /*0xffc737a9*/
    {
      n6_5 = n6_4; /*0xffc737b6*/
      v12 = MiscConfigCheck(n6, v2, n6_4, 184632316) & 0xFFFFF00F | (16 * (unsigned __int8)byte_FFD42F20[n6[257311]]); /*0xffc737e0*/
      if ( !n6[257313] ) /*0xffc737e2*/
        v12 |= 2u; /*0xffc737eb*/
      MiscIoCheck(n6, v2, n6_5, 0xB0143FCu, v12); /*0xffc737f7*/
      v13 = MiscConfigCheck(n6, v2, n6_5, 184567316) & 0xFFFFFFF8; /*0xffc7380c*/
      if ( *(v10 - 1) == 2 ) /*0xffc73813*/
        v13 ^= ((unsigned __int8)v13 ^ *v10) & 7; /*0xffc7381e*/
      MiscIoCheck(n6, v2, n6_5, 0xB004614u, v13); /*0xffc73829*/
      v14 = MiscConfigCheck(n6, v2, n6_5, 184633088) & 0xFEFFFFFD | 0x1000000; /*0xffc7384a*/
      v33 = 48704 * (unsigned __int8)v2; /*0xffc7384f*/
      if ( !n6[v33 + 258699] ) /*0xffc73853*/
        v14 &= ~0x1000000u; /*0xffc7385d*/
      MiscIoCheck(n6, v2, n6_5, 0xB014700u, v14); /*0xffc7386b*/
      v15 = MiscConfigCheck(n6, v2, n6_5, 184567556); /*0xffc73878*/
      if ( n6[v33 + 258699] ) /*0xffc73884*/
        v16 = v15 & 0xDFFEFFFF; /*0xffc7388e*/
      else
        v16 = v15 | 0x20010000; /*0xffc73895*/
      MiscIoCheck(n6, v2, n6_5, 0xB004704u, v16); /*0xffc738a3*/
      n6_2 = n6_4; /*0xffc738a8*/
    }
    ++n6_2; /*0xffc738af*/
    v10 += 7688; /*0xffc738b1*/
    LOBYTE(n6_4) = n6_2; /*0xffc738b7*/
  }
  while ( n6_2 < 6u ); /*0xffc738bd*/
  LOBYTE(n6_3) = KtiFuncE78((int)n6, 0, 3u); /*0xffc738c8*/
  if ( (_BYTE)n6_3 )
  {
    n6_3 = 0; /*0xffc738d8*/
    v18 = 0; /*0xffc738da*/
    LOBYTE(v33) = 0; /*0xffc738dc*/
    if ( n6[244317] ) /*0xffc738e0*/
    {
      do /*0xffc73931*/
      {
        if ( !*((_BYTE *)v31 + v18) && (n6[257309] & 0x80u) == 0 ) /*0xffc738fe*/
        {
          v19 = MailBoxFunc8E0B(v2, (int)n6, v2, v33, 117459308); /*0xffc73907*/
          MailBoxFunc8FC5((int)n6, v2, v33, 117459308, v19 | 0x1000000); /*0xffc73919*/
          v18 = v33; /*0xffc7391e*/
        }
        LOBYTE(v33) = ++v18; /*0xffc73927*/
      }
      while ( v18 < n6[244317] ); /*0xffc73931*/
      n6_3 = 0; /*0xffc73933*/
    }
    SocketInfo_3 = SocketInfo_1; /*0xffc73935*/
    LOBYTE(n6_4) = 0; /*0xffc73939*/
    do
    {
      if ( *SocketInfo_3 )
      {
        n6_6 = n6_4; /*0xffc73947*/
        if ( *((_BYTE *)v31 + (unsigned __int8)DdrTrainFunc45AB((int)n6, v2, n6_4)) )
        {
          MiscIoCheck(n6, v2, n6_6, 0xB004254u, n6[257313] == 0 ? -1073684378 : -2147426202);
          v22 = MiscConfigCheck(n6, v2, n6_6, 184566348); /*0xffc73990*/
          MiscIoCheck(n6, v2, n6_6, 0xB00424Cu, v22 & 0x7FFFFFFF); /*0xffc739a3*/
          v23 = MiscConfigCheck(n6, v2, n6_6, 184566352); /*0xffc739b0*/
          MiscIoCheck(n6, v2, n6_6, 0xB004250u, v23 & 0x7FFFFFFF); /*0xffc739c6*/
          v24 = MiscConfigCheck(n6, v2, n6_6, 184566360); /*0xffc739d3*/
          MiscIoCheck(n6, v2, n6_6, 0xB004258u, v24 & 0x7FFFFFFF); /*0xffc739e6*/
          v25 = MiscConfigCheck(n6, v2, n6_6, 184566380); /*0xffc739f3*/
          MiscIoCheck(n6, v2, n6_6, 0xB00426Cu, v25 & 0x7FFFFFFF); /*0xffc73a09*/
          v26 = MiscConfigCheck(n6, v2, n6_6, 184566436); /*0xffc73a16*/
          MiscIoCheck(n6, v2, n6_6, 0xB0042A4u, v26 & 0x7FFFFFFF); /*0xffc73a29*/
          v27 = MiscConfigCheck(n6, v2, n6_6, 184566440); /*0xffc73a36*/
          MiscIoCheck(n6, v2, n6_6, 0xB0042A8u, v27 & 0x7FFFFFFF); /*0xffc73a4c*/
          v28 = MiscConfigCheck(n6, v2, n6_6, 184566444); /*0xffc73a59*/
          MiscIoCheck(n6, v2, n6_6, 0xB0042ACu, v28 & 0x7FFFFFFF); /*0xffc73a6c*/
        }
        n6_3 = n6_7; /*0xffc73a74*/
      }
      LOBYTE(n6_3) = n6_3 + 1; /*0xffc73a78*/
      SocketInfo_3 += 7688; /*0xffc73a7a*/
      n6_7 = n6_3; /*0xffc73a80*/
      LOBYTE(n6_4) = n6_3; /*0xffc73a84*/
    }
    while ( (unsigned __int8)n6_3 < 6u );
  }
  return n6_3; /*0xffc73a90*/
}

// Function: DdrTrainFunc3A98 @ 0xffc73a98 (0x1dd bytes)
// Index: 930/2560

_BYTE *__cdecl DdrTrainFunc3A98(_BYTE *n6, int n4)
{
  unsigned __int8 n6_4; // bl
  _BYTE *n6_1; // edi
  int SocketInfo; // eax
  int (__cdecl *DdrTrainFunc41B2_1)(unsigned __int8 *, unsigned __int8); // ecx
  char (__cdecl *ProcCommonFunc1944_1)(); // edx
  _BYTE *SocketInfo_1; // esi
  unsigned __int8 n6_2; // al
  _BYTE *SocketInfo_3; // edx
  int v10; // ecx
  unsigned int v11; // eax
  int v12; // eax
  _BYTE *SocketInfo_5; // esi
  unsigned __int8 n6_3; // al
  _BYTE *SocketInfo_6; // eax
  int v16; // esi
  int v17; // [esp+10h] [ebp-40h]
  _BYTE *SocketInfo_2; // [esp+14h] [ebp-3Ch]
  _BYTE *SocketInfo_4; // [esp+18h] [ebp-38h]
  _DWORD v20[12]; // [esp+20h] [ebp-30h]

  n6_4 = 0; /*0xffc73aa1*/
  n6_1 = n6; /*0xffc73aa5*/
  SocketInfo = GetSocketInfo((int)n6, n4); /*0xffc73aaf*/
  DdrTrainFunc41B2_1 = DdrTrainFunc41B2; /*0xffc73ab6*/
  ProcCommonFunc1944_1 = ProcCommonFunc1944; /*0xffc73abb*/
  SocketInfo_1 = (_BYTE *)SocketInfo; /*0xffc73ac4*/
  SocketInfo_2 = (_BYTE *)SocketInfo; /*0xffc73ac6*/
  if ( (unsigned int)ProcCommonFunc1944 > (unsigned int)DdrTrainFunc41B2 /*0xffc73ade*/
    || (ProcCommonFunc1944_1 = (char (__cdecl *)())&loc_FFC781B2, &loc_FFC781B2 >= (_UNKNOWN *)DdrTrainFunc41B2) )
  {
    do /*0xffc73aef*/
      DdrTrainFunc41B2_1 = (int (__cdecl *)(unsigned __int8 *, unsigned __int8))((char *)DdrTrainFunc41B2_1 + 4); /*0xffc73ae2*/
    while ( (unsigned int)DdrTrainFunc41B2_1 < (unsigned int)ProcCommonFunc1944_1 ); /*0xffc73aef*/
  }
  if ( *(_DWORD *)(n6 + 9405) == 12 ) /*0xffc73b02*/
    KtiFuncCB08(n6, n4); /*0xffc73b06*/
  n6_2 = 0; /*0xffc73b0d*/
  SocketInfo_3 = SocketInfo_1; /*0xffc73b0f*/
  v10 = 0; /*0xffc73b11*/
  LOBYTE(n6) = 0; /*0xffc73b13*/
  SocketInfo_4 = SocketInfo_1; /*0xffc73b17*/
  v17 = 0; /*0xffc73b1b*/
  do /*0xffc73bb9*/
  {
    *(_DWORD *)((char *)v20 + v10) = 0; /*0xffc73b1f*/
    *(_DWORD *)((char *)&v20[6] + v10) = 0; /*0xffc73b23*/
    if ( *SocketInfo_3 ) /*0xffc73b27*/
    {
      v11 = MiscConfigCheck(n6_1, n4, (unsigned __int8)n6, 184566292); /*0xffc73b37*/
      *(_DWORD *)((char *)v20 + v17) = v11; /*0xffc73b40*/
      MiscIoCheck(n6_1, n4, (int)n6, 0xB004214u, v11 & 0xFFFF8000 | (v11 >> 1) & 0x3FFF); /*0xffc73b5e*/
      v12 = MiscConfigCheck(n6_1, n4, (unsigned __int8)n6, 184566304); /*0xffc73b6b*/
      *(_DWORD *)((char *)&v20[6] + v17) = v12; /*0xffc73b74*/
      MiscIoCheck(n6_1, n4, (int)n6, 0xB004220u, v12 & 0xFFFFFF00 | 2); /*0xffc73b89*/
      n6_2 = (unsigned __int8)n6; /*0xffc73b8e*/
      v10 = v17; /*0xffc73b98*/
      SocketInfo_3 = SocketInfo_4; /*0xffc73b9c*/
    }
    ++n6_2; /*0xffc73ba0*/
    SocketInfo_3 += 7688; /*0xffc73ba2*/
    v10 += 4; /*0xffc73ba8*/
    LOBYTE(n6) = n6_2; /*0xffc73bab*/
    SocketInfo_4 = SocketInfo_3; /*0xffc73baf*/
    v17 = v10; /*0xffc73bb3*/
  }
  while ( n6_2 < 6u ); /*0xffc73bb9*/
  DdrTrainFunc3C75((int)n6_1, n4); /*0xffc73bc1*/
  SocketInfo_5 = SocketInfo_2; /*0xffc73bc6*/
  n6_3 = 0; /*0xffc73bca*/
  LOBYTE(n6) = 0; /*0xffc73bce*/
  do /*0xffc73bf7*/
  {
    if ( *SocketInfo_5 ) /*0xffc73bd2*/
    {
      DdrTrainFunc7621(n6_1, n4, n6, 0); /*0xffc73bdd*/
      n6_3 = (unsigned __int8)n6; /*0xffc73be2*/
    }
    ++n6_3; /*0xffc73be9*/
    SocketInfo_5 += 7688; /*0xffc73beb*/
    LOBYTE(n6) = n6_3; /*0xffc73bf1*/
  }
  while ( n6_3 < 6u ); /*0xffc73bf7*/
  if ( *((_DWORD *)n6_1 + 61601) == 1 || *(_DWORD *)(n6_1 + 9405) == 10 ) /*0xffc73c09*/
    KtiFunc8C4((int)n6_1, 0x3E80u); /*0xffc73c11*/
  SocketInfo_6 = SocketInfo_2; /*0xffc73c18*/
  v16 = 0; /*0xffc73c1c*/
  LOBYTE(n6) = 0; /*0xffc73c1e*/
  do /*0xffc73c6b*/
  {
    if ( *SocketInfo_6 ) /*0xffc73c22*/
    {
      MiscIoCheck(n6_1, n4, (int)n6, 0xB004214u, v20[v16]); /*0xffc73c36*/
      MiscIoCheck(n6_1, n4, (int)n6, 0xB004220u, v20[v16 + 6]); /*0xffc73c4a*/
      SocketInfo_6 = SocketInfo_2; /*0xffc73c4f*/
    }
    ++n6_4; /*0xffc73c56*/
    SocketInfo_6 += 7688; /*0xffc73c58*/
    ++v16; /*0xffc73c5d*/
    LOBYTE(n6) = n6_4; /*0xffc73c60*/
    SocketInfo_2 = SocketInfo_6; /*0xffc73c64*/
  }
  while ( n6_4 < 6u ); /*0xffc73c6b*/
  return SocketInfo_6; /*0xffc73c6d*/
}

// Function: DdrTrainFunc3C75 @ 0xffc73c75 (0x53d bytes)
// Index: 931/2560

unsigned __int8 __cdecl DdrTrainFunc3C75(int n2, int n4)
{
  int n2_1; // edi
  int SocketInfo; // ebp
  bool v4; // zf
  unsigned __int8 n6_1; // al
  _BYTE *SocketInfo_2; // esi
  unsigned __int8 n6_2; // al
  unsigned __int8 *v8; // esi
  int CpuCount; // edx
  unsigned __int8 n2a_1; // al
  int v11; // ebp
  unsigned __int8 n6_3; // al
  unsigned __int8 *CpuCount_2; // esi
  int v14; // eax
  unsigned __int8 v15; // cl
  int v16; // ecx
  int v17; // esi
  int v18; // esi
  unsigned __int8 v19; // al
  int v20; // ecx
  int v21; // eax
  int v22; // [esp+10h] [ebp-30h]
  unsigned __int8 v23; // [esp+10h] [ebp-30h]
  _BYTE *n6; // [esp+14h] [ebp-2Ch]
  int v25; // [esp+18h] [ebp-28h]
  int v26; // [esp+1Ch] [ebp-24h]
  unsigned __int8 v27[4]; // [esp+20h] [ebp-20h] BYREF
  unsigned __int8 *CpuCount_1; // [esp+24h] [ebp-1Ch]
  int SocketInfo_1; // [esp+28h] [ebp-18h]
  int v30; // [esp+2Ch] [ebp-14h]
  int v31; // [esp+30h] [ebp-10h]
  unsigned __int16 v32[2]; // [esp+34h] [ebp-Ch]
 ... [9566 chars total]

// Function: DdrTrainFunc41B2 @ 0xffc741b2 (0x223 bytes)
// Index: 932/2560

int __cdecl DdrTrainFunc41B2(unsigned __int8 *n6, unsigned __int8 n2)
{
  unsigned __int8 *n6_1; // ebp
  unsigned __int8 n6_5; // bl
  unsigned __int8 n2_1; // si
  int SocketInfo; // edi
  unsigned __int8 n6_2; // al
  _BYTE *SocketInfo_1; // ecx
  int v8; // eax
  unsigned __int8 n6_3; // al
  _BYTE *v10; // edi
  int v11; // eax
  _BYTE *SocketInfo_4; // ecx
  unsigned __int8 n6_4; // al
  int CpuCount; // eax
  int v15; // esi
  unsigned int v16; // edi
  _BYTE *SocketInfo_6; // edi
  int result; // eax
  _BYTE *SocketInfo_3; // [esp+14h] [ebp-1Ch]
  unsigned int n360; // [esp+14h] [ebp-1Ch]
  _BYTE *SocketInfo_5; // [esp+18h] [ebp-18h]
  _BYTE *SocketInfo_2; // [esp+1Ch] [ebp-14h]
  __int64 v23; // [esp+20h] [ebp-10h] BYREF
  __int64 v24; // [esp+28h] [ebp-8h] BYREF

  n6_1 = n6; /*0xffc741b7*/
  n6_5 = 0; /*0xffc741bb*/
  n2_1 = n2; /*0xffc741be*/
  v24 = 0; /*0xffc741c5*/
  v23 = 0; /*0xffc741cd*/
  SocketInfo = GetSocketInfo((int)n6, n2); /*0xffc741db*/
  n6_2 = 0; /*0xffc741dd*/
  SocketInfo_1 = (_BYTE *)SocketInfo; /*0xffc741e0*/
  SocketInfo_2 = (_BYTE *)SocketInfo; /*0xffc741e2*/
  LOBYTE(n6) = 0; /*0xffc741e6*/
  SocketInfo_3 = (_BYTE *)SocketInfo; /*0xffc741ea*/
  do /*0xffc74230*/
  {
    if ( *SocketInfo_1 ) /*0xffc741ee*/
    {
      v8 = MiscConfigCheck(n6_1, n2, (unsigned __int8)n6, 184567108); /*0xffc741fd*/
      MiscIoCheck(n6_1, n2, (int)n6, 0xB004544u, v8); /*0xffc7420e*/
      n6_2 = (unsigned __int8)n6; /*0xffc74213*/
      SocketInfo_1 = SocketInfo_3; /*0xffc7421a*/
    }
    ++n6_2; /*0xffc7421e*/
    SocketInfo_1 += 7688; /*0xffc74220*/
    LOBYTE(n6) = n6_2; /*0xffc74226*/
    SocketInfo_3 = SocketInfo_1; /*0xffc7422a*/
  }
  while ( n6_2 < 6u ); /*0xffc74230*/
  n6_3 = 0; /*0xffc74232*/
  v10 = (_BYTE *)(SocketInfo + 1); /*0xffc74234*/
  LOBYTE(n6) = 0; /*0xffc74235*/
  do /*0xffc74286*/
  {
    if ( *(v10 - 1) == 1 || v10[6715] && !*v10 ) /*0xffc74247*/
    {
      v11 = MiscConfigCheck(n6_1, n2, (unsigned __int8)n6, 184567108); /*0xffc74256*/
      MiscIoCheck(n6_1, n2, (int)n6, 0xB004544u, v11 | 0x100); /*0xffc7426c*/
      n6_3 = (unsigned __int8)n6; /*0xffc74271*/
    }
    ++n6_3; /*0xffc74278*/
    v10 += 7688; /*0xffc7427a*/
    LOBYTE(n6) = n6_3; /*0xffc74280*/
  }
  while ( n6_3 < 6u ); /*0xffc74286*/
  SocketInfo_4 = SocketInfo_2; /*0xffc74288*/
  n6_4 = 0; /*0xffc7428c*/
  LOBYTE(n6) = 0; /*0xffc7428e*/
  SocketInfo_5 = SocketInfo_2; /*0xffc74292*/
  do /*0xffc74384*/
  {
    if ( *SocketInfo_4 ) /*0xffc74296*/
    {
      CpuCount = GetCpuCount((int)n6_1, n2_1, (unsigned __int8)n6); /*0xffc742a4*/
      n360 = 360; /*0xffc742ac*/
      if ( *(_BYTE *)(CpuCount + 118) == 6 || *(_BYTE *)(CpuCount + 1497) == 6 ) /*0xffc742c1*/
        n360 = 560; /*0xffc742c3*/
      v15 = MiscConfigCheck(n6_1, n2_1, (unsigned __int8)n6, 184567108) | 0x7F80FF; /*0xffc742ea*/
      v16 = MiscConfigCheck(n6_1, n2, (unsigned __int8)n6, 184567096) & 0xFFFFFF00; /*0xffc74306*/
      MiscIoCheck(n6_1, n2, (int)n6, 0xB004544u, v15); /*0xffc7430e*/
      KtiFuncF4E(&v24); /*0xffc74318*/
      do /*0xffc74350*/
        KtiFuncF4E(&v23); /*0xffc74329*/
      while ( KtiFuncF75((int)n6_1, v24, SHIDWORD(v24), v23, SHIDWORD(v23), 0x3B9ACA00u) < n360 ); /*0xffc74350*/
      n2_1 = n2; /*0xffc74352*/
      MiscIoCheck(n6_1, n2, (int)n6, 0xB004538u, v16); /*0xffc74362*/
      n6_4 = (unsigned __int8)n6; /*0xffc74367*/
      SocketInfo_4 = SocketInfo_5; /*0xffc7436e*/
    }
    ++n6_4; /*0xffc74372*/
    SocketInfo_4 += 7688; /*0xffc74374*/
    LOBYTE(n6) = n6_4; /*0xffc7437a*/
    SocketInfo_5 = SocketInfo_4; /*0xffc7437e*/
  }
  while ( n6_4 < 6u ); /*0xffc74384*/
  SocketInfo_6 = SocketInfo_2; /*0xffc7438a*/
  LOBYTE(n6) = 0; /*0xffc7438e*/
  do /*0xffc743b6*/
  {
    if ( *SocketInfo_6 ) /*0xffc74392*/
      ProcCommonFunc49AC(n6_1, n2_1, (int)n6, 1); /*0xffc7439f*/
    ++n6_5; /*0xffc743a7*/
    SocketInfo_6 += 7688; /*0xffc743a9*/
    LOBYTE(n6) = n6_5; /*0xffc743af*/
  }
  while ( n6_5 < 6u ); /*0xffc743b6*/
  result = 50813 * n2; /*0xffc743bf*/
  n6_1[result + 58726] = 1; /*0xffc743c7*/
  return result; /*0xffc743c5*/
}

// Function: DdrTrainFunc43D5 @ 0xffc743d5 (0x2d bytes)
// Index: 933/2560

int __cdecl DdrTrainFunc43D5(int __return_address, int *a2, char *a3, int *a4, char *a5)
{
  *a2 = (int)&off_FFD537E4; /*0xffc743dd*/
  *a3 = byte_FFD53C34; /*0xffc743e8*/
  *a4 = (int)&off_FFD53C3C; /*0xffc743f2*/
  *a5 = byte_FFD53FE4; /*0xffc743fd*/
  return 0; /*0xffc74401*/
}

// Function: DdrTrainFunc4402 @ 0xffc74402 (0x1d bytes)
// Index: 934/2560

unsigned int __cdecl DdrTrainFunc4402(unsigned __int8 *n6, unsigned __int8 n2, unsigned __int8 a3)
{
  return (unsigned int)MiscConfigCheck(n6, n2, a3, 184566276) >> 30; /*0xffc7441e*/
}

// Function: DdrTrainFunc441F @ 0xffc7441f (0x1a bytes)
// Index: 935/2560

char __cdecl DdrTrainFunc441F(unsigned __int8 a1, char a2)
{
  if ( a2 == -123 ) /*0xffc74429*/
    return byte_FFD3F60C[a1]; /*0xffc7442b*/
  else
    return byte_FFD3046C[a1]; /*0xffc74432*/
}

// Function: DdrTrainFunc4439 @ 0xffc74439 (0x146 bytes)
// Index: 936/2560

int __cdecl DdrTrainFunc4439(_BYTE *p_n42, int n4, bool *a3, unsigned __int8 *p_n42a)
{
  unsigned __int8 n4_1; // bl
  int v5; // ebp
  unsigned int v6; // ebx
  bool v7; // cl
  unsigned __int8 *p_n42a_1; // esi
  char v9; // al
  int v10; // eax

  n4_1 = n4; /*0xffc7443a*/
  v5 = 50813 * (unsigned __int8)n4; /*0xffc74442*/
  if ( p_n42[v5 + 60985] )
  {
    p_n42a_1 = p_n42a; /*0xffc74527*/
    *p_n42a = p_n42[v5 + 60983]; /*0xffc74536*/
    *a3 = p_n42[v5 + 60984]; /*0xffc7453f*/
  }
  else if ( DimmConfigPerSocket(p_n42, n4, 167, 0) )
  {
    DebugPrint( /*0xffc74508*/
      (int)p_n42,
      3,
      255,
      255,
      255,
      255,
      255,
      255,
      "Could not able to get Current DCLK and reqType from Pcode mailbox!\n");
    KtiFunc20C6(p_n42, 245, 1, n4, 255, 255, 255); /*0xffc74519*/
    p_n42a_1 = p_n42a; /*0xffc7451e*/
  }
  else
  {
    v6 = CpuIoRead((int)p_n42, n4, 0, 67190924); /*0xffc74486*/
    *p_n42a = v6 & 0x3F; /*0xffc74496*/
    v7 = (v6 & 0x40) != 0; /*0xffc7449d*/
    *a3 = v7; /*0xffc744a0*/
    DebugPrint((int)p_n42, 2, 255, 255, 255, 255, 255, 255, "\n Current DCLK: %d; reqType = %d\n", *p_n42a, v7);
    p_n42a_1 = p_n42a; /*0xffc744bd*/
    p_n42[v5 + 60985] = 1; /*0xffc744c4*/
    p_n42[v5 + 60983] = *p_n42a; /*0xffc744d4*/
    v9 = *a3; /*0xffc744df*/
    p_n42[v5 + 60999] = (v6 >> 7) & 0x3F; /*0xffc744e1*/
    n4_1 = n4; /*0xffc744e8*/
    p_n42[v5 + 60984] = v9; /*0xffc744ec*/
  }
  v10 = CpuIoRead((int)p_n42, n4_1, 0, 67190936); /*0xffc7454b*/
  return CpuIoCfgWrite((int)p_n42, n4_1, 0, 67190936, v10 & 0xFFFFF0C0 | *p_n42a_1 & 0x3F | ((*a3 & 0xF) << 8)); /*0xffc7457a*/
}

// Function: DdrTrainFunc457F @ 0xffc7457f (0x1d bytes)
// Index: 937/2560

unsigned int __cdecl DdrTrainFunc457F(unsigned __int8 *__return_address, unsigned __int8 n4)
{
  return ((unsigned int)MiscConfigCheck(__return_address, n4, 0, 134303512) >> 1) & 3; /*0xffc7459b*/
}

// Function: DdrTrainFunc459C @ 0xffc7459c (0xf bytes)
// Index: 938/2560

char DdrTrainFunc459C(int a1, unsigned __int8 a2, ...)
{
  return a2 % 3u; /*0xffc745aa*/
}

// Function: DdrTrainFunc45AB @ 0xffc745ab (0x22 bytes)
// Index: 939/2560

char DdrTrainFunc45AB(int a1, unsigned __int8 a2, unsigned __int8 a3, ...)
{
  return *(_BYTE *)(8077 * a3 + a1 + 50813 * a2 + 10239); /*0xffc745cc*/
}

// Function: DdrTrainFunc45CD @ 0xffc745cd (0x243 bytes)
// Index: 940/2560

char __cdecl DdrTrainFunc45CD(int p_n42, int n4)
{
  unsigned int v2; // eax
  char n7; // bl
  unsigned __int8 n8; // cl
  int v5; // esi
  int v6; // eax
  unsigned __int8 v7; // ch
  unsigned __int8 v8; // al
  unsigned __int8 v9; // ch
  unsigned __int8 v10; // al
  int n4_1; // ecx
  int v12; // ebp
  unsigned int n18; // eax
  unsigned int v14; // eax
  unsigned int v15; // eax
  unsigned int n2; // eax
  unsigned int v17; // eax
  unsigned int v18; // eax
  unsigned int n4_2; // eax
  bool v20; // zf
  unsigned int v21; // eax
  unsigned int v22; // eax
  unsigned int n2_1; // eax
  unsigned int v24; // eax
  unsigned int n2_2; // eax
  unsigned __int8 v26; // dl
  unsigned __int8 n8_1; // [esp+Eh] [ebp-2h]
  unsigned __int8 v29; // [esp+Fh] [ebp-1h]

  v2 = CpuIoRead(p_n42, n4, 0, 67321992); /*0xffc745e1*/
  if ( (v2 & 0x20000000) != 0 ) /*0xffc745f1*/
    return -1; /*0xffc745f6*/
  n8 = 0; /*0xffc745fe*/
  v5 = (v2 >> 26) & 0xF; /*0xffc74600*/
  do /*0xffc74616*/
  {
    if ( v5 == (unsigned __int8)byte_FFD30488[n8] ) /*0xffc7460f*/
      break; /*0xffc7460f*/
    ++n8; /*0xffc74611*/
  }
  while ( n8 < 8u ); /*0xffc74616*/
  n8_1 = n8; /*0xffc74622*/
  n7 = 7; /*0xffc7462b*/
  if ( (*(_BYTE *)(p_n42 + 246408) & 4) == 0 && n8 != 8 )
  {
    v6 = 50813 * (unsigned __int8)n4; /*0xffc74642*/
    v7 = *(_BYTE *)(v6 + p_n42 + 60984); /*0xffc74648*/
    if ( v7 )
    {
      v29 = *(_BYTE *)(v6 + p_n42 + 60999); /*0xffc7465a*/
      v8 = byte_FFD30498[n8]; /*0xffc74665*/
      if ( v29 == v8 ) /*0xffc7466d*/
        goto LABEL_14; /*0xffc7466d*/
      DebugPrint(
        p_n42,
        2,
        n4,
        255,
        255,
        255,
        255,
        255,
        "Could not find valid freq ratio: dmfc: %d Clk Type: %d max ratio: %d Expected max ratio: %d\n",
        v5,
        v7,
        v29,
        v8);
    }
    else
    {
      v9 = *(_BYTE *)(v6 + p_n42 + 60999); /*0xffc7467d*/
      v10 = byte_FFD30490[n8]; /*0xffc74687*/
      if ( v9 == v10 ) /*0xffc7468f*/
        goto LABEL_14; /*0xffc7468f*/
      DebugPrint(
        p_n42,
        2,
        n4,
        255,
        255,
        255,
        255,
        255,
        "Could not find valid freq ratio: dmfc: %d Clk Type: %d max ratio: %d Expected max ratio: %d\n",
        v5,
        0,
        v9,
        v10);
    }
    KtiFunc211E(p_n42, 7, 8, n4, 255, 255, 255); /*0xffc746ba*/
  }
LABEL_14:
  n4_1 = n4; /*0xffc746c2*/
  v12 = 50813 * (unsigned __int8)n4; /*0xffc746c9*/
  n18 = *(unsigned __int8 *)(p_n42 + v12 + 60999); /*0xffc746d7*/
  if ( *(_BYTE *)(p_n42 + v12 + 60984) ) /*0xffc746cf*/
  {
    if ( n18 <= 0x12 ) /*0xffc746e4*/
    {
      if ( n18 == 18 ) /*0xffc746e6*/
        goto LABEL_50; /*0xffc746e6*/
      v14 = n18 - 10; /*0xffc746ec*/
      if ( !v14 ) /*0xffc746ef*/
      {
        n7 = 1; /*0xffc74718*/
        goto LABEL_50; /*0xffc7471a*/
      }
      v15 = v14 - 2; /*0xffc746f2*/
      if ( !v15 ) /*0xffc746f5*/
      {
        n7 = 3; /*0xffc74711*/
        goto LABEL_50; /*0xffc74713*/
      }
      n2 = v15 - 2; /*0xffc746f8*/
      if ( !n2 ) /*0xffc746fb*/
      {
        n7 = 5; /*0xffc7470a*/
        goto LABEL_50; /*0xffc7470c*/
      }
      if ( n2 == 2 ) /*0xffc74701*/
      {
LABEL_21:
        n7 = 6; /*0xffc74703*/
        goto LABEL_50; /*0xffc74705*/
      }
      goto LABEL_46; /*0xffc74701*/
    }
    v17 = n18 - 20; /*0xffc7471f*/
    if ( !v17 ) /*0xffc74722*/
    {
      n7 = 9; /*0xffc7473c*/
      goto LABEL_50; /*0xffc7473e*/
    }
    v18 = v17 - 2; /*0xffc74725*/
    if ( !v18 ) /*0xffc74728*/
    {
      n7 = 11; /*0xffc74738*/
      goto LABEL_50; /*0xffc7473a*/
    }
    n4_2 = v18 - 6; /*0xffc7472a*/
    if ( !n4_2 ) /*0xffc7472d*/
    {
      n7 = 15; /*0xffc74734*/
      goto LABEL_50; /*0xffc74736*/
    }
    v20 = n4_2 == 4; /*0xffc7472f*/
  }
  else
  {
    if ( n18 <= 0x12 ) /*0xffc74743*/
    {
      if ( n18 == 18 ) /*0xffc74745*/
      {
        n7 = 12; /*0xffc7476a*/
        goto LABEL_50; /*0xffc7476c*/
      }
      v21 = n18 - 10; /*0xffc74747*/
      if ( !v21 ) /*0xffc7474a*/
      {
        n7 = 4; /*0xffc74766*/
        goto LABEL_50; /*0xffc74768*/
      }
      v22 = v21 - 2; /*0xffc7474d*/
      if ( !v22 ) /*0xffc74750*/
        goto LABEL_21; /*0xffc74750*/
      n2_1 = v22 - 2; /*0xffc74753*/
      if ( !n2_1 ) /*0xffc74756*/
      {
        n7 = 8; /*0xffc74762*/
        goto LABEL_50; /*0xffc74764*/
      }
      if ( n2_1 == 2 ) /*0xffc7475c*/
      {
        n7 = 10; /*0xffc7475e*/
        goto LABEL_50; /*0xffc74760*/
      }
      goto LABEL_46; /*0xffc7475c*/
    }
    v24 = n18 - 20; /*0xffc7476e*/
    if ( !v24 ) /*0xffc74771*/
    {
      n7 = 14; /*0xffc747aa*/
      goto LABEL_50; /*0xffc747aa*/
    }
    n2_2 = v24 - 2; /*0xffc74774*/
    if ( !n2_2 ) /*0xffc74777*/
    {
      n7 = 16; /*0xffc747a6*/
      goto LABEL_50; /*0xffc747a8*/
    }
    v20 = n2_2 == 2; /*0xffc7477a*/
  }
  if ( !v20 )
  {
LABEL_46:
    n7 = 12; /*0xffc7477f*/
    DebugPrint(p_n42, 2, n4, 255, 255, 255, 255, 255, "Could not find valid freq ratio: Capping frequency at 2400\n");
    n4_1 = n4; /*0xffc74799*/
    goto LABEL_50; /*0xffc747a0*/
  }
  n7 = 18; /*0xffc747a2*/
LABEL_50:
  if ( n8_1 != 8 )
  {
    v26 = *(_BYTE *)(p_n42 + v12 + 60984); /*0xffc747b4*/
    if ( v26 )
      DebugPrint(
        p_n42,
        2,
        n4_1,
        255,
        255,
        255,
        255,
        255,
        "dmfc: %d Clk Type: %d max ratio: %d Expected max ratio: %d\n",
        v5,
        v26,
        *(unsigned __int8 *)(p_n42 + v12 + 60999),
        (unsigned __int8)byte_FFD30498[n8_1]);
    else
      DebugPrint(
        p_n42,
        2,
        n4_1,
        255,
        255,
        255,
        255,
        255,
        "dmfc: %d Clk Type: %d max ratio: %d Expected max ratio: %d\n",
        v5,
        0,
        *(unsigned __int8 *)(p_n42 + v12 + 60999),
        (unsigned __int8)byte_FFD30490[n8_1]);
  }
  return n7; /*0xffc74809*/
}

// Function: DdrTrainFunc4810 @ 0xffc74810 (0x144 bytes)
// Index: 941/2560

char __cdecl DdrTrainFunc4810(unsigned __int8 *n6, unsigned __int8 n4)
{
  int SocketInfo; // eax
  unsigned __int8 n6_1; // bl
  unsigned __int8 *v4; // edi
  int CpuCount; // eax
  unsigned __int8 v6; // bl
  unsigned __int8 n2_1; // cl
  unsigned __int8 *v8; // esi
  unsigned __int8 v9; // bh
  unsigned __int8 n4_1; // al
  unsigned __int8 v11; // al
  char v13; // [esp+11h] [ebp-Fh]
  unsigned __int8 v14; // [esp+12h] [ebp-Eh]
  unsigned __int8 v15; // [esp+13h] [ebp-Dh]
  unsigned __int8 n6_2; // [esp+14h] [ebp-Ch]
  unsigned __int8 n2; // [esp+18h] [ebp-8h]
  char v18; // [esp+1Ch] [ebp-4h]

  v14 = -1; /*0xffc74822*/
  v15 = 0; /*0xffc74827*/
  v13 = 0; /*0xffc7482c*/
  SocketInfo = GetSocketInfo((int)n6, n4); /*0xffc74830*/
  n6_1 = 0; /*0xffc74836*/
  n6_2 = 0; /*0xffc74839*/
  v4 = (unsigned __int8 *)(SocketInfo + 6740); /*0xffc7483d*/
  do /*0xffc74946*/
  {
    if ( !*(v4 - 6740) ) /*0xffc7484a*/
      goto LABEL_18; /*0xffc7484a*/
    CpuCount = GetCpuCount((int)n6, n4, n6_2); /*0xffc74859*/
    v6 = v15; /*0xffc7485e*/
    n2_1 = 0; /*0xffc74865*/
    n2 = 0; /*0xffc74867*/
    v8 = (unsigned __int8 *)(CpuCount + 19); /*0xffc7486b*/
    do /*0xffc7490d*/
    {
      if ( *(v8 - 19) && !v8[88] ) /*0xffc74878*/
      {
        v9 = 0; /*0xffc7487e*/
        LOBYTE(SocketInfo) = 1; /*0xffc74880*/
        v13 = 1; /*0xffc74882*/
        v18 = 0; /*0xffc74886*/
        if ( !*v8 ) /*0xffc7488c*/
          goto LABEL_15; /*0xffc7488c*/
        do /*0xffc748f0*/
        {
          if ( !KtiFunc89E9((int)n6, n4, n6_2, n2, v18, 0) ) /*0xffc748a1*/
          {
            n4_1 = KtiFunc88D1((int)n6, n4, n6_2, n2, v18); /*0xffc748be*/
            v11 = ProcCommonFuncD799(n6, n4, n6_2, n4_1); /*0xffc748d0*/
            if ( v11 < v14 ) /*0xffc748dc*/
              v14 = v11; /*0xffc748de*/
            if ( v11 > v6 ) /*0xffc748e4*/
              v6 = v11; /*0xffc748e6*/
          }
          v18 = ++v9; /*0xffc748ea*/
        }
        while ( v9 < *v8 ); /*0xffc748f0*/
        n2_1 = n2; /*0xffc748f2*/
        v15 = v6; /*0xffc748f6*/
      }
      LOBYTE(SocketInfo) = v13; /*0xffc748fa*/
LABEL_15:
      ++n2_1; /*0xffc748fe*/
      v8 += 1379; /*0xffc74900*/
      n2 = n2_1; /*0xffc74906*/
    }
    while ( n2_1 < 2u ); /*0xffc7490d*/
    n6_1 = n6_2; /*0xffc74913*/
    if ( (_BYTE)SocketInfo == 1 ) /*0xffc74919*/
    {
      *(v4 - 1) = v14; /*0xffc7491f*/
      *v4 = v15; /*0xffc74926*/
      LOBYTE(SocketInfo) = 0; /*0xffc74928*/
      v13 = 0; /*0xffc7492a*/
      v14 = -1; /*0xffc7492e*/
      v15 = 0; /*0xffc74933*/
    }
LABEL_18:
    ++n6_1; /*0xffc74937*/
    v4 += 7688; /*0xffc74939*/
    n6_2 = n6_1; /*0xffc7493f*/
  }
  while ( n6_1 < 6u ); /*0xffc74946*/
  return SocketInfo; /*0xffc7494c*/
}

// Function: DdrTrainFunc4954 @ 0xffc74954 (0x39a bytes)
// Index: 942/2560

unsigned __int8 __cdecl DdrTrainFunc4954(int p_n42, int n4, int n6, char n6_3)
{
  unsigned __int8 v5; // bl
  int SocketInfo; // edi
  int CpuCount; // eax
  unsigned __int8 n6_1; // cl
  int CpuCount_1; // ebp
  unsigned __int8 p_n42a_1; // dl
  int SocketInfo_2; // edx
  int v12; // edi
  char v13; // al
  int v14; // ebx
  int v15; // edi
  char v16; // cl
  unsigned __int8 p_n80_1; // bl
  int v18; // ecx
  char n4_1; // bp
  char v20; // al
  unsigned __int8 v22; // [esp+11h] [ebp-2Fh]
  char v23; // [esp+12h] [ebp-2Eh]
  unsigned __int8 n2; // [esp+12h] [ebp-2Eh]
  unsigned __int8 v25; // [esp+13h] [ebp-2Dh]
  int SocketInfo_1; // [esp+14h] [ebp-2Ch]
  _BYTE *v27; // [esp+18h] [ebp-28h] BYREF
  int p_n80; // [esp+1Ch] [ebp-24h] BYREF
  int v29; // [esp+20h] [ebp-20h]
  int n2_1; // [esp+24h] [ebp-1Ch]
  int n6_2; // [esp+28h] [ebp-18h]
  int v32; // [esp+2Ch] [ebp-14h]
  int v33; // [esp+30h] [ebp-10h]
  int v34; // [esp+34h] [ebp-Ch]
  int p_n42a_2; // [esp+38h] [ebp-8h]
  int v36; // [esp+3Ch] [ebp-4h]
  unsigned __int8 p_n42a; // [esp+44h] [ebp+4h]

  v25 = -1; /*0xffc74968*/
  v5 = 0; /*0xffc7496e*/
  v27 = &unk_FFD53334; /*0xffc74970*/
  v22 = 0; /*0xffc74979*/
  v23 = 0; /*0xffc7497d*/
  p_n80 = 80; /*0xffc74981*/
  KtiFuncCB03((_BYTE *)p_n42, &v27, &p_n80); /*0xffc74989*/
  SocketInfo = GetSocketInfo(p_n42, n4); /*0xffc7499d*/
  SocketInfo_1 = SocketInfo; /*0xffc749a1*/
  CpuCount = GetCpuCount(p_n42, n4, n6); /*0xffc749a5*/
  n6_1 = n6; /*0xffc749aa*/
  CpuCount_1 = CpuCount; /*0xffc749ae*/
  p_n42a_1 = *(_BYTE *)(p_n42 + 257313); /*0xffc749b0*/
  n6_2 = (unsigned __int8)n6; /*0xffc749bc*/
  p_n42a = p_n42a_1; /*0xffc749c6*/
  LOBYTE(n2_1) = 0; /*0xffc749ca*/
  v29 = 7688 * (unsigned __int8)n6; /*0xffc749ce*/
  if ( *(_BYTE *)(v29 + SocketInfo + 3) ) /*0xffc749d2*/
  {
    SocketInfo_2 = SocketInfo; /*0xffc749d8*/
    do /*0xffc74a39*/
    {
      v12 = 1379 * v5; /*0xffc749dd*/
      if ( !*(_BYTE *)(v12 + CpuCount_1) ) /*0xffc749e3*/
        goto LABEL_8; /*0xffc749e3*/
      v22 += *(_BYTE *)(v12 + CpuCount_1 + 20); /*0xffc749fa*/
      if ( ProcCommonFunc24FA(p_n42, n4, n6_1, n2_1) ) /*0xffc749ff*/
        p_n42a = 9; /*0xffc74a0b*/
      n6_1 = n6; /*0xffc74a15*/
      SocketInfo_2 = SocketInfo_1; /*0xffc74a19*/
      if ( *(_BYTE *)(v12 + CpuCount_1 + 107) ) /*0xffc74a10*/
      {
        v13 = 1; /*0xffc74a1f*/
        v23 = 1; /*0xffc74a21*/
      }
      else
      {
LABEL_8:
        v13 = v23; /*0xffc74a27*/
      }
      LOBYTE(n2_1) = ++v5; /*0xffc74a31*/
    }
    while ( v5 < *(_BYTE *)(v29 + SocketInfo_2 + 3) ); /*0xffc74a39*/
    if ( v13 ) /*0xffc74a3d*/
      p_n42a = 11; /*0xffc74a3f*/
  }
  if ( *(_BYTE *)(p_n42 + 257313) == 1 && *(_WORD *)(p_n42 + 257315) == 12 ) /*0xffc74a55*/
    n2 = 2; /*0xffc74a57*/
  else
    n2 = *(_BYTE *)(p_n42 + 255480); /*0xffc74a64*/
  DebugPrint(p_n42, 2, 255, 255, 255, 255, 255, 255, "Memory Configuration for: ");
  DdrTrainFunc2E3C(p_n42, n4); /*0xffc74a86*/
  v14 = 8077 * n6_2; /*0xffc74a99*/
  v15 = 50813 * (unsigned __int8)n4; /*0xffc74aa1*/
  n2_1 = n2; /*0xffc74aac*/
  n6_2 = (unsigned __int8)n6_3; /*0xffc74ab9*/
  v34 = v22; /*0xffc74ac1*/
  v36 = v14 + v15; /*0xffc74acc*/
  p_n42a_2 = p_n42a; /*0xffc74ad0*/
  DebugPrint( /*0xffc74b13*/
    p_n42,
    2,
    255,
    n6,
    255,
    255,
    255,
    255,
    "Vdd = %d, procType = 0x%x, socketType = %d, dramType = %d, spc = %d, dpc = %d, dimmType = %d, numRanks = %d\n",
    (unsigned __int8)n6_3,
    *(_DWORD *)(p_n42 + 246420),
    n2,
    *(unsigned __int16 *)(p_n42 + 257315),
    *(unsigned __int8 *)(p_n42 + v14 + v15 + 10240),
    *(unsigned __int8 *)(v29 + SocketInfo_1 + 3),
    p_n42a,
    v22);
  if ( (_WORD)p_n80 )
  {
    v16 = *(_BYTE *)(p_n42 + 246424); /*0xffc74b28*/
    v33 = v14 + v15; /*0xffc74b36*/
    p_n80_1 = 0; /*0xffc74b3f*/
    v32 = 1 << v16; /*0xffc74b41*/
    while ( 1 ) /*0xffc74b48*/
    {
      v18 = 15 * p_n80_1; /*0xffc74b48*/
      if ( (*(_WORD *)&v27[v18] & (unsigned __int16)v32) != 0 /*0xffc74bbc*/
        && *(_DWORD *)&v27[v18 + 2] == *(_DWORD *)(p_n42 + 246420)
        && v27[v18 + 6] == n2
        && (unsigned __int8)v27[v18 + 7] == *(_WORD *)(p_n42 + 257315)
        && v27[v18 + 8] == *(_BYTE *)(v33 + p_n42 + 10240)
        && v27[v18 + 9] == *(_BYTE *)(SocketInfo_1 + v29 + 3)
        && v27[v18 + 10] == p_n42a
        && v27[v18 + 12] >= v22
        && v27[v18 + 11] == n6_3 )
      {
        break; /*0xffc74bbc*/
      }
      if ( ++p_n80_1 >= (unsigned __int16)p_n80 ) /*0xffc74bc8*/
        goto LABEL_34; /*0xffc74bc8*/
    }
    n4_1 = n4; /*0xffc74be3*/
    DebugPrint(p_n42, 2, n4, n6, 255, 255, 255, 255, " Table Index: %d\n", p_n80_1);
    v20 = *(_BYTE *)(p_n42 + 144); /*0xffc74bf0*/
    if ( v20 ) /*0xffc74bfb*/
    {
      if ( v20 == 1 ) /*0xffc74c10*/
        v25 = v27[15 * p_n80_1 + 14]; /*0xffc74c1d*/
    }
    else
    {
      v25 = v27[15 * p_n80_1 + 13]; /*0xffc74c08*/
    }
  }
  else
  {
    p_n80_1 = 0; /*0xffc74c23*/
LABEL_34:
    n4_1 = n4; /*0xffc74c25*/
  }
  if ( p_n80_1 == (_WORD)p_n80 )
  {
    DebugPrint(p_n42, 3, 255, 255, 255, 255, 255, 255, "Configuration not in POR table!\n"); /*0xffc74c4a*/
    DebugPrint(p_n42, 2, 255, 255, 255, 255, 255, 255, "Memory Configuration for: ");
    DdrTrainFunc2E3C(p_n42, n4_1); /*0xffc74c67*/
    DebugPrint( /*0xffc74cb9*/
      p_n42,
      2,
      255,
      n6,
      255,
      255,
      255,
      255,
      "Vdd = %d, procType = 0x%x, socketType = %d, dramType = %d, spc = %d, dpc = %d, dimmType = %d, numRanks = %d\n",
      n6_2,
      *(_DWORD *)(p_n42 + 246420),
      n2_1,
      *(unsigned __int16 *)(p_n42 + 257315),
      *(unsigned __int8 *)(v36 + p_n42 + 10240),
      *(unsigned __int8 *)(v29 + SocketInfo_1 + 3),
      p_n42a_2,
      v34);
  }
  DebugPrint(p_n42, 2, 255, 255, 255, 255, 255, 255, "GetPORDDRFreq returns ddrfreq = %d\n", v25); /*0xffc74cda*/
  return v25; /*0xffc74ce6*/
}

// Function: DdrTrainFunc4CEE @ 0xffc74cee (0xc bytes)
// Index: 943/2560

char __cdecl DdrTrainFunc4CEE(char a1, char a2)
{
  return a2 + 4 * a1; /*0xffc74cf9*/
}

// Function: DdrTrainFunc4CFA @ 0xffc74cfa (0xd5 bytes)
// Index: 944/2560

unsigned __int8 __cdecl DdrTrainFunc4CFA(
        int n6,
        unsigned __int8 n4,
        unsigned __int8 n6a,
        unsigned __int8 n2,
        unsigned __int8 a5)
{
  int SocketInfo; // edi
  int CpuCount; // eax
  unsigned __int8 n6_1; // dl
  char v8; // al
  unsigned __int8 n6_3; // bl
  unsigned __int8 n6_2; // [esp+12h] [ebp-6h]
  char v12; // [esp+13h] [ebp-5h]

  SocketInfo = GetSocketInfo(n6, n4); /*0xffc74d11*/
  CpuCount = GetCpuCount(n6, n4, n6a); /*0xffc74d1c*/
  n6_1 = 0; /*0xffc74d26*/
  n6_2 = 0; /*0xffc74d38*/
  v8 = *(_BYTE *)(1379 * n2 + CpuCount + 107); /*0xffc74d4a*/
  v12 = v8; /*0xffc74d4e*/
  do /*0xffc74dc9*/
  {
    if ( v8 ) /*0xffc74d56*/
    {
      if ( (n6_1 + 6 + (unsigned int)a5) % 6 == 2 * (n6a % 3u) ) /*0xffc74d77*/
        return n6_2; /*0xffc74d85*/
    }
    else
    {
      n6_3 = n6_2; /*0xffc74d8e*/
      if ( (unsigned __int8)((n6_2 - 1 + (*(unsigned __int8 *)(SocketInfo + 7688 * n6a + 6740) - 1) / 2 - a5) % 6) == 2 * (n6a % 3u) ) /*0xffc74db6*/
        return n6_3; /*0xffc74db6*/
    }
    v8 = v12; /*0xffc74dbc*/
    n6_1 = n6_2 + 1; /*0xffc74dc0*/
    n6_2 = n6_1; /*0xffc74dc2*/
  }
  while ( n6_1 < 6u ); /*0xffc74dc9*/
  return -1; /*0xffc74d7f*/
}

// Function: DdrTrainFunc4DCF @ 0xffc74dcf (0xa bytes)
// Index: 945/2560

_WORD *__cdecl DdrTrainFunc4DCF(_WORD *a1)
{
  *a1 = 512; /*0xffc74dd3*/
  return a1; /*0xffc74dd8*/
}

// Function: DdrTrainFunc4DD9 @ 0xffc74dd9 (0xe8 bytes)
// Index: 946/2560

int __cdecl DdrTrainFunc4DD9(unsigned __int8 *n6, int n4, int n6_1)
{
  int result; // eax
  unsigned __int8 n2_1; // bl
  _BYTE *v5; // edi
  unsigned int n6_2; // esi
  int v7; // eax
  int n2; // [esp+10h] [ebp-4h]

  result = GetCpuCount((int)n6, n4, n6_1); /*0xffc74deb*/
  n2_1 = 0; /*0xffc74df3*/
  LOBYTE(n2) = 0; /*0xffc74df5*/
  v5 = (_BYTE *)(result + 23); /*0xffc74df9*/
  do /*0xffc74eb5*/
  {
    if ( *(v5 - 23) && v5[84] ) /*0xffc74e06*/
    {
      if ( *v5 == 121 ) /*0xffc74e13*/
      {
        n6_2 = ProcCommonFuncE35E((int)n6, n4, n6_1, n2, 0x5044704u) | 0x80000000; /*0xffc74e2e*/
        ProcCommonFuncF4C7(n6, n4, n6_1, n2, 84166404, n6_2); /*0xffc74e47*/
        result = ProcCommonFuncF4C7(n6, n4, n6_1, n2, 84166404, n6_2 & 0x7FFFFFFF); /*0xffc74e65*/
      }
      else
      {
        v7 = ProcCommonFuncE35E((int)n6, n4, n6_1, n2, 0x504400Cu); /*0xffc74e81*/
        result = ProcCommonFuncF4C7(n6, n4, n6_1, n2, 84164620, v7 | 0x40000000); /*0xffc74e9e*/
      }
    }
    ++n2_1; /*0xffc74ea6*/
    v5 += 1379; /*0xffc74ea8*/
    LOBYTE(n2) = n2_1; /*0xffc74eae*/
  }
  while ( n2_1 < 2u ); /*0xffc74eb5*/
  return result; /*0xffc74ebb*/
}

// Function: DdrTrainFunc4EC1 @ 0xffc74ec1 (0x39 bytes)
// Index: 947/2560

BOOL __cdecl DdrTrainFunc4EC1(
        int __return_address,
        unsigned __int8 n4,
        unsigned __int8 n6,
        unsigned __int8 n2,
        char a5)
{
  return (*(_BYTE *)(1379 * n2 + GetCpuCount(__return_address, n4, n6) + 136) & (unsigned __int8)(1 << a5) & 0xF) != 0; /*0xffc74ef7*/
}

// Function: DdrTrainFunc4EFA @ 0xffc74efa (0x74 bytes)
// Index: 948/2560

int __cdecl DdrTrainFunc4EFA(unsigned __int8 *__return_address, int n4)
{
  int v2; // edi
  _BYTE *SocketInfo; // eax
  char v4; // cl
  int n6; // edx

  v2 = 0; /*0xffc74f07*/
  SocketInfo = (_BYTE *)GetSocketInfo((int)__return_address, n4); /*0xffc74f09*/
  v4 = 0; /*0xffc74f12*/
  n6 = 6; /*0xffc74f14*/
  do /*0xffc74f26*/
  {
    if ( *SocketInfo ) /*0xffc74f15*/
      v2 |= 1 << v4; /*0xffc74f1a*/
    ++v4; /*0xffc74f1d*/
    SocketInfo += 7688; /*0xffc74f1e*/
    --n6; /*0xffc74f23*/
  }
  while ( n6 ); /*0xffc74f26*/
  *(_DWORD *)&__return_address[48704 * (unsigned __int8)n4 + 304938] |= 0x3Fu; /*0xffc74f34*/
  if ( AutoGenFunc174A(__return_address, n4, v2) ) /*0xffc74f3c*/
    return DebugPrint((int)__return_address, 2, n4, 255, 255, 255, 255, 255, "Write all 0's pattern was failure\n"); /*0xffc74f62*/
  else
    return DebugPrint((int)__return_address, 2, n4, 255, 255, 255, 255, 255, "Write all 0's pattern was successfull\n"); /*0xffc74f52*/
}

// Function: DdrTrainFunc4F6E @ 0xffc74f6e (0x31f bytes)
// Index: 949/2560

int __cdecl DdrTrainFunc4F6E(unsigned __int8 *__return_address, unsigned __int8 n2, int a3)
{
  int v4; // esi
  unsigned int v5; // edi
  unsigned int v6; // esi
  int v7; // edx
  int v8; // edi
  int v9; // edx
  int v10; // esi
  int v11; // eax
  bool v12; // zf
  unsigned int v13; // eax
  unsigned int v15; // [esp+10h] [ebp-18h]
  int v16; // [esp+10h] [ebp-18h]
  unsigned int v17; // [esp+14h] [ebp-14h]
  int v18; // [esp+14h] [ebp-14h]
  unsigned int v19; // [esp+18h] [ebp-10h]
  int CpuCount; // [esp+1Ch] [ebp-Ch]
  int SocketInfo; // [esp+20h] [ebp-8h]
  int v22; // [esp+24h] [ebp-4h]
  unsigned __int8 v23; // [esp+2Ch] [ebp+4h]

  v19 = 0; /*0xffc74f71*/
  SocketInfo = GetSocketInfo((int)__return_address, n2); /*0xffc74f90*/
  CpuCount = GetCpuCount((int)__return_address, n2, a3); /*0xffc74f9b*/
  v22 = KtiFuncC0FC((int)__return_address); /*0xffc74faa*/
  DebugPrint((int)__return_address, 2, 255, 255, 255, 255, 255, 255, "SRI DclkCycle %x\n", v22); /*0xffc74fbc*/
  v4 = MiscConfigCheck(__return_address, n2, a3, 184567456); /*0xffc74fdd*/
  v5 = MiscConfigCheck(__return_address, n2, a3, 184567460) & 0xFEFFFC00; /*0xffc74ff8*/
  v17 = v4 & 0xFEFFFC00; /*0xffc74ffc*/
  v15 = MiscConfigCheck(__return_address, n2, a3, 184567464) & 0xFEFFFC00; /*0xffc75015*/
  v6 = MiscConfigCheck(__return_address, n2, a3, 184567468) & 0xFEFFFC00; /*0xffc75023*/
  if ( __return_address[257314] ) /*0xffc75029*/
    __return_address[1429] = 1; /*0xffc75032*/
  if ( __return_address[1429] == 1 ) /*0xffc75040*/
  {
    v23 = __return_address[1431]; /*0xffc75048*/
    if ( v23 == 1 && __return_address[1432] == 1 ) /*0xffc75056*/
      __return_address[1432] = 0; /*0xffc75058*/
    v19 = v22 * (unsigned int)__return_address[1430] / 0x2710; /*0xffc75087*/
    v7 = (v23 | (2 * (__return_address[1432] | (__return_address[1433] << 15)))) << 8; /*0xffc75098*/
    v18 = v19 | v7 | v17; /*0xffc7509f*/
    v8 = v19 | v7 | v5; /*0xffc750a7*/
    v9 = v19 | v7; /*0xffc750ad*/
    v16 = v9 | v15; /*0xffc750af*/
    v10 = v9 | v6; /*0xffc750b3*/
  }
  else
  {
    v18 = v17 | 0x80; /*0xffc750b7*/
    v16 = v15 | 0x1000230; /*0xffc750c4*/
    v8 = v5 | 0x1000260; /*0xffc750c8*/
    v10 = v6 | 0x1000230; /*0xffc750ce*/
  }
  if ( !KtiFuncE78((int)__return_address, 0, 3u) /*0xffc75129*/
    || (v11 = 7688 * (unsigned __int8)a3, *(_BYTE *)(v11 + SocketInfo + 3) != 2)
    || *(_BYTE *)(v11 + SocketInfo + 6262) == 2
    || *(_BYTE *)(CpuCount + 107)
    || !ProcCommonFunc24FA((int)__return_address, n2, a3, 0)
    || *(_BYTE *)(CpuCount + 1486) )
  {
    v13 = v16; /*0xffc75166*/
  }
  else
  {
    v12 = ProcCommonFunc24FA((int)__return_address, n2, a3, 1u) == 0; /*0xffc75142*/
    v13 = v16; /*0xffc75144*/
    if ( !v12 ) /*0xffc75148*/
    {
      v13 = v16 & 0xFFFFFCFF | 0x100; /*0xffc75158*/
      v8 = v8 & 0xFFFFFCFF | 0x100; /*0xffc7515c*/
      v16 = v13; /*0xffc7515e*/
      v10 = v10 & 0xFFFFFCFF | 0x100; /*0xffc75162*/
    }
  }
  if ( *(_BYTE *)(7688 * (unsigned __int8)a3 + SocketInfo + 6262) == 2 ) /*0xffc75183*/
  {
    if ( (v8 & 0x200) != 0 ) /*0xffc75191*/
      v8 |= 0x100u; /*0xffc75193*/
    if ( (v13 & 0x200) != 0 ) /*0xffc75197*/
      v16 = v13 | 0x100; /*0xffc7519b*/
    if ( (v10 & 0x200) != 0 ) /*0xffc751a1*/
      v10 |= 0x100u; /*0xffc751a3*/
  }
  MiscIoCheck(__return_address, n2, a3, 0xB0046A0u, v18); /*0xffc751b4*/
  MiscIoCheck(__return_address, n2, a3, 0xB0046A4u, v8); /*0xffc751c5*/
  MiscIoCheck(__return_address, n2, a3, 0xB0046A8u, v16); /*0xffc751d9*/
  MiscIoCheck(__return_address, n2, a3, 0xB0046ACu, v10); /*0xffc751ea*/
  DebugPrint((int)__return_address, 2, 255, 255, 255, 255, 255, 255, "SRI cke_ll0.Data %x\n", v18); /*0xffc7520a*/
  DebugPrint((int)__return_address, 2, 255, 255, 255, 255, 255, 255, "SRI cke_ll0.Data %x\n", v18); /*0xffc75222*/
  DebugPrint((int)__return_address, 2, 255, 255, 255, 255, 255, 255, "SRI cke_ll1.Data %x\n", v8); /*0xffc7523b*/
  DebugPrint((int)__return_address, 2, 255, 255, 255, 255, 255, 255, "SRI cke_ll2.Data %x\n", v16); /*0xffc75251*/
  DebugPrint((int)__return_address, 2, 255, 255, 255, 255, 255, 255, "SRI cke_ll3.Data %x\n", v10); /*0xffc75267*/
  return DebugPrint((int)__return_address, 2, 255, 255, 255, 255, 255, 255, "SRI tempCkeTimer %x\n", v19); /*0xffc75285*/
}

// Function: DdrTrainFunc528D @ 0xffc7528d (0x225 bytes)
// Index: 950/2560

int __cdecl DdrTrainFunc528D(unsigned __int8 *__return_address, int n2, int a3)
{
  int v4; // esi
  unsigned int v5; // edi
  unsigned int v6; // eax
  unsigned __int8 n2_1; // dl
  int n2_2; // esi
  int v9; // edx
  int v10; // esi
  int v11; // edi
  int v12; // esi
  int v13; // edx
  unsigned int v14; // eax
  int SocketInfo; // [esp+10h] [ebp-1Ch]
  int v17; // [esp+14h] [ebp-18h]
  int v18; // [esp+18h] [ebp-14h]
  unsigned int v19; // [esp+1Ch] [ebp-10h]
  int n2_3; // [esp+20h] [ebp-Ch]
  int v21; // [esp+20h] [ebp-Ch]
  unsigned __int8 *v22; // [esp+30h] [ebp+4h]

  SocketInfo = GetSocketInfo((int)__return_address, n2); /*0xffc752ab*/
  v4 = MiscConfigCheck(__return_address, n2, a3, 184567328); /*0xffc752d7*/
  v18 = v4; /*0xffc752d9*/
  v5 = MiscConfigCheck(__return_address, n2, a3, 184567408) & 0xF0A00000; /*0xffc752f1*/
  v19 = MiscConfigCheck(__return_address, n2, a3, 184567412) & 0xF0A00000; /*0xffc7530c*/
  v6 = MiscConfigCheck(__return_address, n2, a3, 184567416) & 0xF0A00000; /*0xffc75318*/
  if ( __return_address[257313] == 1 ) /*0xffc75324*/
    __return_address[1428] = 0; /*0xffc75326*/
  n2_1 = __return_address[1428]; /*0xffc7532d*/
  if ( !n2_1 ) /*0xffc75335*/
    __return_address[1426] = 0; /*0xffc75337*/
  if ( n2_1 == 2 ) /*0xffc75340*/
    v18 = v4 | 5; /*0xffc75345*/
  v17 = *(unsigned __int16 *)(7688 * (unsigned __int8)a3 + SocketInfo + 324) + 228; /*0xffc75363*/
  n2_2 = n2_1; /*0xffc75367*/
  v9 = __return_address[1426]; /*0xffc7536a*/
  n2_3 = n2_2; /*0xffc75371*/
  v10 = v17 | ((v9 | (4 * (n2_2 | 8))) << 22); /*0xffc75380*/
  v22 = (unsigned __int8 *)(v5 | v10); /*0xffc75388*/
  v11 = v19 | v10; /*0xffc7538e*/
  v12 = v6 | v10; /*0xffc75392*/
  if ( *(_BYTE *)(7688 * (unsigned __int8)a3 + SocketInfo + 6716) == 1 ) /*0xffc753a0*/
    v13 = v9 | 0x20; /*0xffc753a2*/
  else
    v13 = (4 * (n2_3 | 4)) | v9; /*0xffc753b1*/
  v21 = v17 | (v13 << 22); /*0xffc753c7*/
  MiscIoCheck(__return_address, n2, a3, 0xB004670u, (int)v22); /*0xffc753cd*/
  MiscIoCheck(__return_address, n2, a3, 0xB004674u, v11); /*0xffc753df*/
  MiscIoCheck(__return_address, n2, a3, 0xB004678u, v12); /*0xffc753ed*/
  MiscIoCheck(__return_address, n2, a3, 0xB004620u, v18); /*0xffc753fe*/
  if ( DimmConfigPerSocket( /*0xffc7542a*/
         __return_address,
         n2,
         ((((unsigned __int8)a3 / 3u) | (16 * ((unsigned __int8)a3 % 3u))) << 8) | 0xAD,
         v21) )
  {
    DebugPrint((int)__return_address, 3, n2, 255, 255, 255, 255, 255, "SREF_PKGC UCR Command Failed\n"); /*0xffc75449*/
  }
  MiscIoCheck(__return_address, n2, a3, 0xB00467Cu, v21); /*0xffc7545a*/
  DebugPrint((int)__return_address, 2, n2, a3, 255, 255, 255, 255, "opp_sref_en: %d\n", 0);
  v14 = MiscConfigCheck(__return_address, n2, a3, 184567364) & 0xBFFFFFFF; /*0xffc7548a*/
  if ( __return_address[1427] == 1 ) /*0xffc75496*/
    v14 |= 0x40000000u; /*0xffc75498*/
  return MiscIoCheck(__return_address, n2, a3, 0xB004644u, v14); /*0xffc754aa*/
}

// Function: DdrTrainFunc54B2 @ 0xffc754b2 (0x725 bytes)
// Index: 951/2560

int __cdecl DdrTrainFunc54B2(_BYTE *n6)
{
  _BYTE *n6_1; // esi
  _BYTE *SocketInfo; // ebp
  int v3; // edi
  unsigned __int8 n6_2; // al
  int v5; // ecx
  _BYTE *CpuCount; // ebx
  _WORD *v7; // eax
  int v8; // edi
  bool v9; // zf
  char n2_1; // al
  char n2_2; // al
  char n2_3; // al
  char n2_4; // al
  __int64 v15; // [esp-8h] [ebp-24h]
  int v16; // [esp-8h] [ebp-24h]
  int n2; // [esp+10h] [ebp-Ch]
  int v18; // [esp+14h] [ebp-8h]
  int v19; // [esp+18h] [ebp-4h]

  n6_1 = n6; /*0xffc754b8*/
  LOBYTE(n2) = n6[9402]; /*0xffc754c3*/
  SocketInfo = (_BYTE *)GetSocketInfo((int)n6, n2); /*0xffc754d3*/
  v3 = 0; /*0xffc754d5*/
  n6_2 = 0; /*0xffc754d7*/
  v19 = 0; /*0xffc754d9*/
  v5 = 0; /*0xffc754dd*/
  LOBYTE(n6) = 0; /*0xffc754df*/
  v18 = 0; /*0xffc754e3*/
  do
  {
    if ( *SocketInfo )
    {
      DebugPrint(
        (int)n6_1,
        2,
        255,
        255,
        255,
        255,
        255,
        255,
        "\n: Create Dynamic Variables for Populated Channe... [9662 chars total]

// Function: DdrTrainFunc5BD7 @ 0xffc75bd7 (0x1b7 bytes)
// Index: 952/2560

char __cdecl DdrTrainFunc5BD7(unsigned __int8 *__return_address, int n2)
{
  int n6; // eax
  int n2_1; // edi
  unsigned __int8 n6_1; // bl
  int v6; // eax
  char SocketNumber; // al
  unsigned int v8; // ebp
  unsigned __int8 *SocketInfo_1; // ebp
  int v10; // eax
  unsigned __int8 n6_2; // bl
  _BYTE *v12; // ebp
  int v13; // eax
  unsigned __int8 *SocketInfo; // [esp+8h] [ebp+4h]

  LOBYTE(n2) = __return_address[9402]; /*0xffc75be2*/
  n6 = 48704 * (unsigned __int8)n2; /*0xffc75be9*/
  if ( __return_address[n6 + 258689] && __return_address[n6 + 258716] ) /*0xffc75bfd*/
  {
    n2_1 = n2; /*0xffc75c0e*/
    SocketInfo = (unsigned __int8 *)GetSocketInfo((int)__return_address, n2); /*0xffc75c1e*/
    n6_1 = 0; /*0xffc75c23*/
    v6 = CpuIoRead((int)__return_address, n2, 0, 67256540); /*0xffc75c28*/
    CpuIoCfgWrite((int)__return_address, n2, 0, 67256540, v6 | 0x400); /*0xffc75c37*/
    SocketNumber = GetSocketNumber((int)__return_address); /*0xffc75c46*/
    v8 = CpuIoRead((int)__return_address, SocketNumber, 0, 318914748); /*0xffc75c59*/
    if ( __return_address[1424] && __return_address[257314] ) /*0xffc75c63*/
    {
      __return_address[1424] = 0; /*0xffc75c75*/
      DebugPrint( /*0xffc75c84*/
        (int)__return_address,
        3,
        n2,
        255,
        255,
        255,
        255,
        255,
        "WARNING! Opportunistic Self-Refresh (OSR) disabled due to the presence of DDRT DIMM(s) in the system.\n");
    }
    if ( (_BYTE)n2 == GetSocketNumber((int)__return_address) && v8 >= 0x80000000 ) /*0xffc75c9f*/
      DdrTrainFunc6394(__return_address); /*0xffc75ca2*/
    SocketInfo_1 = SocketInfo; /*0xffc75ca8*/
    LOBYTE(n6) = 0; /*0xffc75cac*/
    LOBYTE(n2) = 0; /*0xffc75cae*/
    do /*0xffc75ce2*/
    {
      if ( *SocketInfo_1 ) /*0xffc75cb2*/
      {
        DdrTrainFunc528D(__return_address, n2_1, n2); /*0xffc75cbd*/
        DdrTrainFunc4F6E(__return_address, n2_1, n2); /*0xffc75cc8*/
        LOBYTE(n6) = n2; /*0xffc75ccd*/
      }
      LOBYTE(n6) = n6 + 1; /*0xffc75cd4*/
      SocketInfo_1 += 7688; /*0xffc75cd6*/
      LOBYTE(n2) = n6; /*0xffc75cdc*/
    }
    while ( (unsigned __int8)n6 < 6u ); /*0xffc75ce2*/
    if ( !__return_address[1424] ) /*0xffc75ce4*/
    {
      LOBYTE(n2) = 0; /*0xffc75cf9*/
      do /*0xffc75d27*/
      {
        v10 = MiscConfigCheck(__return_address, n2_1, n2, 134302768); /*0xffc75d04*/
        MiscIoCheck(__return_address, n2_1, n2, 0x8014C30u, v10 | 0x10000); /*0xffc75d16*/
        LOBYTE(n2) = ++n6_1; /*0xffc75d20*/
      }
      while ( n6_1 < 6u ); /*0xffc75d27*/
      n6_2 = 0; /*0xffc75d2b*/
      LOBYTE(n6) = SocketPresentCheck((int)__return_address, 0, 5u); /*0xffc75d2f*/
      if ( (_BYTE)n6 ) /*0xffc75d39*/
      {
        LOBYTE(n2) = 0; /*0xffc75d3f*/
        v12 = SocketInfo + 6716; /*0xffc75d43*/
        do /*0xffc75d87*/
        {
          if ( *v12 ) /*0xffc75d49*/
          {
            v13 = MiscConfigCheck(__return_address, n2_1, n2, 134301232); /*0xffc75d5a*/
            LOBYTE(n6) = MiscIoCheck(__return_address, n2_1, n2, 0x8014630u, v13 | 0x10000); /*0xffc75d70*/
          }
          ++n6_2; /*0xffc75d78*/
          v12 += 7688; /*0xffc75d7a*/
          LOBYTE(n2) = n6_2; /*0xffc75d80*/
        }
        while ( n6_2 < 6u ); /*0xffc75d87*/
      }
    }
  }
  return n6; /*0xffc75d8c*/
}

// Function: DdrTrainFunc5D8E @ 0xffc75d8e (0x38a bytes)
// Index: 953/2560

char __cdecl DdrTrainFunc5D8E(int p_n42, unsigned __int8 n6)
{
  int p_n42_1; // ebp
  unsigned int n139; // edi
  unsigned int n143; // esi
  unsigned __int16 n27_1; // bp
  int n3600; // eax
  int v7; // eax
  unsigned int n147_1; // ecx
  bool v9; // zf
  int n2; // eax
  __int16 n27; // [esp-4h] [ebp-30h]
  int n147; // [esp+10h] [ebp-1Ch]
  int n1200; // [esp+14h] [ebp-18h]
  int v15; // [esp+18h] [ebp-14h]
  int n3600_1; // [esp+1Ch] [ebp-10h]
  int n9; // [esp+20h] [ebp-Ch]
  unsigned __int8 n2_2; // [esp+20h] [ebp-Ch]
  int n2_1; // [esp+24h] [ebp-8h]

  p_n42_1 = p_n42; /*0xffc75d93*/
  n2_1 = 0; /*0xffc75d9f*/
  n139 = 0; /*0xffc75da3*/
  v15 = 0; /*0xffc75da5*/
  n143 = 0; /*0xffc75da9*/
  n147 = 0; /*0xffc75dab*/
  if ( !KtiFuncE78(p_n42, 0, 3u) ) /*0xffc75db9*/
  {
    if ( !KtiFuncE34(p_n42, 0, 3) && !KtiFuncE34(p_n42, 0, 4) ) /*0xffc75e96*/
      goto LABEL_50; /*0xffc75e96*/
    n9 = 9; /*0xffc75eac*/
    switch ( *(_BYTE *)(48704 * n6 + p_n42 + 258694) ) /*0xffc75ebf*/
    {
      case 7: /*0xffc75ebf*/
      case 8: /*0xffc75ebf*/
        n27 = 27; /*0xffc75ec6*/
        goto LABEL_17; /*0xffc75ec6*/
      case 9: /*0xffc75ebf*/
        n27 = 30; /*0xffc75ecb*/
        goto LABEL_17; /*0xffc75ecd*/
      case 0xA: /*0xffc75ebf*/
        n27 = 31; /*0xffc75ecf*/
        goto LABEL_17; /*0xffc75ed1*/
      case 0xB: /*0xffc75ebf*/
        n27 = 33; /*0xffc75ed3*/
        goto LABEL_17; /*0xffc75ed5*/
      case 0xC: /*0xffc75ebf*/
        n27 = 36; /*0xffc75ed7*/
        goto LABEL_17; /*0xffc75ed9*/
      case 0xD: /*0xffc75ebf*/
      case 0xE: /*0xffc75ebf*/
        n27 = 39; /*0xffc75edb*/
        goto LABEL_17; /*0xffc75edd*/
      case 0xF: /*0xffc75ebf*/
        n27 = 42; /*0xffc75edf*/
        goto LABEL_17; /*0xffc75ee1*/
      case 0x10: /*0xffc75ebf*/
        n27 = 43; /*0xffc75ee3*/
LABEL_17:
        n27_1 = n27; /*0xffc75ec8*/
        break; /*0xffc75ec9*/
      default:
        n27_1 = 0; /*0xffc75ee7*/
        break; /*0xffc75ee7*/
    }
    n1200 = 1200; /*0xffc75eef*/
    n3600 = 3600; /*0xffc75f00*/
    n3600_1 = 3600; /*0xffc75f05*/
    while ( 1 ) /*0xffc75f0d*/
    {
      v7 = n3600 / 100; /*0xffc75f0d*/
      if ( 3 * n27_1 / 2 > (__int16)v7 ) /*0xffc75f19*/
      {
        if ( n1200 <= 1600 ) /*0xffc75f28*/
        {
          switch ( n1200 ) /*0xffc75f2e*/
          {
            case 1600: /*0xffc75f2e*/
              n143 = ((2 * n27_1 - (_WORD)v7) << 8) & 0x7F00 | n143 & 0xFFFF80FF | 0x8000; /*0xffc75fd7*/
              break;
            case 1200: /*0xffc75f2e*/
              n139 = (((2 * (_BYTE)n27_1 - (_BYTE)v7) & 0x7F | 0x80) << 8) | n139 & 0xFFFF80FF; /*0xffc75fbb*/
              break;
            case 1300: /*0xffc75f2e*/
              n139 = ((2 * n27_1 - (__int16)v7) << 16) & 0x7F0000 | n139 & 0xFF80FFFF | 0x800000; /*0xffc75f96*/
              break;
            case 1400: /*0xffc75f2e*/
              n139 = ((2 * n27_1 - (__int16)v7) << 24) | n139 & 0xFFFFFF | 0x80000000; /*0xffc75f76*/
              break;
            case 1500: /*0xffc75f2e*/
              n143 = (2 * (_BYTE)n27_1 - (_BYTE)v7) & 0x7F | n143 & 0xFFFFFF80 | 0x80; /*0xffc75f5b*/
              break;
          }
          goto LABEL_48; /*0xffc75f61*/
        }
        switch ( n1200 ) /*0xffc75fe7*/
        {
          case 1700: /*0xffc75fe7*/
            n143 = ((2 * n27_1 - (__int16)v7) << 16) & 0x7F0000 | n143 & 0xFF80FFFF | 0x800000; /*0xffc76063*/
            break; /*0xffc76063*/
          case 1800: /*0xffc75fe7*/
            n143 = ((2 * n27_1 - (__int16)v7) << 24) | n143 & 0xFFFFFF | 0x80000000; /*0xffc76046*/
            break; /*0xffc7604c*/
          case 1900: /*0xffc75fe7*/
            n147_1 = n147 & 0xFFFFFF80 | (2 * (_BYTE)n27_1 - (_BYTE)v7) & 0x7F | 0x80; /*0xffc7602a*/
            goto LABEL_45; /*0xffc7602a*/
          case 2000: /*0xffc75fe7*/
            n147_1 = n147 & 0xFFFF80FF | ((2 * n27_1 - (_WORD)v7) << 8) & 0x7F00 | 0x8000; /*0xffc76011*/
LABEL_45:
            n147 = n147_1; /*0xffc76030*/
            break;
        }
      }
LABEL_48:
      n1200 += 100; /*0xffc76069*/
      n3600 = n3600_1 + 300; /*0xffc76074*/
      v9 = n9-- == 1; /*0xffc76079*/
      n3600_1 += 300; /*0xffc7607e*/
      if ( v9 ) /*0xffc76082*/
      {
        p_n42_1 = p_n42; /*0xffc76088*/
        goto LABEL_50; /*0xffc76088*/
      }
    }
  }
  switch ( *(_BYTE *)(48704 * n6 + p_n42 + 258694) ) /*0xffc75de0*/
  {
    case 6: /*0xffc75de0*/
      v15 = -1970405376; /*0xffc75de7*/
      n139 = 139; /*0xffc75def*/
      break; /*0xffc75df4*/
    case 7: /*0xffc75de0*/
      v15 = -1895825408; /*0xffc75df9*/
      goto LABEL_5; /*0xffc75df9*/
    case 8: /*0xffc75de0*/
LABEL_5:
      n139 = 9276561; /*0xffc75e01*/
      break; /*0xffc75e06*/
    case 9: /*0xffc75de0*/
      n139 = -1903324527; /*0xffc75e0b*/
      break; /*0xffc75e10*/
    case 0xA: /*0xffc75de0*/
      n139 = -1902865920; /*0xffc75e15*/
      n143 = 143; /*0xffc75e1a*/
      break; /*0xffc75e1f*/
    case 0xB: /*0xffc75de0*/
      n139 = -1902903296; /*0xffc75e24*/
      n143 = 37007; /*0xffc75e29*/
      break; /*0xffc75e2e*/
    case 0xC: /*0xffc75de0*/
      n139 = -1795162112; /*0xffc75e33*/
      n143 = 9539727; /*0xffc75e38*/
      break; /*0xffc75e3d*/
    case 0xD: /*0xffc75de0*/
    case 0xE: /*0xffc75de0*/
      n143 = -1835951977; /*0xffc75e42*/
      n147 = 147; /*0xffc75e47*/
      break; /*0xffc75e4f*/
    case 0xF: /*0xffc75de0*/
      n143 = -1835362304; /*0xffc75e54*/
      n147 = 38035; /*0xffc75e59*/
      break; /*0xffc75e61*/
    case 0x10: /*0xffc75de0*/
      n143 = -1684406272; /*0xffc75e66*/
      n147 = 9802899; /*0xffc75e6b*/
      break; /*0xffc75e73*/
    default:
      break;
  }
LABEL_50:
  DebugPrint(p_n42_1, 2, 255, 255, 255, 255, 255, 255, "Programming the DCLK/UCLK bubble generator \n"); /*0xffc7608e*/
  n2_2 = 0; /*0xffc760a9*/
  do /*0xffc7610e*/
  {
    MailBoxFunc8FC5(p_n42_1, n6, n2_2, 117458656, v15); /*0xffc760c0*/
    MailBoxFunc8FC5(p_n42_1, n6, n2_2, 117458660, n139); /*0xffc760d1*/
    MailBoxFunc8FC5(p_n42_1, n6, n2_2, 117458664, n143); /*0xffc760e2*/
    MailBoxFunc8FC5(p_n42_1, n6, n2_2, 117458668, n147); /*0xffc760f6*/
    n2 = n2_1; /*0xffc760fb*/
    LOBYTE(n2) = n2_1 + 1; /*0xffc76102*/
    n2_1 = n2; /*0xffc76104*/
    n2_2 = n2; /*0xffc76108*/
  }
  while ( (unsigned __int8)n2 < 2u ); /*0xffc7610e*/
  return n2; /*0xffc76110*/
}

// Function: DdrTrainFunc616E @ 0xffc7616e (0x83 bytes)
// Index: 954/2560

int __cdecl DdrTrainFunc616E(unsigned __int8 *n6, int n4, int n6_1)
{
  int result; // eax
  unsigned __int8 n2_1; // bl
  _BYTE *v5; // esi
  int v6; // eax
  int n2; // [esp+Ch] [ebp-4h]

  result = GetCpuCount((int)n6, n4, n6_1); /*0xffc7617e*/
  n2_1 = 0; /*0xffc7618b*/
  LOBYTE(n2) = 0; /*0xffc7618d*/
  v5 = (_BYTE *)(result + 1351); /*0xffc76190*/
  do /*0xffc761e8*/
  {
    if ( *(v5 - 1351) ) /*0xffc76196*/
    {
      if ( *(v5 - 1244) ) /*0xffc7619f*/
      {
        v6 = ProcCommonFuncE35E((int)n6, n4, n6_1, n2, 0x5024114u); /*0xffc761b5*/
        result = ProcCommonFuncF4C7(n6, n4, n6_1, n2, 84033812, v6 ^ ((unsigned __int8)v6 ^ *v5) & 7); /*0xffc761d2*/
      }
    }
    ++n2_1; /*0xffc761da*/
    v5 += 1379; /*0xffc761dc*/
    LOBYTE(n2) = n2_1; /*0xffc761e2*/
  }
  while ( n2_1 < 2u ); /*0xffc761e8*/
  return result; /*0xffc761ea*/
}

// Function: DdrTrainFunc61F1 @ 0xffc761f1 (0x1a3 bytes)
// Index: 955/2560

unsigned __int8 __cdecl DdrTrainFunc61F1(unsigned __int8 *n6, int a2)
{
  _BYTE *SocketInfo; // ecx
  unsigned __int8 n6_1; // al
  unsigned int v4; // edi
  int CpuCount; // edx
  unsigned __int8 n2; // al
  int v7; // ecx
  unsigned __int8 v8; // al
  unsigned int v9; // esi
  unsigned int v10; // eax
  int n184631428; // [esp-14h] [ebp-38h]
  int n6_2; // [esp+10h] [ebp-14h]
  int n2_1; // [esp+14h] [ebp-10h]
  _BYTE *SocketInfo_1; // [esp+1Ch] [ebp-8h]
  int CpuCount_1; // [esp+20h] [ebp-4h]

  SocketInfo = (_BYTE *)GetSocketInfo((int)n6, a2); /*0xffc76209*/
  n6_1 = 0; /*0xffc7620b*/
  SocketInfo_1 = SocketInfo; /*0xffc7620d*/
  LOBYTE(n6_2) = 0; /*0xffc76211*/
  do /*0xffc76386*/
  {
    if ( *SocketInfo && SocketInfo[6716] ) /*0xffc7621e*/
    {
      v4 = MiscConfigCheck(n6, a2, n6_2, 184631880); /*0xffc7623f*/
      CpuCount = GetCpuCount((int)n6, a2, n6_2); /*0xffc76246*/
      n2 = 0; /*0xffc7624b*/
      CpuCount_1 = CpuCount; /*0xffc7624d*/
      LOBYTE(n2_1) = 0; /*0xffc76251*/
      do /*0xffc762fd*/
      {
        v7 = 1379 * n2; /*0xffc76258*/
        if ( *(_BYTE *)(v7 + CpuCount) && *(_BYTE *)(v7 + CpuCount + 107) ) /*0xffc76268*/
        {
          if ( n2 ) /*0xffc76275*/
          {
            v8 = MiscConfigCheck(n6, a2, n6_2, 117525028); /*0xffc7627f*/
            n184631428 = 184631428; /*0xffc76284*/
          }
          else
          {
            v8 = MiscConfigCheck(n6, a2, n6_2, 117525024); /*0xffc76293*/
            n184631428 = 184631424; /*0xffc76298*/
          }
          v4 ^= (v4 ^ ((((unsigned int)MiscConfigCheck(n6, a2, n6_2, n184631428) >> 1) - v8 - 4) << 16)) & 0x1F0000; /*0xffc762c4*/
          DebugPrint((int)n6, 2, a2, n6_2, n2_1, 255, 255, 255, "erid2datavalid = %d\n", HIWORD(v4) & 0x1F); /*0xffc762e5*/
          n2 = n2_1; /*0xffc762ea*/
          CpuCount = CpuCount_1; /*0xffc762f1*/
        }
        LOBYTE(n2_1) = ++n2; /*0xffc762f7*/
      }
      while ( n2 < 2u ); /*0xffc762fd*/
      v9 = v4 & 0xFFFF80FF | (((v4 >> 8) & 0x1F00) + 1280); /*0xffc7631a*/
      v10 = (BYTE2(v9) + 1) & 0x1F | MiscConfigCheck(n6, a2, n6_2, 184631884) & 0xFFFFFFE0; /*0xffc76339*/
      MiscIoCheck(n6, a2, n6_2, 0xB01424Cu, v10 ^ ((unsigned __int16)v10 ^ (unsigned __int16)(32 * (v10 - 2))) & 0x3E0); /*0xffc76353*/
      MiscIoCheck(n6, a2, n6_2, 0xB014248u, v9); /*0xffc76364*/
      n6_1 = n6_2; /*0xffc76369*/
      SocketInfo = SocketInfo_1; /*0xffc76370*/
    }
    ++n6_1; /*0xffc76374*/
    SocketInfo += 7688; /*0xffc76376*/
    LOBYTE(n6_2) = n6_1; /*0xffc7637c*/
    SocketInfo_1 = SocketInfo; /*0xffc76380*/
  }
  while ( n6_1 < 6u ); /*0xffc76386*/
  return n6_1; /*0xffc7638c*/
}

// Function: DdrTrainFunc6394 @ 0xffc76394 (0x82 bytes)
// Index: 956/2560

int __cdecl DdrTrainFunc6394(unsigned __int8 *__return_address)
{
  unsigned __int8 n4; // bl
  char v2; // di
  int result; // eax
  unsigned int v4; // esi
  int v5; // [esp+10h] [ebp-4h]

  n4 = 0; /*0xffc7639b*/
  LOBYTE(v5) = 0; /*0xffc7639f*/
  v2 = 0; /*0xffc763a3*/
  do
  {
    result = 1 << v2; /*0xffc763aa*/
    if ( ((1 << v2) & *((_DWORD *)__return_address + 61617)) != 0 )
    {
      v4 = CpuIoRead((int)__return_address, v5, 0, 67190960) & 0xFF3FFF3F | 0xC0; /*0xffc763cd*/
      CpuIoCfgWrite((int)__return_address, v5, 0, 67190960, v4); /*0xffc763e0*/
      result = DebugPrint((int)__return_address, 2, v5, 255, 255, 255, 255, 255, "sapmctl: %x\n", v4);
    }
    ++n4; /*0xffc76404*/
    ++v2; /*0xffc76406*/
    LOBYTE(v5) = n4; /*0xffc76407*/
  }
  while ( n4 < 4u );
  return result; /*0xffc76410*/
}

// Function: DdrTrainFunc6416 @ 0xffc76416 (0x277 bytes)
// Index: 957/2560

unsigned __int8 __cdecl DdrTrainFunc6416(unsigned __int8 *__return_address, int n2)
{
  unsigned __int8 *__return_address_1; // ebx
  _BYTE *SocketInfo; // esi
  unsigned __int8 __return_address_2; // al
  int v5; // edi
  int v6; // esi
  unsigned int v7; // edi
  int v8; // esi
  unsigned int v9; // eax
  unsigned __int8 n2_1; // cl
  int n1008600594; // ecx
  int v12; // eax
  int n1048626; // [esp+10h] [ebp-14h]
  int n806361118; // [esp+14h] [ebp-10h]
  int v15; // [esp+18h] [ebp-Ch]
  _BYTE *SocketInfo_1; // [esp+1Ch] [ebp-8h]

  __return_address_1 = __return_address; /*0xffc7641a*/
  SocketInfo = (_BYTE *)GetSocketInfo((int)__return_address, n2); /*0xffc76433*/
  SocketInfo_1 = SocketInfo; /*0xffc76440*/
  DebugPrint( /*0xffc7644d*/
    (int)__return_address_1,
    2,
    n2,
    255,
    255,
    255,
    255,
    255,
    "NVM Performance Setting Programming (profile id %d)\n",
    __return_address_1[1465]);
  __return_address_2 = 0; /*0xffc76455*/
  LOBYTE(__return_address) = 0; /*0xffc76457*/
  do /*0xffc7667f*/
  {
    if ( !*SocketInfo ) /*0xffc7645e*/
      goto LABEL_14; /*0xffc7645e*/
    MiscConfigCheck(__return_address_1, n2, (unsigned __int8)__return_address, 117525044); /*0xffc76470*/
    MiscConfigCheck(__return_address_1, n2, (unsigned __int8)__return_address, 117525112); /*0xffc7647d*/
    v5 = MiscConfigCheck(__return_address_1, n2, (unsigned __int8)__return_address, 117525052); /*0xffc76497*/
    v6 = MiscConfigCheck(__return_address_1, n2, (unsigned __int8)__return_address, 117525116); /*0xffc764a1*/
    MiscConfigCheck(__return_address_1, n2, (unsigned __int8)__return_address, 117525120); /*0xffc764ae*/
    n806361118 = 806361118; /*0xffc764d1*/
    v7 = v5 & 0xFFFFFC00 | 0x42; /*0xffc764da*/
    v8 = v6 & 0x83FFFF | 0x10200000; /*0xffc764dd*/
    n1048626 = 1048626; /*0xffc764f6*/
    v9 = MiscConfigCheck(__return_address_1, n2, (unsigned __int8)__return_address, 184566620) & 0xFFFF0000 | 0x1A1A; /*0xffc764fe*/
    v15 = v9; /*0xffc76503*/
    if ( SocketInfo_1[6716] != 1 ) /*0xffc7650e*/
    {
LABEL_10:
      n1008600594 = 1008600594; /*0xffc765c6*/
      goto LABEL_11; /*0xffc765c6*/
    }
    n2_1 = __return_address_1[1465]; /*0xffc76514*/
    if ( n2_1 ) /*0xffc7651c*/
    {
      if ( n2_1 == 1 ) /*0xffc76553*/
      {
        n806361118 = 806361128; /*0xffc7655b*/
        n1048626 = 5242892; /*0xffc76569*/
        v7 = v7 & 0xFFFFFC00 | 0x2B; /*0xffc76571*/
        v8 = v8 & 0x83FFFF | 0x28200000; /*0xffc76574*/
        n1008600594 = 1008600594; /*0xffc7657f*/
        v15 = v9 & 0xFFFF081A; /*0xffc76584*/
      }
      else
      {
        if ( n2_1 != 2 ) /*0xffc7658d*/
          goto LABEL_10; /*0xffc7658d*/
        n806361118 = 806356238; /*0xffc76595*/
        n1048626 = 1704016; /*0xffc765a2*/
        v7 |= 0xCBu; /*0xffc765aa*/
        v8 = v8 & 0x83FFFF | 0x14200000; /*0xffc765b0*/
        n1008600594 = 508495378; /*0xffc765bb*/
        v15 = v9 & 0xFFFF0000 | 0x1E21; /*0xffc765c0*/
      }
    }
    else
    {
      n806361118 = 806361118; /*0xffc76524*/
      n1048626 = 2097188; /*0xffc76532*/
      v7 = v7 & 0xFFFFFC00 | 0x27; /*0xffc7653a*/
      v8 = v8 & 0x83FFFF | 0x10200000; /*0xffc7653d*/
      n1008600594 = 1008600594; /*0xffc76545*/
      v15 = v9 | 0x1A1A; /*0xffc7654a*/
    }
LABEL_11:
    MiscIoCheck(__return_address_1, n2, (int)__return_address, 0x7014A34u, n1008600594); /*0xffc765ca*/
    MiscIoCheck(__return_address_1, n2, (int)__return_address, 0x7014A78u, n1048626); /*0xffc765ea*/
    MiscIoCheck(__return_address_1, n2, (int)__return_address, 0x7014A3Cu, v7); /*0xffc765fc*/
    MiscIoCheck(__return_address_1, n2, (int)__return_address, 0x7014A7Cu, v8); /*0xffc7660a*/
    MiscIoCheck(__return_address_1, n2, (int)__return_address, 0x7014A80u, n806361118); /*0xffc7661e*/
    MiscIoCheck(__return_address_1, n2, (int)__return_address, 0xB00435Cu, v15); /*0xffc7662f*/
    if ( !KtiFuncE78((int)__return_address_1, 0, 9u) ) /*0xffc76639*/
    {
      v12 = MiscConfigCheck(__return_address_1, n2, (unsigned __int8)__return_address, 117525164); /*0xffc7664e*/
      MiscIoCheck(__return_address_1, n2, (int)__return_address, 0x7014AACu, v12 | 0x1000); /*0xffc7665d*/
    }
    SocketInfo = SocketInfo_1; /*0xffc76665*/
    __return_address_2 = (unsigned __int8)__return_address; /*0xffc76669*/
LABEL_14:
    ++__return_address_2; /*0xffc7666d*/
    SocketInfo += 7688; /*0xffc7666f*/
    LOBYTE(__return_address) = __return_address_2; /*0xffc76675*/
    SocketInfo_1 = SocketInfo; /*0xffc76679*/
  }
  while ( __return_address_2 < 6u ); /*0xffc7667f*/
  return __return_address_2; /*0xffc76685*/
}

// Function: DdrTrainFunc668D @ 0xffc7668d (0x18b bytes)
// Index: 958/2560

int __cdecl DdrTrainFunc668D(unsigned __int8 *n6, int n4, int n6_1)
{
  unsigned __int8 n4_1; // si
  int result; // eax
  unsigned __int8 n2_1; // bl
  _BYTE *v6; // edi
  int v7; // eax
  char v8; // cl
  unsigned __int8 v9; // bh
  char v10; // al
  int v11; // eax
  int v12; // esi
  int v13; // edi
  unsigned int v14; // esi
  int n6_2; // edi
  unsigned __int8 v16; // [esp+12h] [ebp-Ah]
  char v17; // [esp+13h] [ebp-9h]
  int n2; // [esp+14h] [ebp-8h]
  _BYTE *v19; // [esp+18h] [ebp-4h]

  n4_1 = n4; /*0xffc76697*/
  result = GetCpuCount((int)n6, n4, n6_1); /*0xffc766a2*/
  n2_1 = 0; /*0xffc766aa*/
  LOBYTE(n2) = 0; /*0xffc766ac*/
  v6 = (_BYTE *)(result + 23); /*0xffc766b0*/
  v19 = (_BYTE *)(result + 23); /*0xffc766b3*/
  do /*0xffc7680a*/
  {
    if ( *(v6 - 23) && v6[84] ) /*0xffc766c1*/
    {
      if ( ProcCommonFunc24FA((int)n6, n4_1, n6_1, n2_1 ^ 1) ) /*0xffc766d9*/
      {
        v7 = n6[48704 * (unsigned __int8)n4 + 307390]; /*0xffc766f2*/
        v8 = byte_FFD516FC[v7]; /*0xffc766fa*/
        v9 = byte_FFD5170C[v7]; /*0xffc76700*/
        v10 = byte_FFD51704[v7]; /*0xffc76706*/
        v17 = v8; /*0xffc7670c*/
      }
      else
      {
        v11 = n6[48704 * (unsigned __int8)n4 + 307390]; /*0xffc7671b*/
        v17 = byte_FFD516DC[v11]; /*0xffc76729*/
        if ( *v6 == 122 ) /*0xffc7672d*/
        {
          v9 = byte_FFD5172C[v11]; /*0xffc7672f*/
          v10 = byte_FFD51724[v11]; /*0xffc76735*/
        }
        else
        {
          v9 = byte_FFD516EC[v11]; /*0xffc7673d*/
          v10 = byte_FFD516E4[v11]; /*0xffc76743*/
        }
      }
      v16 = v10; /*0xffc76752*/
      v12 = ProcCommonFuncE35E((int)n6, n4, n6_1, n2, 0x5024120u); /*0xffc7676d*/
      v13 = ProcCommonFuncE35E((int)n6, n4, n6_1, n2, 0x502406Cu); /*0xffc76782*/
      v14 = v12 & 0xFFFFFE03; /*0xffc7678c*/
      if ( v9 + (unsigned int)v16 > 0xC ) /*0xffc767ac*/
        n6_2 = v13 | 0x200000; /*0xffc767b6*/
      else
        n6_2 = v13 & 0xFFDFFFFF; /*0xffc767ae*/
      ProcCommonFuncF4C7(n6, n4, n6_1, n2, 84033824, v14 | (4 * (v17 & 7 | (8 * (v9 & 0xF))))); /*0xffc767cf*/
      result = ProcCommonFuncF4C7(n6, n4, n6_1, n2, 84033644, n6_2); /*0xffc767e7*/
      n4_1 = n4; /*0xffc767ec*/
      v6 = v19; /*0xffc767f3*/
    }
    ++n2_1; /*0xffc767f7*/
    v6 += 1379; /*0xffc767f9*/
    LOBYTE(n2) = n2_1; /*0xffc767ff*/
    v19 = v6; /*0xffc76803*/
  }
  while ( n2_1 < 2u ); /*0xffc7680a*/
  return result; /*0xffc76810*/
}

// Function: DdrTrainFunc6818 @ 0xffc76818 (0x1a4 bytes)
// Index: 959/2560

char __cdecl DdrTrainFunc6818(_BYTE *__return_address, int n2)
{
  int v2; // ebx
  int n1851521; // ebp
  int n526; // eax
  int n1851521_1; // eax
  int n526_2; // edx
  char n3; // al
  unsigned __int8 n2_1; // cl
  int v9; // eax
  int n526_1; // [esp+Ch] [ebp-4h]
  unsigned __int8 v12; // [esp+Ch] [ebp-4h]

  v2 = 0; /*0xffc76820*/
  n1851521 = 0; /*0xffc76826*/
  n526_1 = 0; /*0xffc7682a*/
  LOBYTE(n526) = KtiFuncE78((int)__return_address, 0, 9u); /*0xffc7682e*/
  if ( (_BYTE)n526 || !__return_address[1480] ) /*0xffc7683e*/
    return n526; /*0xffc76844*/
  if ( (__return_address[246408] & 4) == 0 ) /*0xffc76856*/
  {
    n1851521_1 = KtiFunc2C7D((int)__return_address, n2, 0x108u); /*0xffc7685f*/
    n526_1 = n526_2; /*0xffc76867*/
    n1851521 = n1851521_1; /*0xffc7686b*/
  }
  n3 = __return_address[1480]; /*0xffc7686d*/
  if ( n3 == 1 )
  {
    DebugPrint((int)__return_address, 3, n2, 255, 255, 255, 255, 255, "CR QoS: Recipe 1\n");
    n1851521 = 1851521; /*0xffc76892*/
    n526 = 526; /*0xffc76897*/
  }
  else
  {
    if ( n3 == 2 )
    {
      DebugPrint((int)__return_address, 3, n2, 255, 255, 255, 255, 255, "CR QoS: Recipe 2\n");
      n1851521 = 2384001; /*0xffc768ba*/
    }
    else
    {
      if ( n3 != 3 ) /*0xffc768cb*/
      {
        n526 = n526_1; /*0xffc768ec*/
        goto LABEL_13; /*0xffc768ec*/
      }
      DebugPrint((int)__return_address, 3, n2, 255, 255, 255, 255, 255, "CR QoS: Recipe 3\n");
      n1851521 = 2384066; /*0xffc768e5*/
    }
    n526 = 1038; /*0xffc768c2*/
  }
LABEL_13:
  if ( (__return_address[246408] & 4) == 0 ) /*0xffc768f7*/
  {
    KtiFunc35EC((int)__return_address, n2, 0x108u, __PAIR64__(n526, n1851521)); /*0xffc76903*/
    LOBYTE(n526) = KtiFunc2C7D((int)__return_address, n2, 0x108u); /*0xffc7690b*/
  }
  v12 = 0; /*0xffc76913*/
  if ( __return_address[244317] )
  {
    n2_1 = n2; /*0xffc76923*/
    do
    {
      n526 = 50813 * (unsigned __int8)n2 + (unsigned __int8)v2; /*0xffc76933*/
      if ( __return_address[n526 + 10189] )
      {
        v9 = MailBoxFunc8E0B(v2, (int)__return_address, n2_1, v12, 100679916); /*0xffc7694a*/
        LOBYTE(n526) = MailBoxFunc8FC5(
                         (int)__return_address,
                         n2,
                         v12,
                         100679916,
                         v9 & 0xF0FFFFFF
                       | (((__return_address[257314] != 0) | (__return_address[257314] != 0 ? 0xE : 0)) << 24));
        n2_1 = n2; /*0xffc769a2*/
      }
      LOBYTE(v2) = v2 + 1; /*0xffc769a4*/
      v12 = v2; /*0xffc769a6*/
    }
    while ( (unsigned __int8)v2 < __return_address[244317] );
  }
  return n526; /*0xffc769b7*/
}

// Function: DdrTrainFunc69BC @ 0xffc769bc (0x3b bytes)
// Index: 960/2560

char __cdecl DdrTrainFunc69BC(_BYTE *n6, int n6a)
{
  DebugPrint((int)n6, 3, n6a, 255, 255, 255, 255, 255, "Cant program VDD!\n"); /*0xffc769d6*/
  return KtiFunc20C6(n6, 240, 1, n6a, 255, 255, 255); /*0xffc769f5*/
}

// Function: DdrTrainFunc69F7 @ 0xffc769f7 (0x2de bytes)
// Index: 961/2560

void __cdecl DdrTrainFunc69F7(int __return_address, unsigned __int8 n4, int n63)
{
  int __return_address_1; // edi
  int SocketInfo; // eax
  unsigned __int8 n6; // dl
  int v6; // ecx
  unsigned __int8 n15; // bl
  _BYTE *SocketInfo_2; // esi
  unsigned __int8 n15_1; // al
  _BYTE *SocketInfo_3; // esi
  unsigned __int8 n6_1; // dl
  int v12; // ecx
  int v13; // eax
  int v14; // esi
  unsigned __int8 n15_4; // cl
  int n6_2; // ebx
  int v17; // ebp
  unsigned __int8 n15_7; // bl
  char v19; // bp
  unsigned __int8 *v20; // esi
  unsigned __int8 v21; // bl
  int v22; // eax
  unsigned __int8 n15_2; // [esp+Ah] [ebp-12h]
  unsigned __int8 n15_3; // [esp+Bh] [ebp-11h]
  int n6_4; // [esp+Ch] [ebp-10h]
  unsigned __int8 n6_3; // [esp+Ch] [ebp-10h]
  int v27; // [esp+10h] [ebp-Ch]
  _BYTE *SocketInfo_1; // [esp+14h] [ebp-8h]
  int n6_5; // [esp+18h] [ebp-4h]
  int v30; // [esp+20h] [ebp+4h]
  unsigned __int8 n15_5; // [esp+20h] [ebp+4h]
  unsigned __int8 n15_6; // [esp+20h] [ebp+4h]

  __return_address_1 = __return_address; /*0xffc769fc*/
  n6_5 = 0; /*0xffc76a07*/
  n15_2 = 0; /*0xffc76a0b*/
  if ( *(_DWORD *)(__return_address + 246404) != 1 && *(_DWORD *)(__return_address + 9405) != 10 ) /*0xffc76a23*/
  {
    DebugPrint(__return_address, 2, 255, 255, 255, 255, 255, 255, "\nReset All Channels\n"); /*0xffc76a3e*/
    KtiFunc41B3(__return_address, 2u, 1); /*0xffc76a48*/
    SocketInfo = GetSocketInfo(__return_address, n4); /*0xffc76a53*/
    n6 = 0; /*0xffc76a58*/
    SocketInfo_1 = (_BYTE *)SocketInfo; /*0xffc76a5a*/
    v6 = 0; /*0xffc76a5e*/
    n6_3 = 0; /*0xffc76a60*/
    n15 = 15; /*0xffc76a64*/
    v27 = 0; /*0xffc76a6b*/
    SocketInfo_2 = (_BYTE *)SocketInfo; /*0xffc76a6f*/
    do /*0xffc76abf*/
    {
      if ( *SocketInfo_2 ) /*0xffc76a71*/
      {
        __return_address_1 = __return_address; /*0xffc76a76*/
        if ( ((1 << v6) & n63) != 0 ) /*0xffc76a83*/
        {
          n15_1 = DdrTrainFunc45AB(__return_address, n4, n6_3); /*0xffc76a8b*/
          if ( n15 > n15_1 ) /*0xffc76a95*/
            n15 = n15_1; /*0xffc76a97*/
          n6 = n6_3; /*0xffc76a99*/
          v6 = v27; /*0xffc76a9d*/
          if ( n15_2 < n15_1 ) /*0xffc76aa5*/
            n15_2 = n15_1; /*0xffc76aa7*/
        }
      }
      ++n6; /*0xffc76aab*/
      SocketInfo_2 += 7688; /*0xffc76aad*/
      ++v6; /*0xffc76ab3*/
      n6_3 = n6; /*0xffc76ab4*/
      v27 = v6; /*0xffc76ab8*/
    }
    while ( n6 < 6u ); /*0xffc76abf*/
    SocketInfo_3 = SocketInfo_1; /*0xffc76ac1*/
    n15_3 = n15; /*0xffc76ac5*/
    n6_1 = 0; /*0xffc76acb*/
    v12 = 0; /*0xffc76acd*/
    LOBYTE(n6_4) = 0; /*0xffc76ad3*/
    v30 = 0; /*0xffc76ad7*/
    do /*0xffc76b3a*/
    {
      if ( *SocketInfo_3 && ((1 << v12) & n63) != 0 ) /*0xffc76ae7*/
      {
        v13 = MiscConfigCheck((unsigned __int8 *)__return_address_1, n4, n6_4, 184567108); /*0xffc76af4*/
        MiscIoCheck( /*0xffc76b16*/
          (unsigned __int8 *)__return_address_1,
          n4,
          n6_4,
          0xB004544u,
          v13 & 0xFF807F00 | (unsigned __int8)SocketInfo_3[8]);
        n6_1 = n6_4; /*0xffc76b1b*/
        v12 = v30; /*0xffc76b22*/
      }
      ++n6_1; /*0xffc76b26*/
      SocketInfo_3 += 7688; /*0xffc76b28*/
      ++v12; /*0xffc76b2e*/
      LOBYTE(n6_4) = n6_1; /*0xffc76b2f*/
      v30 = v12; /*0xffc76b33*/
    }
    while ( n6_1 < 6u ); /*0xffc76b3a*/
    v14 = MailBoxFunc8EB3(__return_address_1, n4, 117459124); /*0xffc76b4b*/
    n15_4 = n15; /*0xffc76b51*/
    n15_5 = n15; /*0xffc76b53*/
    n6_2 = 0; /*0xffc76b59*/
    if ( n15_3 <= n15_2 ) /*0xffc76b5e*/
    {
      do /*0xffc76ba1*/
      {
        if ( *(_BYTE *)(50813 * n4 + n15_4 + __return_address_1 + 10189) ) /*0xffc76b72*/
        {
          v14 &= 0xFFFFFFDD; /*0xffc76b7c*/
          MailBoxFunc8FC5(__return_address_1, n4, n15_5, 117459124, v14); /*0xffc76b8b*/
          n15_4 = n15_5; /*0xffc76b90*/
        }
        n15_5 = ++n15_4; /*0xffc76b99*/
      }
      while ( n15_4 <= n15_2 ); /*0xffc76ba1*/
      n6_2 = 0; /*0xffc76ba3*/
    }
    v17 = 50813 * n4; /*0xffc76bac*/
    if ( *(_BYTE *)(__return_address_1 + v17 + 58727) ) /*0xffc76bb2*/
    {
      KtiFunc8C4(__return_address_1, 2u); /*0xffc76bbf*/
    }
    else
    {
      KtiFunc8C4(__return_address_1, 0xC8u); /*0xffc76bcc*/
      *(_BYTE *)(__return_address_1 + v17 + 58727) = 1; /*0xffc76bd1*/
    }
    n15_6 = n15_3; /*0xffc76bdf*/
    if ( n15_3 <= n15_2 ) /*0xffc76be7*/
    {
      n15_7 = n15_3; /*0xffc76be9*/
      do /*0xffc76c1e*/
      {
        if ( *(_BYTE *)(v17 + n15_7 + __return_address_1 + 10189) ) /*0xffc76bf0*/
        {
          v14 |= 2u; /*0xffc76bfa*/
          MailBoxFunc8FC5(__return_address_1, n4, n15_6, 117459124, v14); /*0xffc76c0c*/
        }
        n15_6 = ++n15_7; /*0xffc76c16*/
      }
      while ( n15_7 <= n15_2 ); /*0xffc76c1e*/
      n6_2 = 0; /*0xffc76c20*/
    }
    KtiFunc8C4(__return_address_1, 0x1F4u); /*0xffc76c28*/
    if ( *(_WORD *)(__return_address_1 + 257315) == 11 || *(_BYTE *)(__return_address_1 + 257313) ) /*0xffc76c39*/
    {
      v19 = 0; /*0xffc76c4a*/
      LOBYTE(n6_4) = 0; /*0xffc76c4c*/
      v20 = SocketInfo_1 + 8; /*0xffc76c50*/
      do /*0xffc76cc1*/
      {
        if ( *(v20 - 8) ) /*0xffc76c53*/
        {
          if ( ((1 << v19) & n63) != 0 ) /*0xffc76c64*/
          {
            v21 = *v20; /*0xffc76c66*/
            v22 = MiscConfigCheck((unsigned __int8 *)__return_address_1, n4, n6_4, 184567108); /*0xffc76c76*/
            MiscIoCheck( /*0xffc76ca1*/
              (unsigned __int8 *)__return_address_1,
              n4,
              n6_4,
              0xB004544u,
              (v21 << 15) | *v20 | v22 & 0xFF807F00);
            n6_2 = n6_5; /*0xffc76ca6*/
          }
        }
        LOBYTE(n6_2) = n6_2 + 1; /*0xffc76cad*/
        v20 += 7688; /*0xffc76caf*/
        ++v19; /*0xffc76cb5*/
        n6_5 = n6_2; /*0xffc76cb6*/
        LOBYTE(n6_4) = n6_2; /*0xffc76cba*/
      }
      while ( (unsigned __int8)n6_2 < 6u ); /*0xffc76cc1*/
      KtiFunc8C4(__return_address_1, 1u); /*0xffc76cc6*/
    }
    else
    {
      KtiFunc8C4(__return_address_1, 5u); /*0xffc76c44*/
    }
  }
}

// Function: DdrTrainFunc6CD5 @ 0xffc76cd5 (0x4c bytes)
// Index: 962/2560

int __cdecl DdrTrainFunc6CD5(unsigned __int8 *n6, unsigned __int8 n6a, int a3, unsigned __int8 a4, _BYTE *a5)
{
  int v5; // eax

  v5 = MiscConfigCheck(n6, n6a, a3, 184566276); /*0xffc76ce8*/
  *a5 = HIBYTE(v5) & 0x1F; /*0xffc76cf8*/
  return MiscIoCheck(n6, n6a, a3, 0xB004204u, v5 ^ (v5 ^ (a4 << 24)) & 0x1F000000); /*0xffc76d1e*/
}

// Function: DdrTrainFunc6D21 @ 0xffc76d21 (0x64 bytes)
// Index: 963/2560

int __cdecl DdrTrainFunc6D21(unsigned __int8 *n2, unsigned __int8 n4, _BYTE *n6, char n255, char a5)
{
  int v5; // eax
  int v6; // eax
  int v7; // eax

  v5 = MiscConfigCheck(n2, n4, (unsigned __int8)n6, 184567108); /*0xffc76d34*/
  v6 = (unsigned __int8)(v5 ^ (v5 | n255)) ^ v5; /*0xffc76d49*/
  if ( a5 ) /*0xffc76d4f*/
    v7 = (v6 ^ (v6 | ((unsigned __int8)n255 << 15))) & 0x7F8000 ^ v6; /*0xffc76d5e*/
  else
    v7 = ((~(unsigned __int8)n255 << 15) | 0xFF807FFF) & v6; /*0xffc76d6d*/
  return MiscIoCheck(n2, n4, (int)n6, 0xB004544u, v7); /*0xffc76d82*/
}

// Function: DdrTrainFunc6D85 @ 0xffc76d85 (0x2c bytes)
// Index: 964/2560

int __cdecl DdrTrainFunc6D85(unsigned __int8 *__return_address, unsigned __int8 n6)
{
  unsigned __int8 n6_1; // bl
  int result; // eax
  int n4; // [esp+4h] [ebp-4h]

  n6_1 = 0; /*0xffc76d8a*/
  LOBYTE(n4) = 0; /*0xffc76d8c*/
  do /*0xffc76daa*/
  {
    result = DdrTrainFuncF282(__return_address, n6, n4, 0); /*0xffc76d9a*/
    LOBYTE(n4) = ++n6_1; /*0xffc76da4*/
  }
  while ( n6_1 < 6u ); /*0xffc76daa*/
  return result; /*0xffc76dac*/
}

// Function: DdrTrainFunc6DB1 @ 0xffc76db1 (0x4b bytes)
// Index: 965/2560

int __cdecl DdrTrainFunc6DB1(unsigned __int8 *n6, unsigned __int8 n2, int n6a, char n11, char n8)
{
  int v5; // eax

  v5 = MiscConfigCheck(n6, n2, n6a, 184566272); /*0xffc76dc4*/
  return MiscIoCheck(n6, n2, n6a, 0xB004200u, ((n11 & 0x1F | (32 * (n8 & 0x1F))) << 9) | v5 & 0xFFF801FF); /*0xffc76df9*/
}

// Function: DdrTrainFunc6DFC @ 0xffc76dfc (0xe2 bytes)
// Index: 966/2560

char __cdecl DdrTrainFunc6DFC(_BYTE *p_n42, int n6, unsigned __int8 a3, unsigned __int8 a4)
{
  int v4; // esi
  bool v5; // cc
  int n27; // eax
  int v8; // eax

  v4 = a4 | (a3 << 6); /*0xffc76e16*/
  if ( SocketPresentCheck((int)p_n42, 0, 8u) ) /*0xffc76e18*/
    v5 = p_n42[48704 * (unsigned __int8)n6 + 258694] <= 0xEu; /*0xffc76e31*/
  else
    v5 = p_n42[48704 * (unsigned __int8)n6 + 258694] <= 0xCu; /*0xffc76e41*/
  if ( !v5 ) /*0xffc76e49*/
    v4 |= 0x80u; /*0xffc76e4b*/
  n27 = DimmConfigPerSocket(p_n42, n6, 166, v4); /*0xffc76e59*/
  if ( n27 == 27 )
  {
    DebugPrint((int)p_n42, 3, n6, 255, 255, 255, 255, 255, "PCODE mailbox to Set MC Frequency failed!\n"); /*0xffc76e79*/
    return KtiFunc20C6(p_n42, 244, 1, n6, 255, 255, 255); /*0xffc76e8a*/
  }
  else if ( n27 )
  {
    return DebugPrint(
             (int)p_n42,
             3,
             n6,
             255,
             255,
             255,
             255,
             255,
             "PCODE mailbox to Set MC Frequency failed: Boot with previous values!\n");
  }
  else
  {
    v8 = 50813 * (unsigned __int8)n6; /*0xffc76ea3*/
    p_n42[v8 + 60983] = a4; /*0xffc76eaf*/
    p_n42[v8 + 60984] = a3; /*0xffc76eba*/
    return DebugPrint((int)p_n42, 2, n6, 255, 255, 255, 255, 255, "PCODE mailbox to Set MC Frequency succeeded!\n"); /*0xffc76ec1*/
  }
}

// Function: DdrTrainFunc6EDE @ 0xffc76ede (0xa0 bytes)
// Index: 967/2560

int __cdecl DdrTrainFunc6EDE(unsigned __int8 *n6, unsigned __int8 n2, int n117457024)
{
  int SocketInfo; // esi
  int n117457024_1; // eax
  int CpuCount; // esi
  int n2_1; // ecx
  int n117457024_2; // [esp+8h] [ebp-8h]
  int n2_2; // [esp+Ch] [ebp-4h]

  SocketInfo = GetSocketInfo((int)n6, n2); /*0xffc76ef3*/
  GetCpuCount((int)n6, n2, n117457024); /*0xffc76efe*/
  n117457024_1 = n117457024; /*0xffc76f03*/
  if ( *(_BYTE *)(7688 * (unsigned __int8)n117457024 + SocketInfo + 6262) ) /*0xffc76f11*/
  {
    CpuCount = GetCpuCount((int)n6, n2, n117457024); /*0xffc76f2c*/
    n117457024_1 = 117457024; /*0xffc76f2e*/
    n117457024_2 = 117457024; /*0xffc76f33*/
    n2_1 = 2; /*0xffc76f39*/
    n2_2 = 2; /*0xffc76f3a*/
    do /*0xffc76f77*/
    {
      if ( *(_BYTE *)CpuCount ) /*0xffc76f3e*/
      {
        MiscIoCheck(n6, n2, n117457024, n117457024_1, *(_DWORD *)(CpuCount + 134)); /*0xffc76f53*/
        n117457024_1 = n117457024_2; /*0xffc76f58*/
        n2_1 = n2_2; /*0xffc76f5f*/
      }
      n117457024_1 += 4; /*0xffc76f63*/
      CpuCount += 1379; /*0xffc76f66*/
      --n2_1; /*0xffc76f6c*/
      n117457024_2 = n117457024_1; /*0xffc76f6f*/
      n2_2 = n2_1; /*0xffc76f73*/
    }
    while ( n2_1 ); /*0xffc76f77*/
  }
  return n117457024_1; /*0xffc76f79*/
}

// Function: DdrTrainFunc6F7E @ 0xffc76f7e (0x102 bytes)
// Index: 968/2560

_BYTE *__cdecl DdrTrainFunc6F7E(int __return_address)
{
  __int16 v1; // bx
  char v2; // bp
  _BYTE *result; // eax
  unsigned __int8 n6; // bl
  _BYTE *v5; // edi
  int v6; // eax
  unsigned __int8 v7; // [esp+10h] [ebp-10h]
  int v8; // [esp+14h] [ebp-Ch]
  unsigned __int8 v9; // [esp+18h] [ebp-8h]
  int v10; // [esp+1Ch] [ebp-4h]

  HIBYTE(v1) = 0; /*0xffc76f88*/
  v2 = 0; /*0xffc76f8a*/
  v7 = 0; /*0xffc76f8c*/
  v10 = 0; /*0xffc76f90*/
  do /*0xffc77072*/
  {
    result = (_BYTE *)(1 << v2); /*0xffc76f9a*/
    if ( ((1 << v2) & *(_DWORD *)(__return_address + 246468)) != 0 ) /*0xffc76fa2*/
    {
      result = (_BYTE *)GetSocketInfo(__return_address, v7); /*0xffc76fad*/
      n6 = 0; /*0xffc76fb3*/
      v5 = result; /*0xffc76fb5*/
      LOBYTE(v8) = 0; /*0xffc76fb8*/
      do /*0xffc77000*/
      {
        if ( *v5 ) /*0xffc76fbc*/
        {
          MiscIoCheck((unsigned __int8 *)__return_address, v7, v8, 0xB0040F4u, 3); /*0xffc76fd1*/
          result = (_BYTE *)MiscIoCheck((unsigned __int8 *)__return_address, v7, v8, 0xB0040E8u, 4194313); /*0xffc76fe9*/
        }
        ++n6; /*0xffc76ff1*/
        v5 += 7688; /*0xffc76ff3*/
        LOBYTE(v8) = n6; /*0xffc76ff9*/
      }
      while ( n6 < 6u ); /*0xffc77000*/
      LOBYTE(v1) = 0; /*0xffc77002*/
      v9 = 0; /*0xffc77004*/
      if ( *(_BYTE *)(__return_address + 244317) ) /*0xffc77008*/
      {
        do /*0xffc7705e*/
        {
          result = (_BYTE *)(v10 + (unsigned __int8)v1); /*0xffc77017*/
          if ( result[__return_address + 10189] ) /*0xffc77019*/
          {
            v6 = MailBoxFunc8E0B(v1, __return_address, v7, v9, 117459124); /*0xffc77031*/
            result = (_BYTE *)MailBoxFunc8FC5(__return_address, v7, v9, 117459124, v6 | 0x80); /*0xffc7704a*/
          }
          LOBYTE(v1) = v1 + 1; /*0xffc77052*/
          v9 = v1; /*0xffc77054*/
        }
        while ( (unsigned __int8)v1 < *(_BYTE *)(__return_address + 244317) ); /*0xffc7705e*/
      }
    }
    v10 += 50813; /*0xffc77060*/
    ++HIBYTE(v1); /*0xffc77068*/
    ++v2; /*0xffc7706a*/
    v7 = HIBYTE(v1); /*0xffc7706b*/
  }
  while ( HIBYTE(v1) < 4u ); /*0xffc77072*/
  return result; /*0xffc77078*/
}

// Function: DdrTrainFunc7080 @ 0xffc77080 (0x39 bytes)
// Index: 969/2560

int __cdecl DdrTrainFunc7080(unsigned __int8 *a1, unsigned __int8 a2, int a3, unsigned __int8 a4)
{
  int v4; // eax

  v4 = MiscConfigCheck(a1, a2, a3, 184567096); /*0xffc77093*/
  return MiscIoCheck(a1, a2, a3, 0xB004538u, a4 | v4 & 0xFFFFFF00); /*0xffc770b6*/
}

// Function: DdrTrainFunc70B9 @ 0xffc770b9 (0x2d bytes)
// Index: 970/2560

int __cdecl DdrTrainFunc70B9(unsigned __int8 *a1, unsigned __int8 a2, unsigned __int8 a3)
{
  unsigned __int8 n6; // bl
  int result; // eax
  int v5; // [esp+4h] [ebp-4h]

  n6 = 0; /*0xffc770be*/
  LOBYTE(v5) = 0; /*0xffc770c0*/
  do /*0xffc770df*/
  {
    result = DdrTrainFunc7080(a1, a2, v5, a3); /*0xffc770cf*/
    LOBYTE(v5) = ++n6; /*0xffc770d9*/
  }
  while ( n6 < 6u ); /*0xffc770df*/
  return result; /*0xffc770e1*/
}

// Function: DdrTrainFunc70E6 @ 0xffc770e6 (0x41 bytes)
// Index: 971/2560

unsigned __int8 __cdecl DdrTrainFunc70E6(unsigned __int8 *n6, unsigned __int8 n2, int a3, unsigned __int8 a4)
{
  int v4; // eax

  v4 = MiscConfigCheck(n6, n2, a3, 184566276); /*0xffc770fa*/
  MiscIoCheck(n6, n2, a3, 0xB004204u, (a4 << 30) | v4 & 0x3FFFFFFF); /*0xffc77118*/
  return a4; /*0xffc77123*/
}

// Function: DdrTrainFunc7127 @ 0xffc77127 (0x4fa bytes)
// Index: 972/2560

int __cdecl DdrTrainFunc7127(_BYTE *n6, int n6a)
{
  int n6a_1; // ebx
  int n7; // ebp
  _BYTE *SocketInfo; // edi
  int n8; // eax
  int v7; // eax
  unsigned __int8 n6a_2; // al
  int v9; // eax
  int v10; // eax
  unsigned __int16 n1260; // di
  unsigned __int8 n6b_1; // cl
  int n2; // eax
  unsigned int n1260_1; // ecx
  int v15; // eax
  int v16; // eax
  unsigned __int8 v17; // cl
  const char **i; // ebp
  int v19; // ebp
  unsigned int v20; // eax
  char v21; // cl
  int v23; // [esp+10h] [ebp-28h]
  int v24; // [esp+10h] [ebp-28h]
  int n7_1; // [esp+14h] [ebp-24h]
  int v26; // [esp+18h] [ebp-20h]
  int v27; // [esp+1Ch] [ebp-1Ch]
  int v28; // [esp+20h] [ebp-18h]
  _DWORD v29[4]; // [esp+28h] [ebp-10h]
  _BYTE *n6b_2; // [esp+3Ch] [ebp+4h]
  unsigned __int8 n6b; // [esp+40h] [ebp+8h]

  v26 = 0; /*0xffc7712a*/
  n6a_1 = n6a; /*0xffc77130*/
  n7 = 0; /*0xffc7713a*/
  v23 = 0; /*0xffc7713c*/
  n7_1 = 0; /*0xffc77143*/
  v29[0] = 16; /*0xffc77147*/
  v29[1] = 18; /*0xffc7714f... [7773 chars total]

// Function: DdrTrainFunc7621 @ 0xffc77621 (0x39 bytes)
// Index: 973/2560

int __cdecl DdrTrainFunc7621(unsigned __int8 *n6, unsigned __int8 n2, _BYTE *a3, unsigned __int8 n255)
{
  int v4; // eax

  v4 = MiscConfigCheck(n6, n2, (unsigned __int8)a3, 184567100); /*0xffc77634*/
  return MiscIoCheck(n6, n2, (int)a3, 0xB00453Cu, n255 | v4 & 0x7FFFFF00); /*0xffc77657*/
}

// Function: DdrCheckVmseErrLatency @ 0xffc7765a (0x42d bytes)
// Index: 974/2560

unsigned __int8 *__cdecl DdrCheckVmseErrLatency(_BYTE *n6, int n4)
{
  int n4_1; // ebx
  int SocketInfo; // eax
  unsigned __int8 n6_1; // cl
  unsigned __int8 *result; // eax
  int v6; // esi
  int CpuCount; // edx
  unsigned __int8 n2_1; // al
  unsigned __int8 n4_2; // al
  unsigned __int8 v10; // al
  unsigned __int8 v11; // cl
  char v12; // al
  unsigned int v13; // edx
  int v14; // esi
  unsigned int v15; // ecx
  int v16; // eax
  int v17; // eax
  int v18; // eax
  char v19; // bl
  int v20; // ecx
  int n1073766404; // eax
  int n1073799268; // eax
  int n1074402304; // eax
  int n1073799270; // eax
  int n1073766400; // eax
  unsigned int n184566356; // [esp-8h] [ebp-3Ch]
  int n1073766400_1; // [esp-4h] [ebp-38h]
  unsigned __int8 v28; // [esp+13h] [ebp-21h]
  unsigned __int8 *v29; // [esp+14h] [ebp-20h]
  unsigned __int8 v30; // [esp+18h] [ebp-1Ch]
  unsigned __int8 n2; // [esp+1Ch] [ebp-18h]
  int n6_2; // [esp+20h] [ebp-14h]
  unsigned int v33; // [esp+24h] [ebp-10h]
  int CpuCount_1; // [esp+28h] [ebp-Ch]
  int v35; // [esp+28h] [ebp-Ch]
  unsigned __int8 v36; // [esp+2Ch] [ebp-8h]
  unsigned int v37; // [esp+2Ch] [ebp-8h]
  int v38; // [esp+30h] [ebp-4h]
  unsigned int v39; // [esp+30h] [ebp-4h]

  n4_1 = n4; /*0xffc7765e*/
  SocketInfo = GetSocketInfo((int)n6, n4); /*0xffc7766b*/
  n6_1 = 0; /*0xffc77672*/
  result = (unsigned __int8 *)(SocketInfo + 320); /*0xffc77674*/
  LOBYTE(n6_2) = 0; /*0xffc77679*/
  v29 = result; /*0xffc7767d*/
  do
  {
    if ( *(result - 320) )
    {
      v6 = MiscConfigCheck(n6, n4_1, n6_2, 184632072); /*0xffc776a0*/
      v28 = 0; /*0xffc776a2*/
      CpuCount = GetCpuCount((int)n6, n4_1, n6_2); /*0xffc776b6*/
      n2_1 = 0; /*0xffc776b8*/
      CpuCount_1 = CpuCount; /*0xffc776ba*/
      for ( n2 = 0; n2_1 < *(v29 - 317); n2 = n2_1 ) /*0xffc776c5*/
      {
        if ( *(_BYTE *)(1379 * n2_1 + CpuCount) ) /*0xffc776da*/
        {
          v30 = 0; /*0xffc776e9*/
          if ( n6[50813 * (unsigned __int8)n4_1 + 10194] ) /*0xffc776f2*/
          {
            do /*0xffc77751*/
            {
              if ( !KtiFunc89E9((int)n6, n4_1, n6_2, n2, v30, 0) ) /*0xffc7770b*/
              {
                n4_2 = KtiFunc88D1((int)n6, n4_1, n6_2, n2, v30); /*0xffc77722*/
                v10 = ProcCommonFuncD799(n6, n4_1, n6_2, n4_2); /*0xffc7772e*/
                if ( v28 < v10 ) /*0xffc7773a*/
                  v28 = v10; /*0xffc7773c*/
              }
              ++v30; /*0xffc77746*/
            }
            while ( v30 < n6[50813 * (unsigned __int8)n4_1 + 10194] ); /*0xffc77751*/
            CpuCount = CpuCount_1; /*0xffc77753*/
          }
        }
        n2_1 = n2 + 1; /*0xffc7775f*/
      }
      v33 = ((unsigned int)v28 + 1) >> 1; /*0xffc77788*/
      v38 = 48704 * (unsigned __int8)n4_1; /*0xffc77791*/
      v11 = *v29 + v33 + 0x32C8 / (2 * (unsigned int)*(unsigned __int16 *)&n6[v38 + 258697]) - *(v29 - 13) + 6; /*0xffc777b1*/
      v36 = v11; /*0xffc777ba*/
      if ( (char)n6[257309] < 0 ) /*0xffc777be*/
      {
        if ( KtiFuncE78((int)n6, 0, 6u) ) /*0xffc777c5*/
        {
          v35 = MiscConfigCheck(n6, n4_1, n6_2, 184566284); /*0xffc777e6*/
          v37 = MiscConfigCheck(n6, n4_1, n6_2, 184566424); /*0xffc777f7*/
          v12 = MiscConfigCheck(n6, n4_1, n6_2, 184631540); /*0xffc777fb*/
          v11 = *v29 + (BYTE1(v35) & 7) - ((v37 >> 20) & 3) - 6; /*0xffc7781f*/
          if ( (v12 & 1) == 0 ) /*0xffc77824*/
            v11 = *v29 + (BYTE1(v35) & 7) - ((v37 >> 20) & 3) - 7; /*0xffc77826*/
        }
        else
        {
          v11 = v36; /*0xffc7782a*/
        }
      }
      v13 = v11; /*0xffc7782e*/
      v14 = ((unsigned __int8)v6 ^ v11) & 0x7F ^ v6; /*0xffc77838*/
      v15 = v33 + *(v29 - 7); /*0xffc77845*/
      if ( v13 > v15 + *v29 + 17 ) /*0xffc77850*/
        DebugPrint( /*0xffc77867*/
          (int)n6,
          3,
          n4_1,
          n6_2,
          255,
          255,
          255,
          255,
          "vmse_err_latency = 0x%x is greater than the maximum value=0x%x\n",
          v13,
          v15 + *v29 + 17);
      MiscIoCheck(n6, n4_1, n6_2, 0xB014308u, v14); /*0xffc77878*/
      if ( KtiFuncE78((int)n6, 0, 3u) /*0xffc778a5*/
        && ((*((_DWORD *)n6 + 347) & 0x100000) != 0 || (*(_DWORD *)(n6 + 134) & 0x800000) != 0) )
      {
        v16 = MiscConfigCheck(n6, n4_1, n6_2, 134302732); /*0xffc778af*/
        MiscIoCheck(n6, n4_1, n6_2, 0x8014C0Cu, v16 & 0xF01FFFFF); /*0xffc778c2*/
      }
      v17 = MiscConfigCheck(n6, n4_1, n6_2, 184632316); /*0xffc778d2*/
      if ( n6[v38 + 258699] && ((*((_DWORD *)n6 + 347) & 0x100000) != 0 || (*(_DWORD *)(n6 + 134) & 0x800000) != 0) ) /*0xffc778fa*/
        v18 = v17 | 1; /*0xffc778fc*/
      else
        v18 = v17 & 0xFFFFFFFE; /*0xffc77901*/
      MiscIoCheck(n6, n4_1, n6_2, 0xB0143FCu, v18); /*0xffc7790d*/
      v19 = (*(_DWORD *)(n6 + 134) & 0x20000000) != 0; /*0xffc7792e*/
      if ( (char)n6[257309] < 0 && (*((_DWORD *)n6 + 347) & 0x100000) != 0 )
      {
        v39 = (*(_DWORD *)(n6 + 134) >> 29) & 0xFFFFFF01; /*0xffc7792a*/
        v19 = !KtiFuncE78((int)n6, 0, 3u) ? v39 : 0;
      }
      v20 = *((_DWORD *)n6 + 347); /*0xffc77953*/
      if ( (~v20 & 0x100000) != 0 && (~*(_DWORD *)(n6 + 134) & 0x800000) != 0 || !v19 ) /*0xffc77972*/
      {
        n1073766400_1 = -1073684378; /*0xffc77974*/
        n184566356 = 184566356; /*0xffc77979*/
      }
      else
      {
        n1073766404 = 1073766404; /*0xffc77983*/
        if ( (v20 & 0x100000) != 0 && v19 == 1 ) /*0xffc7798f*/
          n1073766404 = -1073717244; /*0xffc77991*/
        MiscIoCheck(n6, n4, n6_2, 0xB00424Cu, n1073766404); /*0xffc779a3*/
        n1073799268 = 1073799268; /*0xffc779ab*/
        if ( (*((_DWORD *)n6 + 347) & 0x100000) != 0 && v19 == 1 ) /*0xffc779bf*/
          n1073799268 = -1073684380; /*0xffc779c1*/
        MiscIoCheck(n6, n4, n6_2, 0xB004250u, n1073799268); /*0xffc779cf*/
        n1074402304 = 1074402304; /*0xffc779d7*/
        if ( (*((_DWORD *)n6 + 347) & 0x100000) != 0 && v19 == 1 ) /*0xffc779eb*/
          n1074402304 = -1073081344; /*0xffc779ed*/
        MiscIoCheck(n6, n4, n6_2, 0xB004254u, n1074402304); /*0xffc779fb*/
        n1073799270 = 1073799270; /*0xffc77a03*/
        if ( (*((_DWORD *)n6 + 347) & 0x100000) != 0 && v19 == 1 ) /*0xffc77a17*/
          n1073799270 = -1073684378; /*0xffc77a19*/
        MiscIoCheck(n6, n4, n6_2, 0xB004258u, n1073799270); /*0xffc77a27*/
        n1073766400 = 1073766400; /*0xffc77a2f*/
        if ( (*((_DWORD *)n6 + 347) & 0x100000) != 0 && v19 == 1 ) /*0xffc77a43*/
          n1073766400 = -1073717248; /*0xffc77a45*/
        n1073766400_1 = n1073766400; /*0xffc77a4a*/
        n184566356 = 184566380; /*0xffc77a4b*/
      }
      n4_1 = n4; /*0xffc77a50*/
      MiscIoCheck(n6, n4, n6_2, n184566356, n1073766400_1); /*0xffc77a57*/
      n6_1 = n6_2; /*0xffc77a5c*/
      result = v29; /*0xffc77a63*/
    }
    ++n6_1; /*0xffc77a67*/
    result += 7688; /*0xffc77a69*/
    LOBYTE(n6_2) = n6_1; /*0xffc77a6e*/
    v29 = result; /*0xffc77a72*/
  }
  while ( n6_1 < 6u );
  return result; /*0xffc77a7f*/
}

// Function: DdrTrainFunc7A87 @ 0xffc77a87 (0x86 bytes)
// Index: 975/2560

_BYTE *__cdecl DdrTrainFunc7A87(unsigned __int8 *n6, int n4, _BYTE *n6a)
{
  _BYTE *result; // eax
  _BYTE *v4; // esi
  unsigned __int8 n2_1; // bl
  unsigned __int16 p_n60[2]; // [esp+Ch] [ebp-8h] BYREF
  int n2; // [esp+10h] [ebp-4h]

  *(_DWORD *)p_n60 = 0; /*0xffc77a8c*/
  result = (_BYTE *)GetCpuCount((int)n6, n4, (unsigned __int8)n6a); /*0xffc77a9c*/
  v4 = result; /*0xffc77aa4*/
  n2_1 = 0; /*0xffc77aa6*/
  LOBYTE(n2) = 0; /*0xffc77aad*/
  do /*0xffc77b04*/
  {
    if ( *v4 ) /*0xffc77ab0*/
    {
      if ( v4[107] ) /*0xffc77ab5*/
      {
        MailBoxFunc66B8((int)n6, n4, (int)n6a, n2, 0, 19, (int)p_n60); /*0xffc77acf*/
        result = (_BYTE *)MrcMarginGroupTrain(n6, n4, n6a, n2, 0, 255, 255, 1, 23, 19, p_n60); /*0xffc77aee*/
      }
    }
    ++n2_1; /*0xffc77af6*/
    v4 += 1379; /*0xffc77af8*/
    LOBYTE(n2) = n2_1; /*0xffc77afe*/
  }
  while ( n2_1 < 2u ); /*0xffc77b04*/
  return result; /*0xffc77b06*/
}

// Function: DdrTrainFunc7B0D @ 0xffc77b0d (0x55 bytes)
// Index: 976/2560

void __cdecl DdrTrainFunc7B0D(_BYTE *n6, int n4)
{
  _BYTE *n6_1; // edi
  unsigned __int8 n6_2; // bl
  _BYTE *SocketInfo; // esi

  n6_1 = n6; /*0xffc77b12*/
  n6_2 = 0; /*0xffc77b15*/
  if ( *((_DWORD *)n6 + 61601) ) /*0xffc77b17*/
  {
    SocketInfo = (_BYTE *)GetSocketInfo((int)n6, n4); /*0xffc77b2b*/
    LOBYTE(n6) = 0; /*0xffc77b2d*/
    do /*0xffc77b5b*/
    {
      if ( *SocketInfo ) /*0xffc77b30*/
      {
        if ( SocketInfo[6716] ) /*0xffc77b35*/
          KtiFuncCD04(n6_1, n4, (int)n6); /*0xffc77b45*/
      }
      ++n6_2; /*0xffc77b4d*/
      SocketInfo += 7688; /*0xffc77b4f*/
      LOBYTE(n6) = n6_2; /*0xffc77b55*/
    }
    while ( n6_2 < 6u ); /*0xffc77b5b*/
  }
}

// Function: DdrtConfigValidation @ 0xffc77b62 (0x15f9 bytes)
// Index: 977/2560

int __cdecl DdrtConfigValidation(int __return_address)
{
  int __return_address_1; // ebp
  char v2; // bl
  bool v3; // zf
  unsigned __int8 n4_5; // al
  int v5; // esi
  int n4_1; // ebx
  __int16 v7; // di
  int SocketInfo; // ecx
  unsigned __int8 n6; // al
  unsigned int n6_1; // edx
  int v11; // eax
  int CpuCount; // eax
  unsigned __int8 v13; // cl
  int n0x8000; // esi
  int v15; // edx
  _BYTE *CpuCount_2; // ecx
  char n4_2; // al
  char v18; // al
  char v19; // ah
  char v20; // ah
  unsigned __int8 v21; // al
  unsigned __int8 v22; // dl
  unsigned __int8 n8; // al
  char n3_3; // al
  char n2; // al
  const char *v26; // eax
  char v27; // al
  unsigned int v28; // eax
  int v29; // edx
  _BYTE *CpuCount_3; // edx
  int v31; // ecx
  char v32; // al
  unsigned __int8 n5_1; // al
  unsigned __int8 v34; // ah
  int v35; // eax
  unsigned __int8 v36; // cl
  char v37; // al
  int v38; // esi
  const char *v39; // eax
  char v40; // al
  char n6_3; // dl
  unsigned __int16... [39398 chars total]

// Function: DdrTrainFunc915B @ 0xffc7915b (0xe2 bytes)
// Index: 978/2560

unsigned __int8 __cdecl DdrTrainFunc915B(int __return_address)
{
  char n32; // bl
  char v2; // cl
  unsigned __int8 n4a_1; // al
  _BYTE *v4; // esi
  int n4; // [esp+Fh] [ebp-5h]
  unsigned __int8 n4a; // [esp+Fh] [ebp-5h]
  char v7; // [esp+13h] [ebp-1h]

  n32 = 0; /*0xffc79166*/
  v2 = 0; /*0xffc79168*/
  n4a_1 = 0; /*0xffc7916a*/
  v7 = 0; /*0xffc7916c*/
  n4a = 0; /*0xffc7916f*/
  v4 = (_BYTE *)(__return_address + 258689); /*0xffc79172*/
  do /*0xffc7919f*/
  {
    if ( *v4 ) /*0xffc79178*/
    {
      v2 = DdrTrainFuncB9CC(__return_address, n4a) | v7; /*0xffc7918a*/
      n4a_1 = n4a; /*0xffc7918c*/
      v7 = v2; /*0xffc7918f*/
    }
    ++n4a_1; /*0xffc79192*/
    v4 += 48704; /*0xffc79194*/
    n4a = n4a_1; /*0xffc7919a*/
  }
  while ( n4a_1 < 4u ); /*0xffc7919f*/
  LOBYTE(n4) = 0; /*0xffc791a1*/
  if ( (v2 & 1) != 0 && (v2 & 0xFE) != 0 ) /*0xffc791ac*/
  {
    n32 = 32; /*0xffc791ae*/
    LOBYTE(n4) = 32; /*0xffc791b0*/
  }
  if ( (v2 & 2) != 0 && (v2 & 0xED) != 0 ) /*0xffc791bb*/
  {
    n32 |= 0x40u; /*0xffc791bd*/
    LOBYTE(n4) = n32; /*0xffc791c0*/
  }
  if ( (v2 & 4) != 0 && (v2 & 0xEB) != 0 ) /*0xffc791cb*/
  {
    n32 |= 0x80u; /*0xffc791cd*/
    LOBYTE(n4) = n32; /*0xffc791d0*/
  }
  if ( (v2 & 8) != 0 && (v2 & 0xE7) != 0 ) /*0xffc791db*/
  {
    n32 |= 2u; /*0xffc791dd*/
    LOBYTE(n4) = n32; /*0xffc791e0*/
  }
  if ( (v2 & 0x20) != 0 && (v2 & 0xCF) != 0 ) /*0xffc791eb*/
  {
    n32 |= 4u; /*0xffc791ed*/
    LOBYTE(n4) = n32; /*0xffc791f0*/
  }
  if ( n32 ) /*0xffc791f5*/
  {
    if ( (v2 & 0x28) != 0 ) /*0xffc7920d*/
    {
      DebugPrint(__return_address, 2, 255, 255, 255, 255, 255, 255, "Mixing Population Rules across Sockets\n"); /*0xffc7921f*/
      return KtiFunc211E(__return_address, 62, n4, 255, 255, 255, 255); /*0xffc7922e*/
    }
    else
    {
      DebugPrint(__return_address, 2, 255, 255, 255, 255, 255, 255, "Mixing Population Rules across Sockets\n"); /*0xffc7920f*/
      return KtiFunc211E(__return_address, 23, n4, 255, 255, 255, 255); /*0xffc7921d*/
    }
  }
  return n4a_1; /*0xffc79236*/
}

// Function: DdrTrainFunc923D @ 0xffc7923d (0x19c bytes)
// Index: 979/2560

int __cdecl DdrTrainFunc923D(_BYTE *__return_address, int n4, int n2, int n4_2, int n13)
{
  _BYTE *__return_address_1; // esi
  int n4_1; // edi
  int SocketInfo; // eax
  int n2_1; // ebx
  int CpuCount; // edx
  int n4_5; // ebp
  int v12; // ecx
  int v13; // eax
  int v14; // ecx
  unsigned __int8 n4_3; // bl
  int n2_2; // ebp
  int v17; // eax
  int n2_3; // [esp-8h] [ebp-24h]
  int n4_4; // [esp-4h] [ebp-20h]
  _WORD v20[3]; // [esp+12h] [ebp-Ah] BYREF
  int SocketInfo_1; // [esp+18h] [ebp-4h]

  __return_address_1 = __return_address; /*0xffc79243*/
  n4_1 = n4; /*0xffc79248*/
  SocketInfo = GetSocketInfo((int)__return_address, n4); /*0xffc7924e*/
  n2_1 = n2; /*0xffc79253*/
  SocketInfo_1 = SocketInfo; /*0xffc7925a*/
  CpuCount = GetCpuCount((int)__return_address_1, n4_1, n2); /*0xffc79266*/
  *(_DWORD *)&v20[1] = CpuCount; /*0xffc79268*/
  *(_WORD *)(__return_address_1 + 257315) = 12; /*0xffc7926f*/
  if ( (_BYTE)n13 == 12 )
  {
    n4_5 = n4_2; /*0xffc79289*/
    if ( (__return_address_1[134] & 1) != 0 && !DdrTrainFuncB87C(__return_address_1, n4_1, n2_1, n4_2) )
    {
      DebugPrint((int)__return_address_1, 3, n4_1, n2_1, n4_5, 255, 255, 255, "Error : Invalid DIMM SPD contents!\n");
      KtiFunc20C6(__return_address_1, 237, 9, n4_1, n2_1, n4_5, 255); /*0xffc792c7*/
      KtiFunc8A8E((int)__return_address_1, n4_1, n2_1); /*0xffc792d2*/
      return 1; /*0xffc792df*/
    }
    KtiFunc27D8(__return_address_1, n4_1, n2_1, n4_5, 3u, (unsigned __int8 *)&__return_address); /*0xffc792ef*/
    KtiFunc27D8(__return_address_1, n4_1, n2_1, n4_5, 0x86u, (unsigned __int8 *)v20); /*0xffc79302*/
    KtiFunc27D8(__return_address_1, n4_1, n2_1, n4_5, 0x87u, (unsigned __int8 *)v20 + 1); /*0xffc79315*/
    if ( (_BYTE)__return_address == 1 && LOBYTE(v20[0]) == 0x97 && HIBYTE(v20[0]) == 11 ) /*0xffc79330*/
    {
      v12 = *(_DWORD *)&v20[1]; /*0xffc79336*/
      v13 = 1379 * (unsigned __int8)n4_2; /*0xffc7933d*/
      *(_BYTE *)(v13 + *(_DWORD *)&v20[1] + 105) = 0; /*0xffc79348*/
      *(_BYTE *)(v13 + v12) = 0; /*0xffc7934d*/
      --*(_BYTE *)(7688 * (unsigned __int8)n2_1 + SocketInfo_1 + 3); /*0xffc7935e*/
      DebugPrint((int)__return_address_1, 2, 255, 255, 255, 255, 255, 255, "DIMM is NOT supported\n"); /*0xffc79370*/
      return 1; /*0xffc79378*/
    }
    return IioFunc1CCD((int)__return_address_1, n4_1, n2_1, n4_2); /*0xffc7938c*/
  }
  else
  {
    v14 = 1; /*0xffc79392*/
    if ( (_BYTE)n13 == 13 ) /*0xffc79395*/
    {
      n4_3 = n4_2; /*0xffc79397*/
      n2_2 = n2; /*0xffc7939b*/
      v17 = 1379 * (unsigned __int8)n4_2; /*0xffc793a2*/
      n4_4 = n4_2; /*0xffc793a8*/
      n2_3 = n2; /*0xffc793a9*/
      __return_address_1[257314] = 1; /*0xffc793ab*/
      *(_BYTE *)(v17 + CpuCount + 107) = 1; /*0xffc793b2*/
      n13 = DimmCheckAepSupport((int)__return_address_1, n4_1, n2_3, n4_4); /*0xffc793bf*/
      DdrTrainFuncB494(__return_address_1, n4_1, n2_2, n4_3); /*0xffc793c3*/
      return n13; /*0xffc793c8*/
    }
  }
  return v14; /*0xffc793d1*/
}

// Function: DdrTrainFunc93D9 @ 0xffc793d9 (0xae bytes)
// Index: 980/2560

int __cdecl DdrTrainFunc93D9(_BYTE *__return_address, unsigned __int16 a2)
{
  unsigned __int8 n0x10; // bl
  unsigned __int16 n44; // si
  int v4; // edx
  char v5; // cl
  int v6; // ebx
  char v8[16]; // [esp+Ch] [ebp-10h] BYREF

  n0x10 = 0; /*0xffc793e3*/
  n44 = 0; /*0xffc793e8*/
  while ( word_FFD5401C[4 * n44] != a2 ) /*0xffc793f6*/
  {
    if ( ++n44 >= 0x2Cu ) /*0xffc793fc*/
      goto LABEL_11; /*0xffc793fc*/
  }
  v4 = (int)*(&off_FFD54020 + 2 * n44); /*0xffc79403*/
  do /*0xffc7941d*/
  {
    v5 = *(_BYTE *)(v4 + 2 * n0x10); /*0xffc7940d*/
    v8[n0x10] = v5; /*0xffc79410*/
    if ( !v5 ) /*0xffc79416*/
      break; /*0xffc79416*/
    ++n0x10; /*0xffc79418*/
  }
  while ( n0x10 < 0x10u ); /*0xffc7941d*/
  LogDebugString(__return_address, (int)"%s", v8); /*0xffc7942d*/
  if ( n0x10 < 8u ) /*0xffc79438*/
  {
    v6 = (unsigned __int8)(8 - n0x10); /*0xffc7943e*/
    do /*0xffc79454*/
    {
      LogDebugString(__return_address, (int)" "); /*0xffc7944a*/
      --v6; /*0xffc79451*/
    }
    while ( v6 ); /*0xffc79454*/
  }
LABEL_11:
  if ( n44 == 44 ) /*0xffc7945c*/
    LogDebugString(__return_address, (int)"%04x    ", a2); /*0xffc7946b*/
  return RmtFunc696A(__return_address, 3u); /*0xffc79480*/
}

// Function: DdrTrainFunc9487 @ 0xffc79487 (0xd bytes)
// Index: 981/2560

int __cdecl DdrTrainFunc9487(int a1)
{
  DimmSpdTimingInit(a1); /*0xffc7948b*/
  return 0; /*0xffc79493*/
}

// Function: DimmSpdTimingInit @ 0xffc79494 (0x1fe6 bytes)
// Index: 982/2560

int __cdecl DimmSpdTimingInit(_BYTE *__return_address)
{
  _BYTE *__return_address_1; // edi
  int n4_1; // ebp
  int n4_3; // ebx
  int SocketInfo; // eax
  unsigned __int8 n6_2; // cl
  int n3_1; // ebp
  int CpuCount; // esi
  int v8; // ecx
  unsigned __int8 n40198_1; // dl
  int v10; // eax
  int n255_1; // esi
  bool v12; // zf
  unsigned __int8 v13; // dl
  unsigned __int8 v14; // dl
  unsigned __int8 v15; // dl
  unsigned __int8 v16; // dl
  unsigned __int8 v17; // dl
  unsigned __int16 n45824_3; // ax
  int SocketInfo_2; // ecx
  int v20; // edx
  unsigned __int16 n45824_4; // ax
  int v22; // edx
  int SocketInfo_3; // ecx
  int v24; // edi
  unsigned __int16 n40198_7; // ax
  unsigned __int16 v26; // dx
  unsigned __int16 n4400_4; // ax
  unsigned __int16 v28; // dx
  unsigned __int16 n40198_8; // ax
  int SocketInfo_4; // ecx
  char *n45824_5; // edx
  unsigned __int16 n40198_9; // ax
  unsigned __int16 n4400_1; // dx
  int SocketInfo_5; // eax
  int v35; // ecx
  unsigned ... [58299 chars total]

// Function: DdrTrainFuncB494 @ 0xffc7b494 (0x2d2 bytes)
// Index: 983/2560

unsigned __int8 __cdecl DdrTrainFuncB494(_BYTE *__return_address, int n4, int n2, char a4)
{
  int CpuCount; // edi
  int v5; // esi
  unsigned __int8 n4_1; // bl
  _BYTE *v7; // esi
  unsigned __int8 result; // al
  unsigned __int8 v9; // [esp+13h] [ebp-1h] BYREF

  CpuCount = GetCpuCount((int)__return_address, n4, n2); /*0xffc7b4ac*/
  KtiFunc27D8(__return_address, n4, n2, a4, 0x141u, &v9); /*0xffc7b4c2*/
  v5 = 1379 * (unsigned __int8)a4; /*0xffc7b4ce*/
  *(_WORD *)(v5 + CpuCount + 1325) = v9 << 8; /*0xffc7b4dd*/
  KtiFunc27D8(__return_address, n4, n2, a4, 0x140u, &v9); /*0xffc7b4f6*/
  *(_WORD *)(v5 + CpuCount + 1325) |= v9; /*0xffc7b500*/
  KtiFunc27D8(__return_address, n4, n2, a4, 0xC1u, &v9); /*0xffc7b51c*/
  *(_WORD *)(v5 + CpuCount + 1327) = v9 << 8; /*0xffc7b52d*/
  KtiFunc27D8(__return_address, n4, n2, a4, 0xC0u, &v9); /*0xffc7b549*/
  *(_WORD *)(v5 + CpuCount + 1327) |= v9; /*0xffc7b553*/
  KtiFunc27D8(__return_address, n4, n2, a4, 0x15Du, &v9); /*0xffc7b56f*/
  *(_WORD *)(v5 + CpuCount + 1358) = v9; /*0xffc7b579*/
  KtiFunc27D8(__return_address, n4, n2, a4, 0xC3u, &v9); /*0xffc7b595*/
  *(_WORD *)(v5 + CpuCount + 1360) = v9 << 8; /*0xffc7b5a6*/
  KtiFunc27D8(__return_address, n4, n2, a4, 0xC2u, &v9); /*0xffc7b5c2*/
  *(_WORD *)(v5 + CpuCount + 1360) |= v9; /*0xffc7b5cc*/
  KtiFunc27D8(__return_address, n4, n2, a4, 0xC5u, &v9); /*0xffc7b5e8*/
  *(_WORD *)(v5 + CpuCount + 1362) = v9 << 8; /*0xffc7b5f6*/
  KtiFunc27D8(__return_address, n4, n2, a4, 0xC4u, &v9); /*0xffc7b612*/
  *(_WORD *)(v5 + CpuCount + 1362) |= v9; /*0xffc7b61f*/
  KtiFunc27D8(__return_address, n4, n2, a4, 0xC6u, &v9); /*0xffc7b63b*/
  *(_WORD *)(v5 + CpuCount + 1364) = v9; /*0xffc7b645*/
  KtiFunc27D8(__return_address, n4, n2, a4, 0x141u, &v9); /*0xffc7b661*/
  *(_WORD *)(v5 + CpuCount + 142) = v9 << 8; /*0xffc7b66f*/
  KtiFunc27D8(__return_address, n4, n2, a4, 0x140u, &v9); /*0xffc7b68b*/
  *(_WORD *)(v5 + CpuCount + 142) |= v9 & 0x7F; /*0xffc7b6a0*/
  KtiFunc27D8(__return_address, n4, n2, a4, 0x142u, &v9); /*0xffc7b6bc*/
  *(_BYTE *)(v5 + CpuCount + 144) = v9; /*0xffc7b6c5*/
  KtiFunc27D8(__return_address, n4, n2, a4, 0x143u, &v9); /*0xffc7b6e0*/
  *(_WORD *)(v5 + CpuCount + 145) = v9; /*0xffc7b6ea*/
  KtiFunc27D8(__return_address, n4, n2, a4, 0x144u, &v9); /*0xffc7b706*/
  n4_1 = 0; /*0xffc7b717*/
  *(_WORD *)(v5 + CpuCount + 145) |= v9 << 8; /*0xffc7b719*/
  v7 = (_BYTE *)(CpuCount + v5 + 150); /*0xffc7b727*/
  do /*0xffc7b75e*/
  {
    KtiFunc27D8(__return_address, n4, n2, a4, n4_1 + 325, &v9); /*0xffc7b74a*/
    result = v9; /*0xffc7b74f*/
    ++n4_1; /*0xffc7b756*/
    *v7++ = v9; /*0xffc7b758*/
  }
  while ( n4_1 < 4u ); /*0xffc7b75e*/
  return result; /*0xffc7b760*/
}

// Function: DdrTrainFuncB766 @ 0xffc7b766 (0x3 bytes)
// Index: 984/2560

char DdrTrainFuncB766()
{
  return 1; /*0xffc7b768*/
}

// Function: DdrTrainFuncB769 @ 0xffc7b769 (0x6a bytes)
// Index: 985/2560

_BYTE *__cdecl DdrTrainFuncB769(char n13, char n4, _BYTE *a3)
{
  _BYTE *v4; // esi
  char *RDIMM; // [esp-8h] [ebp-8h]

  if ( n13 == 13 ) /*0xffc7b770*/
  {
    RmtFunc8B50(a3, "AEP-DIMM"); /*0xffc7b77a*/
    return a3; /*0xffc7b785*/
  }
  switch ( n4 ) /*0xffc7b78e*/
  {
    case 1: /*0xffc7b78e*/
      RDIMM = "RDIMM"; /*0xffc7b7be*/
      break;
    case 2: /*0xffc7b78e*/
      RDIMM = "UDIMM"; /*0xffc7b7b7*/
      break;
    case 3: /*0xffc7b78e*/
      RDIMM = "SODIMM"; /*0xffc7b7b0*/
      break;
    default:
      v4 = a3; /*0xffc7b79a*/
      if ( n4 == 4 ) /*0xffc7b7a0*/
        RmtFunc8B50(a3, "LRDIMM"); /*0xffc7b7ae*/
      else
        RmtFunc8B50(a3, "Unknown DIMM"); /*0xffc7b7a7*/
      return v4; /*0xffc7b7a7*/
  }
  v4 = a3; /*0xffc7b7c3*/
  RmtFunc8B50(a3, RDIMM); /*0xffc7b7c7*/
  return v4; /*0xffc7b784*/
}

// Function: DdrTrainFuncB7D3 @ 0xffc7b7d3 (0x2c bytes)
// Index: 986/2560

int __cdecl DdrTrainFuncB7D3(_BYTE *__return_address, int n4, int n6, char a4, unsigned __int8 n4a, _BYTE *p_n11)
{
  return KtiFunc27D8(__return_address, n4, n6, a4, n4a + 325, p_n11); /*0xffc7b7fd*/
}

// Function: DdrTrainFuncB7FF @ 0xffc7b7ff (0x7d bytes)
// Index: 987/2560

unsigned __int8 __cdecl DdrTrainFuncB7FF(
        int __return_address,
        unsigned __int8 n4,
        unsigned __int8 n3,
        unsigned __int8 n255)
{
  int CpuCount; // eax
  int v5; // esi
  unsigned __int8 n0xC; // cl

  CpuCount = GetCpuCount(__return_address, n4, n3); /*0xffc7b80c*/
  v5 = 1379 * n255; /*0xffc7b818*/
  n0xC = 0; /*0xffc7b821*/
  if ( *(_BYTE *)(v5 + CpuCount + 105) != 13 ) /*0xffc7b828*/
  {
    do /*0xffc7b86c*/
    {
      if ( (unsigned __int8)byte_FFD40B28[n0xC] >> 3 == (*(_BYTE *)(v5 + CpuCount + 110) & 7) /*0xffc7b865*/
        && byte_FFD40B3C[n0xC] == *(_BYTE *)(v5 + CpuCount + 119)
        && byte_FFD40B50[n0xC] == *(_BYTE *)(v5 + CpuCount + 120)
        && byte_FFD40B64[n0xC] == *(_BYTE *)(v5 + CpuCount + 115) )
      {
        break; /*0xffc7b865*/
      }
      ++n0xC; /*0xffc7b867*/
    }
    while ( n0xC < 0xCu ); /*0xffc7b86c*/
    if ( n0xC >= 0xCu ) /*0xffc7b873*/
      return -1; /*0xffc7b875*/
  }
  return n0xC; /*0xffc7b87a*/
}

// Function: DdrTrainFuncB87C @ 0xffc7b87c (0x150 bytes)
// Index: 988/2560

bool __cdecl DdrTrainFuncB87C(_BYTE *__return_address, int n4, int n2, char a4)
{
  unsigned __int8 n0x7E; // bl
  unsigned __int8 *buf_1; // eax
  __int16 v6; // ax
  unsigned __int8 n0x7E_1; // bl
  unsigned __int8 *buf_3; // eax
  __int16 v10; // ax
  unsigned __int8 v11[8]; // [esp+10h] [ebp-8Ch] BYREF
  char *buf_2; // [esp+18h] [ebp-84h]
  char buf[128]; // [esp+1Ch] [ebp-80h] BYREF

  n0x7E = 0; /*0xffc7b888*/
  memset_save_flags(buf, 0, 0x7Eu); /*0xffc7b890*/
  buf_1 = (unsigned __int8 *)buf; /*0xffc7b89c*/
  buf_2 = buf; /*0xffc7b8b1*/
  do /*0xffc7b8da*/
  {
    KtiFunc27D8(__return_address, n4, n2, a4, n0x7E++, buf_1); /*0xffc7b8c4*/
    buf_1 = (unsigned __int8 *)++buf_2; /*0xffc7b8d2*/
  }
  while ( n0x7E < 0x7Eu ); /*0xffc7b8da*/
  KtiFunc27D8(__return_address, n4, n2, a4, 0x7Eu, v11); /*0xffc7b8ed*/
  KtiFunc27D8(__return_address, n4, n2, a4, 0x7Fu, &v11[1]); /*0xffc7b903*/
  v6 = RmtFunc6DAF(buf, 126); /*0xffc7b917*/
  n0x7E_1 = 0; /*0xffc7b91c*/
  if ( v6 != *(_WORD *)v11 ) /*0xffc7b922*/
    return 0; /*0xffc7b924*/
  memset_save_flags(buf, 0, 0x7Eu); /*0xffc7b933*/
  buf_3 = (unsigned __int8 *)buf; /*0xffc7b938*/
  buf_2 = buf; /*0xffc7b93f*/
  do /*0xffc7b973*/
  {
    KtiFunc27D8(__return_address, n4, n2, a4, n0x7E_1++ + 128, buf_3); /*0xffc7b95d*/
    buf_3 = (unsigned __int8 *)++buf_2; /*0xffc7b96b*/
  }
  while ( n0x7E_1 < 0x7Eu ); /*0xffc7b973*/
  KtiFunc27D8(__return_address, n4, n2, a4, 0xFEu, v11); /*0xffc7b989*/
  KtiFunc27D8(__return_address, n4, n2, a4, 0xFFu, &v11[1]); /*0xffc7b9a2*/
  v10 = RmtFunc6DAF(buf, 126); /*0xffc7b9b3*/
  return v10 == *(_WORD *)v11; /*0xffc7b9c1*/
}

// Function: DdrTrainFuncB9CC @ 0xffc7b9cc (0xaa bytes)
// Index: 989/2560

char __cdecl DdrTrainFuncB9CC(int __return_address, unsigned __int8 n4)
{
  char v2; // bl
  _BYTE *SocketInfo; // esi
  unsigned __int8 n6; // al
  _BYTE *v5; // ecx
  int n2; // edx
  unsigned __int8 n6_1; // [esp+8h] [ebp-4h]

  v2 = 0; /*0xffc7b9dd*/
  SocketInfo = (_BYTE *)GetSocketInfo(__return_address, n4); /*0xffc7b9df*/
  n6 = 0; /*0xffc7b9e2*/
  n6_1 = 0; /*0xffc7b9e5*/
  do /*0xffc7ba68*/
  {
    if ( *SocketInfo ) /*0xffc7b9e8*/
    {
      v5 = (_BYTE *)(GetCpuCount(__return_address, n4, n6_1) + 109); /*0xffc7b9fe*/
      n2 = 2; /*0xffc7ba03*/
      do /*0xffc7ba56*/
      {
        if ( *(v5 - 109) ) /*0xffc7ba04*/
        {
          if ( *v5 == 2 ) /*0xffc7ba0e*/
            v2 |= 1u; /*0xffc7ba10*/
          if ( *v5 == 1 ) /*0xffc7ba15*/
          {
            if ( (v5[3] & 3) == 2 ) /*0xffc7ba1e*/
              v2 |= 0x20u; /*0xffc7ba20*/
            else
              v2 |= 2u; /*0xffc7ba25*/
          }
          if ( v5[1140] ) /*0xffc7ba28*/
          {
            if ( *(v5 - 2) == 1 ) /*0xffc7ba35*/
            {
              v2 |= 0x10u; /*0xffc7ba37*/
            }
            else if ( (v5[3] & 3) == 2 ) /*0xffc7ba43*/
            {
              v2 |= 8u; /*0xffc7ba45*/
            }
            else
            {
              v2 |= 4u; /*0xffc7ba4a*/
            }
          }
        }
        v5 += 1379; /*0xffc7ba4d*/
        --n2; /*0xffc7ba53*/
      }
      while ( n2 ); /*0xffc7ba56*/
      n6 = n6_1; /*0xffc7ba58*/
    }
    ++n6; /*0xffc7ba5b*/
    SocketInfo += 7688; /*0xffc7ba5d*/
    n6_1 = n6; /*0xffc7ba63*/
  }
  while ( n6 < 6u ); /*0xffc7ba68*/
  return v2; /*0xffc7ba6e*/
}

// Function: DdrTrainFuncBA76 @ 0xffc7ba76 (0x247 bytes)
// Index: 990/2560

_BYTE *__cdecl DdrTrainFuncBA76(int __return_address)
{
  int __return_address_1; // esi
  int n9; // eax
  unsigned __int8 n4; // bl
  char v4; // di
  int v5; // eax
  unsigned __int8 n4_1; // bl
  _BYTE *result; // eax
  int SocketInfo; // ebp
  unsigned __int8 n6; // bh
  unsigned __int8 *v10; // ebp
  int CpuCount; // eax
  unsigned __int8 v12; // bl
  int v13; // ecx
  char v14; // [esp+13h] [ebp-15h]
  int v15; // [esp+14h] [ebp-14h]
  _BYTE *v16; // [esp+18h] [ebp-10h]
  int CpuCount_1; // [esp+1Ch] [ebp-Ch]
  int n4_3; // [esp+20h] [ebp-8h]
  int v19; // [esp+24h] [ebp-4h]
  unsigned __int8 n4_2; // [esp+2Ch] [ebp+4h]

  __return_address_1 = __return_address; /*0xffc7ba7c*/
  v14 = 0; /*0xffc7ba81*/
  n9 = *(_DWORD *)(__return_address + 9405); /*0xffc7ba86*/
  if ( n9 != 9 && n9 != 10 && *(_BYTE *)(__return_address + 257314) == 1 ) /*0xffc7ba9d*/
  {
    n4 = 0; /*0xffc7ba9f*/
    n4_2 = 0; /*0xffc7baa6*/
    v4 = 0; /*0xffc7baaa*/
    do /*0xffc7baef*/
    {
      if ( ((1 << v4) & *(_DWORD *)(__return_address_1 + 246468)) != 0 ) /*0xffc7bab9*/
      {
        v5 = CpuIoRead(__return_address_1, n4_2, 0, 318914748); /*0xffc7bac3*/
        if ( v5 >= 0 ) /*0xffc7bacd*/
          CpuIoCfgWrite(__return_address_1, n4_2, 0, 318914748, v5 | 0x80000000); /*0xffc7badd*/
      }
      ++n4; /*0xffc7bae5*/
      ++v4; /*0xffc7bae7*/
      n4_2 = n4; /*0xffc7bae8*/
    }
    while ( n4 < 4u ); /*0xffc7baef*/
  }
  n4_1 = 0; /*0xffc7baf1*/
  result = (_BYTE *)(__return_address_1 + 258689); /*0xffc7baf3*/
  LOBYTE(n4_3) = 0; /*0xffc7baf9*/
  v16 = (_BYTE *)(__return_address_1 + 258689); /*0xffc7bafd*/
  do /*0xffc7bcaf*/
  {
    if ( *result ) /*0xffc7bb01*/
    {
      SocketInfo = GetSocketInfo(__return_address_1, n4_3); /*0xffc7bb1c*/
      if ( *(_BYTE *)(__return_address_1 + 257314) == 1 /*0xffc7bb33*/
        && (ProcCommonFunc226E(__return_address_1, n4_3, 0) & 0x200) != 0 )
      {
        v14 = 1; /*0xffc7bb3f*/
        DebugPrint( /*0xffc7bb4d*/
          __return_address_1,
          3,
          n4_3,
          255,
          255,
          255,
          255,
          255,
          "Surprise warmreset happened in either MC and EKV in training mode\n");
      }
      n6 = 0; /*0xffc7bb55*/
      v10 = (unsigned __int8 *)(SocketInfo + 3); /*0xffc7bb57*/
      LOBYTE(__return_address) = 0; /*0xffc7bb5a*/
      do /*0xffc7bc23*/
      {
        CpuCount = GetCpuCount(__return_address_1, n4_3, __return_address); /*0xffc7bb64*/
        v12 = 0; /*0xffc7bb69*/
        CpuCount_1 = CpuCount; /*0xffc7bb6b*/
        for ( LOBYTE(v15) = 0; v12 < *v10; LOBYTE(v15) = v12 ) /*0xffc7bb76*/
        {
          v13 = 1379 * v12; /*0xffc7bb82*/
          if ( *(_BYTE *)(v13 + CpuCount) && *(_BYTE *)(v13 + CpuCount + 107) ) /*0xffc7bb8e*/
          {
            v19 = ((int (__cdecl *)(int, _BYTE, int, _BYTE))loc_FFC3E340)( /*0xffc7bbaa*/
                    __return_address_1,
                    n4_3,
                    __return_address,
                    v15);
            DebugPrint(__return_address_1, 2, n4_3, __return_address, v15, 255, 255, 255, "Bsr = 0x%x\n", v19); /*0xffc7bbc2*/
            if ( v19 != -1 && (v19 & 0x20000000) != 0 ) /*0xffc7bbd8*/
            {
              v14 = 1; /*0xffc7bbe5*/
              DebugPrint( /*0xffc7bbf9*/
                __return_address_1,
                3,
                n4_3,
                __return_address,
                v15,
                255,
                255,
                255,
                "Bsr = 0x%x, NVMDIMM receive surprise clock stop\n",
                v19);
            }
            CpuCount = CpuCount_1; /*0xffc7bc01*/
          }
          ++v12; /*0xffc7bc05*/
        }
        ++n6; /*0xffc7bc14*/
        v10 += 7688; /*0xffc7bc16*/
        LOBYTE(__return_address) = n6; /*0xffc7bc1c*/
      }
      while ( n6 < 6u ); /*0xffc7bc23*/
      n4_1 = n4_3; /*0xffc7bc2e*/
      if ( v14 == 1 ) /*0xffc7bc32*/
      {
        if ( *(_BYTE *)(__return_address_1 + 1481) == 1 ) /*0xffc7bc40*/
        {
          DebugPrint( /*0xffc7bc79*/
            __return_address_1,
            3,
            255,
            255,
            255,
            255,
            255,
            255,
            "Power cycle policy is enabled, issue power cycle\n");
          KtiFunc211E(__return_address_1, 138, 2, n4_3, 255, 255, 255); /*0xffc7bc8a*/
          *(_BYTE *)(__return_address_1 + 246400) |= 4u; /*0xffc7bc92*/
        }
        else
        {
          DebugPrint(__return_address_1, 3, 255, 255, 255, 255, 255, 255, "Please generate a power cycle to recover\n"); /*0xffc7bc50*/
          KtiFunc211E(__return_address_1, 138, 1, n4_3, 255, 255, 255); /*0xffc7bc61*/
        }
      }
      result = v16; /*0xffc7bc99*/
    }
    ++n4_1; /*0xffc7bc9d*/
    result += 48704; /*0xffc7bc9f*/
    LOBYTE(n4_3) = n4_1; /*0xffc7bca4*/
    v16 = result; /*0xffc7bca8*/
  }
  while ( n4_1 < 4u ); /*0xffc7bcaf*/
  return result; /*0xffc7bcb5*/
}

// Function: DdrTrainFuncBCBD @ 0xffc7bcbd (0x2c bytes)
// Index: 991/2560

int __cdecl DdrTrainFuncBCBD(int __return_address, unsigned __int8 n4)
{
  int result; // eax
  int n6; // ecx

  result = GetSocketInfo(__return_address, n4); /*0xffc7bcc5*/
  n6 = 6; /*0xffc7bcce*/
  do /*0xffc7bce6*/
  {
    if ( *(_BYTE *)result ) /*0xffc7bccf*/
      *(_DWORD *)(result + 7497) = 1; /*0xffc7bcd4*/
    result += 7688; /*0xffc7bcde*/
    --n6; /*0xffc7bce3*/
  }
  while ( n6 ); /*0xffc7bce6*/
  return result; /*0xffc7bce8*/
}

// Function: DdrTrainFuncBCE9 @ 0xffc7bce9 (0x16 bytes)
// Index: 992/2560

int __cdecl DdrTrainFuncBCE9(int __return_address, int n4)
{
  return ProcCommonFuncD32C(__return_address, n4, 0x100000); /*0xffc7bcfe*/
}

// Function: IOTrainingCtlCmdCkeClk @ 0xffc7bcff (0x17dc bytes)
// Index: 993/2560

int __cdecl IOTrainingCtlCmdCkeClk(unsigned __int8 *n6)
{
  unsigned __int8 *n6_1; // ebp
  int __return_address; // ebx
  int SocketInfo; // esi
  unsigned __int8 n6_2; // al
  int v5; // edi
  unsigned __int8 n6_13; // al
  int v7; // eax
  int v8; // eax
  int v9; // eax
  int v10; // eax
  int v11; // eax
  int v12; // edi
  unsigned int v13; // eax
  _BYTE *v14; // edi
  _BYTE *v15; // ecx
  _BYTE *v16; // edx
  _BYTE *v17; // eax
  _DWORD *v18; // edi
  _DWORD *v19; // edi
  _DWORD *v20; // edi
  _DWORD *v21; // ecx
  _DWORD *v22; // edi
  _DWORD *v23; // edx
  _BYTE *v24; // edx
  unsigned __int8 *n6_3; // ebp
  int v26; // eax
  int v27; // eax
  int v28; // eax
  int v29; // eax
  int n0x40; // eax
  char n0x40_1; // si
  unsigned __int8 n6_16; // di
  int v33; // eax
  int v34; // eax
  int v35; // eax
  int v36; // eax
  int v37; // eax
  _DWORD *v38; // ecx
  unsigned int v39; // eax
  unsigned int v40; // esi
  unsigned int v41; // edi
  unsigned int v42; // esi
  unsigned... [44638 chars total]

// Function: Ddr4RcdInit @ 0xffc7d4db (0xa66 bytes)
// Index: 994/2560

int __cdecl Ddr4RcdInit(unsigned __int8 *n6)
{
  unsigned __int8 *n6_1; // ebx
  int n4_1; // ebp
  int SocketInfo; // esi
  unsigned __int8 n6a_1; // al
  unsigned __int8 n6a_2; // al
  unsigned __int8 *v6; // edi
  int v7; // edx
  unsigned __int8 n2_1; // al
  int v9; // eax
  int v10; // esi
  int n6_4; // edi
  _DWORD *v12; // esi
  _BYTE *v13; // edx
  int v14; // ecx
  int n6_5; // eax
  int v16; // eax
  unsigned __int8 *v17; // esi
  int v18; // edi
  int CpuCount_2; // edx
  unsigned __int8 n2_2; // al
  unsigned int v21; // edx
  int v22; // ecx
  int n6_8; // esi
  bool *v24; // edx
  unsigned __int8 *v25; // ecx
  int n6_9; // esi
  bool v27; // al
  unsigned __int16 *v28; // edi
  int v29; // esi
  unsigned __int16 n0x40_1; // bp
  char v31; // dl
  _BYTE *v32; // ecx
  _DWORD *v33; // edi
  unsigned __int8 n6a_3; // al
  unsigned __int8 *v35; // esi
  int n6_10; // ebp
  int v37; // edi
  unsigned int n6a_4; // esi
  int CpuCount_3; // edx
  unsigned __int8 v40; // al
  ... [17978 chars total]

// Function: DdrTrainFuncDF41 @ 0xffc7df41 (0x180 bytes)
// Index: 995/2560

char __cdecl DdrTrainFuncDF41(
        _BYTE *a1,
        unsigned __int8 a2,
        unsigned __int8 a3,
        unsigned __int8 a4,
        unsigned __int8 a5,
        int a6,
        int n23)
{
  char v7; // bl
  int CpuCount; // [esp+10h] [ebp-8h]
  int SocketInfo; // [esp+14h] [ebp-4h]

  v7 = 0; /*0xffc7df4f*/
  SocketInfo = GetSocketInfo((int)a1, a2); /*0xffc7df5b*/
  CpuCount = GetCpuCount((int)a1, a2, a3); /*0xffc7df78*/
  if ( a5 ) /*0xffc7df7e*/
  {
    if ( !a1[244249] /*0xffc7dfc5*/
      && ProcCommonFunc24FA((int)a1, a2, a3, a4)
      && !a6
      && (n23 == 23 || n23 == 5 || n23 == 22 || n23 == 3 || n23 == 4 || n23 == 1) )
    {
      v7 = 1; /*0xffc7dfc7*/
    }
    if ( *(_BYTE *)(7688 * a3 + SocketInfo + 6262) == 2 && a5 > 1u ) /*0xffc7dfe7*/
      v7 = 1; /*0xffc7dfe9*/
    if ( !a1[257313] && KtiFunc47AD(n23) && !a1[244249] && !a6 ) /*0xffc7e00d*/
      v7 = 1; /*0xffc7e00f*/
  }
  if ( (KtiFunc47AD(n23) || KtiFunc47DF(n23) || n23 == 53) /*0xffc7e075*/
    && a6 == 1
    && (!KtiFuncCB2E((int)a1, a2, a3, a4) && !*(_BYTE *)(1379 * a4 + CpuCount + 107)
     || *(_BYTE *)(1379 * a4 + CpuCount + 107) && !a1[195]) )
  {
    v7 = 1; /*0xffc7e07e*/
  }
  if ( !ProcCommonFunc24FA((int)a1, a2, a3, a4) && a6 == 1 && !KtiFunc47AD(n23) && !KtiFunc47DF(n23) ) /*0xffc7e0ac*/
    return 1; /*0xffc7e0b6*/
  return v7; /*0xffc7e0b8*/
}

// Function: DdrTrainFuncE0C1 @ 0xffc7e0c1 (0x4c9 bytes)
// Index: 996/2560

char __cdecl DdrTrainFuncE0C1(int __return_address, int n6)
{
  int __return_address_1; // ebx
  int SocketInfo; // eax
  _BYTE *SocketInfo_1; // edi
  int n63_2; // ebx
  _BYTE *v6; // ecx
  int v7; // edx
  int n6_1; // eax
  unsigned __int8 n63; // al
  unsigned __int8 n6_3; // cl
  _BYTE *SocketInfo_2; // esi
  char *v12; // eax
  int n6_2; // ecx
  int n8; // edx
  int n6_4; // [esp+1Ch] [ebp-2B8h]
  char n63_1; // [esp+24h] [ebp-2B0h]
  int v18[6]; // [esp+4Ch] [ebp-288h]
  int v19; // [esp+64h] [ebp-270h] BYREF
  int v20[108]; // [esp+124h] [ebp-1B0h] BYREF

  __return_address_1 = __return_address; /*0xffc7e0c8*/
  SocketInfo = GetSocketInfo(__return_address, n6); /*0xffc7e0e0*/
  SocketInfo_1 = (_BYTE *)SocketInfo; /*0xffc7e0ec*/
  if ( *(_BYTE *)(__return_address + 257313) ) /*0xffc7e0e5*/
  {
    n63 = 63; /*0xffc7e14b*/
    n63_1 = 63; /*0xffc7e14d*/
  }
  else
  {
    LOBYTE(n63_2) = 0; /*0xffc7e0f6*/
    v6 = (_BYTE *)(SocketInfo + 6716); /*0xffc7e0fa*/
    v7 = 0; /*0xffc7e102*/
    n6_1 = 6; /*0xffc7e104*/
    do /*0xffc7e138*/
    {
      *((_WORD *)&v18[3] + v7) = 0; /*0xffc7e107*/
      *((_WORD *)v18 + v7) = 0; /*0xffc7e10c*/
      if ( *(v6 - 6716) && *(v6 - 6713) == 2 && *v6 ) /*0xffc7e123*/
        n63_2 = (unsigned __int8)n63_2 | (1 << v7); /*0xffc7e12b*/
      ++v7; /*0xffc7e12e*/
      v6 += 7688; /*0xffc7e12f*/
      --n6_1; /*0xffc7e135*/
    }
    while ( n6_1 ); /*0xffc7e138*/
    n63_1 = n63_2; /*0xffc7e13a*/
    __return_address_1 = __return_address; /*0xffc7e13e*/
    n63 = n63_1; /*0xffc7e145*/
  }
  if ( n63 ) /*0xffc7e153*/
  {
    n6_3 = 0; /*0xffc7e159*/
    SocketInfo_2 = SocketInfo_1; /*0xffc7e15b*/
    LOBYTE(n6_4) = 0; /*0xffc7e15d*/
    while ( 1 ) /*0xffc7e166*/
    {
      if ( *SocketInfo_2 == 1 ) /*0xffc7e169*/
      {
        if ( ((n63 >> n6_3) & 1) == 0 ) /*0xffc7e16f*/
        {
          DebugPrint(__return_address_1, 2, n6, n6_4, 255, 255, 255, 255, "Not training\n"); /*0xffc7e182*/
          n6_3 = n6_4; /*0xffc7e187*/
        }
        n63 = n63_1; /*0xffc7e193*/
      }
      ++n6_3; /*0xffc7e197*/
      SocketInfo_2 += 7688; /*0xffc7e199*/
      LOBYTE(n6_4) = n6_3; /*0xffc7e19f*/
      if ( n6_3 >= 6u ) /*0xffc7e1a6*/
      {
        v12 = (char *)&v19 + 2; /*0xffc7e1aa*/
        n6_2 = 6; /*0xffc7e1ae*/
        while ( 1 ) /*0xffc7e1b1*/
        {
          n8 = 8; /*0xffc7e1b1*/
          do /*0xffc7e1bd*/
          {
            *(_DWORD *)(v12 - 2) = 0; /*0xffc7e1b4*/
            v12 += 4; /*0xffc7e1b7*/
            --n8; /*0xffc7e1ba*/
          }
          while ( n8 ); /*0xffc7e1bd*/
          if ( !--n6_2 ) /*0xffc7e1c2*/
          {
            RmtFunc9414(__return_address_1, n6, (int)v20); /*0xffc7e1ce*/
            DdrTrainFunc158E(__return_address_1, n6); /*0xffc7e1d5*/
          }
        }
      }
    }
  }
  return 0; /*0xffc7e57d*/
}

// Function: DdrTrainFuncE58A @ 0xffc7e58a (0x1f bytes)
// Index: 997/2560

unsigned __int8 __cdecl DdrTrainFuncE58A(unsigned __int8 n8)
{
  unsigned __int8 n8_1; // cl
  int v2; // eax

  n8_1 = n8; /*0xffc7e58a*/
  if ( n8 > 3u ) /*0xffc7e591*/
  {
    v2 = (unsigned __int8)(((unsigned __int8)(n8 - 4) >> 2) + 1); /*0xffc7e59b*/
    do /*0xffc7e5a4*/
    {
      n8_1 -= 4; /*0xffc7e59e*/
      --v2; /*0xffc7e5a1*/
    }
    while ( v2 ); /*0xffc7e5a4*/
  }
  return n8_1; /*0xffc7e5a8*/
}

// Function: MemCpgcMain @ 0xffc7e5a9 (0xc53 bytes)
// Index: 998/2560

int __cdecl MemCpgcMain(unsigned __int8 *n6)
{
  unsigned __int8 *n6_1; // ebx
  int n4_1; // ebp
  int SocketInfo; // ecx
  unsigned __int8 n6_2; // al
  _BYTE *CpuCount; // ecx
  unsigned __int8 n2_2; // al
  unsigned int v7; // esi
  unsigned __int8 n2_3; // al
  int v9; // edi
  int v10; // esi
  unsigned int v11; // eax
  unsigned int v12; // eax
  unsigned int v13; // eax
  int v14; // eax
  unsigned __int8 n8; // al
  int v16; // edi
  unsigned __int8 n8_2; // al
  _BYTE *CpuCount_3; // ecx
  int n4_2; // edi
  int n4_3; // eax
  unsigned __int8 n2a_1; // al
  int v22; // edi
  unsigned int v23; // eax
  unsigned __int8 n2b_1; // al
  unsigned int v25; // eax
  unsigned int v26; // esi
  unsigned __int8 n2c_1; // al
  unsigned int v28; // eax
  unsigned __int8 n2d_2; // al
  int n9; // ecx
  unsigned int v31; // eax
  unsigned __int16 v32; // di
  unsigned __int8 n2_4; // al
  int v34; // ecx
  unsigned __int8 n2d_1; // al
  int v36; // eax
  unsigned __int8 n2_8; // al
  unsign... [22211 chars total]

// Function: DdrTrainFuncF1FC @ 0xffc7f1fc (0x41 bytes)
// Index: 999/2560

int __cdecl DdrTrainFuncF1FC(unsigned __int8 *n6, unsigned __int8 n2, int a3, unsigned __int8 a4)
{
  int v4; // eax

  v4 = MiscConfigCheck(n6, n2, a3, 184567108); /*0xffc7f20f*/
  return MiscIoCheck(n6, n2, a3, 0xB004544u, (a4 << 15) | v4 & 0xFF807FFF | 0xFF); /*0xffc7f23a*/
}

// Function: DdrTrainFuncF23D @ 0xffc7f23d (0x45 bytes)
