; LLVM IR from faishasj/cpparticles :: src/environment.ll (ZN11Environment6updateEv)

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

%struct.Vector = type { float, float }
%class.Environment = type { i32, i32, i8, i8, i8, i8, i8, i8, i8, float, float, %"class.std::vector", %"class.std::vector.0", %struct.Vector }
%"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<Spring *, std::allocator<Spring *>>::_Vector_impl" }
%"struct.std::_Vector_base<Spring *, std::allocator<Spring *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Spring *, std::allocator<Spring *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Spring *, std::allocator<Spring *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: 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 noundef i64 @_ZNKSt6vectorIP6SpringSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

; Function Attrs: 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 i64 @_ZNKSt6vectorIP8ParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11Environment6updateEv(ptr noundef nonnull align 8 dereferenceable(80) %0) #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %struct.Vector, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %11 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %12

12:                                               ; preds = %91, %1
  %13 = load i32, ptr %3, align 4, !tbaa !9
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds %class.Environment, ptr %11, i32 0, i32 11
  %16 = call noundef i64 @_ZNKSt6vectorIP8ParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #6
  %17 = icmp ult i64 %14, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %12
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %94

19:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %20 = getelementptr inbounds %class.Environment, ptr %11, i32 0, i32 11
  %21 = load i32, ptr %3, align 4, !tbaa !9
  %22 = sext i32 %21 to i64
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8ParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %22) #6
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %24, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %class.Environment, ptr %11, i32 0, i32 2
  %26 = load i8, ptr %25, align 8, !tbaa !11, !range !24, !noundef !25
  %27 = trunc i8 %26 to i1
  br i1 %27, label %28, label %32

28:                                               ; preds = %19
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %class.Environment, ptr %11, i32 0, i32 13
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 8 %30, i64 8, i1 false), !tbaa.struct !26
  %31 = load <2 x float>, ptr %6, align 4
  call void @_ZN8Particle10accelerateE6Vector(ptr noundef nonnull align 8 dereferenceable(40) %29, <2 x float> %31)
  br label %32

32:                                               ; preds = %28, %19
  %33 = getelementptr inbounds %class.Environment, ptr %11, i32 0, i32 8
  %34 = load i8, ptr %33, align 2, !tbaa !28, !range !24, !noundef !25
  %35 = trunc i8 %34 to i1
  br i1 %35, label %36, label %38

36:                                               ; preds = %32
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN8Particle4moveEv(ptr noundef nonnull align 8 dereferenceable(40) %37)
  br label %38

38:                                               ; preds = %36, %32
  %39 = getelementptr inbounds %class.Environment, ptr %11, i32 0, i32 7
  %40 = load i8, ptr %39, align 1, !tbaa !29, !range !24, !noundef !25
  %41 = trunc i8 %40 to i1
  br i1 %41, label %42, label %44

42:                                               ; preds = %38
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN8Particle14experienceDragEv(ptr noundef nonnull align 8 dereferenceable(40) %43)
  br label %44

44:                                               ; preds = %42, %38
  %45 = getelementptr inbounds %class.Environment, ptr %11, i32 0, i32 4
  %46 = load i8, ptr %45, align 2, !tbaa !30, !range !24, !noundef !25
  %47 = trunc i8 %46 to i1
  br i1 %47, label %48, label %50

48:                                               ; preds = %44
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN11Environment6bounceEP8Particle(ptr noundef nonnull align 8 dereferenceable(80) %11, ptr noundef %49)
  br label %50

50:                                               ; preds = %48, %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %51 = load i32, ptr %3, align 4, !tbaa !9
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %7, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %87, %50
  %54 = load i32, ptr %7, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds %class.Environment, ptr %11, i32 0, i32 11
  %57 = call noundef i64 @_ZNKSt6vectorIP8ParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %56) #6
  %58 = icmp ult i64 %55, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %53
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %90

60:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %61 = getelementptr inbounds %class.Environment, ptr %11, i32 0, i32 11
  %62 = load i32, ptr %7, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8ParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %61, i64 noundef %63) #6
  %65 = load ptr, ptr %64, align 8, !tbaa !5
  store ptr %65, ptr %8, align 8, !tbaa !5
  %66 = getelementptr inbounds %class.Environment, ptr %11, i32 0, i32 5
  %67 = load i8, ptr %66, align 1, !tbaa !31, !range !24, !noundef !25
  %68 = trunc i8 %67 to i1
  br i1 %68, label %69, label %72

69:                                               ; preds = %60
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN8Particle7collideEPS_(ptr noundef nonnull align 8 dereferenceable(40) %70, ptr noundef %71)
  br label %72

72:                                               ; preds = %69, %60
  %73 = getelementptr inbounds %class.Environment, ptr %11, i32 0, i32 3
  %74 = load i8, ptr %73, align 1, !tbaa !32, !range !24, !noundef !25
  %75 = trunc i8 %74 to i1
  br i1 %75, label %76, label %79

76:                                               ; preds = %72
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN8Particle7attractEPS_(ptr noundef nonnull align 8 dereferenceable(40) %77, ptr noundef %78)
  br label %79

79:                                               ; preds = %76, %72
  %80 = getelementptr inbounds %class.Environment, ptr %11, i32 0, i32 6
  %81 = load i8, ptr %80, align 4, !tbaa !33, !range !24, !noundef !25
  %82 = trunc i8 %81 to i1
  br i1 %82, label %83, label %86

83:                                               ; preds = %79
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN8Particle7combineEPS_(ptr noundef nonnull align 8 dereferenceable(40) %84, ptr noundef %85)
  br label %86

86:                                               ; preds = %83, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %87

87:                                               ; preds = %86
  %88 = load i32, ptr %7, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %7, align 4, !tbaa !9
  br label %53, !llvm.loop !34

90:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %91

91:                                               ; preds = %90
  %92 = load i32, ptr %3, align 4, !tbaa !9
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %3, align 4, !tbaa !9
  br label %12, !llvm.loop !36

94:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %95

95:                                               ; preds = %109, %94
  %96 = load i32, ptr %9, align 4, !tbaa !9
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds %class.Environment, ptr %11, i32 0, i32 12
  %99 = call noundef i64 @_ZNKSt6vectorIP6SpringSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %98) #6
  %100 = icmp ult i64 %97, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %95
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %112

102:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %103 = getelementptr inbounds %class.Environment, ptr %11, i32 0, i32 12
  %104 = load i32, ptr %9, align 4, !tbaa !9
  %105 = sext i32 %104 to i64
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP6SpringSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %103, i64 noundef %105) #6
  %107 = load ptr, ptr %106, align 8, !tbaa !5
  store ptr %107, ptr %10, align 8, !tbaa !5
  %108 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN6Spring6updateEv(ptr noundef nonnull align 8 dereferenceable(24) %108)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %109

109:                                              ; preds = %102
  %110 = load i32, ptr %9, align 4, !tbaa !9
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %9, align 4, !tbaa !9
  br label %95, !llvm.loop !37

112:                                              ; preds = %101
  ret void
}

declare void @_ZN8Particle10accelerateE6Vector(ptr noundef nonnull align 8 dereferenceable(40), <2 x float>) #4

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

declare void @_ZN8Particle4moveEv(ptr noundef nonnull align 8 dereferenceable(40)) #4

declare void @_ZN8Particle14experienceDragEv(ptr noundef nonnull align 8 dereferenceable(40)) #4

declare void @_ZN8Particle7collideEPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) #4

declare void @_ZN8Particle7attractEPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) #4

declare void @_ZN8Particle7combineEPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) #4

declare void @_ZN6Spring6updateEv(ptr noundef nonnull align 8 dereferenceable(24)) #4

