; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2014-15/Dec 2014 Gold (14 Dec 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"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<std::pair<long long, long long>, long long>, std::allocator<std::pair<std::pair<long long, long long>, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<std::pair<long long, long long>, long long>, std::allocator<std::pair<std::pair<long long, long long>, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<std::pair<long long, long long>, long long>, std::allocator<std::pair<std::pair<long long, long long>, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<std::pair<long long, long long>, long long>, std::allocator<std::pair<std::pair<long long, long long>, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { %"struct.std::pair.0", i64 }
%"struct.std::pair.0" = type { i64, i64 }
%"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 }

@N = external dso_local global i64, align 8
@H = external dso_local global i64, align 8
@ans = external dso_local global i64, align 8
@cows = external dso_local global %"class.std::vector", align 8
@dp = external dso_local global [1048576 x %"struct.std::pair"], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [17 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 i32, align 4
  %11 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 520, ptr %2) #6
  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) #6
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %3, ptr noundef @.str.3, i32 noundef 16)
          to label %12 unwind label %25

12:                                               ; preds = %0
  %13 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(8) @N)
          to label %14 unwind label %29

14:                                               ; preds = %12
  %15 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) @H)
          to label %16 unwind label %29

16:                                               ; preds = %14
  %17 = load i64, ptr @N, align 8, !tbaa !5
  invoke void @_ZNSt6vectorISt4pairIS0_IxxExESaIS2_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %17)
          to label %18 unwind label %29

18:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %54, %18
  %20 = load i32, ptr %6, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = load i64, ptr @N, align 8, !tbaa !5
  %23 = icmp slt i64 %21, %22
  br i1 %23, label %33, label %24

24:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %61

25:                                               ; preds = %0
  %26 = landingpad { ptr, i32 }
          cleanup
  %27 = extractvalue { ptr, i32 } %26, 0
  store ptr %27, ptr %4, align 8
  %28 = extractvalue { ptr, i32 } %26, 1
  store i32 %28, ptr %5, align 4
  br label %223

29:                                               ; preds = %216, %213, %16, %14, %12
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %4, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %5, align 4
  br label %222

33:                                               ; preds = %19
  %34 = load i32, ptr %6, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IxxExESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %35) #6
  %37 = getelementptr inbounds %"struct.std::pair", ptr %36, i32 0, i32 0
  %38 = getelementptr inbounds %"struct.std::pair.0", ptr %37, i32 0, i32 0
  %39 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(8) %38)
          to label %40 unwind label %57

40:                                               ; preds = %33
  %41 = load i32, ptr %6, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IxxExESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %42) #6
  %44 = getelementptr inbounds %"struct.std::pair", ptr %43, i32 0, i32 0
  %45 = getelementptr inbounds %"struct.std::pair.0", ptr %44, i32 0, i32 1
  %46 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %39, ptr noundef nonnull align 8 dereferenceable(8) %45)
          to label %47 unwind label %57

47:                                               ; preds = %40
  %48 = load i32, ptr %6, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IxxExESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %49) #6
  %51 = getelementptr inbounds %"struct.std::pair", ptr %50, i32 0, i32 1
  %52 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %46, ptr noundef nonnull align 8 dereferenceable(8) %51)
          to label %53 unwind label %57

53:                                               ; preds = %47
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %6, align 4, !tbaa !9
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %6, align 4, !tbaa !9
  br label %19, !llvm.loop !11

57:                                               ; preds = %47, %40, %33
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %4, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %222

61:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %62

62:                                               ; preds = %206, %61
  %63 = load i32, ptr %7, align 4, !tbaa !9
  %64 = load i64, ptr @N, align 8, !tbaa !5
  %65 = trunc i64 %64 to i32
  %66 = shl i32 1, %65
  %67 = icmp slt i32 %63, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %62
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %210

