; LLVM IR from zeux/meshoptimizer :: src (clusterizer)

; 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.meshopt_Allocator = type { [24 x ptr], i64 }
%"struct.meshopt::TriangleAdjacency2" = type { ptr, ptr, ptr }
%struct.meshopt_Meshlet = type { i32, i32, i32, i32 }
%"struct.meshopt::Cone" = type { float, float, float, float, float, float }

@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [57 x i8], align 1
@__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex = external hidden unnamed_addr constant [184 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [87 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i64 @meshopt_buildMeshletsBound(i64 noundef, i64 noundef, i64 noundef) #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local i64 @meshopt_buildMeshletsFlex(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, i64 noundef %6, i64 noundef %7, i64 noundef %8, i64 noundef %9, i64 noundef %10, float noundef %11, float noundef %12) #3 personality ptr @__gxx_personality_v0 {
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i64, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca float, align 4
  %27 = alloca float, align 4
  %28 = alloca %class.meshopt_Allocator, align 8
  %29 = alloca %"struct.meshopt::TriangleAdjacency2", align 8
  %30 = alloca ptr, align 8
  %31 = alloca i32, align 4
  %32 = alloca ptr, align 8
  %33 = alloca i64, align 8
  %34 = alloca ptr, align 8
  %35 = alloca ptr, align 8
  %36 = alloca float, align 4
  %37 = alloca float, align 4
  %38 = alloca float, align 4
  %39 = alloca ptr, align 8
  %40 = alloca i64, align 8
  %41 = alloca ptr, align 8
  %42 = alloca float, align 4
  %43 = alloca float, align 4
  %44 = alloca float, align 4
  %45 = alloca i64, align 8
  %46 = alloca ptr, align 8
  %47 = alloca ptr, align 8
  %48 = alloca i32, align 4
  %49 = alloca float, align 4
  %50 = alloca i64, align 8
  %51 = alloca ptr, align 8
  %52 = alloca float, align 4
  %53 = alloca [256 x i32], align 16
  %54 = alloca i64, align 8
  %55 = alloca %struct.meshopt_Meshlet, align 4
  %56 = alloca i64, align 8
  %57 = alloca %"struct.meshopt::Cone", align 4
  %58 = alloca %"struct.meshopt::Cone", align 4
  %59 = alloca i32, align 4
  %60 = alloca i8, align 1
  %61 = alloca [3 x float], align 4
  %62 = alloca i32, align 4
  %63 = alloca float, align 4
  %64 = alloca i32, align 4
  %65 = alloca i32, align 4
  %66 = alloca i32, align 4
  %67 = alloca i32, align 4
  %68 = alloca i32, align 4
  %69 = alloca i32, align 4
  %70 = alloca i64, align 8
  %71 = alloca i32, align 4
  %72 = alloca ptr, align 8
  %73 = alloca i64, align 8
  %74 = alloca i64, align 8
  %75 = alloca i32, align 4
  store ptr %0, ptr %15, align 8, !tbaa !5
  store ptr %1, ptr %16, align 8, !tbaa !5
  store ptr %2, ptr %17, align 8, !tbaa !5
  store ptr %3, ptr %18, align 8, !tbaa !5
  store i64 %4, ptr %19, align 8, !tbaa !9
  store ptr %5, ptr %20, align 8, !tbaa !5
  store i64 %6, ptr %21, align 8, !tbaa !9
  store i64 %7, ptr %22, align 8, !tbaa !9
  store i64 %8, ptr %23, align 8, !tbaa !9
  store i64 %9, ptr %24, align 8, !tbaa !9
  store i64 %10, ptr %25, align 8, !tbaa !9
  store float %11, ptr %26, align 4, !tbaa !11
  store float %12, ptr %27, align 4, !tbaa !11
  %76 = load i64, ptr %19, align 8, !tbaa !9
  %77 = urem i64 %76, 3
  %78 = icmp eq i64 %77, 0
  br i1 %78, label %79, label %80

79:                                               ; preds = %13
  br label %82

80:                                               ; preds = %13
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 1066, ptr noundef @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

81:                                               ; No predecessors!
  br label %82

82:                                               ; preds = %81, %79
  %83 = load i64, ptr %22, align 8, !tbaa !9
  %84 = icmp uge i64 %83, 12
  br i1 %84, label %85, label %88

85:                                               ; preds = %82
  %86 = load i64, ptr %22, align 8, !tbaa !9
  %87 = icmp ule i64 %86, 256
  br label %88

88:                                               ; preds = %85, %82
  %89 = phi i1 [ false, %82 ], [ %87, %85 ]
  br i1 %89, label %90, label %91

90:                                               ; preds = %88
  br label %93

91:                                               ; preds = %88
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 1067, ptr noundef @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

92:                                               ; No predecessors!
  br label %93

93:                                               ; preds = %92, %90
  %94 = load i64, ptr %22, align 8, !tbaa !9
  %95 = urem i64 %94, 4
  %96 = icmp eq i64 %95, 0
  br i1 %96, label %97, label %98

97:                                               ; preds = %93
  br label %100

98:                                               ; preds = %93
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 1068, ptr noundef @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

99:                                               ; No predecessors!
  br label %100

100:                                              ; preds = %99, %97
  %101 = load i64, ptr %23, align 8, !tbaa !9
  %102 = icmp uge i64 %101, 3
  br i1 %102, label %103, label %106

103:                                              ; preds = %100
  %104 = load i64, ptr %23, align 8, !tbaa !9
  %105 = icmp ule i64 %104, 256
  br label %106

106:                                              ; preds = %103, %100
  %107 = phi i1 [ false, %100 ], [ %105, %103 ]
  br i1 %107, label %108, label %109

108:                                              ; preds = %106
  br label %111

109:                                              ; preds = %106
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 1070, ptr noundef @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

110:                                              ; No predecessors!
  br label %111

111:                                              ; preds = %110, %108
  %112 = load i64, ptr %24, align 8, !tbaa !9
  %113 = icmp uge i64 %112, 1
  br i1 %113, label %114, label %121

114:                                              ; preds = %111
  %115 = load i64, ptr %24, align 8, !tbaa !9
  %116 = load i64, ptr %25, align 8, !tbaa !9
  %117 = icmp ule i64 %115, %116
  br i1 %117, label %118, label %121

118:                                              ; preds = %114
  %119 = load i64, ptr %25, align 8, !tbaa !9
  %120 = icmp ule i64 %119, 512
  br label %121

121:                                              ; preds = %118, %114, %111
  %122 = phi i1 [ false, %114 ], [ false, %111 ], [ %120, %118 ]
  br i1 %122, label %123, label %124

123:                                              ; preds = %121
  br label %126

124:                                              ; preds = %121
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 1071, ptr noundef @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

125:                                              ; No predecessors!
  br label %126

126:                                              ; preds = %125, %123
  %127 = load i64, ptr %24, align 8, !tbaa !9
  %128 = urem i64 %127, 4
  %129 = icmp eq i64 %128, 0
  br i1 %129, label %130, label %134

130:                                              ; preds = %126
  %131 = load i64, ptr %25, align 8, !tbaa !9
  %132 = urem i64 %131, 4
  %133 = icmp eq i64 %132, 0
  br label %134

134:                                              ; preds = %130, %126
  %135 = phi i1 [ false, %126 ], [ %133, %130 ]
  br i1 %135, label %136, label %137

136:                                              ; preds = %134
  br label %139

137:                                              ; preds = %134
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 1072, ptr noundef @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

138:                                              ; No predecessors!
  br label %139

139:                                              ; preds = %138, %136
  %140 = load float, ptr %26, align 4, !tbaa !11
  %141 = fcmp ole float %140, 1.000000e+00
  br i1 %141, label %142, label %143

142:                                              ; preds = %139
  br label %145

143:                                              ; preds = %139
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 1074, ptr noundef @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

144:                                              ; No predecessors!
  br label %145

145:                                              ; preds = %144, %142
  %146 = load float, ptr %27, align 4, !tbaa !11
  %147 = fcmp oge float %146, 0.000000e+00
  br i1 %147, label %148, label %149

148:                                              ; preds = %145
  br label %151

149:                                              ; preds = %145
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 1075, ptr noundef @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

150:                                              ; No predecessors!
  br label %151

151:                                              ; preds = %150, %148
  %152 = load i64, ptr %19, align 8, !tbaa !9
  %153 = icmp eq i64 %152, 0
  br i1 %153, label %154, label %155

154:                                              ; preds = %151
  store i64 0, ptr %14, align 8
  br label %814

155:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 200, ptr %28) #8
  call void @_ZN17meshopt_AllocatorC2Ev(ptr noundef nonnull align 8 dereferenceable(200) %28)
  call void @llvm.lifetime.start.p0(i64 24, ptr %29) #8
  call void @llvm.memset.p0.i64(ptr align 8 %29, i8 0, i64 24, i1 false)
  %156 = load i64, ptr %21, align 8, !tbaa !9
  %157 = load i64, ptr %19, align 8, !tbaa !9
  %158 = icmp ugt i64 %156, %157
  br i1 %158, label %159, label %171

159:                                              ; preds = %155
  %160 = load i64, ptr %19, align 8, !tbaa !9
  %161 = icmp ult i64 %160, 2147483648
  br i1 %161, label %162, label %171

162:                                              ; preds = %159
  %163 = load ptr, ptr %18, align 8, !tbaa !5
  %164 = load i64, ptr %19, align 8, !tbaa !9
  %165 = load i64, ptr %21, align 8, !tbaa !9
  invoke void @_ZN7meshoptL28buildTriangleAdjacencySparseERNS_18TriangleAdjacency2EPKjmmR17meshopt_Allocator(ptr noundef nonnull align 8 dereferenceable(24) %29, ptr noundef %163, i64 noundef %164, i64 noundef %165, ptr noundef nonnull align 8 dereferenceable(200) %28)
          to label %166 unwind label %167

166:                                              ; preds = %162
  br label %176

167:                                              ; preds = %171, %162
  %168 = landingpad { ptr, i32 }
          cleanup
  %169 = extractvalue { ptr, i32 } %168, 0
  store ptr %169, ptr %30, align 8
  %170 = extractvalue { ptr, i32 } %168, 1
  store i32 %170, ptr %31, align 4
  br label %813

171:                                              ; preds = %159, %155
  %172 = load ptr, ptr %18, align 8, !tbaa !5
  %173 = load i64, ptr %19, align 8, !tbaa !9
  %174 = load i64, ptr %21, align 8, !tbaa !9
  invoke void @_ZN7meshoptL22buildTriangleAdjacencyERNS_18TriangleAdjacency2EPKjmmR17meshopt_Allocator(ptr noundef nonnull align 8 dereferenceable(24) %29, ptr noundef %172, i64 noundef %173, i64 noundef %174, ptr noundef nonnull align 8 dereferenceable(200) %28)
          to label %175 unwind label %167

175:                                              ; preds = %171
  br label %176

176:                                              ; preds = %175, %166
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #8
  %177 = getelementptr inbounds %"struct.meshopt::TriangleAdjacency2", ptr %29, i32 0, i32 0
  %178 = load ptr, ptr %177, align 8, !tbaa !13
  store ptr %178, ptr %32, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #8
  %179 = load i64, ptr %19, align 8, !tbaa !9
  %180 = udiv i64 %179, 3
  store i64 %180, ptr %33, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #8
  %181 = load i64, ptr %33, align 8, !tbaa !9
  %182 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIhEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %28, i64 noundef %181)
          to label %183 unwind label %222

183:                                              ; preds = %176
  store ptr %182, ptr %34, align 8, !tbaa !5
  %184 = load ptr, ptr %34, align 8, !tbaa !5
  %185 = load i64, ptr %33, align 8, !tbaa !9
  call void @llvm.memset.p0.i64(ptr align 1 %184, i8 0, i64 %185, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #8
  %186 = load i64, ptr %33, align 8, !tbaa !9
  %187 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIN7meshopt4ConeEEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %28, i64 noundef %186)
          to label %188 unwind label %226

188:                                              ; preds = %183
  store ptr %187, ptr %35, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #8
  %189 = load ptr, ptr %35, align 8, !tbaa !5
  %190 = load ptr, ptr %18, align 8, !tbaa !5
  %191 = load i64, ptr %19, align 8, !tbaa !9
  %192 = load ptr, ptr %20, align 8, !tbaa !5
  %193 = load i64, ptr %21, align 8, !tbaa !9
  %194 = load i64, ptr %22, align 8, !tbaa !9
  %195 = invoke noundef float @_ZN7meshoptL20computeTriangleConesEPNS_4ConeEPKjmPKfmm(ptr noundef %189, ptr noundef %190, i64 noundef %191, ptr noundef %192, i64 noundef %193, i64 noundef %194)
          to label %196 unwind label %230

196:                                              ; preds = %188
  store float %195, ptr %36, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #8
  %197 = load i64, ptr %33, align 8, !tbaa !9
  %198 = icmp eq i64 %197, 0
  br i1 %198, label %199, label %200

199:                                              ; preds = %196
  br label %206

200:                                              ; preds = %196
  %201 = load float, ptr %36, align 4, !tbaa !11
  %202 = load i64, ptr %33, align 8, !tbaa !9
  %203 = uitofp i64 %202 to float
  %204 = fdiv float %201, %203
  %205 = fmul float %204, 5.000000e-01
  br label %206

206:                                              ; preds = %200, %199
  %207 = phi float [ 0.000000e+00, %199 ], [ %205, %200 ]
  store float %207, ptr %37, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #8
  %208 = load float, ptr %37, align 4, !tbaa !11
  %209 = load i64, ptr %25, align 8, !tbaa !9
  %210 = uitofp i64 %209 to float
  %211 = fmul float %208, %210
  %212 = call float @sqrtf(float noundef %211) #8
  %213 = fmul float %212, 5.000000e-01
  store float %213, ptr %38, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #8
  %214 = load i64, ptr %33, align 8, !tbaa !9
  %215 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIjEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %28, i64 noundef %214)
          to label %216 unwind label %234

216:                                              ; preds = %206
  store ptr %215, ptr %39, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #8
  store i64 0, ptr %40, align 8, !tbaa !9
  br label %217

217:                                              ; preds = %244, %216
  %218 = load i64, ptr %40, align 8, !tbaa !9
  %219 = load i64, ptr %33, align 8, !tbaa !9
  %220 = icmp ult i64 %218, %219
  br i1 %220, label %238, label %221

221:                                              ; preds = %217
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #8
  br label %247

222:                                              ; preds = %176
  %223 = landingpad { ptr, i32 }
          cleanup
  %224 = extractvalue { ptr, i32 } %223, 0
  store ptr %224, ptr %30, align 8
  %225 = extractvalue { ptr, i32 } %223, 1
  store i32 %225, ptr %31, align 4
  br label %812

226:                                              ; preds = %183
  %227 = landingpad { ptr, i32 }
          cleanup
  %228 = extractvalue { ptr, i32 } %227, 0
  store ptr %228, ptr %30, align 8
  %229 = extractvalue { ptr, i32 } %227, 1
  store i32 %229, ptr %31, align 4
  br label %811

230:                                              ; preds = %188
  %231 = landingpad { ptr, i32 }
          cleanup
  %232 = extractvalue { ptr, i32 } %231, 0
  store ptr %232, ptr %30, align 8
  %233 = extractvalue { ptr, i32 } %231, 1
  store i32 %233, ptr %31, align 4
  br label %810

234:                                              ; preds = %206
  %235 = landingpad { ptr, i32 }
          cleanup
  %236 = extractvalue { ptr, i32 } %235, 0
  store ptr %236, ptr %30, align 8
  %237 = extractvalue { ptr, i32 } %235, 1
  store i32 %237, ptr %31, align 4
  br label %809

238:                                              ; preds = %217
  %239 = load i64, ptr %40, align 8, !tbaa !9
  %240 = trunc i64 %239 to i32
  %241 = load ptr, ptr %39, align 8, !tbaa !5
  %242 = load i64, ptr %40, align 8, !tbaa !9
  %243 = getelementptr inbounds i32, ptr %241, i64 %242
  store i32 %240, ptr %243, align 4, !tbaa !15
  br label %244

244:                                              ; preds = %238
  %245 = load i64, ptr %40, align 8, !tbaa !9
  %246 = add i64 %245, 1
  store i64 %246, ptr %40, align 8, !tbaa !9
  br label %217, !llvm.loop !17

247:                                              ; preds = %221
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #8
  %248 = load i64, ptr %33, align 8, !tbaa !9
  %249 = mul i64 %248, 2
  %250 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIN7meshopt6KDNodeEEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %28, i64 noundef %249)
          to label %251 unwind label %267

251:                                              ; preds = %247
  store ptr %250, ptr %41, align 8, !tbaa !5
  %252 = load ptr, ptr %41, align 8, !tbaa !5
  %253 = load i64, ptr %33, align 8, !tbaa !9
  %254 = mul i64 %253, 2
  %255 = load ptr, ptr %35, align 8, !tbaa !5
  %256 = getelementptr inbounds %"struct.meshopt::Cone", ptr %255, i64 0
  %257 = getelementptr inbounds %"struct.meshopt::Cone", ptr %256, i32 0, i32 0
  %258 = load ptr, ptr %39, align 8, !tbaa !5
  %259 = load i64, ptr %33, align 8, !tbaa !9
  %260 = invoke noundef i64 @_ZN7meshoptL11kdtreeBuildEmPNS_6KDNodeEmPKfmPjmm(i64 noundef 0, ptr noundef %252, i64 noundef %254, ptr noundef %257, i64 noundef 6, ptr noundef %258, i64 noundef %259, i64 noundef 8)
          to label %261 unwind label %267

261:                                              ; preds = %251
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #8
  store float 0x47EFFFFFE0000000, ptr %42, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #8
  store float 0x47EFFFFFE0000000, ptr %43, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #8
  store float 0x47EFFFFFE0000000, ptr %44, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #8
  store i64 0, ptr %45, align 8, !tbaa !9
  br label %262

262:                                              ; preds = %314, %261
  %263 = load i64, ptr %45, align 8, !tbaa !9
  %264 = load i64, ptr %33, align 8, !tbaa !9
  %265 = icmp ult i64 %263, %264
  br i1 %265, label %271, label %266

266:                                              ; preds = %262
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #8
  br label %317

267:                                              ; preds = %251, %247
  %268 = landingpad { ptr, i32 }
          cleanup
  %269 = extractvalue { ptr, i32 } %268, 0
  store ptr %269, ptr %30, align 8
  %270 = extractvalue { ptr, i32 } %268, 1
  store i32 %270, ptr %31, align 4
  br label %808

271:                                              ; preds = %262
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #8
  %272 = load ptr, ptr %35, align 8, !tbaa !5
  %273 = load i64, ptr %45, align 8, !tbaa !9
  %274 = getelementptr inbounds %"struct.meshopt::Cone", ptr %272, i64 %273
  store ptr %274, ptr %46, align 8, !tbaa !5
  %275 = load float, ptr %42, align 4, !tbaa !11
  %276 = load ptr, ptr %46, align 8, !tbaa !5
  %277 = getelementptr inbounds %"struct.meshopt::Cone", ptr %276, i32 0, i32 0
  %278 = load float, ptr %277, align 4, !tbaa !19
  %279 = fcmp ogt float %275, %278
  br i1 %279, label %280, label %284

280:                                              ; preds = %271
  %281 = load ptr, ptr %46, align 8, !tbaa !5
  %282 = getelementptr inbounds %"struct.meshopt::Cone", ptr %281, i32 0, i32 0
  %283 = load float, ptr %282, align 4, !tbaa !19
  br label %286

284:                                              ; preds = %271
  %285 = load float, ptr %42, align 4, !tbaa !11
  br label %286

286:                                              ; preds = %284, %280
  %287 = phi float [ %283, %280 ], [ %285, %284 ]
  store float %287, ptr %42, align 4, !tbaa !11
  %288 = load float, ptr %43, align 4, !tbaa !11
  %289 = load ptr, ptr %46, align 8, !tbaa !5
  %290 = getelementptr inbounds %"struct.meshopt::Cone", ptr %289, i32 0, i32 1
  %291 = load float, ptr %290, align 4, !tbaa !21
  %292 = fcmp ogt float %288, %291
  br i1 %292, label %293, label %297

293:                                              ; preds = %286
  %294 = load ptr, ptr %46, align 8, !tbaa !5
  %295 = getelementptr inbounds %"struct.meshopt::Cone", ptr %294, i32 0, i32 1
  %296 = load float, ptr %295, align 4, !tbaa !21
  br label %299

297:                                              ; preds = %286
  %298 = load float, ptr %43, align 4, !tbaa !11
  br label %299

299:                                              ; preds = %297, %293
  %300 = phi float [ %296, %293 ], [ %298, %297 ]
  store float %300, ptr %43, align 4, !tbaa !11
  %301 = load float, ptr %44, align 4, !tbaa !11
  %302 = load ptr, ptr %46, align 8, !tbaa !5
  %303 = getelementptr inbounds %"struct.meshopt::Cone", ptr %302, i32 0, i32 2
  %304 = load float, ptr %303, align 4, !tbaa !22
  %305 = fcmp ogt float %301, %304
  br i1 %305, label %306, label %310

306:                                              ; preds = %299
  %307 = load ptr, ptr %46, align 8, !tbaa !5
  %308 = getelementptr inbounds %"struct.meshopt::Cone", ptr %307, i32 0, i32 2
  %309 = load float, ptr %308, align 4, !tbaa !22
  br label %312

310:                                              ; preds = %299
  %311 = load float, ptr %44, align 4, !tbaa !11
  br label %312

312:                                              ; preds = %310, %306
  %313 = phi float [ %309, %306 ], [ %311, %310 ]
  store float %313, ptr %44, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #8
  br label %314

314:                                              ; preds = %312
  %315 = load i64, ptr %45, align 8, !tbaa !9
  %316 = add i64 %315, 1
  store i64 %316, ptr %45, align 8, !tbaa !9
  br label %262, !llvm.loop !23

317:                                              ; preds = %266
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #8
  %318 = load i64, ptr %21, align 8, !tbaa !9
  %319 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIsEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %28, i64 noundef %318)
          to label %320 unwind label %329

320:                                              ; preds = %317
  store ptr %319, ptr %47, align 8, !tbaa !5
  %321 = load ptr, ptr %47, align 8, !tbaa !5
  %322 = load i64, ptr %21, align 8, !tbaa !9
  %323 = mul i64 %322, 2
  call void @llvm.memset.p0.i64(ptr align 2 %321, i8 -1, i64 %323, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %48) #8
  store i32 -1, ptr %48, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %49) #8
  store float 0x47EFFFFFE0000000, ptr %49, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %50) #8
  store i64 0, ptr %50, align 8, !tbaa !9
  br label %324

324:                                              ; preds = %369, %320
  %325 = load i64, ptr %50, align 8, !tbaa !9
  %326 = load i64, ptr %33, align 8, !tbaa !9
  %327 = icmp ult i64 %325, %326
  br i1 %327, label %333, label %328

328:                                              ; preds = %324
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #8
  br label %372

329:                                              ; preds = %317
  %330 = landingpad { ptr, i32 }
          cleanup
  %331 = extractvalue { ptr, i32 } %330, 0
  store ptr %331, ptr %30, align 8
  %332 = extractvalue { ptr, i32 } %330, 1
  store i32 %332, ptr %31, align 4
  br label %807

333:                                              ; preds = %324
  call void @llvm.lifetime.start.p0(i64 8, ptr %51) #8
  %334 = load ptr, ptr %35, align 8, !tbaa !5
  %335 = load i64, ptr %50, align 8, !tbaa !9
  %336 = getelementptr inbounds %"struct.meshopt::Cone", ptr %334, i64 %335
  store ptr %336, ptr %51, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %52) #8
  %337 = load ptr, ptr %51, align 8, !tbaa !5
  %338 = getelementptr inbounds %"struct.meshopt::Cone", ptr %337, i32 0, i32 0
  %339 = load float, ptr %338, align 4, !tbaa !19
  %340 = load float, ptr %42, align 4, !tbaa !11
  %341 = fsub float %339, %340
  %342 = load ptr, ptr %51, align 8, !tbaa !5
  %343 = getelementptr inbounds %"struct.meshopt::Cone", ptr %342, i32 0, i32 1
  %344 = load float, ptr %343, align 4, !tbaa !21
  %345 = load float, ptr %43, align 4, !tbaa !11
  %346 = fsub float %344, %345
  %347 = load ptr, ptr %51, align 8, !tbaa !5
  %348 = getelementptr inbounds %"struct.meshopt::Cone", ptr %347, i32 0, i32 2
  %349 = load float, ptr %348, align 4, !tbaa !22
  %350 = load float, ptr %44, align 4, !tbaa !11
  %351 = fsub float %349, %350
  %352 = invoke noundef float @_ZN7meshoptL11getDistanceEfffb(float noundef %341, float noundef %346, float noundef %351, i1 noundef zeroext false)
          to label %353 unwind label %364

353:                                              ; preds = %333
  store float %352, ptr %52, align 4, !tbaa !11
  %354 = load i32, ptr %48, align 4, !tbaa !15
  %355 = icmp eq i32 %354, -1
  br i1 %355, label %360, label %356

356:                                              ; preds = %353
  %357 = load float, ptr %52, align 4, !tbaa !11
  %358 = load float, ptr %49, align 4, !tbaa !11
  %359 = fcmp olt float %357, %358
  br i1 %359, label %360, label %368

360:                                              ; preds = %356, %353
  %361 = load i64, ptr %50, align 8, !tbaa !9
  %362 = trunc i64 %361 to i32
  store i32 %362, ptr %48, align 4, !tbaa !15
  %363 = load float, ptr %52, align 4, !tbaa !11
  store float %363, ptr %49, align 4, !tbaa !11
  br label %368

364:                                              ; preds = %333
  %365 = landingpad { ptr, i32 }
          cleanup
  %366 = extractvalue { ptr, i32 } %365, 0
  store ptr %366, ptr %30, align 8
  %367 = extractvalue { ptr, i32 } %365, 1
  store i32 %367, ptr %31, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %52) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #8
  br label %806

368:                                              ; preds = %360, %356
  call void @llvm.lifetime.end.p0(i64 4, ptr %52) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #8
  br label %369

369:                                              ; preds = %368
  %370 = load i64, ptr %50, align 8, !tbaa !9
  %371 = add i64 %370, 1
  store i64 %371, ptr %50, align 8, !tbaa !9
  br label %324, !llvm.loop !24

372:                                              ; preds = %328
  call void @llvm.lifetime.start.p0(i64 1024, ptr %53) #8
  call void @llvm.memset.p0.i64(ptr align 16 %53, i8 0, i64 1024, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %54) #8
  store i64 0, ptr %54, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %55) #8
  call void @llvm.memset.p0.i64(ptr align 4 %55, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %56) #8
  store i64 0, ptr %56, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %57) #8
  call void @llvm.memset.p0.i64(ptr align 4 %57, i8 0, i64 24, i1 false)
  br label %373

