//
// std::__ndk1::__assoc_sub_state::copy from 0xf876ec to 0xf877fc (272 bytes)
//
// 2 xrefs:
// > std::__ndk1::future::get @ 0xf87b34
// > ??> @ 0xb8288
//
// 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
//
void __fastcall std::__assoc_sub_state::copy(std::__assoc_sub_state *this)
{
pthread_mutex_t *v2; // x20
int v3; // w8
__int64 *v4; // x19
__int64 v5; // t1
__int64 v6; // [xsp+8h] [xbp-38h] BYREF
__int64 v7; // [xsp+10h] [xbp-30h] BYREF
std::mutex *v8; // [xsp+18h] [xbp-28h] BYREF
char v9; // [xsp+20h] [xbp-20h]
__int64 v10; // [xsp+28h] [xbp-18h]
v2 = (pthread_mutex_t *)((char *)this + 24);
v10 = *(_QWORD *)(_ReadStatusReg(TPIDR_EL0) + 40);
v8 = (std::__assoc_sub_state *)((char *)this + 24);
v9 = 1;
std::mutex::lock((pthread_mutex_t *)((char *)this + 24));
v3 = *((_DWORD *)this + 28);
if ( (v3 & 4) == 0 )
{
if ( (v3 & 8) != 0 )
{
*((_DWORD *)this + 28) = v3 & 0xFFFFFFF7;
std::mutex::unlock(v2);
v9 = 0;
(*(void (__fastcall **)(std::__assoc_sub_state *))(*(_QWORD *)this + 24LL))(this);
}
else
{
do
std::condition_variable::wait((pthread_cond_t *)((char *)this + 64), (__int64)&v8);
while ( (*((_BYTE *)this + 112) & 4) == 0 );
}
}
v7 = 0;
v5 = *((_QWORD *)this + 2);
v4 = (__int64 *)((char *)this + 16);
std::exception_ptr::~exception_ptr((std::exception_ptr *)&v7);
if ( v5 )
{
std::exception_ptr::exception_ptr(&v6, v4);
std::rethrow_exception(&v6);
}
if ( v9 )
std::mutex::unlock((pthread_mutex_t *)v8);
_ReadStatusReg(TPIDR_EL0);
}