//
// SetupMGTrigger::determineStartValues from 0x10038f02c to 0x10038f274 (584 bytes)
//
// 1 xrefs:
// > ??> @ 0x1009400b0
//
// 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:03:37 +0000
//
__int64 __fastcall SetupMGTrigger::determineStartValues(__int64 a1)
{
__int64 result; // x0
_QWORD *v3; // x20
unsigned int v4; // w21
bool v5; // w24
char v6; // w27
char v7; // w26
char v8; // w28
float v9; // s8
int v10; // w23
int v11; // w25
float v12; // s10
__int64 v13; // x0
int v14; // w9
bool v15; // w10
int v16; // w11
bool v17; // zf
double *v18; // x1
__int64 v19; // [xsp+8h] [xbp-78h] BYREF
result = SetupTriggerPopup::determineStartValues(a1);
if ( *(_QWORD *)(a1 + 680) )
{
v3 = sub_1002E736C();
result = sub_1002E74E0((__int64)v3);
}
else
{
v3 = *(_QWORD **)(a1 + 688);
}
*(_DWORD *)(a1 + 1032) = -943501440;
*(_QWORD *)(a1 + 1048) = 0xC7C34F80FFFE7961LL;
*(_DWORD *)(a1 + 1088) = -99999;
if ( !v3 )
return result;
result = sub_1002E757C((__int64)v3);
if ( !(_DWORD)result )
return result;
result = sub_1002E757C((__int64)v3);
if ( !(_DWORD)result )
return result;
v4 = 0;
v5 = 0;
v6 = 0;
v7 = 0;
v8 = 0;
v9 = -99999.0;
v10 = -99999;
v11 = -99999;
v12 = -99999.0;
do
{
v13 = sub_1002E75A0((__int64)v3, v4);
if ( (v8 & 1) != 0 )
{
v8 = 1;
if ( (v7 & 1) != 0 )
goto LABEL_16;
}
else if ( v12 == -99999.0 )
{
v8 = 0;
v12 = *(float *)(v13 + 1452);
if ( (v7 & 1) != 0 )
goto LABEL_16;
}
else if ( v12 == *(float *)(v13 + 1452) )
{
v8 = 0;
if ( (v7 & 1) != 0 )
{
LABEL_16:
v7 = 1;
if ( (v6 & 1) != 0 )
goto LABEL_34;
goto LABEL_17;
}
}
else
{
v8 = 1;
v12 = -99999.0;
if ( (v7 & 1) != 0 )
goto LABEL_16;
}
v14 = *(_DWORD *)(v13 + 1496);
v15 = v11 != v14;
if ( v11 == v14 )
v16 = v11;
else
v16 = -99999;
v17 = v11 == -99999;
if ( v11 == -99999 )
v11 = *(_DWORD *)(v13 + 1496);
else
v11 = v16;
v7 = !v17 && v15;
if ( (v6 & 1) != 0 )
{
LABEL_34:
v6 = 1;
if ( v5 )
goto LABEL_35;
goto LABEL_37;
}
LABEL_17:
if ( v9 == -99999.0 )
{
v6 = 0;
v9 = *(float *)(v13 + 1500);
if ( v5 )
goto LABEL_35;
}
else if ( v9 == *(float *)(v13 + 1500) )
{
v6 = 0;
if ( v5 )
{
LABEL_35:
v5 = 1;
goto LABEL_41;
}
}
else
{
v6 = 1;
v9 = -99999.0;
if ( v5 )
goto LABEL_35;
}
LABEL_37:
v18 = (double *)(v13 + 1488);
if ( v10 == -99999 )
{
sub_1000262F4(&v19, v18);
v5 = 0;
v10 = (int)*((float *)&v19 + 1);
}
else
{
sub_1000262F4(&v19, v18);
v5 = v10 != (int)*((float *)&v19 + 1);
if ( v10 != (int)*((float *)&v19 + 1) )
v10 = -99999;
}
LABEL_41:
++v4;
result = sub_1002E757C((__int64)v3);
}
while ( v4 < (unsigned int)result );
if ( v12 != -99999.0 )
*(float *)(a1 + 1032) = v12;
if ( v11 != -99999 )
*(_DWORD *)(a1 + 1048) = v11;
if ( v9 != -99999.0 )
*(float *)(a1 + 1052) = v9;
if ( v10 != -99999 )
*(_DWORD *)(a1 + 1088) = v10;
return result;
}