//
// sub_180049380 from 0x180049380 to 0x180049434 (180 bytes)
//
// 5 xrefs:
// > sub_180050790 @ 0x1800507be
// > sub_180050930 @ 0x18005095f
// > ??> @ 0x1801812d4
// > ??> @ 0x180181308
// > ??> @ 0x1801f8400
//
// 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 10:53:14 +0000
//
__int64 __fastcall sub_180049380(__int64 a1, __int64 a2)
{
__int64 *v2; // rbx
unsigned int v5; // r14d
__int64 *v6; // rdi
int v7; // ecx
__int64 v8; // rax
v2 = *(__int64 **)(a2 + 112);
v5 = 0;
if ( v2 )
{
do
{
v6 = (__int64 *)v2[1];
sub_180033C90(a1, *v2);
*(_OWORD *)v2 = 0;
sub_180033C90(a1, (__int64)v2);
v2 = v6;
}
while ( v6 );
}
v7 = *(_DWORD *)(a2 + 104);
if ( v7 )
{
v8 = sub_180033D20(a1, *(_QWORD *)(a2 + 88), (unsigned int)(v7 + *(_DWORD *)(a2 + 100)));
*(_QWORD *)(a2 + 88) = v8;
v5 = -139;
*(_DWORD *)(a2 + 100) += *(_DWORD *)(a2 + 104);
*(_DWORD *)(a2 + 104) = 0;
if ( v8 )
v5 = 0;
}
*(_DWORD *)(a2 + 96) = 0;
*(_QWORD *)(a2 + 112) = 0;
return v5;
}