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

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

@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [45 x i8], align 1
@__PRETTY_FUNCTION__.meshopt_simplifyPoints = external hidden unnamed_addr constant [115 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [34 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: mustprogress nounwind uwtable
declare dso_local void @_ZN17meshopt_AllocatorC2Ev(ptr noundef nonnull align 8 dereferenceable(200)) unnamed_addr #2 align 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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN7meshoptL16computeVertexIdsEPjPKNS_7Vector3Emi(ptr noundef, ptr noundef, i64 noundef, i32 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef float @_ZN7meshoptL11interpolateEfffffff(float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN7meshoptL12hashBuckets2Em(i64 noundef) #2

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

; Function Attrs: mustprogress uwtable
define dso_local i64 @meshopt_simplifyPoints(ptr noundef %0, ptr noundef %1, i64 noundef %2, i64 noundef %3, ptr noundef %4, i64 noundef %5, float noundef %6, i64 noundef %7) #5 personality ptr @__gxx_personality_v0 {
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca float, align 4
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  %20 = alloca %class.meshopt_Allocator, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca i64, align 8
  %26 = alloca ptr, align 8
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i64, align 8
  %31 = alloca i64, align 8
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i64, align 8
  %36 = alloca float, align 4
  %37 = alloca ptr, align 8
  %38 = alloca i64, align 8
  %39 = alloca ptr, align 8
  %40 = alloca ptr, align 8
  %41 = alloca ptr, align 8
  %42 = alloca float, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store i64 %2, ptr %12, align 8, !tbaa !9
  store i64 %3, ptr %13, align 8, !tbaa !9
  store ptr %4, ptr %14, align 8, !tbaa !5
  store i64 %5, ptr %15, align 8, !tbaa !9
  store float %6, ptr %16, align 4, !tbaa !11
  store i64 %7, ptr %17, align 8, !tbaa !9
  %43 = load i64, ptr %13, align 8, !tbaa !9
  %44 = icmp uge i64 %43, 12
  br i1 %44, label %45, label %48

45:                                               ; preds = %8
  %46 = load i64, ptr %13, align 8, !tbaa !9
  %47 = icmp ule i64 %46, 256
  br label %48

48:                                               ; preds = %45, %8
  %49 = phi i1 [ false, %8 ], [ %47, %45 ]
  br i1 %49, label %50, label %51

50:                                               ; preds = %48
  br label %53

51:                                               ; preds = %48
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 2271, ptr noundef @__PRETTY_FUNCTION__.meshopt_simplifyPoints) #7
  unreachable

52:                                               ; No predecessors!
  br label %53

53:                                               ; preds = %52, %50
  %54 = load i64, ptr %13, align 8, !tbaa !9
  %55 = urem i64 %54, 4
  %56 = icmp eq i64 %55, 0
  br i1 %56, label %57, label %58

57:                                               ; preds = %53
  br label %60

58:                                               ; preds = %53
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 2272, ptr noundef @__PRETTY_FUNCTION__.meshopt_simplifyPoints) #7
  unreachable

59:                                               ; No predecessors!
  br label %60

60:                                               ; preds = %59, %57
  %61 = load i64, ptr %15, align 8, !tbaa !9
  %62 = icmp eq i64 %61, 0
  br i1 %62, label %71, label %63

63:                                               ; preds = %60
  %64 = load i64, ptr %15, align 8, !tbaa !9
  %65 = icmp uge i64 %64, 12
  br i1 %65, label %66, label %69

66:                                               ; preds = %63
  %67 = load i64, ptr %15, align 8, !tbaa !9
  %68 = icmp ule i64 %67, 256
  br label %69

69:                                               ; preds = %66, %63
  %70 = phi i1 [ false, %63 ], [ %68, %66 ]
  br label %71

71:                                               ; preds = %69, %60
  %72 = phi i1 [ true, %60 ], [ %70, %69 ]
  br i1 %72, label %73, label %74

73:                                               ; preds = %71
  br label %76

74:                                               ; preds = %71
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.1, i32 noundef 2273, ptr noundef @__PRETTY_FUNCTION__.meshopt_simplifyPoints) #7
  unreachable

75:                                               ; No predecessors!
  br label %76

76:                                               ; preds = %75, %73
  %77 = load i64, ptr %15, align 8, !tbaa !9
  %78 = urem i64 %77, 4
  %79 = icmp eq i64 %78, 0
  br i1 %79, label %80, label %81

80:                                               ; preds = %76
  br label %83

81:                                               ; preds = %76
  call void @__assert_fail(ptr noundef @.str.15, ptr noundef @.str.1, i32 noundef 2274, ptr noundef @__PRETTY_FUNCTION__.meshopt_simplifyPoints) #7
  unreachable

82:                                               ; No predecessors!
  br label %83

83:                                               ; preds = %82, %80
  %84 = load ptr, ptr %14, align 8, !tbaa !5
  %85 = icmp eq ptr %84, null
  br i1 %85, label %89, label %86

86:                                               ; preds = %83
  %87 = load i64, ptr %15, align 8, !tbaa !9
  %88 = icmp ne i64 %87, 0
  br label %89

89:                                               ; preds = %86, %83
  %90 = phi i1 [ true, %83 ], [ %88, %86 ]
  br i1 %90, label %91, label %92

