//
// GJBaseGameLayer::parentForZLayer from 0x59ad08 to 0x59b32a (1570 bytes)
//
// 4 xrefs:
// > GameObject::parentForZLayer @ 0x44d51e
// > LevelEditorLayer::claimCustomParticle @ 0x45e8fa
// > GJBaseGameLayer::parentForZLayer @ 0x59ad56
// > GJBaseGameLayer::claimCustomParticle @ 0x5a9546
//
// 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:12 +0000
//
int *__fastcall GJBaseGameLayer::parentForZLayer(cocos2d::CCDictionary **this, int a2, _BOOL4 a3, int a4, int a5)
{
_BOOL4 v8; // r7
int v9; // r8
int *result; // r0
CCNodeContainer *v11; // r0
CCNodeContainer *v12; // r9
int *v13; // r4
__int64 v14; // r0
unsigned int v15; // r2
int v16; // r0
void (__fastcall *v17)(int, int, int, _DWORD *); // r6
int v18; // r5
void (__fastcall *v19)(int, int *, int); // r6
int v20; // r0
_DWORD v21[3]; // [sp+8h] [bp-Ch] BYREF
v8 = a3;
if ( a5 )
{
if ( a4 == 5 )
v8 = 1;
v9 = 100000 * a4 + 1000000 + 100 * a2 + v8;
result = (int *)cocos2d::CCDictionary::objectForKey(*(this + 2812), v9);
if ( !result )
{
v11 = (CCNodeContainer *)GJBaseGameLayer::parentForZLayer((GJBaseGameLayer *)this, a2, v8, a4, 0);
v12 = v11;
if ( a4 == 4 )
{
v13 = CCNodeContainer::create(v11);
}
else
{
v14 = ((__int64 (__fastcall *)(CCNodeContainer *))*(_DWORD *)(*(_DWORD *)v11 + 448))(v11);
v16 = cocos2d::CCSpriteBatchNode::createWithTexture(
(cocos2d::CCSpriteBatchNode *)v14,
(cocos2d::CCTexture2D *)HIDWORD(v14),
v15);
v13 = (int *)v16;
if ( v8 )
{
v17 = *(void (__fastcall **)(int, int, int, _DWORD *))(*(_DWORD *)v16 + 456);
v21[0] = 770;
v21[1] = 1;
v17(v16, 770, 1, v21);
}
}
cocos2d::CCDictionary::setObject(*(this + 2812), (cocos2d::CCObject *)v13, v9);
v18 = (int)*(this + 2813);
v19 = *(void (__fastcall **)(int, int *, int))(*(_DWORD *)v18 + 232);
v20 = (*(int (__fastcall **)(CCNodeContainer *))(*(_DWORD *)v12 + 52))(v12);
v19(v18, v13, v20);
return v13;
}
}
else if ( a4 == 5 )
{
if ( a2 >= -4 )
{
if ( a2 >= -2 )
{
if ( a2 >= 0 )
{
if ( a2 > 1 )
{
if ( a2 > 4 )
{
if ( a2 == 5 )
{
return (int *)*(this + 431);
}
else if ( a2 > 7 )
{
if ( a2 > 9 )
return (int *)*(this + 389);
else
return (int *)*(this + 403);
}
else
{
return (int *)*(this + 417);
}
}
else
{
return (int *)*(this + 451);
}
}
else
{
return (int *)*(this + 465);
}
}
else
{
return (int *)*(this + 479);
}
}
else
{
return (int *)*(this + 493);
}
}
else
{
return (int *)*(this + 507);
}
}
else if ( a3 )
{
if ( a2 >= -4 )
{
if ( a2 >= -2 )
{
if ( a2 >= 0 )
{
if ( a2 > 1 )
{
if ( a2 > 3 )
{
if ( a2 == 4 )
{
return (int *)*(this + 444);
}
else if ( a2 == 5 )
{
return (int *)*(this + 430);
}
else if ( a2 > 7 )
{
if ( a2 > 9 )
{
if ( a2 > 11 )
return (int *)*(this + 382);
else
return (int *)*(this + 388);
}
else
{
return (int *)*(this + 402);
}
}
else
{
return (int *)*(this + 416);
}
}
else
{
return (int *)*(this + 450);
}
}
else
{
return (int *)*(this + 464);
}
}
else
{
return (int *)*(this + 478);
}
}
else
{
return (int *)*(this + 492);
}
}
else
{
return (int *)*(this + 506);
}
}
else if ( a2 >= -4 )
{
if ( a2 >= -2 )
{
if ( a2 >= 0 )
{
if ( a2 > 1 )
{
if ( a2 > 3 )
{
if ( a2 > 5 )
{
if ( a2 > 7 )
{
if ( a2 > 9 )
return (int *)*(this + 387);
else
return (int *)*(this + 401);
}
else
{
return (int *)*(this + 415);
}
}
else
{
return (int *)*(this + 429);
}
}
else
{
return (int *)*(this + 449);
}
}
else
{
return (int *)*(this + 463);
}
}
else
{
return (int *)*(this + 477);
}
}
else
{
return (int *)*(this + 491);
}
}
else
{
return (int *)*(this + 505);
}
return result;
}