; LLVM IR from reyadussalahin/problem-solving :: ad_hoc/implementation/codeforces/F1512C (Solution)

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

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [117 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1

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

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

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

30:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  %33 = 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) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %34 unwind label %43

34:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %35 = load i32, ptr %5, align 4, !tbaa !8
  %36 = load i32, ptr %6, align 4, !tbaa !8
  %37 = add nsw i32 %35, %36
  store i32 %37, ptr %10, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !8
  br label %38

38:                                               ; preds = %84, %34
  %39 = load i32, ptr %11, align 4, !tbaa !8
  %40 = load i32, ptr %10, align 4, !tbaa !8
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %47, label %42

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

43:                                               ; preds = %30
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %8, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %9, align 4
  br label %341

47:                                               ; preds = %38
  %48 = load i32, ptr %11, align 4, !tbaa !8
  %49 = sext i32 %48 to i64
  %50 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %49)
          to label %51 unwind label %79

51:                                               ; preds = %47
  %52 = load i8, ptr %50, align 1, !tbaa !11
  %53 = sext i8 %52 to i32
  %54 = icmp eq i32 %53, 63
  br i1 %54, label %55, label %83

55:                                               ; preds = %51
  %56 = load i32, ptr %10, align 4, !tbaa !8
  %57 = load i32, ptr %11, align 4, !tbaa !8
  %58 = sub nsw i32 %56, %57
  %59 = sub nsw i32 %58, 1
  %60 = sext i32 %59 to i64
  %61 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %60)
          to label %62 unwind label %79

62:                                               ; preds = %55
  %63 = load i8, ptr %61, align 1, !tbaa !11
  %64 = sext i8 %63 to i32
  %65 = icmp ne i32 %64, 63
  br i1 %65, label %66, label %83

66:                                               ; preds = %62
  %67 = load i32, ptr %10, align 4, !tbaa !8
  %68 = load i32, ptr %11, align 4, !tbaa !8
  %69 = sub nsw i32 %67, %68
  %70 = sub nsw i32 %69, 1
  %71 = sext i32 %70 to i64
  %72 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %71)
          to label %73 unwind label %79

73:                                               ; preds = %66
  %74 = load i8, ptr %72, align 1, !tbaa !11
  %75 = load i32, ptr %11, align 4, !tbaa !8
  %76 = sext i32 %75 to i64
  %77 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %76)
          to label %78 unwind label %79

78:                                               ; preds = %73
  store i8 %74, ptr %77, align 1, !tbaa !11
  br label %83

79:                                               ; preds = %73, %66, %55, %47
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %8, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %340

83:                                               ; preds = %78, %62, %51
  br label %84

84:                                               ; preds = %83
  %85 = load i32, ptr %11, align 4, !tbaa !8
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %11, align 4, !tbaa !8
  br label %38, !llvm.loop !12

87:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 1, ptr %12, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !8
  br label %88

88:                                               ; preds = %116, %87
  %89 = load i32, ptr %13, align 4, !tbaa !8
  %90 = load i32, ptr %10, align 4, !tbaa !8
  %91 = icmp slt i32 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  store i32 8, ptr %4, align 4
  br label %119

93:                                               ; preds = %88
  %94 = load i32, ptr %13, align 4, !tbaa !8
  %95 = sext i32 %94 to i64
  %96 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %95)
          to label %97 unwind label %111

97:                                               ; preds = %93
  %98 = load i8, ptr %96, align 1, !tbaa !11
  %99 = sext i8 %98 to i32
  %100 = load i32, ptr %10, align 4, !tbaa !8
  %101 = load i32, ptr %13, align 4, !tbaa !8
  %102 = sub nsw i32 %100, %101
  %103 = sub nsw i32 %102, 1
  %104 = sext i32 %103 to i64
  %105 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %104)
          to label %106 unwind label %111

