; LLVM IR from tangjz/acm-icpc :: codeforces/complete (815E)

; 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<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_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 }
%"class.std::reverse_iterator" = type { %"struct.std::_Rb_tree_iterator" }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair.0" = type { i64, i64 }
%"struct.std::pair" = type { i64, i64 }

@n = external dso_local global i64, align 8
@m = external dso_local global i64, align 8
@len = external dso_local global i64, align 8
@cnt = external dso_local global %"class.std::map", align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"class.std::reverse_iterator", align 8
  %5 = alloca i64, align 8
  %6 = alloca %"class.std::reverse_iterator", align 8
  %7 = alloca %"struct.std::pair.0", align 8
  %8 = alloca %"class.std::reverse_iterator", align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca %"class.std::map", align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca %"class.std::reverse_iterator", align 8
  %20 = alloca %"class.std::reverse_iterator", align 8
  %21 = alloca %"struct.std::pair.0", align 8
  %22 = alloca %"class.std::reverse_iterator", align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  %26 = load i64, ptr @m, align 8, !tbaa !5
  %27 = icmp sle i64 %26, 2
  br i1 %27, label %28, label %37

28:                                               ; preds = %0
  %29 = load i64, ptr @m, align 8, !tbaa !5
  %30 = icmp eq i64 %29, 1
  br i1 %30, label %31, label %32

31:                                               ; preds = %28
  br label %34

32:                                               ; preds = %28
  %33 = load i64, ptr @n, align 8, !tbaa !5
  br label %34

34:                                               ; preds = %32, %31
  %35 = phi i64 [ 1, %31 ], [ %33, %32 ]
  %36 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %35)
  store i32 0, ptr %1, align 4
  br label %229

37:                                               ; preds = %0
  %38 = load i64, ptr @m, align 8, !tbaa !5
  %39 = sub nsw i64 %38, 2
  store i64 %39, ptr @m, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %40 = load i64, ptr @n, align 8, !tbaa !5
  %41 = sub nsw i64 %40, 2
  store i64 %41, ptr %2, align 8, !tbaa !5
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @cnt, ptr noundef nonnull align 8 dereferenceable(8) %2)
  store i64 1, ptr %42, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %43

43:                                               ; preds = %113, %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE6rbeginEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %4, ptr noundef nonnull align 8 dereferenceable(48) @cnt) #6
  %44 = call noundef ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKxxEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %45 = getelementptr inbounds %"struct.std::pair", ptr %44, i32 0, i32 0
  %46 = load i64, ptr %45, align 8, !tbaa !9
  %47 = sub nsw i64 %46, 1
  %48 = ashr i64 %47, 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  store i64 %48, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i64 0, ptr %5, align 8, !tbaa !5
  br label %49

49:                                               ; preds = %99, %43
  %50 = call noundef i64 @_ZNKSt3mapIxxSt4lessIxESaISt4pairIKxxEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @cnt) #6
  %51 = icmp ugt i64 %50, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  br i1 %51, label %52, label %60

52:                                               ; preds = %49
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE6rbeginEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %6, ptr noundef nonnull align 8 dereferenceable(48) @cnt) #6
  %53 = call noundef ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKxxEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %54 = getelementptr inbounds %"struct.std::pair", ptr %53, i32 0, i32 0
  %55 = load i64, ptr %54, align 8, !tbaa !9
  %56 = sub nsw i64 %55, 1
  %57 = ashr i64 %56, 1
  %58 = load i64, ptr %3, align 8, !tbaa !5
  %59 = icmp eq i64 %57, %58
  br label %60

60:                                               ; preds = %52, %49
  %61 = phi i1 [ false, %49 ], [ %59, %52 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br i1 %61, label %62, label %100

62:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE6rbeginEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %8, ptr noundef nonnull align 8 dereferenceable(48) @cnt) #6
  %63 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKxxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
  call void @_ZNSt4pairIxxEC2IKxxTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE18_ConstructiblePairIS4_S5_EEclsr6_PCCFPIS4_S5_EE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKS_IS4_S5_E(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %63)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  %64 = getelementptr inbounds %"struct.std::pair.0", ptr %7, i32 0, i32 0
  %65 = call noundef i64 @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5eraseERS3_(ptr noundef nonnull align 8 dereferenceable(48) @cnt, ptr noundef nonnull align 8 dereferenceable(8) %64)
  %66 = getelementptr inbounds %"struct.std::pair.0", ptr %7, i32 0, i32 1
  %67 = load i64, ptr %66, align 8, !tbaa !11
  %68 = load i64, ptr %5, align 8, !tbaa !5
  %69 = add nsw i64 %68, %67
  store i64 %69, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.std::pair.0", ptr %7, i32 0, i32 0
  %71 = load i64, ptr %70, align 8, !tbaa !13
  %72 = ashr i64 %71, 1
  %73 = icmp ne i64 %72, 0
  br i1 %73, label %74, label %99

74:                                               ; preds = %62
  %75 = getelementptr inbounds %"struct.std::pair.0", ptr %7, i32 0, i32 0
  %76 = load i64, ptr %75, align 8, !tbaa !13
  %77 = sub nsw i64 %76, 1
  %78 = ashr i64 %77, 1
  %79 = icmp ne i64 %78, 0
  br i1 %79, label %80, label %90

80:                                               ; preds = %74
  %81 = getelementptr inbounds %"struct.std::pair.0", ptr %7, i32 0, i32 1
  %82 = load i64, ptr %81, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %83 = getelementptr inbounds %"struct.std::pair.0", ptr %7, i32 0, i32 0
  %84 = load i64, ptr %83, align 8, !tbaa !13
  %85 = sub nsw i64 %84, 1
  %86 = ashr i64 %85, 1
  store i64 %86, ptr %9, align 8, !tbaa !5
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @cnt, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %88 = load i64, ptr %87, align 8, !tbaa !5
  %89 = add nsw i64 %88, %82
  store i64 %89, ptr %87, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %90

90:                                               ; preds = %80, %74
  %91 = getelementptr inbounds %"struct.std::pair.0", ptr %7, i32 0, i32 1
  %92 = load i64, ptr %91, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %93 = getelementptr inbounds %"struct.std::pair.0", ptr %7, i32 0, i32 0
  %94 = load i64, ptr %93, align 8, !tbaa !13
  %95 = ashr i64 %94, 1
  store i64 %95, ptr %10, align 8, !tbaa !5
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @cnt, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %97 = load i64, ptr %96, align 8, !tbaa !5
  %98 = add nsw i64 %97, %92
  store i64 %98, ptr %96, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %99

99:                                               ; preds = %90, %62
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  br label %49, !llvm.loop !14

100:                                              ; preds = %60
  %101 = load i64, ptr %5, align 8, !tbaa !5
  %102 = load i64, ptr @m, align 8, !tbaa !5
  %103 = icmp slt i64 %101, %102
  br i1 %103, label %104, label %108

104:                                              ; preds = %100
  %105 = load i64, ptr %5, align 8, !tbaa !5
  %106 = load i64, ptr @m, align 8, !tbaa !5
  %107 = sub nsw i64 %106, %105
  store i64 %107, ptr @m, align 8, !tbaa !5
  br label %110

108:                                              ; preds = %100
  %109 = load i64, ptr %3, align 8, !tbaa !5
  store i64 %109, ptr @len, align 8, !tbaa !5
  store i32 3, ptr %11, align 4
  br label %111

110:                                              ; preds = %104
  store i32 0, ptr %11, align 4
  br label %111

111:                                              ; preds = %110, %108
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  %112 = load i32, ptr %11, align 4
  switch i32 %112, label %231 [
    i32 0, label %113
    i32 3, label %114
  ]

113:                                              ; preds = %111
  br label %43, !llvm.loop !16

114:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 2, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %115 = load i64, ptr @n, align 8, !tbaa !5
  %116 = sub nsw i64 %115, 1
  store i64 %116, ptr %13, align 8, !tbaa !5
  br label %117

117:                                              ; preds = %219, %114
  %118 = load i64, ptr @len, align 8, !tbaa !5
  %119 = load i64, ptr %13, align 8, !tbaa !5
  %120 = load i64, ptr %12, align 8, !tbaa !5
  %121 = sub nsw i64 %119, %120
  %122 = ashr i64 %121, 1
  %123 = icmp slt i64 %118, %122
  br i1 %123, label %124, label %220

124:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %125 = load i64, ptr %12, align 8, !tbaa !5
  %126 = load i64, ptr %13, align 8, !tbaa !5
  %127 = add nsw i64 %125, %126
  %128 = ashr i64 %127, 1
  store i64 %128, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 0, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %16) #6
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 48, i1 false)
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %16) #6
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE4swapERS6_(ptr noundef nonnull align 8 dereferenceable(48) %16, ptr noundef nonnull align 8 dereferenceable(48) @cnt) #6
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %16) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %129 = load i64, ptr %13, align 8, !tbaa !5
  %130 = load i64, ptr %12, align 8, !tbaa !5
  %131 = sub nsw i64 %129, %130
  %132 = ashr i64 %131, 1
  store i64 %132, ptr %17, align 8, !tbaa !5
  %133 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @cnt, ptr noundef nonnull align 8 dereferenceable(8) %17)
  store i64 1, ptr %133, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %134

134:                                              ; preds = %205, %124
  br label %135

135:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE6rbeginEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %19, ptr noundef nonnull align 8 dereferenceable(48) @cnt) #6
  %136 = call noundef ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKxxEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %19)
  %137 = getelementptr inbounds %"struct.std::pair", ptr %136, i32 0, i32 0
  %138 = load i64, ptr %137, align 8, !tbaa !9
  %139 = sub nsw i64 %138, 1
  %140 = ashr i64 %139, 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  store i64 %140, ptr %18, align 8, !tbaa !5
  br label %141

141:                                              ; preds = %196, %135
  %142 = call noundef i64 @_ZNKSt3mapIxxSt4lessIxESaISt4pairIKxxEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @cnt) #6
  %143 = icmp ugt i64 %142, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  br i1 %143, label %144, label %152

144:                                              ; preds = %141
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE6rbeginEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %20, ptr noundef nonnull align 8 dereferenceable(48) @cnt) #6
  %145 = call noundef ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKxxEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20)
  %146 = getelementptr inbounds %"struct.std::pair", ptr %145, i32 0, i32 0
  %147 = load i64, ptr %146, align 8, !tbaa !9
  %148 = sub nsw i64 %147, 1
  %149 = ashr i64 %148, 1
  %150 = load i64, ptr %18, align 8, !tbaa !5
  %151 = icmp eq i64 %149, %150
  br label %152

152:                                              ; preds = %144, %141
  %153 = phi i1 [ false, %141 ], [ %151, %144 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br i1 %153, label %154, label %197

154:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE6rbeginEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %22, ptr noundef nonnull align 8 dereferenceable(48) @cnt) #6
  %155 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKxxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %22)
  call void @_ZNSt4pairIxxEC2IKxxTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE18_ConstructiblePairIS4_S5_EEclsr6_PCCFPIS4_S5_EE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKS_IS4_S5_E(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(16) %155)
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  %156 = getelementptr inbounds %"struct.std::pair.0", ptr %21, i32 0, i32 0
  %157 = call noundef i64 @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5eraseERS3_(ptr noundef nonnull align 8 dereferenceable(48) @cnt, ptr noundef nonnull align 8 dereferenceable(8) %156)
  %158 = load i64, ptr %18, align 8, !tbaa !5
  %159 = load i64, ptr @len, align 8, !tbaa !5
  %160 = icmp eq i64 %158, %159
  br i1 %160, label %161, label %166

161:                                              ; preds = %154
  %162 = getelementptr inbounds %"struct.std::pair.0", ptr %21, i32 0, i32 1
  %163 = load i64, ptr %162, align 8, !tbaa !11
  %164 = load i64, ptr %15, align 8, !tbaa !5
  %165 = add nsw i64 %164, %163
  store i64 %165, ptr %15, align 8, !tbaa !5
  br label %166

166:                                              ; preds = %161, %154
  %167 = getelementptr inbounds %"struct.std::pair.0", ptr %21, i32 0, i32 0
  %168 = load i64, ptr %167, align 8, !tbaa !13
  %169 = ashr i64 %168, 1
  %170 = icmp ne i64 %169, 0
  br i1 %170, label %171, label %196

171:                                              ; preds = %166
  %172 = getelementptr inbounds %"struct.std::pair.0", ptr %21, i32 0, i32 0
  %173 = load i64, ptr %172, align 8, !tbaa !13
  %174 = sub nsw i64 %173, 1
  %175 = ashr i64 %174, 1
  %176 = icmp ne i64 %175, 0
  br i1 %176, label %177, label %187

177:                                              ; preds = %171
  %178 = getelementptr inbounds %"struct.std::pair.0", ptr %21, i32 0, i32 1
  %179 = load i64, ptr %178, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %180 = getelementptr inbounds %"struct.std::pair.0", ptr %21, i32 0, i32 0
  %181 = load i64, ptr %180, align 8, !tbaa !13
  %182 = sub nsw i64 %181, 1
  %183 = ashr i64 %182, 1
  store i64 %183, ptr %23, align 8, !tbaa !5
  %184 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @cnt, ptr noundef nonnull align 8 dereferenceable(8) %23)
  %185 = load i64, ptr %184, align 8, !tbaa !5
  %186 = add nsw i64 %185, %179
  store i64 %186, ptr %184, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %187

187:                                              ; preds = %177, %171
  %188 = getelementptr inbounds %"struct.std::pair.0", ptr %21, i32 0, i32 1
  %189 = load i64, ptr %188, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %190 = getelementptr inbounds %"struct.std::pair.0", ptr %21, i32 0, i32 0
  %191 = load i64, ptr %190, align 8, !tbaa !13
  %192 = ashr i64 %191, 1
  store i64 %192, ptr %24, align 8, !tbaa !5
  %193 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @cnt, ptr noundef nonnull align 8 dereferenceable(8) %24)
  %194 = load i64, ptr %193, align 8, !tbaa !5
  %195 = add nsw i64 %194, %189
  store i64 %195, ptr %193, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %196

196:                                              ; preds = %187, %166
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #6
  br label %141, !llvm.loop !17

197:                                              ; preds = %152
  %198 = load i64, ptr %18, align 8, !tbaa !5
  %199 = load i64, ptr @len, align 8, !tbaa !5
  %200 = icmp sle i64 %198, %199
  br i1 %200, label %201, label %202

201:                                              ; preds = %197
  store i32 9, ptr %11, align 4
  br label %203

202:                                              ; preds = %197
  store i32 0, ptr %11, align 4
  br label %203

203:                                              ; preds = %202, %201
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  %204 = load i32, ptr %11, align 4
  switch i32 %204, label %231 [
    i32 0, label %205
    i32 9, label %206
  ]

205:                                              ; preds = %203
  br label %134, !llvm.loop !18

206:                                              ; preds = %203
  %207 = load i64, ptr %15, align 8, !tbaa !5
  %208 = load i64, ptr @m, align 8, !tbaa !5
  %209 = icmp slt i64 %207, %208
  br i1 %209, label %210, label %216

210:                                              ; preds = %206
  %211 = load i64, ptr %15, align 8, !tbaa !5
  %212 = load i64, ptr @m, align 8, !tbaa !5
  %213 = sub nsw i64 %212, %211
  store i64 %213, ptr @m, align 8, !tbaa !5
  %214 = load i64, ptr %14, align 8, !tbaa !5
  %215 = add nsw i64 %214, 1
  store i64 %215, ptr %12, align 8, !tbaa !5
  br label %219

216:                                              ; preds = %206
  %217 = load i64, ptr %14, align 8, !tbaa !5
  %218 = sub nsw i64 %217, 1
  store i64 %218, ptr %13, align 8, !tbaa !5
  br label %219

219:                                              ; preds = %216, %210
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %117, !llvm.loop !19

220:                                              ; preds = %117
  %221 = load i64, ptr %12, align 8, !tbaa !5
  %222 = load i64, ptr %13, align 8, !tbaa !5
  %223 = add nsw i64 %221, %222
  %224 = load i64, ptr @m, align 8, !tbaa !5
  %225 = sub nsw i64 %224, 1
  %226 = add nsw i64 %223, %225
  %227 = ashr i64 %226, 1
  %228 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %227)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %229

229:                                              ; preds = %220, %34
  %230 = load i32, ptr %1, align 4
  ret i32 %230

231:                                              ; preds = %203, %111
  unreachable
}

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE6rbeginEv(ptr dead_on_unwind noalias writable sret(%"class.std::reverse_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(48)) #0 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5eraseERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE4swapERS6_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) #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 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSSt4pairIKxxE", !6, i64 0, !6, i64 8}
!11 = !{!12, !6, i64 8}
!12 = !{!"_ZTSSt4pairIxxE", !6, i64 0, !6, i64 8}
!13 = !{!12, !6, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}
!19 = distinct !{!19, !15}


; 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<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_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 }
%"class.std::reverse_iterator" = type { %"struct.std::_Rb_tree_iterator" }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair.0" = type { i64, i64 }

@n = external dso_local global i64, align 8
@m = external dso_local global i64, align 8
@len = external dso_local local_unnamed_addr global i64, align 8
@cnt = external dso_local global %"class.std::map", align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i64, align 8
  %2 = alloca %"class.std::reverse_iterator", align 8
  %3 = alloca %"class.std::reverse_iterator", align 8
  %4 = alloca %"struct.std::pair.0", align 8
  %5 = alloca %"class.std::reverse_iterator", align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca %"class.std::map", align 8
  %9 = alloca i64, align 8
  %10 = alloca %"class.std::reverse_iterator", align 8
  %11 = alloca %"class.std::reverse_iterator", align 8
  %12 = alloca %"struct.std::pair.0", align 8
  %13 = alloca %"class.std::reverse_iterator", align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %17 = load i64, ptr @m, align 8, !tbaa !5
  %18 = icmp slt i64 %17, 3
  br i1 %18, label %19, label %24

19:                                               ; preds = %0
  %20 = icmp eq i64 %17, 1
  %21 = load i64, ptr @n, align 8
  %22 = select i1 %20, i64 1, i64 %21
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %22)
  br label %134

24:                                               ; preds = %0
  %25 = add nsw i64 %17, -2
  store i64 %25, ptr @m, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %26 = load i64, ptr @n, align 8, !tbaa !5
  %27 = add nsw i64 %26, -2
  store i64 %27, ptr %1, align 8, !tbaa !5
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @cnt, ptr noundef nonnull align 8 dereferenceable(8) %1)
  store i64 1, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  %29 = getelementptr inbounds i8, ptr %4, i64 8
  br label %30

30:                                               ; preds = %65, %24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE6rbeginEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %2, ptr noundef nonnull align 8 dereferenceable(48) @cnt) #6
  %31 = call noundef ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKxxEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
  %32 = load i64, ptr %31, align 8, !tbaa !9
  %33 = add nsw i64 %32, -1
  %34 = ashr i64 %33, 1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %35 = call noundef i64 @_ZNKSt3mapIxxSt4lessIxESaISt4pairIKxxEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @cnt) #6
  %.not52 = icmp eq i64 %35, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  br i1 %.not52, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %30, %61
  %.02753 = phi i64 [ %45, %61 ], [ 0, %30 ]
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE6rbeginEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %3, ptr noundef nonnull align 8 dereferenceable(48) @cnt) #6
  %36 = call noundef ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKxxEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %37 = load i64, ptr %36, align 8, !tbaa !9
  %38 = add nsw i64 %37, -1
  %39 = ashr i64 %38, 1
  %40 = icmp eq i64 %39, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br i1 %40, label %41, label %.loopexit47

41:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE6rbeginEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %5, ptr noundef nonnull align 8 dereferenceable(48) @cnt) #6
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKxxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @_ZNSt4pairIxxEC2IKxxTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE18_ConstructiblePairIS4_S5_EEclsr6_PCCFPIS4_S5_EE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKS_IS4_S5_E(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %42)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %43 = call noundef i64 @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5eraseERS3_(ptr noundef nonnull align 8 dereferenceable(48) @cnt, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %44 = load i64, ptr %29, align 8, !tbaa !11
  %45 = add nsw i64 %44, %.02753
  %46 = load i64, ptr %4, align 8, !tbaa !13
  %.not43 = icmp ult i64 %46, 2
  br i1 %.not43, label %61, label %47

47:                                               ; preds = %41
  %.not44 = icmp eq i64 %46, 2
  br i1 %.not44, label %54, label %48

48:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %49 = add nsw i64 %46, -1
  %50 = ashr i64 %49, 1
  store i64 %50, ptr %6, align 8, !tbaa !5
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @cnt, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %52 = load i64, ptr %51, align 8, !tbaa !5
  %53 = add nsw i64 %52, %44
  store i64 %53, ptr %51, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %.pre = load i64, ptr %29, align 8, !tbaa !11
  %.pre66 = load i64, ptr %4, align 8, !tbaa !13
  br label %54

54:                                               ; preds = %48, %47
  %55 = phi i64 [ %.pre66, %48 ], [ 2, %47 ]
  %56 = phi i64 [ %.pre, %48 ], [ %44, %47 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %57 = ashr i64 %55, 1
  store i64 %57, ptr %7, align 8, !tbaa !5
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @cnt, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %59 = load i64, ptr %58, align 8, !tbaa !5
  %60 = add nsw i64 %59, %56
  store i64 %60, ptr %58, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %61

61:                                               ; preds = %54, %41
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  %62 = call noundef i64 @_ZNKSt3mapIxxSt4lessIxESaISt4pairIKxxEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @cnt) #6
  %.not = icmp eq i64 %62, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  br i1 %.not, label %.critedge, label %.lr.ph, !llvm.loop !14

.critedge:                                        ; preds = %61, %30
  %.027.lcssa = phi i64 [ 0, %30 ], [ %45, %61 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br label %.loopexit47

.loopexit47:                                      ; preds = %.lr.ph, %.critedge
  %.02751 = phi i64 [ %.027.lcssa, %.critedge ], [ %.02753, %.lr.ph ]
  %63 = load i64, ptr @m, align 8, !tbaa !5
  %64 = icmp slt i64 %.02751, %63
  br i1 %64, label %65, label %67

65:                                               ; preds = %.loopexit47
  %66 = sub nsw i64 %63, %.02751
  store i64 %66, ptr @m, align 8, !tbaa !5
  br label %30

67:                                               ; preds = %.loopexit47
  store i64 %34, ptr @len, align 8, !tbaa !5
  %68 = load i64, ptr @n, align 8, !tbaa !5
  %69 = add nsw i64 %68, -1
  %70 = add nsw i64 %68, -3
  %71 = ashr i64 %70, 1
  %72 = icmp slt i64 %34, %71
  br i1 %72, label %.lr.ph60, label %._crit_edge

.lr.ph60:                                         ; preds = %67
  %73 = getelementptr inbounds i8, ptr %12, i64 8
  br label %74

74:                                               ; preds = %.lr.ph60, %123
  %75 = phi i64 [ %71, %.lr.ph60 ], [ %126, %123 ]
  %.02859 = phi i64 [ %69, %.lr.ph60 ], [ %.129, %123 ]
  %.03058 = phi i64 [ 2, %.lr.ph60 ], [ %.131, %123 ]
  %76 = add nsw i64 %.02859, %.03058
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %8) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %8, i8 0, i64 48, i1 false)
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #6
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE4swapERS6_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(48) @cnt) #6
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  store i64 %75, ptr %9, align 8, !tbaa !5
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @cnt, ptr noundef nonnull align 8 dereferenceable(8) %9)
  store i64 1, ptr %77, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  br label %78

78:                                               ; preds = %.loopexit, %74
  %.026 = phi i64 [ 0, %74 ], [ %.149, %.loopexit ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE6rbeginEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %10, ptr noundef nonnull align 8 dereferenceable(48) @cnt) #6
  %79 = call noundef ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKxxEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
  %80 = load i64, ptr %79, align 8, !tbaa !9
  %81 = add nsw i64 %80, -1
  %82 = ashr i64 %81, 1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  %83 = call noundef i64 @_ZNKSt3mapIxxSt4lessIxESaISt4pairIKxxEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @cnt) #6
  %.not3954 = icmp eq i64 %83, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  br i1 %.not3954, label %.critedge2, label %.lr.ph56

.lr.ph56:                                         ; preds = %78, %111
  %.155 = phi i64 [ %.2, %111 ], [ %.026, %78 ]
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE6rbeginEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %11, ptr noundef nonnull align 8 dereferenceable(48) @cnt) #6
  %84 = call noundef ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKxxEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
  %85 = load i64, ptr %84, align 8, !tbaa !9
  %86 = add nsw i64 %85, -1
  %87 = ashr i64 %86, 1
  %88 = icmp eq i64 %87, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  br i1 %88, label %89, label %.loopexit

89:                                               ; preds = %.lr.ph56
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE6rbeginEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %13, ptr noundef nonnull align 8 dereferenceable(48) @cnt) #6
  %90 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKxxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13)
  call void @_ZNSt4pairIxxEC2IKxxTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE18_ConstructiblePairIS4_S5_EEclsr6_PCCFPIS4_S5_EE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKS_IS4_S5_E(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %90)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  %91 = call noundef i64 @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5eraseERS3_(ptr noundef nonnull align 8 dereferenceable(48) @cnt, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %92 = load i64, ptr @len, align 8, !tbaa !5
  %93 = icmp eq i64 %82, %92
  %94 = load i64, ptr %73, align 8
  %95 = select i1 %93, i64 %94, i64 0
  %.2 = add nsw i64 %95, %.155
  %96 = load i64, ptr %12, align 8, !tbaa !13
  %.not41 = icmp ult i64 %96, 2
  br i1 %.not41, label %111, label %97

97:                                               ; preds = %89
  %.not42 = icmp eq i64 %96, 2
  br i1 %.not42, label %104, label %98

98:                                               ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #6
  %99 = add nsw i64 %96, -1
  %100 = ashr i64 %99, 1
  store i64 %100, ptr %14, align 8, !tbaa !5
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @cnt, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %102 = load i64, ptr %101, align 8, !tbaa !5
  %103 = add nsw i64 %102, %94
  store i64 %103, ptr %101, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  %.pre67 = load i64, ptr %73, align 8, !tbaa !11
  %.pre68 = load i64, ptr %12, align 8, !tbaa !13
  br label %104

104:                                              ; preds = %98, %97
  %105 = phi i64 [ %.pre68, %98 ], [ 2, %97 ]
  %106 = phi i64 [ %.pre67, %98 ], [ %94, %97 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #6
  %107 = ashr i64 %105, 1
  store i64 %107, ptr %15, align 8, !tbaa !5
  %108 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @cnt, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %109 = load i64, ptr %108, align 8, !tbaa !5
  %110 = add nsw i64 %109, %106
  store i64 %110, ptr %108, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  br label %111

111:                                              ; preds = %104, %89
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  %112 = call noundef i64 @_ZNKSt3mapIxxSt4lessIxESaISt4pairIKxxEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @cnt) #6
  %.not39 = icmp eq i64 %112, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  br i1 %.not39, label %.critedge2, label %.lr.ph56, !llvm.loop !16

.critedge2:                                       ; preds = %111, %78
  %.1.lcssa = phi i64 [ %.026, %78 ], [ %.2, %111 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph56, %.critedge2
  %.149 = phi i64 [ %.1.lcssa, %.critedge2 ], [ %.155, %.lr.ph56 ]
  %113 = load i64, ptr @len, align 8, !tbaa !5
  %.not40 = icmp sgt i64 %82, %113
  br i1 %.not40, label %78, label %114

114:                                              ; preds = %.loopexit
  %115 = ashr i64 %76, 1
  %116 = load i64, ptr @m, align 8, !tbaa !5
  %117 = icmp slt i64 %.149, %116
  br i1 %117, label %118, label %121

118:                                              ; preds = %114
  %119 = sub nsw i64 %116, %.149
  store i64 %119, ptr @m, align 8, !tbaa !5
  %120 = add nsw i64 %115, 1
  br label %123

121:                                              ; preds = %114
  %122 = add nsw i64 %115, -1
  br label %123

123:                                              ; preds = %121, %118
  %124 = phi i64 [ %119, %118 ], [ %116, %121 ]
  %.131 = phi i64 [ %120, %118 ], [ %.03058, %121 ]
  %.129 = phi i64 [ %.02859, %118 ], [ %122, %121 ]
  %125 = sub nsw i64 %.129, %.131
  %126 = ashr i64 %125, 1
  %127 = icmp slt i64 %113, %126
  br i1 %127, label %74, label %._crit_edge, !llvm.loop !17

._crit_edge:                                      ; preds = %123, %67
  %128 = phi i64 [ %63, %67 ], [ %124, %123 ]
  %.030.lcssa = phi i64 [ 2, %67 ], [ %.131, %123 ]
  %.028.lcssa = phi i64 [ %69, %67 ], [ %.129, %123 ]
  %129 = add i64 %.028.lcssa, %.030.lcssa
  %130 = add i64 %129, -1
  %131 = add i64 %130, %128
  %132 = ashr i64 %131, 1
  %133 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %132)
  br label %134

134:                                              ; preds = %._crit_edge, %19
  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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE6rbeginEv(ptr dead_on_unwind noalias writable sret(%"class.std::reverse_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

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

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE4swapERS6_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) 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 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 #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" }
attributes #3 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSSt4pairIKxxE", !6, i64 0, !6, i64 8}
!11 = !{!12, !6, i64 8}
!12 = !{!"_ZTSSt4pairIxxE", !6, i64 0, !6, i64 8}
!13 = !{!12, !6, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}


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