//
// unknown_libname_39 from 0x18012c650 to 0x18012c6f3 (163 bytes)
//
// 2 xrefs:
// > __crt_stdio_output::output_processor,__crt_stdio_output::standard_base>>::process @ 0x18012cc8e
// > ??> @ 0x180202bf4
//
// This function is hookable on this platform (idp: pc, 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 10:54:57 +0000
//
// Microsoft VisualC 64bit universal runtime
char __fastcall unknown_libname_39(__int64 a1, int *a2)
{
int *v2; // rbx
int v5; // esi
__int64 v6; // rcx
int *v7; // rax
char result; // al
wchar_t *EndPtr; // [rsp+30h] [rbp+8h] BYREF
v2 = *(int **)(a1 + 16);
if ( !v2 )
{
v2 = errno();
*(_QWORD *)(a1 + 16) = v2;
}
v5 = *v2;
*v2 = 0;
v6 = *(_QWORD *)(a1 + 24);
EndPtr = nullptr;
*a2 = wcstol((const wchar_t *)(v6 - 2), &EndPtr, 10);
v7 = *(int **)(a1 + 16);
if ( !v7 )
{
v7 = errno();
*(_QWORD *)(a1 + 16) = v7;
}
if ( *v7 == 34 || (unsigned __int64)EndPtr < *(_QWORD *)(a1 + 24) )
{
result = 0;
}
else
{
*(_QWORD *)(a1 + 24) = EndPtr;
result = 1;
}
if ( !*v2 )
{
if ( v5 )
*v2 = v5;
}
return result;
}