; 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"

@.str.1 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [39 x i8], align 1
@__PRETTY_FUNCTION__.meshopt_optimizeMeshlet = external hidden unnamed_addr constant [78 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [30 x i8], align 1

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @meshopt_optimizeMeshlet(ptr noundef %0, ptr noundef %1, i64 noundef %2, i64 noundef %3) #4 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca [256 x i8], align 16
  %12 = alloca i8, align 1
  %13 = alloca i8, align 1
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %19 = alloca i8, align 1
  %20 = alloca i8, align 1
  %21 = alloca i8, align 1
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i8, align 1
  %26 = alloca i8, align 1
  %27 = alloca i8, align 1
  %28 = alloca [256 x i32], align 16
  %29 = alloca [256 x i16], align 16
  %30 = alloca i64, align 8
  %31 = alloca i64, align 8
  %32 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i64 %2, ptr %7, align 8, !tbaa !9
  store i64 %3, ptr %8, align 8, !tbaa !9
  %33 = load i64, ptr %7, align 8, !tbaa !9
  %34 = icmp ule i64 %33, 512
  br i1 %34, label %35, label %36

35:                                               ; preds = %4
  br label %38

36:                                               ; preds = %4
  call void @__assert_fail(ptr noundef @.str.21, ptr noundef @.str.1, i32 noundef 1611, ptr noundef @__PRETTY_FUNCTION__.meshopt_optimizeMeshlet) #5
  unreachable

37:                                               ; No predecessors!
  br label %38

38:                                               ; preds = %37, %35
  %39 = load i64, ptr %8, align 8, !tbaa !9
  %40 = icmp ule i64 %39, 256
  br i1 %40, label %41, label %42

41:                                               ; preds = %38
  br label %44

42:                                               ; preds = %38
  call void @__assert_fail(ptr noundef @.str.27, ptr noundef @.str.1, i32 noundef 1612, ptr noundef @__PRETTY_FUNCTION__.meshopt_optimizeMeshlet) #5
  unreachable

43:                                               ; No predecessors!
  br label %44

44:                                               ; preds = %43, %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %45, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %46, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 256, ptr %11) #6
  %47 = getelementptr inbounds [256 x i8], ptr %11, i64 0, i64 0
  %48 = load i64, ptr %8, align 8, !tbaa !9
  call void @llvm.memset.p0.i64(ptr align 16 %47, i8 0, i64 %48, i1 false)
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #6
  store i8 -128, ptr %12, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #6
  store i8 3, ptr %13, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %49

49:                                               ; preds = %238, %44
  %50 = load i64, ptr %14, align 8, !tbaa !9
  %51 = load i64, ptr %7, align 8, !tbaa !9
  %52 = icmp ult i64 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  store i32 2, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %241

54:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 -1, ptr %16, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 -1, ptr %17, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %55 = load i64, ptr %14, align 8, !tbaa !9
  store i64 %55, ptr %18, align 8, !tbaa !9
  br label %56

56:                                               ; preds = %159, %54
  %57 = load i64, ptr %18, align 8, !tbaa !9
  %58 = load i64, ptr %7, align 8, !tbaa !9
  %59 = icmp ult i64 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  store i32 5, ptr %15, align 4
  br label %162

61:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #6
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = load i64, ptr %18, align 8, !tbaa !9
  %64 = mul i64 %63, 3
  %65 = add i64 %64, 0
  %66 = getelementptr inbounds i8, ptr %62, i64 %65
  %67 = load i8, ptr %66, align 1, !tbaa !11
  store i8 %67, ptr %19, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #6
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = load i64, ptr %18, align 8, !tbaa !9
  %70 = mul i64 %69, 3
  %71 = add i64 %70, 1
  %72 = getelementptr inbounds i8, ptr %68, i64 %71
  %73 = load i8, ptr %72, align 1, !tbaa !11
  store i8 %73, ptr %20, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #6
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  %75 = load i64, ptr %18, align 8, !tbaa !9
  %76 = mul i64 %75, 3
  %77 = add i64 %76, 2
  %78 = getelementptr inbounds i8, ptr %74, i64 %77
  %79 = load i8, ptr %78, align 1, !tbaa !11
  store i8 %79, ptr %21, align 1, !tbaa !11
  %80 = load i8, ptr %19, align 1, !tbaa !11
  %81 = zext i8 %80 to i64
  %82 = load i64, ptr %8, align 8, !tbaa !9
  %83 = icmp ult i64 %81, %82
  br i1 %83, label %84, label %94

