; LLVM IR from eyangch/competitive-programming :: Codeforces/1472 (f)

; 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, rt>, std::_Select1st<std::pair<const int, rt>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, rt>, std::_Select1st<std::pair<const int, rt>>, 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 }
%"class.std::map.0" = type { %"class.std::_Rb_tree.1" }
%"class.std::_Rb_tree.1" = type { %"struct.std::_Rb_tree<int, std::pair<const int, st>, std::_Select1st<std::pair<const int, st>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, st>, std::_Select1st<std::pair<const int, st>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%struct.rt = type { i8, i8 }
%struct.st = type { i32, i32, i32 }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"class.std::reverse_iterator" = type { %"struct.std::_Rb_tree_iterator.5" }
%"struct.std::_Rb_tree_iterator.5" = type { ptr }
%"struct.std::pair" = type <{ i32, %struct.rt, [2 x i8] }>
%"struct.std::pair.6" = type { i32, %struct.st }

@T = external dso_local global i32, align 4
@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@b = external dso_local global %"class.std::map", align 8
@dp = external dso_local global %"class.std::map.0", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %struct.rt, align 1
  %6 = alloca %struct.st, align 4
  %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 i32, align 4
  %11 = alloca %struct.rt, align 1
  %12 = alloca %"class.std::reverse_iterator", align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %struct.st, align 4
  %16 = alloca %struct.st, align 4
  %17 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %18 = alloca %struct.st, align 4
  %19 = alloca %"class.std::reverse_iterator", align 8
  store i32 0, ptr %1, align 4
  %20 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %21 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %22 = getelementptr i8, ptr %21, i64 -24
  %23 = load i64, ptr %22, align 8
  %24 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %23
  %25 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %24, ptr noundef null)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @T)
  br label %27

27:                                               ; preds = %154, %0
  %28 = load i32, ptr @T, align 4, !tbaa !8
  %29 = add nsw i32 %28, -1
  store i32 %29, ptr @T, align 4, !tbaa !8
  %30 = icmp ne i32 %28, 0
  br i1 %30, label %31, label %155

31:                                               ; preds = %27
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 4 dereferenceable(4) @M)
  call void @_ZNSt3mapIi2rtSt4lessIiESaISt4pairIKiS0_EEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @b) #8
  call void @_ZNSt3mapIi2stSt4lessIiESaISt4pairIKiS0_EEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @dp) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !8
  br label %34

34:                                               ; preds = %61, %31
  %35 = load i32, ptr %2, align 4, !tbaa !8
  %36 = load i32, ptr @M, align 4, !tbaa !8
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %39, label %38

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

39:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %40, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %42 = call noundef i64 @_ZNKSt3mapIi2rtSt4lessIiESaISt4pairIKiS0_EEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48) @b, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %43 = icmp ne i64 %42, 0
  br i1 %43, label %48, label %44

44:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 2, ptr %5) #8
  %45 = getelementptr inbounds %struct.rt, ptr %5, i32 0, i32 0
  store i8 0, ptr %45, align 1, !tbaa !11
  %46 = getelementptr inbounds %struct.rt, ptr %5, i32 0, i32 1
  store i8 0, ptr %46, align 1, !tbaa !14
  %47 = call noundef nonnull align 1 dereferenceable(2) ptr @_ZNSt3mapIi2rtSt4lessIiESaISt4pairIKiS0_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) @b, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %47, ptr align 1 %5, i64 2, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 2, ptr %5) #8
  br label %48

48:                                               ; preds = %44, %39
  %49 = load i32, ptr %3, align 4, !tbaa !8
  %50 = icmp eq i32 %49, 1
  br i1 %50, label %51, label %54

51:                                               ; preds = %48
  %52 = call noundef nonnull align 1 dereferenceable(2) ptr @_ZNSt3mapIi2rtSt4lessIiESaISt4pairIKiS0_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) @b, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %53 = getelementptr inbounds %struct.rt, ptr %52, i32 0, i32 0
  store i8 1, ptr %53, align 1, !tbaa !11
  br label %54

