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

; 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.33 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [51 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_colsEi(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.34)
  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 1
  %22 = load i32, ptr %21, align 4, !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 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 0
  %26 = load i32, ptr %25, align 8, !tbaa !13
  %27 = load i32, ptr %4, align 4, !tbaa !9
  %28 = mul nsw i32 %26, %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 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 0
  %41 = load i32, ptr %40, align 8, !tbaa !13
  %42 = icmp sle i32 %39, %41
  br i1 %42, label %44, label %43

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

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

45:                                               ; preds = %92, %44
  %46 = load i32, ptr %8, align 4, !tbaa !9
  %47 = load i32, ptr %4, align 4, !tbaa !9
  %48 = icmp sle i32 %46, %47
  br i1 %48, label %50, label %49

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

50:                                               ; preds = %45
  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 1
  %60 = load i32, ptr %59, align 4, !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 %45, !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 = %43
  %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 1
  store i32 %105, ptr %106, align 4, !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 1
  %112 = load i32, ptr %111, align 4, !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 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 0
  %116 = load i32, ptr %115, align 8, !tbaa !13
  %117 = load i32, ptr %4, align 4, !tbaa !9
  %118 = mul nsw i32 %116, %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.35)
  %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 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 0
  %133 = load i32, ptr %132, align 8, !tbaa !13
  %134 = icmp sle i32 %131, %133
  br i1 %134, label %136, label %135

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

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

137:                                              ; preds = %170, %136
  %138 = load i32, ptr %12, align 4, !tbaa !9
  %139 = load i32, ptr %4, align 4, !tbaa !9
  %140 = icmp sle i32 %138, %139
  br i1 %140, label %142, label %141

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

142:                                              ; preds = %137
  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 %137, !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 = %135
  %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 1
  store i32 %183, ptr %184, align 4, !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 4}
!12 = !{!"_ZTSN6catnip6MatrixE", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16}
!13 = !{!12, !10, i64 0}
!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.33 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [51 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_colsEi(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.34)
  tail call void @exit(i32 noundef 1) #6
  unreachable

6:                                                ; preds = %2
  %7 = getelementptr inbounds i8, ptr %0, i64 4
  %8 = load i32, ptr %7, align 4, !tbaa !5
  %9 = icmp slt i32 %8, %1
  br i1 %9, label %10, label %52

10:                                               ; preds = %6
  %11 = load i32, ptr %0, align 8, !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
  %.not5379 = icmp slt i32 %11, 1
  br i1 %.not5379, label %._crit_edge82, label %.preheader57.lr.ph

.preheader57.lr.ph:                               ; preds = %10
  %.not5476 = icmp eq i32 %1, 0
  %21 = getelementptr inbounds i8, ptr %0, i64 16
  %22 = icmp slt i32 %14, 1
  %or.cond = or i1 %.not5476, %22
  br i1 %or.cond, label %._crit_edge82, label %.preheader57

.preheader57:                                     ; preds = %.preheader57.lr.ph, %._crit_edge78
  %23 = phi i32 [ %31, %._crit_edge78 ], [ %11, %.preheader57.lr.ph ]
  %24 = phi i32 [ %32, %._crit_edge78 ], [ %14, %.preheader57.lr.ph ]
  %25 = phi i32 [ %33, %._crit_edge78 ], [ %14, %.preheader57.lr.ph ]
  %.04480 = phi i32 [ %34, %._crit_edge78 ], [ 1, %.preheader57.lr.ph ]
  %26 = icmp slt i32 %25, 1
  br i1 %26, label %._crit_edge78, label %.preheader

._crit_edge82:                                    ; preds = %._crit_edge78, %.preheader57.lr.ph, %10
  %27 = getelementptr inbounds i8, ptr %0, i64 16
  %28 = load ptr, ptr %27, align 8, !tbaa !13
  %29 = icmp eq ptr %28, null
  br i1 %29, label %51, label %50

.preheader:                                       ; preds = %.preheader57, %._crit_edge75
  %30 = phi i32 [ %35, %._crit_edge75 ], [ %24, %.preheader57 ]
  %.04677 = phi i32 [ %36, %._crit_edge75 ], [ 1, %.preheader57 ]
  %.not5572 = icmp slt i32 %30, 1
  br i1 %.not5572, label %._crit_edge75, label %.lr.ph74

._crit_edge78.loopexit87:                         ; preds = %._crit_edge75
  %.pre93 = load i32, ptr %0, align 8, !tbaa !11
  br label %._crit_edge78

._crit_edge78:                                    ; preds = %.preheader57, %._crit_edge78.loopexit87
  %31 = phi i32 [ %.pre93, %._crit_edge78.loopexit87 ], [ %23, %.preheader57 ]
  %32 = phi i32 [ %35, %._crit_edge78.loopexit87 ], [ %24, %.preheader57 ]
  %33 = phi i32 [ %35, %._crit_edge78.loopexit87 ], [ %25, %.preheader57 ]
  %34 = add nuw nsw i32 %.04480, 1
  %.not53.not = icmp slt i32 %.04480, %31
  br i1 %.not53.not, label %.preheader57, label %._crit_edge82, !llvm.loop !14

._crit_edge75:                                    ; preds = %44, %.preheader
  %35 = phi i32 [ %30, %.preheader ], [ %49, %44 ]
  %36 = add nuw i32 %.04677, 1
  %exitcond92.not = icmp eq i32 %.04677, %1
  br i1 %exitcond92.not, label %._crit_edge78.loopexit87, label %.preheader, !llvm.loop !17

.lr.ph74:                                         ; preds = %.preheader, %44
  %.04573 = phi i32 [ %48, %44 ], [ 1, %.preheader ]
  %37 = load i32, ptr %7, align 4, !tbaa !5
  %.not56 = icmp slt i32 %37, %1
  br i1 %.not56, label %44, label %38

38:                                               ; preds = %.lr.ph74
  %39 = load ptr, ptr %21, align 8, !tbaa !13
  %40 = tail call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.04480, i32 noundef %.04677, i32 noundef %.04573)
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds double, ptr %39, i64 %41
  %43 = load double, ptr %42, align 8, !tbaa !18
  br label %44

44:                                               ; preds = %.lr.ph74, %38
  %.sink = phi double [ %43, %38 ], [ 0.000000e+00, %.lr.ph74 ]
  %45 = tail call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.04480, i32 noundef %.04677, i32 noundef %.04573)
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds double, ptr %20, i64 %46
  store double %.sink, ptr %47, align 8, !tbaa !18
  %48 = add nuw nsw i32 %.04573, 1
  %49 = load i32, ptr %13, align 8, !tbaa !12
  %.not55.not = icmp slt i32 %.04573, %49
  br i1 %.not55.not, label %.lr.ph74, label %._crit_edge75, !llvm.loop !20

50:                                               ; preds = %._crit_edge82
  tail call void @_ZdlPvm(ptr noundef nonnull %28, i64 noundef 8) #8
  br label %51

51:                                               ; preds = %50, %._crit_edge82
  store i32 %1, ptr %7, align 4, !tbaa !5
  store ptr %20, ptr %27, align 8, !tbaa !13
  br label %97

52:                                               ; preds = %6
  %53 = icmp ugt i32 %8, %1
  br i1 %53, label %54, label %97

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

.preheader59.lr.ph:                               ; preds = %54
  %.not5162 = icmp eq i32 %1, 0
  %68 = getelementptr inbounds i8, ptr %0, i64 16
  %69 = load i32, ptr %57, align 8
  %70 = icmp slt i32 %69, 1
  %or.cond101 = select i1 %.not5162, i1 true, i1 %70
  br i1 %or.cond101, label %._crit_edge68, label %.preheader59

.preheader59:                                     ; preds = %.preheader59.lr.ph, %._crit_edge64
  %71 = phi i32 [ %79, %._crit_edge64 ], [ %67, %.preheader59.lr.ph ]
  %72 = phi i32 [ %80, %._crit_edge64 ], [ %69, %.preheader59.lr.ph ]
  %73 = phi i32 [ %81, %._crit_edge64 ], [ %69, %.preheader59.lr.ph ]
  %.04366 = phi i32 [ %82, %._crit_edge64 ], [ 1, %.preheader59.lr.ph ]
  %74 = icmp slt i32 %73, 1
  br i1 %74, label %._crit_edge64, label %.preheader58

._crit_edge68:                                    ; preds = %._crit_edge64, %.preheader59.lr.ph, %54
  %75 = getelementptr inbounds i8, ptr %0, i64 16
  %76 = load ptr, ptr %75, align 8, !tbaa !13
  %77 = icmp eq ptr %76, null
  br i1 %77, label %96, label %95

.preheader58:                                     ; preds = %.preheader59, %._crit_edge
  %78 = phi i32 [ %83, %._crit_edge ], [ %72, %.preheader59 ]
  %.04263 = phi i32 [ %84, %._crit_edge ], [ 1, %.preheader59 ]
  %.not5260 = icmp slt i32 %78, 1
  br i1 %.not5260, label %._crit_edge, label %.lr.ph

._crit_edge64.loopexit90:                         ; preds = %._crit_edge
  %.pre = load i32, ptr %0, align 8, !tbaa !11
  br label %._crit_edge64

._crit_edge64:                                    ; preds = %.preheader59, %._crit_edge64.loopexit90
  %79 = phi i32 [ %.pre, %._crit_edge64.loopexit90 ], [ %71, %.preheader59 ]
  %80 = phi i32 [ %83, %._crit_edge64.loopexit90 ], [ %72, %.preheader59 ]
  %81 = phi i32 [ %83, %._crit_edge64.loopexit90 ], [ %73, %.preheader59 ]
  %82 = add nuw nsw i32 %.04366, 1
  %.not.not = icmp slt i32 %.04366, %79
  br i1 %.not.not, label %.preheader59, label %._crit_edge68, !llvm.loop !21

._crit_edge:                                      ; preds = %.lr.ph, %.preheader58
  %83 = phi i32 [ %78, %.preheader58 ], [ %94, %.lr.ph ]
  %84 = add nuw i32 %.04263, 1
  %exitcond.not = icmp eq i32 %.04263, %1
  br i1 %exitcond.not, label %._crit_edge64.loopexit90, label %.preheader58, !llvm.loop !22

.lr.ph:                                           ; preds = %.preheader58, %.lr.ph
  %.061 = phi i32 [ %93, %.lr.ph ], [ 1, %.preheader58 ]
  %85 = load ptr, ptr %68, align 8, !tbaa !13
  %86 = tail call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.04366, i32 noundef %.04263, i32 noundef %.061)
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds double, ptr %85, i64 %87
  %89 = load double, ptr %88, align 8, !tbaa !18
  %90 = tail call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.04366, i32 noundef %.04263, i32 noundef %.061)
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds double, ptr %64, i64 %91
  store double %89, ptr %92, align 8, !tbaa !18
  %93 = add nuw nsw i32 %.061, 1
  %94 = load i32, ptr %57, align 8, !tbaa !12
  %.not52.not = icmp slt i32 %.061, %94
  br i1 %.not52.not, label %.lr.ph, label %._crit_edge, !llvm.loop !23

95:                                               ; preds = %._crit_edge68
  tail call void @_ZdlPvm(ptr noundef nonnull %76, i64 noundef 8) #8
  br label %96

96:                                               ; preds = %95, %._crit_edge68
  store i32 %1, ptr %7, align 4, !tbaa !5
  store ptr %64, ptr %75, align 8, !tbaa !13
  br label %97

97:                                               ; preds = %52, %96, %51
  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 4}
!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 0}
!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