//
// GJGameState::getGameObjectPhysics from 0x880b00 to 0x880d20 (544 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::processAdvancedFollowAction @ 0x883bb4
// > GJBaseGameLayer::processAdvancedFollowAction @ 0x884050
// > ??> @ 0x303a8
//
// 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)
{
int m_uniqueID; // w22
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 M_bucket_count; // x4
unsigned __int64 v6; // x5
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>::__bucket_type v7; // x6
std::__detail::_Hash_node_base *M_nxt; // x2
int v9; // w0
GameObjectPhysics *v10; // x1
__int64 v12; // x23
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 v13; // x6
int v14; // w8
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>::__bucket_type *M_buckets; // x0
unsigned __int64 v16; // x1
char **v17; // x7
char *v18; // x4
int v19; // w0
char *inserted; // x22
cocos2d::CCPoint v21; // [xsp+60h] [xbp+60h] BYREF
cocos2d::CCPoint v22; // [xsp+68h] [xbp+68h] BYREF
int v23; // [xsp+70h] [xbp+70h]
int v24; // [xsp+74h] [xbp+74h]
int v25; // [xsp+78h] [xbp+78h]
int v26; // [xsp+7Ch] [xbp+7Ch]
int v27; // [xsp+80h] [xbp+80h]
m_uniqueID = a2->m_uniqueID;
M_bucket_count = a1->m_gameObjectPhysics._M_h._M_bucket_count;
v6 = m_uniqueID % M_bucket_count;
v7 = a1->m_gameObjectPhysics._M_h._M_buckets[v6];
if ( !v7 )
goto LABEL_8;
M_nxt = v7->_M_nxt;
if ( m_uniqueID != LODWORD(v7->_M_nxt[1]._M_nxt) )
{
while ( M_nxt->_M_nxt )
{
v9 = (int)M_nxt->_M_nxt[1]._M_nxt;
v7 = M_nxt;
if ( v6 != v9 % M_bucket_count )
break;
M_nxt = M_nxt->_M_nxt;
if ( m_uniqueID == v9 )
goto LABEL_6;
}
LABEL_8:
cocos2d::CCPoint::CCPoint(&v21);
cocos2d::CCPoint::CCPoint(&v22);
v25 = 0;
v26 = 0;
v27 = 0;
v23 = 0;
v24 = 0;
v12 = operator new(0x40u);
*(_QWORD *)v12 = 0;
*(_DWORD *)(v12 + 8) = m_uniqueID;
*(_QWORD *)(v12 + 16) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)(v12 + 24), &v21);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)(v12 + 32), &v22);
*(_DWORD *)(v12 + 48) = v25;
*(_DWORD *)(v12 + 52) = v26;
*(_DWORD *)(v12 + 56) = v27;
v13 = a1->m_gameObjectPhysics._M_h._M_bucket_count;
v14 = *(_DWORD *)(v12 + 8);
M_buckets = a1->m_gameObjectPhysics._M_h._M_buckets;
*(_DWORD *)(v12 + 40) = v23;
*(_DWORD *)(v12 + 44) = v24;
v16 = v14 % v13;
v17 = (char **)M_buckets[v16];
if ( v17 )
{
v18 = *v17;
if ( *((_DWORD *)*v17 + 2) == v14 )
{
LABEL_13:
inserted = *v17;
if ( *v17 )
{
operator delete((void *)v12);
LABEL_15:
v10 = (GameObjectPhysics *)(inserted + 16);
*((_QWORD *)inserted + 2) = a2;
goto LABEL_7;
}
}
else
{
while ( *(_QWORD *)v18 )
{
v19 = *(_DWORD *)(*(_QWORD *)v18 + 8LL);
v17 = (char **)v18;
if ( v16 != v19 % v13 )
break;
v18 = *(char **)v18;
if ( v19 == v14 )
goto LABEL_13;
}
}
}
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(
(char **)&a1->m_gameObjectPhysics,
v16,
v14,
(char *)v12);
goto LABEL_15;
}
LABEL_6:
v10 = (GameObjectPhysics *)&v7->_M_nxt[2];
if ( !v7->_M_nxt )
goto LABEL_8;
LABEL_7:
v10->m_unkInt1 = a1->m_commandIndex;
return v10;
}