; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2007-08/bales.ll (Z7processii)

; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::pair.11" = type { i32, i32 }

@bad = external dso_local global %"class.std::map", align 8

; 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 uwtable
declare dso_local void @_Z10checkValidv() #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z7processii(i32 noundef %0, i32 noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %6 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %10 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %12 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %15 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %16 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %17 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::pair", align 4
  %20 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %21 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %22 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %23 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %24 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %25 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %26 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %27 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %28 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %29 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %30 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %31 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %32 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %33 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %34 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %35 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %36 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %37 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %38 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %39 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %40 = alloca %"struct.std::_Rb_tree_iterator", align 8
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  call void @_Z10checkValidv()
  br label %41

41:                                               ; preds = %76, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %42 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE11lower_boundERS3_(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %43 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %5, i32 0, i32 0
  store ptr %42, ptr %43, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %44 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @bad) #5
  %45 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %6, i32 0, i32 0
  store ptr %44, ptr %45, align 8
  %46 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  br i1 %46, label %53, label %47

47:                                               ; preds = %41
  %48 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %49 = getelementptr inbounds %"struct.std::pair.11", ptr %48, i32 0, i32 0
  %50 = load i32, ptr %49, align 4, !tbaa !9
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = icmp sgt i32 %50, %51
  br label %53

53:                                               ; preds = %47, %41
  %54 = phi i1 [ true, %41 ], [ %52, %47 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br i1 %54, label %55, label %56

55:                                               ; preds = %53
  store i32 3, ptr %7, align 4
  br label %74

56:                                               ; preds = %53
  %57 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %58 = getelementptr inbounds %"struct.std::pair.11", ptr %57, i32 0, i32 1
  %59 = load i32, ptr %58, align 4, !tbaa !11
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %61 = icmp sgt i32 %59, %60
  br i1 %61, label %62, label %69

62:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %8, align 4, !tbaa !5
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %66 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %67 = getelementptr inbounds %"struct.std::pair.11", ptr %66, i32 0, i32 1
  %68 = load i32, ptr %67, align 4, !tbaa !11
  call void @_Z5ckmaxIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %65, i32 noundef %68)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %69

69:                                               ; preds = %62, %56
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %5, i64 8, i1 false), !tbaa.struct !12
  %70 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %9, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8
  %72 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr %71)
  %73 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %10, i32 0, i32 0
  store ptr %72, ptr %73, align 8
  store i32 0, ptr %7, align 4
  br label %74

74:                                               ; preds = %69, %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  %75 = load i32, ptr %7, align 4
  switch i32 %75, label %193 [
    i32 0, label %76
    i32 3, label %77
  ]

76:                                               ; preds = %74
  br label %41, !llvm.loop !15

77:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %78 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE11lower_boundERS3_(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %79 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %11, i32 0, i32 0
  store ptr %78, ptr %79, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %80 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @bad) #5
  %81 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %12, i32 0, i32 0
  store ptr %80, ptr %81, align 8
  %82 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br i1 %82, label %83, label %108

83:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !12
  %84 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %15, i32 0, i32 0
  %85 = load ptr, ptr %84, align 8
  %86 = call ptr @_ZSt4prevISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %85, i64 noundef 1)
  %87 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %14, i32 0, i32 0
  store ptr %86, ptr %87, align 8
  %88 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %89 = getelementptr inbounds %"struct.std::pair.11", ptr %88, i32 0, i32 1
  %90 = load i32, ptr %89, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  store i32 %90, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !12
  %91 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %17, i32 0, i32 0
  %92 = load ptr, ptr %91, align 8
  %93 = call ptr @_ZSt4prevISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %92, i64 noundef 1)
  %94 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %16, i32 0, i32 0
  store ptr %93, ptr %94, align 8
  %95 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  %96 = getelementptr inbounds %"struct.std::pair.11", ptr %95, i32 0, i32 1
  %97 = load i32, ptr %3, align 4, !tbaa !5
  %98 = sub nsw i32 %97, 1
  call void @_Z5ckminIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %96, i32 noundef %98)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  %99 = load i32, ptr %13, align 4, !tbaa !5
  %100 = load i32, ptr %4, align 4, !tbaa !5
  %101 = icmp sgt i32 %99, %100
  br i1 %101, label %102, label %107

102:                                              ; preds = %83
  %103 = load i32, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %104 = load i32, ptr %4, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %18, align 4, !tbaa !5
  %106 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr noundef nonnull align 4 dereferenceable(4) %18)
  store i32 %103, ptr %106, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %107

107:                                              ; preds = %102, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %108

