//
// sub_7665E4 from 0x7665e4 to 0x766710 (300 bytes)
//
// 0 xrefs:
//
// 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
//
_DWORD *__fastcall sub_7665E4(_DWORD *a1, int a2, int a3, int a4, unsigned __int8 a5, int a6, wchar_t a7, double a8)
{
void *v10; // r11
int v11; // r5
char *v12; // r3
char *v13; // r5
char *v14; // r0
unsigned int *v16; // r2
int v17; // r3
char v18[320]; // [sp+10h] [bp-140h] BYREF
char *v19; // [sp+150h] [bp+0h]
int *v20; // [sp+154h] [bp+4h]
int v21; // [sp+158h] [bp+8h]
int v22; // [sp+15Ch] [bp+Ch]
_DWORD v23[3]; // [sp+160h] [bp+10h] BYREF
char v24; // [sp+16Ch] [bp+1Ch] BYREF
unsigned int *v25; // [sp+170h] [bp+20h] BYREF
char *v26; // [sp+174h] [bp+24h] BYREF
v22 = a2;
v23[0] = a3;
v23[1] = a4;
v20 = v23;
v21 = a5;
sub_75629C(&v25, (unsigned int **)(a6 + 108));
v10 = sub_764188((int)&v25);
v26 = (char *)sub_7566B8();
v11 = sub_74B564((int)&v26, v18, 0, "%.*Lf", 0, a8);
v19 = &v24;
sub_7782AC(&v26, v11, 0);
v12 = v26;
v13 = &v18[v11];
if ( *((int *)v26 - 1) >= 0 )
{
sub_777910(&v26);
v12 = v26;
}
(*(void (__fastcall **)(void *, char *, char *, char *))(*(_DWORD *)v10 + 44))(v10, v18, v13, v12);
if ( v21 )
sub_765C04(a1, v22, *v20, v20[1], (_DWORD *)a6, a7, &v26);
else
sub_7660F4(a1, v22, *v20, v20[1], (_DWORD *)a6, a7, &v26);
v14 = v26 - 12;
if ( v26 - 12 != (char *)&unk_ACDDAC )
{
if ( &pthread_create )
{
v16 = (unsigned int *)(v26 - 4);
__dmb(0xFu);
do
v17 = __ldrex(v16);
while ( __strex(v17 - 1, v16) );
__dmb(0xFu);
}
else
{
v17 = *((_DWORD *)v26 - 1);
*((_DWORD *)v26 - 1) = v17 - 1;
}
if ( v17 <= 0 )
operator delete(v14);
}
sub_756898(&v25);
return a1;
}