//
// CCTextInputNode::updateBlinkLabelToChar from 0x3e1bbc to 0x3e1f9c (992 bytes)
//
// 1 xrefs:
// > CCTextInputNode::updateBlinkLabel @ 0x3e1fb4
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:47:02 +0000
//
float *__fastcall CCTextInputNode::updateBlinkLabelToChar(float *this, int a2, int a3)
{
float *v3; // r6
int v5; // r5
const char *v6; // r0
const char *v7; // r9
size_t v8; // r0
int v9; // r0
int v10; // r0
char *v11; // r3
int v12; // r5
int v13; // r5
char *v14; // r3
int v15; // r3
cocos2d::CCLabelBMFont *v16; // r4
unsigned int v17; // r9
cocos2d::CCArray *v18; // r10
cocos2d::CCArray *v19; // r0
int v20; // r0
cocos2d::CCLabelBMFont *Object; // r0
const cocos2d::CCPoint *v22; // r9
float v23; // s16
const cocos2d::CCPoint *v24; // r0
float v25; // s18
float v26; // s18
cocos2d::CCArray *v27; // r0
cocos2d::CCArray *v28; // r9
cocos2d::CCSprite *v29; // r0
float v30; // r0
float v31; // s17
float v32; // s16
const char *v33; // r0
const char *v34; // r11
size_t v35; // r0
_BOOL4 v36; // r9
float v37; // s19
float v38; // s17
float v39; // s21
float v40; // s15
float v41; // s17
float v42; // s20
float v43; // s16
int v44; // r7
void (__fastcall *v45)(int, _BYTE *); // r9
int v46; // r0
int v47; // r7
void (__fastcall *v48)(int, _DWORD); // r9
float v49; // s19
int v50; // r7
int (__fastcall *v51)(int, _BYTE *); // r9
int v52; // r0
float v53; // s16
float v54; // s16
float v55; // r0
_BYTE v56[4]; // [sp+4h] [bp-30h] BYREF
float v57; // [sp+8h] [bp-2Ch]
_BYTE v58[4]; // [sp+Ch] [bp-28h] BYREF
float v59; // [sp+10h] [bp-24h]
int v60[3]; // [sp+14h] [bp-20h] BYREF
int v61; // [sp+20h] [bp-14h] BYREF
int v62; // [sp+24h] [bp-10h]
char *v63; // [sp+28h] [bp-Ch]
v3 = this;
if ( !*((_DWORD *)this + 107) && !*((_DWORD *)this + 109) || !*((_DWORD *)this + 103) )
return this;
v5 = *((unsigned __int8 *)this + 440);
if ( *((_BYTE *)this + 440) )
{
v5 = 0;
v6 = (const char *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 104) + 624))(*((_DWORD *)this + 104));
v61 = 0;
v62 = 0;
v63 = nullptr;
v7 = v6;
v8 = strlen(v6);
std::string::__init(&v61, v7, v8);
if ( a2 <= 0 )
{
if ( a2 < 0 )
{
if ( (v61 & 1) != 0 )
{
v5 = v62;
if ( !v62 )
goto LABEL_18;
}
else
{
v5 = (int)(unsigned __int8)v61 >> 1;
if ( !v5 )
goto LABEL_18;
}
v13 = v5 - 1;
if ( (v61 & 1) != 0 )
v14 = v63;
else
v14 = (char *)&v61 + 1;
v12 = (unsigned __int8)v14[v13];
goto LABEL_17;
}
}
else
{
v9 = sub_3DC656((unsigned __int8 *)&v61, a2);
if ( v9 > 0 )
{
v10 = v9 - 1;
if ( (v61 & 1) != 0 )
v11 = v63;
else
v11 = (char *)&v61 + 1;
v12 = (unsigned __int8)v11[v10];
LABEL_17:
v5 = v12 == 10;
}
}
LABEL_18:
std::string::~string((int)&v61);
}
v15 = *((_DWORD *)v3 + 93);
if ( v15 > 0 && a2 >= 0 )
a2 = CCTextInputNode::rawToDisplayIndex((int **)v3, a2, a3, v15);
v16 = *((cocos2d::CCLabelBMFont **)v3 + 107);
if ( v16 )
{
v26 = 0.0;
}
else
{
if ( a2 >= 0 )
{
v17 = *((_DWORD *)v3 + 107);
v18 = *(cocos2d::CCArray **)(*(_DWORD *)(*((_DWORD *)v3 + 109) + 520) + 536);
while ( v17 < cocos2d::CCArray::count(v18) )
{
v16 = (cocos2d::CCLabelBMFont *)cocos2d::CCArray::objectAtIndex(v18, v17);
v19 = (cocos2d::CCArray *)(*(int (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)v16 + 244))(v16);
v20 = cocos2d::CCArray::count(v19);
if ( a2 <= v20 && (!v5 || a2 != v20) )
goto LABEL_31;
a2 -= v20;
++v17;
}
}
a2 = -1;
Object = (cocos2d::CCLabelBMFont *)cocos2d::CCArray::lastObject(*(cocos2d::CCArray **)(*(_DWORD *)(*((_DWORD *)v3 + 109) + 520)
+ 536));
*(_DWORD *)(*((_DWORD *)v3 + 104) + 608) = -1;
v16 = Object;
LABEL_31:
v22 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)v16 + 256))(v16);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)v16 + 96))(v16);
cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)v56, v22);
v23 = v57;
v24 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)v3 + 109) + 256))(*((_DWORD *)v3 + 109));
cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)v58, v24);
v25 = v59;
v26 = (float)(v23 - v25)
- *(float *)((*(int (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)v16 + 96))(v16) + 4);
}
v27 = (cocos2d::CCArray *)(*(int (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)v16 + 244))(v16);
v28 = v27;
if ( a2 < 0 || cocos2d::CCArray::count(v27) <= (unsigned int)a2 )
{
v53 = *(float *)(*(int (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)v16 + 164))(v16);
v54 = v53 * COERCE_FLOAT((*(int (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)v16 + 84))(v16));
v55 = (*(float (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)v16 + 68))(v16);
v32 = v54 + (float)(v55 + v55);
}
else
{
v29 = (cocos2d::CCSprite *)cocos2d::CCArray::objectAtIndex(v28, a2);
v30 = COERCE_FLOAT(cocos2d::CCLabelBMFont::getLetterPosXLeft(v16, v29));
v31 = v3[87];
v32 = v30 + (float)(v31 * (*(float (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)v16 + 68))(v16));
}
v33 = (const char *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)v3 + 104) + 624))(*((_DWORD *)v3 + 104));
memset(v60, 0, sizeof(v60));
v34 = v33;
v35 = strlen(v33);
std::string::__init(v60, v34, v35);
v61 = 0;
v62 = 0;
v63 = nullptr;
std::string::__init(&v61, &unk_B6B226, 0);
v36 = sub_3DC1CE((unsigned __int8 *)v60, (unsigned __int8 *)&v61);
std::string::~string((int)&v61);
std::string::~string((int)v60);
if ( v36 )
v32 = 2.0;
if ( v5 && a2 <= 0 )
v32 = 2.0;
if ( *((_DWORD *)v3 + 107) )
v37 = 1.0;
else
v37 = COERCE_FLOAT((*(int (__fastcall **)(_DWORD))(**((_DWORD **)v3 + 109) + 84))(*((_DWORD *)v3 + 109)));
v38 = *(float *)(*(int (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)v16 + 96))(v16);
v39 = *(float *)(*(int (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)v16 + 164))(v16);
v40 = *(float *)(*(int (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)v16 + 152))(v16);
v41 = v38
+ (float)((float)(v39 * (float)(1.0 - v40))
* COERCE_FLOAT((*(int (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)v16 + 84))(v16)));
v42 = *(float *)(*(int (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)v16 + 164))(v16);
v43 = (float)((float)(v41
- (float)(v42 * (*(float (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)v16 + 84))(v16)))
+ v32)
* v37;
if ( !*((_DWORD *)v3 + 107) )
v43 = v43 + *(float *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)v3 + 109) + 96))(*((_DWORD *)v3 + 109));
v44 = *((_DWORD *)v3 + 103);
v45 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v44 + 92);
v46 = (*(int (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)v16 + 96))(v16);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v58, v43, v26 + *(float *)(v46 + 4));
v45(v44, v58);
v47 = *((_DWORD *)v3 + 103);
v48 = *(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v47 + 80);
if ( *((_DWORD *)v3 + 107) )
v49 = 1.0;
else
v49 = v37 * (*(float (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)v16 + 84))(v16);
v48(v47, LODWORD(v49));
v50 = *((_DWORD *)v3 + 103);
v51 = *(int (__fastcall **)(int, _BYTE *))(*(_DWORD *)v50 + 148);
v52 = (*(int (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)v16 + 152))(v16);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v58, 0.5, *(float *)(v52 + 4));
this = (float *)v51(v50, v58);
if ( *((_DWORD *)v3 + 113) )
return CCTextInputNode::scrollToCursor(v3);
return this;
}