//
// sub_1006531D0 from 0x1006531d0 to 0x1006532c4 (244 bytes)
//
// 2 xrefs:
// > sub_10065318C @ 0x1006531b4
// > sub_1006532C4 @ 0x1006532ec
//
// 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 11:10:51 +0000
//
__int64 __fastcall sub_1006531D0(__int64 a1, int a2, unsigned __int64 a3, _QWORD *a4)
{
__int64 *v8; // x8
__int64 v9; // x8
bool v10; // zf
unsigned int v11; // w9
__int64 result; // x0
sub_1006AE2F8(9, 12, "s3_both.c", 624);
v8 = (__int64 *)(a1 + 560);
if ( !a2 )
v8 = (__int64 *)(a1 + 552);
v9 = *v8;
if ( v9
&& (*(_QWORD *)v9 != a3 ? (v10 = *(_QWORD *)v9 == 0) : (v10 = 1),
v10 && a3 >= 8 && (v11 = *(_DWORD *)(v9 + 8), v11 < *(_DWORD *)(a1 + 544))) )
{
*(_QWORD *)v9 = a3;
*a4 = *(_QWORD *)(v9 + 16);
*(_QWORD *)(v9 + 16) = a4;
*(_DWORD *)(v9 + 8) = v11 + 1;
return sub_1006AE2F8(10, 12, "s3_both.c", 637);
}
else
{
result = sub_1006AE2F8(10, 12, "s3_both.c", 637);
if ( a4 )
return sub_1006AEDAC(a4);
}
return result;
}