91:                                               ; preds = %89
  br label %94

92:                                               ; preds = %89
  call void @__assert_fail(ptr noundef @.str.16, ptr noundef @.str.1, i32 noundef 2275, ptr noundef @__PRETTY_FUNCTION__.meshopt_simplifyPoints) #7
  unreachable

93:                                               ; No predecessors!
  br label %94

94:                                               ; preds = %93, %91
  %95 = load i64, ptr %17, align 8, !tbaa !9
  %96 = load i64, ptr %12, align 8, !tbaa !9
  %97 = icmp ule i64 %95, %96
  br i1 %97, label %98, label %99

98:                                               ; preds = %94
  br label %101

99:                                               ; preds = %94
  call void @__assert_fail(ptr noundef @.str.17, ptr noundef @.str.1, i32 noundef 2276, ptr noundef @__PRETTY_FUNCTION__.meshopt_simplifyPoints) #7
  unreachable

100:                                              ; No predecessors!
  br label %101

101:                                              ; preds = %100, %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %102 = load i64, ptr %17, align 8, !tbaa !9
  store i64 %102, ptr %18, align 8, !tbaa !9
  %103 = load i64, ptr %18, align 8, !tbaa !9
  %104 = icmp eq i64 %103, 0
  br i1 %104, label %105, label %106

105:                                              ; preds = %101
  store i64 0, ptr %9, align 8
  store i32 1, ptr %19, align 4
  br label %380

106:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 200, ptr %20) #8
  call void @_ZN17meshopt_AllocatorC2Ev(ptr noundef nonnull align 8 dereferenceable(200) %20)
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %107 = load i64, ptr %12, align 8, !tbaa !9
  %108 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIN7meshopt7Vector3EEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %20, i64 noundef %107)
          to label %109 unwind label %135

109:                                              ; preds = %106
  store ptr %108, ptr %21, align 8, !tbaa !5
  %110 = load ptr, ptr %21, align 8, !tbaa !5
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = load i64, ptr %12, align 8, !tbaa !9
  %113 = load i64, ptr %13, align 8, !tbaa !9
  %114 = invoke noundef float @_ZN7meshoptL16rescalePositionsEPNS_7Vector3EPKfmmPKj(ptr noundef %110, ptr noundef %111, i64 noundef %112, i64 noundef %113, ptr noundef null)
          to label %115 unwind label %135

115:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %116 = load i64, ptr %12, align 8, !tbaa !9
  %117 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIjEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %20, i64 noundef %116)
          to label %118 unwind label %139

118:                                              ; preds = %115
  store ptr %117, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %119 = load i64, ptr %12, align 8, !tbaa !9
  %120 = invoke noundef i64 @_ZN7meshoptL12hashBuckets2Em(i64 noundef %119)
          to label %121 unwind label %143

121:                                              ; preds = %118
  store i64 %120, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %122 = load i64, ptr %25, align 8, !tbaa !9
  %123 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIjEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %20, i64 noundef %122)
          to label %124 unwind label %147

124:                                              ; preds = %121
  store ptr %123, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  store i32 5, ptr %27, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  store i32 0, ptr %28, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  store i32 1025, ptr %29, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #8
  store i64 0, ptr %30, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #8
  %125 = load i64, ptr %12, align 8, !tbaa !9
  store i64 %125, ptr %31, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #8
  %126 = load i64, ptr %18, align 8, !tbaa !9
  %127 = uitofp i64 %126 to float
  %128 = call float @sqrtf(float noundef %127) #8
  %129 = fadd float %128, 5.000000e-01
  %130 = fptosi float %129 to i32
  store i32 %130, ptr %32, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #8
  store i32 0, ptr %33, align 4, !tbaa !13
  br label %131

131:                                              ; preds = %262, %124
  %132 = load i32, ptr %33, align 4, !tbaa !13
  %133 = icmp slt i32 %132, 15
  br i1 %133, label %151, label %134

134:                                              ; preds = %131
  store i32 2, ptr %19, align 4
  br label %267

135:                                              ; preds = %109, %106
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %22, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %23, align 4
  br label %379

139:                                              ; preds = %115
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %22, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %23, align 4
  br label %378

143:                                              ; preds = %118
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %22, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %23, align 4
  br label %377

147:                                              ; preds = %121
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %22, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %23, align 4
  br label %376

151:                                              ; preds = %131
  %152 = load i64, ptr %30, align 8, !tbaa !9
  %153 = load i64, ptr %17, align 8, !tbaa !9
  %154 = icmp ult i64 %152, %153
  br i1 %154, label %155, label %156

155:                                              ; preds = %151
  br label %158

156:                                              ; preds = %151
  call void @__assert_fail(ptr noundef @.str.18, ptr noundef @.str.1, i32 noundef 2312, ptr noundef @__PRETTY_FUNCTION__.meshopt_simplifyPoints) #7
  unreachable

157:                                              ; No predecessors!
  br label %158

158:                                              ; preds = %157, %155
  %159 = load i32, ptr %29, align 4, !tbaa !13
  %160 = load i32, ptr %28, align 4, !tbaa !13
  %161 = sub nsw i32 %159, %160
  %162 = icmp sgt i32 %161, 1
  br i1 %162, label %163, label %164

163:                                              ; preds = %158
  br label %166

164:                                              ; preds = %158
  call void @__assert_fail(ptr noundef @.str.19, ptr noundef @.str.1, i32 noundef 2313, ptr noundef @__PRETTY_FUNCTION__.meshopt_simplifyPoints) #7
  unreachable

165:                                              ; No predecessors!
  br label %166

166:                                              ; preds = %165, %163
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #8
  %167 = load i32, ptr %32, align 4, !tbaa !13
  store i32 %167, ptr %34, align 4, !tbaa !13
  %168 = load i32, ptr %34, align 4, !tbaa !13
  %169 = load i32, ptr %28, align 4, !tbaa !13
  %170 = icmp sle i32 %168, %169
  br i1 %170, label %171, label %174

171:                                              ; preds = %166
  %172 = load i32, ptr %28, align 4, !tbaa !13
  %173 = add nsw i32 %172, 1
  br label %185

174:                                              ; preds = %166
  %175 = load i32, ptr %34, align 4, !tbaa !13
  %176 = load i32, ptr %29, align 4, !tbaa !13
  %177 = icmp sge i32 %175, %176
  br i1 %177, label %178, label %181

178:                                              ; preds = %174
  %179 = load i32, ptr %29, align 4, !tbaa !13
  %180 = sub nsw i32 %179, 1
  br label %183

181:                                              ; preds = %174
  %182 = load i32, ptr %34, align 4, !tbaa !13
  br label %183

183:                                              ; preds = %181, %178
  %184 = phi i32 [ %180, %178 ], [ %182, %181 ]
  br label %185

185:                                              ; preds = %183, %171
  %186 = phi i32 [ %173, %171 ], [ %184, %183 ]
  store i32 %186, ptr %34, align 4, !tbaa !13
  %187 = load ptr, ptr %24, align 8, !tbaa !5
  %188 = load ptr, ptr %21, align 8, !tbaa !5
  %189 = load i64, ptr %12, align 8, !tbaa !9
  %190 = load i32, ptr %34, align 4, !tbaa !13
  invoke void @_ZN7meshoptL16computeVertexIdsEPjPKNS_7Vector3Emi(ptr noundef %187, ptr noundef %188, i64 noundef %189, i32 noundef %190)
          to label %191 unwind label %220

191:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #8
  %192 = load ptr, ptr %26, align 8, !tbaa !5
  %193 = load i64, ptr %25, align 8, !tbaa !9
  %194 = load ptr, ptr %24, align 8, !tbaa !5
  %195 = load i64, ptr %12, align 8, !tbaa !9
  %196 = invoke noundef i64 @_ZN7meshoptL16countVertexCellsEPjmPKjm(ptr noundef %192, i64 noundef %193, ptr noundef %194, i64 noundef %195)
          to label %197 unwind label %224

197:                                              ; preds = %191
  store i64 %196, ptr %35, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #8
  %198 = load i64, ptr %17, align 8, !tbaa !9
  %199 = uitofp i64 %198 to float
  %200 = load i32, ptr %28, align 4, !tbaa !13
  %201 = sitofp i32 %200 to float
  %202 = load i64, ptr %30, align 8, !tbaa !9
  %203 = uitofp i64 %202 to float
  %204 = load i32, ptr %34, align 4, !tbaa !13
  %205 = sitofp i32 %204 to float
  %206 = load i64, ptr %35, align 8, !tbaa !9
  %207 = uitofp i64 %206 to float
  %208 = load i32, ptr %29, align 4, !tbaa !13
  %209 = sitofp i32 %208 to float
  %210 = load i64, ptr %31, align 8, !tbaa !9
  %211 = uitofp i64 %210 to float
  %212 = invoke noundef float @_ZN7meshoptL11interpolateEfffffff(float noundef %199, float noundef %201, float noundef %203, float noundef %205, float noundef %207, float noundef %209, float noundef %211)
          to label %213 unwind label %228

213:                                              ; preds = %197
  store float %212, ptr %36, align 4, !tbaa !11
  %214 = load i64, ptr %35, align 8, !tbaa !9
  %215 = load i64, ptr %17, align 8, !tbaa !9
  %216 = icmp ule i64 %214, %215
  br i1 %216, label %217, label %232

217:                                              ; preds = %213
  %218 = load i32, ptr %34, align 4, !tbaa !13
  store i32 %218, ptr %28, align 4, !tbaa !13
  %219 = load i64, ptr %35, align 8, !tbaa !9
  store i64 %219, ptr %30, align 8, !tbaa !9
  br label %235

220:                                              ; preds = %185
  %221 = landingpad { ptr, i32 }
          cleanup
  %222 = extractvalue { ptr, i32 } %221, 0
  store ptr %222, ptr %22, align 8
  %223 = extractvalue { ptr, i32 } %221, 1
  store i32 %223, ptr %23, align 4
  br label %266

224:                                              ; preds = %191
  %225 = landingpad { ptr, i32 }
          cleanup
  %226 = extractvalue { ptr, i32 } %225, 0
  store ptr %226, ptr %22, align 8
  %227 = extractvalue { ptr, i32 } %225, 1
  store i32 %227, ptr %23, align 4
  br label %265

