//
// sub_9780C2 from 0x9780c2 to 0x9780ec (42 bytes)
//
// 0 xrefs:
//
// 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:05:59 +0000
//
unsigned __int8 *__fastcall sub_9780C2(unsigned __int8 *a1)
{
unsigned int v1; // r1
int v2; // r1
unsigned __int8 *result; // r0
int v4; // r1
v1 = *a1;
if ( (v1 & 1) != 0 )
{
v4 = *((_DWORD *)a1 + 1) - 1;
*((_DWORD *)a1 + 1) = v4;
result = *((unsigned __int8 **)a1 + 2);
result[v4] = 0;
}
else
{
v2 = (v1 >> 1) - 1;
*a1 = 2 * v2;
result = &a1[v2];
result[1] = 0;
}
return result;
}