// 20B0D20C: using guessed type wchar_t aNone_3[5];
// 20B0D31C: using guessed type wchar_t aNone_18[7];
// 20B0D32C: using guessed type wchar_t aSSS[10];
// 20B1F790: using guessed type wchar_t[46];
//----- (20521580) --------------------------------------------------------
char __cdecl sub_20521580(int a1, _BYTE *a2)
{
const wchar_t *v2; // esi@4
const wchar_t *v3; // eax@7
signed int i; // esi@10
signed int j; // edi@13
_BYTE *v6; // eax@15
int v7; // eax@16
int v8; // eax@17
_BYTE *v9; // eax@18
int v10; // ecx@19
int v11; // eax@19
int v12; // ecx@19
int v13; // eax@21
int v14; // eax@23
int v15; // eax@23
int v16; // eax@23
int v17; // edx@23
int v19; // [sp+0h] [bp-ECh]@1
__int16 v20; // [sp+Ch] [bp-E0h]@15
__int16 v21; // [sp+3Ch] [bp-B0h]@15
int v22; // [sp+78h] [bp-74h]@13
int v23; // [sp+84h] [bp-68h]@13
unsigned __int64 v24; // [sp+90h] [bp-5Ch]@15
int v25; // [sp+98h] [bp-54h]@14
int v26; // [sp+A0h] [bp-4Ch]@11
char v27; // [sp+A4h] [bp-48h]@10
int v28; // [sp+B8h] [bp-34h]@16
int v29; // [sp+BCh] [bp-30h]@15
int v30; // [sp+C0h] [bp-2Ch]@12
int v31; // [sp+C4h] [bp-28h]@15
int v32; // [sp+C8h] [bp-24h]@12
int v33; // [sp+CCh] [bp-20h]@10
int v34; // [sp+D0h] [bp-1Ch]@13
_BYTE *v35; // [sp+D4h] [bp-18h]@10
_BYTE *v36; // [sp+D8h] [bp-14h]@12
int *v37; // [sp+DCh] [bp-10h]@1
int v38; // [sp+E8h] [bp-4h]@1
v37 = &v19;
v38 = 0;
if ( v151906E8 )
{
if ( vCB58068 && (*(int (**)(void))(*vCB58068 + 208))() )
v2 = (const wchar_t *)(*(int (**)(void))(*vCB58068 + 208))();
else
v2 = L"NONE";
if ( vCB58068 )
v3 = (const wchar_t *)(*(int (**)(void))(*vCB58068 + 2228))();
else
v3 = L"(None)";
v1509F460(v151906E8, (const char *)L"%s[%s] %s", v3, v2, L"ExDieInfo");
}
v150A3540(&v27);
LOBYTE(v38) = 1;
v33 = 0;
v35 = sub_204F5950(*(char **)(a1 + 72), a2, (int)"h", (unsigned int)&v33);
v150A33B0(&v27, (signed __int16)v33, (unsigned __int64)(signed __int16)v33 >> 32);
for ( i = 0; ; ++i )
{
v26 = i;
if ( i >= (signed __int16)v33 )
break;
v30 = 0;
v32 = 0;
v36 = 0;
v35 = sub_204F5950(*(char **)(a1 + 72), v35, (int)&dword_20ADB750, (unsigned int)&v30);
v150A33B0(&v27, v30, (unsigned __int64)v30 >> 32);
v150A33B0(&v27, v32, (unsigned __int64)v32 >> 32);
v150A33B0(&v27, v36, (unsigned __int64)(signed int)v36 >> 32);
}
v34 = 0;
v36 = sub_204F5950(*(char **)(a1 + 72), v35, (int)"h", (unsigned int)&v34);
v150A33B0(&v27, (signed __int16)v34, (unsigned __int64)(signed __int16)v34 >> 32);
sub_201B4A00((int)&v22);
LOBYTE(v38) = 2;
sub_201B4A00((int)&v23);
LOBYTE(v38) = 3;
for ( j = 0; ; ++j )
{
v25 = j;
if ( j >= (signed __int16)v34 )
break;
v35 = 0;
v21 = 0;
v20 = 0;
v31 = 0;
v24 = 0i64;
v29 = 0;
v6 = sub_204F5950(*(char **)(a1 + 72), v36, (int)"h", (unsigned int)&v35);
if ( (_WORD)v35 == 1 )
{
v28 = 0;
v36 = sub_204F5950(*(char **)(a1 + 72), v6, (int)&dword_20ADB74C, (unsigned int)&v28);
v7 = sub_20204190(0, &v28);
if ( v7 )
{
v8 = v1500AFF0(v7);
v15079520(&v21, v8, 24);
}
v9 = v36;
}
else
{
v9 = sub_204F5950(*(char **)(a1 + 72), v6, (int)&dword_20ADB748, 48);
}
v36 = sub_204F5950(*(char **)(a1 + 72), v9, (int)"Sdfh", 48);
v11 = sub_201FB920(v10, &v22);
if ( v11 )
v1500AA30(v11, &v21);
v13 = sub_201FB920(v12, &v23);
if ( v13 )
v1500AA30(v13, &v20);
v150A33B0(&v27, (signed __int16)v35, (unsigned __int64)(signed __int16)v35 >> 32);
v14 = v1500AFF0(v22 + 12 * j);
v150A33B0(&v27, v14, (unsigned __int64)v14 >> 32);
v15 = v1500AFF0(v23 + 12 * j);
v150A33B0(&v27, v15, (unsigned __int64)v15 >> 32);
v150A33B0(&v27, v31, (unsigned __int64)v31 >> 32);
sub_209323FD((__m128d)v24);
v150A33B0(&v27, v16, v17);
v150A33B0(&v27, (signed __int16)v29, (unsigned __int64)(signed __int16)v29 >> 32);
}
(*(void (__stdcall **)(char *))(*(_DWORD *)GL2Console + 5196))(&v27);
LOBYTE(v38) = 2;
sub_201B4AF0((int)&v23);
LOBYTE(v38) = 1;
sub_201B4AF0((int)&v22);
LOBYTE(v38) = 0;
v150A3450(&v27);
return 0;
}
// 20ADB748: using guessed type int dword_20ADB748;
// 20ADB74C: using guessed type int dword_20ADB74C;
// 20ADB750: using guessed type int dword_20ADB750;
// 20B0D20C: using guessed type wchar_t aNone_3[5];
// 20B0D31C: using guessed type wchar_t aNone_18[7];
// 20B0D32C: using guessed type wchar_t aSSS[10];
// 20B1F714: using guessed type wchar_t aExdieinfo[10];