//
// std::__ndk1::stoull from 0xf82858 to 0xf82a50 (504 bytes)
//
// 6 xrefs:
// > EditorBuildStats::fromString @ 0x811624
// > GJBaseGameLayer::parseRecording @ 0x9de1c4
// > GJBaseGameLayer::parseRecording @ 0x9de93c
// > GJBaseGameLayer::parseRecording @ 0x9dea24
// > ReadArchive::process @ 0xc0f1d0
// > ??> @ 0x93ee0
//
// This function is hookable on this platform (idp: arm, 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 13:13:51 +0000
//
unsigned __int64 __fastcall std::stoull(__int64 a1, _QWORD *a2, int a3)
{
char *v5; // x20
int *v6; // x22
unsigned __int64 result; // x0
_QWORD *exception; // x20
_QWORD *v9; // x20
void *v10[3]; // [xsp+0h] [xbp-80h] BYREF
int v11; // [xsp+1Ch] [xbp-64h]
char *v12; // [xsp+20h] [xbp-60h] BYREF
unsigned __int64 v13[2]; // [xsp+28h] [xbp-58h] BYREF
unsigned __int64 v14[4]; // [xsp+40h] [xbp-40h] BYREF
v14[3] = *(_QWORD *)(_ReadStatusReg(TPIDR_EL0) + 40);
LOBYTE(v10[0]) = 12;
v10[1] = nullptr;
v10[2] = nullptr;
strcpy((char *)v10 + 1, "stoull");
v12 = nullptr;
if ( (*(_BYTE *)a1 & 1) != 0 )
v5 = *(char **)(a1 + 16);
else
v5 = (char *)(a1 + 1);
v6 = (int *)__errno();
v11 = *v6;
*v6 = 0;
result = strtoull(v5, &v12, a3);
LODWORD(v14[0]) = *v6;
*v6 = v11;
v11 = v14[0];
if ( LODWORD(v14[0]) == 34 )
{
std::operator+(": out of range", (__int64)v10, v14);
exception = _cxa_allocate_exception(0x10u);
std::logic_error::logic_error(exception, (__int64)v14);
*exception = off_1536D68;
_cxa_throw(
exception,
(struct type_info *)&`typeinfo for'std::out_of_range,
(void (*)(void *))std::logic_error::~logic_error);
}
if ( v12 == v5 )
{
std::operator+(": no conversion", (__int64)v10, v13);
v9 = _cxa_allocate_exception(0x10u);
std::logic_error::logic_error(v9, (__int64)v13);
*v9 = off_1536CE8;
_cxa_throw(
v9,
(struct type_info *)&`typeinfo for'std::invalid_argument,
(void (*)(void *))std::logic_error::~logic_error);
}
if ( a2 )
*a2 = v12 - v5;
_ReadStatusReg(TPIDR_EL0);
return result;
}