; LLVM IR from simbody/simbody :: SimTKmath/Integrators/src/CPodes/sundials/src/sundials (sundials_dense)

; 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: nounwind uwtable
define dso_local i32 @denseGETRF(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3) #0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %195, %4
  %21 = load i32, ptr %12, align 4, !tbaa !9
  %22 = load i32, ptr %8, align 4, !tbaa !9
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %24, label %198

24:                                               ; preds = %20
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = load i32, ptr %12, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds ptr, ptr %25, i64 %27
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  store ptr %29, ptr %15, align 8, !tbaa !5
  %30 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %30, ptr %13, align 4, !tbaa !9
  %31 = load i32, ptr %12, align 4, !tbaa !9
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %10, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %54, %24
  %34 = load i32, ptr %10, align 4, !tbaa !9
  %35 = load i32, ptr %7, align 4, !tbaa !9
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %37, label %57

37:                                               ; preds = %33
  %38 = load ptr, ptr %15, align 8, !tbaa !5
  %39 = load i32, ptr %10, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds double, ptr %38, i64 %40
  %42 = load double, ptr %41, align 8, !tbaa !11
  %43 = call double @RAbs(double noundef %42)
  %44 = load ptr, ptr %15, align 8, !tbaa !5
  %45 = load i32, ptr %13, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds double, ptr %44, i64 %46
  %48 = load double, ptr %47, align 8, !tbaa !11
  %49 = call double @RAbs(double noundef %48)
  %50 = fcmp ogt double %43, %49
  br i1 %50, label %51, label %53

51:                                               ; preds = %37
  %52 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %52, ptr %13, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %51, %37
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %10, align 4, !tbaa !9
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %10, align 4, !tbaa !9
  br label %33, !llvm.loop !13

57:                                               ; preds = %33
  %58 = load i32, ptr %13, align 4, !tbaa !9
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = load i32, ptr %12, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds i32, ptr %59, i64 %61
  store i32 %58, ptr %62, align 4, !tbaa !9
  %63 = load ptr, ptr %15, align 8, !tbaa !5
  %64 = load i32, ptr %13, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds double, ptr %63, i64 %65
  %67 = load double, ptr %66, align 8, !tbaa !11
  %68 = fcmp oeq double %67, 0.000000e+00
  br i1 %68, label %69, label %72

69:                                               ; preds = %57
  %70 = load i32, ptr %12, align 4, !tbaa !9
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %5, align 4
  store i32 1, ptr %19, align 4
  br label %199

72:                                               ; preds = %57
  %73 = load i32, ptr %13, align 4, !tbaa !9
  %74 = load i32, ptr %12, align 4, !tbaa !9
  %75 = icmp ne i32 %73, %74
  br i1 %75, label %76, label %121

76:                                               ; preds = %72
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %77

77:                                               ; preds = %117, %76
  %78 = load i32, ptr %10, align 4, !tbaa !9
  %79 = load i32, ptr %8, align 4, !tbaa !9
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %81, label %120

81:                                               ; preds = %77
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = load i32, ptr %10, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds ptr, ptr %82, i64 %84
  %86 = load ptr, ptr %85, align 8, !tbaa !5
  %87 = load i32, ptr %13, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds double, ptr %86, i64 %88
  %90 = load double, ptr %89, align 8, !tbaa !11
  store double %90, ptr %16, align 8, !tbaa !11
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = load i32, ptr %10, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds ptr, ptr %91, i64 %93
  %95 = load ptr, ptr %94, align 8, !tbaa !5
  %96 = load i32, ptr %12, align 4, !tbaa !9
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds double, ptr %95, i64 %97
  %99 = load double, ptr %98, align 8, !tbaa !11
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = load i32, ptr %10, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds ptr, ptr %100, i64 %102
  %104 = load ptr, ptr %103, align 8, !tbaa !5
  %105 = load i32, ptr %13, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds double, ptr %104, i64 %106
  store double %99, ptr %107, align 8, !tbaa !11
  %108 = load double, ptr %16, align 8, !tbaa !11
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = load i32, ptr %10, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds ptr, ptr %109, i64 %111
  %113 = load ptr, ptr %112, align 8, !tbaa !5
  %114 = load i32, ptr %12, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds double, ptr %113, i64 %115
  store double %108, ptr %116, align 8, !tbaa !11
  br label %117

117:                                              ; preds = %81
  %118 = load i32, ptr %10, align 4, !tbaa !9
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %10, align 4, !tbaa !9
  br label %77, !llvm.loop !15

120:                                              ; preds = %77
  br label %121

121:                                              ; preds = %120, %72
  %122 = load ptr, ptr %15, align 8, !tbaa !5
  %123 = load i32, ptr %12, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds double, ptr %122, i64 %124
  %126 = load double, ptr %125, align 8, !tbaa !11
  %127 = fdiv double 1.000000e+00, %126
  store double %127, ptr %17, align 8, !tbaa !11
  %128 = load i32, ptr %12, align 4, !tbaa !9
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %10, align 4, !tbaa !9
  br label %130

130:                                              ; preds = %142, %121
  %131 = load i32, ptr %10, align 4, !tbaa !9
  %132 = load i32, ptr %7, align 4, !tbaa !9
  %133 = icmp slt i32 %131, %132
  br i1 %133, label %134, label %145

134:                                              ; preds = %130
  %135 = load double, ptr %17, align 8, !tbaa !11
  %136 = load ptr, ptr %15, align 8, !tbaa !5
  %137 = load i32, ptr %10, align 4, !tbaa !9
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds double, ptr %136, i64 %138
  %140 = load double, ptr %139, align 8, !tbaa !11
  %141 = fmul double %140, %135
  store double %141, ptr %139, align 8, !tbaa !11
  br label %142

142:                                              ; preds = %134
  %143 = load i32, ptr %10, align 4, !tbaa !9
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %10, align 4, !tbaa !9
  br label %130, !llvm.loop !16

145:                                              ; preds = %130
  %146 = load i32, ptr %12, align 4, !tbaa !9
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %11, align 4, !tbaa !9
  br label %148

148:                                              ; preds = %191, %145
  %149 = load i32, ptr %11, align 4, !tbaa !9
  %150 = load i32, ptr %8, align 4, !tbaa !9
  %151 = icmp slt i32 %149, %150
  br i1 %151, label %152, label %194

152:                                              ; preds = %148
  %153 = load ptr, ptr %6, align 8, !tbaa !5
  %154 = load i32, ptr %11, align 4, !tbaa !9
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds ptr, ptr %153, i64 %155
  %157 = load ptr, ptr %156, align 8, !tbaa !5
  store ptr %157, ptr %14, align 8, !tbaa !5
  %158 = load ptr, ptr %14, align 8, !tbaa !5
  %159 = load i32, ptr %12, align 4, !tbaa !9
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds double, ptr %158, i64 %160
  %162 = load double, ptr %161, align 8, !tbaa !11
  store double %162, ptr %18, align 8, !tbaa !11
  %163 = load double, ptr %18, align 8, !tbaa !11
  %164 = fcmp une double %163, 0.000000e+00
  br i1 %164, label %165, label %190

165:                                              ; preds = %152
  %166 = load i32, ptr %12, align 4, !tbaa !9
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %10, align 4, !tbaa !9
  br label %168

168:                                              ; preds = %186, %165
  %169 = load i32, ptr %10, align 4, !tbaa !9
  %170 = load i32, ptr %7, align 4, !tbaa !9
  %171 = icmp slt i32 %169, %170
  br i1 %171, label %172, label %189

