//
// sub_946A0C from 0x946a0c to 0x946a70 (100 bytes)
//
// 0 xrefs:
//
// 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:05:11 +0000
//
int __fastcall sub_946A0C(int a1)
{
int i; // r5
int (__fastcall *v4)(_DWORD, _DWORD); // r3
int v5; // r0
pthread_mutex_t *v6; // r0
do
{
while ( 1 )
{
pthread_mutex_lock(*(pthread_mutex_t **)a1);
for ( i = *(_DWORD *)(a1 + 4); i == 1; i = *(_DWORD *)(a1 + 4) )
pthread_cond_wait((pthread_cond_t *)(*(_DWORD *)a1 + 4), *(pthread_mutex_t **)a1);
if ( i != 2 )
break;
v4 = *(int (__fastcall **)(_DWORD, _DWORD))(a1 + 8);
if ( v4 )
{
if ( v4(*(_DWORD *)(a1 + 12), *(_DWORD *)(a1 + 16)) )
v5 = *(_DWORD *)(a1 + 20);
else
v5 = *(_DWORD *)(a1 + 20) | 1;
*(_DWORD *)(a1 + 20) = v5;
}
v6 = *(pthread_mutex_t **)a1;
*(_DWORD *)(a1 + 4) = 1;
pthread_cond_signal((pthread_cond_t *)(&v6->__align + 1));
pthread_mutex_unlock(*(pthread_mutex_t **)a1);
}
pthread_cond_signal((pthread_cond_t *)(*(_DWORD *)a1 + 4));
pthread_mutex_unlock(*(pthread_mutex_t **)a1);
}
while ( i );
return 0;
}