//
// GJBaseGameLayer::checkCollisionBlocks from 0x58f9e4 to 0x58fb20 (316 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::updateCollisionBlocks @ 0x5935c2
// > GJBaseGameLayer::updateCollisionBlocks @ 0x59360e
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:53:04 +0000
//
char *__fastcall GJBaseGameLayer::checkCollisionBlocks(_DWORD *a1, int a2, _DWORD *a3, int a4)
{
const cocos2d::CCRect *v8; // r0
float v9; // s16
float v10; // s17
float v11; // s18
int v12; // r6
float v13; // s19
char *result; // r0
float *v15; // r8
int v16; // r5
float v17; // s15
float *v18; // r9
int v19; // [sp+0h] [bp-24h]
_BYTE v20[16]; // [sp+Ch] [bp-18h] BYREF
v19 = *(_DWORD *)(a2 + 780);
v8 = (const cocos2d::CCRect *)(*(int (__fastcall **)(int))(*(_DWORD *)a2 + 664))(a2);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v20, v8);
v9 = COERCE_FLOAT(cocos2d::CCRect::getMaxX((cocos2d::CCRect *)v20));
v10 = COERCE_FLOAT(cocos2d::CCRect::getMinX((cocos2d::CCRect *)v20));
v11 = COERCE_FLOAT(cocos2d::CCRect::getMaxY((cocos2d::CCRect *)v20));
v12 = 0;
v13 = COERCE_FLOAT(cocos2d::CCRect::getMinY((cocos2d::CCRect *)v20));
result = (char *)(*(int (__fastcall **)(int))(*(_DWORD *)a2 + 780))(a2);
v15 = (float *)result;
while ( v12 < a4 )
{
v16 = *(_DWORD *)(*a3 + 4 * v12);
if ( !*(_BYTE *)(v16 + 550) && *(_DWORD *)(v16 + 1644) != a1[524] )
{
result = GameObject::getObjectRectPointer(*(GameObject **)(*a3 + 4 * v12));
if ( v9 >= *(float *)result && (float)(*(float *)result + *((float *)result + 2)) >= v10 )
{
v17 = *((float *)result + 1);
if ( v11 >= v17 && (float)(v17 + *((float *)result + 3)) >= v13 && *(_DWORD *)(v16 + 780) != v19 )
{
if ( !*(_BYTE *)(a2 + 636) && !*(_BYTE *)(v16 + 636)
|| (v18 = (float *)(*(int (__fastcall **)(int))(*(_DWORD *)v16 + 780))(v16),
(result = (char *)OBB2D::overlaps1Way((int)v15, v18)) != nullptr)
&& (result = (char *)OBB2D::overlaps1Way((int)v18, v15)) != nullptr )
{
result = (char *)(*(int (__fastcall **)(_DWORD *, _DWORD, _DWORD))(*a1 + 612))(
a1,
*(_DWORD *)(a2 + 1500),
*(_DWORD *)(v16 + 1500));
}
}
}
}
++v12;
}
return result;
}