//
// sub_78D94 from 0x78d94 to 0x78dd8 (68 bytes)
//
// 4 xrefs:
// > sub_78EB8 @ 0x78f0e
// > sub_78EB8 @ 0x78f74
// > sub_78EB8 @ 0x78fca
// > sub_78EB8 @ 0x78ffa
//
// 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_78D94(int a1, int *a2)
{
unsigned int v2; // r5
unsigned int v3; // r12
int v4; // r2
char v5; // r4
char v6; // r3
v3 = *(_DWORD *)(a1 + 12);
v2 = *(_DWORD *)(a1 + 8);
v4 = 0;
v5 = 0;
while ( v5 != 4 && v2 < v3 )
{
*(_DWORD *)(a1 + 8) = v2 + 1;
++v5;
v6 = *(_BYTE *)(*(_DWORD *)(a1 + 4) + v2);
v4 = v6 & 0x7F | (v4 << 7);
++v2;
if ( (v6 & 0x80) == 0 )
{
*a2 = v4;
return 0;
}
}
*(_BYTE *)(a1 + 28) = 1;
return 16;
}