//
// sub_10072BBC0 from 0x10072bbc0 to 0x10072bcc1 (257 bytes)
//
// 2 xrefs:
// > sub_100729BA0 @ 0x10072a32f
// > sub_10072B870 @ 0x10072ba0d
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:36:19 +0000
//
__int64 __fastcall sub_10072BBC0(__int64 a1)
{
__int64 i; // r15
__int64 v2; // rax
int v3; // eax
_QWORD *v4; // r12
__int64 v5; // rax
__int64 v6; // rcx
_QWORD *v7; // rax
_QWORD *v9; // rax
for ( i = ((__int64 (*)(void))sub_10072BE50)(); ; i = sub_10072BE50(a1, i) )
{
v3 = *(_DWORD *)(a1 + 40);
if ( v3 != 17 )
break;
sub_1007292C0(a1 + 8);
v4 = *(_QWORD **)a1;
v5 = *(_QWORD *)(*(_QWORD *)a1 + 8LL);
v6 = v5 + 40;
if ( (unsigned __int64)(v5 + 40) <= 0x1000 )
{
v2 = *v4 + v5 + 8;
v4[1] = v6;
}
else
{
v7 = (_QWORD *)off_100BE07E8();
if ( !v7 )
{
v9 = *(_QWORD **)(a1 + 64);
*v9 = "Out of memory";
v9[1] = *(_QWORD *)(a1 + 16) - *(_QWORD *)(a1 + 48);
longjmp((int *)(a1 + 104), 1);
}
*v7 = *v4;
*v4 = v7;
v4[1] = 40;
v2 = (__int64)(v7 + 1);
}
*(_DWORD *)v2 = 33882425;
*(_QWORD *)(v2 + 8) = i;
*(_OWORD *)(v2 + 16) = 0;
*(_QWORD *)(v2 + 32) = 0;
i = v2;
LABEL_4:
;
}
if ( v3 == 16 )
{
sub_1007292C0(a1 + 8);
goto LABEL_4;
}
return i;
}