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

; 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.catnip::Matrix" = type { i32, i32, i32, ptr }

@.str.31 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [32 x i8], align 1

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

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

declare i32 @printf(ptr noundef, ...) #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #3

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6catnip6Matrix8set_rowsEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1) #7 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %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 ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %14 = load ptr, ptr %3, align 8
  %15 = load i32, ptr %4, align 4, !tbaa !9
  %16 = icmp slt i32 %15, 0
  br i1 %16, label %17, label %19

17:                                               ; preds = %2
  %18 = call i32 (ptr, ...) @printf(ptr noundef @.str.31)
  call void @exit(i32 noundef 1) #8
  unreachable

19:                                               ; preds = %2
  %20 = load i32, ptr %4, align 4, !tbaa !9
  %21 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 0
  %22 = load i32, ptr %21, align 8, !tbaa !11
  %23 = icmp sgt i32 %20, %22
  br i1 %23, label %24, label %109

24:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #9
  %25 = load i32, ptr %4, align 4, !tbaa !9
  %26 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 1
  %27 = load i32, ptr %26, align 4, !tbaa !13
  %28 = mul nsw i32 %25, %27
  %29 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 2
  %30 = load i32, ptr %29, align 8, !tbaa !14
  %31 = mul nsw i32 %28, %30
  %32 = sext i32 %31 to i64
  %33 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %32, i64 8)
  %34 = extractvalue { i64, i1 } %33, 1
  %35 = extractvalue { i64, i1 } %33, 0
  %36 = select i1 %34, i64 -1, i64 %35
  %37 = call noalias noundef nonnull ptr @_Znam(i64 noundef %36) #10
  store ptr %37, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  store i32 1, ptr %6, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %96, %24
  %39 = load i32, ptr %6, align 4, !tbaa !9
  %40 = load i32, ptr %4, align 4, !tbaa !9
  %41 = icmp sle i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  br label %99

43:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  store i32 1, ptr %8, align 4, !tbaa !9
  br label %44

44:                                               ; preds = %92, %43
  %45 = load i32, ptr %8, align 4, !tbaa !9
  %46 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 1
  %47 = load i32, ptr %46, align 4, !tbaa !13
  %48 = icmp sle i32 %45, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %44
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  br label %95

50:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %88, %50
  %52 = load i32, ptr %9, align 4, !tbaa !9
  %53 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 2
  %54 = load i32, ptr %53, align 8, !tbaa !14
  %55 = icmp sle i32 %52, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %51
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  br label %91

57:                                               ; preds = %51
  %58 = load i32, ptr %4, align 4, !tbaa !9
  %59 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 0
  %60 = load i32, ptr %59, align 8, !tbaa !11
  %61 = icmp sle i32 %58, %60
  br i1 %61, label %62, label %79

62:                                               ; preds = %57
  %63 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 3
  %64 = load ptr, ptr %63, align 8, !tbaa !15
  %65 = load i32, ptr %6, align 4, !tbaa !9
  %66 = load i32, ptr %8, align 4, !tbaa !9
  %67 = load i32, ptr %9, align 4, !tbaa !9
  %68 = call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef %65, i32 noundef %66, i32 noundef %67)
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds double, ptr %64, i64 %69
  %71 = load double, ptr %70, align 8, !tbaa !16
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = load i32, ptr %6, align 4, !tbaa !9
  %74 = load i32, ptr %8, align 4, !tbaa !9
  %75 = load i32, ptr %9, align 4, !tbaa !9
  %76 = call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef %73, i32 noundef %74, i32 noundef %75)
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds double, ptr %72, i64 %77
  store double %71, ptr %78, align 8, !tbaa !16
  br label %87

79:                                               ; preds = %57
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = load i32, ptr %6, align 4, !tbaa !9
  %82 = load i32, ptr %8, align 4, !tbaa !9
  %83 = load i32, ptr %9, align 4, !tbaa !9
  %84 = call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef %81, i32 noundef %82, i32 noundef %83)
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds double, ptr %80, i64 %85
  store double 0.000000e+00, ptr %86, align 8, !tbaa !16
  br label %87

87:                                               ; preds = %79, %62
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %9, align 4, !tbaa !9
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %9, align 4, !tbaa !9
  br label %51, !llvm.loop !18

91:                                               ; preds = %56
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %8, align 4, !tbaa !9
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %8, align 4, !tbaa !9
  br label %44, !llvm.loop !20

