//
// sub_856164 from 0x856164 to 0x8561d8 (116 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::updatePlatformerTime @ 0x87a620
// > GJBaseGameLayer::updateSpecialLabels @ 0x87a8d4
// > GJBaseGameLayer::updateSpecialLabels @ 0x87aa04
//
// 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
//
__int64 __fastcall sub_856164(_QWORD *a1, int a2)
{
unsigned __int64 v2; // x5
unsigned __int64 v3; // x7
__int64 **v4; // x0
__int64 *v5; // x3
__int64 result; // x0
int v7; // w6
v2 = a1[1];
v3 = a2 % v2;
v4 = *(__int64 ***)(*a1 + 8 * v3);
if ( !v4 )
return 0;
v5 = *v4;
result = 0;
if ( v5 )
{
v7 = *((_DWORD *)v5 + 2);
do
{
if ( v7 == a2 )
{
v5 = (__int64 *)*v5;
++result;
if ( !v5 )
return result;
}
else
{
if ( result )
return result;
v5 = (__int64 *)*v5;
if ( !v5 )
return result;
}
v7 = *((_DWORD *)v5 + 2);
}
while ( v3 == v7 % v2 );
}
return result;
}