; 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_Meshlet = type { i32, i32, i32, i32 }

@.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
@.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
@__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit = external hidden unnamed_addr constant [185 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [32 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 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) #3

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local i64 @meshopt_buildMeshletsSplit(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) #4 personality ptr @__gxx_personality_v0 {
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca float, align 4
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  %28 = alloca %class.meshopt_Allocator, align 8
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = alloca i32, align 4
  %32 = alloca ptr, align 8
  %33 = alloca ptr, align 8
  %34 = alloca ptr, align 8
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca ptr, align 8
  %38 = alloca ptr, align 8
  %39 = alloca [1024 x [3 x i32]], align 16
  %40 = alloca i64, align 8
  %41 = alloca ptr, align 8
  %42 = alloca ptr, align 8
  %43 = alloca i64, align 8
  %44 = alloca i64, align 8
  %45 = alloca i64, align 8
  %46 = alloca %struct.meshopt_Meshlet, align 4
  %47 = alloca i64, align 8
  %48 = alloca i64, align 8
  %49 = alloca i64, align 8
  %50 = alloca i8, align 1
  %51 = alloca i32, align 4
  %52 = alloca i32, align 4
  %53 = alloca i32, align 4
  %54 = alloca i32, align 4
  store ptr %0, ptr %14, align 8, !tbaa !5
  store ptr %1, ptr %15, align 8, !tbaa !5
  store ptr %2, ptr %16, align 8, !tbaa !5
  store ptr %3, ptr %17, align 8, !tbaa !5
  store i64 %4, ptr %18, align 8, !tbaa !9
  store ptr %5, ptr %19, align 8, !tbaa !5
  store i64 %6, ptr %20, align 8, !tbaa !9
  store i64 %7, ptr %21, align 8, !tbaa !9
  store i64 %8, ptr %22, align 8, !tbaa !9
  store i64 %9, ptr %23, align 8, !tbaa !9
  store i64 %10, ptr %24, align 8, !tbaa !9
  store float %11, ptr %25, align 4, !tbaa !11
  %55 = load i64, ptr %18, align 8, !tbaa !9
  %56 = urem i64 %55, 3
  %57 = icmp eq i64 %56, 0
  br i1 %57, label %58, label %59

58:                                               ; preds = %12
  br label %61

59:                                               ; preds = %12
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 1306, ptr noundef @__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit) #6
  unreachable

60:                                               ; No predecessors!
  br label %61

61:                                               ; preds = %60, %58
  %62 = load i64, ptr %21, align 8, !tbaa !9
  %63 = icmp uge i64 %62, 12
  br i1 %63, label %64, label %67

64:                                               ; preds = %61
  %65 = load i64, ptr %21, align 8, !tbaa !9
  %66 = icmp ule i64 %65, 256
  br label %67

67:                                               ; preds = %64, %61
  %68 = phi i1 [ false, %61 ], [ %66, %64 ]
  br i1 %68, label %69, label %70

69:                                               ; preds = %67
  br label %72

70:                                               ; preds = %67
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 1307, ptr noundef @__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit) #6
  unreachable

71:                                               ; No predecessors!
  br label %72

72:                                               ; preds = %71, %69
  %73 = load i64, ptr %21, align 8, !tbaa !9
  %74 = urem i64 %73, 4
  %75 = icmp eq i64 %74, 0
  br i1 %75, label %76, label %77

76:                                               ; preds = %72
  br label %79

77:                                               ; preds = %72
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 1308, ptr noundef @__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit) #6
  unreachable

78:                                               ; No predecessors!
  br label %79

79:                                               ; preds = %78, %76
  %80 = load i64, ptr %22, align 8, !tbaa !9
  %81 = icmp uge i64 %80, 3
  br i1 %81, label %82, label %85

82:                                               ; preds = %79
  %83 = load i64, ptr %22, align 8, !tbaa !9
  %84 = icmp ule i64 %83, 256
  br label %85

85:                                               ; preds = %82, %79
  %86 = phi i1 [ false, %79 ], [ %84, %82 ]
  br i1 %86, label %87, label %88

87:                                               ; preds = %85
  br label %90

88:                                               ; preds = %85
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 1310, ptr noundef @__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit) #6
  unreachable

89:                                               ; No predecessors!
  br label %90

90:                                               ; preds = %89, %87
  %91 = load i64, ptr %23, align 8, !tbaa !9
  %92 = icmp uge i64 %91, 1
  br i1 %92, label %93, label %100

93:                                               ; preds = %90
  %94 = load i64, ptr %23, align 8, !tbaa !9
  %95 = load i64, ptr %24, align 8, !tbaa !9
  %96 = icmp ule i64 %94, %95
  br i1 %96, label %97, label %100

97:                                               ; preds = %93
  %98 = load i64, ptr %24, align 8, !tbaa !9
  %99 = icmp ule i64 %98, 512
  br label %100

100:                                              ; preds = %97, %93, %90
  %101 = phi i1 [ false, %93 ], [ false, %90 ], [ %99, %97 ]
  br i1 %101, label %102, label %103

102:                                              ; preds = %100
  br label %105

103:                                              ; preds = %100
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 1311, ptr noundef @__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit) #6
  unreachable

104:                                              ; No predecessors!
  br label %105

105:                                              ; preds = %104, %102
  %106 = load i64, ptr %23, align 8, !tbaa !9
  %107 = urem i64 %106, 4
  %108 = icmp eq i64 %107, 0
  br i1 %108, label %109, label %113

109:                                              ; preds = %105
  %110 = load i64, ptr %24, align 8, !tbaa !9
  %111 = urem i64 %110, 4
  %112 = icmp eq i64 %111, 0
  br label %113

113:                                              ; preds = %109, %105
  %114 = phi i1 [ false, %105 ], [ %112, %109 ]
  br i1 %114, label %115, label %116

115:                                              ; preds = %113
  br label %118

116:                                              ; preds = %113
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 1312, ptr noundef @__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit) #6
  unreachable

117:                                              ; No predecessors!
  br label %118

118:                                              ; preds = %117, %115
  %119 = load i64, ptr %18, align 8, !tbaa !9
  %120 = icmp eq i64 %119, 0
  br i1 %120, label %121, label %122

121:                                              ; preds = %118
  store i64 0, ptr %13, align 8
  br label %426

122:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %123 = load i64, ptr %18, align 8, !tbaa !9
  %124 = udiv i64 %123, 3
  store i64 %124, ptr %26, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %125 = load i64, ptr %21, align 8, !tbaa !9
  %126 = udiv i64 %125, 4
  store i64 %126, ptr %27, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 200, ptr %28) #7
  call void @_ZN17meshopt_AllocatorC2Ev(ptr noundef nonnull align 8 dereferenceable(200) %28)
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %127 = load i64, ptr %26, align 8, !tbaa !9
  %128 = mul i64 %127, 4
  %129 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIfEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %28, i64 noundef %128)
          to label %130 unwind label %154

130:                                              ; preds = %122
  store ptr %129, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  %131 = load i64, ptr %26, align 8, !tbaa !9
  %132 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIN7meshopt6BVHBoxEEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %28, i64 noundef %131)
          to label %133 unwind label %158

