//
// CCTextInputNode::moveCursorVertical from 0x3e2454 to 0x3e25da (390 bytes)
//
// 1 xrefs:
// > CCTextInputNode::onTextFieldInsertText @ 0x3e41c0
//
// 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::moveCursorVertical(float this, int a2)
{
float v2; // s0
int v3; // r6
int v5; // r2
int v6; // r3
cocos2d::CCArray *v7; // r7
float v8; // s17
signed int v9; // r5
signed int i; // r4
const cocos2d::CCPoint *v11; // r10
float v12; // s18
int v13; // r0
int (__fastcall *v14)(signed int); // r3
float v15; // s15
signed int v16; // r0
signed int v17; // r5
float v18; // s18
float j; // s16
int v20; // r0
int v21; // r1
signed int v22; // r5
float v23; // s16
int v24; // r0
int v25; // r1
float v26[2]; // [sp+4h] [bp-24h] BYREF
float v27[2]; // [sp+Ch] [bp-1Ch] BYREF
char v28[16]; // [sp+14h] [bp-14h] BYREF
v3 = LODWORD(this);
v5 = *(_DWORD *)(LODWORD(this) + 436);
if ( v5 )
{
if ( *(_DWORD *)(LODWORD(this) + 412) )
{
v6 = *(_DWORD *)(v5 + 520);
v7 = *(cocos2d::CCArray **)(v6 + 536);
if ( v7 )
{
this = COERCE_FLOAT(cocos2d::CCArray::count(*(cocos2d::CCArray **)(v6 + 536)));
if ( LODWORD(this) > 1 )
{
v8 = 1.0;
v9 = cocos2d::CCArray::objectAtIndex(v7, 0);
for ( i = v9; i; i = (*(int (__fastcall **)(signed int))(*(_DWORD *)i + 256))(i) )
v8 = v8 * COERCE_FLOAT((*(int (__fastcall **)(signed int))(*(_DWORD *)i + 76))(i));
v11 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(_DWORD))(**(_DWORD **)(v3 + 412) + 256))(*(_DWORD *)(v3 + 412));
(*(void (__fastcall **)(_DWORD))(**(_DWORD **)(v3 + 412) + 96))(*(_DWORD *)(v3 + 412));
cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)v26, v11);
v12 = v26[1];
v13 = (*(int (__fastcall **)(_DWORD))(**(_DWORD **)(v3 + 412) + 152))(*(_DWORD *)(v3 + 412));
v14 = *(int (__fastcall **)(signed int))(*(_DWORD *)v9 + 164);
v15 = *(float *)(v13 + 4);
v16 = v9;
v17 = 0;
v18 = v12 + (float)((float)((float)(0.5 - v15) * *(float *)(v14(v16) + 4)) * v8);
for ( j = -1.0; ; j = v2 )
{
this = COERCE_FLOAT(cocos2d::CCArray::count(v7));
if ( i >= SLODWORD(this) )
break;
v20 = cocos2d::CCArray::objectAtIndex(v7, i);
sub_3DC2FC(v20, v21);
v2 = fabsf(v2 - v18);
if ( j < 0.0 || v2 < j )
v17 = i;
else
v2 = j;
++i;
}
v22 = v17 + a2;
if ( v22 >= 0 )
{
this = COERCE_FLOAT(cocos2d::CCArray::count(v7));
if ( v22 < SLODWORD(this) )
{
v23 = *(float *)(v3 + 456);
if ( v23 < 0.0 )
v23 = v26[0];
v24 = cocos2d::CCArray::objectAtIndex(v7, v22);
sub_3DC2FC(v24, v25);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v27, v23, v2);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v28, (const cocos2d::CCRect *)&unk_D2B360);
this = CCTextInputNode::updateCursorPosition(v3, v27);
*(float *)(v3 + 456) = v23;
}
}
}
}
}
}
return this;
}