95:                                               ; preds = %49
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %6, align 4, !tbaa !9
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %6, align 4, !tbaa !9
  br label %38, !llvm.loop !21

99:                                               ; preds = %42
  %100 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 3
  %101 = load ptr, ptr %100, align 8, !tbaa !15
  %102 = icmp eq ptr %101, null
  br i1 %102, label %104, label %103

103:                                              ; preds = %99
  call void @_ZdlPvm(ptr noundef %101, i64 noundef 8) #11
  br label %104

104:                                              ; preds = %103, %99
  %105 = load i32, ptr %4, align 4, !tbaa !9
  %106 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 0
  store i32 %105, ptr %106, align 8, !tbaa !11
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 3
  store ptr %107, ptr %108, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #9
  br label %188

109:                                              ; preds = %19
  %110 = load i32, ptr %4, align 4, !tbaa !9
  %111 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 0
  %112 = load i32, ptr %111, align 8, !tbaa !11
  %113 = icmp slt i32 %110, %112
  br i1 %113, label %114, label %187

114:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  %115 = load i32, ptr %4, align 4, !tbaa !9
  %116 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 1
  %117 = load i32, ptr %116, align 4, !tbaa !13
  %118 = mul nsw i32 %115, %117
  %119 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 2
  %120 = load i32, ptr %119, align 8, !tbaa !14
  %121 = mul nsw i32 %118, %120
  %122 = sext i32 %121 to i64
  %123 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %122, i64 8)
  %124 = extractvalue { i64, i1 } %123, 1
  %125 = extractvalue { i64, i1 } %123, 0
  %126 = select i1 %124, i64 -1, i64 %125
  %127 = call noalias noundef nonnull ptr @_Znam(i64 noundef %126) #10
  store ptr %127, ptr %10, align 8, !tbaa !5
  %128 = call i32 (ptr, ...) @printf(ptr noundef @.str.32)
  %129 = call i32 (ptr, ...) @printf(ptr noundef @.str.33)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %130

130:                                              ; preds = %174, %114
  %131 = load i32, ptr %11, align 4, !tbaa !9
  %132 = load i32, ptr %4, align 4, !tbaa !9
  %133 = icmp sle i32 %131, %132
  br i1 %133, label %135, label %134

134:                                              ; preds = %130
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  br label %177

135:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  store i32 1, ptr %12, align 4, !tbaa !9
  br label %136

136:                                              ; preds = %170, %135
  %137 = load i32, ptr %12, align 4, !tbaa !9
  %138 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 1
  %139 = load i32, ptr %138, align 4, !tbaa !13
  %140 = icmp sle i32 %137, %139
  br i1 %140, label %142, label %141

141:                                              ; preds = %136
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  br label %173

142:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  store i32 1, ptr %13, align 4, !tbaa !9
  br label %143

143:                                              ; preds = %166, %142
  %144 = load i32, ptr %13, align 4, !tbaa !9
  %145 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 2
  %146 = load i32, ptr %145, align 8, !tbaa !14
  %147 = icmp sle i32 %144, %146
  br i1 %147, label %149, label %148

148:                                              ; preds = %143
  store i32 17, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  br label %169

149:                                              ; preds = %143
  %150 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 3
  %151 = load ptr, ptr %150, align 8, !tbaa !15
  %152 = load i32, ptr %11, align 4, !tbaa !9
  %153 = load i32, ptr %12, align 4, !tbaa !9
  %154 = load i32, ptr %13, align 4, !tbaa !9
  %155 = call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef %152, i32 noundef %153, i32 noundef %154)
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds double, ptr %151, i64 %156
  %158 = load double, ptr %157, align 8, !tbaa !16
  %159 = load ptr, ptr %10, align 8, !tbaa !5
  %160 = load i32, ptr %11, align 4, !tbaa !9
  %161 = load i32, ptr %12, align 4, !tbaa !9
  %162 = load i32, ptr %13, align 4, !tbaa !9
  %163 = call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef %160, i32 noundef %161, i32 noundef %162)
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds double, ptr %159, i64 %164
  store double %158, ptr %165, align 8, !tbaa !16
  br label %166

166:                                              ; preds = %149
  %167 = load i32, ptr %13, align 4, !tbaa !9
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %13, align 4, !tbaa !9
  br label %143, !llvm.loop !22

169:                                              ; preds = %148
  br label %170

170:                                              ; preds = %169
  %171 = load i32, ptr %12, align 4, !tbaa !9
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %12, align 4, !tbaa !9
  br label %136, !llvm.loop !23

