//
// GJBaseGameLayer::claimRotationAction from 0x100146f90 to 0x100147100 (368 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::processTransformActions @ 0x100145262
// > GJBaseGameLayer::processRotationActions @ 0x100145f1d
//
// 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
//
// local variable allocation has failed, the output may be wrong!
void __fastcall GJBaseGameLayer::claimRotationAction(
GJBaseGameLayer *a1,
int a2,
int a3,
float *a4,
float *a5,
bool a6,
bool a7)
{
GJEffectManager *m_effectManager; // rdi
std::__tree_end_node *>::pointer left; // r10
std::map,std::vector> *p_m_unkMap770; // rdi
std::__tree_end_node *>::pointer v10; // rax
__int64 *v11; // rax
__int64 *v12; // rdx
__int64 v13; // rsi
float v14; // xmm0_4
__int64 v15; // rsi
float v16; // xmm0_4
__int64 v17; // [rsp+8h] [rbp-8h] BYREF
v17 = (*(_QWORD *)&a3 << 32) | (unsigned int)a2;
m_effectManager = a1->m_effectManager;
left = m_effectManager->m_unkMap770.__tree_.__pair1_.__value_.__left_;
if ( !left )
return;
p_m_unkMap770 = &m_effectManager->m_unkMap770;
v10 = left;
while ( 1 )
{
if ( *((_DWORD *)v10 + 8) > a2 )
goto LABEL_4;
if ( *((_DWORD *)v10 + 8) >= a2 )
{
if ( *((_DWORD *)v10 + 9) > a3 )
goto LABEL_4;
if ( *((_DWORD *)v10 + 9) >= a3 )
break;
}
v10 = (std::__tree_end_node *>::pointer)((char *)v10 + 8);
LABEL_4:
v10 = *(std::__tree_end_node *>::pointer *)v10;
if ( !v10 )
return;
}
while ( 1 )
{
while ( *((_DWORD *)left + 8) > a2 )
{
LABEL_10:
left = *(std::__tree_end_node *>::pointer *)left;
if ( !left )
goto LABEL_16;
}
if ( *((_DWORD *)left + 8) >= a2 )
break;
LABEL_15:
left = *((std::__tree_end_node *>::pointer *)left + 1);
if ( !left )
LABEL_16:
sub_1000547D0((__int64)"map::at: key not found");
}
if ( *((_DWORD *)left + 9) > a3 )
goto LABEL_10;
if ( *((_DWORD *)left + 9) < a3 )
goto LABEL_15;
v11 = *((__int64 **)left + 5);
v12 = *((__int64 **)left + 6);
if ( v11 != v12 )
{
if ( a6 )
{
do
{
v13 = *v11;
if ( !*(_BYTE *)(*v11 + 424) )
{
*(_BYTE *)(v13 + 424) = 1;
v14 = *(double *)(v13 + 168) - *(double *)(v13 + 280);
*a4 = *a4 + v14;
if ( !*(_BYTE *)(v13 + 184) )
*a5 = v14 + *a5;
}
++v11;
}
while ( v11 != v12 );
}
else
{
do
{
v15 = *v11;
if ( !*(_BYTE *)(*v11 + 424) )
{
*(_BYTE *)(v15 + 424) = 1;
v16 = *(double *)(v15 + 160) - *(double *)(v15 + 272);
*a4 = *a4 + v16;
if ( !*(_BYTE *)(v15 + 184) )
*a5 = v16 + *a5;
}
++v11;
}
while ( v11 != v12 );
}
}
sub_10016EA00(p_m_unkMap770, &v17, v12, a4, a5, a6);
}