; LLVM IR from DionysiosB/CodeForces :: 1500-1599 (1598B-Groups)

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

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = 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 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::map", align 8
  %6 = alloca %"class.std::map", align 8
  %7 = alloca %"class.std::map", align 8
  %8 = alloca %"class.std::map", align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::vector", align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::allocator.0", align 1
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca %"struct.std::pair", align 8
  %20 = alloca i8, align 1
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca %"struct.std::pair", align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 5, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  br label %25

25:                                               ; preds = %215, %0
  %26 = load i64, ptr %3, align 8, !tbaa !9
  %27 = add nsw i64 %26, -1
  store i64 %27, ptr %3, align 8, !tbaa !9
  %28 = icmp ne i64 %26, 0
  br i1 %28, label %29, label %222

29:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %4)
  call void @llvm.lifetime.start.p0(i64 48, ptr %5) #5
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  call void @llvm.lifetime.start.p0(i64 48, ptr %6) #5
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.start.p0(i64 48, ptr %7) #5
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #5
  call void @llvm.lifetime.start.p0(i64 48, ptr %8) #5
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %31

31:                                               ; preds = %131, %29
  %32 = load i64, ptr %9, align 8, !tbaa !9
  %33 = load i64, ptr %4, align 8, !tbaa !9
  %34 = icmp slt i64 %32, %33
  br i1 %34, label %36, label %35

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

36:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #5
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef 5, ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %37 unwind label %42

37:                                               ; preds = %36
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store i64 0, ptr %16, align 8, !tbaa !9
  br label %38

38:                                               ; preds = %51, %37
  %39 = load i64, ptr %16, align 8, !tbaa !9
  %40 = icmp slt i64 %39, 5
  br i1 %40, label %46, label %41

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

42:                                               ; preds = %36
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %14, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %15, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %135

46:                                               ; preds = %38
  %47 = load i64, ptr %16, align 8, !tbaa !9
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %47) #5
  %49 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %48)
          to label %50 unwind label %54

50:                                               ; preds = %46
  br label %51

51:                                               ; preds = %50
  %52 = load i64, ptr %16, align 8, !tbaa !9
  %53 = add nsw i64 %52, 1
  store i64 %53, ptr %16, align 8, !tbaa !9
  br label %38, !llvm.loop !11

54:                                               ; preds = %46
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %14, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %134

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

59:                                               ; preds = %127, %58
  %60 = load i64, ptr %17, align 8, !tbaa !9
  %61 = icmp slt i64 %60, 5
  br i1 %61, label %63, label %62

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

63:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %64 = load i64, ptr %17, align 8, !tbaa !9
  %65 = add nsw i64 %64, 1
  store i64 %65, ptr %18, align 8, !tbaa !9
  br label %66

66:                                               ; preds = %123, %63
  %67 = load i64, ptr %18, align 8, !tbaa !9
  %68 = icmp slt i64 %67, 5
  br i1 %68, label %70, label %69

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

70:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #5
  %71 = invoke { i64, i64 } @_ZSt9make_pairIRlS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %72 unwind label %91

72:                                               ; preds = %70
  %73 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 0
  %74 = extractvalue { i64, i64 } %71, 0
  store i64 %74, ptr %73, align 8
  %75 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 1
  %76 = extractvalue { i64, i64 } %71, 1
  store i64 %76, ptr %75, align 8
  %77 = load i64, ptr %17, align 8, !tbaa !9
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %77) #5
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %81, label %95

81:                                               ; preds = %72
  %82 = load i64, ptr %18, align 8, !tbaa !9
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %82) #5
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %95

86:                                               ; preds = %81
  %87 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 8 dereferenceable(16) %19)
          to label %88 unwind label %91

88:                                               ; preds = %86
  %89 = load i64, ptr %87, align 8, !tbaa !9
  %90 = add nsw i64 %89, 1
  store i64 %90, ptr %87, align 8, !tbaa !9
  br label %122

