//
// cocos2d::tgaLoadImageData from 0x5ecbb0 to 0x5ecbfc (76 bytes)
//
// 1 xrefs:
// > cocos2d::tgaLoad @ 0x5ecd90
//
// 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
//
int __fastcall cocos2d::tgaLoadImageData(int a1, unsigned int a2, int a3)
{
unsigned int v4; // r6
signed int v5; // r4
signed int v7; // r3
int v8; // r2
int v9; // r1
char v10; // r0
v4 = *(unsigned __int8 *)(a3 + 5) >> 3;
v5 = *(__int16 *)(a3 + 8) * *(__int16 *)(a3 + 6) * v4;
if ( v5 + 18 > a2 )
return 0;
memcpy(*(void **)(a3 + 12), (const void *)(a1 + 18), v5);
if ( v4 > 2 )
{
v7 = 0;
while ( v7 < v5 )
{
v8 = *(_DWORD *)(a3 + 12);
v9 = v7 + 2;
v10 = *(_BYTE *)(v8 + v7);
*(_BYTE *)(v8 + v7) = *(_BYTE *)(v8 + v7 + 2);
v7 += v4;
*(_BYTE *)(*(_DWORD *)(a3 + 12) + v9) = v10;
}
}
return 1;
}