//
// std::__ndk1::basic_istream>::sentry::sentry from 0x835170 to 0x83537c (524 bytes)
//
// 24 xrefs:
// > std::__ndk1::getline,std::__ndk1::allocator> @ 0x8353b8
// > cocos2d::ZipUtils::hexToChar @ 0xd9c704
// > cocos2d::CCTMXMapInfo::startElement @ 0xdaef90
// > cocos2d::CCTMXMapInfo::startElement @ 0xdaf048
// > cocos2d::CCTMXMapInfo::startElement @ 0xdaf194
// > std::__ndk1::basic_istream>::tellg @ 0xddbf2c
// > std::__ndk1::basic_istream>::read @ 0xddc030
// > pugi::xml_document::load @ 0xddc180
// > pugi::xml_document::load @ 0xddc1c0
// > std::__ndk1::basic_istream>::operator>> @ 0xf45160
// > std::__ndk1::basic_istream>::operator>> @ 0xf4529c
// > std::__ndk1::basic_istream>::operator>> @ 0xf45418
// > std::__ndk1::basic_istream>::operator>> @ 0xf45554
// > std::__ndk1::basic_istream>::operator>> @ 0xf456d4
// > std::__ndk1::basic_istream>::operator>> @ 0xf45810
// > std::__ndk1::basic_istream>::operator>> @ 0xf4594c
// > std::__ndk1::basic_istream>::operator>> @ 0xf45a88
// > std::__ndk1::basic_istream>::operator>> @ 0xf45bc4
// > std::__ndk1::basic_istream>::operator>> @ 0xf45d00
// > std::__ndk1::basic_istream>::operator>> @ 0xf45e3c
// > std::__ndk1::basic_istream>::operator>> @ 0xf45f78
// > std::__ndk1::basic_istream>::operator>> @ 0xf460b4
// > ??> @ 0x548c8
// > ??> @ 0xf7de0
//
// 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 12:55:10 +0000
//
// Alternative name is '_ZNSt6__ndk113basic_istreamIcNS_11char_traitsIcEEE6sentryC2ERS3_b'
__int64 __fastcall std::istream::sentry::sentry(bool *a1, _QWORD *a2, unsigned __int8 a3)
{
int v5; // w19
__int64 v6; // x0
char *v7; // x20
int v8; // w1
_QWORD *v9; // x0
std::ios_base *v10; // x0
__int64 v12; // x24
_QWORD *v13; // x19
unsigned __int8 *v14; // x0
unsigned __int8 v15; // w20
__int64 v16; // x0
__int64 v17[2]; // [xsp+40h] [xbp+40h] BYREF
v5 = a3;
v6 = _stack_chk_guard;
*a1 = 0;
v17[1] = v6;
v7 = (char *)a2 + *(_QWORD *)(*a2 - 24LL);
v8 = *((_DWORD *)v7 + 8);
if ( v8 )
{
std::ios_base::clear((std::ios_base *)v7, v8 | 4);
}
else
{
v9 = *((_QWORD **)v7 + 17);
if ( v9 )
{
std::ostream::flush(v9);
v10 = (std::ios_base *)((char *)a2 + *(_QWORD *)(*a2 - 24LL));
}
else
{
v10 = (std::ios_base *)v7;
}
if ( !v5 && (*((_DWORD *)v10 + 2) & 0x1000) != 0 )
{
std::ios_base::getloc(v17, v10);
v12 = std::locale::use_facet((std::locale *)v17, (std::locale::id *)&std::ctype::id);
std::locale::~locale((std::locale *)v17);
v13 = *(_QWORD **)((char *)a2 + *(_QWORD *)(*a2 - 24LL) + 40);
while ( 1 )
{
if ( !v13 )
goto LABEL_18;
v14 = (unsigned __int8 *)v13[3];
if ( v14 != (unsigned __int8 *)v13[4] )
goto LABEL_12;
if ( (*(unsigned int (__fastcall **)(_QWORD *))(*v13 + 72LL))(v13) == -1 )
goto LABEL_18;
v14 = (unsigned __int8 *)v13[3];
if ( v14 == (unsigned __int8 *)v13[4] )
v15 = (*(__int64 (__fastcall **)(_QWORD *))(*v13 + 72LL))(v13);
else
LABEL_12:
v15 = *v14;
if ( !isascii(v15) || (*(_QWORD *)(*(_QWORD *)(v12 + 16) + 8LL * v15) & 1) == 0 )
break;
v16 = v13[3];
if ( v16 == v13[4] )
(*(void (__fastcall **)(_QWORD *))(*v13 + 80LL))(v13);
else
v13[3] = v16 + 1;
}
if ( v13[3] == v13[4] && (*(unsigned int (__fastcall **)(_QWORD *))(*v13 + 72LL))(v13) == -1 )
LABEL_18:
std::ios_base::clear(
(std::ios_base *)((char *)a2 + *(_QWORD *)(*a2 - 24LL)),
*(_DWORD *)((char *)a2 + *(_QWORD *)(*a2 - 24LL) + 32) | 6);
v10 = (std::ios_base *)((char *)a2 + *(_QWORD *)(*a2 - 24LL));
}
*a1 = *((_DWORD *)v10 + 8) == 0;
}
return _stack_chk_guard;
}