//
// sub_8244EC from 0x8244ec to 0x8245a6 (186 bytes)
//
// 6 xrefs:
// > sub_825538 @ 0x825896
// > sub_826F08 @ 0x82717c
// > sub_826F08 @ 0x827958
// > sub_826F08 @ 0x827fea
// > sub_826F08 @ 0x828044
// > sub_84BB58 @ 0x84c1b2
//
// 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 12:01:53 +0000
//
char *__fastcall sub_8244EC(char *a1)
{
const char *v1; // r4
int v2; // r3
bool v3; // zf
int v4; // t1
bool v5; // zf
int v6; // r3
int v7; // t1
int v8; // r2
char *result; // r0
char *v10; // r3
int v11; // r0
size_t v12; // r6
char *v13; // r5
v1 = a1;
v2 = (unsigned __int8)*a1;
v3 = v2 == 58;
if ( v2 != 58 )
v3 = v2 == 0;
if ( !v3 )
{
do
{
v4 = *(unsigned __int8 *)++v1;
v2 = v4;
v5 = v4 == 58;
if ( v4 != 58 )
v5 = v2 == 0;
}
while ( !v5 );
}
if ( v2 )
{
v6 = *(unsigned __int8 *)++v1;
if ( v6 )
{
if ( (*(_BYTE *)(v6 + ctype_ + 1) & 8) != 0 )
{
do
{
v7 = *(unsigned __int8 *)++v1;
v8 = ctype_ + v7;
}
while ( v7 && (*(_BYTE *)(v8 + 1) & 8) != 0 );
}
}
}
result = strchr(v1, 13);
if ( result || (result = strchr(v1, 10)) != nullptr || (result = strchr(v1, 0)) != nullptr )
{
if ( result > v1 && (*(_BYTE *)((unsigned __int8)*result + ctype_ + 1) & 8) != 0 )
{
v10 = result - 1;
do
{
v3 = v10 == v1;
result = v10--;
}
while ( !v3 && (*(_BYTE *)((unsigned __int8)*result + ctype_ + 1) & 8) != 0 );
}
v11 = result - v1;
v12 = v11 + 1;
result = (char *)off_D200AC(v11 + 2);
v13 = result;
if ( result )
{
memcpy(result, v1, v12);
v13[v12] = 0;
return v13;
}
}
return result;
}