//
// sub_81C02C from 0x81c02c to 0x81c0ec (192 bytes)
//
// 3 xrefs:
// > OBJ_add_object @ 0x81c388
// > OBJ_add_object @ 0x81c390
// > ??> @ 0x81c3cc
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int __fastcall sub_81C02C(int *a1)
{
int v1; // r2
int v3; // r1
int v4; // r0
int result; // r0
int v6; // lr
unsigned __int8 *v7; // r0
unsigned __int8 *v8; // lr
int v9; // r2
int v10; // t1
v1 = a1[1];
switch ( *a1 )
{
case 0:
v6 = *(_DWORD *)(v1 + 12);
v7 = *(unsigned __int8 **)(v1 + 16);
v3 = v6 << 20;
if ( v6 > 0 )
{
v8 = &v7[v6];
v9 = 0;
do
{
v10 = *v7++;
v3 ^= v10 << ((char)v9 % 24);
v9 += 3;
}
while ( v7 != v8 );
}
v4 = 0;
goto LABEL_3;
case 1:
v3 = (int)OPENSSL_LH_strhash(*(unsigned __int8 **)v1);
v4 = *a1;
goto LABEL_3;
case 2:
v3 = (int)OPENSSL_LH_strhash(*(unsigned __int8 **)(v1 + 4));
v4 = *a1;
goto LABEL_3;
case 3:
v3 = *(_DWORD *)(v1 + 8);
v4 = 3;
LABEL_3:
result = v3 & 0x3FFFFFFF | (v4 << 30);
break;
default:
result = 0;
break;
}
return result;
}