//
// SecretNumberLayer::playNumberEffect from 0x9415cc to 0x9419f8 (1068 bytes)
//
// 2 xrefs:
// > SecretLayer2::onSubmit @ 0x944678
// > ??> @ 0x985c8
//
// 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
//
// local variable allocation has failed, the output may be wrong!
void SecretNumberLayer::playNumberEffect(SecretNumberLayer *a1, int a2)
{
int v3; // w20
cocos2d::CCDirector *v4; // x0
int v5; // w27
int v6; // w25
cocos2d::CCString *v7; // x0
char *CString; // x0
unsigned int v9; // w28
cocos2d::CCString *v10; // x0
cocos2d::CCLabelBMFont *v11; // x19
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x24
cocos2d::CCScaleTo *v13; // x24
cocos2d::CCFiniteTimeAction *v14; // x0
float v15; // s0
cocos2d::CCFadeOut *v16; // x24
__int64 v17; // x0
cocos2d::CCSequence *v18; // x24
__int64 v19; // x3
int v20; // w19
cocos2d::CCPoint v21; // x24
void *v22; // x1
unsigned int *v23; // x24
int v24; // w0
void *v25; // x19
unsigned int *v26; // x24
int v27; // w0
cocos2d::CCFiniteTimeAction *v28; // x0
void (__fastcall *setColor)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // x3
double v30; // d0
double v31; // d1
cocos2d::CCDelayTime *v32; // [xsp+98h] [xbp+98h]
cocos2d::CCSpawn *v33; // [xsp+A0h] [xbp+A0h]
cocos2d::CCSequence *v34; // [xsp+A8h] [xbp+A8h]
cocos2d::CCFiniteTimeAction *v35; // [xsp+B0h] [xbp+B0h]
cocos2d::CCShow *v36; // [xsp+B0h] [xbp+B0h]
int v37; // [xsp+BCh] [xbp+BCh]
float v38; // [xsp+D0h] [xbp+D0h]
float v39; // [xsp+D4h] [xbp+D4h]
__int64 v40; // [xsp+D8h] [xbp+D8h] BYREF
const char *v41; // [xsp+E0h] [xbp+E0h] BYREF
cocos2d::CCSize WinSize; // 0:kr00_8.8
v35 = *(cocos2d::CCFiniteTimeAction **)&a2;
v37 = 0;
v3 = 0;
v4 = cocos2d::CCDirector::sharedDirector();
v5 = 0;
v6 = 0;
WinSize = cocos2d::CCDirector::getWinSize(v4);
*(float *)&v30 = WinSize.width;
*(float *)&v31 = WinSize.height;
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", (const char *)v35, v30, v31);
CString = (char *)cocos2d::CCString::getCString(v7);
sub_D153B8((int)&v40, CString);
v9 = (int)(float)((float)((float)rand() * 4.6566e-10) * 100.0);
while ( 1 )
{
v10 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", (const char *)v9);
cocos2d::CCString::getCString(v10);
v11 = cocos2d::CCLabelBMFont::create();
a1->addChild(a1, v11);
setPosition = v11->setPosition;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v41, v38 * 0.5, (float)(v39 * 0.5) + 94.0);
setPosition(v11, (const cocos2d::CCPoint *)&v41);
v11->setVisible(v11, 0);
v11->setOpacity(v11, 0);
v11->setScale(v11, 3.0);
v36 = cocos2d::CCShow::create();
v34 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create((float)v3 * 0.55);
v13 = (cocos2d::CCScaleTo *)cocos2d::CCFadeIn::create(0.1);
v14 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCScaleTo::create(v13, 0.2, 1.0);
v33 = cocos2d::CCSpawn::createWithTwoActions(v13, v14);
v32 = cocos2d::CCDelayTime::create(0.2);
if ( v3 == 5 )
v15 = 0.5;
else
v15 = 0.25;
v16 = cocos2d::CCFadeOut::create(v15);
v17 = cocos2d::CCCallFunc::create(v11, 520, 1);
v18 = (cocos2d::CCSequence *)cocos2d::CCSequence::create(v34, v36, v33, v32, v16, v17, 0);
if ( v3 == 5 )
{
v28 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(a1, 520, 1);
v18 = (cocos2d::CCSequence *)cocos2d::CCSequence::create(v18, v28, 0);
setColor = v11->setColor;
LOWORD(v41) = -106;
BYTE2(v41) = -1;
setColor(v11, (const cocos2d::ccColor3B *)&v41);
}
cocos2d::CCNode::runAction(v11, v18);
if ( ++v3 == 6 )
break;
if ( v37 <= 2 && (v6 > 1 || (float)((float)rand() * 4.6566e-10) > 0.5) )
{
v19 = 1;
v20 = 1;
++v37;
}
else
{
v19 = 2;
++v6;
v20 = 2;
}
if ( (unsigned __int64)v5 > *(_QWORD *)(v40 - 24) )
sub_D13C5C(
"%s: __pos (which is %zu) > this->size() (which is %zu)",
"basic_string::substr",
v5,
*(_QWORD *)(v40 - 24));
sub_D14F84(&v41, &v40, v5, v19);
v21 = (cocos2d::CCPoint)v41;
v5 += v20;
v9 += atoi(v41);
v22 = (void *)(*(_QWORD *)&v21 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v21 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v23 = (unsigned int *)(*(_QWORD *)&v21 - 8LL);
do
v24 = __ldaxr(v23);
while ( __stlxr(v24 - 1, v23) );
}
else
{
v24 = *(_DWORD *)(*(_QWORD *)&v21 - 8LL);
*(_DWORD *)(*(_QWORD *)&v21 - 8LL) = v24 - 1;
}
if ( v24 <= 0 )
operator delete(v22);
}
}
v25 = (void *)(v40 - 24);
if ( (__int64 *)(v40 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v26 = (unsigned int *)(v40 - 8);
do
v27 = __ldaxr(v26);
while ( __stlxr(v27 - 1, v26) );
}
else
{
v27 = *(_DWORD *)(v40 - 8);
*(_DWORD *)(v40 - 8) = v27 - 1;
}
if ( v27 <= 0 )
operator delete(v25);
}
}