//
// sub_1004EBC24 from 0x1004ebc24 to 0x1004ebd18 (244 bytes)
//
// 1 xrefs:
// > sub_1004ED490 @ 0x1004ed600
//
// 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
//
__n128 __fastcall sub_1004EBC24(__int64 a1, __n128 *a2, __int64 a3)
{
_QWORD *v5; // x8
__int64 v6; // x23
__int64 v7; // x22
__n128 result; // q0
signed __int32 v9; // w0
unsigned __int32 v10; // w8
unsigned __int32 v11; // w0
v5 = (_QWORD *)a2[5].n128_u64[0];
v6 = v5[14];
v7 = *(_QWORD *)(*v5 + 32LL);
if ( !(unsigned int)sub_10042CAB0(a1, (__int64)a2) )
{
sub_10042C340((__int64)&a2->n128_i64[1], *(_QWORD *)a3, *(_DWORD *)(a3 + 8));
if ( !(unsigned int)sub_10042C698(&a2->n128_i32[2], 1u) )
{
v9 = sub_10042C698(&a2->n128_i32[2], *(_DWORD *)(v6 + 24));
if ( v9 != -1 )
{
a2[3].n128_u32[2] = v9;
v10 = **(_DWORD **)(v7 + 8LL * v9 + 32);
a2[2].n128_u32[3] = v10;
if ( v10 )
{
a2[2].n128_u32[2] = sub_10042C698(&a2->n128_i32[2], 1u);
v11 = sub_10042C698(&a2->n128_i32[2], 1u);
a2[3].n128_u32[0] = v11;
if ( v11 == -1 )
return result;
}
else
{
a2[2].n128_u32[2] = 0;
a2[3].n128_u32[0] = 0;
}
result = *(__n128 *)(a3 + 24);
a2[4] = result;
a2[3].n128_u32[3] = *(_DWORD *)(a3 + 16);
a2[3].n128_u32[1] = 0;
a2->n128_u64[0] = 0;
}
}
}
return result;
}