; LLVM IR from xirc/cp-algorithm :: atcoder/abc055/D/main.ll (Z5solveRSt6vectorIcSaIcEEcc)

; 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::__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] }

@N = external dso_local global i32, align 4
@_Z1SB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z5solveRSt6vectorIcSaIcEEcc(ptr noundef nonnull align 8 dereferenceable(24) %0, i8 noundef signext %1, i8 noundef signext %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i8 %1, ptr %5, align 1, !tbaa !9
  store i8 %2, ptr %6, align 1, !tbaa !9
  %14 = load i8, ptr %5, align 1, !tbaa !9
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef 0) #3
  store i8 %14, ptr %16, align 1, !tbaa !9
  %17 = load i8, ptr %6, align 1, !tbaa !9
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef 1) #3
  store i8 %17, ptr %19, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 1, ptr %7, align 4, !tbaa !10
  br label %20

20:                                               ; preds = %132, %3
  %21 = load i32, ptr %7, align 4, !tbaa !10
  %22 = load i32, ptr @N, align 4, !tbaa !10
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %135

25:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %26 = load i32, ptr %7, align 4, !tbaa !10
  %27 = sub nsw i32 %26, 1
  %28 = load i32, ptr @N, align 4, !tbaa !10
  %29 = add nsw i32 %27, %28
  %30 = load i32, ptr @N, align 4, !tbaa !10
  %31 = srem i32 %29, %30
  store i32 %31, ptr %8, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %32 = load i32, ptr %7, align 4, !tbaa !10
  %33 = add nsw i32 %32, 1
  %34 = load i32, ptr @N, align 4, !tbaa !10
  %35 = srem i32 %33, %34
  store i32 %35, ptr %9, align 4, !tbaa !10
  %36 = load i32, ptr %7, align 4, !tbaa !10
  %37 = sext i32 %36 to i64
  %38 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11, i64 noundef %37)
  %39 = load i8, ptr %38, align 1, !tbaa !9
  %40 = sext i8 %39 to i32
  %41 = icmp eq i32 %40, 111
  br i1 %41, label %42, label %83

42:                                               ; preds = %25
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = load i32, ptr %7, align 4, !tbaa !10
  %45 = sext i32 %44 to i64
  %46 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %43, i64 noundef %45) #3
  %47 = load i8, ptr %46, align 1, !tbaa !9
  %48 = sext i8 %47 to i32
  %49 = icmp eq i32 %48, 83
  br i1 %49, label %50, label %60

50:                                               ; preds = %42
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = load i32, ptr %8, align 4, !tbaa !10
  %53 = sext i32 %52 to i64
  %54 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %51, i64 noundef %53) #3
  %55 = load i8, ptr %54, align 1, !tbaa !9
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = load i32, ptr %9, align 4, !tbaa !10
  %58 = sext i32 %57 to i64
  %59 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %56, i64 noundef %58) #3
  store i8 %55, ptr %59, align 1, !tbaa !9
  br label %60

60:                                               ; preds = %50, %42
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = load i32, ptr %7, align 4, !tbaa !10
  %63 = sext i32 %62 to i64
  %64 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %61, i64 noundef %63) #3
  %65 = load i8, ptr %64, align 1, !tbaa !9
  %66 = sext i8 %65 to i32
  %67 = icmp eq i32 %66, 87
  br i1 %67, label %68, label %82

68:                                               ; preds = %60
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = load i32, ptr %8, align 4, !tbaa !10
  %71 = sext i32 %70 to i64
  %72 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %69, i64 noundef %71) #3
  %73 = load i8, ptr %72, align 1, !tbaa !9
  %74 = sext i8 %73 to i32
  %75 = icmp eq i32 %74, 83
  %76 = zext i1 %75 to i64
  %77 = select i1 %75, i8 87, i8 83
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = load i32, ptr %9, align 4, !tbaa !10
  %80 = sext i32 %79 to i64
  %81 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %78, i64 noundef %80) #3
  store i8 %77, ptr %81, align 1, !tbaa !9
  br label %82

82:                                               ; preds = %68, %60
  br label %83

83:                                               ; preds = %82, %25
  %84 = load i32, ptr %7, align 4, !tbaa !10
  %85 = sext i32 %84 to i64
  %86 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11, i64 noundef %85)
  %87 = load i8, ptr %86, align 1, !tbaa !9
  %88 = sext i8 %87 to i32
  %89 = icmp eq i32 %88, 120
  br i1 %89, label %90, label %131

90:                                               ; preds = %83
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = load i32, ptr %7, align 4, !tbaa !10
  %93 = sext i32 %92 to i64
  %94 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %91, i64 noundef %93) #3
  %95 = load i8, ptr %94, align 1, !tbaa !9
  %96 = sext i8 %95 to i32
  %97 = icmp eq i32 %96, 83
  br i1 %97, label %98, label %112

98:                                               ; preds = %90
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  %100 = load i32, ptr %8, align 4, !tbaa !10
  %101 = sext i32 %100 to i64
  %102 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %99, i64 noundef %101) #3
  %103 = load i8, ptr %102, align 1, !tbaa !9
  %104 = sext i8 %103 to i32
  %105 = icmp eq i32 %104, 83
  %106 = zext i1 %105 to i64
  %107 = select i1 %105, i8 87, i8 83
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = load i32, ptr %9, align 4, !tbaa !10
  %110 = sext i32 %109 to i64
  %111 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %108, i64 noundef %110) #3
  store i8 %107, ptr %111, align 1, !tbaa !9
  br label %112

112:                                              ; preds = %98, %90
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  %114 = load i32, ptr %7, align 4, !tbaa !10
  %115 = sext i32 %114 to i64
  %116 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %113, i64 noundef %115) #3
  %117 = load i8, ptr %116, align 1, !tbaa !9
  %118 = sext i8 %117 to i32
  %119 = icmp eq i32 %118, 87
  br i1 %119, label %120, label %130

120:                                              ; preds = %112
  %121 = load ptr, ptr %4, align 8, !tbaa !5
  %122 = load i32, ptr %8, align 4, !tbaa !10
  %123 = sext i32 %122 to i64
  %124 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %121, i64 noundef %123) #3
  %125 = load i8, ptr %124, align 1, !tbaa !9
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = load i32, ptr %9, align 4, !tbaa !10
  %128 = sext i32 %127 to i64
  %129 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %126, i64 noundef %128) #3
  store i8 %125, ptr %129, align 1, !tbaa !9
  br label %130

130:                                              ; preds = %120, %112
  br label %131

131:                                              ; preds = %130, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %132

132:                                              ; preds = %131
  %133 = load i32, ptr %7, align 4, !tbaa !10
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %7, align 4, !tbaa !10
  br label %20, !llvm.loop !12

135:                                              ; preds = %24
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #3
  store i8 1, ptr %10, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 0, ptr %11, align 4, !tbaa !10
  br label %136

136:                                              ; preds = %284, %135
  %137 = load i32, ptr %11, align 4, !tbaa !10
  %138 = load i32, ptr @N, align 4, !tbaa !10
  %139 = icmp slt i32 %137, %138
  br i1 %139, label %141, label %140

140:                                              ; preds = %136
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %287

141:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %142 = load i32, ptr %11, align 4, !tbaa !10
  %143 = sub nsw i32 %142, 1
  %144 = load i32, ptr @N, align 4, !tbaa !10
  %145 = add nsw i32 %143, %144
  %146 = load i32, ptr @N, align 4, !tbaa !10
  %147 = srem i32 %145, %146
  store i32 %147, ptr %12, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %148 = load i32, ptr %11, align 4, !tbaa !10
  %149 = add nsw i32 %148, 1
  %150 = load i32, ptr @N, align 4, !tbaa !10
  %151 = srem i32 %149, %150
  store i32 %151, ptr %13, align 4, !tbaa !10
  %152 = load i32, ptr %11, align 4, !tbaa !10
  %153 = sext i32 %152 to i64
  %154 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11, i64 noundef %153)
  %155 = load i8, ptr %154, align 1, !tbaa !9
  %156 = sext i8 %155 to i32
  %157 = icmp eq i32 %156, 111
  br i1 %157, label %158, label %217

158:                                              ; preds = %141
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = load i32, ptr %11, align 4, !tbaa !10
  %161 = sext i32 %160 to i64
  %162 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %159, i64 noundef %161) #3
  %163 = load i8, ptr %162, align 1, !tbaa !9
  %164 = sext i8 %163 to i32
  %165 = icmp eq i32 %164, 83
  br i1 %165, label %166, label %187

166:                                              ; preds = %158
  %167 = load ptr, ptr %4, align 8, !tbaa !5
  %168 = load i32, ptr %13, align 4, !tbaa !10
  %169 = sext i32 %168 to i64
  %170 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %167, i64 noundef %169) #3
  %171 = load i8, ptr %170, align 1, !tbaa !9
  %172 = sext i8 %171 to i32
  %173 = load ptr, ptr %4, align 8, !tbaa !5
  %174 = load i32, ptr %12, align 4, !tbaa !10
  %175 = sext i32 %174 to i64
  %176 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %173, i64 noundef %175) #3
  %177 = load i8, ptr %176, align 1, !tbaa !9
  %178 = sext i8 %177 to i32
  %179 = icmp eq i32 %172, %178
  %180 = zext i1 %179 to i32
  %181 = load i8, ptr %10, align 1, !tbaa !14, !range !16, !noundef !17
  %182 = trunc i8 %181 to i1
  %183 = zext i1 %182 to i32
  %184 = and i32 %183, %180
  %185 = icmp ne i32 %184, 0
  %186 = zext i1 %185 to i8
  store i8 %186, ptr %10, align 1, !tbaa !14
  br label %187

187:                                              ; preds = %166, %158
  %188 = load ptr, ptr %4, align 8, !tbaa !5
  %189 = load i32, ptr %11, align 4, !tbaa !10
  %190 = sext i32 %189 to i64
  %191 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %188, i64 noundef %190) #3
  %192 = load i8, ptr %191, align 1, !tbaa !9
  %193 = sext i8 %192 to i32
  %194 = icmp eq i32 %193, 87
  br i1 %194, label %195, label %216

195:                                              ; preds = %187
  %196 = load ptr, ptr %4, align 8, !tbaa !5
  %197 = load i32, ptr %13, align 4, !tbaa !10
  %198 = sext i32 %197 to i64
  %199 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %196, i64 noundef %198) #3
  %200 = load i8, ptr %199, align 1, !tbaa !9
  %201 = sext i8 %200 to i32
  %202 = load ptr, ptr %4, align 8, !tbaa !5
  %203 = load i32, ptr %12, align 4, !tbaa !10
  %204 = sext i32 %203 to i64
  %205 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %202, i64 noundef %204) #3
  %206 = load i8, ptr %205, align 1, !tbaa !9
  %207 = sext i8 %206 to i32
  %208 = icmp ne i32 %201, %207
  %209 = zext i1 %208 to i32
  %210 = load i8, ptr %10, align 1, !tbaa !14, !range !16, !noundef !17
  %211 = trunc i8 %210 to i1
  %212 = zext i1 %211 to i32
  %213 = and i32 %212, %209
  %214 = icmp ne i32 %213, 0
  %215 = zext i1 %214 to i8
  store i8 %215, ptr %10, align 1, !tbaa !14
  br label %216

216:                                              ; preds = %195, %187
  br label %217

217:                                              ; preds = %216, %141
  %218 = load i32, ptr %11, align 4, !tbaa !10
  %219 = sext i32 %218 to i64
  %220 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11, i64 noundef %219)
  %221 = load i8, ptr %220, align 1, !tbaa !9
  %222 = sext i8 %221 to i32
  %223 = icmp eq i32 %222, 120
  br i1 %223, label %224, label %283

224:                                              ; preds = %217
  %225 = load ptr, ptr %4, align 8, !tbaa !5
  %226 = load i32, ptr %11, align 4, !tbaa !10
  %227 = sext i32 %226 to i64
  %228 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %225, i64 noundef %227) #3
  %229 = load i8, ptr %228, align 1, !tbaa !9
  %230 = sext i8 %229 to i32
  %231 = icmp eq i32 %230, 83
  br i1 %231, label %232, label %253

232:                                              ; preds = %224
  %233 = load ptr, ptr %4, align 8, !tbaa !5
  %234 = load i32, ptr %13, align 4, !tbaa !10
  %235 = sext i32 %234 to i64
  %236 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %233, i64 noundef %235) #3
  %237 = load i8, ptr %236, align 1, !tbaa !9
  %238 = sext i8 %237 to i32
  %239 = load ptr, ptr %4, align 8, !tbaa !5
  %240 = load i32, ptr %12, align 4, !tbaa !10
  %241 = sext i32 %240 to i64
  %242 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %239, i64 noundef %241) #3
  %243 = load i8, ptr %242, align 1, !tbaa !9
  %244 = sext i8 %243 to i32
  %245 = icmp ne i32 %238, %244
  %246 = zext i1 %245 to i32
  %247 = load i8, ptr %10, align 1, !tbaa !14, !range !16, !noundef !17
  %248 = trunc i8 %247 to i1
  %249 = zext i1 %248 to i32
  %250 = and i32 %249, %246
  %251 = icmp ne i32 %250, 0
  %252 = zext i1 %251 to i8
  store i8 %252, ptr %10, align 1, !tbaa !14
  br label %253

253:                                              ; preds = %232, %224
  %254 = load ptr, ptr %4, align 8, !tbaa !5
  %255 = load i32, ptr %11, align 4, !tbaa !10
  %256 = sext i32 %255 to i64
  %257 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %254, i64 noundef %256) #3
  %258 = load i8, ptr %257, align 1, !tbaa !9
  %259 = sext i8 %258 to i32
  %260 = icmp eq i32 %259, 87
  br i1 %260, label %261, label %282

261:                                              ; preds = %253
  %262 = load ptr, ptr %4, align 8, !tbaa !5
  %263 = load i32, ptr %13, align 4, !tbaa !10
  %264 = sext i32 %263 to i64
  %265 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %262, i64 noundef %264) #3
  %266 = load i8, ptr %265, align 1, !tbaa !9
  %267 = sext i8 %266 to i32
  %268 = load ptr, ptr %4, align 8, !tbaa !5
  %269 = load i32, ptr %12, align 4, !tbaa !10
  %270 = sext i32 %269 to i64
  %271 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %268, i64 noundef %270) #3
  %272 = load i8, ptr %271, align 1, !tbaa !9
  %273 = sext i8 %272 to i32
  %274 = icmp eq i32 %267, %273
  %275 = zext i1 %274 to i32
  %276 = load i8, ptr %10, align 1, !tbaa !14, !range !16, !noundef !17
  %277 = trunc i8 %276 to i1
  %278 = zext i1 %277 to i32
  %279 = and i32 %278, %275
  %280 = icmp ne i32 %279, 0
  %281 = zext i1 %280 to i8
  store i8 %281, ptr %10, align 1, !tbaa !14
  br label %282

282:                                              ; preds = %261, %253
  br label %283

283:                                              ; preds = %282, %217
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %284

284:                                              ; preds = %283
  %285 = load i32, ptr %11, align 4, !tbaa !10
  %286 = add nsw i32 %285, 1
  store i32 %286, ptr %11, align 4, !tbaa !10
  br label %136, !llvm.loop !18

287:                                              ; preds = %140
  %288 = load i8, ptr %10, align 1, !tbaa !14, !range !16, !noundef !17
  %289 = trunc i8 %288 to i1
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  ret i1 %289
}

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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) #1 align 2

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

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


; 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::__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] }

@N = external dso_local local_unnamed_addr global i32, align 4
@_Z1SB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_Z5solveRSt6vectorIcSaIcEEcc(ptr noundef nonnull align 8 dereferenceable(24) %0, i8 noundef signext %1, i8 noundef signext %2) local_unnamed_addr #0 {
  %4 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 0) #1
  store i8 %1, ptr %4, align 1, !tbaa !5
  %5 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 1) #1
  store i8 %2, ptr %5, align 1, !tbaa !5
  %6 = load i32, ptr @N, align 4, !tbaa !8
  %7 = icmp sgt i32 %6, 1
  br i1 %7, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %68, %3
  %8 = phi i32 [ %6, %3 ], [ %69, %68 ]
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph76, label %._crit_edge

.lr.ph:                                           ; preds = %3, %68
  %indvars.iv = phi i64 [ %indvars.iv.next, %68 ], [ 1, %3 ]
  %10 = phi i32 [ %69, %68 ], [ %6, %3 ]
  %11 = trunc i64 %indvars.iv to i32
  %12 = add i32 %11, -1
  %13 = add nsw i32 %12, %10
  %14 = srem i32 %13, %10
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %15 = trunc nuw nsw i64 %indvars.iv.next to i32
  %16 = srem i32 %15, %10
  %17 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11, i64 noundef %indvars.iv)
  %18 = load i8, ptr %17, align 1, !tbaa !5
  %19 = icmp eq i8 %18, 111
  br i1 %19, label %20, label %42

20:                                               ; preds = %.lr.ph
  %21 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #1
  %22 = load i8, ptr %21, align 1, !tbaa !5
  %23 = icmp eq i8 %22, 83
  br i1 %23, label %24, label %30

24:                                               ; preds = %20
  %25 = sext i32 %14 to i64
  %26 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %25) #1
  %27 = load i8, ptr %26, align 1, !tbaa !5
  %28 = zext nneg i32 %16 to i64
  %29 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %28) #1
  store i8 %27, ptr %29, align 1, !tbaa !5
  br label %30

30:                                               ; preds = %24, %20
  %31 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #1
  %32 = load i8, ptr %31, align 1, !tbaa !5
  %33 = icmp eq i8 %32, 87
  br i1 %33, label %34, label %42

34:                                               ; preds = %30
  %35 = sext i32 %14 to i64
  %36 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %35) #1
  %37 = load i8, ptr %36, align 1, !tbaa !5
  %38 = icmp eq i8 %37, 83
  %39 = select i1 %38, i8 87, i8 83
  %40 = zext nneg i32 %16 to i64
  %41 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %40) #1
  store i8 %39, ptr %41, align 1, !tbaa !5
  br label %42

42:                                               ; preds = %30, %34, %.lr.ph
  %43 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11, i64 noundef %indvars.iv)
  %44 = load i8, ptr %43, align 1, !tbaa !5
  %45 = icmp eq i8 %44, 120
  br i1 %45, label %46, label %68

46:                                               ; preds = %42
  %47 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #1
  %48 = load i8, ptr %47, align 1, !tbaa !5
  %49 = icmp eq i8 %48, 83
  br i1 %49, label %50, label %58

50:                                               ; preds = %46
  %51 = sext i32 %14 to i64
  %52 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %51) #1
  %53 = load i8, ptr %52, align 1, !tbaa !5
  %54 = icmp eq i8 %53, 83
  %55 = select i1 %54, i8 87, i8 83
  %56 = zext nneg i32 %16 to i64
  %57 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %56) #1
  store i8 %55, ptr %57, align 1, !tbaa !5
  br label %58

58:                                               ; preds = %50, %46
  %59 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #1
  %60 = load i8, ptr %59, align 1, !tbaa !5
  %61 = icmp eq i8 %60, 87
  br i1 %61, label %62, label %68

62:                                               ; preds = %58
  %63 = sext i32 %14 to i64
  %64 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %63) #1
  %65 = load i8, ptr %64, align 1, !tbaa !5
  %66 = zext nneg i32 %16 to i64
  %67 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %66) #1
  store i8 %65, ptr %67, align 1, !tbaa !5
  br label %68

68:                                               ; preds = %58, %62, %42
  %69 = load i32, ptr @N, align 4, !tbaa !8
  %70 = sext i32 %69 to i64
  %71 = icmp slt i64 %indvars.iv.next, %70
  br i1 %71, label %.lr.ph, label %.preheader, !llvm.loop !10

._crit_edge.loopexit:                             ; preds = %149
  %72 = trunc nuw i8 %.4 to i1
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %.068.lcssa = phi i1 [ true, %.preheader ], [ %72, %._crit_edge.loopexit ]
  ret i1 %.068.lcssa

.lr.ph76:                                         ; preds = %.preheader, %149
  %indvars.iv78 = phi i64 [ %indvars.iv.next79, %149 ], [ 0, %.preheader ]
  %73 = phi i32 [ %150, %149 ], [ %8, %.preheader ]
  %.06875 = phi i8 [ %.4, %149 ], [ 1, %.preheader ]
  %74 = trunc i64 %indvars.iv78 to i32
  %75 = add i32 %74, -1
  %76 = add nsw i32 %75, %73
  %77 = srem i32 %76, %73
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %78 = trunc nuw nsw i64 %indvars.iv.next79 to i32
  %79 = srem i32 %78, %73
  %80 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11, i64 noundef %indvars.iv78)
  %81 = load i8, ptr %80, align 1, !tbaa !5
  %82 = icmp eq i8 %81, 111
  br i1 %82, label %83, label %114

83:                                               ; preds = %.lr.ph76
  %84 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv78) #1
  %85 = load i8, ptr %84, align 1, !tbaa !5
  %86 = icmp eq i8 %85, 83
  br i1 %86, label %87, label %99

87:                                               ; preds = %83
  %88 = zext nneg i32 %79 to i64
  %89 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %88) #1
  %90 = load i8, ptr %89, align 1, !tbaa !5
  %91 = sext i32 %77 to i64
  %92 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %91) #1
  %93 = load i8, ptr %92, align 1, !tbaa !5
  %94 = icmp eq i8 %90, %93
  %95 = and i8 %.06875, 1
  %96 = icmp ne i8 %95, 0
  %97 = select i1 %94, i1 %96, i1 false
  %98 = zext i1 %97 to i8
  br label %99

99:                                               ; preds = %87, %83
  %.1 = phi i8 [ %98, %87 ], [ %.06875, %83 ]
  %100 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv78) #1
  %101 = load i8, ptr %100, align 1, !tbaa !5
  %102 = icmp eq i8 %101, 87
  br i1 %102, label %103, label %114

103:                                              ; preds = %99
  %104 = zext nneg i32 %79 to i64
  %105 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %104) #1
  %106 = load i8, ptr %105, align 1, !tbaa !5
  %107 = sext i32 %77 to i64
  %108 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %107) #1
  %109 = load i8, ptr %108, align 1, !tbaa !5
  %.not = icmp ne i8 %106, %109
  %110 = and i8 %.1, 1
  %111 = icmp ne i8 %110, 0
  %112 = select i1 %.not, i1 %111, i1 false
  %113 = zext i1 %112 to i8
  br label %114

114:                                              ; preds = %99, %103, %.lr.ph76
  %.2 = phi i8 [ %113, %103 ], [ %.1, %99 ], [ %.06875, %.lr.ph76 ]
  %115 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11, i64 noundef %indvars.iv78)
  %116 = load i8, ptr %115, align 1, !tbaa !5
  %117 = icmp eq i8 %116, 120
  br i1 %117, label %118, label %149

118:                                              ; preds = %114
  %119 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv78) #1
  %120 = load i8, ptr %119, align 1, !tbaa !5
  %121 = icmp eq i8 %120, 83
  br i1 %121, label %122, label %133

122:                                              ; preds = %118
  %123 = zext nneg i32 %79 to i64
  %124 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %123) #1
  %125 = load i8, ptr %124, align 1, !tbaa !5
  %126 = sext i32 %77 to i64
  %127 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %126) #1
  %128 = load i8, ptr %127, align 1, !tbaa !5
  %.not72 = icmp ne i8 %125, %128
  %129 = and i8 %.2, 1
  %130 = icmp ne i8 %129, 0
  %131 = select i1 %.not72, i1 %130, i1 false
  %132 = zext i1 %131 to i8
  br label %133

133:                                              ; preds = %122, %118
  %.3 = phi i8 [ %132, %122 ], [ %.2, %118 ]
  %134 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv78) #1
  %135 = load i8, ptr %134, align 1, !tbaa !5
  %136 = icmp eq i8 %135, 87
  br i1 %136, label %137, label %149

137:                                              ; preds = %133
  %138 = zext nneg i32 %79 to i64
  %139 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %138) #1
  %140 = load i8, ptr %139, align 1, !tbaa !5
  %141 = sext i32 %77 to i64
  %142 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %141) #1
  %143 = load i8, ptr %142, align 1, !tbaa !5
  %144 = icmp eq i8 %140, %143
  %145 = and i8 %.3, 1
  %146 = icmp ne i8 %145, 0
  %147 = select i1 %144, i1 %146, i1 false
  %148 = zext i1 %147 to i8
  br label %149

149:                                              ; preds = %133, %137, %114
  %.4 = phi i8 [ %148, %137 ], [ %.3, %133 ], [ %.2, %114 ]
  %150 = load i32, ptr @N, align 4, !tbaa !8
  %151 = sext i32 %150 to i64
  %152 = icmp slt i64 %indvars.iv.next79, %151
  br i1 %152, label %.lr.ph76, label %._crit_edge.loopexit, !llvm.loop !12
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 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) local_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 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}


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