; LLVM IR from reyadussalahin/problem-solving :: dynamic_programming/non_classical/codeforces/F1353F (Solution)

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

@a = external dso_local global [128 x [128 x i64]], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [129 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z7getCostx(i64 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

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

13:                                               ; preds = %99, %0
  %14 = load i32, ptr %3, align 4, !tbaa !5
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = icmp slt i32 %14, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %102

18:                                               ; preds = %13
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %43, %18
  %21 = load i32, ptr %5, align 4, !tbaa !5
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %46

25:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %39, %25
  %27 = load i32, ptr %6, align 4, !tbaa !5
  %28 = load i32, ptr @m, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %42

31:                                               ; preds = %26
  %32 = load i32, ptr %5, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [128 x [128 x i64]], ptr @a, i64 0, i64 %33
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [128 x i64], ptr %34, i64 0, i64 %36
  %38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %37)
  br label %39

39:                                               ; preds = %31
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %6, align 4, !tbaa !5
  br label %26, !llvm.loop !9

42:                                               ; preds = %30
  br label %43

43:                                               ; preds = %42
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %5, align 4, !tbaa !5
  br label %20, !llvm.loop !11

46:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 1000000000000000000, ptr %7, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %87, %46
  %48 = load i32, ptr %8, align 4, !tbaa !5
  %49 = load i32, ptr @n, align 4, !tbaa !5
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %90

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

53:                                               ; preds = %83, %52
  %54 = load i32, ptr %9, align 4, !tbaa !5
  %55 = load i32, ptr @m, align 4, !tbaa !5
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %53
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %86

58:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %59 = load i32, ptr %8, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [128 x [128 x i64]], ptr @a, i64 0, i64 %60
  %62 = load i32, ptr %9, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [128 x i64], ptr %61, i64 0, i64 %63
  %65 = load i64, ptr %64, align 8, !tbaa !12
  %66 = load i32, ptr %8, align 4, !tbaa !5
  %67 = load i32, ptr %9, align 4, !tbaa !5
  %68 = add nsw i32 %66, %67
  %69 = sext i32 %68 to i64
  %70 = sub nsw i64 %65, %69
  store i64 %70, ptr %10, align 8, !tbaa !12
  %71 = load i64, ptr @a, align 16, !tbaa !12
  %72 = load i64, ptr %10, align 8, !tbaa !12
  %73 = icmp slt i64 %71, %72
  br i1 %73, label %74, label %75

74:                                               ; preds = %58
  store i32 16, ptr %4, align 4
  br label %80

75:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %76 = load i64, ptr %10, align 8, !tbaa !12
  %77 = call noundef i64 @_Z7getCostx(i64 noundef %76)
  store i64 %77, ptr %11, align 8, !tbaa !12
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %79 = load i64, ptr %78, align 8, !tbaa !12
  store i64 %79, ptr %7, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  store i32 0, ptr %4, align 4
  br label %80

80:                                               ; preds = %75, %74
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  %81 = load i32, ptr %4, align 4
  switch i32 %81, label %104 [
    i32 0, label %82
    i32 16, label %83
  ]

82:                                               ; preds = %80
  br label %83

83:                                               ; preds = %82, %80
  %84 = load i32, ptr %9, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %9, align 4, !tbaa !5
  br label %53, !llvm.loop !14

86:                                               ; preds = %57
  br label %87

87:                                               ; preds = %86
  %88 = load i32, ptr %8, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %8, align 4, !tbaa !5
  br label %47, !llvm.loop !15

90:                                               ; preds = %51
  %91 = load i64, ptr %7, align 8, !tbaa !12
  %92 = icmp ne i64 %91, 1000000000000000000
  br i1 %92, label %93, label %94

93:                                               ; preds = %90
  br label %96

94:                                               ; preds = %90
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.4, i32 noundef 109, ptr noundef @__PRETTY_FUNCTION__.main) #7
  unreachable

