; LLVM IR from kazunetakahashi/atcoder :: 2018/1211_ABC007/D.ll (Z3cntx)

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

@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z3cntx(i64 noundef %0) #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca [21 x [2 x [2 x i64]]], align 16
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i64 %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #4
  %13 = load i64, ptr %2, align 8, !tbaa !5
  call void @_ZNSt7__cxx119to_stringEx(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %3, i64 noundef %13)
  br label %14

14:                                               ; preds = %19, %1
  %15 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  %16 = trunc i64 %15 to i32
  %17 = icmp slt i32 %16, 20
  br i1 %17, label %18, label %25

18:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #4
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %4, ptr noundef @.str, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %19 unwind label %21

19:                                               ; preds = %18
  %20 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #4
  br label %14, !llvm.loop !9

21:                                               ; preds = %18
  %22 = landingpad { ptr, i32 }
          cleanup
  %23 = extractvalue { ptr, i32 } %22, 0
  store ptr %23, ptr %5, align 8
  %24 = extractvalue { ptr, i32 } %22, 1
  store i32 %24, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #4
  br label %272

25:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 672, ptr %7) #4
  %26 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 0
  %27 = getelementptr inbounds [2 x [2 x i64]], ptr %26, i64 0, i64 0
  %28 = getelementptr inbounds [2 x i64], ptr %27, i64 0, i64 0
  %29 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 0
  %30 = getelementptr inbounds [2 x [2 x i64]], ptr %29, i64 0, i64 0
  %31 = getelementptr inbounds [2 x i64], ptr %30, i64 0, i64 0
  %32 = getelementptr inbounds i64, ptr %31, i64 84
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !11
  invoke void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef %28, ptr noundef %32, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %33 unwind label %41

33:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %34 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 0
  %35 = getelementptr inbounds [2 x [2 x i64]], ptr %34, i64 0, i64 1
  %36 = getelementptr inbounds [2 x i64], ptr %35, i64 0, i64 0
  store i64 1, ptr %36, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 1, ptr %9, align 4, !tbaa !11
  br label %37

37:                                               ; preds = %257, %33
  %38 = load i32, ptr %9, align 4, !tbaa !11
  %39 = icmp slt i32 %38, 21
  br i1 %39, label %45, label %40

40:                                               ; preds = %37
  store i32 4, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %261

41:                                               ; preds = %25
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %5, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %271

45:                                               ; preds = %37
  %46 = load i32, ptr %9, align 4, !tbaa !11
  %47 = sub nsw i32 %46, 1
  %48 = sext i32 %47 to i64
  %49 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %48)
          to label %50 unwind label %92

50:                                               ; preds = %45
  %51 = load i8, ptr %49, align 1, !tbaa !13
  %52 = sext i8 %51 to i32
  %53 = icmp eq i32 %52, 52
  br i1 %53, label %63, label %54

54:                                               ; preds = %50
  %55 = load i32, ptr %9, align 4, !tbaa !11
  %56 = sub nsw i32 %55, 1
  %57 = sext i32 %56 to i64
  %58 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %57)
          to label %59 unwind label %92

59:                                               ; preds = %54
  %60 = load i8, ptr %58, align 1, !tbaa !13
  %61 = sext i8 %60 to i32
  %62 = icmp eq i32 %61, 57
  br i1 %62, label %63, label %96

