//
// CompareFunction from 0x140007c20 to 0x140007d93 (371 bytes)
//
// 2 xrefs:
// > AchievementManager::getAllAchievementsSorted @ 0x140039d0f
// > ??> @ 0x1406c3c18
//
// 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
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall CompareFunction(_QWORD *a1, __int64 *a2)
{
__int64 v2; // rbx
cocos2d::CCString *v3; // rax
float v4; // xmm6_4
void *v5; // rcx
cocos2d::CCString *v6; // rax
float v7; // xmm7_4
void *v8; // rcx
void *Block[2]; // [rsp+20h] [rbp-58h] BYREF
__int64 v11; // [rsp+30h] [rbp-48h]
unsigned __int64 v12; // [rsp+38h] [rbp-40h]
v2 = *a2;
*(_OWORD *)Block = 0;
v11 = 5;
v12 = 15;
strcpy((char *)Block, "order");
v3 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*a1, Block);
v4 = cocos2d::CCString::floatValue(v3) * 1000.0;
if ( v12 > 0xF )
{
v5 = Block[0];
if ( v12 + 1 >= 0x1000 )
{
v5 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v5 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v5);
}
*(_OWORD *)Block = 0;
v11 = 5;
v12 = 15;
strcpy((char *)Block, "order");
v6 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v2, Block);
v7 = cocos2d::CCString::floatValue(v6) * 1000.0;
if ( v12 > 0xF )
{
v8 = Block[0];
if ( v12 + 1 >= 0x1000 )
{
v8 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v8 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v8);
}
return (unsigned int)(int)(float)(v4 - v7);
}