//
// sub_B0B9F4 from 0xb0b9f4 to 0xb0bac8 (212 bytes)
//
// 2 xrefs:
// > cocos2d::CCImage::_initWithTiffData @ 0xb0c2f4
// > cocos2d::CCImage::_initWithTiffData @ 0xb0c310
//
// 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 sub_B0B9F4(__int64 a1, char *a2, unsigned __int64 a3)
{
unsigned __int64 v3; // x19
int v6; // w1
__int64 v7; // x24
int v8; // w23
size_t v9; // x20
void *v10; // x0
v3 = a3;
if ( a3 )
{
v6 = *(_DWORD *)(a1 + 12);
v7 = 0;
while ( 1 )
{
v8 = v3 > 0x7FFFFFFF ? 0x80000000 : v3;
v9 = v3 > 0x7FFFFFFF ? 0x80000000LL : v3;
v10 = a2;
a2 += v9;
if ( v8 + v6 > *(_DWORD *)(a1 + 8) )
break;
v7 += v9;
memcpy(v10, (const void *)(*(_QWORD *)a1 + v6), v9);
v3 -= v9;
v6 = v8 + *(_DWORD *)(a1 + 12);
*(_DWORD *)(a1 + 12) = v6;
if ( !v3 )
return v7;
}
}
return 0;
}