//
// GJBaseGameLayer::modifyGroupPhysics from 0x100148490 to 0x1001486cc (572 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::triggerAdvancedFollowEditCommand @ 0x1001483bc
//
// 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
//
void __fastcall GJBaseGameLayer::modifyGroupPhysics(
GJBaseGameLayer *a1,
AdvancedFollowEditObject *a2,
cocos2d::CCArray *a3)
{
cocos2d::ccArray *data; // rax
cocos2d::CCObject **arr; // r15
unsigned __int64 v6; // r12
__int64 v7; // r11
__int64 v8; // rbx
unsigned __int64 value; // rdi
unsigned __int64 m_uReference; // rcx
unsigned __int64 v11; // r9
__int64 v12; // r10
std::__hash_node_base, void *> *> *v13; // rax
std::__hash_node_base, void *> *>::__next_pointer next; // r8
unsigned __int64 v15; // rdi
std::__hash_node_base, void *> *>::__next_pointer v16; // rax
unsigned __int64 v17; // rax
if ( a3 )
{
data = a3->data;
if ( data->num )
{
arr = data->arr;
v6 = (unsigned __int64)&arr[data->num - 1];
v7 = 0x5555555555555555LL;
while ( 1 )
{
if ( !*arr )
return;
value = a1->m_gameState.m_gameObjectPhysics.__table_.__bucket_list_.__ptr_.__value_.__data_.__value_;
if ( !value )
goto LABEL_5;
m_uReference = (int)(*arr)[16].m_uReference;
v11 = (0x101010101010101LL
* ((((value - (v7 & (value >> 1))) & 0x3333333333333333LL)
+ (((value - (v7 & (value >> 1))) >> 2) & 0x3333333333333333LL)
+ ((((value - (v7 & (value >> 1))) & 0x3333333333333333LL)
+ (((value - (v7 & (value >> 1))) >> 2) & 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v11 <= 1 )
{
v12 = m_uReference & (value - 1);
v13 = a1->m_gameState.m_gameObjectPhysics.__table_.__bucket_list_.__ptr_.__value_[v12];
if ( v13 )
goto LABEL_15;
goto LABEL_5;
}
v12 = (int)(*arr)[16].m_uReference;
if ( value > m_uReference )
goto LABEL_14;
if ( (value | m_uReference) >> 32 )
break;
v12 = (unsigned int)m_uReference % (unsigned int)value;
v13 = a1->m_gameState.m_gameObjectPhysics.__table_.__bucket_list_.__ptr_.__value_[v12];
if ( v13 )
{
LABEL_15:
next = v13->__next_;
if ( v13->__next_ )
{
if ( (unsigned int)v11 < 2 )
{
v15 = value - 1;
while ( 1 )
{
v16 = next[1].__next_;
if ( v16 == (std::__hash_node_base, void *> *>::__next_pointer)m_uReference )
{
if ( LODWORD(next[2].__next_) == (_DWORD)m_uReference )
goto LABEL_4;
}
else if ( (v15 & (unsigned __int64)v16) != v12 )
{
goto LABEL_5;
}
next = next->__next_;
if ( !next )
goto LABEL_5;
}
}
do
{
v17 = (unsigned __int64)next[1].__next_;
if ( v17 == m_uReference )
{
if ( LODWORD(next[2].__next_) == (_DWORD)m_uReference )
{
LABEL_4:
v8 = v7;
GJBaseGameLayer::modifyObjectPhysics(a1, a2, (GameObjectPhysics *)&next[3]);
v7 = v8;
break;
}
}
else
{
if ( v17 >= value )
{
if ( (value | v17) >> 32 )
v17 %= value;
else
v17 = (unsigned int)v17 % (unsigned int)value;
}
if ( v17 != v12 )
break;
}
next = next->__next_;
}
while ( next );
}
}
LABEL_5:
if ( (unsigned __int64)++arr > v6 )
return;
}
v12 = m_uReference % value;
LABEL_14:
v13 = a1->m_gameState.m_gameObjectPhysics.__table_.__bucket_list_.__ptr_.__value_[v12];
if ( v13 )
goto LABEL_15;
goto LABEL_5;
}
}
}