//
// sub_10050F104 from 0x10050f104 to 0x10050f344 (576 bytes)
//
// 1 xrefs:
// > sub_10050F9E4 @ 0x10050f9e8
//
// 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_10050F104(__int64 a1, int a2, float a3)
{
__int64 result; // x0
__int64 v5; // x20
__int64 v6; // x8
_QWORD *v7; // x11
__int64 v8; // x8
result = 31;
switch ( a2 )
{
case 1:
if ( *(float *)(a1 + 912) == a3 )
return 0;
*(float *)(a1 + 912) = a3;
v5 = *(_QWORD *)(a1 + 168);
if ( v5 )
goto LABEL_33;
goto LABEL_45;
case 2:
if ( *(float *)(a1 + 916) == a3 )
return 0;
*(float *)(a1 + 916) = a3;
v5 = *(_QWORD *)(a1 + 168);
if ( !v5 )
goto LABEL_45;
goto LABEL_33;
case 3:
if ( *(float *)(a1 + 920) == a3 )
return 0;
*(float *)(a1 + 920) = a3;
v5 = *(_QWORD *)(a1 + 168);
if ( !v5 )
goto LABEL_45;
goto LABEL_33;
case 4:
if ( *(float *)(a1 + 924) == a3 )
return 0;
*(float *)(a1 + 924) = a3;
v5 = *(_QWORD *)(a1 + 168);
if ( !v5 )
goto LABEL_45;
goto LABEL_33;
case 5:
if ( *(float *)(a1 + 928) == a3 )
return 0;
*(float *)(a1 + 928) = a3;
v5 = *(_QWORD *)(a1 + 168);
if ( !v5 )
goto LABEL_45;
goto LABEL_33;
case 7:
if ( *(float *)(a1 + 936) == a3 )
return 0;
*(float *)(a1 + 936) = a3;
v5 = *(_QWORD *)(a1 + 168);
if ( !v5 )
goto LABEL_45;
goto LABEL_33;
case 8:
if ( *(float *)(a1 + 940) == a3 )
return 0;
*(float *)(a1 + 940) = a3;
v5 = *(_QWORD *)(a1 + 168);
if ( !v5 )
goto LABEL_45;
goto LABEL_33;
case 12:
*(float *)(a1 + 560) = a3;
if ( !*(_BYTE *)(a1 + 568) || *(float *)(a1 + 952) == a3 )
return 0;
if ( *(float *)(a1 + 564) <= a3 )
a3 = *(float *)(a1 + 564);
goto LABEL_32;
case 13:
*(float *)(a1 + 564) = a3;
if ( !*(_BYTE *)(a1 + 568) || *(float *)(a1 + 956) == a3 )
return 0;
*(float *)(a1 + 956) = a3;
if ( *(float *)(a1 + 560) < a3 )
a3 = *(float *)(a1 + 560);
LABEL_32:
*(float *)(a1 + 952) = a3;
v5 = *(_QWORD *)(a1 + 168);
if ( v5 )
goto LABEL_33;
goto LABEL_45;
case 15:
if ( *(float *)(a1 + 964) == a3 )
return 0;
*(float *)(a1 + 964) = a3;
v5 = *(_QWORD *)(a1 + 168);
if ( !v5 )
goto LABEL_45;
goto LABEL_33;
case 16:
if ( *(float *)(a1 + 972) == a3 )
return 0;
*(float *)(a1 + 972) = a3;
v5 = *(_QWORD *)(a1 + 168);
if ( !v5 )
goto LABEL_45;
goto LABEL_33;
case 17:
if ( *(float *)(a1 + 968) == a3 )
return 0;
*(float *)(a1 + 968) = a3;
v5 = *(_QWORD *)(a1 + 168);
if ( !v5 )
goto LABEL_45;
goto LABEL_33;
case 21:
if ( *(float *)(a1 + 944) == a3 )
return 0;
*(float *)(a1 + 944) = a3;
v5 = *(_QWORD *)(a1 + 168);
if ( v5 )
{
LABEL_33:
sub_100442B5C(v5, 6u);
v6 = *(_QWORD *)(a1 + 168);
}
else
{
LABEL_45:
v6 = 0;
}
*(_BYTE *)(a1 + 544) = 1;
v7 = *(_QWORD **)(a1 + 888);
*v7 = *(_QWORD *)(a1 + 880);
*(_QWORD *)(*(_QWORD *)(a1 + 880) + 8LL) = v7;
*(_QWORD *)(a1 + 888) = a1 + 880;
v8 = v6 + 68064;
*(_QWORD *)(a1 + 888) = *(_QWORD *)(v8 + 8);
*(_QWORD *)(a1 + 880) = v8;
*(_QWORD *)(v8 + 8) = a1 + 880;
**(_QWORD **)(a1 + 888) = a1 + 880;
if ( v5 )
sub_100442B7C(v5, 6u);
return 0;
default:
return result;
}
}