//
// unknown_libname_58 from 0x18012ef48 to 0x18012f02e (230 bytes)
//
// 2 xrefs:
// > __multtenpow12 @ 0x18012db4e
// > ??> @ 0x180202d68
//
// 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
//
// Microsoft VisualC 64bit universal runtime
char __fastcall unknown_libname_58(__int64 a1)
{
const char *v2; // rsi
int v3; // edi
__crt_locale_pointers *v4; // r9
int v5; // eax
__int64 v6; // rcx
wchar_t v7; // dx
wchar_t DstCh; // [rsp+40h] [rbp+8h] BYREF
if ( *(_BYTE *)(a1 + 84) || *(int *)(a1 + 80) <= 0 )
{
unknown_libname_60(a1 + 1128, *(_QWORD *)(a1 + 72), *(unsigned int *)(a1 + 80), a1 + 40, a1 + 16);
}
else
{
v2 = *(const char **)(a1 + 72);
v3 = 0;
while ( 1 )
{
v4 = *(__crt_locale_pointers **)(a1 + 8);
DstCh = 0;
v5 = mbtowc_l(&DstCh, v2, *((int *)v4->locinfo + 2), v4);
if ( v5 <= 0 )
break;
v6 = *(_QWORD *)(a1 + 1128);
v7 = DstCh;
if ( *(_QWORD *)(v6 + 16) == *(_QWORD *)(v6 + 8) )
{
if ( *(_BYTE *)(v6 + 24) )
++*(_DWORD *)(a1 + 40);
else
*(_DWORD *)(a1 + 40) = -1;
}
else
{
++*(_DWORD *)(a1 + 40);
++*(_QWORD *)(v6 + 16);
***(_WORD ***)(a1 + 1128) = v7;
**(_QWORD **)(a1 + 1128) += 2LL;
}
v2 += v5;
if ( ++v3 == *(_DWORD *)(a1 + 80) )
return 1;
}
*(_DWORD *)(a1 + 40) = -1;
}
return 1;
}