; LLVM IR from jianboqi/CSF :: src/Cloth.ll (ZN5Cloth18findUnmovablePointESt6vectorI2XYSaIS1_EE)

; 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.Vec3 = type { [3 x double] }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.XY = type { i32, i32 }
%class.Cloth = type { i32, i32, double, %"class.std::vector", double, double, %class.Vec3, double, double, %"class.std::vector.0", i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Particle, std::allocator<Particle>>::_Vector_impl" }
%"struct.std::_Vector_base<Particle, std::allocator<Particle>>::_Vector_impl" = type { %"struct.std::_Vector_base<Particle, std::allocator<Particle>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Particle, std::allocator<Particle>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Vec3C2Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #2 align 2

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

; 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 noundef ptr @_ZN5Cloth11getParticleEii(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef, i32 noundef) #2 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8Particle9offsetPosE4Vec3(ptr noundef nonnull align 8 dereferenceable(216), ptr noundef byval(%class.Vec3) align 8) #2 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5Cloth18findUnmovablePointESt6vectorI2XYSaIS1_EE(ptr dead_on_unwind noalias writable sret(%"class.std::vector.10") align 8 %0, ptr noundef nonnull align 8 dereferenceable(128) %1, ptr noundef %2) #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i1, align 1
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca %class.Vec3, align 8
  %19 = alloca %class.Vec3, align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca %class.Vec3, align 8
  %24 = alloca %class.Vec3, align 8
  %25 = alloca i32, align 4
  %26 = alloca ptr, align 8
  %27 = alloca i32, align 4
  %28 = alloca %class.Vec3, align 8
  %29 = alloca %class.Vec3, align 8
  %30 = alloca i32, align 4
  %31 = alloca ptr, align 8
  %32 = alloca i32, align 4
  %33 = alloca %class.Vec3, align 8
  %34 = alloca %class.Vec3, align 8
  %35 = alloca i32, align 4
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %36 = load ptr, ptr %5, align 8
  store i1 false, ptr %7, align 1
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store i64 0, ptr %8, align 8, !tbaa !9
  br label %37

37:                                               ; preds = %482, %3
  %38 = load i64, ptr %8, align 8, !tbaa !9
  %39 = call noundef i64 @_ZNKSt6vectorI2XYSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %40 = icmp ult i64 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %486

42:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %43 = load i64, ptr %8, align 8, !tbaa !9
  %44 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI2XYSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %43) #5
  %45 = getelementptr inbounds %struct.XY, ptr %44, i32 0, i32 0
  %46 = load i32, ptr %45, align 4, !tbaa !11
  store i32 %46, ptr %10, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %47 = load i64, ptr %8, align 8, !tbaa !9
  %48 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI2XYSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %47) #5
  %49 = getelementptr inbounds %struct.XY, ptr %48, i32 0, i32 1
  %50 = load i32, ptr %49, align 4, !tbaa !15
  store i32 %50, ptr %11, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %51 = load i32, ptr %11, align 4, !tbaa !14
  %52 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 10
  %53 = load i32, ptr %52, align 8, !tbaa !16
  %54 = mul nsw i32 %51, %53
  %55 = load i32, ptr %10, align 4, !tbaa !14
  %56 = add nsw i32 %54, %55
  store i32 %56, ptr %12, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %57 = load i32, ptr %10, align 4, !tbaa !14
  %58 = load i32, ptr %11, align 4, !tbaa !14
  %59 = invoke noundef ptr @_ZN5Cloth11getParticleEii(ptr noundef nonnull align 8 dereferenceable(128) %36, i32 noundef %57, i32 noundef %58)
          to label %60 unwind label %135

60:                                               ; preds = %42
  store ptr %59, ptr %13, align 8, !tbaa !5
  %61 = load i32, ptr %10, align 4, !tbaa !14
  %62 = icmp sgt i32 %61, 0
  br i1 %62, label %63, label %166

63:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %64 = load i32, ptr %10, align 4, !tbaa !14
  %65 = sub nsw i32 %64, 1
  %66 = load i32, ptr %11, align 4, !tbaa !14
  %67 = invoke noundef ptr @_ZN5Cloth11getParticleEii(ptr noundef nonnull align 8 dereferenceable(128) %36, i32 noundef %65, i32 noundef %66)
          to label %68 unwind label %139

68:                                               ; preds = %63
  store ptr %67, ptr %16, align 8, !tbaa !5
  %69 = load ptr, ptr %16, align 8, !tbaa !5
  %70 = invoke noundef zeroext i1 @_ZN8Particle9isMovableEv(ptr noundef nonnull align 8 dereferenceable(216) %69)
          to label %71 unwind label %139

71:                                               ; preds = %68
  br i1 %70, label %161, label %72

72:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %73 = load i32, ptr %11, align 4, !tbaa !14
  %74 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 10
  %75 = load i32, ptr %74, align 8, !tbaa !16
  %76 = mul nsw i32 %73, %75
  %77 = load i32, ptr %10, align 4, !tbaa !14
  %78 = add nsw i32 %76, %77
  %79 = sub nsw i32 %78, 1
  store i32 %79, ptr %17, align 4, !tbaa !14
  %80 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 9
  %81 = load i32, ptr %12, align 4, !tbaa !14
  %82 = sext i32 %81 to i64
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %80, i64 noundef %82) #5
  %84 = load double, ptr %83, align 8, !tbaa !28
  %85 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 9
  %86 = load i32, ptr %17, align 4, !tbaa !14
  %87 = sext i32 %86 to i64
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %85, i64 noundef %87) #5
  %89 = load double, ptr %88, align 8, !tbaa !28
  %90 = fsub double %84, %89
  %91 = call double @llvm.fabs.f64(double %90)
  %92 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 4
  %93 = load double, ptr %92, align 8, !tbaa !29
  %94 = fcmp olt double %91, %93
  br i1 %94, label %95, label %156

95:                                               ; preds = %72
  %96 = load ptr, ptr %13, align 8, !tbaa !5
  %97 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN8Particle6getPosEv(ptr noundef nonnull align 8 dereferenceable(216) %96)
          to label %98 unwind label %143

98:                                               ; preds = %95
  %99 = getelementptr inbounds %class.Vec3, ptr %97, i32 0, i32 0
  %100 = getelementptr inbounds [3 x double], ptr %99, i64 0, i64 1
  %101 = load double, ptr %100, align 8, !tbaa !28
  %102 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 9
  %103 = load i32, ptr %12, align 4, !tbaa !14
  %104 = sext i32 %103 to i64
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %102, i64 noundef %104) #5
  %106 = load double, ptr %105, align 8, !tbaa !28
  %107 = fsub double %101, %106
  %108 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 5
  %109 = load double, ptr %108, align 8, !tbaa !30
  %110 = fcmp olt double %107, %109
  br i1 %110, label %111, label %156

111:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #5
  %112 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 9
  %113 = load i32, ptr %12, align 4, !tbaa !14
  %114 = sext i32 %113 to i64
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %112, i64 noundef %114) #5
  %116 = load double, ptr %115, align 8, !tbaa !28
  %117 = load ptr, ptr %13, align 8, !tbaa !5
  %118 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN8Particle6getPosEv(ptr noundef nonnull align 8 dereferenceable(216) %117)
          to label %119 unwind label %147

119:                                              ; preds = %111
  %120 = getelementptr inbounds %class.Vec3, ptr %118, i32 0, i32 0
  %121 = getelementptr inbounds [3 x double], ptr %120, i64 0, i64 1
  %122 = load double, ptr %121, align 8, !tbaa !28
  %123 = fsub double %116, %122
  invoke void @_ZN4Vec3C2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %18, double noundef 0.000000e+00, double noundef %123, double noundef 0.000000e+00)
          to label %124 unwind label %147

124:                                              ; preds = %119
  %125 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 3
  %126 = load i32, ptr %12, align 4, !tbaa !14
  %127 = sext i32 %126 to i64
  %128 = call noundef nonnull align 8 dereferenceable(216) ptr @_ZNSt6vectorI8ParticleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %125, i64 noundef %127) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %18, i64 24, i1 false), !tbaa.struct !31
  invoke void @_ZN8Particle9offsetPosE4Vec3(ptr noundef nonnull align 8 dereferenceable(216) %128, ptr noundef byval(%class.Vec3) align 8 %19)
          to label %129 unwind label %147

129:                                              ; preds = %124
  %130 = load ptr, ptr %13, align 8, !tbaa !5
  invoke void @_ZN8Particle13makeUnmovableEv(ptr noundef nonnull align 8 dereferenceable(216) %130)
          to label %131 unwind label %147

131:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %132 = load i64, ptr %8, align 8, !tbaa !9
  %133 = trunc i64 %132 to i32
  store i32 %133, ptr %20, align 4, !tbaa !14
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %20)
          to label %134 unwind label %151

134:                                              ; preds = %131
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  store i32 4, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #5
  br label %157

135:                                              ; preds = %42
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %14, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %15, align 4
  br label %485

139:                                              ; preds = %68, %63
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %14, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %15, align 4
  br label %165

143:                                              ; preds = %95
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %14, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %15, align 4
  br label %160

147:                                              ; preds = %129, %124, %119, %111
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %14, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %15, align 4
  br label %155

151:                                              ; preds = %131
  %152 = landingpad { ptr, i32 }
          cleanup
  %153 = extractvalue { ptr, i32 } %152, 0
  store ptr %153, ptr %14, align 8
  %154 = extractvalue { ptr, i32 } %152, 1
  store i32 %154, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %155

155:                                              ; preds = %151, %147
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #5
  br label %160

156:                                              ; preds = %98, %72
  store i32 0, ptr %9, align 4
  br label %157

157:                                              ; preds = %156, %134
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  %158 = load i32, ptr %9, align 4
  switch i32 %158, label %162 [
    i32 0, label %159
  ]

159:                                              ; preds = %157
  br label %161

160:                                              ; preds = %155, %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %165

161:                                              ; preds = %159, %71
  store i32 0, ptr %9, align 4
  br label %162

162:                                              ; preds = %161, %157
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  %163 = load i32, ptr %9, align 4
  switch i32 %163, label %479 [
    i32 0, label %164
  ]

164:                                              ; preds = %162
  br label %166

165:                                              ; preds = %160, %139
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %485

166:                                              ; preds = %164, %60
  %167 = load i32, ptr %10, align 4, !tbaa !14
  %168 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 10
  %169 = load i32, ptr %168, align 8, !tbaa !16
  %170 = sub nsw i32 %169, 1
  %171 = icmp slt i32 %167, %170
  br i1 %171, label %172, label %271

172:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %173 = load i32, ptr %10, align 4, !tbaa !14
  %174 = add nsw i32 %173, 1
  %175 = load i32, ptr %11, align 4, !tbaa !14
  %176 = invoke noundef ptr @_ZN5Cloth11getParticleEii(ptr noundef nonnull align 8 dereferenceable(128) %36, i32 noundef %174, i32 noundef %175)
          to label %177 unwind label %244

177:                                              ; preds = %172
  store ptr %176, ptr %21, align 8, !tbaa !5
  %178 = load ptr, ptr %21, align 8, !tbaa !5
  %179 = invoke noundef zeroext i1 @_ZN8Particle9isMovableEv(ptr noundef nonnull align 8 dereferenceable(216) %178)
          to label %180 unwind label %244

180:                                              ; preds = %177
  br i1 %179, label %266, label %181

181:                                              ; preds = %180
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %182 = load i32, ptr %11, align 4, !tbaa !14
  %183 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 10
  %184 = load i32, ptr %183, align 8, !tbaa !16
  %185 = mul nsw i32 %182, %184
  %186 = load i32, ptr %10, align 4, !tbaa !14
  %187 = add nsw i32 %185, %186
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %22, align 4, !tbaa !14
  %189 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 9
  %190 = load i32, ptr %12, align 4, !tbaa !14
  %191 = sext i32 %190 to i64
  %192 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %189, i64 noundef %191) #5
  %193 = load double, ptr %192, align 8, !tbaa !28
  %194 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 9
  %195 = load i32, ptr %22, align 4, !tbaa !14
  %196 = sext i32 %195 to i64
  %197 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %194, i64 noundef %196) #5
  %198 = load double, ptr %197, align 8, !tbaa !28
  %199 = fsub double %193, %198
  %200 = call double @llvm.fabs.f64(double %199)
  %201 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 4
  %202 = load double, ptr %201, align 8, !tbaa !29
  %203 = fcmp olt double %200, %202
  br i1 %203, label %204, label %261

204:                                              ; preds = %181
  %205 = load ptr, ptr %13, align 8, !tbaa !5
  %206 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN8Particle6getPosEv(ptr noundef nonnull align 8 dereferenceable(216) %205)
          to label %207 unwind label %248

207:                                              ; preds = %204
  %208 = getelementptr inbounds %class.Vec3, ptr %206, i32 0, i32 0
  %209 = getelementptr inbounds [3 x double], ptr %208, i64 0, i64 1
  %210 = load double, ptr %209, align 8, !tbaa !28
  %211 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 9
  %212 = load i32, ptr %12, align 4, !tbaa !14
  %213 = sext i32 %212 to i64
  %214 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %211, i64 noundef %213) #5
  %215 = load double, ptr %214, align 8, !tbaa !28
  %216 = fsub double %210, %215
  %217 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 5
  %218 = load double, ptr %217, align 8, !tbaa !30
  %219 = fcmp olt double %216, %218
  br i1 %219, label %220, label %261

220:                                              ; preds = %207
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #5
  %221 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 9
  %222 = load i32, ptr %12, align 4, !tbaa !14
  %223 = sext i32 %222 to i64
  %224 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %221, i64 noundef %223) #5
  %225 = load double, ptr %224, align 8, !tbaa !28
  %226 = load ptr, ptr %13, align 8, !tbaa !5
  %227 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN8Particle6getPosEv(ptr noundef nonnull align 8 dereferenceable(216) %226)
          to label %228 unwind label %252

228:                                              ; preds = %220
  %229 = getelementptr inbounds %class.Vec3, ptr %227, i32 0, i32 0
  %230 = getelementptr inbounds [3 x double], ptr %229, i64 0, i64 1
  %231 = load double, ptr %230, align 8, !tbaa !28
  %232 = fsub double %225, %231
  invoke void @_ZN4Vec3C2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %23, double noundef 0.000000e+00, double noundef %232, double noundef 0.000000e+00)
          to label %233 unwind label %252

233:                                              ; preds = %228
  %234 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 3
  %235 = load i32, ptr %12, align 4, !tbaa !14
  %236 = sext i32 %235 to i64
  %237 = call noundef nonnull align 8 dereferenceable(216) ptr @_ZNSt6vectorI8ParticleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %234, i64 noundef %236) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %24, ptr align 8 %23, i64 24, i1 false), !tbaa.struct !31
  invoke void @_ZN8Particle9offsetPosE4Vec3(ptr noundef nonnull align 8 dereferenceable(216) %237, ptr noundef byval(%class.Vec3) align 8 %24)
          to label %238 unwind label %252

238:                                              ; preds = %233
  %239 = load ptr, ptr %13, align 8, !tbaa !5
  invoke void @_ZN8Particle13makeUnmovableEv(ptr noundef nonnull align 8 dereferenceable(216) %239)
          to label %240 unwind label %252

240:                                              ; preds = %238
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  %241 = load i64, ptr %8, align 8, !tbaa !9
  %242 = trunc i64 %241 to i32
  store i32 %242, ptr %25, align 4, !tbaa !14
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %25)
          to label %243 unwind label %256

243:                                              ; preds = %240
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  store i32 4, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #5
  br label %262

244:                                              ; preds = %177, %172
  %245 = landingpad { ptr, i32 }
          cleanup
  %246 = extractvalue { ptr, i32 } %245, 0
  store ptr %246, ptr %14, align 8
  %247 = extractvalue { ptr, i32 } %245, 1
  store i32 %247, ptr %15, align 4
  br label %270

248:                                              ; preds = %204
  %249 = landingpad { ptr, i32 }
          cleanup
  %250 = extractvalue { ptr, i32 } %249, 0
  store ptr %250, ptr %14, align 8
  %251 = extractvalue { ptr, i32 } %249, 1
  store i32 %251, ptr %15, align 4
  br label %265

252:                                              ; preds = %238, %233, %228, %220
  %253 = landingpad { ptr, i32 }
          cleanup
  %254 = extractvalue { ptr, i32 } %253, 0
  store ptr %254, ptr %14, align 8
  %255 = extractvalue { ptr, i32 } %253, 1
  store i32 %255, ptr %15, align 4
  br label %260

256:                                              ; preds = %240
  %257 = landingpad { ptr, i32 }
          cleanup
  %258 = extractvalue { ptr, i32 } %257, 0
  store ptr %258, ptr %14, align 8
  %259 = extractvalue { ptr, i32 } %257, 1
  store i32 %259, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  br label %260

260:                                              ; preds = %256, %252
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #5
  br label %265

261:                                              ; preds = %207, %181
  store i32 0, ptr %9, align 4
  br label %262

262:                                              ; preds = %261, %243
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  %263 = load i32, ptr %9, align 4
  switch i32 %263, label %267 [
    i32 0, label %264
  ]

264:                                              ; preds = %262
  br label %266

265:                                              ; preds = %260, %248
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %270

266:                                              ; preds = %264, %180
  store i32 0, ptr %9, align 4
  br label %267

267:                                              ; preds = %266, %262
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  %268 = load i32, ptr %9, align 4
  switch i32 %268, label %479 [
    i32 0, label %269
  ]

269:                                              ; preds = %267
  br label %271

270:                                              ; preds = %265, %244
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %485

271:                                              ; preds = %269, %166
  %272 = load i32, ptr %11, align 4, !tbaa !14
  %273 = icmp sgt i32 %272, 0
  br i1 %273, label %274, label %373

274:                                              ; preds = %271
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %275 = load i32, ptr %10, align 4, !tbaa !14
  %276 = load i32, ptr %11, align 4, !tbaa !14
  %277 = sub nsw i32 %276, 1
  %278 = invoke noundef ptr @_ZN5Cloth11getParticleEii(ptr noundef nonnull align 8 dereferenceable(128) %36, i32 noundef %275, i32 noundef %277)
          to label %279 unwind label %346

279:                                              ; preds = %274
  store ptr %278, ptr %26, align 8, !tbaa !5
  %280 = load ptr, ptr %26, align 8, !tbaa !5
  %281 = invoke noundef zeroext i1 @_ZN8Particle9isMovableEv(ptr noundef nonnull align 8 dereferenceable(216) %280)
          to label %282 unwind label %346

282:                                              ; preds = %279
  br i1 %281, label %368, label %283

283:                                              ; preds = %282
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  %284 = load i32, ptr %11, align 4, !tbaa !14
  %285 = sub nsw i32 %284, 1
  %286 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 10
  %287 = load i32, ptr %286, align 8, !tbaa !16
  %288 = mul nsw i32 %285, %287
  %289 = load i32, ptr %10, align 4, !tbaa !14
  %290 = add nsw i32 %288, %289
  store i32 %290, ptr %27, align 4, !tbaa !14
  %291 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 9
  %292 = load i32, ptr %12, align 4, !tbaa !14
  %293 = sext i32 %292 to i64
  %294 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %291, i64 noundef %293) #5
  %295 = load double, ptr %294, align 8, !tbaa !28
  %296 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 9
  %297 = load i32, ptr %27, align 4, !tbaa !14
  %298 = sext i32 %297 to i64
  %299 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %296, i64 noundef %298) #5
  %300 = load double, ptr %299, align 8, !tbaa !28
  %301 = fsub double %295, %300
  %302 = call double @llvm.fabs.f64(double %301)
  %303 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 4
  %304 = load double, ptr %303, align 8, !tbaa !29
  %305 = fcmp olt double %302, %304
  br i1 %305, label %306, label %363

306:                                              ; preds = %283
  %307 = load ptr, ptr %13, align 8, !tbaa !5
  %308 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN8Particle6getPosEv(ptr noundef nonnull align 8 dereferenceable(216) %307)
          to label %309 unwind label %350

309:                                              ; preds = %306
  %310 = getelementptr inbounds %class.Vec3, ptr %308, i32 0, i32 0
  %311 = getelementptr inbounds [3 x double], ptr %310, i64 0, i64 1
  %312 = load double, ptr %311, align 8, !tbaa !28
  %313 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 9
  %314 = load i32, ptr %12, align 4, !tbaa !14
  %315 = sext i32 %314 to i64
  %316 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %313, i64 noundef %315) #5
  %317 = load double, ptr %316, align 8, !tbaa !28
  %318 = fsub double %312, %317
  %319 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 5
  %320 = load double, ptr %319, align 8, !tbaa !30
  %321 = fcmp olt double %318, %320
  br i1 %321, label %322, label %363

322:                                              ; preds = %309
  call void @llvm.lifetime.start.p0(i64 24, ptr %28) #5
  %323 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 9
  %324 = load i32, ptr %12, align 4, !tbaa !14
  %325 = sext i32 %324 to i64
  %326 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %323, i64 noundef %325) #5
  %327 = load double, ptr %326, align 8, !tbaa !28
  %328 = load ptr, ptr %13, align 8, !tbaa !5
  %329 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN8Particle6getPosEv(ptr noundef nonnull align 8 dereferenceable(216) %328)
          to label %330 unwind label %354

330:                                              ; preds = %322
  %331 = getelementptr inbounds %class.Vec3, ptr %329, i32 0, i32 0
  %332 = getelementptr inbounds [3 x double], ptr %331, i64 0, i64 1
  %333 = load double, ptr %332, align 8, !tbaa !28
  %334 = fsub double %327, %333
  invoke void @_ZN4Vec3C2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %28, double noundef 0.000000e+00, double noundef %334, double noundef 0.000000e+00)
          to label %335 unwind label %354

335:                                              ; preds = %330
  %336 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 3
  %337 = load i32, ptr %12, align 4, !tbaa !14
  %338 = sext i32 %337 to i64
  %339 = call noundef nonnull align 8 dereferenceable(216) ptr @_ZNSt6vectorI8ParticleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %336, i64 noundef %338) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %29, ptr align 8 %28, i64 24, i1 false), !tbaa.struct !31
  invoke void @_ZN8Particle9offsetPosE4Vec3(ptr noundef nonnull align 8 dereferenceable(216) %339, ptr noundef byval(%class.Vec3) align 8 %29)
          to label %340 unwind label %354

340:                                              ; preds = %335
  %341 = load ptr, ptr %13, align 8, !tbaa !5
  invoke void @_ZN8Particle13makeUnmovableEv(ptr noundef nonnull align 8 dereferenceable(216) %341)
          to label %342 unwind label %354

342:                                              ; preds = %340
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  %343 = load i64, ptr %8, align 8, !tbaa !9
  %344 = trunc i64 %343 to i32
  store i32 %344, ptr %30, align 4, !tbaa !14
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %30)
          to label %345 unwind label %358

345:                                              ; preds = %342
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  store i32 4, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %28) #5
  br label %364

346:                                              ; preds = %279, %274
  %347 = landingpad { ptr, i32 }
          cleanup
  %348 = extractvalue { ptr, i32 } %347, 0
  store ptr %348, ptr %14, align 8
  %349 = extractvalue { ptr, i32 } %347, 1
  store i32 %349, ptr %15, align 4
  br label %372

350:                                              ; preds = %306
  %351 = landingpad { ptr, i32 }
          cleanup
  %352 = extractvalue { ptr, i32 } %351, 0
  store ptr %352, ptr %14, align 8
  %353 = extractvalue { ptr, i32 } %351, 1
  store i32 %353, ptr %15, align 4
  br label %367

354:                                              ; preds = %340, %335, %330, %322
  %355 = landingpad { ptr, i32 }
          cleanup
  %356 = extractvalue { ptr, i32 } %355, 0
  store ptr %356, ptr %14, align 8
  %357 = extractvalue { ptr, i32 } %355, 1
  store i32 %357, ptr %15, align 4
  br label %362

358:                                              ; preds = %342
  %359 = landingpad { ptr, i32 }
          cleanup
  %360 = extractvalue { ptr, i32 } %359, 0
  store ptr %360, ptr %14, align 8
  %361 = extractvalue { ptr, i32 } %359, 1
  store i32 %361, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  br label %362

362:                                              ; preds = %358, %354
  call void @llvm.lifetime.end.p0(i64 24, ptr %28) #5
  br label %367

363:                                              ; preds = %309, %283
  store i32 0, ptr %9, align 4
  br label %364

364:                                              ; preds = %363, %345
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  %365 = load i32, ptr %9, align 4
  switch i32 %365, label %369 [
    i32 0, label %366
  ]

366:                                              ; preds = %364
  br label %368

367:                                              ; preds = %362, %350
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  br label %372

368:                                              ; preds = %366, %282
  store i32 0, ptr %9, align 4
  br label %369

369:                                              ; preds = %368, %364
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  %370 = load i32, ptr %9, align 4
  switch i32 %370, label %479 [
    i32 0, label %371
  ]

371:                                              ; preds = %369
  br label %373

372:                                              ; preds = %367, %346
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  br label %485

373:                                              ; preds = %371, %271
  %374 = load i32, ptr %11, align 4, !tbaa !14
  %375 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 11
  %376 = load i32, ptr %375, align 4, !tbaa !33
  %377 = sub nsw i32 %376, 1
  %378 = icmp slt i32 %374, %377
  br i1 %378, label %379, label %478

379:                                              ; preds = %373
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  %380 = load i32, ptr %10, align 4, !tbaa !14
  %381 = load i32, ptr %11, align 4, !tbaa !14
  %382 = add nsw i32 %381, 1
  %383 = invoke noundef ptr @_ZN5Cloth11getParticleEii(ptr noundef nonnull align 8 dereferenceable(128) %36, i32 noundef %380, i32 noundef %382)
          to label %384 unwind label %451

384:                                              ; preds = %379
  store ptr %383, ptr %31, align 8, !tbaa !5
  %385 = load ptr, ptr %31, align 8, !tbaa !5
  %386 = invoke noundef zeroext i1 @_ZN8Particle9isMovableEv(ptr noundef nonnull align 8 dereferenceable(216) %385)
          to label %387 unwind label %451

387:                                              ; preds = %384
  br i1 %386, label %473, label %388

388:                                              ; preds = %387
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #5
  %389 = load i32, ptr %11, align 4, !tbaa !14
  %390 = add nsw i32 %389, 1
  %391 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 10
  %392 = load i32, ptr %391, align 8, !tbaa !16
  %393 = mul nsw i32 %390, %392
  %394 = load i32, ptr %10, align 4, !tbaa !14
  %395 = add nsw i32 %393, %394
  store i32 %395, ptr %32, align 4, !tbaa !14
  %396 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 9
  %397 = load i32, ptr %12, align 4, !tbaa !14
  %398 = sext i32 %397 to i64
  %399 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %396, i64 noundef %398) #5
  %400 = load double, ptr %399, align 8, !tbaa !28
  %401 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 9
  %402 = load i32, ptr %32, align 4, !tbaa !14
  %403 = sext i32 %402 to i64
  %404 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %401, i64 noundef %403) #5
  %405 = load double, ptr %404, align 8, !tbaa !28
  %406 = fsub double %400, %405
  %407 = call double @llvm.fabs.f64(double %406)
  %408 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 4
  %409 = load double, ptr %408, align 8, !tbaa !29
  %410 = fcmp olt double %407, %409
  br i1 %410, label %411, label %468

411:                                              ; preds = %388
  %412 = load ptr, ptr %13, align 8, !tbaa !5
  %413 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN8Particle6getPosEv(ptr noundef nonnull align 8 dereferenceable(216) %412)
          to label %414 unwind label %455

414:                                              ; preds = %411
  %415 = getelementptr inbounds %class.Vec3, ptr %413, i32 0, i32 0
  %416 = getelementptr inbounds [3 x double], ptr %415, i64 0, i64 1
  %417 = load double, ptr %416, align 8, !tbaa !28
  %418 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 9
  %419 = load i32, ptr %12, align 4, !tbaa !14
  %420 = sext i32 %419 to i64
  %421 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %418, i64 noundef %420) #5
  %422 = load double, ptr %421, align 8, !tbaa !28
  %423 = fsub double %417, %422
  %424 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 5
  %425 = load double, ptr %424, align 8, !tbaa !30
  %426 = fcmp olt double %423, %425
  br i1 %426, label %427, label %468

427:                                              ; preds = %414
  call void @llvm.lifetime.start.p0(i64 24, ptr %33) #5
  %428 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 9
  %429 = load i32, ptr %12, align 4, !tbaa !14
  %430 = sext i32 %429 to i64
  %431 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %428, i64 noundef %430) #5
  %432 = load double, ptr %431, align 8, !tbaa !28
  %433 = load ptr, ptr %13, align 8, !tbaa !5
  %434 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN8Particle6getPosEv(ptr noundef nonnull align 8 dereferenceable(216) %433)
          to label %435 unwind label %459

435:                                              ; preds = %427
  %436 = getelementptr inbounds %class.Vec3, ptr %434, i32 0, i32 0
  %437 = getelementptr inbounds [3 x double], ptr %436, i64 0, i64 1
  %438 = load double, ptr %437, align 8, !tbaa !28
  %439 = fsub double %432, %438
  invoke void @_ZN4Vec3C2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %33, double noundef 0.000000e+00, double noundef %439, double noundef 0.000000e+00)
          to label %440 unwind label %459

440:                                              ; preds = %435
  %441 = getelementptr inbounds %class.Cloth, ptr %36, i32 0, i32 3
  %442 = load i32, ptr %12, align 4, !tbaa !14
  %443 = sext i32 %442 to i64
  %444 = call noundef nonnull align 8 dereferenceable(216) ptr @_ZNSt6vectorI8ParticleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %441, i64 noundef %443) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %34, ptr align 8 %33, i64 24, i1 false), !tbaa.struct !31
  invoke void @_ZN8Particle9offsetPosE4Vec3(ptr noundef nonnull align 8 dereferenceable(216) %444, ptr noundef byval(%class.Vec3) align 8 %34)
          to label %445 unwind label %459

445:                                              ; preds = %440
  %446 = load ptr, ptr %13, align 8, !tbaa !5
  invoke void @_ZN8Particle13makeUnmovableEv(ptr noundef nonnull align 8 dereferenceable(216) %446)
          to label %447 unwind label %459

447:                                              ; preds = %445
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #5
  %448 = load i64, ptr %8, align 8, !tbaa !9
  %449 = trunc i64 %448 to i32
  store i32 %449, ptr %35, align 4, !tbaa !14
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %35)
          to label %450 unwind label %463

450:                                              ; preds = %447
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #5
  store i32 4, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %33) #5
  br label %469

451:                                              ; preds = %384, %379
  %452 = landingpad { ptr, i32 }
          cleanup
  %453 = extractvalue { ptr, i32 } %452, 0
  store ptr %453, ptr %14, align 8
  %454 = extractvalue { ptr, i32 } %452, 1
  store i32 %454, ptr %15, align 4
  br label %477

455:                                              ; preds = %411
  %456 = landingpad { ptr, i32 }
          cleanup
  %457 = extractvalue { ptr, i32 } %456, 0
  store ptr %457, ptr %14, align 8
  %458 = extractvalue { ptr, i32 } %456, 1
  store i32 %458, ptr %15, align 4
  br label %472

459:                                              ; preds = %445, %440, %435, %427
  %460 = landingpad { ptr, i32 }
          cleanup
  %461 = extractvalue { ptr, i32 } %460, 0
  store ptr %461, ptr %14, align 8
  %462 = extractvalue { ptr, i32 } %460, 1
  store i32 %462, ptr %15, align 4
  br label %467

463:                                              ; preds = %447
  %464 = landingpad { ptr, i32 }
          cleanup
  %465 = extractvalue { ptr, i32 } %464, 0
  store ptr %465, ptr %14, align 8
  %466 = extractvalue { ptr, i32 } %464, 1
  store i32 %466, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #5
  br label %467

467:                                              ; preds = %463, %459
  call void @llvm.lifetime.end.p0(i64 24, ptr %33) #5
  br label %472

468:                                              ; preds = %414, %388
  store i32 0, ptr %9, align 4
  br label %469

469:                                              ; preds = %468, %450
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  %470 = load i32, ptr %9, align 4
  switch i32 %470, label %474 [
    i32 0, label %471
  ]

471:                                              ; preds = %469
  br label %473

472:                                              ; preds = %467, %455
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  br label %477

473:                                              ; preds = %471, %387
  store i32 0, ptr %9, align 4
  br label %474

474:                                              ; preds = %473, %469
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  %475 = load i32, ptr %9, align 4
  switch i32 %475, label %479 [
    i32 0, label %476
  ]

476:                                              ; preds = %474
  br label %478

477:                                              ; preds = %472, %451
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  br label %485

478:                                              ; preds = %476, %373
  store i32 0, ptr %9, align 4
  br label %479

479:                                              ; preds = %478, %474, %369, %267, %162
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %480 = load i32, ptr %9, align 4
  switch i32 %480, label %495 [
    i32 0, label %481
    i32 4, label %482
  ]

481:                                              ; preds = %479
  br label %482

482:                                              ; preds = %481, %479
  %483 = load i64, ptr %8, align 8, !tbaa !9
  %484 = add i64 %483, 1
  store i64 %484, ptr %8, align 8, !tbaa !9
  br label %37, !llvm.loop !34

485:                                              ; preds = %477, %372, %270, %165, %135
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %490

486:                                              ; preds = %41
  store i1 true, ptr %7, align 1
  store i32 1, ptr %9, align 4
  %487 = load i1, ptr %7, align 1
  br i1 %487, label %489, label %488

488:                                              ; preds = %486
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %489

489:                                              ; preds = %488, %486
  ret void

490:                                              ; preds = %485
  %491 = load ptr, ptr %14, align 8
  %492 = load i32, ptr %15, align 4
  %493 = insertvalue { ptr, i32 } poison, ptr %491, 0
  %494 = insertvalue { ptr, i32 } %493, i32 %492, 1
  resume { ptr, i32 } %494

495:                                              ; preds = %479
  unreachable
}

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

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

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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, !13, i64 0}
!12 = !{!"_ZTS2XY", !13, i64 0, !13, i64 4}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!12, !13, i64 4}
!16 = !{!17, !13, i64 120}
!17 = !{!"_ZTS5Cloth", !13, i64 0, !13, i64 4, !18, i64 8, !19, i64 16, !18, i64 40, !18, i64 48, !23, i64 56, !18, i64 80, !18, i64 88, !24, i64 96, !13, i64 120, !13, i64 124}
!18 = !{!"double", !7, i64 0}
!19 = !{!"_ZTSSt6vectorI8ParticleSaIS0_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseI8ParticleSaIS0_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseI8ParticleSaIS0_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseI8ParticleSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!"_ZTS4Vec3", !7, i64 0}
!24 = !{!"_ZTSSt6vectorIdSaIdEE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!28 = !{!18, !18, i64 0}
!29 = !{!17, !18, i64 40}
!30 = !{!17, !18, i64 48}
!31 = !{i64 0, i64 24, !32}
!32 = !{!7, !7, i64 0}
!33 = !{!17, !13, i64 124}
!34 = distinct !{!34, !35}
!35 = !{!"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.Vec3 = type { [3 x double] }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Vec3C2Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN5Cloth11getParticleEii(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN8Particle9isMovableEv(ptr noundef nonnull align 8 dereferenceable(216)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8Particle9offsetPosE4Vec3(ptr noundef nonnull align 8 dereferenceable(216), ptr noundef byval(%class.Vec3) align 8) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8Particle13makeUnmovableEv(ptr noundef nonnull align 8 dereferenceable(216)) local_unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5Cloth18findUnmovablePointESt6vectorI2XYSaIS1_EE(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::vector.10") align 8 %0, ptr noundef nonnull align 8 dereferenceable(128) %1, ptr noundef %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %class.Vec3, align 8
  %5 = alloca i32, align 4
  %6 = alloca %class.Vec3, align 8
  %7 = alloca i32, align 4
  %8 = alloca %class.Vec3, align 8
  %9 = alloca i32, align 4
  %10 = alloca %class.Vec3, align 8
  %11 = alloca i32, align 4
  tail call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  %12 = tail call noundef i64 @_ZNKSt6vectorI2XYSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %.not = icmp eq i64 %12, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %3
  %13 = getelementptr inbounds i8, ptr %1, i64 120
  %14 = getelementptr inbounds i8, ptr %1, i64 96
  %15 = getelementptr inbounds i8, ptr %1, i64 40
  %16 = getelementptr inbounds i8, ptr %1, i64 48
  %17 = getelementptr inbounds i8, ptr %1, i64 16
  %18 = getelementptr inbounds i8, ptr %1, i64 124
  br label %19

19:                                               ; preds = %.lr.ph, %192
  %.0116 = phi i64 [ 0, %.lr.ph ], [ %193, %192 ]
  %20 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI2XYSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.0116) #4
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI2XYSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.0116) #4
  %23 = getelementptr inbounds i8, ptr %22, i64 4
  %24 = load i32, ptr %23, align 4, !tbaa !10
  %25 = load i32, ptr %13, align 8, !tbaa !11
  %26 = mul nsw i32 %25, %24
  %27 = add nsw i32 %26, %21
  %28 = call noundef ptr @_ZN5Cloth11getParticleEii(ptr noundef nonnull align 8 dereferenceable(128) %1, i32 noundef %21, i32 noundef %24)
  %29 = icmp sgt i32 %21, 0
  br i1 %29, label %30, label %.thread97

30:                                               ; preds = %19
  %31 = add nsw i32 %21, -1
  %32 = call noundef ptr @_ZN5Cloth11getParticleEii(ptr noundef nonnull align 8 dereferenceable(128) %1, i32 noundef %31, i32 noundef %24)
  %33 = call noundef zeroext i1 @_ZN8Particle9isMovableEv(ptr noundef nonnull align 8 dereferenceable(216) %32)
  br i1 %33, label %.thread97, label %34

34:                                               ; preds = %30
  %35 = load i32, ptr %13, align 8, !tbaa !11
  %36 = mul nsw i32 %35, %24
  %37 = add i32 %31, %36
  %38 = sext i32 %27 to i64
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %38) #4
  %40 = load double, ptr %39, align 8, !tbaa !24
  %41 = sext i32 %37 to i64
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %41) #4
  %43 = load double, ptr %42, align 8, !tbaa !24
  %44 = fsub double %40, %43
  %45 = call double @llvm.fabs.f64(double %44)
  %46 = load double, ptr %15, align 8, !tbaa !25
  %47 = fcmp olt double %45, %46
  br i1 %47, label %48, label %.thread97

48:                                               ; preds = %34
  %49 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8Particle6getPosEv(ptr noundef nonnull align 8 dereferenceable(216) %28)
  %50 = getelementptr inbounds i8, ptr %49, i64 8
  %51 = load double, ptr %50, align 8, !tbaa !24
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %38) #4
  %53 = load double, ptr %52, align 8, !tbaa !24
  %54 = fsub double %51, %53
  %55 = load double, ptr %16, align 8, !tbaa !26
  %56 = fcmp olt double %54, %55
  br i1 %56, label %57, label %.thread97

57:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #4
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %38) #4
  %59 = load double, ptr %58, align 8, !tbaa !24
  %60 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8Particle6getPosEv(ptr noundef nonnull align 8 dereferenceable(216) %28)
  %61 = getelementptr inbounds i8, ptr %60, i64 8
  %62 = load double, ptr %61, align 8, !tbaa !24
  %63 = fsub double %59, %62
  call void @_ZN4Vec3C2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %4, double noundef 0.000000e+00, double noundef %63, double noundef 0.000000e+00)
  %64 = call noundef nonnull align 8 dereferenceable(216) ptr @_ZNSt6vectorI8ParticleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %38) #4
  call void @_ZN8Particle9offsetPosE4Vec3(ptr noundef nonnull align 8 dereferenceable(216) %64, ptr noundef nonnull byval(%class.Vec3) align 8 %4)
  call void @_ZN8Particle13makeUnmovableEv(ptr noundef nonnull align 8 dereferenceable(216) %28)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  %65 = trunc i64 %.0116 to i32
  store i32 %65, ptr %5, align 4, !tbaa !27
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %68 unwind label %66

66:                                               ; preds = %57
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  br label %196

68:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  br label %192

.thread97:                                        ; preds = %34, %48, %30, %19
  %69 = load i32, ptr %13, align 8, !tbaa !11
  %70 = add nsw i32 %69, -1
  %71 = icmp slt i32 %21, %70
  br i1 %71, label %72, label %.thread105

72:                                               ; preds = %.thread97
  %73 = add nsw i32 %21, 1
  %74 = call noundef ptr @_ZN5Cloth11getParticleEii(ptr noundef nonnull align 8 dereferenceable(128) %1, i32 noundef %73, i32 noundef %24)
  %75 = call noundef zeroext i1 @_ZN8Particle9isMovableEv(ptr noundef nonnull align 8 dereferenceable(216) %74)
  br i1 %75, label %.thread105, label %76

76:                                               ; preds = %72
  %77 = load i32, ptr %13, align 8, !tbaa !11
  %78 = mul nsw i32 %77, %24
  %79 = add i32 %73, %78
  %80 = sext i32 %27 to i64
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %80) #4
  %82 = load double, ptr %81, align 8, !tbaa !24
  %83 = sext i32 %79 to i64
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %83) #4
  %85 = load double, ptr %84, align 8, !tbaa !24
  %86 = fsub double %82, %85
  %87 = call double @llvm.fabs.f64(double %86)
  %88 = load double, ptr %15, align 8, !tbaa !25
  %89 = fcmp olt double %87, %88
  br i1 %89, label %90, label %.thread105

90:                                               ; preds = %76
  %91 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8Particle6getPosEv(ptr noundef nonnull align 8 dereferenceable(216) %28)
  %92 = getelementptr inbounds i8, ptr %91, i64 8
  %93 = load double, ptr %92, align 8, !tbaa !24
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %80) #4
  %95 = load double, ptr %94, align 8, !tbaa !24
  %96 = fsub double %93, %95
  %97 = load double, ptr %16, align 8, !tbaa !26
  %98 = fcmp olt double %96, %97
  br i1 %98, label %99, label %.thread105

99:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #4
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %80) #4
  %101 = load double, ptr %100, align 8, !tbaa !24
  %102 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8Particle6getPosEv(ptr noundef nonnull align 8 dereferenceable(216) %28)
  %103 = getelementptr inbounds i8, ptr %102, i64 8
  %104 = load double, ptr %103, align 8, !tbaa !24
  %105 = fsub double %101, %104
  call void @_ZN4Vec3C2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %6, double noundef 0.000000e+00, double noundef %105, double noundef 0.000000e+00)
  %106 = call noundef nonnull align 8 dereferenceable(216) ptr @_ZNSt6vectorI8ParticleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %80) #4
  call void @_ZN8Particle9offsetPosE4Vec3(ptr noundef nonnull align 8 dereferenceable(216) %106, ptr noundef nonnull byval(%class.Vec3) align 8 %6)
  call void @_ZN8Particle13makeUnmovableEv(ptr noundef nonnull align 8 dereferenceable(216) %28)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %107 = trunc i64 %.0116 to i32
  store i32 %107, ptr %7, align 4, !tbaa !27
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %110 unwind label %108

108:                                              ; preds = %99
  %109 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #4
  br label %196

110:                                              ; preds = %99
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #4
  br label %192

.thread105:                                       ; preds = %76, %90, %72, %.thread97
  %111 = icmp sgt i32 %24, 0
  br i1 %111, label %112, label %.thread113

112:                                              ; preds = %.thread105
  %113 = add nsw i32 %24, -1
  %114 = call noundef ptr @_ZN5Cloth11getParticleEii(ptr noundef nonnull align 8 dereferenceable(128) %1, i32 noundef %21, i32 noundef %113)
  %115 = call noundef zeroext i1 @_ZN8Particle9isMovableEv(ptr noundef nonnull align 8 dereferenceable(216) %114)
  br i1 %115, label %.thread113, label %116

116:                                              ; preds = %112
  %117 = load i32, ptr %13, align 8, !tbaa !11
  %118 = mul nsw i32 %117, %113
  %119 = add nsw i32 %118, %21
  %120 = sext i32 %27 to i64
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %120) #4
  %122 = load double, ptr %121, align 8, !tbaa !24
  %123 = sext i32 %119 to i64
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %123) #4
  %125 = load double, ptr %124, align 8, !tbaa !24
  %126 = fsub double %122, %125
  %127 = call double @llvm.fabs.f64(double %126)
  %128 = load double, ptr %15, align 8, !tbaa !25
  %129 = fcmp olt double %127, %128
  br i1 %129, label %130, label %.thread113

130:                                              ; preds = %116
  %131 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8Particle6getPosEv(ptr noundef nonnull align 8 dereferenceable(216) %28)
  %132 = getelementptr inbounds i8, ptr %131, i64 8
  %133 = load double, ptr %132, align 8, !tbaa !24
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %120) #4
  %135 = load double, ptr %134, align 8, !tbaa !24
  %136 = fsub double %133, %135
  %137 = load double, ptr %16, align 8, !tbaa !26
  %138 = fcmp olt double %136, %137
  br i1 %138, label %139, label %.thread113

139:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #4
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %120) #4
  %141 = load double, ptr %140, align 8, !tbaa !24
  %142 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8Particle6getPosEv(ptr noundef nonnull align 8 dereferenceable(216) %28)
  %143 = getelementptr inbounds i8, ptr %142, i64 8
  %144 = load double, ptr %143, align 8, !tbaa !24
  %145 = fsub double %141, %144
  call void @_ZN4Vec3C2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %8, double noundef 0.000000e+00, double noundef %145, double noundef 0.000000e+00)
  %146 = call noundef nonnull align 8 dereferenceable(216) ptr @_ZNSt6vectorI8ParticleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %120) #4
  call void @_ZN8Particle9offsetPosE4Vec3(ptr noundef nonnull align 8 dereferenceable(216) %146, ptr noundef nonnull byval(%class.Vec3) align 8 %8)
  call void @_ZN8Particle13makeUnmovableEv(ptr noundef nonnull align 8 dereferenceable(216) %28)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #4
  %147 = trunc i64 %.0116 to i32
  store i32 %147, ptr %9, align 4, !tbaa !27
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %150 unwind label %148

148:                                              ; preds = %139
  %149 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #4
  br label %196

150:                                              ; preds = %139
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #4
  br label %192

.thread113:                                       ; preds = %116, %130, %112, %.thread105
  %151 = load i32, ptr %18, align 4, !tbaa !28
  %152 = add nsw i32 %151, -1
  %153 = icmp slt i32 %24, %152
  br i1 %153, label %154, label %192

154:                                              ; preds = %.thread113
  %155 = add nsw i32 %24, 1
  %156 = call noundef ptr @_ZN5Cloth11getParticleEii(ptr noundef nonnull align 8 dereferenceable(128) %1, i32 noundef %21, i32 noundef %155)
  %157 = call noundef zeroext i1 @_ZN8Particle9isMovableEv(ptr noundef nonnull align 8 dereferenceable(216) %156)
  br i1 %157, label %192, label %158

158:                                              ; preds = %154
  %159 = load i32, ptr %13, align 8, !tbaa !11
  %160 = mul nsw i32 %159, %155
  %161 = add nsw i32 %160, %21
  %162 = sext i32 %27 to i64
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %162) #4
  %164 = load double, ptr %163, align 8, !tbaa !24
  %165 = sext i32 %161 to i64
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %165) #4
  %167 = load double, ptr %166, align 8, !tbaa !24
  %168 = fsub double %164, %167
  %169 = call double @llvm.fabs.f64(double %168)
  %170 = load double, ptr %15, align 8, !tbaa !25
  %171 = fcmp olt double %169, %170
  br i1 %171, label %172, label %192

172:                                              ; preds = %158
  %173 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8Particle6getPosEv(ptr noundef nonnull align 8 dereferenceable(216) %28)
  %174 = getelementptr inbounds i8, ptr %173, i64 8
  %175 = load double, ptr %174, align 8, !tbaa !24
  %176 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %162) #4
  %177 = load double, ptr %176, align 8, !tbaa !24
  %178 = fsub double %175, %177
  %179 = load double, ptr %16, align 8, !tbaa !26
  %180 = fcmp olt double %178, %179
  br i1 %180, label %181, label %192

181:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #4
  %182 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %162) #4
  %183 = load double, ptr %182, align 8, !tbaa !24
  %184 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8Particle6getPosEv(ptr noundef nonnull align 8 dereferenceable(216) %28)
  %185 = getelementptr inbounds i8, ptr %184, i64 8
  %186 = load double, ptr %185, align 8, !tbaa !24
  %187 = fsub double %183, %186
  call void @_ZN4Vec3C2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %10, double noundef 0.000000e+00, double noundef %187, double noundef 0.000000e+00)
  %188 = call noundef nonnull align 8 dereferenceable(216) ptr @_ZNSt6vectorI8ParticleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %162) #4
  call void @_ZN8Particle9offsetPosE4Vec3(ptr noundef nonnull align 8 dereferenceable(216) %188, ptr noundef nonnull byval(%class.Vec3) align 8 %10)
  call void @_ZN8Particle13makeUnmovableEv(ptr noundef nonnull align 8 dereferenceable(216) %28)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #4
  %189 = trunc i64 %.0116 to i32
  store i32 %189, ptr %11, align 4, !tbaa !27
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %.critedge unwind label %190

.critedge:                                        ; preds = %181
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #4
  br label %192

190:                                              ; preds = %181
  %191 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #4
  br label %196

192:                                              ; preds = %150, %110, %68, %154, %158, %172, %.critedge, %.thread113
  %193 = add nuw i64 %.0116, 1
  %194 = call noundef i64 @_ZNKSt6vectorI2XYSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %195 = icmp ult i64 %193, %194
  br i1 %195, label %19, label %._crit_edge, !llvm.loop !29

196:                                              ; preds = %190, %148, %108, %66
  %.pn = phi { ptr, i32 } [ %191, %190 ], [ %149, %148 ], [ %109, %108 ], [ %67, %66 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  resume { ptr, i32 } %.pn

._crit_edge:                                      ; preds = %192, %3
  ret void
}

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTS2XY", !7, i64 0, !7, i64 4}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 4}
!11 = !{!12, !7, i64 120}
!12 = !{!"_ZTS5Cloth", !7, i64 0, !7, i64 4, !13, i64 8, !14, i64 16, !13, i64 40, !13, i64 48, !19, i64 56, !13, i64 80, !13, i64 88, !20, i64 96, !7, i64 120, !7, i64 124}
!13 = !{!"double", !8, i64 0}
!14 = !{!"_ZTSSt6vectorI8ParticleSaIS0_EE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseI8ParticleSaIS0_EE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseI8ParticleSaIS0_EE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseI8ParticleSaIS0_EE17_Vector_impl_dataE", !18, i64 0, !18, i64 8, !18, i64 16}
!18 = !{!"any pointer", !8, i64 0}
!19 = !{!"_ZTS4Vec3", !8, i64 0}
!20 = !{!"_ZTSSt6vectorIdSaIdEE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !18, i64 0, !18, i64 8, !18, i64 16}
!24 = !{!13, !13, i64 0}
!25 = !{!12, !13, i64 40}
!26 = !{!12, !13, i64 48}
!27 = !{!7, !7, i64 0}
!28 = !{!12, !7, i64 124}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}


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