91:                                               ; preds = %115, %110, %100, %86, %70
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %14, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %134

95:                                               ; preds = %81, %72
  %96 = load i64, ptr %17, align 8, !tbaa !9
  %97 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %96) #5
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %105

100:                                              ; preds = %95
  %101 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(16) %19)
          to label %102 unwind label %91

102:                                              ; preds = %100
  %103 = load i64, ptr %101, align 8, !tbaa !9
  %104 = add nsw i64 %103, 1
  store i64 %104, ptr %101, align 8, !tbaa !9
  br label %121

105:                                              ; preds = %95
  %106 = load i64, ptr %18, align 8, !tbaa !9
  %107 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %106) #5
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = icmp ne i32 %108, 0
  br i1 %109, label %110, label %115

110:                                              ; preds = %105
  %111 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 8 dereferenceable(16) %19)
          to label %112 unwind label %91

112:                                              ; preds = %110
  %113 = load i64, ptr %111, align 8, !tbaa !9
  %114 = add nsw i64 %113, 1
  store i64 %114, ptr %111, align 8, !tbaa !9
  br label %120

115:                                              ; preds = %105
  %116 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(16) %19)
          to label %117 unwind label %91

117:                                              ; preds = %115
  %118 = load i64, ptr %116, align 8, !tbaa !9
  %119 = add nsw i64 %118, 1
  store i64 %119, ptr %116, align 8, !tbaa !9
  br label %120

120:                                              ; preds = %117, %112
  br label %121

121:                                              ; preds = %120, %102
  br label %122

122:                                              ; preds = %121, %88
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #5
  br label %123

123:                                              ; preds = %122
  %124 = load i64, ptr %18, align 8, !tbaa !9
  %125 = add nsw i64 %124, 1
  store i64 %125, ptr %18, align 8, !tbaa !9
  br label %66, !llvm.loop !13

126:                                              ; preds = %69
  br label %127

127:                                              ; preds = %126
  %128 = load i64, ptr %17, align 8, !tbaa !9
  %129 = add nsw i64 %128, 1
  store i64 %129, ptr %17, align 8, !tbaa !9
  br label %59, !llvm.loop !14

130:                                              ; preds = %62
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #5
  br label %131

131:                                              ; preds = %130
  %132 = load i64, ptr %9, align 8, !tbaa !9
  %133 = add nsw i64 %132, 1
  store i64 %133, ptr %9, align 8, !tbaa !9
  br label %31, !llvm.loop !15

134:                                              ; preds = %91, %54
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  br label %135

135:                                              ; preds = %134, %42
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %221

136:                                              ; preds = %35
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #5
  store i8 0, ptr %20, align 1, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  store i64 0, ptr %21, align 8, !tbaa !9
  br label %137

137:                                              ; preds = %206, %136
  %138 = load i8, ptr %20, align 1, !tbaa !16, !range !18, !noundef !19
  %139 = trunc i8 %138 to i1
  br i1 %139, label %143, label %140

140:                                              ; preds = %137
  %141 = load i64, ptr %21, align 8, !tbaa !9
  %142 = icmp slt i64 %141, 5
  br label %143

143:                                              ; preds = %140, %137
  %144 = phi i1 [ false, %137 ], [ %142, %140 ]
  br i1 %144, label %146, label %145

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

146:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %147 = load i64, ptr %21, align 8, !tbaa !9
  %148 = add nsw i64 %147, 1
  store i64 %148, ptr %22, align 8, !tbaa !9
  br label %149

149:                                              ; preds = %201, %146
  %150 = load i8, ptr %20, align 1, !tbaa !16, !range !18, !noundef !19
  %151 = trunc i8 %150 to i1
  br i1 %151, label %155, label %152

152:                                              ; preds = %149
  %153 = load i64, ptr %22, align 8, !tbaa !9
  %154 = icmp slt i64 %153, 5
  br label %155

155:                                              ; preds = %152, %149
  %156 = phi i1 [ false, %149 ], [ %154, %152 ]
  br i1 %156, label %158, label %157

157:                                              ; preds = %155
  store i32 19, ptr %10, align 4
  br label %204

158:                                              ; preds = %155
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #5
  %159 = invoke { i64, i64 } @_ZSt9make_pairIRlS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22)
          to label %160 unwind label %170

160:                                              ; preds = %158
  %161 = getelementptr inbounds { i64, i64 }, ptr %23, i32 0, i32 0
  %162 = extractvalue { i64, i64 } %159, 0
  store i64 %162, ptr %161, align 8
  %163 = getelementptr inbounds { i64, i64 }, ptr %23, i32 0, i32 1
  %164 = extractvalue { i64, i64 } %159, 1
  store i64 %164, ptr %163, align 8
  %165 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(16) %23)
          to label %166 unwind label %170

166:                                              ; preds = %160
  %167 = load i64, ptr %165, align 8, !tbaa !9
  %168 = icmp sgt i64 %167, 0
  br i1 %168, label %169, label %174

169:                                              ; preds = %166
  store i32 21, ptr %10, align 4
  br label %198

170:                                              ; preds = %187, %185, %176, %174, %160, %158
  %171 = landingpad { ptr, i32 }
          cleanup
  %172 = extractvalue { ptr, i32 } %171, 0
  store ptr %172, ptr %14, align 8
  %173 = extractvalue { ptr, i32 } %171, 1
  store i32 %173, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %220

174:                                              ; preds = %166
  %175 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(16) %23)
          to label %176 unwind label %170

176:                                              ; preds = %174
  %177 = load i64, ptr %175, align 8, !tbaa !9
  %178 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 8 dereferenceable(16) %23)
          to label %179 unwind label %170

179:                                              ; preds = %176
  %180 = load i64, ptr %178, align 8, !tbaa !9
  %181 = add nsw i64 %177, %180
  %182 = load i64, ptr %4, align 8, !tbaa !9
  %183 = sdiv i64 %182, 2
  %184 = icmp sge i64 %181, %183
  br i1 %184, label %185, label %197

185:                                              ; preds = %179
  %186 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 8 dereferenceable(16) %23)
          to label %187 unwind label %170

187:                                              ; preds = %185
  %188 = load i64, ptr %186, align 8, !tbaa !9
  %189 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 8 dereferenceable(16) %23)
          to label %190 unwind label %170

190:                                              ; preds = %187
  %191 = load i64, ptr %189, align 8, !tbaa !9
  %192 = add nsw i64 %188, %191
  %193 = load i64, ptr %4, align 8, !tbaa !9
  %194 = sdiv i64 %193, 2
  %195 = icmp sge i64 %192, %194
  br i1 %195, label %196, label %197

196:                                              ; preds = %190
  store i8 1, ptr %20, align 1, !tbaa !16
  store i32 19, ptr %10, align 4
  br label %198

197:                                              ; preds = %190, %179
  store i32 0, ptr %10, align 4
  br label %198

198:                                              ; preds = %197, %196, %169
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #5
  %199 = load i32, ptr %10, align 4
  switch i32 %199, label %204 [
    i32 0, label %200
    i32 21, label %201
  ]

200:                                              ; preds = %198
  br label %201

201:                                              ; preds = %200, %198
  %202 = load i64, ptr %22, align 8, !tbaa !9
  %203 = add nsw i64 %202, 1
  store i64 %203, ptr %22, align 8, !tbaa !9
  br label %149, !llvm.loop !20

204:                                              ; preds = %198, %157
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %205

205:                                              ; preds = %204
  br label %206

206:                                              ; preds = %205
  %207 = load i64, ptr %21, align 8, !tbaa !9
  %208 = add nsw i64 %207, 1
  store i64 %208, ptr %21, align 8, !tbaa !9
  br label %137, !llvm.loop !21

209:                                              ; preds = %145
  %210 = load i8, ptr %20, align 1, !tbaa !16, !range !18, !noundef !19
  %211 = trunc i8 %210 to i1
  %212 = zext i1 %211 to i64
  %213 = select i1 %211, ptr @.str.2, ptr @.str.3
  %214 = invoke i32 @puts(ptr noundef %213)
          to label %215 unwind label %216

215:                                              ; preds = %209
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #5
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %8) #5
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %7) #5
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %6) #5
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  br label %25, !llvm.loop !22

216:                                              ; preds = %209
  %217 = landingpad { ptr, i32 }
          cleanup
  %218 = extractvalue { ptr, i32 } %217, 0
  store ptr %218, ptr %14, align 8
  %219 = extractvalue { ptr, i32 } %217, 1
  store i32 %219, ptr %15, align 4
  br label %220

220:                                              ; preds = %216, %170
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #5
  br label %221

221:                                              ; preds = %220, %135
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %8) #5
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %7) #5
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %6) #5
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %224

222:                                              ; preds = %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %223 = load i32, ptr %1, align 4
  ret i32 %223

224:                                              ; preds = %221
  %225 = load ptr, ptr %14, align 8
  %226 = load i32, ptr %15, align 4
  %227 = insertvalue { ptr, i32 } poison, ptr %225, 0
  %228 = insertvalue { ptr, i32 } %227, i32 %226, 1
  resume { ptr, i32 } %228
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

; 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 noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIRlS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

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

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

declare i32 @puts(ptr noundef) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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

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

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


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

%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<long, long>, std::pair<const std::pair<long, long>, long>, std::_Select1st<std::pair<const std::pair<long, long>, long>>, std::less<std::pair<long, long>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long, long>, std::pair<const std::pair<long, long>, long>, std::_Select1st<std::pair<const std::pair<long, long>, long>>, std::less<std::pair<long, long>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.0" = type { i8 }
%"struct.std::pair" = type { i64, i64 }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = 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 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::map", align 8
  %4 = alloca %"class.std::map", align 8
  %5 = alloca %"class.std::map", align 8
  %6 = alloca %"class.std::map", align 8
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::allocator.0", align 1
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca %"struct.std::pair", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %17 = load i64, ptr %1, align 8, !tbaa !5
  %18 = add nsw i64 %17, -1
  store i64 %18, ptr %1, align 8, !tbaa !5
  %.not52 = icmp eq i64 %17, 0
  br i1 %.not52, label %._crit_edge55, label %.lr.ph54

.lr.ph54:                                         ; preds = %0
  %19 = getelementptr inbounds i8, ptr %12, i64 8
  %20 = getelementptr inbounds i8, ptr %15, i64 8
  br label %21

21:                                               ; preds = %.lr.ph54, %73
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #5
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #5
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #5
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #5
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  %23 = load i64, ptr %2, align 8, !tbaa !5
  %24 = icmp sgt i64 %23, 0
  br i1 %24, label %.lr.ph42, label %._crit_edge43

._crit_edge43:                                    ; preds = %.loopexit62, %21
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  store i64 0, ptr %13, align 8, !tbaa !5
  br label %78

.lr.ph42:                                         ; preds = %21, %.loopexit62
  %.01740 = phi i64 [ %38, %.loopexit62 ], [ 0, %21 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %9) #5
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef 5, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %25 unwind label %36

25:                                               ; preds = %.lr.ph42
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef 0) #5
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %26)
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef 1) #5
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %28)
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef 2) #5
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %30)
  %32 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef 3) #5
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %32)
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef 4) #5
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %34)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  store i64 0, ptr %10, align 8, !tbaa !5
  br label %41

36:                                               ; preds = %.lr.ph42
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  br label %71

