; LLVM IR from AdarshGaur/Competitive-Programming :: Codeforces/Codeforces Round #829 (Div. 2)/D - Factorial Divisibility.ll (Z5solvev)

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

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::map", align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::map", align 8
  %9 = alloca ptr, align 8
  %10 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca ptr, align 8
  %23 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %24 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %25 = alloca %"struct.std::pair", align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.start.p0(i64 48, ptr %3) #5
  call void @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store i64 0, ptr %4, align 8, !tbaa !5
  br label %30

30:                                               ; preds = %42, %0
  %31 = load i64, ptr %4, align 8, !tbaa !5
  %32 = load i64, ptr %1, align 8, !tbaa !5
  %33 = icmp slt i64 %31, %32
  br i1 %33, label %35, label %34

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

35:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %36 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %37 unwind label %45

37:                                               ; preds = %35
  %38 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %39 unwind label %45

39:                                               ; preds = %37
  %40 = load i64, ptr %38, align 8, !tbaa !5
  %41 = add nsw i64 %40, 1
  store i64 %41, ptr %38, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %42

42:                                               ; preds = %39
  %43 = load i64, ptr %4, align 8, !tbaa !5
  %44 = add nsw i64 %43, 1
  store i64 %44, ptr %4, align 8, !tbaa !5
  br label %30, !llvm.loop !9

45:                                               ; preds = %37, %35
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %6, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  br label %236

49:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 48, ptr %8) #5
  call void @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr %3, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %50 = load ptr, ptr %9, align 8, !tbaa !11
  %51 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %50) #5
  %52 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %10, i32 0, i32 0
  store ptr %51, ptr %52, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %53 = load ptr, ptr %9, align 8, !tbaa !11
  %54 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %53) #5
  %55 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %11, i32 0, i32 0
  store ptr %54, ptr %55, align 8
  br label %56

56:                                               ; preds = %181, %49
  %57 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKllEES5_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  br i1 %57, label %59, label %58

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

59:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %60 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKllEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  store ptr %60, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %61 = load ptr, ptr %13, align 8, !tbaa !11
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EKllERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERS5_(ptr noundef nonnull align 8 dereferenceable(16) %61) #5
  store ptr %62, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %63 = load ptr, ptr %13, align 8, !tbaa !11
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EKllERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERS5_(ptr noundef nonnull align 8 dereferenceable(16) %63) #5
  store ptr %64, ptr %15, align 8, !tbaa !11
  %65 = load ptr, ptr %14, align 8, !tbaa !11
  %66 = load i64, ptr %65, align 8, !tbaa !5
  %67 = load i64, ptr %2, align 8, !tbaa !5
  %68 = icmp eq i64 %66, %67
  br i1 %68, label %69, label %70

69:                                               ; preds = %59
  store i32 6, ptr %12, align 4
  br label %178

70:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %71 = load ptr, ptr %14, align 8, !tbaa !11
  %72 = load i64, ptr %71, align 8, !tbaa !5
  %73 = add nsw i64 %72, 1
  store i64 %73, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %74 = load ptr, ptr %15, align 8, !tbaa !11
  %75 = load i64, ptr %74, align 8, !tbaa !5
  store i64 %75, ptr %17, align 8, !tbaa !5
  br label %76

76:                                               ; preds = %87, %70
  %77 = load i64, ptr %16, align 8, !tbaa !5
  %78 = load i64, ptr %2, align 8, !tbaa !5
  %79 = icmp sle i64 %77, %78
  br i1 %79, label %80, label %85

80:                                               ; preds = %76
  %81 = load i64, ptr %17, align 8, !tbaa !5
  %82 = load i64, ptr %16, align 8, !tbaa !5
  %83 = srem i64 %81, %82
  %84 = icmp eq i64 %83, 0
  br label %85

85:                                               ; preds = %80, %76
  %86 = phi i1 [ false, %76 ], [ %84, %80 ]
  br i1 %86, label %87, label %93

87:                                               ; preds = %85
  %88 = load i64, ptr %16, align 8, !tbaa !5
  %89 = load i64, ptr %17, align 8, !tbaa !5
  %90 = sdiv i64 %89, %88
  store i64 %90, ptr %17, align 8, !tbaa !5
  %91 = load i64, ptr %16, align 8, !tbaa !5
  %92 = add nsw i64 %91, 1
  store i64 %92, ptr %16, align 8, !tbaa !5
  br label %76, !llvm.loop !13

93:                                               ; preds = %85
  %94 = load i64, ptr %16, align 8, !tbaa !5
  %95 = load i64, ptr %2, align 8, !tbaa !5
  %96 = icmp sgt i64 %94, %95
  br i1 %96, label %97, label %98

97:                                               ; preds = %93
  store i32 6, ptr %12, align 4
  br label %175

98:                                               ; preds = %93
  %99 = invoke noundef i64 @_ZNKSt3mapIllSt4lessIlESaISt4pairIKllEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %100 unwind label %108

100:                                              ; preds = %98
  %101 = icmp ne i64 %99, 0
  br i1 %101, label %102, label %112

102:                                              ; preds = %100
  %103 = load i64, ptr %17, align 8, !tbaa !5
  %104 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %105 unwind label %108

105:                                              ; preds = %102
  %106 = load i64, ptr %104, align 8, !tbaa !5
  %107 = add nsw i64 %106, %103
  store i64 %107, ptr %104, align 8, !tbaa !5
  br label %116

108:                                              ; preds = %150, %121, %112, %102, %98
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %6, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %7, align 4
  br label %183

112:                                              ; preds = %100
  %113 = load i64, ptr %17, align 8, !tbaa !5
  %114 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %115 unwind label %108

115:                                              ; preds = %112
  store i64 %113, ptr %114, align 8, !tbaa !5
  br label %116

116:                                              ; preds = %115, %105
  br label %117

117:                                              ; preds = %165, %116
  %118 = load i64, ptr %16, align 8, !tbaa !5
  %119 = load i64, ptr %2, align 8, !tbaa !5
  %120 = icmp sle i64 %118, %119
  br i1 %120, label %121, label %128

121:                                              ; preds = %117
  %122 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %123 unwind label %108

123:                                              ; preds = %121
  %124 = load i64, ptr %122, align 8, !tbaa !5
  %125 = load i64, ptr %16, align 8, !tbaa !5
  %126 = srem i64 %124, %125
  %127 = icmp eq i64 %126, 0
  br label %128

128:                                              ; preds = %123, %117
  %129 = phi i1 [ false, %117 ], [ %127, %123 ]
  br i1 %129, label %130, label %174

130:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %131 = load i64, ptr %16, align 8, !tbaa !5
  %132 = add nsw i64 %131, 1
  store i64 %132, ptr %18, align 8, !tbaa !5
  %133 = invoke noundef i64 @_ZNKSt3mapIllSt4lessIlESaISt4pairIKllEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %134 unwind label %142

134:                                              ; preds = %130
  %135 = icmp ne i64 %133, 0
  %136 = xor i1 %135, true
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br i1 %136, label %137, label %150

137:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %138 = load i64, ptr %16, align 8, !tbaa !5
  %139 = add nsw i64 %138, 1
  store i64 %139, ptr %19, align 8, !tbaa !5
  %140 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixEOl(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %19)
          to label %141 unwind label %146

141:                                              ; preds = %137
  store i64 0, ptr %140, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %150

142:                                              ; preds = %130
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %6, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %183

146:                                              ; preds = %137
  %147 = landingpad { ptr, i32 }
          cleanup
  %148 = extractvalue { ptr, i32 } %147, 0
  store ptr %148, ptr %6, align 8
  %149 = extractvalue { ptr, i32 } %147, 1
  store i32 %149, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %183

150:                                              ; preds = %141, %134
  %151 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %152 unwind label %108

152:                                              ; preds = %150
  %153 = load i64, ptr %151, align 8, !tbaa !5
  %154 = load i64, ptr %16, align 8, !tbaa !5
  %155 = sdiv i64 %153, %154
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %156 = load i64, ptr %16, align 8, !tbaa !5
  %157 = add nsw i64 %156, 1
  store i64 %157, ptr %20, align 8, !tbaa !5
  %158 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixEOl(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %20)
          to label %159 unwind label %166

