//
// sub_1006302C0 from 0x1006302c0 to 0x1006303b8 (248 bytes)
//
// 3 xrefs:
// > ??> @ 0x1009ab138
// > ??> @ 0x1009ab360
// > ??> @ 0x1009adc18
//
// 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:10:27 +0000
//
__int64 __fastcall sub_1006302C0(__int64 a1, __int64 a2, unsigned int a3)
{
float v3; // w8
float *v8; // x8
__int64 v9; // x9
const mach_header_64 *v10; // x10
float v11; // w13
float v12; // w14
bool v13; // zf
if ( (a3 & 0x80000000) != 0 )
return 31;
if ( a2 && a3 )
{
v3 = *(float *)(a2 + 4);
if ( (~*(_DWORD *)a2 & 0x7F800000) != 0
&& (LODWORD(v3) & 0x7F800000) != 2139095040
&& (*(_DWORD *)(a2 + 8) & 0x7F800000) != 2139095040 )
{
if ( v3 < 0.0 || v3 > 1.0 )
return 31;
if ( a3 == 1 )
goto LABEL_19;
v8 = (float *)(a2 + 20);
v9 = a3 - 1LL;
v10 = &_mh_execute_header;
while ( 1 )
{
v12 = *(v8 - 2);
v11 = *(v8 - 1);
v13 = (~LODWORD(v12) & 0x7F800000) == 0 || (LODWORD(v11) & 0x7F800000) == 2139095040;
if ( v13 || (*(_DWORD *)v8 & 0x7F800000) == 2139095040 )
break;
if ( *(float *)(a2 + 12LL * (unsigned int)v10) >= v12 )
return 31;
if ( v11 < 0.0 || v11 > 1.0 )
return 31;
LODWORD(v10) = (_DWORD)v10 + 1;
v8 += 3;
if ( !--v9 )
goto LABEL_19;
}
}
return 29;
}
LABEL_19:
*(_QWORD *)(a1 + 224) = a2;
*(_DWORD *)(a1 + 232) = a3;
*(_DWORD *)(a1 + 72) |= 4u;
return 0;
}