//
// sub_78600 from 0x78600 to 0x78742 (322 bytes)
//
// 1 xrefs:
// > sub_78744 @ 0x7887a
//
// 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_78600(
int a1,
int a2,
_DWORD *a3,
_DWORD *a4,
_DWORD *a5,
_DWORD *a6,
_DWORD *a7,
int a8,
_DWORD *a9,
_DWORD *a10,
_DWORD *a11)
{
int v13; // r4
int v14; // r5
_DWORD *v15; // r12
_DWORD *v16; // r6
int v17; // r3
int i; // r0
int v19; // r8
int v20; // r9
int v21; // r5
int v22; // r0
int v23; // r0
int v24; // r0
int result; // r0
int v26; // r0
int v27; // r0
int v28; // r1
v13 = 0;
v14 = 0;
v15 = *(_DWORD **)(**(_DWORD **)(a1 + 12) + 11560);
while ( v14 < v15[56] )
{
v16 = (_DWORD *)(v15[58] + v13);
if ( v16[65] == *(_DWORD *)(a1 + 624) && v16[66] == *(unsigned __int8 *)(a1 + 628) )
{
*a4 = v16;
v17 = 64;
for ( i = v16[64]; ; --i )
{
if ( !i )
return 13;
v19 = v16[67];
v20 = v19 + v17;
if ( *(unsigned __int16 *)(v19 + v17 - 64) <= a2 && *(unsigned __int16 *)(v20 - 62) >= a2 )
break;
v17 += 68;
}
v21 = *(_DWORD *)(v20 - 8);
if ( *(_DWORD *)(v20 - 52) )
{
*a5 = *(unsigned __int16 *)(v20 - 48);
*a6 = *(__int16 *)(v20 - 46);
v22 = *(_DWORD *)(v20 - 44);
}
else if ( v21 < 0 || v21 >= v15[59] )
{
*a5 = 60;
v22 = 0;
*a6 = 0;
}
else
{
v23 = v15[61] + 296 * v21;
*a5 = *(unsigned __int16 *)(v23 + 264);
*a6 = *(__int16 *)(v23 + 266);
v22 = *(_DWORD *)(v23 + 268);
}
*a7 = v22;
*a9 = *(unsigned __int16 *)(v20 - 54);
*a10 = *(_DWORD *)(v20 - 4);
*a11 = *(_DWORD *)(v19 + v17);
if ( v21 == -1 )
return 13;
v24 = *(_DWORD *)(**(_DWORD **)(a1 + 12) + 11556);
result = (*(int (__fastcall **)(int, int, _DWORD *))(*(_DWORD *)v24 + 60))(v24, v21, a3);
if ( result )
return result;
v26 = *(_DWORD *)(**(_DWORD **)(a1 + 12) + 11564);
if ( v26 && !*a3 )
*(_BYTE *)(v26 + v21) = 1;
v27 = v16[68];
if ( v27 )
{
v28 = v16[69];
if ( v28 )
{
*a10 = v27;
*a11 = v28;
}
}
return 0;
}
v13 += 280;
++v14;
}
return 0;
}