//
// GJBaseGameLayer::createGroundLayer from 0x58be34 to 0x58be9e (106 bytes)
//
// 5 xrefs:
// > PlayLayer::setupHasCompleted @ 0x40a168
// > LevelEditorLayer::init @ 0x4763f8
// > GJBaseGameLayer::asyncGLoaded @ 0x58c7d4
// > GJBaseGameLayer::syncBGTextures @ 0x5964e4
// > LevelSettingsLayer::selectArtClosed @ 0x6a8c8a
//
// 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:02 +0000
//
int __fastcall GJBaseGameLayer::createGroundLayer(GJBaseGameLayer *this, GJGroundLayer *a2, int a3)
{
cocos2d::CCLayer *v6; // r0
int v7; // r2
cocos2d::CCLayer *v8; // r0
if ( *((_DWORD *)this + 614) )
GJBaseGameLayer::removeGroundLayer(this);
if ( (int)a2 >= 22 )
a2 = (GJGroundLayer *)((char *)&dword_14 + 2);
v6 = GJGroundLayer::create(a2, a3, a3);
*((_DWORD *)this + 614) = v6;
(*(void (__fastcall **)(cocos2d::CCLayer *, GJGroundLayer *))(*(_DWORD *)v6 + 36))(v6, a2);
(*(void (__fastcall **)(_DWORD, _DWORD, int))(**((_DWORD **)this + 606) + 232))(
*((_DWORD *)this + 606),
*((_DWORD *)this + 614),
40);
v8 = GJGroundLayer::create(a2, a3, v7);
*((_DWORD *)this + 615) = v8;
(*(void (__fastcall **)(_DWORD, cocos2d::CCLayer *, int))(**((_DWORD **)this + 606) + 232))(
*((_DWORD *)this + 606),
v8,
40);
return (*(int (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 615) + 72))(*((_DWORD *)this + 615), -1082130432);
}