//
// sub_83280 from 0x83280 to 0x83370 (240 bytes)
//
// 1 xrefs:
// > sub_63AAC @ 0x63d78
//
// 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_83280(__int64 a1, __int64 *a2, __int64 a3)
{
__int64 result; // x0
__int64 v7; // x10
__int64 v8; // x11
char v9; // w8
int v10; // w8
int *v11; // x10
__int64 v12; // x11
int v13; // w22
__int64 v14; // x23
int v15; // t1
int v16; // w8
bool v17; // vf
int v18; // w8
__int64 v19; // x9
__int64 v20; // x8
result = sub_82B20((__int64 *)(a1 + 1312), 0, a3);
if ( (_DWORD)result )
{
if ( (_DWORD)result != 45 )
return result;
goto LABEL_5;
}
if ( *(_BYTE *)(a1 + 720) )
{
LABEL_5:
result = 0;
*a2 = 0;
return result;
}
v7 = *(_QWORD *)(a3 + 8);
v8 = 0;
do
v9 = v7 + v8++;
while ( (v9 & 3) != 0 );
v10 = v8 - 1;
v11 = (int *)(v7 + v8 - 1);
v12 = -(__int64)(unsigned int)(v8 - 1);
do
{
v13 = v10;
v10 += 4;
v14 = v12;
if ( v10 > *(_DWORD *)(a3 + 24) )
break;
v15 = *v11++;
v12 -= 4;
}
while ( v15 == -1 );
result = sub_82D40();
if ( !(_DWORD)result )
{
v16 = *(_DWORD *)(a3 + 24);
v17 = __OFSUB__(v16, v13);
v18 = v16 - v13;
if ( (v18 < 0) ^ v17 | (v18 == 0) )
{
v19 = *(_QWORD *)(a3 + 16);
v18 = *(_DWORD *)(a3 + 28);
}
else
{
v19 = *(_QWORD *)(a3 + 8) - v14;
}
result = 0;
if ( v18 <= 0 )
v20 = 0;
else
v20 = v19;
*a2 = v20;
}
return result;
}