106:                                              ; preds = %97
  %107 = load i8, ptr %105, align 1, !tbaa !11
  %108 = sext i8 %107 to i32
  %109 = icmp ne i32 %99, %108
  br i1 %109, label %110, label %115

110:                                              ; preds = %106
  store i32 0, ptr %12, align 4, !tbaa !8
  store i32 8, ptr %4, align 4
  br label %119

111:                                              ; preds = %97, %93
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %8, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %339

115:                                              ; preds = %106
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %13, align 4, !tbaa !8
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %13, align 4, !tbaa !8
  br label %88, !llvm.loop !14

119:                                              ; preds = %110, %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %120

120:                                              ; preds = %119
  %121 = load i32, ptr %12, align 4, !tbaa !8
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %132, label %123

123:                                              ; preds = %120
  %124 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
          to label %125 unwind label %128

125:                                              ; preds = %123
  %126 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %124, ptr noundef @.str)
          to label %127 unwind label %128

127:                                              ; preds = %125
  store i32 4, ptr %4, align 4
  br label %332

128:                                              ; preds = %176, %174, %125, %123
  %129 = landingpad { ptr, i32 }
          cleanup
  %130 = extractvalue { ptr, i32 } %129, 0
  store ptr %130, ptr %8, align 8
  %131 = extractvalue { ptr, i32 } %129, 1
  store i32 %131, ptr %9, align 4
  br label %339

132:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !8
  br label %133

133:                                              ; preds = %165, %132
  %134 = load i32, ptr %14, align 4, !tbaa !8
  %135 = load i32, ptr %10, align 4, !tbaa !8
  %136 = icmp slt i32 %134, %135
  br i1 %136, label %138, label %137

137:                                              ; preds = %133
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %168

138:                                              ; preds = %133
  %139 = load i32, ptr %14, align 4, !tbaa !8
  %140 = sext i32 %139 to i64
  %141 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %140)
          to label %142 unwind label %149

142:                                              ; preds = %138
  %143 = load i8, ptr %141, align 1, !tbaa !11
  %144 = sext i8 %143 to i32
  %145 = icmp eq i32 %144, 48
  br i1 %145, label %146, label %153

146:                                              ; preds = %142
  %147 = load i32, ptr %5, align 4, !tbaa !8
  %148 = add nsw i32 %147, -1
  store i32 %148, ptr %5, align 4, !tbaa !8
  br label %153

149:                                              ; preds = %153, %138
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %8, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %339

153:                                              ; preds = %146, %142
  %154 = load i32, ptr %14, align 4, !tbaa !8
  %155 = sext i32 %154 to i64
  %156 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %155)
          to label %157 unwind label %149

157:                                              ; preds = %153
  %158 = load i8, ptr %156, align 1, !tbaa !11
  %159 = sext i8 %158 to i32
  %160 = icmp eq i32 %159, 49
  br i1 %160, label %161, label %164

161:                                              ; preds = %157
  %162 = load i32, ptr %6, align 4, !tbaa !8
  %163 = add nsw i32 %162, -1
  store i32 %163, ptr %6, align 4, !tbaa !8
  br label %164

164:                                              ; preds = %161, %157
  br label %165

165:                                              ; preds = %164
  %166 = load i32, ptr %14, align 4, !tbaa !8
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %14, align 4, !tbaa !8
  br label %133, !llvm.loop !15

168:                                              ; preds = %137
  %169 = load i32, ptr %5, align 4, !tbaa !8
  %170 = icmp slt i32 %169, 0
  br i1 %170, label %174, label %171

171:                                              ; preds = %168
  %172 = load i32, ptr %6, align 4, !tbaa !8
  %173 = icmp slt i32 %172, 0
  br i1 %173, label %174, label %179

174:                                              ; preds = %171, %168
  %175 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
          to label %176 unwind label %128

176:                                              ; preds = %174
  %177 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %175, ptr noundef @.str)
          to label %178 unwind label %128

178:                                              ; preds = %176
  store i32 4, ptr %4, align 4
  br label %332

179:                                              ; preds = %171
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !8
  br label %180

180:                                              ; preds = %201, %179
  %181 = load i32, ptr %16, align 4, !tbaa !8
  %182 = load i32, ptr %10, align 4, !tbaa !8
  %183 = icmp slt i32 %181, %182
  br i1 %183, label %185, label %184

184:                                              ; preds = %180
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %204

185:                                              ; preds = %180
  %186 = load i32, ptr %16, align 4, !tbaa !8
  %187 = sext i32 %186 to i64
  %188 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %187)
          to label %189 unwind label %196

189:                                              ; preds = %185
  %190 = load i8, ptr %188, align 1, !tbaa !11
  %191 = sext i8 %190 to i32
  %192 = icmp eq i32 %191, 63
  br i1 %192, label %193, label %200

193:                                              ; preds = %189
  %194 = load i32, ptr %15, align 4, !tbaa !8
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr %15, align 4, !tbaa !8
  br label %200

196:                                              ; preds = %185
  %197 = landingpad { ptr, i32 }
          cleanup
  %198 = extractvalue { ptr, i32 } %197, 0
  store ptr %198, ptr %8, align 8
  %199 = extractvalue { ptr, i32 } %197, 1
  store i32 %199, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %338

200:                                              ; preds = %193, %189
  br label %201

201:                                              ; preds = %200
  %202 = load i32, ptr %16, align 4, !tbaa !8
  %203 = add nsw i32 %202, 1
  store i32 %203, ptr %16, align 4, !tbaa !8
  br label %180, !llvm.loop !16

204:                                              ; preds = %184
  %205 = load i32, ptr %5, align 4, !tbaa !8
  %206 = load i32, ptr %6, align 4, !tbaa !8
  %207 = add nsw i32 %205, %206
  %208 = load i32, ptr %15, align 4, !tbaa !8
  %209 = icmp eq i32 %207, %208
  br i1 %209, label %210, label %211

210:                                              ; preds = %204
  br label %213

211:                                              ; preds = %204
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 68, ptr noundef @__PRETTY_FUNCTION__.main) #7
  unreachable

212:                                              ; No predecessors!
  br label %213

213:                                              ; preds = %212, %210
  %214 = load i32, ptr %5, align 4, !tbaa !8
  %215 = load i32, ptr %6, align 4, !tbaa !8
  %216 = add nsw i32 %214, %215
  %217 = and i32 %216, 1
  %218 = icmp ne i32 %217, 0
  br i1 %218, label %232, label %219

219:                                              ; preds = %213
  %220 = load i32, ptr %5, align 4, !tbaa !8
  %221 = and i32 %220, 1
  %222 = icmp ne i32 %221, 0
  br i1 %222, label %223, label %232

223:                                              ; preds = %219
  %224 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
          to label %225 unwind label %228

225:                                              ; preds = %223
  %226 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %224, ptr noundef @.str)
          to label %227 unwind label %228

227:                                              ; preds = %225
  store i32 4, ptr %4, align 4
  br label %331

228:                                              ; preds = %328, %326, %225, %223
  %229 = landingpad { ptr, i32 }
          cleanup
  %230 = extractvalue { ptr, i32 } %229, 0
  store ptr %230, ptr %8, align 8
  %231 = extractvalue { ptr, i32 } %229, 1
  store i32 %231, ptr %9, align 4
  br label %338

232:                                              ; preds = %219, %213
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !8
  br label %233

233:                                              ; preds = %323, %232
  %234 = load i32, ptr %17, align 4, !tbaa !8
  %235 = load i32, ptr %10, align 4, !tbaa !8
  %236 = icmp slt i32 %234, %235
  br i1 %236, label %238, label %237

237:                                              ; preds = %233
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %326

238:                                              ; preds = %233
  %239 = load i32, ptr %17, align 4, !tbaa !8
  %240 = sext i32 %239 to i64
  %241 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %240)
          to label %242 unwind label %270

242:                                              ; preds = %238
  %243 = load i8, ptr %241, align 1, !tbaa !11
  %244 = sext i8 %243 to i32
  %245 = icmp eq i32 %244, 63
  br i1 %245, label %246, label %322

246:                                              ; preds = %242
  %247 = load i32, ptr %17, align 4, !tbaa !8
  %248 = load i32, ptr %10, align 4, !tbaa !8
  %249 = load i32, ptr %17, align 4, !tbaa !8
  %250 = sub nsw i32 %248, %249
  %251 = sub nsw i32 %250, 1
  %252 = icmp eq i32 %247, %251
  br i1 %252, label %253, label %289

253:                                              ; preds = %246
  %254 = load i32, ptr %5, align 4, !tbaa !8
  %255 = icmp eq i32 %254, 1
  br i1 %255, label %256, label %274

256:                                              ; preds = %253
  %257 = load i32, ptr %10, align 4, !tbaa !8
  %258 = load i32, ptr %17, align 4, !tbaa !8
  %259 = sub nsw i32 %257, %258
  %260 = sub nsw i32 %259, 1
  %261 = sext i32 %260 to i64
  %262 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %261)
          to label %263 unwind label %270

263:                                              ; preds = %256
  store i8 48, ptr %262, align 1, !tbaa !11
  %264 = load i32, ptr %17, align 4, !tbaa !8
  %265 = sext i32 %264 to i64
  %266 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %265)
          to label %267 unwind label %270

267:                                              ; preds = %263
  store i8 48, ptr %266, align 1, !tbaa !11
  %268 = load i32, ptr %5, align 4, !tbaa !8
  %269 = sub nsw i32 %268, 1
  store i32 %269, ptr %5, align 4, !tbaa !8
  br label %288

270:                                              ; preds = %313, %306, %299, %292, %281, %274, %263, %256, %238
  %271 = landingpad { ptr, i32 }
          cleanup
  %272 = extractvalue { ptr, i32 } %271, 0
  store ptr %272, ptr %8, align 8
  %273 = extractvalue { ptr, i32 } %271, 1
  store i32 %273, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %338

274:                                              ; preds = %253
  %275 = load i32, ptr %10, align 4, !tbaa !8
  %276 = load i32, ptr %17, align 4, !tbaa !8
  %277 = sub nsw i32 %275, %276
  %278 = sub nsw i32 %277, 1
  %279 = sext i32 %278 to i64
  %280 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %279)
          to label %281 unwind label %270

281:                                              ; preds = %274
  store i8 49, ptr %280, align 1, !tbaa !11
  %282 = load i32, ptr %17, align 4, !tbaa !8
  %283 = sext i32 %282 to i64
  %284 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %283)
          to label %285 unwind label %270

285:                                              ; preds = %281
  store i8 49, ptr %284, align 1, !tbaa !11
  %286 = load i32, ptr %6, align 4, !tbaa !8
  %287 = sub nsw i32 %286, 1
  store i32 %287, ptr %6, align 4, !tbaa !8
  br label %288

288:                                              ; preds = %285, %267
  br label %321

289:                                              ; preds = %246
  %290 = load i32, ptr %5, align 4, !tbaa !8
  %291 = icmp sgt i32 %290, 1
  br i1 %291, label %292, label %306

292:                                              ; preds = %289
  %293 = load i32, ptr %10, align 4, !tbaa !8
  %294 = load i32, ptr %17, align 4, !tbaa !8
  %295 = sub nsw i32 %293, %294
  %296 = sub nsw i32 %295, 1
  %297 = sext i32 %296 to i64
  %298 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %297)
          to label %299 unwind label %270

299:                                              ; preds = %292
  store i8 48, ptr %298, align 1, !tbaa !11
  %300 = load i32, ptr %17, align 4, !tbaa !8
  %301 = sext i32 %300 to i64
  %302 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %301)
          to label %303 unwind label %270

303:                                              ; preds = %299
  store i8 48, ptr %302, align 1, !tbaa !11
  %304 = load i32, ptr %5, align 4, !tbaa !8
  %305 = sub nsw i32 %304, 2
  store i32 %305, ptr %5, align 4, !tbaa !8
  br label %320

306:                                              ; preds = %289
  %307 = load i32, ptr %10, align 4, !tbaa !8
  %308 = load i32, ptr %17, align 4, !tbaa !8
  %309 = sub nsw i32 %307, %308
  %310 = sub nsw i32 %309, 1
  %311 = sext i32 %310 to i64
  %312 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %311)
          to label %313 unwind label %270

313:                                              ; preds = %306
  store i8 49, ptr %312, align 1, !tbaa !11
  %314 = load i32, ptr %17, align 4, !tbaa !8
  %315 = sext i32 %314 to i64
  %316 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %315)
          to label %317 unwind label %270

317:                                              ; preds = %313
  store i8 49, ptr %316, align 1, !tbaa !11
  %318 = load i32, ptr %6, align 4, !tbaa !8
  %319 = sub nsw i32 %318, 2
  store i32 %319, ptr %6, align 4, !tbaa !8
  br label %320

320:                                              ; preds = %317, %303
  br label %321

321:                                              ; preds = %320, %288
  br label %322

322:                                              ; preds = %321, %242
  br label %323

323:                                              ; preds = %322
  %324 = load i32, ptr %17, align 4, !tbaa !8
  %325 = add nsw i32 %324, 1
  store i32 %325, ptr %17, align 4, !tbaa !8
  br label %233, !llvm.loop !17

326:                                              ; preds = %237
  %327 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %328 unwind label %228

328:                                              ; preds = %326
  %329 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %327, ptr noundef @.str)
          to label %330 unwind label %228

330:                                              ; preds = %328
  store i32 0, ptr %4, align 4
  br label %331

331:                                              ; preds = %330, %227
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %332

332:                                              ; preds = %331, %178, %127
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  %333 = load i32, ptr %4, align 4
  switch i32 %333, label %349 [
    i32 0, label %334
    i32 4, label %335
  ]

334:                                              ; preds = %332
  br label %335

335:                                              ; preds = %334, %332
  %336 = load i32, ptr %3, align 4, !tbaa !8
  %337 = add nsw i32 %336, 1
  store i32 %337, ptr %3, align 4, !tbaa !8
  br label %25, !llvm.loop !18

338:                                              ; preds = %270, %228, %196
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %339

339:                                              ; preds = %338, %149, %128, %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %340

340:                                              ; preds = %339, %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %341

341:                                              ; preds = %340, %43
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %344

342:                                              ; preds = %29
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %343 = load i32, ptr %1, align 4
  ret i32 %343

344:                                              ; preds = %341
  %345 = load ptr, ptr %8, align 8
  %346 = load i32, ptr %9, align 4
  %347 = insertvalue { ptr, i32 } poison, ptr %345, 0
  %348 = insertvalue { ptr, i32 } %347, i32 %346, 1
  resume { ptr, i32 } %348

349:                                              ; preds = %332
  unreachable
}

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #5

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

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

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

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [117 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1

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

._crit_edge90:                                    ; preds = %120, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

.lr.ph89:                                         ; preds = %0, %120
  %.06187 = phi i32 [ %121, %120 ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  %16 = 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) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %17 unwind label %24

17:                                               ; preds = %.lr.ph89
  %18 = load i32, ptr %2, align 4, !tbaa !8
  %19 = load i32, ptr %3, align 4, !tbaa !8
  %20 = add nsw i32 %19, %18
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph.preheader, label %.critedge._crit_edge

.lr.ph.preheader:                                 ; preds = %17
  %22 = zext nneg i32 %20 to i64
  %wide.trip.count = zext nneg i32 %20 to i64
  br label %.lr.ph

.preheader75:                                     ; preds = %38
  br i1 %21, label %.lr.ph78.preheader, label %.critedge._crit_edge

.lr.ph78.preheader:                               ; preds = %.preheader75
  %23 = zext nneg i32 %20 to i64
  %wide.trip.count95 = zext nneg i32 %20 to i64
  br label %.lr.ph78

24:                                               ; preds = %.lr.ph89
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %124

.lr.ph:                                           ; preds = %.lr.ph.preheader, %38
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %38 ]
  %26 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %indvars.iv)
  %27 = load i8, ptr %26, align 1, !tbaa !11
  %28 = icmp eq i8 %27, 63
  br i1 %28, label %29, label %38

29:                                               ; preds = %.lr.ph
  %30 = xor i64 %indvars.iv, -1
  %31 = add nsw i64 %22, %30
  %32 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %31)
  %33 = load i8, ptr %32, align 1, !tbaa !11
  %.not72 = icmp eq i8 %33, 63
  br i1 %.not72, label %38, label %34

34:                                               ; preds = %29
  %35 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %31)
  %36 = load i8, ptr %35, align 1, !tbaa !11
  %37 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %indvars.iv)
  store i8 %36, ptr %37, align 1, !tbaa !11
  br label %38

38:                                               ; preds = %.lr.ph, %29, %34
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader75, label %.lr.ph, !llvm.loop !12

39:                                               ; preds = %.lr.ph78
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %exitcond96.not = icmp eq i64 %indvars.iv.next93, %wide.trip.count95
  br i1 %exitcond96.not, label %.critedge.preheader, label %.lr.ph78, !llvm.loop !14

.critedge.preheader:                              ; preds = %39
  br i1 %21, label %.lr.ph80.preheader, label %.critedge._crit_edge

.lr.ph80.preheader:                               ; preds = %.critedge.preheader
  %wide.trip.count100 = zext nneg i32 %20 to i64
  br label %.lr.ph80

.lr.ph78:                                         ; preds = %.lr.ph78.preheader, %39
  %indvars.iv92 = phi i64 [ 0, %.lr.ph78.preheader ], [ %indvars.iv.next93, %39 ]
  %40 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %indvars.iv92)
  %41 = load i8, ptr %40, align 1, !tbaa !11
  %42 = xor i64 %indvars.iv92, -1
  %43 = add nsw i64 %23, %42
  %44 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %43)
  %45 = load i8, ptr %44, align 1, !tbaa !11
  %.not = icmp eq i8 %41, %45
  br i1 %.not, label %39, label %.invoke114

46:                                               ; preds = %.invoke114, %.invoke
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %124

.critedge._crit_edge:                             ; preds = %.critedge, %17, %.preheader75, %.critedge.preheader
  %48 = load i32, ptr %2, align 4, !tbaa !8
  %49 = icmp slt i32 %48, 0
  %50 = load i32, ptr %3, align 4
  %51 = icmp slt i32 %50, 0
  %or.cond = select i1 %49, i1 true, i1 %51
  br i1 %or.cond, label %.invoke114, label %.preheader74

.preheader74:                                     ; preds = %.critedge._crit_edge
  br i1 %21, label %.lr.ph83.preheader, label %._crit_edge

.lr.ph83.preheader:                               ; preds = %.preheader74
  %wide.trip.count105 = zext nneg i32 %20 to i64
  br label %.lr.ph83

.lr.ph80:                                         ; preds = %.lr.ph80.preheader, %.critedge
  %indvars.iv97 = phi i64 [ 0, %.lr.ph80.preheader ], [ %indvars.iv.next98, %.critedge ]
  %52 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %indvars.iv97)
  %53 = load i8, ptr %52, align 1, !tbaa !11
  %54 = icmp eq i8 %53, 48
  br i1 %54, label %55, label %58

55:                                               ; preds = %.lr.ph80
  %56 = load i32, ptr %2, align 4, !tbaa !8
  %57 = add nsw i32 %56, -1
  store i32 %57, ptr %2, align 4, !tbaa !8
  br label %58

58:                                               ; preds = %55, %.lr.ph80
  %59 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %indvars.iv97)
  %60 = load i8, ptr %59, align 1, !tbaa !11
  %61 = icmp eq i8 %60, 49
  br i1 %61, label %62, label %.critedge

62:                                               ; preds = %58
  %63 = load i32, ptr %3, align 4, !tbaa !8
  %64 = add nsw i32 %63, -1
  store i32 %64, ptr %3, align 4, !tbaa !8
  br label %.critedge

.critedge:                                        ; preds = %58, %62
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %exitcond101.not = icmp eq i64 %indvars.iv.next98, %wide.trip.count100
  br i1 %exitcond101.not, label %.critedge._crit_edge, label %.lr.ph80, !llvm.loop !15

.invoke114:                                       ; preds = %.lr.ph78, %.critedge._crit_edge
  %65 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
          to label %.invoke unwind label %46

.invoke:                                          ; preds = %.invoke114
  %66 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %65, ptr noundef nonnull @.str)
          to label %120 unwind label %46

._crit_edge.loopexit:                             ; preds = %.lr.ph83
  %.pre = load i32, ptr %2, align 4, !tbaa !8
  %.pre112 = load i32, ptr %3, align 4, !tbaa !8
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader74
  %67 = phi i32 [ %50, %.preheader74 ], [ %.pre112, %._crit_edge.loopexit ]
  %68 = phi i32 [ %48, %.preheader74 ], [ %.pre, %._crit_edge.loopexit ]
  %.052.lcssa = phi i32 [ 0, %.preheader74 ], [ %spec.select, %._crit_edge.loopexit ]
  %69 = add nsw i32 %67, %68
  %70 = icmp eq i32 %69, %.052.lcssa
  br i1 %70, label %76, label %75

.lr.ph83:                                         ; preds = %.lr.ph83.preheader, %.lr.ph83
  %indvars.iv102 = phi i64 [ 0, %.lr.ph83.preheader ], [ %indvars.iv.next103, %.lr.ph83 ]
  %.05281 = phi i32 [ 0, %.lr.ph83.preheader ], [ %spec.select, %.lr.ph83 ]
  %71 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %indvars.iv102)
  %72 = load i8, ptr %71, align 1, !tbaa !11
  %73 = icmp eq i8 %72, 63
  %74 = zext i1 %73 to i32
  %spec.select = add nuw nsw i32 %.05281, %74
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %exitcond106.not = icmp eq i64 %indvars.iv.next103, %wide.trip.count105
  br i1 %exitcond106.not, label %._crit_edge.loopexit, label %.lr.ph83, !llvm.loop !16

75:                                               ; preds = %._crit_edge
  call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 68, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7
  unreachable

76:                                               ; preds = %._crit_edge
  %77 = and i32 %.052.lcssa, 1
  %.not68 = icmp ne i32 %77, 0
  %78 = and i32 %68, 1
  %.not69 = icmp eq i32 %78, 0
  %or.cond73 = or i1 %.not69, %.not68
  br i1 %or.cond73, label %.preheader, label %80

.preheader:                                       ; preds = %76
  br i1 %21, label %.lr.ph85.preheader, label %._crit_edge86

.lr.ph85.preheader:                               ; preds = %.preheader
  %79 = zext nneg i32 %20 to i64
  %wide.trip.count110 = zext nneg i32 %20 to i64
  br label %.lr.ph85

80:                                               ; preds = %76
  %81 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
          to label %.invoke113 unwind label %82

82:                                               ; preds = %.invoke113, %._crit_edge86, %80
  %83 = landingpad { ptr, i32 }
          cleanup
  br label %124

._crit_edge86:                                    ; preds = %117, %.preheader
  %84 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %.invoke113 unwind label %82

.lr.ph85:                                         ; preds = %.lr.ph85.preheader, %117
  %indvars.iv107 = phi i64 [ 0, %.lr.ph85.preheader ], [ %indvars.iv.next108, %117 ]
  %85 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %indvars.iv107)
  %86 = load i8, ptr %85, align 1, !tbaa !11
  %87 = icmp eq i8 %86, 63
  br i1 %87, label %88, label %117

88:                                               ; preds = %.lr.ph85
  %indvars109 = trunc i64 %indvars.iv107 to i32
  %89 = xor i64 %indvars.iv107, -1
  %90 = xor i32 %indvars109, -1
  %91 = add nsw i64 %79, %89
  %92 = add nsw i32 %20, %90
  %93 = zext i32 %92 to i64
  %94 = icmp eq i64 %indvars.iv107, %93
  %95 = load i32, ptr %2, align 4, !tbaa !8
  %96 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %91)
  br i1 %94, label %97, label %107

97:                                               ; preds = %88
  %98 = icmp eq i32 %95, 1
  br i1 %98, label %99, label %103

99:                                               ; preds = %97
  store i8 48, ptr %96, align 1, !tbaa !11
  %100 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %indvars.iv107)
  store i8 48, ptr %100, align 1, !tbaa !11
  %101 = load i32, ptr %2, align 4, !tbaa !8
  %102 = add nsw i32 %101, -1
  store i32 %102, ptr %2, align 4, !tbaa !8
  br label %117

103:                                              ; preds = %97
  store i8 49, ptr %96, align 1, !tbaa !11
  %104 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %indvars.iv107)
  store i8 49, ptr %104, align 1, !tbaa !11
  %105 = load i32, ptr %3, align 4, !tbaa !8
  %106 = add nsw i32 %105, -1
  store i32 %106, ptr %3, align 4, !tbaa !8
  br label %117

107:                                              ; preds = %88
  %108 = icmp sgt i32 %95, 1
  br i1 %108, label %109, label %113

109:                                              ; preds = %107
  store i8 48, ptr %96, align 1, !tbaa !11
  %110 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %indvars.iv107)
  store i8 48, ptr %110, align 1, !tbaa !11
  %111 = load i32, ptr %2, align 4, !tbaa !8
  %112 = add nsw i32 %111, -2
  store i32 %112, ptr %2, align 4, !tbaa !8
  br label %117

113:                                              ; preds = %107
  store i8 49, ptr %96, align 1, !tbaa !11
  %114 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %indvars.iv107)
  store i8 49, ptr %114, align 1, !tbaa !11
  %115 = load i32, ptr %3, align 4, !tbaa !8
  %116 = add nsw i32 %115, -2
  store i32 %116, ptr %3, align 4, !tbaa !8
  br label %117

117:                                              ; preds = %.lr.ph85, %109, %113, %99, %103
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %exitcond111.not = icmp eq i64 %indvars.iv.next108, %wide.trip.count110
  br i1 %exitcond111.not, label %._crit_edge86, label %.lr.ph85, !llvm.loop !17

.invoke113:                                       ; preds = %80, %._crit_edge86
  %118 = phi ptr [ %84, %._crit_edge86 ], [ %81, %80 ]
  %119 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %118, ptr noundef nonnull @.str)
          to label %120 unwind label %82

120:                                              ; preds = %.invoke113, %.invoke
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %121 = add nuw nsw i32 %.06187, 1
  %122 = load i32, ptr %1, align 4, !tbaa !8
  %123 = icmp slt i32 %121, %122
  br i1 %123, label %.lr.ph89, label %._crit_edge90, !llvm.loop !18

124:                                              ; preds = %46, %82, %24
  %.pn.pn = phi { ptr, i32 } [ %25, %24 ], [ %47, %46 ], [ %83, %82 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn.pn
}

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

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

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

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


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