//
// GJBaseGameLayer::createMiddleground from 0x1000f0dc0 to 0x1000f0e52 (146 bytes)
//
// 3 xrefs:
// > PlayLayer::setupHasCompleted @ 0x10007b4e6
// > LevelEditorLayer::init @ 0x1000aad56
// > LevelSettingsLayer::selectArtClosed @ 0x1002595b6
//
// 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 12:21:11 +0000
//
__int64 __fastcall GJBaseGameLayer::createMiddleground(__int64 a1, int a2, double a3)
{
__int64 v4; // rdi
__int64 result; // rax
unsigned int v6; // r15d
__int64 v7; // rax
v4 = *(_QWORD *)(a1 + 3976);
if ( v4 )
{
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 520LL))(v4);
*(_QWORD *)(a1 + 3976) = 0;
}
if ( a2 > 0 )
{
v6 = 3;
if ( (unsigned int)a2 < 3 )
v6 = a2;
v7 = GJMGLayer::create(v6, a3);
*(_QWORD *)(a1 + 3976) = v7;
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v7 + 72LL))(v7, v6);
return (*(__int64 (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 3896) + 464LL))(
*(_QWORD *)(a1 + 3896),
*(_QWORD *)(a1 + 3976),
4294967257LL);
}
return result;
}