84:                                               ; preds = %61
  %85 = load i8, ptr %20, align 1, !tbaa !11
  %86 = zext i8 %85 to i64
  %87 = load i64, ptr %8, align 8, !tbaa !9
  %88 = icmp ult i64 %86, %87
  br i1 %88, label %89, label %94

89:                                               ; preds = %84
  %90 = load i8, ptr %21, align 1, !tbaa !11
  %91 = zext i8 %90 to i64
  %92 = load i64, ptr %8, align 8, !tbaa !9
  %93 = icmp ult i64 %91, %92
  br label %94

94:                                               ; preds = %89, %84, %61
  %95 = phi i1 [ false, %84 ], [ false, %61 ], [ %93, %89 ]
  br i1 %95, label %96, label %97

96:                                               ; preds = %94
  br label %99

97:                                               ; preds = %94
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.1, i32 noundef 1633, ptr noundef @__PRETTY_FUNCTION__.meshopt_optimizeMeshlet) #5
  unreachable

98:                                               ; No predecessors!
  br label %99

99:                                               ; preds = %98, %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %100 = load i8, ptr %12, align 1, !tbaa !11
  %101 = zext i8 %100 to i32
  %102 = load i8, ptr %19, align 1, !tbaa !11
  %103 = zext i8 %102 to i64
  %104 = getelementptr inbounds [256 x i8], ptr %11, i64 0, i64 %103
  %105 = load i8, ptr %104, align 1, !tbaa !11
  %106 = zext i8 %105 to i32
  %107 = sub nsw i32 %101, %106
  %108 = trunc i32 %107 to i8
  %109 = zext i8 %108 to i32
  %110 = icmp slt i32 %109, 3
  %111 = zext i1 %110 to i32
  store i32 %111, ptr %22, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %112 = load i8, ptr %12, align 1, !tbaa !11
  %113 = zext i8 %112 to i32
  %114 = load i8, ptr %20, align 1, !tbaa !11
  %115 = zext i8 %114 to i64
  %116 = getelementptr inbounds [256 x i8], ptr %11, i64 0, i64 %115
  %117 = load i8, ptr %116, align 1, !tbaa !11
  %118 = zext i8 %117 to i32
  %119 = sub nsw i32 %113, %118
  %120 = trunc i32 %119 to i8
  %121 = zext i8 %120 to i32
  %122 = icmp slt i32 %121, 3
  %123 = zext i1 %122 to i32
  store i32 %123, ptr %23, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %124 = load i8, ptr %12, align 1, !tbaa !11
  %125 = zext i8 %124 to i32
  %126 = load i8, ptr %21, align 1, !tbaa !11
  %127 = zext i8 %126 to i64
  %128 = getelementptr inbounds [256 x i8], ptr %11, i64 0, i64 %127
  %129 = load i8, ptr %128, align 1, !tbaa !11
  %130 = zext i8 %129 to i32
  %131 = sub nsw i32 %125, %130
  %132 = trunc i32 %131 to i8
  %133 = zext i8 %132 to i32
  %134 = icmp slt i32 %133, 3
  %135 = zext i1 %134 to i32
  store i32 %135, ptr %24, align 4, !tbaa !12
  %136 = load i32, ptr %22, align 4, !tbaa !12
  %137 = load i32, ptr %23, align 4, !tbaa !12
  %138 = add nsw i32 %136, %137
  %139 = load i32, ptr %24, align 4, !tbaa !12
  %140 = add nsw i32 %138, %139
  %141 = load i32, ptr %17, align 4, !tbaa !12
  %142 = icmp sgt i32 %140, %141
  br i1 %142, label %143, label %155

143:                                              ; preds = %99
  %144 = load i64, ptr %18, align 8, !tbaa !9
  %145 = trunc i64 %144 to i32
  store i32 %145, ptr %16, align 4, !tbaa !12
  %146 = load i32, ptr %22, align 4, !tbaa !12
  %147 = load i32, ptr %23, align 4, !tbaa !12
  %148 = add nsw i32 %146, %147
  %149 = load i32, ptr %24, align 4, !tbaa !12
  %150 = add nsw i32 %148, %149
  store i32 %150, ptr %17, align 4, !tbaa !12
  %151 = load i32, ptr %17, align 4, !tbaa !12
  %152 = icmp sge i32 %151, 2
  br i1 %152, label %153, label %154

153:                                              ; preds = %143
  store i32 5, ptr %15, align 4
  br label %156

154:                                              ; preds = %143
  br label %155

155:                                              ; preds = %154, %99
  store i32 0, ptr %15, align 4
  br label %156

156:                                              ; preds = %155, %153
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #6
  %157 = load i32, ptr %15, align 4
  switch i32 %157, label %162 [
    i32 0, label %158
  ]

158:                                              ; preds = %156
  br label %159

159:                                              ; preds = %158
  %160 = load i64, ptr %18, align 8, !tbaa !9
  %161 = add i64 %160, 1
  store i64 %161, ptr %18, align 8, !tbaa !9
  br label %56, !llvm.loop !14

162:                                              ; preds = %156, %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %163

163:                                              ; preds = %162
  %164 = load i32, ptr %16, align 4, !tbaa !12
  %165 = icmp sge i32 %164, 0
  br i1 %165, label %166, label %167

166:                                              ; preds = %163
  br label %169

167:                                              ; preds = %163
  call void @__assert_fail(ptr noundef @.str.28, ptr noundef @.str.1, i32 noundef 1652, ptr noundef @__PRETTY_FUNCTION__.meshopt_optimizeMeshlet) #5
  unreachable

168:                                              ; No predecessors!
  br label %169

169:                                              ; preds = %168, %166
  call void @llvm.lifetime.start.p0(i64 1, ptr %25) #6
  %170 = load ptr, ptr %9, align 8, !tbaa !5
  %171 = load i32, ptr %16, align 4, !tbaa !12
  %172 = mul nsw i32 %171, 3
  %173 = add nsw i32 %172, 0
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds i8, ptr %170, i64 %174
  %176 = load i8, ptr %175, align 1, !tbaa !11
  store i8 %176, ptr %25, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %26) #6
  %177 = load ptr, ptr %9, align 8, !tbaa !5
  %178 = load i32, ptr %16, align 4, !tbaa !12
  %179 = mul nsw i32 %178, 3
  %180 = add nsw i32 %179, 1
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds i8, ptr %177, i64 %181
  %183 = load i8, ptr %182, align 1, !tbaa !11
  store i8 %183, ptr %26, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %27) #6
  %184 = load ptr, ptr %9, align 8, !tbaa !5
  %185 = load i32, ptr %16, align 4, !tbaa !12
  %186 = mul nsw i32 %185, 3
  %187 = add nsw i32 %186, 2
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds i8, ptr %184, i64 %188
  %190 = load i8, ptr %189, align 1, !tbaa !11
  store i8 %190, ptr %27, align 1, !tbaa !11
  %191 = load ptr, ptr %9, align 8, !tbaa !5
  %192 = load i64, ptr %14, align 8, !tbaa !9
  %193 = add i64 %192, 1
  %194 = mul i64 %193, 3
  %195 = getelementptr inbounds i8, ptr %191, i64 %194
  %196 = load ptr, ptr %9, align 8, !tbaa !5
  %197 = load i64, ptr %14, align 8, !tbaa !9
  %198 = mul i64 %197, 3
  %199 = getelementptr inbounds i8, ptr %196, i64 %198
  %200 = load i32, ptr %16, align 4, !tbaa !12
  %201 = sext i32 %200 to i64
  %202 = load i64, ptr %14, align 8, !tbaa !9
  %203 = sub i64 %201, %202
  %204 = mul i64 %203, 3
  %205 = mul i64 %204, 1
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %195, ptr align 1 %199, i64 %205, i1 false)
  %206 = load i8, ptr %25, align 1, !tbaa !11
  %207 = load ptr, ptr %9, align 8, !tbaa !5
  %208 = load i64, ptr %14, align 8, !tbaa !9
  %209 = mul i64 %208, 3
  %210 = add i64 %209, 0
  %211 = getelementptr inbounds i8, ptr %207, i64 %210
  store i8 %206, ptr %211, align 1, !tbaa !11
  %212 = load i8, ptr %26, align 1, !tbaa !11
  %213 = load ptr, ptr %9, align 8, !tbaa !5
  %214 = load i64, ptr %14, align 8, !tbaa !9
  %215 = mul i64 %214, 3
  %216 = add i64 %215, 1
  %217 = getelementptr inbounds i8, ptr %213, i64 %216
  store i8 %212, ptr %217, align 1, !tbaa !11
  %218 = load i8, ptr %27, align 1, !tbaa !11
  %219 = load ptr, ptr %9, align 8, !tbaa !5
  %220 = load i64, ptr %14, align 8, !tbaa !9
  %221 = mul i64 %220, 3
  %222 = add i64 %221, 2
  %223 = getelementptr inbounds i8, ptr %219, i64 %222
  store i8 %218, ptr %223, align 1, !tbaa !11
  %224 = load i8, ptr %12, align 1, !tbaa !11
  %225 = add i8 %224, 1
  store i8 %225, ptr %12, align 1, !tbaa !11
  %226 = load i8, ptr %12, align 1, !tbaa !11
  %227 = load i8, ptr %25, align 1, !tbaa !11
  %228 = zext i8 %227 to i64
  %229 = getelementptr inbounds [256 x i8], ptr %11, i64 0, i64 %228
  store i8 %226, ptr %229, align 1, !tbaa !11
  %230 = load i8, ptr %12, align 1, !tbaa !11
  %231 = load i8, ptr %26, align 1, !tbaa !11
  %232 = zext i8 %231 to i64
  %233 = getelementptr inbounds [256 x i8], ptr %11, i64 0, i64 %232
  store i8 %230, ptr %233, align 1, !tbaa !11
  %234 = load i8, ptr %12, align 1, !tbaa !11
  %235 = load i8, ptr %27, align 1, !tbaa !11
  %236 = zext i8 %235 to i64
  %237 = getelementptr inbounds [256 x i8], ptr %11, i64 0, i64 %236
  store i8 %234, ptr %237, align 1, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %238

