//
// GameObject::createWithKey from 0x361c70 to 0x362548 (2264 bytes)
//
// 7 xrefs:
// > PlayLayer::setupHasCompleted @ 0x31c234
// > GameObject::objectFromVector @ 0x36262c
// > LevelEditorLayer::copyObjectState @ 0x368c14
// > LevelEditorLayer::createObject @ 0x3713cc
// > EditorUI::getCreateBtn @ 0x38638a
// > GJBaseGameLayer::createPlayerCollisionBlock @ 0x46fd08
// > GJMapObject::createMonster @ 0x50e392
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
GameObject *GameObject::createWithKey(int a1)
{
ObjectToolbox *v2; // r0
const char *v3; // r0
GameObject *result; // r0
unsigned int v5; // r2
bool v6; // cc
bool v7; // zf
bool v8; // cc
bool v9; // zf
unsigned int v10; // r2
unsigned int v11; // r2
unsigned int v12; // r2
bool v13; // cc
unsigned int v14; // r2
int v15; // r2
int v16; // r2
bool v17; // cc
bool v18; // r1
cocos2d::CCTextureCache *v19; // r5
GameManager *v20; // r6
GameManager *v21; // r0
const char *FontTexture; // r0
cocos2d::CCTexture2D *v23; // r0
int m_unk390; // r3
v2 = ObjectToolbox::sharedState();
v3 = ObjectToolbox::intKeyToFrame(v2, a1);
if ( !a1 || !*v3 )
return nullptr;
if ( a1 <= 1819 )
{
if ( a1 >= 1818 )
goto LABEL_307;
if ( a1 <= 921 )
{
if ( a1 >= 920 )
goto LABEL_332;
if ( a1 == 142 )
goto LABEL_307;
if ( a1 <= 142 )
{
if ( a1 <= 59 )
{
if ( a1 >= 55 )
goto LABEL_325;
if ( a1 == 31 )
{
result = StartPosObject::create();
goto LABEL_334;
}
if ( a1 <= 31 )
{
if ( a1 <= 28 )
{
if ( a1 < 22 )
{
v5 = a1 - 10;
LABEL_47:
v6 = v5 > 3;
goto LABEL_291;
}
goto LABEL_325;
}
LABEL_307:
result = EffectGameObject::create(v3);
goto LABEL_334;
}
if ( a1 == 35 )
goto LABEL_307;
if ( a1 <= 35 )
{
if ( a1 <= 33 )
goto LABEL_307;
goto LABEL_333;
}
if ( a1 != 36 )
{
v6 = (unsigned int)(a1 - 45) > 2;
goto LABEL_291;
}
LABEL_297:
result = RingObject::create(v3);
goto LABEL_334;
}
if ( a1 == 99 )
goto LABEL_307;
if ( a1 <= 99 )
{
if ( a1 <= 89 )
{
if ( a1 < 85 )
{
if ( a1 == 67 )
goto LABEL_307;
v7 = a1 == 84;
LABEL_37:
if ( !v7 )
goto LABEL_333;
goto LABEL_297;
}
goto LABEL_332;
}
v8 = a1 < 97;
LABEL_117:
if ( v8 )
goto LABEL_333;
goto LABEL_332;
}
if ( a1 > 139 )
{
if ( a1 == 140 )
goto LABEL_307;
v7 = a1 == 141;
goto LABEL_37;
}
if ( a1 >= 137 )
{
LABEL_332:
result = EnhancedGameObject::create(v3);
goto LABEL_334;
}
if ( a1 == 105 || a1 == 111 )
goto LABEL_307;
v9 = a1 == 101;
LABEL_87:
if ( v9 )
goto LABEL_307;
goto LABEL_333;
}
if ( a1 == 660 )
goto LABEL_307;
if ( a1 <= 660 )
{
if ( a1 <= 224 )
{
if ( a1 >= 222 )
goto LABEL_332;
if ( a1 > 188 )
{
v5 = a1 - 200;
goto LABEL_47;
}
if ( a1 >= 180 )
goto LABEL_332;
v10 = a1 - 154;
goto LABEL_250;
}
if ( a1 <= 378 )
{
if ( a1 > 374 )
goto LABEL_332;
v11 = a1 - 286;
goto LABEL_81;
}
v12 = a1 - 394;
LABEL_57:
v13 = v12 > 5;
goto LABEL_251;
}
if ( a1 != 749 )
{
if ( a1 <= 749 )
{
if ( a1 <= 742 )
{
if ( a1 >= 740 )
goto LABEL_332;
v12 = a1 - 675;
goto LABEL_57;
}
if ( a1 < 744 )
goto LABEL_333;
if ( a1 <= 745 )
goto LABEL_307;
if ( a1 != 747 )
{
LABEL_333:
result = GameObject::createWithFrame(v3);
goto LABEL_334;
}
goto LABEL_330;
}
if ( a1 == 914 )
{
v19 = cocos2d::CCTextureCache::sharedTextureCache();
v20 = GameManager::sharedState();
v21 = GameManager::sharedState();
FontTexture = GameManager::getFontTexture(v20, v21->m_loadedFont);
v23 = cocos2d::CCTextureCache::addImage(v19, FontTexture, 0);
result = TextGameObject::create(v23);
goto LABEL_334;
}
if ( a1 <= 914 )
{
if ( a1 < 899 )
goto LABEL_333;
if ( a1 <= 900 )
goto LABEL_307;
if ( a1 != 901 )
goto LABEL_333;
LABEL_312:
result = EnhancedTriggerObject::create(v3);
goto LABEL_334;
}
if ( a1 == 915 )
goto LABEL_307;
if ( a1 < 918 )
goto LABEL_333;
LABEL_304:
result = AnimatedGameObject::create(a1);
goto LABEL_334;
}
LABEL_330:
v18 = 0;
goto LABEL_331;
}
if ( a1 < 1584 )
{
if ( a1 >= 1582 )
goto LABEL_332;
if ( a1 <= 1328 )
{
if ( a1 >= 1327 )
goto LABEL_304;
if ( a1 <= 1021 )
{
if ( a1 >= 1019 )
goto LABEL_332;
if ( a1 > 1000 )
{
v11 = a1 - 1006;
LABEL_81:
v6 = v11 > 1;
goto LABEL_291;
}
if ( a1 > 996 )
goto LABEL_332;
v14 = a1 - 923;
LABEL_199:
v13 = v14 > 1;
goto LABEL_251;
}
if ( a1 > 1061 )
{
if ( a1 == 1268 )
{
result = SpawnTriggerGameObject::create();
goto LABEL_334;
}
v15 = 1275;
}
else
{
if ( a1 >= 1050 )
goto LABEL_332;
if ( a1 == 1022 )
goto LABEL_297;
v15 = 1049;
}
LABEL_86:
v9 = a1 == v15;
goto LABEL_87;
}
if ( a1 == 1346 )
goto LABEL_312;
if ( a1 <= 1346 )
{
if ( a1 <= 1332 )
{
if ( a1 >= 1331 || a1 == 1329 )
goto LABEL_307;
v7 = a1 == 1330;
goto LABEL_37;
}
if ( a1 == 1333 )
goto LABEL_297;
v15 = 1334;
goto LABEL_86;
}
if ( a1 < 1520 )
{
if ( a1 >= 1518 )
goto LABEL_332;
if ( a1 == 1347 )
goto LABEL_307;
v16 = 1516;
goto LABEL_160;
}
if ( a1 == 1520 )
goto LABEL_307;
v17 = a1 <= 1528;
LABEL_134:
if ( !v17 )
goto LABEL_333;
goto LABEL_332;
}
if ( a1 <= 1620 )
{
if ( a1 >= 1618 )
goto LABEL_332;
if ( a1 != 1594 )
{
if ( a1 <= 1594 )
{
if ( a1 == 1587 )
goto LABEL_307;
if ( a1 > 1587 )
{
if ( a1 == 1589 )
goto LABEL_307;
if ( a1 >= 1589 )
{
v8 = a1 < 1591;
goto LABEL_117;
}
goto LABEL_333;
}
if ( a1 == 1584 )
goto LABEL_304;
v15 = 1585;
goto LABEL_86;
}
if ( a1 > 1614 )
{
if ( a1 == 1615 )
{
result = LabelGameObject::create();
goto LABEL_334;
}
if ( a1 == 1616 )
{
result = TriggerControlGameObject::create(v3);
goto LABEL_334;
}
goto LABEL_333;
}
if ( a1 >= 1612 || a1 == 1598 )
goto LABEL_307;
if ( a1 != 1611 )
{
v15 = 1595;
goto LABEL_86;
}
LABEL_318:
result = CountTriggerGameObject::create(v3);
goto LABEL_334;
}
LABEL_299:
result = RingObject::create(v3);
result->m_classType = Effect;
goto LABEL_335;
}
if ( a1 > 1736 )
{
if ( a1 == 1811 )
goto LABEL_318;
if ( a1 > 1811 )
{
if ( a1 <= 1816 )
goto LABEL_307;
goto LABEL_318;
}
if ( a1 == 1752 )
goto LABEL_332;
if ( a1 == 1755 )
goto LABEL_307;
if ( a1 != 1751 )
goto LABEL_333;
}
else
{
if ( a1 >= 1734 )
goto LABEL_332;
if ( a1 != 1704 )
{
if ( a1 > 1704 )
{
v17 = a1 <= 1710;
goto LABEL_134;
}
v10 = a1 - 1697;
LABEL_250:
v13 = v10 > 2;
LABEL_251:
if ( v13 )
goto LABEL_333;
goto LABEL_332;
}
}
result = DashRingObject::create(v3);
goto LABEL_334;
}
if ( a1 <= 2917 )
{
if ( a1 < 2909 )
{
if ( a1 <= 2054 )
{
if ( a1 >= 2048 )
goto LABEL_332;
if ( a1 == 1917 )
goto LABEL_307;
if ( a1 <= 1917 )
{
if ( a1 <= 1858 )
{
if ( a1 > 1848 )
goto LABEL_332;
if ( a1 > 1834 )
{
v13 = (unsigned int)(a1 - 1839) > 3;
goto LABEL_251;
}
if ( a1 >= 1831 )
goto LABEL_332;
v15 = 1829;
goto LABEL_86;
}
if ( a1 <= 1913 )
{
if ( a1 >= 1912 || a1 == 1859 )
goto LABEL_307;
v16 = 1860;
goto LABEL_160;
}
if ( a1 == 1915 )
goto LABEL_325;
LABEL_314:
result = CameraTriggerGameObject::create(v3);
goto LABEL_334;
}
if ( a1 <= 1939 )
{
if ( a1 >= 1936 )
goto LABEL_332;
if ( a1 == 1933 )
goto LABEL_307;
if ( a1 <= 1933 )
{
if ( a1 == 1931 )
goto LABEL_307;
if ( a1 == 1932 )
{
result = PlayerControlGameObject::create();
goto LABEL_334;
}
goto LABEL_333;
}
if ( a1 != 1934 )
{
v15 = 1935;
goto LABEL_86;
}
LABEL_321:
result = SongTriggerGameObject::create(v3);
goto LABEL_334;
}
if ( a1 <= 2045 )
{
if ( a1 >= 2020 )
goto LABEL_332;
if ( a1 == 2012 )
goto LABEL_304;
if ( a1 < 2012 || (unsigned int)(a1 - 2015) > 1 )
goto LABEL_333;
goto LABEL_314;
}
LABEL_303:
result = SpecialAnimGameObject::create(v3);
goto LABEL_334;
}
if ( a1 == 2694 )
goto LABEL_332;
if ( a1 <= 2694 )
{
if ( a1 == 2067 )
{
result = TransformTriggerGameObject::create(v3);
goto LABEL_334;
}
if ( a1 <= 2067 )
{
if ( a1 == 2063 )
{
result = CheckpointGameObject::create();
goto LABEL_334;
}
if ( a1 >= 2064 )
{
if ( a1 == 2065 )
{
result = ParticleGameObject::create();
goto LABEL_334;
}
if ( a1 > 2065 )
goto LABEL_307;
goto LABEL_330;
}
if ( a1 != 2055 )
{
if ( a1 != 2062 )
goto LABEL_333;
goto LABEL_314;
}
goto LABEL_303;
}
if ( a1 == 2246 )
goto LABEL_332;
if ( a1 > 2246 )
{
if ( a1 == 2605 )
goto LABEL_332;
if ( a1 < 2605 )
goto LABEL_333;
v14 = a1 - 2629;
goto LABEL_199;
}
if ( a1 != 2069 )
{
if ( a1 < 2069 )
{
result = RandTriggerGameObject::create();
goto LABEL_334;
}
v16 = 2223;
goto LABEL_160;
}
LABEL_310:
result = ForceBlockGameObject::create(v3);
goto LABEL_334;
}
if ( a1 == 2899 )
{
result = GameOptionsTrigger::create(v3);
goto LABEL_334;
}
if ( a1 <= 2899 )
{
if ( a1 > 2894 )
{
if ( a1 <= 2897 )
{
result = SmartGameObject::create(v3);
goto LABEL_334;
}
goto LABEL_333;
}
if ( a1 < 2867 )
{
if ( a1 < 2864 )
goto LABEL_333;
if ( a1 > 2865 )
goto LABEL_307;
}
goto LABEL_332;
}
if ( a1 == 2903 )
{
result = GradientTriggerObject::create();
goto LABEL_334;
}
if ( a1 <= 2903 )
{
if ( a1 == 2901 )
goto LABEL_307;
if ( a1 <= 2901 )
{
result = RotateGameplayGameObject::create();
goto LABEL_334;
}
goto LABEL_330;
}
if ( a1 > 2905 && a1 != 2907 )
goto LABEL_333;
}
LABEL_326:
result = ShaderGameObject::create(v3);
goto LABEL_334;
}
if ( a1 > 3493 )
{
if ( a1 == 3618 )
goto LABEL_307;
if ( a1 <= 3618 )
{
if ( a1 == 3607 )
{
result = SequenceTriggerGameObject::create();
goto LABEL_334;
}
if ( a1 > 3607 )
{
if ( a1 == 3613 )
{
result = UISettingsGameObject::create();
goto LABEL_334;
}
if ( a1 > 3613 )
{
if ( a1 < 3616 || a1 == 3617 )
{
result = TimerTriggerGameObject::create(v3);
goto LABEL_334;
}
goto LABEL_333;
}
if ( a1 == 3609 )
goto LABEL_307;
if ( a1 < 3609 )
{
result = SpawnParticleGameObject::create();
goto LABEL_334;
}
v15 = 3612;
goto LABEL_86;
}
if ( a1 <= 3603 )
{
if ( a1 >= 3602 )
{
result = SFXTriggerGameObject::create(v3);
goto LABEL_334;
}
if ( a1 == 3600 )
{
result = EndTriggerGameObject::create();
goto LABEL_334;
}
v15 = 3601;
goto LABEL_86;
}
if ( a1 != 3605 )
{
if ( a1 <= 3605 )
{
result = EventLinkTrigger::create();
goto LABEL_334;
}
goto LABEL_307;
}
goto LABEL_321;
}
if ( a1 == 3655 )
{
result = ObjectControlGameObject::create();
goto LABEL_334;
}
if ( a1 > 3655 )
{
if ( a1 == 4211 )
goto LABEL_332;
if ( a1 > 4211 )
{
if ( a1 == 4300 )
goto LABEL_332;
if ( a1 < 4300 )
goto LABEL_333;
v6 = (unsigned int)(a1 - 4401) > 0x8A;
LABEL_291:
if ( !v6 )
goto LABEL_307;
goto LABEL_333;
}
if ( a1 < 3660 )
goto LABEL_333;
if ( a1 <= 3661 )
{
result = AdvancedFollowEditObject::create(v3);
goto LABEL_334;
}
v15 = 3662;
goto LABEL_86;
}
if ( a1 != 3641 )
{
if ( a1 > 3641 )
{
if ( a1 == 3643 )
goto LABEL_299;
if ( a1 < 3643 )
{
result = AudioLineGuideGameObject::create();
goto LABEL_334;
}
if ( a1 != 3645 )
goto LABEL_333;
goto LABEL_310;
}
if ( a1 > 3620 )
{
v15 = 3640;
goto LABEL_86;
}
}
result = ItemTriggerGameObject::create(v3);
goto LABEL_334;
}
if ( a1 >= 3492 )
goto LABEL_332;
if ( a1 == 3022 )
{
v18 = 1;
LABEL_331:
result = TeleportPortalObject::create(v3, v18);
goto LABEL_334;
}
if ( a1 <= 3022 )
{
if ( a1 > 3002 )
{
if ( a1 > 3015 )
{
if ( a1 == 3016 )
{
result = AdvancedFollowTriggerObject::create(v3);
goto LABEL_334;
}
goto LABEL_325;
}
if ( a1 >= 3006 )
{
LABEL_325:
result = EnterEffectObject::create(v3);
goto LABEL_334;
}
if ( a1 == 3004 )
goto LABEL_297;
v15 = 3005;
goto LABEL_86;
}
if ( a1 >= 3000 )
goto LABEL_332;
if ( a1 == 2925 )
goto LABEL_314;
if ( a1 > 2925 )
{
if ( a1 == 2926 )
goto LABEL_307;
v15 = 2999;
goto LABEL_86;
}
if ( a1 < 2919 )
goto LABEL_333;
goto LABEL_326;
}
if ( a1 == 3033 )
{
result = KeyframeAnimTriggerObject::create();
goto LABEL_334;
}
if ( a1 > 3033 )
{
if ( a1 > 3304 )
{
v10 = a1 - 3482;
goto LABEL_250;
}
if ( a1 >= 3303 )
goto LABEL_332;
if ( a1 < 3119 )
goto LABEL_333;
if ( a1 <= 3121 )
goto LABEL_332;
v16 = 3219;
LABEL_160:
if ( a1 != v16 )
goto LABEL_333;
goto LABEL_332;
}
if ( a1 == 3027 )
goto LABEL_330;
if ( a1 <= 3027 )
{
if ( a1 <= 3024 )
goto LABEL_325;
goto LABEL_333;
}
if ( a1 < 3029 )
goto LABEL_333;
if ( a1 > 3031 )
result = KeyframeGameObject::create();
else
result = ArtTriggerGameObject::create(v3);
LABEL_334:
if ( !result )
return nullptr;
LABEL_335:
m_unk390 = result->m_unk390;
result->m_objectID = a1;
if ( m_unk390 == 7 )
result->m_unk390 = result->m_objectType;
return result;
}