//
// cocos2d::tgaLoadImageData from 0xb21d24 to 0xb21dec (200 bytes)
//
// 2 xrefs:
// > cocos2d::tgaLoad @ 0xb22028
// > ??> @ 0x325c8
//
// 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
//
__int64 __fastcall cocos2d::tgaLoadImageData(__int64 a1, unsigned __int64 a2, __int64 a3)
{
unsigned int v3; // w21
int v4; // w20
__int64 v7; // x0
int v8; // w2
__int64 v9; // x1
__int64 v10; // x3
char v11; // w4
v3 = *(unsigned __int8 *)(a3 + 5) >> 3;
v4 = *(__int16 *)(a3 + 8) * *(__int16 *)(a3 + 6) * v3;
if ( v4 + 18LL > a2 )
return 0;
memcpy(*(void **)(a3 + 16), (const void *)(a1 + 18), v4);
if ( v3 > 2 && v4 > 0 )
{
v7 = 0;
v8 = 0;
do
{
v9 = *(_QWORD *)(a3 + 16);
v10 = v7 + 2;
v8 += v3;
v11 = *(_BYTE *)(v9 + v7);
*(_BYTE *)(v9 + v7) = *(_BYTE *)(v9 + v7 + 2);
v7 += (unsigned __int8)v3;
*(_BYTE *)(*(_QWORD *)(a3 + 16) + v10) = v11;
}
while ( v4 > v8 );
}
return 1;
}