238:                                              ; preds = %169
  %239 = load i64, ptr %14, align 8, !tbaa !9
  %240 = add i64 %239, 1
  store i64 %240, ptr %14, align 8, !tbaa !9
  br label %49, !llvm.loop !16

241:                                              ; preds = %53
  call void @llvm.lifetime.start.p0(i64 1024, ptr %28) #6
  call void @llvm.lifetime.start.p0(i64 512, ptr %29) #6
  %242 = getelementptr inbounds [256 x i16], ptr %29, i64 0, i64 0
  %243 = load i64, ptr %8, align 8, !tbaa !9
  %244 = mul i64 %243, 2
  call void @llvm.memset.p0.i64(ptr align 16 %242, i8 -1, i64 %244, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  store i64 0, ptr %30, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #6
  store i64 0, ptr %31, align 8, !tbaa !9
  br label %245

245:                                              ; preds = %285, %241
  %246 = load i64, ptr %31, align 8, !tbaa !9
  %247 = load i64, ptr %7, align 8, !tbaa !9
  %248 = mul i64 %247, 3
  %249 = icmp ult i64 %246, %248
  br i1 %249, label %251, label %250

250:                                              ; preds = %245
  store i32 8, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  br label %288

251:                                              ; preds = %245
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #6
  %252 = load ptr, ptr %9, align 8, !tbaa !5
  %253 = load i64, ptr %31, align 8, !tbaa !9
  %254 = getelementptr inbounds i8, ptr %252, i64 %253
  %255 = load i8, ptr %254, align 1, !tbaa !11
  %256 = zext i8 %255 to i64
  %257 = getelementptr inbounds [256 x i16], ptr %29, i64 0, i64 %256
  store ptr %257, ptr %32, align 8, !tbaa !5
  %258 = load ptr, ptr %32, align 8, !tbaa !5
  %259 = load i16, ptr %258, align 2, !tbaa !17
  %260 = sext i16 %259 to i32
  %261 = icmp slt i32 %260, 0
  br i1 %261, label %262, label %278

262:                                              ; preds = %251
  %263 = load i64, ptr %30, align 8, !tbaa !9
  %264 = trunc i64 %263 to i16
  %265 = load ptr, ptr %32, align 8, !tbaa !5
  store i16 %264, ptr %265, align 2, !tbaa !17
  %266 = load ptr, ptr %10, align 8, !tbaa !5
  %267 = load ptr, ptr %9, align 8, !tbaa !5
  %268 = load i64, ptr %31, align 8, !tbaa !9
  %269 = getelementptr inbounds i8, ptr %267, i64 %268
  %270 = load i8, ptr %269, align 1, !tbaa !11
  %271 = zext i8 %270 to i64
  %272 = getelementptr inbounds i32, ptr %266, i64 %271
  %273 = load i32, ptr %272, align 4, !tbaa !12
  %274 = load i64, ptr %30, align 8, !tbaa !9
  %275 = getelementptr inbounds [256 x i32], ptr %28, i64 0, i64 %274
  store i32 %273, ptr %275, align 4, !tbaa !12
  %276 = load i64, ptr %30, align 8, !tbaa !9
  %277 = add i64 %276, 1
  store i64 %277, ptr %30, align 8, !tbaa !9
  br label %278

278:                                              ; preds = %262, %251
  %279 = load ptr, ptr %32, align 8, !tbaa !5
  %280 = load i16, ptr %279, align 2, !tbaa !17
  %281 = trunc i16 %280 to i8
  %282 = load ptr, ptr %9, align 8, !tbaa !5
  %283 = load i64, ptr %31, align 8, !tbaa !9
  %284 = getelementptr inbounds i8, ptr %282, i64 %283
  store i8 %281, ptr %284, align 1, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  br label %285

285:                                              ; preds = %278
  %286 = load i64, ptr %31, align 8, !tbaa !9
  %287 = add i64 %286, 1
  store i64 %287, ptr %31, align 8, !tbaa !9
  br label %245, !llvm.loop !19

288:                                              ; preds = %250
  %289 = load i64, ptr %30, align 8, !tbaa !9
  %290 = load i64, ptr %8, align 8, !tbaa !9
  %291 = icmp ule i64 %289, %290
  br i1 %291, label %292, label %293

292:                                              ; preds = %288
  br label %295

293:                                              ; preds = %288
  call void @__assert_fail(ptr noundef @.str.29, ptr noundef @.str.1, i32 noundef 1693, ptr noundef @__PRETTY_FUNCTION__.meshopt_optimizeMeshlet) #5
  unreachable

294:                                              ; No predecessors!
  br label %295

295:                                              ; preds = %294, %292
  %296 = load ptr, ptr %10, align 8, !tbaa !5
  %297 = getelementptr inbounds [256 x i32], ptr %28, i64 0, i64 0
  %298 = load i64, ptr %30, align 8, !tbaa !9
  %299 = mul i64 %298, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %296, ptr align 16 %297, i64 %299, i1 false)
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 1024, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  ret void
}

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { noreturn nounwind }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = !{!18, !18, i64 0}
!18 = !{!"short", !7, i64 0}
!19 = distinct !{!19, !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"

@.str.1 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [39 x i8], align 1
@__PRETTY_FUNCTION__.meshopt_optimizeMeshlet = external hidden unnamed_addr constant [78 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [30 x i8], align 1

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @meshopt_optimizeMeshlet(ptr nocapture noundef %0, ptr nocapture noundef %1, i64 noundef %2, i64 noundef %3) local_unnamed_addr #4 {
  %5 = alloca [256 x i8], align 16
  %6 = alloca [256 x i32], align 16
  %7 = alloca [256 x i16], align 16
  %8 = icmp ult i64 %2, 513
  br i1 %8, label %10, label %9

9:                                                ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str.21, ptr noundef nonnull @.str.1, i32 noundef 1611, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_optimizeMeshlet) #6
  unreachable

10:                                               ; preds = %4
  %11 = icmp ult i64 %3, 257
  br i1 %11, label %13, label %12

12:                                               ; preds = %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.27, ptr noundef nonnull @.str.1, i32 noundef 1612, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_optimizeMeshlet) #6
  unreachable

13:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %5) #7
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %5, i8 0, i64 %3, i1 false)
  %.not114 = icmp eq i64 %2, 0
  br i1 %.not114, label %._crit_edge113.thread, label %.preheader

._crit_edge113.thread:                            ; preds = %13
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %7) #7
  br label %102

.preheader:                                       ; preds = %13, %59
  %.0109 = phi i8 [ %78, %59 ], [ -128, %13 ]
  %.091108 = phi i64 [ %68, %59 ], [ 0, %13 ]
  br label %16

.lr.ph.preheader:                                 ; preds = %59
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %7) #7
  %14 = shl nuw nsw i64 %3, 1
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %7, i8 -1, i64 %14, i1 false)
  %15 = mul nuw nsw i64 %2, 3
  br label %.lr.ph

16:                                               ; preds = %.preheader, %53
  %.093107 = phi i32 [ -1, %.preheader ], [ %.2, %53 ]
  %.095106 = phi i32 [ -1, %.preheader ], [ %.297, %53 ]
  %.098105 = phi i64 [ %.091108, %.preheader ], [ %54, %53 ]
  %17 = mul nuw nsw i64 %.098105, 3
  %18 = getelementptr inbounds i8, ptr %1, i64 %17
  %19 = load i8, ptr %18, align 1, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %18, i64 2
  %21 = load i8, ptr %20, align 1, !tbaa !5
  %22 = zext i8 %19 to i64
  %23 = icmp ult i64 %22, %3
  br i1 %23, label %24, label %.critedge

24:                                               ; preds = %16
  %25 = getelementptr inbounds i8, ptr %18, i64 1
  %26 = load i8, ptr %25, align 1, !tbaa !5
  %27 = zext i8 %26 to i64
  %28 = icmp ult i64 %27, %3
  br i1 %28, label %29, label %.critedge

29:                                               ; preds = %24
  %30 = zext i8 %21 to i64
  %31 = icmp ult i64 %30, %3
  br i1 %31, label %32, label %.critedge

.critedge:                                        ; preds = %24, %16, %29
  tail call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.1, i32 noundef 1633, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_optimizeMeshlet) #6
  unreachable

32:                                               ; preds = %29
  %33 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 %22
  %34 = load i8, ptr %33, align 1, !tbaa !5
  %35 = sub i8 %.0109, %34
  %36 = icmp ult i8 %35, 3
  %37 = zext i1 %36 to i32
  %38 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 %27
  %39 = load i8, ptr %38, align 1, !tbaa !5
  %40 = sub i8 %.0109, %39
  %41 = icmp ult i8 %40, 3
  %42 = zext i1 %41 to i32
  %43 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 %30
  %44 = load i8, ptr %43, align 1, !tbaa !5
  %45 = sub i8 %.0109, %44
  %46 = icmp ult i8 %45, 3
  %47 = zext i1 %46 to i32
  %48 = add nuw nsw i32 %42, %37
  %49 = add nuw nsw i32 %48, %47
  %50 = icmp sle i32 %49, %.095106
  %51 = trunc nuw nsw i64 %.098105 to i32
  %52 = icmp ult i32 %49, 2
  %.2 = select i1 %50, i32 %.093107, i32 %51
  %cond = or i1 %50, %52
  br i1 %cond, label %53, label %56

53:                                               ; preds = %32
  %.297 = tail call i32 @llvm.smax.i32(i32 %49, i32 %.095106)
  %54 = add nuw nsw i64 %.098105, 1
  %55 = icmp ult i64 %54, %2
  br i1 %55, label %16, label %56, !llvm.loop !8

56:                                               ; preds = %53, %32
  %57 = icmp sgt i32 %.2, -1
  br i1 %57, label %59, label %58

58:                                               ; preds = %56
  tail call void @__assert_fail(ptr noundef nonnull @.str.28, ptr noundef nonnull @.str.1, i32 noundef 1652, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_optimizeMeshlet) #6
  unreachable

59:                                               ; preds = %56
  %60 = mul nuw nsw i32 %.2, 3
  %61 = zext nneg i32 %60 to i64
  %62 = getelementptr inbounds i8, ptr %1, i64 %61
  %63 = load i8, ptr %62, align 1, !tbaa !5
  %64 = getelementptr inbounds i8, ptr %62, i64 1
  %65 = load i8, ptr %64, align 1, !tbaa !5
  %66 = getelementptr inbounds i8, ptr %62, i64 2
  %67 = load i8, ptr %66, align 1, !tbaa !5
  %68 = add nuw i64 %.091108, 1
  %69 = mul nuw nsw i64 %68, 3
  %70 = getelementptr inbounds i8, ptr %1, i64 %69
  %71 = mul nuw nsw i64 %.091108, 3
  %72 = getelementptr inbounds i8, ptr %1, i64 %71
  %73 = zext nneg i32 %.2 to i64
  %74 = sub nsw i64 %73, %.091108
  %75 = mul nsw i64 %74, 3
  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %70, ptr align 1 %72, i64 %75, i1 false)
  store i8 %63, ptr %72, align 1, !tbaa !5
  %76 = getelementptr inbounds i8, ptr %72, i64 1
  store i8 %65, ptr %76, align 1, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %72, i64 2
  store i8 %67, ptr %77, align 1, !tbaa !5
  %78 = add i8 %.0109, 1
  %79 = zext i8 %63 to i64
  %80 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 %79
  store i8 %78, ptr %80, align 1, !tbaa !5
  %81 = zext i8 %65 to i64
  %82 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 %81
  store i8 %78, ptr %82, align 1, !tbaa !5
  %83 = zext i8 %67 to i64
  %84 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 %83
  store i8 %78, ptr %84, align 1, !tbaa !5
  %exitcond.not = icmp eq i64 %68, %2
  br i1 %exitcond.not, label %.lr.ph.preheader, label %.preheader, !llvm.loop !10

._crit_edge113:                                   ; preds = %97
  %.not = icmp ugt i64 %.1, %3
  br i1 %.not, label %101, label %102

.lr.ph:                                           ; preds = %.lr.ph.preheader, %97
  %.089111 = phi i64 [ %100, %97 ], [ 0, %.lr.ph.preheader ]
  %.090110 = phi i64 [ %.1, %97 ], [ 0, %.lr.ph.preheader ]
  %85 = getelementptr inbounds i8, ptr %1, i64 %.089111
  %86 = load i8, ptr %85, align 1, !tbaa !5
  %87 = zext i8 %86 to i64
  %88 = getelementptr inbounds [256 x i16], ptr %7, i64 0, i64 %87
  %89 = load i16, ptr %88, align 2, !tbaa !11
  %90 = icmp slt i16 %89, 0
  br i1 %90, label %91, label %97

91:                                               ; preds = %.lr.ph
  %92 = trunc i64 %.090110 to i16
  store i16 %92, ptr %88, align 2, !tbaa !11
  %93 = getelementptr inbounds i32, ptr %0, i64 %87
  %94 = load i32, ptr %93, align 4, !tbaa !13
  %95 = getelementptr inbounds [256 x i32], ptr %6, i64 0, i64 %.090110
  store i32 %94, ptr %95, align 4, !tbaa !13
  %96 = add i64 %.090110, 1
  br label %97

97:                                               ; preds = %91, %.lr.ph
  %98 = phi i16 [ %92, %91 ], [ %89, %.lr.ph ]
  %.1 = phi i64 [ %96, %91 ], [ %.090110, %.lr.ph ]
  %99 = trunc i16 %98 to i8
  store i8 %99, ptr %85, align 1, !tbaa !5
  %100 = add nuw nsw i64 %.089111, 1
  %exitcond116.not = icmp eq i64 %100, %15
  br i1 %exitcond116.not, label %._crit_edge113, label %.lr.ph, !llvm.loop !15

101:                                              ; preds = %._crit_edge113
  tail call void @__assert_fail(ptr noundef nonnull @.str.29, ptr noundef nonnull @.str.1, i32 noundef 1693, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_optimizeMeshlet) #6
  unreachable

102:                                              ; preds = %._crit_edge113.thread, %._crit_edge113
  %.090.lcssa119 = phi i64 [ 0, %._crit_edge113.thread ], [ %.1, %._crit_edge113 ]
  %103 = shl nuw nsw i64 %.090.lcssa119, 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %0, ptr nonnull align 16 %6, i64 %103, i1 false)
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %5) #7
  ret void
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = !{!12, !12, i64 0}
!12 = !{!"short", !6, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !6, i64 0}
!15 = distinct !{!15, !9}


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