//
// sub_645C80 from 0x645c80 to 0x645d1a (154 bytes)
//
// 1 xrefs:
// > sub_64231C @ 0x6425e4
//
// 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
//
int __fastcall sub_645C80(int a1, int a2, const char *a3, char *a4)
{
size_t v7; // r9
size_t v8; // r0
size_t v9; // r4
size_t v10; // r6
int v11; // r5
char *v12; // r0
char *v13; // r7
char *v14; // r3
int v15; // r4
_DWORD *v16; // r6
v7 = strlen(a4);
v8 = strlen(a3);
v9 = v8 + v7;
v10 = v8;
v11 = v8 + v7 + 2;
v12 = (char *)off_ABAEAC(v11);
if ( !v12 )
return 27;
v13 = v12;
sub_624640(v12, v11, "%s:", a3);
memcpy(&v13[v10 + 1], a4, v7);
v14 = &v13[v9];
v15 = 0;
v14[1] = 0;
v16 = sub_635FE4(*(_DWORD *)(*(_DWORD *)(a1 + 34944) + 4 * a2), (int)v13);
if ( !v16 )
{
v15 = 27;
off_ABAEB0(v13);
sub_63611C(*(_DWORD *)(*(_DWORD *)(a1 + 34944) + 4 * a2));
}
*(_DWORD *)(*(_DWORD *)(a1 + 34944) + 4 * a2) = v16;
return v15;
}