//
// InfoLayer::onSimilar from 0x7e2cd8 to 0x7e2e24 (332 bytes)
//
// 1 xrefs:
// > ??> @ 0x922e0
//
// 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 InfoLayer::onSimilar(InfoLayer *a1, cocos2d::CCObject *a2)
{
cocos2d::CCDirector *v3; // x22
cocos2d::CCString *v4; // x0
char *CString; // x0
GJSearchObject *v6; // x0
cocos2d::CCScene *v7; // x0
cocos2d::CCTransitionFade *v8; // x0
void *v9; // x0
unsigned int *v10; // x2
int v11; // w1
__int64 v12; // [xsp+40h] [xbp+40h] BYREF
v3 = cocos2d::CCDirector::sharedDirector();
v4 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)(a1->m_level->m_levelID.random - a1->m_level->m_levelID.seed));
CString = (char *)cocos2d::CCString::getCString(v4);
sub_D153B8((int)&v12, CString);
v6 = GJSearchObject::create(Similar);
v7 = LevelBrowserLayer::scene(v6);
v8 = cocos2d::CCTransitionFade::create(0.5, v7);
cocos2d::CCDirector::replaceScene(v3, v8);
v9 = (void *)(v12 - 24);
if ( (__int64 *)(v12 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v10 = (unsigned int *)(v12 - 8);
do
v11 = __ldaxr(v10);
while ( __stlxr(v11 - 1, v10) );
}
else
{
v11 = *(_DWORD *)(v12 - 8);
*(_DWORD *)(v12 - 8) = v11 - 1;
}
if ( v11 <= 0 )
operator delete(v9);
}
a1->m_buttonMenu->setEnabled(a1->m_buttonMenu, 0);
}