//
// std::__ndk1::__assoc_sub_state::wait from 0xf87890 to 0xf87968 (216 bytes)
//
// 1 xrefs:
// > ??> @ 0x554b0
//
// 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:53 +0000
//
__int64 __fastcall std::__assoc_sub_state::wait(std::__assoc_sub_state *this)
{
pthread_mutex_t *v2; // x20
__int64 result; // x0
int v4; // w8
std::mutex *v5; // [xsp+8h] [xbp-28h] BYREF
char v6; // [xsp+10h] [xbp-20h]
__int64 v7; // [xsp+18h] [xbp-18h]
v2 = (pthread_mutex_t *)((char *)this + 24);
v7 = *(_QWORD *)(_ReadStatusReg(TPIDR_EL0) + 40);
v5 = (std::__assoc_sub_state *)((char *)this + 24);
v6 = 1;
result = std::mutex::lock((pthread_mutex_t *)((char *)this + 24));
v4 = *((_DWORD *)this + 28);
if ( (v4 & 4) == 0 )
{
if ( (v4 & 8) != 0 )
{
*((_DWORD *)this + 28) = v4 & 0xFFFFFFF7;
std::mutex::unlock(v2);
v6 = 0;
result = (*(__int64 (__fastcall **)(std::__assoc_sub_state *))(*(_QWORD *)this + 24LL))(this);
}
else
{
do
result = std::condition_variable::wait((pthread_cond_t *)((char *)this + 64), (__int64)&v5);
while ( (*((_BYTE *)this + 112) & 4) == 0 );
}
}
if ( v6 )
result = std::mutex::unlock((pthread_mutex_t *)v5);
_ReadStatusReg(TPIDR_EL0);
return result;
}