; LLVM IR from Overload-Technologies/Overload :: Dependencies/assimp/code/Common (SGSpatialSort)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.__gnu_cxx::__normal_iterator.5" = type { ptr }
%class.aiVector3t = type { float, float, float }
%"class.Assimp::SGSpatialSort" = type { %class.aiVector3t, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Assimp::SGSpatialSort::Entry, std::allocator<Assimp::SGSpatialSort::Entry>>::_Vector_impl" }
%"struct.std::_Vector_base<Assimp::SGSpatialSort::Entry, std::allocator<Assimp::SGSpatialSort::Entry>>::_Vector_impl" = type { %"struct.std::_Vector_base<Assimp::SGSpatialSort::Entry, std::allocator<Assimp::SGSpatialSort::Entry>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Assimp::SGSpatialSort::Entry, std::allocator<Assimp::SGSpatialSort::Entry>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.Assimp::SGSpatialSort::Entry" = type { i32, %class.aiVector3t, i32, float }

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZmlIfET_RK10aiVector3tIS0_ES4_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK6Assimp13SGSpatialSort13FindPositionsERK10aiVector3tIfEjfRSt6vectorIjSaIjEEb(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i32 noundef %2, float noundef %3, ptr noundef nonnull align 8 dereferenceable(24) %4, i1 noundef zeroext %5) #2 align 2 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca float, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i8, align 1
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca float, align 4
  %20 = alloca %"class.__gnu_cxx::__normal_iterator.5", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator.5", align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator.5", align 8
  %23 = alloca %class.aiVector3t, align 4
  %24 = alloca { <2 x float>, float }, align 8
  %25 = alloca %class.aiVector3t, align 4
  %26 = alloca { <2 x float>, float }, align 8
  %27 = alloca %class.aiVector3t, align 4
  %28 = alloca { <2 x float>, float }, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store float %3, ptr %10, align 4, !tbaa !11
  store ptr %4, ptr %11, align 8, !tbaa !5
  %29 = zext i1 %5 to i8
  store i8 %29, ptr %12, align 1, !tbaa !13
  %30 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = getelementptr inbounds %"class.Assimp::SGSpatialSort", ptr %30, i32 0, i32 0
  %33 = call noundef float @_ZmlIfET_RK10aiVector3tIS0_ES4_(ptr noundef nonnull align 4 dereferenceable(12) %31, ptr noundef nonnull align 4 dereferenceable(12) %32)
  store float %33, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %34 = load float, ptr %13, align 4, !tbaa !11
  %35 = load float, ptr %10, align 4, !tbaa !11
  %36 = fsub float %34, %35
  store float %36, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %37 = load float, ptr %13, align 4, !tbaa !11
  %38 = load float, ptr %10, align 4, !tbaa !11
  %39 = fadd float %37, %38
  store float %39, ptr %15, align 4, !tbaa !11
  %40 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZNSt6vectorIjSaIjEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #7
  %41 = getelementptr inbounds %"class.Assimp::SGSpatialSort", ptr %30, i32 0, i32 1
  %42 = call noundef zeroext i1 @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #7
  br i1 %42, label %43, label %44

43:                                               ; preds = %6
  store i32 1, ptr %16, align 4
  br label %253

44:                                               ; preds = %6
  %45 = load float, ptr %15, align 4, !tbaa !11
  %46 = getelementptr inbounds %"class.Assimp::SGSpatialSort", ptr %30, i32 0, i32 1
  %47 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %46) #7
  %48 = getelementptr inbounds %"struct.Assimp::SGSpatialSort::Entry", ptr %47, i32 0, i32 3
  %49 = load float, ptr %48, align 4, !tbaa !15
  %50 = fcmp olt float %45, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %44
  store i32 1, ptr %16, align 4
  br label %253

52:                                               ; preds = %44
  %53 = load float, ptr %14, align 4, !tbaa !11
  %54 = getelementptr inbounds %"class.Assimp::SGSpatialSort", ptr %30, i32 0, i32 1
  %55 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %54) #7
  %56 = getelementptr inbounds %"struct.Assimp::SGSpatialSort::Entry", ptr %55, i32 0, i32 3
  %57 = load float, ptr %56, align 4, !tbaa !15
  %58 = fcmp ogt float %53, %57
  br i1 %58, label %59, label %60

59:                                               ; preds = %52
  store i32 1, ptr %16, align 4
  br label %253

60:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %61 = getelementptr inbounds %"class.Assimp::SGSpatialSort", ptr %30, i32 0, i32 1
  %62 = call noundef i64 @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %61) #7
  %63 = trunc i64 %62 to i32
  %64 = udiv i32 %63, 2
  store i32 %64, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %65 = getelementptr inbounds %"class.Assimp::SGSpatialSort", ptr %30, i32 0, i32 1
  %66 = call noundef i64 @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %65) #7
  %67 = trunc i64 %66 to i32
  %68 = udiv i32 %67, 4
  store i32 %68, ptr %18, align 4, !tbaa !9
  br label %69

69:                                               ; preds = %89, %60
  %70 = load i32, ptr %18, align 4, !tbaa !9
  %71 = icmp ugt i32 %70, 1
  br i1 %71, label %72, label %92

72:                                               ; preds = %69
  %73 = getelementptr inbounds %"class.Assimp::SGSpatialSort", ptr %30, i32 0, i32 1
  %74 = load i32, ptr %17, align 4, !tbaa !9
  %75 = zext i32 %74 to i64
  %76 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %73, i64 noundef %75) #7
  %77 = getelementptr inbounds %"struct.Assimp::SGSpatialSort::Entry", ptr %76, i32 0, i32 3
  %78 = load float, ptr %77, align 4, !tbaa !15
  %79 = load float, ptr %14, align 4, !tbaa !11
  %80 = fcmp olt float %78, %79
  br i1 %80, label %81, label %85

81:                                               ; preds = %72
  %82 = load i32, ptr %18, align 4, !tbaa !9
  %83 = load i32, ptr %17, align 4, !tbaa !9
  %84 = add i32 %83, %82
  store i32 %84, ptr %17, align 4, !tbaa !9
  br label %89

85:                                               ; preds = %72
  %86 = load i32, ptr %18, align 4, !tbaa !9
  %87 = load i32, ptr %17, align 4, !tbaa !9
  %88 = sub i32 %87, %86
  store i32 %88, ptr %17, align 4, !tbaa !9
  br label %89

89:                                               ; preds = %85, %81
  %90 = load i32, ptr %18, align 4, !tbaa !9
  %91 = udiv i32 %90, 2
  store i32 %91, ptr %18, align 4, !tbaa !9
  br label %69, !llvm.loop !18

92:                                               ; preds = %69
  br label %93

93:                                               ; preds = %107, %92
  %94 = load i32, ptr %17, align 4, !tbaa !9
  %95 = icmp ugt i32 %94, 0
  br i1 %95, label %96, label %105

96:                                               ; preds = %93
  %97 = getelementptr inbounds %"class.Assimp::SGSpatialSort", ptr %30, i32 0, i32 1
  %98 = load i32, ptr %17, align 4, !tbaa !9
  %99 = zext i32 %98 to i64
  %100 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %97, i64 noundef %99) #7
  %101 = getelementptr inbounds %"struct.Assimp::SGSpatialSort::Entry", ptr %100, i32 0, i32 3
  %102 = load float, ptr %101, align 4, !tbaa !15
  %103 = load float, ptr %14, align 4, !tbaa !11
  %104 = fcmp ogt float %102, %103
  br label %105

105:                                              ; preds = %96, %93
  %106 = phi i1 [ false, %93 ], [ %104, %96 ]
  br i1 %106, label %107, label %110

107:                                              ; preds = %105
  %108 = load i32, ptr %17, align 4, !tbaa !9
  %109 = add i32 %108, -1
  store i32 %109, ptr %17, align 4, !tbaa !9
  br label %93, !llvm.loop !20

110:                                              ; preds = %105
  br label %111

111:                                              ; preds = %129, %110
  %112 = load i32, ptr %17, align 4, !tbaa !9
  %113 = zext i32 %112 to i64
  %114 = getelementptr inbounds %"class.Assimp::SGSpatialSort", ptr %30, i32 0, i32 1
  %115 = call noundef i64 @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %114) #7
  %116 = sub i64 %115, 1
  %117 = icmp ult i64 %113, %116
  br i1 %117, label %118, label %127

