//
// sub_50EB0 from 0x50eb0 to 0x50f32 (130 bytes)
//
// 5 xrefs:
// > sub_50E00 @ 0x50e28
// > sub_50E00 @ 0x50e4e
// > sub_50E00 @ 0x50e72
// > sub_517DC @ 0x517f0
// > sub_5880C @ 0x58824
//
// 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_50EB0(int a1, int a2, int a3)
{
int v6; // r0
int v7; // r4
int v8; // r5
int i; // r6
int v10; // r1
int v11; // r0
v6 = sub_51802();
if ( v6 )
{
v7 = v6;
v8 = 0;
if ( **(_DWORD **)(v6 + 4) == a2 )
{
for ( i = *(_DWORD *)v6 - 1; ; --i )
{
if ( i + 1 < 1 )
{
sub_BD7AC(*(int *)((char *)&dword_14C + (_DWORD)off_E8000), v7, "../../src/fmod_pluginfactory.cpp", 617, 1);
return 0;
}
v10 = *(_DWORD *)(*(_DWORD *)(v7 + 4) + 4 * i);
if ( v10 )
{
v11 = sub_51848(a1, v10, a3);
if ( v11 )
return v11;
*(_DWORD *)(*(_DWORD *)(v7 + 4) + 4 * i) = 0;
}
}
}
}
else
{
v8 = sub_51848(a1, a2, a3);
if ( !v8 )
return 0;
}
return v8;
}