172:                                              ; preds = %168
  %173 = load double, ptr %18, align 8, !tbaa !11
  %174 = load ptr, ptr %15, align 8, !tbaa !5
  %175 = load i32, ptr %10, align 4, !tbaa !9
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds double, ptr %174, i64 %176
  %178 = load double, ptr %177, align 8, !tbaa !11
  %179 = load ptr, ptr %14, align 8, !tbaa !5
  %180 = load i32, ptr %10, align 4, !tbaa !9
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds double, ptr %179, i64 %181
  %183 = load double, ptr %182, align 8, !tbaa !11
  %184 = fneg double %173
  %185 = call double @llvm.fmuladd.f64(double %184, double %178, double %183)
  store double %185, ptr %182, align 8, !tbaa !11
  br label %186

186:                                              ; preds = %172
  %187 = load i32, ptr %10, align 4, !tbaa !9
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %10, align 4, !tbaa !9
  br label %168, !llvm.loop !17

189:                                              ; preds = %168
  br label %190

190:                                              ; preds = %189, %152
  br label %191

191:                                              ; preds = %190
  %192 = load i32, ptr %11, align 4, !tbaa !9
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %11, align 4, !tbaa !9
  br label %148, !llvm.loop !18

194:                                              ; preds = %148
  br label %195

195:                                              ; preds = %194
  %196 = load i32, ptr %12, align 4, !tbaa !9
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %12, align 4, !tbaa !9
  br label %20, !llvm.loop !19

198:                                              ; preds = %20
  store i32 0, ptr %5, align 4
  store i32 1, ptr %19, align 4
  br label %199

199:                                              ; preds = %198, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  %200 = load i32, ptr %5, align 4
  ret i32 %200
}

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