118:                                              ; preds = %111
  %119 = getelementptr inbounds %"class.Assimp::SGSpatialSort", ptr %30, i32 0, i32 1
  %120 = load i32, ptr %17, align 4, !tbaa !9
  %121 = zext i32 %120 to i64
  %122 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %119, i64 noundef %121) #7
  %123 = getelementptr inbounds %"struct.Assimp::SGSpatialSort::Entry", ptr %122, i32 0, i32 3
  %124 = load float, ptr %123, align 4, !tbaa !15
  %125 = load float, ptr %14, align 4, !tbaa !11
  %126 = fcmp olt float %124, %125
  br label %127

127:                                              ; preds = %118, %111
  %128 = phi i1 [ false, %111 ], [ %126, %118 ]
  br i1 %128, label %129, label %132

129:                                              ; preds = %127
  %130 = load i32, ptr %17, align 4, !tbaa !9
  %131 = add i32 %130, 1
  store i32 %131, ptr %17, align 4, !tbaa !9
  br label %111, !llvm.loop !21

132:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %133 = load float, ptr %10, align 4, !tbaa !11
  %134 = load float, ptr %10, align 4, !tbaa !11
  %135 = fmul float %133, %134
  store float %135, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %136 = getelementptr inbounds %"class.Assimp::SGSpatialSort", ptr %30, i32 0, i32 1
  %137 = call ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %136) #7
  %138 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.5", ptr %21, i32 0, i32 0
  store ptr %137, ptr %138, align 8
  %139 = load i32, ptr %17, align 4, !tbaa !9
  %140 = zext i32 %139 to i64
  %141 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %21, i64 noundef %140) #7
  %142 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.5", ptr %20, i32 0, i32 0
  store ptr %141, ptr %142, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %143 = getelementptr inbounds %"class.Assimp::SGSpatialSort", ptr %30, i32 0, i32 1
  %144 = call ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %143) #7
  %145 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.5", ptr %22, i32 0, i32 0
  store ptr %144, ptr %145, align 8
  %146 = load i8, ptr %12, align 1, !tbaa !13, !range !22, !noundef !23
  %147 = trunc i8 %146 to i1
  br i1 %147, label %148, label %181

148:                                              ; preds = %132
  br label %149

149:                                              ; preds = %179, %148
  %150 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %151 = getelementptr inbounds %"struct.Assimp::SGSpatialSort::Entry", ptr %150, i32 0, i32 3
  %152 = load float, ptr %151, align 4, !tbaa !15
  %153 = load float, ptr %15, align 4, !tbaa !11
  %154 = fcmp olt float %152, %153
  br i1 %154, label %155, label %180

155:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #7
  %156 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %157 = getelementptr inbounds %"struct.Assimp::SGSpatialSort::Entry", ptr %156, i32 0, i32 1
  %158 = load ptr, ptr %8, align 8, !tbaa !5
  %159 = call { <2 x float>, float } @_ZmiIfE10aiVector3tIT_ERKS2_S4_(ptr noundef nonnull align 4 dereferenceable(12) %157, ptr noundef nonnull align 4 dereferenceable(12) %158)
  store { <2 x float>, float } %159, ptr %24, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 8 %24, i64 12, i1 false)
  %160 = call noundef float @_ZNK10aiVector3tIfE12SquareLengthEv(ptr noundef nonnull align 4 dereferenceable(12) %23)
  %161 = load float, ptr %19, align 4, !tbaa !11
  %162 = fcmp olt float %160, %161
  br i1 %162, label %163, label %169

163:                                              ; preds = %155
  %164 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %165 = getelementptr inbounds %"struct.Assimp::SGSpatialSort::Entry", ptr %164, i32 0, i32 2
  %166 = load i32, ptr %165, align 4, !tbaa !24
  %167 = load i32, ptr %9, align 4, !tbaa !9
  %168 = icmp eq i32 %166, %167
  br label %169

169:                                              ; preds = %163, %155
  %170 = phi i1 [ false, %155 ], [ %168, %163 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #7
  br i1 %170, label %171, label %175

171:                                              ; preds = %169
  %172 = load ptr, ptr %11, align 8, !tbaa !5
  %173 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %174 = getelementptr inbounds %"struct.Assimp::SGSpatialSort::Entry", ptr %173, i32 0, i32 0
  call void @_ZNSt6vectorIjSaIjEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24) %172, ptr noundef nonnull align 4 dereferenceable(4) %174)
  br label %175

175:                                              ; preds = %171, %169
  %176 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %177 = call noundef zeroext i1 @_ZN9__gnu_cxxeqIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  br i1 %177, label %178, label %179

178:                                              ; preds = %175
  br label %180

179:                                              ; preds = %175
  br label %149, !llvm.loop !25

180:                                              ; preds = %178, %149
  br label %252

181:                                              ; preds = %132
  %182 = load i32, ptr %9, align 4, !tbaa !9
  %183 = icmp ne i32 %182, 0
  br i1 %183, label %209, label %184

184:                                              ; preds = %181
  br label %185

185:                                              ; preds = %207, %184
  %186 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %187 = getelementptr inbounds %"struct.Assimp::SGSpatialSort::Entry", ptr %186, i32 0, i32 3
  %188 = load float, ptr %187, align 4, !tbaa !15
  %189 = load float, ptr %15, align 4, !tbaa !11
  %190 = fcmp olt float %188, %189
  br i1 %190, label %191, label %208

191:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 12, ptr %25) #7
  %192 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %193 = getelementptr inbounds %"struct.Assimp::SGSpatialSort::Entry", ptr %192, i32 0, i32 1
  %194 = load ptr, ptr %8, align 8, !tbaa !5
  %195 = call { <2 x float>, float } @_ZmiIfE10aiVector3tIT_ERKS2_S4_(ptr noundef nonnull align 4 dereferenceable(12) %193, ptr noundef nonnull align 4 dereferenceable(12) %194)
  store { <2 x float>, float } %195, ptr %26, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 8 %26, i64 12, i1 false)
  %196 = call noundef float @_ZNK10aiVector3tIfE12SquareLengthEv(ptr noundef nonnull align 4 dereferenceable(12) %25)
  %197 = load float, ptr %19, align 4, !tbaa !11
  %198 = fcmp olt float %196, %197
  call void @llvm.lifetime.end.p0(i64 12, ptr %25) #7
  br i1 %198, label %199, label %203

199:                                              ; preds = %191
  %200 = load ptr, ptr %11, align 8, !tbaa !5
  %201 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %202 = getelementptr inbounds %"struct.Assimp::SGSpatialSort::Entry", ptr %201, i32 0, i32 0
  call void @_ZNSt6vectorIjSaIjEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24) %200, ptr noundef nonnull align 4 dereferenceable(4) %202)
  br label %203

203:                                              ; preds = %199, %191
  %204 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %205 = call noundef zeroext i1 @_ZN9__gnu_cxxeqIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  br i1 %205, label %206, label %207

206:                                              ; preds = %203
  br label %208

207:                                              ; preds = %203
  br label %185, !llvm.loop !26

208:                                              ; preds = %206, %185
  br label %251

209:                                              ; preds = %181
  br label %210

210:                                              ; preds = %249, %209
  %211 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %212 = getelementptr inbounds %"struct.Assimp::SGSpatialSort::Entry", ptr %211, i32 0, i32 3
  %213 = load float, ptr %212, align 4, !tbaa !15
  %214 = load float, ptr %15, align 4, !tbaa !11
  %215 = fcmp olt float %213, %214
  br i1 %215, label %216, label %250

216:                                              ; preds = %210
  call void @llvm.lifetime.start.p0(i64 12, ptr %27) #7
  %217 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %218 = getelementptr inbounds %"struct.Assimp::SGSpatialSort::Entry", ptr %217, i32 0, i32 1
  %219 = load ptr, ptr %8, align 8, !tbaa !5
  %220 = call { <2 x float>, float } @_ZmiIfE10aiVector3tIT_ERKS2_S4_(ptr noundef nonnull align 4 dereferenceable(12) %218, ptr noundef nonnull align 4 dereferenceable(12) %219)
  store { <2 x float>, float } %220, ptr %28, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 8 %28, i64 12, i1 false)
  %221 = call noundef float @_ZNK10aiVector3tIfE12SquareLengthEv(ptr noundef nonnull align 4 dereferenceable(12) %27)
  %222 = load float, ptr %19, align 4, !tbaa !11
  %223 = fcmp olt float %221, %222
  br i1 %223, label %224, label %239

224:                                              ; preds = %216
  %225 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %226 = getelementptr inbounds %"struct.Assimp::SGSpatialSort::Entry", ptr %225, i32 0, i32 2
  %227 = load i32, ptr %226, align 4, !tbaa !24
  %228 = load i32, ptr %9, align 4, !tbaa !9
  %229 = and i32 %227, %228
  %230 = icmp ne i32 %229, 0
  br i1 %230, label %237, label %231

231:                                              ; preds = %224
  %232 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %233 = getelementptr inbounds %"struct.Assimp::SGSpatialSort::Entry", ptr %232, i32 0, i32 2
  %234 = load i32, ptr %233, align 4, !tbaa !24
  %235 = icmp ne i32 %234, 0
  %236 = xor i1 %235, true
  br label %237

237:                                              ; preds = %231, %224
  %238 = phi i1 [ true, %224 ], [ %236, %231 ]
  br label %239

239:                                              ; preds = %237, %216
  %240 = phi i1 [ false, %216 ], [ %238, %237 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr %27) #7
  br i1 %240, label %241, label %245

241:                                              ; preds = %239
  %242 = load ptr, ptr %11, align 8, !tbaa !5
  %243 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %244 = getelementptr inbounds %"struct.Assimp::SGSpatialSort::Entry", ptr %243, i32 0, i32 0
  call void @_ZNSt6vectorIjSaIjEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24) %242, ptr noundef nonnull align 4 dereferenceable(4) %244)
  br label %245

245:                                              ; preds = %241, %239
  %246 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %247 = call noundef zeroext i1 @_ZN9__gnu_cxxeqIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  br i1 %247, label %248, label %249

248:                                              ; preds = %245
  br label %250

249:                                              ; preds = %245
  br label %210, !llvm.loop !27

250:                                              ; preds = %248, %210
  br label %251

251:                                              ; preds = %250, %208
  br label %252

252:                                              ; preds = %251, %180
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  store i32 0, ptr %16, align 4
  br label %253

253:                                              ; preds = %252, %59, %51, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  %254 = load i32, ptr %16, align 4
  switch i32 %254, label %256 [
    i32 0, label %255
    i32 1, label %255
  ]

255:                                              ; preds = %253, %253
  ret void

256:                                              ; preds = %253
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIjSaIjEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(24) ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(24) ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(24) ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZmiIfE10aiVector3tIT_ERKS2_S4_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK10aiVector3tIfE12SquareLengthEv(ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIjSaIjEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxeqIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!16, !12, i64 20}
!16 = !{!"_ZTSN6Assimp13SGSpatialSort5EntryE", !10, i64 0, !17, i64 4, !10, i64 16, !12, i64 20}
!17 = !{!"_ZTS10aiVector3tIfE", !12, i64 0, !12, i64 4, !12, i64 8}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = !{!16, !10, i64 16}
!25 = distinct !{!25, !19}
!26 = distinct !{!26, !19}
!27 = distinct !{!27, !19}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.__gnu_cxx::__normal_iterator.5" = type { ptr }
%class.aiVector3t = type { float, float, float }

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZmlIfET_RK10aiVector3tIS0_ES4_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK6Assimp13SGSpatialSort13FindPositionsERK10aiVector3tIfEjfRSt6vectorIjSaIjEEb(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i32 noundef %2, float noundef %3, ptr noundef nonnull align 8 dereferenceable(24) %4, i1 noundef zeroext %5) local_unnamed_addr #2 align 2 {
  %7 = alloca %"class.__gnu_cxx::__normal_iterator.5", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.5", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.5", align 8
  %10 = alloca %class.aiVector3t, align 8
  %11 = alloca %class.aiVector3t, align 8
  %12 = alloca %class.aiVector3t, align 8
  %13 = tail call noundef float @_ZmlIfET_RK10aiVector3tIS0_ES4_(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %0)
  %14 = fsub float %13, %3
  %15 = fadd float %13, %3
  tail call void @_ZNSt6vectorIjSaIjEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %16 = getelementptr inbounds i8, ptr %0, i64 16
  %17 = tail call noundef zeroext i1 @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  br i1 %17, label %134, label %18

18:                                               ; preds = %6
  %19 = tail call noundef nonnull align 4 dereferenceable(24) ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  %20 = getelementptr inbounds i8, ptr %19, i64 20
  %21 = load float, ptr %20, align 4, !tbaa !5
  %22 = fcmp olt float %15, %21
  br i1 %22, label %134, label %23

23:                                               ; preds = %18
  %24 = tail call noundef nonnull align 4 dereferenceable(24) ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  %25 = getelementptr inbounds i8, ptr %24, i64 20
  %26 = load float, ptr %25, align 4, !tbaa !5
  %27 = fcmp ogt float %14, %26
  br i1 %27, label %134, label %28

28:                                               ; preds = %23
  %29 = tail call noundef i64 @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  %30 = trunc i64 %29 to i32
  %31 = lshr i32 %30, 1
  %32 = tail call noundef i64 @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  %33 = trunc i64 %32 to i32
  %34 = icmp ugt i32 %33, 7
  br i1 %34, label %.lr.ph.preheader, label %.preheader70

.lr.ph.preheader:                                 ; preds = %28
  %35 = lshr i32 %33, 2
  br label %.lr.ph

.preheader70:                                     ; preds = %.lr.ph, %28
  %.0.lcssa = phi i32 [ %31, %28 ], [ %.1, %.lr.ph ]
  %.not73 = icmp eq i32 %.0.lcssa, 0
  br i1 %.not73, label %.critedge, label %.lr.ph75.preheader

.lr.ph75.preheader:                               ; preds = %.preheader70
  %36 = zext i32 %.0.lcssa to i64
  br label %.lr.ph75

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.072 = phi i32 [ %.1, %.lr.ph ], [ %31, %.lr.ph.preheader ]
  %.05971 = phi i32 [ %43, %.lr.ph ], [ %35, %.lr.ph.preheader ]
  %37 = zext i32 %.072 to i64
  %38 = tail call noundef nonnull align 4 dereferenceable(24) ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %37) #6
  %39 = getelementptr inbounds i8, ptr %38, i64 20
  %40 = load float, ptr %39, align 4, !tbaa !5
  %41 = fcmp olt float %40, %14
  %42 = sub nsw i32 0, %.05971
  %.1.p = select i1 %41, i32 %.05971, i32 %42
  %.1 = add i32 %.1.p, %.072
  %43 = lshr i32 %.05971, 1
  %44 = icmp ugt i32 %.05971, 3
  br i1 %44, label %.lr.ph, label %.preheader70, !llvm.loop !12

.lr.ph75:                                         ; preds = %.lr.ph75.preheader, %49
  %indvars.iv = phi i64 [ %36, %.lr.ph75.preheader ], [ %indvars.iv.next, %49 ]
  %45 = tail call noundef nonnull align 4 dereferenceable(24) ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %indvars.iv) #6
  %46 = getelementptr inbounds i8, ptr %45, i64 20
  %47 = load float, ptr %46, align 4, !tbaa !5
  %48 = fcmp ogt float %47, %14
  br i1 %48, label %49, label %.critedge.loopexit.split.loop.exit89

49:                                               ; preds = %.lr.ph75
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %50 = and i64 %indvars.iv.next, 4294967295
  %.not = icmp eq i64 %50, 0
  br i1 %.not, label %.critedge, label %.lr.ph75, !llvm.loop !14

.critedge.loopexit.split.loop.exit89:             ; preds = %.lr.ph75
  %51 = trunc nuw i64 %indvars.iv to i32
  br label %.critedge

.critedge:                                        ; preds = %49, %.critedge.loopexit.split.loop.exit89, %.preheader70
  %.2.lcssa = phi i32 [ 0, %.preheader70 ], [ %51, %.critedge.loopexit.split.loop.exit89 ], [ 0, %49 ]
  %52 = zext i32 %.2.lcssa to i64
  %53 = tail call noundef i64 @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  %54 = add i64 %53, -1
  %55 = icmp ugt i64 %54, %52
  br i1 %55, label %.lr.ph80, label %.critedge2

56:                                               ; preds = %.lr.ph80
  %57 = add i32 %.379, 1
  %58 = zext i32 %57 to i64
  %59 = tail call noundef i64 @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  %60 = add i64 %59, -1
  %61 = icmp ugt i64 %60, %58
  br i1 %61, label %.lr.ph80, label %.critedge2, !llvm.loop !15

.lr.ph80:                                         ; preds = %.critedge, %56
  %62 = phi i64 [ %58, %56 ], [ %52, %.critedge ]
  %.379 = phi i32 [ %57, %56 ], [ %.2.lcssa, %.critedge ]
  %63 = tail call noundef nonnull align 4 dereferenceable(24) ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %62) #6
  %64 = getelementptr inbounds i8, ptr %63, i64 20
  %65 = load float, ptr %64, align 4, !tbaa !5
  %66 = fcmp olt float %65, %14
  br i1 %66, label %56, label %.critedge2

.critedge2:                                       ; preds = %.lr.ph80, %56, %.critedge
  %.lcssa = phi i64 [ %52, %.critedge ], [ %58, %56 ], [ %62, %.lr.ph80 ]
  %67 = fmul float %3, %3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %68 = tail call ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  store ptr %68, ptr %8, align 8
  %69 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %8, i64 noundef %.lcssa) #6
  store ptr %69, ptr %7, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %70 = call ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  store ptr %70, ptr %9, align 8
  br i1 %5, label %.preheader, label %92

.preheader:                                       ; preds = %.critedge2
  %.sroa.216.0..sroa_idx = getelementptr inbounds i8, ptr %10, i64 8
  br label %71

71:                                               ; preds = %.preheader, %89
  %72 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %73 = getelementptr inbounds i8, ptr %72, i64 20
  %74 = load float, ptr %73, align 4, !tbaa !5
  %75 = fcmp olt float %74, %15
  br i1 %75, label %76, label %.loopexit

76:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #6
  %77 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %78 = getelementptr inbounds i8, ptr %77, i64 4
  %79 = call { <2 x float>, float } @_ZmiIfE10aiVector3tIT_ERKS2_S4_(ptr noundef nonnull align 4 dereferenceable(12) %78, ptr noundef nonnull align 4 dereferenceable(12) %1)
  %.fca.0.extract13 = extractvalue { <2 x float>, float } %79, 0
  %.fca.1.extract14 = extractvalue { <2 x float>, float } %79, 1
  store <2 x float> %.fca.0.extract13, ptr %10, align 8
  store float %.fca.1.extract14, ptr %.sroa.216.0..sroa_idx, align 8
  %80 = call noundef float @_ZNK10aiVector3tIfE12SquareLengthEv(ptr noundef nonnull align 4 dereferenceable(12) %10)
  %81 = fcmp olt float %80, %67
  br i1 %81, label %82, label %.critedge4

82:                                               ; preds = %76
  %83 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %84 = getelementptr inbounds i8, ptr %83, i64 16
  %85 = load i32, ptr %84, align 4, !tbaa !16
  %86 = icmp eq i32 %85, %2
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #6
  br i1 %86, label %87, label %89

87:                                               ; preds = %82
  %88 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @_ZNSt6vectorIjSaIjEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(4) %88)
  br label %89

.critedge4:                                       ; preds = %76
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #6
  br label %89

89:                                               ; preds = %.critedge4, %87, %82
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %91 = call noundef zeroext i1 @_ZN9__gnu_cxxeqIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  br i1 %91, label %.loopexit, label %71, !llvm.loop !17

92:                                               ; preds = %.critedge2
  %.not63 = icmp eq i32 %2, 0
  br i1 %.not63, label %.preheader66, label %.preheader68

.preheader68:                                     ; preds = %92
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %12, i64 8
  br label %109

.preheader66:                                     ; preds = %92
  %.sroa.212.0..sroa_idx = getelementptr inbounds i8, ptr %11, i64 8
  br label %93

93:                                               ; preds = %.preheader66, %106
  %94 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %95 = getelementptr inbounds i8, ptr %94, i64 20
  %96 = load float, ptr %95, align 4, !tbaa !5
  %97 = fcmp olt float %96, %15
  br i1 %97, label %98, label %.loopexit

98:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #6
  %99 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %100 = getelementptr inbounds i8, ptr %99, i64 4
  %101 = call { <2 x float>, float } @_ZmiIfE10aiVector3tIT_ERKS2_S4_(ptr noundef nonnull align 4 dereferenceable(12) %100, ptr noundef nonnull align 4 dereferenceable(12) %1)
  %.fca.0.extract9 = extractvalue { <2 x float>, float } %101, 0
  %.fca.1.extract10 = extractvalue { <2 x float>, float } %101, 1
  store <2 x float> %.fca.0.extract9, ptr %11, align 8
  store float %.fca.1.extract10, ptr %.sroa.212.0..sroa_idx, align 8
  %102 = call noundef float @_ZNK10aiVector3tIfE12SquareLengthEv(ptr noundef nonnull align 4 dereferenceable(12) %11)
  %103 = fcmp olt float %102, %67
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #6
  br i1 %103, label %104, label %106

104:                                              ; preds = %98
  %105 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @_ZNSt6vectorIjSaIjEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(4) %105)
  br label %106

106:                                              ; preds = %104, %98
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %108 = call noundef zeroext i1 @_ZN9__gnu_cxxeqIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  br i1 %108, label %.loopexit, label %93, !llvm.loop !18

109:                                              ; preds = %.preheader68, %131
  %110 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %111 = getelementptr inbounds i8, ptr %110, i64 20
  %112 = load float, ptr %111, align 4, !tbaa !5
  %113 = fcmp olt float %112, %15
  br i1 %113, label %114, label %.loopexit

114:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #6
  %115 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %116 = getelementptr inbounds i8, ptr %115, i64 4
  %117 = call { <2 x float>, float } @_ZmiIfE10aiVector3tIT_ERKS2_S4_(ptr noundef nonnull align 4 dereferenceable(12) %116, ptr noundef nonnull align 4 dereferenceable(12) %1)
  %.fca.0.extract = extractvalue { <2 x float>, float } %117, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %117, 1
  store <2 x float> %.fca.0.extract, ptr %12, align 8
  store float %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  %118 = call noundef float @_ZNK10aiVector3tIfE12SquareLengthEv(ptr noundef nonnull align 4 dereferenceable(12) %12)
  %119 = fcmp olt float %118, %67
  br i1 %119, label %120, label %.critedge6

120:                                              ; preds = %114
  %121 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %122 = getelementptr inbounds i8, ptr %121, i64 16
  %123 = load i32, ptr %122, align 4, !tbaa !16
  %124 = and i32 %123, %2
  %.not64 = icmp eq i32 %124, 0
  br i1 %.not64, label %125, label %.critedge8

125:                                              ; preds = %120
  %126 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %127 = getelementptr inbounds i8, ptr %126, i64 16
  %128 = load i32, ptr %127, align 4, !tbaa !16
  %.not65 = icmp eq i32 %128, 0
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #6
  br i1 %.not65, label %129, label %131

.critedge8:                                       ; preds = %120
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #6
  br label %129

129:                                              ; preds = %.critedge8, %125
  %130 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @_ZNSt6vectorIjSaIjEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(4) %130)
  br label %131

.critedge6:                                       ; preds = %114
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #6
  br label %131

131:                                              ; preds = %.critedge6, %129, %125
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %133 = call noundef zeroext i1 @_ZN9__gnu_cxxeqIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  br i1 %133, label %.loopexit, label %109, !llvm.loop !19

.loopexit:                                        ; preds = %131, %109, %106, %93, %71, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %134

134:                                              ; preds = %23, %18, %6, %.loopexit
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIjSaIjEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(24) ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(24) ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(24) ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt6vectorIN6Assimp13SGSpatialSort5EntryESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZmiIfE10aiVector3tIT_ERKS2_S4_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK10aiVector3tIfE12SquareLengthEv(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIjSaIjEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxeqIPKN6Assimp13SGSpatialSort5EntryESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !11, i64 20}
!6 = !{!"_ZTSN6Assimp13SGSpatialSort5EntryE", !7, i64 0, !10, i64 4, !7, i64 16, !11, i64 20}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS10aiVector3tIfE", !11, i64 0, !11, i64 4, !11, i64 8}
!11 = !{!"float", !8, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = !{!6, !7, i64 16}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass