//
// CCTextInputNode::displayToRawIndex from 0x3e1fc8 to 0x3e2070 (168 bytes)
//
// 3 xrefs:
// > CCTextInputNode::updateCursorPosition @ 0x3e2308
// > CCTextInputNode::updateCursorPosition @ 0x3e23ec
// > CCTextInputNode::updateCursorPosition @ 0x3e2414
//
// 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
//
int __fastcall CCTextInputNode::displayToRawIndex(CCTextInputNode *this, int a2)
{
unsigned int v4; // r4
const char *v5; // r0
const char *v6; // r7
size_t v7; // r0
const char *v8; // r1
int v9; // r7
int v10; // r2
int *v11; // r11
int v12; // r0
int v13; // r2
int v14; // r3
int v16[3]; // [sp+0h] [bp-14h] BYREF
v4 = 0;
v5 = (const char *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 104) + 624))(*((_DWORD *)this + 104));
memset(v16, 0, sizeof(v16));
v6 = v5;
v7 = strlen(v5);
v8 = v6;
v9 = a2;
std::string::__init(v16, v8, v7);
while ( 1 )
{
v10 = *((_DWORD *)this + 94);
if ( v4 >= -1431655765 * ((*((_DWORD *)this + 95) - v10) >> 2) )
break;
v11 = (int *)(v10 + 12 * v4);
v12 = sub_3DC19C((unsigned __int8 *)v16, *v11);
if ( CCTextInputNode::rawToDisplayIndex((int **)this, v12, v13, v14) >= a2 )
break;
++v4;
v9 += v11[1] - 1;
}
std::string::~string((int)v16);
return v9;
}