; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2015-16/Jan 2016/Gold (16 Jan G2)

; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"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.0 }
%union.anon.0 = 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 }

@MOD = external dso_local global i64, align 8
@pos1 = external dso_local global [1001 x %"struct.std::pair"], align 16
@pos2 = external dso_local global [1001 x %"struct.std::pair"], align 16
@best = external dso_local global [1001 x [1001 x i64]], align 16
@_Z2d1B5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_Z2d2B5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_Z6getdirc(i8 noundef signext) #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #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 noundef i32 @_Z4distSt4pairIiiES0_(i64, i64) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 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 %"struct.std::pair", align 4
  %10 = alloca %"struct.std::pair", align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 4
  %15 = alloca %"struct.std::pair", align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca %"struct.std::pair", align 4
  %24 = alloca %"struct.std::pair", 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 %25 unwind label %47

25:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %26 = 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 %27 unwind label %51

27:                                               ; preds = %25
  %28 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %29 unwind label %51

29:                                               ; preds = %27
  %30 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 4 dereferenceable(4) @pos1)
          to label %31 unwind label %51

31:                                               ; preds = %29
  %32 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %30, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (%"struct.std::pair", ptr @pos1, i32 0, i32 1))
          to label %33 unwind label %51

33:                                               ; preds = %31
  %34 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 4 dereferenceable(4) @pos2)
          to label %35 unwind label %51

35:                                               ; preds = %33
  %36 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %34, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (%"struct.std::pair", ptr @pos2, i32 0, i32 1))
          to label %37 unwind label %51

37:                                               ; preds = %35
  %38 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(32) @_Z2d1B5cxx11)
          to label %39 unwind label %51

39:                                               ; preds = %37
  %40 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 8 dereferenceable(32) @_Z2d2B5cxx11)
          to label %41 unwind label %51

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

42:                                               ; preds = %85, %41
  %43 = load i32, ptr %8, align 4, !tbaa !5
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %55, label %46

46:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %97

47:                                               ; preds = %0
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %4, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %5, align 4
  br label %325

51:                                               ; preds = %313, %39, %37, %35, %33, %31, %29, %27, %25
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %4, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %5, align 4
  br label %324

55:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %56 = load i32, ptr %8, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z2d1B5cxx11, i64 noundef %57)
          to label %59 unwind label %88

59:                                               ; preds = %55
  %60 = load i8, ptr %58, align 1, !tbaa !9
  %61 = invoke i64 @_Z6getdirc(i8 noundef signext %60)
          to label %62 unwind label %88

62:                                               ; preds = %59
  store i64 %61, ptr %9, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr @pos1, i64 0, i64 %64
  %66 = getelementptr inbounds %"struct.std::pair", ptr %65, i32 0, i32 0
  %67 = load i32, ptr %66, align 8, !tbaa !10
  %68 = getelementptr inbounds %"struct.std::pair", ptr %9, i32 0, i32 0
  %69 = load i32, ptr %68, align 4, !tbaa !10
  %70 = add nsw i32 %67, %69
  store i32 %70, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %71 = load i32, ptr %8, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr @pos1, i64 0, i64 %72
  %74 = getelementptr inbounds %"struct.std::pair", ptr %73, i32 0, i32 1
  %75 = load i32, ptr %74, align 4, !tbaa !12
  %76 = getelementptr inbounds %"struct.std::pair", ptr %9, i32 0, i32 1
  %77 = load i32, ptr %76, align 4, !tbaa !12
  %78 = add nsw i32 %75, %77
  store i32 %78, ptr %12, align 4, !tbaa !5
  invoke void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %79 unwind label %92

79:                                               ; preds = %62
  %80 = load i32, ptr %8, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr @pos1, i64 0, i64 %82
  %84 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %83, ptr noundef nonnull align 4 dereferenceable(8) %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %85

85:                                               ; preds = %79
  %86 = load i32, ptr %8, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %8, align 4, !tbaa !5
  br label %42, !llvm.loop !13

