//
// ParticleGameObject::addMainSpriteToParent from 0x140641cb0 to 0x140641d98 (232 bytes)
//
// 5 xrefs:
// > ??> @ 0x14081f128
// > ??> @ 0x1408e8290
// > ??> @ 0x1408e82a4
// > ??> @ 0x1408e82b4
// > ??> @ 0x140931034
//
// 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 11:35:35 +0000
//
char __fastcall ParticleGameObject::addMainSpriteToParent(__int64 a1, char a2)
{
__int64 v4; // rax
int v5; // edx
__int64 v6; // rdi
LOBYTE(v4) = GameObject::addMainSpriteToParent((_BYTE *)a1, a2);
if ( *(_QWORD *)(a1 + 776) )
{
v5 = *(_DWORD *)(a1 + 1132);
if ( !v5 )
v5 = *(_DWORD *)(a1 + 1124);
v6 = GameObject::parentForZLayer(a1, v5, 0, 4);
v4 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 776) + 504LL))(*(_QWORD *)(a1 + 776));
if ( v4 == v6 )
{
if ( a2 )
LOBYTE(v4) = (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v6 + 584LL))(v6, *(_QWORD *)(a1 + 776));
}
else
{
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 776) + 520LL))(*(_QWORD *)(a1 + 776), 0);
LOBYTE(v4) = (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v6 + 456LL))(v6, *(_QWORD *)(a1 + 776));
}
}
return v4;
}