//
// sub_77F0C4 from 0x77f0c4 to 0x77f142 (126 bytes)
//
// 10 xrefs:
// > EditorSFXManager::decodeSound @ 0x77f196
// > EditorSFXManager::decodeSound @ 0x77f1b6
// > EditorSFXManager::summarizeBlob @ 0x78049a
// > EditorSFXManager::summarizeBlob @ 0x7804b8
// > EditorSFXManager::summarizeBlob @ 0x780524
// > EditorSFXManager::summarizeBlob @ 0x78055e
// > EditorSFXManager::summarizeBlob @ 0x78057c
// > EditorSFXManager::deserializeAll @ 0x7809ca
// > EditorSFXManager::deserializeAll @ 0x780a3a
// > EditorSFXManager::deserializeAll @ 0x780a58
//
// 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:59:26 +0000
//
int __fastcall sub_77F0C4(unsigned __int8 *a1, unsigned int *a2, _DWORD *a3, int a4)
{
int v5; // r4
unsigned int v7; // r8
unsigned int v9; // r2
int v10; // r6
size_t v11; // r2
unsigned int v12; // r4
unsigned __int8 *v13; // r1
size_t v14; // r4
unsigned __int8 *v15; // r1
unsigned int v16; // r6
v5 = *a1;
v7 = *a2;
if ( (v5 & 1) != 0 )
v9 = *((_DWORD *)a1 + 1);
else
v9 = v5 >> 1;
if ( v7 > v9 )
return 0;
v10 = std::string::find(a1, a4, v7);
if ( v10 == -1 )
{
if ( (v5 & 1) != 0 )
v10 = *((_DWORD *)a1 + 1);
else
v10 = v5 >> 1;
}
v11 = v10 - v7;
if ( (v5 & 1) != 0 )
{
v12 = *((_DWORD *)a1 + 1);
if ( v7 > v12 )
LABEL_13:
sub_38AF48();
v13 = *((unsigned __int8 **)a1 + 2);
}
else
{
v12 = v5 >> 1;
if ( v7 > v12 )
goto LABEL_13;
v13 = a1 + 1;
}
v14 = v12 - v7;
v15 = &v13[v7];
v16 = v10 + 1;
if ( v11 >= v14 )
v11 = v14;
std::string::assign(a3, v15, v11);
*a2 = v16;
return 1;
}