//
// sub_81B86C from 0x81b86c to 0x81b8aa (62 bytes)
//
// 6 xrefs:
// > fmt::BasicFormatter::ParseArgIndex @ 0x81ba64
// > fmt::BasicFormatter::format @ 0x81d514
// > fmt::BasicFormatter::format @ 0x81d538
// > fmt::internal::PrintfParser::Format @ 0x81dbec
// > fmt::internal::PrintfParser::Format @ 0x81dc68
// > fmt::internal::PrintfParser::Format @ 0x81dd06
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:01:46 +0000
//
int __fastcall sub_81B86C(_DWORD *a1, int *a2)
{
int v2; // r3
unsigned __int8 *v3; // r4
int result; // r0
v2 = 0;
do
{
v3 = (unsigned __int8 *)(*a1)++;
if ( (unsigned int)*v3 - 48 + 10 * v2 < v2 )
v2 = -1;
else
v2 = *v3 - 48 + 10 * v2;
}
while ( (unsigned int)v3[1] - 48 <= 9 );
if ( v2 >= 0 )
return v2;
result = *a2;
if ( *a2 )
return 0;
*a2 = (int)"number is too big in format";
return result;
}