//
// sub_1005127F8 from 0x1005127f8 to 0x10051287c (132 bytes)
//
// 5 xrefs:
// > sub_100512508 @ 0x100512534
// > sub_100512508 @ 0x10051254c
// > sub_10051269C @ 0x1005126c0
// > sub_10051269C @ 0x1005126d8
// > sub_10051269C @ 0x10051276c
//
// 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:07:03 +0000
//
__int64 __fastcall sub_1005127F8(__int64 a1, __int64 a2, __int64 a3, int a4)
{
int v6; // w21
char *v7; // x22
int v8; // w8
char *v10[2]; // [xsp+8h] [xbp-38h] BYREF
char v11; // [xsp+1Fh] [xbp-21h]
if ( a2 )
{
CCTextInputNode::getString(a2, v10);
if ( v11 < 0 )
{
v7 = v10[0];
v6 = atoi(v10[0]);
operator delete(v7);
}
else
{
v6 = atoi((const char *)v10);
}
if ( v6 >= a4 )
v8 = a4;
else
v8 = v6;
if ( v8 <= (int)a3 )
return (unsigned int)a3;
else
return (unsigned int)v8;
}
return a3;
}