//
// GJGameState::getGameObjectPhysics from 0x48868c to 0x48878c (256 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::processAdvancedFollowAction @ 0x48a1b2
// > GJBaseGameLayer::processAdvancedFollowAction @ 0x48adf6
//
// 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
//
GameObjectPhysics *GJGameState::getGameObjectPhysics(GJGameState *a1, GameObject *a2)
{
std::unordered_map *p_m_gameObjectPhysics; // r9
int v5; // r0
GameObjectPhysics *result; // r0
cocos2d::CCPoint *v7; // r0
int v8; // r3
cocos2d::CCPoint *v9; // r4
_DWORD *p_y; // r10
unsigned int y_low; // r11
_DWORD **v12; // r0
_DWORD *inserted; // r5
std::_Hashtable, std::allocator>, std::__detail::_Select1st, std::equal_to, std::hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits>::size_type v14; // [sp+4h] [bp-38h]
int m_uniqueID; // [sp+8h] [bp-34h] BYREF
float v16; // [sp+Ch] [bp-30h]
cocos2d::CCPoint v17; // [sp+10h] [bp-2Ch] BYREF
cocos2d::CCPoint v18; // [sp+18h] [bp-24h] BYREF
float v19; // [sp+20h] [bp-1Ch]
float v20; // [sp+24h] [bp-18h]
float v21; // [sp+28h] [bp-14h]
float v22; // [sp+2Ch] [bp-10h]
float v23; // [sp+30h] [bp-Ch]
p_m_gameObjectPhysics = &a1->m_gameObjectPhysics;
m_uniqueID = a2->m_uniqueID;
v5 = std::_Hashtable,std::allocator>,std::__detail::_Select1st,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits>::find(
&a1->m_gameObjectPhysics._M_h._M_buckets,
&m_uniqueID);
if ( v5 )
{
result = (GameObjectPhysics *)(v5 + 8);
}
else
{
v16 = 0.0;
cocos2d::CCPoint::CCPoint(&v17);
cocos2d::CCPoint::CCPoint(&v18);
v21 = 0.0;
v19 = 0.0;
v20 = 0.0;
v22 = 0.0;
v23 = 0.0;
v7 = (cocos2d::CCPoint *)operator new(0x30u);
v8 = m_uniqueID;
v9 = v7;
v7->x = 0.0;
p_y = (_DWORD *)&v7->y;
v7 = (cocos2d::CCPoint *)((char *)v7 + 12);
LODWORD(v7[-1].x) = v8;
v7[-1].y = v16;
cocos2d::CCPoint::CCPoint(v7, &v17);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)((char *)v9 + 20), &v18);
y_low = LODWORD(v9->y);
v9[3].y = v19;
v9[4].x = v20;
v9[4].y = v21;
v9[5].x = v22;
v9[5].y = v23;
v14 = y_low % a1->m_gameObjectPhysics._M_h._M_bucket_count;
v12 = sub_46C5AE(p_m_gameObjectPhysics, v14, p_y);
if ( v12 && (inserted = *v12) != nullptr )
operator delete(v9);
else
inserted = std::_Hashtable,std::allocator>,std::__detail::_Select1st,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits>::_M_insert_unique_node(
(int)p_m_gameObjectPhysics,
v14,
y_low,
v9);
result = (GameObjectPhysics *)(inserted + 2);
inserted[2] = a2;
}
result->m_unkInt1 = a1->m_commandIndex;
return result;
}