133:                                              ; preds = %130
  store ptr %132, ptr %32, align 8, !tbaa !5
  %134 = load ptr, ptr %32, align 8, !tbaa !5
  %135 = load ptr, ptr %29, align 8, !tbaa !5
  %136 = load ptr, ptr %17, align 8, !tbaa !5
  %137 = load i64, ptr %26, align 8, !tbaa !9
  %138 = load ptr, ptr %19, align 8, !tbaa !5
  %139 = load i64, ptr %20, align 8, !tbaa !9
  %140 = load i64, ptr %27, align 8, !tbaa !9
  invoke void @_ZN7meshoptL10bvhPrepareEPNS_6BVHBoxEPfPKjmPKfmm(ptr noundef %134, ptr noundef %135, ptr noundef %136, i64 noundef %137, ptr noundef %138, i64 noundef %139, i64 noundef %140)
          to label %141 unwind label %158

141:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #7
  %142 = load i64, ptr %26, align 8, !tbaa !9
  %143 = mul i64 %142, 3
  %144 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIjEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %28, i64 noundef %143)
          to label %145 unwind label %162

145:                                              ; preds = %141
  store ptr %144, ptr %33, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #7
  %146 = load ptr, ptr %29, align 8, !tbaa !5
  %147 = load i64, ptr %26, align 8, !tbaa !9
  %148 = mul i64 %147, 3
  %149 = getelementptr inbounds i32, ptr %146, i64 %148
  store ptr %149, ptr %34, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #7
  store i32 0, ptr %35, align 4, !tbaa !13
  br label %150

150:                                              ; preds = %216, %145
  %151 = load i32, ptr %35, align 4, !tbaa !13
  %152 = icmp slt i32 %151, 3
  br i1 %152, label %166, label %153

153:                                              ; preds = %150
  store i32 2, ptr %36, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #7
  br label %219

154:                                              ; preds = %122
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %30, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %31, align 4
  br label %425

158:                                              ; preds = %133, %130
  %159 = landingpad { ptr, i32 }
          cleanup
  %160 = extractvalue { ptr, i32 } %159, 0
  store ptr %160, ptr %30, align 8
  %161 = extractvalue { ptr, i32 } %159, 1
  store i32 %161, ptr %31, align 4
  br label %424

162:                                              ; preds = %141
  %163 = landingpad { ptr, i32 }
          cleanup
  %164 = extractvalue { ptr, i32 } %163, 0
  store ptr %164, ptr %30, align 8
  %165 = extractvalue { ptr, i32 } %163, 1
  store i32 %165, ptr %31, align 4
  br label %423

166:                                              ; preds = %150
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #7
  %167 = load ptr, ptr %33, align 8, !tbaa !5
  %168 = load i32, ptr %35, align 4, !tbaa !13
  %169 = sext i32 %168 to i64
  %170 = load i64, ptr %26, align 8, !tbaa !9
  %171 = mul i64 %169, %170
  %172 = getelementptr inbounds i32, ptr %167, i64 %171
  store ptr %172, ptr %37, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #7
  %173 = load ptr, ptr %29, align 8, !tbaa !5
  %174 = load i32, ptr %35, align 4, !tbaa !13
  %175 = sext i32 %174 to i64
  %176 = load i64, ptr %26, align 8, !tbaa !9
  %177 = mul i64 %175, %176
  %178 = getelementptr inbounds float, ptr %173, i64 %177
  store ptr %178, ptr %38, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12288, ptr %39) #7
  %179 = load ptr, ptr %38, align 8, !tbaa !5
  %180 = load i64, ptr %26, align 8, !tbaa !9
  invoke void @_ZN7meshoptL16computeHistogramERA1024_A3_jPKfm(ptr noundef nonnull align 4 dereferenceable(12288) %39, ptr noundef %179, i64 noundef %180)
          to label %181 unwind label %187

181:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #7
  store i64 0, ptr %40, align 8, !tbaa !9
  br label %182

182:                                              ; preds = %197, %181
  %183 = load i64, ptr %40, align 8, !tbaa !9
  %184 = load i64, ptr %26, align 8, !tbaa !9
  %185 = icmp ult i64 %183, %184
  br i1 %185, label %191, label %186

186:                                              ; preds = %182
  store i32 5, ptr %36, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #7
  br label %200

187:                                              ; preds = %210, %205, %200, %166
  %188 = landingpad { ptr, i32 }
          cleanup
  %189 = extractvalue { ptr, i32 } %188, 0
  store ptr %189, ptr %30, align 8
  %190 = extractvalue { ptr, i32 } %188, 1
  store i32 %190, ptr %31, align 4
  call void @llvm.lifetime.end.p0(i64 12288, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #7
  br label %422

191:                                              ; preds = %182
  %192 = load i64, ptr %40, align 8, !tbaa !9
  %193 = trunc i64 %192 to i32
  %194 = load ptr, ptr %34, align 8, !tbaa !5
  %195 = load i64, ptr %40, align 8, !tbaa !9
  %196 = getelementptr inbounds i32, ptr %194, i64 %195
  store i32 %193, ptr %196, align 4, !tbaa !13
  br label %197

197:                                              ; preds = %191
  %198 = load i64, ptr %40, align 8, !tbaa !9
  %199 = add i64 %198, 1
  store i64 %199, ptr %40, align 8, !tbaa !9
  br label %182, !llvm.loop !15

200:                                              ; preds = %186
  %201 = load ptr, ptr %37, align 8, !tbaa !5
  %202 = load ptr, ptr %34, align 8, !tbaa !5
  %203 = load ptr, ptr %38, align 8, !tbaa !5
  %204 = load i64, ptr %26, align 8, !tbaa !9
  invoke void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef %201, ptr noundef %202, ptr noundef %203, i64 noundef %204, ptr noundef nonnull align 4 dereferenceable(12288) %39, i32 noundef 0)
          to label %205 unwind label %187

205:                                              ; preds = %200
  %206 = load ptr, ptr %34, align 8, !tbaa !5
  %207 = load ptr, ptr %37, align 8, !tbaa !5
  %208 = load ptr, ptr %38, align 8, !tbaa !5
  %209 = load i64, ptr %26, align 8, !tbaa !9
  invoke void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef %206, ptr noundef %207, ptr noundef %208, i64 noundef %209, ptr noundef nonnull align 4 dereferenceable(12288) %39, i32 noundef 1)
          to label %210 unwind label %187

210:                                              ; preds = %205
  %211 = load ptr, ptr %37, align 8, !tbaa !5
  %212 = load ptr, ptr %34, align 8, !tbaa !5
  %213 = load ptr, ptr %38, align 8, !tbaa !5
  %214 = load i64, ptr %26, align 8, !tbaa !9
  invoke void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef %211, ptr noundef %212, ptr noundef %213, i64 noundef %214, ptr noundef nonnull align 4 dereferenceable(12288) %39, i32 noundef 2)
          to label %215 unwind label %187

215:                                              ; preds = %210
  call void @llvm.lifetime.end.p0(i64 12288, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #7
  br label %216

216:                                              ; preds = %215
  %217 = load i32, ptr %35, align 4, !tbaa !13
  %218 = add nsw i32 %217, 1
  store i32 %218, ptr %35, align 4, !tbaa !13
  br label %150, !llvm.loop !17

219:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #7
  %220 = load i64, ptr %20, align 8, !tbaa !9
  %221 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIsEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %28, i64 noundef %220)
          to label %222 unwind label %254

222:                                              ; preds = %219
  store ptr %221, ptr %41, align 8, !tbaa !5
  %223 = load ptr, ptr %41, align 8, !tbaa !5
  %224 = load i64, ptr %20, align 8, !tbaa !9
  %225 = mul i64 %224, 2
  call void @llvm.memset.p0.i64(ptr align 2 %223, i8 -1, i64 %225, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #7
  %226 = load i64, ptr %26, align 8, !tbaa !9
  %227 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIhEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %28, i64 noundef %226)
          to label %228 unwind label %258

228:                                              ; preds = %222
  store ptr %227, ptr %42, align 8, !tbaa !5
  %229 = load ptr, ptr %32, align 8, !tbaa !5
  %230 = load ptr, ptr %33, align 8, !tbaa !5
  %231 = getelementptr inbounds i32, ptr %230, i64 0
  %232 = load ptr, ptr %33, align 8, !tbaa !5
  %233 = load i64, ptr %26, align 8, !tbaa !9
  %234 = getelementptr inbounds i32, ptr %232, i64 %233
  %235 = load ptr, ptr %33, align 8, !tbaa !5
  %236 = load i64, ptr %26, align 8, !tbaa !9
  %237 = mul i64 %236, 2
  %238 = getelementptr inbounds i32, ptr %235, i64 %237
  %239 = load ptr, ptr %42, align 8, !tbaa !5
  %240 = load i64, ptr %26, align 8, !tbaa !9
  %241 = load ptr, ptr %29, align 8, !tbaa !5
  %242 = load ptr, ptr %41, align 8, !tbaa !5
  %243 = load ptr, ptr %17, align 8, !tbaa !5
  %244 = load i64, ptr %22, align 8, !tbaa !9
  %245 = load i64, ptr %23, align 8, !tbaa !9
  %246 = load i64, ptr %24, align 8, !tbaa !9
  %247 = load float, ptr %25, align 4, !tbaa !11
  invoke void @_ZN7meshoptL8bvhSplitEPKNS_6BVHBoxEPjS3_S3_PhmiPvPsPKjmmmf(ptr noundef %229, ptr noundef %231, ptr noundef %234, ptr noundef %238, ptr noundef %239, i64 noundef %240, i32 noundef 0, ptr noundef %241, ptr noundef %242, ptr noundef %243, i64 noundef %244, i64 noundef %245, i64 noundef %246, float noundef %247)
          to label %248 unwind label %258

248:                                              ; preds = %228
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #7
  store i64 0, ptr %43, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #7
  store i64 0, ptr %44, align 8, !tbaa !9
  br label %249

249:                                              ; preds = %280, %248
  %250 = load i64, ptr %44, align 8, !tbaa !9
  %251 = load i64, ptr %26, align 8, !tbaa !9
  %252 = icmp ult i64 %250, %251
  br i1 %252, label %262, label %253

253:                                              ; preds = %249
  store i32 8, ptr %36, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #7
  br label %283

254:                                              ; preds = %219
  %255 = landingpad { ptr, i32 }
          cleanup
  %256 = extractvalue { ptr, i32 } %255, 0
  store ptr %256, ptr %30, align 8
  %257 = extractvalue { ptr, i32 } %255, 1
  store i32 %257, ptr %31, align 4
  br label %421

258:                                              ; preds = %228, %222
  %259 = landingpad { ptr, i32 }
          cleanup
  %260 = extractvalue { ptr, i32 } %259, 0
  store ptr %260, ptr %30, align 8
  %261 = extractvalue { ptr, i32 } %259, 1
  store i32 %261, ptr %31, align 4
  br label %420

262:                                              ; preds = %249
  %263 = load ptr, ptr %42, align 8, !tbaa !5
  %264 = load i64, ptr %44, align 8, !tbaa !9
  %265 = getelementptr inbounds i8, ptr %263, i64 %264
  %266 = load i8, ptr %265, align 1, !tbaa !18
  %267 = zext i8 %266 to i32
  %268 = icmp sle i32 %267, 1
  br i1 %268, label %269, label %270

269:                                              ; preds = %262
  br label %272

270:                                              ; preds = %262
  call void @__assert_fail(ptr noundef @.str.16, ptr noundef @.str.1, i32 noundef 1363, ptr noundef @__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit) #6
  unreachable

271:                                              ; No predecessors!
  br label %272

272:                                              ; preds = %271, %269
  %273 = load ptr, ptr %42, align 8, !tbaa !5
  %274 = load i64, ptr %44, align 8, !tbaa !9
  %275 = getelementptr inbounds i8, ptr %273, i64 %274
  %276 = load i8, ptr %275, align 1, !tbaa !18
  %277 = zext i8 %276 to i64
  %278 = load i64, ptr %43, align 8, !tbaa !9
  %279 = add i64 %278, %277
  store i64 %279, ptr %43, align 8, !tbaa !9
  br label %280

280:                                              ; preds = %272
  %281 = load i64, ptr %44, align 8, !tbaa !9
  %282 = add i64 %281, 1
  store i64 %282, ptr %44, align 8, !tbaa !9
  br label %249, !llvm.loop !19

283:                                              ; preds = %253
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #7
  %284 = load i64, ptr %18, align 8, !tbaa !9
  %285 = load i64, ptr %22, align 8, !tbaa !9
  %286 = load i64, ptr %23, align 8, !tbaa !9
  %287 = call i64 @meshopt_buildMeshletsBound(i64 noundef %284, i64 noundef %285, i64 noundef %286)
  store i64 %287, ptr %45, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %46) #7
  call void @llvm.memset.p0.i64(ptr align 4 %46, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #7
  store i64 0, ptr %47, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #7
  %288 = load i64, ptr %43, align 8, !tbaa !9
  store i64 %288, ptr %48, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #7
  store i64 0, ptr %49, align 8, !tbaa !9
  br label %289

289:                                              ; preds = %388, %283
  %290 = load i64, ptr %49, align 8, !tbaa !9
  %291 = load i64, ptr %26, align 8, !tbaa !9
  %292 = icmp ult i64 %290, %291
  br i1 %292, label %294, label %293

293:                                              ; preds = %289
  store i32 11, ptr %36, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #7
  br label %395

294:                                              ; preds = %289
  %295 = load ptr, ptr %42, align 8, !tbaa !5
  %296 = load i64, ptr %49, align 8, !tbaa !9
  %297 = getelementptr inbounds i8, ptr %295, i64 %296
  %298 = load i8, ptr %297, align 1, !tbaa !18
  %299 = zext i8 %298 to i32
  %300 = icmp sle i32 %299, 1
  br i1 %300, label %301, label %302

301:                                              ; preds = %294
  br label %304

302:                                              ; preds = %294
  call void @__assert_fail(ptr noundef @.str.16, ptr noundef @.str.1, i32 noundef 1376, ptr noundef @__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit) #6
  unreachable

303:                                              ; No predecessors!
  br label %304

304:                                              ; preds = %303, %301
  call void @llvm.lifetime.start.p0(i64 1, ptr %50) #7
  %305 = load i64, ptr %49, align 8, !tbaa !9
  %306 = icmp ugt i64 %305, 0
  br i1 %306, label %307, label %314

307:                                              ; preds = %304
  %308 = load ptr, ptr %42, align 8, !tbaa !5
  %309 = load i64, ptr %49, align 8, !tbaa !9
  %310 = getelementptr inbounds i8, ptr %308, i64 %309
  %311 = load i8, ptr %310, align 1, !tbaa !18
  %312 = zext i8 %311 to i32
  %313 = icmp eq i32 %312, 1
  br label %314

314:                                              ; preds = %307, %304
  %315 = phi i1 [ false, %304 ], [ %313, %307 ]
  %316 = zext i1 %315 to i8
  store i8 %316, ptr %50, align 1, !tbaa !20
  %317 = load i8, ptr %50, align 1, !tbaa !20, !range !22, !noundef !23
  %318 = trunc i8 %317 to i1
  br i1 %318, label %319, label %330

319:                                              ; preds = %314
  %320 = load i64, ptr %43, align 8, !tbaa !9
  %321 = load i64, ptr %45, align 8, !tbaa !9
  %322 = icmp ugt i64 %320, %321
  br i1 %322, label %323, label %330

323:                                              ; preds = %319
  %324 = load i64, ptr %47, align 8, !tbaa !9
  %325 = load i64, ptr %48, align 8, !tbaa !9
  %326 = add i64 %324, %325
  %327 = load i64, ptr %45, align 8, !tbaa !9
  %328 = icmp uge i64 %326, %327
  br i1 %328, label %329, label %330

329:                                              ; preds = %323
  store i8 0, ptr %50, align 1, !tbaa !20
  br label %330

330:                                              ; preds = %329, %323, %319, %314
  call void @llvm.lifetime.start.p0(i64 4, ptr %51) #7
  %331 = load ptr, ptr %33, align 8, !tbaa !5
  %332 = load i64, ptr %49, align 8, !tbaa !9
  %333 = getelementptr inbounds i32, ptr %331, i64 %332
  %334 = load i32, ptr %333, align 4, !tbaa !13
  store i32 %334, ptr %51, align 4, !tbaa !13
  %335 = load i32, ptr %51, align 4, !tbaa !13
  %336 = zext i32 %335 to i64
  %337 = load i64, ptr %26, align 8, !tbaa !9
  %338 = icmp ult i64 %336, %337
  br i1 %338, label %339, label %340

339:                                              ; preds = %330
  br label %342

340:                                              ; preds = %330
  call void @__assert_fail(ptr noundef @.str.17, ptr noundef @.str.1, i32 noundef 1384, ptr noundef @__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit) #6
  unreachable

341:                                              ; No predecessors!
  br label %342

342:                                              ; preds = %341, %339
  call void @llvm.lifetime.start.p0(i64 4, ptr %52) #7
  %343 = load ptr, ptr %17, align 8, !tbaa !5
  %344 = load i32, ptr %51, align 4, !tbaa !13
  %345 = mul i32 %344, 3
  %346 = add i32 %345, 0
  %347 = zext i32 %346 to i64
  %348 = getelementptr inbounds i32, ptr %343, i64 %347
  %349 = load i32, ptr %348, align 4, !tbaa !13
  store i32 %349, ptr %52, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %53) #7
  %350 = load ptr, ptr %17, align 8, !tbaa !5
  %351 = load i32, ptr %51, align 4, !tbaa !13
  %352 = mul i32 %351, 3
  %353 = add i32 %352, 1
  %354 = zext i32 %353 to i64
  %355 = getelementptr inbounds i32, ptr %350, i64 %354
  %356 = load i32, ptr %355, align 4, !tbaa !13
  store i32 %356, ptr %53, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %54) #7
  %357 = load ptr, ptr %17, align 8, !tbaa !5
  %358 = load i32, ptr %51, align 4, !tbaa !13
  %359 = mul i32 %358, 3
  %360 = add i32 %359, 2
  %361 = zext i32 %360 to i64
  %362 = getelementptr inbounds i32, ptr %357, i64 %361
  %363 = load i32, ptr %362, align 4, !tbaa !13
  store i32 %363, ptr %54, align 4, !tbaa !13
  %364 = load i32, ptr %52, align 4, !tbaa !13
  %365 = load i32, ptr %53, align 4, !tbaa !13
  %366 = load i32, ptr %54, align 4, !tbaa !13
  %367 = load ptr, ptr %41, align 8, !tbaa !5
  %368 = load ptr, ptr %14, align 8, !tbaa !5
  %369 = load ptr, ptr %15, align 8, !tbaa !5
  %370 = load ptr, ptr %16, align 8, !tbaa !5
  %371 = load i64, ptr %47, align 8, !tbaa !9
  %372 = load i64, ptr %22, align 8, !tbaa !9
  %373 = load i64, ptr %24, align 8, !tbaa !9
  %374 = load i8, ptr %50, align 1, !tbaa !20, !range !22, !noundef !23
  %375 = trunc i8 %374 to i1
  %376 = invoke noundef zeroext i1 @_ZN7meshoptL13appendMeshletER15meshopt_MeshletjjjPsPS0_PjPhmmmb(ptr noundef nonnull align 4 dereferenceable(16) %46, i32 noundef %364, i32 noundef %365, i32 noundef %366, ptr noundef %367, ptr noundef %368, ptr noundef %369, ptr noundef %370, i64 noundef %371, i64 noundef %372, i64 noundef %373, i1 noundef zeroext %375)
          to label %377 unwind label %391

377:                                              ; preds = %342
  %378 = zext i1 %376 to i64
  %379 = load i64, ptr %47, align 8, !tbaa !9
  %380 = add i64 %379, %378
  store i64 %380, ptr %47, align 8, !tbaa !9
  %381 = load ptr, ptr %42, align 8, !tbaa !5
  %382 = load i64, ptr %49, align 8, !tbaa !9
  %383 = getelementptr inbounds i8, ptr %381, i64 %382
  %384 = load i8, ptr %383, align 1, !tbaa !18
  %385 = zext i8 %384 to i64
  %386 = load i64, ptr %48, align 8, !tbaa !9
  %387 = sub i64 %386, %385
  store i64 %387, ptr %48, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %54) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %53) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %52) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %51) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %50) #7
  br label %388

388:                                              ; preds = %377
  %389 = load i64, ptr %49, align 8, !tbaa !9
  %390 = add i64 %389, 1
  store i64 %390, ptr %49, align 8, !tbaa !9
  br label %289, !llvm.loop !24

391:                                              ; preds = %342
  %392 = landingpad { ptr, i32 }
          cleanup
  %393 = extractvalue { ptr, i32 } %392, 0
  store ptr %393, ptr %30, align 8
  %394 = extractvalue { ptr, i32 } %392, 1
  store i32 %394, ptr %31, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %54) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %53) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %52) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %51) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %50) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #7
  br label %419

395:                                              ; preds = %293
  %396 = getelementptr inbounds %struct.meshopt_Meshlet, ptr %46, i32 0, i32 3
  %397 = load i32, ptr %396, align 4, !tbaa !25
  %398 = icmp ne i32 %397, 0
  br i1 %398, label %399, label %410

399:                                              ; preds = %395
  %400 = load ptr, ptr %16, align 8, !tbaa !5
  invoke void @_ZN7meshoptL13finishMeshletER15meshopt_MeshletPh(ptr noundef nonnull align 4 dereferenceable(16) %46, ptr noundef %400)
          to label %401 unwind label %406

401:                                              ; preds = %399
  %402 = load ptr, ptr %14, align 8, !tbaa !5
  %403 = load i64, ptr %47, align 8, !tbaa !9
  %404 = add i64 %403, 1
  store i64 %404, ptr %47, align 8, !tbaa !9
  %405 = getelementptr inbounds %struct.meshopt_Meshlet, ptr %402, i64 %403
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %405, ptr align 4 %46, i64 16, i1 false), !tbaa.struct !27
  br label %410

406:                                              ; preds = %399
  %407 = landingpad { ptr, i32 }
          cleanup
  %408 = extractvalue { ptr, i32 } %407, 0
  store ptr %408, ptr %30, align 8
  %409 = extractvalue { ptr, i32 } %407, 1
  store i32 %409, ptr %31, align 4
  br label %419

410:                                              ; preds = %401, %395
  %411 = load i64, ptr %47, align 8, !tbaa !9
  %412 = load i64, ptr %45, align 8, !tbaa !9
  %413 = icmp ule i64 %411, %412
  br i1 %413, label %414, label %415

414:                                              ; preds = %410
  br label %417

415:                                              ; preds = %410
  call void @__assert_fail(ptr noundef @.str.18, ptr noundef @.str.1, i32 noundef 1400, ptr noundef @__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit) #6
  unreachable

416:                                              ; No predecessors!
  br label %417

417:                                              ; preds = %416, %414
  %418 = load i64, ptr %47, align 8, !tbaa !9
  store i64 %418, ptr %13, align 8
  store i32 1, ptr %36, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %46) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @_ZN17meshopt_AllocatorD2Ev(ptr noundef nonnull align 8 dereferenceable(200) %28) #7
  call void @llvm.lifetime.end.p0(i64 200, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  br label %426

419:                                              ; preds = %406, %391
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %46) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #7
  br label %420

420:                                              ; preds = %419, %258
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #7
  br label %421

421:                                              ; preds = %420, %254
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #7
  br label %422

422:                                              ; preds = %421, %187
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #7
  br label %423

423:                                              ; preds = %422, %162
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  br label %424

424:                                              ; preds = %423, %158
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  br label %425

425:                                              ; preds = %424, %154
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @_ZN17meshopt_AllocatorD2Ev(ptr noundef nonnull align 8 dereferenceable(200) %28) #7
  call void @llvm.lifetime.end.p0(i64 200, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  br label %428

426:                                              ; preds = %417, %121
  %427 = load i64, ptr %13, align 8
  ret i64 %427

428:                                              ; preds = %425
  %429 = load ptr, ptr %30, align 8
  %430 = load i32, ptr %31, align 4
  %431 = insertvalue { ptr, i32 } poison, ptr %429, 0
  %432 = insertvalue { ptr, i32 } %431, i32 %430, 1
  resume { ptr, i32 } %432
}

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN7meshoptL16computeHistogramERA1024_A3_jPKfm(ptr noundef nonnull align 4 dereferenceable(12288), ptr noundef, i64 noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef nonnull align 4 dereferenceable(12288), i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN7meshoptL8bvhSplitEPKNS_6BVHBoxEPjS3_S3_PhmiPvPsPKjmmmf(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, float noundef) #4

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

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

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


; 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_Meshlet = type { i32, i32, i32, i32 }

@.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
@.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
@__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit = external hidden unnamed_addr constant [185 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [32 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 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) #3

declare i32 @__gxx_personality_v0(...)

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

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

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

; 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 #4

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

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

; Function Attrs: mustprogress uwtable
define dso_local i64 @meshopt_buildMeshletsSplit(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) local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %13 = alloca %class.meshopt_Allocator, align 8
  %14 = alloca [1024 x [3 x i32]], align 16
  %15 = alloca %struct.meshopt_Meshlet, align 4
  %16 = urem i64 %4, 3
  %17 = udiv i64 %4, 3
  %18 = icmp eq i64 %16, 0
  br i1 %18, label %20, label %19

19:                                               ; preds = %12
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 1306, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit) #6
  unreachable

20:                                               ; preds = %12
  %21 = add i64 %7, -12
  %22 = icmp ult i64 %21, 245
  br i1 %22, label %24, label %23

23:                                               ; preds = %20
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 1307, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit) #6
  unreachable

24:                                               ; preds = %20
  %25 = and i64 %7, 3
  %26 = icmp eq i64 %25, 0
  br i1 %26, label %28, label %27

27:                                               ; preds = %24
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 1308, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit) #6
  unreachable

28:                                               ; preds = %24
  %29 = add i64 %8, -3
  %30 = icmp ult i64 %29, 254
  br i1 %30, label %32, label %31

31:                                               ; preds = %28
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 1310, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit) #6
  unreachable

32:                                               ; preds = %28
  %.not = icmp eq i64 %9, 0
  br i1 %.not, label %.critedge, label %33

33:                                               ; preds = %32
  %34 = icmp ule i64 %9, %10
  %35 = icmp ult i64 %10, 513
  %or.cond = and i1 %34, %35
  br i1 %or.cond, label %36, label %.critedge

.critedge:                                        ; preds = %33, %32
  tail call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 1311, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit) #6
  unreachable

36:                                               ; preds = %33
  %37 = or i64 %10, %9
  %38 = and i64 %37, 3
  %39 = icmp eq i64 %38, 0
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  tail call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 1312, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit) #6
  unreachable

41:                                               ; preds = %36
  %42 = icmp eq i64 %4, 0
  br i1 %42, label %156, label %43

43:                                               ; preds = %41
  %44 = lshr exact i64 %7, 2
  call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %13) #7
  call void @_ZN17meshopt_AllocatorC2Ev(ptr noundef nonnull align 8 dereferenceable(200) %13)
  %45 = shl i64 %17, 2
  %46 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIfEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %13, i64 noundef %45)
          to label %47 unwind label %79

47:                                               ; preds = %43
  %48 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIN7meshopt6BVHBoxEEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %13, i64 noundef %17)
          to label %49 unwind label %81

49:                                               ; preds = %47
  call void @_ZN7meshoptL10bvhPrepareEPNS_6BVHBoxEPfPKjmPKfmm(ptr noundef %48, ptr noundef %46, ptr noundef %3, i64 noundef %17, ptr noundef %5, i64 noundef %6, i64 noundef %44)
  %50 = mul nuw i64 %17, 3
  %51 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIjEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %13, i64 noundef %50)
          to label %52 unwind label %83

52:                                               ; preds = %49
  %53 = getelementptr inbounds i32, ptr %46, i64 %50
  %.not193 = icmp ult i64 %4, 3
  call void @llvm.lifetime.start.p0(i64 12288, ptr nonnull %14) #7
  br i1 %.not193, label %.split.preheader, label %.split.us.preheader

.split.us.preheader:                              ; preds = %52
  invoke void @_ZN7meshoptL16computeHistogramERA1024_A3_jPKfm(ptr noundef nonnull align 4 dereferenceable(12288) %14, ptr noundef %46, i64 noundef %17)
          to label %.preheader173.us.preheader unwind label %.split181.us

.preheader173.us.preheader:                       ; preds = %.split.us.preheader
  %min.iters.check = icmp ult i64 %4, 24
  br i1 %min.iters.check, label %.preheader173.us.preheader246, label %vector.ph

.preheader173.us.preheader246:                    ; preds = %middle.block, %.preheader173.us.preheader
  %.0149178.us.ph = phi i64 [ 0, %.preheader173.us.preheader ], [ %n.vec, %middle.block ]
  br label %.preheader173.us

vector.ph:                                        ; preds = %.preheader173.us.preheader
  %n.vec = and i64 %17, 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>
  %54 = getelementptr inbounds i32, ptr %53, i64 %index
  %55 = getelementptr inbounds i8, ptr %54, i64 16
  store <4 x i32> %vec.ind, ptr %54, align 4, !tbaa !5
  store <4 x i32> %step.add, ptr %55, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %56 = icmp eq i64 %index.next, %n.vec
  br i1 %56, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %17, %n.vec
  br i1 %cmp.n, label %._crit_edge.us, label %.preheader173.us.preheader246

.split.preheader:                                 ; preds = %52
  invoke void @_ZN7meshoptL16computeHistogramERA1024_A3_jPKfm(ptr noundef nonnull align 4 dereferenceable(12288) %14, ptr noundef %46, i64 noundef %17)
          to label %.preheader173 unwind label %.split181

.preheader173.us:                                 ; preds = %.preheader173.us.preheader246, %.preheader173.us
  %.0149178.us = phi i64 [ %59, %.preheader173.us ], [ %.0149178.us.ph, %.preheader173.us.preheader246 ]
  %57 = trunc i64 %.0149178.us to i32
  %58 = getelementptr inbounds i32, ptr %53, i64 %.0149178.us
  store i32 %57, ptr %58, align 4, !tbaa !5
  %59 = add nuw nsw i64 %.0149178.us, 1
  %exitcond.not = icmp eq i64 %59, %17
  br i1 %exitcond.not, label %._crit_edge.us, label %.preheader173.us, !llvm.loop !13

._crit_edge.us:                                   ; preds = %.preheader173.us, %middle.block
  call void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef %51, ptr noundef nonnull %53, ptr noundef nonnull %46, i64 noundef %17, ptr noundef nonnull align 4 dereferenceable(12288) %14, i32 noundef 0)
  call void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef nonnull %53, ptr noundef %51, ptr noundef nonnull %46, i64 noundef %17, ptr noundef nonnull align 4 dereferenceable(12288) %14, i32 noundef 1)
  call void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef %51, ptr noundef nonnull %53, ptr noundef nonnull %46, i64 noundef %17, ptr noundef nonnull align 4 dereferenceable(12288) %14, i32 noundef 2)
  call void @llvm.lifetime.end.p0(i64 12288, ptr nonnull %14) #7
  %60 = getelementptr inbounds i32, ptr %51, i64 %17
  %61 = getelementptr inbounds float, ptr %46, i64 %17
  call void @llvm.lifetime.start.p0(i64 12288, ptr nonnull %14) #7
  invoke void @_ZN7meshoptL16computeHistogramERA1024_A3_jPKfm(ptr noundef nonnull align 4 dereferenceable(12288) %14, ptr noundef %61, i64 noundef %17)
          to label %.preheader173.us.1.preheader unwind label %.split181.us

.preheader173.us.1.preheader:                     ; preds = %._crit_edge.us
  %min.iters.check215 = icmp ult i64 %4, 24
  br i1 %min.iters.check215, label %.preheader173.us.1.preheader245, label %vector.ph216

vector.ph216:                                     ; preds = %.preheader173.us.1.preheader
  %n.vec218 = and i64 %17, 9223372036854775800
  br label %vector.body220

vector.body220:                                   ; preds = %vector.body220, %vector.ph216
  %index221 = phi i64 [ 0, %vector.ph216 ], [ %index.next226, %vector.body220 ]
  %vec.ind222 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph216 ], [ %vec.ind.next225, %vector.body220 ]
  %step.add223 = add <4 x i32> %vec.ind222, <i32 4, i32 4, i32 4, i32 4>
  %62 = getelementptr inbounds i32, ptr %53, i64 %index221
  %63 = getelementptr inbounds i8, ptr %62, i64 16
  store <4 x i32> %vec.ind222, ptr %62, align 4, !tbaa !5
  store <4 x i32> %step.add223, ptr %63, align 4, !tbaa !5
  %index.next226 = add nuw i64 %index221, 8
  %vec.ind.next225 = add <4 x i32> %vec.ind222, <i32 8, i32 8, i32 8, i32 8>
  %64 = icmp eq i64 %index.next226, %n.vec218
  br i1 %64, label %middle.block213, label %vector.body220, !llvm.loop !14

middle.block213:                                  ; preds = %vector.body220
  %cmp.n227 = icmp eq i64 %17, %n.vec218
  br i1 %cmp.n227, label %._crit_edge.us.1, label %.preheader173.us.1.preheader245

.preheader173.us.1.preheader245:                  ; preds = %middle.block213, %.preheader173.us.1.preheader
  %.0149178.us.1.ph = phi i64 [ 0, %.preheader173.us.1.preheader ], [ %n.vec218, %middle.block213 ]
  br label %.preheader173.us.1

.preheader173.us.1:                               ; preds = %.preheader173.us.1.preheader245, %.preheader173.us.1
  %.0149178.us.1 = phi i64 [ %67, %.preheader173.us.1 ], [ %.0149178.us.1.ph, %.preheader173.us.1.preheader245 ]
  %65 = trunc i64 %.0149178.us.1 to i32
  %66 = getelementptr inbounds i32, ptr %53, i64 %.0149178.us.1
  store i32 %65, ptr %66, align 4, !tbaa !5
  %67 = add nuw nsw i64 %.0149178.us.1, 1
  %exitcond.1.not = icmp eq i64 %67, %17
  br i1 %exitcond.1.not, label %._crit_edge.us.1, label %.preheader173.us.1, !llvm.loop !15

._crit_edge.us.1:                                 ; preds = %.preheader173.us.1, %middle.block213
  call void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef %60, ptr noundef nonnull %53, ptr noundef nonnull %61, i64 noundef %17, ptr noundef nonnull align 4 dereferenceable(12288) %14, i32 noundef 0)
  call void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef nonnull %53, ptr noundef %60, ptr noundef nonnull %61, i64 noundef %17, ptr noundef nonnull align 4 dereferenceable(12288) %14, i32 noundef 1)
  call void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef %60, ptr noundef nonnull %53, ptr noundef nonnull %61, i64 noundef %17, ptr noundef nonnull align 4 dereferenceable(12288) %14, i32 noundef 2)
  call void @llvm.lifetime.end.p0(i64 12288, ptr nonnull %14) #7
  %68 = shl nuw i64 %17, 1
  %69 = getelementptr inbounds i32, ptr %51, i64 %68
  %70 = getelementptr inbounds float, ptr %46, i64 %68
  call void @llvm.lifetime.start.p0(i64 12288, ptr nonnull %14) #7
  invoke void @_ZN7meshoptL16computeHistogramERA1024_A3_jPKfm(ptr noundef nonnull align 4 dereferenceable(12288) %14, ptr noundef %70, i64 noundef %17)
          to label %.preheader173.us.2.preheader unwind label %.split181.us

.preheader173.us.2.preheader:                     ; preds = %._crit_edge.us.1
  %min.iters.check230 = icmp ult i64 %4, 24
  br i1 %min.iters.check230, label %.preheader173.us.2.preheader244, label %vector.ph231

vector.ph231:                                     ; preds = %.preheader173.us.2.preheader
  %n.vec233 = and i64 %17, 9223372036854775800
  br label %vector.body235

vector.body235:                                   ; preds = %vector.body235, %vector.ph231
  %index236 = phi i64 [ 0, %vector.ph231 ], [ %index.next241, %vector.body235 ]
  %vec.ind237 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph231 ], [ %vec.ind.next240, %vector.body235 ]
  %step.add238 = add <4 x i32> %vec.ind237, <i32 4, i32 4, i32 4, i32 4>
  %71 = getelementptr inbounds i32, ptr %53, i64 %index236
  %72 = getelementptr inbounds i8, ptr %71, i64 16
  store <4 x i32> %vec.ind237, ptr %71, align 4, !tbaa !5
  store <4 x i32> %step.add238, ptr %72, align 4, !tbaa !5
  %index.next241 = add nuw i64 %index236, 8
  %vec.ind.next240 = add <4 x i32> %vec.ind237, <i32 8, i32 8, i32 8, i32 8>
  %73 = icmp eq i64 %index.next241, %n.vec233
  br i1 %73, label %middle.block228, label %vector.body235, !llvm.loop !16

middle.block228:                                  ; preds = %vector.body235
  %cmp.n242 = icmp eq i64 %17, %n.vec233
  br i1 %cmp.n242, label %._crit_edge.us.2, label %.preheader173.us.2.preheader244

.preheader173.us.2.preheader244:                  ; preds = %middle.block228, %.preheader173.us.2.preheader
  %.0149178.us.2.ph = phi i64 [ 0, %.preheader173.us.2.preheader ], [ %n.vec233, %middle.block228 ]
  br label %.preheader173.us.2

.preheader173.us.2:                               ; preds = %.preheader173.us.2.preheader244, %.preheader173.us.2
  %.0149178.us.2 = phi i64 [ %76, %.preheader173.us.2 ], [ %.0149178.us.2.ph, %.preheader173.us.2.preheader244 ]
  %74 = trunc i64 %.0149178.us.2 to i32
  %75 = getelementptr inbounds i32, ptr %53, i64 %.0149178.us.2
  store i32 %74, ptr %75, align 4, !tbaa !5
  %76 = add nuw nsw i64 %.0149178.us.2, 1
  %exitcond.2.not = icmp eq i64 %76, %17
  br i1 %exitcond.2.not, label %._crit_edge.us.2, label %.preheader173.us.2, !llvm.loop !17

._crit_edge.us.2:                                 ; preds = %.preheader173.us.2, %middle.block228
  call void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef %69, ptr noundef nonnull %53, ptr noundef nonnull %70, i64 noundef %17, ptr noundef nonnull align 4 dereferenceable(12288) %14, i32 noundef 0)
  call void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef nonnull %53, ptr noundef %69, ptr noundef nonnull %70, i64 noundef %17, ptr noundef nonnull align 4 dereferenceable(12288) %14, i32 noundef 1)
  call void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef %69, ptr noundef nonnull %53, ptr noundef nonnull %70, i64 noundef %17, ptr noundef nonnull align 4 dereferenceable(12288) %14, i32 noundef 2)
  call void @llvm.lifetime.end.p0(i64 12288, ptr nonnull %14) #7
  br label %.split183.us

.split181.us:                                     ; preds = %._crit_edge.us.1, %._crit_edge.us, %.split.us.preheader
  %77 = landingpad { ptr, i32 }
          cleanup
  br label %91

.split183.us:                                     ; preds = %._crit_edge.us.2, %.preheader173.2
  %78 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIsEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %13, i64 noundef %6)
          to label %92 unwind label %101

79:                                               ; preds = %43
  %80 = landingpad { ptr, i32 }
          cleanup
  br label %155

81:                                               ; preds = %47
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %155

83:                                               ; preds = %49
  %84 = landingpad { ptr, i32 }
          cleanup
  br label %155

.preheader173:                                    ; preds = %.split.preheader
  call void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef %51, ptr noundef %53, ptr noundef %46, i64 noundef %17, ptr noundef nonnull align 4 dereferenceable(12288) %14, i32 noundef 0)
  call void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef %53, ptr noundef %51, ptr noundef %46, i64 noundef %17, ptr noundef nonnull align 4 dereferenceable(12288) %14, i32 noundef 1)
  call void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef %51, ptr noundef %53, ptr noundef %46, i64 noundef %17, ptr noundef nonnull align 4 dereferenceable(12288) %14, i32 noundef 2)
  call void @llvm.lifetime.end.p0(i64 12288, ptr nonnull %14) #7
  %85 = getelementptr inbounds float, ptr %46, i64 %17
  call void @llvm.lifetime.start.p0(i64 12288, ptr nonnull %14) #7
  invoke void @_ZN7meshoptL16computeHistogramERA1024_A3_jPKfm(ptr noundef nonnull align 4 dereferenceable(12288) %14, ptr noundef %85, i64 noundef %17)
          to label %.preheader173.1 unwind label %.split181

.preheader173.1:                                  ; preds = %.preheader173
  %86 = getelementptr inbounds i32, ptr %51, i64 %17
  call void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef %86, ptr noundef %53, ptr noundef %85, i64 noundef %17, ptr noundef nonnull align 4 dereferenceable(12288) %14, i32 noundef 0)
  call void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef %53, ptr noundef %86, ptr noundef %85, i64 noundef %17, ptr noundef nonnull align 4 dereferenceable(12288) %14, i32 noundef 1)
  call void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef %86, ptr noundef %53, ptr noundef %85, i64 noundef %17, ptr noundef nonnull align 4 dereferenceable(12288) %14, i32 noundef 2)
  call void @llvm.lifetime.end.p0(i64 12288, ptr nonnull %14) #7
  %87 = shl nuw nsw i64 %17, 1
  %88 = getelementptr inbounds float, ptr %46, i64 %87
  call void @llvm.lifetime.start.p0(i64 12288, ptr nonnull %14) #7
  invoke void @_ZN7meshoptL16computeHistogramERA1024_A3_jPKfm(ptr noundef nonnull align 4 dereferenceable(12288) %14, ptr noundef %88, i64 noundef %17)
          to label %.preheader173.2 unwind label %.split181

.preheader173.2:                                  ; preds = %.preheader173.1
  %89 = getelementptr inbounds i32, ptr %51, i64 %87
  call void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef %89, ptr noundef %53, ptr noundef %88, i64 noundef %17, ptr noundef nonnull align 4 dereferenceable(12288) %14, i32 noundef 0)
  call void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef %53, ptr noundef %89, ptr noundef %88, i64 noundef %17, ptr noundef nonnull align 4 dereferenceable(12288) %14, i32 noundef 1)
  call void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef %89, ptr noundef %53, ptr noundef %88, i64 noundef %17, ptr noundef nonnull align 4 dereferenceable(12288) %14, i32 noundef 2)
  call void @llvm.lifetime.end.p0(i64 12288, ptr nonnull %14) #7
  br label %.split183.us

.split181:                                        ; preds = %.preheader173.1, %.preheader173, %.split.preheader
  %90 = landingpad { ptr, i32 }
          cleanup
  br label %91

91:                                               ; preds = %.split181.us, %.split181
  %.us-phi = phi { ptr, i32 } [ %90, %.split181 ], [ %77, %.split181.us ]
  call void @llvm.lifetime.end.p0(i64 12288, ptr nonnull %14) #7
  br label %155

92:                                               ; preds = %.split183.us
  %93 = shl i64 %6, 1
  call void @llvm.memset.p0.i64(ptr align 2 %78, i8 -1, i64 %93, i1 false)
  %94 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIhEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %13, i64 noundef %17)
          to label %95 unwind label %103

95:                                               ; preds = %92
  %96 = getelementptr inbounds i32, ptr %51, i64 %17
  %.idx = shl i64 %17, 3
  %97 = getelementptr inbounds i8, ptr %51, i64 %.idx
  invoke void @_ZN7meshoptL8bvhSplitEPKNS_6BVHBoxEPjS3_S3_PhmiPvPsPKjmmmf(ptr noundef %48, ptr noundef %51, ptr noundef %96, ptr noundef %97, ptr noundef %94, i64 noundef %17, i32 noundef 0, ptr noundef %46, ptr noundef %78, ptr noundef %3, i64 noundef %8, i64 noundef %9, i64 noundef %10, float noundef %11)
          to label %.preheader unwind label %103

.preheader:                                       ; preds = %95
  br i1 %.not193, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %.preheader
  %98 = call i64 @meshopt_buildMeshletsBound(i64 noundef %4, i64 noundef %8, i64 noundef %9)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #7
  br label %.thread

._crit_edge:                                      ; preds = %109
  %99 = call i64 @meshopt_buildMeshletsBound(i64 noundef %4, i64 noundef %8, i64 noundef %9)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %15, i8 0, i64 16, i1 false)
  br i1 %.not193, label %.thread, label %.lr.ph190

.lr.ph190:                                        ; preds = %._crit_edge
  %100 = icmp ule i64 %111, %99
  br label %114

101:                                              ; preds = %.split183.us
  %102 = landingpad { ptr, i32 }
          cleanup
  br label %155

103:                                              ; preds = %95, %92
  %104 = landingpad { ptr, i32 }
          cleanup
  br label %155

.lr.ph:                                           ; preds = %.preheader, %109
  %.0147185 = phi i64 [ %112, %109 ], [ 0, %.preheader ]
  %.0148184 = phi i64 [ %111, %109 ], [ 0, %.preheader ]
  %105 = getelementptr inbounds i8, ptr %94, i64 %.0147185
  %106 = load i8, ptr %105, align 1, !tbaa !18
  %107 = icmp ult i8 %106, 2
  br i1 %107, label %109, label %108

108:                                              ; preds = %.lr.ph
  call void @__assert_fail(ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.1, i32 noundef 1363, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit) #6
  unreachable

109:                                              ; preds = %.lr.ph
  %110 = zext nneg i8 %106 to i64
  %111 = add i64 %.0148184, %110
  %112 = add nuw nsw i64 %.0147185, 1
  %exitcond202.not = icmp eq i64 %112, %17
  br i1 %exitcond202.not, label %._crit_edge, label %.lr.ph, !llvm.loop !19

._crit_edge191:                                   ; preds = %141
  %.phi.trans.insert = getelementptr inbounds i8, ptr %15, i64 12
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !20
  %113 = icmp eq i32 %.pre, 0
  br i1 %113, label %153, label %150

114:                                              ; preds = %.lr.ph190, %141
  %.0143188 = phi i64 [ 0, %.lr.ph190 ], [ %147, %141 ]
  %.0144187 = phi i64 [ %111, %.lr.ph190 ], [ %146, %141 ]
  %.0145186 = phi i64 [ 0, %.lr.ph190 ], [ %143, %141 ]
  %115 = getelementptr inbounds i8, ptr %94, i64 %.0143188
  %116 = load i8, ptr %115, align 1, !tbaa !18
  %117 = icmp ult i8 %116, 2
  br i1 %117, label %119, label %118

118:                                              ; preds = %114
  call void @__assert_fail(ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.1, i32 noundef 1376, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit) #6
  unreachable

119:                                              ; preds = %114
  %120 = getelementptr inbounds i32, ptr %51, i64 %.0143188
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = zext i32 %121 to i64
  %123 = icmp ugt i64 %17, %122
  br i1 %123, label %125, label %124

124:                                              ; preds = %119
  call void @__assert_fail(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.1, i32 noundef 1384, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit) #6
  unreachable

125:                                              ; preds = %119
  %.not161 = icmp ne i64 %.0143188, 0
  %126 = icmp eq i8 %116, 1
  %spec.select = and i1 %.not161, %126
  %not.spec.select = xor i1 %spec.select, true
  %or.cond170 = select i1 %not.spec.select, i1 true, i1 %100
  %127 = add i64 %.0144187, %.0145186
  %.not162 = icmp ult i64 %127, %99
  %or.cond171 = select i1 %or.cond170, i1 true, i1 %.not162
  %spec.select172 = and i1 %spec.select, %or.cond171
  %128 = mul i32 %121, 3
  %129 = zext i32 %128 to i64
  %130 = getelementptr inbounds i32, ptr %3, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = add i32 %128, 1
  %133 = zext i32 %132 to i64
  %134 = getelementptr inbounds i32, ptr %3, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = add i32 %128, 2
  %137 = zext i32 %136 to i64
  %138 = getelementptr inbounds i32, ptr %3, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = invoke noundef zeroext i1 @_ZN7meshoptL13appendMeshletER15meshopt_MeshletjjjPsPS0_PjPhmmmb(ptr noundef nonnull align 4 dereferenceable(16) %15, i32 noundef %131, i32 noundef %135, i32 noundef %139, ptr noundef %78, ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %.0145186, i64 noundef %8, i64 noundef %10, i1 noundef zeroext %spec.select172)
          to label %141 unwind label %148

141:                                              ; preds = %125
  %142 = zext i1 %140 to i64
  %143 = add i64 %.0145186, %142
  %144 = load i8, ptr %115, align 1, !tbaa !18
  %145 = zext i8 %144 to i64
  %146 = sub i64 %.0144187, %145
  %147 = add nuw nsw i64 %.0143188, 1
  %exitcond203.not = icmp eq i64 %147, %17
  br i1 %exitcond203.not, label %._crit_edge191, label %114, !llvm.loop !22

148:                                              ; preds = %125
  %149 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #7
  br label %155

150:                                              ; preds = %._crit_edge191
  call void @_ZN7meshoptL13finishMeshletER15meshopt_MeshletPh(ptr noundef nonnull align 4 dereferenceable(16) %15, ptr noundef %2)
  %151 = add i64 %143, 1
  %152 = getelementptr inbounds %struct.meshopt_Meshlet, ptr %0, i64 %143
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %152, ptr noundef nonnull align 4 dereferenceable(16) %15, i64 16, i1 false), !tbaa.struct !23
  br label %153

153:                                              ; preds = %150, %._crit_edge191
  %.1146 = phi i64 [ %151, %150 ], [ %143, %._crit_edge191 ]
  %.not160 = icmp ugt i64 %.1146, %99
  br i1 %.not160, label %154, label %.thread

154:                                              ; preds = %153
  call void @__assert_fail(ptr noundef nonnull @.str.18, ptr noundef nonnull @.str.1, i32 noundef 1400, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_buildMeshletsSplit) #6
  unreachable

.thread:                                          ; preds = %._crit_edge, %._crit_edge.thread, %153
  %.1146209 = phi i64 [ %.1146, %153 ], [ 0, %._crit_edge.thread ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #7
  call void @_ZN17meshopt_AllocatorD2Ev(ptr noundef nonnull align 8 dereferenceable(200) %13) #7
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %13) #7
  br label %156

155:                                              ; preds = %81, %91, %103, %148, %101, %83, %79
  %.pn165.pn.pn.pn = phi { ptr, i32 } [ %80, %79 ], [ %82, %81 ], [ %84, %83 ], [ %.us-phi, %91 ], [ %102, %101 ], [ %149, %148 ], [ %104, %103 ]
  call void @_ZN17meshopt_AllocatorD2Ev(ptr noundef nonnull align 8 dereferenceable(200) %13) #7
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %13) #7
  resume { ptr, i32 } %.pn165.pn.pn.pn

156:                                              ; preds = %41, %.thread
  %.0 = phi i64 [ %.1146209, %.thread ], [ 0, %41 ]
  ret i64 %.0
}

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN7meshoptL16computeHistogramERA1024_A3_jPKfm(ptr noundef nonnull align 4 dereferenceable(12288), ptr noundef, i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN7meshoptL9radixPassEPjPKjPKfmRA1024_A3_ji(ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef nonnull align 4 dereferenceable(12288), i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN7meshoptL8bvhSplitEPKNS_6BVHBoxEPjS3_S3_PhmiPvPsPKjmmmf(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, float noundef) local_unnamed_addr #4

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

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

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


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