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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN9NOMAD_4_37getRankEPPdmmd(ptr noundef %0, i64 noundef %1, i64 noundef %2, double noundef %3) #5 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca double, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !9
  store i64 %2, ptr %8, align 8, !tbaa !9
  store double %3, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %20 = load i64, ptr %8, align 8, !tbaa !9
  %21 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %20, i64 8)
  %22 = extractvalue { i64, i1 } %21, 1
  %23 = extractvalue { i64, i1 } %21, 0
  %24 = select i1 %22, i64 -1, i64 %23
  %25 = call noalias noundef nonnull ptr @_Znam(i64 noundef %24) #7
  store ptr %25, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %26 = load i64, ptr %8, align 8, !tbaa !9
  %27 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %26, i64 8)
  %28 = extractvalue { i64, i1 } %27, 1
  %29 = extractvalue { i64, i1 } %27, 0
  %30 = select i1 %28, i64 -1, i64 %29
  %31 = call noalias noundef nonnull ptr @_Znam(i64 noundef %30) #7
  store ptr %31, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 0, ptr %12, align 8, !tbaa !9
  br label %32

32:                                               ; preds = %47, %4
  %33 = load i64, ptr %12, align 8, !tbaa !9
  %34 = load i64, ptr %8, align 8, !tbaa !9
  %35 = icmp ult i64 %33, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %50

37:                                               ; preds = %32
  %38 = load i64, ptr %8, align 8, !tbaa !9
  %39 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %38, i64 8)
  %40 = extractvalue { i64, i1 } %39, 1
  %41 = extractvalue { i64, i1 } %39, 0
  %42 = select i1 %40, i64 -1, i64 %41
  %43 = call noalias noundef nonnull ptr @_Znam(i64 noundef %42) #7
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  %45 = load i64, ptr %12, align 8, !tbaa !9
  %46 = getelementptr inbounds ptr, ptr %44, i64 %45
  store ptr %43, ptr %46, align 8, !tbaa !5
  br label %47

47:                                               ; preds = %37
  %48 = load i64, ptr %12, align 8, !tbaa !9
  %49 = add i64 %48, 1
  store i64 %49, ptr %12, align 8, !tbaa !9
  br label %32, !llvm.loop !13

50:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = load ptr, ptr %10, align 8, !tbaa !5
  %53 = load ptr, ptr %11, align 8, !tbaa !5
  %54 = load i64, ptr %7, align 8, !tbaa !9
  %55 = trunc i64 %54 to i32
  %56 = load i64, ptr %8, align 8, !tbaa !9
  %57 = trunc i64 %56 to i32
  %58 = invoke noundef zeroext i1 @_ZN9NOMAD_4_317SVD_decompositionERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPPdS7_S8_iii(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef %51, ptr noundef %52, ptr noundef %53, i32 noundef %55, i32 noundef %57, i32 noundef 1500)
          to label %59 unwind label %65

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

60:                                               ; preds = %77, %59
  %61 = load i64, ptr %16, align 8, !tbaa !9
  %62 = load i64, ptr %8, align 8, !tbaa !9
  %63 = icmp ult i64 %61, %62
  br i1 %63, label %69, label %64

64:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %80

65:                                               ; preds = %50
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %14, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %15, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %120

69:                                               ; preds = %60
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  %71 = load i64, ptr %16, align 8, !tbaa !9
  %72 = getelementptr inbounds ptr, ptr %70, i64 %71
  %73 = load ptr, ptr %72, align 8, !tbaa !5
  %74 = icmp eq ptr %73, null
  br i1 %74, label %76, label %75

75:                                               ; preds = %69
  call void @_ZdaPv(ptr noundef %73) #8
  br label %76

76:                                               ; preds = %75, %69
  br label %77

77:                                               ; preds = %76
  %78 = load i64, ptr %16, align 8, !tbaa !9
  %79 = add i64 %78, 1
  store i64 %79, ptr %16, align 8, !tbaa !9
  br label %60, !llvm.loop !15

80:                                               ; preds = %64
  %81 = load ptr, ptr %11, align 8, !tbaa !5
  %82 = icmp eq ptr %81, null
  br i1 %82, label %84, label %83

83:                                               ; preds = %80
  call void @_ZdaPv(ptr noundef %81) #8
  br label %84

84:                                               ; preds = %83, %80
  %85 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  br i1 %85, label %91, label %86

86:                                               ; preds = %84
  %87 = load ptr, ptr %10, align 8, !tbaa !5
  %88 = icmp eq ptr %87, null
  br i1 %88, label %90, label %89

89:                                               ; preds = %86
  call void @_ZdaPv(ptr noundef %87) #8
  br label %90

90:                                               ; preds = %89, %86
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %17, align 4
  br label %118

91:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store i64 0, ptr %19, align 8, !tbaa !9
  br label %92

92:                                               ; preds = %109, %91
  %93 = load i64, ptr %19, align 8, !tbaa !9
  %94 = load i64, ptr %8, align 8, !tbaa !9
  %95 = icmp ult i64 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 8, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %112

97:                                               ; preds = %92
  %98 = load ptr, ptr %10, align 8, !tbaa !5
  %99 = load i64, ptr %19, align 8, !tbaa !9
  %100 = getelementptr inbounds double, ptr %98, i64 %99
  %101 = load double, ptr %100, align 8, !tbaa !11
  %102 = call double @llvm.fabs.f64(double %101)
  %103 = load double, ptr %9, align 8, !tbaa !11
  %104 = fcmp ogt double %102, %103
  br i1 %104, label %105, label %108

105:                                              ; preds = %97
  %106 = load i32, ptr %18, align 4, !tbaa !16
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %18, align 4, !tbaa !16
  br label %108

108:                                              ; preds = %105, %97
  br label %109

109:                                              ; preds = %108
  %110 = load i64, ptr %19, align 8, !tbaa !9
  %111 = add i64 %110, 1
  store i64 %111, ptr %19, align 8, !tbaa !9
  br label %92, !llvm.loop !18

112:                                              ; preds = %96
  %113 = load ptr, ptr %10, align 8, !tbaa !5
  %114 = icmp eq ptr %113, null
  br i1 %114, label %116, label %115

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

116:                                              ; preds = %115, %112
  %117 = load i32, ptr %18, align 4, !tbaa !16
  store i32 %117, ptr %5, align 4
  store i32 1, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %118

118:                                              ; preds = %116, %90
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  %119 = load i32, ptr %5, align 4
  ret i32 %119

120:                                              ; preds = %65
  %121 = load ptr, ptr %14, align 8
  %122 = load i32, ptr %15, align 4
  %123 = insertvalue { ptr, i32 } poison, ptr %121, 0
  %124 = insertvalue { ptr, i32 } %123, i32 %122, 1
  resume { ptr, i32 } %124
}

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

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

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 #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 = !{!17, !17, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = distinct !{!18, !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 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 #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 #3

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN9NOMAD_4_37getRankEPPdmmd(ptr noundef %0, i64 noundef %1, i64 noundef %2, double noundef %3) local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = icmp ugt i64 %2, 2305843009213693951
  %7 = shl nuw i64 %2, 3
  %8 = select i1 %6, i64 -1, i64 %7
  %9 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %8) #7
  %10 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %8) #7
  %.not = icmp ne i64 %2, 0
  br i1 %.not, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #8
  %11 = trunc i64 %1 to i32
  %12 = trunc i64 %2 to i32
  %13 = invoke noundef zeroext i1 @_ZN9NOMAD_4_317SVD_decompositionERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPPdS7_S8_iii(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef %0, ptr noundef nonnull %9, ptr noundef nonnull %10, i32 noundef %11, i32 noundef %12, i32 noundef 1500)
          to label %.preheader37 unwind label %17

.preheader37:                                     ; preds = %._crit_edge
  br i1 %.not, label %.lr.ph40, label %._crit_edge41

.lr.ph:                                           ; preds = %4, %.lr.ph
  %.03438 = phi i64 [ %16, %.lr.ph ], [ 0, %4 ]
  %14 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %8) #7
  %15 = getelementptr inbounds ptr, ptr %10, i64 %.03438
  store ptr %14, ptr %15, align 8, !tbaa !5
  %16 = add nuw i64 %.03438, 1
  %exitcond.not = icmp eq i64 %16, %2
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

17:                                               ; preds = %._crit_edge
  %18 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  resume { ptr, i32 } %18

