//
// sub_78CF4 from 0x78cf4 to 0x78d12 (30 bytes)
//
// 22 xrefs:
// > sub_78744 @ 0x787ec
// > sub_78744 @ 0x787fe
// > sub_78744 @ 0x78840
// > sub_78744 @ 0x78850
// > sub_78744 @ 0x78896
// > sub_78744 @ 0x788b0
// > sub_78744 @ 0x788c0
// > sub_78744 @ 0x78906
// > sub_78744 @ 0x78964
// > sub_78744 @ 0x78970
// > sub_78744 @ 0x7897c
// > sub_78EB8 @ 0x78f4c
// > sub_78EB8 @ 0x78fec
// > sub_78EB8 @ 0x790a4
// > sub_78EB8 @ 0x790b8
// > sub_78EB8 @ 0x790cc
// > sub_78EB8 @ 0x790e0
// > sub_78EB8 @ 0x790fc
// > sub_78EB8 @ 0x7910e
// > sub_78EB8 @ 0x79120
// > sub_78EB8 @ 0x7913a
// > sub_78EB8 @ 0x79214
//
// 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_78CF4(int a1, _BYTE *a2)
{
__int64 v2; // r2
v2 = *(_QWORD *)(a1 + 8);
if ( (unsigned int)v2 < HIDWORD(v2) )
{
*(_DWORD *)(a1 + 8) = v2 + 1;
*a2 = *(_BYTE *)(*(_DWORD *)(a1 + 4) + v2);
return 0;
}
else
{
*(_BYTE *)(a1 + 28) = 1;
return 16;
}
}