; 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 @testMatrixAddRow(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 1, 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 2
  store i32 12, ptr %18, align 8
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = call ptr @generateIntPointerMT(i32 noundef 10)
  call void @matrixInsert(ptr noundef %19, ptr noundef %20, i32 noundef 0, i32 noundef 0)
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = call ptr @generateIntPointerMT(i32 noundef 11)
  call void @matrixInsert(ptr noundef %21, ptr noundef %22, i32 noundef 1, i32 noundef 0)
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  call void @matrixAddRow(ptr noundef %23)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %24

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

30:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %50

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

47:                                               ; preds = %31
  %48 = load i32, ptr %5, align 4, !tbaa !9
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %5, align 4, !tbaa !9
  br label %24, !llvm.loop !15

50:                                               ; preds = %30
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = call ptr @generateIntPointerMT(i32 noundef 12)
  call void @matrixInsert(ptr noundef %51, ptr noundef %52, i32 noundef 2, i32 noundef 0)
  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 %53

53:                                               ; preds = %136, %50
  %54 = load i32, ptr %6, align 4, !tbaa !9
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.Matrix, ptr %55, i32 0, i32 1
  %57 = load i32, ptr %56, align 8, !tbaa !14
  %58 = icmp slt i32 %54, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %53
  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 %139

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

61:                                               ; preds = %132, %60
  %62 = load i32, ptr %9, align 4, !tbaa !9
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.Matrix, ptr %63, i32 0, i32 3
  %65 = load i32, ptr %64, align 8, !tbaa !11
  %66 = icmp slt i32 %62, %65
  br i1 %66, label %68, label %67

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

68:                                               ; preds = %61
  %69 = load i32, ptr %7, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [3 x [3 x i32]], ptr %4, i64 0, i64 %70
  %72 = getelementptr inbounds [3 x i32], ptr %71, i64 0, i64 0
  %73 = load i32, ptr %72, align 4, !tbaa !9
  %74 = load i32, ptr %6, align 4, !tbaa !9
  %75 = icmp eq i32 %73, %74
  br i1 %75, label %76, label %118

76:                                               ; preds = %68
  %77 = load i32, ptr %7, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [3 x [3 x i32]], ptr %4, i64 0, i64 %78
  %80 = getelementptr inbounds [3 x i32], ptr %79, i64 0, i64 1
  %81 = load i32, ptr %80, align 4, !tbaa !9
  %82 = load i32, ptr %9, align 4, !tbaa !9
  %83 = icmp eq i32 %81, %82
  br i1 %83, label %84, label %118

84:                                               ; preds = %76
  %85 = load ptr, ptr %2, align 8, !tbaa !5
  %86 = load ptr, ptr %3, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.Matrix, ptr %86, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8, !tbaa !13
  %89 = load i32, ptr %6, 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 = load i32, ptr %9, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds ptr, ptr %92, i64 %94
  %96 = load ptr, ptr %95, align 8, !tbaa !5
  %97 = icmp ne ptr %96, null
  %98 = zext i1 %97 to i32
  call void @CuAssert_Line(ptr noundef %85, ptr noundef @.str, i32 noundef 291, ptr noundef @.str.1, i32 noundef %98)
  %99 = load ptr, ptr %2, align 8, !tbaa !5
  %100 = load i32, ptr %7, align 4, !tbaa !9
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %7, align 4, !tbaa !9
  %102 = sext i32 %100 to i64
  %103 = getelementptr inbounds [3 x [3 x i32]], ptr %4, i64 0, i64 %102
  %104 = getelementptr inbounds [3 x i32], ptr %103, i64 0, i64 2
  %105 = load i32, ptr %104, align 4, !tbaa !9
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.Matrix, ptr %106, i32 0, i32 0
  %108 = load ptr, ptr %107, align 8, !tbaa !13
  %109 = load i32, ptr %6, 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 %9, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds ptr, ptr %112, i64 %114
  %116 = load ptr, ptr %115, align 8, !tbaa !5
  %117 = load i32, ptr %116, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %99, ptr noundef @.str, i32 noundef 292, ptr noundef null, i32 noundef %105, i32 noundef %117)
  br label %131

118:                                              ; preds = %76, %68
  %119 = load ptr, ptr %2, align 8, !tbaa !5
  %120 = load ptr, ptr %3, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.Matrix, ptr %120, i32 0, i32 0
  %122 = load ptr, ptr %121, align 8, !tbaa !13
  %123 = load i32, ptr %6, 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
  %127 = load i32, ptr %9, align 4, !tbaa !9
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds ptr, ptr %126, i64 %128
  %130 = load ptr, ptr %129, align 8, !tbaa !5
  call void @CuAssertPtrEquals_LineMsg(ptr noundef %119, ptr noundef @.str, i32 noundef 294, ptr noundef null, ptr noundef null, ptr noundef %130)
  br label %131

131:                                              ; preds = %118, %84
  br label %132

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

135:                                              ; preds = %67
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %6, align 4, !tbaa !9
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %6, align 4, !tbaa !9
  br label %53, !llvm.loop !18

139:                                              ; preds = %59
  %140 = load ptr, ptr %3, align 8, !tbaa !5
  call void @destroyMatrix(ptr noundef %140)
  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 @matrixAddRow(ptr 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 = !{!12, !10, i64 8}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}


; 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 @testMatrixAddRow(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 1, ptr %5, align 4
  %6 = getelementptr inbounds i8, ptr %2, i64 20
  store i32 11, ptr %6, align 4
  %7 = getelementptr inbounds i8, ptr %2, i64 24
  store i32 2, ptr %7, align 8
  %8 = getelementptr inbounds i8, ptr %2, i64 32
  store i32 12, ptr %8, align 16
  %9 = tail call ptr @generateIntPointerMT(i32 noundef 10)
  tail call void @matrixInsert(ptr noundef %3, ptr noundef %9, i32 noundef 0, i32 noundef 0) #5
  %10 = tail call ptr @generateIntPointerMT(i32 noundef 11)
  tail call void @matrixInsert(ptr noundef %3, ptr noundef %10, i32 noundef 1, i32 noundef 0) #5
  tail call void @matrixAddRow(ptr noundef %3) #5
  %11 = getelementptr inbounds i8, ptr %3, i64 16
  %12 = load i32, ptr %11, align 8, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %14 = getelementptr inbounds i8, ptr %3, i64 8
  br label %21

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

.preheader.lr.ph:                                 ; preds = %._crit_edge
  %19 = load i32, ptr %11, align 8, !tbaa !5
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.preheader, label %._crit_edge44

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

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge41
  %33 = phi i32 [ %36, %._crit_edge41 ], [ %17, %.preheader.lr.ph ]
  %34 = phi i32 [ %37, %._crit_edge41 ], [ %19, %.preheader.lr.ph ]
  %indvars.iv50 = phi i64 [ %indvars.iv.next51, %._crit_edge41 ], [ 0, %.preheader.lr.ph ]
  %.03443 = phi i32 [ %.1.lcssa, %._crit_edge41 ], [ 0, %.preheader.lr.ph ]
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %.lr.ph40, label %._crit_edge41

._crit_edge44:                                    ; preds = %._crit_edge41, %.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_edge41.loopexit:                           ; preds = %73
  %.pre = load i32, ptr %16, align 8, !tbaa !11
  br label %._crit_edge41

._crit_edge41:                                    ; preds = %._crit_edge41.loopexit, %.preheader
  %36 = phi i32 [ %33, %.preheader ], [ %.pre, %._crit_edge41.loopexit ]
  %37 = phi i32 [ %34, %.preheader ], [ %74, %._crit_edge41.loopexit ]
  %.1.lcssa = phi i32 [ %.03443, %.preheader ], [ %.2, %._crit_edge41.loopexit ]
  %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
  %38 = sext i32 %36 to i64
  %39 = icmp slt i64 %indvars.iv.next51, %38
  br i1 %39, label %.preheader, label %._crit_edge44, !llvm.loop !16

.lr.ph40:                                         ; preds = %.preheader, %73
  %indvars.iv47 = phi i64 [ %indvars.iv.next48, %73 ], [ 0, %.preheader ]
  %.138 = phi i32 [ %.2, %73 ], [ %.03443, %.preheader ]
  %40 = sext i32 %.138 to i64
  %41 = getelementptr inbounds [3 x [3 x i32]], ptr %2, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !18
  %43 = zext i32 %42 to i64
  %44 = icmp eq i64 %indvars.iv50, %43
  br i1 %44, label %45, label %67

45:                                               ; preds = %.lr.ph40
  %46 = getelementptr inbounds i8, ptr %41, i64 4
  %47 = load i32, ptr %46, align 4, !tbaa !18
  %48 = zext i32 %47 to i64
  %49 = icmp eq i64 %indvars.iv47, %48
  br i1 %49, label %50, label %67

50:                                               ; preds = %45
  %51 = load ptr, ptr %3, align 8, !tbaa !12
  %52 = getelementptr inbounds ptr, ptr %51, i64 %indvars.iv50
  %53 = load ptr, ptr %52, align 8, !tbaa !13
  %54 = getelementptr inbounds ptr, ptr %53, i64 %indvars.iv47
  %55 = load ptr, ptr %54, align 8, !tbaa !13
  %56 = icmp ne ptr %55, null
  %57 = zext i1 %56 to i32
  tail call void @CuAssert_Line(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 291, ptr noundef nonnull @.str.1, i32 noundef %57) #5
  %58 = add nsw i32 %.138, 1
  %59 = getelementptr inbounds i8, ptr %41, i64 8
  %60 = load i32, ptr %59, align 4, !tbaa !18
  %61 = load ptr, ptr %3, align 8, !tbaa !12
  %62 = getelementptr inbounds ptr, ptr %61, i64 %indvars.iv50
  %63 = load ptr, ptr %62, align 8, !tbaa !13
  %64 = getelementptr inbounds ptr, ptr %63, i64 %indvars.iv47
  %65 = load ptr, ptr %64, align 8, !tbaa !13
  %66 = load i32, ptr %65, align 4, !tbaa !18
  tail call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 292, ptr noundef null, i32 noundef %60, i32 noundef %66) #5
  br label %73

67:                                               ; preds = %45, %.lr.ph40
  %68 = load ptr, ptr %3, align 8, !tbaa !12
  %69 = getelementptr inbounds ptr, ptr %68, i64 %indvars.iv50
  %70 = load ptr, ptr %69, align 8, !tbaa !13
  %71 = getelementptr inbounds ptr, ptr %70, i64 %indvars.iv47
  %72 = load ptr, ptr %71, align 8, !tbaa !13
  tail call void @CuAssertPtrEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 294, ptr noundef null, ptr noundef null, ptr noundef %72) #5
  br label %73

73:                                               ; preds = %50, %67
  %.2 = phi i32 [ %58, %50 ], [ %.138, %67 ]
  %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
  %74 = load i32, ptr %11, align 8, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = icmp slt i64 %indvars.iv.next48, %75
  br i1 %76, label %.lr.ph40, label %._crit_edge41.loopexit, !llvm.loop !19
}

declare void @matrixAddRow(ptr 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,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass