; LLVM IR from abeaumont/competitive-programming :: kattis/ecoins.ll (Z5solveRSt6vectorISt4pairIiiESaIS1_EEii)

; 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.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::pair" = type { i32, i32 }

@dp = external dso_local global [301 x [301 x i32]], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z5solveRSt6vectorISt4pairIiiESaIS1_EEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1, i32 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"struct.std::pair", align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %19

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

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

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

25:                                               ; preds = %37, %24
  %26 = load i32, ptr %9, align 4, !tbaa !9
  %27 = load i32, ptr %6, align 4, !tbaa !9
  %28 = icmp sle i32 %26, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %25
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %40

30:                                               ; preds = %25
  %31 = load i32, ptr %7, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [301 x [301 x i32]], ptr @dp, i64 0, i64 %32
  %34 = load i32, ptr %9, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [301 x i32], ptr %33, i64 0, i64 %35
  store i32 10000000, ptr %36, align 4, !tbaa !9
  br label %37

37:                                               ; preds = %30
  %38 = load i32, ptr %9, align 4, !tbaa !9
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %9, align 4, !tbaa !9
  br label %25, !llvm.loop !11

40:                                               ; preds = %29
  br label %41

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

44:                                               ; preds = %23
  store i32 0, ptr @dp, align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %45, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %46) #5
  %48 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %47, ptr %48, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %49) #5
  %51 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %50, ptr %51, align 8
  br label %52

52:                                               ; preds = %129, %44
  %53 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  br i1 %53, label %55, label %54

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

55:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %56 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %56, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EiiEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS4_(ptr noundef nonnull align 4 dereferenceable(8) %13) #5
  store ptr %57, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EiiEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS4_(ptr noundef nonnull align 4 dereferenceable(8) %13) #5
  store ptr %58, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %125, %55
  %60 = load i32, ptr %16, align 4, !tbaa !9
  %61 = load i32, ptr %5, align 4, !tbaa !9
  %62 = load ptr, ptr %14, align 8, !tbaa !5
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = sub nsw i32 %61, %63
  %65 = icmp sle i32 %60, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %59
  store i32 10, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %128

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

68:                                               ; preds = %121, %67
  %69 = load i32, ptr %17, align 4, !tbaa !9
  %70 = load i32, ptr %6, align 4, !tbaa !9
  %71 = load ptr, ptr %15, align 8, !tbaa !5
  %72 = load i32, ptr %71, align 4, !tbaa !9
  %73 = sub nsw i32 %70, %72
  %74 = icmp sle i32 %69, %73
  br i1 %74, label %76, label %75

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

76:                                               ; preds = %68
  %77 = load i32, ptr %16, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [301 x [301 x i32]], ptr @dp, i64 0, i64 %78
  %80 = load i32, ptr %17, align 4, !tbaa !9
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [301 x i32], ptr %79, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !9
  %84 = icmp slt i32 %83, 10000000
  br i1 %84, label %85, label %120

85:                                               ; preds = %76
  %86 = load i32, ptr %16, align 4, !tbaa !9
  %87 = load ptr, ptr %14, align 8, !tbaa !5
  %88 = load i32, ptr %87, align 4, !tbaa !9
  %89 = add nsw i32 %86, %88
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [301 x [301 x i32]], ptr @dp, i64 0, i64 %90
  %92 = load i32, ptr %17, align 4, !tbaa !9
  %93 = load ptr, ptr %15, align 8, !tbaa !5
  %94 = load i32, ptr %93, align 4, !tbaa !9
  %95 = add nsw i32 %92, %94
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [301 x i32], ptr %91, i64 0, i64 %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %98 = load i32, ptr %16, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [301 x [301 x i32]], ptr @dp, i64 0, i64 %99
  %101 = load i32, ptr %17, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [301 x i32], ptr %100, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !9
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %18, align 4, !tbaa !9
  %106 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %97, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %107 = load i32, ptr %106, align 4, !tbaa !9
  %108 = load i32, ptr %16, align 4, !tbaa !9
  %109 = load ptr, ptr %14, align 8, !tbaa !5
  %110 = load i32, ptr %109, align 4, !tbaa !9
  %111 = add nsw i32 %108, %110
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [301 x [301 x i32]], ptr @dp, i64 0, i64 %112
  %114 = load i32, ptr %17, align 4, !tbaa !9
  %115 = load ptr, ptr %15, align 8, !tbaa !5
  %116 = load i32, ptr %115, align 4, !tbaa !9
  %117 = add nsw i32 %114, %116
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [301 x i32], ptr %113, i64 0, i64 %118
  store i32 %107, ptr %119, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %120

120:                                              ; preds = %85, %76
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %17, align 4, !tbaa !9
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %17, align 4, !tbaa !9
  br label %68, !llvm.loop !14

124:                                              ; preds = %75
  br label %125

125:                                              ; preds = %124
  %126 = load i32, ptr %16, align 4, !tbaa !9
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %16, align 4, !tbaa !9
  br label %59, !llvm.loop !15

128:                                              ; preds = %66
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %129

129:                                              ; preds = %128
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  br label %52

131:                                              ; preds = %54
  %132 = load i32, ptr %5, align 4, !tbaa !9
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [301 x [301 x i32]], ptr @dp, i64 0, i64 %133
  %135 = load i32, ptr %6, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [301 x i32], ptr %134, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !9
  ret i32 %138
}

; 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 nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EiiEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS4_(ptr noundef nonnull align 4 dereferenceable(8)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EiiEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS4_(ptr noundef nonnull align 4 dereferenceable(8)) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

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 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 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


; 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.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::pair" = type { i32, i32 }

@dp = external dso_local global [301 x [301 x i32]], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_Z5solveRSt6vectorISt4pairIiiESaIS1_EEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca i32, align 4
  %8 = or i32 %1, %2
  %or.cond.not = icmp sgt i32 %8, -1
  br i1 %or.cond.not, label %.preheader39.preheader, label %._crit_edge44

.preheader39.preheader:                           ; preds = %3
  %9 = add nuw i32 %2, 1
  %10 = add nuw i32 %1, 1
  %wide.trip.count60 = zext i32 %10 to i64
  %wide.trip.count = zext i32 %9 to i64
  %min.iters.check = icmp ult i32 %2, 7
  %n.vec = and i64 %wide.trip.count, 4294967288
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br label %.preheader39

.preheader39:                                     ; preds = %.preheader39.preheader, %._crit_edge
  %indvars.iv57 = phi i64 [ 0, %.preheader39.preheader ], [ %indvars.iv.next58, %._crit_edge ]
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.body

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader39
  %indvars.iv.ph = phi i64 [ 0, %.preheader39 ], [ %n.vec, %middle.block ]
  br label %scalar.ph

vector.body:                                      ; preds = %.preheader39, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader39 ]
  %11 = getelementptr inbounds [301 x [301 x i32]], ptr @dp, i64 0, i64 %indvars.iv57, i64 %index
  %12 = getelementptr inbounds i8, ptr %11, i64 16
  store <4 x i32> <i32 10000000, i32 10000000, i32 10000000, i32 10000000>, ptr %11, align 4, !tbaa !5
  store <4 x i32> <i32 10000000, i32 10000000, i32 10000000, i32 10000000>, ptr %12, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %13 = icmp eq i64 %index.next, %n.vec
  br i1 %13, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

._crit_edge44:                                    ; preds = %._crit_edge, %3
  store i32 0, ptr @dp, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %14 = tail call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  store ptr %14, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %15 = tail call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  store ptr %15, ptr %5, align 8
  %16 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  br i1 %16, label %.lr.ph52, label %._crit_edge53

._crit_edge:                                      ; preds = %scalar.ph, %middle.block
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %exitcond61.not = icmp eq i64 %indvars.iv.next58, %wide.trip.count60
  br i1 %exitcond61.not, label %._crit_edge44, label %.preheader39, !llvm.loop !13

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %17 = getelementptr inbounds [301 x [301 x i32]], ptr @dp, i64 0, i64 %indvars.iv57, i64 %indvars.iv
  store i32 10000000, ptr %17, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %scalar.ph, !llvm.loop !14

._crit_edge53:                                    ; preds = %._crit_edge50, %._crit_edge44
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  %18 = sext i32 %1 to i64
  %19 = sext i32 %2 to i64
  %20 = getelementptr inbounds [301 x [301 x i32]], ptr @dp, i64 0, i64 %18, i64 %19
  %21 = load i32, ptr %20, align 4, !tbaa !5
  ret i32 %21

