//
// sub_10044D440 from 0x10044d440 to 0x10044d590 (336 bytes)
//
// 4 xrefs:
// > sub_100428A88 @ 0x100428af8
// > sub_100428A88 @ 0x100428b34
// > sub_100428E30 @ 0x100428e74
// > sub_100428E30 @ 0x100428ebc
//
// 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_10044D440(__int64 a1, int *a2)
{
int v2; // w19
__int64 v5; // x21
unsigned int v6; // w0
unsigned int v7; // w23
_BOOL4 v9; // w19
void *v10; // x0
__int64 v11; // x8
int v12; // w9
__int64 v13; // x8
int v14; // w9
__int64 v15; // x22
int v16; // [xsp+Ch] [xbp-54h] BYREF
void *__dst[2]; // [xsp+10h] [xbp-50h] BYREF
__int128 v18; // [xsp+20h] [xbp-40h]
v2 = *a2;
if ( (unsigned int)*a2 > 0x6400000 )
return 28;
*(_OWORD *)__dst = 0u;
v18 = 0u;
v5 = a1 + 1240;
v6 = sub_10044C550((__int64 *)(a1 + 1240), v2, 0, (__int64)__dst);
if ( v6 )
goto LABEL_3;
if ( *(_BYTE *)(a1 + 720) )
{
v7 = 0;
LABEL_7:
v9 = 1;
v10 = __dst[0];
if ( !__dst[0] )
goto LABEL_9;
goto LABEL_8;
}
v6 = sub_1004B5828(&v16);
if ( v6 )
{
LABEL_3:
v7 = v6;
goto LABEL_7;
}
v11 = 0;
v12 = v16;
a2[1] = v16;
while ( *(unsigned __int8 *)(a1 + v11 + 724) != *((unsigned __int8 *)a2 + 8)
|| *(unsigned __int8 *)(a1 + v11 + 725) != *((unsigned __int8 *)a2 + 9) )
{
v11 += 16;
if ( v11 == 512 )
goto LABEL_20;
}
v13 = a1 + v11;
*(_DWORD *)(v13 + 732) = v12;
v14 = *(_DWORD *)(v13 + 736);
if ( v14 <= v2 )
v14 = v2;
*(_DWORD *)(v13 + 736) = v14;
LABEL_20:
v15 = SDWORD2(v18);
memcpy(__dst[1], a2, SDWORD2(v18));
if ( HIDWORD(v18) )
memcpy((void *)v18, (char *)a2 + v15, SHIDWORD(v18));
v7 = sub_10044C738(v5, v2);
v9 = v7 != 0;
v10 = __dst[0];
if ( !__dst[0] )
goto LABEL_9;
LABEL_8:
sub_1004B5CA0(v10);
LABEL_9:
if ( v9 )
return v7;
else
return 0;
}