; LLVM IR from JoshuaSBrown/QC_Tools :: src/libcatnip/matrix.ll (ZN6catnip23Matrix_concatenate_colsERKNS_6MatrixES2_)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.catnip::Matrix" = type { i32, i32, i32, ptr }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [35 x i8], align 1

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

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

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

; 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: mustprogress uwtable
declare dso_local noundef double @_ZNK6catnip6Matrix8get_elemEiii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef, i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6catnip6Matrix8set_elemEdiii(ptr noundef nonnull align 8 dereferenceable(24), double noundef, i32 noundef, i32 noundef, i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6catnip23Matrix_concatenate_colsERKNS_6MatrixES2_(ptr dead_on_unwind noalias writable sret(%"class.catnip::Matrix") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  store ptr %2, ptr %5, align 8, !tbaa !5
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = call noundef i32 @_ZNK6catnip6Matrix8get_rowsEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = call noundef i32 @_ZNK6catnip6Matrix8get_rowsEv(ptr noundef nonnull align 8 dereferenceable(24) %14)
  %16 = icmp ne i32 %13, %15
  br i1 %16, label %17, label %20

17:                                               ; preds = %3
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.5)
  %19 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.6)
  call void @_ZN6catnip6MatrixC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %0)
  br label %121

20:                                               ; preds = %3
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = call noundef i32 @_ZNK6catnip6Matrix8get_shelEv(ptr noundef nonnull align 8 dereferenceable(24) %21)
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = call noundef i32 @_ZNK6catnip6Matrix8get_shelEv(ptr noundef nonnull align 8 dereferenceable(24) %23)
  %25 = icmp ne i32 %22, %24
  br i1 %25, label %26, label %29

26:                                               ; preds = %20
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.2)
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.4)
  call void @_ZN6catnip6MatrixC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %0)
  br label %121

29:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = call noundef i32 @_ZNK6catnip6Matrix8get_colsEv(ptr noundef nonnull align 8 dereferenceable(24) %30)
  store i32 %31, ptr %7, align 4, !tbaa !9
  %32 = load i32, ptr %7, align 4, !tbaa !9
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = call noundef i32 @_ZNK6catnip6Matrix8get_colsEv(ptr noundef nonnull align 8 dereferenceable(24) %33)
  %35 = add nsw i32 %32, %34
  store i32 %35, ptr %6, align 4, !tbaa !9
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = call noundef i32 @_ZNK6catnip6Matrix8get_rowsEv(ptr noundef nonnull align 8 dereferenceable(24) %36)
  %38 = load i32, ptr %6, align 4, !tbaa !9
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = call noundef i32 @_ZNK6catnip6Matrix8get_shelEv(ptr noundef nonnull align 8 dereferenceable(24) %39)
  call void @_ZN6catnip6MatrixC1Eiii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %37, i32 noundef %38, i32 noundef %40)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store i32 1, ptr %8, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %76, %29
  %42 = load i32, ptr %8, align 4, !tbaa !9
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = call noundef i32 @_ZNK6catnip6Matrix8get_rowsEv(ptr noundef nonnull align 8 dereferenceable(24) %43)
  %45 = icmp sle i32 %42, %44
  br i1 %45, label %46, label %79

46:                                               ; preds = %41
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %72, %46
  %48 = load i32, ptr %9, align 4, !tbaa !9
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = call noundef i32 @_ZNK6catnip6Matrix8get_colsEv(ptr noundef nonnull align 8 dereferenceable(24) %49)
  %51 = icmp sle i32 %48, %50
  br i1 %51, label %52, label %75

52:                                               ; preds = %47
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %68, %52
  %54 = load i32, ptr %10, align 4, !tbaa !9
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = call noundef i32 @_ZNK6catnip6Matrix8get_shelEv(ptr noundef nonnull align 8 dereferenceable(24) %55)
  %57 = icmp sle i32 %54, %56
  br i1 %57, label %58, label %71

