//
// GameLevelManager::markLevelAsReported from 0x10055a5a0 to 0x10055a6d6 (310 bytes)
//
// 1 xrefs:
// > GameLevelManager::reportLevel @ 0x10055a20a
//
// 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
//
void __fastcall GameLevelManager::markLevelAsReported(GameLevelManager *a1, int a2)
{
double v2; // xmm0_8
cocos2d::CCDictionary *m_reportedLevels; // rbx
cocos2d::CCString *m_trueString; // r14
cocos2d::CCString *v5; // rax
const char *CString; // r12
size_t v7; // rax
std::string::size_type v8; // r15
char *data; // r13
cocos2d::CCDictionary *v10; // r14
size_t v11; // rbx
char v12; // [rsp+0h] [rbp-50h]
cocos2d::CCString *v13; // [rsp+8h] [rbp-48h]
std::string __dst[2]; // [rsp+10h] [rbp-40h] BYREF
if ( cocos2d::CCDictionary::count(a1->m_reportedLevels) >= 0xA )
{
cocos2d::CCDictionary::getFirstKey(__dst, (__int64)a1->m_reportedLevels);
cocos2d::CCDictionary::removeObjectForKey_1((__int64)a1->m_reportedLevels, (char *)__dst);
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst[0].__r_.__value_.__l.__data_);
}
m_reportedLevels = a1->m_reportedLevels;
m_trueString = a1->m_trueString;
v5 = (cocos2d::CCString *)sub_1007AB580("%i", v12);
CString = cocos2d::CCString::getCString(v5);
v7 = strlen(CString);
if ( v7 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v2);
v8 = v7;
if ( v7 >= 0x17 )
{
v13 = m_trueString;
v10 = m_reportedLevels;
v11 = 26;
if ( (v7 | 7) != 0x17 )
v11 = (v7 | 7) + 1;
data = (char *)operator new(v11);
__dst[0].__r_.__value_.__r.__words[2] = (std::string::size_type)data;
__dst[0].__r_.__value_.__r.__words[0] = v11 + 1;
m_reportedLevels = v10;
m_trueString = v13;
__dst[0].__r_.__value_.__l.__size_ = v8;
goto LABEL_11;
}
__dst[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v7);
data = __dst[0].__r_.__value_.__s.__data_;
if ( v7 )
LABEL_11:
memmove(data, CString, v8);
data[v8] = 0;
cocos2d::CCDictionary::setObject_1((__int64)m_reportedLevels, m_trueString, (char *)__dst);
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst[0].__r_.__value_.__l.__data_);
}