//
// sub_D7CB00 from 0xd7cb00 to 0xd7cb8c (140 bytes)
//
// 2 xrefs:
// > cocos2d::CCImage::_initWithTiffData @ 0xd7d2cc
// > cocos2d::CCImage::_initWithTiffData @ 0xd7d338
//
// This function is hookable on this platform (idp: arm, 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 13:08:08 +0000
//
__int64 __fastcall sub_D7CB00(__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;
}