//
// GJBaseGameLayer::getMinDistance from 0x9aa200 to 0x9aa6fc (1276 bytes)
//
// 4 xrefs:
// > GJBaseGameLayer::volumeForProximityEffect @ 0x9aa84c
// > GJBaseGameLayer::volumeForProximityEffect @ 0x9aa9d0
// > GJBaseGameLayer::volumeForProximityEffect @ 0x9aaa10
// > ??> @ 0x670c0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 12:58:12 +0000
//
__int64 __fastcall GJBaseGameLayer::getMinDistance(float a1, __int64 a2, float *a3, __int64 a4, int a5)
{
unsigned int *v7; // x1
_BYTE **v8; // x21
_BYTE **v9; // x23
unsigned int *v11; // x1
_BYTE **v12; // x21
_BYTE **v13; // x23
_BYTE *v14; // x0
float v15; // s8
float v16; // s1
unsigned int *v17; // x1
_BYTE **v18; // x21
_BYTE **v19; // x23
_BYTE *v20; // x0
float v21; // s8
const cocos2d::CCPoint *v22; // x2
const cocos2d::CCPoint *v23; // x2
float v24; // s0
unsigned int *v25; // x1
_BYTE **v26; // x21
_BYTE **v27; // x23
_BYTE *v28; // x0
float v29; // s8
float v30; // s0
unsigned int *v31; // x1
_BYTE **v32; // x21
_BYTE **v33; // x23
_BYTE *v34; // x0
float v35; // s8
unsigned int *v36; // x1
_BYTE **v37; // x21
_BYTE **v38; // x23
_BYTE *v39; // x0
float v40; // s8
unsigned int *v41; // x1
_BYTE **v42; // x21
_BYTE **v43; // x23
_BYTE *v44; // x0
float v45; // s8
float v46; // s0
_BYTE *v47; // x0
float v48; // s8
float v49; // s0
float v52; // [xsp+68h] [xbp+68h] BYREF
float v53; // [xsp+6Ch] [xbp+6Ch]
_BYTE v54[8]; // [xsp+70h] [xbp+70h] BYREF
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52);
switch ( a5 )
{
case 0:
if ( a4 )
{
v17 = *(unsigned int **)(a4 + 56);
if ( *v17 )
{
v18 = *((_BYTE ***)v17 + 2);
v19 = &v18[*v17 - 1];
if ( v18 <= v19 )
{
v20 = *v18;
v21 = 2147500000.0;
if ( *v18 )
{
if ( !v20[650] )
goto LABEL_26;
while ( v19 >= ++v18 )
{
v20 = *v18;
if ( !*v18 )
break;
if ( !v20[650] )
{
LABEL_26:
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)v20 + 1360LL))(v20);
cocos2d::CCPoint::operator=(&v52, v54);
cocos2d::ccpDistance((cocos2d *)&v52, (const cocos2d::CCPoint *)a3, v22);
if ( v21 > v24 )
{
cocos2d::ccpDistance((cocos2d *)&v52, (const cocos2d::CCPoint *)a3, v23);
v21 = v49;
}
if ( v21 <= a1 )
return _stack_chk_guard;
}
}
}
}
}
}
break;
case 1:
if ( a4 )
{
v25 = *(unsigned int **)(a4 + 56);
if ( *v25 )
{
v26 = *((_BYTE ***)v25 + 2);
v27 = &v26[*v25 - 1];
if ( v26 <= v27 )
{
v28 = *v26;
v29 = 2147500000.0;
if ( *v26 )
{
if ( !v28[650] )
goto LABEL_38;
while ( v27 >= ++v26 )
{
v28 = *v26;
if ( !*v26 )
break;
if ( !v28[650] )
{
LABEL_38:
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)v28 + 1360LL))(v28);
cocos2d::CCPoint::operator=(&v52, v54);
v30 = vabds_f32(v52, *a3);
if ( v29 > v30 )
v29 = v30;
if ( v29 <= a1 )
return _stack_chk_guard;
}
}
}
}
}
}
break;
case 2:
if ( a4 )
{
v31 = *(unsigned int **)(a4 + 56);
if ( *v31 )
{
v32 = *((_BYTE ***)v31 + 2);
v33 = &v32[*v31 - 1];
if ( v32 <= v33 )
{
v34 = *v32;
v35 = 2147500000.0;
if ( *v32 )
{
if ( !v34[650] )
goto LABEL_50;
while ( v33 >= ++v32 )
{
v34 = *v32;
if ( !*v32 )
break;
if ( !v34[650] )
{
LABEL_50:
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)v34 + 1360LL))(v34);
cocos2d::CCPoint::operator=(&v52, v54);
if ( v35 > (float)(v52 - *a3) )
v35 = v52 - *a3;
if ( v35 <= a1 )
return _stack_chk_guard;
}
}
}
}
}
}
break;
case 3:
if ( a4 )
{
v36 = *(unsigned int **)(a4 + 56);
if ( *v36 )
{
v37 = *((_BYTE ***)v36 + 2);
v38 = &v37[*v36 - 1];
if ( v37 <= v38 )
{
v39 = *v37;
v40 = 2147500000.0;
if ( *v37 )
{
if ( !v39[650] )
goto LABEL_62;
while ( v38 >= ++v37 )
{
v39 = *v37;
if ( !*v37 )
break;
if ( !v39[650] )
{
LABEL_62:
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)v39 + 1360LL))(v39);
cocos2d::CCPoint::operator=(&v52, v54);
if ( v40 > (float)(*a3 - v52) )
v40 = *a3 - v52;
if ( v40 <= a1 )
return _stack_chk_guard;
}
}
}
}
}
}
break;
case 4:
if ( a4 )
{
v41 = *(unsigned int **)(a4 + 56);
if ( *v41 )
{
v42 = *((_BYTE ***)v41 + 2);
v43 = &v42[*v41 - 1];
if ( v42 <= v43 )
{
v44 = *v42;
v45 = 2147500000.0;
if ( *v42 )
{
if ( !v44[650] )
goto LABEL_74;
while ( v43 >= ++v42 )
{
v44 = *v42;
if ( !*v42 )
break;
if ( !v44[650] )
{
LABEL_74:
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)v44 + 1360LL))(v44);
cocos2d::CCPoint::operator=(&v52, v54);
v46 = vabds_f32(v53, a3[1]);
if ( v45 > v46 )
v45 = v46;
if ( v45 <= a1 )
return _stack_chk_guard;
}
}
}
}
}
}
break;
case 5:
if ( a4 )
{
v11 = *(unsigned int **)(a4 + 56);
if ( *v11 )
{
v12 = *((_BYTE ***)v11 + 2);
v13 = &v12[*v11 - 1];
if ( v12 <= v13 )
{
v14 = *v12;
v15 = 2147500000.0;
if ( *v12 )
{
if ( !v14[650] )
goto LABEL_14;
while ( v13 >= ++v12 )
{
v14 = *v12;
if ( !*v12 )
break;
if ( !v14[650] )
{
LABEL_14:
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)v14 + 1360LL))(v14);
cocos2d::CCPoint::operator=(&v52, v54);
v16 = a3[1];
if ( v15 > (float)(v53 - v16) )
v15 = v53 - v16;
if ( v15 <= a1 )
return _stack_chk_guard;
}
}
}
}
}
}
break;
case 6:
if ( a4 )
{
v7 = *(unsigned int **)(a4 + 56);
if ( *v7 )
{
v8 = *((_BYTE ***)v7 + 2);
v9 = &v8[*v7 - 1];
if ( v8 <= v9 )
{
v47 = *v8;
v48 = 2147500000.0;
if ( *v8 )
{
if ( !v47[650] )
goto LABEL_83;
while ( v9 >= ++v8 )
{
v47 = *v8;
if ( !*v8 )
break;
if ( !v47[650] )
{
LABEL_83:
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)v47 + 1360LL))(v47);
cocos2d::CCPoint::operator=(&v52, v54);
if ( v48 > (float)(a3[1] - v53) )
v48 = a3[1] - v53;
if ( v48 <= a1 )
return _stack_chk_guard;
}
}
}
}
}
}
break;
default:
return _stack_chk_guard;
}
return _stack_chk_guard;
}