attributes #0 = { 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 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 uwtable "min-legal-vector-width"="64" "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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 8}
!12 = !{!"_ZTS11Environment", !10, i64 0, !10, i64 4, !13, i64 8, !13, i64 9, !13, i64 10, !13, i64 11, !13, i64 12, !13, i64 13, !13, i64 14, !14, i64 16, !14, i64 20, !15, i64 24, !19, i64 48, !23, i64 72}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!"_ZTSSt6vectorIP8ParticleSaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIP8ParticleSaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIP8ParticleSaIS1_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIP8ParticleSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"_ZTSSt6vectorIP6SpringSaIS1_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIP6SpringSaIS1_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIP6SpringSaIS1_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIP6SpringSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!"_ZTS6Vector", !14, i64 0, !14, i64 4}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{i64 0, i64 4, !27, i64 4, i64 4, !27}
!27 = !{!14, !14, i64 0}
!28 = !{!12, !13, i64 14}
!29 = !{!12, !13, i64 13}
!30 = !{!12, !13, i64 10}
!31 = !{!12, !13, i64 11}
!32 = !{!12, !13, i64 9}
!33 = !{!12, !13, i64 12}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = distinct !{!36, !35}
!37 = distinct !{!37, !35}


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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11Environment6bounceEP8Particle(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11Environment6updateEv(ptr noundef nonnull align 8 dereferenceable(80) %0) local_unnamed_addr #2 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 24
  %3 = tail call noundef i64 @_ZNKSt6vectorIP8ParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %.not = icmp eq i64 %3, 0
  br i1 %.not, label %.preheader, label %.lr.ph28

.lr.ph28:                                         ; preds = %1
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = getelementptr inbounds i8, ptr %0, i64 72
  %6 = getelementptr inbounds i8, ptr %0, i64 14
  %7 = getelementptr inbounds i8, ptr %0, i64 13
  %8 = getelementptr inbounds i8, ptr %0, i64 10
  %9 = getelementptr inbounds i8, ptr %0, i64 11
  %10 = getelementptr inbounds i8, ptr %0, i64 9
  %11 = getelementptr inbounds i8, ptr %0, i64 12
  br label %16

.loopexit:                                        ; preds = %50, %34
  %12 = tail call noundef i64 @_ZNKSt6vectorIP8ParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %13 = icmp ugt i64 %12, %indvars.iv.next36
  %indvars.iv.next = add i64 %indvars.iv, 1
  br i1 %13, label %16, label %.preheader, !llvm.loop !5

.preheader:                                       ; preds = %.loopexit, %1
  %14 = getelementptr inbounds i8, ptr %0, i64 48
  %15 = tail call noundef i64 @_ZNKSt6vectorIP6SpringSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  %.not31 = icmp eq i64 %15, 0
  br i1 %.not31, label %._crit_edge, label %.lr.ph30

16:                                               ; preds = %.lr.ph28, %.loopexit
  %indvars.iv35 = phi i64 [ 0, %.lr.ph28 ], [ %indvars.iv.next36, %.loopexit ]
  %indvars.iv = phi i64 [ 1, %.lr.ph28 ], [ %indvars.iv.next, %.loopexit ]
  %17 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8ParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv35) #4
  %18 = load ptr, ptr %17, align 8, !tbaa !7
  %19 = load i8, ptr %4, align 8, !tbaa !11, !range !25, !noundef !26
  %20 = trunc nuw i8 %19 to i1
  br i1 %20, label %21, label %22

21:                                               ; preds = %16
  %.sroa.0.0.copyload = load <2 x float>, ptr %5, align 8
  tail call void @_ZN8Particle10accelerateE6Vector(ptr noundef nonnull align 8 dereferenceable(40) %18, <2 x float> %.sroa.0.0.copyload)
  br label %22

22:                                               ; preds = %21, %16
  %23 = load i8, ptr %6, align 2, !tbaa !27, !range !25, !noundef !26
  %24 = trunc nuw i8 %23 to i1
  br i1 %24, label %25, label %26

25:                                               ; preds = %22
  tail call void @_ZN8Particle4moveEv(ptr noundef nonnull align 8 dereferenceable(40) %18)
  br label %26

26:                                               ; preds = %25, %22
  %27 = load i8, ptr %7, align 1, !tbaa !28, !range !25, !noundef !26
  %28 = trunc nuw i8 %27 to i1
  br i1 %28, label %29, label %30

29:                                               ; preds = %26
  tail call void @_ZN8Particle14experienceDragEv(ptr noundef nonnull align 8 dereferenceable(40) %18)
  br label %30

30:                                               ; preds = %29, %26
  %31 = load i8, ptr %8, align 2, !tbaa !29, !range !25, !noundef !26
  %32 = trunc nuw i8 %31 to i1
  br i1 %32, label %33, label %34

33:                                               ; preds = %30
  tail call void @_ZN11Environment6bounceEP8Particle(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef %18)
  br label %34

34:                                               ; preds = %33, %30
  %indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1
  %35 = tail call noundef i64 @_ZNKSt6vectorIP8ParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %36 = icmp ugt i64 %35, %indvars.iv.next36
  br i1 %36, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %34, %50
  %indvars.iv32 = phi i64 [ %indvars.iv.next33, %50 ], [ %indvars.iv, %34 ]
  %37 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP8ParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv32) #4
  %38 = load ptr, ptr %37, align 8, !tbaa !7
  %39 = load i8, ptr %9, align 1, !tbaa !30, !range !25, !noundef !26
  %40 = trunc nuw i8 %39 to i1
  br i1 %40, label %41, label %42