108:                                              ; preds = %107, %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %19, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %109 = load i32, ptr %4, align 4, !tbaa !5
  %110 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i32 %109, ptr %110, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %111 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE4findERS3_(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %112 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %20, i32 0, i32 0
  store ptr %111, ptr %112, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %20, i64 8, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %113 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @bad) #5
  %114 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %21, i32 0, i32 0
  store ptr %113, ptr %114, align 8
  %115 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %21) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  br i1 %115, label %116, label %127

116:                                              ; preds = %108
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %23, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !12
  %117 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %23, i32 0, i32 0
  %118 = load ptr, ptr %117, align 8
  %119 = call ptr @_ZSt4prevISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %118, i64 noundef 1)
  %120 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %22, i32 0, i32 0
  store ptr %119, ptr %120, align 8
  %121 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #5
  %122 = getelementptr inbounds %"struct.std::pair.11", ptr %121, i32 0, i32 1
  %123 = load i32, ptr %122, align 4, !tbaa !11
  %124 = load i32, ptr %3, align 4, !tbaa !5
  %125 = sub nsw i32 %124, 1
  %126 = icmp eq i32 %123, %125
  br label %127

127:                                              ; preds = %116, %108
  %128 = phi i1 [ false, %108 ], [ %126, %116 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br i1 %128, label %129, label %146

129:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %25, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !12
  %130 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %25, i32 0, i32 0
  %131 = load ptr, ptr %130, align 8
  %132 = call ptr @_ZSt4prevISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %131, i64 noundef 1)
  %133 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %24, i32 0, i32 0
  store ptr %132, ptr %133, align 8
  %134 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #5
  %135 = getelementptr inbounds %"struct.std::pair.11", ptr %134, i32 0, i32 0
  %136 = load i32, ptr %135, align 4, !tbaa !9
  %137 = getelementptr inbounds %"struct.std::pair", ptr %19, i32 0, i32 0
  store i32 %136, ptr %137, align 4, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %27, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !12
  %138 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %27, i32 0, i32 0
  %139 = load ptr, ptr %138, align 8
  %140 = call ptr @_ZSt4prevISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %139, i64 noundef 1)
  %141 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %26, i32 0, i32 0
  store ptr %140, ptr %141, align 8
  %142 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %26, i32 0, i32 0
  %143 = load ptr, ptr %142, align 8
  %144 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr %143)
  %145 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %28, i32 0, i32 0
  store ptr %144, ptr %145, align 8
  br label %146

146:                                              ; preds = %129, %127
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %30, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !12
  %147 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %30, i32 0, i32 0
  %148 = load ptr, ptr %147, align 8
  %149 = call ptr @_ZSt4nextISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %148, i64 noundef 1)
  %150 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %29, i32 0, i32 0
  store ptr %149, ptr %150, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  %151 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @bad) #5
  %152 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %31, i32 0, i32 0
  store ptr %151, ptr %152, align 8
  %153 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull align 8 dereferenceable(8) %31) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #5
  br i1 %153, label %154, label %165

154:                                              ; preds = %146
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %33, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !12
  %155 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %33, i32 0, i32 0
  %156 = load ptr, ptr %155, align 8
  %157 = call ptr @_ZSt4nextISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %156, i64 noundef 1)
  %158 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %32, i32 0, i32 0
  store ptr %157, ptr %158, align 8
  %159 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %32) #5
  %160 = getelementptr inbounds %"struct.std::pair.11", ptr %159, i32 0, i32 0
  %161 = load i32, ptr %160, align 4, !tbaa !9
  %162 = load i32, ptr %4, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  %164 = icmp eq i32 %161, %163
  br label %165

165:                                              ; preds = %154, %146
  %166 = phi i1 [ false, %146 ], [ %164, %154 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  br i1 %166, label %167, label %184

167:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %35, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !12
  %168 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %35, i32 0, i32 0
  %169 = load ptr, ptr %168, align 8
  %170 = call ptr @_ZSt4nextISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %169, i64 noundef 1)
  %171 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %34, i32 0, i32 0
  store ptr %170, ptr %171, align 8
  %172 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %34) #5
  %173 = getelementptr inbounds %"struct.std::pair.11", ptr %172, i32 0, i32 1
  %174 = load i32, ptr %173, align 4, !tbaa !11
  %175 = getelementptr inbounds %"struct.std::pair", ptr %19, i32 0, i32 1
  store i32 %174, ptr %175, align 4, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %37, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !12
  %176 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %37, i32 0, i32 0
  %177 = load ptr, ptr %176, align 8
  %178 = call ptr @_ZSt4nextISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %177, i64 noundef 1)
  %179 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %36, i32 0, i32 0
  store ptr %178, ptr %179, align 8
  %180 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %36, i32 0, i32 0
  %181 = load ptr, ptr %180, align 8
  %182 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr %181)
  %183 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %38, i32 0, i32 0
  store ptr %182, ptr %183, align 8
  br label %184

184:                                              ; preds = %167, %165
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %39, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !12
  %185 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %39, i32 0, i32 0
  %186 = load ptr, ptr %185, align 8
  %187 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr %186)
  %188 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %40, i32 0, i32 0
  store ptr %187, ptr %188, align 8
  %189 = getelementptr inbounds %"struct.std::pair", ptr %19, i32 0, i32 1
  %190 = load i32, ptr %189, align 4, !tbaa !19
  %191 = getelementptr inbounds %"struct.std::pair", ptr %19, i32 0, i32 0
  %192 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr noundef nonnull align 4 dereferenceable(4) %191)
  store i32 %190, ptr %192, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  ret void

193:                                              ; preds = %74
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE11lower_boundERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5ckmaxIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(48), ptr) #1 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) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4prevISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr, i64 noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5ckminIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE4findERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4nextISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr, i64 noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint 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 #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 = !{!10, !6, i64 0}
!10 = !{!"_ZTSSt4pairIKiiE", !6, i64 0, !6, i64 4}
!11 = !{!10, !6, i64 4}
!12 = !{i64 0, i64 8, !13}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !6, i64 0}
!18 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!19 = !{!18, !6, i64 4}


; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair" = type { i32, i32 }

@bad = external dso_local global %"class.std::map", align 8

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10checkValidv() local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z7processii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #1 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %6 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %10 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair", align 4
  %14 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %15 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %16 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %17 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %18 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %19 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %20 = alloca %"struct.std::_Rb_tree_iterator", align 8
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  tail call void @_Z10checkValidv()
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %21 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE11lower_boundERS3_(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store ptr %21, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %22 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @bad) #4
  store ptr %22, ptr %6, align 8
  %23 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  br i1 %23, label %.critedge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %2
  %24 = add nsw i32 %1, 1
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %38
  %25 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  %26 = load i32, ptr %25, align 4, !tbaa !9
  %27 = icmp sgt i32 %26, %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br i1 %27, label %.loopexit, label %28

.critedge:                                        ; preds = %38, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br label %.loopexit

28:                                               ; preds = %.lr.ph
  %29 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  %30 = getelementptr inbounds i8, ptr %29, i64 4
  %31 = load i32, ptr %30, align 4, !tbaa !11
  %32 = icmp sgt i32 %31, %1
  br i1 %32, label %33, label %38

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  store i32 %24, ptr %7, align 4, !tbaa !5
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %35 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  %36 = getelementptr inbounds i8, ptr %35, i64 4
  %37 = load i32, ptr %36, align 4, !tbaa !11
  call void @_Z5ckmaxIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %34, i32 noundef %37)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  br label %38

38:                                               ; preds = %28, %33
  %.sroa.022.0.copyload = load ptr, ptr %5, align 8, !tbaa !12
  %39 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr %.sroa.022.0.copyload)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %40 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE11lower_boundERS3_(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store ptr %40, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %41 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @bad) #4
  store ptr %41, ptr %6, align 8
  %42 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  br i1 %42, label %.critedge, label %.lr.ph

.loopexit:                                        ; preds = %.lr.ph, %.critedge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %43 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE11lower_boundERS3_(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store ptr %43, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %44 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @bad) #4
  store ptr %44, ptr %9, align 8
  %45 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  br i1 %45, label %46, label %60

46:                                               ; preds = %.loopexit
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  %.sroa.019.0.copyload = load ptr, ptr %8, align 8, !tbaa !12
  %47 = call ptr @_ZSt4prevISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %.sroa.019.0.copyload, i64 noundef 1)
  store ptr %47, ptr %10, align 8
  %48 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  %49 = getelementptr inbounds i8, ptr %48, i64 4
  %50 = load i32, ptr %49, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  %.sroa.018.0.copyload = load ptr, ptr %8, align 8, !tbaa !12
  %51 = call ptr @_ZSt4prevISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %.sroa.018.0.copyload, i64 noundef 1)
  store ptr %51, ptr %11, align 8
  %52 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  %53 = getelementptr inbounds i8, ptr %52, i64 4
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = add nsw i32 %54, -1
  call void @_Z5ckminIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %53, i32 noundef %55)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  %56 = icmp sgt i32 %50, %1
  br i1 %56, label %57, label %60

57:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #4
  %58 = add nsw i32 %1, 1
  store i32 %58, ptr %12, align 4, !tbaa !5
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr noundef nonnull align 4 dereferenceable(4) %12)
  store i32 %50, ptr %59, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #4
  br label %60

60:                                               ; preds = %46, %57, %.loopexit
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #4
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i32 %61, ptr %62, align 4, !tbaa !5
  %63 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE4findERS3_(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store ptr %63, ptr %8, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #4
  %64 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @bad) #4
  store ptr %64, ptr %14, align 8
  %65 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #4
  br i1 %65, label %66, label %.critedge2

66:                                               ; preds = %60
  %.sroa.016.0.copyload = load ptr, ptr %8, align 8, !tbaa !12
  %67 = call ptr @_ZSt4prevISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %.sroa.016.0.copyload, i64 noundef 1)
  store ptr %67, ptr %15, align 8
  %68 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  %69 = getelementptr inbounds i8, ptr %68, i64 4
  %70 = load i32, ptr %69, align 4, !tbaa !11
  %71 = load i32, ptr %3, align 4, !tbaa !5
  %72 = add nsw i32 %71, -1
  %73 = icmp eq i32 %70, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #4
  br i1 %73, label %74, label %80

74:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #4
  %.sroa.015.0.copyload = load ptr, ptr %8, align 8, !tbaa !12
  %75 = call ptr @_ZSt4prevISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %.sroa.015.0.copyload, i64 noundef 1)
  store ptr %75, ptr %16, align 8
  %76 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %77 = load i32, ptr %76, align 4, !tbaa !9
  store i32 %77, ptr %13, align 4, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #4
  %.sroa.013.0.copyload = load ptr, ptr %8, align 8, !tbaa !12
  %78 = call ptr @_ZSt4prevISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %.sroa.013.0.copyload, i64 noundef 1)
  %79 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr %78)
  br label %80

.critedge2:                                       ; preds = %60
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #4
  br label %80

80:                                               ; preds = %.critedge2, %74, %66
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #4
  %.sroa.011.0.copyload = load ptr, ptr %8, align 8, !tbaa !12
  %81 = call ptr @_ZSt4nextISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %.sroa.011.0.copyload, i64 noundef 1)
  store ptr %81, ptr %17, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #4
  %82 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @bad) #4
  store ptr %82, ptr %18, align 8
  %83 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #4
  br i1 %83, label %84, label %.critedge4

84:                                               ; preds = %80
  %.sroa.010.0.copyload = load ptr, ptr %8, align 8, !tbaa !12
  %85 = call ptr @_ZSt4nextISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %.sroa.010.0.copyload, i64 noundef 1)
  store ptr %85, ptr %19, align 8
  %86 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #4
  %87 = load i32, ptr %86, align 4, !tbaa !9
  %88 = load i32, ptr %4, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  %90 = icmp eq i32 %87, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #4
  br i1 %90, label %91, label %99

91:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #4
  %.sroa.09.0.copyload = load ptr, ptr %8, align 8, !tbaa !12
  %92 = call ptr @_ZSt4nextISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %.sroa.09.0.copyload, i64 noundef 1)
  store ptr %92, ptr %20, align 8
  %93 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #4
  %94 = getelementptr inbounds i8, ptr %93, i64 4
  %95 = load i32, ptr %94, align 4, !tbaa !11
  %96 = getelementptr inbounds i8, ptr %13, i64 4
  store i32 %95, ptr %96, align 4, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #4
  %.sroa.07.0.copyload = load ptr, ptr %8, align 8, !tbaa !12
  %97 = call ptr @_ZSt4nextISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %.sroa.07.0.copyload, i64 noundef 1)
  %98 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr %97)
  br label %99

.critedge4:                                       ; preds = %80
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #4
  br label %99

99:                                               ; preds = %.critedge4, %91, %84
  %.sroa.05.0.copyload = load ptr, ptr %8, align 8, !tbaa !12
  %100 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr %.sroa.05.0.copyload)
  %101 = getelementptr inbounds i8, ptr %13, i64 4
  %102 = load i32, ptr %101, align 4, !tbaa !16
  %103 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @bad, ptr noundef nonnull align 4 dereferenceable(4) %13)
  store i32 %102, ptr %103, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE11lower_boundERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(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 ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5ckmaxIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(48), ptr) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4prevISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr, i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5ckminIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE4findERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4nextISt17_Rb_tree_iteratorISt4pairIKiiEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr, i64 noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 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 = { 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, !6, i64 0}
!10 = !{!"_ZTSSt4pairIKiiE", !6, i64 0, !6, i64 4}
!11 = !{!10, !6, i64 4}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!16 = !{!15, !6, i64 4}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass