//
// GJBaseGameLayer::claimRotationAction from 0x14022d9a0 to 0x14022dbdf (575 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::processRotationActions @ 0x14022bb3e
// > GJBaseGameLayer::processTransformActions @ 0x14022cbf4
// > ??> @ 0x1406cdcb0
//
// 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 GJBaseGameLayer::claimRotationAction(GJBaseGameLayer *a1, int a2, int a3, float *a4, float *a5, bool a6, bool a7)
{
GJEffectManager *m_effectManager; // rsi
std::_Tree_val, std::vector>>>::_Nodeptr Myhead; // r11
std::_Tree_val, std::vector>>>::_Nodeptr v11; // rbx
__int64 *v12; // rax
char v13; // r9
std::_Tree_simple_types, std::vector>>::_Node *v14; // rcx
__int64 *v15; // rax
__int64 *v16; // r8
__int64 v17; // rcx
double v18; // xmm0_8
float v19; // xmm2_4
__int64 v20; // rcx
double v21; // xmm0_8
float v22; // xmm2_4
std::_Tree_val, std::vector>>>::_Nodeptr v23; // r9
std::_Tree_val, std::vector>>>::_Nodeptr v24; // r8
__int64 *v25; // rax
int v26; // ecx
std::_Tree_simple_types, std::vector>>::_Node **v27; // rax
std::_Tree_simple_types, std::vector>>::_Node *v28; // rax
_QWORD v29[3]; // [rsp+20h] [rbp-18h] BYREF
m_effectManager = a1->m_effectManager;
Myhead = m_effectManager->m_unkMap770._Mypair._Myval2._Myval2._Myhead;
v11 = Myhead;
v12 = *((__int64 **)Myhead + 1);
v13 = *((_BYTE *)v12 + 25);
if ( !v13 )
{
v14 = *((std::_Tree_simple_types, std::vector>>::_Node **)Myhead
+ 1);
do
{
if ( *((_DWORD *)v14 + 8) < a2 || *((_DWORD *)v14 + 8) <= a2 && *((_DWORD *)v14 + 9) < a3 )
{
v14 = *((std::_Tree_simple_types, std::vector>>::_Node **)v14
+ 2);
}
else
{
v11 = v14;
v14 = *(std::_Tree_simple_types, std::vector>>::_Node **)v14;
}
}
while ( !*((_BYTE *)v14 + 25) );
}
if ( !*((_BYTE *)v11 + 25) && a2 >= *((_DWORD *)v11 + 8) && (a2 > *((_DWORD *)v11 + 8) || a3 >= *((_DWORD *)v11 + 9)) )
{
if ( !v13 )
{
do
{
if ( *((_DWORD *)v12 + 8) < a2 || *((_DWORD *)v12 + 8) <= a2 && *((_DWORD *)v12 + 9) < a3 )
{
v12 = (__int64 *)v12[2];
}
else
{
Myhead = (std::_Tree_val, std::vector>>>::_Nodeptr)v12;
v12 = (__int64 *)*v12;
}
}
while ( !*((_BYTE *)v12 + 25) );
}
if ( *((_BYTE *)Myhead + 25)
|| a2 < *((_DWORD *)Myhead + 8)
|| a2 <= *((_DWORD *)Myhead + 8) && a3 < *((_DWORD *)Myhead + 9) )
{
std::_Xout_of_range("invalid map key");
JUMPOUT(0x14022DBDELL);
}
v15 = *((__int64 **)Myhead + 5);
v16 = *((__int64 **)Myhead + 6);
if ( v15 != v16 )
{
if ( a6 )
{
do
{
v20 = *v15;
if ( !*(_BYTE *)(*v15 + 424) )
{
v21 = *(double *)(v20 + 168) - *(double *)(v20 + 280);
*(_BYTE *)(v20 + 424) = 1;
v22 = v21;
*a4 = v22 + *a4;
if ( !*(_BYTE *)(v20 + 184) )
*a5 = v22 + *a5;
}
++v15;
}
while ( v15 != v16 );
}
else
{
do
{
v17 = *v15;
if ( !*(_BYTE *)(*v15 + 424) )
{
v18 = *(double *)(v17 + 160) - *(double *)(v17 + 272);
*(_BYTE *)(v17 + 424) = 1;
v19 = v18;
*a4 = v19 + *a4;
if ( !*(_BYTE *)(v17 + 184) )
*a5 = v19 + *a5;
}
++v15;
}
while ( v15 != v16 );
}
}
v23 = m_effectManager->m_unkMap770._Mypair._Myval2._Myval2._Myhead;
v24 = v23;
v25 = *((__int64 **)v23 + 1);
while ( !*((_BYTE *)v25 + 25) )
{
v26 = *((_DWORD *)v25 + 8);
if ( v26 < a2 || v26 <= a2 && *((_DWORD *)v25 + 9) < a3 )
{
v25 = (__int64 *)v25[2];
}
else
{
if ( *((_BYTE *)v24 + 25) && (a2 < v26 || a3 < *((_DWORD *)v25 + 9)) )
v24 = (std::_Tree_val, std::vector>>>::_Nodeptr)v25;
v23 = (std::_Tree_val, std::vector>>>::_Nodeptr)v25;
v25 = (__int64 *)*v25;
}
}
if ( *((_BYTE *)v24 + 25) )
v27 = (std::_Tree_simple_types, std::vector>>::_Node **)((char *)m_effectManager->m_unkMap770._Mypair._Myval2._Myval2._Myhead + 8);
else
v27 = (std::_Tree_simple_types, std::vector>>::_Node **)v24;
v28 = *v27;
while ( !*((_BYTE *)v28 + 25) )
{
if ( a2 < *((_DWORD *)v28 + 8) || a2 <= *((_DWORD *)v28 + 8) && a3 < *((_DWORD *)v28 + 9) )
{
v24 = v28;
v28 = *(std::_Tree_simple_types, std::vector>>::_Node **)v28;
}
else
{
v28 = *((std::_Tree_simple_types, std::vector>>::_Node **)v28
+ 2);
}
}
v29[0] = v23;
v29[1] = v24;
sub_14024C170(&m_effectManager->m_unkMap770, v29);
}
}