//
// sub_97DDE4 from 0x97dde4 to 0x97df08 (292 bytes)
//
// 2 xrefs:
// > std::__ndk1::stoi @ 0x97b8be
// > std::__ndk1::stol @ 0x97b9d6
//
// 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:06:04 +0000
//
int __fastcall sub_97DDE4(unsigned __int8 *a1, char *a2, _DWORD *a3, int a4)
{
char *v8; // r6
char v9; // r4
int v10; // r4
unsigned int *v11; // r0
_DWORD *exception; // r5
_DWORD *v14; // r5
unsigned int v15; // [sp+4h] [bp-24h]
char *v16; // [sp+8h] [bp-20h] BYREF
unsigned int v17[2]; // [sp+Ch] [bp-1Ch] BYREF
v16 = nullptr;
v8 = *((char **)a2 + 2);
v9 = *a2;
v15 = *(_DWORD *)_errno();
*(_DWORD *)_errno() = 0;
if ( (v9 & 1) == 0 )
v8 = a2 + 1;
v10 = strtol(v8, &v16, a4);
v11 = (unsigned int *)_errno();
v17[0] = *v11;
*v11 = v15;
if ( v17[0] == 34 )
{
std::operator+(v17, a1, ": out of range");
exception = _cxa_allocate_exception(8u);
std::logic_error::logic_error(exception, (int)v17);
*exception = &off_D1548C;
_cxa_throw(
exception,
(struct type_info *)&`typeinfo for'std::out_of_range,
(void (*)(void *))std::length_error::~length_error);
}
if ( v16 == v8 )
{
std::operator+(v17, a1, ": no conversion");
v14 = _cxa_allocate_exception(8u);
std::logic_error::logic_error(v14, (int)v17);
*v14 = &off_D1544C;
_cxa_throw(
v14,
(struct type_info *)&`typeinfo for'std::invalid_argument,
(void (*)(void *))std::length_error::~length_error);
}
if ( a3 )
*a3 = v16 - v8;
return v10;
}