//
// sub_1004E22CC from 0x1004e22cc to 0x1004e2350 (132 bytes)
//
// 5 xrefs:
// > sub_1004E0BEC @ 0x1004e0bfc
// > sub_1004E0C28 @ 0x1004e0c38
// > sub_1004E0C28 @ 0x1004e0c4c
// > sub_1004E0E28 @ 0x1004e0e70
// > sub_1004E2024 @ 0x1004e2080
//
// 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:06:37 +0000
//
__int64 __fastcall sub_1004E22CC(__int64 a1)
{
__int64 v1; // x0
int v2; // w20
const char *v3; // x0
__int64 v4; // x19
int v5; // w0
int v6; // w8
char *v8[2]; // [xsp+8h] [xbp-28h] BYREF
char v9; // [xsp+1Fh] [xbp-11h]
v1 = *(_QWORD *)(a1 + 712);
if ( !v1 )
return 0;
CCTextInputNode::getString(v1, v8);
v2 = v9;
if ( v9 < 0 )
{
if ( !v8[1] )
{
v4 = 0;
LABEL_14:
operator delete(v8[0]);
return v4;
}
v3 = v8[0];
goto LABEL_8;
}
if ( !v9 )
return 0;
v3 = (const char *)v8;
LABEL_8:
v5 = atoi(v3);
v6 = v5 & ~(v5 >> 31);
if ( v6 >= 9999 )
v4 = 9999;
else
v4 = (unsigned int)v6;
if ( v2 < 0 )
goto LABEL_14;
return v4;
}