//
// sub_10044CA2C from 0x10044ca2c to 0x10044cae8 (188 bytes)
//
// 3 xrefs:
// > sub_10044D350 @ 0x10044d400
// > sub_10044D434 @ 0x10044d43c
// > sub_10044D7E4 @ 0x10044d924
//
// 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_10044CA2C(__int64 a1, int a2)
{
__int64 v4; // x19
int v5; // w9
int v6; // w8
__int64 v7; // x21
int v8; // w23
__int64 v9; // x0
__int64 v10; // x22
v4 = *(_QWORD *)(a1 + 32);
sub_1004B5C70(v4);
if ( a2 )
{
v5 = *(_DWORD *)(a1 + 12);
v6 = *(_DWORD *)(a1 + 16) + a2;
*(_DWORD *)(a1 + 16) = v6;
if ( v6 == v5 )
{
*(_DWORD *)(a1 + 12) = 0;
*(_DWORD *)(a1 + 16) = 0;
}
}
v7 = *(_QWORD *)(a1 + 32);
sub_1004B5C70(v7);
if ( *(int *)(a1 + 60) < 1 )
{
v10 = 0;
}
else
{
v8 = 0;
while ( 1 )
{
v9 = sub_1004B5DD4(*(_QWORD *)(a1 + 48));
if ( (_DWORD)v9 )
break;
if ( ++v8 >= *(_DWORD *)(a1 + 60) )
{
v10 = 0;
*(_DWORD *)(a1 + 60) = 0;
goto LABEL_11;
}
}
v10 = v9;
}
LABEL_11:
sub_1004B5CA0(v7);
sub_1004B5CA0(v4);
return v10;
}