//
// GameLevelManager::levelIDFromCommentKey from 0x14015d6a0 to 0x14015d7a2 (258 bytes)
//
// 4 xrefs:
// > GameLevelManager::onGetLevelCommentsCompleted @ 0x14015c385
// > GameLevelManager::onGetAccountCommentsCompleted @ 0x14015caf5
// > GameLevelManager::onDeleteCommentCompleted @ 0x14015f6f4
// > ??> @ 0x1406caaac
//
// 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=1
int GameLevelManager::levelIDFromCommentKey(GameLevelManager *a1, const char *a2)
{
size_t v2; // r8
cocos2d::CCArray *v3; // rbx
void *v4; // rcx
cocos2d::CCString *v5; // rax
const char *CString; // rax
void *Block[2]; // [rsp+20h] [rbp-38h] BYREF
__m128i si128; // [rsp+30h] [rbp-28h]
*(_OWORD *)Block = 0;
si128 = 0;
v2 = -1;
do
++v2;
while ( a2[v2] );
sub_14003A930(Block, a2, v2);
v3 = sub_140140F70((__int64 *)Block, "_");
if ( si128.m128i_i64[1] > 0xFuLL )
{
v4 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v4 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v4 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v4);
}
si128 = _mm_load_si128((const __m128i *)&xmmword_140623F30);
LOBYTE(Block[0]) = 0;
if ( cocos2d::CCArray::count(v3) < 3 )
return 0;
v5 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v3, 1u);
CString = cocos2d::CCString::getCString(v5);
return atoi(CString);
}