//
// std::__ndk1::__assoc_sub_state::__sub_wait from 0x97f428 to 0x97f472 (74 bytes)
//
// 2 xrefs:
// > std::__ndk1::__assoc_sub_state::copy @ 0x97f3be
// > std::__ndk1::__assoc_sub_state::wait @ 0x97f49a
//
// 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:06 +0000
//
int __fastcall std::__assoc_sub_state::__sub_wait(int a1, int a2)
{
int result; // r0
result = *(_DWORD *)(a1 + 20);
if ( (result & 4) == 0 )
{
if ( (result & 8) != 0 )
{
*(_DWORD *)(a1 + 20) = result & 0xFFFFFFF7;
std::unique_lock::unlock(a2);
return (*(int (__fastcall **)(int))(*(_DWORD *)a1 + 12))(a1);
}
else
{
do
{
std::condition_variable::wait((pthread_cond_t *)(a1 + 16), a2);
result = *(unsigned __int8 *)(a1 + 20);
}
while ( (result & 4) == 0 );
}
}
return result;
}