; LLVM IR from atlantis13579/Riemann :: Src/Solver/NumericalODESolver.ll (ZN18NumericalODESolver13MidpointEuler9IntegrateEfiPf)

; 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.NumericalODESolver::MidpointEuler" = type <{ %"class.std::function", %"class.std::vector", float, [4 x i8] }>
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIfSaIfEE6resizeEm(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.start.p0(i64 immarg, ptr nocapture) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNKSt8functionIFvPKfifPfEEclES1_ifS2_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef, float noundef, ptr noundef) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN18NumericalODESolver13MidpointEuler9IntegrateEfiPf(ptr noundef nonnull align 8 dereferenceable(60) %0, float noundef %1, i32 noundef %2, ptr noundef %3) #1 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca float, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store float %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !11
  store ptr %3, ptr %8, align 8, !tbaa !5
  %13 = load ptr, ptr %5, align 8
  %14 = getelementptr inbounds %"class.NumericalODESolver::MidpointEuler", ptr %13, i32 0, i32 1
  %15 = call noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  %16 = load i32, ptr %7, align 4, !tbaa !11
  %17 = mul nsw i32 2, %16
  %18 = sext i32 %17 to i64
  %19 = icmp ult i64 %15, %18
  br i1 %19, label %20, label %25

20:                                               ; preds = %4
  %21 = getelementptr inbounds %"class.NumericalODESolver::MidpointEuler", ptr %13, i32 0, i32 1
  %22 = load i32, ptr %7, align 4, !tbaa !11
  %23 = mul nsw i32 2, %22
  %24 = sext i32 %23 to i64
  call void @_ZNSt6vectorIfSaIfEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %24)
  br label %25

25:                                               ; preds = %20, %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %26 = getelementptr inbounds %"class.NumericalODESolver::MidpointEuler", ptr %13, i32 0, i32 1
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef 0) #4
  store ptr %27, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = load i32, ptr %7, align 4, !tbaa !11
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds float, ptr %28, i64 %30
  store ptr %31, ptr %10, align 8, !tbaa !5
  %32 = getelementptr inbounds %"class.NumericalODESolver::MidpointEuler", ptr %13, i32 0, i32 0
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = load i32, ptr %7, align 4, !tbaa !11
  %35 = getelementptr inbounds %"class.NumericalODESolver::MidpointEuler", ptr %13, i32 0, i32 2
  %36 = load float, ptr %35, align 8, !tbaa !13
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZNKSt8functionIFvPKfifPfEEclES1_ifS2_(ptr noundef nonnull align 8 dereferenceable(32) %32, ptr noundef %33, i32 noundef %34, float noundef %36, ptr noundef %37)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %38

38:                                               ; preds = %61, %25
  %39 = load i32, ptr %11, align 4, !tbaa !11
  %40 = load i32, ptr %7, align 4, !tbaa !11
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %64

43:                                               ; preds = %38
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = load i32, ptr %11, align 4, !tbaa !11
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds float, ptr %44, i64 %46
  %48 = load float, ptr %47, align 4, !tbaa !9
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = load i32, ptr %11, align 4, !tbaa !11
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds float, ptr %49, i64 %51
  %53 = load float, ptr %52, align 4, !tbaa !9
  %54 = load float, ptr %6, align 4, !tbaa !9
  %55 = fmul float %53, %54
  %56 = call float @llvm.fmuladd.f32(float %55, float 5.000000e-01, float %48)
  %57 = load ptr, ptr %10, align 8, !tbaa !5
  %58 = load i32, ptr %11, align 4, !tbaa !11
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds float, ptr %57, i64 %59
  store float %56, ptr %60, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %43
  %62 = load i32, ptr %11, align 4, !tbaa !11
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %11, align 4, !tbaa !11
  br label %38, !llvm.loop !21

64:                                               ; preds = %42
  %65 = getelementptr inbounds %"class.NumericalODESolver::MidpointEuler", ptr %13, i32 0, i32 0
  %66 = load ptr, ptr %10, align 8, !tbaa !5
  %67 = load i32, ptr %7, align 4, !tbaa !11
  %68 = getelementptr inbounds %"class.NumericalODESolver::MidpointEuler", ptr %13, i32 0, i32 2
  %69 = load float, ptr %68, align 8, !tbaa !13
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZNKSt8functionIFvPKfifPfEEclES1_ifS2_(ptr noundef nonnull align 8 dereferenceable(32) %65, ptr noundef %66, i32 noundef %67, float noundef %69, ptr noundef %70)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %71

71:                                               ; preds = %93, %64
  %72 = load i32, ptr %12, align 4, !tbaa !11
  %73 = load i32, ptr %7, align 4, !tbaa !11
  %74 = icmp slt i32 %72, %73
  br i1 %74, label %76, label %75

75:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %96

76:                                               ; preds = %71
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = load i32, ptr %12, align 4, !tbaa !11
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds float, ptr %77, i64 %79
  %81 = load float, ptr %80, align 4, !tbaa !9
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %83 = load i32, ptr %12, align 4, !tbaa !11
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds float, ptr %82, i64 %84
  %86 = load float, ptr %85, align 4, !tbaa !9
  %87 = load float, ptr %6, align 4, !tbaa !9
  %88 = call float @llvm.fmuladd.f32(float %86, float %87, float %81)
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = load i32, ptr %12, align 4, !tbaa !11
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds float, ptr %89, i64 %91
  store float %88, ptr %92, align 4, !tbaa !9
  br label %93

93:                                               ; preds = %76
  %94 = load i32, ptr %12, align 4, !tbaa !11
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %12, align 4, !tbaa !11
  br label %71, !llvm.loop !23

96:                                               ; preds = %75
  %97 = load float, ptr %6, align 4, !tbaa !9
  %98 = getelementptr inbounds %"class.NumericalODESolver::MidpointEuler", ptr %13, i32 0, i32 2
  %99 = load float, ptr %98, align 8, !tbaa !13
  %100 = fadd float %99, %97
  store float %100, ptr %98, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  ret void
}

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !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 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 56}
!14 = !{!"_ZTSN18NumericalODESolver13MidpointEulerE", !15, i64 0, !17, i64 32, !10, i64 56}
!15 = !{!"_ZTSSt8functionIFvPKfifPfEE", !16, i64 0, !6, i64 24}
!16 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!17 = !{!"_ZTSSt6vectorIfSaIfEE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}


; 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 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNKSt8functionIFvPKfifPfEEclES1_ifS2_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef, float noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN18NumericalODESolver13MidpointEuler9IntegrateEfiPf(ptr noundef nonnull align 8 dereferenceable(60) %0, float noundef %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #1 align 2 {
  %5 = ptrtoint ptr %3 to i64
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  %7 = tail call noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %8 = shl nsw i32 %2, 1
  %9 = sext i32 %8 to i64
  %10 = icmp ult i64 %7, %9
  br i1 %10, label %11, label %12

11:                                               ; preds = %4
  tail call void @_ZNSt6vectorIfSaIfEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %9)
  br label %12

12:                                               ; preds = %11, %4
  %13 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef 0) #4
  %14 = ptrtoint ptr %13 to i64
  %15 = sext i32 %2 to i64
  %16 = getelementptr inbounds float, ptr %13, i64 %15
  %17 = getelementptr inbounds i8, ptr %0, i64 56
  %18 = load float, ptr %17, align 8, !tbaa !5
  tail call void @_ZNKSt8functionIFvPKfifPfEEclES1_ifS2_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %3, i32 noundef %2, float noundef %18, ptr noundef nonnull %13)
  %19 = icmp sgt i32 %2, 0
  br i1 %19, label %.lr.ph.preheader, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %12
  %20 = load float, ptr %17, align 8, !tbaa !5
  tail call void @_ZNKSt8functionIFvPKfifPfEEclES1_ifS2_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull %16, i32 noundef %2, float noundef %20, ptr noundef nonnull %13)
  br label %._crit_edge38

.lr.ph.preheader:                                 ; preds = %12
  %wide.trip.count = zext nneg i32 %2 to i64
  %min.iters.check = icmp ult i32 %2, 8
  br i1 %min.iters.check, label %.lr.ph.preheader69, label %vector.memcheck

.lr.ph.preheader69:                               ; preds = %middle.block, %vector.memcheck, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader69
  %21 = getelementptr inbounds float, ptr %3, i64 %indvars.iv.ph
  %22 = load float, ptr %21, align 4, !tbaa !17
  %23 = getelementptr inbounds float, ptr %13, i64 %indvars.iv.ph
  %24 = load float, ptr %23, align 4, !tbaa !17
  %25 = fmul float %24, %1
  %26 = tail call float @llvm.fmuladd.f32(float %25, float 5.000000e-01, float %22)
  %27 = getelementptr inbounds float, ptr %16, i64 %indvars.iv.ph
  store float %26, ptr %27, align 4, !tbaa !17
  %indvars.iv.next.prol = or disjoint i64 %indvars.iv.ph, 1
  br label %.lr.ph.prol.loopexit

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader69
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %.lr.ph.preheader69 ], [ %indvars.iv.next.prol, %.lr.ph.prol ]
  %28 = add nsw i64 %wide.trip.count, -1
  %29 = icmp eq i64 %indvars.iv.ph, %28
  br i1 %29, label %._crit_edge, label %.lr.ph

vector.memcheck:                                  ; preds = %.lr.ph.preheader
  %30 = shl nuw nsw i64 %15, 2
  %31 = add i64 %30, %14
  %32 = sub i64 %31, %5
  %diff.check = icmp ult i64 %32, 32
  br i1 %diff.check, label %.lr.ph.preheader69, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %wide.trip.count, 2147483640
  %broadcast.splatinsert = insertelement <4 x float> poison, float %1, i64 0
  %broadcast.splat = shufflevector <4 x float> %broadcast.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %33 = getelementptr inbounds float, ptr %3, i64 %index
  %34 = getelementptr inbounds i8, ptr %33, i64 16
  %wide.load = load <4 x float>, ptr %33, align 4, !tbaa !17
  %wide.load46 = load <4 x float>, ptr %34, align 4, !tbaa !17
  %35 = getelementptr inbounds float, ptr %13, i64 %index
  %36 = getelementptr inbounds i8, ptr %35, i64 16
  %wide.load47 = load <4 x float>, ptr %35, align 4, !tbaa !17
  %wide.load48 = load <4 x float>, ptr %36, align 4, !tbaa !17
  %37 = fmul <4 x float> %wide.load47, %broadcast.splat
  %38 = fmul <4 x float> %wide.load48, %broadcast.splat
  %39 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %37, <4 x float> <float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01>, <4 x float> %wide.load)
  %40 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %38, <4 x float> <float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01>, <4 x float> %wide.load46)
  %41 = getelementptr inbounds float, ptr %16, i64 %index
  %42 = getelementptr inbounds i8, ptr %41, i64 16
  store <4 x float> %39, ptr %41, align 4, !tbaa !17
  store <4 x float> %40, ptr %42, align 4, !tbaa !17
  %index.next = add nuw i64 %index, 8
  %43 = icmp eq i64 %index.next, %n.vec
  br i1 %43, label %middle.block, label %vector.body, !llvm.loop !18

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader69

._crit_edge:                                      ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %middle.block
  %44 = load float, ptr %17, align 8, !tbaa !5
  tail call void @_ZNKSt8functionIFvPKfifPfEEclES1_ifS2_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull %16, i32 noundef %2, float noundef %44, ptr noundef nonnull %13)
  br i1 %19, label %.lr.ph37.preheader, label %._crit_edge38

.lr.ph37.preheader:                               ; preds = %._crit_edge
  %wide.trip.count43 = zext nneg i32 %2 to i64
  %min.iters.check53 = icmp ult i32 %2, 8
  br i1 %min.iters.check53, label %.lr.ph37.preheader68, label %vector.memcheck49

.lr.ph37.preheader68:                             ; preds = %middle.block51, %vector.memcheck49, %.lr.ph37.preheader
  %indvars.iv40.ph = phi i64 [ 0, %vector.memcheck49 ], [ 0, %.lr.ph37.preheader ], [ %n.vec56, %middle.block51 ]
  %xtraiter70 = and i64 %wide.trip.count, 1
  %lcmp.mod71.not = icmp eq i64 %xtraiter70, 0
  br i1 %lcmp.mod71.not, label %.lr.ph37.prol.loopexit, label %.lr.ph37.prol

.lr.ph37.prol:                                    ; preds = %.lr.ph37.preheader68
  %45 = getelementptr inbounds float, ptr %3, i64 %indvars.iv40.ph
  %46 = load float, ptr %45, align 4, !tbaa !17
  %47 = getelementptr inbounds float, ptr %13, i64 %indvars.iv40.ph
  %48 = load float, ptr %47, align 4, !tbaa !17
  %49 = tail call float @llvm.fmuladd.f32(float %48, float %1, float %46)
  store float %49, ptr %45, align 4, !tbaa !17
  %indvars.iv.next41.prol = or disjoint i64 %indvars.iv40.ph, 1
  br label %.lr.ph37.prol.loopexit

.lr.ph37.prol.loopexit:                           ; preds = %.lr.ph37.prol, %.lr.ph37.preheader68
  %indvars.iv40.unr = phi i64 [ %indvars.iv40.ph, %.lr.ph37.preheader68 ], [ %indvars.iv.next41.prol, %.lr.ph37.prol ]
  %50 = add nsw i64 %wide.trip.count, -1
  %51 = icmp eq i64 %indvars.iv40.ph, %50
  br i1 %51, label %._crit_edge38, label %.lr.ph37

vector.memcheck49:                                ; preds = %.lr.ph37.preheader
  %52 = shl nuw nsw i64 %wide.trip.count, 2
  %scevgep = getelementptr i8, ptr %3, i64 %52
  %scevgep50 = getelementptr i8, ptr %13, i64 %52
  %bound0 = icmp ugt ptr %scevgep50, %3
  %bound1 = icmp ult ptr %13, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %.lr.ph37.preheader68, label %vector.ph54

vector.ph54:                                      ; preds = %vector.memcheck49
  %n.vec56 = and i64 %wide.trip.count, 2147483640
  %broadcast.splatinsert64 = insertelement <4 x float> poison, float %1, i64 0
  %broadcast.splat65 = shufflevector <4 x float> %broadcast.splatinsert64, <4 x float> poison, <4 x i32> zeroinitializer
  br label %vector.body58

vector.body58:                                    ; preds = %vector.body58, %vector.ph54
  %index59 = phi i64 [ 0, %vector.ph54 ], [ %index.next66, %vector.body58 ]
  %53 = getelementptr inbounds float, ptr %3, i64 %index59
  %54 = getelementptr inbounds i8, ptr %53, i64 16
  %wide.load60 = load <4 x float>, ptr %53, align 4, !tbaa !17, !alias.scope !22, !noalias !25
  %wide.load61 = load <4 x float>, ptr %54, align 4, !tbaa !17, !alias.scope !22, !noalias !25
  %55 = getelementptr inbounds float, ptr %13, i64 %index59
  %56 = getelementptr inbounds i8, ptr %55, i64 16
  %wide.load62 = load <4 x float>, ptr %55, align 4, !tbaa !17, !alias.scope !25
  %wide.load63 = load <4 x float>, ptr %56, align 4, !tbaa !17, !alias.scope !25
  %57 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %wide.load62, <4 x float> %broadcast.splat65, <4 x float> %wide.load60)
  %58 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %wide.load63, <4 x float> %broadcast.splat65, <4 x float> %wide.load61)
  store <4 x float> %57, ptr %53, align 4, !tbaa !17, !alias.scope !22, !noalias !25
  store <4 x float> %58, ptr %54, align 4, !tbaa !17, !alias.scope !22, !noalias !25
  %index.next66 = add nuw i64 %index59, 8
  %59 = icmp eq i64 %index.next66, %n.vec56
  br i1 %59, label %middle.block51, label %vector.body58, !llvm.loop !27

middle.block51:                                   ; preds = %vector.body58
  %cmp.n67 = icmp eq i64 %n.vec56, %wide.trip.count
  br i1 %cmp.n67, label %._crit_edge38, label %.lr.ph37.preheader68

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %.lr.ph ], [ %indvars.iv.unr, %.lr.ph.prol.loopexit ]
  %60 = getelementptr inbounds float, ptr %3, i64 %indvars.iv
  %61 = load float, ptr %60, align 4, !tbaa !17
  %62 = getelementptr inbounds float, ptr %13, i64 %indvars.iv
  %63 = load float, ptr %62, align 4, !tbaa !17
  %64 = fmul float %63, %1
  %65 = tail call float @llvm.fmuladd.f32(float %64, float 5.000000e-01, float %61)
  %66 = getelementptr inbounds float, ptr %16, i64 %indvars.iv
  store float %65, ptr %66, align 4, !tbaa !17
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %67 = getelementptr inbounds float, ptr %3, i64 %indvars.iv.next
  %68 = load float, ptr %67, align 4, !tbaa !17
  %69 = getelementptr inbounds float, ptr %13, i64 %indvars.iv.next
  %70 = load float, ptr %69, align 4, !tbaa !17
  %71 = fmul float %70, %1
  %72 = tail call float @llvm.fmuladd.f32(float %71, float 5.000000e-01, float %68)
  %73 = getelementptr inbounds float, ptr %16, i64 %indvars.iv.next
  store float %72, ptr %73, align 4, !tbaa !17
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count
  br i1 %exitcond.not.1, label %._crit_edge, label %.lr.ph, !llvm.loop !28

._crit_edge38:                                    ; preds = %.lr.ph37.prol.loopexit, %.lr.ph37, %middle.block51, %._crit_edge.thread, %._crit_edge
  %74 = load float, ptr %17, align 8, !tbaa !5
  %75 = fadd float %74, %1
  store float %75, ptr %17, align 8, !tbaa !5
  ret void

.lr.ph37:                                         ; preds = %.lr.ph37.prol.loopexit, %.lr.ph37
  %indvars.iv40 = phi i64 [ %indvars.iv.next41.1, %.lr.ph37 ], [ %indvars.iv40.unr, %.lr.ph37.prol.loopexit ]
  %76 = getelementptr inbounds float, ptr %3, i64 %indvars.iv40
  %77 = load float, ptr %76, align 4, !tbaa !17
  %78 = getelementptr inbounds float, ptr %13, i64 %indvars.iv40
  %79 = load float, ptr %78, align 4, !tbaa !17
  %80 = tail call float @llvm.fmuladd.f32(float %79, float %1, float %77)
  store float %80, ptr %76, align 4, !tbaa !17
  %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
  %81 = getelementptr inbounds float, ptr %3, i64 %indvars.iv.next41
  %82 = load float, ptr %81, align 4, !tbaa !17
  %83 = getelementptr inbounds float, ptr %13, i64 %indvars.iv.next41
  %84 = load float, ptr %83, align 4, !tbaa !17
  %85 = tail call float @llvm.fmuladd.f32(float %84, float %1, float %82)
  store float %85, ptr %81, align 4, !tbaa !17
  %indvars.iv.next41.1 = add nuw nsw i64 %indvars.iv40, 2
  %exitcond44.not.1 = icmp eq i64 %indvars.iv.next41.1, %wide.trip.count43
  br i1 %exitcond44.not.1, label %._crit_edge38, label %.lr.ph37, !llvm.loop !29
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x float> @llvm.fmuladd.v4f32(<4 x float>, <4 x float>, <4 x float>) #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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !16, i64 56}
!6 = !{!"_ZTSN18NumericalODESolver13MidpointEulerE", !7, i64 0, !12, i64 32, !16, i64 56}
!7 = !{!"_ZTSSt8functionIFvPKfifPfEE", !8, i64 0, !11, i64 24}
!8 = !{!"_ZTSSt14_Function_base", !9, i64 0, !11, i64 16}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"_ZTSSt6vectorIfSaIfEE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!16 = !{!"float", !9, i64 0}
!17 = !{!16, !16, i64 0}
!18 = distinct !{!18, !19, !20, !21}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!"llvm.loop.isvectorized", i32 1}
!21 = !{!"llvm.loop.unroll.runtime.disable"}
!22 = !{!23}
!23 = distinct !{!23, !24}
!24 = distinct !{!24, !"LVerDomain"}
!25 = !{!26}
!26 = distinct !{!26, !24}
!27 = distinct !{!27, !19, !20, !21}
!28 = distinct !{!28, !19, !20}
!29 = distinct !{!29, !19, !20}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass