//
// sub_1800B7E80 from 0x1800b7e80 to 0x1800b7eef (111 bytes)
//
// 4 xrefs:
// > sub_1800FE610 @ 0x1801004f8
// > ??> @ 0x180189930
// > ??> @ 0x180189940
// > ??> @ 0x1801fd230
//
// 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
//
__int64 __fastcall sub_1800B7E80(__int64 a1, int a2, unsigned __int8 *a3)
{
unsigned __int8 v3; // al
int v4; // r10d
__int64 v5; // r9
int v6; // ebx
unsigned __int8 *v7; // rdx
v3 = *a3;
v4 = 0;
if ( *a3 )
{
v5 = 0;
v6 = a2 - 2;
do
{
if ( v4 >= v6 )
break;
++a3;
v7 = (unsigned __int8 *)(v5 + a1);
++v5;
if ( v3 >= 0x80u )
{
*v7 = (v3 >> 6) | 0xC0;
*(_BYTE *)(v5 + a1) = v3 & 0x3F | 0x80;
++v5;
++v4;
}
else
{
*v7 = v3;
}
v3 = *a3;
++v4;
}
while ( *a3 );
}
*(_BYTE *)(v4 + a1) = 0;
return a1;
}