//
// sub_1800A4990 from 0x1800a4990 to 0x1800a4b85 (501 bytes)
//
// 2 xrefs:
// > sub_1800A6260 @ 0x1800a62c3
// > ??> @ 0x1801fb6d0
//
// 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_1800A4990(__int64 *a1)
{
__int64 v1; // rbx
int v3; // esi
LPVOID *v4; // rdi
__int64 v5; // rcx
__int64 result; // rax
__int64 v7; // rcx
_QWORD *v8; // rdi
__int64 v9; // rsi
_QWORD *v10; // rdi
__int64 v11; // rsi
__int64 v12; // rcx
__int64 v13; // rcx
void *v14; // rcx
void *v15; // rcx
__int64 v16; // rcx
v1 = *a1;
if ( !*a1 )
return 0;
if ( *(_QWORD *)(v1 + 712) )
{
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(v1 + 704) + 56LL))(*(_QWORD *)(v1 + 704));
sub_1800B6AA0(
*((_QWORD *)off_1801AED20 + 52),
*(_QWORD *)(v1 + 712),
"C:\\buildagent1\\work\\570ad728b1678096\\core_api\\src\\fmod_output_winsonic.cpp",
833,
1);
*(_QWORD *)(v1 + 712) = 0;
}
v3 = 0;
if ( *(int *)(v1 + 720) > 0 )
{
v4 = (LPVOID *)(v1 + 728);
do
{
CoTaskMemFree(*v4);
*v4++ = nullptr;
++v3;
}
while ( v3 < *(_DWORD *)(v1 + 720) );
}
v5 = *(_QWORD *)(v1 + 704);
*(_DWORD *)(v1 + 720) = 0;
if ( v5 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v5 + 16LL))(v5);
*(_QWORD *)(v1 + 704) = 0;
}
result = sub_1800A48C0(a1);
if ( !(_DWORD)result )
{
if ( *(_QWORD *)v1 )
{
((void (__fastcall *)(_QWORD, const char *, __int64))a1[3])(
*(_QWORD *)v1,
"C:\\buildagent1\\work\\570ad728b1678096\\core_api\\src\\fmod_output_winsonic.cpp",
856);
*(_QWORD *)v1 = 0;
}
v7 = *(_QWORD *)(v1 + 8);
if ( v7 )
{
((void (__fastcall *)(__int64, const char *, __int64))a1[3])(
v7,
"C:\\buildagent1\\work\\570ad728b1678096\\core_api\\src\\fmod_output_winsonic.cpp",
862);
*(_QWORD *)(v1 + 8) = 0;
}
v8 = (_QWORD *)(v1 + 56);
v9 = 12;
do
{
if ( *v8 )
{
(*(void (__fastcall **)(_QWORD))(*(_QWORD *)*v8 + 16LL))(*v8);
*v8 = 0;
}
++v8;
--v9;
}
while ( v9 );
v10 = (_QWORD *)(v1 + 152);
v11 = 2;
do
{
if ( *v10 )
{
(*(void (__fastcall **)(_QWORD))(*(_QWORD *)*v10 + 16LL))(*v10);
*v10 = 0;
}
++v10;
--v11;
}
while ( v11 );
v12 = *(_QWORD *)(v1 + 48);
if ( v12 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v12 + 16LL))(v12);
*(_QWORD *)(v1 + 48) = 0;
}
v13 = *(_QWORD *)(v1 + 40);
if ( v13 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v13 + 16LL))(v13);
*(_QWORD *)(v1 + 40) = 0;
}
v14 = *(void **)(v1 + 24);
if ( v14 )
{
CloseHandle(v14);
*(_QWORD *)(v1 + 24) = 0;
}
v15 = *(void **)(v1 + 16);
if ( v15 )
{
CloseHandle(v15);
*(_QWORD *)(v1 + 16) = 0;
}
v16 = *(_QWORD *)(v1 + 32);
if ( v16 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v16 + 16LL))(v16);
*(_QWORD *)(v1 + 32) = 0;
}
((void (__fastcall *)(__int64, const char *, __int64))a1[3])(
*a1,
"C:\\buildagent1\\work\\570ad728b1678096\\core_api\\src\\fmod_output_winsonic.cpp",
914);
*a1 = 0;
return 0;
}
return result;
}