//
// sub_CB2C0 from 0xcb2c0 to 0xcb398 (216 bytes)
//
// 2 xrefs:
// > sub_56490 @ 0x565e8
// > sub_56C18 @ 0x56e14
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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:14:48 +0000
//
__int64 __fastcall sub_CB2C0(__int64 a1, __int64 a2, unsigned int a3, unsigned int a4, unsigned int a5, char a6)
{
__int64 v6; // x8
__int64 v12; // x8
__int16 v13; // w8
__int64 result; // x0
__int64 v15; // x1
char v16; // w2
__int64 v17; // [xsp+8h] [xbp-38h] BYREF
v6 = *(_QWORD *)(a1 + 232);
if ( v6 && !*(_DWORD *)(v6 + 40) )
return 5;
v12 = *(_QWORD *)(a2 + 232);
if ( v12 )
{
if ( !*(_DWORD *)(v12 + 44) )
return 5;
}
v13 = atomic_load((unsigned int *)(a1 + 100));
if ( (v13 & 0x100) != 0 )
return sub_CB398(a1, a2, a3, a4, a5, 0);
result = sub_77980(*(_QWORD *)(a1 + 168), &v17, 40, a6 & 1);
if ( !(_DWORD)result )
{
sub_CD4B0();
*(_QWORD *)(v15 + 8) = a1;
*(_QWORD *)(v15 + 16) = a2;
*(_DWORD *)(v15 + 24) = a3;
*(_DWORD *)(v15 + 28) = a4;
*(_DWORD *)(v15 + 32) = a5;
return sub_77A28(*(_QWORD *)(a1 + 168), v15, v16);
}
return result;
}