//
// GameLevelManager::levelIDFromPostCommentKey from 0x6f8740 to 0x6f8858 (280 bytes)
//
// 2 xrefs:
// > GameLevelManager::onUploadCommentCompleted @ 0x6f9118
// > ??> @ 0x63600
//
// 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
//
int GameLevelManager::levelIDFromPostCommentKey(GameLevelManager *a1, const char *a2)
{
cocos2d::CCArray *v2; // x20
void *v3; // x0
cocos2d::CCString *v4; // x0
const char *CString; // x0
unsigned int *v7; // x2
int v8; // w1
__int64 v9; // [xsp+30h] [xbp+30h] BYREF
sub_D153B8((int)&v9, (char *)a2);
v2 = sub_6F004C(&v9, "_");
v3 = (void *)(v9 - 24);
if ( (__int64 *)(v9 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v7 = (unsigned int *)(v9 - 8);
do
v8 = __ldaxr(v7);
while ( __stlxr(v8 - 1, v7) );
}
else
{
v8 = *(_DWORD *)(v9 - 8);
*(_DWORD *)(v9 - 8) = v8 - 1;
}
if ( v8 <= 0 )
operator delete(v3);
}
if ( (unsigned int)cocos2d::CCArray::count(v2) <= 1 )
return 0;
v4 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v2, 1u);
CString = cocos2d::CCString::getCString(v4);
return atoi(CString);
}