; LLVM IR from buresjan/optim_lbm :: nomad/src/Math/MatrixUtils.ll (ZN9NOMAD_4_314getDeterminantEPPdRdm)

; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN9NOMAD_4_314getDeterminantEPPdRdm(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(8) %1, i64 noundef %2) #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca double, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i64 %2, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store double 1.000000e+00, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %18 = load i64, ptr %7, align 8, !tbaa !9
  %19 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %18, i64 8)
  %20 = extractvalue { i64, i1 } %19, 1
  %21 = extractvalue { i64, i1 } %19, 0
  %22 = select i1 %20, i64 -1, i64 %21
  %23 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %22) #7
          to label %24 unwind label %30

24:                                               ; preds = %3
  store ptr %23, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %25

25:                                               ; preds = %72, %24
  %26 = load i64, ptr %13, align 8, !tbaa !9
  %27 = load i64, ptr %7, align 8, !tbaa !9
  %28 = icmp ult i64 %26, %27
  br i1 %28, label %34, label %29

29:                                               ; preds = %25
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %75

30:                                               ; preds = %75, %3
  %31 = landingpad { ptr, i32 }
          cleanup
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %11, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %12, align 4
  br label %131

34:                                               ; preds = %25
  %35 = load i64, ptr %7, align 8, !tbaa !9
  %36 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %35, i64 8)
  %37 = extractvalue { i64, i1 } %36, 1
  %38 = extractvalue { i64, i1 } %36, 0
  %39 = select i1 %37, i64 -1, i64 %38
  %40 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %39) #7
          to label %41 unwind label %50

41:                                               ; preds = %34
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = load i64, ptr %13, align 8, !tbaa !9
  %44 = getelementptr inbounds ptr, ptr %42, i64 %43
  store ptr %40, ptr %44, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 0, ptr %15, align 8, !tbaa !9
  br label %45

45:                                               ; preds = %68, %41
  %46 = load i64, ptr %15, align 8, !tbaa !9
  %47 = load i64, ptr %7, align 8, !tbaa !9
  %48 = icmp ult i64 %46, %47
  br i1 %48, label %54, label %49

49:                                               ; preds = %45
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %71

50:                                               ; preds = %34
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %11, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %131

54:                                               ; preds = %45
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = load i64, ptr %13, align 8, !tbaa !9
  %57 = getelementptr inbounds ptr, ptr %55, i64 %56
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  %59 = load i64, ptr %15, align 8, !tbaa !9
  %60 = getelementptr inbounds double, ptr %58, i64 %59
  %61 = load double, ptr %60, align 8, !tbaa !11
  %62 = load ptr, ptr %10, align 8, !tbaa !5
  %63 = load i64, ptr %13, align 8, !tbaa !9
  %64 = getelementptr inbounds ptr, ptr %62, i64 %63
  %65 = load ptr, ptr %64, align 8, !tbaa !5
  %66 = load i64, ptr %15, align 8, !tbaa !9
  %67 = getelementptr inbounds double, ptr %65, i64 %66
  store double %61, ptr %67, align 8, !tbaa !11
  br label %68

68:                                               ; preds = %54
  %69 = load i64, ptr %15, align 8, !tbaa !9
  %70 = add i64 %69, 1
  store i64 %70, ptr %15, align 8, !tbaa !9
  br label %45, !llvm.loop !13

71:                                               ; preds = %49
  br label %72

72:                                               ; preds = %71
  %73 = load i64, ptr %13, align 8, !tbaa !9
  %74 = add i64 %73, 1
  store i64 %74, ptr %13, align 8, !tbaa !9
  br label %25, !llvm.loop !15

75:                                               ; preds = %29
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  %77 = load i64, ptr %7, align 8, !tbaa !9
  %78 = trunc i64 %77 to i32
  %79 = invoke noundef zeroext i1 @_ZN9NOMAD_4_316LU_decompositionERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPPdiRdi(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef %76, i32 noundef %78, ptr noundef nonnull align 8 dereferenceable(8) %9, i32 noundef 1500)
          to label %80 unwind label %30

