//
// TextArea::fadeInCharacters from 0x100322800 to 0x100322bff (1023 bytes)
//
// 3 xrefs:
// > DialogLayer::displayDialogObject @ 0x1003c7c0c
// > SecretLayer5::fadeInMessage @ 0x10047c29a
// > SecretLayer5::fadeOutMessage @ 0x10047c313
//
// 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
//
float __fastcall TextArea::fadeInCharacters(TextArea *a1, float a2, float a3, bool a4, TextFadeInStyle a5)
{
bool v5; // r14
TextArea *v6; // rbx
cocos2d::CCDictionary *m_shakeCharacters; // rdi
cocos2d::CCDictionary *v8; // rax
__int64 v9; // rax
__int64 v10; // r12
int v11; // r15d
__int64 v12; // rdi
__int64 v13; // rax
unsigned int *v14; // rcx
__int64 *v15; // rbx
__int64 v16; // r13
__int64 *v17; // rbx
float v18; // xmm0_4
unsigned int v19; // eax
unsigned int v20; // r12d
unsigned int v21; // eax
int v22; // ecx
int v23; // r8d
int v24; // r9d
cocos2d::CCAction *v25; // rsi
float v26; // xmm0_4
float v27; // xmm1_4
cocos2d::CCScaleTo *v28; // r12
unsigned int v29; // r14d
unsigned int v30; // eax
int v31; // ecx
int v32; // r8d
int v33; // r9d
cocos2d::CCAction *v34; // rsi
int v35; // r12d
double *v36; // rax
cocos2d::CCDictionary *v37; // rdi
intptr_t v38; // rsi
cocos2d::CCObject *v39; // rax
cocos2d::CCObject *v40; // r14
float v41; // xmm1_4
unsigned int v42; // r14d
unsigned int v43; // eax
unsigned int v44; // edi
int v45; // ecx
int v46; // r8d
int v47; // r9d
cocos2d::CCAction *v48; // rsi
unsigned __int64 v50; // [rsp+8h] [rbp-88h]
__int64 v51; // [rsp+10h] [rbp-80h]
int *v52; // [rsp+18h] [rbp-78h]
__int64 v53; // [rsp+20h] [rbp-70h]
__int64 v54; // [rsp+28h] [rbp-68h]
char v55; // [rsp+30h] [rbp-60h]
TextArea *v58; // [rsp+48h] [rbp-48h]
float v61; // [rsp+5Ch] [rbp-34h]
float v62; // [rsp+60h] [rbp-30h]
float v63; // [rsp+64h] [rbp-2Ch]
v5 = a4;
v6 = a1;
m_shakeCharacters = a1->m_shakeCharacters;
if ( m_shakeCharacters )
{
cocos2d::CCObject::release(m_shakeCharacters);
v6->m_shakeCharacters = nullptr;
}
v8 = cocos2d::CCDictionary::create();
v6->m_shakeCharacters = v8;
cocos2d::CCObject::retain(v8);
v52 = *(int **)(((__int64 (__fastcall *)(MultilineBitmapFont *))v6->m_label->getChildren)(v6->m_label) + 56);
v9 = *v52;
if ( v9 <= 0 )
{
cocos2d::CCNode::unscheduleUpdate(v6);
v61 = 0.0;
goto LABEL_39;
}
v58 = v6;
v54 = (unsigned int)(v9 - 1);
v55 = 0;
v61 = 0.0;
v10 = 0;
v63 = 0.0;
v11 = 0;
v53 = *v52;
while ( 2 )
{
v12 = *(_QWORD *)(*((_QWORD *)v52 + 2) + 8 * v10);
v13 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v12 + 472LL))(v12);
v51 = v10;
if ( !v13 || (v14 = *(unsigned int **)(v13 + 56), !*v14) )
{
v41 = 0.0;
if ( v10 == v54 )
goto LABEL_31;
goto LABEL_5;
}
v15 = *((__int64 **)v14 + 2);
v16 = *v15;
if ( !*v15 )
{
v41 = 0.0;
if ( v10 == v54 )
goto LABEL_31;
goto LABEL_5;
}
v50 = (unsigned __int64)&v15[*v14 - 1];
v17 = v15 + 1;
while ( 1 )
{
if ( v5 )
{
v18 = a2;
if ( *(_BYTE *)(v16 + 604) == 1 )
goto LABEL_12;
}
else
{
cocos2d::CCNode::stopAllActions((cocos2d::CCNode *)v16);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v16 + 896LL))(v16, 0);
v63 = v63 + *(float *)(v16 + 612);
v18 = a2;
if ( *(_BYTE *)(v16 + 604) == 1 )
{
LABEL_12:
v18 = *(float *)(v16 + 608);
v62 = v18;
if ( !v5 )
goto LABEL_13;
goto LABEL_16;
}
}
v62 = v18;
if ( !v5 )
{
LABEL_13:
v19 = (unsigned int)cocos2d::CCFadeIn::create(v18);
goto LABEL_17;
}
LABEL_16:
v19 = (unsigned int)cocos2d::CCFadeOut::create(v18);
LABEL_17:
v20 = v19;
v21 = (unsigned int)cocos2d::CCDelayTime::create((float)((float)v11 * a3) + v63);
v25 = (cocos2d::CCAction *)sub_1003B5760(v21, v20, 0, v22, v23, v24);
cocos2d::CCNode::runAction((cocos2d::CCNode *)v16, v25);
if ( a5 == Scale )
{
if ( v5 )
{
v26 = v62;
v27 = 1.4;
}
else
{
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v16 + 160LL))(v16, 1.4);
v26 = v62 * 0.5;
v27 = 1.0;
}
v28 = cocos2d::CCScaleTo::create_1(v26, v27);
v29 = (unsigned int)cocos2d::CCDelayTime::create((float)((float)v11 * a3) + v63);
v30 = (unsigned int)cocos2d::CCEaseInOut::create(v28, 2.0);
v34 = (cocos2d::CCAction *)sub_1003B5760(v29, v30, 0, v31, v32, v33);
cocos2d::CCNode::runAction((cocos2d::CCNode *)v16, v34);
v5 = a4;
}
v35 = *(unsigned __int8 *)(v16 + 604);
if ( *(int *)(v16 + 628) > 0 )
{
v36 = (double *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v16 + 192LL))(v16);
sub_10028CC90((_QWORD *)(v16 + 632), v36);
v37 = v58->m_shakeCharacters;
v38 = *(int *)(v16 + 628);
v39 = cocos2d::CCDictionary::objectForKey(v37, v38);
if ( !v39 )
{
v40 = (cocos2d::CCObject *)sub_10071F9E0(v37, v38);
cocos2d::CCDictionary::setObject(v58->m_shakeCharacters, v40, *(int *)(v16 + 628));
v39 = v40;
v5 = a4;
}
sub_10071FCD0(v39, v16);
v55 = 1;
}
v11 += v35 ^ 1;
if ( (unsigned __int64)v17 > v50 )
break;
v16 = *v17++;
v41 = v62;
if ( !v16 )
{
v10 = v51;
if ( v51 != v54 )
goto LABEL_5;
goto LABEL_31;
}
}
v41 = v62;
v10 = v51;
if ( v51 != v54 )
goto LABEL_5;
LABEL_31:
v61 = (float)((float)((float)v11 * a3) + v41) + v63;
v42 = (unsigned int)cocos2d::CCDelayTime::create(v61);
v43 = (unsigned int)cocos2d::CCCallFunc::create(v58, (cocos2d::SEL_CallFunc)(unsigned __int64)TextArea::finishFade);
v44 = v42;
v5 = a4;
v48 = (cocos2d::CCAction *)sub_1003B5760(v44, v43, 0, v45, v46, v47);
cocos2d::CCNode::runAction(v58, v48);
LABEL_5:
if ( ++v10 != v53 )
continue;
break;
}
v6 = v58;
cocos2d::CCNode::unscheduleUpdate(v58);
if ( (v55 & 1) == 0 )
{
LABEL_39:
cocos2d::CCNode::unscheduleUpdate(v6);
return v61;
}
cocos2d::CCNode::scheduleUpdate(v58);
return v61;
}