; LLVM IR from RichtersFinger/ChainSimulation :: Simulation.ll (ZN10Simulation15addTrailofWallsESt6vectorI6VectorSaIS1_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.Vector = type { double, double }
%class.Wall = type <{ double, double, double, double, double, double, double, double, double, double, double, double, i32, [4 x i8] }>
%class.Simulation = type { %class.Chain, %"class.std::vector.0", double, double }
%class.Chain = type { double, double, double, double, double, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<ChainElement *, std::allocator<ChainElement *>>::_Vector_impl" }
%"struct.std::_Vector_base<ChainElement *, std::allocator<ChainElement *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ChainElement *, std::allocator<ChainElement *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ChainElement *, std::allocator<ChainElement *>>::_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<Wall *, std::allocator<Wall *>>::_Vector_impl" }
%"struct.std::_Vector_base<Wall *, std::allocator<Wall *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Wall *, std::allocator<Wall *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Wall *, std::allocator<Wall *>>::_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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10Simulation15addTrailofWallsESt6vectorI6VectorSaIS1_EE(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef %1) #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %class.Vector, align 8
  %11 = alloca %class.Vector, align 8
  %12 = alloca %class.Vector, align 8
  %13 = alloca %class.Vector, align 8
  %14 = alloca %class.Vector, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %15 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %16 = call noundef i64 @_ZNKSt6vectorI6VectorSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %17 = trunc i64 %16 to i32
  store i32 %17, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %18

18:                                               ; preds = %116, %2
  %19 = load i32, ptr %6, align 4, !tbaa !9
  %20 = load i32, ptr %5, align 4, !tbaa !9
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %119

23:                                               ; preds = %18
  %24 = load i32, ptr %6, align 4, !tbaa !9
  %25 = add nsw i32 %24, 1
  %26 = load i32, ptr %5, align 4, !tbaa !9
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %28, label %115

28:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %29 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 104) #7
  invoke void @_ZN4WallC2Ev(ptr noundef nonnull align 8 dereferenceable(100) %29)
          to label %30 unwind label %111

30:                                               ; preds = %28
  store ptr %29, ptr %7, align 8, !tbaa !5
  %31 = load i32, ptr %6, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI6VectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %32) #6
  %34 = getelementptr inbounds %class.Vector, ptr %33, i32 0, i32 0
  %35 = load double, ptr %34, align 8, !tbaa !11
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = getelementptr inbounds %class.Wall, ptr %36, i32 0, i32 0
  store double %35, ptr %37, align 8, !tbaa !14
  %38 = load i32, ptr %6, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI6VectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %39) #6
  %41 = getelementptr inbounds %class.Vector, ptr %40, i32 0, i32 1
  %42 = load double, ptr %41, align 8, !tbaa !17
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = getelementptr inbounds %class.Wall, ptr %43, i32 0, i32 1
  store double %42, ptr %44, align 8, !tbaa !18
  %45 = load i32, ptr %6, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI6VectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %46) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %47, i64 16, i1 false), !tbaa.struct !19
  %48 = load i32, ptr %6, align 4, !tbaa !9
  %49 = add nsw i32 %48, 1
  %50 = sext i32 %49 to i64
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI6VectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %50) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %51, i64 16, i1 false), !tbaa.struct !19
  %52 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 0
  %53 = load double, ptr %52, align 8
  %54 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 1
  %55 = load double, ptr %54, align 8
  %56 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 0
  %57 = load double, ptr %56, align 8
  %58 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 1
  %59 = load double, ptr %58, align 8
  %60 = call noundef double @_ZN10Simulation16distanceOfPointsE6VectorS0_(ptr noundef nonnull align 8 dereferenceable(104) %15, double %53, double %55, double %57, double %59)
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = getelementptr inbounds %class.Wall, ptr %61, i32 0, i32 2
  store double %60, ptr %62, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  %63 = load i32, ptr %6, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI6VectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %64) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %65, i64 16, i1 false), !tbaa.struct !19
  %66 = load i32, ptr %6, align 4, !tbaa !9
  %67 = add nsw i32 %66, 1
  %68 = sext i32 %67 to i64
  %69 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI6VectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %68) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %69, i64 16, i1 false), !tbaa.struct !19
  %70 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 0
  %71 = load double, ptr %70, align 8
  %72 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 1
  %73 = load double, ptr %72, align 8
  %74 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 0
  %75 = load double, ptr %74, align 8
  %76 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 1
  %77 = load double, ptr %76, align 8
  %78 = call { double, double } @_ZN10Simulation14relativeVectorE6VectorS0_(ptr noundef nonnull align 8 dereferenceable(104) %15, double %71, double %73, double %75, double %77)
  %79 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 0
  %80 = extractvalue { double, double } %78, 0
  store double %80, ptr %79, align 8
  %81 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 1
  %82 = extractvalue { double, double } %78, 1
  store double %82, ptr %81, align 8
  %83 = getelementptr inbounds %class.Vector, ptr %12, i32 0, i32 0
  %84 = load double, ptr %83, align 8, !tbaa !11
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  %86 = getelementptr inbounds %class.Wall, ptr %85, i32 0, i32 2
  %87 = load double, ptr %86, align 8, !tbaa !21
  %88 = fdiv double %84, %87
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %class.Wall, ptr %89, i32 0, i32 6
  store double %88, ptr %90, align 8, !tbaa !22
  %91 = getelementptr inbounds %class.Vector, ptr %12, i32 0, i32 1
  %92 = load double, ptr %91, align 8, !tbaa !17
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = getelementptr inbounds %class.Wall, ptr %93, i32 0, i32 2
  %95 = load double, ptr %94, align 8, !tbaa !21
  %96 = fdiv double %92, %95
  %97 = load ptr, ptr %7, align 8, !tbaa !5
  %98 = getelementptr inbounds %class.Wall, ptr %97, i32 0, i32 7
  store double %96, ptr %98, align 8, !tbaa !23
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = getelementptr inbounds %class.Wall, ptr %99, i32 0, i32 7
  %101 = load double, ptr %100, align 8, !tbaa !23
  %102 = fneg double %101
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = getelementptr inbounds %class.Wall, ptr %103, i32 0, i32 4
  store double %102, ptr %104, align 8, !tbaa !24
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  %106 = getelementptr inbounds %class.Wall, ptr %105, i32 0, i32 6
  %107 = load double, ptr %106, align 8, !tbaa !22
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = getelementptr inbounds %class.Wall, ptr %108, i32 0, i32 5
  store double %107, ptr %109, align 8, !tbaa !25
  %110 = getelementptr inbounds %class.Simulation, ptr %15, i32 0, i32 1
  call void @_ZNSt6vectorIP4WallSaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %110, ptr noundef nonnull align 8 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %115

