//
// cocos2d::unzGetLocalExtrafield from 0x1800a0c50 to 0x1800a0d3c (236 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b77c4
//
// 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::unzGetLocalExtrafield(cocos2d *this, void *a2, void *a3)
{
unsigned __int64 v3; // rdi
__int64 v5; // rbx
__int64 v6; // r8
unsigned __int64 v7; // rcx
v3 = (unsigned int)a3;
if ( !this )
return 4294967194LL;
v5 = *((_QWORD *)this + 34);
if ( !v5 )
return 4294967194LL;
v6 = *(_QWORD *)(v5 + 128);
v7 = *(unsigned int *)(v5 + 120) - v6;
if ( !a2 )
return (unsigned int)v7;
if ( v3 > v7 )
LODWORD(v3) = *(_DWORD *)(v5 + 120) - v6;
if ( !(_DWORD)v3 )
return 0;
if ( (unsigned int)sub_18009F7F0(v5 + 168, *(_QWORD *)(v5 + 256), *(_QWORD *)(v5 + 112) + v6) )
return 0xFFFFFFFFLL;
if ( (*(unsigned int (__fastcall **)(_QWORD, _QWORD, void *, _QWORD))(v5 + 176))(
*(_QWORD *)(v5 + 224),
*(_QWORD *)(v5 + 256),
a2,
(unsigned int)v3) != (_DWORD)v3 )
LODWORD(v3) = -1;
return (unsigned int)v3;
}