; LLVM IR from MostafaTwfiq/C-DataStructures-And-Algorithms :: Unit Test/Tests/DataStructuresTests/MatricesTest/MatrixTest (MatrixTest)

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

%struct.Matrix = type { ptr, i32, i32, i32, i32, ptr, ptr }

@.str = external hidden unnamed_addr constant [151 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @generateIntPointerMT(i32 noundef) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @compareIntPointersMT(ptr noundef, ptr noundef) #0

declare ptr @matrixInitialization(i32 noundef, i32 noundef, ptr noundef, ptr noundef) #2

declare void @CuAssertIntEquals_LineMsg(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

declare void @CuAssert_Line(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) #2

declare void @destroyMatrix(ptr noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

declare void @matrixInsert(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #2

declare void @CuAssertPtrEquals_LineMsg(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @testMatrixAddRowAtIndex(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca [3 x [3 x i32]], align 16
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %10 = call ptr @matrixInitialization(i32 noundef 2, i32 noundef 2, ptr noundef @free, ptr noundef @compareIntPointersMT)
  store ptr %10, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 36, ptr %4) #5
  call void @llvm.memset.p0.i64(ptr align 16 %4, i8 0, i64 36, i1 false)
  %11 = getelementptr inbounds [3 x [3 x i32]], ptr %4, i32 0, i32 0
  %12 = getelementptr inbounds [3 x i32], ptr %11, i32 0, i32 2
  store i32 10, ptr %12, align 8
  %13 = getelementptr inbounds [3 x [3 x i32]], ptr %4, i32 0, i32 1
  %14 = getelementptr inbounds [3 x i32], ptr %13, i32 0, i32 0
  store i32 2, ptr %14, align 4
  %15 = getelementptr inbounds [3 x i32], ptr %13, i32 0, i32 2
  store i32 11, ptr %15, align 4
  %16 = getelementptr inbounds [3 x [3 x i32]], ptr %4, i32 0, i32 2
  %17 = getelementptr inbounds [3 x i32], ptr %16, i32 0, i32 0
  store i32 2, ptr %17, align 8
  %18 = getelementptr inbounds [3 x i32], ptr %16, i32 0, i32 1
  store i32 1, ptr %18, align 4
  %19 = getelementptr inbounds [3 x i32], ptr %16, i32 0, i32 2
  store i32 12, ptr %19, align 8
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = call ptr @generateIntPointerMT(i32 noundef 10)
  call void @matrixInsert(ptr noundef %20, ptr noundef %21, i32 noundef 0, i32 noundef 0)
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = call ptr @generateIntPointerMT(i32 noundef 11)
  call void @matrixInsert(ptr noundef %22, ptr noundef %23, i32 noundef 1, i32 noundef 0)
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  call void @matrixAddRowAtIndex(ptr noundef %24, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %43, %1
  %26 = load i32, ptr %5, align 4, !tbaa !9
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.Matrix, ptr %27, i32 0, i32 3
  %29 = load i32, ptr %28, align 8, !tbaa !11
  %30 = icmp slt i32 %26, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %46

32:                                               ; preds = %25
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.Matrix, ptr %34, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !13
  %37 = getelementptr inbounds ptr, ptr %36, i64 1
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %39 = load i32, ptr %5, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds ptr, ptr %38, i64 %40
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  call void @CuAssertPtrEquals_LineMsg(ptr noundef %33, ptr noundef @.str, i32 noundef 318, ptr noundef null, ptr noundef null, ptr noundef %42)
  br label %43

43:                                               ; preds = %32
  %44 = load i32, ptr %5, align 4, !tbaa !9
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %5, align 4, !tbaa !9
  br label %25, !llvm.loop !14

46:                                               ; preds = %31
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = call ptr @generateIntPointerMT(i32 noundef 12)
  call void @matrixInsert(ptr noundef %47, ptr noundef %48, i32 noundef 2, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %49

49:                                               ; preds = %132, %46
  %50 = load i32, ptr %6, align 4, !tbaa !9
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.Matrix, ptr %51, i32 0, i32 1
  %53 = load i32, ptr %52, align 8, !tbaa !16
  %54 = icmp slt i32 %50, %53
  br i1 %54, label %56, label %55

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

56:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %128, %56
  %58 = load i32, ptr %9, align 4, !tbaa !9
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.Matrix, ptr %59, i32 0, i32 3
  %61 = load i32, ptr %60, align 8, !tbaa !11
  %62 = icmp slt i32 %58, %61
  br i1 %62, label %64, label %63

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

64:                                               ; preds = %57
  %65 = load i32, ptr %7, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [3 x [3 x i32]], ptr %4, i64 0, i64 %66
  %68 = getelementptr inbounds [3 x i32], ptr %67, i64 0, i64 0
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = load i32, ptr %6, align 4, !tbaa !9
  %71 = icmp eq i32 %69, %70
  br i1 %71, label %72, label %114

72:                                               ; preds = %64
  %73 = load i32, ptr %7, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [3 x [3 x i32]], ptr %4, i64 0, i64 %74
  %76 = getelementptr inbounds [3 x i32], ptr %75, i64 0, i64 1
  %77 = load i32, ptr %76, align 4, !tbaa !9
  %78 = load i32, ptr %9, align 4, !tbaa !9
  %79 = icmp eq i32 %77, %78
  br i1 %79, label %80, label %114

80:                                               ; preds = %72
  %81 = load ptr, ptr %2, align 8, !tbaa !5
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.Matrix, ptr %82, i32 0, i32 0
  %84 = load ptr, ptr %83, align 8, !tbaa !13
  %85 = load i32, ptr %6, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds ptr, ptr %84, i64 %86
  %88 = load ptr, ptr %87, align 8, !tbaa !5
  %89 = load i32, ptr %9, align 4, !tbaa !9
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds ptr, ptr %88, i64 %90
  %92 = load ptr, ptr %91, align 8, !tbaa !5
  %93 = icmp ne ptr %92, null
  %94 = zext i1 %93 to i32
  call void @CuAssert_Line(ptr noundef %81, ptr noundef @.str, i32 noundef 329, ptr noundef @.str.1, i32 noundef %94)
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  %96 = load i32, ptr %7, align 4, !tbaa !9
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %7, align 4, !tbaa !9
  %98 = sext i32 %96 to i64
  %99 = getelementptr inbounds [3 x [3 x i32]], ptr %4, i64 0, i64 %98
  %100 = getelementptr inbounds [3 x i32], ptr %99, i64 0, i64 2
  %101 = load i32, ptr %100, align 4, !tbaa !9
  %102 = load ptr, ptr %3, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.Matrix, ptr %102, i32 0, i32 0
  %104 = load ptr, ptr %103, align 8, !tbaa !13
  %105 = load i32, ptr %6, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds ptr, ptr %104, i64 %106
  %108 = load ptr, ptr %107, align 8, !tbaa !5
  %109 = load i32, ptr %9, align 4, !tbaa !9
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds ptr, ptr %108, i64 %110
  %112 = load ptr, ptr %111, align 8, !tbaa !5
  %113 = load i32, ptr %112, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %95, ptr noundef @.str, i32 noundef 330, ptr noundef null, i32 noundef %101, i32 noundef %113)
  br label %127

114:                                              ; preds = %72, %64
  %115 = load ptr, ptr %2, align 8, !tbaa !5
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.Matrix, ptr %116, i32 0, i32 0
  %118 = load ptr, ptr %117, align 8, !tbaa !13
  %119 = load i32, ptr %6, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds ptr, ptr %118, i64 %120
  %122 = load ptr, ptr %121, align 8, !tbaa !5
  %123 = load i32, ptr %9, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds ptr, ptr %122, i64 %124
  %126 = load ptr, ptr %125, align 8, !tbaa !5
  call void @CuAssertPtrEquals_LineMsg(ptr noundef %115, ptr noundef @.str, i32 noundef 332, ptr noundef null, ptr noundef null, ptr noundef %126)
  br label %127

127:                                              ; preds = %114, %80
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %9, align 4, !tbaa !9
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %9, align 4, !tbaa !9
  br label %57, !llvm.loop !17

131:                                              ; preds = %63
  br label %132

132:                                              ; preds = %131
  %133 = load i32, ptr %6, align 4, !tbaa !9
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %6, align 4, !tbaa !9
  br label %49, !llvm.loop !18

135:                                              ; preds = %55
  %136 = load ptr, ptr %3, align 8, !tbaa !5
  call void @destroyMatrix(ptr noundef %136)
  call void @llvm.lifetime.end.p0(i64 36, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  ret void
}

declare void @matrixAddRowAtIndex(ptr noundef, i32 noundef) #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 nounwind willreturn memory(argmem: write) }
attributes #5 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"Matrix", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !6, i64 24, !6, i64 32}
!13 = !{!12, !6, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!12, !10, i64 8}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}


; 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 = external hidden unnamed_addr constant [151 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @generateIntPointerMT(i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @compareIntPointersMT(ptr noundef, ptr noundef) #0

declare ptr @matrixInitialization(i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @CuAssertIntEquals_LineMsg(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) #3

declare void @CuAssert_Line(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @destroyMatrix(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

declare void @matrixInsert(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @CuAssertPtrEquals_LineMsg(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @testMatrixAddRowAtIndex(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca [3 x [3 x i32]], align 16
  %3 = tail call ptr @matrixInitialization(i32 noundef 2, i32 noundef 2, ptr noundef nonnull @free, ptr noundef nonnull @compareIntPointersMT) #5
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %2) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(36) %2, i8 0, i64 32, i1 false)
  %4 = getelementptr inbounds i8, ptr %2, i64 8
  store i32 10, ptr %4, align 8
  %5 = getelementptr inbounds i8, ptr %2, i64 12
  store i32 2, ptr %5, align 4
  %6 = getelementptr inbounds i8, ptr %2, i64 20
  store <4 x i32> <i32 11, i32 2, i32 1, i32 12>, ptr %6, align 4
  %7 = tail call ptr @generateIntPointerMT(i32 noundef 10)
  tail call void @matrixInsert(ptr noundef %3, ptr noundef %7, i32 noundef 0, i32 noundef 0) #5
  %8 = tail call ptr @generateIntPointerMT(i32 noundef 11)
  tail call void @matrixInsert(ptr noundef %3, ptr noundef %8, i32 noundef 1, i32 noundef 0) #5
  tail call void @matrixAddRowAtIndex(ptr noundef %3, i32 noundef 1) #5
  %9 = getelementptr inbounds i8, ptr %3, i64 16
  %10 = load i32, ptr %9, align 8, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %1
  %12 = tail call ptr @generateIntPointerMT(i32 noundef 12)
  tail call void @matrixInsert(ptr noundef nonnull %3, ptr noundef %12, i32 noundef 2, i32 noundef 1) #5
  %13 = getelementptr inbounds i8, ptr %3, i64 8
  %14 = load i32, ptr %13, align 8, !tbaa !11
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.preheader.lr.ph, label %._crit_edge43

.preheader.lr.ph:                                 ; preds = %._crit_edge
  %16 = load i32, ptr %9, align 8, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.preheader, label %._crit_edge43

.lr.ph:                                           ; preds = %1, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %1 ]
  %18 = load ptr, ptr %3, align 8, !tbaa !12
  %19 = getelementptr inbounds i8, ptr %18, i64 8
  %20 = load ptr, ptr %19, align 8, !tbaa !13
  %21 = getelementptr inbounds ptr, ptr %20, i64 %indvars.iv
  %22 = load ptr, ptr %21, align 8, !tbaa !13
  tail call void @CuAssertPtrEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 318, ptr noundef null, ptr noundef null, ptr noundef %22) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %23 = load i32, ptr %9, align 8, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = icmp slt i64 %indvars.iv.next, %24
  br i1 %25, label %.lr.ph, label %._crit_edge, !llvm.loop !14

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge40
  %26 = phi i32 [ %29, %._crit_edge40 ], [ %14, %.preheader.lr.ph ]
  %27 = phi i32 [ %30, %._crit_edge40 ], [ %16, %.preheader.lr.ph ]
  %indvars.iv49 = phi i64 [ %indvars.iv.next50, %._crit_edge40 ], [ 0, %.preheader.lr.ph ]
  %.03342 = phi i32 [ %.1.lcssa, %._crit_edge40 ], [ 0, %.preheader.lr.ph ]
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph39, label %._crit_edge40

._crit_edge43:                                    ; preds = %._crit_edge40, %.preheader.lr.ph, %._crit_edge
  tail call void @destroyMatrix(ptr noundef nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %2) #5
  ret void

._crit_edge40.loopexit:                           ; preds = %66
  %.pre = load i32, ptr %13, align 8, !tbaa !11
  br label %._crit_edge40

._crit_edge40:                                    ; preds = %._crit_edge40.loopexit, %.preheader
  %29 = phi i32 [ %26, %.preheader ], [ %.pre, %._crit_edge40.loopexit ]
  %30 = phi i32 [ %27, %.preheader ], [ %67, %._crit_edge40.loopexit ]
  %.1.lcssa = phi i32 [ %.03342, %.preheader ], [ %.2, %._crit_edge40.loopexit ]
  %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
  %31 = sext i32 %29 to i64
  %32 = icmp slt i64 %indvars.iv.next50, %31
  br i1 %32, label %.preheader, label %._crit_edge43, !llvm.loop !16

.lr.ph39:                                         ; preds = %.preheader, %66
  %indvars.iv46 = phi i64 [ %indvars.iv.next47, %66 ], [ 0, %.preheader ]
  %.137 = phi i32 [ %.2, %66 ], [ %.03342, %.preheader ]
  %33 = sext i32 %.137 to i64
  %34 = getelementptr inbounds [3 x [3 x i32]], ptr %2, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !18
  %36 = zext i32 %35 to i64
  %37 = icmp eq i64 %indvars.iv49, %36
  br i1 %37, label %38, label %60

38:                                               ; preds = %.lr.ph39
  %39 = getelementptr inbounds i8, ptr %34, i64 4
  %40 = load i32, ptr %39, align 4, !tbaa !18
  %41 = zext i32 %40 to i64
  %42 = icmp eq i64 %indvars.iv46, %41
  br i1 %42, label %43, label %60

43:                                               ; preds = %38
  %44 = load ptr, ptr %3, align 8, !tbaa !12
  %45 = getelementptr inbounds ptr, ptr %44, i64 %indvars.iv49
  %46 = load ptr, ptr %45, align 8, !tbaa !13
  %47 = getelementptr inbounds ptr, ptr %46, i64 %indvars.iv46
  %48 = load ptr, ptr %47, align 8, !tbaa !13
  %49 = icmp ne ptr %48, null
  %50 = zext i1 %49 to i32
  tail call void @CuAssert_Line(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 329, ptr noundef nonnull @.str.1, i32 noundef %50) #5
  %51 = add nsw i32 %.137, 1
  %52 = getelementptr inbounds i8, ptr %34, i64 8
  %53 = load i32, ptr %52, align 4, !tbaa !18
  %54 = load ptr, ptr %3, align 8, !tbaa !12
  %55 = getelementptr inbounds ptr, ptr %54, i64 %indvars.iv49
  %56 = load ptr, ptr %55, align 8, !tbaa !13
  %57 = getelementptr inbounds ptr, ptr %56, i64 %indvars.iv46
  %58 = load ptr, ptr %57, align 8, !tbaa !13
  %59 = load i32, ptr %58, align 4, !tbaa !18
  tail call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 330, ptr noundef null, i32 noundef %53, i32 noundef %59) #5
  br label %66

60:                                               ; preds = %38, %.lr.ph39
  %61 = load ptr, ptr %3, align 8, !tbaa !12
  %62 = getelementptr inbounds ptr, ptr %61, i64 %indvars.iv49
  %63 = load ptr, ptr %62, align 8, !tbaa !13
  %64 = getelementptr inbounds ptr, ptr %63, i64 %indvars.iv46
  %65 = load ptr, ptr %64, align 8, !tbaa !13
  tail call void @CuAssertPtrEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 332, ptr noundef null, ptr noundef null, ptr noundef %65) #5
  br label %66

66:                                               ; preds = %43, %60
  %.2 = phi i32 [ %51, %43 ], [ %.137, %60 ]
  %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
  %67 = load i32, ptr %9, align 8, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = icmp slt i64 %indvars.iv.next47, %68
  br i1 %69, label %.lr.ph39, label %._crit_edge40.loopexit, !llvm.loop !19
}

declare void @matrixAddRowAtIndex(ptr noundef, i32 noundef) local_unnamed_addr #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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, !10, i64 16}
!6 = !{!"Matrix", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !7, i64 24, !7, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!6, !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15, !17}
!17 = !{!"llvm.loop.unswitch.partial.disable"}
!18 = !{!10, !10, i64 0}
!19 = distinct !{!19, !15}


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