//
// CCTextInputNode::updateBlinkLabelToChar from 0x6c0eb8 to 0x6c14c0 (1544 bytes)
//
// 2 xrefs:
// > CCTextInputNode::updateBlinkLabel @ 0x6c14c8
// > ??> @ 0xe1760
//
// This function is hookable on this platform (idp: arm, 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:51:19 +0000
//
__int64 __fastcall CCTextInputNode::updateBlinkLabelToChar(CCTextInputNode *this, int a2)
{
_BOOL4 v4; // w26
cocos2d::CCLabelBMFont *Object; // x19
float v6; // s10
cocos2d::CCArray *v7; // x0
cocos2d::CCArray *v8; // x22
cocos2d::CCSprite *v9; // x0
float v10; // s11
float v11; // s0
float v12; // s11
float v13; // s11
float v14; // s9
float v15; // s0
const char *v16; // x0
size_t v17; // x0
_BOOL4 v18; // w22
float v19; // s12
float v20; // s13
float v21; // s8
float v22; // s9
float v23; // s9
float v24; // s8
float v25; // s0
__int64 v26; // x22
void (__fastcall *v27)(__int64, __int64 *); // x24
__int64 v28; // x0
long double v29; // q0
__int64 v30; // x22
void (__fastcall *v31)(__int64, long double); // x24
__int64 v32; // x22
cocos2d::CCLabelBMFont *v33; // x0
__int64 (__fastcall *v34)(cocos2d::CCLabelBMFont *); // x1
void (__fastcall *v35)(__int64, __int64 *); // x19
__int64 v36; // x0
const char *v38; // x0
size_t v39; // x0
int v40; // w0
__int64 v41; // x1
void *v42; // x0
int v43; // w0
unsigned int v44; // w22
cocos2d::CCArray *v45; // x25
cocos2d::CCArray *v46; // x0
int v47; // w0
cocos2d::CCNode *v48; // x22
const cocos2d::CCPoint *v49; // x0
float v50; // s8
cocos2d::CCNode *v51; // x0
float v52; // s8
int v53; // w1
char *v54; // [xsp+80h] [xbp+80h]
float v55; // [xsp+80h] [xbp+80h]
char *v56; // [xsp+80h] [xbp+80h]
__int64 v57; // [xsp+98h] [xbp+98h] BYREF
__int64 v58; // [xsp+A0h] [xbp+A0h] BYREF
__int64 v59[2]; // [xsp+A8h] [xbp+A8h] BYREF
void *v60; // [xsp+B8h] [xbp+B8h]
__int64 v61; // [xsp+C0h] [xbp+C0h] BYREF
__int64 v62; // [xsp+C8h] [xbp+C8h]
void *v63; // [xsp+D0h] [xbp+D0h]
if ( !*((_QWORD *)this + 75) && !*((_QWORD *)this + 77) || !*((_QWORD *)this + 71) )
return _stack_chk_guard;
if ( !*((_BYTE *)this + 624) )
{
v4 = 0;
goto LABEL_5;
}
v38 = (const char *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 72) + 1248LL))(*((_QWORD *)this + 72));
v61 = 0;
v56 = (char *)v38;
v62 = 0;
v63 = nullptr;
v39 = strlen(v38);
std::string::__init(&v61, v56, v39);
if ( a2 > 0 )
{
v40 = sub_6B7D64((__int64)&v61, a2);
if ( v40 > 0 )
{
v41 = v40 - 1LL;
if ( (v61 & 1) != 0 )
{
v42 = v63;
if ( *((_BYTE *)v63 + v41) != 10 )
{
LABEL_38:
v4 = 0;
operator delete(v63);
goto LABEL_5;
}
goto LABEL_46;
}
v4 = *((unsigned __int8 *)&v61 + v41 + 1) == 10;
goto LABEL_5;
}
v43 = v61 & 1;
LABEL_40:
v4 = 0;
if ( v43 )
goto LABEL_38;
goto LABEL_5;
}
v43 = v61 & 1;
if ( a2 >= 0 )
goto LABEL_40;
if ( (v61 & 1) != 0 )
{
if ( !v62 )
goto LABEL_38;
v42 = v63;
if ( *((char *)v63 + v62 - 1) != 10 )
goto LABEL_38;
LABEL_46:
v4 = 1;
operator delete(v42);
goto LABEL_5;
}
v53 = (int)(unsigned __int8)v61 >> 1;
v4 = 0;
if ( v53 )
v4 = *((unsigned __int8 *)&v61 + v53) == 10;
LABEL_5:
if ( *((int *)this + 126) > 0 )
{
if ( a2 < 0 )
{
Object = *((cocos2d::CCLabelBMFont **)this + 75);
if ( Object )
{
v6 = 0.0;
(*(void (__fastcall **)(_QWORD))(*(_QWORD *)Object + 488LL))(*((_QWORD *)this + 75));
LABEL_15:
v13 = *(float *)(*(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)Object + 328LL))(Object);
v14 = (*(float (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)Object + 168LL))(Object);
v15 = (*(float (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)Object + 136LL))(Object);
v12 = (float)(v15 + v15) + (float)(v13 * v14);
goto LABEL_16;
}
goto LABEL_56;
}
a2 = CCTextInputNode::rawToDisplayIndex(this, a2);
}
Object = *((cocos2d::CCLabelBMFont **)this + 75);
if ( Object )
{
v6 = 0.0;
goto LABEL_10;
}
if ( (a2 & 0x80000000) == 0 )
{
v44 = 0;
v45 = *(cocos2d::CCArray **)(*(_QWORD *)(*((_QWORD *)this + 77) + 608LL) + 648LL);
while ( v44 < (unsigned int)cocos2d::CCArray::count(v45) )
{
Object = (cocos2d::CCLabelBMFont *)cocos2d::CCArray::objectAtIndex(v45, v44);
v46 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)Object + 488LL))(Object);
v47 = cocos2d::CCArray::count(v46);
if ( a2 <= v47 && (a2 != v47 || !v4) )
goto LABEL_57;
a2 -= v47;
++v44;
}
}
LABEL_56:
Object = (cocos2d::CCLabelBMFont *)cocos2d::CCArray::lastObject(*(cocos2d::CCArray **)(*(_QWORD *)(*((_QWORD *)this + 77) + 608LL)
+ 648LL));
a2 = -1;
*(_DWORD *)(*((_QWORD *)this + 72) + 752LL) = -1;
LABEL_57:
v48 = (cocos2d::CCNode *)(*(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)Object + 512LL))(Object);
v49 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)Object + 192LL))(Object);
cocos2d::CCNode::convertToWorldSpace(&v57, v48, v49);
v50 = *((float *)&v57 + 1);
v51 = (cocos2d::CCNode *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 77) + 512LL))(*((_QWORD *)this + 77));
cocos2d::CCNode::convertToWorldSpace(&v58, v51, (const cocos2d::CCPoint *)&unk_155C0E0);
v52 = v50 - *((float *)&v58 + 1);
v6 = v52 - *(float *)((*(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)Object + 192LL))(Object) + 4);
LABEL_10:
v7 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)Object + 488LL))(Object);
v8 = v7;
if ( a2 < 0 || (unsigned int)cocos2d::CCArray::count(v7) <= a2 )
goto LABEL_15;
v9 = (cocos2d::CCSprite *)cocos2d::CCArray::objectAtIndex(v8, a2);
cocos2d::CCLabelBMFont::getLetterPosXLeft(Object, v9);
v10 = *((float *)this + 116);
v12 = v11 + (float)(v10 * (*(float (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)Object + 136LL))(Object));
LABEL_16:
v16 = (const char *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 72) + 1248LL))(*((_QWORD *)this + 72));
v59[0] = 0;
v54 = (char *)v16;
v59[1] = 0;
v60 = nullptr;
v17 = strlen(v16);
std::string::__init(v59, v54, v17);
v61 = 0;
v62 = 0;
v63 = nullptr;
std::string::__init(&v61, &byte_11B8890, 0);
v18 = sub_6B7640((__int64)v59, (__int64)&v61);
if ( (v61 & 1) != 0 )
operator delete(v63);
if ( (v59[0] & 1) != 0 )
operator delete(v60);
if ( v18 )
v12 = 2.0;
if ( a2 <= 0 && v4 )
v12 = 2.0;
if ( *((_QWORD *)this + 75) )
v19 = 1.0;
else
v19 = (*(float (__fastcall **)(_QWORD))(**((_QWORD **)this + 77) + 168LL))(*((_QWORD *)this + 77));
v20 = *(float *)(*(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)Object + 192LL))(Object);
v21 = *(float *)(*(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)Object + 328LL))(Object);
v22 = *(float *)(*(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)Object + 304LL))(Object);
v23 = v20
+ (float)((float)(v21 * (float)(1.0 - v22))
* (*(float (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)Object + 168LL))(Object));
v24 = *(float *)(*(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)Object + 328LL))(Object);
v25 = v19
* (float)((float)(v23
- (float)(v24
* (*(float (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)Object + 168LL))(Object)))
+ v12);
if ( !*((_QWORD *)this + 75) )
v25 = v25 + *(float *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 77) + 192LL))(*((_QWORD *)this + 77));
v26 = *((_QWORD *)this + 71);
v55 = v25;
v27 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v26 + 184LL);
v28 = (*(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)Object + 192LL))(Object);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, v55, v6 + *(float *)(v28 + 4));
v27(v26, &v58);
v30 = *((_QWORD *)this + 71);
v31 = *(void (__fastcall **)(__int64, long double))(*(_QWORD *)v30 + 160LL);
if ( *((_QWORD *)this + 75) )
LODWORD(v29) = 1.0;
else
*(float *)&v29 = v19 * (*(float (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)Object + 168LL))(Object);
v31(v30, v29);
v32 = *((_QWORD *)this + 71);
v33 = Object;
v34 = *(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)Object + 304LL);
v35 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v32 + 296LL);
v36 = v34(v33);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, 0.5, *(float *)(v36 + 4));
v35(v32, &v58);
if ( *((_QWORD *)this + 80) )
CCTextInputNode::scrollToCursor(this);
return _stack_chk_guard;
}