; LLVM IR from lzyrapx/Competitive-Programming :: 百度之星/百度之星2017-资格赛 (03（背包dp）)

; 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 [100005 x i32], align 16
@b = external dso_local global [100005 x i32], align 16
@c = external dso_local global [100005 x i32], align 16
@d = external dso_local global [100005 x i32], align 16
@dp = external dso_local global [12 x [1234 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 [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z6getmaxxx(i64 noundef, i64 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z6getminxx(i64 noundef, i64 noundef) #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 i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  br label %11

11:                                               ; preds = %170, %0
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  %13 = xor i32 %12, -1
  %14 = icmp ne i32 %13, 0
  br i1 %14, label %15, label %171

15:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %29, %15
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = icmp sle i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %32

21:                                               ; preds = %16
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %23
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %26
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %24, ptr noundef %27)
  br label %29

29:                                               ; preds = %21
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %2, align 4, !tbaa !5
  br label %16, !llvm.loop !9

32:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %46, %32
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = load i32, ptr @m, align 4, !tbaa !5
  %36 = icmp sle i32 %34, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %49

38:                                               ; preds = %33
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [100005 x i32], ptr @c, i64 0, i64 %40
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [100005 x i32], ptr @d, i64 0, i64 %43
  %45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %41, ptr noundef %44)
  br label %46

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

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

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

53:                                               ; preds = %50
  store i32 10, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %135

54:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %66, %54
  %56 = load i32, ptr %6, align 4, !tbaa !5
  %57 = icmp sle i32 %56, 1000
  br i1 %57, label %59, label %58

58:                                               ; preds = %55
  store i32 13, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %69

59:                                               ; preds = %55
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [12 x [1234 x i64]], ptr @dp, i64 0, i64 %61
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [1234 x i64], ptr %62, i64 0, i64 %64
  store i64 100000000000000000, ptr %65, align 8, !tbaa !12
  br label %66

66:                                               ; preds = %59
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %6, align 4, !tbaa !5
  br label %55, !llvm.loop !14

69:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %128, %69
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = icmp sle i32 %71, 1000
  br i1 %72, label %74, label %73

73:                                               ; preds = %70
  store i32 16, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %131

74:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %124, %74
  %76 = load i32, ptr %8, align 4, !tbaa !5
  %77 = load i32, ptr @m, align 4, !tbaa !5
  %78 = icmp sle i32 %76, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %75
  store i32 19, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %127

80:                                               ; preds = %75
  %81 = load i32, ptr %8, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [100005 x i32], ptr @d, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = icmp sgt i32 %84, %85
  br i1 %86, label %87, label %123

87:                                               ; preds = %80
  %88 = load i32, ptr %4, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [12 x [1234 x i64]], ptr @dp, i64 0, i64 %89
  %91 = load i32, ptr %7, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [1234 x i64], ptr %90, i64 0, i64 %92
  %94 = load i64, ptr %93, align 8, !tbaa !12
  %95 = load i32, ptr %4, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [12 x [1234 x i64]], ptr @dp, i64 0, i64 %96
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = load i32, ptr %8, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [100005 x i32], ptr @d, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = sub nsw i32 %98, %102
  %104 = load i32, ptr %4, align 4, !tbaa !5
  %105 = add nsw i32 %103, %104
  %106 = sext i32 %105 to i64
  %107 = call noundef i64 @_Z6getmaxxx(i64 noundef 0, i64 noundef %106)
  %108 = getelementptr inbounds [1234 x i64], ptr %97, i64 0, i64 %107
  %109 = load i64, ptr %108, align 8, !tbaa !12
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [100005 x i32], ptr @c, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = add nsw i64 %109, %114
  %116 = call noundef i64 @_Z6getminxx(i64 noundef %94, i64 noundef %115)
  %117 = load i32, ptr %4, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [12 x [1234 x i64]], ptr @dp, i64 0, i64 %118
  %120 = load i32, ptr %7, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [1234 x i64], ptr %119, i64 0, i64 %121
  store i64 %116, ptr %122, align 8, !tbaa !12
  br label %123

123:                                              ; preds = %87, %80
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %8, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %8, align 4, !tbaa !5
  br label %75, !llvm.loop !15

127:                                              ; preds = %79
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %7, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %7, align 4, !tbaa !5
  br label %70, !llvm.loop !16

131:                                              ; preds = %73
  br label %132

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

135:                                              ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store i64 0, ptr %9, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %136

136:                                              ; preds = %159, %135
  %137 = load i32, ptr %10, align 4, !tbaa !5
  %138 = load i32, ptr @n, align 4, !tbaa !5
  %139 = icmp sle i32 %137, %138
  br i1 %139, label %141, label %140

140:                                              ; preds = %136
  store i32 22, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %162

141:                                              ; preds = %136
  %142 = load i32, ptr %10, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [12 x [1234 x i64]], ptr @dp, i64 0, i64 %146
  %148 = load i32, ptr %10, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [1234 x i64], ptr %147, i64 0, i64 %152
  %154 = load i64, ptr %153, align 8, !tbaa !12
  %155 = load i64, ptr %9, align 8, !tbaa !12
  %156 = add nsw i64 %155, %154
  store i64 %156, ptr %9, align 8, !tbaa !12
  %157 = load i64, ptr %9, align 8, !tbaa !12
  %158 = call noundef i64 @_Z6getminxx(i64 noundef %157, i64 noundef 100000000000000000)
  store i64 %158, ptr %9, align 8, !tbaa !12
  br label %159

159:                                              ; preds = %141
  %160 = load i32, ptr %10, align 4, !tbaa !5
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %10, align 4, !tbaa !5
  br label %136, !llvm.loop !18

162:                                              ; preds = %140
  %163 = load i64, ptr %9, align 8, !tbaa !12
  %164 = icmp eq i64 %163, 100000000000000000
  br i1 %164, label %165, label %167

165:                                              ; preds = %162
  %166 = call i32 @puts(ptr noundef @.str.1)
  br label %170

167:                                              ; preds = %162
  %168 = load i64, ptr %9, align 8, !tbaa !12
  %169 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %168)
  br label %170

170:                                              ; preds = %167, %165
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %11, !llvm.loop !19

171:                                              ; preds = %11
  ret i32 0
}

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

declare i32 @puts(ptr noundef) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = 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}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !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 [100005 x i32], align 16
@b = external dso_local global [100005 x i32], align 16
@c = external dso_local global [100005 x i32], align 16
@d = external dso_local global [100005 x i32], align 16
@dp = external dso_local local_unnamed_addr global [12 x [1234 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 [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z6getmaxxx(i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z6getminxx(i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %.not71 = icmp eq i32 %1, -1
  br i1 %.not71, label %._crit_edge72, label %.preheader54

.preheader54:                                     ; preds = %0, %71
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %.not4555 = icmp slt i32 %2, 1
  br i1 %.not4555, label %.preheader53, label %.lr.ph

.preheader53:                                     ; preds = %.lr.ph, %.preheader54
  %3 = load i32, ptr @m, align 4, !tbaa !5
  %.not4657 = icmp slt i32 %3, 1
  br i1 %.not4657, label %vector.ph.preheader, label %.lr.ph59

.lr.ph:                                           ; preds = %.preheader54, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.preheader54 ]
  %4 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %indvars.iv
  %5 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %indvars.iv
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = sext i32 %7 to i64
  %.not45.not = icmp slt i64 %indvars.iv, %8
  br i1 %.not45.not, label %.lr.ph, label %.preheader53, !llvm.loop !9

.lr.ph59:                                         ; preds = %.preheader53, %.lr.ph59
  %indvars.iv75 = phi i64 [ %indvars.iv.next76, %.lr.ph59 ], [ 1, %.preheader53 ]
  %9 = getelementptr inbounds [100005 x i32], ptr @c, i64 0, i64 %indvars.iv75
  %10 = getelementptr inbounds [100005 x i32], ptr @d, i64 0, i64 %indvars.iv75
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %9, ptr noundef nonnull %10)
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %12 = load i32, ptr @m, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %.not46.not = icmp slt i64 %indvars.iv75, %13
  br i1 %.not46.not, label %.lr.ph59, label %vector.ph.preheader, !llvm.loop !11

vector.ph.preheader:                              ; preds = %.lr.ph59, %.preheader53
  %.ph106 = phi i32 [ %3, %.preheader53 ], [ %12, %.lr.ph59 ]
  br label %vector.ph

.preheader51:                                     ; preds = %.split.us
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %.not4766 = icmp slt i32 %14, 1
  br i1 %.not4766, label %._crit_edge70.thread, label %.lr.ph69

vector.ph:                                        ; preds = %vector.ph.preheader, %.split.us
  %15 = phi i32 [ %29, %.split.us ], [ %.ph106, %vector.ph.preheader ]
  %16 = phi i32 [ %30, %.split.us ], [ %.ph106, %vector.ph.preheader ]
  %17 = phi i32 [ %31, %.split.us ], [ %.ph106, %vector.ph.preheader ]
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %.split.us ], [ 0, %vector.ph.preheader ]
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next.1, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %18 = getelementptr inbounds [12 x [1234 x i64]], ptr @dp, i64 0, i64 %indvars.iv88, i64 %offset.idx
  %19 = getelementptr inbounds i8, ptr %18, i64 16
  store <2 x i64> <i64 100000000000000000, i64 100000000000000000>, ptr %18, align 8, !tbaa !12
  store <2 x i64> <i64 100000000000000000, i64 100000000000000000>, ptr %19, align 8, !tbaa !12
  %offset.idx.1 = or disjoint i64 %index, 5
  %20 = getelementptr inbounds [12 x [1234 x i64]], ptr @dp, i64 0, i64 %indvars.iv88, i64 %offset.idx.1
  %21 = getelementptr inbounds i8, ptr %20, i64 16
  store <2 x i64> <i64 100000000000000000, i64 100000000000000000>, ptr %20, align 8, !tbaa !12
  store <2 x i64> <i64 100000000000000000, i64 100000000000000000>, ptr %21, align 8, !tbaa !12
  %index.next.1 = add nuw nsw i64 %index, 8
  %22 = icmp eq i64 %index.next.1, 1000
  br i1 %22, label %.preheader49, label %vector.body, !llvm.loop !14

.preheader49:                                     ; preds = %vector.body
  %23 = icmp slt i32 %17, 1
  br i1 %23, label %.split.us, label %.preheader

.preheader:                                       ; preds = %.preheader49, %._crit_edge
  %24 = phi i32 [ %32, %._crit_edge ], [ %15, %.preheader49 ]
  %25 = phi i32 [ %33, %._crit_edge ], [ %16, %.preheader49 ]
  %indvars.iv84 = phi i64 [ %indvars.iv.next85, %._crit_edge ], [ 1, %.preheader49 ]
  %.not4861 = icmp slt i32 %25, 1
  br i1 %.not4861, label %._crit_edge, label %.lr.ph63

.lr.ph63:                                         ; preds = %.preheader
  %26 = getelementptr inbounds [12 x [1234 x i64]], ptr @dp, i64 0, i64 %indvars.iv88, i64 %indvars.iv84
  %27 = add nuw nsw i64 %indvars.iv84, %indvars.iv88
  %28 = trunc nuw nsw i64 %27 to i32
  br label %34

.split.us:                                        ; preds = %._crit_edge, %.preheader49
  %29 = phi i32 [ %15, %.preheader49 ], [ %32, %._crit_edge ]
  %30 = phi i32 [ %16, %.preheader49 ], [ %33, %._crit_edge ]
  %31 = phi i32 [ %17, %.preheader49 ], [ %33, %._crit_edge ]
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond91.not = icmp eq i64 %indvars.iv.next89, 11
  br i1 %exitcond91.not, label %.preheader51, label %vector.ph, !llvm.loop !17

._crit_edge:                                      ; preds = %52, %.preheader
  %32 = phi i32 [ %24, %.preheader ], [ %53, %52 ]
  %33 = phi i32 [ %25, %.preheader ], [ %53, %52 ]
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  %exitcond87.not = icmp eq i64 %indvars.iv.next85, 1001
  br i1 %exitcond87.not, label %.split.us, label %.preheader, !llvm.loop !18

34:                                               ; preds = %.lr.ph63, %52
  %35 = phi i32 [ %24, %.lr.ph63 ], [ %53, %52 ]
  %indvars.iv81 = phi i64 [ 1, %.lr.ph63 ], [ %indvars.iv.next82, %52 ]
  %36 = getelementptr inbounds [100005 x i32], ptr @d, i64 0, i64 %indvars.iv81
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = icmp slt i64 %indvars.iv88, %38
  br i1 %39, label %40, label %52

40:                                               ; preds = %34
  %41 = load i64, ptr %26, align 8, !tbaa !12
  %42 = sub i32 %28, %37
  %43 = sext i32 %42 to i64
  %44 = tail call noundef i64 @_Z6getmaxxx(i64 noundef 0, i64 noundef %43)
  %45 = getelementptr inbounds [12 x [1234 x i64]], ptr @dp, i64 0, i64 %indvars.iv88, i64 %44
  %46 = load i64, ptr %45, align 8, !tbaa !12
  %47 = getelementptr inbounds [100005 x i32], ptr @c, i64 0, i64 %indvars.iv81
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = add nsw i64 %46, %49
  %51 = tail call noundef i64 @_Z6getminxx(i64 noundef %41, i64 noundef %50)
  store i64 %51, ptr %26, align 8, !tbaa !12
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %34, %40
  %53 = phi i32 [ %35, %34 ], [ %.pre, %40 ]
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %54 = sext i32 %53 to i64
  %.not48.not = icmp slt i64 %indvars.iv81, %54
  br i1 %.not48.not, label %34, label %._crit_edge, !llvm.loop !20

._crit_edge70:                                    ; preds = %.lr.ph69
  %55 = icmp eq i64 %65, 100000000000000000
  br i1 %55, label %68, label %._crit_edge70.thread

.lr.ph69:                                         ; preds = %.preheader51, %.lr.ph69
  %indvars.iv92 = phi i64 [ %indvars.iv.next93, %.lr.ph69 ], [ 1, %.preheader51 ]
  %.03767 = phi i64 [ %65, %.lr.ph69 ], [ 0, %.preheader51 ]
  %56 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %indvars.iv92
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %indvars.iv92
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [12 x [1234 x i64]], ptr @dp, i64 0, i64 %58, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !12
  %64 = add nsw i64 %63, %.03767
  %65 = tail call noundef i64 @_Z6getminxx(i64 noundef %64, i64 noundef 100000000000000000)
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %66 = load i32, ptr @n, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %.not47.not = icmp slt i64 %indvars.iv92, %67
  br i1 %.not47.not, label %.lr.ph69, label %._crit_edge70, !llvm.loop !21

68:                                               ; preds = %._crit_edge70
  %69 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %71

._crit_edge70.thread:                             ; preds = %.preheader51, %._crit_edge70
  %.037.lcssa96 = phi i64 [ %65, %._crit_edge70 ], [ 0, %.preheader51 ]
  %70 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %.037.lcssa96)
  br label %71

71:                                               ; preds = %._crit_edge70.thread, %68
  %72 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %.not = icmp eq i32 %72, -1
  br i1 %.not, label %._crit_edge72, label %.preheader54, !llvm.loop !22

._crit_edge72:                                    ; preds = %71, %0
  ret i32 0
}

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

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

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

attributes #0 = { 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 #1 = { mustprogress norecurse 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 #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" }

!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, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !19}
!19 = !{!"llvm.loop.unswitch.partial.disable"}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}


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