58:                                               ; preds = %53
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = load i32, ptr %8, align 4, !tbaa !9
  %61 = load i32, ptr %9, align 4, !tbaa !9
  %62 = load i32, ptr %10, align 4, !tbaa !9
  %63 = call noundef double @_ZNK6catnip6Matrix8get_elemEiii(ptr noundef nonnull align 8 dereferenceable(24) %59, i32 noundef %60, i32 noundef %61, i32 noundef %62)
  store double %63, ptr %11, align 8, !tbaa !11
  %64 = load double, ptr %11, align 8, !tbaa !11
  %65 = load i32, ptr %8, align 4, !tbaa !9
  %66 = load i32, ptr %9, align 4, !tbaa !9
  %67 = load i32, ptr %10, align 4, !tbaa !9
  call void @_ZN6catnip6Matrix8set_elemEdiii(ptr noundef nonnull align 8 dereferenceable(24) %0, double noundef %64, i32 noundef %65, i32 noundef %66, i32 noundef %67)
  br label %68

68:                                               ; preds = %58
  %69 = load i32, ptr %10, align 4, !tbaa !9
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %10, align 4, !tbaa !9
  br label %53, !llvm.loop !13

71:                                               ; preds = %53
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %9, align 4, !tbaa !9
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %9, align 4, !tbaa !9
  br label %47, !llvm.loop !15

75:                                               ; preds = %47
  br label %76

76:                                               ; preds = %75
  %77 = load i32, ptr %8, align 4, !tbaa !9
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %8, align 4, !tbaa !9
  br label %41, !llvm.loop !16

79:                                               ; preds = %41
  store i32 1, ptr %8, align 4, !tbaa !9
  br label %80

80:                                               ; preds = %117, %79
  %81 = load i32, ptr %8, align 4, !tbaa !9
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = call noundef i32 @_ZNK6catnip6Matrix8get_rowsEv(ptr noundef nonnull align 8 dereferenceable(24) %82)
  %84 = icmp sle i32 %81, %83
  br i1 %84, label %85, label %120

85:                                               ; preds = %80
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %86

86:                                               ; preds = %113, %85
  %87 = load i32, ptr %9, align 4, !tbaa !9
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = call noundef i32 @_ZNK6catnip6Matrix8get_colsEv(ptr noundef nonnull align 8 dereferenceable(24) %88)
  %90 = icmp sle i32 %87, %89
  br i1 %90, label %91, label %116

91:                                               ; preds = %86
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %92

92:                                               ; preds = %109, %91
  %93 = load i32, ptr %10, align 4, !tbaa !9
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = call noundef i32 @_ZNK6catnip6Matrix8get_shelEv(ptr noundef nonnull align 8 dereferenceable(24) %94)
  %96 = icmp sle i32 %93, %95
  br i1 %96, label %97, label %112

97:                                               ; preds = %92
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = load i32, ptr %8, align 4, !tbaa !9
  %100 = load i32, ptr %9, align 4, !tbaa !9
  %101 = load i32, ptr %10, align 4, !tbaa !9
  %102 = call noundef double @_ZNK6catnip6Matrix8get_elemEiii(ptr noundef nonnull align 8 dereferenceable(24) %98, i32 noundef %99, i32 noundef %100, i32 noundef %101)
  store double %102, ptr %11, align 8, !tbaa !11
  %103 = load double, ptr %11, align 8, !tbaa !11
  %104 = load i32, ptr %8, align 4, !tbaa !9
  %105 = load i32, ptr %9, align 4, !tbaa !9
  %106 = load i32, ptr %7, align 4, !tbaa !9
  %107 = add nsw i32 %105, %106
  %108 = load i32, ptr %10, align 4, !tbaa !9
  call void @_ZN6catnip6Matrix8set_elemEdiii(ptr noundef nonnull align 8 dereferenceable(24) %0, double noundef %103, i32 noundef %104, i32 noundef %107, i32 noundef %108)
  br label %109

109:                                              ; preds = %97
  %110 = load i32, ptr %10, align 4, !tbaa !9
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %10, align 4, !tbaa !9
  br label %92, !llvm.loop !17

112:                                              ; preds = %92
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %9, align 4, !tbaa !9
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %9, align 4, !tbaa !9
  br label %86, !llvm.loop !18

116:                                              ; preds = %86
  br label %117

117:                                              ; preds = %116
  %118 = load i32, ptr %8, align 4, !tbaa !9
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %8, align 4, !tbaa !9
  br label %80, !llvm.loop !19

120:                                              ; preds = %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %121

121:                                              ; preds = %120, %26, %17
  ret void
}

declare void @_ZN6catnip6MatrixC1Ev(ptr)

declare void @_ZN6catnip6MatrixC1Eiii(ptr, i32, i32, i32)

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

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

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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.catnip::Matrix" = type { i32, i32, i32, ptr }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [35 x i8], align 1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK6catnip6Matrix8get_elemEiii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6catnip23Matrix_concatenate_colsERKNS_6MatrixES2_(ptr dead_on_unwind noalias writable sret(%"class.catnip::Matrix") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #1 {
  %4 = tail call noundef i32 @_ZNK6catnip6Matrix8get_rowsEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %5 = tail call noundef i32 @_ZNK6catnip6Matrix8get_rowsEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
  %.not = icmp eq i32 %4, %5
  br i1 %.not, label %6, label %.loopexit.sink.split

6:                                                ; preds = %3
  %7 = tail call noundef i32 @_ZNK6catnip6Matrix8get_shelEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %8 = tail call noundef i32 @_ZNK6catnip6Matrix8get_shelEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
  %.not48 = icmp eq i32 %7, %8
  br i1 %.not48, label %9, label %.loopexit.sink.split

9:                                                ; preds = %6
  %10 = tail call noundef i32 @_ZNK6catnip6Matrix8get_colsEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %11 = tail call noundef i32 @_ZNK6catnip6Matrix8get_colsEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
  %12 = add nsw i32 %11, %10
  %13 = tail call noundef i32 @_ZNK6catnip6Matrix8get_rowsEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %14 = tail call noundef i32 @_ZNK6catnip6Matrix8get_shelEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  tail call void @_ZN6catnip6MatrixC1Eiii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %13, i32 noundef %12, i32 noundef %14)
  %15 = tail call noundef i32 @_ZNK6catnip6Matrix8get_rowsEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %.not4964 = icmp slt i32 %15, 1
  br i1 %.not4964, label %.preheader56, label %.preheader58

.preheader58:                                     ; preds = %9, %._crit_edge63
  %.04665 = phi i32 [ %24, %._crit_edge63 ], [ 1, %9 ]
  %16 = tail call noundef i32 @_ZNK6catnip6Matrix8get_colsEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %.not5361 = icmp slt i32 %16, 1
  br i1 %.not5361, label %._crit_edge63, label %.preheader57

.preheader56:                                     ; preds = %._crit_edge63, %9
  %17 = tail call noundef i32 @_ZNK6catnip6Matrix8get_rowsEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
  %.not5073 = icmp slt i32 %17, 1
  br i1 %.not5073, label %.loopexit, label %.preheader55

.preheader57:                                     ; preds = %.preheader58, %._crit_edge
  %.04462 = phi i32 [ %22, %._crit_edge ], [ 1, %.preheader58 ]
  %18 = tail call noundef i32 @_ZNK6catnip6Matrix8get_shelEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %.not5459 = icmp slt i32 %18, 1
  br i1 %.not5459, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader57, %.lr.ph
  %.060 = phi i32 [ %20, %.lr.ph ], [ 1, %.preheader57 ]
  %19 = tail call noundef double @_ZNK6catnip6Matrix8get_elemEiii(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %.04665, i32 noundef %.04462, i32 noundef %.060)
  tail call void @_ZN6catnip6Matrix8set_elemEdiii(ptr noundef nonnull align 8 dereferenceable(24) %0, double noundef %19, i32 noundef %.04665, i32 noundef %.04462, i32 noundef %.060)
  %20 = add nuw nsw i32 %.060, 1
  %21 = tail call noundef i32 @_ZNK6catnip6Matrix8get_shelEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %.not54.not = icmp slt i32 %.060, %21
  br i1 %.not54.not, label %.lr.ph, label %._crit_edge, !llvm.loop !5

._crit_edge:                                      ; preds = %.lr.ph, %.preheader57
  %22 = add nuw nsw i32 %.04462, 1
  %23 = tail call noundef i32 @_ZNK6catnip6Matrix8get_colsEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %.not53.not = icmp slt i32 %.04462, %23
  br i1 %.not53.not, label %.preheader57, label %._crit_edge63, !llvm.loop !7

._crit_edge63:                                    ; preds = %._crit_edge, %.preheader58
  %24 = add nuw nsw i32 %.04665, 1
  %25 = tail call noundef i32 @_ZNK6catnip6Matrix8get_rowsEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %.not49.not = icmp slt i32 %.04665, %25
  br i1 %.not49.not, label %.preheader58, label %.preheader56, !llvm.loop !8

.preheader55:                                     ; preds = %.preheader56, %._crit_edge72
  %.14774 = phi i32 [ %35, %._crit_edge72 ], [ 1, %.preheader56 ]
  %26 = tail call noundef i32 @_ZNK6catnip6Matrix8get_colsEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
  %.not5170 = icmp slt i32 %26, 1
  br i1 %.not5170, label %._crit_edge72, label %.preheader

.preheader:                                       ; preds = %.preheader55, %._crit_edge69
  %.14571 = phi i32 [ %33, %._crit_edge69 ], [ 1, %.preheader55 ]
  %27 = tail call noundef i32 @_ZNK6catnip6Matrix8get_shelEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
  %.not5266 = icmp slt i32 %27, 1
  br i1 %.not5266, label %._crit_edge69, label %.lr.ph68

.lr.ph68:                                         ; preds = %.preheader
  %28 = add nsw i32 %.14571, %10
  br label %29

29:                                               ; preds = %.lr.ph68, %29
  %.167 = phi i32 [ 1, %.lr.ph68 ], [ %31, %29 ]
  %30 = tail call noundef double @_ZNK6catnip6Matrix8get_elemEiii(ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %.14774, i32 noundef %.14571, i32 noundef %.167)
  tail call void @_ZN6catnip6Matrix8set_elemEdiii(ptr noundef nonnull align 8 dereferenceable(24) %0, double noundef %30, i32 noundef %.14774, i32 noundef %28, i32 noundef %.167)
  %31 = add nuw nsw i32 %.167, 1
  %32 = tail call noundef i32 @_ZNK6catnip6Matrix8get_shelEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
  %.not52.not = icmp slt i32 %.167, %32
  br i1 %.not52.not, label %29, label %._crit_edge69, !llvm.loop !9

._crit_edge69:                                    ; preds = %29, %.preheader
  %33 = add nuw nsw i32 %.14571, 1
  %34 = tail call noundef i32 @_ZNK6catnip6Matrix8get_colsEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
  %.not51.not = icmp slt i32 %.14571, %34
  br i1 %.not51.not, label %.preheader, label %._crit_edge72, !llvm.loop !10

._crit_edge72:                                    ; preds = %._crit_edge69, %.preheader55
  %35 = add nuw nsw i32 %.14774, 1
  %36 = tail call noundef i32 @_ZNK6catnip6Matrix8get_rowsEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
  %.not50.not = icmp slt i32 %.14774, %36
  br i1 %.not50.not, label %.preheader55, label %.loopexit, !llvm.loop !11

.loopexit.sink.split:                             ; preds = %6, %3
  %.str.2.sink = phi ptr [ @.str.5, %3 ], [ @.str.2, %6 ]
  %.str.4.sink = phi ptr [ @.str.6, %3 ], [ @.str.4, %6 ]
  %37 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull %.str.2.sink)
  %38 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull %.str.4.sink)
  tail call void @_ZN6catnip6MatrixC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %0)
  br label %.loopexit

.loopexit:                                        ; preds = %._crit_edge72, %.loopexit.sink.split, %.preheader56
  ret void
}

declare void @_ZN6catnip6MatrixC1Ev(ptr) local_unnamed_addr

declare void @_ZN6catnip6MatrixC1Eiii(ptr, i32, i32, i32) local_unnamed_addr

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint 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" }

!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 = distinct !{!7, !6}
!8 = distinct !{!8, !6}
!9 = distinct !{!9, !6}
!10 = distinct !{!10, !6}
!11 = distinct !{!11, !6}


; Effective O3 passes: GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass