; LLVM IR from reyadussalahin/problem-solving :: dynamic_programming/non_classical/codeforces/F917B (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"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@g = external dso_local global [128 x %"class.std::vector"], align 16
@w = external dso_local global [128 x %"class.std::vector"], align 16
@dp = external dso_local global [128 x [128 x [32 x i32]]], align 16
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1

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

19:                                               ; preds = %40, %0
  %20 = load i32, ptr %7, align 4, !tbaa !5
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %43

24:                                               ; preds = %19
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef %4, ptr noundef %5, ptr noundef %6)
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = sub nsw i32 %26, 1
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [128 x %"class.std::vector"], ptr @g, i64 0, i64 %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %31 = sub nsw i32 %30, 1
  store i32 %31, ptr %8, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %29, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = sub nsw i32 %32, 1
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [128 x %"class.std::vector"], ptr @w, i64 0, i64 %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %36 = load i8, ptr %6, align 1, !tbaa !9
  %37 = sext i8 %36 to i32
  %38 = sub nsw i32 %37, 97
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %9, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %35, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %40

40:                                               ; preds = %24
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %7, align 4, !tbaa !5
  br label %19, !llvm.loop !10

43:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %76, %43
  %45 = load i32, ptr %10, align 4, !tbaa !5
  %46 = icmp slt i32 %45, 128
  br i1 %46, label %48, label %47

47:                                               ; preds = %44
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %79

48:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %72, %48
  %50 = load i32, ptr %12, align 4, !tbaa !5
  %51 = icmp slt i32 %50, 128
  br i1 %51, label %53, label %52

52:                                               ; preds = %49
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %75

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

54:                                               ; preds = %68, %53
  %55 = load i32, ptr %13, align 4, !tbaa !5
  %56 = icmp slt i32 %55, 32
  br i1 %56, label %58, label %57

57:                                               ; preds = %54
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %71

58:                                               ; preds = %54
  %59 = load i32, ptr %10, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [128 x [128 x [32 x i32]]], ptr @dp, i64 0, i64 %60
  %62 = load i32, ptr %12, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [128 x [32 x i32]], ptr %61, i64 0, i64 %63
  %65 = load i32, ptr %13, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [32 x i32], ptr %64, i64 0, i64 %66
  store i32 -1, ptr %67, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %58
  %69 = load i32, ptr %13, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %13, align 4, !tbaa !5
  br label %54, !llvm.loop !12

71:                                               ; preds = %57
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %12, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %12, align 4, !tbaa !5
  br label %49, !llvm.loop !13

75:                                               ; preds = %52
  br label %76

76:                                               ; preds = %75
  %77 = load i32, ptr %10, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %10, align 4, !tbaa !5
  br label %44, !llvm.loop !14

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

80:                                               ; preds = %99, %79
  %81 = load i32, ptr %14, align 4, !tbaa !5
  %82 = load i32, ptr %2, align 4, !tbaa !5
  %83 = icmp slt i32 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  store i32 14, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %102

85:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %95, %85
  %87 = load i32, ptr %15, align 4, !tbaa !5
  %88 = load i32, ptr %2, align 4, !tbaa !5
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %86
  store i32 17, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %98

91:                                               ; preds = %86
  %92 = load i32, ptr %14, align 4, !tbaa !5
  %93 = load i32, ptr %15, align 4, !tbaa !5
  %94 = call noundef i32 @_Z3dfsiii(i32 noundef %92, i32 noundef %93, i32 noundef 0)
  br label %95

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

98:                                               ; preds = %90
  br label %99

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

102:                                              ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %134, %102
  %104 = load i32, ptr %16, align 4, !tbaa !5
  %105 = load i32, ptr %2, align 4, !tbaa !5
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %108, label %107

107:                                              ; preds = %103
  store i32 20, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %137

108:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %129, %108
  %110 = load i32, ptr %17, align 4, !tbaa !5
  %111 = load i32, ptr %2, align 4, !tbaa !5
  %112 = icmp slt i32 %110, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %109
  store i32 23, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %132

114:                                              ; preds = %109
  %115 = load i32, ptr %16, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [128 x [128 x [32 x i32]]], ptr @dp, i64 0, i64 %116
  %118 = load i32, ptr %17, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [128 x [32 x i32]], ptr %117, i64 0, i64 %119
  %121 = getelementptr inbounds [32 x i32], ptr %120, i64 0, i64 0
  %122 = load i32, ptr %121, align 16, !tbaa !5
  %123 = icmp ne i32 %122, 0
  br i1 %123, label %124, label %126

124:                                              ; preds = %114
  %125 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %128

126:                                              ; preds = %114
  %127 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  br label %128

128:                                              ; preds = %126, %124
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %17, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %17, align 4, !tbaa !5
  br label %109, !llvm.loop !17

132:                                              ; preds = %113
  %133 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  br label %134

134:                                              ; preds = %132
  %135 = load i32, ptr %16, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %16, align 4, !tbaa !5
  br label %103, !llvm.loop !18

137:                                              ; preds = %107
  store i32 0, ptr %1, align 4
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %138 = load i32, ptr %1, align 4
  ret i32 %138
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

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

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 = { 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 #3 = { "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 = { 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@g = external dso_local global [128 x %"class.std::vector"], align 16
@w = external dso_local global [128 x %"class.std::vector"], align 16
@dp = external dso_local local_unnamed_addr global [128 x [128 x [32 x i32]]], align 16
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3dfsiii(i32 noundef, i32 noundef, 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: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #5
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %.preheader36

.preheader36:                                     ; preds = %.lr.ph, %0
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2097152) @dp, i8 -1, i64 2097152, i1 false), !tbaa !5
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.preheader32, label %._crit_edge48

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.03037 = phi i32 [ %27, %.lr.ph ], [ 0, %0 ]
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %14 = load i32, ptr %3, align 4, !tbaa !5
  %15 = add nsw i32 %14, -1
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [128 x %"class.std::vector"], ptr @g, i64 0, i64 %16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = add nsw i32 %18, -1
  store i32 %19, ptr %6, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = add nsw i32 %20, -1
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [128 x %"class.std::vector"], ptr @w, i64 0, i64 %22
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  %24 = load i8, ptr %5, align 1, !tbaa !9
  %25 = sext i8 %24 to i32
  %26 = add nsw i32 %25, -96
  store i32 %26, ptr %7, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  %27 = add nuw nsw i32 %.03037, 1
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %.lr.ph, label %.preheader36, !llvm.loop !10

.preheader32:                                     ; preds = %.preheader36, %._crit_edge
  %30 = phi i32 [ %33, %._crit_edge ], [ %11, %.preheader36 ]
  %.02643 = phi i32 [ %34, %._crit_edge ], [ 0, %.preheader36 ]
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %.lr.ph42, label %._crit_edge

.preheader31:                                     ; preds = %._crit_edge
  %32 = icmp sgt i32 %33, 0
  br i1 %32, label %.preheader, label %._crit_edge48

._crit_edge:                                      ; preds = %.lr.ph42, %.preheader32
  %33 = phi i32 [ %30, %.preheader32 ], [ %38, %.lr.ph42 ]
  %34 = add nuw nsw i32 %.02643, 1
  %35 = icmp slt i32 %34, %33
  br i1 %35, label %.preheader32, label %.preheader31, !llvm.loop !12

.lr.ph42:                                         ; preds = %.preheader32, %.lr.ph42
  %.02541 = phi i32 [ %37, %.lr.ph42 ], [ 0, %.preheader32 ]
  %36 = call noundef i32 @_Z3dfsiii(i32 noundef %.02643, i32 noundef %.02541, i32 noundef 0)
  %37 = add nuw nsw i32 %.02541, 1
  %38 = load i32, ptr %1, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %.lr.ph42, label %._crit_edge, !llvm.loop !14

.preheader:                                       ; preds = %.preheader31, %._crit_edge46
  %40 = phi i32 [ %43, %._crit_edge46 ], [ %33, %.preheader31 ]
  %indvars.iv57 = phi i64 [ %indvars.iv.next58, %._crit_edge46 ], [ 0, %.preheader31 ]
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %.lr.ph45, label %._crit_edge46

._crit_edge48:                                    ; preds = %._crit_edge46, %.preheader36, %.preheader31
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0

._crit_edge46:                                    ; preds = %.lr.ph45, %.preheader
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %43 = load i32, ptr %1, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = icmp slt i64 %indvars.iv.next58, %44
  br i1 %45, label %.preheader, label %._crit_edge48, !llvm.loop !15

.lr.ph45:                                         ; preds = %.preheader, %.lr.ph45
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph45 ], [ 0, %.preheader ]
  %46 = getelementptr inbounds [128 x [128 x [32 x i32]]], ptr @dp, i64 0, i64 %indvars.iv57, i64 %indvars.iv
  %47 = load i32, ptr %46, align 16, !tbaa !5
  %.not = icmp eq i32 %47, 0
  %.str.6..str.5 = select i1 %.not, ptr @.str.6, ptr @.str.5
  %48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.6..str.5)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %49 = load i32, ptr %1, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = icmp slt i64 %indvars.iv.next, %50
  br i1 %51, label %.lr.ph45, label %._crit_edge46, !llvm.loop !16
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { 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 #3 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11, !13}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}


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