//
// sub_1004B8DB0 from 0x1004b8db0 to 0x1004b8ee0 (304 bytes)
//
// 1 xrefs:
// > sub_1004D1228 @ 0x1004d1890
//
// 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_1004B8DB0(__int64 *a1, int a2)
{
_OWORD *v4; // x0
__int64 v5; // x0
__int64 result; // x0
void *v7; // x0
__int64 v8; // x22
unsigned int v9; // w21
__int64 v10; // x20
_QWORD *v11; // x0
if ( !a1[9] )
return 67;
if ( !a2 )
return 0;
v4 = sub_1004B11FC(
*((__int64 **)off_1008524C8 + 54),
32,
(char)"/opt/teamcity-agent/work/570ad728b1678096/core_api/src/fmod_output_emulated.cpp",
65,
0,
0);
if ( !v4 )
{
a1[8] = 0;
return 38;
}
sub_10045F338(v4);
a1[8] = v5;
result = sub_10045F344(v5, a1[9], (__int64)a1, a2);
if ( (_DWORD)result )
return result;
v7 = sub_1004B14F8(
*((__int64 **)off_1008524C8 + 54),
112 * a2,
(char)"/opt/teamcity-agent/work/570ad728b1678096/core_api/src/fmod_output_emulated.cpp",
77,
0);
a1[131] = (__int64)v7;
if ( !v7 )
return 38;
if ( a2 < 1 )
return 0;
v8 = 0;
v9 = 0;
v10 = 112LL * (unsigned int)a2;
do
{
sub_10045626C(a1[131] + v8);
*v11 = off_100827568;
result = sub_10045F5FC(a1[8], v9, a1[131] + v8);
if ( (_DWORD)result )
break;
++v9;
v8 += 112;
}
while ( v10 != v8 );
return result;
}