54:                                               ; preds = %51, %48
  %55 = load i32, ptr %3, align 4, !tbaa !8
  %56 = icmp eq i32 %55, 2
  br i1 %56, label %57, label %60

57:                                               ; preds = %54
  %58 = call noundef nonnull align 1 dereferenceable(2) ptr @_ZNSt3mapIi2rtSt4lessIiESaISt4pairIKiS0_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) @b, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %59 = getelementptr inbounds %struct.rt, ptr %58, i32 0, i32 1
  store i8 1, ptr %59, align 1, !tbaa !14
  br label %60

60:                                               ; preds = %57, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %61

61:                                               ; preds = %60
  %62 = load i32, ptr %2, align 4, !tbaa !8
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %2, align 4, !tbaa !8
  br label %34, !llvm.loop !17

64:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #8
  %65 = getelementptr inbounds %struct.st, ptr %6, i32 0, i32 0
  store i32 1, ptr %65, align 4, !tbaa !19
  %66 = getelementptr inbounds %struct.st, ptr %6, i32 0, i32 1
  store i32 0, ptr %66, align 4, !tbaa !21
  %67 = getelementptr inbounds %struct.st, ptr %6, i32 0, i32 2
  store i32 0, ptr %67, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !8
  %68 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3mapIi2stSt4lessIiESaISt4pairIKiS0_EEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @dp, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %68, ptr align 4 %6, i64 12, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %69 = call ptr @_ZNSt3mapIi2rtSt4lessIiESaISt4pairIKiS0_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @b) #8
  %70 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %8, i32 0, i32 0
  store ptr %69, ptr %70, align 8
  br label %71

71:                                               ; preds = %139, %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %72 = call ptr @_ZNSt3mapIi2rtSt4lessIiESaISt4pairIKiS0_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @b) #8
  %73 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %9, i32 0, i32 0
  store ptr %72, ptr %73, align 8
  %74 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKi2rtEES6_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  br i1 %74, label %76, label %75

75:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %142

76:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %77 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKi2rtEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  %78 = getelementptr inbounds %"struct.std::pair", ptr %77, i32 0, i32 0
  %79 = load i32, ptr %78, align 4, !tbaa !24
  store i32 %79, ptr %10, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 2, ptr %11) #8
  %80 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKi2rtEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  %81 = getelementptr inbounds %"struct.std::pair", ptr %80, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %11, ptr align 4 %81, i64 2, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  call void @_ZNSt3mapIi2stSt4lessIiESaISt4pairIKiS0_EEE6rbeginEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %12, ptr noundef nonnull align 8 dereferenceable(48) @dp) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %82 = call noundef ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKi2stEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
  %83 = getelementptr inbounds %"struct.std::pair.6", ptr %82, i32 0, i32 0
  %84 = load i32, ptr %83, align 4, !tbaa !26
  store i32 %84, ptr %13, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %85 = load i32, ptr %10, align 4, !tbaa !8
  %86 = load i32, ptr %13, align 4, !tbaa !8
  %87 = sub nsw i32 %85, %86
  %88 = srem i32 %87, 2
  store i32 %88, ptr %14, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #8
  %89 = call noundef ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKi2stEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
  %90 = getelementptr inbounds %"struct.std::pair.6", ptr %89, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %90, i64 12, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #8
  call void @llvm.memset.p0.i64(ptr align 4 %16, i8 0, i64 12, i1 false)
  %91 = getelementptr inbounds %struct.rt, ptr %11, i32 0, i32 0
  %92 = load i8, ptr %91, align 1, !tbaa !11, !range !28, !noundef !29
  %93 = trunc i8 %92 to i1
  br i1 %93, label %94, label %102

94:                                               ; preds = %76
  %95 = getelementptr inbounds %struct.rt, ptr %11, i32 0, i32 1
  %96 = load i8, ptr %95, align 1, !tbaa !14, !range !28, !noundef !29
  %97 = trunc i8 %96 to i1
  br i1 %97, label %98, label %102

98:                                               ; preds = %94
  %99 = getelementptr inbounds %struct.st, ptr %15, i32 0, i32 0
  %100 = load i32, ptr %99, align 4, !tbaa !19
  %101 = getelementptr inbounds %struct.st, ptr %16, i32 0, i32 0
  store i32 %100, ptr %101, align 4, !tbaa !19
  br label %137

102:                                              ; preds = %94, %76
  %103 = getelementptr inbounds %struct.rt, ptr %11, i32 0, i32 0
  %104 = load i8, ptr %103, align 1, !tbaa !11, !range !28, !noundef !29
  %105 = trunc i8 %104 to i1
  br i1 %105, label %106, label %121

106:                                              ; preds = %102
  %107 = load i32, ptr %14, align 4, !tbaa !8
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %109, label %113

109:                                              ; preds = %106
  %110 = getelementptr inbounds %struct.st, ptr %15, i32 0, i32 2
  %111 = load i32, ptr %110, align 4, !tbaa !22
  %112 = getelementptr inbounds %struct.st, ptr %16, i32 0, i32 0
  store i32 %111, ptr %112, align 4, !tbaa !19
  br label %117

113:                                              ; preds = %106
  %114 = getelementptr inbounds %struct.st, ptr %15, i32 0, i32 1
  %115 = load i32, ptr %114, align 4, !tbaa !21
  %116 = getelementptr inbounds %struct.st, ptr %16, i32 0, i32 0
  store i32 %115, ptr %116, align 4, !tbaa !19
  br label %117

117:                                              ; preds = %113, %109
  %118 = getelementptr inbounds %struct.st, ptr %15, i32 0, i32 0
  %119 = load i32, ptr %118, align 4, !tbaa !19
  %120 = getelementptr inbounds %struct.st, ptr %16, i32 0, i32 2
  store i32 %119, ptr %120, align 4, !tbaa !22
  br label %136

121:                                              ; preds = %102
  %122 = load i32, ptr %14, align 4, !tbaa !8
  %123 = icmp ne i32 %122, 0
  br i1 %123, label %128, label %124

124:                                              ; preds = %121
  %125 = getelementptr inbounds %struct.st, ptr %15, i32 0, i32 2
  %126 = load i32, ptr %125, align 4, !tbaa !22
  %127 = getelementptr inbounds %struct.st, ptr %16, i32 0, i32 0
  store i32 %126, ptr %127, align 4, !tbaa !19
  br label %132

128:                                              ; preds = %121
  %129 = getelementptr inbounds %struct.st, ptr %15, i32 0, i32 1
  %130 = load i32, ptr %129, align 4, !tbaa !21
  %131 = getelementptr inbounds %struct.st, ptr %16, i32 0, i32 0
  store i32 %130, ptr %131, align 4, !tbaa !19
  br label %132

132:                                              ; preds = %128, %124
  %133 = getelementptr inbounds %struct.st, ptr %15, i32 0, i32 0
  %134 = load i32, ptr %133, align 4, !tbaa !19
  %135 = getelementptr inbounds %struct.st, ptr %16, i32 0, i32 1
  store i32 %134, ptr %135, align 4, !tbaa !21
  br label %136

136:                                              ; preds = %132, %117
  br label %137

137:                                              ; preds = %136, %98
  %138 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3mapIi2stSt4lessIiESaISt4pairIKiS0_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) @dp, ptr noundef nonnull align 4 dereferenceable(4) %10)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %138, ptr align 4 %16, i64 12, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 2, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %139

139:                                              ; preds = %137
  %140 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKi2rtEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %8, i32 noundef 0) #8
  %141 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %17, i32 0, i32 0
  store ptr %140, ptr %141, align 8
  br label %71, !llvm.loop !30

142:                                              ; preds = %75
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  call void @_ZNSt3mapIi2stSt4lessIiESaISt4pairIKiS0_EEE6rbeginEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %19, ptr noundef nonnull align 8 dereferenceable(48) @dp) #8
  %143 = call noundef ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKi2stEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %19)
  %144 = getelementptr inbounds %"struct.std::pair.6", ptr %143, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %144, i64 12, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  %145 = getelementptr inbounds %struct.st, ptr %18, i32 0, i32 0
  %146 = load i32, ptr %145, align 4, !tbaa !19
  %147 = icmp ne i32 %146, 0
  br i1 %147, label %148, label %151

148:                                              ; preds = %142
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %150 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %149, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %154

151:                                              ; preds = %142
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %152, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %154

154:                                              ; preds = %151, %148
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #8
  br label %27, !llvm.loop !31

155:                                              ; preds = %27
  %156 = load i32, ptr %1, align 4
  ret i32 %156
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #7

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #7

attributes #0 = { 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 #1 = { "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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { 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 #8 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTS2rt", !13, i64 0, !13, i64 1}
!13 = !{!"bool", !10, i64 0}
!14 = !{!12, !13, i64 1}
!15 = !{i64 0, i64 1, !16, i64 1, i64 1, !16}
!16 = !{!13, !13, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!20, !9, i64 0}
!20 = !{!"_ZTS2st", !9, i64 0, !9, i64 4, !9, i64 8}
!21 = !{!20, !9, i64 4}
!22 = !{!20, !9, i64 8}
!23 = !{i64 0, i64 4, !8, i64 4, i64 4, !8, i64 8, i64 4, !8}
!24 = !{!25, !9, i64 0}
!25 = !{!"_ZTSSt4pairIKi2rtE", !9, i64 0, !12, i64 4}
!26 = !{!27, !9, i64 0}
!27 = !{!"_ZTSSt4pairIKi2stE", !9, i64 0, !20, i64 4}
!28 = !{i8 0, i8 2}
!29 = !{}
!30 = distinct !{!30, !18}
!31 = distinct !{!31, !18}


; 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, rt>, std::_Select1st<std::pair<const int, rt>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, rt>, std::_Select1st<std::pair<const int, rt>>, 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 }
%"class.std::map.0" = type { %"class.std::_Rb_tree.1" }
%"class.std::_Rb_tree.1" = type { %"struct.std::_Rb_tree<int, std::pair<const int, st>, std::_Select1st<std::pair<const int, st>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, st>, std::_Select1st<std::pair<const int, st>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"class.std::reverse_iterator" = type { %"struct.std::_Rb_tree_iterator.5" }
%"struct.std::_Rb_tree_iterator.5" = type { ptr }

@T = external dso_local global i32, align 4
@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@b = external dso_local global %"class.std::map", align 8
@dp = external dso_local global %"class.std::map.0", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %5 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::reverse_iterator", align 8
  %8 = alloca %"class.std::reverse_iterator", align 8
  %9 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %10 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %12
  %14 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @T)
  %16 = load i32, ptr @T, align 4, !tbaa !8
  %17 = add nsw i32 %16, -1
  store i32 %17, ptr @T, align 4, !tbaa !8
  %.not28 = icmp eq i32 %16, 0
  br i1 %.not28, label %._crit_edge31, label %.lr.ph30

.lr.ph30:                                         ; preds = %0, %._crit_edge27
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 4 dereferenceable(4) @M)
  call void @_ZNSt3mapIi2rtSt4lessIiESaISt4pairIKiS0_EEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @b) #6
  call void @_ZNSt3mapIi2stSt4lessIiESaISt4pairIKiS0_EEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @dp) #6
  %20 = load i32, ptr @M, align 4, !tbaa !8
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %42, %.lr.ph30
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 0, ptr %3, align 4, !tbaa !8
  %22 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3mapIi2stSt4lessIiESaISt4pairIKiS0_EEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @dp, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i32 1, ptr %22, align 4, !tbaa !8
  %.sroa.413.0..sroa_idx = getelementptr inbounds i8, ptr %22, i64 4
  store i32 0, ptr %.sroa.413.0..sroa_idx, align 4, !tbaa !8
  %.sroa.514.0..sroa_idx = getelementptr inbounds i8, ptr %22, i64 8
  store i32 0, ptr %.sroa.514.0..sroa_idx, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %23 = call ptr @_ZNSt3mapIi2rtSt4lessIiESaISt4pairIKiS0_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @b) #6
  store ptr %23, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %24 = call ptr @_ZNSt3mapIi2rtSt4lessIiESaISt4pairIKiS0_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @b) #6
  store ptr %24, ptr %5, align 8
  %25 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKi2rtEES6_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br i1 %25, label %.lr.ph26, label %._crit_edge27

.lr.ph:                                           ; preds = %.lr.ph30, %42
  %.024 = phi i32 [ %43, %42 ], [ 0, %.lr.ph30 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %28 = call noundef i64 @_ZNKSt3mapIi2rtSt4lessIiESaISt4pairIKiS0_EEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48) @b, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %.not23 = icmp eq i64 %28, 0
  br i1 %.not23, label %29, label %31

29:                                               ; preds = %.lr.ph
  %30 = call noundef nonnull align 1 dereferenceable(2) ptr @_ZNSt3mapIi2rtSt4lessIiESaISt4pairIKiS0_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) @b, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i8 0, ptr %30, align 1, !tbaa !11
  %.sroa.416.0..sroa_idx = getelementptr inbounds i8, ptr %30, i64 1
  store i8 0, ptr %.sroa.416.0..sroa_idx, align 1, !tbaa !11
  br label %31

31:                                               ; preds = %29, %.lr.ph
  %32 = load i32, ptr %1, align 4, !tbaa !8
  %33 = icmp eq i32 %32, 1
  br i1 %33, label %34, label %36

34:                                               ; preds = %31
  %35 = call noundef nonnull align 1 dereferenceable(2) ptr @_ZNSt3mapIi2rtSt4lessIiESaISt4pairIKiS0_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) @b, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i8 1, ptr %35, align 1, !tbaa !13
  %.pr = load i32, ptr %1, align 4, !tbaa !8
  br label %36

36:                                               ; preds = %34, %31
  %37 = phi i32 [ %.pr, %34 ], [ %32, %31 ]
  %38 = icmp eq i32 %37, 2
  br i1 %38, label %39, label %42

39:                                               ; preds = %36
  %40 = call noundef nonnull align 1 dereferenceable(2) ptr @_ZNSt3mapIi2rtSt4lessIiESaISt4pairIKiS0_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) @b, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %41 = getelementptr inbounds i8, ptr %40, i64 1
  store i8 1, ptr %41, align 1, !tbaa !15
  br label %42

42:                                               ; preds = %39, %36
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %43 = add nuw nsw i32 %.024, 1
  %44 = load i32, ptr @M, align 4, !tbaa !8
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %.lr.ph, label %._crit_edge, !llvm.loop !16

._crit_edge27:                                    ; preds = %67, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @_ZNSt3mapIi2stSt4lessIiESaISt4pairIKiS0_EEE6rbeginEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %8, ptr noundef nonnull align 8 dereferenceable(48) @dp) #6
  %46 = call noundef ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKi2stEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
  %47 = getelementptr inbounds i8, ptr %46, i64 4
  %.sroa.0.0.copyload = load i32, ptr %47, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  %.not20 = icmp eq i32 %.sroa.0.0.copyload, 0
  %.str.3..str = select i1 %.not20, ptr @.str.3, ptr @.str
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %.str.3..str)
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %50 = load i32, ptr @T, align 4, !tbaa !8
  %51 = add nsw i32 %50, -1
  store i32 %51, ptr @T, align 4, !tbaa !8
  %.not = icmp eq i32 %50, 0
  br i1 %.not, label %._crit_edge31, label %.lr.ph30, !llvm.loop !18

.lr.ph26:                                         ; preds = %._crit_edge, %67
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %52 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKi2rtEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  %53 = load i32, ptr %52, align 4, !tbaa !19
  store i32 %53, ptr %6, align 4, !tbaa !8
  %54 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKi2rtEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  %55 = getelementptr inbounds i8, ptr %54, i64 4
  %.sroa.010.0.copyload = load i8, ptr %55, align 4, !tbaa !11
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %54, i64 5
  %.sroa.5.0.copyload = load i8, ptr %.sroa.5.0..sroa_idx, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  call void @_ZNSt3mapIi2stSt4lessIiESaISt4pairIKiS0_EEE6rbeginEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %7, ptr noundef nonnull align 8 dereferenceable(48) @dp) #6
  %56 = call noundef ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKi2stEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %57 = load i32, ptr %56, align 4, !tbaa !21
  %58 = load i32, ptr %6, align 4, !tbaa !8
  %59 = sub nsw i32 %58, %57
  %60 = srem i32 %59, 2
  %61 = call noundef ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKi2stEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %62 = getelementptr inbounds i8, ptr %61, i64 4
  %.sroa.03.0.copyload = load i32, ptr %62, align 4, !tbaa !8
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %61, i64 8
  %.sroa.6.0.copyload = load i32, ptr %.sroa.6.0..sroa_idx, align 4, !tbaa !8
  %.sroa.8.0..sroa_idx = getelementptr inbounds i8, ptr %61, i64 12
  %.sroa.8.0.copyload = load i32, ptr %.sroa.8.0..sroa_idx, align 4, !tbaa !8
  %63 = trunc i8 %.sroa.010.0.copyload to i1
  br i1 %63, label %64, label %.critedge

64:                                               ; preds = %.lr.ph26
  %65 = trunc i8 %.sroa.5.0.copyload to i1
  br i1 %65, label %67, label %66

66:                                               ; preds = %64
  %.not22 = icmp eq i32 %60, 0
  %.sroa.6.0.copyload..sroa.8.0.copyload = select i1 %.not22, i32 %.sroa.6.0.copyload, i32 %.sroa.8.0.copyload
  br label %67

.critedge:                                        ; preds = %.lr.ph26
  %.not21 = icmp eq i32 %60, 0
  %.sroa.8.0.copyload..sroa.6.0.copyload = select i1 %.not21, i32 %.sroa.8.0.copyload, i32 %.sroa.6.0.copyload
  br label %67

67:                                               ; preds = %64, %66, %.critedge
  %.sroa.9.2 = phi i32 [ 0, %66 ], [ %.sroa.03.0.copyload, %.critedge ], [ 0, %64 ]
  %.sroa.10.2 = phi i32 [ %.sroa.03.0.copyload, %66 ], [ 0, %.critedge ], [ 0, %64 ]
  %.sroa.02.4 = phi i32 [ %.sroa.6.0.copyload..sroa.8.0.copyload, %66 ], [ %.sroa.8.0.copyload..sroa.6.0.copyload, %.critedge ], [ %.sroa.03.0.copyload, %64 ]
  %68 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3mapIi2stSt4lessIiESaISt4pairIKiS0_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) @dp, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i32 %.sroa.02.4, ptr %68, align 4, !tbaa !8
  %.sroa.9.0..sroa_idx = getelementptr inbounds i8, ptr %68, i64 4
  store i32 %.sroa.9.2, ptr %.sroa.9.0..sroa_idx, align 4, !tbaa !8
  %.sroa.10.0..sroa_idx = getelementptr inbounds i8, ptr %68, i64 8
  store i32 %.sroa.10.2, ptr %.sroa.10.0..sroa_idx, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  %69 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKi2rtEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %4, i32 noundef 0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %70 = call ptr @_ZNSt3mapIi2rtSt4lessIiESaISt4pairIKiS0_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @b) #6
  store ptr %70, ptr %5, align 8
  %71 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKi2rtEES6_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br i1 %71, label %.lr.ph26, label %._crit_edge27, !llvm.loop !24

._crit_edge31:                                    ; preds = %._crit_edge27, %0
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

attributes #0 = { 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 #1 = { "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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !10, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"_ZTS2rt", !12, i64 0, !12, i64 1}
!15 = !{!14, !12, i64 1}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{!20, !9, i64 0}
!20 = !{!"_ZTSSt4pairIKi2rtE", !9, i64 0, !14, i64 4}
!21 = !{!22, !9, i64 0}
!22 = !{!"_ZTSSt4pairIKi2stE", !9, i64 0, !23, i64 4}
!23 = !{!"_ZTS2st", !9, i64 0, !9, i64 4, !9, i64 8}
!24 = distinct !{!24, !17}


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