41:                                               ; preds = %.lr.ph
  tail call void @_ZN8Particle7collideEPS_(ptr noundef nonnull align 8 dereferenceable(40) %18, ptr noundef %38)
  br label %42

42:                                               ; preds = %41, %.lr.ph
  %43 = load i8, ptr %10, align 1, !tbaa !31, !range !25, !noundef !26
  %44 = trunc nuw i8 %43 to i1
  br i1 %44, label %45, label %46

45:                                               ; preds = %42
  tail call void @_ZN8Particle7attractEPS_(ptr noundef nonnull align 8 dereferenceable(40) %18, ptr noundef %38)
  br label %46

46:                                               ; preds = %45, %42
  %47 = load i8, ptr %11, align 4, !tbaa !32, !range !25, !noundef !26
  %48 = trunc nuw i8 %47 to i1
  br i1 %48, label %49, label %50

49:                                               ; preds = %46
  tail call void @_ZN8Particle7combineEPS_(ptr noundef nonnull align 8 dereferenceable(40) %18, ptr noundef %38)
  br label %50

50:                                               ; preds = %49, %46
  %indvars.iv.next33 = add nuw nsw i64 %indvars.iv32, 1
  %51 = tail call noundef i64 @_ZNKSt6vectorIP8ParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %52 = icmp ugt i64 %51, %indvars.iv.next33
  br i1 %52, label %.lr.ph, label %.loopexit, !llvm.loop !33

._crit_edge:                                      ; preds = %.lr.ph30, %.preheader
  ret void

.lr.ph30:                                         ; preds = %.preheader, %.lr.ph30
  %indvars.iv38 = phi i64 [ %indvars.iv.next39, %.lr.ph30 ], [ 0, %.preheader ]
  %53 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP6SpringSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %indvars.iv38) #4
  %54 = load ptr, ptr %53, align 8, !tbaa !7
  tail call void @_ZN6Spring6updateEv(ptr noundef nonnull align 8 dereferenceable(24) %54)
  %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1
  %55 = tail call noundef i64 @_ZNKSt6vectorIP6SpringSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  %56 = icmp ugt i64 %55, %indvars.iv.next39
  br i1 %56, label %.lr.ph30, label %._crit_edge, !llvm.loop !34
}

declare void @_ZN8Particle10accelerateE6Vector(ptr noundef nonnull align 8 dereferenceable(40), <2 x float>) local_unnamed_addr #3

declare void @_ZN8Particle4moveEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3

declare void @_ZN8Particle14experienceDragEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3

declare void @_ZN8Particle7collideEPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) local_unnamed_addr #3

declare void @_ZN8Particle7attractEPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) local_unnamed_addr #3

declare void @_ZN8Particle7combineEPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) local_unnamed_addr #3

declare void @_ZN6Spring6updateEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = { "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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!12, !14, i64 8}
!12 = !{!"_ZTS11Environment", !13, i64 0, !13, i64 4, !14, i64 8, !14, i64 9, !14, i64 10, !14, i64 11, !14, i64 12, !14, i64 13, !14, i64 14, !15, i64 16, !15, i64 20, !16, i64 24, !20, i64 48, !24, i64 72}
!13 = !{!"int", !9, i64 0}
!14 = !{!"bool", !9, i64 0}
!15 = !{!"float", !9, i64 0}
!16 = !{!"_ZTSSt6vectorIP8ParticleSaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIP8ParticleSaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIP8ParticleSaIS1_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIP8ParticleSaIS1_EE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!20 = !{!"_ZTSSt6vectorIP6SpringSaIS1_EE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIP6SpringSaIS1_EE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIP6SpringSaIS1_EE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIP6SpringSaIS1_EE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!24 = !{!"_ZTS6Vector", !15, i64 0, !15, i64 4}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!12, !14, i64 14}
!28 = !{!12, !14, i64 13}
!29 = !{!12, !14, i64 10}
!30 = !{!12, !14, i64 11}
!31 = !{!12, !14, i64 9}
!32 = !{!12, !14, i64 12}
!33 = distinct !{!33, !6}
!34 = distinct !{!34, !6}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass