; LLVM IR from AllAlgorithms/c :: algorithms/converting a matrix to sparse matrix (converting matrix to sparse)

; 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.term = type { i32, i32, i32 }

@.str = external hidden unnamed_addr constant [53 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [46 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca [10 x [10 x i32]], align 16
  %8 = alloca [10 x [10 x i32]], align 16
  %9 = alloca [101 x %struct.term], align 16
  %10 = alloca [101 x %struct.term], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 400, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 400, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 1212, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 1212, ptr %10) #3
  %11 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %1, ptr noundef %2)
  %13 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %36, %0
  %15 = load i32, ptr %5, align 4, !tbaa !5
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = icmp slt i32 %15, %16
  br i1 %17, label %18, label %39

18:                                               ; preds = %14
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %32, %18
  %20 = load i32, ptr %6, align 4, !tbaa !5
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %23, label %35

23:                                               ; preds = %19
  %24 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  %25 = load i32, ptr %5, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [10 x [10 x i32]], ptr %7, i64 0, i64 %26
  %28 = load i32, ptr %6, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [10 x i32], ptr %27, i64 0, i64 %29
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef %30)
  br label %32

32:                                               ; preds = %23
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %6, align 4, !tbaa !5
  br label %19, !llvm.loop !9

35:                                               ; preds = %19
  br label %36

36:                                               ; preds = %35
  %37 = load i32, ptr %5, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %5, align 4, !tbaa !5
  br label %14, !llvm.loop !11

39:                                               ; preds = %14
  %40 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  %41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %3, ptr noundef %4)
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %65, %39
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %47, label %68

47:                                               ; preds = %43
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %61, %47
  %49 = load i32, ptr %6, align 4, !tbaa !5
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %52, label %64

52:                                               ; preds = %48
  %53 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  %54 = load i32, ptr %5, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [10 x [10 x i32]], ptr %8, i64 0, i64 %55
  %57 = load i32, ptr %6, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [10 x i32], ptr %56, i64 0, i64 %58
  %60 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef %59)
  br label %61

61:                                               ; preds = %52
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %6, align 4, !tbaa !5
  br label %48, !llvm.loop !12

64:                                               ; preds = %48
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %5, align 4, !tbaa !5
  br label %43, !llvm.loop !13

68:                                               ; preds = %43
  %69 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %93, %68
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = load i32, ptr %1, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %74, label %96

74:                                               ; preds = %70
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %88, %74
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = load i32, ptr %2, align 4, !tbaa !5
  %78 = icmp slt i32 %76, %77
  br i1 %78, label %79, label %91

79:                                               ; preds = %75
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [10 x [10 x i32]], ptr %7, i64 0, i64 %81
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [10 x i32], ptr %82, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %86)
  br label %88

88:                                               ; preds = %79
  %89 = load i32, ptr %6, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %6, align 4, !tbaa !5
  br label %75, !llvm.loop !14

91:                                               ; preds = %75
  %92 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  br label %93

93:                                               ; preds = %91
  %94 = load i32, ptr %5, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %5, align 4, !tbaa !5
  br label %70, !llvm.loop !15

96:                                               ; preds = %70
  %97 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %121, %96
  %99 = load i32, ptr %5, align 4, !tbaa !5
  %100 = load i32, ptr %3, align 4, !tbaa !5
  %101 = icmp slt i32 %99, %100
  br i1 %101, label %102, label %124

102:                                              ; preds = %98
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %116, %102
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = load i32, ptr %4, align 4, !tbaa !5
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %107, label %119

107:                                              ; preds = %103
  %108 = load i32, ptr %5, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [10 x [10 x i32]], ptr %8, i64 0, i64 %109
  %111 = load i32, ptr %6, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [10 x i32], ptr %110, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %114)
  br label %116

116:                                              ; preds = %107
  %117 = load i32, ptr %6, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %6, align 4, !tbaa !5
  br label %103, !llvm.loop !16

119:                                              ; preds = %103
  %120 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  br label %121

121:                                              ; preds = %119
  %122 = load i32, ptr %5, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %5, align 4, !tbaa !5
  br label %98, !llvm.loop !17

124:                                              ; preds = %98
  %125 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  %126 = getelementptr inbounds [10 x [10 x i32]], ptr %7, i64 0, i64 0
  %127 = load i32, ptr %1, align 4, !tbaa !5
  %128 = load i32, ptr %2, align 4, !tbaa !5
  %129 = getelementptr inbounds [101 x %struct.term], ptr %9, i64 0, i64 0
  call void @create_sparse(ptr noundef %126, i32 noundef %127, i32 noundef %128, ptr noundef %129)
  %130 = call i32 (ptr, ...) @printf(ptr noundef @.str.12)
  %131 = getelementptr inbounds [10 x [10 x i32]], ptr %8, i64 0, i64 0
  %132 = load i32, ptr %3, align 4, !tbaa !5
  %133 = load i32, ptr %4, align 4, !tbaa !5
  %134 = getelementptr inbounds [101 x %struct.term], ptr %10, i64 0, i64 0
  call void @create_sparse(ptr noundef %131, i32 noundef %132, i32 noundef %133, ptr noundef %134)
  call void @llvm.lifetime.end.p0(i64 1212, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 1212, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 400, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 400, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #3
  ret void
}

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

declare i32 @printf(ptr noundef, ...) #2

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

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

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

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 }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


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

%struct.term = type { i32, i32, i32 }

@.str = external hidden unnamed_addr constant [53 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [46 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca [10 x [10 x i32]], align 16
  %6 = alloca [10 x [10 x i32]], align 16
  %7 = alloca [101 x %struct.term], align 16
  %8 = alloca [101 x %struct.term], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 1212, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 1212, ptr nonnull %8) #3
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  %14 = load i32, ptr %2, align 4
  %15 = icmp sgt i32 %14, 0
  %or.cond = select i1 %13, i1 %15, i1 false
  br i1 %or.cond, label %.preheader30, label %._crit_edge33

.preheader30:                                     ; preds = %0, %._crit_edge
  %16 = phi i32 [ %25, %._crit_edge ], [ %12, %0 ]
  %17 = phi i32 [ %26, %._crit_edge ], [ %14, %0 ]
  %indvars.iv52 = phi i64 [ %indvars.iv.next53, %._crit_edge ], [ 0, %0 ]
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader30, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader30 ]
  %19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %20 = getelementptr inbounds [10 x [10 x i32]], ptr %5, i64 0, i64 %indvars.iv52, i64 %indvars.iv
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %20)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = icmp slt i64 %indvars.iv.next, %23
  br i1 %24, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !9

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader30
  %25 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %16, %.preheader30 ]
  %26 = phi i32 [ %22, %._crit_edge.loopexit ], [ %17, %.preheader30 ]
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
  %27 = sext i32 %25 to i64
  %28 = icmp slt i64 %indvars.iv.next53, %27
  br i1 %28, label %.preheader30, label %._crit_edge33, !llvm.loop !11

._crit_edge33:                                    ; preds = %._crit_edge, %0
  %29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = icmp sgt i32 %32, 0
  %34 = load i32, ptr %4, align 4
  %35 = icmp sgt i32 %34, 0
  %or.cond77 = select i1 %33, i1 %35, i1 false
  br i1 %or.cond77, label %.preheader29, label %._crit_edge38

.preheader29:                                     ; preds = %._crit_edge33, %._crit_edge36
  %36 = phi i32 [ %45, %._crit_edge36 ], [ %32, %._crit_edge33 ]
  %37 = phi i32 [ %46, %._crit_edge36 ], [ %34, %._crit_edge33 ]
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %._crit_edge36 ], [ 0, %._crit_edge33 ]
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %.lr.ph35, label %._crit_edge36

.lr.ph35:                                         ; preds = %.preheader29, %.lr.ph35
  %indvars.iv55 = phi i64 [ %indvars.iv.next56, %.lr.ph35 ], [ 0, %.preheader29 ]
  %39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %40 = getelementptr inbounds [10 x [10 x i32]], ptr %6, i64 0, i64 %indvars.iv58, i64 %indvars.iv55
  %41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %40)
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = icmp slt i64 %indvars.iv.next56, %43
  br i1 %44, label %.lr.ph35, label %._crit_edge36.loopexit, !llvm.loop !13

._crit_edge36.loopexit:                           ; preds = %.lr.ph35
  %.pre73 = load i32, ptr %3, align 4, !tbaa !5
  br label %._crit_edge36

._crit_edge36:                                    ; preds = %._crit_edge36.loopexit, %.preheader29
  %45 = phi i32 [ %.pre73, %._crit_edge36.loopexit ], [ %36, %.preheader29 ]
  %46 = phi i32 [ %42, %._crit_edge36.loopexit ], [ %37, %.preheader29 ]
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %47 = sext i32 %45 to i64
  %48 = icmp slt i64 %indvars.iv.next59, %47
  br i1 %48, label %.preheader29, label %._crit_edge38, !llvm.loop !14

._crit_edge38:                                    ; preds = %._crit_edge36, %._crit_edge33
  %49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  %50 = load i32, ptr %1, align 4, !tbaa !5
  %51 = icmp sgt i32 %50, 0
  br i1 %51, label %.preheader28, label %._crit_edge43

.preheader28:                                     ; preds = %._crit_edge38, %._crit_edge41
  %indvars.iv64 = phi i64 [ %indvars.iv.next65, %._crit_edge41 ], [ 0, %._crit_edge38 ]
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = icmp sgt i32 %52, 0
  br i1 %53, label %.lr.ph40, label %._crit_edge41

.lr.ph40:                                         ; preds = %.preheader28, %.lr.ph40
  %indvars.iv61 = phi i64 [ %indvars.iv.next62, %.lr.ph40 ], [ 0, %.preheader28 ]
  %54 = getelementptr inbounds [10 x [10 x i32]], ptr %5, i64 0, i64 %indvars.iv64, i64 %indvars.iv61
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %55)
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = icmp slt i64 %indvars.iv.next62, %58
  br i1 %59, label %.lr.ph40, label %._crit_edge41, !llvm.loop !15

._crit_edge41:                                    ; preds = %.lr.ph40, %.preheader28
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %61 = load i32, ptr %1, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = icmp slt i64 %indvars.iv.next65, %62
  br i1 %63, label %.preheader28, label %._crit_edge43, !llvm.loop !16

._crit_edge43:                                    ; preds = %._crit_edge41, %._crit_edge38
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = icmp sgt i32 %65, 0
  br i1 %66, label %.preheader, label %._crit_edge48

.preheader:                                       ; preds = %._crit_edge43, %._crit_edge46
  %indvars.iv70 = phi i64 [ %indvars.iv.next71, %._crit_edge46 ], [ 0, %._crit_edge43 ]
  %67 = load i32, ptr %4, align 4, !tbaa !5
  %68 = icmp sgt i32 %67, 0
  br i1 %68, label %.lr.ph45, label %._crit_edge46

.lr.ph45:                                         ; preds = %.preheader, %.lr.ph45
  %indvars.iv67 = phi i64 [ %indvars.iv.next68, %.lr.ph45 ], [ 0, %.preheader ]
  %69 = getelementptr inbounds [10 x [10 x i32]], ptr %6, i64 0, i64 %indvars.iv70, i64 %indvars.iv67
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %70)
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = icmp slt i64 %indvars.iv.next68, %73
  br i1 %74, label %.lr.ph45, label %._crit_edge46, !llvm.loop !17

._crit_edge46:                                    ; preds = %.lr.ph45, %.preheader
  %75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %76 = load i32, ptr %3, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = icmp slt i64 %indvars.iv.next71, %77
  br i1 %78, label %.preheader, label %._crit_edge48, !llvm.loop !18

._crit_edge48:                                    ; preds = %._crit_edge46, %._crit_edge43
  %79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  %80 = load i32, ptr %1, align 4, !tbaa !5
  %81 = load i32, ptr %2, align 4, !tbaa !5
  call void @create_sparse(ptr noundef nonnull %5, i32 noundef %80, i32 noundef %81, ptr noundef nonnull %7)
  %82 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12)
  %83 = load i32, ptr %3, align 4, !tbaa !5
  %84 = load i32, ptr %4, align 4, !tbaa !5
  call void @create_sparse(ptr noundef nonnull %6, i32 noundef %83, i32 noundef %84, ptr noundef nonnull %8)
  call void @llvm.lifetime.end.p0(i64 1212, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 1212, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #3
  ret void
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

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 = { 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 #3 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}


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