//
// SecretNumberLayer::playNumberEffect from 0x10049a2b0 to 0x10049a823 (1395 bytes)
//
// 1 xrefs:
// > SecretLayer2::onSubmit @ 0x1004984ff
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:30:50 +0000
//
void __fastcall SecretNumberLayer::playNumberEffect(__int64 a1)
{
__int64 v1; // rax
__int64 v2; // rax
const char *CString; // r14
size_t v4; // rax
size_t v5; // rbx
char *v6; // r15
size_t v7; // r12
int v8; // eax
__int64 v9; // rax
__int64 v10; // rax
__int64 v11; // r14
_OWORD *v12; // r13
_OWORD *v13; // rbx
_OWORD *v14; // rax
_OWORD *v15; // rbx
_OWORD *v16; // r15
_OWORD *v17; // r12
__int64 v18; // rax
__int64 v19; // rax
unsigned int v20; // ecx
unsigned int v21; // eax
unsigned __int64 v22; // rdx
char *v23; // rsi
size_t v24; // rbx
int v25; // eax
__int64 v26; // rax
__int64 v27; // rax
__int64 v28; // r14
__int64 v29; // r13
__m128 v30; // xmm0
_OWORD *v31; // r15
_OWORD *v32; // rbx
_OWORD *v33; // rax
__int64 v34; // rbx
_OWORD *v35; // r15
_OWORD *v36; // r12
__int64 v37; // rax
__int64 v38; // rbx
__int64 v39; // rax
char v40; // [rsp+0h] [rbp-C0h]
char v41; // [rsp+0h] [rbp-C0h]
unsigned int v42; // [rsp+8h] [rbp-B8h]
_OWORD *v43; // [rsp+10h] [rbp-B0h]
unsigned __int64 v44; // [rsp+18h] [rbp-A8h]
char *__p; // [rsp+20h] [rbp-A0h]
char v46[24]; // [rsp+28h] [rbp-98h] BYREF
size_t __dst; // [rsp+40h] [rbp-80h] BYREF
size_t v48; // [rsp+48h] [rbp-78h]
char *v49; // [rsp+50h] [rbp-70h]
unsigned int v50; // [rsp+5Ch] [rbp-64h]
__int64 v51; // [rsp+60h] [rbp-60h]
unsigned __int64 v52; // [rsp+68h] [rbp-58h]
__int64 v53; // [rsp+74h] [rbp-4Ch] BYREF
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]
v51 = a1;
v1 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v53, v1);
v2 = sub_10088E820("%i", v40);
CString = (const char *)cocos2d::CCString::getCString(v2);
v4 = strlen(CString);
if ( v4 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v5 = v4;
if ( v4 >= 0x17 )
{
v7 = 26;
if ( (v4 | 7) != 0x17 )
v7 = (v4 | 7) + 1;
v6 = (char *)operator new(v7);
v49 = v6;
__dst = v7 + 1;
v48 = 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();
v52 = (unsigned __int8)__dst;
v60 = __dst & 1;
v44 = v48;
__p = v49;
v54 = (int)(float)((float)((float)v8 * 4.6566129e-10) * 100.0);
v9 = sub_10088E820("%i", v41);
v10 = cocos2d::CCString::getCString(v9);
v11 = cocos2d::CCLabelBMFont::create_3(v10, "bigFont.fnt");
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v51 + 456LL))(v51, v11);
sub_100278250((float *)v46, *(float *)&v53 * 0.5, (float)(*((float *)&v53 + 1) * 0.5) + 94.0);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v11 + 184LL))(v11, v46);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v11 + 344LL))(v11, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v11 + 1024LL))(v11, 0);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v11 + 160LL))(v11, 3.0);
v57 = cocos2d::CCShow::create(v11);
v12 = cocos2d::CCDelayTime::create((__m128)0LL);
v13 = cocos2d::CCFadeIn::create((__m128)0x3DCCCCCDu);
v14 = cocos2d::CCScaleTo::create_1((__m128)0x3E4CCCCDu, 1.0);
v15 = cocos2d::CCSpawn::createWithTwoActions((__int64)v13, (__int64)v14);
v16 = cocos2d::CCDelayTime::create((__m128)0x3E4CCCCDu);
v17 = cocos2d::CCFadeOut::create((__m128)0x3E800000u);
v18 = cocos2d::CCCallFunc::create(v11, 537, 0);
v19 = sub_10039EB60((__int64)v12, v57, v15, v16, v17, v18);
cocos2d::CCNode::runAction(v11, v19);
v52 = (unsigned int)v52 >> 1;
v57 = 4294967291LL;
v20 = 0;
v55 = 0;
v56 = 0;
do
{
v21 = 2;
v50 = 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 = v44;
v23 = __p;
if ( v44 < v56 )
LABEL_27:
sub_100056810();
}
else
{
v22 = v52;
v23 = (char *)&__dst + 1;
if ( (unsigned int)v52 < v56 )
goto LABEL_27;
}
v24 = v22 - v56;
v42 = v21;
if ( v24 >= v21 )
v24 = v21;
v46[0] = 2 * v24;
if ( v22 != v56 )
memcpy(&v46[1], &v23[v56], v24);
v46[v24 + 1] = 0;
v25 = atoi(&v46[1]);
v54 += v25;
v26 = sub_10088E820("%i", 0);
v27 = cocos2d::CCString::getCString(v26);
v28 = cocos2d::CCLabelBMFont::create_3(v27, "bigFont.fnt");
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v51 + 456LL))(v51, v28);
sub_100278250((float *)v46, *(float *)&v53 * 0.5, (float)(*((float *)&v53 + 1) * 0.5) + 94.0);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v28 + 184LL))(v28, v46);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v28 + 344LL))(v28, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v28 + 1024LL))(v28, 0);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v28 + 160LL))(v28, 3.0);
v29 = cocos2d::CCShow::create(v28);
v30 = 0;
v30.f32[0] = (float)(v57 + 6) * 0.55000001;
v31 = cocos2d::CCDelayTime::create(v30);
v32 = cocos2d::CCFadeIn::create((__m128)0x3DCCCCCDu);
v33 = cocos2d::CCScaleTo::create_1((__m128)0x3E4CCCCDu, 1.0);
v43 = cocos2d::CCSpawn::createWithTwoActions((__int64)v32, (__int64)v33);
v34 = (__int64)v31;
v35 = cocos2d::CCDelayTime::create((__m128)0x3E4CCCCDu);
v36 = cocos2d::CCFadeOut::create((__m128)*((unsigned int *)&unk_100A0B9F8 + ((_DWORD)v57 == -1)));
v37 = cocos2d::CCCallFunc::create(v28, 537, 0);
v38 = sub_10039EB60(v34, v29, v43, v35, v36, v37);
if ( (_DWORD)v57 == -1 )
{
v39 = cocos2d::CCCallFunc::create(v51, 537, 0);
v38 = sub_10039EB60(v38, v39, 0);
v46[2] = -1;
*(_WORD *)v46 = -106;
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v28 + 1072LL))(v28, v46);
}
cocos2d::CCNode::runAction(v28, v38);
v55 += v59;
v20 = v58 + v50;
v56 += v42;
v57 = (unsigned int)(v57 + 1);
}
while ( (_DWORD)v57 );
if ( v60 )
operator delete(__p);
}