//
// sub_100569BF0 from 0x100569bf0 to 0x100569d61 (369 bytes)
//
// 7 xrefs:
// > sub_100212D50 @ 0x100212db1
// > sub_100528E70 @ 0x100529061
// > GameLevelManager::onDeleteUserMessagesCompleted @ 0x10052aebc
// > ProfilePage::init @ 0x10089dc0d
// > ProfilePage::init @ 0x10089dc1e
// > ProfilePage::onUpdate @ 0x10089ee8f
// > ProfilePage::onUpdate @ 0x10089eea0
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:32:12 +0000
//
void __fastcall sub_100569BF0(__int64 a1, char a2)
{
unsigned __int8 v2; // r14
int v3; // r15d
__int64 i; // rax
const char *CString; // r12
size_t v6; // rax
size_t v7; // r13
char *v8; // rbx
const char *v9; // rsi
__int64 StoredOnlineLevels; // r12
__int64 v11; // rax
size_t v12; // r14
__int64 v13; // rdi
char v14; // [rsp+0h] [rbp-50h]
char v15; // [rsp+4h] [rbp-4Ch]
_QWORD __dst[2]; // [rsp+10h] [rbp-40h] BYREF
void *__p; // [rsp+20h] [rbp-30h]
v2 = a2;
v3 = 0;
for ( i = sub_10088E820("messages_%i_%i", a2); ; i = sub_10088E820("messages_%i_%i", v14) )
{
CString = (const char *)cocos2d::CCString::getCString(i);
v6 = strlen(CString);
if ( v6 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v7 = v6;
if ( v6 >= 0x17 )
{
v11 = v6 | 7;
v12 = 26;
if ( (v7 | 7) != 0x17 )
v12 = v11 + 1;
v8 = (char *)operator new(v12);
__p = v8;
__dst[0] = v12 + 1;
__dst[1] = v7;
v2 = v14;
}
else
{
LOBYTE(__dst[0]) = 2 * v6;
v8 = (char *)__dst + 1;
if ( !v6 )
{
BYTE1(__dst[0]) = 0;
v9 = (char *)__dst + 1;
if ( (__dst[0] & 1) == 0 )
goto LABEL_9;
LABEL_8:
v9 = (const char *)__p;
goto LABEL_9;
}
}
memmove(v8, CString, v7);
v8[v7] = 0;
v9 = (char *)__dst + 1;
if ( (__dst[0] & 1) != 0 )
goto LABEL_8;
LABEL_9:
StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(a1, v9);
if ( StoredOnlineLevels )
cocos2d::CCDictionary::removeObjectForKey(*(_QWORD *)(a1 + 1040), (char *)__dst);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
++v3;
if ( !StoredOnlineLevels )
break;
}
if ( v15 )
{
v13 = *(_QWORD *)(a1 + 1384);
if ( v13 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v13 + 16LL))(v13, v2);
}
}