//
// GJGameState::tweenValue from 0x5b6644 to 0x5b6866 (546 bytes)
//
// 18 xrefs:
// > GJBaseGameLayer::animateOutGroundNew @ 0x5b68ba
// > GJBaseGameLayer::updateScreenRotation @ 0x5b6948
// > GJBaseGameLayer::updateCameraOffsetX @ 0x5b699a
// > GJBaseGameLayer::updateCameraOffsetY @ 0x5b69e8
// > GJBaseGameLayer::updateMGOffsetY @ 0x5b6a3a
// > GJBaseGameLayer::updateCamera @ 0x5b7b28
// > GJBaseGameLayer::cameraMoveX @ 0x5b8730
// > GJBaseGameLayer::cameraMoveY @ 0x5b8782
// > GJBaseGameLayer::updateInternalCamOffsetX @ 0x5b87fa
// > GJBaseGameLayer::updateInternalCamOffsetY @ 0x5b8848
// > GJBaseGameLayer::animatePortalY @ 0x5b8894
// > GJBaseGameLayer::updateStaticCameraPos @ 0x5b8a04
// > GJBaseGameLayer::updateStaticCameraPos @ 0x5b8a2c
// > GJBaseGameLayer::animateInDualGroundNew @ 0x5b8bfa
// > GJBaseGameLayer::updateZoom @ 0x5b9278
// > GJBaseGameLayer::updateStaticCameraPosToGroup @ 0x5b9c90
// > GJBaseGameLayer::updateStaticCameraPosToGroup @ 0x5b9cd4
// > GJBaseGameLayer::toggleFlipped @ 0x5b9df4
//
// 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:38 +0000
//
void __fastcall GJGameState::tweenValue(
GJGameState *this,
float a2,
float a3,
unsigned int a4,
float a5,
int a6,
float a7,
int a8,
int a9)
{
unsigned int v9; // r7
unsigned int v14; // r4
unsigned int v15; // r11
_DWORD *v16; // r2
_DWORD *i; // r5
unsigned int v18; // r0
int v19; // r1
int v20; // r0
int v21; // r5
float v22; // s13
float v23; // s15
bool v24; // r7
unsigned int prime; // r7
unsigned int v26; // r0
unsigned int v27; // r4
char *v28; // r0
unsigned int v29; // r1
unsigned int v30; // s15
float v31; // s14
_DWORD *v32; // r3
int v33; // r3
unsigned int v34; // r0
int v35; // r1
float v36; // r0
unsigned int v37; // r0
GJGameState::stopTweenAction((unsigned int)this, a4);
v14 = *((_DWORD *)this + 137);
if ( v14 )
{
v15 = v14 - 1;
v9 = ((v14 - 1) & v14) != 0 ? a4 % v14 : v15 & a4;
v16 = *(_DWORD **)(*((_DWORD *)this + 136) + 4 * v9);
if ( v16 )
{
for ( i = (_DWORD *)*v16; i; i = (_DWORD *)*i )
{
v18 = i[1];
v19 = ((v14 - 1) & v14) != 0 ? v18 % v14 : v15 & v18;
if ( v19 != v9 )
break;
if ( i[2] == a4 )
return;
}
}
}
v20 = operator new(0x34u);
*(float *)(v20 + 20) = a5;
*(_DWORD *)(v20 + 24) = 0;
v21 = v20;
*(_DWORD *)(v20 + 28) = 0;
*(_DWORD *)(v20 + 44) = a8;
*(_DWORD *)(v20 + 32) = a6;
*(_DWORD *)(v20 + 8) = a4;
*(float *)(v20 + 12) = a2;
*(float *)(v20 + 36) = a7;
*(float *)(v20 + 16) = a3;
*(_BYTE *)(v20 + 40) = 0;
*(_BYTE *)(v20 + 41) = 0;
*(_DWORD *)(v20 + 48) = a9;
*(_DWORD *)v20 = 0;
*(_DWORD *)(v20 + 4) = a4;
v22 = *((float *)this + 140);
v23 = (float)(unsigned int)(*((_DWORD *)this + 139) + 1);
if ( v23 > (float)((float)v14 * v22) )
{
v24 = v14 > 2 && ((v14 - 1) & v14) == 0;
LABEL_15:
prime = 2 * v14 + !v24;
v26 = (unsigned int)ceilf(v23 / v22);
if ( prime < v26 )
prime = v26;
if ( prime == 1 )
{
prime = 2;
}
else if ( ((prime - 1) & prime) != 0 )
{
prime = std::__next_prime(prime);
}
v27 = *((_DWORD *)this + 137);
if ( prime <= v27 )
{
if ( prime >= v27 )
goto LABEL_24;
v30 = *((_DWORD *)this + 139);
v31 = *((float *)this + 140);
if ( v27 <= 2 || ((v27 - 1) & v27) != 0 )
{
v36 = ceilf((float)v30 / v31);
v37 = std::__next_prime((unsigned int)v36);
}
else
{
v37 = 1 << (32 - __clz((unsigned int)ceilf((float)v30 / v31) - 1));
}
v29 = v37;
if ( v37 < prime )
v29 = prime;
if ( v29 >= v27 )
goto LABEL_24;
v28 = (char *)this + 544;
}
else
{
v28 = (char *)this + 544;
v29 = prime;
}
std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::__rehash(
(int)v28,
v29);
LABEL_24:
v14 = *((_DWORD *)this + 137);
if ( ((v14 - 1) & v14) != 0 )
v9 = a4 % v14;
else
v9 = (v14 - 1) & a4;
goto LABEL_31;
}
if ( !v14 )
{
v24 = 0;
goto LABEL_15;
}
LABEL_31:
v32 = *(_DWORD **)(*((_DWORD *)this + 136) + 4 * v9);
if ( v32 )
{
*(_DWORD *)v21 = *v32;
*v32 = v21;
}
else
{
*(_DWORD *)v21 = *((_DWORD *)this + 138);
v33 = *((_DWORD *)this + 136);
*((_DWORD *)this + 138) = v21;
*(_DWORD *)(v33 + 4 * v9) = (char *)this + 552;
if ( *(_DWORD *)v21 )
{
v34 = *(_DWORD *)(*(_DWORD *)v21 + 4);
if ( ((v14 - 1) & v14) != 0 )
v35 = v34 % v14;
else
v35 = (v14 - 1) & v34;
*(_DWORD *)(*((_DWORD *)this + 136) + 4 * v35) = v21;
}
}
++*((_DWORD *)this + 139);
}