BgpConsoleDisplayCharacterEx

INT64 __fastcall BgpConsoleDisplayCharacterEx(
        WCHAR Character,
        UINT64 Column,
        UINT64 Row,
        UINT64 Foreground,
        UINT64 Background,
        UINT64 Flags){
  int v6; 
  unsigned int v7; 
  __int64 v8; 
  int *v9; 
  _DWORD *v10; 
  _DWORD *v11; 
  unsigned int v12; 
  int v13; 
  int v14; 
  int v15; 
  int v16; 
  int v17; 
  __int64 v18; 
  unsigned int v19; 
  unsigned int v20; 
  unsigned int v21; 
  unsigned int v22; 
  __int64 v23; 
  int v24; 
  __int64 v25; 
  unsigned int v26; 
  int v27; 
  int v28; 
  __int64 v29; 
  unsigned int v30; 
  unsigned __int64 v32; 
  int v33; 
  v6 = Character;
  v7 = Foreground;
  if( (unsigned int)Column > 0x50 )
    return 3221225485i64;
  v8 = qword_140CDAE98;
  if( (unsigned int)Row > *(_DWORD *)(qword_140CDAE98 + 4) )
    return 3221225485i64;
  v9 = (int *)(qword_140CDAE98 + 68);
  v10 = (_DWORD *)(qword_140CDAE98 + 60);
  v11 = (_DWORD *)(qword_140CDAE98 + 48);
  v12 = 0;
  v13 = Character - 8;
  if( v6 == 8 )
  {
    if( !*v9 )
      goto LABEL_20;
    v26 = Background;
    v27 = *v9 - 1;
    *v9 = v27;
    BgpDisplayCharacterEx(
      0x20u,
      *(_QWORD *)(v8 + 40),
      *v10 + *v11 * v27,
      v10[1] + *(_DWORD *)(v8 + 72) * *(_DWORD *)(v8 + 52),
      v26,
      Foreground,
      (int *)&Flags,
      &v33,
      v32,
      0i64);
    v12 = v28;
    if( v28 >= 0 )
    {
      v8 = qword_140CDAE98;
      v29 = 3 * ((unsigned int)v9[1] + 25i64 * (unsigned int)*v9);
      *(_WORD *)(qword_140CDAE98 + 4 * v29 + 88) = 32;
      *(_DWORD *)(v8 + 4 * v29 + 80) = v7;
      *(_DWORD *)(v8 + 4 * v29 + 84) = v26;
      goto LABEL_20;
    }
    goto LABEL_19;
  }
  v14 = v13 - 1;
  if( v14 )
  {
    v15 = v14 - 1;
    if( !v15 )
    {
LABEL_21:
      ++v9[1];
      goto LABEL_22;
    }
    if( v15 == 3 )
    {
LABEL_22:
      *v9 = 0;
      goto LABEL_23;
    }
    v16 = Background;
    BgpDisplayCharacterEx(
      v6,
      *(_QWORD *)(qword_140CDAE98 + 40),
      *(_DWORD *)(qword_140CDAE98 + 60) + *v9 * *v11,
      *(_DWORD *)(qword_140CDAE98 + 64) + *(_DWORD *)(qword_140CDAE98 + 72) * *(_DWORD *)(qword_140CDAE98 + 52),
      Background,
      Foreground,
      (int *)&Flags,
      &v33,
      v32,
      0i64);
    v12 = v17;
    if( v17 >= 0 )
    {
      v18 = 3 * ((unsigned int)v9[1] + 25i64 * (unsigned int)*v9);
      v8 = qword_140CDAE98;
      *(_WORD *)(qword_140CDAE98 + 4 * v18 + 88) = v6;
      *(_DWORD *)(v8 + 4 * v18 + 80) = v7;
      *(_DWORD *)(v8 + 4 * v18 + 84) = v16;
      ++*v9;
      goto LABEL_20;
    }
LABEL_19:
    v8 = qword_140CDAE98;
    goto LABEL_20;
  }
  v19 = *v9;
  v20 = 80 - *v9;
  v21 = 5;
  if( v20 >= 5 || (v21 = 80 - *v9, v20) )
  {
    v22 = Background;
    v23 = v21;
    do
    {
      BgpDisplayCharacterEx(
        0x20u,
        *(_QWORD *)(v8 + 40),
        *v10 + v19 * *v11,
        v10[1] + v11[1] * v9[1],
        v22,
        v7,
        (int *)&Flags,
        &v33,
        v32,
        0i64);
      v8 = qword_140CDAE98;
      v12 = v24;
      if( v24 >= 0 )
      {
        v25 = 3 * ((unsigned int)v9[1] + 25i64 * (unsigned int)*v9);
        *(_WORD *)(qword_140CDAE98 + 4 * v25 + 88) = 32;
        *(_DWORD *)(v8 + 4 * v25 + 80) = v7;
        *(_DWORD *)(v8 + 4 * v25 + 84) = v22;
      }
      v19 = ++*v9;
      --v23;
    }
    while( v23 );
  }
LABEL_20:
  if( (unsigned int)*v9 >= 0x50 )
    goto LABEL_21;
LABEL_23:
  v30 = v9[1];
  if( v30 >= *(_DWORD *)(v8 + 4) )
  {
    v9[1] = v30 - 1;
    BgpConsoleScrollScreen();
  }
  return v12;
}

Referenced by:

BgpConsoleDisplayString