//
// sub_81BF24 from 0x81bf24 to 0x81bfe0 (188 bytes)
//
// 3 xrefs:
// > OBJ_add_object @ 0x81c38c
// > OBJ_add_object @ 0x81c394
// > ??> @ 0x81c3d0
//
// 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_81BF24(int *a1, _DWORD *a2)
{
int v2; // r3
int v3; // r0
int v4; // r1
size_t v6; // r2
const char *v7; // r0
const char *v8; // r1
v2 = *a1;
if ( *a1 != *a2 )
return *a1 - *a2;
v3 = a1[1];
v4 = a2[1];
switch ( v2 )
{
case 0:
v6 = *(_DWORD *)(v3 + 12);
v2 = v6 - *(_DWORD *)(v4 + 12);
if ( v2 )
return v2;
return memcmp(*(const void **)(v3 + 16), *(const void **)(v4 + 16), v6);
case 1:
v7 = *(const char **)v3;
if ( !v7 )
goto LABEL_14;
v8 = *(const char **)v4;
if ( v8 )
return strcmp(v7, v8);
return v2;
case 2:
v7 = *(const char **)(v3 + 4);
if ( v7 )
{
v8 = *(const char **)(v4 + 4);
if ( v8 )
return strcmp(v7, v8);
v2 = 1;
}
else
{
LABEL_14:
v2 = -1;
}
break;
case 3:
return *(_DWORD *)(v3 + 8) - *(_DWORD *)(v4 + 8);
default:
return 0;
}
return v2;
}