//
// sub_CBB174 from 0xcbb174 to 0xcbb1f0 (124 bytes)
//
// 2 xrefs:
// > WebPSetWorkerInterface @ 0xcbb378
// > ??> @ 0x1233e50
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
pthread_mutex_t *__fastcall sub_CBB174(_DWORD *a1)
{
pthread_mutex_t *result; // x0
int v3; // w0
pthread_mutex_t *v4; // x0
result = *(pthread_mutex_t **)a1;
if ( result )
{
pthread_mutex_lock(result);
v3 = a1[2];
if ( v3 )
{
while ( v3 != 1 )
{
pthread_cond_wait((pthread_cond_t *)(*(_QWORD *)a1 + 40LL), *(pthread_mutex_t **)a1);
v3 = a1[2];
}
v4 = *(pthread_mutex_t **)a1;
a1[2] = 2;
pthread_cond_signal((pthread_cond_t *)&v4[1]);
return (pthread_mutex_t *)pthread_mutex_unlock(*(pthread_mutex_t **)a1);
}
else
{
return (pthread_mutex_t *)pthread_mutex_unlock(*(pthread_mutex_t **)a1);
}
}
return result;
}