//
// PlayerObject::rotateGameplayObject from 0x442448 to 0x44270a (706 bytes)
//
// 3 xrefs:
// > PlayerObject::rotatePreSlopeObjects @ 0x442726
// > PlayerObject::handleRotatedCollisionInternal @ 0x44275c
// > PlayerObject::spiderTestJumpInternal @ 0x4441d0
//
// 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:48:27 +0000
//
void __fastcall PlayerObject::rotateGameplayObject(PlayerObject *this, GameObject *a2)
{
int v2; // r7
char *v3; // r9
const cocos2d::CCPoint *v6; // r0
float v7; // s10
float v8; // s16
float v9; // s17
float v10; // s16
double v11; // d9
int LastPosition; // r11
int v13; // r3
int v14; // r0
unsigned int v15; // r10
_DWORD *v16; // r6
unsigned int v17; // r4
unsigned int v18; // r11
_DWORD *v19; // r3
unsigned int v20; // r0
int v21; // r1
float v22; // s13
float v23; // s15
bool v24; // r7
unsigned int v25; // r7
unsigned int v26; // r1
unsigned int v27; // r0
_DWORD *v28; // r3
int v29; // r3
unsigned int v30; // r0
int v31; // r1
float v32; // [sp+14h] [bp-30h] BYREF
float v33; // [sp+18h] [bp-2Ch]
float v34[2]; // [sp+1Ch] [bp-28h] BYREF
float v35; // [sp+24h] [bp-20h] BYREF
float v36; // [sp+28h] [bp-1Ch]
_BYTE v37[8]; // [sp+2Ch] [bp-18h] BYREF
unsigned int v38[2]; // [sp+34h] [bp-10h] BYREF
v3 = (char *)this + 1432;
v38[0] = *((_DWORD *)a2 + 195);
if ( std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::find(
(_DWORD *)this + 358,
v38) )
{
return;
}
(*(void (__fastcall **)(float *, GameObject *))(*(_DWORD *)a2 + 680))(&v32, a2);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v34, (const cocos2d::CCPoint *)&v32);
v6 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(PlayerObject *))(*(_DWORD *)this + 96))(this);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v35, v6);
v7 = (float)((float)((float)(v32 - v35) * -0.000000043711) - (float)(v33 - v36)) + v35;
v8 = (float)((float)(v32 - v35) + (float)((float)(v33 - v36) * -0.000000043711)) + v36;
v32 = v7;
v9 = v7 - v34[0];
v33 = v8;
v10 = v8 - v34[1];
v11 = (float)(v7 - v34[0]);
GameObject::addToTempOffset(a2, v11, v10);
LastPosition = GameObject::getLastPosition(a2);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v37, v9, v10);
cocos2d::CCPoint::operator+(v38, LastPosition, v37);
GameObject::setLastPosition(a2, (const cocos2d::CCPoint *)v38);
v13 = *(_DWORD *)a2;
*((float *)a2 + 209) = *((float *)a2 + 209) - 90.0;
*((float *)a2 + 210) = *((float *)a2 + 210) - 90.0;
(*(void (__fastcall **)(GameObject *, _DWORD))(v13 + 740))(a2, 0);
(*(void (__fastcall **)(GameObject *, int))(*(_DWORD *)a2 + 888))(a2, 1);
if ( (*(int (__fastcall **)(GameObject *))(*(_DWORD *)a2 + 900))(a2) == 25 )
GameObject::determineSlopeDirection(a2);
v14 = operator new(0x20u);
v15 = *((_DWORD *)a2 + 195);
*(double *)(v14 + 16) = v11;
v16 = (_DWORD *)v14;
*(_DWORD *)(v14 + 8) = v15;
*(_DWORD *)(v14 + 4) = v15;
*(double *)(v14 + 24) = v10;
*(_DWORD *)v14 = 0;
v17 = *((_DWORD *)this + 359);
if ( v17 )
{
v18 = v17 - 1;
v2 = ((v17 - 1) & v17) != 0 ? v15 % v17 : v18 & v15;
v19 = *(_DWORD **)(*((_DWORD *)this + 358) + 4 * v2);
if ( v19 )
{
while ( 1 )
{
v19 = (_DWORD *)*v19;
if ( !v19 )
break;
v20 = v19[1];
v21 = ((v17 - 1) & v17) != 0 ? v20 % v17 : v18 & v20;
if ( v21 != v2 )
break;
if ( v19[2] == v15 )
{
operator delete(v16);
return;
}
}
}
}
v22 = *((float *)this + 362);
v23 = (float)(unsigned int)(*((_DWORD *)this + 361) + 1);
if ( v23 > (float)((float)v17 * v22) )
{
v24 = v17 > 2 && ((v17 - 1) & v17) == 0;
goto LABEL_17;
}
if ( !v17 )
{
v24 = 0;
LABEL_17:
v25 = 2 * v17 + !v24;
v26 = (unsigned int)ceilf(v23 / v22);
if ( v26 < v25 )
v26 = v25;
std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::rehash(
(int)v3,
v26);
v17 = *((_DWORD *)this + 359);
v27 = v16[1];
if ( ((v17 - 1) & v17) != 0 )
v2 = v27 % v17;
else
v2 = (v17 - 1) & v27;
}
v28 = *(_DWORD **)(*((_DWORD *)this + 358) + 4 * v2);
if ( v28 )
{
*v16 = *v28;
*v28 = v16;
}
else
{
*v16 = *((_DWORD *)this + 360);
v29 = *((_DWORD *)this + 358);
*((_DWORD *)this + 360) = v16;
*(_DWORD *)(v29 + 4 * v2) = (char *)this + 1440;
if ( *v16 )
{
v30 = *(_DWORD *)(*v16 + 4);
if ( ((v17 - 1) & v17) != 0 )
v31 = v30 % v17;
else
v31 = (v17 - 1) & v30;
*(_DWORD *)(*((_DWORD *)this + 358) + 4 * v31) = v16;
}
}
++*((_DWORD *)this + 361);
}