//
// sub_1001A6D84 from 0x1001a6d84 to 0x1001a7f00 (4476 bytes)
//
// 2 xrefs:
// > EditorUI::findObject @ 0x1001a6924
// > sub_1001A6D84 @ 0x1001a725c
//
// 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:00:04 +0000
//
float *__fastcall sub_1001A6D84(float *result, float *a2, __int64 a3, char a4)
{
float *v7; // x20
float *v8; // x27
__int64 v9; // x27
unsigned __int64 v10; // x19
float *v11; // x26
__int64 v12; // x8
__int64 v13; // x26
__int64 v14; // x27
float v15; // s8
float v16; // s9
float *v17; // x0
float v18; // s8
float *v19; // x0
__int64 v20; // x19
__int64 v21; // x26
__int64 v22; // x27
float v23; // s8
float v24; // s9
float *v25; // x0
float v26; // s8
float *v27; // x0
float *v28; // x23
float *v29; // x22
__int64 v30; // t1
float v31; // s8
float v32; // s9
float *v33; // x0
float v34; // s8
float *v35; // x0
__int64 v36; // t1
float v37; // s8
float v38; // s9
float *v39; // x0
float v40; // s8
float *v41; // x0
float *v42; // x28
float *v43; // x19
__int64 v44; // x8
__int64 v45; // t1
float v46; // s8
float v47; // s9
float *v48; // x0
float v49; // s8
float *v50; // x0
__int64 v51; // t1
float v52; // s8
float v53; // s9
float *v54; // x0
float v55; // s8
float *v56; // x0
float *v57; // x28
bool v58; // cf
char v59; // w26
__int64 v60; // x26
__int64 v61; // x25
float v62; // s8
float v63; // s9
float *v64; // x0
float v65; // s8
__int64 v66; // x25
__int64 v67; // t1
float v68; // s8
float v69; // s9
float *v70; // x0
float v71; // s8
float *v72; // x8
__int64 v73; // x25
float v74; // s8
float v75; // s9
float *v76; // x0
float v77; // s8
float *v78; // x19
__int64 v79; // x25
__int64 v80; // t1
float v81; // s8
float v82; // s9
float *v83; // x0
float v84; // s8
__int64 v85; // x8
__int64 v86; // x25
__int64 v87; // t1
float v88; // s8
float v89; // s9
float *v90; // x0
float v91; // s8
float *v92; // x0
__int64 v93; // x25
__int64 v94; // t1
float v95; // s8
float v96; // s9
float *v97; // x0
float v98; // s8
float *v99; // x8
__int64 v100; // x22
__int64 v101; // x21
float v102; // s8
float v103; // s9
float *v104; // x0
float v105; // s8
float *v106; // x8
bool v108; // w9
__int64 v109; // x19
float *v110; // x23
__int64 v111; // x21
__int64 v112; // x22
float v113; // s8
float v114; // s9
float *v115; // x0
float v116; // s8
float *v117; // x25
__int64 v118; // x21
__int64 v119; // x24
__int64 v120; // x22
float v121; // s8
float v122; // s9
float *v123; // x0
float v124; // s8
float *v125; // x8
signed __int64 v126; // x8
signed __int64 v127; // x26
__int64 v128; // x24
float *v129; // x25
__int64 v130; // x22
__int64 v131; // x21
float v132; // s8
float v133; // s9
float *v134; // x0
float v135; // s8
float *v136; // x0
float *v137; // x23
__int64 v138; // x22
__int64 v139; // x21
float v140; // s8
float v141; // s9
float *v142; // x0
float v143; // s8
__int64 v144; // x21
float *v145; // x28
__int64 v146; // x8
__int64 v147; // x19
__int64 v148; // x23
__int64 v149; // x22
float v150; // s8
float v151; // s9
float *v152; // x0
float v153; // s8
float *v154; // x0
__int64 v155; // x22
float v156; // s8
float v157; // s9
float *v158; // x0
float v159; // s8
float *v160; // x26
__int64 v161; // x24
float *v162; // x19
float *v163; // x26
float *v164; // x28
__int64 v165; // x8
__int64 v166; // x23
__int64 v167; // x21
float *v168; // x28
__int64 v169; // t1
__int64 v170; // x22
float v171; // s8
float v172; // s9
float *v173; // x0
float v174; // s8
float *v175; // x9
__int64 v176; // x8
bool v177; // cc
unsigned __int64 v178; // x8
unsigned __int64 v179; // x23
float *v180; // x24
__int64 v181; // x22
__int64 v182; // x21
float v183; // s8
float v184; // s9
float *v185; // x0
float v186; // s8
__int64 v187; // x21
float *v188; // x25
__int64 v189; // x22
float v190; // s8
float v191; // s9
float *v192; // x0
float v193; // s8
__int64 v194; // x21
__int64 v195; // x22
float v196; // s8
float v197; // s9
float *v198; // x0
float v199; // s8
__int64 v200; // x21
float *v201; // x19
__int64 v202; // x22
float v203; // s8
float v204; // s9
float *v205; // x0
float v206; // s8
__int64 v207; // x8
float *v208; // [xsp+8h] [xbp-78h]
float *v209; // [xsp+10h] [xbp-70h]
float *v210; // [xsp+10h] [xbp-70h]
float *v211; // [xsp+10h] [xbp-70h]
float *v212; // [xsp+18h] [xbp-68h]
signed __int64 v213; // [xsp+18h] [xbp-68h]
__int64 v214; // [xsp+18h] [xbp-68h]
v7 = result;
while ( 2 )
{
v209 = a2 - 4;
v212 = a2 - 2;
v208 = a2 - 6;
v8 = v7;
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
v7 = v8;
v9 = ((char *)a2 - (char *)v8) >> 3;
if ( v9 > 2 )
{
switch ( v9 )
{
case 3LL:
return (float *)sub_1001A7F00(v7, v7 + 2, v212);
case 4LL:
return (float *)sub_1001A81E8(v7, v7 + 2, v7 + 4, v212);
case 5LL:
return (float *)sub_1001A83E8(v7, v7 + 2, v7 + 4, v7 + 6, v212);
}
}
else
{
if ( (unsigned __int64)v9 < 2 )
return result;
if ( v9 == 2 )
{
v100 = *((_QWORD *)a2 - 1);
v101 = *(_QWORD *)v7;
v102 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v100 + 192LL))(v100);
v103 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v101 + 192LL))(v101);
v104 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v100 + 192LL))(v100);
if ( v102 == v103 )
{
v105 = v104[1];
result = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v101 + 192LL))(v101) + 4);
}
else
{
v105 = *v104;
result = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v101 + 192LL))(v101);
}
if ( v105 < *result )
{
v207 = *(_QWORD *)v7;
*(_QWORD *)v7 = *((_QWORD *)a2 - 1);
*((_QWORD *)a2 - 1) = v207;
}
return result;
}
}
if ( v9 <= 23 )
{
v106 = v7 + 2;
v108 = v7 == a2 || v106 == a2;
if ( (a4 & 1) != 0 )
{
if ( !v108 )
{
v109 = 0;
v110 = v7;
do
{
v111 = *(_QWORD *)v110;
v112 = *((_QWORD *)v110 + 1);
v110 = v106;
v113 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v112 + 192LL))(v112);
v114 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v111 + 192LL))(v111);
v115 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v112 + 192LL))(v112);
if ( v113 == v114 )
{
v116 = v115[1];
result = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v111 + 192LL))(v111) + 4);
}
else
{
v116 = *v115;
result = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v111 + 192LL))(v111);
}
if ( v116 < *result )
{
v117 = a2;
v118 = *(_QWORD *)v110;
v119 = v109;
while ( 1 )
{
*(_QWORD *)((char *)v7 + v119 + 8) = *(_QWORD *)((char *)v7 + v119);
if ( !v119 )
break;
v120 = *(_QWORD *)((char *)v7 + v119 - 8);
v121 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v118 + 192LL))(v118);
v122 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v120 + 192LL))(v120);
v123 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v118 + 192LL))(v118);
if ( v121 == v122 )
{
v124 = v123[1];
result = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v120 + 192LL))(v120) + 4);
}
else
{
v124 = *v123;
result = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v120 + 192LL))(v120);
}
v119 -= 8;
if ( v124 >= *result )
{
v125 = (float *)((char *)v7 + v119 + 8);
goto LABEL_121;
}
}
v125 = v7;
LABEL_121:
*(_QWORD *)v125 = v118;
a2 = v117;
}
v106 = v110 + 2;
v109 += 8;
}
while ( v110 + 2 != a2 );
}
}
else if ( !v108 )
{
do
{
v194 = *(_QWORD *)v7;
v195 = *((_QWORD *)v7 + 1);
v7 = v106;
v196 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v195 + 192LL))(v195);
v197 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v194 + 192LL))(v194);
v198 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v195 + 192LL))(v195);
if ( v196 == v197 )
{
v199 = v198[1];
result = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v194 + 192LL))(v194) + 4);
}
else
{
v199 = *v198;
result = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v194 + 192LL))(v194);
}
if ( v199 < *result )
{
v200 = *(_QWORD *)v7;
v201 = v7;
do
{
v202 = *((_QWORD *)v201 - 2);
*(_QWORD *)v201 = *((_QWORD *)v201 - 1);
v203 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v200 + 192LL))(v200);
v204 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v202 + 192LL))(v202);
v205 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v200 + 192LL))(v200);
if ( v203 == v204 )
{
v206 = v205[1];
result = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v202 + 192LL))(v202) + 4);
}
else
{
v206 = *v205;
result = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v202 + 192LL))(v202);
}
v201 -= 2;
}
while ( v206 < *result );
*(_QWORD *)v201 = v200;
}
v106 = v7 + 2;
}
while ( v7 + 2 != a2 );
}
return result;
}
if ( !a3 )
{
if ( v7 != a2 )
{
v126 = (unsigned __int64)(v9 - 2) >> 1;
v210 = a2;
v213 = v126;
do
{
v127 = v126;
if ( v213 >= v126 )
{
v128 = (2 * v126) | 1;
v129 = &v7[2 * v128];
if ( 2 * v126 + 2 < v9 )
{
v130 = *(_QWORD *)v129;
v131 = *((_QWORD *)v129 + 1);
v132 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)v129 + 192LL))(*(_QWORD *)v129);
v133 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v131 + 192LL))(v131);
v134 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v130 + 192LL))(v130);
if ( v132 == v133 )
{
v135 = v134[1];
v136 = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v131 + 192LL))(v131) + 4);
}
else
{
v135 = *v134;
v136 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v131 + 192LL))(v131);
}
if ( v135 < *v136 )
{
v129 += 2;
v128 = 2 * v127 + 2;
}
}
v137 = &v7[2 * v127];
v138 = *(_QWORD *)v129;
v139 = *(_QWORD *)v137;
v140 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)v129 + 192LL))(*(_QWORD *)v129);
v141 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v139 + 192LL))(v139);
v142 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v138 + 192LL))(v138);
if ( v140 == v141 )
{
v143 = v142[1];
result = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v139 + 192LL))(v139) + 4);
}
else
{
v143 = *v142;
result = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v139 + 192LL))(v139);
}
if ( v143 >= *result )
{
v144 = *(_QWORD *)v137;
do
{
v145 = v129;
*(_QWORD *)v137 = *(_QWORD *)v129;
if ( v213 < v128 )
break;
v146 = 2 * v128;
v128 = (2 * v128) | 1;
v129 = &v7[2 * v128];
v147 = v146 + 2;
if ( v146 + 2 < v9 )
{
v148 = *(_QWORD *)v129;
v149 = *((_QWORD *)v129 + 1);
v150 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)v129 + 192LL))(*(_QWORD *)v129);
v151 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v149 + 192LL))(v149);
v152 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v148 + 192LL))(v148);
if ( v150 == v151 )
{
v153 = v152[1];
v154 = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v149 + 192LL))(v149) + 4);
}
else
{
v153 = *v152;
v154 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v149 + 192LL))(v149);
}
if ( v153 < *v154 )
{
v129 += 2;
v128 = v147;
}
}
v155 = *(_QWORD *)v129;
v156 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)v129 + 192LL))(*(_QWORD *)v129);
v157 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v144 + 192LL))(v144);
v158 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v155 + 192LL))(v155);
if ( v156 == v157 )
{
v159 = v158[1];
result = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v144 + 192LL))(v144) + 4);
}
else
{
v159 = *v158;
result = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v144 + 192LL))(v144);
}
v137 = v145;
}
while ( v159 >= *result );
*(_QWORD *)v145 = v144;
}
}
v126 = v127 - 1;
}
while ( v127 );
v160 = v210;
do
{
v161 = 0;
v211 = v160;
v214 = *(_QWORD *)v7;
v162 = v7;
do
{
v163 = v162;
v164 = &v162[2 * v161];
v162 = v164 + 2;
v165 = 2 * v161;
v161 = (2 * v161) | 1;
v166 = v165 + 2;
if ( v165 + 2 < v9 )
{
v169 = *((_QWORD *)v164 + 2);
v168 = v164 + 4;
v167 = v169;
v170 = *((_QWORD *)v168 - 1);
v171 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v170 + 192LL))(v170);
v172 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v167 + 192LL))(v167);
v173 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v170 + 192LL))(v170);
if ( v171 == v172 )
{
v174 = v173[1];
result = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v167 + 192LL))(v167) + 4);
}
else
{
v174 = *v173;
result = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v167 + 192LL))(v167);
}
if ( v174 < *result )
{
v162 = v168;
v161 = v166;
}
}
*(_QWORD *)v163 = *(_QWORD *)v162;
}
while ( v161 <= (__int64)((unsigned __int64)(v9 - 2) >> 1) );
v175 = v211 - 2;
if ( v162 == v211 - 2 )
{
v160 = v211 - 2;
*(_QWORD *)v162 = v214;
}
else
{
*(_QWORD *)v162 = *(_QWORD *)v175;
v160 = v211 - 2;
*(_QWORD *)v175 = v214;
v176 = ((char *)v162 - (char *)v7 + 8) >> 3;
v177 = v176 < 2;
v178 = v176 - 2;
if ( !v177 )
{
v179 = v178 >> 1;
v180 = &v7[2 * (v178 >> 1)];
v181 = *(_QWORD *)v180;
v182 = *(_QWORD *)v162;
v183 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)v180 + 192LL))(*(_QWORD *)v180);
v184 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v182 + 192LL))(v182);
v185 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v181 + 192LL))(v181);
if ( v183 == v184 )
{
v186 = v185[1];
result = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v182 + 192LL))(v182) + 4);
}
else
{
v186 = *v185;
result = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v182 + 192LL))(v182);
}
if ( v186 < *result )
{
v187 = *(_QWORD *)v162;
do
{
v188 = v180;
*(_QWORD *)v162 = *(_QWORD *)v180;
if ( !v179 )
break;
v179 = (v179 - 1) >> 1;
v180 = &v7[2 * v179];
v189 = *(_QWORD *)v180;
v190 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)v180 + 192LL))(*(_QWORD *)v180);
v191 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v187 + 192LL))(v187);
v192 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v189 + 192LL))(v189);
if ( v190 == v191 )
{
v193 = v192[1];
result = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v187 + 192LL))(v187) + 4);
}
else
{
v193 = *v192;
result = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v187 + 192LL))(v187);
}
v162 = v188;
}
while ( v193 < *result );
*(_QWORD *)v188 = v187;
}
}
}
v177 = v9-- <= 2;
}
while ( !v177 );
}
return result;
}
v10 = (unsigned __int64)v9 >> 1;
v11 = &v7[2 * ((unsigned __int64)v9 >> 1)];
if ( (unsigned __int64)v9 < 0x81 )
{
sub_1001A7F00(&v7[2 * ((unsigned __int64)v9 >> 1)], v7, v212);
}
else
{
sub_1001A7F00(v7, &v7[2 * ((unsigned __int64)v9 >> 1)], v212);
sub_1001A7F00(v7 + 2, v11 - 2, v209);
sub_1001A7F00(v7 + 4, &v7[2 * v10 + 2], v208);
sub_1001A7F00(v11 - 2, &v7[2 * ((unsigned __int64)v9 >> 1)], &v7[2 * v10 + 2]);
v12 = *(_QWORD *)v7;
*(_QWORD *)v7 = *(_QWORD *)v11;
*(_QWORD *)v11 = v12;
}
--a3;
if ( (a4 & 1) != 0 )
break;
v14 = *((_QWORD *)v7 - 1);
v13 = *(_QWORD *)v7;
v15 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v14 + 192LL))(v14);
v16 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v13 + 192LL))(v13);
v17 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v14 + 192LL))(v14);
if ( v15 == v16 )
{
v18 = v17[1];
v19 = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v13 + 192LL))(v13) + 4);
}
else
{
v18 = *v17;
v19 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v13 + 192LL))(v13);
}
if ( v18 < *v19 )
break;
v60 = *(_QWORD *)v7;
v61 = *(_QWORD *)v212;
v62 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)v7 + 192LL))(*(_QWORD *)v7);
v63 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v61 + 192LL))(v61);
v64 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v60 + 192LL))(v60);
if ( v62 == v63 )
{
v65 = v64[1];
result = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v61 + 192LL))(v61) + 4);
}
else
{
v65 = *v64;
result = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v61 + 192LL))(v61);
}
if ( v65 >= *result )
{
v72 = v7 + 2;
do
{
v8 = v72;
if ( v72 >= a2 )
break;
v73 = *(_QWORD *)v72;
v74 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v60 + 192LL))(v60);
v75 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v73 + 192LL))(v73);
v76 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v60 + 192LL))(v60);
if ( v74 == v75 )
{
v77 = v76[1];
result = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v73 + 192LL))(v73) + 4);
}
else
{
v77 = *v76;
result = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v73 + 192LL))(v73);
}
v72 = v8 + 2;
}
while ( v77 >= *result );
}
else
{
v8 = v7;
do
{
v67 = *((_QWORD *)v8 + 1);
v8 += 2;
v66 = v67;
v68 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v60 + 192LL))(v60);
v69 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v66 + 192LL))(v66);
v70 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v60 + 192LL))(v60);
if ( v68 == v69 )
{
v71 = v70[1];
result = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v66 + 192LL))(v66) + 4);
}
else
{
v71 = *v70;
result = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v66 + 192LL))(v66);
}
}
while ( v71 >= *result );
}
v78 = a2;
if ( v8 < a2 )
{
v78 = a2;
do
{
v80 = *((_QWORD *)v78 - 1);
v78 -= 2;
v79 = v80;
v81 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v60 + 192LL))(v60);
v82 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v79 + 192LL))(v79);
v83 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v60 + 192LL))(v60);
if ( v81 == v82 )
{
v84 = v83[1];
result = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v79 + 192LL))(v79) + 4);
}
else
{
v84 = *v83;
result = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v79 + 192LL))(v79);
}
}
while ( v84 < *result );
}
while ( v8 < v78 )
{
v85 = *(_QWORD *)v8;
*(_QWORD *)v8 = *(_QWORD *)v78;
*(_QWORD *)v78 = v85;
do
{
v87 = *((_QWORD *)v8 + 1);
v8 += 2;
v86 = v87;
v88 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v60 + 192LL))(v60);
v89 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v86 + 192LL))(v86);
v90 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v60 + 192LL))(v60);
if ( v88 == v89 )
{
v91 = v90[1];
v92 = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v86 + 192LL))(v86) + 4);
}
else
{
v91 = *v90;
v92 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v86 + 192LL))(v86);
}
}
while ( v91 >= *v92 );
do
{
v94 = *((_QWORD *)v78 - 1);
v78 -= 2;
v93 = v94;
v95 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v60 + 192LL))(v60);
v96 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v93 + 192LL))(v93);
v97 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v60 + 192LL))(v60);
if ( v95 == v96 )
{
v98 = v97[1];
result = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v93 + 192LL))(v93) + 4);
}
else
{
v98 = *v97;
result = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v93 + 192LL))(v93);
}
}
while ( v98 < *result );
}
v99 = v8 - 2;
if ( v8 - 2 != v7 )
*(_QWORD *)v7 = *(_QWORD *)v99;
a4 = 0;
*(_QWORD *)v99 = v60;
}
v20 = 0;
v21 = *(_QWORD *)v7;
do
{
v22 = *(_QWORD *)&v7[v20 + 2];
v23 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v22 + 192LL))(v22);
v24 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 192LL))(v21);
v25 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v22 + 192LL))(v22);
if ( v23 == v24 )
{
v26 = v25[1];
v27 = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 192LL))(v21) + 4);
}
else
{
v26 = *v25;
v27 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 192LL))(v21);
}
v20 += 2;
}
while ( v26 < *v27 );
v28 = &v7[v20];
v29 = a2;
if ( v20 == 2 )
{
do
{
if ( v28 >= a2 )
break;
v36 = *((_QWORD *)a2 - 1);
a2 -= 2;
v37 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v36 + 192LL))(v36);
v38 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 192LL))(v21);
v39 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v36 + 192LL))(v36);
if ( v37 == v38 )
{
v40 = v39[1];
v41 = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 192LL))(v21) + 4);
}
else
{
v40 = *v39;
v41 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 192LL))(v21);
}
}
while ( v40 >= *v41 );
}
else
{
do
{
v30 = *((_QWORD *)a2 - 1);
a2 -= 2;
v31 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v30 + 192LL))(v30);
v32 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 192LL))(v21);
v33 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v30 + 192LL))(v30);
if ( v31 == v32 )
{
v34 = v33[1];
v35 = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 192LL))(v21) + 4);
}
else
{
v34 = *v33;
v35 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 192LL))(v21);
}
}
while ( v34 >= *v35 );
}
if ( v28 >= a2 )
{
v57 = v28 - 2;
}
else
{
v42 = &v7[v20];
v43 = a2;
do
{
v44 = *(_QWORD *)v42;
*(_QWORD *)v42 = *(_QWORD *)v43;
*(_QWORD *)v43 = v44;
do
{
v45 = *((_QWORD *)v42 + 1);
v42 += 2;
v46 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v45 + 192LL))(v45);
v47 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 192LL))(v21);
v48 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v45 + 192LL))(v45);
if ( v46 == v47 )
{
v49 = v48[1];
v50 = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 192LL))(v21) + 4);
}
else
{
v49 = *v48;
v50 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 192LL))(v21);
}
}
while ( v49 < *v50 );
do
{
v51 = *((_QWORD *)v43 - 1);
v43 -= 2;
v52 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v51 + 192LL))(v51);
v53 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 192LL))(v21);
v54 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v51 + 192LL))(v51);
if ( v52 == v53 )
{
v55 = v54[1];
v56 = (float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 192LL))(v21) + 4);
}
else
{
v55 = *v54;
v56 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 192LL))(v21);
}
}
while ( v55 >= *v56 );
}
while ( v42 < v43 );
v57 = v42 - 2;
}
if ( v57 != v7 )
*(_QWORD *)v7 = *(_QWORD *)v57;
*(_QWORD *)v57 = v21;
v58 = v28 >= a2;
a2 = v29;
if ( v58 )
break;
LABEL_56:
result = (float *)sub_1001A6D84(v7, v57, a3, a4 & 1);
a4 = 0;
v8 = v57 + 2;
}
v59 = sub_1001A8688(v7, v57);
v8 = v57 + 2;
result = (float *)sub_1001A8688(v57 + 2, v29);
if ( (_DWORD)result )
break;
if ( (v59 & 1) == 0 )
goto LABEL_56;
}
a2 = v57;
if ( (v59 & 1) == 0 )
continue;
return result;
}
}