.lr.ph52:                                         ; preds = %._crit_edge44, %._crit_edge50
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  %22 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %23 = load i64, ptr %22, align 4
  store i64 %23, ptr %6, align 8
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EiiEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS4_(ptr noundef nonnull align 4 dereferenceable(8) %6) #3
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EiiEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS4_(ptr noundef nonnull align 4 dereferenceable(8) %6) #3
  %26 = load i32, ptr %24, align 4, !tbaa !5
  %.not3648 = icmp sgt i32 %26, %1
  %27 = load i32, ptr %25, align 4
  %28 = icmp sgt i32 %27, %2
  %or.cond70 = select i1 %.not3648, i1 true, i1 %28
  br i1 %or.cond70, label %._crit_edge50, label %.preheader

.preheader:                                       ; preds = %.lr.ph52, %._crit_edge47
  %29 = phi i32 [ %35, %._crit_edge47 ], [ %26, %.lr.ph52 ]
  %30 = phi i32 [ %36, %._crit_edge47 ], [ %27, %.lr.ph52 ]
  %31 = phi i32 [ %37, %._crit_edge47 ], [ %27, %.lr.ph52 ]
  %indvars.iv65 = phi i64 [ %indvars.iv.next66, %._crit_edge47 ], [ 0, %.lr.ph52 ]
  %.not3745 = icmp sgt i32 %31, %2
  br i1 %.not3745, label %._crit_edge47, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %32 = trunc nuw nsw i64 %indvars.iv65 to i32
  br label %40

._crit_edge50:                                    ; preds = %._crit_edge47, %.lr.ph52
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %34 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  br i1 %34, label %.lr.ph52, label %._crit_edge53

._crit_edge47.loopexit:                           ; preds = %64
  %.pre68 = load i32, ptr %24, align 4, !tbaa !5
  br label %._crit_edge47

._crit_edge47:                                    ; preds = %._crit_edge47.loopexit, %.preheader
  %35 = phi i32 [ %.pre68, %._crit_edge47.loopexit ], [ %29, %.preheader ]
  %36 = phi i32 [ %65, %._crit_edge47.loopexit ], [ %30, %.preheader ]
  %37 = phi i32 [ %65, %._crit_edge47.loopexit ], [ %31, %.preheader ]
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %38 = sub nsw i32 %1, %35
  %39 = sext i32 %38 to i64
  %.not36.not = icmp slt i64 %indvars.iv65, %39
  br i1 %.not36.not, label %.preheader, label %._crit_edge50, !llvm.loop !15

40:                                               ; preds = %.lr.ph, %64
  %41 = phi i32 [ %30, %.lr.ph ], [ %65, %64 ]
  %indvars.iv62 = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next63, %64 ]
  %42 = phi i32 [ %31, %.lr.ph ], [ %65, %64 ]
  %43 = getelementptr inbounds [301 x [301 x i32]], ptr @dp, i64 0, i64 %indvars.iv65, i64 %indvars.iv62
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = icmp slt i32 %44, 10000000
  br i1 %45, label %46, label %64

46:                                               ; preds = %40
  %47 = load i32, ptr %24, align 4, !tbaa !5
  %48 = add nsw i32 %47, %32
  %49 = sext i32 %48 to i64
  %50 = trunc nuw nsw i64 %indvars.iv62 to i32
  %51 = add nsw i32 %42, %50
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [301 x [301 x i32]], ptr @dp, i64 0, i64 %49, i64 %52
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  %54 = add nsw i32 %44, 1
  store i32 %54, ptr %7, align 4, !tbaa !5
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %53, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = load i32, ptr %24, align 4, !tbaa !5
  %58 = add nsw i32 %57, %32
  %59 = sext i32 %58 to i64
  %60 = load i32, ptr %25, align 4, !tbaa !5
  %61 = add nsw i32 %60, %50
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [301 x [301 x i32]], ptr @dp, i64 0, i64 %59, i64 %62
  store i32 %56, ptr %63, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  %.pre = load i32, ptr %25, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %40, %46
  %65 = phi i32 [ %41, %40 ], [ %.pre, %46 ]
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %66 = sub nsw i32 %2, %65
  %67 = sext i32 %66 to i64
  %.not37.not = icmp slt i64 %indvars.iv62, %67
  br i1 %.not37.not, label %40, label %._crit_edge47.loopexit, !llvm.loop !17
}

; 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 nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EiiEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS4_(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EiiEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS4_(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 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 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 = { 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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10, !16}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
!17 = distinct !{!17, !10}


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