//
// GJBaseGameLayer::updateSavePositionObjects from 0x100109aa0 to 0x100109bea (330 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::update @ 0x100130603
//
// This function is hookable on this platform (idp: pc, 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:21:33 +0000
//
__int64 __fastcall GJBaseGameLayer::updateSavePositionObjects(__int64 a1, __m128 a2)
{
__int64 LastPosition; // rcx
__int64 result; // rax
__int64 *v5; // r12
__int64 v6; // r13
int v7; // r13d
int v8; // edx
__int64 v9; // rsi
int v10; // eax
int v11; // r15d
__int64 v12; // rdi
int *v13; // [rsp+0h] [rbp-40h] BYREF
__int64 v14; // [rsp+8h] [rbp-38h]
int v15; // [rsp+10h] [rbp-30h] BYREF
LastPosition = *(unsigned int *)(a1 + 960);
if ( !(_DWORD)LastPosition )
{
result = *(unsigned int *)(a1 + 964);
goto LABEL_5;
}
LastPosition = (unsigned int)(LastPosition + 1000);
result = *(unsigned int *)(a1 + 964);
if ( (unsigned int)LastPosition <= (unsigned int)result )
{
LABEL_5:
*(_DWORD *)(a1 + 960) = result;
++*(_DWORD *)(a1 + 1140);
v5 = *(__int64 **)(a1 + 13248);
if ( !v5 )
return result;
v14 = a1 + 1204;
do
{
v10 = *((_DWORD *)v5 + 4);
v15 = v10;
v11 = *((_DWORD *)v5 + 5);
if ( v10 > 0 )
{
v13 = &v15;
v6 = sub_1000E7180((float *)(a1 + 13192), &v15, a2, (__int64)&unk_100A04ED8, &v13)[3];
LastPosition = GameObject::getLastPosition(v6);
v7 = *(_DWORD *)(v6 + 1340);
}
else
{
if ( v10 == -3 )
{
v7 = *(_DWORD *)(a1 + 1144);
LastPosition = v14;
goto LABEL_8;
}
if ( v10 == -2 )
{
v12 = *(_QWORD *)(a1 + 3264);
goto LABEL_15;
}
v7 = 0;
if ( v10 == -1 )
{
v12 = *(_QWORD *)(a1 + 3256);
LABEL_15:
v7 = *(_DWORD *)(v12 + 1340);
LastPosition = GameObject::getLastPosition(v12);
}
}
LABEL_8:
v8 = v7 + *(_DWORD *)(a1 + 1140) % v11;
v9 = *(_QWORD *)(a1 + 1112);
*(_DWORD *)(v9 + 8LL * v8) = *(_DWORD *)LastPosition;
a2 = (__m128)*(unsigned int *)(LastPosition + 4);
result = 2 * v8 + 1;
*(_DWORD *)(v9 + 4 * result) = a2.i32[0];
v5 = (__int64 *)*v5;
}
while ( v5 );
}
return result;
}