; LLVM IR from smv1999/CompetitiveProgrammingQuestionBank :: Dynamic Programming (Matrix_chain_multiplication)

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

@st = external dso_local global [100 x [100 x i32]], align 16
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [22 x i8], align 1
@p = external dso_local global [100 x i32], align 16
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@mt = external dso_local global [100 x [100 x i32]], align 16
@.str.7 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [52 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @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 i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  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 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %9 = load i32, ptr %5, align 4, !tbaa !5
  %10 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %9)
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef %5)
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %24, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = load i32, ptr %5, align 4, !tbaa !5
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %16, label %27

16:                                               ; preds = %12
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %17)
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [100 x i32], ptr @p, i64 0, i64 %20
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef %21)
  %23 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  br label %24

24:                                               ; preds = %16
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !9

27:                                               ; preds = %12
  %28 = load i32, ptr %5, align 4, !tbaa !5
  %29 = sub nsw i32 %28, 1
  store i32 %29, ptr %6, align 4, !tbaa !5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %46, %27
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = icmp sle i32 %31, 4
  br i1 %32, label %33, label %49

33:                                               ; preds = %30
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100 x [100 x i32]], ptr @mt, i64 0, i64 %35
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100 x i32], ptr %36, i64 0, i64 %38
  store i32 0, ptr %39, align 4, !tbaa !5
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [100 x [100 x i32]], ptr @st, i64 0, i64 %41
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100 x i32], ptr %42, i64 0, i64 %44
  store i32 0, ptr %45, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %33
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %2, align 4, !tbaa !5
  br label %30, !llvm.loop !11

49:                                               ; preds = %30
  store i32 2, ptr %7, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %145, %49
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = icmp sle i32 %51, %52
  br i1 %53, label %54, label %148

54:                                               ; preds = %50
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %141, %54
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = load i32, ptr %6, align 4, !tbaa !5
  %58 = load i32, ptr %7, align 4, !tbaa !5
  %59 = sub nsw i32 %57, %58
  %60 = add nsw i32 %59, 1
  %61 = icmp sle i32 %56, %60
  br i1 %61, label %62, label %144

62:                                               ; preds = %55
  %63 = load i32, ptr %2, align 4, !tbaa !5
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = add nsw i32 %63, %64
  %66 = sub nsw i32 %65, 1
  store i32 %66, ptr %3, align 4, !tbaa !5
  %67 = load i32, ptr %2, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [100 x [100 x i32]], ptr @mt, i64 0, i64 %68
  %70 = load i32, ptr %3, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [100 x i32], ptr %69, i64 0, i64 %71
  store i32 1000000, ptr %72, align 4, !tbaa !5
  %73 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %73, ptr %4, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %137, %62
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = load i32, ptr %3, align 4, !tbaa !5
  %77 = sub nsw i32 %76, 1
  %78 = icmp sle i32 %75, %77
  br i1 %78, label %79, label %140

79:                                               ; preds = %74
  %80 = load i32, ptr %2, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [100 x [100 x i32]], ptr @mt, i64 0, i64 %81
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [100 x i32], ptr %82, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = load i32, ptr %4, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [100 x [100 x i32]], ptr @mt, i64 0, i64 %89
  %91 = load i32, ptr %3, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [100 x i32], ptr %90, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = add nsw i32 %86, %94
  %96 = load i32, ptr %2, align 4, !tbaa !5
  %97 = sub nsw i32 %96, 1
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [100 x i32], ptr @p, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = load i32, ptr %4, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [100 x i32], ptr @p, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = mul nsw i32 %100, %104
  %106 = load i32, ptr %3, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [100 x i32], ptr @p, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = mul nsw i32 %105, %109
  %111 = add nsw i32 %95, %110
  store i32 %111, ptr %8, align 4, !tbaa !5
  %112 = load i32, ptr %8, align 4, !tbaa !5
  %113 = load i32, ptr %2, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [100 x [100 x i32]], ptr @mt, i64 0, i64 %114
  %116 = load i32, ptr %3, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [100 x i32], ptr %115, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = icmp slt i32 %112, %119
  br i1 %120, label %121, label %136

121:                                              ; preds = %79
  %122 = load i32, ptr %8, align 4, !tbaa !5
  %123 = load i32, ptr %2, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [100 x [100 x i32]], ptr @mt, i64 0, i64 %124
  %126 = load i32, ptr %3, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [100 x i32], ptr %125, i64 0, i64 %127
  store i32 %122, ptr %128, align 4, !tbaa !5
  %129 = load i32, ptr %4, align 4, !tbaa !5
  %130 = load i32, ptr %2, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [100 x [100 x i32]], ptr @st, i64 0, i64 %131
  %133 = load i32, ptr %3, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [100 x i32], ptr %132, i64 0, i64 %134
  store i32 %129, ptr %135, align 4, !tbaa !5
  br label %136

