//
// sub_1005CEB04 from 0x1005ceb04 to 0x1005ceca4 (416 bytes)
//
// 2 xrefs:
// > sub_100569E44 @ 0x100569ea8
// > sub_100569E44 @ 0x100569ebc
//
// 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 11:09:30 +0000
//
__int64 __fastcall sub_1005CEB04(__int64 a1, int a2, double a3, double a4)
{
int v5; // w8
float32x4_t v6; // q1
float32x4_t v7; // q3
float32x4_t v8; // q2
__int128 v9; // q5
float32x4_t v10; // q3
float32x4_t v11; // q3
float32x4_t v12; // q2
__int128 v13; // q5
float32x4_t v14; // q3
float32x4_t v15; // q3
float32x4_t v16; // q2
__int128 v17; // q5
float32x4_t v18; // q3
float32x4_t v19; // q3
float32x4_t v20; // q2
__int128 v21; // q5
float32x4_t v22; // q1
if ( *(_DWORD *)(a1 + 520) + 2 >= a2 )
{
v5 = *(_DWORD *)(a1 + 524);
if ( v5 >= 1 )
{
*(_DWORD *)(a1 + 516) = 0;
*(_OWORD *)(a1 + 500) = 0u;
*(_OWORD *)(a1 + 484) = 0u;
*(_OWORD *)(a1 + 468) = 0u;
*(_OWORD *)(a1 + 452) = 0u;
*(_OWORD *)(a1 + 436) = 0u;
*(_OWORD *)(a1 + 420) = 0u;
*(_OWORD *)(a1 + 404) = 0u;
*(_OWORD *)(a1 + 388) = 0u;
*(_OWORD *)(a1 + 372) = 0u;
*(_OWORD *)(a1 + 356) = 0u;
*(_OWORD *)(a1 + 340) = 0u;
*(_OWORD *)(a1 + 324) = 0u;
*(_OWORD *)(a1 + 308) = 0u;
*(_OWORD *)(a1 + 292) = 0u;
*(_OWORD *)(a1 + 276) = 0u;
*(_OWORD *)(a1 + 260) = 0u;
*(float *)&a4 = (float)v5;
v6 = (float32x4_t)vdupq_lane_s32(*(int32x2_t *)&a4, 0);
v7 = *(float32x4_t *)(a1 + 16);
v8 = vdivq_f32(*(float32x4_t *)a1, v6);
v9 = *(_OWORD *)(a1 + 144);
*(_OWORD *)(a1 + 260) = *(_OWORD *)(a1 + 128);
*(_OWORD *)(a1 + 276) = v9;
v10 = vdivq_f32(v7, v6);
*(int8x16_t *)(a1 + 388) = vandq_s8((int8x16_t)vsqrtq_f32(v8), (int8x16_t)vcgtzq_f32(v8));
*(int8x16_t *)(a1 + 404) = vandq_s8((int8x16_t)vsqrtq_f32(v10), (int8x16_t)vcgtzq_f32(v10));
v11 = *(float32x4_t *)(a1 + 48);
v12 = vdivq_f32(*(float32x4_t *)(a1 + 32), v6);
v13 = *(_OWORD *)(a1 + 176);
*(_OWORD *)(a1 + 292) = *(_OWORD *)(a1 + 160);
*(_OWORD *)(a1 + 308) = v13;
v14 = vdivq_f32(v11, v6);
*(int8x16_t *)(a1 + 420) = vandq_s8((int8x16_t)vsqrtq_f32(v12), (int8x16_t)vcgtzq_f32(v12));
*(int8x16_t *)(a1 + 436) = vandq_s8((int8x16_t)vsqrtq_f32(v14), (int8x16_t)vcgtzq_f32(v14));
v15 = *(float32x4_t *)(a1 + 80);
v16 = vdivq_f32(*(float32x4_t *)(a1 + 64), v6);
v17 = *(_OWORD *)(a1 + 208);
*(_OWORD *)(a1 + 324) = *(_OWORD *)(a1 + 192);
*(_OWORD *)(a1 + 340) = v17;
v18 = vdivq_f32(v15, v6);
*(int8x16_t *)(a1 + 452) = vandq_s8((int8x16_t)vsqrtq_f32(v16), (int8x16_t)vcgtzq_f32(v16));
*(int8x16_t *)(a1 + 468) = vandq_s8((int8x16_t)vsqrtq_f32(v18), (int8x16_t)vcgtzq_f32(v18));
v19 = *(float32x4_t *)(a1 + 112);
v20 = vdivq_f32(*(float32x4_t *)(a1 + 96), v6);
v21 = *(_OWORD *)(a1 + 240);
*(_OWORD *)(a1 + 356) = *(_OWORD *)(a1 + 224);
*(_OWORD *)(a1 + 372) = v21;
*(_DWORD *)(a1 + 524) = 0;
*(_DWORD *)(a1 + 256) = v5;
v22 = vdivq_f32(v19, v6);
*(int8x16_t *)(a1 + 484) = vandq_s8((int8x16_t)vsqrtq_f32(v20), (int8x16_t)vcgtzq_f32(v20));
*(int8x16_t *)(a1 + 500) = vandq_s8((int8x16_t)vsqrtq_f32(v22), (int8x16_t)vcgtzq_f32(v22));
*(_OWORD *)a1 = 0u;
*(_OWORD *)(a1 + 16) = 0u;
*(_OWORD *)(a1 + 32) = 0u;
*(_OWORD *)(a1 + 48) = 0u;
*(_OWORD *)(a1 + 128) = 0u;
*(_OWORD *)(a1 + 144) = 0u;
*(_OWORD *)(a1 + 160) = 0u;
*(_OWORD *)(a1 + 176) = 0u;
*(_OWORD *)(a1 + 192) = 0u;
*(_OWORD *)(a1 + 208) = 0u;
*(_OWORD *)(a1 + 64) = 0u;
*(_OWORD *)(a1 + 80) = 0u;
*(_OWORD *)(a1 + 224) = 0u;
*(_OWORD *)(a1 + 240) = 0u;
*(_OWORD *)(a1 + 96) = 0u;
*(_OWORD *)(a1 + 112) = 0u;
*(_WORD *)(a1 + 516) = *(_WORD *)(a1 + 528);
}
return 0;
}
else
{
*(_QWORD *)(a1 + 512) = 0;
*(_OWORD *)(a1 + 480) = 0u;
*(_OWORD *)(a1 + 496) = 0u;
*(_OWORD *)(a1 + 448) = 0u;
*(_OWORD *)(a1 + 464) = 0u;
*(_OWORD *)(a1 + 416) = 0u;
*(_OWORD *)(a1 + 432) = 0u;
*(_OWORD *)(a1 + 384) = 0u;
*(_OWORD *)(a1 + 400) = 0u;
*(_OWORD *)(a1 + 352) = 0u;
*(_OWORD *)(a1 + 368) = 0u;
*(_OWORD *)(a1 + 320) = 0u;
*(_OWORD *)(a1 + 336) = 0u;
*(_OWORD *)(a1 + 288) = 0u;
*(_OWORD *)(a1 + 304) = 0u;
*(_OWORD *)(a1 + 256) = 0u;
*(_OWORD *)(a1 + 272) = 0u;
return 0;
}
}