//
// SecretNumberLayer::playNumberEffect from 0x1004a12e0 to 0x1004a1853 (1395 bytes)
//
// 1 xrefs:
// > SecretLayer2::onSubmit @ 0x10049f52f
//
// 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 SecretNumberLayer::playNumberEffect(SecretNumberLayer *a1, int a2)
{
cocos2d::CCString *v2; // rax
const char *CString; // r14
size_t v4; // rax
size_t v5; // rbx
char *v6; // r15
size_t v7; // r12
int v8; // eax
cocos2d::CCString *v9; // rax
const char *v10; // rax
cocos2d::CCLabelBMFont *v11; // r14
cocos2d::CCDelayTime *v12; // r13
cocos2d::CCFadeIn *v13; // rbx
cocos2d::CCScaleTo *v14; // rax
cocos2d::CCSpawn *v15; // rbx
cocos2d::CCDelayTime *v16; // r15
cocos2d::CCFadeOut *v17; // r12
cocos2d::CCCallFunc *v18; // rax
cocos2d::CCSequence *v19; // rax
unsigned int v20; // ecx
unsigned int v21; // eax
unsigned __int64 v22; // rdx
char *v23; // rsi
size_t v24; // rbx
int v25; // eax
cocos2d::CCString *v26; // rax
const char *v27; // rax
cocos2d::CCLabelBMFont *v28; // r14
cocos2d::CCShow *v29; // r13
cocos2d::CCDelayTime *v30; // r15
cocos2d::CCFadeIn *v31; // rbx
cocos2d::CCScaleTo *v32; // rax
cocos2d::CCFiniteTimeAction *v33; // rbx
cocos2d::CCDelayTime *v34; // r15
cocos2d::CCFadeOut *v35; // r12
cocos2d::CCCallFunc *v36; // rax
cocos2d::CCSequence *v37; // rbx
cocos2d::CCCallFunc *v38; // rax
char v39; // [rsp+0h] [rbp-C0h]
char v40; // [rsp+0h] [rbp-C0h]
unsigned int v41; // [rsp+8h] [rbp-B8h]
cocos2d::CCSpawn *v42; // [rsp+10h] [rbp-B0h]
unsigned __int64 v43; // [rsp+18h] [rbp-A8h]
char *__p; // [rsp+20h] [rbp-A0h]
char v45[24]; // [rsp+28h] [rbp-98h] BYREF
size_t __dst; // [rsp+40h] [rbp-80h] BYREF
size_t v47; // [rsp+48h] [rbp-78h]
char *v48; // [rsp+50h] [rbp-70h]
unsigned int v49; // [rsp+5Ch] [rbp-64h]
SecretNumberLayer *v50; // [rsp+60h] [rbp-60h]
unsigned __int64 v51; // [rsp+68h] [rbp-58h]
float v52; // [rsp+74h] [rbp-4Ch] BYREF
float v53; // [rsp+78h] [rbp-48h]
int v54; // [rsp+7Ch] [rbp-44h]
unsigned int v55; // [rsp+80h] [rbp-40h]
unsigned int v56; // [rsp+84h] [rbp-3Ch]
__int64 v57; // [rsp+88h] [rbp-38h]
bool v58; // [rsp+95h] [rbp-2Bh]
bool v59; // [rsp+96h] [rbp-2Ah]
char v60; // [rsp+97h] [rbp-29h]
double v61; // 0:xmm0_8.8
v50 = a1;
cocos2d::CCDirector::sharedDirector();
*(cocos2d::CCSize *)&v61 = cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v52);
v2 = (cocos2d::CCString *)sub_1007AB580("%i", v39);
CString = cocos2d::CCString::getCString(v2);
v4 = strlen(CString);
if ( v4 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v61);
v5 = v4;
if ( v4 >= 0x17 )
{
v7 = 26;
if ( (v4 | 7) != 0x17 )
v7 = (v4 | 7) + 1;
v6 = (char *)operator new(v7);
v48 = v6;
__dst = v7 + 1;
v47 = v5;
}
else
{
LOBYTE(__dst) = 2 * v4;
v6 = (char *)&__dst + 1;
if ( !v4 )
goto LABEL_9;
}
memmove(v6, CString, v5);
LABEL_9:
v6[v5] = 0;
v8 = rand();
v51 = (unsigned __int8)__dst;
v60 = __dst & 1;
v43 = v47;
__p = v48;
v54 = (int)(float)((float)((float)v8 * 4.6566129e-10) * 100.0);
v9 = (cocos2d::CCString *)sub_1007AB580("%i", v40);
v10 = cocos2d::CCString::getCString(v9);
v11 = cocos2d::CCLabelBMFont::create_3(v10, "bigFont.fnt");
((void (__fastcall *)(SecretNumberLayer *, cocos2d::CCLabelBMFont *))v50->addChild)(v50, v11);
sub_10028CBE0((float *)v45, v52 * 0.5, (float)(v53 * 0.5) + 94.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, char *))v11->setPosition)(v11, v45);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD))v11->setVisible)(v11, 0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD))v11->setOpacity)(v11, 0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v11->setScale)(v11, 3.0);
v57 = (__int64)cocos2d::CCShow::create();
v12 = cocos2d::CCDelayTime::create(0.0);
v13 = cocos2d::CCFadeIn::create(0.1);
v14 = cocos2d::CCScaleTo::create_1(0.2, 1.0);
v15 = cocos2d::CCSpawn::createWithTwoActions(v13, v14);
v16 = cocos2d::CCDelayTime::create(0.2);
v17 = cocos2d::CCFadeOut::create(0.25);
v18 = cocos2d::CCCallFunc::create(v11, (cocos2d::SEL_CallFunc)0x209uLL);
v19 = sub_1003B5760(v12, v57, v15, v16, v17, v18);
cocos2d::CCNode::runAction(v11, v19);
v51 = (unsigned int)v51 >> 1;
v57 = 4294967291LL;
v20 = 0;
v55 = 0;
v56 = 0;
do
{
v21 = 2;
v49 = v20;
if ( v20 <= 2 )
{
v21 = 1;
if ( v55 <= 1 )
v21 = ((float)((float)rand() * 4.6566129e-10) <= 0.5) + 1;
}
v58 = v21 == 1;
v59 = v21 != 1;
if ( v60 )
{
v22 = v43;
v23 = __p;
if ( v43 < v56 )
LABEL_27:
sub_1000547C0();
}
else
{
v22 = v51;
v23 = (char *)&__dst + 1;
if ( (unsigned int)v51 < v56 )
goto LABEL_27;
}
v24 = v22 - v56;
v41 = v21;
if ( v24 >= v21 )
v24 = v21;
v45[0] = 2 * v24;
if ( v22 != v56 )
memcpy(&v45[1], &v23[v56], v24);
v45[v24 + 1] = 0;
v25 = atoi(&v45[1]);
v54 += v25;
v26 = (cocos2d::CCString *)sub_1007AB580("%i", 0);
v27 = cocos2d::CCString::getCString(v26);
v28 = cocos2d::CCLabelBMFont::create_3(v27, "bigFont.fnt");
((void (__fastcall *)(SecretNumberLayer *, cocos2d::CCLabelBMFont *))v50->addChild)(v50, v28);
sub_10028CBE0((float *)v45, v52 * 0.5, (float)(v53 * 0.5) + 94.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, char *))v28->setPosition)(v28, v45);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD))v28->setVisible)(v28, 0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD))v28->setOpacity)(v28, 0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v28->setScale)(v28, 3.0);
v29 = cocos2d::CCShow::create();
v30 = cocos2d::CCDelayTime::create((float)(v57 + 6) * 0.55000001);
v31 = cocos2d::CCFadeIn::create(0.1);
v32 = cocos2d::CCScaleTo::create_1(0.2, 1.0);
v42 = cocos2d::CCSpawn::createWithTwoActions(v31, v32);
v33 = v30;
v34 = cocos2d::CCDelayTime::create(0.2);
v35 = cocos2d::CCFadeOut::create(flt_10081D3B0[(_DWORD)v57 == -1]);
v36 = cocos2d::CCCallFunc::create(v28, (cocos2d::SEL_CallFunc)0x209uLL);
v37 = sub_1003B5760(v33, v29, v42, v34, v35, v36);
if ( (_DWORD)v57 == -1 )
{
v38 = cocos2d::CCCallFunc::create(v50, (cocos2d::SEL_CallFunc)0x209uLL);
v37 = sub_1003B5760(v37, v38, 0);
v45[2] = -1;
*(_WORD *)v45 = -106;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, char *))v28->setColor)(v28, v45);
}
cocos2d::CCNode::runAction(v28, v37);
v55 += v59;
v20 = v58 + v49;
v56 += v41;
v57 = (unsigned int)(v57 + 1);
}
while ( (_DWORD)v57 );
if ( v60 )
operator delete(__p);
}