//
// sub_712B4 from 0x712b4 to 0x7136c (184 bytes)
//
// 2 xrefs:
// > sub_71150 @ 0x71208
// > sub_7136C @ 0x713d8
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 12:13:59 +0000
//
__int64 __fastcall sub_712B4(__int64 a1, unsigned __int64 a2, unsigned __int64 a3, __int64 **a4, _DWORD *a5)
{
unsigned int v5; // w10
__int64 *v6; // x8
unsigned __int64 v7; // x12
unsigned __int64 v8; // x12
__int64 result; // x0
unsigned __int64 v10; // x9
v5 = (*(_DWORD *)(a1 + 28) + 167) & -*(_DWORD *)(a1 + 28);
v6 = *(__int64 **)(a1 + 8);
while ( 1 )
{
if ( a2 )
{
v7 = *(_QWORD *)v6[6];
if ( v7 <= a2 && *((_DWORD *)v6 + 8) * v5 + v7 > a2 )
{
v10 = (a2 - v7) / v5;
goto LABEL_13;
}
}
if ( a3 )
{
v8 = v6[5];
if ( v8 <= a3 && v8 + 24LL * *((int *)v6 + 8) > a3 )
break;
}
v6 = (__int64 *)*v6;
if ( *(__int64 **)(a1 + 8) == v6 )
return 30;
}
v10 = (__int64)(a3 - v8) / 24;
LABEL_13:
if ( (_DWORD)v10 == -1 )
return 30;
if ( a4 )
*a4 = v6;
result = 0;
if ( a5 )
*a5 = v10;
return result;
}