; LLVM IR from plskz/competitive-programming :: Junior Training Sheet/B (28)

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

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

@key = external dso_local global [31 x [31 x i8]], align 16
@can = external dso_local global [26 x i8], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@posKey = external dso_local global [26 x %"class.std::vector"], align 16
@shift = external dso_local global %"class.std::vector", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5checkii(i32 noundef, i32 noundef) #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 noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 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 norecurse uwtable
define dso_local noundef i32 @main() #2 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 i32, align 4
  %6 = alloca %"struct.std::pair", align 4
  %7 = alloca %"struct.std::pair", align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %16 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %17 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %18 = getelementptr i8, ptr %17, i64 -24
  %19 = load i64, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %19
  %21 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %20, ptr noundef null)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 4 dereferenceable(4) @x)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !8
  br label %25

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

29:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %39

30:                                               ; preds = %25
  %31 = load i32, ptr %2, align 4, !tbaa !8
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [31 x [31 x i8]], ptr @key, i64 0, i64 %32
  %34 = getelementptr inbounds [31 x i8], ptr %33, i64 0, i64 0
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %34)
  br label %36

36:                                               ; preds = %30
  %37 = load i32, ptr %2, align 4, !tbaa !8
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %2, align 4, !tbaa !8
  br label %25, !llvm.loop !11

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

40:                                               ; preds = %79, %39
  %41 = load i32, ptr %3, align 4, !tbaa !8
  %42 = load i32, ptr @n, align 4, !tbaa !8
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %82

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

46:                                               ; preds = %75, %45
  %47 = load i32, ptr %5, align 4, !tbaa !8
  %48 = load i32, ptr @m, align 4, !tbaa !8
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %51, label %50

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

51:                                               ; preds = %46
  %52 = load i32, ptr %3, align 4, !tbaa !8
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [31 x [31 x i8]], ptr @key, i64 0, i64 %53
  %55 = load i32, ptr %5, align 4, !tbaa !8
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [31 x i8], ptr %54, i64 0, i64 %56
  %58 = load i8, ptr %57, align 1, !tbaa !13
  %59 = sext i8 %58 to i32
  %60 = icmp eq i32 %59, 83
  br i1 %60, label %61, label %62

61:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @shift, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %74

62:                                               ; preds = %51
  %63 = load i32, ptr %3, align 4, !tbaa !8
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [31 x [31 x i8]], ptr @key, i64 0, i64 %64
  %66 = load i32, ptr %5, align 4, !tbaa !8
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [31 x i8], ptr %65, i64 0, i64 %67
  %69 = load i8, ptr %68, align 1, !tbaa !13
  %70 = sext i8 %69 to i32
  %71 = sub nsw i32 %70, 97
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [26 x %"class.std::vector"], ptr @posKey, i64 0, i64 %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %73, ptr noundef nonnull align 4 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %74

74:                                               ; preds = %62, %61
  br label %75

75:                                               ; preds = %74
  %76 = load i32, ptr %5, align 4, !tbaa !8
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %5, align 4, !tbaa !8
  br label %46, !llvm.loop !14

78:                                               ; preds = %50
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %3, align 4, !tbaa !8
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %3, align 4, !tbaa !8
  br label %40, !llvm.loop !15

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

83:                                               ; preds = %141, %82
  %84 = load i32, ptr %8, align 4, !tbaa !8
  %85 = icmp slt i32 %84, 26
  br i1 %85, label %87, label %86

86:                                               ; preds = %83
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %144

87:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !8
  br label %88

88:                                               ; preds = %137, %87
  %89 = load i32, ptr %9, align 4, !tbaa !8
  %90 = sext i32 %89 to i64
  %91 = load i32, ptr %8, align 4, !tbaa !8
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [26 x %"class.std::vector"], ptr @posKey, i64 0, i64 %92
  %94 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %93) #7
  %95 = icmp ult i64 %90, %94
  br i1 %95, label %96, label %103

96:                                               ; preds = %88
  %97 = load i32, ptr %8, align 4, !tbaa !8
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [26 x i8], ptr @can, i64 0, i64 %98
  %100 = load i8, ptr %99, align 1, !tbaa !16, !range !18, !noundef !19
  %101 = trunc i8 %100 to i1
  %102 = xor i1 %101, true
  br label %103

