//
// sub_10044DBC0 from 0x10044dbc0 to 0x10044dca8 (232 bytes)
//
// 1 xrefs:
// > ??> @ 0x100827380
//
// 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_10044DBC0(__int64 a1, __int64 a2, unsigned int a3, unsigned int *a4)
{
__int64 v4; // x8
__int64 v6; // x0
_QWORD *v10; // x0
_QWORD *v11; // x23
unsigned int v12; // w24
__int64 v13; // x4
__int64 v14; // x3
__int64 result; // x0
int v16; // w8
int v17; // [xsp+Ch] [xbp-44h] BYREF
*a4 = 0;
v4 = *(_QWORD *)(a1 + 408);
if ( !v4 )
return 28;
v6 = *(_QWORD *)(v4 + 73968);
if ( !v6 )
return 13;
v10 = sub_100428BF0(v6, 10);
if ( !v10 )
return 13;
if ( a3 )
{
v11 = v10;
v12 = 0;
v13 = *(unsigned int *)(a1 + 496);
while ( 1 )
{
v14 = a3 >= 0x10000 ? 0x10000LL : a3;
v17 = 0;
result = sub_10044EFFC(v11, *(_QWORD *)(a1 + 504), a2 + v12, v14, v13, &v17);
v16 = v17;
v13 = (unsigned int)(*(_DWORD *)(a1 + 496) + v17);
*(_DWORD *)(a1 + 496) = v13;
v12 += v16;
if ( (_DWORD)result )
break;
a3 -= v16;
if ( !a3 )
{
result = 0;
break;
}
}
}
else
{
v12 = 0;
result = 13;
}
*a4 = v12;
return result;
}