//
// GameLevelManager::storeCommentsResult from 0x14015d7b0 to 0x14015d9ac (508 bytes)
//
// 5 xrefs:
// > GameLevelManager::onGetUserMessagesCompleted @ 0x14015a9f8
// > GameLevelManager::onGetLevelCommentsCompleted @ 0x14015c784
// > GameLevelManager::onGetAccountCommentsCompleted @ 0x14015cef4
// > GameLevelManager::onGetFriendRequestsCompleted @ 0x140160511
// > ??> @ 0x1406caab8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=4
void __fastcall GameLevelManager::storeCommentsResult(GameLevelManager *a1, __int64 a2, _QWORD *a3, const char *a4)
{
size_t v8; // rbx
size_t v9; // r8
void *v10; // rcx
size_t v11; // r8
_BYTE *v12; // rdx
__int64 v13; // rax
void *v14; // rcx
void *v15; // rcx
void *Block[2]; // [rsp+28h] [rbp-70h] BYREF
__m128i si128; // [rsp+38h] [rbp-60h]
void *v18[2]; // [rsp+48h] [rbp-50h] BYREF
__int128 v19; // [rsp+58h] [rbp-40h]
GameLevelManager::makeTimeStamp(a1, a4);
*(_OWORD *)Block = 0;
si128 = 0;
v8 = -1;
v9 = -1;
do
++v9;
while ( a4[v9] );
sub_14003A930(Block, a4, v9);
cocos2d::CCDictionary::setObject(a1->m_storedLevels, a2, Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v10 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v10 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v10 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v10);
}
*(_OWORD *)v18 = 0;
v19 = 0;
v11 = -1;
do
++v11;
while ( a4[v11] );
sub_14003A930(v18, a4, v11);
v12 = a3;
if ( a3[3] > 0xFu )
v12 = (_BYTE *)*a3;
*(_OWORD *)Block = 0;
si128 = 0;
do
++v8;
while ( v12[v8] );
sub_14003A930(Block, v12, v8);
v13 = cocos2d::CCString::create(Block);
cocos2d::CCDictionary::setObject(a1->m_pageInfo, v13, v18);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v14 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v14 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v14 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v14);
}
si128 = _mm_load_si128((const __m128i *)&xmmword_140623F30);
LOBYTE(Block[0]) = 0;
if ( *((_QWORD *)&v19 + 1) > 0xFu )
{
v15 = v18[0];
if ( (unsigned __int64)(*((_QWORD *)&v19 + 1) + 1LL) >= 0x1000 )
{
v15 = *((void **)v18[0] - 1);
if ( (unsigned __int64)((char *)v18[0] - (char *)v15 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v15);
}
sub_14003A830((__int64)a3);
}