63:                                               ; preds = %59, %50
  %64 = load i32, ptr %9, align 4, !tbaa !11
  %65 = sub nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %66
  %68 = getelementptr inbounds [2 x [2 x i64]], ptr %67, i64 0, i64 1
  %69 = getelementptr inbounds [2 x i64], ptr %68, i64 0, i64 0
  %70 = load i64, ptr %69, align 16, !tbaa !5
  %71 = load i32, ptr %9, align 4, !tbaa !11
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %72
  %74 = getelementptr inbounds [2 x [2 x i64]], ptr %73, i64 0, i64 1
  %75 = getelementptr inbounds [2 x i64], ptr %74, i64 0, i64 1
  %76 = load i64, ptr %75, align 8, !tbaa !5
  %77 = add nsw i64 %76, %70
  store i64 %77, ptr %75, align 8, !tbaa !5
  %78 = load i32, ptr %9, align 4, !tbaa !11
  %79 = sub nsw i32 %78, 1
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %80
  %82 = getelementptr inbounds [2 x [2 x i64]], ptr %81, i64 0, i64 1
  %83 = getelementptr inbounds [2 x i64], ptr %82, i64 0, i64 1
  %84 = load i64, ptr %83, align 8, !tbaa !5
  %85 = load i32, ptr %9, align 4, !tbaa !11
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %86
  %88 = getelementptr inbounds [2 x [2 x i64]], ptr %87, i64 0, i64 1
  %89 = getelementptr inbounds [2 x i64], ptr %88, i64 0, i64 1
  %90 = load i64, ptr %89, align 8, !tbaa !5
  %91 = add nsw i64 %90, %84
  store i64 %91, ptr %89, align 8, !tbaa !5
  br label %125

92:                                               ; preds = %54, %45
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %5, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %6, align 4
  br label %260

96:                                               ; preds = %59
  %97 = load i32, ptr %9, align 4, !tbaa !11
  %98 = sub nsw i32 %97, 1
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %99
  %101 = getelementptr inbounds [2 x [2 x i64]], ptr %100, i64 0, i64 1
  %102 = getelementptr inbounds [2 x i64], ptr %101, i64 0, i64 0
  %103 = load i64, ptr %102, align 16, !tbaa !5
  %104 = load i32, ptr %9, align 4, !tbaa !11
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %105
  %107 = getelementptr inbounds [2 x [2 x i64]], ptr %106, i64 0, i64 1
  %108 = getelementptr inbounds [2 x i64], ptr %107, i64 0, i64 0
  %109 = load i64, ptr %108, align 16, !tbaa !5
  %110 = add nsw i64 %109, %103
  store i64 %110, ptr %108, align 16, !tbaa !5
  %111 = load i32, ptr %9, align 4, !tbaa !11
  %112 = sub nsw i32 %111, 1
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %113
  %115 = getelementptr inbounds [2 x [2 x i64]], ptr %114, i64 0, i64 1
  %116 = getelementptr inbounds [2 x i64], ptr %115, i64 0, i64 1
  %117 = load i64, ptr %116, align 8, !tbaa !5
  %118 = load i32, ptr %9, align 4, !tbaa !11
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %119
  %121 = getelementptr inbounds [2 x [2 x i64]], ptr %120, i64 0, i64 1
  %122 = getelementptr inbounds [2 x i64], ptr %121, i64 0, i64 1
  %123 = load i64, ptr %122, align 8, !tbaa !5
  %124 = add nsw i64 %123, %117
  store i64 %124, ptr %122, align 8, !tbaa !5
  br label %125

125:                                              ; preds = %96, %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %126 = load i32, ptr %9, align 4, !tbaa !11
  %127 = sub nsw i32 %126, 1
  %128 = sext i32 %127 to i64
  %129 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %128)
          to label %130 unwind label %139

130:                                              ; preds = %125
  %131 = load i8, ptr %129, align 1, !tbaa !13
  %132 = sext i8 %131 to i32
  %133 = sub nsw i32 %132, 48
  store i32 %133, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %134

134:                                              ; preds = %208, %130
  %135 = load i32, ptr %12, align 4, !tbaa !11
  %136 = load i32, ptr %11, align 4, !tbaa !11
  %137 = icmp slt i32 %135, %136
  br i1 %137, label %143, label %138

138:                                              ; preds = %134
  store i32 7, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %211

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

143:                                              ; preds = %134
  %144 = load i32, ptr %12, align 4, !tbaa !11
  %145 = icmp eq i32 %144, 4
  br i1 %145, label %149, label %146

146:                                              ; preds = %143
  %147 = load i32, ptr %12, align 4, !tbaa !11
  %148 = icmp eq i32 %147, 9
  br i1 %148, label %149, label %178

149:                                              ; preds = %146, %143
  %150 = load i32, ptr %9, align 4, !tbaa !11
  %151 = sub nsw i32 %150, 1
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %152
  %154 = getelementptr inbounds [2 x [2 x i64]], ptr %153, i64 0, i64 1
  %155 = getelementptr inbounds [2 x i64], ptr %154, i64 0, i64 0
  %156 = load i64, ptr %155, align 16, !tbaa !5
  %157 = load i32, ptr %9, align 4, !tbaa !11
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %158
  %160 = getelementptr inbounds [2 x [2 x i64]], ptr %159, i64 0, i64 0
  %161 = getelementptr inbounds [2 x i64], ptr %160, i64 0, i64 1
  %162 = load i64, ptr %161, align 8, !tbaa !5
  %163 = add nsw i64 %162, %156
  store i64 %163, ptr %161, align 8, !tbaa !5
  %164 = load i32, ptr %9, align 4, !tbaa !11
  %165 = sub nsw i32 %164, 1
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %166
  %168 = getelementptr inbounds [2 x [2 x i64]], ptr %167, i64 0, i64 1
  %169 = getelementptr inbounds [2 x i64], ptr %168, i64 0, i64 1
  %170 = load i64, ptr %169, align 8, !tbaa !5
  %171 = load i32, ptr %9, align 4, !tbaa !11
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %172
  %174 = getelementptr inbounds [2 x [2 x i64]], ptr %173, i64 0, i64 0
  %175 = getelementptr inbounds [2 x i64], ptr %174, i64 0, i64 1
  %176 = load i64, ptr %175, align 8, !tbaa !5
  %177 = add nsw i64 %176, %170
  store i64 %177, ptr %175, align 8, !tbaa !5
  br label %207

178:                                              ; preds = %146
  %179 = load i32, ptr %9, align 4, !tbaa !11
  %180 = sub nsw i32 %179, 1
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %181
  %183 = getelementptr inbounds [2 x [2 x i64]], ptr %182, i64 0, i64 1
  %184 = getelementptr inbounds [2 x i64], ptr %183, i64 0, i64 0
  %185 = load i64, ptr %184, align 16, !tbaa !5
  %186 = load i32, ptr %9, align 4, !tbaa !11
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %187
  %189 = getelementptr inbounds [2 x [2 x i64]], ptr %188, i64 0, i64 0
  %190 = getelementptr inbounds [2 x i64], ptr %189, i64 0, i64 0
  %191 = load i64, ptr %190, align 16, !tbaa !5
  %192 = add nsw i64 %191, %185
  store i64 %192, ptr %190, align 16, !tbaa !5
  %193 = load i32, ptr %9, align 4, !tbaa !11
  %194 = sub nsw i32 %193, 1
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %195
  %197 = getelementptr inbounds [2 x [2 x i64]], ptr %196, i64 0, i64 1
  %198 = getelementptr inbounds [2 x i64], ptr %197, i64 0, i64 1
  %199 = load i64, ptr %198, align 8, !tbaa !5
  %200 = load i32, ptr %9, align 4, !tbaa !11
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %201
  %203 = getelementptr inbounds [2 x [2 x i64]], ptr %202, i64 0, i64 0
  %204 = getelementptr inbounds [2 x i64], ptr %203, i64 0, i64 1
  %205 = load i64, ptr %204, align 8, !tbaa !5
  %206 = add nsw i64 %205, %199
  store i64 %206, ptr %204, align 8, !tbaa !5
  br label %207

207:                                              ; preds = %178, %149
  br label %208

208:                                              ; preds = %207
  %209 = load i32, ptr %12, align 4, !tbaa !11
  %210 = add nsw i32 %209, 1
  store i32 %210, ptr %12, align 4, !tbaa !11
  br label %134, !llvm.loop !14

211:                                              ; preds = %138
  %212 = load i32, ptr %9, align 4, !tbaa !11
  %213 = sub nsw i32 %212, 1
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %214
  %216 = getelementptr inbounds [2 x [2 x i64]], ptr %215, i64 0, i64 0
  %217 = getelementptr inbounds [2 x i64], ptr %216, i64 0, i64 0
  %218 = load i64, ptr %217, align 16, !tbaa !5
  %219 = mul nsw i64 8, %218
  %220 = load i32, ptr %9, align 4, !tbaa !11
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %221
  %223 = getelementptr inbounds [2 x [2 x i64]], ptr %222, i64 0, i64 0
  %224 = getelementptr inbounds [2 x i64], ptr %223, i64 0, i64 0
  %225 = load i64, ptr %224, align 16, !tbaa !5
  %226 = add nsw i64 %225, %219
  store i64 %226, ptr %224, align 16, !tbaa !5
  %227 = load i32, ptr %9, align 4, !tbaa !11
  %228 = sub nsw i32 %227, 1
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %229
  %231 = getelementptr inbounds [2 x [2 x i64]], ptr %230, i64 0, i64 0
  %232 = getelementptr inbounds [2 x i64], ptr %231, i64 0, i64 0
  %233 = load i64, ptr %232, align 16, !tbaa !5
  %234 = mul nsw i64 2, %233
  %235 = load i32, ptr %9, align 4, !tbaa !11
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %236
  %238 = getelementptr inbounds [2 x [2 x i64]], ptr %237, i64 0, i64 0
  %239 = getelementptr inbounds [2 x i64], ptr %238, i64 0, i64 1
  %240 = load i64, ptr %239, align 8, !tbaa !5
  %241 = add nsw i64 %240, %234
  store i64 %241, ptr %239, align 8, !tbaa !5
  %242 = load i32, ptr %9, align 4, !tbaa !11
  %243 = sub nsw i32 %242, 1
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %244
  %246 = getelementptr inbounds [2 x [2 x i64]], ptr %245, i64 0, i64 0
  %247 = getelementptr inbounds [2 x i64], ptr %246, i64 0, i64 1
  %248 = load i64, ptr %247, align 8, !tbaa !5
  %249 = mul nsw i64 10, %248
  %250 = load i32, ptr %9, align 4, !tbaa !11
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 %251
  %253 = getelementptr inbounds [2 x [2 x i64]], ptr %252, i64 0, i64 0
  %254 = getelementptr inbounds [2 x i64], ptr %253, i64 0, i64 1
  %255 = load i64, ptr %254, align 8, !tbaa !5
  %256 = add nsw i64 %255, %249
  store i64 %256, ptr %254, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %257

257:                                              ; preds = %211
  %258 = load i32, ptr %9, align 4, !tbaa !11
  %259 = add nsw i32 %258, 1
  store i32 %259, ptr %9, align 4, !tbaa !11
  br label %37, !llvm.loop !15

260:                                              ; preds = %139, %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %271

261:                                              ; preds = %40
  %262 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 20
  %263 = getelementptr inbounds [2 x [2 x i64]], ptr %262, i64 0, i64 0
  %264 = getelementptr inbounds [2 x i64], ptr %263, i64 0, i64 1
  %265 = load i64, ptr %264, align 8, !tbaa !5
  %266 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %7, i64 0, i64 20
  %267 = getelementptr inbounds [2 x [2 x i64]], ptr %266, i64 0, i64 1
  %268 = getelementptr inbounds [2 x i64], ptr %267, i64 0, i64 1
  %269 = load i64, ptr %268, align 8, !tbaa !5
  %270 = add nsw i64 %265, %269
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 672, ptr %7) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #4
  ret i64 %270

271:                                              ; preds = %260, %41
  call void @llvm.lifetime.end.p0(i64 672, ptr %7) #4
  br label %272

272:                                              ; preds = %271, %21
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #4
  br label %273

273:                                              ; preds = %272
  %274 = load ptr, ptr %5, align 8
  %275 = load i32, ptr %6, align 4
  %276 = insertvalue { ptr, i32 } poison, ptr %274, 0
  %277 = insertvalue { ptr, i32 } %276, i32 %275, 1
  resume { ptr, i32 } %277
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNSt7__cxx119to_stringEx(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i64 noundef) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #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) #3 align 2

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

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

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


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

@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z3cntx(i64 noundef %0) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca [21 x [2 x [2 x i64]]], align 16
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #4
  call void @_ZNSt7__cxx119to_stringEx(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %2, i64 noundef %0)
  %6 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #4
  %7 = trunc i64 %6 to i32
  %8 = icmp slt i32 %7, 20
  br i1 %8, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1, %9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #4
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %3, ptr noundef nonnull @.str, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %9 unwind label %14

9:                                                ; preds = %.lr.ph
  %10 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  %11 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #4
  %12 = trunc i64 %11 to i32
  %13 = icmp slt i32 %12, 20
  br i1 %13, label %.lr.ph, label %._crit_edge, !llvm.loop !5

14:                                               ; preds = %.lr.ph
  %15 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  br label %92

._crit_edge:                                      ; preds = %9, %1
  call void @llvm.lifetime.start.p0(i64 672, ptr nonnull %4) #4
  %16 = getelementptr inbounds i8, ptr %4, i64 672
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 0, ptr %5, align 4, !tbaa !7
  invoke void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull %4, ptr noundef nonnull %16, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %17 unwind label %25

17:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  %18 = getelementptr inbounds i8, ptr %4, i64 16
  store i64 1, ptr %18, align 16, !tbaa !11
  br label %27

19:                                               ; preds = %._crit_edge42
  %20 = getelementptr inbounds i8, ptr %4, i64 648
  %21 = load i64, ptr %20, align 8, !tbaa !11
  %22 = getelementptr inbounds i8, ptr %4, i64 664
  %23 = load i64, ptr %22, align 8, !tbaa !11
  %24 = add nsw i64 %23, %21
  call void @llvm.lifetime.end.p0(i64 672, ptr nonnull %4) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #4
  ret i64 %24

25:                                               ; preds = %._crit_edge
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 672, ptr nonnull %4) #4
  br label %92

27:                                               ; preds = %17, %._crit_edge42
  %indvars.iv = phi i64 [ 1, %17 ], [ %indvars.iv.next, %._crit_edge42 ]
  %28 = add nsw i64 %indvars.iv, -1
  %29 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %28)
  %30 = load i8, ptr %29, align 1, !tbaa !13
  %31 = icmp eq i8 %30, 52
  br i1 %31, label %36, label %32

32:                                               ; preds = %27
  %33 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %28)
  %34 = load i8, ptr %33, align 1, !tbaa !13
  %35 = icmp eq i8 %34, 57
  br i1 %35, label %36, label %43

36:                                               ; preds = %32, %27
  %37 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %4, i64 0, i64 %28, i64 1
  %38 = load i64, ptr %37, align 16, !tbaa !11
  %39 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %4, i64 0, i64 %indvars.iv, i64 1, i64 1
  %40 = load i64, ptr %39, align 8, !tbaa !11
  %41 = add nsw i64 %40, %38
  %42 = getelementptr inbounds i8, ptr %37, i64 8
  br label %52

43:                                               ; preds = %32
  %44 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %4, i64 0, i64 %28, i64 1
  %45 = load i64, ptr %44, align 16, !tbaa !11
  %46 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %4, i64 0, i64 %indvars.iv, i64 1
  %47 = load i64, ptr %46, align 16, !tbaa !11
  %48 = add nsw i64 %47, %45
  store i64 %48, ptr %46, align 16, !tbaa !11
  %49 = getelementptr inbounds i8, ptr %44, i64 8
  %50 = load i64, ptr %49, align 8, !tbaa !11
  %51 = getelementptr inbounds i8, ptr %46, i64 8
  br label %52

52:                                               ; preds = %43, %36
  %.sink = phi ptr [ %51, %43 ], [ %42, %36 ]
  %.sink49 = phi i64 [ %50, %43 ], [ %41, %36 ]
  %.sink47 = phi ptr [ %51, %43 ], [ %39, %36 ]
  %53 = load i64, ptr %.sink, align 8, !tbaa !11
  %54 = add nsw i64 %53, %.sink49
  store i64 %54, ptr %.sink47, align 8, !tbaa !11
  %55 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %28)
  %56 = load i8, ptr %55, align 1, !tbaa !13
  %57 = icmp sgt i8 %56, 48
  br i1 %57, label %.lr.ph41, label %.._crit_edge42_crit_edge

.._crit_edge42_crit_edge:                         ; preds = %52
  %.phi.trans.insert46 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %4, i64 0, i64 %indvars.iv, i64 0, i64 1
  %.pre = load i64, ptr %.phi.trans.insert46, align 8, !tbaa !11
  br label %._crit_edge42

.lr.ph41:                                         ; preds = %52
  %58 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %4, i64 0, i64 %28, i64 1
  %59 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %4, i64 0, i64 %indvars.iv, i64 0, i64 1
  %60 = getelementptr inbounds i8, ptr %58, i64 8
  %61 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %4, i64 0, i64 %indvars.iv
  %62 = getelementptr inbounds i8, ptr %61, i64 8
  %narrow = add nsw i8 %56, -49
  %63 = sext i8 %narrow to i32
  br label %78

._crit_edge42:                                    ; preds = %88, %.._crit_edge42_crit_edge
  %64 = phi i64 [ %.pre, %.._crit_edge42_crit_edge ], [ %90, %88 ]
  %65 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %4, i64 0, i64 %28
  %66 = load i64, ptr %65, align 16, !tbaa !11
  %67 = shl nsw i64 %66, 3
  %68 = getelementptr inbounds [21 x [2 x [2 x i64]]], ptr %4, i64 0, i64 %indvars.iv
  %69 = load i64, ptr %68, align 16, !tbaa !11
  %70 = add nsw i64 %69, %67
  store i64 %70, ptr %68, align 16, !tbaa !11
  %71 = shl nsw i64 %66, 1
  %72 = getelementptr inbounds i8, ptr %68, i64 8
  %73 = add nsw i64 %64, %71
  %74 = getelementptr inbounds i8, ptr %65, i64 8
  %75 = load i64, ptr %74, align 8, !tbaa !11
  %76 = mul nsw i64 %75, 10
  %77 = add nsw i64 %76, %73
  store i64 %77, ptr %72, align 8, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond45.not = icmp eq i64 %indvars.iv.next, 21
  br i1 %exitcond45.not, label %19, label %27, !llvm.loop !14

78:                                               ; preds = %.lr.ph41, %88
  %.039 = phi i32 [ 0, %.lr.ph41 ], [ %91, %88 ]
  switch i32 %.039, label %83 [
    i32 9, label %79
    i32 4, label %79
  ]

79:                                               ; preds = %78, %78
  %80 = load i64, ptr %58, align 16, !tbaa !11
  %81 = load i64, ptr %59, align 8, !tbaa !11
  %82 = add nsw i64 %81, %80
  br label %88

83:                                               ; preds = %78
  %84 = load i64, ptr %58, align 16, !tbaa !11
  %85 = load i64, ptr %61, align 16, !tbaa !11
  %86 = add nsw i64 %85, %84
  store i64 %86, ptr %61, align 16, !tbaa !11
  %87 = load i64, ptr %60, align 8, !tbaa !11
  br label %88

88:                                               ; preds = %79, %83
  %.sink54 = phi ptr [ %60, %79 ], [ %62, %83 ]
  %.sink53 = phi i64 [ %82, %79 ], [ %87, %83 ]
  %.sink51 = phi ptr [ %59, %79 ], [ %62, %83 ]
  %89 = load i64, ptr %.sink54, align 8, !tbaa !11
  %90 = add nsw i64 %89, %.sink53
  store i64 %90, ptr %.sink51, align 8, !tbaa !11
  %91 = add nuw nsw i32 %.039, 1
  %exitcond.not = icmp eq i32 %.039, %63
  br i1 %exitcond.not, label %._crit_edge42, label %78, !llvm.loop !15

92:                                               ; preds = %25, %14
  %.pn = phi { ptr, i32 } [ %15, %14 ], [ %26, %25 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #4
  resume { ptr, i32 } %.pn
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNSt7__cxx119to_stringEx(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i64 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #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 #3 align 2

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


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