; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/82 Beta Division 2/Problem D (D)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<char, std::pair<const char, std::pair<int, int>>, std::_Select1st<std::pair<const char, std::pair<int, int>>>, std::less<char>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<char, std::pair<const char, std::pair<int, int>>, std::_Select1st<std::pair<const char, std::pair<int, int>>>, std::less<char>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::__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_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::pair" = type { i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<char, int>, std::allocator<std::pair<char, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<char, int>, std::allocator<std::pair<char, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<char, int>, std::allocator<std::pair<char, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<char, int>, std::allocator<std::pair<char, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair.6" = type { i8, i32 }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair.8" = type { i8, %"struct.std::pair" }

@nn = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@grid = external dso_local global [1001 x [1001 x i32]], align 16
@n = external dso_local global [1001 x [1001 x i32]], align 16
@s = external dso_local global [1001 x [1001 x i32]], align 16
@e = external dso_local global [1001 x [1001 x i32]], align 16
@w = external dso_local global [1001 x [1001 x i32]], align 16
@pos = external dso_local global %"class.std::map", align 8
@res = external dso_local global [26 x i8], align 16
@_Z3strB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %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 i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.std::vector", align 8
  %11 = alloca i8, align 1
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"struct.std::pair.6", align 4
  %19 = alloca %"class.std::__cxx11::basic_string", align 8
  %20 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %21 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %22 = alloca i32, align 4
  %23 = alloca %"struct.std::_Rb_tree_iterator", align 8
  store i32 0, ptr %1, align 4
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @nn, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %77, %0
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = load i32, ptr @nn, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %25
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %80

30:                                               ; preds = %25
  %31 = call 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) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z3strB5cxx11)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %73, %30
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = load i32, ptr @m, align 4, !tbaa !5
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %32
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %76

37:                                               ; preds = %32
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3strB5cxx11, i64 noundef %39)
  %41 = load i8, ptr %40, align 1, !tbaa !9
  %42 = sext i8 %41 to i32
  %43 = icmp eq i32 %42, 35
  br i1 %43, label %44, label %51

44:                                               ; preds = %37
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [1001 x [1001 x i32]], ptr @grid, i64 0, i64 %46
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [1001 x i32], ptr %47, i64 0, i64 %49
  store i32 -1, ptr %50, align 4, !tbaa !5
  br label %72

51:                                               ; preds = %37
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [1001 x [1001 x i32]], ptr @grid, i64 0, i64 %53
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [1001 x i32], ptr %54, i64 0, i64 %56
  store i32 1, ptr %57, align 4, !tbaa !5
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3strB5cxx11, i64 noundef %59)
  %61 = load i8, ptr %60, align 1, !tbaa !9
  %62 = sext i8 %61 to i32
  %63 = icmp ne i32 %62, 46
  br i1 %63, label %64, label %71

64:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %65 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %65, ptr %5, align 4
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3strB5cxx11, i64 noundef %67)
  %69 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIcSt4pairIiiESt4lessIcESaIS0_IKcS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) @pos, ptr noundef nonnull align 1 dereferenceable(1) %68)
  %70 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %69, ptr noundef nonnull align 4 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %71

71:                                               ; preds = %64, %51
  br label %72

72:                                               ; preds = %71, %44
  br label %73

73:                                               ; preds = %72
  %74 = load i32, ptr %4, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %4, align 4, !tbaa !5
  br label %32, !llvm.loop !10

76:                                               ; preds = %36
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %2, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %2, align 4, !tbaa !5
  br label %25, !llvm.loop !12

80:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %150, %80
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = load i32, ptr @nn, align 4, !tbaa !5
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %81
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %153

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

87:                                               ; preds = %146, %86
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = load i32, ptr @m, align 4, !tbaa !5
  %90 = icmp slt i32 %88, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %87
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %149

92:                                               ; preds = %87
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [1001 x [1001 x i32]], ptr @grid, i64 0, i64 %94
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [1001 x i32], ptr %95, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = icmp eq i32 %99, -1
  br i1 %100, label %101, label %114

101:                                              ; preds = %92
  %102 = load i32, ptr %6, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [1001 x [1001 x i32]], ptr @w, i64 0, i64 %103
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [1001 x i32], ptr %104, i64 0, i64 %106
  store i32 -1, ptr %107, align 4, !tbaa !5
  %108 = load i32, ptr %6, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [1001 x [1001 x i32]], ptr @n, i64 0, i64 %109
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [1001 x i32], ptr %110, i64 0, i64 %112
  store i32 -1, ptr %113, align 4, !tbaa !5
  br label %145

114:                                              ; preds = %92
  %115 = load i32, ptr %6, align 4, !tbaa !5
  %116 = sub nsw i32 %115, 1
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [1001 x [1001 x i32]], ptr @n, i64 0, i64 %117
  %119 = load i32, ptr %7, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [1001 x i32], ptr %118, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  %124 = load i32, ptr %6, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [1001 x [1001 x i32]], ptr @n, i64 0, i64 %125
  %127 = load i32, ptr %7, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [1001 x i32], ptr %126, i64 0, i64 %128
  store i32 %123, ptr %129, align 4, !tbaa !5
  %130 = load i32, ptr %6, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [1001 x [1001 x i32]], ptr @w, i64 0, i64 %131
  %133 = load i32, ptr %7, align 4, !tbaa !5
  %134 = sub nsw i32 %133, 1
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [1001 x i32], ptr %132, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  %139 = load i32, ptr %6, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [1001 x [1001 x i32]], ptr @w, i64 0, i64 %140
  %142 = load i32, ptr %7, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [1001 x i32], ptr %141, i64 0, i64 %143
  store i32 %138, ptr %144, align 4, !tbaa !5
  br label %145

145:                                              ; preds = %114, %101
  br label %146

146:                                              ; preds = %145
  %147 = load i32, ptr %7, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %7, align 4, !tbaa !5
  br label %87, !llvm.loop !13

149:                                              ; preds = %91
  br label %150

150:                                              ; preds = %149
  %151 = load i32, ptr %6, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %6, align 4, !tbaa !5
  br label %81, !llvm.loop !14

153:                                              ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %154 = load i32, ptr @nn, align 4, !tbaa !5
  %155 = sub nsw i32 %154, 1
  store i32 %155, ptr %8, align 4, !tbaa !5
  br label %156

156:                                              ; preds = %225, %153
  %157 = load i32, ptr %8, align 4, !tbaa !5
  %158 = icmp sge i32 %157, 0
  br i1 %158, label %160, label %159

159:                                              ; preds = %156
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %228

160:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %161 = load i32, ptr @m, align 4, !tbaa !5
  %162 = sub nsw i32 %161, 1
  store i32 %162, ptr %9, align 4, !tbaa !5
  br label %163

163:                                              ; preds = %221, %160
  %164 = load i32, ptr %9, align 4, !tbaa !5
  %165 = icmp sge i32 %164, 0
  br i1 %165, label %167, label %166

166:                                              ; preds = %163
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %224

167:                                              ; preds = %163
  %168 = load i32, ptr %8, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [1001 x [1001 x i32]], ptr @grid, i64 0, i64 %169
  %171 = load i32, ptr %9, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [1001 x i32], ptr %170, i64 0, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !5
  %175 = icmp eq i32 %174, -1
  br i1 %175, label %176, label %189

176:                                              ; preds = %167
  %177 = load i32, ptr %8, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [1001 x [1001 x i32]], ptr @s, i64 0, i64 %178
  %180 = load i32, ptr %9, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [1001 x i32], ptr %179, i64 0, i64 %181
  store i32 -1, ptr %182, align 4, !tbaa !5
  %183 = load i32, ptr %8, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [1001 x [1001 x i32]], ptr @e, i64 0, i64 %184
  %186 = load i32, ptr %9, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [1001 x i32], ptr %185, i64 0, i64 %187
  store i32 -1, ptr %188, align 4, !tbaa !5
  br label %220

189:                                              ; preds = %167
  %190 = load i32, ptr %8, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [1001 x [1001 x i32]], ptr @e, i64 0, i64 %191
  %193 = load i32, ptr %9, align 4, !tbaa !5
  %194 = add nsw i32 %193, 1
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [1001 x i32], ptr %192, i64 0, i64 %195
  %197 = load i32, ptr %196, align 4, !tbaa !5
  %198 = add nsw i32 %197, 1
  %199 = load i32, ptr %8, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [1001 x [1001 x i32]], ptr @e, i64 0, i64 %200
  %202 = load i32, ptr %9, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [1001 x i32], ptr %201, i64 0, i64 %203
  store i32 %198, ptr %204, align 4, !tbaa !5
  %205 = load i32, ptr %8, align 4, !tbaa !5
  %206 = add nsw i32 %205, 1
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [1001 x [1001 x i32]], ptr @s, i64 0, i64 %207
  %209 = load i32, ptr %9, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [1001 x i32], ptr %208, i64 0, i64 %210
  %212 = load i32, ptr %211, align 4, !tbaa !5
  %213 = add nsw i32 %212, 1
  %214 = load i32, ptr %8, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [1001 x [1001 x i32]], ptr @s, i64 0, i64 %215
  %217 = load i32, ptr %9, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [1001 x i32], ptr %216, i64 0, i64 %218
  store i32 %213, ptr %219, align 4, !tbaa !5
  br label %220

220:                                              ; preds = %189, %176
  br label %221

221:                                              ; preds = %220
  %222 = load i32, ptr %9, align 4, !tbaa !5
  %223 = add nsw i32 %222, -1
  store i32 %223, ptr %9, align 4, !tbaa !5
  br label %163, !llvm.loop !15

224:                                              ; preds = %166
  br label %225

225:                                              ; preds = %224
  %226 = load i32, ptr %8, align 4, !tbaa !5
  %227 = add nsw i32 %226, -1
  store i32 %227, ptr %8, align 4, !tbaa !5
  br label %156, !llvm.loop !16

228:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #6
  call void @_ZNSt6vectorISt4pairIciESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %229 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %14)
          to label %230 unwind label %236

230:                                              ; preds = %228
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %231

231:                                              ; preds = %246, %230
  %232 = load i32, ptr %17, align 4, !tbaa !5
  %233 = load i32, ptr %14, align 4, !tbaa !5
  %234 = icmp slt i32 %232, %233
  br i1 %234, label %240, label %235

235:                                              ; preds = %231
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %258

236:                                              ; preds = %228
  %237 = landingpad { ptr, i32 }
          cleanup
  %238 = extractvalue { ptr, i32 } %237, 0
  store ptr %238, ptr %15, align 8
  %239 = extractvalue { ptr, i32 } %237, 1
  store i32 %239, ptr %16, align 4
  br label %481

240:                                              ; preds = %231
  %241 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef %11, ptr noundef %12)
          to label %242 unwind label %249

242:                                              ; preds = %240
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %243 = invoke i64 @_ZSt9make_pairIRcRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 1 dereferenceable(1) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %244 unwind label %253

244:                                              ; preds = %242
  store i64 %243, ptr %18, align 4
  invoke void @_ZNSt6vectorISt4pairIciESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 4 dereferenceable(8) %18)
          to label %245 unwind label %253

245:                                              ; preds = %244
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %246

246:                                              ; preds = %245
  %247 = load i32, ptr %17, align 4, !tbaa !5
  %248 = add nsw i32 %247, 1
  store i32 %248, ptr %17, align 4, !tbaa !5
  br label %231, !llvm.loop !17

249:                                              ; preds = %240
  %250 = landingpad { ptr, i32 }
          cleanup
  %251 = extractvalue { ptr, i32 } %250, 0
  store ptr %251, ptr %15, align 8
  %252 = extractvalue { ptr, i32 } %250, 1
  store i32 %252, ptr %16, align 4
  br label %257

253:                                              ; preds = %244, %242
  %254 = landingpad { ptr, i32 }
          cleanup
  %255 = extractvalue { ptr, i32 } %254, 0
  store ptr %255, ptr %15, align 8
  %256 = extractvalue { ptr, i32 } %254, 1
  store i32 %256, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %257

257:                                              ; preds = %253, %249
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %481

258:                                              ; preds = %235
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %259 = call ptr @_ZNSt3mapIcSt4pairIiiESt4lessIcESaIS0_IKcS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @pos) #6
  %260 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %20, i32 0, i32 0
  store ptr %259, ptr %260, align 8
  br label %261

261:                                              ; preds = %460, %258
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %262 = call ptr @_ZNSt3mapIcSt4pairIiiESt4lessIcESaIS0_IKcS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @pos) #6
  %263 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %21, i32 0, i32 0
  store ptr %262, ptr %263, align 8
  %264 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKcS0_IiiEEES6_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br i1 %264, label %266, label %265

265:                                              ; preds = %261
  store i32 23, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %463

266:                                              ; preds = %261
  %267 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKcS0_IiiEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  %268 = getelementptr inbounds %"struct.std::pair.8", ptr %267, i32 0, i32 1
  %269 = getelementptr inbounds %"struct.std::pair", ptr %268, i32 0, i32 0
  %270 = load i32, ptr %269, align 4, !tbaa !18
  store i32 %270, ptr %12, align 4, !tbaa !5
  %271 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKcS0_IiiEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  %272 = getelementptr inbounds %"struct.std::pair.8", ptr %271, i32 0, i32 1
  %273 = getelementptr inbounds %"struct.std::pair", ptr %272, i32 0, i32 1
  %274 = load i32, ptr %273, align 4, !tbaa !21
  store i32 %274, ptr %13, align 4, !tbaa !5
  %275 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKcS0_IiiEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  %276 = getelementptr inbounds %"struct.std::pair.8", ptr %275, i32 0, i32 0
  %277 = load i8, ptr %276, align 4, !tbaa !22
  store i8 %277, ptr %11, align 1, !tbaa !9
  %278 = load i8, ptr %11, align 1, !tbaa !9
  %279 = sext i8 %278 to i32
  %280 = sub nsw i32 %279, 65
  %281 = sext i32 %280 to i64
  %282 = getelementptr inbounds [26 x i8], ptr @res, i64 0, i64 %281
  store i8 1, ptr %282, align 1, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %283

283:                                              ; preds = %440, %266
  %284 = load i32, ptr %22, align 4, !tbaa !5
  %285 = load i32, ptr %14, align 4, !tbaa !5
  %286 = icmp slt i32 %284, %285
  br i1 %286, label %288, label %287

287:                                              ; preds = %283
  store i32 26, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %443

288:                                              ; preds = %283
  %289 = load i32, ptr %22, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %290) #6
  %292 = getelementptr inbounds %"struct.std::pair.6", ptr %291, i32 0, i32 0
  %293 = load i8, ptr %292, align 4, !tbaa !25
  %294 = sext i8 %293 to i32
  %295 = icmp eq i32 %294, 78
  br i1 %295, label %296, label %325

296:                                              ; preds = %288
  %297 = load i32, ptr %12, align 4, !tbaa !5
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds [1001 x [1001 x i32]], ptr @n, i64 0, i64 %298
  %300 = load i32, ptr %13, align 4, !tbaa !5
  %301 = sext i32 %300 to i64
  %302 = getelementptr inbounds [1001 x i32], ptr %299, i64 0, i64 %301
  %303 = load i32, ptr %302, align 4, !tbaa !5
  %304 = load i32, ptr %22, align 4, !tbaa !5
  %305 = sext i32 %304 to i64
  %306 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %305) #6
  %307 = getelementptr inbounds %"struct.std::pair.6", ptr %306, i32 0, i32 1
  %308 = load i32, ptr %307, align 4, !tbaa !27
  %309 = icmp slt i32 %303, %308
  br i1 %309, label %310, label %316

310:                                              ; preds = %296
  %311 = load i8, ptr %11, align 1, !tbaa !9
  %312 = sext i8 %311 to i32
  %313 = sub nsw i32 %312, 65
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds [26 x i8], ptr @res, i64 0, i64 %314
  store i8 0, ptr %315, align 1, !tbaa !23
  br label %324

316:                                              ; preds = %296
  %317 = load i32, ptr %22, align 4, !tbaa !5
  %318 = sext i32 %317 to i64
  %319 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %318) #6
  %320 = getelementptr inbounds %"struct.std::pair.6", ptr %319, i32 0, i32 1
  %321 = load i32, ptr %320, align 4, !tbaa !27
  %322 = load i32, ptr %12, align 4, !tbaa !5
  %323 = sub nsw i32 %322, %321
  store i32 %323, ptr %12, align 4, !tbaa !5
  br label %324

324:                                              ; preds = %316, %310
  br label %439

325:                                              ; preds = %288
  %326 = load i32, ptr %22, align 4, !tbaa !5
  %327 = sext i32 %326 to i64
  %328 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %327) #6
  %329 = getelementptr inbounds %"struct.std::pair.6", ptr %328, i32 0, i32 0
  %330 = load i8, ptr %329, align 4, !tbaa !25
  %331 = sext i8 %330 to i32
  %332 = icmp eq i32 %331, 83
  br i1 %332, label %333, label %362

333:                                              ; preds = %325
  %334 = load i32, ptr %12, align 4, !tbaa !5
  %335 = sext i32 %334 to i64
  %336 = getelementptr inbounds [1001 x [1001 x i32]], ptr @s, i64 0, i64 %335
  %337 = load i32, ptr %13, align 4, !tbaa !5
  %338 = sext i32 %337 to i64
  %339 = getelementptr inbounds [1001 x i32], ptr %336, i64 0, i64 %338
  %340 = load i32, ptr %339, align 4, !tbaa !5
  %341 = load i32, ptr %22, align 4, !tbaa !5
  %342 = sext i32 %341 to i64
  %343 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %342) #6
  %344 = getelementptr inbounds %"struct.std::pair.6", ptr %343, i32 0, i32 1
  %345 = load i32, ptr %344, align 4, !tbaa !27
  %346 = icmp slt i32 %340, %345
  br i1 %346, label %347, label %353

347:                                              ; preds = %333
  %348 = load i8, ptr %11, align 1, !tbaa !9
  %349 = sext i8 %348 to i32
  %350 = sub nsw i32 %349, 65
  %351 = sext i32 %350 to i64
  %352 = getelementptr inbounds [26 x i8], ptr @res, i64 0, i64 %351
  store i8 0, ptr %352, align 1, !tbaa !23
  br label %361

353:                                              ; preds = %333
  %354 = load i32, ptr %22, align 4, !tbaa !5
  %355 = sext i32 %354 to i64
  %356 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %355) #6
  %357 = getelementptr inbounds %"struct.std::pair.6", ptr %356, i32 0, i32 1
  %358 = load i32, ptr %357, align 4, !tbaa !27
  %359 = load i32, ptr %12, align 4, !tbaa !5
  %360 = add nsw i32 %359, %358
  store i32 %360, ptr %12, align 4, !tbaa !5
  br label %361

361:                                              ; preds = %353, %347
  br label %438

362:                                              ; preds = %325
  %363 = load i32, ptr %22, align 4, !tbaa !5
  %364 = sext i32 %363 to i64
  %365 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %364) #6
  %366 = getelementptr inbounds %"struct.std::pair.6", ptr %365, i32 0, i32 0
  %367 = load i8, ptr %366, align 4, !tbaa !25
  %368 = sext i8 %367 to i32
  %369 = icmp eq i32 %368, 69
  br i1 %369, label %370, label %399

370:                                              ; preds = %362
  %371 = load i32, ptr %12, align 4, !tbaa !5
  %372 = sext i32 %371 to i64
  %373 = getelementptr inbounds [1001 x [1001 x i32]], ptr @e, i64 0, i64 %372
  %374 = load i32, ptr %13, align 4, !tbaa !5
  %375 = sext i32 %374 to i64
  %376 = getelementptr inbounds [1001 x i32], ptr %373, i64 0, i64 %375
  %377 = load i32, ptr %376, align 4, !tbaa !5
  %378 = load i32, ptr %22, align 4, !tbaa !5
  %379 = sext i32 %378 to i64
  %380 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %379) #6
  %381 = getelementptr inbounds %"struct.std::pair.6", ptr %380, i32 0, i32 1
  %382 = load i32, ptr %381, align 4, !tbaa !27
  %383 = icmp slt i32 %377, %382
  br i1 %383, label %384, label %390

384:                                              ; preds = %370
  %385 = load i8, ptr %11, align 1, !tbaa !9
  %386 = sext i8 %385 to i32
  %387 = sub nsw i32 %386, 65
  %388 = sext i32 %387 to i64
  %389 = getelementptr inbounds [26 x i8], ptr @res, i64 0, i64 %388
  store i8 0, ptr %389, align 1, !tbaa !23
  br label %398

390:                                              ; preds = %370
  %391 = load i32, ptr %22, align 4, !tbaa !5
  %392 = sext i32 %391 to i64
  %393 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %392) #6
  %394 = getelementptr inbounds %"struct.std::pair.6", ptr %393, i32 0, i32 1
  %395 = load i32, ptr %394, align 4, !tbaa !27
  %396 = load i32, ptr %13, align 4, !tbaa !5
  %397 = add nsw i32 %396, %395
  store i32 %397, ptr %13, align 4, !tbaa !5
  br label %398

398:                                              ; preds = %390, %384
  br label %437

399:                                              ; preds = %362
  %400 = load i32, ptr %22, align 4, !tbaa !5
  %401 = sext i32 %400 to i64
  %402 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %401) #6
  %403 = getelementptr inbounds %"struct.std::pair.6", ptr %402, i32 0, i32 0
  %404 = load i8, ptr %403, align 4, !tbaa !25
  %405 = sext i8 %404 to i32
  %406 = icmp eq i32 %405, 87
  br i1 %406, label %407, label %436

407:                                              ; preds = %399
  %408 = load i32, ptr %12, align 4, !tbaa !5
  %409 = sext i32 %408 to i64
  %410 = getelementptr inbounds [1001 x [1001 x i32]], ptr @w, i64 0, i64 %409
  %411 = load i32, ptr %13, align 4, !tbaa !5
  %412 = sext i32 %411 to i64
  %413 = getelementptr inbounds [1001 x i32], ptr %410, i64 0, i64 %412
  %414 = load i32, ptr %413, align 4, !tbaa !5
  %415 = load i32, ptr %22, align 4, !tbaa !5
  %416 = sext i32 %415 to i64
  %417 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %416) #6
  %418 = getelementptr inbounds %"struct.std::pair.6", ptr %417, i32 0, i32 1
  %419 = load i32, ptr %418, align 4, !tbaa !27
  %420 = icmp slt i32 %414, %419
  br i1 %420, label %421, label %427

421:                                              ; preds = %407
  %422 = load i8, ptr %11, align 1, !tbaa !9
  %423 = sext i8 %422 to i32
  %424 = sub nsw i32 %423, 65
  %425 = sext i32 %424 to i64
  %426 = getelementptr inbounds [26 x i8], ptr @res, i64 0, i64 %425
  store i8 0, ptr %426, align 1, !tbaa !23
  br label %435

427:                                              ; preds = %407
  %428 = load i32, ptr %22, align 4, !tbaa !5
  %429 = sext i32 %428 to i64
  %430 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %429) #6
  %431 = getelementptr inbounds %"struct.std::pair.6", ptr %430, i32 0, i32 1
  %432 = load i32, ptr %431, align 4, !tbaa !27
  %433 = load i32, ptr %13, align 4, !tbaa !5
  %434 = sub nsw i32 %433, %432
  store i32 %434, ptr %13, align 4, !tbaa !5
  br label %435

435:                                              ; preds = %427, %421
  br label %436

436:                                              ; preds = %435, %399
  br label %437

437:                                              ; preds = %436, %398
  br label %438

438:                                              ; preds = %437, %361
  br label %439

439:                                              ; preds = %438, %324
  br label %440

440:                                              ; preds = %439
  %441 = load i32, ptr %22, align 4, !tbaa !5
  %442 = add nsw i32 %441, 1
  store i32 %442, ptr %22, align 4, !tbaa !5
  br label %283, !llvm.loop !28

443:                                              ; preds = %287
  %444 = load i8, ptr %11, align 1, !tbaa !9
  %445 = sext i8 %444 to i32
  %446 = sub nsw i32 %445, 65
  %447 = sext i32 %446 to i64
  %448 = getelementptr inbounds [26 x i8], ptr @res, i64 0, i64 %447
  %449 = load i8, ptr %448, align 1, !tbaa !23, !range !29, !noundef !30
  %450 = trunc i8 %449 to i1
  br i1 %450, label %451, label %459

451:                                              ; preds = %443
  %452 = load i8, ptr %11, align 1, !tbaa !9
  %453 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %19, i8 noundef signext %452)
          to label %454 unwind label %455

454:                                              ; preds = %451
  br label %459

455:                                              ; preds = %451
  %456 = landingpad { ptr, i32 }
          cleanup
  %457 = extractvalue { ptr, i32 } %456, 0
  store ptr %457, ptr %15, align 8
  %458 = extractvalue { ptr, i32 } %456, 1
  store i32 %458, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %480

459:                                              ; preds = %454, %443
  br label %460

460:                                              ; preds = %459
  %461 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKcS0_IiiEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %20, i32 noundef 0) #6
  %462 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %23, i32 0, i32 0
  store ptr %461, ptr %462, align 8
  br label %261, !llvm.loop !31

463:                                              ; preds = %265
  %464 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %19) #6
  %465 = icmp ne i64 %464, 0
  br i1 %465, label %466, label %475

466:                                              ; preds = %463
  %467 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) %19)
          to label %468 unwind label %471

468:                                              ; preds = %466
  %469 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %467, ptr noundef @.str.5)
          to label %470 unwind label %471

470:                                              ; preds = %468
  br label %478

471:                                              ; preds = %475, %468, %466
  %472 = landingpad { ptr, i32 }
          cleanup
  %473 = extractvalue { ptr, i32 } %472, 0
  store ptr %473, ptr %15, align 8
  %474 = extractvalue { ptr, i32 } %472, 1
  store i32 %474, ptr %16, align 4
  br label %480

475:                                              ; preds = %463
  %476 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.6)
          to label %477 unwind label %471

477:                                              ; preds = %475
  br label %478

478:                                              ; preds = %477, %470
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  call void @_ZNSt6vectorISt4pairIciESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  %479 = load i32, ptr %1, align 4
  ret i32 %479

480:                                              ; preds = %471, %455
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #6
  br label %481

481:                                              ; preds = %480, %257, %236
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  call void @_ZNSt6vectorISt4pairIciESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  br label %482

482:                                              ; preds = %481
  %483 = load ptr, ptr %15, align 8
  %484 = load i32, ptr %16, align 4
  %485 = insertvalue { ptr, i32 } poison, ptr %483, 0
  %486 = insertvalue { ptr, i32 } %485, i32 %484, 1
  resume { ptr, i32 } %486
}

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

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

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)) #2

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRcRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 4 dereferenceable(4)) #4

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32), i8 noundef signext) #4 align 2

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

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

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

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

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

attributes #0 = { 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 #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = !{!19, !6, i64 4}
!19 = !{!"_ZTSSt4pairIKcS_IiiEE", !7, i64 0, !20, i64 4}
!20 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!21 = !{!19, !6, i64 8}
!22 = !{!19, !7, i64 0}
!23 = !{!24, !24, i64 0}
!24 = !{!"bool", !7, i64 0}
!25 = !{!26, !7, i64 0}
!26 = !{!"_ZTSSt4pairIciE", !7, i64 0, !6, i64 4}
!27 = !{!26, !6, i64 4}
!28 = distinct !{!28, !11}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = distinct !{!31, !11}


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

%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<char, std::pair<const char, std::pair<int, int>>, std::_Select1st<std::pair<const char, std::pair<int, int>>>, std::less<char>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<char, std::pair<const char, std::pair<int, int>>, std::_Select1st<std::pair<const char, std::pair<int, int>>>, std::less<char>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::__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_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::pair" = type { i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<char, int>, std::allocator<std::pair<char, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<char, int>, std::allocator<std::pair<char, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<char, int>, std::allocator<std::pair<char, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<char, int>, std::allocator<std::pair<char, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair.6" = type { i8, i32 }
%"struct.std::_Rb_tree_iterator" = type { ptr }

@nn = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@grid = external dso_local local_unnamed_addr global [1001 x [1001 x i32]], align 16
@n = external dso_local local_unnamed_addr global [1001 x [1001 x i32]], align 16
@s = external dso_local local_unnamed_addr global [1001 x [1001 x i32]], align 16
@e = external dso_local local_unnamed_addr global [1001 x [1001 x i32]], align 16
@w = external dso_local local_unnamed_addr global [1001 x [1001 x i32]], align 16
@pos = external dso_local global %"class.std::map", align 8
@res = external dso_local local_unnamed_addr global [26 x i8], align 16
@_Z3strB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair.6", align 8
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %12 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @nn, ptr noundef nonnull @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !5
  %13 = load i32, ptr @nn, align 4, !tbaa !5
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph80, label %._crit_edge81.thread

._crit_edge81.thread:                             ; preds = %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  br label %._crit_edge95

._crit_edge81:                                    ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %15 = icmp sgt i32 %39, 0
  br i1 %15, label %.preheader77.lr.ph, label %._crit_edge95

.preheader77.lr.ph:                               ; preds = %._crit_edge81
  %16 = load i32, ptr @m, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.preheader77.us.preheader, label %._crit_edge95

.preheader77.us.preheader:                        ; preds = %.preheader77.lr.ph
  %wide.trip.count115 = zext nneg i32 %39 to i64
  %wide.trip.count = zext nneg i32 %16 to i64
  br label %.preheader77.us

.preheader77.us:                                  ; preds = %.preheader77.us.preheader, %._crit_edge84.us
  %indvars.iv112 = phi i64 [ 0, %.preheader77.us.preheader ], [ %indvars.iv.next113, %._crit_edge84.us ]
  %18 = add nsw i64 %indvars.iv112, -1
  br label %19

19:                                               ; preds = %.preheader77.us, %31
  %indvars.iv = phi i64 [ 0, %.preheader77.us ], [ %indvars.iv.next, %31 ]
  %20 = getelementptr inbounds [1001 x [1001 x i32]], ptr @grid, i64 0, i64 %indvars.iv112, i64 %indvars.iv
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = icmp eq i32 %21, -1
  br i1 %22, label %31, label %23

23:                                               ; preds = %19
  %24 = getelementptr inbounds [1001 x [1001 x i32]], ptr @n, i64 0, i64 %18, i64 %indvars.iv
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  %27 = add nsw i64 %indvars.iv, -1
  %28 = getelementptr inbounds [1001 x [1001 x i32]], ptr @w, i64 0, i64 %indvars.iv112, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  br label %31

31:                                               ; preds = %19, %23
  %.sink130 = phi i32 [ %30, %23 ], [ -1, %19 ]
  %.sink = phi i32 [ %26, %23 ], [ -1, %19 ]
  %32 = getelementptr inbounds [1001 x [1001 x i32]], ptr @w, i64 0, i64 %indvars.iv112, i64 %indvars.iv
  store i32 %.sink130, ptr %32, align 4
  %33 = getelementptr inbounds [1001 x [1001 x i32]], ptr @n, i64 0, i64 %indvars.iv112, i64 %indvars.iv
  store i32 %.sink, ptr %33, align 4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge84.us, label %19, !llvm.loop !9

._crit_edge84.us:                                 ; preds = %31
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %exitcond116.not = icmp eq i64 %indvars.iv.next113, %wide.trip.count115
  br i1 %exitcond116.not, label %.preheader, label %.preheader77.us, !llvm.loop !11

.lr.ph80:                                         ; preds = %0, %._crit_edge
  %34 = call 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) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z3strB5cxx11)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  %35 = load i32, ptr @m, align 4, !tbaa !5
  %36 = icmp sgt i32 %35, 0
  br i1 %36, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %61, %.lr.ph80
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %37 = load i32, ptr %1, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %1, align 4, !tbaa !5
  %39 = load i32, ptr @nn, align 4, !tbaa !5
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %.lr.ph80, label %._crit_edge81, !llvm.loop !12

.lr.ph:                                           ; preds = %.lr.ph80, %61
  %storemerge7578 = phi i32 [ %63, %61 ], [ 0, %.lr.ph80 ]
  %41 = sext i32 %storemerge7578 to i64
  %42 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3strB5cxx11, i64 noundef %41)
  %43 = load i8, ptr %42, align 1, !tbaa !13
  %44 = icmp eq i8 %43, 35
  %45 = load i32, ptr %1, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [1001 x [1001 x i32]], ptr @grid, i64 0, i64 %46, i64 %48
  br i1 %44, label %50, label %51

50:                                               ; preds = %.lr.ph
  store i32 -1, ptr %49, align 4, !tbaa !5
  br label %61

51:                                               ; preds = %.lr.ph
  store i32 1, ptr %49, align 4, !tbaa !5
  %52 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3strB5cxx11, i64 noundef %48)
  %53 = load i8, ptr %52, align 1, !tbaa !13
  %.not76 = icmp eq i8 %53, 46
  br i1 %.not76, label %61, label %54

54:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %55 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %55, ptr %3, align 8
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3strB5cxx11, i64 noundef %57)
  %59 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIcSt4pairIiiESt4lessIcESaIS0_IKcS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) @pos, ptr noundef nonnull align 1 dereferenceable(1) %58)
  %60 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %59, ptr noundef nonnull align 4 dereferenceable(8) %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %61

61:                                               ; preds = %50, %54, %51
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %2, align 4, !tbaa !5
  %64 = load i32, ptr @m, align 4, !tbaa !5
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %.lr.ph, label %._crit_edge, !llvm.loop !14

.preheader:                                       ; preds = %._crit_edge84.us
  br i1 %15, label %.lr.ph94, label %._crit_edge95

.lr.ph94:                                         ; preds = %.preheader
  %.pr = load i32, ptr @m, align 4, !tbaa !5
  %66 = icmp sgt i32 %.pr, 0
  br i1 %66, label %.lr.ph90.us.preheader, label %._crit_edge95

.lr.ph90.us.preheader:                            ; preds = %.lr.ph94
  %.06791 = add nsw i32 %39, -1
  %67 = zext nneg i32 %.pr to i64
  %68 = zext i32 %.06791 to i64
  %69 = zext nneg i32 %39 to i64
  br label %.lr.ph90.us

.lr.ph90.us:                                      ; preds = %.lr.ph90.us.preheader, %..loopexit_crit_edge.us
  %indvars.iv122 = phi i64 [ %69, %.lr.ph90.us.preheader ], [ %indvars.iv.next123, %..loopexit_crit_edge.us ]
  %indvars.iv120 = phi i64 [ %68, %.lr.ph90.us.preheader ], [ %indvars.iv.next121, %..loopexit_crit_edge.us ]
  br label %70

70:                                               ; preds = %.lr.ph90.us, %81
  %indvars.iv117 = phi i64 [ %67, %.lr.ph90.us ], [ %indvars.iv.next118, %81 ]
  %indvars.iv.next118 = add nsw i64 %indvars.iv117, -1
  %71 = getelementptr inbounds [1001 x [1001 x i32]], ptr @grid, i64 0, i64 %indvars.iv120, i64 %indvars.iv.next118
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = icmp eq i32 %72, -1
  br i1 %73, label %81, label %74

74:                                               ; preds = %70
  %75 = getelementptr inbounds [1001 x [1001 x i32]], ptr @e, i64 0, i64 %indvars.iv120, i64 %indvars.iv117
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  %78 = getelementptr inbounds [1001 x [1001 x i32]], ptr @s, i64 0, i64 %indvars.iv122, i64 %indvars.iv.next118
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  br label %81

81:                                               ; preds = %70, %74
  %.sink132 = phi i32 [ %80, %74 ], [ -1, %70 ]
  %.sink131 = phi i32 [ %77, %74 ], [ -1, %70 ]
  %82 = getelementptr inbounds [1001 x [1001 x i32]], ptr @s, i64 0, i64 %indvars.iv120, i64 %indvars.iv.next118
  store i32 %.sink132, ptr %82, align 4
  %83 = getelementptr inbounds [1001 x [1001 x i32]], ptr @e, i64 0, i64 %indvars.iv120, i64 %indvars.iv.next118
  store i32 %.sink131, ptr %83, align 4
  %84 = icmp sgt i64 %indvars.iv117, 1
  br i1 %84, label %70, label %..loopexit_crit_edge.us, !llvm.loop !15

..loopexit_crit_edge.us:                          ; preds = %81
  %indvars.iv.next121 = add nsw i64 %indvars.iv120, -1
  %85 = icmp sgt i64 %indvars.iv120, 0
  %indvars.iv.next123 = add nsw i64 %indvars.iv122, -1
  br i1 %85, label %.lr.ph90.us, label %._crit_edge95, !llvm.loop !16

._crit_edge95:                                    ; preds = %..loopexit_crit_edge.us, %._crit_edge81, %._crit_edge81.thread, %.preheader77.lr.ph, %.lr.ph94, %.preheader
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  call void @_ZNSt6vectorISt4pairIciESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %86 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %7)
  %87 = load i32, ptr %7, align 4, !tbaa !5
  %88 = icmp sgt i32 %87, 0
  br i1 %88, label %.lr.ph98, label %._crit_edge99

._crit_edge99:                                    ; preds = %95, %._crit_edge95
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %89 = call ptr @_ZNSt3mapIcSt4pairIiiESt4lessIcESaIS0_IKcS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @pos) #7
  store ptr %89, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %90 = call ptr @_ZNSt3mapIcSt4pairIiiESt4lessIcESaIS0_IKcS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @pos) #7
  store ptr %90, ptr %11, align 8
  %91 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKcS0_IiiEEES6_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  br i1 %91, label %.lr.ph106, label %._crit_edge107

.lr.ph98:                                         ; preds = %._crit_edge95, %95
  %.06096 = phi i32 [ %96, %95 ], [ 0, %._crit_edge95 ]
  %92 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %5, ptr noundef nonnull %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %93 = invoke i64 @_ZSt9make_pairIRcRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 1 dereferenceable(1) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %94 unwind label %99

94:                                               ; preds = %.lr.ph98
  store i64 %93, ptr %8, align 8
  invoke void @_ZNSt6vectorISt4pairIciESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(8) %8)
          to label %95 unwind label %99

95:                                               ; preds = %94
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  %96 = add nuw nsw i32 %.06096, 1
  %97 = load i32, ptr %7, align 4, !tbaa !5
  %98 = icmp slt i32 %96, %97
  br i1 %98, label %.lr.ph98, label %._crit_edge99, !llvm.loop !17

99:                                               ; preds = %94, %.lr.ph98
  %100 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br label %237

._crit_edge107:                                   ; preds = %224, %._crit_edge99
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  %101 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  %.not = icmp eq i64 %101, 0
  br i1 %.not, label %.invoke, label %228

.lr.ph106:                                        ; preds = %._crit_edge99, %224
  %102 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKcS0_IiiEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %103 = getelementptr inbounds i8, ptr %102, i64 4
  %104 = load i32, ptr %103, align 4, !tbaa !18
  store i32 %104, ptr %6, align 4, !tbaa !5
  %105 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKcS0_IiiEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %106 = getelementptr inbounds i8, ptr %105, i64 8
  %107 = load i32, ptr %106, align 4, !tbaa !21
  %108 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKcS0_IiiEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %109 = load i8, ptr %108, align 4, !tbaa !22
  store i8 %109, ptr %5, align 1, !tbaa !13
  %110 = sext i8 %109 to i64
  %111 = add nsw i64 %110, -65
  %112 = getelementptr inbounds [26 x i8], ptr @res, i64 0, i64 %111
  store i8 1, ptr %112, align 1, !tbaa !23
  %113 = load i32, ptr %7, align 4, !tbaa !5
  %114 = icmp sgt i32 %113, 0
  br i1 %114, label %.lr.ph103, label %._crit_edge104

._crit_edge104.loopexit:                          ; preds = %216
  %.pre = load i8, ptr %5, align 1, !tbaa !13
  %.pre133 = sext i8 %.pre to i64
  %.pre134 = add nsw i64 %.pre133, -65
  br label %._crit_edge104

._crit_edge104:                                   ; preds = %._crit_edge104.loopexit, %.lr.ph106
  %.pre-phi135 = phi i64 [ %.pre134, %._crit_edge104.loopexit ], [ %111, %.lr.ph106 ]
  %115 = phi i8 [ %.pre, %._crit_edge104.loopexit ], [ %109, %.lr.ph106 ]
  %116 = getelementptr inbounds [26 x i8], ptr @res, i64 0, i64 %.pre-phi135
  %117 = load i8, ptr %116, align 1, !tbaa !23, !range !25, !noundef !26
  %118 = trunc nuw i8 %117 to i1
  br i1 %118, label %220, label %224

.lr.ph103:                                        ; preds = %.lr.ph106, %216
  %indvars.iv127 = phi i64 [ %indvars.iv.next128, %216 ], [ 0, %.lr.ph106 ]
  %.064100 = phi i32 [ %.165, %216 ], [ %107, %.lr.ph106 ]
  %119 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv127) #7
  %120 = load i8, ptr %119, align 4, !tbaa !27
  %121 = icmp eq i8 %120, 78
  br i1 %121, label %122, label %143

122:                                              ; preds = %.lr.ph103
  %123 = load i32, ptr %6, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = sext i32 %.064100 to i64
  %126 = getelementptr inbounds [1001 x [1001 x i32]], ptr @n, i64 0, i64 %124, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv127) #7
  %129 = getelementptr inbounds i8, ptr %128, i64 4
  %130 = load i32, ptr %129, align 4, !tbaa !29
  %131 = icmp slt i32 %127, %130
  br i1 %131, label %132, label %137

132:                                              ; preds = %122
  %133 = load i8, ptr %5, align 1, !tbaa !13
  %134 = sext i8 %133 to i64
  %135 = add nsw i64 %134, -65
  %136 = getelementptr inbounds [26 x i8], ptr @res, i64 0, i64 %135
  store i8 0, ptr %136, align 1, !tbaa !23
  br label %216

137:                                              ; preds = %122
  %138 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv127) #7
  %139 = getelementptr inbounds i8, ptr %138, i64 4
  %140 = load i32, ptr %139, align 4, !tbaa !29
  %141 = load i32, ptr %6, align 4, !tbaa !5
  %142 = sub nsw i32 %141, %140
  store i32 %142, ptr %6, align 4, !tbaa !5
  br label %216

143:                                              ; preds = %.lr.ph103
  %144 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv127) #7
  %145 = load i8, ptr %144, align 4, !tbaa !27
  %146 = icmp eq i8 %145, 83
  br i1 %146, label %147, label %168

147:                                              ; preds = %143
  %148 = load i32, ptr %6, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = sext i32 %.064100 to i64
  %151 = getelementptr inbounds [1001 x [1001 x i32]], ptr @s, i64 0, i64 %149, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv127) #7
  %154 = getelementptr inbounds i8, ptr %153, i64 4
  %155 = load i32, ptr %154, align 4, !tbaa !29
  %156 = icmp slt i32 %152, %155
  br i1 %156, label %157, label %162

157:                                              ; preds = %147
  %158 = load i8, ptr %5, align 1, !tbaa !13
  %159 = sext i8 %158 to i64
  %160 = add nsw i64 %159, -65
  %161 = getelementptr inbounds [26 x i8], ptr @res, i64 0, i64 %160
  store i8 0, ptr %161, align 1, !tbaa !23
  br label %216

162:                                              ; preds = %147
  %163 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv127) #7
  %164 = getelementptr inbounds i8, ptr %163, i64 4
  %165 = load i32, ptr %164, align 4, !tbaa !29
  %166 = load i32, ptr %6, align 4, !tbaa !5
  %167 = add nsw i32 %166, %165
  store i32 %167, ptr %6, align 4, !tbaa !5
  br label %216

168:                                              ; preds = %143
  %169 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv127) #7
  %170 = load i8, ptr %169, align 4, !tbaa !27
  %171 = icmp eq i8 %170, 69
  br i1 %171, label %172, label %192

172:                                              ; preds = %168
  %173 = load i32, ptr %6, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = sext i32 %.064100 to i64
  %176 = getelementptr inbounds [1001 x [1001 x i32]], ptr @e, i64 0, i64 %174, i64 %175
  %177 = load i32, ptr %176, align 4, !tbaa !5
  %178 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv127) #7
  %179 = getelementptr inbounds i8, ptr %178, i64 4
  %180 = load i32, ptr %179, align 4, !tbaa !29
  %181 = icmp slt i32 %177, %180
  br i1 %181, label %182, label %187

182:                                              ; preds = %172
  %183 = load i8, ptr %5, align 1, !tbaa !13
  %184 = sext i8 %183 to i64
  %185 = add nsw i64 %184, -65
  %186 = getelementptr inbounds [26 x i8], ptr @res, i64 0, i64 %185
  store i8 0, ptr %186, align 1, !tbaa !23
  br label %216

187:                                              ; preds = %172
  %188 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv127) #7
  %189 = getelementptr inbounds i8, ptr %188, i64 4
  %190 = load i32, ptr %189, align 4, !tbaa !29
  %191 = add nsw i32 %190, %.064100
  br label %216

192:                                              ; preds = %168
  %193 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv127) #7
  %194 = load i8, ptr %193, align 4, !tbaa !27
  %195 = icmp eq i8 %194, 87
  br i1 %195, label %196, label %216

196:                                              ; preds = %192
  %197 = load i32, ptr %6, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = sext i32 %.064100 to i64
  %200 = getelementptr inbounds [1001 x [1001 x i32]], ptr @w, i64 0, i64 %198, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !5
  %202 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv127) #7
  %203 = getelementptr inbounds i8, ptr %202, i64 4
  %204 = load i32, ptr %203, align 4, !tbaa !29
  %205 = icmp slt i32 %201, %204
  br i1 %205, label %206, label %211

206:                                              ; preds = %196
  %207 = load i8, ptr %5, align 1, !tbaa !13
  %208 = sext i8 %207 to i64
  %209 = add nsw i64 %208, -65
  %210 = getelementptr inbounds [26 x i8], ptr @res, i64 0, i64 %209
  store i8 0, ptr %210, align 1, !tbaa !23
  br label %216

211:                                              ; preds = %196
  %212 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIciESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv127) #7
  %213 = getelementptr inbounds i8, ptr %212, i64 4
  %214 = load i32, ptr %213, align 4, !tbaa !29
  %215 = sub nsw i32 %.064100, %214
  br label %216

216:                                              ; preds = %137, %132, %187, %182, %206, %211, %192, %157, %162
  %.165 = phi i32 [ %.064100, %132 ], [ %.064100, %137 ], [ %.064100, %157 ], [ %.064100, %162 ], [ %.064100, %182 ], [ %191, %187 ], [ %.064100, %206 ], [ %215, %211 ], [ %.064100, %192 ]
  %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
  %217 = load i32, ptr %7, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = icmp slt i64 %indvars.iv.next128, %218
  br i1 %219, label %.lr.ph103, label %._crit_edge104.loopexit, !llvm.loop !30

220:                                              ; preds = %._crit_edge104
  %221 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %9, i8 noundef signext %115)
          to label %224 unwind label %222

222:                                              ; preds = %220
  %223 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  br label %236

224:                                              ; preds = %._crit_edge104, %220
  %225 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKcS0_IiiEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %10, i32 noundef 0) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %226 = call ptr @_ZNSt3mapIcSt4pairIiiESt4lessIcESaIS0_IKcS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @pos) #7
  store ptr %226, ptr %11, align 8
  %227 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKcS0_IiiEEES6_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  br i1 %227, label %.lr.ph106, label %._crit_edge107, !llvm.loop !31

228:                                              ; preds = %._crit_edge107
  %229 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %.invoke unwind label %230

230:                                              ; preds = %.invoke, %228
  %231 = landingpad { ptr, i32 }
          cleanup
  br label %236

.invoke:                                          ; preds = %228, %._crit_edge107
  %232 = phi ptr [ @_ZSt4cout, %._crit_edge107 ], [ %229, %228 ]
  %233 = phi ptr [ @.str.6, %._crit_edge107 ], [ @.str.5, %228 ]
  %234 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %232, ptr noundef nonnull %233)
          to label %235 unwind label %230

235:                                              ; preds = %.invoke
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  call void @_ZNSt6vectorISt4pairIciESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  ret i32 0

236:                                              ; preds = %230, %222
  %.pn = phi { ptr, i32 } [ %223, %222 ], [ %231, %230 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #7
  br label %237

237:                                              ; preds = %236, %99
  %.pn73 = phi { ptr, i32 } [ %100, %99 ], [ %.pn, %236 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  call void @_ZNSt6vectorISt4pairIciESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  resume { ptr, i32 } %.pn73
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIcSt4pairIiiESt4lessIcESaIS0_IKcS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #5 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 #0 align 2

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRcRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32), i8 noundef signext) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

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

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

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

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

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

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


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,MergedLoadStoreMotionPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass