//
// std::__ndk1::promise::set_exception_at_thread_exit from 0xf88108 to 0xf88228 (288 bytes)
//
// 1 xrefs:
// > ??> @ 0x8bd08
//
// 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:54 +0000
//
void __fastcall std::promise::set_exception_at_thread_exit(__int64 *a1, __int64 *a2)
{
__int64 v2; // x19
void *exception; // x0
unsigned __int8 v4; // w8
void *v5; // x19
__int64 v6[2]; // [xsp+0h] [xbp-20h] BYREF
v6[1] = *(_QWORD *)(_ReadStatusReg(TPIDR_EL0) + 40);
v2 = *a1;
if ( !*a1 )
{
exception = _cxa_allocate_exception(0x20u);
v4 = atomic_load((unsigned __int8 *)&byte_1565EA8);
v5 = exception;
if ( (v4 & 1) == 0 && _cxa_guard_acquire((__guard *)&byte_1565EA8) )
{
qword_1565EA0 = (__int64)&off_1535E88;
__cxa_atexit((void (*)(void *))std::error_category::~error_category, &qword_1565EA0, &unk_1548000);
_cxa_guard_release((__guard *)&byte_1565EA8);
}
std::future_error::future_error((__int64)v5, 3, (__int64)&qword_1565EA0);
_cxa_throw(
v5,
(struct type_info *)&`typeinfo for'std::future_error,
(void (*)(void *))std::future_error::~future_error);
}
std::exception_ptr::exception_ptr(v6, a2);
std::__assoc_sub_state::set_exception_at_thread_exit(v2, v6);
std::exception_ptr::~exception_ptr((std::exception_ptr *)v6);
_ReadStatusReg(TPIDR_EL0);
}