//
// sub_1005746A4 from 0x1005746a4 to 0x100574888 (484 bytes)
//
// 1 xrefs:
// > sub_1005742CC @ 0x100574388
//
// This function is hookable on this platform (idp: arm, 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 11:08:20 +0000
//
__int64 __fastcall sub_1005746A4(__int64 a1, __int64 a2, __int64 a3)
{
unsigned int v3; // w8
__int64 v7; // x23
__int64 v8; // x22
__int64 v9; // x0
__int64 v10; // x23
int v11; // w9
int v12; // w8
int v13; // w10
__int64 v14; // x9
__int64 v16; // x24
v3 = *(_DWORD *)(a2 + 20);
if ( v3 > 0x8000000 )
return 28;
v7 = v3 + 33;
v8 = *(_QWORD *)(a1 + 48);
if ( *(_DWORD *)(a1 + 64) < (int)v7 )
{
if ( v8 )
sub_1005D7AD8(
*((_QWORD *)off_1009DA5E8 + 54),
v8,
"/opt/teamcity-agent/work/570ad728b1678096/core_api/src/fmod_profile_remotefile.cpp",
649,
1);
v9 = sub_1005D7364(
*((_QWORD *)off_1009DA5E8 + 54),
v7,
"/opt/teamcity-agent/work/570ad728b1678096/core_api/src/fmod_profile_remotefile.cpp",
652,
0,
0,
1);
*(_QWORD *)(a1 + 48) = v9;
if ( !v9 )
return 38;
v8 = v9;
*(_DWORD *)(a1 + 64) = v7;
}
*(_QWORD *)(v8 + 4) = 0;
*(_DWORD *)(v8 + 28) = 0;
*(_QWORD *)(v8 + 20) = 0;
*(_QWORD *)(v8 + 12) = 0;
*(_DWORD *)v8 = 32;
*(_WORD *)(v8 + 8) = 778;
*(_DWORD *)(v8 + 12) = *(_DWORD *)(a2 + 12);
*(_QWORD *)(v8 + 20) = *(_QWORD *)(a2 + 16);
*(_DWORD *)(v8 + 16) = 3;
v10 = *(_QWORD *)(a1 + 56);
sub_1005DBDD8(v10);
if ( *(_DWORD *)(a1 + 156) )
{
v11 = *(_DWORD *)(a1 + 128);
if ( v11 )
{
v12 = *(_DWORD *)(a2 + 12);
v13 = *(_DWORD *)(*(_QWORD *)(a1 + 120) + 4LL * (v12 & (v11 - 1)));
if ( v13 != -1 )
{
v14 = *(_QWORD *)(a1 + 136);
while ( *(_DWORD *)(v14 + 16LL * v13) != v12 )
{
v13 = *(_DWORD *)(v14 + 16LL * v13 + 4);
if ( v13 == -1 )
goto LABEL_20;
}
v16 = *(_QWORD *)(v14 + 16LL * v13 + 8);
if ( v16
&& !(unsigned int)sub_1005DB8FC(*(_QWORD *)(v16 + 16), *(unsigned int *)(a2 + 16))
&& (sub_1005DB82C(*(FILE **)(v16 + 16), (void *)(v8 + 32), *(unsigned int *)(a2 + 20)) & 0xFFFFFFEF) == 0 )
{
*(_DWORD *)(v8 + 28) = 0;
*(_DWORD *)v8 = *(_DWORD *)v8;
*(_DWORD *)(v8 + 16) = 0;
}
}
}
}
LABEL_20:
sub_1005DBE08(v10);
return (***(__int64 (__fastcall ****)(_QWORD, __int64, __int64))(a1 + 32))(*(_QWORD *)(a1 + 32), v8, a3);
}