//
// GJBaseGameLayer::updateSavePositionObjects from 0x5a5648 to 0x5a571c (212 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::update @ 0x5be09c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:53:20 +0000
//
int __fastcall GJBaseGameLayer::updateSavePositionObjects(int this, unsigned int a2, unsigned int a3)
{
char *v3; // r8
_DWORD *v4; // r4
int v5; // r5
unsigned int v6; // r3
_DWORD *i; // r7
int v8; // r11
GameObject *v9; // r5
char *LastPosition; // r0
int v11; // r5
GameObject *v12; // r0
int v13; // r0
int v14; // r1
int v15; // r1
unsigned int v16[3]; // [sp+0h] [bp-Ch] BYREF
v16[0] = this;
v16[1] = a2;
v16[2] = a3;
v4 = (_DWORD *)this;
v5 = *(_DWORD *)(this + 824);
v6 = *(_DWORD *)(this + 828);
if ( !v5 || v5 + 1000 <= v6 )
{
*(_DWORD *)(this + 824) = v6;
++*(_DWORD *)(this + 944);
for ( i = *(_DWORD **)(this + 11220); ; i = (_DWORD *)*i )
{
if ( !i )
return this;
v8 = i[3];
v16[0] = i[2];
if ( (int)v16[0] > 0 )
{
v9 = (GameObject *)*std::unordered_map::operator[]((int)(v4 + 2798), v16);
LastPosition = GameObject::getLastPosition(v9);
v11 = *((_DWORD *)v9 + 290);
v3 = LastPosition;
goto LABEL_15;
}
if ( v16[0] == -2 )
break;
if ( v16[0] == -1 )
{
v12 = (GameObject *)v4[519];
LABEL_13:
v11 = *((_DWORD *)v12 + 290);
v3 = GameObject::getLastPosition(v12);
goto LABEL_15;
}
if ( v16[0] == -3 )
{
v11 = v4[237];
v3 = (char *)(v4 + 249);
}
else
{
v11 = 0;
}
LABEL_15:
v13 = v4[236];
v14 = v13 % v8;
this = v13 / v8;
v15 = v14 + v11;
*(_DWORD *)(v4[232] + 8 * v15) = *(_DWORD *)v3;
*(_DWORD *)(v4[232] + 8 * v15 + 4) = *((_DWORD *)v3 + 1);
}
v12 = (GameObject *)v4[520];
goto LABEL_13;
}
return this;
}