int sub_FFD83249()
{
  int n2; // esi
  char *n3_1; // edi
  int v2; // ebx
  int v3; // eax
  int v4; // eax
  int v5; // eax
  int v6; // eax
  unsigned int i; // ebp
  int v8; // eax
  int v9; // ecx
  int v10; // esi
  int v12; // [esp+14h] [ebp-30h]
  int v13; // [esp+1Ch] [ebp-28h]
  int n2_2; // [esp+28h] [ebp-1Ch]
  int v15; // [esp+2Ch] [ebp-18h]
  unsigned int n3; // [esp+30h] [ebp-14h]
  int n2_1; // [esp+34h] [ebp-10h]
  int n4; // [esp+38h] [ebp-Ch]
  int n4_1; // [esp+3Ch] [ebp-8h]
  int n4_2; // [esp+40h] [ebp-4h]

  DebugPrint(64, (int)"PchConfigurePsfGrantCountsForPcie() Start\
"); /*0xffd83257*/
  n2 = sub_FFD8BE68(); /*0xffd83263*/
  n2_2 = n2; /*0xffd83265*/
  if ( n2 == 2 ) /*0xffd8326c*/
    n3 = 3; /*0xffd8326e*/
  else
    n3 = 5; /*0xffd83288*/
  n3_1 = 0; /*0xffd832a0*/
  v2 = 0; /*0xffd832a2*/
  v15 = 0; /*0xffd832a6*/
  do /*0xffd8341f*/
  {
    v3 = sub_FFD83186(n3_1); /*0xffd832ad*/
    if ( !v3 ) /*0xffd832b5*/
    {
      n2_1 = 1; /*0xffd83325*/
      n4 = 1; /*0xffd83329*/
      goto LABEL_16; /*0xffd83329*/
    }
    v4 = v3 - 1; /*0xffd832b7*/
    if ( !v4 ) /*0xffd832ba*/
    {
      n2_1 = 2; /*0xffd83313*/
      n4 = 4; /*0xffd8331b*/
LABEL_16:
      n4_2 = 1; /*0xffd8332d*/
      n4_1 = 1; /*0xffd83331*/
      goto LABEL_17; /*0xffd83331*/
    }
    v5 = v4 - 1; /*0xffd832bc*/
    if ( v5 ) /*0xffd832bf*/
    {
      if ( v5 != 1 ) /*0xffd832c4*/
      {
        v6 = GetReportStatusCodePpi(); /*0xffd832c6*/
        if ( v6 ) /*0xffd832cd*/
          (*(void (__cdecl **)(const char *, int, const char *))(v6 + 4))( /*0xffd832e2*/
            "e:\\hs\\PurleySktPkg\\SouthClusterLbg\\LibraryPrivate\\PeiPchInitLib\\PchRootPorts.c",
            1230,
            "((BOOLEAN)(0==1))");
        goto LABEL_23; /*0xffd832e8*/
      }
      n2_1 = 4; /*0xffd832ed*/
      n4_1 = 4; /*0xffd832f1*/
    }
    else
    {
      n2_1 = 2; /*0xffd832f7*/
      n4_1 = 2; /*0xffd832ff*/
    }
    n4 = 4; /*0xffd83307*/
    n4_2 = 4; /*0xffd8330b*/
LABEL_17:
    for ( i = 0; i < 4; ++i ) /*0xffd83335*/
    {
      if ( n2 == 2 ) /*0xffd8333a*/
      {
        v8 = (unsigned __int8)byte_FFD93FCC[v2]; /*0xffd83343*/
        v12 = (unsigned __int8)byte_FFD93FCD[v2]; /*0xffd8334a*/
        v9 = (unsigned __int8)byte_FFD93F44[4 * (_DWORD)n3_1 + i]; /*0xffd8334e*/
      }
      else
      {
        v8 = (unsigned __int8)byte_FFD93F8C[v2]; /*0xffd8335f*/
        v12 = (unsigned __int8)byte_FFD93F8D[v2]; /*0xffd83366*/
        v9 = (unsigned __int8)byte_FFD93F5C[4 * (_DWORD)n3_1 + i]; /*0xffd8336a*/
      }
      v10 = *(&n2_1 + i); /*0xffd83372*/
      v13 = v9; /*0xffd8337f*/
      DebugPrint(64, (int)"DGCR%d = %d\
", v8, v10); /*0xffd83387*/
      sub_FFD8C578(-32, v10); /*0xffd8339f*/
      DebugPrint(64, (int)"DGCR%d = %d\
", v12, v10); /*0xffd833b0*/
      sub_FFD8C578(-32, v10); /*0xffd833c8*/
      DebugPrint(64, (int)"PG1_TGT%d = %d\
", v13, v10); /*0xffd833d9*/
      sub_FFD8C578(-32, v10); /*0xffd833f4*/
      n2 = n2_2; /*0xffd833f9*/
      v2 += 2; /*0xffd833ff*/
    }
    v2 = v15; /*0xffd8340c*/
LABEL_23:
    ++n3_1; /*0xffd83413*/
    v2 += 8; /*0xffd83414*/
    v15 = v2; /*0xffd83417*/
  }
  while ( (unsigned int)n3_1 < n3 ); /*0xffd8341f*/
  return DebugPrint(64, (int)"PchConfigurePsfGrantCountsForPcie() End\
"); /*0xffd83433*/
}
