//
// GJShaderState::tweenValue from 0xb2ed0c to 0xb2f048 (828 bytes)
//
// 2 xrefs:
// > ShaderLayer::tweenValue @ 0xb2f04c
// > ??> @ 0xf6388
//
// 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 13:01:42 +0000
//
_QWORD *__fastcall GJShaderState::tweenValue(
GJShaderState *this,
float a2,
float a3,
int a4,
float a5,
int a6,
float a7)
{
unsigned __int64 v7; // x21
unsigned __int64 v14; // x19
unsigned __int64 v15; // x23
__int64 *v16; // x0
unsigned __int64 v17; // x1
unsigned __int64 v18; // x1
__int64 v19; // x20
float v20; // s2
float v21; // s0
_BOOL8 v22; // x24
__int64 v23; // x1
unsigned __int64 prime; // x24
unsigned __int64 v25; // x0
unsigned __int64 v26; // x21
unsigned __int64 v27; // x0
unsigned __int64 v28; // x1
__int64 *v29; // x0
_QWORD *result; // x0
unsigned __int64 v31; // x1
unsigned __int64 v32; // x0
int v33; // [xsp+6Ch] [xbp+6Ch] BYREF
v33 = a4;
GJShaderState::stopTweenAction(this, a4);
if ( a5 <= 0.0 )
return (_QWORD *)GJShaderState::updateTweenAction((__int64)this, a3, v33);
v14 = *((_QWORD *)this + 1);
v15 = v33;
if ( v14 )
{
v7 = (v14 - 1) & v33;
if ( ((v14 - 1) & v14) != 0 )
v7 = v33 % v14;
v16 = *(__int64 **)(*(_QWORD *)this + 8 * v7);
if ( v16 )
{
while ( 1 )
{
v16 = (__int64 *)*v16;
if ( !v16 )
break;
v17 = v16[1];
v18 = ((v14 - 1) & v14) != 0 ? v17 % v14 : (v14 - 1) & v17;
if ( v7 != v18 )
break;
if ( v33 == *((_DWORD *)v16 + 4) )
goto LABEL_32;
}
}
}
v19 = operator new(0x40u);
*(_DWORD *)(v19 + 16) = v33;
*(_DWORD *)(v19 + 40) = a6;
*(_BYTE *)(v19 + 48) = 0;
*(_BYTE *)(v19 + 49) = 0;
*(_DWORD *)(v19 + 52) = -1;
*(_DWORD *)(v19 + 56) = -1;
*(_QWORD *)(v19 + 8) = v15;
*(_QWORD *)v19 = 0;
*(float *)(v19 + 20) = a2;
*(float *)(v19 + 24) = a3;
*(float *)(v19 + 28) = a5;
*(_DWORD *)(v19 + 32) = 0;
*(_DWORD *)(v19 + 36) = 0;
*(float *)(v19 + 44) = a7;
v20 = *((float *)this + 8);
v21 = (float)(unsigned __int64)(*((_QWORD *)this + 3) + 1LL);
if ( v21 <= (float)((float)v14 * v20) )
{
if ( v14 )
goto LABEL_29;
v22 = 1;
v23 = 0;
}
else
{
v22 = 1;
v23 = 2 * v14;
if ( v14 > 2 )
v22 = ((v14 - 1) & v14) != 0;
}
prime = v23 + v22;
v25 = vcvtps_u32_f32(v21 / v20);
if ( v25 >= prime )
prime = v25;
if ( prime == 1 )
{
prime = 2;
}
else if ( ((prime - 1) & prime) != 0 )
{
prime = std::__next_prime(prime);
}
v14 = *((_QWORD *)this + 1);
if ( prime > v14 )
{
std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::__rehash(
(__int64)this,
prime);
v14 = *((_QWORD *)this + 1);
goto LABEL_27;
}
if ( prime < v14 )
{
if ( v14 <= 2 || (v26 = v14 - 1, ((v14 - 1) & v14) != 0) )
{
v27 = std::__next_prime(vcvtps_u32_f32((float)*((unsigned __int64 *)this + 3) / *((float *)this + 8)));
if ( v27 < prime )
v28 = prime;
else
v28 = v27;
if ( v28 >= v14 )
{
v14 = *((_QWORD *)this + 1);
goto LABEL_27;
}
}
else
{
v28 = 1LL << (64
- (unsigned __int8)__clz(vcvtps_u32_f32((float)*((unsigned __int64 *)this + 3) / *((float *)this + 8)) - 1));
if ( v28 < prime )
v28 = prime;
if ( v28 >= v14 )
goto LABEL_28;
}
std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::__rehash(
(__int64)this,
v28);
v14 = *((_QWORD *)this + 1);
}
LABEL_27:
v26 = v14 - 1;
if ( ((v14 - 1) & v14) == 0 )
{
LABEL_28:
v7 = v26 & v15;
goto LABEL_29;
}
v7 = v15 % v14;
LABEL_29:
v29 = *(__int64 **)(*(_QWORD *)this + 8 * v7);
if ( v29 )
{
*(_QWORD *)v19 = *v29;
*v29 = v19;
}
else
{
*(_QWORD *)v19 = *((_QWORD *)this + 2);
*((_QWORD *)this + 2) = v19;
*(_QWORD *)(*(_QWORD *)this + 8 * v7) = (char *)this + 16;
if ( *(_QWORD *)v19 )
{
v31 = *(_QWORD *)(*(_QWORD *)v19 + 8LL);
if ( ((v14 - 1) & v14) != 0 )
v32 = v31 % v14;
else
v32 = (v14 - 1) & v31;
*(_QWORD *)(*(_QWORD *)this + 8 * v32) = v19;
}
}
++*((_QWORD *)this + 3);
LABEL_32:
result = (_QWORD *)std::unordered_map::operator[]((__int64)this + 40, &v33);
*result = *((_QWORD *)this + 10);
return result;
}