80:                                               ; preds = %75
  %81 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  br i1 %81, label %82, label %102

82:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 0, ptr %16, align 8, !tbaa !9
  br label %83

83:                                               ; preds = %98, %82
  %84 = load i64, ptr %16, align 8, !tbaa !9
  %85 = load i64, ptr %7, align 8, !tbaa !9
  %86 = icmp ult i64 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %83
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %101

88:                                               ; preds = %83
  %89 = load ptr, ptr %10, align 8, !tbaa !5
  %90 = load i64, ptr %16, align 8, !tbaa !9
  %91 = getelementptr inbounds ptr, ptr %89, i64 %90
  %92 = load ptr, ptr %91, align 8, !tbaa !5
  %93 = load i64, ptr %16, align 8, !tbaa !9
  %94 = getelementptr inbounds double, ptr %92, i64 %93
  %95 = load double, ptr %94, align 8, !tbaa !11
  %96 = load double, ptr %9, align 8, !tbaa !11
  %97 = fmul double %96, %95
  store double %97, ptr %9, align 8, !tbaa !11
  br label %98

98:                                               ; preds = %88
  %99 = load i64, ptr %16, align 8, !tbaa !9
  %100 = add i64 %99, 1
  store i64 %100, ptr %16, align 8, !tbaa !9
  br label %83, !llvm.loop !16

101:                                              ; preds = %87
  br label %102

102:                                              ; preds = %101, %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store i64 0, ptr %17, align 8, !tbaa !9
  br label %103

103:                                              ; preds = %116, %102
  %104 = load i64, ptr %17, align 8, !tbaa !9
  %105 = load i64, ptr %7, align 8, !tbaa !9
  %106 = icmp ult i64 %104, %105
  br i1 %106, label %108, label %107

107:                                              ; preds = %103
  store i32 11, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %119

108:                                              ; preds = %103
  %109 = load ptr, ptr %10, align 8, !tbaa !5
  %110 = load i64, ptr %17, align 8, !tbaa !9
  %111 = getelementptr inbounds ptr, ptr %109, i64 %110
  %112 = load ptr, ptr %111, align 8, !tbaa !5
  %113 = icmp eq ptr %112, null
  br i1 %113, label %115, label %114

114:                                              ; preds = %108
  call void @_ZdaPv(ptr noundef %112) #8
  br label %115

115:                                              ; preds = %114, %108
  br label %116

116:                                              ; preds = %115
  %117 = load i64, ptr %17, align 8, !tbaa !9
  %118 = add i64 %117, 1
  store i64 %118, ptr %17, align 8, !tbaa !9
  br label %103, !llvm.loop !17

119:                                              ; preds = %107
  %120 = load ptr, ptr %10, align 8, !tbaa !5
  %121 = icmp eq ptr %120, null
  br i1 %121, label %123, label %122

122:                                              ; preds = %119
  call void @_ZdaPv(ptr noundef %120) #8
  br label %123

123:                                              ; preds = %122, %119
  %124 = load double, ptr %9, align 8, !tbaa !11
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  store double %124, ptr %125, align 8, !tbaa !11
  %126 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  br i1 %126, label %127, label %128

127:                                              ; preds = %123
  store i1 true, ptr %4, align 1
  store i32 1, ptr %14, align 4
  br label %129

128:                                              ; preds = %123
  store i1 false, ptr %4, align 1
  store i32 1, ptr %14, align 4
  br label %129

129:                                              ; preds = %128, %127
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #6
  %130 = load i1, ptr %4, align 1
  ret i1 %130

131:                                              ; preds = %50, %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #6
  br label %132