declare double @RAbs(double noundef) #2

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

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

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !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}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !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: nounwind uwtable
define dso_local i32 @denseGETRF(ptr nocapture noundef readonly %0, i32 noundef %1, i32 noundef %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #0 {
  %5 = icmp sgt i32 %2, 0
  br i1 %5, label %.lr.ph91, label %._crit_edge92

.lr.ph91:                                         ; preds = %4
  %6 = sext i32 %1 to i64
  %7 = zext nneg i32 %2 to i64
  %wide.trip.count125 = zext nneg i32 %2 to i64
  %wide.trip.count = zext i32 %1 to i64
  %wide.trip.count110 = zext i32 %1 to i64
  %wide.trip.count115 = zext i32 %1 to i64
  %8 = shl nuw nsw i64 %wide.trip.count, 3
  %xtraiter = and i64 %wide.trip.count125, 1
  %9 = icmp eq i32 %2, 1
  %unroll_iter = and i64 %wide.trip.count125, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  %10 = add nsw i64 %wide.trip.count, -1
  br label %11

.loopexit75:                                      ; preds = %..loopexit_crit_edge.us, %.preheader74, %.loopexit77
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond126.not = icmp eq i64 %indvars.iv.next123, %wide.trip.count125
  br i1 %exitcond126.not, label %._crit_edge92, label %11, !llvm.loop !5

11:                                               ; preds = %.lr.ph91, %.loopexit75
  %indvars.iv122 = phi i64 [ 0, %.lr.ph91 ], [ %indvars.iv.next123, %.loopexit75 ]
  %indvars.iv = phi i64 [ 1, %.lr.ph91 ], [ %indvars.iv.next, %.loopexit75 ]
  %12 = xor i64 %indvars.iv122, -1
  %13 = add nsw i64 %12, %wide.trip.count
  %14 = xor i64 %indvars.iv122, -1
  %15 = add nsw i64 %14, %wide.trip.count
  %16 = shl nuw nsw i64 %indvars.iv122, 3
  %17 = add nuw i64 %16, 8
  %18 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv122
  %19 = load ptr, ptr %18, align 8, !tbaa !7
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %20 = icmp sge i64 %indvars.iv.next123, %6
  %21 = trunc nuw nsw i64 %indvars.iv122 to i32
  br i1 %20, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %11, %.lr.ph
  %indvars.iv99 = phi i64 [ %indvars.iv.next100, %.lr.ph ], [ %indvars.iv, %11 ]
  %.06978 = phi i32 [ %.170, %.lr.ph ], [ %21, %11 ]
  %22 = getelementptr inbounds double, ptr %19, i64 %indvars.iv99
  %23 = load double, ptr %22, align 8, !tbaa !11
  %24 = tail call double @RAbs(double noundef %23) #4
  %25 = sext i32 %.06978 to i64
  %26 = getelementptr inbounds double, ptr %19, i64 %25
  %27 = load double, ptr %26, align 8, !tbaa !11
  %28 = tail call double @RAbs(double noundef %27) #4
  %29 = fcmp ogt double %24, %28
  %30 = trunc nuw nsw i64 %indvars.iv99 to i32
  %.170 = select i1 %29, i32 %30, i32 %.06978
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next100, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph, %11
  %.069.lcssa = phi i32 [ %21, %11 ], [ %.170, %.lr.ph ]
  %31 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv122
  store i32 %.069.lcssa, ptr %31, align 4, !tbaa !14
  %32 = sext i32 %.069.lcssa to i64
  %33 = getelementptr inbounds double, ptr %19, i64 %32
  %34 = load double, ptr %33, align 8, !tbaa !11
  %35 = fcmp oeq double %34, 0.000000e+00
  br i1 %35, label %._crit_edge92.loopexit.split.loop.exit127, label %36

36:                                               ; preds = %._crit_edge
  %37 = zext i32 %.069.lcssa to i64
  %.not = icmp eq i64 %indvars.iv122, %37
  br i1 %.not, label %.loopexit77, label %.lr.ph81.preheader

.lr.ph81.preheader:                               ; preds = %36
  br i1 %9, label %.loopexit77.loopexit.unr-lcssa, label %.lr.ph81

.lr.ph81:                                         ; preds = %.lr.ph81.preheader, %.lr.ph81
  %indvars.iv102 = phi i64 [ %indvars.iv.next103.1, %.lr.ph81 ], [ 0, %.lr.ph81.preheader ]
  %niter = phi i64 [ %niter.next.1, %.lr.ph81 ], [ 0, %.lr.ph81.preheader ]
  %38 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv102
  %39 = load ptr, ptr %38, align 8, !tbaa !7
  %40 = getelementptr inbounds double, ptr %39, i64 %32
  %41 = load double, ptr %40, align 8, !tbaa !11
  %42 = getelementptr inbounds double, ptr %39, i64 %indvars.iv122
  %43 = load double, ptr %42, align 8, !tbaa !11
  store double %43, ptr %40, align 8, !tbaa !11
  store double %41, ptr %42, align 8, !tbaa !11
  %indvars.iv.next103 = or disjoint i64 %indvars.iv102, 1
  %44 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv.next103
  %45 = load ptr, ptr %44, align 8, !tbaa !7
  %46 = getelementptr inbounds double, ptr %45, i64 %32
  %47 = load double, ptr %46, align 8, !tbaa !11
  %48 = getelementptr inbounds double, ptr %45, i64 %indvars.iv122
  %49 = load double, ptr %48, align 8, !tbaa !11
  store double %49, ptr %46, align 8, !tbaa !11
  store double %47, ptr %48, align 8, !tbaa !11
  %indvars.iv.next103.1 = add nuw nsw i64 %indvars.iv102, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.loopexit77.loopexit.unr-lcssa, label %.lr.ph81, !llvm.loop !16

.loopexit77.loopexit.unr-lcssa:                   ; preds = %.lr.ph81, %.lr.ph81.preheader
  %indvars.iv102.unr = phi i64 [ 0, %.lr.ph81.preheader ], [ %indvars.iv.next103.1, %.lr.ph81 ]
  br i1 %lcmp.mod.not, label %.loopexit77, label %.lr.ph81.epil

.lr.ph81.epil:                                    ; preds = %.loopexit77.loopexit.unr-lcssa
  %50 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv102.unr
  %51 = load ptr, ptr %50, align 8, !tbaa !7
  %52 = getelementptr inbounds double, ptr %51, i64 %32
  %53 = load double, ptr %52, align 8, !tbaa !11
  %54 = getelementptr inbounds double, ptr %51, i64 %indvars.iv122
  %55 = load double, ptr %54, align 8, !tbaa !11
  store double %55, ptr %52, align 8, !tbaa !11
  store double %53, ptr %54, align 8, !tbaa !11
  br label %.loopexit77

.loopexit77:                                      ; preds = %.lr.ph81.epil, %.loopexit77.loopexit.unr-lcssa, %36
  %56 = getelementptr inbounds double, ptr %19, i64 %indvars.iv122
  %57 = load double, ptr %56, align 8, !tbaa !11
  %58 = fdiv double 1.000000e+00, %57
  br i1 %20, label %.loopexit75, label %.lr.ph84.preheader

.lr.ph84.preheader:                               ; preds = %.loopexit77
  %min.iters.check140 = icmp ult i64 %13, 4
  br i1 %min.iters.check140, label %.lr.ph84.preheader155, label %vector.ph141

.lr.ph84.preheader155:                            ; preds = %middle.block138, %.lr.ph84.preheader
  %indvars.iv107.ph = phi i64 [ %indvars.iv, %.lr.ph84.preheader ], [ %ind.end144, %middle.block138 ]
  br label %.lr.ph84

vector.ph141:                                     ; preds = %.lr.ph84.preheader
  %n.vec143 = and i64 %13, -4
  %ind.end144 = add i64 %indvars.iv, %n.vec143
  %broadcast.splatinsert151 = insertelement <2 x double> poison, double %58, i64 0
  %broadcast.splat152 = shufflevector <2 x double> %broadcast.splatinsert151, <2 x double> poison, <2 x i32> zeroinitializer
  %59 = getelementptr double, ptr %19, i64 %indvars.iv
  br label %vector.body146

vector.body146:                                   ; preds = %vector.body146, %vector.ph141
  %index147 = phi i64 [ 0, %vector.ph141 ], [ %index.next153, %vector.body146 ]
  %60 = getelementptr double, ptr %59, i64 %index147
  %61 = getelementptr inbounds i8, ptr %60, i64 16
  %wide.load149 = load <2 x double>, ptr %60, align 8, !tbaa !11
  %wide.load150 = load <2 x double>, ptr %61, align 8, !tbaa !11
  %62 = fmul <2 x double> %broadcast.splat152, %wide.load149
  %63 = fmul <2 x double> %broadcast.splat152, %wide.load150
  store <2 x double> %62, ptr %60, align 8, !tbaa !11
  store <2 x double> %63, ptr %61, align 8, !tbaa !11
  %index.next153 = add nuw i64 %index147, 4
  %64 = icmp eq i64 %index.next153, %n.vec143
  br i1 %64, label %middle.block138, label %vector.body146, !llvm.loop !17

middle.block138:                                  ; preds = %vector.body146
  %cmp.n154 = icmp eq i64 %13, %n.vec143
  br i1 %cmp.n154, label %.preheader74, label %.lr.ph84.preheader155

.preheader74:                                     ; preds = %.lr.ph84, %middle.block138
  %65 = icmp uge i64 %indvars.iv.next123, %7
  %brmerge = or i1 %65, %20
  br i1 %brmerge, label %.loopexit75, label %.lr.ph88.split.us.preheader

.lr.ph88.split.us.preheader:                      ; preds = %.preheader74
  %scevgep133 = getelementptr i8, ptr %19, i64 %17
  %scevgep134 = getelementptr i8, ptr %19, i64 %8
  %min.iters.check = icmp ult i64 %15, 4
  %n.vec = and i64 %15, -4
  %ind.end = add i64 %indvars.iv, %n.vec
  %cmp.n = icmp eq i64 %15, %n.vec
  br label %.lr.ph88.split.us

.lr.ph88.split.us:                                ; preds = %.lr.ph88.split.us.preheader, %..loopexit_crit_edge.us
  %indvars.iv117 = phi i64 [ %indvars.iv.next118, %..loopexit_crit_edge.us ], [ %indvars.iv, %.lr.ph88.split.us.preheader ]
  %66 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv117
  %67 = load ptr, ptr %66, align 8, !tbaa !7
  %68 = getelementptr inbounds double, ptr %67, i64 %indvars.iv122
  %69 = load double, ptr %68, align 8, !tbaa !11
  %70 = fcmp une double %69, 0.000000e+00
  br i1 %70, label %.preheader.us, label %..loopexit_crit_edge.us

..loopexit_crit_edge.us:                          ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %.lr.ph88.split.us
  %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
  %exitcond121.not = icmp eq i64 %indvars.iv.next118, %wide.trip.count125
  br i1 %exitcond121.not, label %.loopexit75, label %.lr.ph88.split.us, !llvm.loop !20

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv112 = phi i64 [ %indvars.iv.next113.1, %scalar.ph ], [ %indvars.iv112.unr, %scalar.ph.prol.loopexit ]
  %71 = getelementptr inbounds double, ptr %19, i64 %indvars.iv112
  %72 = load double, ptr %71, align 8, !tbaa !11
  %73 = getelementptr inbounds double, ptr %67, i64 %indvars.iv112
  %74 = load double, ptr %73, align 8, !tbaa !11
  %75 = tail call double @llvm.fmuladd.f64(double %81, double %72, double %74)
  store double %75, ptr %73, align 8, !tbaa !11
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %76 = getelementptr inbounds double, ptr %19, i64 %indvars.iv.next113
  %77 = load double, ptr %76, align 8, !tbaa !11
  %78 = getelementptr inbounds double, ptr %67, i64 %indvars.iv.next113
  %79 = load double, ptr %78, align 8, !tbaa !11
  %80 = tail call double @llvm.fmuladd.f64(double %81, double %77, double %79)
  store double %80, ptr %78, align 8, !tbaa !11
  %indvars.iv.next113.1 = add nuw nsw i64 %indvars.iv112, 2
  %exitcond116.not.1 = icmp eq i64 %indvars.iv.next113.1, %wide.trip.count115
  br i1 %exitcond116.not.1, label %..loopexit_crit_edge.us, label %scalar.ph, !llvm.loop !21

.preheader.us:                                    ; preds = %.lr.ph88.split.us
  %81 = fneg double %69
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.preheader.us
  %indvars.iv112.ph = phi i64 [ %indvars.iv, %vector.memcheck ], [ %indvars.iv, %.preheader.us ], [ %ind.end, %middle.block ]
  %82 = sub i64 %wide.trip.count, %indvars.iv112.ph
  %xtraiter157 = and i64 %82, 1
  %lcmp.mod158.not = icmp eq i64 %xtraiter157, 0
  br i1 %lcmp.mod158.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader
  %83 = getelementptr inbounds double, ptr %19, i64 %indvars.iv112.ph
  %84 = load double, ptr %83, align 8, !tbaa !11
  %85 = getelementptr inbounds double, ptr %67, i64 %indvars.iv112.ph
  %86 = load double, ptr %85, align 8, !tbaa !11
  %87 = tail call double @llvm.fmuladd.f64(double %81, double %84, double %86)
  store double %87, ptr %85, align 8, !tbaa !11
  %indvars.iv.next113.prol = add nuw nsw i64 %indvars.iv112.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv112.unr = phi i64 [ %indvars.iv112.ph, %scalar.ph.preheader ], [ %indvars.iv.next113.prol, %scalar.ph.prol ]
  %88 = icmp eq i64 %indvars.iv112.ph, %10
  br i1 %88, label %..loopexit_crit_edge.us, label %scalar.ph

vector.memcheck:                                  ; preds = %.preheader.us
  %scevgep = getelementptr i8, ptr %67, i64 %17
  %scevgep132 = getelementptr i8, ptr %67, i64 %8
  %bound0 = icmp ult ptr %scevgep, %scevgep134
  %bound1 = icmp ult ptr %scevgep133, %scevgep132
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %broadcast.splatinsert = insertelement <2 x double> poison, double %81, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %indvars.iv, %index
  %89 = getelementptr inbounds double, ptr %19, i64 %offset.idx
  %90 = getelementptr inbounds i8, ptr %89, i64 16
  %wide.load = load <2 x double>, ptr %89, align 8, !tbaa !11, !alias.scope !22
  %wide.load135 = load <2 x double>, ptr %90, align 8, !tbaa !11, !alias.scope !22
  %91 = getelementptr inbounds double, ptr %67, i64 %offset.idx
  %92 = getelementptr inbounds i8, ptr %91, i64 16
  %wide.load136 = load <2 x double>, ptr %91, align 8, !tbaa !11, !alias.scope !25, !noalias !22
  %wide.load137 = load <2 x double>, ptr %92, align 8, !tbaa !11, !alias.scope !25, !noalias !22
  %93 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat, <2 x double> %wide.load, <2 x double> %wide.load136)
  %94 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat, <2 x double> %wide.load135, <2 x double> %wide.load137)
  store <2 x double> %93, ptr %91, align 8, !tbaa !11, !alias.scope !25, !noalias !22
  store <2 x double> %94, ptr %92, align 8, !tbaa !11, !alias.scope !25, !noalias !22
  %index.next = add nuw i64 %index, 4
  %95 = icmp eq i64 %index.next, %n.vec
  br i1 %95, label %middle.block, label %vector.body, !llvm.loop !27

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %..loopexit_crit_edge.us, label %scalar.ph.preheader

