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

; 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.36 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.37 = 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_shelEi(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.36)
  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 2
  %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 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 0
  %26 = load i32, ptr %25, align 8, !tbaa !13
  %27 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 1
  %28 = load i32, ptr %27, align 4, !tbaa !14
  %29 = mul nsw i32 %26, %28
  %30 = load i32, ptr %4, align 4, !tbaa !9
  %31 = mul nsw i32 %29, %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 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 1
  %48 = load i32, ptr %47, align 4, !tbaa !14
  %49 = icmp sle i32 %46, %48
  br i1 %49, label %51, label %50

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

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

52:                                               ; preds = %88, %51
  %53 = load i32, ptr %9, align 4, !tbaa !9
  %54 = load i32, ptr %4, align 4, !tbaa !9
  %55 = icmp sle i32 %53, %54
  br i1 %55, label %57, label %56

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

57:                                               ; preds = %52
  %58 = load i32, ptr %4, align 4, !tbaa !9
  %59 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 2
  %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 %52, !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 = %50
  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 2
  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 2
  %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 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 0
  %116 = load i32, ptr %115, align 8, !tbaa !13
  %117 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 1
  %118 = load i32, ptr %117, align 4, !tbaa !14
  %119 = mul nsw i32 %116, %118
  %120 = load i32, ptr %4, align 4, !tbaa !9
  %121 = mul nsw i32 %119, %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.37)
  %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 = getelementptr inbounds %"class.catnip::Matrix", ptr %14, i32 0, i32 1
  %140 = load i32, ptr %139, align 4, !tbaa !14
  %141 = icmp sle i32 %138, %140
  br i1 %141, label %143, label %142

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

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

144:                                              ; preds = %166, %143
  %145 = load i32, ptr %13, align 4, !tbaa !9
  %146 = load i32, ptr %4, align 4, !tbaa !9
  %147 = icmp sle i32 %145, %146
  br i1 %147, label %149, label %148

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

149:                                              ; preds = %144
  %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 %144, !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 = %142
  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 2
  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 8}
!12 = !{!"_ZTSN6catnip6MatrixE", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16}
!13 = !{!12, !10, i64 0}
!14 = !{!12, !10, i64 4}
!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.36 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.37 = 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_shelEi(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.36)
  tail call void @exit(i32 noundef 1) #6
  unreachable

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

10:                                               ; preds = %6
  %11 = load i32, ptr %0, align 8, !tbaa !11
  %12 = getelementptr inbounds i8, ptr %0, i64 4
  %13 = load i32, ptr %12, align 4, !tbaa !12
  %14 = mul i32 %11, %1
  %15 = mul i32 %14, %13
  %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
  %.not5375 = icmp slt i32 %11, 1
  br i1 %.not5375, label %._crit_edge78, label %.preheader57.lr.ph

.preheader57.lr.ph:                               ; preds = %10
  %.not5569 = icmp eq i32 %1, 0
  %21 = getelementptr inbounds i8, ptr %0, i64 16
  %22 = icmp slt i32 %13, 1
  br i1 %22, label %._crit_edge78, label %.preheader57

.preheader57:                                     ; preds = %.preheader57.lr.ph, %._crit_edge74
  %23 = phi i32 [ %28, %._crit_edge74 ], [ %11, %.preheader57.lr.ph ]
  %24 = phi i32 [ %29, %._crit_edge74 ], [ %13, %.preheader57.lr.ph ]
  %.04476 = phi i32 [ %30, %._crit_edge74 ], [ 1, %.preheader57.lr.ph ]
  %.not5472 = icmp slt i32 %24, 1
  %brmerge = or i1 %.not5472, %.not5569
  br i1 %brmerge, label %._crit_edge74, label %.preheader

._crit_edge78:                                    ; preds = %._crit_edge74, %.preheader57.lr.ph, %10
  %25 = getelementptr inbounds i8, ptr %0, i64 16
  %26 = load ptr, ptr %25, align 8, !tbaa !13
  %27 = icmp eq ptr %26, null
  br i1 %27, label %47, label %46

.preheader:                                       ; preds = %.preheader57, %._crit_edge71
  %.04673 = phi i32 [ %31, %._crit_edge71 ], [ 1, %.preheader57 ]
  br label %33

._crit_edge74.loopexit79:                         ; preds = %._crit_edge71
  %.pre84 = load i32, ptr %0, align 8, !tbaa !11
  br label %._crit_edge74

._crit_edge74:                                    ; preds = %.preheader57, %._crit_edge74.loopexit79
  %28 = phi i32 [ %.pre84, %._crit_edge74.loopexit79 ], [ %23, %.preheader57 ]
  %29 = phi i32 [ %32, %._crit_edge74.loopexit79 ], [ %24, %.preheader57 ]
  %30 = add nuw nsw i32 %.04476, 1
  %.not53.not = icmp slt i32 %.04476, %28
  br i1 %.not53.not, label %.preheader57, label %._crit_edge78, !llvm.loop !14

._crit_edge71:                                    ; preds = %41
  %31 = add nuw nsw i32 %.04673, 1
  %32 = load i32, ptr %12, align 4, !tbaa !12
  %.not54.not = icmp slt i32 %.04673, %32
  br i1 %.not54.not, label %.preheader, label %._crit_edge74.loopexit79, !llvm.loop !17

33:                                               ; preds = %.preheader, %41
  %.04570 = phi i32 [ 1, %.preheader ], [ %45, %41 ]
  %34 = load i32, ptr %7, align 8, !tbaa !5
  %.not56 = icmp slt i32 %34, %1
  br i1 %.not56, label %41, label %35

35:                                               ; preds = %33
  %36 = load ptr, ptr %21, align 8, !tbaa !13
  %37 = tail call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.04476, i32 noundef %.04673, i32 noundef %.04570)
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds double, ptr %36, i64 %38
  %40 = load double, ptr %39, align 8, !tbaa !18
  br label %41

41:                                               ; preds = %33, %35
  %.sink = phi double [ %40, %35 ], [ 0.000000e+00, %33 ]
  %42 = tail call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.04476, i32 noundef %.04673, i32 noundef %.04570)
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds double, ptr %20, i64 %43
  store double %.sink, ptr %44, align 8, !tbaa !18
  %45 = add nuw i32 %.04570, 1
  %exitcond83.not = icmp eq i32 %.04570, %1
  br i1 %exitcond83.not, label %._crit_edge71, label %33, !llvm.loop !20

46:                                               ; preds = %._crit_edge78
  tail call void @_ZdlPvm(ptr noundef nonnull %26, i64 noundef 8) #8
  br label %47

47:                                               ; preds = %46, %._crit_edge78
  store i32 %1, ptr %7, align 8, !tbaa !5
  store ptr %20, ptr %25, align 8, !tbaa !13
  br label %89

48:                                               ; preds = %6
  %49 = icmp ugt i32 %8, %1
  br i1 %49, label %50, label %89

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

.preheader59.lr.ph:                               ; preds = %50
  %.not5260 = icmp eq i32 %1, 0
  %64 = getelementptr inbounds i8, ptr %0, i64 16
  %65 = load i32, ptr %52, align 4, !tbaa !12
  %66 = icmp slt i32 %65, 1
  br i1 %66, label %._crit_edge68, label %.preheader59

.preheader59:                                     ; preds = %.preheader59.lr.ph, %._crit_edge64
  %67 = phi i32 [ %72, %._crit_edge64 ], [ %63, %.preheader59.lr.ph ]
  %68 = phi i32 [ %73, %._crit_edge64 ], [ %65, %.preheader59.lr.ph ]
  %.04366 = phi i32 [ %74, %._crit_edge64 ], [ 1, %.preheader59.lr.ph ]
  %.not5162 = icmp slt i32 %68, 1
  %brmerge89 = or i1 %.not5162, %.not5260
  br i1 %brmerge89, label %._crit_edge64, label %.preheader58

._crit_edge68:                                    ; preds = %._crit_edge64, %.preheader59.lr.ph, %50
  %69 = getelementptr inbounds i8, ptr %0, i64 16
  %70 = load ptr, ptr %69, align 8, !tbaa !13
  %71 = icmp eq ptr %70, null
  br i1 %71, label %88, label %87

.preheader58:                                     ; preds = %.preheader59, %._crit_edge
  %.04263 = phi i32 [ %75, %._crit_edge ], [ 1, %.preheader59 ]
  br label %77

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

._crit_edge64:                                    ; preds = %.preheader59, %._crit_edge64.loopexit81
  %72 = phi i32 [ %.pre, %._crit_edge64.loopexit81 ], [ %67, %.preheader59 ]
  %73 = phi i32 [ %76, %._crit_edge64.loopexit81 ], [ %68, %.preheader59 ]
  %74 = add nuw nsw i32 %.04366, 1
  %.not.not = icmp slt i32 %.04366, %72
  br i1 %.not.not, label %.preheader59, label %._crit_edge68, !llvm.loop !21

._crit_edge:                                      ; preds = %77
  %75 = add nuw nsw i32 %.04263, 1
  %76 = load i32, ptr %52, align 4, !tbaa !12
  %.not51.not = icmp slt i32 %.04263, %76
  br i1 %.not51.not, label %.preheader58, label %._crit_edge64.loopexit81, !llvm.loop !22

77:                                               ; preds = %.preheader58, %77
  %.061 = phi i32 [ 1, %.preheader58 ], [ %86, %77 ]
  %78 = load ptr, ptr %64, align 8, !tbaa !13
  %79 = tail call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.04366, i32 noundef %.04263, i32 noundef %.061)
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds double, ptr %78, i64 %80
  %82 = load double, ptr %81, align 8, !tbaa !18
  %83 = tail call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.04366, i32 noundef %.04263, i32 noundef %.061)
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds double, ptr %60, i64 %84
  store double %82, ptr %85, align 8, !tbaa !18
  %86 = add nuw i32 %.061, 1
  %exitcond.not = icmp eq i32 %.061, %1
  br i1 %exitcond.not, label %._crit_edge, label %77, !llvm.loop !23

87:                                               ; preds = %._crit_edge68
  tail call void @_ZdlPvm(ptr noundef nonnull %70, i64 noundef 8) #8
  br label %88

88:                                               ; preds = %87, %._crit_edge68
  store i32 %1, ptr %7, align 8, !tbaa !5
  store ptr %60, ptr %69, align 8, !tbaa !13
  br label %89

89:                                               ; preds = %48, %88, %47
  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 8}
!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 4}
!13 = !{!6, !10, i64 16}
!14 = distinct !{!14, !15, !16}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
!17 = distinct !{!17, !15}
!18 = !{!19, !19, i64 0}
!19 = !{!"double", !8, i64 0}
!20 = distinct !{!20, !15}
!21 = distinct !{!21, !15, !16}
!22 = distinct !{!22, !15}
!23 = distinct !{!23, !15}


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