//
// sub_77B528 from 0x77b528 to 0x77b572 (74 bytes)
//
// 0 xrefs:
//
// 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_77B528(int a1, unsigned int a2)
{
int v2; // r3
int result; // r0
unsigned int *v4; // r3
int v5; // [sp+4h] [bp-Ch] BYREF
v2 = *(_DWORD *)(a1 + 16);
if ( v2 )
return *(_DWORD *)(v2 + 4 * a2);
while ( 2 )
{
switch ( *(_BYTE *)(a1 + 12) )
{
case 0:
result = *(_DWORD *)(*(_DWORD *)(a1 + 24) + 4 * a2);
break;
case 1:
v4 = *(unsigned int **)(a1 + 24);
if ( *v4 > a2 )
{
a1 = *(_DWORD *)(a1 + 24);
}
else
{
a2 -= *v4;
a1 = *(_DWORD *)(a1 + 28);
}
continue;
case 2:
case 3:
(*(void (__fastcall **)(_DWORD, unsigned int, int, int *))(**(_DWORD **)(a1 + 24) + 8))(
*(_DWORD *)(a1 + 24),
a2,
1,
&v5);
result = v5;
break;
default:
continue;
}
return result;
}
}