228:                                              ; preds = %197
  %229 = landingpad { ptr, i32 }
          cleanup
  %230 = extractvalue { ptr, i32 } %229, 0
  store ptr %230, ptr %22, align 8
  %231 = extractvalue { ptr, i32 } %229, 1
  store i32 %231, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  br label %265

232:                                              ; preds = %213
  %233 = load i32, ptr %34, align 4, !tbaa !13
  store i32 %233, ptr %29, align 4, !tbaa !13
  %234 = load i64, ptr %35, align 8, !tbaa !9
  store i64 %234, ptr %31, align 8, !tbaa !9
  br label %235

235:                                              ; preds = %232, %217
  %236 = load i64, ptr %35, align 8, !tbaa !9
  %237 = load i64, ptr %17, align 8, !tbaa !9
  %238 = icmp eq i64 %236, %237
  br i1 %238, label %244, label %239

239:                                              ; preds = %235
  %240 = load i32, ptr %29, align 4, !tbaa !13
  %241 = load i32, ptr %28, align 4, !tbaa !13
  %242 = sub nsw i32 %240, %241
  %243 = icmp sle i32 %242, 1
  br i1 %243, label %244, label %245

244:                                              ; preds = %239, %235
  store i32 2, ptr %19, align 4
  br label %259

245:                                              ; preds = %239
  %246 = load i32, ptr %33, align 4, !tbaa !13
  %247 = icmp slt i32 %246, 5
  br i1 %247, label %248, label %252

248:                                              ; preds = %245
  %249 = load float, ptr %36, align 4, !tbaa !11
  %250 = fadd float %249, 5.000000e-01
  %251 = fptosi float %250 to i32
  br label %257

252:                                              ; preds = %245
  %253 = load i32, ptr %28, align 4, !tbaa !13
  %254 = load i32, ptr %29, align 4, !tbaa !13
  %255 = add nsw i32 %253, %254
  %256 = sdiv i32 %255, 2
  br label %257

257:                                              ; preds = %252, %248
  %258 = phi i32 [ %251, %248 ], [ %256, %252 ]
  store i32 %258, ptr %32, align 4, !tbaa !13
  store i32 0, ptr %19, align 4
  br label %259

259:                                              ; preds = %257, %244
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  %260 = load i32, ptr %19, align 4
  switch i32 %260, label %267 [
    i32 0, label %261
  ]

261:                                              ; preds = %259
  br label %262

262:                                              ; preds = %261
  %263 = load i32, ptr %33, align 4, !tbaa !13
  %264 = add nsw i32 %263, 1
  store i32 %264, ptr %33, align 4, !tbaa !13
  br label %131, !llvm.loop !15

265:                                              ; preds = %228, %224
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  br label %266

266:                                              ; preds = %265, %220
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  br label %375

267:                                              ; preds = %259, %134
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  br label %268

268:                                              ; preds = %267
  %269 = load i64, ptr %30, align 8, !tbaa !9
  %270 = icmp eq i64 %269, 0
  br i1 %270, label %271, label %272

271:                                              ; preds = %268
  store i64 0, ptr %9, align 8
  store i32 1, ptr %19, align 4
  br label %374

272:                                              ; preds = %268
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #8
  %273 = load i64, ptr %12, align 8, !tbaa !9
  %274 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIjEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %20, i64 noundef %273)
          to label %275 unwind label %338

275:                                              ; preds = %272
  store ptr %274, ptr %37, align 8, !tbaa !5
  %276 = load ptr, ptr %24, align 8, !tbaa !5
  %277 = load ptr, ptr %21, align 8, !tbaa !5
  %278 = load i64, ptr %12, align 8, !tbaa !9
  %279 = load i32, ptr %28, align 4, !tbaa !13
  invoke void @_ZN7meshoptL16computeVertexIdsEPjPKNS_7Vector3Emi(ptr noundef %276, ptr noundef %277, i64 noundef %278, i32 noundef %279)
          to label %280 unwind label %338

280:                                              ; preds = %275
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #8
  %281 = load ptr, ptr %26, align 8, !tbaa !5
  %282 = load i64, ptr %25, align 8, !tbaa !9
  %283 = load ptr, ptr %37, align 8, !tbaa !5
  %284 = load ptr, ptr %24, align 8, !tbaa !5
  %285 = load i64, ptr %12, align 8, !tbaa !9
  %286 = invoke noundef i64 @_ZN7meshoptL15fillVertexCellsEPjmS0_PKjm(ptr noundef %281, i64 noundef %282, ptr noundef %283, ptr noundef %284, i64 noundef %285)
          to label %287 unwind label %342

287:                                              ; preds = %280
  store i64 %286, ptr %38, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #8
  %288 = load i64, ptr %38, align 8, !tbaa !9
  %289 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIN7meshopt9ReservoirEEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %20, i64 noundef %288)
          to label %290 unwind label %346

290:                                              ; preds = %287
  store ptr %289, ptr %39, align 8, !tbaa !5
  %291 = load ptr, ptr %39, align 8, !tbaa !5
  %292 = load i64, ptr %38, align 8, !tbaa !9
  %293 = mul i64 %292, 28
  call void @llvm.memset.p0.i64(ptr align 4 %291, i8 0, i64 %293, i1 false)
  %294 = load ptr, ptr %39, align 8, !tbaa !5
  %295 = load i64, ptr %38, align 8, !tbaa !9
  %296 = load ptr, ptr %21, align 8, !tbaa !5
  %297 = load ptr, ptr %14, align 8, !tbaa !5
  %298 = load i64, ptr %15, align 8, !tbaa !9
  %299 = load i64, ptr %12, align 8, !tbaa !9
  %300 = load ptr, ptr %37, align 8, !tbaa !5
  invoke void @_ZN7meshoptL18fillCellReservoirsEPNS_9ReservoirEmPKNS_7Vector3EPKfmmPKj(ptr noundef %294, i64 noundef %295, ptr noundef %296, ptr noundef %297, i64 noundef %298, i64 noundef %299, ptr noundef %300)
          to label %301 unwind label %346

301:                                              ; preds = %290
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #8
  %302 = load i64, ptr %38, align 8, !tbaa !9
  %303 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIjEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %20, i64 noundef %302)
          to label %304 unwind label %350

304:                                              ; preds = %301
  store ptr %303, ptr %40, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #8
  %305 = load i64, ptr %38, align 8, !tbaa !9
  %306 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIfEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %20, i64 noundef %305)
          to label %307 unwind label %354

307:                                              ; preds = %304
  store ptr %306, ptr %41, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #8
  %308 = load float, ptr %16, align 4, !tbaa !11
  %309 = load i32, ptr %28, align 4, !tbaa !13
  %310 = icmp eq i32 %309, 1
  br i1 %310, label %311, label %312

311:                                              ; preds = %307
  br label %317

312:                                              ; preds = %307
  %313 = load i32, ptr %28, align 4, !tbaa !13
  %314 = sub nsw i32 %313, 1
  %315 = sitofp i32 %314 to float
  %316 = fdiv float 1.000000e+00, %315
  br label %317

317:                                              ; preds = %312, %311
  %318 = phi float [ 1.000000e+00, %311 ], [ %316, %312 ]
  %319 = fmul float %308, %318
  store float %319, ptr %42, align 4, !tbaa !11
  %320 = load ptr, ptr %40, align 8, !tbaa !5
  %321 = load ptr, ptr %41, align 8, !tbaa !5
  %322 = load i64, ptr %38, align 8, !tbaa !9
  %323 = load ptr, ptr %37, align 8, !tbaa !5
  %324 = load ptr, ptr %39, align 8, !tbaa !5
  %325 = load ptr, ptr %21, align 8, !tbaa !5
  %326 = load ptr, ptr %14, align 8, !tbaa !5
  %327 = load i64, ptr %15, align 8, !tbaa !9
  %328 = load float, ptr %42, align 4, !tbaa !11
  %329 = load float, ptr %42, align 4, !tbaa !11
  %330 = fmul float %328, %329
  %331 = load i64, ptr %12, align 8, !tbaa !9
  invoke void @_ZN7meshoptL13fillCellRemapEPjPfmPKjPKNS_9ReservoirEPKNS_7Vector3EPKfmfm(ptr noundef %320, ptr noundef %321, i64 noundef %322, ptr noundef %323, ptr noundef %324, ptr noundef %325, ptr noundef %326, i64 noundef %327, float noundef %330, i64 noundef %331)
          to label %332 unwind label %358

332:                                              ; preds = %317
  %333 = load i64, ptr %38, align 8, !tbaa !9
  %334 = load i64, ptr %17, align 8, !tbaa !9
  %335 = icmp ule i64 %333, %334
  br i1 %335, label %336, label %337

336:                                              ; preds = %332
  br label %363

337:                                              ; preds = %332
  call void @__assert_fail(ptr noundef @.str.20, ptr noundef @.str.1, i32 noundef 2375, ptr noundef @__PRETTY_FUNCTION__.meshopt_simplifyPoints) #7
  unreachable

338:                                              ; preds = %275, %272
  %339 = landingpad { ptr, i32 }
          cleanup
  %340 = extractvalue { ptr, i32 } %339, 0
  store ptr %340, ptr %22, align 8
  %341 = extractvalue { ptr, i32 } %339, 1
  store i32 %341, ptr %23, align 4
  br label %373

342:                                              ; preds = %280
  %343 = landingpad { ptr, i32 }
          cleanup
  %344 = extractvalue { ptr, i32 } %343, 0
  store ptr %344, ptr %22, align 8
  %345 = extractvalue { ptr, i32 } %343, 1
  store i32 %345, ptr %23, align 4
  br label %372

346:                                              ; preds = %290, %287
  %347 = landingpad { ptr, i32 }
          cleanup
  %348 = extractvalue { ptr, i32 } %347, 0
  store ptr %348, ptr %22, align 8
  %349 = extractvalue { ptr, i32 } %347, 1
  store i32 %349, ptr %23, align 4
  br label %371

350:                                              ; preds = %301
  %351 = landingpad { ptr, i32 }
          cleanup
  %352 = extractvalue { ptr, i32 } %351, 0
  store ptr %352, ptr %22, align 8
  %353 = extractvalue { ptr, i32 } %351, 1
  store i32 %353, ptr %23, align 4
  br label %370

