//
// sub_180019820 from 0x180019820 to 0x1800198ca (170 bytes)
//
// 2 xrefs:
// > ??> @ 0x180028ff8
// > ??> @ 0x18004ac68
//
// 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
//
void __fastcall sub_180019820(__int64 a1)
{
__int64 v2; // r8
__int64 v3; // r9
__int64 *v4; // rcx
__int64 v5; // rdx
void *v6; // rbx
__int64 v7; // rcx
pthread_mutex_lock(a1 + 72);
v2 = *(_QWORD *)(a1 + 56);
v3 = *(_QWORD *)(v2 + 8);
if ( v3 )
{
v4 = **(__int64 ***)v2;
v5 = *v4;
v6 = (void *)v4[2];
*(_QWORD *)(v2 + 8) = v3 - 1;
*(_QWORD *)v4[1] = v5;
*(_QWORD *)(v5 + 8) = v4[1];
j_j_free(v4);
pthread_mutex_unlock(a1 + 72);
v7 = *(_QWORD *)(a1 + 104);
if ( v7 )
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v7 + 32LL))(v7, v6);
if ( v6 )
j_j_free(v6);
}
else
{
pthread_mutex_unlock(a1 + 72);
}
}