//
// sub_1001FCD10 from 0x1001fcd10 to 0x1001fd214 (1284 bytes)
//
// 10 xrefs:
// > CCTextInputNode::updateLabel @ 0x1001fb6d0
// > CCTextInputNode::insertAtCursor @ 0x1001fbfac
// > sub_1001FC470 @ 0x1001fc478
// > CCTextInputNode::onTextFieldDeleteBackward @ 0x1001fca04
// > CCTextInputNode::onTextFieldInsertText @ 0x1001fd780
// > CCTextInputNode::onTextFieldInsertText @ 0x1001fdb38
// > CCTextInputNode::onTextFieldAttachWithIME @ 0x1001fe02c
// > CCTextInputNode::updateCursorPosition @ 0x1001feb34
// > CCTextInputNode::updateCursorPosition @ 0x1001febcc
// > sub_1001FF868 @ 0x1001ff8c0
//
// 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 11:00:44 +0000
//
__int64 __fastcall sub_1001FCD10(__int64 result, __int64 a2)
{
__int64 v3; // x19
char *v4; // x0
int v5; // w0
void **v6; // x8
_BOOL4 v7; // w24
__int64 v8; // x21
float v9; // s10
__int64 v10; // x22
__int64 v11; // x23
__int64 v12; // x0
int v13; // w0
_BOOL4 v14; // w8
__int64 v16; // x22
__int64 v17; // x0
float v18; // s8
__int64 v19; // x0
float v20; // s8
__int64 v21; // x0
__int64 v22; // x22
__int64 v23; // x0
float LetterPosXLeft; // s8
float v25; // s9
float v26; // s8
float v27; // s9
float v28; // s8
float v29; // s0
char *v30; // x0
bool v31; // w22
bool v32; // w8
float v33; // s9
float v34; // s8
float v35; // s12
float v36; // s13
float v37; // s11
float v38; // s11
float v39; // s12
float v40; // s9
__int64 v41; // x20
__int64 v42; // x0
__int64 v43; // x20
__n128 v44; // q0
__int64 v45; // x20
__int64 v46; // x0
__int64 v47; // x9
char *p_p; // x8
void *v49[2]; // [xsp+0h] [xbp-A0h] BYREF
char v50; // [xsp+17h] [xbp-89h]
void *__p; // [xsp+18h] [xbp-88h] BYREF
__int64 v52; // [xsp+20h] [xbp-80h]
char v53; // [xsp+2Fh] [xbp-71h]
v3 = result;
if ( !*(_QWORD *)(result + 600) && !*(_QWORD *)(result + 616) || !*(_QWORD *)(result + 568) )
return result;
if ( *(_BYTE *)(result + 624) == 1 )
{
v4 = (char *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(result + 576) + 1248LL))(*(_QWORD *)(result + 576));
sub_100009900(&__p, v4);
if ( (int)a2 < 1 )
{
if ( (a2 & 0x80000000) != 0 )
{
if ( (v53 & 0x8000000000000000LL) != 0 )
{
v47 = v52;
if ( !v52 )
goto LABEL_14;
}
else
{
if ( !v53 )
goto LABEL_14;
v47 = v53;
}
p_p = (char *)&__p;
if ( v53 < 0 )
p_p = (char *)__p;
v7 = p_p[v47 - 1] == 10;
goto LABEL_15;
}
}
else
{
v5 = sub_1001FC2D0((__int64 *)&__p, a2);
if ( v5 >= 1 )
{
v6 = v53 >= 0 ? &__p : (void **)__p;
if ( *((_BYTE *)v6 + (unsigned int)v5 - 1) == 10 )
{
v7 = 1;
goto LABEL_15;
}
}
}
LABEL_14:
v7 = 0;
LABEL_15:
if ( v53 < 0 )
operator delete(__p);
goto LABEL_17;
}
v7 = 0;
LABEL_17:
if ( (a2 & 0x80000000) == 0 && *(int *)(v3 + 504) >= 1 )
a2 = sub_1001FC504(v3, a2);
v8 = *(_QWORD *)(v3 + 600);
if ( v8 )
{
v9 = 0.0;
}
else
{
if ( (a2 & 0x80000000) != 0
|| (v10 = *(_QWORD *)(*(_QWORD *)(*(_QWORD *)(v3 + 616) + 608LL) + 648LL), !(unsigned int)sub_1002E757C(v10)) )
{
LABEL_33:
v8 = sub_1002E75B0(*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(v3 + 616) + 608LL) + 648LL));
a2 = 0xFFFFFFFFLL;
*(_DWORD *)(*(_QWORD *)(v3 + 576) + 752LL) = -1;
}
else
{
v11 = 0;
while ( 1 )
{
v8 = sub_1002E75A0(v10, v11);
v12 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 488LL))(v8);
v13 = sub_1002E757C(v12);
v14 = (_DWORD)a2 == v13 && v7;
if ( (int)a2 <= v13 && !v14 )
break;
v11 = (unsigned int)(v11 + 1);
a2 = (unsigned int)(a2 - v13);
if ( (unsigned int)v11 >= (unsigned int)sub_1002E757C(v10) )
goto LABEL_33;
}
}
v16 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 512LL))(v8);
v17 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 192LL))(v8);
cocos2d::CCNode::convertToWorldSpace(&__p, v16, v17);
v18 = *((float *)&__p + 1);
v19 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v3 + 616) + 512LL))(*(_QWORD *)(v3 + 616));
cocos2d::CCNode::convertToWorldSpace(v49, v19, &unk_1009F4890);
v20 = v18 - *((float *)v49 + 1);
v9 = v20 - *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 192LL))(v8) + 4);
}
v21 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 488LL))(v8);
if ( (a2 & 0x80000000) != 0 || (v22 = v21, (unsigned int)sub_1002E757C(v21) <= (unsigned int)a2) )
{
v27 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 328LL))(v8);
v28 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v8 + 168LL))(v8);
v29 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v8 + 136LL))(v8);
v26 = (float)(v29 + v29) + (float)(v27 * v28);
}
else
{
v23 = sub_1002E75A0(v22, a2);
LetterPosXLeft = cocos2d::CCLabelBMFont::getLetterPosXLeft(v8, v23);
v25 = *(float *)(v3 + 464);
v26 = LetterPosXLeft + (float)(v25 * (*(float (__fastcall **)(__int64))(*(_QWORD *)v8 + 136LL))(v8));
}
v30 = (char *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v3 + 576) + 1248LL))(*(_QWORD *)(v3 + 576));
sub_100009900(&__p, v30);
sub_100009900(v49, "");
v31 = sub_1000045BC(&__p, v49);
if ( v50 < 0 )
operator delete(v49[0]);
if ( v53 < 0 )
operator delete(__p);
v32 = (int)a2 < 1 && v7;
if ( v32 || v31 )
v33 = 2.0;
else
v33 = v26;
v34 = 1.0;
if ( !*(_QWORD *)(v3 + 600) )
v34 = (*(float (__fastcall **)(_QWORD))(**(_QWORD **)(v3 + 616) + 168LL))(*(_QWORD *)(v3 + 616));
v35 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 192LL))(v8);
v36 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 328LL))(v8);
v37 = v36 * (float)(1.0 - *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 304LL))(v8));
v38 = v35 + (float)(v37 * (*(float (__fastcall **)(__int64))(*(_QWORD *)v8 + 168LL))(v8));
v39 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 328LL))(v8);
v40 = v34
* (float)(v33 + (float)(v38 - (float)(v39 * (*(float (__fastcall **)(__int64))(*(_QWORD *)v8 + 168LL))(v8))));
if ( !*(_QWORD *)(v3 + 600) )
v40 = v40 + *(float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v3 + 616) + 192LL))(*(_QWORD *)(v3 + 616));
v41 = *(_QWORD *)(v3 + 568);
v42 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 192LL))(v8);
sub_1000262BC((float *)&__p, v40, v9 + *(float *)(v42 + 4));
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v41 + 184LL))(v41, &__p);
v43 = *(_QWORD *)(v3 + 568);
v44.n128_u32[0] = 1.0;
if ( !*(_QWORD *)(v3 + 600) )
v44.n128_f32[0] = v34 * (*(float (__fastcall **)(__int64, float))(*(_QWORD *)v8 + 168LL))(v8, 1.0);
(*(void (__fastcall **)(__int64, __n128))(*(_QWORD *)v43 + 160LL))(v43, v44);
v45 = *(_QWORD *)(v3 + 568);
v46 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 304LL))(v8);
sub_1000262BC((float *)&__p, 0.5, *(float *)(v46 + 4));
result = (*(__int64 (__fastcall **)(__int64, void **))(*(_QWORD *)v45 + 296LL))(v45, &__p);
if ( *(_QWORD *)(v3 + 640) )
return sub_1001FBA00(v3);
return result;
}