95:                                               ; No predecessors!
  br label %96

96:                                               ; preds = %95, %93
  %97 = load i64, ptr %7, align 8, !tbaa !12
  %98 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i64 noundef %97)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %99

99:                                               ; preds = %96
  %100 = load i32, ptr %3, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %3, align 4, !tbaa !5
  br label %13, !llvm.loop !16

102:                                              ; preds = %17
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %103 = load i32, ptr %1, align 4
  ret i32 %103

104:                                              ; preds = %80
  unreachable
}

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #5

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

attributes #0 = { mustprogress 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 = { inlinehint mustprogress 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 #3 = { mustprogress norecurse 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 #4 = { "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 #5 = { noreturn 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 #6 = { nounwind }
attributes #7 = { noreturn 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++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !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"

@a = external dso_local global [128 x [128 x i64]], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [129 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z7getCostx(i64 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph36, label %._crit_edge37

._crit_edge37:                                    ; preds = %56, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

.lr.ph36:                                         ; preds = %0, %56
  %.02234 = phi i32 [ %58, %56 ], [ 0, %0 ]
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.preheader25.lr.ph, label %._crit_edge28.thread54

._crit_edge28.thread54:                           ; preds = %.lr.ph36
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  store i64 1000000000000000000, ptr %2, align 8, !tbaa !9
  br label %._crit_edge33.thread

.preheader25.lr.ph:                               ; preds = %.lr.ph36
  %10 = load i32, ptr @m, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.preheader25, label %.preheader.lr.ph.thread

.preheader.lr.ph.thread:                          ; preds = %.preheader25.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  store i64 1000000000000000000, ptr %2, align 8, !tbaa !9
  br label %._crit_edge33.thread

.preheader25:                                     ; preds = %.preheader25.lr.ph, %._crit_edge
  %12 = phi i32 [ %17, %._crit_edge ], [ %8, %.preheader25.lr.ph ]
  %13 = phi i32 [ %18, %._crit_edge ], [ %10, %.preheader25.lr.ph ]
  %indvars.iv41 = phi i64 [ %indvars.iv.next42, %._crit_edge ], [ 0, %.preheader25.lr.ph ]
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

._crit_edge28:                                    ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  store i64 1000000000000000000, ptr %2, align 8, !tbaa !9
  %15 = icmp sgt i32 %17, 0
  %.pr = load i32, ptr @m, align 4
  %16 = icmp sgt i32 %.pr, 0
  %or.cond = select i1 %15, i1 %16, i1 false
  br i1 %or.cond, label %.preheader, label %._crit_edge33.thread

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

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader25
  %17 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %12, %.preheader25 ]
  %18 = phi i32 [ %23, %._crit_edge.loopexit ], [ %13, %.preheader25 ]
  %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
  %19 = sext i32 %17 to i64
  %20 = icmp slt i64 %indvars.iv.next42, %19
  br i1 %20, label %.preheader25, label %._crit_edge28, !llvm.loop !11

.lr.ph:                                           ; preds = %.preheader25, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader25 ]
  %21 = getelementptr inbounds [128 x [128 x i64]], ptr @a, i64 0, i64 %indvars.iv41, i64 %indvars.iv
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %21)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %23 = load i32, ptr @m, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = icmp slt i64 %indvars.iv.next, %24
  br i1 %25, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !14

.preheader:                                       ; preds = %._crit_edge28, %._crit_edge31
  %26 = phi i64 [ %31, %._crit_edge31 ], [ 1000000000000000000, %._crit_edge28 ]
  %27 = phi i32 [ %32, %._crit_edge31 ], [ %17, %._crit_edge28 ]
  %28 = phi i32 [ %33, %._crit_edge31 ], [ %.pr, %._crit_edge28 ]
  %29 = phi i32 [ %34, %._crit_edge31 ], [ %.pr, %._crit_edge28 ]
  %indvars.iv47 = phi i64 [ %indvars.iv.next48, %._crit_edge31 ], [ 0, %._crit_edge28 ]
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph30, label %._crit_edge31

.lr.ph30:                                         ; preds = %.preheader
  %.pre51 = load i64, ptr @a, align 16, !tbaa !9
  br label %37

._crit_edge33:                                    ; preds = %._crit_edge31
  %.not = icmp eq i64 %31, 1000000000000000000
  br i1 %.not, label %._crit_edge33.thread, label %56

._crit_edge31.loopexit:                           ; preds = %50
  %.pre53 = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge31

._crit_edge31:                                    ; preds = %._crit_edge31.loopexit, %.preheader
  %31 = phi i64 [ %51, %._crit_edge31.loopexit ], [ %26, %.preheader ]
  %32 = phi i32 [ %.pre53, %._crit_edge31.loopexit ], [ %27, %.preheader ]
  %33 = phi i32 [ %52, %._crit_edge31.loopexit ], [ %28, %.preheader ]
  %34 = phi i32 [ %52, %._crit_edge31.loopexit ], [ %29, %.preheader ]
  %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
  %35 = sext i32 %32 to i64
  %36 = icmp slt i64 %indvars.iv.next48, %35
  br i1 %36, label %.preheader, label %._crit_edge33, !llvm.loop !15

37:                                               ; preds = %.lr.ph30, %50
  %38 = phi i64 [ %26, %.lr.ph30 ], [ %51, %50 ]
  %39 = phi i32 [ %28, %.lr.ph30 ], [ %52, %50 ]
  %40 = phi i64 [ %.pre51, %.lr.ph30 ], [ %53, %50 ]
  %indvars.iv44 = phi i64 [ 0, %.lr.ph30 ], [ %indvars.iv.next45, %50 ]
  %41 = getelementptr inbounds [128 x [128 x i64]], ptr @a, i64 0, i64 %indvars.iv47, i64 %indvars.iv44
  %42 = load i64, ptr %41, align 8, !tbaa !9
  %43 = add nuw nsw i64 %indvars.iv44, %indvars.iv47
  %44 = sub nsw i64 %42, %43
  %45 = icmp slt i64 %40, %44
  br i1 %45, label %50, label %46

46:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %47 = call noundef i64 @_Z7getCostx(i64 noundef %44)
  store i64 %47, ptr %3, align 8, !tbaa !9
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %49 = load i64, ptr %48, align 8, !tbaa !9
  store i64 %49, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  %.pre50 = load i64, ptr @a, align 16, !tbaa !9
  %.pre52 = load i32, ptr @m, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %37, %46
  %51 = phi i64 [ %38, %37 ], [ %49, %46 ]
  %52 = phi i32 [ %39, %37 ], [ %.pre52, %46 ]
  %53 = phi i64 [ %40, %37 ], [ %.pre50, %46 ]
  %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
  %54 = sext i32 %52 to i64
  %55 = icmp slt i64 %indvars.iv.next45, %54
  br i1 %55, label %37, label %._crit_edge31.loopexit, !llvm.loop !16

._crit_edge33.thread:                             ; preds = %._crit_edge28, %._crit_edge33, %.preheader.lr.ph.thread, %._crit_edge28.thread54
  call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, i32 noundef 109, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7
  unreachable

56:                                               ; preds = %._crit_edge33
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %31)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %58 = add nuw nsw i32 %.02234, 1
  %59 = load i32, ptr %1, align 4, !tbaa !5
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %.lr.ph36, label %._crit_edge37, !llvm.loop !17
}

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

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

attributes #0 = { mustprogress 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 = { inlinehint mustprogress 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 #3 = { mustprogress norecurse 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 #4 = { 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 #5 = { noreturn 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 #6 = { nounwind }
attributes #7 = { noreturn 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12, !13}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12, !13}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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