103:                                              ; preds = %96, %88
  %104 = phi i1 [ false, %88 ], [ %102, %96 ]
  br i1 %104, label %106, label %105

105:                                              ; preds = %103
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %140

106:                                              ; preds = %103
  %107 = load i32, ptr %8, align 4, !tbaa !8
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [26 x i8], ptr @can, i64 0, i64 %108
  %110 = load i8, ptr %109, align 1, !tbaa !16, !range !18, !noundef !19
  %111 = trunc i8 %110 to i1
  %112 = zext i1 %111 to i32
  %113 = load i32, ptr %8, align 4, !tbaa !8
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [26 x %"class.std::vector"], ptr @posKey, i64 0, i64 %114
  %116 = load i32, ptr %9, align 4, !tbaa !8
  %117 = sext i32 %116 to i64
  %118 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %115, i64 noundef %117) #7
  %119 = getelementptr inbounds %"struct.std::pair", ptr %118, i32 0, i32 0
  %120 = load i32, ptr %119, align 4, !tbaa !20
  %121 = load i32, ptr %8, align 4, !tbaa !8
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [26 x %"class.std::vector"], ptr @posKey, i64 0, i64 %122
  %124 = load i32, ptr %9, align 4, !tbaa !8
  %125 = sext i32 %124 to i64
  %126 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %123, i64 noundef %125) #7
  %127 = getelementptr inbounds %"struct.std::pair", ptr %126, i32 0, i32 1
  %128 = load i32, ptr %127, align 4, !tbaa !22
  %129 = call noundef zeroext i1 @_Z5checkii(i32 noundef %120, i32 noundef %128)
  %130 = zext i1 %129 to i32
  %131 = or i32 %112, %130
  %132 = icmp ne i32 %131, 0
  %133 = load i32, ptr %8, align 4, !tbaa !8
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [26 x i8], ptr @can, i64 0, i64 %134
  %136 = zext i1 %132 to i8
  store i8 %136, ptr %135, align 1, !tbaa !16
  br label %137

137:                                              ; preds = %106
  %138 = load i32, ptr %9, align 4, !tbaa !8
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %9, align 4, !tbaa !8
  br label %88, !llvm.loop !23

140:                                              ; preds = %105
  br label %141

141:                                              ; preds = %140
  %142 = load i32, ptr %8, align 4, !tbaa !8
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %8, align 4, !tbaa !8
  br label %83, !llvm.loop !24

144:                                              ; preds = %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  %145 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %146 unwind label %154

146:                                              ; preds = %144
  %147 = 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) %145, ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %148 unwind label %154

148:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !8
  br label %149

149:                                              ; preds = %231, %148
  %150 = load i32, ptr %15, align 4, !tbaa !8
  %151 = load i32, ptr %10, align 4, !tbaa !8
  %152 = icmp slt i32 %150, %151
  br i1 %152, label %158, label %153

153:                                              ; preds = %149
  store i32 17, ptr %4, align 4
  br label %234

154:                                              ; preds = %146, %144
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %12, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %13, align 4
  br label %247

158:                                              ; preds = %149
  %159 = load i32, ptr %15, align 4, !tbaa !8
  %160 = sext i32 %159 to i64
  %161 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %11, i64 noundef %160)
          to label %162 unwind label %181

162:                                              ; preds = %158
  %163 = load i8, ptr %161, align 1, !tbaa !13
  %164 = sext i8 %163 to i32
  %165 = call i32 @islower(i32 noundef %164) #8
  %166 = icmp ne i32 %165, 0
  br i1 %166, label %167, label %186

167:                                              ; preds = %162
  %168 = load i32, ptr %15, align 4, !tbaa !8
  %169 = sext i32 %168 to i64
  %170 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %11, i64 noundef %169)
          to label %171 unwind label %181

171:                                              ; preds = %167
  %172 = load i8, ptr %170, align 1, !tbaa !13
  %173 = sext i8 %172 to i32
  %174 = sub nsw i32 %173, 97
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [26 x %"class.std::vector"], ptr @posKey, i64 0, i64 %175
  %177 = call noundef zeroext i1 @_ZNKSt6vectorISt4pairIiiESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %176) #7
  br i1 %177, label %178, label %185

