//
// sub_1800B8230 from 0x1800b8230 to 0x1800b82c1 (145 bytes)
//
// 4 xrefs:
// > sub_1800B7CA0 @ 0x1800b7cb3
// > ??> @ 0x1801899d0
// > ??> @ 0x1801899e0
// > ??> @ 0x1801fd290
//
// 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:53:59 +0000
//
__int64 __fastcall sub_1800B8230(_BYTE *a1, int a2, int a3, __int64 a4)
{
int v4; // ebx
__int64 v8; // rsi
_DWORD *v9; // rax
int v10; // eax
v4 = a2;
if ( a2 <= 0 )
return 0;
v8 = a2;
*a1 = 0;
v9 = sub_1800429F0();
v10 = common_vsprintf<__crt_stdio_output::standard_base,char>(*v9 | 2u, (int)a1, v4, a3, nullptr, a4);
if ( v10 < 0 )
v10 = -1;
if ( v10 >= 0 && v10 < v4 )
v4 = v10;
a1[v8 - 1] = 0;
return (unsigned int)v4;
}