173:                                              ; preds = %141
  br label %174

174:                                              ; preds = %173
  %175 = load i32, ptr %11, align 4, !tbaa !9
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %11, align 4, !tbaa !9
  br label %130, !llvm.loop !24

177:                                              ; preds = %134
  %178 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 3
  %179 = load ptr, ptr %178, align 8, !tbaa !15
  %180 = icmp eq ptr %179, null
  br i1 %180, label %182, label %181

181:                                              ; preds = %177
  call void @_ZdlPvm(ptr noundef %179, i64 noundef 8) #11
  br label %182

182:                                              ; preds = %181, %177
  %183 = load i32, ptr %4, align 4, !tbaa !9
  %184 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 0
  store i32 %183, ptr %184, align 8, !tbaa !11
  %185 = load ptr, ptr %10, align 8, !tbaa !5
  %186 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 3
  store ptr %185, ptr %186, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  br label %187

187:                                              ; preds = %182, %109
  br label %188

188:                                              ; preds = %187, %104
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { noreturn 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #6 = { 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 #7 = { 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 #8 = { noreturn nounwind }
attributes #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTSN6catnip6MatrixE", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16}
!13 = !{!12, !10, i64 4}
!14 = !{!12, !10, i64 8}
!15 = !{!12, !6, i64 16}
!16 = !{!17, !17, i64 0}
!17 = !{!"double", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !19}
!23 = distinct !{!23, !19}
!24 = distinct !{!24, !19}


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

@.str.31 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6catnip6Matrix8set_rowsEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1) local_unnamed_addr #5 align 2 {
  %3 = icmp slt i32 %1, 0
  br i1 %3, label %4, label %6

4:                                                ; preds = %2
  %5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.31)
  tail call void @exit(i32 noundef 1) #6
  unreachable

6:                                                ; preds = %2
  %7 = load i32, ptr %0, align 8, !tbaa !5
  %8 = icmp slt i32 %7, %1
  br i1 %8, label %9, label %56

9:                                                ; preds = %6
  %10 = getelementptr inbounds i8, ptr %0, i64 4
  %11 = load i32, ptr %10, align 4, !tbaa !11
  %12 = mul nsw i32 %11, %1
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = load i32, ptr %13, align 8, !tbaa !12
  %15 = mul nsw i32 %12, %14
  %16 = sext i32 %15 to i64
  %17 = icmp slt i32 %15, 0
  %18 = shl nsw i64 %16, 3
  %19 = select i1 %17, i64 -1, i64 %18
  %20 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %19) #7
  %.not5376 = icmp eq i32 %1, 0
  br i1 %.not5376, label %._crit_edge79, label %.preheader57.lr.ph

.preheader57.lr.ph:                               ; preds = %9
  %21 = getelementptr inbounds i8, ptr %0, i64 16
  %22 = icmp slt i32 %11, 1
  br i1 %22, label %._crit_edge79, label %.preheader57

.preheader57:                                     ; preds = %.preheader57.lr.ph, %._crit_edge75
  %23 = phi i32 [ %33, %._crit_edge75 ], [ %11, %.preheader57.lr.ph ]
  %24 = phi i32 [ %34, %._crit_edge75 ], [ %14, %.preheader57.lr.ph ]
  %25 = phi i32 [ %35, %._crit_edge75 ], [ %14, %.preheader57.lr.ph ]
  %26 = phi i32 [ %36, %._crit_edge75 ], [ %11, %.preheader57.lr.ph ]
  %.04477 = phi i32 [ %37, %._crit_edge75 ], [ 1, %.preheader57.lr.ph ]
  %.not5473 = icmp slt i32 %26, 1
  %27 = icmp slt i32 %25, 1
  %or.cond = select i1 %.not5473, i1 true, i1 %27
  br i1 %or.cond, label %._crit_edge75, label %.preheader

._crit_edge79:                                    ; preds = %._crit_edge75, %.preheader57.lr.ph, %9
  %28 = getelementptr inbounds i8, ptr %0, i64 16
  %29 = load ptr, ptr %28, align 8, !tbaa !13
  %30 = icmp eq ptr %29, null
  br i1 %30, label %55, label %54

.preheader:                                       ; preds = %.preheader57, %._crit_edge72
  %31 = phi i32 [ %38, %._crit_edge72 ], [ %23, %.preheader57 ]
  %32 = phi i32 [ %39, %._crit_edge72 ], [ %24, %.preheader57 ]
  %.04674 = phi i32 [ %40, %._crit_edge72 ], [ 1, %.preheader57 ]
  %.not5569 = icmp slt i32 %32, 1
  br i1 %.not5569, label %._crit_edge72, label %.lr.ph71

._crit_edge75:                                    ; preds = %._crit_edge72, %.preheader57
  %33 = phi i32 [ %23, %.preheader57 ], [ %38, %._crit_edge72 ]
  %34 = phi i32 [ %24, %.preheader57 ], [ %39, %._crit_edge72 ]
  %35 = phi i32 [ %25, %.preheader57 ], [ %39, %._crit_edge72 ]
  %36 = phi i32 [ %26, %.preheader57 ], [ %38, %._crit_edge72 ]
  %37 = add nuw i32 %.04477, 1
  %exitcond84.not = icmp eq i32 %.04477, %1
  br i1 %exitcond84.not, label %._crit_edge79, label %.preheader57, !llvm.loop !14

._crit_edge72.loopexit:                           ; preds = %48
  %.pre85 = load i32, ptr %10, align 4, !tbaa !11
  br label %._crit_edge72

._crit_edge72:                                    ; preds = %._crit_edge72.loopexit, %.preheader
  %38 = phi i32 [ %.pre85, %._crit_edge72.loopexit ], [ %31, %.preheader ]
  %39 = phi i32 [ %53, %._crit_edge72.loopexit ], [ %32, %.preheader ]
  %40 = add nuw nsw i32 %.04674, 1
  %.not54.not = icmp slt i32 %.04674, %38
  br i1 %.not54.not, label %.preheader, label %._crit_edge75, !llvm.loop !17

.lr.ph71:                                         ; preds = %.preheader, %48
  %.04570 = phi i32 [ %52, %48 ], [ 1, %.preheader ]
  %41 = load i32, ptr %0, align 8, !tbaa !5
  %.not56 = icmp slt i32 %41, %1
  br i1 %.not56, label %48, label %42

42:                                               ; preds = %.lr.ph71
  %43 = load ptr, ptr %21, align 8, !tbaa !13
  %44 = tail call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.04477, i32 noundef %.04674, i32 noundef %.04570)
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds double, ptr %43, i64 %45
  %47 = load double, ptr %46, align 8, !tbaa !18
  br label %48

48:                                               ; preds = %.lr.ph71, %42
  %.sink = phi double [ %47, %42 ], [ 0.000000e+00, %.lr.ph71 ]
  %49 = tail call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.04477, i32 noundef %.04674, i32 noundef %.04570)
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds double, ptr %20, i64 %50
  store double %.sink, ptr %51, align 8, !tbaa !18
  %52 = add nuw nsw i32 %.04570, 1
  %53 = load i32, ptr %13, align 8, !tbaa !12
  %.not55.not = icmp slt i32 %.04570, %53
  br i1 %.not55.not, label %.lr.ph71, label %._crit_edge72.loopexit, !llvm.loop !20

54:                                               ; preds = %._crit_edge79
  tail call void @_ZdlPvm(ptr noundef nonnull %29, i64 noundef 8) #8
  br label %55

55:                                               ; preds = %54, %._crit_edge79
  store i32 %1, ptr %0, align 8, !tbaa !5
  store ptr %20, ptr %28, align 8, !tbaa !13
  br label %102

56:                                               ; preds = %6
  %57 = icmp ugt i32 %7, %1
  br i1 %57, label %58, label %102

58:                                               ; preds = %56
  %59 = getelementptr inbounds i8, ptr %0, i64 4
  %60 = load i32, ptr %59, align 4, !tbaa !11
  %61 = mul nsw i32 %60, %1
  %62 = getelementptr inbounds i8, ptr %0, i64 8
  %63 = load i32, ptr %62, align 8, !tbaa !12
  %64 = mul nsw i32 %61, %63
  %65 = sext i32 %64 to i64
  %66 = icmp slt i32 %64, 0
  %67 = shl nsw i64 %65, 3
  %68 = select i1 %66, i64 -1, i64 %67
  %69 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %68) #7
  %70 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.32)
  %71 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.33)
  %.not65 = icmp eq i32 %1, 0
  br i1 %.not65, label %._crit_edge68, label %.preheader59.lr.ph

.preheader59.lr.ph:                               ; preds = %58
  %72 = getelementptr inbounds i8, ptr %0, i64 16
  %73 = load i32, ptr %59, align 4, !tbaa !11
  %74 = icmp slt i32 %73, 1
  br i1 %74, label %._crit_edge68, label %.preheader59

