; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2014-15/Jan 2015 Gold (15 Jan G1)

; 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"

%"struct.std::pair" = type { i32, i32 }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::basic_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"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::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"struct.std::pair.0" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@rec = external dso_local global [1001 x [1001 x %"struct.std::pair"]], align 16
@ans = external dso_local global %"struct.std::pair", align 4
@todo = external dso_local global %"class.std::set", align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 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 %"class.std::basic_ifstream", align 8
  %3 = alloca %"class.std::basic_ofstream", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca %"struct.std::pair.0", align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %17 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %21 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca %"struct.std::pair", align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 520, ptr %2) #7
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256) %2, ptr noundef @.str, i32 noundef 8)
  call void @llvm.lifetime.start.p0(i64 512, ptr %3) #7
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %3, ptr noundef @.str.2, i32 noundef 16)
          to label %31 unwind label %39

31:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %32 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %33 unwind label %43

33:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %88, %33
  %35 = load i32, ptr %7, align 4, !tbaa !5
  %36 = load i32, ptr %6, align 4, !tbaa !5
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %47, label %38

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

39:                                               ; preds = %0
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %4, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %5, align 4
  br label %295

43:                                               ; preds = %289, %287, %284, %31
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %4, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %5, align 4
  br label %294

47:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #7
  %48 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %49 unwind label %67

49:                                               ; preds = %47
  %50 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %48, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %51 unwind label %67

51:                                               ; preds = %49
  %52 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) %50, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %53 unwind label %67

53:                                               ; preds = %51
  %54 = load i8, ptr %10, align 1, !tbaa !9
  %55 = sext i8 %54 to i32
  %56 = icmp eq i32 %55, 72
  br i1 %56, label %57, label %71

57:                                               ; preds = %53
  %58 = load i32, ptr %8, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [1001 x [1001 x %"struct.std::pair"]], ptr @rec, i64 0, i64 %59
  %61 = load i32, ptr %9, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %60, i64 0, i64 %62
  %64 = getelementptr inbounds %"struct.std::pair", ptr %63, i32 0, i32 0
  %65 = load i32, ptr %64, align 8, !tbaa !10
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %64, align 8, !tbaa !10
  br label %81

67:                                               ; preds = %81, %51, %49, %47
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %4, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %294

71:                                               ; preds = %53
  %72 = load i32, ptr %8, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [1001 x [1001 x %"struct.std::pair"]], ptr @rec, i64 0, i64 %73
  %75 = load i32, ptr %9, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %74, i64 0, i64 %76
  %78 = getelementptr inbounds %"struct.std::pair", ptr %77, i32 0, i32 1
  %79 = load i32, ptr %78, align 4, !tbaa !12
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %78, align 4, !tbaa !12
  br label %81

81:                                               ; preds = %71, %57
  %82 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @todo, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %83 unwind label %67

83:                                               ; preds = %81
  %84 = getelementptr inbounds { ptr, i8 }, ptr %11, i32 0, i32 0
  %85 = extractvalue { ptr, i8 } %82, 0
  store ptr %85, ptr %84, align 8
  %86 = getelementptr inbounds { ptr, i8 }, ptr %11, i32 0, i32 1
  %87 = extractvalue { ptr, i8 } %82, 1
  store i8 %87, ptr %86, align 8
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %88

88:                                               ; preds = %83
  %89 = load i32, ptr %7, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %7, align 4, !tbaa !5
  br label %34, !llvm.loop !13

91:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %142, %91
  %93 = load i32, ptr %12, align 4, !tbaa !5
  %94 = icmp slt i32 %93, 1001
  br i1 %94, label %96, label %95

95:                                               ; preds = %92
  store i32 5, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %145

96:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %97

97:                                               ; preds = %138, %96
  %98 = load i32, ptr %14, align 4, !tbaa !5
  %99 = icmp slt i32 %98, 1001
  br i1 %99, label %101, label %100

100:                                              ; preds = %97
  store i32 8, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %141

101:                                              ; preds = %97
  %102 = load i32, ptr %12, align 4, !tbaa !5
  %103 = sub nsw i32 %102, 1
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [1001 x [1001 x %"struct.std::pair"]], ptr @rec, i64 0, i64 %104
  %106 = load i32, ptr %14, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %105, i64 0, i64 %107
  %109 = getelementptr inbounds %"struct.std::pair", ptr %108, i32 0, i32 0
  %110 = load i32, ptr %109, align 8, !tbaa !10
  %111 = load i32, ptr %12, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [1001 x [1001 x %"struct.std::pair"]], ptr @rec, i64 0, i64 %112
  %114 = load i32, ptr %14, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %113, i64 0, i64 %115
  %117 = getelementptr inbounds %"struct.std::pair", ptr %116, i32 0, i32 0
  %118 = load i32, ptr %117, align 8, !tbaa !10
  %119 = add nsw i32 %118, %110
  store i32 %119, ptr %117, align 8, !tbaa !10
  %120 = load i32, ptr %12, align 4, !tbaa !5
  %121 = sub nsw i32 %120, 1
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [1001 x [1001 x %"struct.std::pair"]], ptr @rec, i64 0, i64 %122
  %124 = load i32, ptr %14, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %123, i64 0, i64 %125
  %127 = getelementptr inbounds %"struct.std::pair", ptr %126, i32 0, i32 1
  %128 = load i32, ptr %127, align 4, !tbaa !12
  %129 = load i32, ptr %12, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [1001 x [1001 x %"struct.std::pair"]], ptr @rec, i64 0, i64 %130
  %132 = load i32, ptr %14, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %131, i64 0, i64 %133
  %135 = getelementptr inbounds %"struct.std::pair", ptr %134, i32 0, i32 1
  %136 = load i32, ptr %135, align 4, !tbaa !12
  %137 = add nsw i32 %136, %128
  store i32 %137, ptr %135, align 4, !tbaa !12
  br label %138

138:                                              ; preds = %101
  %139 = load i32, ptr %14, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %14, align 4, !tbaa !5
  br label %97, !llvm.loop !15

141:                                              ; preds = %100
  br label %142

142:                                              ; preds = %141
  %143 = load i32, ptr %12, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %12, align 4, !tbaa !5
  br label %92, !llvm.loop !16

145:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store ptr @todo, ptr %15, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %146 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @todo) #7
  %147 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %16, i32 0, i32 0
  store ptr %146, ptr %147, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %148 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @todo) #7
  %149 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %17, i32 0, i32 0
  store ptr %148, ptr %149, align 8
  br label %150

150:                                              ; preds = %282, %145
  %151 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  br i1 %151, label %153, label %152

152:                                              ; preds = %150
  store i32 11, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %284

153:                                              ; preds = %150
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %154 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  %155 = load i32, ptr %154, align 4, !tbaa !5
  store i32 %155, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  store ptr @todo, ptr %19, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %156 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @todo) #7
  %157 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %20, i32 0, i32 0
  store ptr %156, ptr %157, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %158 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @todo) #7
  %159 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %21, i32 0, i32 0
  store ptr %158, ptr %159, align 8
  br label %160

160:                                              ; preds = %279, %153
  %161 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #7
  br i1 %161, label %163, label %162

162:                                              ; preds = %160
  store i32 13, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %281

163:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %164 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %165 = load i32, ptr %164, align 4, !tbaa !5
  store i32 %165, ptr %22, align 4, !tbaa !5
  %166 = load i32, ptr %18, align 4, !tbaa !5
  %167 = load i32, ptr %22, align 4, !tbaa !5
  %168 = icmp sle i32 %166, %167
  br i1 %168, label %169, label %278

169:                                              ; preds = %163
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 0, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 1, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 1, ptr %25, align 4, !tbaa !5
  br label %170

170:                                              ; preds = %273, %169
  %171 = load i32, ptr %25, align 4, !tbaa !5
  %172 = icmp slt i32 %171, 1001
  br i1 %172, label %174, label %173

173:                                              ; preds = %170
  store i32 15, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %277

174:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  %175 = load i32, ptr %22, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [1001 x [1001 x %"struct.std::pair"]], ptr @rec, i64 0, i64 %176
  %178 = load i32, ptr %25, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %177, i64 0, i64 %179
  %181 = getelementptr inbounds %"struct.std::pair", ptr %180, i32 0, i32 0
  %182 = load i32, ptr %181, align 8, !tbaa !10
  store i32 %182, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  %183 = load i32, ptr %22, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [1001 x [1001 x %"struct.std::pair"]], ptr @rec, i64 0, i64 %184
  %186 = load i32, ptr %25, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %185, i64 0, i64 %187
  %189 = getelementptr inbounds %"struct.std::pair", ptr %188, i32 0, i32 1
  %190 = load i32, ptr %189, align 4, !tbaa !12
  store i32 %190, ptr %27, align 4, !tbaa !5
  %191 = load i32, ptr %18, align 4, !tbaa !5
  %192 = icmp sgt i32 %191, 0
  br i1 %192, label %193, label %216

193:                                              ; preds = %174
  %194 = load i32, ptr %18, align 4, !tbaa !5
  %195 = sub nsw i32 %194, 1
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [1001 x [1001 x %"struct.std::pair"]], ptr @rec, i64 0, i64 %196
  %198 = load i32, ptr %25, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %197, i64 0, i64 %199
  %201 = getelementptr inbounds %"struct.std::pair", ptr %200, i32 0, i32 0
  %202 = load i32, ptr %201, align 8, !tbaa !10
  %203 = load i32, ptr %26, align 4, !tbaa !5
  %204 = sub nsw i32 %203, %202
  store i32 %204, ptr %26, align 4, !tbaa !5
  %205 = load i32, ptr %18, align 4, !tbaa !5
  %206 = sub nsw i32 %205, 1
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [1001 x [1001 x %"struct.std::pair"]], ptr @rec, i64 0, i64 %207
  %209 = load i32, ptr %25, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %208, i64 0, i64 %210
  %212 = getelementptr inbounds %"struct.std::pair", ptr %211, i32 0, i32 1
  %213 = load i32, ptr %212, align 4, !tbaa !12
  %214 = load i32, ptr %27, align 4, !tbaa !5
  %215 = sub nsw i32 %214, %213
  store i32 %215, ptr %27, align 4, !tbaa !5
  br label %216

216:                                              ; preds = %193, %174
  %217 = load i32, ptr %27, align 4, !tbaa !5
  %218 = icmp ne i32 %217, 0
  br i1 %218, label %219, label %222

219:                                              ; preds = %216
  %220 = load i32, ptr %25, align 4, !tbaa !5
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr %24, align 4, !tbaa !5
  store i32 0, ptr %23, align 4, !tbaa !5
  store i32 17, ptr %13, align 4
  br label %270

222:                                              ; preds = %216
  %223 = load i32, ptr %26, align 4, !tbaa !5
  %224 = load i32, ptr %23, align 4, !tbaa !5
  %225 = add nsw i32 %224, %223
  store i32 %225, ptr %23, align 4, !tbaa !5
  %226 = load i32, ptr %23, align 4, !tbaa !5
  %227 = load i32, ptr @ans, align 4, !tbaa !10
  %228 = icmp sgt i32 %226, %227
  br i1 %228, label %229, label %243

229:                                              ; preds = %222
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  %230 = load i32, ptr %22, align 4, !tbaa !5
  %231 = load i32, ptr %18, align 4, !tbaa !5
  %232 = sub nsw i32 %230, %231
  %233 = load i32, ptr %25, align 4, !tbaa !5
  %234 = load i32, ptr %24, align 4, !tbaa !5
  %235 = sub nsw i32 %233, %234
  %236 = mul nsw i32 %232, %235
  store i32 %236, ptr %29, align 4, !tbaa !5
  invoke void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %28, ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %29)
          to label %237 unwind label %239

237:                                              ; preds = %229
  %238 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) @ans, ptr noundef nonnull align 4 dereferenceable(8) %28) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  br label %263

239:                                              ; preds = %229
  %240 = landingpad { ptr, i32 }
          cleanup
  %241 = extractvalue { ptr, i32 } %240, 0
  store ptr %241, ptr %4, align 8
  %242 = extractvalue { ptr, i32 } %240, 1
  store i32 %242, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  br label %276

243:                                              ; preds = %222
  %244 = load i32, ptr %23, align 4, !tbaa !5
  %245 = load i32, ptr @ans, align 4, !tbaa !10
  %246 = icmp eq i32 %244, %245
  br i1 %246, label %247, label %262

247:                                              ; preds = %243
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  %248 = load i32, ptr %22, align 4, !tbaa !5
  %249 = load i32, ptr %18, align 4, !tbaa !5
  %250 = sub nsw i32 %248, %249
  %251 = load i32, ptr %25, align 4, !tbaa !5
  %252 = load i32, ptr %24, align 4, !tbaa !5
  %253 = sub nsw i32 %251, %252
  %254 = mul nsw i32 %250, %253
  store i32 %254, ptr %30, align 4, !tbaa !5
  %255 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (%"struct.std::pair", ptr @ans, i32 0, i32 1), ptr noundef nonnull align 4 dereferenceable(4) %30)
          to label %256 unwind label %258

256:                                              ; preds = %247
  %257 = load i32, ptr %255, align 4, !tbaa !5
  store i32 %257, ptr getelementptr inbounds (%"struct.std::pair", ptr @ans, i32 0, i32 1), align 4, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  br label %262

258:                                              ; preds = %247
  %259 = landingpad { ptr, i32 }
          cleanup
  %260 = extractvalue { ptr, i32 } %259, 0
  store ptr %260, ptr %4, align 8
  %261 = extractvalue { ptr, i32 } %259, 1
  store i32 %261, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  br label %276

262:                                              ; preds = %256, %243
  br label %263

263:                                              ; preds = %262, %237
  %264 = load i32, ptr %23, align 4, !tbaa !5
  %265 = icmp eq i32 %264, 0
  br i1 %265, label %266, label %269

266:                                              ; preds = %263
  %267 = load i32, ptr %25, align 4, !tbaa !5
  %268 = add nsw i32 %267, 1
  store i32 %268, ptr %24, align 4, !tbaa !5
  br label %269

269:                                              ; preds = %266, %263
  store i32 0, ptr %13, align 4
  br label %270

270:                                              ; preds = %269, %219
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  %271 = load i32, ptr %13, align 4
  switch i32 %271, label %301 [
    i32 0, label %272
    i32 17, label %273
  ]

272:                                              ; preds = %270
  br label %273

273:                                              ; preds = %272, %270
  %274 = load i32, ptr %25, align 4, !tbaa !5
  %275 = add nsw i32 %274, 1
  store i32 %275, ptr %25, align 4, !tbaa !5
  br label %170, !llvm.loop !19

276:                                              ; preds = %258, %239
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %294

277:                                              ; preds = %173
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %278

278:                                              ; preds = %277, %163
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %279

279:                                              ; preds = %278
  %280 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  br label %160

281:                                              ; preds = %162
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %282

282:                                              ; preds = %281
  %283 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  br label %150

284:                                              ; preds = %152
  %285 = load i32, ptr @ans, align 4, !tbaa !10
  %286 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef %285)
          to label %287 unwind label %43

287:                                              ; preds = %284
  %288 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %286, ptr noundef @.str.3)
          to label %289 unwind label %43

289:                                              ; preds = %287
  %290 = load i32, ptr getelementptr inbounds (%"struct.std::pair", ptr @ans, i32 0, i32 1), align 4, !tbaa !12
  %291 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %288, i32 noundef %290)
          to label %292 unwind label %43

292:                                              ; preds = %289
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %3) #7
  call void @llvm.lifetime.end.p0(i64 512, ptr %3) #7
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %2) #7
  call void @llvm.lifetime.end.p0(i64 520, ptr %2) #7
  %293 = load i32, ptr %1, align 4
  ret i32 %293

294:                                              ; preds = %276, %67, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %3) #7
  br label %295

295:                                              ; preds = %294, %39
  call void @llvm.lifetime.end.p0(i64 512, ptr %3) #7
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %2) #7
  call void @llvm.lifetime.end.p0(i64 520, ptr %2) #7
  br label %296

296:                                              ; preds = %295
  %297 = load ptr, ptr %4, align 8
  %298 = load i32, ptr %5, align 4
  %299 = insertvalue { ptr, i32 } poison, ptr %297, 0
  %300 = insertvalue { ptr, i32 } %299, i32 %298, 1
  resume { ptr, i32 } %300

301:                                              ; preds = %270
  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 void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef, i32 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, i32 noundef) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #3

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #2 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 @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) #4 align 2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #4 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 = { 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 #3 = { "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 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 #5 = { inlinehint 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 #6 = { 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 #7 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !6, i64 0}
!11 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!12 = !{!11, !6, i64 4}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = !{!18, !18, i64 0}
!18 = !{!"any pointer", !7, i64 0}
!19 = distinct !{!19, !14}


; 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"

%"struct.std::pair" = type { i32, i32 }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::basic_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"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::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@rec = external dso_local local_unnamed_addr global [1001 x [1001 x %"struct.std::pair"]], align 16
@ans = external dso_local global %"struct.std::pair", align 4
@todo = external dso_local global %"class.std::set", align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 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 %"class.std::basic_ifstream", align 8
  %2 = alloca %"class.std::basic_ofstream", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %10 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair", align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 520, ptr nonnull %1) #7
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256) %1, ptr noundef nonnull @.str, i32 noundef 8)
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %2) #7
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %2, ptr noundef nonnull @.str.2, i32 noundef 16)
          to label %15 unwind label %19

15:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %16 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %.preheader61 unwind label %21

.preheader61:                                     ; preds = %15
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph, label %.preheader.preheader

19:                                               ; preds = %0
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %165

21:                                               ; preds = %160, %158, %._crit_edge72, %15
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %164

.lr.ph:                                           ; preds = %.preheader61, %47
  %.05062 = phi i32 [ %48, %47 ], [ 0, %.preheader61 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #7
  %23 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %24 unwind label %39

24:                                               ; preds = %.lr.ph
  %25 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %26 unwind label %39

26:                                               ; preds = %24
  %27 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %28 unwind label %39

28:                                               ; preds = %26
  %29 = load i8, ptr %6, align 1, !tbaa !9
  %30 = icmp eq i8 %29, 72
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = load i32, ptr %5, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  br i1 %30, label %35, label %41

35:                                               ; preds = %28
  %36 = getelementptr inbounds [1001 x [1001 x %"struct.std::pair"]], ptr @rec, i64 0, i64 %32, i64 %34
  %37 = load i32, ptr %36, align 8, !tbaa !10
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %36, align 8, !tbaa !10
  br label %45

39:                                               ; preds = %45, %26, %24, %.lr.ph
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  br label %164

41:                                               ; preds = %28
  %42 = getelementptr inbounds [1001 x [1001 x %"struct.std::pair"]], ptr @rec, i64 0, i64 %32, i64 %34, i32 1
  %43 = load i32, ptr %42, align 4, !tbaa !12
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %42, align 4, !tbaa !12
  br label %45

45:                                               ; preds = %41, %35
  %46 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @todo, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %47 unwind label %39

47:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %48 = add nuw nsw i32 %.05062, 1
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %.lr.ph, label %.preheader.preheader, !llvm.loop !13

.preheader.preheader:                             ; preds = %47, %.preheader61
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %middle.block
  %indvars.iv76 = phi i64 [ %indvars.iv.next77, %middle.block ], [ 1, %.preheader.preheader ]
  %51 = add nsw i64 %indvars.iv76, -1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %.preheader
  %index = phi i64 [ 0, %.preheader ], [ %index.next.1, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %52 = getelementptr inbounds [1001 x [1001 x %"struct.std::pair"]], ptr @rec, i64 0, i64 %51, i64 %offset.idx
  %wide.vec = load <4 x i32>, ptr %52, align 8, !tbaa !5
  %53 = getelementptr inbounds [1001 x [1001 x %"struct.std::pair"]], ptr @rec, i64 0, i64 %indvars.iv76, i64 %offset.idx
  %wide.vec91 = load <4 x i32>, ptr %53, align 8, !tbaa !5
  %interleaved.vec = add nsw <4 x i32> %wide.vec91, %wide.vec
  store <4 x i32> %interleaved.vec, ptr %53, align 8, !tbaa !5
  %offset.idx.1 = or disjoint i64 %index, 3
  %54 = getelementptr inbounds [1001 x [1001 x %"struct.std::pair"]], ptr @rec, i64 0, i64 %51, i64 %offset.idx.1
  %wide.vec.1 = load <4 x i32>, ptr %54, align 8, !tbaa !5
  %55 = getelementptr inbounds [1001 x [1001 x %"struct.std::pair"]], ptr @rec, i64 0, i64 %indvars.iv76, i64 %offset.idx.1
  %wide.vec91.1 = load <4 x i32>, ptr %55, align 8, !tbaa !5
  %interleaved.vec.1 = add nsw <4 x i32> %wide.vec91.1, %wide.vec.1
  store <4 x i32> %interleaved.vec.1, ptr %55, align 8, !tbaa !5
  %index.next.1 = add nuw nsw i64 %index, 4
  %56 = icmp eq i64 %index.next.1, 1000
  br i1 %56, label %middle.block, label %vector.body, !llvm.loop !15

57:                                               ; preds = %middle.block
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %58 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @todo) #7
  store ptr %58, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %59 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @todo) #7
  store ptr %59, ptr %8, align 8
  %60 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br i1 %60, label %.lr.ph71, label %._crit_edge72

middle.block:                                     ; preds = %vector.body
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next77, 1001
  br i1 %exitcond79.not, label %57, label %.preheader, !llvm.loop !18

._crit_edge72:                                    ; preds = %._crit_edge, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  %61 = load i32, ptr @ans, align 4, !tbaa !10
  %62 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %2, i32 noundef %61)
          to label %158 unwind label %21

.lr.ph71:                                         ; preds = %57, %._crit_edge
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %.fr73 = freeze i32 %64
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %65 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @todo) #7
  store ptr %65, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %66 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @todo) #7
  store ptr %66, ptr %10, align 8
  %67 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br i1 %67, label %.lr.ph69, label %._crit_edge

.lr.ph69:                                         ; preds = %.lr.ph71
  %68 = icmp sgt i32 %.fr73, 0
  %69 = add nsw i32 %.fr73, -1
  %70 = zext nneg i32 %69 to i64
  br i1 %68, label %.lr.ph69.split.us, label %.lr.ph69.split

.lr.ph69.split.us:                                ; preds = %.lr.ph69, %75
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %.not.us = icmp sgt i32 %.fr73, %72
  br i1 %.not.us, label %75, label %.split.us.us

.split.us.us:                                     ; preds = %.lr.ph69.split.us
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  %73 = sext i32 %72 to i64
  %74 = sub nsw i32 %72, %.fr73
  br label %78

75:                                               ; preds = %.split68.us.us, %.lr.ph69.split.us
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %77 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br i1 %77, label %.lr.ph69.split.us, label %._crit_edge

78:                                               ; preds = %114, %.split.us.us
  %79 = phi i32 [ %115, %114 ], [ 0, %.split.us.us ]
  %indvars.iv84 = phi i64 [ %indvars.iv.next85.pre-phi, %114 ], [ 1, %.split.us.us ]
  %.04565.us.us = phi i32 [ %.2.us.us, %114 ], [ 1, %.split.us.us ]
  %80 = getelementptr inbounds [1001 x [1001 x %"struct.std::pair"]], ptr @rec, i64 0, i64 %73, i64 %indvars.iv84
  %81 = getelementptr inbounds i8, ptr %80, i64 4
  %82 = load i32, ptr %81, align 4, !tbaa !12
  %83 = getelementptr inbounds [1001 x [1001 x %"struct.std::pair"]], ptr @rec, i64 0, i64 %70, i64 %indvars.iv84
  %84 = getelementptr inbounds i8, ptr %83, i64 4
  %85 = load i32, ptr %84, align 4, !tbaa !12
  %.not57.us.us = icmp eq i32 %82, %85
  br i1 %.not57.us.us, label %89, label %86

86:                                               ; preds = %78
  %87 = add nuw nsw i64 %indvars.iv84, 1
  %88 = trunc nuw nsw i64 %87 to i32
  br label %114

89:                                               ; preds = %78
  %90 = load i32, ptr %80, align 8, !tbaa !10
  %91 = load i32, ptr %83, align 8, !tbaa !10
  %92 = sub nsw i32 %90, %91
  %93 = add nsw i32 %79, %92
  store i32 %93, ptr %11, align 4, !tbaa !5
  %94 = load i32, ptr @ans, align 4, !tbaa !10
  %95 = icmp sgt i32 %93, %94
  br i1 %95, label %104, label %96

96:                                               ; preds = %89
  %97 = icmp eq i32 %93, %94
  br i1 %97, label %98, label %109

98:                                               ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #7
  %99 = trunc nuw nsw i64 %indvars.iv84 to i32
  %100 = sub nsw i32 %99, %.04565.us.us
  %101 = mul nsw i32 %100, %74
  store i32 %101, ptr %14, align 4, !tbaa !5
  %102 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @ans, i64 4), ptr noundef nonnull align 4 dereferenceable(4) %14)
  %103 = load i32, ptr %102, align 4, !tbaa !5
  store i32 %103, ptr getelementptr inbounds (i8, ptr @ans, i64 4), align 4, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  br label %109

104:                                              ; preds = %89
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %105 = trunc nuw nsw i64 %indvars.iv84 to i32
  %106 = sub nsw i32 %105, %.04565.us.us
  %107 = mul nsw i32 %106, %74
  store i32 %107, ptr %13, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %108 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) @ans, ptr noundef nonnull align 4 dereferenceable(8) %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  br label %109

109:                                              ; preds = %104, %98, %96
  %110 = load i32, ptr %11, align 4, !tbaa !5
  %111 = icmp eq i32 %110, 0
  %112 = add nuw nsw i64 %indvars.iv84, 1
  %113 = trunc nuw nsw i64 %112 to i32
  %spec.select.us.us = select i1 %111, i32 %113, i32 %.04565.us.us
  br label %114

114:                                              ; preds = %109, %86
  %indvars.iv.next85.pre-phi = phi i64 [ %112, %109 ], [ %87, %86 ]
  %115 = phi i32 [ %110, %109 ], [ 0, %86 ]
  %.2.us.us = phi i32 [ %spec.select.us.us, %109 ], [ %88, %86 ]
  %exitcond87.not = icmp eq i64 %indvars.iv.next85.pre-phi, 1001
  br i1 %exitcond87.not, label %.split68.us.us, label %78, !llvm.loop !19

.split68.us.us:                                   ; preds = %114
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  br label %75

._crit_edge:                                      ; preds = %155, %75, %.lr.ph71
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %117 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br i1 %117, label %.lr.ph71, label %._crit_edge72

.lr.ph69.split:                                   ; preds = %.lr.ph69, %155
  %118 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %.not = icmp sgt i32 %.fr73, %119
  br i1 %.not, label %155, label %.split

.split:                                           ; preds = %.lr.ph69.split
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  %120 = sext i32 %119 to i64
  %121 = sub nsw i32 %119, %.fr73
  br label %122

.split68:                                         ; preds = %153
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  br label %155

122:                                              ; preds = %.split, %153
  %123 = phi i32 [ 0, %.split ], [ %154, %153 ]
  %indvars.iv80 = phi i64 [ 1, %.split ], [ %indvars.iv.next81.pre-phi, %153 ]
  %.04565 = phi i32 [ 1, %.split ], [ %.2, %153 ]
  %124 = getelementptr inbounds [1001 x [1001 x %"struct.std::pair"]], ptr @rec, i64 0, i64 %120, i64 %indvars.iv80
  %125 = getelementptr inbounds i8, ptr %124, i64 4
  %126 = load i32, ptr %125, align 4, !tbaa !12
  %.not57 = icmp eq i32 %126, 0
  br i1 %.not57, label %130, label %127

127:                                              ; preds = %122
  %128 = add nuw nsw i64 %indvars.iv80, 1
  %129 = trunc nuw nsw i64 %128 to i32
  br label %153

130:                                              ; preds = %122
  %131 = load i32, ptr %124, align 8, !tbaa !10
  %132 = add nsw i32 %123, %131
  store i32 %132, ptr %11, align 4, !tbaa !5
  %133 = load i32, ptr @ans, align 4, !tbaa !10
  %134 = icmp sgt i32 %132, %133
  br i1 %134, label %135, label %140

135:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %136 = trunc nuw nsw i64 %indvars.iv80 to i32
  %137 = sub nsw i32 %136, %.04565
  %138 = mul nsw i32 %137, %121
  store i32 %138, ptr %13, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %139 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) @ans, ptr noundef nonnull align 4 dereferenceable(8) %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  br label %148

140:                                              ; preds = %130
  %141 = icmp eq i32 %132, %133
  br i1 %141, label %142, label %148

142:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #7
  %143 = trunc nuw nsw i64 %indvars.iv80 to i32
  %144 = sub nsw i32 %143, %.04565
  %145 = mul nsw i32 %144, %121
  store i32 %145, ptr %14, align 4, !tbaa !5
  %146 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @ans, i64 4), ptr noundef nonnull align 4 dereferenceable(4) %14)
  %147 = load i32, ptr %146, align 4, !tbaa !5
  store i32 %147, ptr getelementptr inbounds (i8, ptr @ans, i64 4), align 4, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  br label %148

148:                                              ; preds = %140, %142, %135
  %149 = load i32, ptr %11, align 4, !tbaa !5
  %150 = icmp eq i32 %149, 0
  %151 = add nuw nsw i64 %indvars.iv80, 1
  %152 = trunc nuw nsw i64 %151 to i32
  %spec.select = select i1 %150, i32 %152, i32 %.04565
  br label %153

153:                                              ; preds = %148, %127
  %indvars.iv.next81.pre-phi = phi i64 [ %151, %148 ], [ %128, %127 ]
  %154 = phi i32 [ %149, %148 ], [ 0, %127 ]
  %.2 = phi i32 [ %spec.select, %148 ], [ %129, %127 ]
  %exitcond83.not = icmp eq i64 %indvars.iv.next81.pre-phi, 1001
  br i1 %exitcond83.not, label %.split68, label %122, !llvm.loop !19

155:                                              ; preds = %.split68, %.lr.ph69.split
  %156 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %157 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br i1 %157, label %.lr.ph69.split, label %._crit_edge

158:                                              ; preds = %._crit_edge72
  %159 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef nonnull @.str.3)
          to label %160 unwind label %21

160:                                              ; preds = %158
  %161 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 4), align 4, !tbaa !12
  %162 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %159, i32 noundef %161)
          to label %163 unwind label %21

163:                                              ; preds = %160
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %2) #7
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %2) #7
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %1) #7
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %1) #7
  ret i32 0

164:                                              ; preds = %39, %21
  %.pn = phi { ptr, i32 } [ %40, %39 ], [ %22, %21 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %2) #7
  br label %165

165:                                              ; preds = %164, %19
  %.pn.pn = phi { ptr, i32 } [ %.pn, %164 ], [ %20, %19 ]
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %2) #7
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %1) #7
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn.pn
}

; 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 void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef, i32 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, i32 noundef) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 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 @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #4 align 2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #4 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 = { 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 #3 = { "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 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 #5 = { inlinehint 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 #6 = { 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 #7 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !6, i64 0}
!11 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!12 = !{!11, !6, i64 4}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,VectorCombinePass