; LLVM IR from niessner/Matterport :: code/gaps/pkgs/RNBasics/RNSvd.ll (Z19RNSvdBacksubstituteiiPKdS0_S0_S0_Pdd)

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

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

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

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z19RNSvdBacksubstituteiiPKdS0_S0_S0_Pdd(i32 noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, double noundef %7) #4 {
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca double, align 8
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  store i32 %0, ptr %9, align 4, !tbaa !5
  store i32 %1, ptr %10, align 4, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !9
  store ptr %3, ptr %12, align 8, !tbaa !9
  store ptr %4, ptr %13, align 8, !tbaa !9
  store ptr %5, ptr %14, align 8, !tbaa !9
  store ptr %6, ptr %15, align 8, !tbaa !9
  store double %7, ptr %16, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %25 = load i32, ptr %9, align 4, !tbaa !5
  %26 = load i32, ptr %10, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %28, label %30

28:                                               ; preds = %8
  %29 = load i32, ptr %9, align 4, !tbaa !5
  br label %32

30:                                               ; preds = %8
  %31 = load i32, ptr %10, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %30, %28
  %33 = phi i32 [ %29, %28 ], [ %31, %30 ]
  store i32 %33, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %34 = load double, ptr %16, align 8, !tbaa !11
  %35 = load ptr, ptr %12, align 8, !tbaa !9
  %36 = getelementptr inbounds double, ptr %35, i64 0
  %37 = load double, ptr %36, align 8, !tbaa !11
  %38 = fmul double %34, %37
  store double %38, ptr %18, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %39 = load i32, ptr %17, align 4, !tbaa !5
  %40 = zext i32 %39 to i64
  %41 = mul i64 %40, 8
  %42 = call noalias ptr @malloc(i64 noundef %41) #6
  store ptr %42, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %94, %32
  %44 = load i32, ptr %21, align 4, !tbaa !5
  %45 = load i32, ptr %17, align 4, !tbaa !5
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %47, label %97

47:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  store double 0.000000e+00, ptr %23, align 8, !tbaa !11
  %48 = load ptr, ptr %12, align 8, !tbaa !9
  %49 = load i32, ptr %21, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds double, ptr %48, i64 %50
  %52 = load double, ptr %51, align 8, !tbaa !11
  %53 = load double, ptr %18, align 8, !tbaa !11
  %54 = fcmp oge double %52, %53
  br i1 %54, label %55, label %88

55:                                               ; preds = %47
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %77, %55
  %57 = load i32, ptr %20, align 4, !tbaa !5
  %58 = load i32, ptr %9, align 4, !tbaa !5
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %60, label %80

60:                                               ; preds = %56
  %61 = load ptr, ptr %11, align 8, !tbaa !9
  %62 = load i32, ptr %17, align 4, !tbaa !5
  %63 = load i32, ptr %20, align 4, !tbaa !5
  %64 = mul nsw i32 %62, %63
  %65 = load i32, ptr %21, align 4, !tbaa !5
  %66 = add nsw i32 %64, %65
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds double, ptr %61, i64 %67
  %69 = load double, ptr %68, align 8, !tbaa !11
  %70 = load ptr, ptr %14, align 8, !tbaa !9
  %71 = load i32, ptr %20, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds double, ptr %70, i64 %72
  %74 = load double, ptr %73, align 8, !tbaa !11
  %75 = load double, ptr %23, align 8, !tbaa !11
  %76 = call double @llvm.fmuladd.f64(double %69, double %74, double %75)
  store double %76, ptr %23, align 8, !tbaa !11
  br label %77

77:                                               ; preds = %60
  %78 = load i32, ptr %20, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %20, align 4, !tbaa !5
  br label %56, !llvm.loop !13

80:                                               ; preds = %56
  %81 = load ptr, ptr %12, align 8, !tbaa !9
  %82 = load i32, ptr %21, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds double, ptr %81, i64 %83
  %85 = load double, ptr %84, align 8, !tbaa !11
  %86 = load double, ptr %23, align 8, !tbaa !11
  %87 = fdiv double %86, %85
  store double %87, ptr %23, align 8, !tbaa !11
  br label %88

88:                                               ; preds = %80, %47
  %89 = load double, ptr %23, align 8, !tbaa !11
  %90 = load ptr, ptr %19, align 8, !tbaa !9
  %91 = load i32, ptr %21, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds double, ptr %90, i64 %92
  store double %89, ptr %93, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  br label %94

94:                                               ; preds = %88
  %95 = load i32, ptr %21, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %21, align 4, !tbaa !5
  br label %43, !llvm.loop !15

97:                                               ; preds = %43
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %133, %97
  %99 = load i32, ptr %22, align 4, !tbaa !5
  %100 = load i32, ptr %10, align 4, !tbaa !5
  %101 = icmp slt i32 %99, %100
  br i1 %101, label %102, label %136

102:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  store double 0.000000e+00, ptr %24, align 8, !tbaa !11
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %124, %102
  %104 = load i32, ptr %21, align 4, !tbaa !5
  %105 = load i32, ptr %17, align 4, !tbaa !5
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %107, label %127

107:                                              ; preds = %103
  %108 = load ptr, ptr %13, align 8, !tbaa !9
  %109 = load i32, ptr %10, align 4, !tbaa !5
  %110 = load i32, ptr %21, align 4, !tbaa !5
  %111 = mul nsw i32 %109, %110
  %112 = load i32, ptr %22, align 4, !tbaa !5
  %113 = add nsw i32 %111, %112
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds double, ptr %108, i64 %114
  %116 = load double, ptr %115, align 8, !tbaa !11
  %117 = load ptr, ptr %19, align 8, !tbaa !9
  %118 = load i32, ptr %21, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds double, ptr %117, i64 %119
  %121 = load double, ptr %120, align 8, !tbaa !11
  %122 = load double, ptr %24, align 8, !tbaa !11
  %123 = call double @llvm.fmuladd.f64(double %116, double %121, double %122)
  store double %123, ptr %24, align 8, !tbaa !11
  br label %124

124:                                              ; preds = %107
  %125 = load i32, ptr %21, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %21, align 4, !tbaa !5
  br label %103, !llvm.loop !16

127:                                              ; preds = %103
  %128 = load double, ptr %24, align 8, !tbaa !11
  %129 = load ptr, ptr %15, align 8, !tbaa !9
  %130 = load i32, ptr %22, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds double, ptr %129, i64 %131
  store double %128, ptr %132, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %133

133:                                              ; preds = %127
  %134 = load i32, ptr %22, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %22, align 4, !tbaa !5
  br label %98, !llvm.loop !17

136:                                              ; preds = %98
  %137 = load ptr, ptr %19, align 8, !tbaa !9
  call void @free(ptr noundef %137) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind 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 #3 = { 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { nounwind 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}


; 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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #0

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z19RNSvdBacksubstituteiiPKdS0_S0_S0_Pdd(i32 noundef %0, i32 noundef %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, ptr nocapture noundef readonly %4, ptr nocapture noundef readonly %5, ptr nocapture noundef writeonly %6, double noundef %7) local_unnamed_addr #3 {
  %9 = tail call i32 @llvm.smin.i32(i32 %0, i32 %1)
  %10 = load double, ptr %3, align 8, !tbaa !5
  %11 = fmul double %10, %7
  %12 = zext i32 %9 to i64
  %13 = shl nuw nsw i64 %12, 3
  %14 = tail call noalias ptr @malloc(i64 noundef %13) #6
  %15 = icmp sgt i32 %9, 0
  br i1 %15, label %.lr.ph60.split.us.preheader, label %.preheader53

.lr.ph60.split.us.preheader:                      ; preds = %8
  %wide.trip.count = zext i32 %0 to i64
  %16 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %wide.trip.count, 3
  %17 = icmp ult i64 %16, 3
  %unroll_iter = and i64 %wide.trip.count, 4294967292
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.lr.ph60.split.us

.lr.ph60.split.us:                                ; preds = %.lr.ph60.split.us.preheader, %41
  %indvars.iv70 = phi i64 [ 0, %.lr.ph60.split.us.preheader ], [ %indvars.iv.next71, %41 ]
  %18 = getelementptr inbounds double, ptr %3, i64 %indvars.iv70
  %19 = load double, ptr %18, align 8, !tbaa !5
  %20 = fcmp ult double %19, %11
  br i1 %20, label %41, label %.preheader54.us.preheader

