//
// sub_4CA50 from 0x4ca50 to 0x4ca88 (56 bytes)
//
// 3 xrefs:
// > sub_79454 @ 0x79af2
// > sub_BE9F4 @ 0xbea80
// > sub_BEEE8 @ 0xbef76
//
// 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 11:40:41 +0000
//
int __fastcall sub_4CA50(int *a1, int a2, int a3)
{
int v3; // r2
if ( a2 < 0 || !a3 || *a1 <= a2 )
return 31;
*(_DWORD *)(a1[4] + 4 * a2) = a3;
v3 = a1[4];
*(_DWORD *)(*(_DWORD *)(v3 + 4 * a2) + 8) = a1;
return (*(int (__fastcall **)(_DWORD, int, int, int))(**(_DWORD **)(v3 + 4 * a2) + 12))(
*(_DWORD *)(v3 + 4 * a2),
a2,
a1[2],
a1[3]);
}