.lr.ph84:                                         ; preds = %.lr.ph84.preheader155, %.lr.ph84
  %indvars.iv107 = phi i64 [ %indvars.iv.next108, %.lr.ph84 ], [ %indvars.iv107.ph, %.lr.ph84.preheader155 ]
  %96 = getelementptr inbounds double, ptr %19, i64 %indvars.iv107
  %97 = load double, ptr %96, align 8, !tbaa !11
  %98 = fmul double %58, %97
  store double %98, ptr %96, align 8, !tbaa !11
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %exitcond111.not = icmp eq i64 %indvars.iv.next108, %wide.trip.count110
  br i1 %exitcond111.not, label %.preheader74, label %.lr.ph84, !llvm.loop !28

._crit_edge92.loopexit.split.loop.exit127:        ; preds = %._crit_edge
  %99 = trunc nuw nsw i64 %indvars.iv.next123 to i32
  br label %._crit_edge92

._crit_edge92:                                    ; preds = %.loopexit75, %._crit_edge92.loopexit.split.loop.exit127, %4
  %.0 = phi i32 [ 0, %4 ], [ %99, %._crit_edge92.loopexit.split.loop.exit127 ], [ 0, %.loopexit75 ]
  ret i32 %.0
}

declare double @RAbs(double noundef) local_unnamed_addr #1

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

; 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>) #3

attributes #0 = { 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 = { "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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !9, i64 0}
!13 = distinct !{!13, !6}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !9, i64 0}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !6, !18, !19}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !6}
!21 = distinct !{!21, !6, !18}
!22 = !{!23}
!23 = distinct !{!23, !24}
!24 = distinct !{!24, !"LVerDomain"}
!25 = !{!26}
!26 = distinct !{!26, !24}
!27 = distinct !{!27, !6, !18, !19}
!28 = distinct !{!28, !6, !19, !18}


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