//
// sub_10045B010 from 0x10045b010 to 0x10045b160 (336 bytes)
//
// 1 xrefs:
// > ??> @ 0x1008279c0
//
// 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
//
__int64 __fastcall sub_10045B010(_QWORD *a1, int a2, __n128 a3)
{
__int64 v4; // x21
char *v5; // x22
__int64 *v6; // x20
__int64 result; // x0
__int64 v8; // [xsp+8h] [xbp-28h] BYREF
v4 = a2;
if ( *(_QWORD *)(a1[1] + 24LL * a2 + 73664) )
{
v5 = (char *)a1 + 4 * a2;
a3.n128_u32[0] = *((_DWORD *)v5 + 79);
v6 = &a1[a2 + 42];
result = *v6;
if ( a3.n128_f32[0] == 0.0 )
{
if ( result )
{
result = (*(__int64 (__fastcall **)(_QWORD *, __int64, __int64 *))(*a1 + 288LL))(a1, 4294967294LL, &v8);
if ( !(_DWORD)result )
{
result = sub_1004A73B8(*(_QWORD *)(a1[1] + 24 * v4 + 73664), v8, *v6, 4);
if ( !(_DWORD)result )
*v6 = 0;
}
}
}
else
{
if ( result )
{
LABEL_4:
a3.n128_f32[0] = a3.n128_f32[0] * *(float *)(a1[4] + 492LL);
return sub_1004F2D8C(result, 64, 1, 0, a3);
}
result = (*(__int64 (__fastcall **)(_QWORD *, __int64, __int64 *))(*a1 + 288LL))(a1, 4294967294LL, &v8);
if ( !(_DWORD)result )
{
result = sub_1004A6A84(*(_QWORD *)(a1[1] + 24 * v4 + 73664), v8, &a1[v4 + 42], 2, 0, 0);
if ( !(_DWORD)result )
{
result = *v6;
if ( *v6 )
{
a3.n128_u32[0] = *((_DWORD *)v5 + 79);
goto LABEL_4;
}
}
}
}
}
else
{
result = 0;
a1[a2 + 42] = 0;
}
return result;
}