88:                                               ; preds = %59, %55
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %4, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %5, align 4
  br label %96

92:                                               ; preds = %62
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %4, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %96

96:                                               ; preds = %92, %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %324

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

98:                                               ; preds = %133, %97
  %99 = load i32, ptr %13, align 4, !tbaa !5
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = icmp slt i32 %99, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %98
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %145

103:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %104 = load i32, ptr %13, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z2d2B5cxx11, i64 noundef %105)
          to label %107 unwind label %136

107:                                              ; preds = %103
  %108 = load i8, ptr %106, align 1, !tbaa !9
  %109 = invoke i64 @_Z6getdirc(i8 noundef signext %108)
          to label %110 unwind label %136

110:                                              ; preds = %107
  store i64 %109, ptr %14, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %111 = load i32, ptr %13, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr @pos2, i64 0, i64 %112
  %114 = getelementptr inbounds %"struct.std::pair", ptr %113, i32 0, i32 0
  %115 = load i32, ptr %114, align 8, !tbaa !10
  %116 = getelementptr inbounds %"struct.std::pair", ptr %14, i32 0, i32 0
  %117 = load i32, ptr %116, align 4, !tbaa !10
  %118 = add nsw i32 %115, %117
  store i32 %118, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %119 = load i32, ptr %13, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr @pos2, i64 0, i64 %120
  %122 = getelementptr inbounds %"struct.std::pair", ptr %121, i32 0, i32 1
  %123 = load i32, ptr %122, align 4, !tbaa !12
  %124 = getelementptr inbounds %"struct.std::pair", ptr %14, i32 0, i32 1
  %125 = load i32, ptr %124, align 4, !tbaa !12
  %126 = add nsw i32 %123, %125
  store i32 %126, ptr %17, align 4, !tbaa !5
  invoke void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %127 unwind label %140

127:                                              ; preds = %110
  %128 = load i32, ptr %13, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr @pos2, i64 0, i64 %130
  %132 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %131, ptr noundef nonnull align 4 dereferenceable(8) %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %133

133:                                              ; preds = %127
  %134 = load i32, ptr %13, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %13, align 4, !tbaa !5
  br label %98, !llvm.loop !15

136:                                              ; preds = %107, %103
  %137 = landingpad { ptr, i32 }
          cleanup
  %138 = extractvalue { ptr, i32 } %137, 0
  store ptr %138, ptr %4, align 8
  %139 = extractvalue { ptr, i32 } %137, 1
  store i32 %139, ptr %5, align 4
  br label %144

140:                                              ; preds = %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 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %144

144:                                              ; preds = %140, %136
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %324

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

146:                                              ; preds = %169, %145
  %147 = load i32, ptr %18, align 4, !tbaa !5
  %148 = icmp slt i32 %147, 1001
  br i1 %148, label %150, label %149

149:                                              ; preds = %146
  store i32 8, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %172

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

151:                                              ; preds = %165, %150
  %152 = load i32, ptr %20, align 4, !tbaa !5
  %153 = icmp slt i32 %152, 1001
  br i1 %153, label %155, label %154

154:                                              ; preds = %151
  store i32 11, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %168

155:                                              ; preds = %151
  %156 = load i64, ptr @MOD, align 8, !tbaa !16
  %157 = load i64, ptr @MOD, align 8, !tbaa !16
  %158 = mul nsw i64 %156, %157
  %159 = load i32, ptr %18, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %160
  %162 = load i32, ptr %20, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [1001 x i64], ptr %161, i64 0, i64 %163
  store i64 %158, ptr %164, align 8, !tbaa !16
  br label %165

165:                                              ; preds = %155
  %166 = load i32, ptr %20, align 4, !tbaa !5
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %20, align 4, !tbaa !5
  br label %151, !llvm.loop !18

168:                                              ; preds = %154
  br label %169

169:                                              ; preds = %168
  %170 = load i32, ptr %18, align 4, !tbaa !5
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %18, align 4, !tbaa !5
  br label %146, !llvm.loop !19