373:                                              ; preds = %773, %372
  call void @llvm.lifetime.start.p0(i64 24, ptr %58) #8
  %374 = getelementptr inbounds %struct.meshopt_Meshlet, ptr %55, i32 0, i32 3
  %375 = load i32, ptr %374, align 4, !tbaa !25
  invoke void @_ZN7meshoptL14getMeshletConeERKNS_4ConeEj(ptr dead_on_unwind writable sret(%"struct.meshopt::Cone") align 4 %58, ptr noundef nonnull align 4 dereferenceable(24) %57, i32 noundef %375)
          to label %376 unwind label %385

376:                                              ; preds = %373
  call void @llvm.lifetime.start.p0(i64 4, ptr %59) #8
  store i32 -1, ptr %59, align 4, !tbaa !15
  %377 = load i64, ptr %56, align 8, !tbaa !9
  %378 = icmp eq i64 %377, 0
  br i1 %378, label %379, label %389

379:                                              ; preds = %376
  %380 = getelementptr inbounds %struct.meshopt_Meshlet, ptr %55, i32 0, i32 3
  %381 = load i32, ptr %380, align 4, !tbaa !25
  %382 = icmp eq i32 %381, 0
  br i1 %382, label %383, label %389

383:                                              ; preds = %379
  %384 = load i32, ptr %48, align 4, !tbaa !15
  store i32 %384, ptr %59, align 4, !tbaa !15
  br label %403

385:                                              ; preds = %373
  %386 = landingpad { ptr, i32 }
          cleanup
  %387 = extractvalue { ptr, i32 } %386, 0
  store ptr %387, ptr %30, align 8
  %388 = extractvalue { ptr, i32 } %386, 1
  store i32 %388, ptr %31, align 4
  br label %777

389:                                              ; preds = %379, %376
  %390 = load ptr, ptr %16, align 8, !tbaa !5
  %391 = load ptr, ptr %18, align 8, !tbaa !5
  %392 = load ptr, ptr %35, align 8, !tbaa !5
  %393 = load ptr, ptr %32, align 8, !tbaa !5
  %394 = load ptr, ptr %47, align 8, !tbaa !5
  %395 = load float, ptr %38, align 4, !tbaa !11
  %396 = load float, ptr %26, align 4, !tbaa !11
  %397 = invoke noundef i32 @_ZN7meshoptL19getNeighborTriangleERK15meshopt_MeshletRKNS_4ConeEPKjS7_RKNS_18TriangleAdjacency2EPS4_S7_PKsff(ptr noundef nonnull align 4 dereferenceable(16) %55, ptr noundef nonnull align 4 dereferenceable(24) %58, ptr noundef %390, ptr noundef %391, ptr noundef nonnull align 8 dereferenceable(24) %29, ptr noundef %392, ptr noundef %393, ptr noundef %394, float noundef %395, float noundef %396)
          to label %398 unwind label %399

398:                                              ; preds = %389
  store i32 %397, ptr %59, align 4, !tbaa !15
  br label %403

399:                                              ; preds = %389
  %400 = landingpad { ptr, i32 }
          cleanup
  %401 = extractvalue { ptr, i32 } %400, 0
  store ptr %401, ptr %30, align 8
  %402 = extractvalue { ptr, i32 } %400, 1
  store i32 %402, ptr %31, align 4
  br label %776

403:                                              ; preds = %398, %383
  call void @llvm.lifetime.start.p0(i64 1, ptr %60) #8
  store i8 0, ptr %60, align 1, !tbaa !27
  %404 = load i32, ptr %59, align 4, !tbaa !15
  %405 = icmp eq i32 %404, -1
  br i1 %405, label %406, label %446

406:                                              ; preds = %403
  call void @llvm.lifetime.start.p0(i64 12, ptr %61) #8
  %407 = getelementptr inbounds %"struct.meshopt::Cone", ptr %58, i32 0, i32 0
  %408 = load float, ptr %407, align 4, !tbaa !19
  store float %408, ptr %61, align 4, !tbaa !11
  %409 = getelementptr inbounds float, ptr %61, i64 1
  %410 = getelementptr inbounds %"struct.meshopt::Cone", ptr %58, i32 0, i32 1
  %411 = load float, ptr %410, align 4, !tbaa !21
  store float %411, ptr %409, align 4, !tbaa !11
  %412 = getelementptr inbounds float, ptr %61, i64 2
  %413 = getelementptr inbounds %"struct.meshopt::Cone", ptr %58, i32 0, i32 2
  %414 = load float, ptr %413, align 4, !tbaa !22
  store float %414, ptr %412, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %62) #8
  store i32 -1, ptr %62, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %63) #8
  store float 0x47EFFFFFE0000000, ptr %63, align 4, !tbaa !11
  %415 = load ptr, ptr %41, align 8, !tbaa !5
  %416 = load ptr, ptr %35, align 8, !tbaa !5
  %417 = getelementptr inbounds %"struct.meshopt::Cone", ptr %416, i64 0
  %418 = getelementptr inbounds %"struct.meshopt::Cone", ptr %417, i32 0, i32 0
  %419 = load ptr, ptr %34, align 8, !tbaa !5
  %420 = getelementptr inbounds [3 x float], ptr %61, i64 0, i64 0
  %421 = load float, ptr %26, align 4, !tbaa !11
  %422 = fcmp olt float %421, 0.000000e+00
  invoke void @_ZN7meshoptL13kdtreeNearestEPNS_6KDNodeEjPKfmPKhS3_bRjRf(ptr noundef %415, i32 noundef 0, ptr noundef %418, i64 noundef 6, ptr noundef %419, ptr noundef %420, i1 noundef zeroext %422, ptr noundef nonnull align 4 dereferenceable(4) %62, ptr noundef nonnull align 4 dereferenceable(4) %63)
          to label %423 unwind label %442

423:                                              ; preds = %406
  %424 = load i32, ptr %62, align 4, !tbaa !15
  store i32 %424, ptr %59, align 4, !tbaa !15
  %425 = getelementptr inbounds %struct.meshopt_Meshlet, ptr %55, i32 0, i32 3
  %426 = load i32, ptr %425, align 4, !tbaa !25
  %427 = zext i32 %426 to i64
  %428 = load i64, ptr %24, align 8, !tbaa !9
  %429 = icmp uge i64 %427, %428
  br i1 %429, label %430, label %439

430:                                              ; preds = %423
  %431 = load float, ptr %27, align 4, !tbaa !11
  %432 = fcmp ogt float %431, 0.000000e+00
  br i1 %432, label %433, label %439

433:                                              ; preds = %430
  %434 = load float, ptr %63, align 4, !tbaa !11
  %435 = load float, ptr %38, align 4, !tbaa !11
  %436 = load float, ptr %27, align 4, !tbaa !11
  %437 = fmul float %435, %436
  %438 = fcmp ogt float %434, %437
  br label %439

439:                                              ; preds = %433, %430, %423
  %440 = phi i1 [ false, %430 ], [ false, %423 ], [ %438, %433 ]
  %441 = zext i1 %440 to i8
  store i8 %441, ptr %60, align 1, !tbaa !27
  call void @llvm.lifetime.end.p0(i64 4, ptr %63) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %62) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %61) #8
  br label %446

442:                                              ; preds = %406
  %443 = landingpad { ptr, i32 }
          cleanup
  %444 = extractvalue { ptr, i32 } %443, 0
  store ptr %444, ptr %30, align 8
  %445 = extractvalue { ptr, i32 } %443, 1
  store i32 %445, ptr %31, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %63) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %62) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %61) #8
  br label %775

446:                                              ; preds = %439, %403
  %447 = load i32, ptr %59, align 4, !tbaa !15
  %448 = icmp eq i32 %447, -1
  br i1 %448, label %449, label %450

449:                                              ; preds = %446
  store i32 11, ptr %64, align 4
  br label %771

450:                                              ; preds = %446
  call void @llvm.lifetime.start.p0(i64 4, ptr %65) #8
  %451 = load ptr, ptr %47, align 8, !tbaa !5
  %452 = load ptr, ptr %18, align 8, !tbaa !5
  %453 = load i32, ptr %59, align 4, !tbaa !15
  %454 = mul i32 %453, 3
  %455 = add i32 %454, 0
  %456 = zext i32 %455 to i64
  %457 = getelementptr inbounds i32, ptr %452, i64 %456
  %458 = load i32, ptr %457, align 4, !tbaa !15
  %459 = zext i32 %458 to i64
  %460 = getelementptr inbounds i16, ptr %451, i64 %459
  %461 = load i16, ptr %460, align 2, !tbaa !29
  %462 = sext i16 %461 to i32
  %463 = icmp slt i32 %462, 0
  %464 = zext i1 %463 to i32
  %465 = load ptr, ptr %47, align 8, !tbaa !5
  %466 = load ptr, ptr %18, align 8, !tbaa !5
  %467 = load i32, ptr %59, align 4, !tbaa !15
  %468 = mul i32 %467, 3
  %469 = add i32 %468, 1
  %470 = zext i32 %469 to i64
  %471 = getelementptr inbounds i32, ptr %466, i64 %470
  %472 = load i32, ptr %471, align 4, !tbaa !15
  %473 = zext i32 %472 to i64
  %474 = getelementptr inbounds i16, ptr %465, i64 %473
  %475 = load i16, ptr %474, align 2, !tbaa !29
  %476 = sext i16 %475 to i32
  %477 = icmp slt i32 %476, 0
  %478 = zext i1 %477 to i32
  %479 = add nsw i32 %464, %478
  %480 = load ptr, ptr %47, align 8, !tbaa !5
  %481 = load ptr, ptr %18, align 8, !tbaa !5
  %482 = load i32, ptr %59, align 4, !tbaa !15
  %483 = mul i32 %482, 3
  %484 = add i32 %483, 2
  %485 = zext i32 %484 to i64
  %486 = getelementptr inbounds i32, ptr %481, i64 %485
  %487 = load i32, ptr %486, align 4, !tbaa !15
  %488 = zext i32 %487 to i64
  %489 = getelementptr inbounds i16, ptr %480, i64 %488
  %490 = load i16, ptr %489, align 2, !tbaa !29
  %491 = sext i16 %490 to i32
  %492 = icmp slt i32 %491, 0
  %493 = zext i1 %492 to i32
  %494 = add nsw i32 %479, %493
  store i32 %494, ptr %65, align 4, !tbaa !15
  %495 = load i8, ptr %60, align 1, !tbaa !27, !range !31, !noundef !32
  %496 = trunc i8 %495 to i1
  br i1 %496, label %511, label %497

497:                                              ; preds = %450
  %498 = getelementptr inbounds %struct.meshopt_Meshlet, ptr %55, i32 0, i32 2
  %499 = load i32, ptr %498, align 4, !tbaa !33
  %500 = load i32, ptr %65, align 4, !tbaa !15
  %501 = add i32 %499, %500
  %502 = zext i32 %501 to i64
  %503 = load i64, ptr %23, align 8, !tbaa !9
  %504 = icmp ugt i64 %502, %503
  br i1 %504, label %511, label %505

505:                                              ; preds = %497
  %506 = getelementptr inbounds %struct.meshopt_Meshlet, ptr %55, i32 0, i32 3
  %507 = load i32, ptr %506, align 4, !tbaa !25
  %508 = zext i32 %507 to i64
  %509 = load i64, ptr %25, align 8, !tbaa !9
  %510 = icmp uge i64 %508, %509
  br i1 %510, label %511, label %565

511:                                              ; preds = %505, %497, %450
  %512 = getelementptr inbounds [256 x i32], ptr %53, i64 0, i64 0
  %513 = load i64, ptr %54, align 8, !tbaa !9
  %514 = load ptr, ptr %34, align 8, !tbaa !5
  %515 = invoke noundef i64 @_ZN7meshoptL18pruneSeedTrianglesEPjmPKh(ptr noundef %512, i64 noundef %513, ptr noundef %514)
          to label %516 unwind label %557

516:                                              ; preds = %511
  store i64 %515, ptr %54, align 8, !tbaa !9
  %517 = load i64, ptr %54, align 8, !tbaa !9
  %518 = add i64 %517, 4
  %519 = icmp ule i64 %518, 256
  br i1 %519, label %520, label %522

520:                                              ; preds = %516
  %521 = load i64, ptr %54, align 8, !tbaa !9
  br label %523

522:                                              ; preds = %516
  br label %523

523:                                              ; preds = %522, %520
  %524 = phi i64 [ %521, %520 ], [ 252, %522 ]
  store i64 %524, ptr %54, align 8, !tbaa !9
  %525 = getelementptr inbounds [256 x i32], ptr %53, i64 0, i64 0
  %526 = load i64, ptr %54, align 8, !tbaa !9
  %527 = getelementptr inbounds i32, ptr %525, i64 %526
  %528 = load ptr, ptr %16, align 8, !tbaa !5
  %529 = load ptr, ptr %18, align 8, !tbaa !5
  %530 = load ptr, ptr %35, align 8, !tbaa !5
  %531 = load ptr, ptr %32, align 8, !tbaa !5
  %532 = load float, ptr %42, align 4, !tbaa !11
  %533 = load float, ptr %43, align 4, !tbaa !11
  %534 = load float, ptr %44, align 4, !tbaa !11
  %535 = invoke noundef i64 @_ZN7meshoptL19appendSeedTrianglesEPjRK15meshopt_MeshletPKjS5_RKNS_18TriangleAdjacency2EPKNS_4ConeES5_fff(ptr noundef %527, ptr noundef nonnull align 4 dereferenceable(16) %55, ptr noundef %528, ptr noundef %529, ptr noundef nonnull align 8 dereferenceable(24) %29, ptr noundef %530, ptr noundef %531, float noundef %532, float noundef %533, float noundef %534)
          to label %536 unwind label %557

536:                                              ; preds = %523
  %537 = load i64, ptr %54, align 8, !tbaa !9
  %538 = add i64 %537, %535
  store i64 %538, ptr %54, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %66) #8
  %539 = getelementptr inbounds [256 x i32], ptr %53, i64 0, i64 0
  %540 = load i64, ptr %54, align 8, !tbaa !9
  %541 = load ptr, ptr %18, align 8, !tbaa !5
  %542 = load ptr, ptr %35, align 8, !tbaa !5
  %543 = load ptr, ptr %32, align 8, !tbaa !5
  %544 = load float, ptr %42, align 4, !tbaa !11
  %545 = load float, ptr %43, align 4, !tbaa !11
  %546 = load float, ptr %44, align 4, !tbaa !11
  %547 = invoke noundef i32 @_ZN7meshoptL18selectSeedTriangleEPKjmS1_PKNS_4ConeES1_fff(ptr noundef %539, i64 noundef %540, ptr noundef %541, ptr noundef %542, ptr noundef %543, float noundef %544, float noundef %545, float noundef %546)
          to label %548 unwind label %561

548:                                              ; preds = %536
  store i32 %547, ptr %66, align 4, !tbaa !15
  %549 = load i32, ptr %66, align 4, !tbaa !15
  %550 = icmp ne i32 %549, -1
  br i1 %550, label %551, label %553

551:                                              ; preds = %548
  %552 = load i32, ptr %66, align 4, !tbaa !15
  br label %555

553:                                              ; preds = %548
  %554 = load i32, ptr %59, align 4, !tbaa !15
  br label %555

555:                                              ; preds = %553, %551
  %556 = phi i32 [ %552, %551 ], [ %554, %553 ]
  store i32 %556, ptr %59, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 4, ptr %66) #8
  br label %565

557:                                              ; preds = %523, %511
  %558 = landingpad { ptr, i32 }
          cleanup
  %559 = extractvalue { ptr, i32 } %558, 0
  store ptr %559, ptr %30, align 8
  %560 = extractvalue { ptr, i32 } %558, 1
  store i32 %560, ptr %31, align 4
  br label %774

561:                                              ; preds = %536
  %562 = landingpad { ptr, i32 }
          cleanup
  %563 = extractvalue { ptr, i32 } %562, 0
  store ptr %563, ptr %30, align 8
  %564 = extractvalue { ptr, i32 } %562, 1
  store i32 %564, ptr %31, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %66) #8
  br label %774

565:                                              ; preds = %555, %505
  call void @llvm.lifetime.start.p0(i64 4, ptr %67) #8
  %566 = load ptr, ptr %18, align 8, !tbaa !5
  %567 = load i32, ptr %59, align 4, !tbaa !15
  %568 = mul i32 %567, 3
  %569 = add i32 %568, 0
  %570 = zext i32 %569 to i64
  %571 = getelementptr inbounds i32, ptr %566, i64 %570
  %572 = load i32, ptr %571, align 4, !tbaa !15
  store i32 %572, ptr %67, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %68) #8
  %573 = load ptr, ptr %18, align 8, !tbaa !5
  %574 = load i32, ptr %59, align 4, !tbaa !15
  %575 = mul i32 %574, 3
  %576 = add i32 %575, 1
  %577 = zext i32 %576 to i64
  %578 = getelementptr inbounds i32, ptr %573, i64 %577
  %579 = load i32, ptr %578, align 4, !tbaa !15
  store i32 %579, ptr %68, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %69) #8
  %580 = load ptr, ptr %18, align 8, !tbaa !5
  %581 = load i32, ptr %59, align 4, !tbaa !15
  %582 = mul i32 %581, 3
  %583 = add i32 %582, 2
  %584 = zext i32 %583 to i64
  %585 = getelementptr inbounds i32, ptr %580, i64 %584
  %586 = load i32, ptr %585, align 4, !tbaa !15
  store i32 %586, ptr %69, align 4, !tbaa !15
  %587 = load i32, ptr %67, align 4, !tbaa !15
  %588 = zext i32 %587 to i64
  %589 = load i64, ptr %21, align 8, !tbaa !9
  %590 = icmp ult i64 %588, %589
  br i1 %590, label %591, label %601

591:                                              ; preds = %565
  %592 = load i32, ptr %68, align 4, !tbaa !15
  %593 = zext i32 %592 to i64
  %594 = load i64, ptr %21, align 8, !tbaa !9
  %595 = icmp ult i64 %593, %594
  br i1 %595, label %596, label %601

596:                                              ; preds = %591
  %597 = load i32, ptr %69, align 4, !tbaa !15
  %598 = zext i32 %597 to i64
  %599 = load i64, ptr %21, align 8, !tbaa !9
  %600 = icmp ult i64 %598, %599
  br label %601

601:                                              ; preds = %596, %591, %565
  %602 = phi i1 [ false, %591 ], [ false, %565 ], [ %600, %596 ]
  br i1 %602, label %603, label %604

603:                                              ; preds = %601
  br label %606

604:                                              ; preds = %601
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.1, i32 noundef 1201, ptr noundef @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

605:                                              ; No predecessors!
  br label %606

606:                                              ; preds = %605, %603
  %607 = load i32, ptr %67, align 4, !tbaa !15
  %608 = load i32, ptr %68, align 4, !tbaa !15
  %609 = load i32, ptr %69, align 4, !tbaa !15
  %610 = load ptr, ptr %47, align 8, !tbaa !5
  %611 = load ptr, ptr %15, align 8, !tbaa !5
  %612 = load ptr, ptr %16, align 8, !tbaa !5
  %613 = load ptr, ptr %17, align 8, !tbaa !5
  %614 = load i64, ptr %56, align 8, !tbaa !9
  %615 = load i64, ptr %23, align 8, !tbaa !9
  %616 = load i64, ptr %25, align 8, !tbaa !9
  %617 = load i8, ptr %60, align 1, !tbaa !27, !range !31, !noundef !32
  %618 = trunc i8 %617 to i1
  %619 = invoke noundef zeroext i1 @_ZN7meshoptL13appendMeshletER15meshopt_MeshletjjjPsPS0_PjPhmmmb(ptr noundef nonnull align 4 dereferenceable(16) %55, i32 noundef %607, i32 noundef %608, i32 noundef %609, ptr noundef %610, ptr noundef %611, ptr noundef %612, ptr noundef %613, i64 noundef %614, i64 noundef %615, i64 noundef %616, i1 noundef zeroext %618)
          to label %620 unwind label %624

620:                                              ; preds = %606
  br i1 %619, label %621, label %628

621:                                              ; preds = %620
  %622 = load i64, ptr %56, align 8, !tbaa !9
  %623 = add i64 %622, 1
  store i64 %623, ptr %56, align 8, !tbaa !9
  call void @llvm.memset.p0.i64(ptr align 4 %57, i8 0, i64 24, i1 false)
  br label %628

624:                                              ; preds = %606
  %625 = landingpad { ptr, i32 }
          cleanup
  %626 = extractvalue { ptr, i32 } %625, 0
  store ptr %626, ptr %30, align 8
  %627 = extractvalue { ptr, i32 } %625, 1
  store i32 %627, ptr %31, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %69) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %68) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %67) #8
  br label %774

628:                                              ; preds = %621, %620
  call void @llvm.lifetime.start.p0(i64 8, ptr %70) #8
  store i64 0, ptr %70, align 8, !tbaa !9
  br label %629

629:                                              ; preds = %698, %628
  %630 = load i64, ptr %70, align 8, !tbaa !9
  %631 = icmp ult i64 %630, 3
  br i1 %631, label %633, label %632

632:                                              ; preds = %629
  store i32 13, ptr %64, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %70) #8
  br label %701

633:                                              ; preds = %629
  call void @llvm.lifetime.start.p0(i64 4, ptr %71) #8
  %634 = load ptr, ptr %18, align 8, !tbaa !5
  %635 = load i32, ptr %59, align 4, !tbaa !15
  %636 = mul i32 %635, 3
  %637 = zext i32 %636 to i64
  %638 = load i64, ptr %70, align 8, !tbaa !9
  %639 = add i64 %637, %638
  %640 = getelementptr inbounds i32, ptr %634, i64 %639
  %641 = load i32, ptr %640, align 4, !tbaa !15
  store i32 %641, ptr %71, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %72) #8
  %642 = getelementptr inbounds %"struct.meshopt::TriangleAdjacency2", ptr %29, i32 0, i32 2
  %643 = load ptr, ptr %642, align 8, !tbaa !34
  %644 = getelementptr inbounds i32, ptr %643, i64 0
  %645 = getelementptr inbounds %"struct.meshopt::TriangleAdjacency2", ptr %29, i32 0, i32 1
  %646 = load ptr, ptr %645, align 8, !tbaa !35
  %647 = load i32, ptr %71, align 4, !tbaa !15
  %648 = zext i32 %647 to i64
  %649 = getelementptr inbounds i32, ptr %646, i64 %648
  %650 = load i32, ptr %649, align 4, !tbaa !15
  %651 = zext i32 %650 to i64
  %652 = getelementptr inbounds i32, ptr %644, i64 %651
  store ptr %652, ptr %72, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %73) #8
  %653 = getelementptr inbounds %"struct.meshopt::TriangleAdjacency2", ptr %29, i32 0, i32 0
  %654 = load ptr, ptr %653, align 8, !tbaa !13
  %655 = load i32, ptr %71, align 4, !tbaa !15
  %656 = zext i32 %655 to i64
  %657 = getelementptr inbounds i32, ptr %654, i64 %656
  %658 = load i32, ptr %657, align 4, !tbaa !15
  %659 = zext i32 %658 to i64
  store i64 %659, ptr %73, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %74) #8
  store i64 0, ptr %74, align 8, !tbaa !9
  br label %660

660:                                              ; preds = %693, %633
  %661 = load i64, ptr %74, align 8, !tbaa !9
  %662 = load i64, ptr %73, align 8, !tbaa !9
  %663 = icmp ult i64 %661, %662
  br i1 %663, label %665, label %664

664:                                              ; preds = %660
  store i32 16, ptr %64, align 4
  br label %696

665:                                              ; preds = %660
  call void @llvm.lifetime.start.p0(i64 4, ptr %75) #8
  %666 = load ptr, ptr %72, align 8, !tbaa !5
  %667 = load i64, ptr %74, align 8, !tbaa !9
  %668 = getelementptr inbounds i32, ptr %666, i64 %667
  %669 = load i32, ptr %668, align 4, !tbaa !15
  store i32 %669, ptr %75, align 4, !tbaa !15
  %670 = load i32, ptr %75, align 4, !tbaa !15
  %671 = load i32, ptr %59, align 4, !tbaa !15
  %672 = icmp eq i32 %670, %671
  br i1 %672, label %673, label %689

673:                                              ; preds = %665
  %674 = load ptr, ptr %72, align 8, !tbaa !5
  %675 = load i64, ptr %73, align 8, !tbaa !9
  %676 = sub i64 %675, 1
  %677 = getelementptr inbounds i32, ptr %674, i64 %676
  %678 = load i32, ptr %677, align 4, !tbaa !15
  %679 = load ptr, ptr %72, align 8, !tbaa !5
  %680 = load i64, ptr %74, align 8, !tbaa !9
  %681 = getelementptr inbounds i32, ptr %679, i64 %680
  store i32 %678, ptr %681, align 4, !tbaa !15
  %682 = getelementptr inbounds %"struct.meshopt::TriangleAdjacency2", ptr %29, i32 0, i32 0
  %683 = load ptr, ptr %682, align 8, !tbaa !13
  %684 = load i32, ptr %71, align 4, !tbaa !15
  %685 = zext i32 %684 to i64
  %686 = getelementptr inbounds i32, ptr %683, i64 %685
  %687 = load i32, ptr %686, align 4, !tbaa !15
  %688 = add i32 %687, -1
  store i32 %688, ptr %686, align 4, !tbaa !15
  store i32 16, ptr %64, align 4
  br label %690

689:                                              ; preds = %665
  store i32 0, ptr %64, align 4
  br label %690

690:                                              ; preds = %689, %673
  call void @llvm.lifetime.end.p0(i64 4, ptr %75) #8
  %691 = load i32, ptr %64, align 4
  switch i32 %691, label %696 [
    i32 0, label %692
  ]

692:                                              ; preds = %690
  br label %693

693:                                              ; preds = %692
  %694 = load i64, ptr %74, align 8, !tbaa !9
  %695 = add i64 %694, 1
  store i64 %695, ptr %74, align 8, !tbaa !9
  br label %660, !llvm.loop !36

696:                                              ; preds = %690, %664
  call void @llvm.lifetime.end.p0(i64 8, ptr %74) #8
  br label %697

697:                                              ; preds = %696
  call void @llvm.lifetime.end.p0(i64 8, ptr %73) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %72) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %71) #8
  br label %698

698:                                              ; preds = %697
  %699 = load i64, ptr %70, align 8, !tbaa !9
  %700 = add i64 %699, 1
  store i64 %700, ptr %70, align 8, !tbaa !9
  br label %629, !llvm.loop !37

701:                                              ; preds = %632
  %702 = load ptr, ptr %35, align 8, !tbaa !5
  %703 = load i32, ptr %59, align 4, !tbaa !15
  %704 = zext i32 %703 to i64
  %705 = getelementptr inbounds %"struct.meshopt::Cone", ptr %702, i64 %704
  %706 = getelementptr inbounds %"struct.meshopt::Cone", ptr %705, i32 0, i32 0
  %707 = load float, ptr %706, align 4, !tbaa !19
  %708 = getelementptr inbounds %"struct.meshopt::Cone", ptr %57, i32 0, i32 0
  %709 = load float, ptr %708, align 4, !tbaa !19
  %710 = fadd float %709, %707
  store float %710, ptr %708, align 4, !tbaa !19
  %711 = load ptr, ptr %35, align 8, !tbaa !5
  %712 = load i32, ptr %59, align 4, !tbaa !15
  %713 = zext i32 %712 to i64
  %714 = getelementptr inbounds %"struct.meshopt::Cone", ptr %711, i64 %713
  %715 = getelementptr inbounds %"struct.meshopt::Cone", ptr %714, i32 0, i32 1
  %716 = load float, ptr %715, align 4, !tbaa !21
  %717 = getelementptr inbounds %"struct.meshopt::Cone", ptr %57, i32 0, i32 1
  %718 = load float, ptr %717, align 4, !tbaa !21
  %719 = fadd float %718, %716
  store float %719, ptr %717, align 4, !tbaa !21
  %720 = load ptr, ptr %35, align 8, !tbaa !5
  %721 = load i32, ptr %59, align 4, !tbaa !15
  %722 = zext i32 %721 to i64
  %723 = getelementptr inbounds %"struct.meshopt::Cone", ptr %720, i64 %722
  %724 = getelementptr inbounds %"struct.meshopt::Cone", ptr %723, i32 0, i32 2
  %725 = load float, ptr %724, align 4, !tbaa !22
  %726 = getelementptr inbounds %"struct.meshopt::Cone", ptr %57, i32 0, i32 2
  %727 = load float, ptr %726, align 4, !tbaa !22
  %728 = fadd float %727, %725
  store float %728, ptr %726, align 4, !tbaa !22
  %729 = load ptr, ptr %35, align 8, !tbaa !5
  %730 = load i32, ptr %59, align 4, !tbaa !15
  %731 = zext i32 %730 to i64
  %732 = getelementptr inbounds %"struct.meshopt::Cone", ptr %729, i64 %731
  %733 = getelementptr inbounds %"struct.meshopt::Cone", ptr %732, i32 0, i32 3
  %734 = load float, ptr %733, align 4, !tbaa !38
  %735 = getelementptr inbounds %"struct.meshopt::Cone", ptr %57, i32 0, i32 3
  %736 = load float, ptr %735, align 4, !tbaa !38
  %737 = fadd float %736, %734
  store float %737, ptr %735, align 4, !tbaa !38
  %738 = load ptr, ptr %35, align 8, !tbaa !5
  %739 = load i32, ptr %59, align 4, !tbaa !15
  %740 = zext i32 %739 to i64
  %741 = getelementptr inbounds %"struct.meshopt::Cone", ptr %738, i64 %740
  %742 = getelementptr inbounds %"struct.meshopt::Cone", ptr %741, i32 0, i32 4
  %743 = load float, ptr %742, align 4, !tbaa !39
  %744 = getelementptr inbounds %"struct.meshopt::Cone", ptr %57, i32 0, i32 4
  %745 = load float, ptr %744, align 4, !tbaa !39
  %746 = fadd float %745, %743
  store float %746, ptr %744, align 4, !tbaa !39
  %747 = load ptr, ptr %35, align 8, !tbaa !5
  %748 = load i32, ptr %59, align 4, !tbaa !15
  %749 = zext i32 %748 to i64
  %750 = getelementptr inbounds %"struct.meshopt::Cone", ptr %747, i64 %749
  %751 = getelementptr inbounds %"struct.meshopt::Cone", ptr %750, i32 0, i32 5
  %752 = load float, ptr %751, align 4, !tbaa !40
  %753 = getelementptr inbounds %"struct.meshopt::Cone", ptr %57, i32 0, i32 5
  %754 = load float, ptr %753, align 4, !tbaa !40
  %755 = fadd float %754, %752
  store float %755, ptr %753, align 4, !tbaa !40
  %756 = load ptr, ptr %34, align 8, !tbaa !5
  %757 = load i32, ptr %59, align 4, !tbaa !15
  %758 = zext i32 %757 to i64
  %759 = getelementptr inbounds i8, ptr %756, i64 %758
  %760 = load i8, ptr %759, align 1, !tbaa !41
  %761 = icmp ne i8 %760, 0
  %762 = xor i1 %761, true
  br i1 %762, label %763, label %764

763:                                              ; preds = %701
  br label %766

764:                                              ; preds = %701
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.1, i32 noundef 1241, ptr noundef @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

765:                                              ; No predecessors!
  br label %766

766:                                              ; preds = %765, %763
  %767 = load ptr, ptr %34, align 8, !tbaa !5
  %768 = load i32, ptr %59, align 4, !tbaa !15
  %769 = zext i32 %768 to i64
  %770 = getelementptr inbounds i8, ptr %767, i64 %769
  store i8 1, ptr %770, align 1, !tbaa !41
  call void @llvm.lifetime.end.p0(i64 4, ptr %69) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %68) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %67) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %65) #8
  store i32 0, ptr %64, align 4
  br label %771

771:                                              ; preds = %766, %449
  call void @llvm.lifetime.end.p0(i64 1, ptr %60) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %59) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %58) #8
  %772 = load i32, ptr %64, align 4
  switch i32 %772, label %821 [
    i32 0, label %773
    i32 11, label %778
  ]

773:                                              ; preds = %771
  br label %373, !llvm.loop !42

774:                                              ; preds = %624, %561, %557
  call void @llvm.lifetime.end.p0(i64 4, ptr %65) #8
  br label %775

775:                                              ; preds = %774, %442
  call void @llvm.lifetime.end.p0(i64 1, ptr %60) #8
  br label %776

776:                                              ; preds = %775, %399
  call void @llvm.lifetime.end.p0(i64 4, ptr %59) #8
  br label %777

777:                                              ; preds = %776, %385
  call void @llvm.lifetime.end.p0(i64 24, ptr %58) #8
  br label %805

778:                                              ; preds = %771
  %779 = getelementptr inbounds %struct.meshopt_Meshlet, ptr %55, i32 0, i32 3
  %780 = load i32, ptr %779, align 4, !tbaa !25
  %781 = icmp ne i32 %780, 0
  br i1 %781, label %782, label %793

782:                                              ; preds = %778
  %783 = load ptr, ptr %17, align 8, !tbaa !5
  invoke void @_ZN7meshoptL13finishMeshletER15meshopt_MeshletPh(ptr noundef nonnull align 4 dereferenceable(16) %55, ptr noundef %783)
          to label %784 unwind label %789

784:                                              ; preds = %782
  %785 = load ptr, ptr %15, align 8, !tbaa !5
  %786 = load i64, ptr %56, align 8, !tbaa !9
  %787 = add i64 %786, 1
  store i64 %787, ptr %56, align 8, !tbaa !9
  %788 = getelementptr inbounds %struct.meshopt_Meshlet, ptr %785, i64 %786
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %788, ptr align 4 %55, i64 16, i1 false), !tbaa.struct !43
  br label %793

789:                                              ; preds = %782
  %790 = landingpad { ptr, i32 }
          cleanup
  %791 = extractvalue { ptr, i32 } %790, 0
  store ptr %791, ptr %30, align 8
  %792 = extractvalue { ptr, i32 } %790, 1
  store i32 %792, ptr %31, align 4
  br label %805

793:                                              ; preds = %784, %778
  %794 = load i64, ptr %56, align 8, !tbaa !9
  %795 = load i64, ptr %19, align 8, !tbaa !9
  %796 = load i64, ptr %23, align 8, !tbaa !9
  %797 = load i64, ptr %24, align 8, !tbaa !9
  %798 = call i64 @meshopt_buildMeshletsBound(i64 noundef %795, i64 noundef %796, i64 noundef %797)
  %799 = icmp ule i64 %794, %798
  br i1 %799, label %800, label %801

800:                                              ; preds = %793
  br label %803

801:                                              ; preds = %793
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.1, i32 noundef 1252, ptr noundef @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

802:                                              ; No predecessors!
  br label %803

803:                                              ; preds = %802, %800
  %804 = load i64, ptr %56, align 8, !tbaa !9
  store i64 %804, ptr %14, align 8
  store i32 1, ptr %64, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %57) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %56) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %55) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %54) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr %53) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %29) #8
  call void @_ZN17meshopt_AllocatorD2Ev(ptr noundef nonnull align 8 dereferenceable(200) %28) #8
  call void @llvm.lifetime.end.p0(i64 200, ptr %28) #8
  br label %814

805:                                              ; preds = %789, %777
  call void @llvm.lifetime.end.p0(i64 24, ptr %57) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %56) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %55) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %54) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr %53) #8
  br label %806

806:                                              ; preds = %805, %364
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #8
  br label %807

807:                                              ; preds = %806, %329
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #8
  br label %808

808:                                              ; preds = %807, %267
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #8
  br label %809

809:                                              ; preds = %808, %234
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #8
  br label %810

810:                                              ; preds = %809, %230
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  br label %811

811:                                              ; preds = %810, %226
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  br label %812

812:                                              ; preds = %811, %222
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  br label %813

813:                                              ; preds = %812, %167
  call void @llvm.lifetime.end.p0(i64 24, ptr %29) #8
  call void @_ZN17meshopt_AllocatorD2Ev(ptr noundef nonnull align 8 dereferenceable(200) %28) #8
  call void @llvm.lifetime.end.p0(i64 200, ptr %28) #8
  br label %816

814:                                              ; preds = %803, %154
  %815 = load i64, ptr %14, align 8
  ret i64 %815

816:                                              ; preds = %813
  %817 = load ptr, ptr %30, align 8
  %818 = load i32, ptr %31, align 4
  %819 = insertvalue { ptr, i32 } poison, ptr %817, 0
  %820 = insertvalue { ptr, i32 } %819, i32 %818, 1
  resume { ptr, i32 } %820

821:                                              ; preds = %771
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN17meshopt_AllocatorC2Ev(ptr noundef nonnull align 8 dereferenceable(200)) unnamed_addr #0 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN7meshoptL28buildTriangleAdjacencySparseERNS_18TriangleAdjacency2EPKjmmR17meshopt_Allocator(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(200)) #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN7meshoptL22buildTriangleAdjacencyERNS_18TriangleAdjacency2EPKjmmR17meshopt_Allocator(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(200)) #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef float @_ZN7meshoptL20computeTriangleConesEPNS_4ConeEPKjmPKfmm(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef) #0

; Function Attrs: nounwind
declare float @sqrtf(float noundef) #5

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

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i64 @_ZN7meshoptL11kdtreeBuildEmPNS_6KDNodeEmPKfmPjmm(i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef float @_ZN7meshoptL11getDistanceEfffb(float noundef, float noundef, float noundef, i1 noundef zeroext) #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN7meshoptL14getMeshletConeERKNS_4ConeEj(ptr dead_on_unwind noalias writable sret(%"struct.meshopt::Cone") align 4, ptr noundef nonnull align 4 dereferenceable(24), i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN7meshoptL19getNeighborTriangleERK15meshopt_MeshletRKNS_4ConeEPKjS7_RKNS_18TriangleAdjacency2EPS4_S7_PKsff(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(24), ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ptr noundef, ptr noundef, float noundef, float noundef) #3

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN7meshoptL13kdtreeNearestEPNS_6KDNodeEjPKfmPKhS3_bRjRf(ptr noundef, i32 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, i1 noundef zeroext, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN7meshoptL18pruneSeedTrianglesEPjmPKh(ptr noundef, i64 noundef, ptr noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN7meshoptL19appendSeedTrianglesEPjRK15meshopt_MeshletPKjS5_RKNS_18TriangleAdjacency2EPKNS_4ConeES5_fff(ptr noundef, ptr noundef nonnull align 4 dereferenceable(16), ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ptr noundef, float noundef, float noundef, float noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN7meshoptL18selectSeedTriangleEPKjmS1_PKNS_4ConeES1_fff(ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, float noundef, float noundef, float noundef) #0

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN7meshoptL13appendMeshletER15meshopt_MeshletjjjPsPS0_PjPhmmmb(ptr noundef nonnull align 4 dereferenceable(16), i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, i1 noundef zeroext) #3

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN7meshoptL13finishMeshletER15meshopt_MeshletPh(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef) #0

; 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) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN17meshopt_AllocatorD2Ev(ptr noundef nonnull align 8 dereferenceable(200)) unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { noreturn nounwind "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { noreturn nounwind }
attributes #8 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSN7meshopt18TriangleAdjacency2E", !6, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!20, !12, i64 0}
!20 = !{!"_ZTSN7meshopt4ConeE", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20}
!21 = !{!20, !12, i64 4}
!22 = !{!20, !12, i64 8}
!23 = distinct !{!23, !18}
!24 = distinct !{!24, !18}
!25 = !{!26, !16, i64 12}
!26 = !{!"_ZTS15meshopt_Meshlet", !16, i64 0, !16, i64 4, !16, i64 8, !16, i64 12}
!27 = !{!28, !28, i64 0}
!28 = !{!"bool", !7, i64 0}
!29 = !{!30, !30, i64 0}
!30 = !{!"short", !7, i64 0}
!31 = !{i8 0, i8 2}
!32 = !{}
!33 = !{!26, !16, i64 8}
!34 = !{!14, !6, i64 16}
!35 = !{!14, !6, i64 8}
!36 = distinct !{!36, !18}
!37 = distinct !{!37, !18}
!38 = !{!20, !12, i64 12}
!39 = !{!20, !12, i64 16}
!40 = !{!20, !12, i64 20}
!41 = !{!7, !7, i64 0}
!42 = distinct !{!42, !18}
!43 = !{i64 0, i64 4, !15, i64 4, i64 4, !15, i64 8, i64 4, !15, i64 12, i64 4, !15}


; 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.meshopt_Allocator = type { [24 x ptr], i64 }
%"struct.meshopt::TriangleAdjacency2" = type { ptr, ptr, ptr }
%struct.meshopt_Meshlet = type { i32, i32, i32, i32 }
%"struct.meshopt::Cone" = type { float, float, float, float, float, float }

@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [57 x i8], align 1
@__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex = external hidden unnamed_addr constant [184 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [87 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i64 @meshopt_buildMeshletsBound(i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local i64 @meshopt_buildMeshletsFlex(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, i64 noundef %6, i64 noundef %7, i64 noundef %8, i64 noundef %9, i64 noundef %10, float noundef %11, float noundef %12) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %14 = alloca %class.meshopt_Allocator, align 8
  %15 = alloca %"struct.meshopt::TriangleAdjacency2", align 8
  %16 = alloca [256 x i32], align 16
  %17 = alloca %struct.meshopt_Meshlet, align 4
  %18 = alloca %"struct.meshopt::Cone", align 16
  %19 = alloca %"struct.meshopt::Cone", align 8
  %20 = alloca [3 x float], align 8
  %21 = alloca i32, align 4
  %22 = alloca float, align 4
  %23 = urem i64 %4, 3
  %24 = udiv i64 %4, 3
  %25 = icmp eq i64 %23, 0
  br i1 %25, label %27, label %26

26:                                               ; preds = %13
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 1066, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

27:                                               ; preds = %13
  %28 = add i64 %7, -12
  %29 = icmp ult i64 %28, 245
  br i1 %29, label %31, label %30

30:                                               ; preds = %27
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 1067, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

31:                                               ; preds = %27
  %32 = and i64 %7, 3
  %33 = icmp eq i64 %32, 0
  br i1 %33, label %35, label %34

34:                                               ; preds = %31
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 1068, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

35:                                               ; preds = %31
  %36 = add i64 %8, -3
  %37 = icmp ult i64 %36, 254
  br i1 %37, label %39, label %38

38:                                               ; preds = %35
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 1070, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

39:                                               ; preds = %35
  %.not = icmp eq i64 %9, 0
  br i1 %.not, label %.critedge, label %40

40:                                               ; preds = %39
  %41 = icmp ule i64 %9, %10
  %42 = icmp ult i64 %10, 513
  %or.cond10 = and i1 %41, %42
  br i1 %or.cond10, label %43, label %.critedge

.critedge:                                        ; preds = %40, %39
  tail call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 1071, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

43:                                               ; preds = %40
  %44 = or i64 %10, %9
  %45 = and i64 %44, 3
  %46 = icmp eq i64 %45, 0
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  tail call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 1072, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

48:                                               ; preds = %43
  %49 = fcmp ugt float %11, 1.000000e+00
  br i1 %49, label %50, label %51

50:                                               ; preds = %48
  tail call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 1074, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

51:                                               ; preds = %48
  %52 = fcmp ult float %12, 0.000000e+00
  br i1 %52, label %53, label %54

53:                                               ; preds = %51
  tail call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, i32 noundef 1075, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

54:                                               ; preds = %51
  %55 = icmp eq i64 %4, 0
  br i1 %55, label %327, label %56

56:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %14) #8
  call void @_ZN17meshopt_AllocatorC2Ev(ptr noundef nonnull align 8 dereferenceable(200) %14)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %15) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %15, i8 0, i64 24, i1 false)
  %57 = icmp ugt i64 %6, %4
  %58 = icmp ult i64 %4, 2147483648
  %or.cond = and i1 %58, %57
  br i1 %or.cond, label %59, label %62

59:                                               ; preds = %56
  invoke void @_ZN7meshoptL28buildTriangleAdjacencySparseERNS_18TriangleAdjacency2EPKjmmR17meshopt_Allocator(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef %3, i64 noundef %4, i64 noundef %6, ptr noundef nonnull align 8 dereferenceable(200) %14)
          to label %63 unwind label %60

60:                                               ; preds = %62, %59
  %61 = landingpad { ptr, i32 }
          cleanup
  br label %326

62:                                               ; preds = %56
  invoke void @_ZN7meshoptL22buildTriangleAdjacencyERNS_18TriangleAdjacency2EPKjmmR17meshopt_Allocator(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef %3, i64 noundef %4, i64 noundef %6, ptr noundef nonnull align 8 dereferenceable(200) %14)
          to label %63 unwind label %60

63:                                               ; preds = %62, %59
  %64 = load ptr, ptr %15, align 8, !tbaa !5
  %65 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIhEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %14, i64 noundef %24)
          to label %66 unwind label %85

66:                                               ; preds = %63
  call void @llvm.memset.p0.i64(ptr align 1 %65, i8 0, i64 %24, i1 false)
  %67 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIN7meshopt4ConeEEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %14, i64 noundef %24)
          to label %68 unwind label %87

68:                                               ; preds = %66
  %69 = call noundef float @_ZN7meshoptL20computeTriangleConesEPNS_4ConeEPKjmPKfmm(ptr noundef %67, ptr noundef %3, i64 noundef %4, ptr noundef %5, i64 noundef %6, i64 noundef %7)
  %70 = icmp ult i64 %4, 3
  %71 = uitofp nneg i64 %24 to float
  %72 = fdiv float %69, %71
  %73 = fmul float %72, 5.000000e-01
  %74 = select i1 %70, float 0.000000e+00, float %73
  %75 = uitofp nneg i64 %10 to float
  %76 = fmul float %74, %75
  %77 = call float @sqrtf(float noundef %76) #8
  %78 = fmul float %77, 5.000000e-01
  %79 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIjEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %14, i64 noundef %24)
          to label %.preheader318 unwind label %89

.preheader318:                                    ; preds = %68
  br i1 %70, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader318
  %min.iters.check = icmp ult i64 %4, 24
  br i1 %min.iters.check, label %.lr.ph.preheader414, label %vector.ph

.lr.ph.preheader414:                              ; preds = %middle.block, %.lr.ph.preheader
  %.0235330.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %24, 9223372036854775800
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %80 = getelementptr inbounds i32, ptr %79, i64 %index
  %81 = getelementptr inbounds i8, ptr %80, i64 16
  store <4 x i32> %vec.ind, ptr %80, align 4, !tbaa !10
  store <4 x i32> %step.add, ptr %81, align 4, !tbaa !10
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %82 = icmp eq i64 %index.next, %n.vec
  br i1 %82, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %24, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader414

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %.preheader318
  %83 = shl nuw i64 %24, 1
  %84 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIN7meshopt6KDNodeEEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %14, i64 noundef %83)
          to label %94 unwind label %107

85:                                               ; preds = %63
  %86 = landingpad { ptr, i32 }
          cleanup
  br label %326

87:                                               ; preds = %66
  %88 = landingpad { ptr, i32 }
          cleanup
  br label %326

89:                                               ; preds = %68
  %90 = landingpad { ptr, i32 }
          cleanup
  br label %326

.lr.ph:                                           ; preds = %.lr.ph.preheader414, %.lr.ph
  %.0235330 = phi i64 [ %93, %.lr.ph ], [ %.0235330.ph, %.lr.ph.preheader414 ]
  %91 = trunc i64 %.0235330 to i32
  %92 = getelementptr inbounds i32, ptr %79, i64 %.0235330
  store i32 %91, ptr %92, align 4, !tbaa !10
  %93 = add nuw nsw i64 %.0235330, 1
  %exitcond.not = icmp eq i64 %93, %24
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !16

94:                                               ; preds = %._crit_edge
  %95 = invoke noundef i64 @_ZN7meshoptL11kdtreeBuildEmPNS_6KDNodeEmPKfmPjmm(i64 noundef 0, ptr noundef %84, i64 noundef %83, ptr noundef %67, i64 noundef 6, ptr noundef %79, i64 noundef %24, i64 noundef 8)
          to label %.preheader unwind label %107

.preheader:                                       ; preds = %94
  br i1 %70, label %._crit_edge336, label %.lr.ph335.preheader

.lr.ph335.preheader:                              ; preds = %.preheader
  %xtraiter = and i64 %24, 1
  %.off = add i64 %4, -3
  %96 = icmp ult i64 %.off, 3
  br i1 %96, label %._crit_edge336.loopexit.unr-lcssa, label %.lr.ph335.preheader.new

.lr.ph335.preheader.new:                          ; preds = %.lr.ph335.preheader
  %unroll_iter = and i64 %24, 9223372036854775806
  br label %.lr.ph335

._crit_edge336.loopexit.unr-lcssa:                ; preds = %.lr.ph335, %.lr.ph335.preheader
  %.lcssa413.ph = phi <2 x float> [ poison, %.lr.ph335.preheader ], [ %122, %.lr.ph335 ]
  %.lcssa412.ph = phi float [ poison, %.lr.ph335.preheader ], [ %126, %.lr.ph335 ]
  %.0239332.unr = phi float [ 0x47EFFFFFE0000000, %.lr.ph335.preheader ], [ %126, %.lr.ph335 ]
  %.0240331.unr = phi i64 [ 0, %.lr.ph335.preheader ], [ %127, %.lr.ph335 ]
  %.unr = phi <2 x float> [ <float 0x47EFFFFFE0000000, float 0x47EFFFFFE0000000>, %.lr.ph335.preheader ], [ %122, %.lr.ph335 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge336, label %.lr.ph335.epil

.lr.ph335.epil:                                   ; preds = %._crit_edge336.loopexit.unr-lcssa
  %97 = getelementptr inbounds %"struct.meshopt::Cone", ptr %67, i64 %.0240331.unr
  %98 = load <2 x float>, ptr %97, align 4, !tbaa !17
  %99 = fcmp ogt <2 x float> %.unr, %98
  %100 = select <2 x i1> %99, <2 x float> %98, <2 x float> %.unr
  %101 = getelementptr inbounds i8, ptr %97, i64 8
  %102 = load float, ptr %101, align 4, !tbaa !19
  %103 = fcmp ogt float %.0239332.unr, %102
  %104 = select i1 %103, float %102, float %.0239332.unr
  br label %._crit_edge336

._crit_edge336:                                   ; preds = %.lr.ph335.epil, %._crit_edge336.loopexit.unr-lcssa, %.preheader
  %.0239.lcssa = phi float [ 0x47EFFFFFE0000000, %.preheader ], [ %.lcssa412.ph, %._crit_edge336.loopexit.unr-lcssa ], [ %104, %.lr.ph335.epil ]
  %105 = phi <2 x float> [ <float 0x47EFFFFFE0000000, float 0x47EFFFFFE0000000>, %.preheader ], [ %.lcssa413.ph, %._crit_edge336.loopexit.unr-lcssa ], [ %100, %.lr.ph335.epil ]
  %106 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIsEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %14, i64 noundef %6)
          to label %128 unwind label %144

107:                                              ; preds = %94, %._crit_edge
  %108 = landingpad { ptr, i32 }
          cleanup
  br label %326

.lr.ph335:                                        ; preds = %.lr.ph335, %.lr.ph335.preheader.new
  %.0239332 = phi float [ 0x47EFFFFFE0000000, %.lr.ph335.preheader.new ], [ %126, %.lr.ph335 ]
  %.0240331 = phi i64 [ 0, %.lr.ph335.preheader.new ], [ %127, %.lr.ph335 ]
  %109 = phi <2 x float> [ <float 0x47EFFFFFE0000000, float 0x47EFFFFFE0000000>, %.lr.ph335.preheader.new ], [ %122, %.lr.ph335 ]
  %niter = phi i64 [ 0, %.lr.ph335.preheader.new ], [ %niter.next.1, %.lr.ph335 ]
  %110 = getelementptr inbounds %"struct.meshopt::Cone", ptr %67, i64 %.0240331
  %111 = load <2 x float>, ptr %110, align 4, !tbaa !17
  %112 = fcmp ogt <2 x float> %109, %111
  %113 = select <2 x i1> %112, <2 x float> %111, <2 x float> %109
  %114 = getelementptr inbounds i8, ptr %110, i64 8
  %115 = load float, ptr %114, align 4, !tbaa !19
  %116 = fcmp ogt float %.0239332, %115
  %117 = select i1 %116, float %115, float %.0239332
  %118 = or disjoint i64 %.0240331, 1
  %119 = getelementptr inbounds %"struct.meshopt::Cone", ptr %67, i64 %118
  %120 = load <2 x float>, ptr %119, align 4, !tbaa !17
  %121 = fcmp ogt <2 x float> %113, %120
  %122 = select <2 x i1> %121, <2 x float> %120, <2 x float> %113
  %123 = getelementptr inbounds i8, ptr %119, i64 8
  %124 = load float, ptr %123, align 4, !tbaa !19
  %125 = fcmp ogt float %117, %124
  %126 = select i1 %125, float %124, float %117
  %127 = add nuw nsw i64 %.0240331, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge336.loopexit.unr-lcssa, label %.lr.ph335, !llvm.loop !21

128:                                              ; preds = %._crit_edge336
  %129 = shl i64 %6, 1
  call void @llvm.memset.p0.i64(ptr align 2 %106, i8 -1, i64 %129, i1 false)
  br i1 %70, label %._crit_edge344, label %.lr.ph343.preheader

.lr.ph343.preheader:                              ; preds = %128
  %130 = extractelement <2 x float> %105, i64 0
  %131 = extractelement <2 x float> %105, i64 1
  br label %.lr.ph343

._crit_edge344:                                   ; preds = %.lr.ph343, %128
  %.0241.lcssa = phi i32 [ -1, %128 ], [ %.1242, %.lr.ph343 ]
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %16) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %16, i8 0, i64 1024, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %17) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %17, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %18) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %18, i8 0, i64 24, i1 false)
  %132 = getelementptr inbounds i8, ptr %17, i64 12
  %133 = getelementptr inbounds i8, ptr %20, i64 8
  %134 = getelementptr inbounds i8, ptr %19, i64 8
  %135 = fcmp olt float %11, 0.000000e+00
  %136 = fcmp ogt float %12, 0.000000e+00
  %137 = fmul float %78, %12
  %138 = getelementptr inbounds i8, ptr %17, i64 8
  %139 = getelementptr inbounds i8, ptr %15, i64 16
  %140 = getelementptr inbounds i8, ptr %15, i64 8
  %141 = getelementptr inbounds i8, ptr %18, i64 16
  %142 = extractelement <2 x float> %105, i64 0
  %143 = extractelement <2 x float> %105, i64 1
  br label %160

144:                                              ; preds = %._crit_edge336
  %145 = landingpad { ptr, i32 }
          cleanup
  br label %326

.lr.ph343:                                        ; preds = %.lr.ph343.preheader, %.lr.ph343
  %.0241341 = phi i32 [ %.1242, %.lr.ph343 ], [ -1, %.lr.ph343.preheader ]
  %.0256340 = phi float [ %.1257, %.lr.ph343 ], [ 0x47EFFFFFE0000000, %.lr.ph343.preheader ]
  %.0258339 = phi i64 [ %159, %.lr.ph343 ], [ 0, %.lr.ph343.preheader ]
  %146 = getelementptr inbounds %"struct.meshopt::Cone", ptr %67, i64 %.0258339
  %147 = load float, ptr %146, align 4, !tbaa !22
  %148 = fsub float %147, %130
  %149 = getelementptr inbounds i8, ptr %146, i64 4
  %150 = load float, ptr %149, align 4, !tbaa !23
  %151 = fsub float %150, %131
  %152 = getelementptr inbounds i8, ptr %146, i64 8
  %153 = load float, ptr %152, align 4, !tbaa !19
  %154 = fsub float %153, %.0239.lcssa
  %155 = call noundef float @_ZN7meshoptL11getDistanceEfffb(float noundef %148, float noundef %151, float noundef %154, i1 noundef zeroext false)
  %156 = icmp eq i32 %.0241341, -1
  %157 = fcmp olt float %155, %.0256340
  %or.cond291 = select i1 %156, i1 true, i1 %157
  %158 = trunc i64 %.0258339 to i32
  %.1257 = select i1 %or.cond291, float %155, float %.0256340
  %.1242 = select i1 %or.cond291, i32 %158, i32 %.0241341
  %159 = add nuw nsw i64 %.0258339, 1
  %exitcond362.not = icmp eq i64 %159, %24
  br i1 %exitcond362.not, label %._crit_edge344, label %.lr.ph343, !llvm.loop !24

160:                                              ; preds = %316, %._crit_edge344
  %161 = phi i32 [ 0, %._crit_edge344 ], [ %.pre, %316 ]
  %.0253 = phi i64 [ 0, %._crit_edge344 ], [ %.1254, %316 ]
  %.0249 = phi i64 [ 0, %._crit_edge344 ], [ %.1250, %316 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %19) #8
  call void @_ZN7meshoptL14getMeshletConeERKNS_4ConeEj(ptr dead_on_unwind nonnull writable sret(%"struct.meshopt::Cone") align 4 %19, ptr noundef nonnull align 4 dereferenceable(24) %18, i32 noundef %161)
  %162 = icmp eq i64 %.0249, 0
  %163 = load i32, ptr %132, align 4
  %164 = icmp eq i32 %163, 0
  %or.cond4 = select i1 %162, i1 %164, i1 false
  br i1 %or.cond4, label %169, label %165

165:                                              ; preds = %160
  %166 = invoke noundef i32 @_ZN7meshoptL19getNeighborTriangleERK15meshopt_MeshletRKNS_4ConeEPKjS7_RKNS_18TriangleAdjacency2EPS4_S7_PKsff(ptr noundef nonnull align 4 dereferenceable(16) %17, ptr noundef nonnull align 4 dereferenceable(24) %19, ptr noundef %1, ptr noundef %3, ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef %67, ptr noundef %64, ptr noundef %106, float noundef %78, float noundef %11)
          to label %169 unwind label %167

167:                                              ; preds = %165
  %168 = landingpad { ptr, i32 }
          cleanup
  br label %317

169:                                              ; preds = %165, %160
  %.0246 = phi i32 [ %.0241.lcssa, %160 ], [ %166, %165 ]
  %170 = icmp eq i32 %.0246, -1
  br i1 %170, label %171, label %..thread304_crit_edge

..thread304_crit_edge:                            ; preds = %169
  %.pre365 = load i32, ptr %132, align 4
  %.pre377 = zext i32 %.pre365 to i64
  br label %.thread304

171:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %20) #8
  %172 = load <2 x float>, ptr %19, align 8, !tbaa !17
  store <2 x float> %172, ptr %20, align 8, !tbaa !17
  %173 = load float, ptr %134, align 8, !tbaa !19
  store float %173, ptr %133, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %21) #8
  store i32 -1, ptr %21, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %22) #8
  store float 0x47EFFFFFE0000000, ptr %22, align 4, !tbaa !17
  invoke void @_ZN7meshoptL13kdtreeNearestEPNS_6KDNodeEjPKfmPKhS3_bRjRf(ptr noundef %84, i32 noundef 0, ptr noundef %67, i64 noundef 6, ptr noundef %65, ptr noundef nonnull %20, i1 noundef zeroext %135, ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %174 unwind label %179

174:                                              ; preds = %171
  %175 = load i32, ptr %21, align 4, !tbaa !10
  %176 = load i32, ptr %132, align 4
  %177 = zext i32 %176 to i64
  %178 = icmp uge i64 %177, %9
  %or.cond6 = and i1 %136, %178
  br i1 %or.cond6, label %181, label %.thread

179:                                              ; preds = %171
  %180 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %20) #8
  br label %317

181:                                              ; preds = %174
  %182 = load float, ptr %22, align 4, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %20) #8
  %183 = icmp eq i32 %175, -1
  br i1 %183, label %318, label %185

.thread:                                          ; preds = %174
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %20) #8
  %184 = icmp eq i32 %175, -1
  br i1 %184, label %318, label %.thread304

185:                                              ; preds = %181
  %186 = fcmp ogt float %182, %137
  br i1 %186, label %213, label %.thread304

.thread304:                                       ; preds = %.thread, %..thread304_crit_edge, %185
  %.pre-phi378 = phi i64 [ %.pre377, %..thread304_crit_edge ], [ %177, %185 ], [ %177, %.thread ]
  %.1247302310 = phi i32 [ %.0246, %..thread304_crit_edge ], [ %175, %185 ], [ %175, %.thread ]
  %187 = mul i32 %.1247302310, 3
  %188 = add i32 %187, 2
  %189 = zext i32 %188 to i64
  %190 = getelementptr inbounds i32, ptr %3, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !10
  %192 = zext i32 %191 to i64
  %193 = getelementptr inbounds i16, ptr %106, i64 %192
  %194 = load i16, ptr %193, align 2, !tbaa !25
  %.lobit275 = lshr i16 %194, 15
  %195 = zext i32 %187 to i64
  %196 = getelementptr inbounds i32, ptr %3, i64 %195
  %197 = load i32, ptr %196, align 4, !tbaa !10
  %198 = zext i32 %197 to i64
  %199 = getelementptr inbounds i16, ptr %106, i64 %198
  %200 = load i16, ptr %199, align 2, !tbaa !25
  %.lobit = lshr i16 %200, 15
  %201 = add i32 %187, 1
  %202 = zext i32 %201 to i64
  %203 = getelementptr inbounds i32, ptr %3, i64 %202
  %204 = load i32, ptr %203, align 4, !tbaa !10
  %205 = zext i32 %204 to i64
  %206 = getelementptr inbounds i16, ptr %106, i64 %205
  %207 = load i16, ptr %206, align 2, !tbaa !25
  %.lobit274 = lshr i16 %207, 15
  %narrow = add nuw nsw i16 %.lobit, %.lobit275
  %narrow276 = add nuw nsw i16 %narrow, %.lobit274
  %208 = zext nneg i16 %narrow276 to i32
  %209 = load i32, ptr %138, align 4, !tbaa !27
  %210 = add i32 %209, %208
  %211 = zext i32 %210 to i64
  %212 = icmp ule i64 %211, %8
  %.not277 = icmp ult i64 %.pre-phi378, %10
  %or.cond293 = select i1 %212, i1 %.not277, i1 false
  br i1 %or.cond293, label %223, label %213

213:                                              ; preds = %.thread304, %185
  %.1247302311 = phi i32 [ %.1247302310, %.thread304 ], [ %175, %185 ]
  %.0245303307 = phi i1 [ false, %.thread304 ], [ true, %185 ]
  %214 = call noundef i64 @_ZN7meshoptL18pruneSeedTrianglesEPjmPKh(ptr noundef nonnull %16, i64 noundef %.0253, ptr noundef %65)
  %215 = add i64 %214, 4
  %216 = icmp ult i64 %215, 257
  %217 = select i1 %216, i64 %214, i64 252
  %218 = getelementptr inbounds i32, ptr %16, i64 %217
  %219 = call noundef i64 @_ZN7meshoptL19appendSeedTrianglesEPjRK15meshopt_MeshletPKjS5_RKNS_18TriangleAdjacency2EPKNS_4ConeES5_fff(ptr noundef nonnull %218, ptr noundef nonnull align 4 dereferenceable(16) %17, ptr noundef %1, ptr noundef %3, ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef %67, ptr noundef %64, float noundef %142, float noundef %143, float noundef %.0239.lcssa)
  %220 = add i64 %217, %219
  %221 = call noundef i32 @_ZN7meshoptL18selectSeedTriangleEPKjmS1_PKNS_4ConeES1_fff(ptr noundef nonnull %16, i64 noundef %220, ptr noundef %3, ptr noundef %67, ptr noundef %64, float noundef %142, float noundef %143, float noundef %.0239.lcssa)
  %.not278 = icmp eq i32 %221, -1
  %222 = select i1 %.not278, i32 %.1247302311, i32 %221
  %.pre366 = mul i32 %222, 3
  %.pre367 = zext i32 %.pre366 to i64
  %.pre369 = add i32 %.pre366, 1
  %.pre371 = zext i32 %.pre369 to i64
  %.pre373 = add i32 %.pre366, 2
  %.pre375 = zext i32 %.pre373 to i64
  br label %223

223:                                              ; preds = %.thread304, %213
  %.pre-phi376 = phi i64 [ %189, %.thread304 ], [ %.pre375, %213 ]
  %.pre-phi372 = phi i64 [ %202, %.thread304 ], [ %.pre371, %213 ]
  %.pre-phi368 = phi i64 [ %195, %.thread304 ], [ %.pre367, %213 ]
  %.0245303308 = phi i1 [ false, %.thread304 ], [ %.0245303307, %213 ]
  %.1254 = phi i64 [ %.0253, %.thread304 ], [ %220, %213 ]
  %.2248 = phi i32 [ %.1247302310, %.thread304 ], [ %222, %213 ]
  %224 = getelementptr inbounds i32, ptr %3, i64 %.pre-phi368
  %225 = load i32, ptr %224, align 4, !tbaa !10
  %226 = getelementptr inbounds i32, ptr %3, i64 %.pre-phi372
  %227 = load i32, ptr %226, align 4, !tbaa !10
  %228 = getelementptr inbounds i32, ptr %3, i64 %.pre-phi376
  %229 = load i32, ptr %228, align 4, !tbaa !10
  %230 = zext i32 %225 to i64
  %231 = icmp ult i64 %230, %6
  %232 = zext i32 %227 to i64
  %233 = icmp ult i64 %232, %6
  %or.cond295 = select i1 %231, i1 %233, i1 false
  %234 = zext i32 %229 to i64
  %235 = icmp ult i64 %234, %6
  %or.cond297 = select i1 %or.cond295, i1 %235, i1 false
  br i1 %or.cond297, label %236, label %.critedge8

.critedge8:                                       ; preds = %223
  call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.1, i32 noundef 1201, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

236:                                              ; preds = %223
  %237 = invoke noundef zeroext i1 @_ZN7meshoptL13appendMeshletER15meshopt_MeshletjjjPsPS0_PjPhmmmb(ptr noundef nonnull align 4 dereferenceable(16) %17, i32 noundef %225, i32 noundef %227, i32 noundef %229, ptr noundef %106, ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %.0249, i64 noundef %8, i64 noundef %10, i1 noundef zeroext %.0245303308)
          to label %238 unwind label %241

238:                                              ; preds = %236
  br i1 %237, label %239, label %243

239:                                              ; preds = %238
  %240 = add i64 %.0249, 1
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %18, i8 0, i64 24, i1 false)
  br label %243

241:                                              ; preds = %236
  %242 = landingpad { ptr, i32 }
          cleanup
  br label %317

243:                                              ; preds = %239, %238
  %.1250 = phi i64 [ %240, %239 ], [ %.0249, %238 ]
  %244 = load ptr, ptr %139, align 8, !tbaa !29
  %245 = load ptr, ptr %140, align 8, !tbaa !30
  %246 = load ptr, ptr %15, align 8, !tbaa !5
  %247 = load i32, ptr %224, align 4, !tbaa !10
  %248 = zext i32 %247 to i64
  %249 = getelementptr inbounds i32, ptr %245, i64 %248
  %250 = load i32, ptr %249, align 4, !tbaa !10
  %251 = zext i32 %250 to i64
  %252 = getelementptr inbounds i32, ptr %244, i64 %251
  %253 = getelementptr inbounds i32, ptr %246, i64 %248
  %254 = load i32, ptr %253, align 4, !tbaa !10
  %255 = zext i32 %254 to i64
  %.not353 = icmp eq i32 %254, 0
  br i1 %.not353, label %.loopexit, label %.lr.ph348

.lr.ph348:                                        ; preds = %243, %.critedge299
  %.0225346 = phi i64 [ %265, %.critedge299 ], [ 0, %243 ]
  %256 = getelementptr inbounds i32, ptr %252, i64 %.0225346
  %257 = load i32, ptr %256, align 4, !tbaa !10
  %.not288 = icmp eq i32 %257, %.2248
  br i1 %.not288, label %258, label %.critedge299

258:                                              ; preds = %.lr.ph348
  %259 = getelementptr inbounds i32, ptr %252, i64 %.0225346
  %260 = getelementptr i32, ptr %252, i64 %255
  %261 = getelementptr i8, ptr %260, i64 -4
  %262 = load i32, ptr %261, align 4, !tbaa !10
  store i32 %262, ptr %259, align 4, !tbaa !10
  %263 = load i32, ptr %253, align 4, !tbaa !10
  %264 = add i32 %263, -1
  store i32 %264, ptr %253, align 4, !tbaa !10
  br label %.loopexit

.critedge299:                                     ; preds = %.lr.ph348
  %265 = add nuw nsw i64 %.0225346, 1
  %exitcond363.not = icmp eq i64 %265, %255
  br i1 %exitcond363.not, label %.loopexit, label %.lr.ph348, !llvm.loop !31

.loopexit:                                        ; preds = %.critedge299, %243, %258
  %gep.1 = getelementptr inbounds i8, ptr %224, i64 4
  %266 = load i32, ptr %gep.1, align 4, !tbaa !10
  %267 = zext i32 %266 to i64
  %268 = getelementptr inbounds i32, ptr %245, i64 %267
  %269 = load i32, ptr %268, align 4, !tbaa !10
  %270 = zext i32 %269 to i64
  %271 = getelementptr inbounds i32, ptr %244, i64 %270
  %272 = getelementptr inbounds i32, ptr %246, i64 %267
  %273 = load i32, ptr %272, align 4, !tbaa !10
  %274 = zext i32 %273 to i64
  %.not353.1 = icmp eq i32 %273, 0
  br i1 %.not353.1, label %.loopexit.1, label %.lr.ph348.1

.lr.ph348.1:                                      ; preds = %.loopexit, %.critedge299.1
  %.0225346.1 = phi i64 [ %277, %.critedge299.1 ], [ 0, %.loopexit ]
  %275 = getelementptr inbounds i32, ptr %271, i64 %.0225346.1
  %276 = load i32, ptr %275, align 4, !tbaa !10
  %.not288.1 = icmp eq i32 %276, %.2248
  br i1 %.not288.1, label %278, label %.critedge299.1

.critedge299.1:                                   ; preds = %.lr.ph348.1
  %277 = add nuw nsw i64 %.0225346.1, 1
  %exitcond363.1.not = icmp eq i64 %277, %274
  br i1 %exitcond363.1.not, label %.loopexit.1, label %.lr.ph348.1, !llvm.loop !31

278:                                              ; preds = %.lr.ph348.1
  %279 = getelementptr inbounds i32, ptr %271, i64 %.0225346.1
  %280 = getelementptr i32, ptr %271, i64 %274
  %281 = getelementptr i8, ptr %280, i64 -4
  %282 = load i32, ptr %281, align 4, !tbaa !10
  store i32 %282, ptr %279, align 4, !tbaa !10
  %283 = load i32, ptr %272, align 4, !tbaa !10
  %284 = add i32 %283, -1
  store i32 %284, ptr %272, align 4, !tbaa !10
  br label %.loopexit.1

.loopexit.1:                                      ; preds = %.critedge299.1, %278, %.loopexit
  %gep.2 = getelementptr inbounds i8, ptr %224, i64 8
  %285 = load i32, ptr %gep.2, align 4, !tbaa !10
  %286 = zext i32 %285 to i64
  %287 = getelementptr inbounds i32, ptr %245, i64 %286
  %288 = load i32, ptr %287, align 4, !tbaa !10
  %289 = zext i32 %288 to i64
  %290 = getelementptr inbounds i32, ptr %244, i64 %289
  %291 = getelementptr inbounds i32, ptr %246, i64 %286
  %292 = load i32, ptr %291, align 4, !tbaa !10
  %293 = zext i32 %292 to i64
  %.not353.2 = icmp eq i32 %292, 0
  br i1 %.not353.2, label %.loopexit.2, label %.lr.ph348.2

.lr.ph348.2:                                      ; preds = %.loopexit.1, %.critedge299.2
  %.0225346.2 = phi i64 [ %296, %.critedge299.2 ], [ 0, %.loopexit.1 ]
  %294 = getelementptr inbounds i32, ptr %290, i64 %.0225346.2
  %295 = load i32, ptr %294, align 4, !tbaa !10
  %.not288.2 = icmp eq i32 %295, %.2248
  br i1 %.not288.2, label %297, label %.critedge299.2

.critedge299.2:                                   ; preds = %.lr.ph348.2
  %296 = add nuw nsw i64 %.0225346.2, 1
  %exitcond363.2.not = icmp eq i64 %296, %293
  br i1 %exitcond363.2.not, label %.loopexit.2, label %.lr.ph348.2, !llvm.loop !31

297:                                              ; preds = %.lr.ph348.2
  %298 = getelementptr inbounds i32, ptr %290, i64 %.0225346.2
  %299 = getelementptr i32, ptr %290, i64 %293
  %300 = getelementptr i8, ptr %299, i64 -4
  %301 = load i32, ptr %300, align 4, !tbaa !10
  store i32 %301, ptr %298, align 4, !tbaa !10
  %302 = load i32, ptr %291, align 4, !tbaa !10
  %303 = add i32 %302, -1
  store i32 %303, ptr %291, align 4, !tbaa !10
  br label %.loopexit.2

.loopexit.2:                                      ; preds = %.critedge299.2, %297, %.loopexit.1
  %304 = zext i32 %.2248 to i64
  %305 = getelementptr inbounds %"struct.meshopt::Cone", ptr %67, i64 %304
  %306 = load <4 x float>, ptr %305, align 4, !tbaa !17
  %307 = load <4 x float>, ptr %18, align 16, !tbaa !17
  %308 = fadd <4 x float> %306, %307
  store <4 x float> %308, ptr %18, align 16, !tbaa !17
  %309 = getelementptr inbounds i8, ptr %305, i64 16
  %310 = load <2 x float>, ptr %309, align 4, !tbaa !17
  %311 = load <2 x float>, ptr %141, align 16, !tbaa !17
  %312 = fadd <2 x float> %310, %311
  store <2 x float> %312, ptr %141, align 16, !tbaa !17
  %313 = getelementptr inbounds i8, ptr %65, i64 %304
  %314 = load i8, ptr %313, align 1, !tbaa !32
  %.not287 = icmp eq i8 %314, 0
  br i1 %.not287, label %316, label %315

315:                                              ; preds = %.loopexit.2
  call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.1, i32 noundef 1241, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

316:                                              ; preds = %.loopexit.2
  store i8 1, ptr %313, align 1, !tbaa !32
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %19) #8
  %.pre = load i32, ptr %132, align 4, !tbaa !33
  br label %160

317:                                              ; preds = %179, %241, %167
  %.pn.pn = phi { ptr, i32 } [ %168, %167 ], [ %242, %241 ], [ %180, %179 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %19) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %16) #8
  br label %326

318:                                              ; preds = %.thread, %181
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %19) #8
  %.not289 = icmp eq i32 %176, 0
  br i1 %.not289, label %322, label %319

319:                                              ; preds = %318
  call void @_ZN7meshoptL13finishMeshletER15meshopt_MeshletPh(ptr noundef nonnull align 4 dereferenceable(16) %17, ptr noundef %2)
  %320 = add i64 %.0249, 1
  %321 = getelementptr inbounds %struct.meshopt_Meshlet, ptr %0, i64 %.0249
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %321, ptr noundef nonnull align 4 dereferenceable(16) %17, i64 16, i1 false), !tbaa.struct !34
  br label %322

322:                                              ; preds = %319, %318
  %.3252 = phi i64 [ %320, %319 ], [ %.0249, %318 ]
  %323 = call i64 @meshopt_buildMeshletsBound(i64 noundef %4, i64 noundef %8, i64 noundef %9)
  %.not290 = icmp ugt i64 %.3252, %323
  br i1 %.not290, label %324, label %325

324:                                              ; preds = %322
  call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.1, i32 noundef 1252, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_buildMeshletsFlex) #7
  unreachable

325:                                              ; preds = %322
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %16) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #8
  call void @_ZN17meshopt_AllocatorD2Ev(ptr noundef nonnull align 8 dereferenceable(200) %14) #8
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %14) #8
  br label %327

326:                                              ; preds = %85, %89, %144, %317, %107, %87, %60
  %.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %61, %60 ], [ %86, %85 ], [ %88, %87 ], [ %90, %89 ], [ %108, %107 ], [ %.pn.pn, %317 ], [ %145, %144 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #8
  call void @_ZN17meshopt_AllocatorD2Ev(ptr noundef nonnull align 8 dereferenceable(200) %14) #8
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %14) #8
  resume { ptr, i32 } %.pn.pn.pn.pn.pn.pn.pn.pn

327:                                              ; preds = %54, %325
  %.0 = phi i64 [ %.3252, %325 ], [ 0, %54 ]
  ret i64 %.0
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN17meshopt_AllocatorC2Ev(ptr noundef nonnull align 8 dereferenceable(200)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN7meshoptL28buildTriangleAdjacencySparseERNS_18TriangleAdjacency2EPKjmmR17meshopt_Allocator(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(200)) local_unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN7meshoptL22buildTriangleAdjacencyERNS_18TriangleAdjacency2EPKjmmR17meshopt_Allocator(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(200)) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef float @_ZN7meshoptL20computeTriangleConesEPNS_4ConeEPKjmPKfmm(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @sqrtf(float noundef) local_unnamed_addr #5

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

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i64 @_ZN7meshoptL11kdtreeBuildEmPNS_6KDNodeEmPKfmPjmm(i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef float @_ZN7meshoptL11getDistanceEfffb(float noundef, float noundef, float noundef, i1 noundef zeroext) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN7meshoptL14getMeshletConeERKNS_4ConeEj(ptr dead_on_unwind noalias writable sret(%"struct.meshopt::Cone") align 4, ptr noundef nonnull align 4 dereferenceable(24), i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN7meshoptL19getNeighborTriangleERK15meshopt_MeshletRKNS_4ConeEPKjS7_RKNS_18TriangleAdjacency2EPS4_S7_PKsff(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(24), ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ptr noundef, ptr noundef, float noundef, float noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN7meshoptL13kdtreeNearestEPNS_6KDNodeEjPKfmPKhS3_bRjRf(ptr noundef, i32 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, i1 noundef zeroext, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN7meshoptL18pruneSeedTrianglesEPjmPKh(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN7meshoptL19appendSeedTrianglesEPjRK15meshopt_MeshletPKjS5_RKNS_18TriangleAdjacency2EPKNS_4ConeES5_fff(ptr noundef, ptr noundef nonnull align 4 dereferenceable(16), ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ptr noundef, float noundef, float noundef, float noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN7meshoptL18selectSeedTriangleEPKjmS1_PKNS_4ConeES1_fff(ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, float noundef, float noundef, float noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN7meshoptL13appendMeshletER15meshopt_MeshletjjjPsPS0_PjPhmmmb(ptr noundef nonnull align 4 dereferenceable(16), i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, i1 noundef zeroext) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN7meshoptL13finishMeshletER15meshopt_MeshletPh(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress 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) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN17meshopt_AllocatorD2Ev(ptr noundef nonnull align 8 dereferenceable(200)) unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { noreturn nounwind "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { mustprogress nofree nounwind willreturn memory(write) "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { noreturn nounwind }
attributes #8 = { 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, !7, i64 0}
!6 = !{!"_ZTSN7meshopt18TriangleAdjacency2E", !7, i64 0, !7, i64 8, !7, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = distinct !{!12, !13, !14, !15}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !13, !15, !14}
!17 = !{!18, !18, i64 0}
!18 = !{!"float", !8, i64 0}
!19 = !{!20, !18, i64 8}
!20 = !{!"_ZTSN7meshopt4ConeE", !18, i64 0, !18, i64 4, !18, i64 8, !18, i64 12, !18, i64 16, !18, i64 20}
!21 = distinct !{!21, !13}
!22 = !{!20, !18, i64 0}
!23 = !{!20, !18, i64 4}
!24 = distinct !{!24, !13}
!25 = !{!26, !26, i64 0}
!26 = !{!"short", !8, i64 0}
!27 = !{!28, !11, i64 8}
!28 = !{!"_ZTS15meshopt_Meshlet", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12}
!29 = !{!6, !7, i64 16}
!30 = !{!6, !7, i64 8}
!31 = distinct !{!31, !13}
!32 = !{!8, !8, i64 0}
!33 = !{!28, !11, i64 12}
!34 = !{i64 0, i64 4, !10, i64 4, i64 4, !10, i64 8, i64 4, !10, i64 12, i64 4, !10}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,DivRemPairsPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass