//
// GJBaseGameLayer::loadLevelSettings from 0x1001380a0 to 0x100138232 (402 bytes)
//
// 5 xrefs:
// > PlayLayer::prepareCreateObjectsFromSetup @ 0x10007a6cb
// > LevelEditorLayer::init @ 0x1000aac62
// > LevelEditorLayer::createObjectsFromSetup @ 0x1000abd18
// > LevelEditorLayer::levelSettingsUpdated @ 0x1000ae71f
// > LevelEditorLayer::onPlaytest @ 0x1000c5af8
//
// 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:24:51 +0000
//
unsigned int *__fastcall GJBaseGameLayer::loadLevelSettings(__int64 a1)
{
__int64 v2; // rdi
__int64 v3; // rax
__int64 v4; // rcx
__int64 v5; // rdi
char v6; // dl
__int64 v7; // rsi
char v8; // dl
unsigned int *result; // rax
_QWORD *v10; // r15
unsigned __int64 v11; // r12
_BYTE *v12; // r14
v2 = *(_QWORD *)(a1 + 3256);
*(_BYTE *)(a1 + 12238) = *(_BYTE *)(*(_QWORD *)(a1 + 3272) + 341LL);
PlayerObject::togglePlatformerMode(v2);
PlayerObject::togglePlatformerMode(*(_QWORD *)(a1 + 3264));
v3 = *(_QWORD *)(a1 + 1936);
if ( *(_BYTE *)(a1 + 12238) == 1 )
*(_DWORD *)(v3 + 900) = 5;
v4 = *(_QWORD *)(a1 + 3256);
v5 = *(_QWORD *)(a1 + 3272);
v6 = *(_BYTE *)(v5 + 452) ^ 1;
*(_BYTE *)(v4 + 2904) = v6;
v7 = *(_QWORD *)(a1 + 3264);
*(_BYTE *)(v7 + 2904) = v6;
v8 = *(_BYTE *)(v5 + 461) ^ 1;
*(_BYTE *)(v4 + 2528) = v8;
*(_BYTE *)(v7 + 2528) = v8;
if ( *(int *)(v3 + 1232) > 0 )
{
if ( !LevelSettingsObject::shouldUseYSection(v5) )
goto LABEL_5;
LABEL_8:
*(_DWORD *)(a1 + 13636) = 1008981770;
result = *(unsigned int **)(a1 + 3280);
if ( !result )
return result;
goto LABEL_9;
}
*(_DWORD *)(v3 + 1232) = *(_DWORD *)(v5 + 432);
if ( LevelSettingsObject::shouldUseYSection(v5) )
goto LABEL_8;
LABEL_5:
*(_DWORD *)(a1 + 13636) = 0;
result = *(unsigned int **)(a1 + 3280);
if ( result )
{
LABEL_9:
result = *((unsigned int **)result + 7);
if ( !*result )
return result;
v10 = *((_QWORD **)result + 2);
v11 = (unsigned __int64)&v10[*result - 1];
do
{
v12 = (_BYTE *)*v10;
if ( !*v10 )
return result;
if ( *(_BYTE *)(a1 + 1980) )
{
v12[868] = 1;
result = (unsigned int *)*(unsigned __int8 *)(a1 + 1981);
if ( v12[869] != (_BYTE)result )
goto LABEL_17;
}
else
{
v12[868] = GameObject::canRotateFree(*v10);
result = (unsigned int *)*(unsigned __int8 *)(a1 + 1981);
if ( v12[869] != (_BYTE)result )
LABEL_17:
v12[864] = 1;
}
v12[869] = (_BYTE)result;
++v10;
}
while ( (unsigned __int64)v10 <= v11 );
}
return result;
}