//
// sub_B0BB44 from 0xb0bb44 to 0xb0bbd0 (140 bytes)
//
// 2 xrefs:
// > cocos2d::CCImage::_initWithTiffData @ 0xb0c2fc
// > cocos2d::CCImage::_initWithTiffData @ 0xb0c360
//
// 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_B0BB44(__int64 a1, unsigned __int64 a2, int a3)
{
unsigned __int64 v4; // x2
__int64 result; // x0
unsigned __int64 v6; // x4
int v7; // w2
int v8; // w2
int v9; // w2
switch ( a3 )
{
case 0:
v4 = *(int *)(a1 + 8);
result = -1;
if ( v4 <= a2 )
return result;
LABEL_10:
*(_DWORD *)(a1 + 12) = a2;
return (int)a2;
case 1:
v6 = *(int *)(a1 + 8);
result = -1;
v7 = *(_DWORD *)(a1 + 12);
if ( a2 + v7 < v6 )
{
LODWORD(a2) = v7 + a2;
goto LABEL_10;
}
break;
case 2:
v8 = *(_DWORD *)(a1 + 8);
result = -1;
if ( a2 < v8 )
{
v9 = v8 - 1;
*(_DWORD *)(a1 + 12) = v9 - a2;
return v9 - (int)a2;
}
break;
default:
if ( a2 >= *(int *)(a1 + 8) )
return -1;
goto LABEL_10;
}
return result;
}