//
// sub_100580660 from 0x100580660 to 0x100580780 (288 bytes)
//
// 2 xrefs:
// > sub_10058012C @ 0x100580498
// > sub_100580780 @ 0x10058095c
//
// 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_100580660(__int64 a1, char *__s, const char *a3, _QWORD *a4, _QWORD *a5)
{
size_t v10; // x27
size_t v11; // x26
__int64 v12; // x28
char *v13; // x0
char *v14; // x23
__int64 v15; // x19
v10 = strlen(__s);
v11 = strlen(a3);
v12 = 2 * v10;
v13 = (char *)off_10085DEB0(v11 + 2 * v10 + 2);
v14 = v13;
if ( v13 )
{
memcpy(v13, __s, v10);
v14[v10] = 0;
memcpy(&v14[v10 + 1], __s, v10);
v14[v12 | 1] = 0;
memcpy(&v14[v12 + 2], a3, v11);
v15 = sub_1005492A8(a1, v14);
off_10085DEB8(v14);
return v15;
}
else
{
*a5 = 0;
*a4 = 0;
return 27;
}
}