//
// sub_1004313C8 from 0x1004313c8 to 0x10043143c (116 bytes)
//
// 1 xrefs:
// > sub_10026B1E8 @ 0x10026b240
//
// 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:05:06 +0000
//
__int64 __fastcall sub_1004313C8(__int64 a1, int a2, int a3)
{
__int64 v3; // x9
__int64 v4; // x8
unsigned __int64 v5; // x10
__int64 result; // x0
char v8; // w10
int v9; // w9
__int128 v10; // q0
v3 = *(_QWORD *)(a1 + 1848);
v4 = *(_QWORD *)(a1 + 1840);
v5 = (unsigned __int64)(v3 - v4) >> 4;
if ( (int)v5 <= a2 )
return 0;
if ( (_DWORD)v5 - 1 == a2 && a3 == 0 )
return 0;
result = 0;
if ( a2 )
v8 = 0;
else
v8 = a3;
if ( (v8 & 1) == 0 && v4 != v3 )
{
v9 = a2 - 1;
if ( !a3 )
v9 = a2 + 1;
v10 = *(_OWORD *)(v4 + 16LL * a2);
*(_OWORD *)(v4 + 16LL * a2) = *(_OWORD *)(v4 + 16LL * v9);
*(_OWORD *)(v4 + 16LL * v9) = v10;
return 1;
}
return result;
}