111:                                              ; preds = %28
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %8, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %9, align 4
  call void @_ZdlPvm(ptr noundef %29, i64 noundef 104) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %120

115:                                              ; preds = %30, %23
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %6, align 4, !tbaa !9
  %118 = add nsw i32 %117, 2
  store i32 %118, ptr %6, align 4, !tbaa !9
  br label %18, !llvm.loop !26

119:                                              ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  ret void

120:                                              ; preds = %111
  %121 = load ptr, ptr %8, align 8
  %122 = load i32, ptr %9, align 4
  %123 = insertvalue { ptr, i32 } poison, ptr %121, 0
  %124 = insertvalue { ptr, i32 } %123, i32 %122, 1
  resume { ptr, i32 } %124
}

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #3

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #4

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN10Simulation16distanceOfPointsE6VectorS0_(ptr noundef nonnull align 8 dereferenceable(104), double, double, double, double) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZN10Simulation14relativeVectorE6VectorS0_(ptr noundef nonnull align 8 dereferenceable(104), double, double, double, double) #1 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { nobuiltin allocsize(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 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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 0}
!12 = !{!"_ZTS6Vector", !13, i64 0, !13, i64 8}
!13 = !{!"double", !7, i64 0}
!14 = !{!15, !13, i64 0}
!15 = !{!"_ZTS4Wall", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !13, i64 88, !16, i64 96}
!16 = !{!"_ZTS8WallType", !7, i64 0}
!17 = !{!12, !13, i64 8}
!18 = !{!15, !13, i64 8}
!19 = !{i64 0, i64 8, !20, i64 8, i64 8, !20}
!20 = !{!13, !13, i64 0}
!21 = !{!15, !13, i64 16}
!22 = !{!15, !13, i64 48}
!23 = !{!15, !13, i64 56}
!24 = !{!15, !13, i64 32}
!25 = !{!15, !13, i64 40}
!26 = distinct !{!26, !27}
!27 = !{!"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"

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10Simulation15addTrailofWallsESt6vectorI6VectorSaIS1_EE(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull %1) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = tail call noundef i64 @_ZNKSt6vectorI6VectorSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  %5 = trunc i64 %4 to i32
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %7 = getelementptr inbounds i8, ptr %0, i64 64
  %8 = and i64 %4, 2147483647
  br label %9

._crit_edge:                                      ; preds = %46, %2
  ret void

9:                                                ; preds = %.lr.ph, %46
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %46 ]
  %10 = or disjoint i64 %indvars.iv, 1
  %11 = icmp ult i64 %10, %8
  br i1 %11, label %12, label %46

12:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %13 = call noalias noundef nonnull dereferenceable(104) ptr @_Znwm(i64 noundef 104) #5
  call void @_ZN4WallC2Ev(ptr noundef nonnull align 8 dereferenceable(100) %13)
  store ptr %13, ptr %3, align 8, !tbaa !5
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI6VectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #4
  %15 = load double, ptr %14, align 8, !tbaa !9
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  store double %15, ptr %16, align 8, !tbaa !12
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI6VectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #4
  %18 = getelementptr inbounds i8, ptr %17, i64 8
  %19 = load double, ptr %18, align 8, !tbaa !15
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %20, i64 8
  store double %19, ptr %21, align 8, !tbaa !16
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI6VectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #4
  %.sroa.06.0.copyload = load double, ptr %22, align 8, !tbaa !17
  %.sroa.27.0..sroa_idx = getelementptr inbounds i8, ptr %22, i64 8
  %.sroa.27.0.copyload = load double, ptr %.sroa.27.0..sroa_idx, align 8, !tbaa !17
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI6VectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %10) #4
  %.sroa.04.0.copyload = load double, ptr %23, align 8, !tbaa !17
  %.sroa.25.0..sroa_idx = getelementptr inbounds i8, ptr %23, i64 8
  %.sroa.25.0.copyload = load double, ptr %.sroa.25.0..sroa_idx, align 8, !tbaa !17
  %24 = call noundef double @_ZN10Simulation16distanceOfPointsE6VectorS0_(ptr noundef nonnull align 8 dereferenceable(104) %0, double %.sroa.06.0.copyload, double %.sroa.27.0.copyload, double %.sroa.04.0.copyload, double %.sroa.25.0.copyload)
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %25, i64 16
  store double %24, ptr %26, align 8, !tbaa !18
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI6VectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #4
  %.sroa.01.0.copyload = load double, ptr %27, align 8, !tbaa !17
  %.sroa.22.0..sroa_idx = getelementptr inbounds i8, ptr %27, i64 8
  %.sroa.22.0.copyload = load double, ptr %.sroa.22.0..sroa_idx, align 8, !tbaa !17
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI6VectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %10) #4
  %.sroa.0.0.copyload = load double, ptr %28, align 8, !tbaa !17
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %28, i64 8
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !17
  %29 = call { double, double } @_ZN10Simulation14relativeVectorE6VectorS0_(ptr noundef nonnull align 8 dereferenceable(104) %0, double %.sroa.01.0.copyload, double %.sroa.22.0.copyload, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload)
  %30 = extractvalue { double, double } %29, 0
  %31 = extractvalue { double, double } %29, 1
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %32, i64 16
  %34 = load double, ptr %33, align 8, !tbaa !18
  %35 = getelementptr inbounds i8, ptr %32, i64 48
  %36 = insertelement <2 x double> poison, double %30, i64 0
  %37 = insertelement <2 x double> %36, double %31, i64 1
  %38 = insertelement <2 x double> poison, double %34, i64 0
  %39 = shufflevector <2 x double> %38, <2 x double> poison, <2 x i32> zeroinitializer
  %40 = fdiv <2 x double> %37, %39
  store <2 x double> %40, ptr %35, align 8, !tbaa !17
  %41 = extractelement <2 x double> %40, i64 1
  %42 = fneg double %41
  %43 = getelementptr inbounds i8, ptr %32, i64 32
  store double %42, ptr %43, align 8, !tbaa !19
  %44 = getelementptr inbounds i8, ptr %32, i64 40
  %45 = extractelement <2 x double> %40, i64 0
  store double %45, ptr %44, align 8, !tbaa !20
  call void @_ZNSt6vectorIP4WallSaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  br label %46

46:                                               ; preds = %9, %12
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 2
  %47 = trunc nuw i64 %indvars.iv.next to i32
  %48 = icmp slt i32 %47, %5
  br i1 %48, label %9, label %._crit_edge, !llvm.loop !21
}

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #3

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN10Simulation16distanceOfPointsE6VectorS0_(ptr noundef nonnull align 8 dereferenceable(104), double, double, double, double) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZN10Simulation14relativeVectorE6VectorS0_(ptr noundef nonnull align 8 dereferenceable(104), double, double, double, double) local_unnamed_addr #1 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { nobuiltin allocsize(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 }
attributes #5 = { builtin allocsize(0) }

!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, !11, i64 0}
!10 = !{!"_ZTS6Vector", !11, i64 0, !11, i64 8}
!11 = !{!"double", !7, i64 0}
!12 = !{!13, !11, i64 0}
!13 = !{!"_ZTS4Wall", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !14, i64 96}
!14 = !{!"_ZTS8WallType", !7, i64 0}
!15 = !{!10, !11, i64 8}
!16 = !{!13, !11, i64 8}
!17 = !{!11, !11, i64 0}
!18 = !{!13, !11, i64 16}
!19 = !{!13, !11, i64 32}
!20 = !{!13, !11, i64 40}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


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