.preheader54.us.preheader:                        ; preds = %.lr.ph60.split.us
  %invariant.gep = getelementptr inbounds double, ptr %2, i64 %indvars.iv70
  br i1 %17, label %._crit_edge.us.unr-lcssa, label %.preheader54.us

.preheader54.us:                                  ; preds = %.preheader54.us.preheader, %.preheader54.us
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.preheader54.us ], [ 0, %.preheader54.us.preheader ]
  %.04556.us = phi double [ %40, %.preheader54.us ], [ 0.000000e+00, %.preheader54.us.preheader ]
  %niter = phi i64 [ %niter.next.3, %.preheader54.us ], [ 0, %.preheader54.us.preheader ]
  %21 = mul nuw nsw i64 %indvars.iv, %12
  %gep = getelementptr inbounds double, ptr %invariant.gep, i64 %21
  %22 = load double, ptr %gep, align 8, !tbaa !5
  %23 = getelementptr inbounds double, ptr %5, i64 %indvars.iv
  %24 = load double, ptr %23, align 8, !tbaa !5
  %25 = tail call double @llvm.fmuladd.f64(double %22, double %24, double %.04556.us)
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %26 = mul nuw nsw i64 %indvars.iv.next, %12
  %gep.1 = getelementptr inbounds double, ptr %invariant.gep, i64 %26
  %27 = load double, ptr %gep.1, align 8, !tbaa !5
  %28 = getelementptr inbounds double, ptr %5, i64 %indvars.iv.next
  %29 = load double, ptr %28, align 8, !tbaa !5
  %30 = tail call double @llvm.fmuladd.f64(double %27, double %29, double %25)
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %31 = mul nuw nsw i64 %indvars.iv.next.1, %12
  %gep.2 = getelementptr inbounds double, ptr %invariant.gep, i64 %31
  %32 = load double, ptr %gep.2, align 8, !tbaa !5
  %33 = getelementptr inbounds double, ptr %5, i64 %indvars.iv.next.1
  %34 = load double, ptr %33, align 8, !tbaa !5
  %35 = tail call double @llvm.fmuladd.f64(double %32, double %34, double %30)
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %36 = mul nuw nsw i64 %indvars.iv.next.2, %12
  %gep.3 = getelementptr inbounds double, ptr %invariant.gep, i64 %36
  %37 = load double, ptr %gep.3, align 8, !tbaa !5
  %38 = getelementptr inbounds double, ptr %5, i64 %indvars.iv.next.2
  %39 = load double, ptr %38, align 8, !tbaa !5
  %40 = tail call double @llvm.fmuladd.f64(double %37, double %39, double %35)
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.us.unr-lcssa, label %.preheader54.us, !llvm.loop !9

41:                                               ; preds = %._crit_edge.us, %.lr.ph60.split.us
  %.1.us = phi double [ %48, %._crit_edge.us ], [ 0.000000e+00, %.lr.ph60.split.us ]
  %42 = getelementptr inbounds double, ptr %14, i64 %indvars.iv70
  store double %.1.us, ptr %42, align 8, !tbaa !5
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %exitcond74.not = icmp eq i64 %indvars.iv.next71, %12
  br i1 %exitcond74.not, label %.preheader53, label %.lr.ph60.split.us, !llvm.loop !11

._crit_edge.us.unr-lcssa:                         ; preds = %.preheader54.us, %.preheader54.us.preheader
  %.lcssa92.ph = phi double [ poison, %.preheader54.us.preheader ], [ %40, %.preheader54.us ]
  %indvars.iv.unr = phi i64 [ 0, %.preheader54.us.preheader ], [ %indvars.iv.next.3, %.preheader54.us ]
  %.04556.us.unr = phi double [ 0.000000e+00, %.preheader54.us.preheader ], [ %40, %.preheader54.us ]
  br i1 %lcmp.mod.not, label %._crit_edge.us, label %.preheader54.us.epil

.preheader54.us.epil:                             ; preds = %._crit_edge.us.unr-lcssa, %.preheader54.us.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.preheader54.us.epil ], [ %indvars.iv.unr, %._crit_edge.us.unr-lcssa ]
  %.04556.us.epil = phi double [ %47, %.preheader54.us.epil ], [ %.04556.us.unr, %._crit_edge.us.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader54.us.epil ], [ 0, %._crit_edge.us.unr-lcssa ]
  %43 = mul nuw nsw i64 %indvars.iv.epil, %12
  %gep.epil = getelementptr inbounds double, ptr %invariant.gep, i64 %43
  %44 = load double, ptr %gep.epil, align 8, !tbaa !5
  %45 = getelementptr inbounds double, ptr %5, i64 %indvars.iv.epil
  %46 = load double, ptr %45, align 8, !tbaa !5
  %47 = tail call double @llvm.fmuladd.f64(double %44, double %46, double %.04556.us.epil)
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge.us, label %.preheader54.us.epil, !llvm.loop !12

._crit_edge.us:                                   ; preds = %.preheader54.us.epil, %._crit_edge.us.unr-lcssa
  %.lcssa92 = phi double [ %.lcssa92.ph, %._crit_edge.us.unr-lcssa ], [ %47, %.preheader54.us.epil ]
  %48 = fdiv double %.lcssa92, %19
  br label %41

.preheader53:                                     ; preds = %41, %8
  %49 = icmp sgt i32 %1, 0
  br i1 %49, label %.preheader.lr.ph, label %._crit_edge64

.preheader.lr.ph:                                 ; preds = %.preheader53
  %50 = icmp sgt i32 %0, 0
  %51 = zext nneg i32 %1 to i64
  br i1 %50, label %.preheader.us.preheader, label %.preheader.preheader

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %xtraiter94 = and i64 %12, 3
  %52 = icmp ult i32 %9, 4
  %unroll_iter98 = and i64 %12, 2147483644
  %lcmp.mod96.not = icmp eq i64 %xtraiter94, 0
  br label %.preheader.us

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %53 = shl nuw nsw i64 %51, 3
  tail call void @llvm.memset.p0.i64(ptr align 8 %6, i8 0, i64 %53, i1 false), !tbaa !5
  br label %._crit_edge64

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge.us65
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %._crit_edge.us65 ], [ 0, %.preheader.us.preheader ]
  %invariant.gep89 = getelementptr inbounds double, ptr %4, i64 %indvars.iv83
  br i1 %52, label %._crit_edge.us65.unr-lcssa, label %.preheader.us.new

.preheader.us.new:                                ; preds = %.preheader.us, %.preheader.us.new
  %indvars.iv78 = phi i64 [ %indvars.iv.next79.3, %.preheader.us.new ], [ 0, %.preheader.us ]
  %.062.us = phi double [ %73, %.preheader.us.new ], [ 0.000000e+00, %.preheader.us ]
  %niter99 = phi i64 [ %niter99.next.3, %.preheader.us.new ], [ 0, %.preheader.us ]
  %54 = mul nuw nsw i64 %indvars.iv78, %51
  %gep90 = getelementptr inbounds double, ptr %invariant.gep89, i64 %54
  %55 = load double, ptr %gep90, align 8, !tbaa !5
  %56 = getelementptr inbounds double, ptr %14, i64 %indvars.iv78
  %57 = load double, ptr %56, align 8, !tbaa !5
  %58 = tail call double @llvm.fmuladd.f64(double %55, double %57, double %.062.us)
  %indvars.iv.next79 = or disjoint i64 %indvars.iv78, 1
  %59 = mul nuw nsw i64 %indvars.iv.next79, %51
  %gep90.1 = getelementptr inbounds double, ptr %invariant.gep89, i64 %59
  %60 = load double, ptr %gep90.1, align 8, !tbaa !5
  %61 = getelementptr inbounds double, ptr %14, i64 %indvars.iv.next79
  %62 = load double, ptr %61, align 8, !tbaa !5
  %63 = tail call double @llvm.fmuladd.f64(double %60, double %62, double %58)
  %indvars.iv.next79.1 = or disjoint i64 %indvars.iv78, 2
  %64 = mul nuw nsw i64 %indvars.iv.next79.1, %51
  %gep90.2 = getelementptr inbounds double, ptr %invariant.gep89, i64 %64
  %65 = load double, ptr %gep90.2, align 8, !tbaa !5
  %66 = getelementptr inbounds double, ptr %14, i64 %indvars.iv.next79.1
  %67 = load double, ptr %66, align 8, !tbaa !5
  %68 = tail call double @llvm.fmuladd.f64(double %65, double %67, double %63)
  %indvars.iv.next79.2 = or disjoint i64 %indvars.iv78, 3
  %69 = mul nuw nsw i64 %indvars.iv.next79.2, %51
  %gep90.3 = getelementptr inbounds double, ptr %invariant.gep89, i64 %69
  %70 = load double, ptr %gep90.3, align 8, !tbaa !5
  %71 = getelementptr inbounds double, ptr %14, i64 %indvars.iv.next79.2
  %72 = load double, ptr %71, align 8, !tbaa !5
  %73 = tail call double @llvm.fmuladd.f64(double %70, double %72, double %68)
  %indvars.iv.next79.3 = add nuw nsw i64 %indvars.iv78, 4
  %niter99.next.3 = add i64 %niter99, 4
  %niter99.ncmp.3 = icmp eq i64 %niter99.next.3, %unroll_iter98
  br i1 %niter99.ncmp.3, label %._crit_edge.us65.unr-lcssa, label %.preheader.us.new, !llvm.loop !14

._crit_edge.us65.unr-lcssa:                       ; preds = %.preheader.us.new, %.preheader.us
  %.lcssa.ph = phi double [ poison, %.preheader.us ], [ %73, %.preheader.us.new ]
  %indvars.iv78.unr = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next79.3, %.preheader.us.new ]
  %.062.us.unr = phi double [ 0.000000e+00, %.preheader.us ], [ %73, %.preheader.us.new ]
  br i1 %lcmp.mod96.not, label %._crit_edge.us65, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.us65.unr-lcssa, %.epil.preheader
  %indvars.iv78.epil = phi i64 [ %indvars.iv.next79.epil, %.epil.preheader ], [ %indvars.iv78.unr, %._crit_edge.us65.unr-lcssa ]
  %.062.us.epil = phi double [ %78, %.epil.preheader ], [ %.062.us.unr, %._crit_edge.us65.unr-lcssa ]
  %epil.iter95 = phi i64 [ %epil.iter95.next, %.epil.preheader ], [ 0, %._crit_edge.us65.unr-lcssa ]
  %74 = mul nuw nsw i64 %indvars.iv78.epil, %51
  %gep90.epil = getelementptr inbounds double, ptr %invariant.gep89, i64 %74
  %75 = load double, ptr %gep90.epil, align 8, !tbaa !5
  %76 = getelementptr inbounds double, ptr %14, i64 %indvars.iv78.epil
  %77 = load double, ptr %76, align 8, !tbaa !5
  %78 = tail call double @llvm.fmuladd.f64(double %75, double %77, double %.062.us.epil)
  %indvars.iv.next79.epil = add nuw nsw i64 %indvars.iv78.epil, 1
  %epil.iter95.next = add i64 %epil.iter95, 1
  %epil.iter95.cmp.not = icmp eq i64 %epil.iter95.next, %xtraiter94
  br i1 %epil.iter95.cmp.not, label %._crit_edge.us65, label %.epil.preheader, !llvm.loop !15

._crit_edge.us65:                                 ; preds = %.epil.preheader, %._crit_edge.us65.unr-lcssa
  %.lcssa = phi double [ %.lcssa.ph, %._crit_edge.us65.unr-lcssa ], [ %78, %.epil.preheader ]
  %79 = getelementptr inbounds double, ptr %6, i64 %indvars.iv83
  store double %.lcssa, ptr %79, align 8, !tbaa !5
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %exitcond87.not = icmp eq i64 %indvars.iv.next84, %51
  br i1 %exitcond87.not, label %._crit_edge64, label %.preheader.us, !llvm.loop !16

._crit_edge64:                                    ; preds = %._crit_edge.us65, %.preheader.preheader, %.preheader53
  tail call void @free(ptr noundef %14) #7
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind allocsize(0) }
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, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass