//
// sub_10050C630 from 0x10050c630 to 0x10050c6fc (204 bytes)
//
// 1 xrefs:
// > ??> @ 0x100858550
//
// 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_10050C630(__int64 *a1, __int64 a2, __int64 a3, int a4, int a5)
{
int v5; // w8
int v6; // w9
__int64 v7; // x10
float v8; // s0
float v9; // s1
int v10; // w11
int i; // w12
float v12; // s2
int v13; // w14
float v14; // s2
__int64 v15; // x13
__int64 v16; // x13
float v17; // s3
float v18; // s4
if ( a2 && a4 )
{
v5 = 0;
v6 = 0;
v7 = *a1;
v8 = *(float *)(*a1 + 676);
v9 = *(float *)(*a1 + 672);
v10 = *(_DWORD *)(*a1 + 684);
do
{
if ( v10 )
*(float *)(v7 + 536) = *(float *)(v7 + 680) * *(float *)(v7 + 536);
if ( a5 )
{
for ( i = 0; i != a5; ++i )
{
if ( v10 )
{
v13 = 0;
v14 = *(float *)(v7 + 536);
}
else
{
v15 = v7 + 4LL * i;
v14 = *(float *)(v7 + 680) * *(float *)(v15 + 536);
*(float *)(v15 + 536) = v14;
v13 = i;
}
v16 = (unsigned int)(v5 + i);
v17 = *(float *)(a2 + 4LL * (unsigned int)v16);
v18 = fabsf(v17);
if ( v18 > v14 )
{
*(float *)(v7 + 4LL * v13 + 536) = v18;
v17 = *(float *)(a2 + 4 * v16);
v14 = v18;
}
v12 = v9 / v14;
if ( v12 > v8 )
v12 = v8;
*(float *)(a3 + 4 * v16) = v17 * v12;
}
}
++v6;
v5 += a5;
}
while ( v6 != a4 );
}
return 0;
}