//
// ParticleGameObject::addMainSpriteToParent from 0x86f4bc to 0x86f58c (208 bytes)
//
// 2 xrefs:
// > ??> @ 0xa2238
// > ??> @ 0x1447930
//
// 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:55:45 +0000
//
__int64 __fastcall ParticleGameObject::addMainSpriteToParent(int **this, unsigned __int8 a2)
{
int v2; // w21
__int64 result; // x0
int ObjectZLayer; // w0
__int64 v6; // x20
GameObject *v7; // x0
__int64 (__fastcall *v8)(__int64, __int64, _QWORD); // x19
unsigned int ObjectZOrder; // w0
__int64 v10; // [xsp+38h] [xbp+38h]
v2 = a2;
GameObject::addMainSpriteToParent(this, a2);
result = (__int64)*(this + 97);
if ( result )
{
ObjectZLayer = GameObject::getObjectZLayer((GameObject *)this);
v6 = GameObject::parentForZLayer((GameObject *)this, ObjectZLayer, 0, 4);
result = (*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)*(this + 97) + 512LL))(*(this + 97));
if ( v6 != result )
{
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)*(this + 97) + 528LL))(*(this + 97), 0);
v7 = (GameObject *)this;
v10 = (__int64)*(this + 97);
v8 = *(__int64 (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)v6 + 464LL);
LABEL_4:
ObjectZOrder = GameObject::getObjectZOrder(v7);
return v8(v6, v10, ObjectZOrder);
}
if ( v2 )
{
v7 = (GameObject *)this;
v10 = (__int64)*(this + 97);
v8 = *(__int64 (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)v6 + 592LL);
goto LABEL_4;
}
}
return result;
}