//
// sub_180018400 from 0x180018400 to 0x18001856f (367 bytes)
//
// 4 xrefs:
// > sub_180018CF0 @ 0x180018d16
// > ??> @ 0x18017f5b4
// > ??> @ 0x18017f5e8
// > ??> @ 0x1801f726c
//
// 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_180018400(__int64 a1)
{
__int64 result; // rax
__int64 v3; // rcx
__int64 v4; // rdx
int v5; // esi
__int64 v6; // rax
__int64 v7; // rdi
__int64 v8; // rcx
__int64 v9; // rdx
int v10; // edi
_QWORD *v11; // rbx
int v12; // [rsp+20h] [rbp-18h]
__int64 v13; // [rsp+40h] [rbp+8h] BYREF
result = sub_1800D4D40();
if ( !(_DWORD)result )
{
v3 = *(_QWORD *)(a1 + 18128);
if ( v3 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v3 + 16LL))(v3);
*(_QWORD *)(a1 + 18128) = 0;
}
v4 = *(_QWORD *)(a1 + 1520);
if ( v4 )
{
v5 = 0;
if ( *(int *)(a1 + 972) > 0 )
{
v6 = *(_QWORD *)(a1 + 1520);
v7 = 0;
do
{
v8 = *(_QWORD *)(v7 + v4);
if ( v8 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v8 + 16LL))(v8);
v4 = *(_QWORD *)(a1 + 1520);
v6 = v4;
}
++v5;
v7 += 8;
}
while ( v5 < *(_DWORD *)(a1 + 972) );
v4 = v6;
}
sub_1800B6AA0(
*((_QWORD *)off_1801AED20 + 52),
v4,
"C:\\buildagent1\\work\\570ad728b1678096\\core_api\\src\\fmod_codec_it.cpp",
5814,
1);
*(_QWORD *)(a1 + 1520) = 0;
}
v9 = *(_QWORD *)(a1 + 2304);
if ( v9 )
{
LOBYTE(v12) = 1;
sub_1800B6AA0(
*((_QWORD *)off_1801AED20 + 52),
v9,
"C:\\buildagent1\\work\\570ad728b1678096\\core_api\\src\\fmod_codec_it.cpp",
5820,
v12);
*(_QWORD *)(a1 + 2304) = 0;
}
v10 = 0;
v11 = (_QWORD *)(a1 + 17472);
do
{
if ( *v11 )
{
result = (*(__int64 (__fastcall **)(_QWORD, _QWORD, __int64 *))(*(_QWORD *)*v11 + 288LL))(*v11, 0, &v13);
if ( (_DWORD)result )
return result;
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v13 + 16LL))(v13);
if ( (_DWORD)result )
return result;
LOBYTE(v12) = 1;
sub_1800B6AA0(
*((_QWORD *)off_1801AED20 + 52),
*v11,
"C:\\buildagent1\\work\\570ad728b1678096\\core_api\\src\\fmod_codec_it.cpp",
5837,
v12);
}
++v10;
++v11;
}
while ( v10 < 50 );
return 0;
}
return result;
}