//
// sub_C07070 from 0xc07070 to 0xc07220 (432 bytes)
//
// 1 xrefs:
// > jinit_d_coef_controller @ 0xc07db4
//
// 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 *__fastcall sub_C07070(
__int64 (__fastcall *result)(__int64 a1, __int64 *a2)))(__int64 a1, __int64 *a2)
{
_QWORD *v1; // x20
__int64 (__fastcall *v2)(__int64, __int64 *); // x19
__int64 v3; // x2
__int64 v4; // x4
_WORD *v5; // x0
__int64 v6; // x3
int v7; // w1
int v8; // w5
_DWORD *v9; // x0
int v10; // w6
int v11; // w6
int v12; // w6
int v13; // w6
v1 = *((_QWORD **)result + 74);
v2 = result;
if ( v1[4] )
{
if ( *((_DWORD *)result + 26) && *((_DWORD *)result + 79) && *((_QWORD *)result + 24) )
{
v3 = v1[27];
if ( !v3 )
{
v3 = (**((__int64 (__fastcall ***)(__int64 (__fastcall *)(__int64, __int64 *), __int64, __int64))result + 1))(
result,
1,
24LL * *((int *)result + 14));
v1[27] = v3;
}
v4 = *((_QWORD *)v2 + 38);
if ( *((int *)v2 + 14) > 0 )
{
v5 = *(_WORD **)(v4 + 80);
if ( v5 )
{
if ( *v5 && v5[1] && v5[8] && v5[16] )
{
v6 = 0;
v7 = 0;
v8 = 0;
do
{
++v8;
v4 += 96;
if ( !v5[9] )
break;
if ( !v5[2] )
break;
v9 = (_DWORD *)(*((_QWORD *)v2 + 24) + v6);
v6 += 256;
if ( (*v9 & 0x80000000) != 0 )
break;
v3 += 24;
*(_DWORD *)(v3 - 20) = v9[1];
v10 = v9[1];
*(_DWORD *)(v3 - 16) = v9[2];
if ( v10 )
v7 = 1;
v11 = v9[2];
*(_DWORD *)(v3 - 12) = v9[3];
if ( v11 )
v7 = 1;
v12 = v9[3];
*(_DWORD *)(v3 - 8) = v9[4];
if ( v12 )
v7 = 1;
v13 = v9[4];
*(_DWORD *)(v3 - 4) = v9[5];
if ( v13 )
v7 = 1;
if ( v9[5] )
v7 = 1;
if ( v8 >= *((_DWORD *)v2 + 14) )
{
if ( !v7 )
break;
v1[3] = sub_C07220;
*((_DWORD *)v2 + 46) = 0;
return (__int64 (__fastcall *)(__int64, __int64 *))sub_C07220;
}
v5 = *(_WORD **)(v4 + 80);
}
while ( v5 && *v5 && v5[1] && v5[8] && v5[16] );
}
}
}
}
result = sub_C06E74;
v1[3] = sub_C06E74;
}
*((_DWORD *)v2 + 46) = 0;
return result;
}