159:                                              ; preds = %152
  %160 = load i64, ptr %158, align 8, !tbaa !5
  %161 = add nsw i64 %160, %155
  store i64 %161, ptr %158, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %162 = load i64, ptr %16, align 8, !tbaa !5
  %163 = add nsw i64 %162, 1
  store i64 %163, ptr %16, align 8, !tbaa !5
  store i64 %162, ptr %21, align 8, !tbaa !5
  %164 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixEOl(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %21)
          to label %165 unwind label %170

165:                                              ; preds = %159
  store i64 0, ptr %164, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %117, !llvm.loop !14

166:                                              ; preds = %152
  %167 = landingpad { ptr, i32 }
          cleanup
  %168 = extractvalue { ptr, i32 } %167, 0
  store ptr %168, ptr %6, align 8
  %169 = extractvalue { ptr, i32 } %167, 1
  store i32 %169, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %183

170:                                              ; preds = %159
  %171 = landingpad { ptr, i32 }
          cleanup
  %172 = extractvalue { ptr, i32 } %171, 0
  store ptr %172, ptr %6, align 8
  %173 = extractvalue { ptr, i32 } %171, 1
  store i32 %173, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %183

174:                                              ; preds = %128
  store i32 0, ptr %12, align 4
  br label %175

175:                                              ; preds = %174, %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  %176 = load i32, ptr %12, align 4
  switch i32 %176, label %178 [
    i32 0, label %177
  ]

177:                                              ; preds = %175
  store i32 0, ptr %12, align 4
  br label %178

178:                                              ; preds = %177, %175, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  %179 = load i32, ptr %12, align 4
  switch i32 %179, label %242 [
    i32 0, label %180
    i32 6, label %181
  ]

180:                                              ; preds = %178
  br label %181

181:                                              ; preds = %180, %178
  %182 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKllEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  br label %56

183:                                              ; preds = %170, %166, %146, %142, %108
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %235

184:                                              ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  store ptr %8, ptr %22, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %185 = load ptr, ptr %22, align 8, !tbaa !11
  %186 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %185) #5
  %187 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %23, i32 0, i32 0
  store ptr %186, ptr %187, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %188 = load ptr, ptr %22, align 8, !tbaa !11
  %189 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %188) #5
  %190 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %24, i32 0, i32 0
  store ptr %189, ptr %190, align 8
  br label %191

191:                                              ; preds = %219, %184
  %192 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKllEES5_(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(8) %24) #5
  br i1 %192, label %194, label %193

193:                                              ; preds = %191
  store i32 11, ptr %12, align 4
  br label %221

194:                                              ; preds = %191
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #5
  %195 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKllEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %25, ptr align 8 %195, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %196 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EKllEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS5_(ptr noundef nonnull align 8 dereferenceable(16) %25) #5
  store ptr %196, ptr %26, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %197 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EKllEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS5_(ptr noundef nonnull align 8 dereferenceable(16) %25) #5
  store ptr %197, ptr %27, align 8, !tbaa !11
  %198 = load ptr, ptr %26, align 8, !tbaa !11
  %199 = load i64, ptr %198, align 8, !tbaa !5
  %200 = load i64, ptr %2, align 8, !tbaa !5
  %201 = icmp sle i64 %199, %200
  br i1 %201, label %202, label %215

202:                                              ; preds = %194
  %203 = load ptr, ptr %27, align 8, !tbaa !11
  %204 = load i64, ptr %203, align 8, !tbaa !5
  %205 = icmp ne i64 %204, 0
  br i1 %205, label %206, label %215

206:                                              ; preds = %202
  %207 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %208 unwind label %211

208:                                              ; preds = %206
  %209 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %207, ptr noundef @.str.1)
          to label %210 unwind label %211

210:                                              ; preds = %208
  store i32 1, ptr %12, align 4
  br label %216

211:                                              ; preds = %208, %206
  %212 = landingpad { ptr, i32 }
          cleanup
  %213 = extractvalue { ptr, i32 } %212, 0
  store ptr %213, ptr %6, align 8
  %214 = extractvalue { ptr, i32 } %212, 1
  store i32 %214, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %235

215:                                              ; preds = %202, %194
  store i32 0, ptr %12, align 4
  br label %216

216:                                              ; preds = %215, %210
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #5
  %217 = load i32, ptr %12, align 4
  switch i32 %217, label %221 [
    i32 0, label %218
  ]

218:                                              ; preds = %216
  br label %219

219:                                              ; preds = %218
  %220 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKllEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #5
  br label %191

221:                                              ; preds = %216, %193
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  %222 = load i32, ptr %12, align 4
  switch i32 %222, label %228 [
    i32 11, label %223
  ]

223:                                              ; preds = %221
  %224 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
          to label %225 unwind label %231

225:                                              ; preds = %223
  %226 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %224, ptr noundef @.str.1)
          to label %227 unwind label %231

227:                                              ; preds = %225
  store i32 0, ptr %12, align 4
  br label %228

228:                                              ; preds = %227, %221
  call void @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %8) #5
  call void @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  %229 = load i32, ptr %12, align 4
  switch i32 %229, label %242 [
    i32 0, label %230
    i32 1, label %230
  ]

230:                                              ; preds = %228, %228
  ret void

231:                                              ; preds = %225, %223
  %232 = landingpad { ptr, i32 }
          cleanup
  %233 = extractvalue { ptr, i32 } %232, 0
  store ptr %233, ptr %6, align 8
  %234 = extractvalue { ptr, i32 } %232, 1
  store i32 %234, ptr %7, align 4
  br label %235

235:                                              ; preds = %231, %211, %183
  call void @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %8) #5
  br label %236

236:                                              ; preds = %235, %45
  call void @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  br label %237

237:                                              ; preds = %236
  %238 = load ptr, ptr %6, align 8
  %239 = load i32, ptr %7, align 4
  %240 = insertvalue { ptr, i32 } poison, ptr %238, 0
  %241 = insertvalue { ptr, i32 } %240, i32 %239, 1
  resume { ptr, i32 } %241

242:                                              ; preds = %228, %178
  unreachable
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EKllEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS5_(ptr noundef nonnull align 8 dereferenceable(16)) #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) #4

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::map", align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::map", align 8
  %6 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %7 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %14 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %15 = alloca %"struct.std::pair", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #5
  call void @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  %18 = load i64, ptr %1, align 8, !tbaa !5
  %19 = icmp sgt i64 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %26, %0
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #5
  call void @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %20 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  store ptr %20, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %21 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  store ptr %21, ptr %7, align 8
  %22 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKllEES5_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  br i1 %22, label %.lr.ph59, label %._crit_edge60

.lr.ph:                                           ; preds = %0, %26
  %.049 = phi i64 [ %29, %26 ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %23 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %24 unwind label %32

24:                                               ; preds = %.lr.ph
  %25 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %26 unwind label %32

26:                                               ; preds = %24
  %27 = load i64, ptr %25, align 8, !tbaa !5
  %28 = add nsw i64 %27, 1
  store i64 %28, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %29 = add nuw nsw i64 %.049, 1
  %30 = load i64, ptr %1, align 8, !tbaa !5
  %31 = icmp slt i64 %29, %30
  br i1 %31, label %.lr.ph, label %._crit_edge, !llvm.loop !9

32:                                               ; preds = %24, %.lr.ph
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %131

._crit_edge60:                                    ; preds = %105, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  %34 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  store ptr %34, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %35 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  store ptr %35, ptr %14, align 8
  %36 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKllEES5_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  br i1 %36, label %.lr.ph62, label %._crit_edge63

.lr.ph59:                                         ; preds = %._crit_edge, %105
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKllEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EKllERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERS5_(ptr noundef nonnull align 8 dereferenceable(16) %37) #5
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EKllERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERS5_(ptr noundef nonnull align 8 dereferenceable(16) %37) #5
  %40 = load i64, ptr %38, align 8, !tbaa !5
  %41 = load i64, ptr %2, align 8, !tbaa !5
  %42 = icmp eq i64 %40, %41
  br i1 %42, label %105, label %43

43:                                               ; preds = %.lr.ph59
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %44 = add nsw i64 %40, 1
  store i64 %44, ptr %8, align 8, !tbaa !5
  %.not3550.not = icmp slt i64 %40, %41
  br i1 %.not3550.not, label %.lr.ph53.preheader, label %.critedge4

.lr.ph53.preheader:                               ; preds = %43
  %45 = load i64, ptr %39, align 8, !tbaa !5
  br label %.lr.ph53

.lr.ph53:                                         ; preds = %.lr.ph53.preheader, %50
  %.02951 = phi i64 [ %48, %50 ], [ %45, %.lr.ph53.preheader ]
  %46 = phi i64 [ %51, %50 ], [ %44, %.lr.ph53.preheader ]
  %47 = srem i64 %.02951, %46
  %48 = sdiv i64 %.02951, %46
  %49 = icmp eq i64 %47, 0
  br i1 %49, label %50, label %.critedge

50:                                               ; preds = %.lr.ph53
  %51 = add i64 %46, 1
  store i64 %51, ptr %8, align 8, !tbaa !5
  %exitcond.not = icmp eq i64 %46, %41
  br i1 %exitcond.not, label %.critedge4, label %.lr.ph53, !llvm.loop !11

.critedge:                                        ; preds = %.lr.ph53
  %52 = invoke noundef i64 @_ZNKSt3mapIllSt4lessIlESaISt4pairIKllEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %53 unwind label %.loopexit.split-lp

53:                                               ; preds = %.critedge
  %.not36 = icmp eq i64 %52, 0
  br i1 %.not36, label %59, label %54

54:                                               ; preds = %53
  %55 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %56 unwind label %.loopexit.split-lp

56:                                               ; preds = %54
  %57 = load i64, ptr %55, align 8, !tbaa !5
  %58 = add nsw i64 %57, %.02951
  store i64 %58, ptr %55, align 8, !tbaa !5
  br label %62

.loopexit:                                        ; preds = %.lr.ph56, %84
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %108

.loopexit.split-lp:                               ; preds = %.critedge, %54, %59
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %108

59:                                               ; preds = %53
  %60 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %61 unwind label %.loopexit.split-lp

61:                                               ; preds = %59
  store i64 %.02951, ptr %60, align 8, !tbaa !5
  br label %62

62:                                               ; preds = %61, %56
  %63 = load i64, ptr %8, align 8, !tbaa !5
  %64 = load i64, ptr %2, align 8, !tbaa !5
  %.not3754 = icmp sgt i64 %63, %64
  br i1 %.not3754, label %.critedge4, label %.lr.ph56

.lr.ph56:                                         ; preds = %62, %98
  %65 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %66 unwind label %.loopexit

66:                                               ; preds = %.lr.ph56
  %67 = load i64, ptr %65, align 8, !tbaa !5
  %68 = load i64, ptr %8, align 8, !tbaa !5
  %69 = srem i64 %67, %68
  %70 = icmp eq i64 %69, 0
  br i1 %70, label %71, label %.critedge4

71:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %72 = add nsw i64 %68, 1
  store i64 %72, ptr %9, align 8, !tbaa !5
  %73 = invoke noundef i64 @_ZNKSt3mapIllSt4lessIlESaISt4pairIKllEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %74 unwind label %80

74:                                               ; preds = %71
  %.not38 = icmp eq i64 %73, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br i1 %.not38, label %75, label %84

75:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %76 = load i64, ptr %8, align 8, !tbaa !5
  %77 = add nsw i64 %76, 1
  store i64 %77, ptr %10, align 8, !tbaa !5
  %78 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixEOl(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %79 unwind label %82

79:                                               ; preds = %75
  store i64 0, ptr %78, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  br label %84

80:                                               ; preds = %71
  %81 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br label %108

82:                                               ; preds = %75
  %83 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  br label %108

84:                                               ; preds = %79, %74
  %85 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %86 unwind label %.loopexit

86:                                               ; preds = %84
  %87 = load i64, ptr %85, align 8, !tbaa !5
  %88 = load i64, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %89 = add nsw i64 %88, 1
  store i64 %89, ptr %11, align 8, !tbaa !5
  %90 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixEOl(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %91 unwind label %101

91:                                               ; preds = %86
  %92 = sdiv i64 %87, %88
  %93 = load i64, ptr %90, align 8, !tbaa !5
  %94 = add nsw i64 %93, %92
  store i64 %94, ptr %90, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  %95 = load i64, ptr %8, align 8, !tbaa !5
  %96 = add nsw i64 %95, 1
  store i64 %96, ptr %8, align 8, !tbaa !5
  store i64 %95, ptr %12, align 8, !tbaa !5
  %97 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixEOl(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %98 unwind label %103

98:                                               ; preds = %91
  store i64 0, ptr %97, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  %99 = load i64, ptr %8, align 8, !tbaa !5
  %100 = load i64, ptr %2, align 8, !tbaa !5
  %.not37 = icmp sgt i64 %99, %100
  br i1 %.not37, label %.critedge4, label %.lr.ph56, !llvm.loop !12

101:                                              ; preds = %86
  %102 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br label %108

103:                                              ; preds = %91
  %104 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  br label %108

.critedge4:                                       ; preds = %50, %98, %66, %43, %62
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  br label %105

105:                                              ; preds = %.lr.ph59, %.critedge4
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKllEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %107 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKllEES5_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  br i1 %107, label %.lr.ph59, label %._crit_edge60

108:                                              ; preds = %.loopexit, %.loopexit.split-lp, %103, %101, %82, %80
  %.pn = phi { ptr, i32 } [ %104, %103 ], [ %102, %101 ], [ %83, %82 ], [ %81, %80 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %130

.lr.ph62:                                         ; preds = %._crit_edge60, %121
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #5
  %109 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKllEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(16) %109, i64 16, i1 false)
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EKllEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS5_(ptr noundef nonnull align 8 dereferenceable(16) %15) #5
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EKllEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS5_(ptr noundef nonnull align 8 dereferenceable(16) %15) #5
  %112 = load i64, ptr %110, align 8, !tbaa !5
  %113 = load i64, ptr %2, align 8, !tbaa !5
  %.not = icmp sgt i64 %112, %113
  %114 = load i64, ptr %111, align 8
  %.not34 = icmp eq i64 %114, 0
  %or.cond = select i1 %.not, i1 true, i1 %.not34
  br i1 %or.cond, label %121, label %115

115:                                              ; preds = %.lr.ph62
  %116 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
          to label %117 unwind label %119

117:                                              ; preds = %115
  %118 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %116, ptr noundef nonnull @.str.1)
          to label %.critedge44 unwind label %119

119:                                              ; preds = %117, %115
  %120 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  br label %130

121:                                              ; preds = %.lr.ph62
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #5
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKllEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  %123 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKllEES5_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  br i1 %123, label %.lr.ph62, label %._crit_edge63

.critedge44:                                      ; preds = %117
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  br label %127

._crit_edge63:                                    ; preds = %121, %._crit_edge60
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  %124 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.2)
          to label %125 unwind label %128

125:                                              ; preds = %._crit_edge63
  %126 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %124, ptr noundef nonnull @.str.1)
          to label %127 unwind label %128

127:                                              ; preds = %.critedge44, %125
  call void @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #5
  call void @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret void

128:                                              ; preds = %125, %._crit_edge63
  %129 = landingpad { ptr, i32 }
          cleanup
  br label %130

130:                                              ; preds = %128, %119, %108
  %.pn.pn = phi { ptr, i32 } [ %.pn, %108 ], [ %129, %128 ], [ %120, %119 ]
  call void @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #5
  br label %131

131:                                              ; preds = %130, %32
  %.pn41 = phi { ptr, i32 } [ %33, %32 ], [ %.pn.pn, %130 ]
  call void @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn41
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EKllEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS5_(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #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 #4

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


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