.loopexit62:                                      ; preds = %._crit_edge, %._crit_edge.thread
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  %38 = add nuw nsw i64 %.01740, 1
  %39 = load i64, ptr %2, align 8, !tbaa !5
  %40 = icmp slt i64 %38, %39
  br i1 %40, label %.lr.ph42, label %._crit_edge43, !llvm.loop !11

41:                                               ; preds = %25, %._crit_edge
  %storemerge2539 = phi i64 [ 0, %25 ], [ %.pre57, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %storemerge2638 = add nsw i64 %storemerge2539, 1
  store i64 %storemerge2638, ptr %11, align 8, !tbaa !5
  %42 = icmp slt i64 %storemerge2539, 4
  br i1 %42, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br label %.loopexit62

._crit_edge:                                      ; preds = %67
  %.pre = load i64, ptr %10, align 8, !tbaa !5
  %.pre57 = add nsw i64 %.pre, 1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  store i64 %.pre57, ptr %10, align 8, !tbaa !5
  %43 = icmp slt i64 %.pre, 4
  br i1 %43, label %41, label %.loopexit62, !llvm.loop !13

.lr.ph:                                           ; preds = %41, %67
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #5
  %44 = invoke { i64, i64 } @_ZSt9make_pairIRlS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %45 unwind label %55

45:                                               ; preds = %.lr.ph
  %46 = extractvalue { i64, i64 } %44, 0
  store i64 %46, ptr %12, align 8
  %47 = extractvalue { i64, i64 } %44, 1
  store i64 %47, ptr %19, align 8
  %48 = load i64, ptr %10, align 8, !tbaa !5
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %48) #5
  %50 = load i32, ptr %49, align 4, !tbaa !9
  %.not27 = icmp eq i32 %50, 0
  br i1 %.not27, label %57, label %51

51:                                               ; preds = %45
  %52 = load i64, ptr %11, align 8, !tbaa !5
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %52) #5
  %54 = load i32, ptr %53, align 4, !tbaa !9
  %.not28 = icmp eq i32 %54, 0
  br i1 %.not28, label %57, label %.invoke

55:                                               ; preds = %.invoke, %.lr.ph
  %56 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  br label %71

57:                                               ; preds = %51, %45
  %58 = load i64, ptr %10, align 8, !tbaa !5
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %58) #5
  %60 = load i32, ptr %59, align 4, !tbaa !9
  %.not29 = icmp eq i32 %60, 0
  br i1 %.not29, label %61, label %.invoke

61:                                               ; preds = %57
  %62 = load i64, ptr %11, align 8, !tbaa !5
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %62) #5
  %64 = load i32, ptr %63, align 4, !tbaa !9
  %.not30 = icmp eq i32 %64, 0
  %. = select i1 %.not30, ptr %6, ptr %4
  br label %.invoke

.invoke:                                          ; preds = %51, %61, %57
  %65 = phi ptr [ %3, %57 ], [ %., %61 ], [ %5, %51 ]
  %66 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %65, ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %67 unwind label %55

67:                                               ; preds = %.invoke
  %68 = load i64, ptr %66, align 8, !tbaa !5
  %69 = add nsw i64 %68, 1
  store i64 %69, ptr %66, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  %storemerge26.in.pr = load i64, ptr %11, align 8, !tbaa !5
  %storemerge26 = add nsw i64 %storemerge26.in.pr, 1
  store i64 %storemerge26, ptr %11, align 8, !tbaa !5
  %70 = icmp slt i64 %storemerge26.in.pr, 4
  br i1 %70, label %.lr.ph, label %._crit_edge, !llvm.loop !14

71:                                               ; preds = %55, %36
  %.pn = phi { ptr, i32 } [ %56, %55 ], [ %37, %36 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  br label %115

72:                                               ; preds = %.loopexit
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  br label %73

73:                                               ; preds = %72, %.thread
  %74 = phi ptr [ @.str.2, %.thread ], [ @.str.3, %72 ]
  %75 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %74)
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #5
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #5
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #5
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEED2Ev(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
  %76 = load i64, ptr %1, align 8, !tbaa !5
  %77 = add nsw i64 %76, -1
  store i64 %77, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %76, 0
  br i1 %.not, label %._crit_edge55, label %21, !llvm.loop !15

78:                                               ; preds = %._crit_edge43, %.loopexit
  %storemerge20.in44 = phi i64 [ 0, %._crit_edge43 ], [ %113, %.loopexit ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %storemerge2045 = add nsw i64 %storemerge20.in44, 1
  store i64 %storemerge2045, ptr %14, align 8, !tbaa !5
  %79 = icmp sgt i64 %storemerge20.in44, 3
  br i1 %79, label %.loopexit, label %.lr.ph48.split

.lr.ph48.split:                                   ; preds = %78, %110
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #5
  %80 = invoke { i64, i64 } @_ZSt9make_pairIRlS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %81 unwind label %88

81:                                               ; preds = %.lr.ph48.split
  %82 = extractvalue { i64, i64 } %80, 0
  store i64 %82, ptr %15, align 8
  %83 = extractvalue { i64, i64 } %80, 1
  store i64 %83, ptr %20, align 8
  %84 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 8 dereferenceable(16) %15)
          to label %85 unwind label %88

85:                                               ; preds = %81
  %86 = load i64, ptr %84, align 8, !tbaa !5
  %87 = icmp sgt i64 %86, 0
  br i1 %87, label %110, label %90

88:                                               ; preds = %.lr.ph48.split, %81, %90, %92, %100, %102
  %89 = 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 %115

90:                                               ; preds = %85
  %91 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(16) %15)
          to label %92 unwind label %88

92:                                               ; preds = %90
  %93 = load i64, ptr %91, align 8, !tbaa !5
  %94 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(16) %15)
          to label %95 unwind label %88

95:                                               ; preds = %92
  %96 = load i64, ptr %94, align 8, !tbaa !5
  %97 = add nsw i64 %96, %93
  %98 = load i64, ptr %2, align 8, !tbaa !5
  %99 = sdiv i64 %98, 2
  %.not23 = icmp slt i64 %97, %99
  br i1 %.not23, label %110, label %100

100:                                              ; preds = %95
  %101 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(16) %15)
          to label %102 unwind label %88

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

105:                                              ; preds = %102
  %106 = load i64, ptr %104, align 8, !tbaa !5
  %107 = add nsw i64 %106, %103
  %108 = load i64, ptr %2, align 8, !tbaa !5
  %109 = sdiv i64 %108, 2
  %.not24 = icmp slt i64 %107, %109
  br i1 %.not24, label %110, label %.thread

.thread:                                          ; preds = %105
  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 %73

110:                                              ; preds = %95, %105, %85
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #5
  %storemerge20.in = load i64, ptr %14, align 8, !tbaa !5
  %storemerge20 = add nsw i64 %storemerge20.in, 1
  store i64 %storemerge20, ptr %14, align 8, !tbaa !5
  %111 = icmp sgt i64 %storemerge20.in, 3
  br i1 %111, label %.loopexit, label %.lr.ph48.split, !llvm.loop !16

.loopexit:                                        ; preds = %110, %78
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  %112 = load i64, ptr %13, align 8, !tbaa !5
  %113 = add nsw i64 %112, 1
  store i64 %113, ptr %13, align 8, !tbaa !5
  %114 = icmp sgt i64 %112, 3
  br i1 %114, label %72, label %78, !llvm.loop !17

115:                                              ; preds = %88, %71
  %.pn.pn = phi { ptr, i32 } [ %.pn, %71 ], [ %89, %88 ]
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #5
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #5
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #5
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEED2Ev(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 } %.pn.pn

._crit_edge55:                                    ; preds = %73, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 0
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

; 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 noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIRlS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass