; LLVM IR from RichtersFinger/ChainSimulation :: Chain.ll (ZN5Chain20quickArrangementLineE6VectorS0_)

; 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.__gnu_cxx::__normal_iterator" = type { ptr }
%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.ChainElement = type { double, double, double, double, double, double, double, double, i8, ptr, ptr }

; Function Attrs: nounwind
declare double @sqrt(double noundef) #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIP12ChainElementSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #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 ptr @_ZNSt6vectorIP12ChainElementSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPP12ChainElementSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5Chain20quickArrangementLineE6VectorS0_(ptr noundef nonnull align 8 dereferenceable(64) %0, double %1, double %2, double %3, double %4) #4 align 2 {
  %6 = alloca %class.Vector, align 8
  %7 = alloca %class.Vector, align 8
  %8 = alloca ptr, align 8
  %9 = alloca double, align 8
  %10 = alloca %class.Vector, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca ptr, align 8
  %17 = getelementptr inbounds { double, double }, ptr %6, i32 0, i32 0
  store double %1, ptr %17, align 8
  %18 = getelementptr inbounds { double, double }, ptr %6, i32 0, i32 1
  store double %2, ptr %18, align 8
  %19 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 0
  store double %3, ptr %19, align 8
  %20 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 1
  store double %4, ptr %20, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  %21 = load ptr, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %22 = getelementptr inbounds %class.Vector, ptr %6, i32 0, i32 0
  %23 = load double, ptr %22, align 8, !tbaa !9
  %24 = getelementptr inbounds %class.Vector, ptr %7, i32 0, i32 0
  %25 = load double, ptr %24, align 8, !tbaa !9
  %26 = fsub double %23, %25
  %27 = getelementptr inbounds %class.Vector, ptr %6, i32 0, i32 0
  %28 = load double, ptr %27, align 8, !tbaa !9
  %29 = getelementptr inbounds %class.Vector, ptr %7, i32 0, i32 0
  %30 = load double, ptr %29, align 8, !tbaa !9
  %31 = fsub double %28, %30
  %32 = getelementptr inbounds %class.Vector, ptr %6, i32 0, i32 1
  %33 = load double, ptr %32, align 8, !tbaa !12
  %34 = getelementptr inbounds %class.Vector, ptr %7, i32 0, i32 1
  %35 = load double, ptr %34, align 8, !tbaa !12
  %36 = fsub double %33, %35
  %37 = getelementptr inbounds %class.Vector, ptr %6, i32 0, i32 1
  %38 = load double, ptr %37, align 8, !tbaa !12
  %39 = getelementptr inbounds %class.Vector, ptr %7, i32 0, i32 1
  %40 = load double, ptr %39, align 8, !tbaa !12
  %41 = fsub double %38, %40
  %42 = fmul double %36, %41
  %43 = call double @llvm.fmuladd.f64(double %26, double %31, double %42)
  %44 = call double @sqrt(double noundef %43) #6
  store double %44, ptr %9, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #6
  %45 = getelementptr inbounds %class.Vector, ptr %7, i32 0, i32 0
  %46 = load double, ptr %45, align 8, !tbaa !9
  %47 = getelementptr inbounds %class.Vector, ptr %6, i32 0, i32 0
  %48 = load double, ptr %47, align 8, !tbaa !9
  %49 = fsub double %46, %48
  %50 = load double, ptr %9, align 8, !tbaa !13
  %51 = fdiv double %49, %50
  %52 = getelementptr inbounds %class.Vector, ptr %7, i32 0, i32 1
  %53 = load double, ptr %52, align 8, !tbaa !12
  %54 = getelementptr inbounds %class.Vector, ptr %6, i32 0, i32 1
  %55 = load double, ptr %54, align 8, !tbaa !12
  %56 = fsub double %53, %55
  %57 = load double, ptr %9, align 8, !tbaa !13
  %58 = fdiv double %56, %57
  call void @_ZN6VectorC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %10, double noundef %51, double noundef %58)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %59 = getelementptr inbounds %class.Chain, ptr %21, i32 0, i32 5
  %60 = call noundef i64 @_ZNKSt6vectorIP12ChainElementSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %59) #6
  %61 = trunc i64 %60 to i32
  store i32 %61, ptr %12, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %62 = getelementptr inbounds %class.Chain, ptr %21, i32 0, i32 5
  store ptr %62, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  %64 = call ptr @_ZNSt6vectorIP12ChainElementSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %63) #6
  %65 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %64, ptr %65, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %66 = load ptr, ptr %13, align 8, !tbaa !5
  %67 = call ptr @_ZNSt6vectorIP12ChainElementSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %66) #6
  %68 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %67, ptr %68, align 8
  br label %69

69:                                               ; preds = %112, %5
  %70 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP12ChainElementSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  br i1 %70, label %72, label %71

71:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %114

72:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP12ChainElementSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #6
  store ptr %73, ptr %16, align 8, !tbaa !5
  %74 = getelementptr inbounds %class.Vector, ptr %6, i32 0, i32 0
  %75 = load double, ptr %74, align 8, !tbaa !9
  %76 = load double, ptr %9, align 8, !tbaa !13
  %77 = getelementptr inbounds %class.Vector, ptr %10, i32 0, i32 0
  %78 = load double, ptr %77, align 8, !tbaa !9
  %79 = fmul double %76, %78
  %80 = load i32, ptr %12, align 4, !tbaa !14
  %81 = sub nsw i32 %80, 1
  %82 = sitofp i32 %81 to float
  %83 = fpext float %82 to double
  %84 = fdiv double %79, %83
  %85 = load i32, ptr %11, align 4, !tbaa !14
  %86 = sitofp i32 %85 to float
  %87 = fpext float %86 to double
  %88 = call double @llvm.fmuladd.f64(double %84, double %87, double %75)
  %89 = load ptr, ptr %16, align 8, !tbaa !5
  %90 = load ptr, ptr %89, align 8, !tbaa !5
  %91 = getelementptr inbounds %class.ChainElement, ptr %90, i32 0, i32 0
  store double %88, ptr %91, align 8, !tbaa !16
  %92 = getelementptr inbounds %class.Vector, ptr %6, i32 0, i32 1
  %93 = load double, ptr %92, align 8, !tbaa !12
  %94 = load double, ptr %9, align 8, !tbaa !13
  %95 = getelementptr inbounds %class.Vector, ptr %10, i32 0, i32 1
  %96 = load double, ptr %95, align 8, !tbaa !12
  %97 = fmul double %94, %96
  %98 = load i32, ptr %12, align 4, !tbaa !14
  %99 = sub nsw i32 %98, 1
  %100 = sitofp i32 %99 to float
  %101 = fpext float %100 to double
  %102 = fdiv double %97, %101
  %103 = load i32, ptr %11, align 4, !tbaa !14
  %104 = sitofp i32 %103 to float
  %105 = fpext float %104 to double
  %106 = call double @llvm.fmuladd.f64(double %102, double %105, double %93)
  %107 = load ptr, ptr %16, align 8, !tbaa !5
  %108 = load ptr, ptr %107, align 8, !tbaa !5
  %109 = getelementptr inbounds %class.ChainElement, ptr %108, i32 0, i32 1
  store double %106, ptr %109, align 8, !tbaa !19
  %110 = load i32, ptr %11, align 4, !tbaa !14
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %11, align 4, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %112

112:                                              ; preds = %72
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPP12ChainElementSt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #6
  br label %69

114:                                              ; preds = %71
  call void @_ZN5Chain12refreshLinksEv(ptr noundef nonnull align 8 dereferenceable(64) %21)
  %115 = load i32, ptr %12, align 4, !tbaa !14
  %116 = sitofp i32 %115 to double
  %117 = fdiv double %116, 3.000000e+03
  %118 = fmul double %117, 5.000000e-04
  %119 = getelementptr inbounds %class.Chain, ptr %21, i32 0, i32 0
  %120 = load double, ptr %119, align 8, !tbaa !20
  %121 = call double @sqrt(double noundef %120) #6
  %122 = fmul double %118, %121
  %123 = fmul double %122, 1.800000e+02
  %124 = load double, ptr %9, align 8, !tbaa !13
  %125 = fdiv double %123, %124
  %126 = getelementptr inbounds %class.Chain, ptr %21, i32 0, i32 1
  store double %125, ptr %126, align 8, !tbaa !26
  %127 = load i32, ptr %12, align 4, !tbaa !14
  %128 = sitofp i32 %127 to double
  %129 = fdiv double %128, 3.000000e+03
  %130 = fmul double %129, 5.000000e-03
  %131 = getelementptr inbounds %class.Chain, ptr %21, i32 0, i32 3
  %132 = load double, ptr %131, align 8, !tbaa !27
  %133 = call double @sqrt(double noundef %132) #6
  %134 = fmul double %130, %133
  %135 = fmul double %134, 1.800000e+02
  %136 = load double, ptr %9, align 8, !tbaa !13
  %137 = fdiv double %135, %136
  %138 = getelementptr inbounds %class.Chain, ptr %21, i32 0, i32 4
  store double %137, ptr %138, align 8, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  ret void
}

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

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

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

attributes #0 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !11, i64 0}
!10 = !{!"_ZTS6Vector", !11, i64 0, !11, i64 8}
!11 = !{!"double", !7, i64 0}
!12 = !{!10, !11, i64 8}
!13 = !{!11, !11, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!17, !11, i64 0}
!17 = !{!"_ZTS12ChainElement", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !18, i64 64, !6, i64 72, !6, i64 80}
!18 = !{!"bool", !7, i64 0}
!19 = !{!17, !11, i64 8}
!20 = !{!21, !11, i64 0}
!21 = !{!"_ZTS5Chain", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !22, i64 40}
!22 = !{!"_ZTSSt6vectorIP12ChainElementSaIS1_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseIP12ChainElementSaIS1_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIP12ChainElementSaIS1_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIP12ChainElementSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!26 = !{!21, !11, i64 8}
!27 = !{!21, !11, i64 24}
!28 = !{!21, !11, i64 32}


; 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.Vector = type { double, double }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #0

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPP12ChainElementSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5Chain20quickArrangementLineE6VectorS0_(ptr noundef nonnull align 8 dereferenceable(64) %0, double %1, double %2, double %3, double %4) local_unnamed_addr #4 align 2 {
  %6 = alloca %class.Vector, align 16
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = fsub double %1, %3
  %10 = fsub double %2, %4
  %11 = fmul double %10, %10
  %12 = tail call double @llvm.fmuladd.f64(double %9, double %9, double %11)
  %sqrt = tail call double @llvm.sqrt.f64(double %12)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  %13 = fsub double %3, %1
  %14 = fdiv double %13, %sqrt
  %15 = fsub double %4, %2
  %16 = fdiv double %15, %sqrt
  call void @_ZN6VectorC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %6, double noundef %14, double noundef %16)
  %17 = getelementptr inbounds i8, ptr %0, i64 40
  %18 = call noundef i64 @_ZNKSt6vectorIP12ChainElementSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  %19 = trunc i64 %18 to i32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %20 = call ptr @_ZNSt6vectorIP12ChainElementSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  store ptr %20, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %21 = call ptr @_ZNSt6vectorIP12ChainElementSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  store ptr %21, ptr %8, align 8
  %22 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP12ChainElementSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br i1 %22, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %5
  %23 = add nsw i32 %19, -1
  %24 = sitofp i32 %23 to float
  %25 = fpext float %24 to double
  %26 = insertelement <2 x double> poison, double %sqrt, i64 0
  %27 = shufflevector <2 x double> %26, <2 x double> poison, <2 x i32> zeroinitializer
  %28 = insertelement <2 x double> poison, double %25, i64 0
  %29 = shufflevector <2 x double> %28, <2 x double> poison, <2 x i32> zeroinitializer
  %30 = insertelement <2 x double> poison, double %1, i64 0
  %31 = insertelement <2 x double> %30, double %2, i64 1
  br label %49

._crit_edge:                                      ; preds = %49, %5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @_ZN5Chain12refreshLinksEv(ptr noundef nonnull align 8 dereferenceable(64) %0)
  %32 = sitofp i32 %19 to double
  %33 = fdiv double %32, 3.000000e+03
  %34 = fmul double %33, 5.000000e-04
  %35 = load double, ptr %0, align 8, !tbaa !5
  %36 = call double @sqrt(double noundef %35) #7
  %37 = fmul double %34, %36
  %38 = fmul double %37, 1.800000e+02
  %39 = fdiv double %38, %sqrt
  %40 = getelementptr inbounds i8, ptr %0, i64 8
  store double %39, ptr %40, align 8, !tbaa !15
  %41 = fmul double %33, 5.000000e-03
  %42 = getelementptr inbounds i8, ptr %0, i64 24
  %43 = load double, ptr %42, align 8, !tbaa !16
  %44 = call double @sqrt(double noundef %43) #7
  %45 = fmul double %41, %44
  %46 = fmul double %45, 1.800000e+02
  %47 = fdiv double %46, %sqrt
  %48 = getelementptr inbounds i8, ptr %0, i64 32
  store double %47, ptr %48, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  ret void

49:                                               ; preds = %.lr.ph, %49
  %.028 = phi i32 [ 0, %.lr.ph ], [ %60, %49 ]
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP12ChainElementSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %51 = uitofp nneg i32 %.028 to float
  %52 = fpext float %51 to double
  %53 = load ptr, ptr %50, align 8, !tbaa !18
  %54 = load <2 x double>, ptr %6, align 16, !tbaa !19
  %55 = fmul <2 x double> %27, %54
  %56 = fdiv <2 x double> %55, %29
  %57 = insertelement <2 x double> poison, double %52, i64 0
  %58 = shufflevector <2 x double> %57, <2 x double> poison, <2 x i32> zeroinitializer
  %59 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %56, <2 x double> %58, <2 x double> %31)
  store <2 x double> %59, ptr %53, align 8, !tbaa !19
  %60 = add nuw nsw i32 %.028, 1
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPP12ChainElementSt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %62 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP12ChainElementSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br i1 %62, label %49, label %._crit_edge
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Chain12refreshLinksEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #4 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #6

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTS5Chain", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorIP12ChainElementSaIS1_EE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseIP12ChainElementSaIS1_EE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseIP12ChainElementSaIS1_EE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIP12ChainElementSaIS1_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!6, !7, i64 8}
!16 = !{!6, !7, i64 24}
!17 = !{!6, !7, i64 32}
!18 = !{!14, !14, i64 0}
!19 = !{!7, !7, i64 0}


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