178:                                              ; preds = %171
  %179 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
          to label %180 unwind label %181

180:                                              ; preds = %178
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %234

181:                                              ; preds = %214, %211, %200, %190, %186, %178, %167, %158
  %182 = landingpad { ptr, i32 }
          cleanup
  %183 = extractvalue { ptr, i32 } %182, 0
  store ptr %183, ptr %12, align 8
  %184 = extractvalue { ptr, i32 } %182, 1
  store i32 %184, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %246

185:                                              ; preds = %171
  br label %230

186:                                              ; preds = %162
  %187 = load i32, ptr %15, align 4, !tbaa !8
  %188 = sext i32 %187 to i64
  %189 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %11, i64 noundef %188)
          to label %190 unwind label %181

190:                                              ; preds = %186
  %191 = load i8, ptr %189, align 1, !tbaa !13
  %192 = sext i8 %191 to i32
  %193 = call i32 @tolower(i32 noundef %192) #8
  %194 = trunc i32 %193 to i8
  %195 = load i32, ptr %15, align 4, !tbaa !8
  %196 = sext i32 %195 to i64
  %197 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %11, i64 noundef %196)
          to label %198 unwind label %181

198:                                              ; preds = %190
  store i8 %194, ptr %197, align 1, !tbaa !13
  %199 = call noundef zeroext i1 @_ZNKSt6vectorISt4pairIiiESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) @shift) #7
  br i1 %199, label %211, label %200

200:                                              ; preds = %198
  %201 = load i32, ptr %15, align 4, !tbaa !8
  %202 = sext i32 %201 to i64
  %203 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %11, i64 noundef %202)
          to label %204 unwind label %181

204:                                              ; preds = %200
  %205 = load i8, ptr %203, align 1, !tbaa !13
  %206 = sext i8 %205 to i32
  %207 = sub nsw i32 %206, 97
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [26 x %"class.std::vector"], ptr @posKey, i64 0, i64 %208
  %210 = call noundef zeroext i1 @_ZNKSt6vectorISt4pairIiiESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %209) #7
  br i1 %210, label %211, label %214

211:                                              ; preds = %204, %198
  %212 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
          to label %213 unwind label %181

213:                                              ; preds = %211
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %234

214:                                              ; preds = %204
  %215 = load i32, ptr %15, align 4, !tbaa !8
  %216 = sext i32 %215 to i64
  %217 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %11, i64 noundef %216)
          to label %218 unwind label %181

218:                                              ; preds = %214
  %219 = load i8, ptr %217, align 1, !tbaa !13
  %220 = sext i8 %219 to i32
  %221 = sub nsw i32 %220, 97
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [26 x i8], ptr @can, i64 0, i64 %222
  %224 = load i8, ptr %223, align 1, !tbaa !16, !range !18, !noundef !19
  %225 = trunc i8 %224 to i1
  br i1 %225, label %229, label %226

226:                                              ; preds = %218
  %227 = load i32, ptr %14, align 4, !tbaa !8
  %228 = add nsw i32 %227, 1
  store i32 %228, ptr %14, align 4, !tbaa !8
  br label %229

229:                                              ; preds = %226, %218
  br label %230

230:                                              ; preds = %229, %185
  br label %231

231:                                              ; preds = %230
  %232 = load i32, ptr %15, align 4, !tbaa !8
  %233 = add nsw i32 %232, 1
  store i32 %233, ptr %15, align 4, !tbaa !8
  br label %149, !llvm.loop !25

234:                                              ; preds = %213, %180, %153
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  %235 = load i32, ptr %4, align 4
  switch i32 %235, label %244 [
    i32 17, label %236
  ]

236:                                              ; preds = %234
  %237 = load i32, ptr %14, align 4, !tbaa !8
  %238 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %237)
          to label %239 unwind label %240

239:                                              ; preds = %236
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %244

240:                                              ; preds = %236
  %241 = landingpad { ptr, i32 }
          cleanup
  %242 = extractvalue { ptr, i32 } %241, 0
  store ptr %242, ptr %12, align 8
  %243 = extractvalue { ptr, i32 } %241, 1
  store i32 %243, ptr %13, align 4
  br label %246

244:                                              ; preds = %239, %234
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  %245 = load i32, ptr %1, align 4
  ret i32 %245

246:                                              ; preds = %240, %181
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %247

247:                                              ; preds = %246, %154
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %248

248:                                              ; preds = %247
  %249 = load ptr, ptr %12, align 8
  %250 = load i32, ptr %13, align 4
  %251 = insertvalue { ptr, i32 } poison, ptr %249, 0
  %252 = insertvalue { ptr, i32 } %251, i32 %250, 1
  resume { ptr, i32 } %252
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #3

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

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind willreturn memory(read)
declare i32 @islower(i32 noundef) #6

; 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorISt4pairIiiESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @tolower(i32 noundef) #6

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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 = { nounwind willreturn memory(read) "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 }
attributes #8 = { nounwind willreturn memory(read) }

!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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!10, !10, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = !{!17, !17, i64 0}
!17 = !{!"bool", !10, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!21, !9, i64 0}
!21 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!22 = !{!21, !9, i64 4}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}


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

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

@key = external dso_local global [31 x [31 x i8]], align 16
@can = external dso_local local_unnamed_addr global [26 x i8], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@posKey = external dso_local global [26 x %"class.std::vector"], align 16
@shift = external dso_local global %"class.std::vector", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5checkii(i32 noundef, i32 noundef) 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 noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::pair", align 4
  %4 = alloca %"struct.std::pair", align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %8 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %9 = getelementptr i8, ptr %8, i64 -24
  %10 = load i64, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %10
  %12 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %11, ptr noundef null)
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %14 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(4) @x)
  %16 = load i32, ptr @n, align 4, !tbaa !8
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge.thread

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

._crit_edge:                                      ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !8
  %18 = icmp sgt i32 %23, 0
  %19 = load i32, ptr @m, align 4
  %20 = icmp sgt i32 %19, 0
  %or.cond = select i1 %18, i1 %20, i1 false
  br i1 %or.cond, label %.lr.ph57.split, label %._crit_edge58

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %21 = getelementptr inbounds [31 x [31 x i8]], ptr @key, i64 0, i64 %indvars.iv
  %22 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %21)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %23 = load i32, ptr @n, align 4, !tbaa !8
  %24 = sext i32 %23 to i64
  %25 = icmp slt i64 %indvars.iv.next, %24
  br i1 %25, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge58:                                    ; preds = %._crit_edge55, %._crit_edge.thread, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  br label %.preheader48

.lr.ph57.split:                                   ; preds = %._crit_edge, %._crit_edge55
  %26 = phi i32 [ %30, %._crit_edge55 ], [ %23, %._crit_edge ]
  %27 = phi i32 [ %33, %._crit_edge55 ], [ 0, %._crit_edge ]
  %28 = phi i32 [ %32, %._crit_edge55 ], [ %19, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr %2, align 4, !tbaa !8
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.lr.ph54, label %._crit_edge55

._crit_edge55.loopexit:                           ; preds = %46
  %.pre = load i32, ptr %1, align 4, !tbaa !8
  %.pre78 = load i32, ptr @n, align 4, !tbaa !8
  br label %._crit_edge55

._crit_edge55:                                    ; preds = %._crit_edge55.loopexit, %.lr.ph57.split
  %30 = phi i32 [ %.pre78, %._crit_edge55.loopexit ], [ %26, %.lr.ph57.split ]
  %31 = phi i32 [ %.pre, %._crit_edge55.loopexit ], [ %27, %.lr.ph57.split ]
  %32 = phi i32 [ %49, %._crit_edge55.loopexit ], [ %28, %.lr.ph57.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %33 = add nsw i32 %31, 1
  store i32 %33, ptr %1, align 4, !tbaa !8
  %34 = icmp slt i32 %33, %30
  br i1 %34, label %.lr.ph57.split, label %._crit_edge58, !llvm.loop !13

.lr.ph54:                                         ; preds = %.lr.ph57.split, %46
  %storemerge4552 = phi i32 [ %48, %46 ], [ 0, %.lr.ph57.split ]
  %35 = load i32, ptr %1, align 4, !tbaa !8
  %36 = sext i32 %35 to i64
  %37 = sext i32 %storemerge4552 to i64
  %38 = getelementptr inbounds [31 x [31 x i8]], ptr @key, i64 0, i64 %36, i64 %37
  %39 = load i8, ptr %38, align 1, !tbaa !15
  %40 = icmp eq i8 %39, 83
  br i1 %40, label %41, label %42

41:                                               ; preds = %.lr.ph54
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @shift, ptr noundef nonnull align 4 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %46

42:                                               ; preds = %.lr.ph54
  %43 = sext i8 %39 to i64
  %44 = add nsw i64 %43, -97
  %45 = getelementptr inbounds [26 x %"class.std::vector"], ptr @posKey, i64 0, i64 %44
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %45, ptr noundef nonnull align 4 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %46

46:                                               ; preds = %41, %42
  %47 = load i32, ptr %2, align 4, !tbaa !8
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %2, align 4, !tbaa !8
  %49 = load i32, ptr @m, align 4, !tbaa !8
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %.lr.ph54, label %._crit_edge55.loopexit, !llvm.loop !16

.preheader48:                                     ; preds = %._crit_edge58, %.critedge
  %indvars.iv72 = phi i64 [ 0, %._crit_edge58 ], [ %indvars.iv.next73, %.critedge ]
  %51 = getelementptr inbounds [26 x %"class.std::vector"], ptr @posKey, i64 0, i64 %indvars.iv72
  %52 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %51) #7
  %.not67 = icmp eq i64 %52, 0
  br i1 %.not67, label %.critedge, label %.lr.ph60

.lr.ph60:                                         ; preds = %.preheader48
  %53 = getelementptr inbounds [26 x i8], ptr @can, i64 0, i64 %indvars.iv72
  br label %56

54:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  %55 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %70 unwind label %73

56:                                               ; preds = %.lr.ph60, %59
  %indvars.iv69 = phi i64 [ 0, %.lr.ph60 ], [ %indvars.iv.next70, %59 ]
  %57 = load i8, ptr %53, align 1, !tbaa !17, !range !19, !noundef !20
  %58 = trunc nuw i8 %57 to i1
  br i1 %58, label %.critedge, label %59

.critedge:                                        ; preds = %56, %59, %.preheader48
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next73, 26
  br i1 %exitcond.not, label %54, label %.preheader48, !llvm.loop !21

59:                                               ; preds = %56
  %60 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %51, i64 noundef %indvars.iv69) #7
  %61 = load i32, ptr %60, align 4, !tbaa !22
  %62 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %51, i64 noundef %indvars.iv69) #7
  %63 = getelementptr inbounds i8, ptr %62, i64 4
  %64 = load i32, ptr %63, align 4, !tbaa !24
  %65 = call noundef zeroext i1 @_Z5checkii(i32 noundef %61, i32 noundef %64)
  %66 = zext i1 %65 to i8
  %67 = or i8 %57, %66
  store i8 %67, ptr %53, align 1, !tbaa !17
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %68 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %51) #7
  %69 = icmp ugt i64 %68, %indvars.iv.next70
  br i1 %69, label %56, label %.critedge, !llvm.loop !25

70:                                               ; preds = %54
  %71 = 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) %55, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %.preheader unwind label %73

.preheader:                                       ; preds = %70
  %72 = load i32, ptr %5, align 4, !tbaa !8
  %.not4263 = icmp sgt i32 %72, 0
  br i1 %.not4263, label %.lr.ph66, label %.critedge47

73:                                               ; preds = %70, %54
  %74 = landingpad { ptr, i32 }
          cleanup
  br label %117

.lr.ph66:                                         ; preds = %.preheader, %110
  %indvars.iv75 = phi i64 [ %indvars.iv.next76, %110 ], [ 0, %.preheader ]
  %.02864 = phi i32 [ %.1, %110 ], [ 0, %.preheader ]
  %75 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %6, i64 noundef %indvars.iv75)
  %76 = load i8, ptr %75, align 1, !tbaa !15
  %77 = sext i8 %76 to i32
  %78 = call i32 @islower(i32 noundef %77) #8
  %.not = icmp eq i32 %78, 0
  %79 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %6, i64 noundef %indvars.iv75)
  %80 = load i8, ptr %79, align 1, !tbaa !15
  br i1 %.not, label %88, label %81

81:                                               ; preds = %.lr.ph66
  %82 = sext i8 %80 to i64
  %83 = add nsw i64 %82, -97
  %84 = getelementptr inbounds [26 x %"class.std::vector"], ptr @posKey, i64 0, i64 %83
  %85 = call noundef zeroext i1 @_ZNKSt6vectorISt4pairIiiESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %84) #7
  br i1 %85, label %.invoke, label %110

86:                                               ; preds = %.invoke
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %117

88:                                               ; preds = %.lr.ph66
  %89 = sext i8 %80 to i32
  %90 = call i32 @tolower(i32 noundef %89) #8
  %91 = trunc i32 %90 to i8
  %92 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %6, i64 noundef %indvars.iv75)
  store i8 %91, ptr %92, align 1, !tbaa !15
  %93 = call noundef zeroext i1 @_ZNKSt6vectorISt4pairIiiESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) @shift) #7
  br i1 %93, label %.invoke, label %94

94:                                               ; preds = %88
  %95 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %6, i64 noundef %indvars.iv75)
  %96 = load i8, ptr %95, align 1, !tbaa !15
  %97 = sext i8 %96 to i64
  %98 = add nsw i64 %97, -97
  %99 = getelementptr inbounds [26 x %"class.std::vector"], ptr @posKey, i64 0, i64 %98
  %100 = call noundef zeroext i1 @_ZNKSt6vectorISt4pairIiiESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %99) #7
  br i1 %100, label %.invoke, label %102

.invoke:                                          ; preds = %81, %88, %94
  %101 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
          to label %116 unwind label %86

102:                                              ; preds = %94
  %103 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %6, i64 noundef %indvars.iv75)
  %104 = load i8, ptr %103, align 1, !tbaa !15
  %105 = sext i8 %104 to i64
  %106 = add nsw i64 %105, -97
  %107 = getelementptr inbounds [26 x i8], ptr @can, i64 0, i64 %106
  %108 = load i8, ptr %107, align 1, !tbaa !17, !range !19, !noundef !20
  %109 = xor i8 %108, 1
  %not. = zext nneg i8 %109 to i32
  %spec.select = add nsw i32 %.02864, %not.
  br label %110

110:                                              ; preds = %102, %81
  %.1 = phi i32 [ %.02864, %81 ], [ %spec.select, %102 ]
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %111 = load i32, ptr %5, align 4, !tbaa !8
  %112 = sext i32 %111 to i64
  %.not42 = icmp slt i64 %indvars.iv.next76, %112
  br i1 %.not42, label %.lr.ph66, label %.critedge47, !llvm.loop !26

.critedge47:                                      ; preds = %110, %.preheader
  %.028.lcssa = phi i32 [ 0, %.preheader ], [ %.1, %110 ]
  %113 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.028.lcssa)
          to label %116 unwind label %114

114:                                              ; preds = %.critedge47
  %115 = landingpad { ptr, i32 }
          cleanup
  br label %117

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

117:                                              ; preds = %86, %114, %73
  %.pn.pn = phi { ptr, i32 } [ %74, %73 ], [ %115, %114 ], [ %87, %86 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  resume { ptr, i32 } %.pn.pn
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #3

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

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

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

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

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

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 #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare i32 @islower(i32 noundef) local_unnamed_addr #6

; 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorISt4pairIiiESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare i32 @tolower(i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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 = { mustprogress nofree nounwind willreturn memory(read) "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 }
attributes #8 = { nounwind willreturn memory(read) }

!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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12, !14}
!14 = !{!"llvm.loop.unswitch.partial.disable"}
!15 = !{!10, !10, i64 0}
!16 = distinct !{!16, !12}
!17 = !{!18, !18, i64 0}
!18 = !{!"bool", !10, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = distinct !{!21, !12}
!22 = !{!23, !9, i64 0}
!23 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!24 = !{!23, !9, i64 4}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}


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