; 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 @testMatrixAddColumn(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 1, ptr %17, align 8
  %18 = getelementptr inbounds [3 x i32], ptr %16, i32 0, i32 1
  store i32 2, 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 @matrixAddCol(ptr noundef %24)
  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 = %48, %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 1
  %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 %51

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 = load i32, ptr %5, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds ptr, ptr %36, i64 %38
  %40 = load ptr, ptr %39, align 8, !tbaa !5
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.Matrix, ptr %41, i32 0, i32 3
  %43 = load i32, ptr %42, align 8, !tbaa !14
  %44 = sub nsw i32 %43, 1
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds ptr, ptr %40, i64 %45
  %47 = load ptr, ptr %46, align 8, !tbaa !5
  call void @CuAssertPtrEquals_LineMsg(ptr noundef %33, ptr noundef @.str, i32 noundef 356, ptr noundef null, ptr noundef null, ptr noundef %47)
  br label %48

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

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

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

60:                                               ; preds = %54
  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 %140

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

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

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

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

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

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

119:                                              ; preds = %77, %69
  %120 = load ptr, ptr %2, align 8, !tbaa !5
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.Matrix, ptr %121, i32 0, i32 0
  %123 = load ptr, ptr %122, align 8, !tbaa !13
  %124 = load i32, ptr %6, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds ptr, ptr %123, i64 %125
  %127 = load ptr, ptr %126, align 8, !tbaa !5
  %128 = load i32, ptr %9, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds ptr, ptr %127, i64 %129
  %131 = load ptr, ptr %130, align 8, !tbaa !5
  call void @CuAssertPtrEquals_LineMsg(ptr noundef %120, ptr noundef @.str, i32 noundef 369, ptr noundef null, ptr noundef null, ptr noundef %131)
  br label %132

132:                                              ; preds = %119, %85
  br label %133

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

136:                                              ; preds = %68
  br label %137

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

140:                                              ; preds = %60
  %141 = load ptr, ptr %3, align 8, !tbaa !5
  call void @destroyMatrix(ptr noundef %141)
  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 @matrixAddCol(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 8}
!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 16}
!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 @testMatrixAddColumn(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 <4 x i32> <i32 11, i32 1, i32 2, 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 @matrixAddCol(ptr noundef %3) #5
  %9 = getelementptr inbounds i8, ptr %3, i64 8
  %10 = load i32, ptr %9, align 8, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %12 = getelementptr inbounds i8, ptr %3, i64 16
  br label %19

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

.preheader.lr.ph:                                 ; preds = %._crit_edge
  %16 = getelementptr inbounds i8, ptr %3, i64 16
  %17 = load i32, ptr %16, align 8, !tbaa !11
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.preheader, label %._crit_edge44

19:                                               ; preds = %.lr.ph, %19
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %19 ]
  %20 = load ptr, ptr %3, align 8, !tbaa !12
  %21 = getelementptr inbounds ptr, ptr %20, i64 %indvars.iv
  %22 = load ptr, ptr %21, align 8, !tbaa !13
  %23 = load i32, ptr %12, 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
  tail call void @CuAssertPtrEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 356, ptr noundef null, ptr noundef null, ptr noundef %27) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = load i32, ptr %9, align 8, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = icmp slt i64 %indvars.iv.next, %29
  br i1 %30, label %19, label %._crit_edge, !llvm.loop !14

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge41
  %31 = phi i32 [ %34, %._crit_edge41 ], [ %14, %.preheader.lr.ph ]
  %32 = phi i32 [ %35, %._crit_edge41 ], [ %17, %.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 ]
  %33 = icmp sgt i32 %32, 0
  br i1 %33, 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 = %71
  %.pre = load i32, ptr %9, align 8, !tbaa !5
  br label %._crit_edge41

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

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

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

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

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

71:                                               ; preds = %48, %65
  %.2 = phi i32 [ %56, %48 ], [ %.138, %65 ]
  %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
  %72 = load i32, ptr %16, align 8, !tbaa !11
  %73 = sext i32 %72 to i64
  %74 = icmp slt i64 %indvars.iv.next48, %73
  br i1 %74, label %.lr.ph40, label %._crit_edge41.loopexit, !llvm.loop !19
}

declare void @matrixAddCol(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 8}
!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 16}
!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