172:                                              ; preds = %149
  store i64 0, ptr @best, align 16, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %173

173:                                              ; preds = %310, %172
  %174 = load i32, ptr %21, align 4, !tbaa !5
  %175 = load i32, ptr %6, align 4, !tbaa !5
  %176 = add nsw i32 %175, 1
  %177 = icmp slt i32 %174, %176
  br i1 %177, label %179, label %178

178:                                              ; preds = %173
  store i32 14, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %313

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

180:                                              ; preds = %306, %179
  %181 = load i32, ptr %22, align 4, !tbaa !5
  %182 = load i32, ptr %7, align 4, !tbaa !5
  %183 = add nsw i32 %182, 1
  %184 = icmp slt i32 %181, %183
  br i1 %184, label %186, label %185

185:                                              ; preds = %180
  store i32 17, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %309

186:                                              ; preds = %180
  %187 = load i32, ptr %21, align 4, !tbaa !5
  %188 = icmp ne i32 %187, 0
  br i1 %188, label %192, label %189

189:                                              ; preds = %186
  %190 = load i32, ptr %22, align 4, !tbaa !5
  %191 = icmp ne i32 %190, 0
  br i1 %191, label %192, label %211

192:                                              ; preds = %189, %186
  %193 = load i32, ptr %21, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr @pos1, i64 0, i64 %194
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 8 %195, i64 8, i1 false)
  %196 = load i32, ptr %22, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr @pos2, i64 0, i64 %197
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 8 %198, i64 8, i1 false)
  %199 = load i64, ptr %23, align 4
  %200 = load i64, ptr %24, align 4
  %201 = call noundef i32 @_Z4distSt4pairIiiES0_(i64 %199, i64 %200)
  %202 = sext i32 %201 to i64
  %203 = load i32, ptr %21, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %204
  %206 = load i32, ptr %22, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [1001 x i64], ptr %205, i64 0, i64 %207
  %209 = load i64, ptr %208, align 8, !tbaa !16
  %210 = add nsw i64 %209, %202
  store i64 %210, ptr %208, align 8, !tbaa !16
  br label %211

211:                                              ; preds = %192, %189
  %212 = load i32, ptr %21, align 4, !tbaa !5
  %213 = load i32, ptr %6, align 4, !tbaa !5
  %214 = icmp slt i32 %212, %213
  br i1 %214, label %215, label %243

215:                                              ; preds = %211
  %216 = load i32, ptr %21, align 4, !tbaa !5
  %217 = add nsw i32 %216, 1
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %218
  %220 = load i32, ptr %22, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [1001 x i64], ptr %219, i64 0, i64 %221
  %223 = load i32, ptr %21, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %224
  %226 = load i32, ptr %22, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [1001 x i64], ptr %225, i64 0, i64 %227
  %229 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %222, ptr noundef nonnull align 8 dereferenceable(8) %228)
          to label %230 unwind label %239

230:                                              ; preds = %215
  %231 = load i64, ptr %229, align 8, !tbaa !16
  %232 = load i32, ptr %21, align 4, !tbaa !5
  %233 = add nsw i32 %232, 1
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %234
  %236 = load i32, ptr %22, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [1001 x i64], ptr %235, i64 0, i64 %237
  store i64 %231, ptr %238, align 8, !tbaa !16
  br label %243

239:                                              ; preds = %279, %247, %215
  %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 %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %324

243:                                              ; preds = %230, %211
  %244 = load i32, ptr %22, align 4, !tbaa !5
  %245 = load i32, ptr %7, align 4, !tbaa !5
  %246 = icmp slt i32 %244, %245
  br i1 %246, label %247, label %271

247:                                              ; preds = %243
  %248 = load i32, ptr %21, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %249
  %251 = load i32, ptr %22, align 4, !tbaa !5
  %252 = add nsw i32 %251, 1
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds [1001 x i64], ptr %250, i64 0, i64 %253
  %255 = load i32, ptr %21, align 4, !tbaa !5
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %256
  %258 = load i32, ptr %22, align 4, !tbaa !5
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds [1001 x i64], ptr %257, i64 0, i64 %259
  %261 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %254, ptr noundef nonnull align 8 dereferenceable(8) %260)
          to label %262 unwind label %239

262:                                              ; preds = %247
  %263 = load i64, ptr %261, align 8, !tbaa !16
  %264 = load i32, ptr %21, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %265
  %267 = load i32, ptr %22, align 4, !tbaa !5
  %268 = add nsw i32 %267, 1
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [1001 x i64], ptr %266, i64 0, i64 %269
  store i64 %263, ptr %270, align 8, !tbaa !16
  br label %271

271:                                              ; preds = %262, %243
  %272 = load i32, ptr %21, align 4, !tbaa !5
  %273 = load i32, ptr %6, align 4, !tbaa !5
  %274 = icmp slt i32 %272, %273
  br i1 %274, label %275, label %305

275:                                              ; preds = %271
  %276 = load i32, ptr %22, align 4, !tbaa !5
  %277 = load i32, ptr %7, align 4, !tbaa !5
  %278 = icmp slt i32 %276, %277
  br i1 %278, label %279, label %305

279:                                              ; preds = %275
  %280 = load i32, ptr %21, align 4, !tbaa !5
  %281 = add nsw i32 %280, 1
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %282
  %284 = load i32, ptr %22, align 4, !tbaa !5
  %285 = add nsw i32 %284, 1
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds [1001 x i64], ptr %283, i64 0, i64 %286
  %288 = load i32, ptr %21, align 4, !tbaa !5
  %289 = sext i32 %288 to i64
  %290 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %289
  %291 = load i32, ptr %22, align 4, !tbaa !5
  %292 = sext i32 %291 to i64
  %293 = getelementptr inbounds [1001 x i64], ptr %290, i64 0, i64 %292
  %294 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %287, ptr noundef nonnull align 8 dereferenceable(8) %293)
          to label %295 unwind label %239

295:                                              ; preds = %279
  %296 = load i64, ptr %294, align 8, !tbaa !16
  %297 = load i32, ptr %21, align 4, !tbaa !5
  %298 = add nsw i32 %297, 1
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %299
  %301 = load i32, ptr %22, align 4, !tbaa !5
  %302 = add nsw i32 %301, 1
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds [1001 x i64], ptr %300, i64 0, i64 %303
  store i64 %296, ptr %304, align 8, !tbaa !16
  br label %305

305:                                              ; preds = %295, %275, %271
  br label %306

306:                                              ; preds = %305
  %307 = load i32, ptr %22, align 4, !tbaa !5
  %308 = add nsw i32 %307, 1
  store i32 %308, ptr %22, align 4, !tbaa !5
  br label %180, !llvm.loop !20

309:                                              ; preds = %185
  br label %310

310:                                              ; preds = %309
  %311 = load i32, ptr %21, align 4, !tbaa !5
  %312 = add nsw i32 %311, 1
  store i32 %312, ptr %21, align 4, !tbaa !5
  br label %173, !llvm.loop !21

313:                                              ; preds = %178
  %314 = load i32, ptr %6, align 4, !tbaa !5
  %315 = sext i32 %314 to i64
  %316 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %315
  %317 = load i32, ptr %7, align 4, !tbaa !5
  %318 = sext i32 %317 to i64
  %319 = getelementptr inbounds [1001 x i64], ptr %316, i64 0, i64 %318
  %320 = load i64, ptr %319, align 8, !tbaa !16
  %321 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %320)
          to label %322 unwind label %51

322:                                              ; preds = %313
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  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
  %323 = load i32, ptr %1, align 4
  ret i32 %323

324:                                              ; preds = %239, %144, %96, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  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 %325

325:                                              ; preds = %324, %47
  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 %326

326:                                              ; preds = %325
  %327 = load ptr, ptr %4, align 8
  %328 = load i32, ptr %5, align 4
  %329 = insertvalue { ptr, i32 } poison, ptr %327, 0
  %330 = insertvalue { ptr, i32 } %329, i32 %328, 1
  resume { ptr, i32 } %330
}

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef, i32 noundef) unnamed_addr #0 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 #0 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)) #4

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #4

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #2 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)) #2 align 2

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

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

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

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #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, !17, i64 0}
!17 = !{!"long long", !7, i64 0}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"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.0 }
%union.anon.0 = 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 }

@MOD = external dso_local local_unnamed_addr global i64, align 8
@pos1 = external dso_local global [1001 x %"struct.std::pair"], align 16
@pos2 = external dso_local global [1001 x %"struct.std::pair"], align 16
@best = external dso_local global [1001 x [1001 x i64]], align 16
@_Z2d1B5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_Z2d2B5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_Z6getdirc(i8 noundef signext) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) 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 noundef i32 @_Z4distSt4pairIiiES0_(i64, i64) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 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 %"struct.std::pair", align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair", align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  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.2, i32 noundef 16)
          to label %11 unwind label %31

11:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %12 = 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 %13 unwind label %33

13:                                               ; preds = %11
  %14 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %15 unwind label %33

15:                                               ; preds = %13
  %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) @pos1)
          to label %17 unwind label %33

17:                                               ; preds = %15
  %18 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @pos1, i64 4))
          to label %19 unwind label %33

19:                                               ; preds = %17
  %20 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 4 dereferenceable(4) @pos2)
          to label %21 unwind label %33

21:                                               ; preds = %19
  %22 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @pos2, i64 4))
          to label %23 unwind label %33

23:                                               ; preds = %21
  %24 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(32) @_Z2d1B5cxx11)
          to label %25 unwind label %33

25:                                               ; preds = %23
  %26 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(32) @_Z2d2B5cxx11)
          to label %.preheader72 unwind label %33

.preheader72:                                     ; preds = %25
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph, label %.preheader71

.preheader71:                                     ; preds = %38, %.preheader72
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph75, label %.preheader70

31:                                               ; preds = %0
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %144

33:                                               ; preds = %._crit_edge83, %25, %23, %21, %19, %17, %15, %13, %11
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %143

.lr.ph:                                           ; preds = %.preheader72, %38
  %indvars.iv = phi i64 [ %indvars.iv.next, %38 ], [ 0, %.preheader72 ]
  %35 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z2d1B5cxx11, i64 noundef %indvars.iv)
  %36 = load i8, ptr %35, align 1, !tbaa !9
  %37 = invoke i64 @_Z6getdirc(i8 noundef signext %36)
          to label %38 unwind label %50

38:                                               ; preds = %.lr.ph
  %.sroa.047.0.extract.trunc = trunc i64 %37 to i32
  %.sroa.548.0.extract.shift = lshr i64 %37, 32
  %.sroa.548.0.extract.trunc = trunc nuw i64 %.sroa.548.0.extract.shift to i32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %39 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr @pos1, i64 0, i64 %indvars.iv
  %40 = load i32, ptr %39, align 8, !tbaa !10
  %41 = add nsw i32 %40, %.sroa.047.0.extract.trunc
  store i32 %41, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  %42 = getelementptr inbounds i8, ptr %39, i64 4
  %43 = load i32, ptr %42, align 4, !tbaa !12
  %44 = add nsw i32 %43, %.sroa.548.0.extract.trunc
  store i32 %44, ptr %7, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %45 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr @pos1, i64 0, i64 %indvars.iv.next
  %46 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %45, ptr noundef nonnull align 4 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = icmp slt i64 %indvars.iv.next, %48
  br i1 %49, label %.lr.ph, label %.preheader71, !llvm.loop !13

50:                                               ; preds = %.lr.ph
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %143

.preheader70:                                     ; preds = %58, %.preheader71
  %52 = phi i32 [ %29, %.preheader71 ], [ %67, %58 ]
  %53 = load i64, ptr @MOD, align 8, !tbaa !15
  %54 = mul nsw i64 %53, %53
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %54, i64 0
  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.ph

.lr.ph75:                                         ; preds = %.preheader71, %58
  %indvars.iv87 = phi i64 [ %indvars.iv.next88, %58 ], [ 0, %.preheader71 ]
  %55 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z2d2B5cxx11, i64 noundef %indvars.iv87)
  %56 = load i8, ptr %55, align 1, !tbaa !9
  %57 = invoke i64 @_Z6getdirc(i8 noundef signext %56)
          to label %58 unwind label %70

58:                                               ; preds = %.lr.ph75
  %.sroa.040.0.extract.trunc = trunc i64 %57 to i32
  %.sroa.5.0.extract.shift = lshr i64 %57, 32
  %.sroa.5.0.extract.trunc = trunc nuw i64 %.sroa.5.0.extract.shift to i32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  %59 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr @pos2, i64 0, i64 %indvars.iv87
  %60 = load i32, ptr %59, align 8, !tbaa !10
  %61 = add nsw i32 %60, %.sroa.040.0.extract.trunc
  store i32 %61, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #6
  %62 = getelementptr inbounds i8, ptr %59, i64 4
  %63 = load i32, ptr %62, align 4, !tbaa !12
  %64 = add nsw i32 %63, %.sroa.5.0.extract.trunc
  store i32 %64, ptr %10, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %65 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr @pos2, i64 0, i64 %indvars.iv.next88
  %66 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %65, ptr noundef nonnull align 4 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  %67 = load i32, ptr %4, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = icmp slt i64 %indvars.iv.next88, %68
  br i1 %69, label %.lr.ph75, label %.preheader70, !llvm.loop !17

70:                                               ; preds = %.lr.ph75
  %71 = landingpad { ptr, i32 }
          cleanup
  br label %143

vector.ph:                                        ; preds = %scalar.ph, %.preheader70
  %indvars.iv93 = phi i64 [ 0, %.preheader70 ], [ %indvars.iv.next94, %scalar.ph ]
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next.4, %vector.body ]
  %72 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %indvars.iv93, i64 %index
  %73 = getelementptr inbounds i8, ptr %72, i64 16
  store <2 x i64> %broadcast.splat, ptr %72, align 8, !tbaa !15
  store <2 x i64> %broadcast.splat, ptr %73, align 8, !tbaa !15
  %index.next = add nuw nsw i64 %index, 4
  %74 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %indvars.iv93, i64 %index.next
  %75 = getelementptr inbounds i8, ptr %74, i64 16
  store <2 x i64> %broadcast.splat, ptr %74, align 8, !tbaa !15
  store <2 x i64> %broadcast.splat, ptr %75, align 8, !tbaa !15
  %index.next.1 = add nuw nsw i64 %index, 8
  %76 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %indvars.iv93, i64 %index.next.1
  %77 = getelementptr inbounds i8, ptr %76, i64 16
  store <2 x i64> %broadcast.splat, ptr %76, align 8, !tbaa !15
  store <2 x i64> %broadcast.splat, ptr %77, align 8, !tbaa !15
  %index.next.2 = add nuw nsw i64 %index, 12
  %78 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %indvars.iv93, i64 %index.next.2
  %79 = getelementptr inbounds i8, ptr %78, i64 16
  store <2 x i64> %broadcast.splat, ptr %78, align 8, !tbaa !15
  store <2 x i64> %broadcast.splat, ptr %79, align 8, !tbaa !15
  %index.next.3 = add nuw nsw i64 %index, 16
  %80 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %indvars.iv93, i64 %index.next.3
  %81 = getelementptr inbounds i8, ptr %80, i64 16
  store <2 x i64> %broadcast.splat, ptr %80, align 8, !tbaa !15
  store <2 x i64> %broadcast.splat, ptr %81, align 8, !tbaa !15
  %index.next.4 = add nuw nsw i64 %index, 20
  %82 = icmp eq i64 %index.next.4, 1000
  br i1 %82, label %scalar.ph, label %vector.body, !llvm.loop !18

83:                                               ; preds = %scalar.ph
  store i64 0, ptr @best, align 16, !tbaa !15
  %84 = load i32, ptr %3, align 4, !tbaa !5
  %85 = or i32 %84, %52
  %or.cond115.not = icmp sgt i32 %85, -1
  br i1 %or.cond115.not, label %.preheader, label %._crit_edge83

scalar.ph:                                        ; preds = %vector.body
  %86 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %indvars.iv93, i64 1000
  store i64 %54, ptr %86, align 8, !tbaa !15
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %exitcond96.not = icmp eq i64 %indvars.iv.next94, 1001
  br i1 %exitcond96.not, label %83, label %vector.ph, !llvm.loop !21

.preheader:                                       ; preds = %83, %._crit_edge
  %87 = phi i32 [ %97, %._crit_edge ], [ %84, %83 ]
  %88 = phi i32 [ %98, %._crit_edge ], [ %52, %83 ]
  %indvars.iv100 = phi i64 [ %indvars.iv.next101.pre-phi, %._crit_edge ], [ 0, %83 ]
  %.not6578 = icmp slt i32 %88, 0
  br i1 %.not6578, label %.preheader.._crit_edge_crit_edge, label %.lr.ph80

.preheader.._crit_edge_crit_edge:                 ; preds = %.preheader
  %.pre109 = add nuw nsw i64 %indvars.iv100, 1
  br label %._crit_edge

.lr.ph80:                                         ; preds = %.preheader
  %89 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr @pos1, i64 0, i64 %indvars.iv100
  %90 = add nuw nsw i64 %indvars.iv100, 1
  br label %100

._crit_edge83:                                    ; preds = %._crit_edge, %83
  %91 = phi i32 [ %52, %83 ], [ %98, %._crit_edge ]
  %.lcssa = phi i32 [ %84, %83 ], [ %97, %._crit_edge ]
  %92 = sext i32 %.lcssa to i64
  %93 = sext i32 %91 to i64
  %94 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %92, i64 %93
  %95 = load i64, ptr %94, align 8, !tbaa !15
  %96 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %2, i64 noundef %95)
          to label %142 unwind label %33

._crit_edge.loopexit:                             ; preds = %._crit_edge108
  %.pre104 = load i32, ptr %3, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.preheader.._crit_edge_crit_edge, %._crit_edge.loopexit
  %indvars.iv.next101.pre-phi = phi i64 [ %.pre109, %.preheader.._crit_edge_crit_edge ], [ %90, %._crit_edge.loopexit ]
  %97 = phi i32 [ %87, %.preheader.._crit_edge_crit_edge ], [ %.pre104, %._crit_edge.loopexit ]
  %98 = phi i32 [ %88, %.preheader.._crit_edge_crit_edge ], [ %141, %._crit_edge.loopexit ]
  %99 = sext i32 %97 to i64
  %.not.not = icmp slt i64 %indvars.iv100, %99
  br i1 %.not.not, label %.preheader, label %._crit_edge83, !llvm.loop !22

100:                                              ; preds = %.lr.ph80, %._crit_edge108
  %indvars.iv97 = phi i64 [ 0, %.lr.ph80 ], [ %135, %._crit_edge108 ]
  %101 = or i64 %indvars.iv97, %indvars.iv100
  %102 = and i64 %101, 4294967295
  %or.cond.not = icmp eq i64 %102, 0
  br i1 %or.cond.not, label %110, label %103

103:                                              ; preds = %100
  %.sroa.02.0.copyload = load i64, ptr %89, align 8
  %104 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr @pos2, i64 0, i64 %indvars.iv97
  %.sroa.0.0.copyload = load i64, ptr %104, align 8
  %105 = call noundef i32 @_Z4distSt4pairIiiES0_(i64 %.sroa.02.0.copyload, i64 %.sroa.0.0.copyload)
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %indvars.iv100, i64 %indvars.iv97
  %108 = load i64, ptr %107, align 8, !tbaa !15
  %109 = add nsw i64 %108, %106
  store i64 %109, ptr %107, align 8, !tbaa !15
  br label %110

110:                                              ; preds = %100, %103
  %111 = load i32, ptr %3, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = icmp slt i64 %indvars.iv100, %112
  br i1 %113, label %114, label %119

114:                                              ; preds = %110
  %115 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %90, i64 %indvars.iv97
  %116 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %indvars.iv100, i64 %indvars.iv97
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %115, ptr noundef nonnull align 8 dereferenceable(8) %116)
  %118 = load i64, ptr %117, align 8, !tbaa !15
  store i64 %118, ptr %115, align 8, !tbaa !15
  br label %119

119:                                              ; preds = %114, %110
  %120 = load i32, ptr %4, align 4
  %121 = sext i32 %120 to i64
  %122 = icmp slt i64 %indvars.iv97, %121
  br i1 %122, label %123, label %129

123:                                              ; preds = %119
  %124 = add nuw nsw i64 %indvars.iv97, 1
  %125 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %indvars.iv100, i64 %124
  %126 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %indvars.iv100, i64 %indvars.iv97
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %125, ptr noundef nonnull align 8 dereferenceable(8) %126)
  %128 = load i64, ptr %127, align 8, !tbaa !15
  store i64 %128, ptr %125, align 8, !tbaa !15
  %.pre = load i32, ptr %4, align 4
  %.pre105 = sext i32 %.pre to i64
  br label %129

129:                                              ; preds = %123, %119
  %.pre-phi = phi i64 [ %.pre105, %123 ], [ %121, %119 ]
  %130 = phi i32 [ %.pre, %123 ], [ %120, %119 ]
  %131 = load i32, ptr %3, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = icmp slt i64 %indvars.iv100, %132
  %134 = icmp slt i64 %indvars.iv97, %.pre-phi
  %or.cond = select i1 %133, i1 %134, i1 false
  %135 = add nuw nsw i64 %indvars.iv97, 1
  br i1 %or.cond, label %136, label %._crit_edge108

136:                                              ; preds = %129
  %137 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %90, i64 %135
  %138 = getelementptr inbounds [1001 x [1001 x i64]], ptr @best, i64 0, i64 %indvars.iv100, i64 %indvars.iv97
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %137, ptr noundef nonnull align 8 dereferenceable(8) %138)
  %140 = load i64, ptr %139, align 8, !tbaa !15
  store i64 %140, ptr %137, align 8, !tbaa !15
  %.pre103 = load i32, ptr %4, align 4, !tbaa !5
  %.pre106 = sext i32 %.pre103 to i64
  br label %._crit_edge108

._crit_edge108:                                   ; preds = %129, %136
  %.pre-phi107 = phi i64 [ %.pre106, %136 ], [ %.pre-phi, %129 ]
  %141 = phi i32 [ %.pre103, %136 ], [ %130, %129 ]
  %.not65.not = icmp slt i64 %indvars.iv97, %.pre-phi107
  br i1 %.not65.not, label %100, label %._crit_edge.loopexit, !llvm.loop !24

142:                                              ; preds = %._crit_edge83
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  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

143:                                              ; preds = %70, %50, %33
  %.pn = phi { ptr, i32 } [ %51, %50 ], [ %71, %70 ], [ %34, %33 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %2) #6
  br label %144

144:                                              ; preds = %143, %31
  %.pn.pn = phi { ptr, i32 } [ %.pn, %143 ], [ %32, %31 ]
  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 uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef, i32 noundef) unnamed_addr #0 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 #0 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 #4

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4

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

; 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 #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 #0 align 2

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 #4 = { "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 = { 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 = !{!16, !16, i64 0}
!16 = !{!"long long", !7, i64 0}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14, !23}
!23 = !{!"llvm.loop.unswitch.partial.disable"}
!24 = distinct !{!24, !14}


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