136:                                              ; preds = %121, %79
  br label %137

137:                                              ; preds = %136
  %138 = load i32, ptr %4, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %4, align 4, !tbaa !5
  br label %74, !llvm.loop !12

140:                                              ; preds = %74
  br label %141

141:                                              ; preds = %140
  %142 = load i32, ptr %2, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %2, align 4, !tbaa !5
  br label %55, !llvm.loop !13

144:                                              ; preds = %55
  br label %145

145:                                              ; preds = %144
  %146 = load i32, ptr %7, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %7, align 4, !tbaa !5
  br label %50, !llvm.loop !14

148:                                              ; preds = %50
  %149 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %150

150:                                              ; preds = %171, %148
  %151 = load i32, ptr %2, align 4, !tbaa !5
  %152 = icmp sle i32 %151, 4
  br i1 %152, label %153, label %174

153:                                              ; preds = %150
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %154

154:                                              ; preds = %166, %153
  %155 = load i32, ptr %3, align 4, !tbaa !5
  %156 = icmp sle i32 %155, 4
  br i1 %156, label %157, label %169

157:                                              ; preds = %154
  %158 = load i32, ptr %2, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [100 x [100 x i32]], ptr @mt, i64 0, i64 %159
  %161 = load i32, ptr %3, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [100 x i32], ptr %160, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %164)
  br label %166

166:                                              ; preds = %157
  %167 = load i32, ptr %3, align 4, !tbaa !5
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %3, align 4, !tbaa !5
  br label %154, !llvm.loop !15

169:                                              ; preds = %154
  %170 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  br label %171

171:                                              ; preds = %169
  %172 = load i32, ptr %2, align 4, !tbaa !5
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %2, align 4, !tbaa !5
  br label %150, !llvm.loop !16

174:                                              ; preds = %150
  %175 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %176

176:                                              ; preds = %197, %174
  %177 = load i32, ptr %2, align 4, !tbaa !5
  %178 = icmp sle i32 %177, 4
  br i1 %178, label %179, label %200

179:                                              ; preds = %176
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %180

180:                                              ; preds = %192, %179
  %181 = load i32, ptr %3, align 4, !tbaa !5
  %182 = icmp sle i32 %181, 4
  br i1 %182, label %183, label %195

183:                                              ; preds = %180
  %184 = load i32, ptr %2, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [100 x [100 x i32]], ptr @st, i64 0, i64 %185
  %187 = load i32, ptr %3, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [100 x i32], ptr %186, i64 0, i64 %188
  %190 = load i32, ptr %189, align 4, !tbaa !5
  %191 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %190)
  br label %192

192:                                              ; preds = %183
  %193 = load i32, ptr %3, align 4, !tbaa !5
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %3, align 4, !tbaa !5
  br label %180, !llvm.loop !17

195:                                              ; preds = %180
  %196 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  br label %197

197:                                              ; preds = %195
  %198 = load i32, ptr %2, align 4, !tbaa !5
  %199 = add nsw i32 %198, 1
  store i32 %199, ptr %2, align 4, !tbaa !5
  br label %176, !llvm.loop !18

200:                                              ; preds = %176
  %201 = load i32, ptr %6, align 4, !tbaa !5
  call void @print_optimal(i32 noundef 1, i32 noundef %201)
  %202 = load i32, ptr %6, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [100 x i32], ptr getelementptr inbounds ([100 x [100 x i32]], ptr @mt, i64 0, i64 1), i64 0, i64 %203
  %205 = load i32, ptr %204, align 4, !tbaa !5
  %206 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i32 noundef %205)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, 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
  %207 = load i32, ptr %1, align 4
  ret i32 %207
}

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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}
!18 = distinct !{!18, !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"

@st = external dso_local local_unnamed_addr global [100 x [100 x i32]], align 16
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [22 x i8], align 1
@p = external dso_local global [100 x i32], align 16
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@mt = external dso_local local_unnamed_addr global [100 x [100 x i32]], align 16
@.str.7 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [52 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #3
  %2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef undef)
  %3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %1)
  %4 = load i32, ptr %1, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %6 = trunc nuw nsw i64 %indvars.iv to i32
  %7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %6)
  %8 = getelementptr inbounds [100 x i32], ptr @p, i64 0, i64 %indvars.iv
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %8)
  %10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = icmp slt i64 %indvars.iv.next, %12
  br i1 %13, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa = phi i32 [ %4, %0 ], [ %11, %.lr.ph ]
  store i32 0, ptr getelementptr inbounds (i8, ptr @mt, i64 404), align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @st, i64 404), align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @mt, i64 808), align 8, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @st, i64 808), align 8, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @mt, i64 1212), align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @st, i64 1212), align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @mt, i64 1616), align 16, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @st, i64 1616), align 16, !tbaa !5
  %.not.not79 = icmp sgt i32 %.lcssa, 2
  br i1 %.not.not79, label %.preheader66.preheader, label %._crit_edge81

.preheader66.preheader:                           ; preds = %._crit_edge
  %14 = zext nneg i32 %.lcssa to i64
  %wide.trip.count = zext nneg i32 %.lcssa to i64
  br label %.preheader66

.preheader66:                                     ; preds = %.preheader66.preheader, %._crit_edge78
  %indvars.iv99 = phi i64 [ 2, %.preheader66.preheader ], [ %indvars.iv.next100, %._crit_edge78 ]
  %.not75.not = icmp ult i64 %indvars.iv99, %14
  br i1 %.not75.not, label %.lr.ph73, label %._crit_edge78

.lr.ph73:                                         ; preds = %.preheader66, %._crit_edge74
  %indvars.iv101 = phi i64 [ %indvars.iv.next102, %._crit_edge74 ], [ %indvars.iv99, %.preheader66 ]
  %indvars.iv92 = phi i64 [ %indvars.iv.next93, %._crit_edge74 ], [ 1, %.preheader66 ]
  %15 = add nuw nsw i64 %indvars.iv92, %indvars.iv99
  %16 = add nsw i64 %15, -1
  %17 = getelementptr inbounds [100 x [100 x i32]], ptr @mt, i64 0, i64 %indvars.iv92, i64 %16
  store i32 1000000, ptr %17, align 4, !tbaa !5
  %18 = add nsw i64 %indvars.iv92, -1
  %19 = getelementptr inbounds [100 x i32], ptr @p, i64 0, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = getelementptr inbounds [100 x i32], ptr @p, i64 0, i64 %16
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %factor.op.mul = mul i32 %20, %22
  %23 = getelementptr inbounds [100 x [100 x i32]], ptr @st, i64 0, i64 %indvars.iv92, i64 %16
  br label %24

24:                                               ; preds = %.lr.ph73, %37
  %indvars.iv94 = phi i64 [ %indvars.iv92, %.lr.ph73 ], [ %indvars.iv.next95, %37 ]
  %25 = phi i32 [ 1000000, %.lr.ph73 ], [ %38, %37 ]
  %26 = getelementptr inbounds [100 x [100 x i32]], ptr @mt, i64 0, i64 %indvars.iv92, i64 %indvars.iv94
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %28 = getelementptr inbounds [100 x [100 x i32]], ptr @mt, i64 0, i64 %indvars.iv.next95, i64 %16
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = add nsw i32 %29, %27
  %31 = getelementptr inbounds [100 x i32], ptr @p, i64 0, i64 %indvars.iv94
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %.reass = mul i32 %32, %factor.op.mul
  %33 = add nsw i32 %30, %.reass
  %34 = icmp slt i32 %33, %25
  br i1 %34, label %35, label %37

35:                                               ; preds = %24
  store i32 %33, ptr %17, align 4, !tbaa !5
  %36 = trunc nuw nsw i64 %indvars.iv94 to i32
  store i32 %36, ptr %23, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %24, %35
  %38 = phi i32 [ %25, %24 ], [ %33, %35 ]
  %exitcond.not = icmp eq i64 %indvars.iv.next95, %indvars.iv101
  br i1 %exitcond.not, label %._crit_edge74, label %24, !llvm.loop !11

._crit_edge74:                                    ; preds = %37
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %exitcond107.not = icmp eq i64 %indvars.iv.next102, %wide.trip.count
  br i1 %exitcond107.not, label %._crit_edge78, label %.lr.ph73, !llvm.loop !12

._crit_edge78:                                    ; preds = %._crit_edge74, %.preheader66
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %exitcond109.not = icmp eq i64 %indvars.iv.next100, %wide.trip.count
  br i1 %exitcond109.not, label %._crit_edge81, label %.preheader66, !llvm.loop !13

._crit_edge81:                                    ; preds = %._crit_edge78, %._crit_edge
  %39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  %40 = load i32, ptr getelementptr inbounds (i8, ptr @mt, i64 404), align 4, !tbaa !5
  %41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %40)
  %42 = load i32, ptr getelementptr inbounds (i8, ptr @mt, i64 408), align 8, !tbaa !5
  %43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %42)
  %44 = load i32, ptr getelementptr inbounds (i8, ptr @mt, i64 412), align 4, !tbaa !5
  %45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %44)
  %46 = load i32, ptr getelementptr inbounds (i8, ptr @mt, i64 416), align 16, !tbaa !5
  %47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %46)
  %48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %49 = load i32, ptr getelementptr inbounds (i8, ptr @mt, i64 804), align 4, !tbaa !5
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %49)
  %51 = load i32, ptr getelementptr inbounds (i8, ptr @mt, i64 808), align 8, !tbaa !5
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %51)
  %53 = load i32, ptr getelementptr inbounds (i8, ptr @mt, i64 812), align 4, !tbaa !5
  %54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %53)
  %55 = load i32, ptr getelementptr inbounds (i8, ptr @mt, i64 816), align 16, !tbaa !5
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %55)
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %58 = load i32, ptr getelementptr inbounds (i8, ptr @mt, i64 1204), align 4, !tbaa !5
  %59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %58)
  %60 = load i32, ptr getelementptr inbounds (i8, ptr @mt, i64 1208), align 8, !tbaa !5
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %60)
  %62 = load i32, ptr getelementptr inbounds (i8, ptr @mt, i64 1212), align 4, !tbaa !5
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %62)
  %64 = load i32, ptr getelementptr inbounds (i8, ptr @mt, i64 1216), align 16, !tbaa !5
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %64)
  %66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %67 = load i32, ptr getelementptr inbounds (i8, ptr @mt, i64 1604), align 4, !tbaa !5
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %67)
  %69 = load i32, ptr getelementptr inbounds (i8, ptr @mt, i64 1608), align 8, !tbaa !5
  %70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %69)
  %71 = load i32, ptr getelementptr inbounds (i8, ptr @mt, i64 1612), align 4, !tbaa !5
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %71)
  %73 = load i32, ptr getelementptr inbounds (i8, ptr @mt, i64 1616), align 16, !tbaa !5
  %74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %73)
  %75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  %77 = load i32, ptr getelementptr inbounds (i8, ptr @st, i64 404), align 4, !tbaa !5
  %78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %77)
  %79 = load i32, ptr getelementptr inbounds (i8, ptr @st, i64 408), align 8, !tbaa !5
  %80 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %79)
  %81 = load i32, ptr getelementptr inbounds (i8, ptr @st, i64 412), align 4, !tbaa !5
  %82 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %81)
  %83 = load i32, ptr getelementptr inbounds (i8, ptr @st, i64 416), align 16, !tbaa !5
  %84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %83)
  %85 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %86 = load i32, ptr getelementptr inbounds (i8, ptr @st, i64 804), align 4, !tbaa !5
  %87 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %86)
  %88 = load i32, ptr getelementptr inbounds (i8, ptr @st, i64 808), align 8, !tbaa !5
  %89 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %88)
  %90 = load i32, ptr getelementptr inbounds (i8, ptr @st, i64 812), align 4, !tbaa !5
  %91 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %90)
  %92 = load i32, ptr getelementptr inbounds (i8, ptr @st, i64 816), align 16, !tbaa !5
  %93 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %92)
  %94 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %95 = load i32, ptr getelementptr inbounds (i8, ptr @st, i64 1204), align 4, !tbaa !5
  %96 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %95)
  %97 = load i32, ptr getelementptr inbounds (i8, ptr @st, i64 1208), align 8, !tbaa !5
  %98 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %97)
  %99 = load i32, ptr getelementptr inbounds (i8, ptr @st, i64 1212), align 4, !tbaa !5
  %100 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %99)
  %101 = load i32, ptr getelementptr inbounds (i8, ptr @st, i64 1216), align 16, !tbaa !5
  %102 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %101)
  %103 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %104 = load i32, ptr getelementptr inbounds (i8, ptr @st, i64 1604), align 4, !tbaa !5
  %105 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %104)
  %106 = load i32, ptr getelementptr inbounds (i8, ptr @st, i64 1608), align 8, !tbaa !5
  %107 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %106)
  %108 = load i32, ptr getelementptr inbounds (i8, ptr @st, i64 1612), align 4, !tbaa !5
  %109 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %108)
  %110 = load i32, ptr getelementptr inbounds (i8, ptr @st, i64 1616), align 16, !tbaa !5
  %111 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %110)
  %112 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %113 = add nsw i32 %.lcssa, -1
  call void @print_optimal(i32 noundef 1, i32 noundef %113)
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [100 x i32], ptr getelementptr inbounds (i8, ptr @mt, i64 400), i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef %116)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #3
  ret i32 0
}

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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}


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