//
// std::__ndk1::__assoc_sub_state::set_exception from 0x97f1e4 to 0x97f294 (176 bytes)
//
// 2 xrefs:
// > std::__ndk1::promise::~promise @ 0x97f65e
// > std::__ndk1::promise::set_exception @ 0x97f7d4
//
// 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:05 +0000
//
int __fastcall std::__assoc_sub_state::set_exception(int a1, _DWORD *a2)
{
pthread_mutex_t *v3; // r8
int v5; // r4
void *exception; // r5
_DWORD v8[2]; // [sp+0h] [bp-14h] BYREF
v3 = (pthread_mutex_t *)(a1 + 12);
std::mutex::lock((pthread_mutex_t *)(a1 + 12));
if ( (*(_BYTE *)(a1 + 20) & 1) != 0
|| (v8[0] = 0, v5 = *(_DWORD *)(a1 + 8), std::exception_ptr::~exception_ptr((std::exception_ptr *)v8), v5) )
{
exception = _cxa_allocate_exception(0x10u);
std::future_category();
std::future_error::future_error((int)exception, 2u, (unsigned int)&dword_D33CC4);
_cxa_throw(
exception,
(struct type_info *)&`typeinfo for'std::future_error,
(void (*)(void *))std::future_error::~future_error);
}
std::exception_ptr::operator=((_DWORD *)(a1 + 8), a2);
*(_DWORD *)(a1 + 20) |= 4u;
std::condition_variable::notify_all((pthread_cond_t *)(a1 + 16));
std::mutex::unlock(v3);
return _stack_chk_guard - v8[1];
}