69:                                               ; preds = %62
  %70 = load i32, ptr %7, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [1048576 x %"struct.std::pair"], ptr @dp, i64 0, i64 %71
  %73 = getelementptr inbounds %"struct.std::pair", ptr %72, i32 0, i32 1
  store i64 -1, ptr %73, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %173, %69
  %75 = load i32, ptr %9, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = load i64, ptr @N, align 8, !tbaa !5
  %78 = icmp slt i64 %76, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %74
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %176

80:                                               ; preds = %74
  %81 = load i32, ptr %7, align 4, !tbaa !9
  %82 = load i32, ptr %9, align 4, !tbaa !9
  %83 = shl i32 1, %82
  %84 = and i32 %81, %83
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %172

86:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %87 = load i32, ptr %7, align 4, !tbaa !9
  %88 = load i32, ptr %9, align 4, !tbaa !9
  %89 = shl i32 1, %88
  %90 = xor i32 %87, %89
  store i32 %90, ptr %10, align 4, !tbaa !9
  %91 = load i32, ptr %10, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [1048576 x %"struct.std::pair"], ptr @dp, i64 0, i64 %92
  %94 = getelementptr inbounds %"struct.std::pair", ptr %93, i32 0, i32 1
  %95 = load i64, ptr %94, align 8, !tbaa !13
  %96 = icmp ne i64 %95, -1
  br i1 %96, label %97, label %145

97:                                               ; preds = %86
  %98 = load i32, ptr %9, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IxxExESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %99) #6
  %101 = getelementptr inbounds %"struct.std::pair", ptr %100, i32 0, i32 1
  %102 = load i64, ptr %101, align 8, !tbaa !13
  %103 = load i32, ptr %10, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [1048576 x %"struct.std::pair"], ptr @dp, i64 0, i64 %104
  %106 = getelementptr inbounds %"struct.std::pair", ptr %105, i32 0, i32 0
  %107 = getelementptr inbounds %"struct.std::pair.0", ptr %106, i32 0, i32 1
  %108 = load i64, ptr %107, align 8, !tbaa !16
  %109 = icmp sge i64 %102, %108
  br i1 %109, label %110, label %144

110:                                              ; preds = %97
  %111 = load i32, ptr %7, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [1048576 x %"struct.std::pair"], ptr @dp, i64 0, i64 %112
  %114 = getelementptr inbounds %"struct.std::pair", ptr %113, i32 0, i32 1
  %115 = load i32, ptr %10, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [1048576 x %"struct.std::pair"], ptr @dp, i64 0, i64 %116
  %118 = getelementptr inbounds %"struct.std::pair", ptr %117, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %119 = load i32, ptr %9, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IxxExESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %120) #6
  %122 = getelementptr inbounds %"struct.std::pair", ptr %121, i32 0, i32 1
  %123 = load i64, ptr %122, align 8, !tbaa !13
  %124 = load i32, ptr %10, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [1048576 x %"struct.std::pair"], ptr @dp, i64 0, i64 %125
  %127 = getelementptr inbounds %"struct.std::pair", ptr %126, i32 0, i32 0
  %128 = getelementptr inbounds %"struct.std::pair.0", ptr %127, i32 0, i32 1
  %129 = load i64, ptr %128, align 8, !tbaa !16
  %130 = sub nsw i64 %123, %129
  store i64 %130, ptr %11, align 8, !tbaa !5
  %131 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %118, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %132 unwind label %140

132:                                              ; preds = %110
  %133 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %114, ptr noundef nonnull align 8 dereferenceable(8) %131)
          to label %134 unwind label %140

134:                                              ; preds = %132
  %135 = load i64, ptr %133, align 8, !tbaa !5
  %136 = load i32, ptr %7, align 4, !tbaa !9
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [1048576 x %"struct.std::pair"], ptr @dp, i64 0, i64 %137
  %139 = getelementptr inbounds %"struct.std::pair", ptr %138, i32 0, i32 1
  store i64 %135, ptr %139, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %144

140:                                              ; preds = %132, %110
  %141 = landingpad { ptr, i32 }
          cleanup
  %142 = extractvalue { ptr, i32 } %141, 0
  store ptr %142, ptr %4, align 8
  %143 = extractvalue { ptr, i32 } %141, 1
  store i32 %143, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %209

144:                                              ; preds = %134, %97
  br label %145

145:                                              ; preds = %144, %86
  %146 = load i32, ptr %9, align 4, !tbaa !9
  %147 = sext i32 %146 to i64
  %148 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IxxExESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %147) #6
  %149 = getelementptr inbounds %"struct.std::pair", ptr %148, i32 0, i32 0
  %150 = getelementptr inbounds %"struct.std::pair.0", ptr %149, i32 0, i32 0
  %151 = load i64, ptr %150, align 8, !tbaa !17
  %152 = load i32, ptr %7, align 4, !tbaa !9
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [1048576 x %"struct.std::pair"], ptr @dp, i64 0, i64 %153
  %155 = getelementptr inbounds %"struct.std::pair", ptr %154, i32 0, i32 0
  %156 = getelementptr inbounds %"struct.std::pair.0", ptr %155, i32 0, i32 0
  %157 = load i64, ptr %156, align 8, !tbaa !17
  %158 = add nsw i64 %157, %151
  store i64 %158, ptr %156, align 8, !tbaa !17
  %159 = load i32, ptr %9, align 4, !tbaa !9
  %160 = sext i32 %159 to i64
  %161 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IxxExESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %160) #6
  %162 = getelementptr inbounds %"struct.std::pair", ptr %161, i32 0, i32 0
  %163 = getelementptr inbounds %"struct.std::pair.0", ptr %162, i32 0, i32 1
  %164 = load i64, ptr %163, align 8, !tbaa !16
  %165 = load i32, ptr %7, align 4, !tbaa !9
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [1048576 x %"struct.std::pair"], ptr @dp, i64 0, i64 %166
  %168 = getelementptr inbounds %"struct.std::pair", ptr %167, i32 0, i32 0
  %169 = getelementptr inbounds %"struct.std::pair.0", ptr %168, i32 0, i32 1
  %170 = load i64, ptr %169, align 8, !tbaa !16
  %171 = add nsw i64 %170, %164
  store i64 %171, ptr %169, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %172

172:                                              ; preds = %145, %80
  br label %173

173:                                              ; preds = %172
  %174 = load i32, ptr %9, align 4, !tbaa !9
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %9, align 4, !tbaa !9
  br label %74, !llvm.loop !18

176:                                              ; preds = %79
  %177 = load i32, ptr %7, align 4, !tbaa !9
  %178 = icmp eq i32 %177, 0
  br i1 %178, label %179, label %184

179:                                              ; preds = %176
  %180 = load i32, ptr %7, align 4, !tbaa !9
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [1048576 x %"struct.std::pair"], ptr @dp, i64 0, i64 %181
  %183 = getelementptr inbounds %"struct.std::pair", ptr %182, i32 0, i32 1
  store i64 1000000007, ptr %183, align 8, !tbaa !13
  br label %184

184:                                              ; preds = %179, %176
  %185 = load i32, ptr %7, align 4, !tbaa !9
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [1048576 x %"struct.std::pair"], ptr @dp, i64 0, i64 %186
  %188 = getelementptr inbounds %"struct.std::pair", ptr %187, i32 0, i32 0
  %189 = getelementptr inbounds %"struct.std::pair.0", ptr %188, i32 0, i32 0
  %190 = load i64, ptr %189, align 8, !tbaa !17
  %191 = load i64, ptr @H, align 8, !tbaa !5
  %192 = icmp sge i64 %190, %191
  br i1 %192, label %193, label %205

193:                                              ; preds = %184
  %194 = load i32, ptr %7, align 4, !tbaa !9
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [1048576 x %"struct.std::pair"], ptr @dp, i64 0, i64 %195
  %197 = getelementptr inbounds %"struct.std::pair", ptr %196, i32 0, i32 1
  %198 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @ans, ptr noundef nonnull align 8 dereferenceable(8) %197)
          to label %199 unwind label %201

199:                                              ; preds = %193
  %200 = load i64, ptr %198, align 8, !tbaa !5
  store i64 %200, ptr @ans, align 8, !tbaa !5
  br label %205

201:                                              ; preds = %193
  %202 = landingpad { ptr, i32 }
          cleanup
  %203 = extractvalue { ptr, i32 } %202, 0
  store ptr %203, ptr %4, align 8
  %204 = extractvalue { ptr, i32 } %202, 1
  store i32 %204, ptr %5, align 4
  br label %209

205:                                              ; preds = %199, %184
  br label %206

206:                                              ; preds = %205
  %207 = load i32, ptr %7, align 4, !tbaa !9
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %7, align 4, !tbaa !9
  br label %62, !llvm.loop !19

209:                                              ; preds = %201, %140
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %222

210:                                              ; preds = %68
  %211 = load i64, ptr @ans, align 8, !tbaa !5
  %212 = icmp eq i64 %211, -1
  br i1 %212, label %213, label %216

213:                                              ; preds = %210
  %214 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef @.str.4)
          to label %215 unwind label %29

215:                                              ; preds = %213
  br label %220

216:                                              ; preds = %210
  %217 = load i64, ptr @ans, align 8, !tbaa !5
  %218 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %217)
          to label %219 unwind label %29

219:                                              ; preds = %216
  br label %220

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

222:                                              ; preds = %209, %57, %29
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %3) #6
  br label %223

223:                                              ; preds = %222, %25
  call void @llvm.lifetime.end.p0(i64 512, ptr %3) #6
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %2) #6
  call void @llvm.lifetime.end.p0(i64 520, ptr %2) #6
  br label %224

224:                                              ; preds = %223
  %225 = load ptr, ptr %4, align 8
  %226 = load i32, ptr %5, 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

; 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(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IxxExESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

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

; 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) #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256)) 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 = { 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 = { 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 = { 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 #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long 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 = !{!14, !6, i64 16}
!14 = !{!"_ZTSSt4pairIS_IxxExE", !15, i64 0, !6, i64 16}
!15 = !{!"_ZTSSt4pairIxxE", !6, i64 0, !6, i64 8}
!16 = !{!14, !6, i64 8}
!17 = !{!14, !6, i64 0}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<std::pair<long long, long long>, long long>, std::allocator<std::pair<std::pair<long long, long long>, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<std::pair<long long, long long>, long long>, std::allocator<std::pair<std::pair<long long, long long>, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<std::pair<long long, long long>, long long>, std::allocator<std::pair<std::pair<long long, long long>, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<std::pair<long long, long long>, long long>, std::allocator<std::pair<std::pair<long long, long long>, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { %"struct.std::pair.0", i64 }
%"struct.std::pair.0" = type { i64, i64 }
%"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 }

@N = external dso_local global i64, align 8
@H = external dso_local global i64, align 8
@ans = external dso_local global i64, align 8
@cows = external dso_local global %"class.std::vector", align 8
@dp = external dso_local global [1048576 x %"struct.std::pair"], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [17 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 i64, align 8
  call void @llvm.lifetime.start.p0(i64 520, ptr nonnull %1) #6
  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) #6
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %2, ptr noundef nonnull @.str.3, i32 noundef 16)
          to label %4 unwind label %14

4:                                                ; preds = %0
  %5 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(8) @N)
          to label %6 unwind label %16

6:                                                ; preds = %4
  %7 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) @H)
          to label %8 unwind label %16

8:                                                ; preds = %6
  %9 = load i64, ptr @N, align 8, !tbaa !5
  invoke void @_ZNSt6vectorISt4pairIS0_IxxExESaIS2_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %9)
          to label %.preheader45 unwind label %16

.preheader45:                                     ; preds = %8
  %10 = load i64, ptr @N, align 8, !tbaa !5
  %11 = icmp sgt i64 %10, 0
  br i1 %11, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %28, %.preheader45
  %12 = phi i64 [ %10, %.preheader45 ], [ %29, %28 ]
  %13 = and i64 %12, 4294967295
  %.not52 = icmp eq i64 %13, 31
  br i1 %.not52, label %._crit_edge51, label %.lr.ph50

14:                                               ; preds = %0
  %15 = landingpad { ptr, i32 }
          cleanup
  br label %103

16:                                               ; preds = %99, %97, %8, %6, %4
  %17 = landingpad { ptr, i32 }
          cleanup
  br label %102

.lr.ph:                                           ; preds = %.preheader45, %28
  %indvars.iv = phi i64 [ %indvars.iv.next, %28 ], [ 0, %.preheader45 ]
  %18 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IxxExESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %indvars.iv) #6
  %19 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %20 unwind label %31

20:                                               ; preds = %.lr.ph
  %21 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IxxExESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %indvars.iv) #6
  %22 = getelementptr inbounds i8, ptr %21, i64 8
  %23 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(8) %22)
          to label %24 unwind label %31

24:                                               ; preds = %20
  %25 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IxxExESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %indvars.iv) #6
  %26 = getelementptr inbounds i8, ptr %25, i64 16
  %27 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(8) %26)
          to label %28 unwind label %31

28:                                               ; preds = %24
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = load i64, ptr @N, align 8, !tbaa !5
  %30 = icmp sgt i64 %29, %indvars.iv.next
  br i1 %30, label %.lr.ph, label %.preheader, !llvm.loop !9

31:                                               ; preds = %24, %20, %.lr.ph
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %102

._crit_edge51:                                    ; preds = %91, %.preheader
  %33 = load i64, ptr @ans, align 8, !tbaa !5
  %34 = icmp eq i64 %33, -1
  br i1 %34, label %97, label %99

.lr.ph50:                                         ; preds = %.preheader, %91
  %35 = phi i64 [ %92, %91 ], [ %12, %.preheader ]
  %indvars.iv57 = phi i64 [ %indvars.iv.next58, %91 ], [ 0, %.preheader ]
  %36 = getelementptr inbounds [1048576 x %"struct.std::pair"], ptr @dp, i64 0, i64 %indvars.iv57
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  store i64 -1, ptr %37, align 8, !tbaa !11
  %38 = icmp sgt i64 %35, 0
  br i1 %38, label %.lr.ph48, label %._crit_edge

.lr.ph48:                                         ; preds = %.lr.ph50
  %39 = getelementptr inbounds i8, ptr %36, i64 8
  %40 = trunc nuw nsw i64 %indvars.iv57 to i32
  br label %43

._crit_edge:                                      ; preds = %80, %.lr.ph50
  %41 = phi i64 [ %35, %.lr.ph50 ], [ %81, %80 ]
  %42 = icmp eq i64 %indvars.iv57, 0
  br i1 %42, label %84, label %85

43:                                               ; preds = %.lr.ph48, %80
  %44 = phi i64 [ %35, %.lr.ph48 ], [ %81, %80 ]
  %45 = phi i64 [ %35, %.lr.ph48 ], [ %82, %80 ]
  %indvars.iv54 = phi i64 [ 0, %.lr.ph48 ], [ %indvars.iv.next55, %80 ]
  %46 = trunc nuw nsw i64 %indvars.iv54 to i32
  %47 = shl nuw i32 1, %46
  %48 = and i32 %47, %40
  %.not40 = icmp eq i32 %48, 0
  br i1 %.not40, label %80, label %49

49:                                               ; preds = %43
  %50 = xor i32 %47, %40
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [1048576 x %"struct.std::pair"], ptr @dp, i64 0, i64 %51
  %53 = getelementptr inbounds i8, ptr %52, i64 16
  %54 = load i64, ptr %53, align 8, !tbaa !11
  %.not41 = icmp eq i64 %54, -1
  br i1 %.not41, label %70, label %55

55:                                               ; preds = %49
  %56 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IxxExESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %indvars.iv54) #6
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  %58 = load i64, ptr %57, align 8, !tbaa !11
  %59 = getelementptr inbounds i8, ptr %52, i64 8
  %60 = load i64, ptr %59, align 8, !tbaa !14
  %.not42 = icmp slt i64 %58, %60
  br i1 %.not42, label %70, label %61

61:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %62 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IxxExESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %indvars.iv54) #6
  %63 = getelementptr inbounds i8, ptr %62, i64 16
  %64 = load i64, ptr %63, align 8, !tbaa !11
  %65 = load i64, ptr %59, align 8, !tbaa !14
  %66 = sub nsw i64 %64, %65
  store i64 %66, ptr %3, align 8, !tbaa !5
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %53, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull align 8 dereferenceable(8) %67)
  %69 = load i64, ptr %68, align 8, !tbaa !5
  store i64 %69, ptr %37, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br label %70

70:                                               ; preds = %55, %61, %49
  %71 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IxxExESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %indvars.iv54) #6
  %72 = load i64, ptr %71, align 8, !tbaa !15
  %73 = load i64, ptr %36, align 8, !tbaa !15
  %74 = add nsw i64 %73, %72
  store i64 %74, ptr %36, align 8, !tbaa !15
  %75 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IxxExESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %indvars.iv54) #6
  %76 = getelementptr inbounds i8, ptr %75, i64 8
  %77 = load i64, ptr %76, align 8, !tbaa !14
  %78 = load i64, ptr %39, align 8, !tbaa !14
  %79 = add nsw i64 %78, %77
  store i64 %79, ptr %39, align 8, !tbaa !14
  %.pre = load i64, ptr @N, align 8, !tbaa !5
  br label %80

80:                                               ; preds = %43, %70
  %81 = phi i64 [ %44, %43 ], [ %.pre, %70 ]
  %82 = phi i64 [ %45, %43 ], [ %.pre, %70 ]
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %83 = icmp sgt i64 %82, %indvars.iv.next55
  br i1 %83, label %43, label %._crit_edge, !llvm.loop !16

84:                                               ; preds = %._crit_edge
  store i64 1000000007, ptr %37, align 8, !tbaa !11
  br label %85

85:                                               ; preds = %84, %._crit_edge
  %86 = load i64, ptr %36, align 8, !tbaa !15
  %87 = load i64, ptr @H, align 8, !tbaa !5
  %.not = icmp slt i64 %86, %87
  br i1 %.not, label %91, label %88

88:                                               ; preds = %85
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @ans, ptr noundef nonnull align 8 dereferenceable(8) %37)
  %90 = load i64, ptr %89, align 8, !tbaa !5
  store i64 %90, ptr @ans, align 8, !tbaa !5
  %.pre60 = load i64, ptr @N, align 8, !tbaa !5
  br label %91

91:                                               ; preds = %85, %88
  %92 = phi i64 [ %41, %85 ], [ %.pre60, %88 ]
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %93 = trunc i64 %92 to i32
  %94 = shl nuw i32 1, %93
  %95 = sext i32 %94 to i64
  %96 = icmp slt i64 %indvars.iv.next58, %95
  br i1 %96, label %.lr.ph50, label %._crit_edge51, !llvm.loop !17

97:                                               ; preds = %._crit_edge51
  %98 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull @.str.4)
          to label %101 unwind label %16

99:                                               ; preds = %._crit_edge51
  %100 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %2, i64 noundef %33)
          to label %101 unwind label %16

101:                                              ; preds = %99, %97
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %2) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %2) #6
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %1) #6
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %1) #6
  ret i32 0

102:                                              ; preds = %31, %16
  %.pn = phi { ptr, i32 } [ %32, %31 ], [ %17, %16 ]
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %2) #6
  br label %103

103:                                              ; preds = %102, %14
  %.pn.pn = phi { ptr, i32 } [ %.pn, %102 ], [ %15, %14 ]
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %2) #6
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %1) #6
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %1) #6
  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(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIS0_IxxExESaIS2_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IxxExESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256)) 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 = { 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 = { 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 = { 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 #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

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


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