//
// GJRobotSprite::updateColors from 0x1006ae570 to 0x1006ae87f (783 bytes)
//
// 4 xrefs:
// > PlayerObject::createRobot @ 0x1003e936e
// > PlayerObject::createSpider @ 0x1003e9709
// > GJRobotSprite::updateColor01 @ 0x1006ae566
// > GJRobotSprite::updateColor02 @ 0x1006ae896
//
// This function is hookable on this platform (idp: pc, 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 12:35:23 +0000
//
__int64 __fastcall GJRobotSprite::updateColors(__int64 a1)
{
float v1; // xmm1_4
int v2; // eax
int v3; // ecx
int v4; // eax
int v5; // ecx
unsigned int v6; // r15d
__int64 v7; // rax
__int64 SpriteForKey; // r12
__int64 v9; // r15
__int64 result; // rax
__int64 v11; // r14
int v12; // eax
int v13; // ecx
int v14; // eax
int v15; // ecx
__int64 v16; // rax
__int64 v17; // rax
__int64 v18; // rax
__int64 v19; // rax
__int64 v20; // rax
__int64 v21; // rax
__int16 v22; // [rsp+10h] [rbp-30h] BYREF
char v23; // [rsp+12h] [rbp-2Eh]
__int16 v24; // [rsp+14h] [rbp-2Ch] BYREF
char v25; // [rsp+16h] [rbp-2Ah]
__int16 v26; // [rsp+18h] [rbp-28h] BYREF
char v27; // [rsp+1Ah] [rbp-26h]
__int16 v28; // [rsp+1Ch] [rbp-24h] BYREF
char v29; // [rsp+1Eh] [rbp-22h]
v1 = *(float *)&a333_0[4 * (*(_DWORD *)(a1 + 760) == 6)];
v2 = (int)(float)((float)*(unsigned __int8 *)(a1 + 729) * v1);
v3 = (int)(float)((float)*(unsigned __int8 *)(a1 + 730) * v1);
v27 = (int)(float)((float)*(unsigned __int8 *)(a1 + 731) * v1);
v26 = ((unsigned __int8)v3 << 8) | (unsigned __int8)v2;
v4 = (int)(float)((float)*(unsigned __int8 *)(a1 + 732) * v1);
v5 = (int)(float)((float)*(unsigned __int8 *)(a1 + 733) * v1);
v29 = (int)(float)((float)*(unsigned __int8 *)(a1 + 734) * v1);
v28 = ((unsigned __int8)v5 << 8) | (unsigned __int8)v4;
CCPartAnimSprite::setColor(
*(_QWORD *)(a1 + 672),
*(unsigned __int16 *)(a1 + 729) | (*(unsigned __int8 *)(a1 + 731) << 16));
if ( (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 736)) )
{
v6 = 0;
do
{
v7 = sub_1007FEFE0(*(_QWORD *)(a1 + 736), v6);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v7 + 960LL))(v7, a1 + 732);
++v6;
}
while ( v6 < (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 736)) );
}
SpriteForKey = CCPartAnimSprite::getSpriteForKey(*(_QWORD *)(a1 + 672), "back01");
v9 = CCPartAnimSprite::getSpriteForKey(*(_QWORD *)(a1 + 672), "back02");
result = CCPartAnimSprite::getSpriteForKey(*(_QWORD *)(a1 + 672), "back03");
v11 = result;
if ( SpriteForKey )
{
v12 = (int)(float)((float)*(unsigned __int8 *)(a1 + 729) * v1);
v13 = (int)(float)((float)*(unsigned __int8 *)(a1 + 730) * v1);
v23 = (int)(float)((float)*(unsigned __int8 *)(a1 + 731) * v1);
v22 = ((unsigned __int8)v13 << 8) | (unsigned __int8)v12;
v14 = (int)(float)((float)*(unsigned __int8 *)(a1 + 732) * v1);
v15 = (int)(float)((float)*(unsigned __int8 *)(a1 + 733) * v1);
v25 = (int)(float)((float)*(unsigned __int8 *)(a1 + 734) * v1);
v24 = ((unsigned __int8)v15 << 8) | (unsigned __int8)v14;
(*(void (__fastcall **)(__int64, __int16 *))(*(_QWORD *)SpriteForKey + 960LL))(SpriteForKey, &v22);
v16 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)SpriteForKey + 488LL))(SpriteForKey);
v17 = sub_1007FEFE0(v16, 0);
result = (*(__int64 (__fastcall **)(__int64, __int16 *))(*(_QWORD *)v17 + 960LL))(v17, &v24);
}
if ( v9 )
{
(*(void (__fastcall **)(__int64, __int16 *))(*(_QWORD *)v9 + 960LL))(v9, &v26);
v18 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v9 + 488LL))(v9);
v19 = sub_1007FEFE0(v18, 0);
result = (*(__int64 (__fastcall **)(__int64, __int16 *))(*(_QWORD *)v19 + 960LL))(v19, &v28);
}
if ( v11 )
{
(*(void (__fastcall **)(__int64, __int16 *))(*(_QWORD *)v11 + 960LL))(v11, &v26);
v20 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v11 + 488LL))(v11);
v21 = sub_1007FEFE0(v20, 0);
return (*(__int64 (__fastcall **)(__int64, __int16 *))(*(_QWORD *)v21 + 960LL))(v21, &v28);
}
return result;
}