.lr.ph40:                                         ; preds = %.preheader37, %23
  %.03239 = phi i64 [ %24, %23 ], [ 0, %.preheader37 ]
  %19 = getelementptr inbounds ptr, ptr %10, i64 %.03239
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  %21 = icmp eq ptr %20, null
  br i1 %21, label %23, label %22

22:                                               ; preds = %.lr.ph40
  call void @_ZdaPv(ptr noundef nonnull %20) #9
  br label %23

23:                                               ; preds = %.lr.ph40, %22
  %24 = add nuw i64 %.03239, 1
  %exitcond48.not = icmp eq i64 %24, %2
  br i1 %exitcond48.not, label %._crit_edge41, label %.lr.ph40, !llvm.loop !11

._crit_edge41:                                    ; preds = %23, %.preheader37
  call void @_ZdaPv(ptr noundef nonnull %10) #9
  %25 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #8
  %.not50 = xor i1 %25, true
  %brmerge.not = and i1 %.not, %25
  %.mux = sext i1 %.not50 to i32
  br i1 %brmerge.not, label %.lr.ph44.preheader, label %._crit_edge45

.lr.ph44.preheader:                               ; preds = %._crit_edge41
  %min.iters.check = icmp ult i64 %2, 4
  br i1 %min.iters.check, label %.lr.ph44.preheader53, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph44.preheader
  %n.vec = and i64 %2, -4
  %broadcast.splatinsert = insertelement <2 x double> poison, double %3, 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 ]
  %vec.phi = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %34, %vector.body ]
  %vec.phi51 = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %35, %vector.body ]
  %26 = getelementptr inbounds double, ptr %9, i64 %index
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  %wide.load = load <2 x double>, ptr %26, align 8, !tbaa !12
  %wide.load52 = load <2 x double>, ptr %27, align 8, !tbaa !12
  %28 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %wide.load)
  %29 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %wide.load52)
  %30 = fcmp ogt <2 x double> %28, %broadcast.splat
  %31 = fcmp ogt <2 x double> %29, %broadcast.splat
  %32 = zext <2 x i1> %30 to <2 x i32>
  %33 = zext <2 x i1> %31 to <2 x i32>
  %34 = add <2 x i32> %vec.phi, %32
  %35 = add <2 x i32> %vec.phi51, %33
  %index.next = add nuw i64 %index, 4
  %36 = icmp eq i64 %index.next, %n.vec
  br i1 %36, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i32> %35, %34
  %37 = call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %2
  br i1 %cmp.n, label %._crit_edge45, label %.lr.ph44.preheader53

.lr.ph44.preheader53:                             ; preds = %middle.block, %.lr.ph44.preheader
  %.043.ph = phi i64 [ 0, %.lr.ph44.preheader ], [ %n.vec, %middle.block ]
  %.03142.ph = phi i32 [ 0, %.lr.ph44.preheader ], [ %37, %middle.block ]
  br label %.lr.ph44

.lr.ph44:                                         ; preds = %.lr.ph44.preheader53, %.lr.ph44
  %.043 = phi i64 [ %43, %.lr.ph44 ], [ %.043.ph, %.lr.ph44.preheader53 ]
  %.03142 = phi i32 [ %.1, %.lr.ph44 ], [ %.03142.ph, %.lr.ph44.preheader53 ]
  %38 = getelementptr inbounds double, ptr %9, i64 %.043
  %39 = load double, ptr %38, align 8, !tbaa !12
  %40 = call double @llvm.fabs.f64(double %39)
  %41 = fcmp ogt double %40, %3
  %42 = zext i1 %41 to i32
  %.1 = add nuw nsw i32 %.03142, %42
  %43 = add nuw i64 %.043, 1
  %exitcond49.not = icmp eq i64 %43, %2
  br i1 %exitcond49.not, label %._crit_edge45, label %.lr.ph44, !llvm.loop !17

._crit_edge45:                                    ; preds = %.lr.ph44, %middle.block, %._crit_edge41
  %.033 = phi i32 [ %.mux, %._crit_edge41 ], [ %37, %middle.block ], [ %.1, %.lr.ph44 ]
  call void @_ZdaPv(ptr noundef nonnull %9) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  ret i32 %.033
}

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v2i32(<2 x i32>) #6

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 = { 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 #3 = { 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 #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { nounwind }
attributes #9 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = distinct !{!14, !10, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !10, !16, !15}


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