354:                                              ; preds = %304
  %355 = landingpad { ptr, i32 }
          cleanup
  %356 = extractvalue { ptr, i32 } %355, 0
  store ptr %356, ptr %22, align 8
  %357 = extractvalue { ptr, i32 } %355, 1
  store i32 %357, ptr %23, align 4
  br label %369

358:                                              ; preds = %317
  %359 = landingpad { ptr, i32 }
          cleanup
  %360 = extractvalue { ptr, i32 } %359, 0
  store ptr %360, ptr %22, align 8
  %361 = extractvalue { ptr, i32 } %359, 1
  store i32 %361, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #8
  br label %369

362:                                              ; No predecessors!
  br label %363

363:                                              ; preds = %362, %336
  %364 = load ptr, ptr %10, align 8, !tbaa !5
  %365 = load ptr, ptr %40, align 8, !tbaa !5
  %366 = load i64, ptr %38, align 8, !tbaa !9
  %367 = mul i64 4, %366
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %364, ptr align 4 %365, i64 %367, i1 false)
  %368 = load i64, ptr %38, align 8, !tbaa !9
  store i64 %368, ptr %9, align 8
  store i32 1, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  br label %374

369:                                              ; preds = %358, %354
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #8
  br label %370

370:                                              ; preds = %369, %350
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #8
  br label %371

371:                                              ; preds = %370, %346
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #8
  br label %372

372:                                              ; preds = %371, %342
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #8
  br label %373

373:                                              ; preds = %372, %338
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  br label %375

374:                                              ; preds = %363, %271
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @_ZN17meshopt_AllocatorD2Ev(ptr noundef nonnull align 8 dereferenceable(200) %20) #8
  call void @llvm.lifetime.end.p0(i64 200, ptr %20) #8
  br label %380

375:                                              ; preds = %373, %266
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %376

376:                                              ; preds = %375, %147
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  br label %377

377:                                              ; preds = %376, %143
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br label %378

378:                                              ; preds = %377, %139
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  br label %379

379:                                              ; preds = %378, %135
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @_ZN17meshopt_AllocatorD2Ev(ptr noundef nonnull align 8 dereferenceable(200) %20) #8
  call void @llvm.lifetime.end.p0(i64 200, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %382

380:                                              ; preds = %374, %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  %381 = load i64, ptr %9, align 8
  ret i64 %381

382:                                              ; preds = %379
  %383 = load ptr, ptr %22, align 8
  %384 = load i32, ptr %23, align 4
  %385 = insertvalue { ptr, i32 } poison, ptr %383, 0
  %386 = insertvalue { ptr, i32 } %385, i32 %384, 1
  resume { ptr, i32 } %386
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN7meshoptL13fillCellRemapEPjPfmPKjPKNS_9ReservoirEPKNS_7Vector3EPKfmfm(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, float noundef, i64 noundef) #2

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

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

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


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

@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [45 x i8], align 1
@__PRETTY_FUNCTION__.meshopt_simplifyPoints = external hidden unnamed_addr constant [115 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [34 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 nounwind uwtable
declare dso_local void @_ZN17meshopt_AllocatorC2Ev(ptr noundef nonnull align 8 dereferenceable(200)) unnamed_addr #2 align 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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN7meshoptL16computeVertexIdsEPjPKNS_7Vector3Emi(ptr noundef, ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef float @_ZN7meshoptL11interpolateEfffffff(float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN7meshoptL12hashBuckets2Em(i64 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @meshopt_simplifyPoints(ptr nocapture noundef writeonly %0, ptr noundef %1, i64 noundef %2, i64 noundef %3, ptr noundef %4, i64 noundef %5, float noundef %6, i64 noundef %7) local_unnamed_addr #5 personality ptr @__gxx_personality_v0 {
  %9 = alloca %class.meshopt_Allocator, align 8
  %10 = add i64 %3, -12
  %11 = icmp ult i64 %10, 245
  br i1 %11, label %13, label %12

12:                                               ; preds = %8
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 2271, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_simplifyPoints) #7
  unreachable

13:                                               ; preds = %8
  %14 = and i64 %3, 3
  %15 = icmp eq i64 %14, 0
  br i1 %15, label %17, label %16

16:                                               ; preds = %13
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 2272, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_simplifyPoints) #7
  unreachable

17:                                               ; preds = %13
  %18 = icmp eq i64 %5, 0
  %19 = add i64 %5, -12
  %20 = icmp ult i64 %19, 245
  %or.cond = or i1 %18, %20
  br i1 %or.cond, label %.critedge, label %21

21:                                               ; preds = %17
  tail call void @__assert_fail(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.1, i32 noundef 2273, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_simplifyPoints) #7
  unreachable

.critedge:                                        ; preds = %17
  %22 = and i64 %5, 3
  %23 = icmp eq i64 %22, 0
  br i1 %23, label %25, label %24

24:                                               ; preds = %.critedge
  tail call void @__assert_fail(ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.1, i32 noundef 2274, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_simplifyPoints) #7
  unreachable

25:                                               ; preds = %.critedge
  %26 = icmp eq ptr %4, null
  %27 = icmp ne i64 %5, 0
  %28 = or i1 %26, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %25
  tail call void @__assert_fail(ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.1, i32 noundef 2275, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_simplifyPoints) #7
  unreachable

30:                                               ; preds = %25
  %.not = icmp ugt i64 %7, %2
  br i1 %.not, label %31, label %32

31:                                               ; preds = %30
  tail call void @__assert_fail(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.1, i32 noundef 2276, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_simplifyPoints) #7
  unreachable

32:                                               ; preds = %30
  %33 = icmp eq i64 %7, 0
  br i1 %33, label %124, label %34

34:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %9) #8
  call void @_ZN17meshopt_AllocatorC2Ev(ptr noundef nonnull align 8 dereferenceable(200) %9)
  %35 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIN7meshopt7Vector3EEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %9, i64 noundef %2)
          to label %36 unwind label %46

36:                                               ; preds = %34
  %37 = call noundef float @_ZN7meshoptL16rescalePositionsEPNS_7Vector3EPKfmmPKj(ptr noundef %35, ptr noundef %1, i64 noundef %2, i64 noundef %3, ptr noundef null)
  %38 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIjEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %9, i64 noundef %2)
          to label %39 unwind label %48

39:                                               ; preds = %36
  %40 = call noundef i64 @_ZN7meshoptL12hashBuckets2Em(i64 noundef %2)
  %41 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIjEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %9, i64 noundef %40)
          to label %42 unwind label %50

42:                                               ; preds = %39
  %43 = uitofp i64 %7 to float
  %sqrt = call float @llvm.sqrt.f32(float %43)
  %44 = fadd float %sqrt, 5.000000e-01
  %45 = fptosi float %44 to i32
  br label %52

46:                                               ; preds = %34
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %123

48:                                               ; preds = %36
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %123

50:                                               ; preds = %39
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %123

52:                                               ; preds = %42, %86
  %.0123166 = phi i32 [ 0, %42 ], [ %.0123., %86 ]
  %.0126165 = phi i32 [ 1025, %42 ], [ %..0126, %86 ]
  %.0128164 = phi i64 [ 0, %42 ], [ %.0128., %86 ]
  %.0131163 = phi i64 [ %2, %42 ], [ %..0131, %86 ]
  %.0133162 = phi i32 [ 0, %42 ], [ %87, %86 ]
  %.0134161 = phi i32 [ %45, %42 ], [ %.1135.ph, %86 ]
  %53 = icmp ult i64 %.0128164, %7
  br i1 %53, label %55, label %54

54:                                               ; preds = %52
  call void @__assert_fail(ptr noundef nonnull @.str.18, ptr noundef nonnull @.str.1, i32 noundef 2312, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_simplifyPoints) #7
  unreachable

55:                                               ; preds = %52
  %56 = sub nsw i32 %.0126165, %.0123166
  %57 = icmp sgt i32 %56, 1
  br i1 %57, label %59, label %58

58:                                               ; preds = %55
  call void @__assert_fail(ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.1, i32 noundef 2313, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_simplifyPoints) #7
  unreachable

59:                                               ; preds = %55
  %.not143 = icmp sgt i32 %.0134161, %.0123166
  %60 = add nsw i32 %.0123166, 1
  %.not144 = icmp slt i32 %.0134161, %.0126165
  %61 = add nsw i32 %.0126165, -1
  %62 = select i1 %.not144, i32 %.0134161, i32 %61
  %63 = select i1 %.not143, i32 %62, i32 %60
  call void @_ZN7meshoptL16computeVertexIdsEPjPKNS_7Vector3Emi(ptr noundef %38, ptr noundef %35, i64 noundef %2, i32 noundef %63)
  %64 = invoke noundef i64 @_ZN7meshoptL16countVertexCellsEPjmPKjm(ptr noundef %41, i64 noundef %40, ptr noundef %38, i64 noundef %2)
          to label %65 unwind label %76

65:                                               ; preds = %59
  %66 = sitofp i32 %.0123166 to float
  %67 = uitofp i64 %.0128164 to float
  %68 = sitofp i32 %63 to float
  %69 = uitofp i64 %64 to float
  %70 = sitofp i32 %.0126165 to float
  %71 = uitofp i64 %.0131163 to float
  %72 = call noundef float @_ZN7meshoptL11interpolateEfffffff(float noundef %43, float noundef %66, float noundef %67, float noundef %68, float noundef %69, float noundef %70, float noundef %71)
  %.not145 = icmp ugt i64 %64, %7
  %..0131 = select i1 %.not145, i64 %64, i64 %.0131163
  %.0128. = select i1 %.not145, i64 %.0128164, i64 %64
  %..0126 = select i1 %.not145, i32 %63, i32 %.0126165
  %.0123. = select i1 %.not145, i32 %.0123166, i32 %63
  %73 = icmp eq i64 %64, %7
  %74 = sub nsw i32 %..0126, %.0123.
  %75 = icmp slt i32 %74, 2
  %or.cond157 = select i1 %73, i1 true, i1 %75
  br i1 %or.cond157, label %88, label %78

76:                                               ; preds = %59
  %77 = landingpad { ptr, i32 }
          cleanup
  br label %123

78:                                               ; preds = %65
  %79 = icmp ult i32 %.0133162, 5
  br i1 %79, label %80, label %83

80:                                               ; preds = %78
  %81 = fadd float %72, 5.000000e-01
  %82 = fptosi float %81 to i32
  br label %86

83:                                               ; preds = %78
  %84 = add nsw i32 %.0123., %..0126
  %85 = sdiv i32 %84, 2
  br label %86

86:                                               ; preds = %83, %80
  %.1135.ph = phi i32 [ %85, %83 ], [ %82, %80 ]
  %87 = add nuw nsw i32 %.0133162, 1
  %exitcond.not = icmp eq i32 %87, 15
  br i1 %exitcond.not, label %88, label %52, !llvm.loop !5

88:                                               ; preds = %65, %86
  %89 = icmp eq i64 %.0128., 0
  br i1 %89, label %122, label %90

90:                                               ; preds = %88
  %91 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIjEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %9, i64 noundef %2)
          to label %92 unwind label %110

92:                                               ; preds = %90
  call void @_ZN7meshoptL16computeVertexIdsEPjPKNS_7Vector3Emi(ptr noundef %38, ptr noundef %35, i64 noundef %2, i32 noundef %.0123.)
  %93 = invoke noundef i64 @_ZN7meshoptL15fillVertexCellsEPjmS0_PKjm(ptr noundef %41, i64 noundef %40, ptr noundef %91, ptr noundef %38, i64 noundef %2)
          to label %94 unwind label %112

94:                                               ; preds = %92
  %95 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIN7meshopt9ReservoirEEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %9, i64 noundef %93)
          to label %96 unwind label %114

96:                                               ; preds = %94
  %97 = mul i64 %93, 28
  call void @llvm.memset.p0.i64(ptr align 4 %95, i8 0, i64 %97, i1 false)
  call void @_ZN7meshoptL18fillCellReservoirsEPNS_9ReservoirEmPKNS_7Vector3EPKfmmPKj(ptr noundef %95, i64 noundef %93, ptr noundef %35, ptr noundef %4, i64 noundef %5, i64 noundef %2, ptr noundef %91)
  %98 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIjEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %9, i64 noundef %93)
          to label %99 unwind label %116

99:                                               ; preds = %96
  %100 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIfEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %9, i64 noundef %93)
          to label %101 unwind label %118

101:                                              ; preds = %99
  %102 = icmp eq i32 %.0123., 1
  %103 = add nsw i32 %.0123., -1
  %104 = sitofp i32 %103 to float
  %105 = fdiv float 1.000000e+00, %104
  %106 = select i1 %102, float 1.000000e+00, float %105
  %107 = fmul float %106, %6
  %108 = fmul float %107, %107
  call void @_ZN7meshoptL13fillCellRemapEPjPfmPKjPKNS_9ReservoirEPKNS_7Vector3EPKfmfm(ptr noundef %98, ptr noundef %100, i64 noundef %93, ptr noundef %91, ptr noundef %95, ptr noundef %35, ptr noundef %4, i64 noundef %5, float noundef %108, i64 noundef %2)
  %.not154 = icmp ugt i64 %93, %7
  br i1 %.not154, label %109, label %120

109:                                              ; preds = %101
  call void @__assert_fail(ptr noundef nonnull @.str.20, ptr noundef nonnull @.str.1, i32 noundef 2375, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_simplifyPoints) #7
  unreachable

110:                                              ; preds = %90
  %111 = landingpad { ptr, i32 }
          cleanup
  br label %123

112:                                              ; preds = %92
  %113 = landingpad { ptr, i32 }
          cleanup
  br label %123

114:                                              ; preds = %94
  %115 = landingpad { ptr, i32 }
          cleanup
  br label %123

116:                                              ; preds = %96
  %117 = landingpad { ptr, i32 }
          cleanup
  br label %123

118:                                              ; preds = %99
  %119 = landingpad { ptr, i32 }
          cleanup
  br label %123

120:                                              ; preds = %101
  %121 = shl i64 %93, 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %0, ptr align 4 %98, i64 %121, i1 false)
  br label %122

122:                                              ; preds = %88, %120
  %.0 = phi i64 [ %93, %120 ], [ 0, %88 ]
  call void @_ZN17meshopt_AllocatorD2Ev(ptr noundef nonnull align 8 dereferenceable(200) %9) #8
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %9) #8
  br label %124

123:                                              ; preds = %48, %76, %112, %116, %118, %114, %110, %50, %46
  %.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %47, %46 ], [ %49, %48 ], [ %51, %50 ], [ %77, %76 ], [ %111, %110 ], [ %113, %112 ], [ %115, %114 ], [ %119, %118 ], [ %117, %116 ]
  call void @_ZN17meshopt_AllocatorD2Ev(ptr noundef nonnull align 8 dereferenceable(200) %9) #8
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %9) #8
  resume { ptr, i32 } %.pn.pn.pn.pn.pn.pn.pn.pn

124:                                              ; preds = %32, %122
  %.1 = phi i64 [ %.0, %122 ], [ 0, %32 ]
  ret i64 %.1
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN7meshoptL13fillCellRemapEPjPfmPKjPKNS_9ReservoirEPKNS_7Vector3EPKfmfm(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, float noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.sqrt.f32(float) #6

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


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