//
// sub_1001FC41C from 0x1001fc41c to 0x1001fc470 (84 bytes)
//
// 1 xrefs:
// > CCTextInputNode::onTextFieldInsertText @ 0x1001fdb28
//
// 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:43 +0000
//
__int64 __fastcall sub_1001FC41C(__int64 a1, int a2)
{
int v2; // w9
char *v3; // x8
bool v4; // nf
__int64 v5; // x9
__int64 result; // x0
char v7; // t1
v2 = *(char *)(a1 + 23);
v3 = *(char **)a1;
v4 = v2 < 0;
if ( v2 >= 0 )
v3 = (char *)a1;
LODWORD(v5) = *(unsigned __int8 *)(a1 + 23);
if ( v4 )
LODWORD(v5) = *(_DWORD *)(a1 + 8);
if ( (int)v5 >= a2 )
v5 = (unsigned int)a2;
else
v5 = (unsigned int)v5;
if ( (int)v5 < 1 )
return 0;
LODWORD(result) = 0;
do
{
v7 = *v3++;
if ( (v7 & 0xC0) == 0x80 )
result = (unsigned int)result;
else
result = (unsigned int)(result + 1);
--v5;
}
while ( v5 );
return result;
}