.preheader59:                                     ; preds = %.preheader59.lr.ph, %._crit_edge64
  %75 = phi i32 [ %84, %._crit_edge64 ], [ %73, %.preheader59.lr.ph ]
  %76 = phi i32 [ %85, %._crit_edge64 ], [ %73, %.preheader59.lr.ph ]
  %.04366 = phi i32 [ %86, %._crit_edge64 ], [ 1, %.preheader59.lr.ph ]
  %.not5162 = icmp slt i32 %76, 1
  %77 = load i32, ptr %62, align 8
  %78 = icmp slt i32 %77, 1
  %or.cond94 = select i1 %.not5162, i1 true, i1 %78
  br i1 %or.cond94, label %._crit_edge64, label %.preheader58

._crit_edge68:                                    ; preds = %._crit_edge64, %.preheader59.lr.ph, %58
  %79 = getelementptr inbounds i8, ptr %0, i64 16
  %80 = load ptr, ptr %79, align 8, !tbaa !13
  %81 = icmp eq ptr %80, null
  br i1 %81, label %101, label %100

.preheader58:                                     ; preds = %.preheader59, %._crit_edge
  %82 = phi i32 [ %87, %._crit_edge ], [ %75, %.preheader59 ]
  %83 = phi i32 [ %88, %._crit_edge ], [ %77, %.preheader59 ]
  %.04263 = phi i32 [ %89, %._crit_edge ], [ 1, %.preheader59 ]
  %.not5260 = icmp slt i32 %83, 1
  br i1 %.not5260, label %._crit_edge, label %.lr.ph

._crit_edge64:                                    ; preds = %._crit_edge, %.preheader59
  %84 = phi i32 [ %75, %.preheader59 ], [ %87, %._crit_edge ]
  %85 = phi i32 [ %76, %.preheader59 ], [ %87, %._crit_edge ]
  %86 = add nuw i32 %.04366, 1
  %exitcond.not = icmp eq i32 %.04366, %1
  br i1 %exitcond.not, label %._crit_edge68, label %.preheader59, !llvm.loop !21

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i32, ptr %59, align 4, !tbaa !11
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader58
  %87 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %82, %.preheader58 ]
  %88 = phi i32 [ %99, %._crit_edge.loopexit ], [ %83, %.preheader58 ]
  %89 = add nuw nsw i32 %.04263, 1
  %.not51.not = icmp slt i32 %.04263, %87
  br i1 %.not51.not, label %.preheader58, label %._crit_edge64, !llvm.loop !22

.lr.ph:                                           ; preds = %.preheader58, %.lr.ph
  %.061 = phi i32 [ %98, %.lr.ph ], [ 1, %.preheader58 ]
  %90 = load ptr, ptr %72, align 8, !tbaa !13
  %91 = tail call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.04366, i32 noundef %.04263, i32 noundef %.061)
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds double, ptr %90, i64 %92
  %94 = load double, ptr %93, align 8, !tbaa !18
  %95 = tail call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.04366, i32 noundef %.04263, i32 noundef %.061)
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds double, ptr %69, i64 %96
  store double %94, ptr %97, align 8, !tbaa !18
  %98 = add nuw nsw i32 %.061, 1
  %99 = load i32, ptr %62, align 8, !tbaa !12
  %.not52.not = icmp slt i32 %.061, %99
  br i1 %.not52.not, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !23

100:                                              ; preds = %._crit_edge68
  tail call void @_ZdlPvm(ptr noundef nonnull %80, i64 noundef 8) #8
  br label %101

101:                                              ; preds = %100, %._crit_edge68
  store i32 %1, ptr %0, align 8, !tbaa !5
  store ptr %69, ptr %79, align 8, !tbaa !13
  br label %102

102:                                              ; preds = %56, %101, %55
  ret void
}

attributes #0 = { nofree 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 #1 = { noreturn 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 #2 = { 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 #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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { noreturn 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, !7, i64 0}
!6 = !{!"_ZTSN6catnip6MatrixE", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!6, !7, i64 8}
!13 = !{!6, !10, i64 16}
!14 = distinct !{!14, !15, !16}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
!17 = distinct !{!17, !15, !16}
!18 = !{!19, !19, i64 0}
!19 = !{!"double", !8, i64 0}
!20 = distinct !{!20, !15}
!21 = distinct !{!21, !15, !16}
!22 = distinct !{!22, !15, !16}
!23 = distinct !{!23, !15}


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