//
// sub_75681C from 0x75681c to 0x756892 (118 bytes)
//
// 8 xrefs:
// > sub_744A14 @ 0x744a5e
// > sub_744A84 @ 0x744b7e
// > sub_744F70 @ 0x744fba
// > sub_744FE0 @ 0x7450dc
// > sub_745C14 @ 0x745c36
// > sub_745C44 @ 0x745c5a
// > sub_761258 @ 0x761278
// > sub_7614C8 @ 0x7614e8
//
// 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
//
unsigned int **__fastcall sub_75681C(unsigned int **a1, unsigned int **a2)
{
unsigned int *v4; // r2
unsigned int v5; // r3
unsigned int *v6; // r4
unsigned int v7; // r3
_BOOL4 v8; // r3
v4 = *a2;
if ( &pthread_create )
{
__dmb(0xFu);
do
v5 = __ldrex(v4);
while ( __strex(v5 + 1, v4) );
__dmb(0xFu);
v6 = *a1;
__dmb(0xFu);
do
v7 = __ldrex(v6);
while ( __strex(v7 - 1, v6) );
__dmb(0xFu);
}
else
{
v6 = *a1;
++*v4;
v7 = (*v6)--;
}
v8 = v7 == 1;
if ( !v6 )
v8 = 0;
if ( v8 )
{
sub_756714(v6);
operator delete(v6);
}
*a1 = *a2;
return a1;
}