//
// sub_F85934 from 0xf85934 to 0xf85a10 (220 bytes)
//
// 1 xrefs:
// > ??> @ 0x1535d58
//
// 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 13:13:52 +0000
//
unsigned __int64 __usercall sub_F85934@(int a1@, size_t *a2@)
{
unsigned __int64 result; // x0
char *v4; // x20
size_t v5; // x21
void *v6; // x19
size_t v7; // x22
void *v8; // x0
if ( a1 >= 4096 )
{
result = (unsigned __int64)operator new(0x30u);
a2[2] = result;
*a2 = 49;
a2[1] = 34;
strcpy((char *)result, "unspecified generic_category error");
return result;
}
v4 = strerror(a1);
a2[1] = 0;
a2[2] = 0;
*a2 = 0;
result = strlen(v4);
v5 = result;
if ( result >= 0xFFFFFFFFFFFFFFF0LL )
std::__basic_string_common::__throw_length_error();
if ( result >= 0x17 )
{
v7 = (result + 16) & 0xFFFFFFFFFFFFFFF0LL;
v8 = operator new(v7);
a2[1] = v5;
a2[2] = (size_t)v8;
*a2 = v7 | 1;
v6 = v8;
}
else
{
*(_BYTE *)a2 = 2 * result;
v6 = (char *)a2 + 1;
if ( !result )
goto LABEL_9;
}
result = (unsigned __int64)memcpy(v6, v4, v5);
LABEL_9:
*((_BYTE *)v6 + v5) = 0;
return result;
}