132:                                              ; preds = %131
  %133 = load ptr, ptr %11, align 8
  %134 = load i32, ptr %12, align 4
  %135 = insertvalue { ptr, i32 } poison, ptr %133, 0
  %136 = insertvalue { ptr, i32 } %135, i32 %134, 1
  resume { ptr, i32 } %136
}

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN9NOMAD_4_316LU_decompositionERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPPdiRdi(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #5

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !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"

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN9NOMAD_4_314getDeterminantEPPdRdm(ptr nocapture noundef readonly %0, ptr nocapture noundef nonnull writeonly align 8 dereferenceable(8) %1, i64 noundef %2) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  store double 1.000000e+00, ptr %5, align 8, !tbaa !5
  %6 = icmp ugt i64 %2, 2305843009213693951
  %7 = shl nuw i64 %2, 3
  %8 = select i1 %6, i64 -1, i64 %7
  %9 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %8) #6
          to label %.preheader42 unwind label %12

.preheader42:                                     ; preds = %3
  %.not = icmp eq i64 %2, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader42
  %min.iters.check = icmp ult i64 %2, 4
  %n.vec = and i64 %2, -4
  %cmp.n = icmp eq i64 %n.vec, %2
  %xtraiter = and i64 %2, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.lr.ph

._crit_edge:                                      ; preds = %.loopexit56, %.preheader42
  %10 = trunc i64 %2 to i32
  %11 = invoke noundef zeroext i1 @_ZN9NOMAD_4_316LU_decompositionERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPPdiRdi(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull %9, i32 noundef %10, ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef 1500)
          to label %52 unwind label %12

12:                                               ; preds = %._crit_edge, %3
  %13 = landingpad { ptr, i32 }
          cleanup
  br label %96

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.loopexit56
  %.03544 = phi i64 [ %33, %.loopexit56 ], [ 0, %.lr.ph.preheader ]
  %14 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %8) #6
          to label %15 unwind label %34

15:                                               ; preds = %.lr.ph
  %16 = getelementptr inbounds ptr, ptr %9, i64 %.03544
  store ptr %14, ptr %16, align 8, !tbaa !9
  %17 = getelementptr inbounds ptr, ptr %0, i64 %.03544
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  %19 = ptrtoint ptr %18 to i64
  %20 = ptrtoint ptr %14 to i64
  %21 = sub i64 %20, %19
  %diff.check = icmp ult i64 %21, 32
  %or.cond59 = select i1 %min.iters.check, i1 true, i1 %diff.check
  br i1 %or.cond59, label %scalar.ph.preheader, label %vector.body

scalar.ph.preheader:                              ; preds = %middle.block, %15
  %.03443.ph = phi i64 [ 0, %15 ], [ %n.vec, %middle.block ]
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %.03443.prol = phi i64 [ %25, %scalar.ph.prol ], [ %.03443.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %22 = getelementptr inbounds double, ptr %18, i64 %.03443.prol
  %23 = load double, ptr %22, align 8, !tbaa !5
  %24 = getelementptr inbounds double, ptr %14, i64 %.03443.prol
  store double %23, ptr %24, align 8, !tbaa !5
  %25 = add nuw i64 %.03443.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !11

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %.03443.unr = phi i64 [ %.03443.ph, %scalar.ph.preheader ], [ %25, %scalar.ph.prol ]
  %26 = sub i64 %.03443.ph, %2
  %27 = icmp ugt i64 %26, -4
  br i1 %27, label %.loopexit56, label %scalar.ph

vector.body:                                      ; preds = %15, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %15 ]
  %28 = getelementptr inbounds double, ptr %18, i64 %index
  %29 = getelementptr inbounds i8, ptr %28, i64 16
  %wide.load = load <2 x double>, ptr %28, align 8, !tbaa !5
  %wide.load55 = load <2 x double>, ptr %29, align 8, !tbaa !5
  %30 = getelementptr inbounds double, ptr %14, i64 %index
  %31 = getelementptr inbounds i8, ptr %30, i64 16
  store <2 x double> %wide.load, ptr %30, align 8, !tbaa !5
  store <2 x double> %wide.load55, ptr %31, align 8, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %32 = icmp eq i64 %index.next, %n.vec
  br i1 %32, label %middle.block, label %vector.body, !llvm.loop !13

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

.loopexit56:                                      ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %33 = add nuw i64 %.03544, 1
  %exitcond52.not = icmp eq i64 %33, %2
  br i1 %exitcond52.not, label %._crit_edge, label %.lr.ph, !llvm.loop !17

34:                                               ; preds = %.lr.ph
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %96

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %.03443 = phi i64 [ %51, %scalar.ph ], [ %.03443.unr, %scalar.ph.prol.loopexit ]
  %36 = getelementptr inbounds double, ptr %18, i64 %.03443
  %37 = load double, ptr %36, align 8, !tbaa !5
  %38 = getelementptr inbounds double, ptr %14, i64 %.03443
  store double %37, ptr %38, align 8, !tbaa !5
  %39 = add nuw i64 %.03443, 1
  %40 = getelementptr inbounds double, ptr %18, i64 %39
  %41 = load double, ptr %40, align 8, !tbaa !5
  %42 = getelementptr inbounds double, ptr %14, i64 %39
  store double %41, ptr %42, align 8, !tbaa !5
  %43 = add nuw i64 %.03443, 2
  %44 = getelementptr inbounds double, ptr %18, i64 %43
  %45 = load double, ptr %44, align 8, !tbaa !5
  %46 = getelementptr inbounds double, ptr %14, i64 %43
  store double %45, ptr %46, align 8, !tbaa !5
  %47 = add nuw i64 %.03443, 3
  %48 = getelementptr inbounds double, ptr %18, i64 %47
  %49 = load double, ptr %48, align 8, !tbaa !5
  %50 = getelementptr inbounds double, ptr %14, i64 %47
  store double %49, ptr %50, align 8, !tbaa !5
  %51 = add nuw i64 %.03443, 4
  %exitcond.not.3 = icmp eq i64 %51, %2
  br i1 %exitcond.not.3, label %.loopexit56, label %scalar.ph, !llvm.loop !18

52:                                               ; preds = %._crit_edge
  %53 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  %54 = icmp ne i64 %2, 0
  %or.cond = and i1 %53, %54
  br i1 %or.cond, label %.lr.ph46.preheader, label %.loopexit

.lr.ph46.preheader:                               ; preds = %52
  %.promoted = load double, ptr %5, align 8
  %xtraiter60 = and i64 %2, 3
  %55 = icmp ult i64 %2, 4
  br i1 %55, label %.lr.ph49.preheader.loopexit.unr-lcssa, label %.lr.ph46.preheader.new

.lr.ph46.preheader.new:                           ; preds = %.lr.ph46.preheader
  %unroll_iter = and i64 %2, -4
  br label %.lr.ph46

.lr.ph46:                                         ; preds = %.lr.ph46, %.lr.ph46.preheader.new
  %.03345 = phi i64 [ 0, %.lr.ph46.preheader.new ], [ %80, %.lr.ph46 ]
  %56 = phi double [ %.promoted, %.lr.ph46.preheader.new ], [ %79, %.lr.ph46 ]
  %niter = phi i64 [ 0, %.lr.ph46.preheader.new ], [ %niter.next.3, %.lr.ph46 ]
  %57 = getelementptr inbounds ptr, ptr %9, i64 %.03345
  %58 = load ptr, ptr %57, align 8, !tbaa !9
  %59 = getelementptr inbounds double, ptr %58, i64 %.03345
  %60 = load double, ptr %59, align 8, !tbaa !5
  %61 = fmul double %60, %56
  store double %61, ptr %5, align 8, !tbaa !5
  %62 = or disjoint i64 %.03345, 1
  %63 = getelementptr inbounds ptr, ptr %9, i64 %62
  %64 = load ptr, ptr %63, align 8, !tbaa !9
  %65 = getelementptr inbounds double, ptr %64, i64 %62
  %66 = load double, ptr %65, align 8, !tbaa !5
  %67 = fmul double %66, %61
  store double %67, ptr %5, align 8, !tbaa !5
  %68 = or disjoint i64 %.03345, 2
  %69 = getelementptr inbounds ptr, ptr %9, i64 %68
  %70 = load ptr, ptr %69, align 8, !tbaa !9
  %71 = getelementptr inbounds double, ptr %70, i64 %68
  %72 = load double, ptr %71, align 8, !tbaa !5
  %73 = fmul double %72, %67
  store double %73, ptr %5, align 8, !tbaa !5
  %74 = or disjoint i64 %.03345, 3
  %75 = getelementptr inbounds ptr, ptr %9, i64 %74
  %76 = load ptr, ptr %75, align 8, !tbaa !9
  %77 = getelementptr inbounds double, ptr %76, i64 %74
  %78 = load double, ptr %77, align 8, !tbaa !5
  %79 = fmul double %78, %73
  store double %79, ptr %5, align 8, !tbaa !5
  %80 = add nuw i64 %.03345, 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 %.lr.ph49.preheader.loopexit.unr-lcssa, label %.lr.ph46, !llvm.loop !19

.loopexit:                                        ; preds = %52
  br i1 %.not, label %._crit_edge50, label %.lr.ph49.preheader

.lr.ph49.preheader.loopexit.unr-lcssa:            ; preds = %.lr.ph46, %.lr.ph46.preheader
  %.03345.unr = phi i64 [ 0, %.lr.ph46.preheader ], [ %80, %.lr.ph46 ]
  %.unr = phi double [ %.promoted, %.lr.ph46.preheader ], [ %79, %.lr.ph46 ]
  %lcmp.mod61.not = icmp eq i64 %xtraiter60, 0
  br i1 %lcmp.mod61.not, label %.lr.ph49.preheader, label %.lr.ph46.epil

.lr.ph46.epil:                                    ; preds = %.lr.ph49.preheader.loopexit.unr-lcssa, %.lr.ph46.epil
  %.03345.epil = phi i64 [ %87, %.lr.ph46.epil ], [ %.03345.unr, %.lr.ph49.preheader.loopexit.unr-lcssa ]
  %81 = phi double [ %86, %.lr.ph46.epil ], [ %.unr, %.lr.ph49.preheader.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph46.epil ], [ 0, %.lr.ph49.preheader.loopexit.unr-lcssa ]
  %82 = getelementptr inbounds ptr, ptr %9, i64 %.03345.epil
  %83 = load ptr, ptr %82, align 8, !tbaa !9
  %84 = getelementptr inbounds double, ptr %83, i64 %.03345.epil
  %85 = load double, ptr %84, align 8, !tbaa !5
  %86 = fmul double %85, %81
  store double %86, ptr %5, align 8, !tbaa !5
  %87 = add nuw i64 %.03345.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter60
  br i1 %epil.iter.cmp.not, label %.lr.ph49.preheader, label %.lr.ph46.epil, !llvm.loop !20

.lr.ph49.preheader:                               ; preds = %.lr.ph49.preheader.loopexit.unr-lcssa, %.lr.ph46.epil, %.loopexit
  br label %.lr.ph49

.lr.ph49:                                         ; preds = %.lr.ph49.preheader, %92
  %.047 = phi i64 [ %93, %92 ], [ 0, %.lr.ph49.preheader ]
  %88 = getelementptr inbounds ptr, ptr %9, i64 %.047
  %89 = load ptr, ptr %88, align 8, !tbaa !9
  %90 = icmp eq ptr %89, null
  br i1 %90, label %92, label %91

91:                                               ; preds = %.lr.ph49
  call void @_ZdaPv(ptr noundef nonnull %89) #7
  br label %92

92:                                               ; preds = %.lr.ph49, %91
  %93 = add nuw i64 %.047, 1
  %exitcond54.not = icmp eq i64 %93, %2
  br i1 %exitcond54.not, label %._crit_edge50, label %.lr.ph49, !llvm.loop !21

._crit_edge50:                                    ; preds = %92, %.loopexit
  call void @_ZdaPv(ptr noundef nonnull %9) #7
  %94 = load double, ptr %5, align 8, !tbaa !5
  store double %94, ptr %1, align 8, !tbaa !5
  %95 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  ret i1 %95

96:                                               ; preds = %34, %12
  %.pn = phi { ptr, i32 } [ %35, %34 ], [ %13, %12 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN9NOMAD_4_316LU_decompositionERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPPdiRdi(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #4

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !14, !15, !16}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14, !15}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !14}


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