//
// GameObject::createWithKey from 0x6542a4 to 0x654db0 (2828 bytes)
//
// 8 xrefs:
// > PlayLayer::setupHasCompleted @ 0x5dca44
// > GameObject::objectFromVector @ 0x654ed0
// > LevelEditorLayer::copyObjectState @ 0x661bb4
// > LevelEditorLayer::createObject @ 0x671df4
// > EditorUI::getCreateBtn @ 0x69481c
// > GJBaseGameLayer::createPlayerCollisionBlock @ 0x85b350
// > GJMapObject::createMonster @ 0x97e740
// > ??> @ 0x42f00
//
// 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; // x0
const char *v3; // x0
GameObject *v4; // x1
int m_unk390; // w2
GameObject *result; // x0
cocos2d::CCTextureCache *v7; // x20
GameManager *v8; // x21
GameManager *v9; // x0
const char *FontTexture; // x0
cocos2d::CCTexture2D *v11; // x0
v2 = ObjectToolbox::sharedState();
v3 = ObjectToolbox::intKeyToFrame(v2, a1);
if ( !a1 || !*v3 )
return nullptr;
if ( a1 <= 1819 )
{
if ( a1 >= 1818 )
goto LABEL_166;
if ( a1 <= 921 )
{
if ( a1 >= 920 )
goto LABEL_162;
if ( a1 == 142 )
goto LABEL_166;
if ( a1 <= 142 )
{
if ( a1 > 59 )
{
if ( a1 == 99 )
goto LABEL_166;
if ( a1 > 99 )
{
if ( a1 <= 139 )
{
if ( a1 < 137 )
{
if ( a1 != 105 && a1 != 111 && a1 != 101 )
goto LABEL_144;
goto LABEL_166;
}
goto LABEL_162;
}
if ( a1 == 140 )
goto LABEL_166;
}
else
{
if ( a1 > 89 )
{
if ( a1 < 97 )
goto LABEL_144;
goto LABEL_162;
}
if ( a1 >= 85 )
goto LABEL_162;
if ( a1 == 67 )
goto LABEL_166;
if ( a1 != 84 )
goto LABEL_144;
}
}
else
{
if ( a1 >= 55 )
goto LABEL_174;
if ( a1 == 31 )
{
v4 = StartPosObject::create();
goto LABEL_14;
}
if ( a1 <= 31 )
{
if ( a1 > 28 )
goto LABEL_166;
if ( a1 < 22 )
{
if ( (unsigned int)(a1 - 10) > 3 )
goto LABEL_144;
goto LABEL_166;
}
goto LABEL_174;
}
if ( a1 == 35 )
goto LABEL_166;
if ( a1 <= 35 )
{
if ( a1 > 33 )
goto LABEL_144;
goto LABEL_166;
}
if ( a1 != 36 )
{
if ( (unsigned int)(a1 - 45) > 2 )
goto LABEL_144;
goto LABEL_166;
}
}
goto LABEL_189;
}
if ( a1 == 660 )
goto LABEL_166;
if ( a1 <= 660 )
{
if ( a1 > 224 )
{
if ( a1 > 378 )
{
if ( (unsigned int)(a1 - 394) > 5 )
goto LABEL_144;
}
else if ( a1 < 375 )
{
if ( (unsigned int)(a1 - 286) > 1 )
goto LABEL_144;
goto LABEL_166;
}
}
else if ( a1 < 222 )
{
if ( a1 > 188 )
{
if ( (unsigned int)(a1 - 200) > 3 )
goto LABEL_144;
goto LABEL_166;
}
if ( a1 < 180 && (unsigned int)(a1 - 154) > 2 )
goto LABEL_144;
}
goto LABEL_162;
}
if ( a1 == 749 )
goto LABEL_103;
if ( a1 <= 749 )
{
if ( a1 <= 742 )
{
if ( a1 < 740 && (unsigned int)(a1 - 675) > 5 )
goto LABEL_144;
goto LABEL_162;
}
if ( a1 < 744 )
goto LABEL_144;
if ( a1 <= 745 )
goto LABEL_166;
if ( a1 != 747 )
goto LABEL_144;
goto LABEL_103;
}
if ( a1 == 914 )
{
v7 = cocos2d::CCTextureCache::sharedTextureCache();
v8 = GameManager::sharedState();
v9 = GameManager::sharedState();
FontTexture = GameManager::getFontTexture(v8, v9->m_loadedFont);
v11 = cocos2d::CCTextureCache::addImage(v7, FontTexture, 0);
v4 = TextGameObject::create(v11);
goto LABEL_14;
}
if ( a1 > 914 )
{
if ( a1 == 915 )
goto LABEL_166;
if ( a1 < 918 )
goto LABEL_144;
goto LABEL_180;
}
if ( a1 < 899 )
goto LABEL_144;
if ( a1 <= 900 )
goto LABEL_166;
if ( a1 != 901 )
goto LABEL_144;
}
else
{
if ( a1 > 1583 )
{
if ( a1 <= 1620 )
{
if ( a1 >= 1618 )
goto LABEL_162;
if ( a1 == 1594 )
{
LABEL_110:
v4 = RingObject::create(v3);
v4->m_classType = Effect;
goto LABEL_15;
}
if ( a1 <= 1594 )
{
if ( a1 == 1587 )
goto LABEL_166;
if ( a1 > 1587 )
{
if ( a1 == 1589 )
goto LABEL_166;
if ( a1 <= 1590 )
goto LABEL_144;
goto LABEL_162;
}
if ( a1 != 1584 )
{
if ( a1 != 1585 )
goto LABEL_144;
goto LABEL_166;
}
goto LABEL_180;
}
if ( a1 > 1614 )
{
if ( a1 != 1615 )
{
if ( a1 == 1616 )
{
v4 = TriggerControlGameObject::create(v3);
goto LABEL_14;
}
goto LABEL_144;
}
v4 = LabelGameObject::create();
goto LABEL_14;
}
if ( a1 >= 1612 || a1 == 1598 )
goto LABEL_166;
if ( a1 != 1611 )
{
if ( a1 != 1595 )
goto LABEL_144;
goto LABEL_166;
}
LABEL_177:
v4 = CountTriggerGameObject::create(v3);
goto LABEL_14;
}
if ( a1 <= 1736 )
{
if ( a1 >= 1734 )
goto LABEL_162;
if ( a1 != 1704 )
{
if ( a1 > 1704 )
{
if ( a1 > 1710 )
goto LABEL_144;
}
else if ( (unsigned int)(a1 - 1697) > 2 )
{
goto LABEL_144;
}
goto LABEL_162;
}
}
else
{
if ( a1 == 1811 )
goto LABEL_177;
if ( a1 > 1811 )
{
if ( a1 <= 1816 )
goto LABEL_166;
goto LABEL_177;
}
if ( a1 == 1752 )
goto LABEL_162;
if ( a1 == 1755 )
goto LABEL_166;
if ( a1 != 1751 )
goto LABEL_144;
}
v4 = DashRingObject::create(v3);
goto LABEL_14;
}
if ( a1 >= 1582 )
goto LABEL_162;
if ( a1 <= 1328 )
{
if ( a1 < 1327 )
{
if ( a1 <= 1021 )
{
if ( a1 < 1019 )
{
if ( a1 > 1000 )
{
if ( (unsigned int)(a1 - 1006) > 1 )
goto LABEL_144;
goto LABEL_166;
}
if ( a1 < 997 && (unsigned int)(a1 - 923) > 1 )
goto LABEL_144;
}
goto LABEL_162;
}
if ( a1 > 1061 )
{
if ( a1 == 1268 )
{
v4 = SpawnTriggerGameObject::create();
goto LABEL_14;
}
if ( a1 != 1275 )
goto LABEL_144;
goto LABEL_166;
}
if ( a1 >= 1050 )
goto LABEL_162;
if ( a1 != 1022 )
{
if ( a1 != 1049 )
goto LABEL_144;
goto LABEL_166;
}
goto LABEL_189;
}
goto LABEL_180;
}
if ( a1 != 1346 )
{
if ( a1 > 1346 )
{
if ( a1 > 1519 )
{
if ( a1 == 1520 )
goto LABEL_166;
if ( a1 > 1528 )
goto LABEL_144;
}
else if ( a1 < 1518 )
{
if ( a1 == 1347 )
goto LABEL_166;
if ( a1 != 1516 )
goto LABEL_144;
}
goto LABEL_162;
}
if ( a1 > 1332 )
{
if ( a1 != 1333 )
{
if ( a1 != 1334 )
goto LABEL_144;
goto LABEL_166;
}
}
else if ( a1 >= 1331 || a1 == 1329 )
{
goto LABEL_166;
}
goto LABEL_189;
}
}
v4 = EnhancedTriggerObject::create(v3);
goto LABEL_14;
}
if ( a1 > 2917 )
{
if ( a1 > 3493 )
{
if ( a1 == 3618 )
goto LABEL_166;
if ( a1 <= 3618 )
{
if ( a1 == 3607 )
{
v4 = SequenceTriggerGameObject::create();
goto LABEL_14;
}
if ( a1 <= 3607 )
{
if ( a1 <= 3603 )
{
if ( a1 >= 3602 )
{
v4 = SFXTriggerGameObject::create(v3);
goto LABEL_14;
}
if ( a1 == 3600 )
{
v4 = EndTriggerGameObject::create();
goto LABEL_14;
}
if ( a1 != 3601 )
goto LABEL_144;
goto LABEL_166;
}
if ( a1 != 3605 )
{
if ( a1 <= 3605 )
{
v4 = EventLinkTrigger::create();
goto LABEL_14;
}
goto LABEL_166;
}
LABEL_151:
v4 = SongTriggerGameObject::create(v3);
goto LABEL_14;
}
if ( a1 == 3613 )
{
v4 = UISettingsGameObject::create();
goto LABEL_14;
}
if ( a1 <= 3613 )
{
if ( a1 != 3609 )
{
if ( a1 < 3609 )
{
v4 = SpawnParticleGameObject::create();
goto LABEL_14;
}
if ( a1 != 3612 )
goto LABEL_144;
}
goto LABEL_166;
}
if ( a1 <= 3615 || a1 == 3617 )
{
v4 = TimerTriggerGameObject::create(v3);
goto LABEL_14;
}
LABEL_144:
v4 = GameObject::createWithFrame(v3);
goto LABEL_14;
}
if ( a1 == 3655 )
{
v4 = ObjectControlGameObject::create();
goto LABEL_14;
}
if ( a1 <= 3655 )
{
if ( a1 == 3641 )
goto LABEL_109;
if ( a1 > 3641 )
{
if ( a1 != 3643 )
{
if ( a1 < 3643 )
{
v4 = AudioLineGuideGameObject::create();
goto LABEL_14;
}
if ( a1 != 3645 )
goto LABEL_144;
goto LABEL_183;
}
goto LABEL_110;
}
if ( a1 <= 3620 )
{
LABEL_109:
v4 = ItemTriggerGameObject::create(v3);
goto LABEL_14;
}
if ( a1 != 3640 )
goto LABEL_144;
LABEL_166:
v4 = EffectGameObject::create(v3);
goto LABEL_14;
}
if ( a1 != 4211 )
{
if ( a1 <= 4211 )
{
if ( a1 < 3660 )
goto LABEL_144;
if ( a1 <= 3661 )
{
v4 = AdvancedFollowEditObject::create(v3);
goto LABEL_14;
}
if ( a1 != 3662 )
goto LABEL_144;
goto LABEL_166;
}
if ( a1 != 4300 )
{
if ( a1 < 4300 || (unsigned int)(a1 - 4401) > 0x8A )
goto LABEL_144;
goto LABEL_166;
}
}
LABEL_162:
v4 = EnhancedGameObject::create(v3);
goto LABEL_14;
}
if ( a1 >= 3492 )
goto LABEL_162;
if ( a1 == 3022 )
{
v4 = TeleportPortalObject::create(v3, (bool)&dword_0 + 1);
goto LABEL_14;
}
if ( a1 > 3022 )
{
if ( a1 == 3033 )
{
v4 = KeyframeAnimTriggerObject::create();
goto LABEL_14;
}
if ( a1 > 3033 )
{
if ( a1 > 3304 )
{
if ( (unsigned int)(a1 - 3482) > 2 )
goto LABEL_144;
}
else if ( a1 < 3303 && (a1 < 3119 || a1 > 3121 && a1 != 3219) )
{
goto LABEL_144;
}
goto LABEL_162;
}
if ( a1 != 3027 )
{
if ( a1 > 3027 )
{
if ( a1 < 3029 )
goto LABEL_144;
if ( a1 > 3031 )
v4 = KeyframeGameObject::create();
else
v4 = ArtTriggerGameObject::create(v3);
LABEL_14:
if ( v4 )
goto LABEL_15;
return nullptr;
}
if ( a1 > 3024 )
goto LABEL_144;
goto LABEL_174;
}
LABEL_103:
v4 = TeleportPortalObject::create(v3, 0);
goto LABEL_14;
}
if ( a1 > 3002 )
{
if ( a1 > 3015 )
{
if ( a1 == 3016 )
{
v4 = AdvancedFollowTriggerObject::create(v3);
goto LABEL_14;
}
goto LABEL_174;
}
if ( a1 >= 3006 )
{
LABEL_174:
v4 = EnterEffectObject::create(v3);
goto LABEL_14;
}
if ( a1 != 3004 )
{
if ( a1 != 3005 )
goto LABEL_144;
goto LABEL_166;
}
LABEL_189:
v4 = RingObject::create(v3);
goto LABEL_14;
}
if ( a1 >= 3000 )
goto LABEL_162;
if ( a1 != 2925 )
{
if ( a1 > 2925 )
{
if ( a1 != 2926 && a1 != 2999 )
goto LABEL_144;
goto LABEL_166;
}
if ( a1 < 2919 )
goto LABEL_144;
goto LABEL_172;
}
LABEL_108:
v4 = CameraTriggerGameObject::create(v3);
goto LABEL_14;
}
if ( a1 >= 2909 )
goto LABEL_172;
if ( a1 <= 2054 )
{
if ( a1 >= 2048 )
goto LABEL_162;
if ( a1 == 1917 )
goto LABEL_166;
if ( a1 <= 1917 )
{
if ( a1 <= 1858 )
{
if ( a1 < 1849 )
{
if ( a1 > 1834 )
{
if ( (unsigned int)(a1 - 1839) > 3 )
goto LABEL_144;
}
else if ( a1 < 1831 )
{
if ( a1 != 1829 )
goto LABEL_144;
goto LABEL_166;
}
}
goto LABEL_162;
}
if ( a1 <= 1913 )
{
if ( a1 >= 1912 || a1 == 1859 )
goto LABEL_166;
if ( a1 != 1860 )
goto LABEL_144;
goto LABEL_162;
}
if ( a1 == 1915 )
goto LABEL_174;
goto LABEL_108;
}
if ( a1 <= 1939 )
{
if ( a1 < 1936 )
{
if ( a1 != 1933 )
{
if ( a1 <= 1933 )
{
if ( a1 != 1931 )
{
if ( a1 == 1932 )
{
v4 = PlayerControlGameObject::create();
goto LABEL_14;
}
goto LABEL_144;
}
goto LABEL_166;
}
if ( a1 == 1934 )
goto LABEL_151;
}
goto LABEL_166;
}
goto LABEL_162;
}
if ( a1 > 2045 )
{
LABEL_148:
v4 = SpecialAnimGameObject::create(v3);
goto LABEL_14;
}
if ( a1 >= 2020 )
goto LABEL_162;
if ( a1 != 2012 )
{
if ( a1 < 2012 || (unsigned int)(a1 - 2015) > 1 )
goto LABEL_144;
goto LABEL_108;
}
LABEL_180:
v4 = AnimatedGameObject::create(a1);
goto LABEL_14;
}
if ( a1 == 2694 )
goto LABEL_162;
if ( a1 > 2694 )
{
if ( a1 == 2899 )
{
v4 = GameOptionsTrigger::create(v3);
goto LABEL_14;
}
if ( a1 <= 2899 )
{
if ( a1 > 2894 )
{
if ( a1 <= 2897 )
{
v4 = SmartGameObject::create(v3);
goto LABEL_14;
}
goto LABEL_144;
}
if ( a1 < 2867 )
{
if ( a1 < 2864 )
goto LABEL_144;
if ( a1 > 2865 )
goto LABEL_166;
}
goto LABEL_162;
}
if ( a1 == 2903 )
{
v4 = GradientTriggerObject::create();
goto LABEL_14;
}
if ( a1 <= 2903 )
{
if ( a1 == 2901 )
goto LABEL_166;
if ( a1 <= 2901 )
{
v4 = RotateGameplayGameObject::create();
goto LABEL_14;
}
goto LABEL_103;
}
if ( a1 > 2905 && a1 != 2907 )
goto LABEL_144;
LABEL_172:
v4 = ShaderGameObject::create(v3);
goto LABEL_14;
}
if ( a1 == 2067 )
{
v4 = TransformTriggerGameObject::create(v3);
goto LABEL_14;
}
if ( a1 > 2067 )
{
if ( a1 != 2246 )
{
if ( a1 > 2246 )
{
if ( a1 != 2605 && (a1 < 2605 || (unsigned int)(a1 - 2629) > 1) )
goto LABEL_144;
}
else
{
if ( a1 == 2069 )
{
LABEL_183:
v4 = ForceBlockGameObject::create(v3);
goto LABEL_14;
}
if ( a1 < 2069 )
{
v4 = RandTriggerGameObject::create();
goto LABEL_14;
}
if ( a1 != 2223 )
goto LABEL_144;
}
}
goto LABEL_162;
}
if ( a1 == 2063 )
{
v4 = CheckpointGameObject::create();
goto LABEL_14;
}
if ( a1 <= 2063 )
{
if ( a1 != 2055 )
{
if ( a1 != 2062 )
goto LABEL_144;
goto LABEL_108;
}
goto LABEL_148;
}
if ( a1 != 2065 )
{
if ( a1 > 2065 )
goto LABEL_166;
goto LABEL_103;
}
v4 = ParticleGameObject::create();
if ( !v4 )
return nullptr;
LABEL_15:
m_unk390 = v4->m_unk390;
result = v4;
v4->m_objectID = a1;
if ( m_unk390 == 7 )
v4->m_unk390 = v4->m_objectType;
return result;
}