; LLVM IR from DionysiosB/CodeForces :: 0500-0599 (570C-Replacement)

; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::vector" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::allocator.3" = type { i8 }
%"struct.std::_Bit_reference" = type { ptr, i64 }

@.str = external hidden unnamed_addr constant [9 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.1 = external hidden unnamed_addr constant [5 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 i8, align 1
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca i8, align 1
  %10 = alloca %"class.std::allocator.3", align 1
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca %"struct.std::_Bit_reference", align 8
  %15 = alloca %"struct.std::_Bit_reference", align 8
  %16 = alloca i64, align 8
  %17 = alloca i8, align 1
  %18 = alloca i8, align 1
  %19 = alloca i8, align 1
  %20 = alloca %"struct.std::_Bit_reference", align 8
  %21 = alloca %"struct.std::_Bit_reference", align 8
  %22 = alloca %"struct.std::_Bit_reference", align 8
  %23 = alloca %"struct.std::_Bit_reference", align 8
  %24 = alloca %"struct.std::_Bit_reference", align 8
  %25 = alloca %"struct.std::_Bit_reference", align 8
  %26 = alloca %"struct.std::_Bit_reference", align 8
  %27 = alloca %"struct.std::_Bit_reference", align 8
  %28 = alloca %"struct.std::_Bit_reference", align 8
  %29 = alloca %"struct.std::_Bit_reference", align 8
  %30 = alloca %"struct.std::_Bit_reference", align 8
  %31 = alloca %"struct.std::_Bit_reference", align 8
  %32 = alloca %"struct.std::_Bit_reference", align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 1, ptr %2) #6
  store i8 46, ptr %2, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3, ptr noundef %4)
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  %34 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_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) %5)
          to label %35 unwind label %44

35:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 40, ptr %8) #6
  %36 = load i64, ptr %3, align 8, !tbaa !8
  %37 = add nsw i64 %36, 2
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #6
  store i8 0, ptr %9, align 1, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #6
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %8, i64 noundef %37, ptr noundef nonnull align 1 dereferenceable(1) %9, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %38 unwind label %48

38:                                               ; preds = %35
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i64 0, ptr %11, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 0, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store i64 0, ptr %13, align 8, !tbaa !8
  br label %39

39:                                               ; preds = %100, %38
  %40 = load i64, ptr %13, align 8, !tbaa !8
  %41 = load i64, ptr %3, align 8, !tbaa !8
  %42 = icmp slt i64 %40, %41
  br i1 %42, label %52, label %43

43:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %104

44:                                               ; preds = %0
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %6, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %7, align 4
  br label %405

48:                                               ; preds = %35
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %6, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %7, align 4
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  br label %404

52:                                               ; preds = %39
  %53 = load i64, ptr %13, align 8, !tbaa !8
  %54 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %5, i64 noundef %53)
          to label %55 unwind label %86

55:                                               ; preds = %52
  %56 = load i8, ptr %54, align 1, !tbaa !5
  %57 = sext i8 %56 to i32
  %58 = load i8, ptr %2, align 1, !tbaa !5
  %59 = sext i8 %58 to i32
  %60 = icmp eq i32 %57, %59
  br i1 %60, label %61, label %99

61:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  %62 = load i64, ptr %13, align 8, !tbaa !8
  %63 = add nsw i64 %62, 1
  %64 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %8, i64 noundef %63)
          to label %65 unwind label %90

65:                                               ; preds = %61
  %66 = getelementptr inbounds { ptr, i64 }, ptr %14, i32 0, i32 0
  %67 = extractvalue { ptr, i64 } %64, 0
  store ptr %67, ptr %66, align 8
  %68 = getelementptr inbounds { ptr, i64 }, ptr %14, i32 0, i32 1
  %69 = extractvalue { ptr, i64 } %64, 1
  store i64 %69, ptr %68, align 8
  %70 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %14, i1 noundef zeroext true) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  %71 = load i64, ptr %11, align 8, !tbaa !8
  %72 = add nsw i64 %71, 1
  store i64 %72, ptr %11, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #6
  %73 = load i64, ptr %13, align 8, !tbaa !8
  %74 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %8, i64 noundef %73)
          to label %75 unwind label %94

75:                                               ; preds = %65
  %76 = getelementptr inbounds { ptr, i64 }, ptr %15, i32 0, i32 0
  %77 = extractvalue { ptr, i64 } %74, 0
  store ptr %77, ptr %76, align 8
  %78 = getelementptr inbounds { ptr, i64 }, ptr %15, i32 0, i32 1
  %79 = extractvalue { ptr, i64 } %74, 1
  store i64 %79, ptr %78, align 8
  %80 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %15) #6
  %81 = zext i1 %80 to i32
  %82 = icmp eq i32 %81, 0
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  br i1 %82, label %83, label %98

83:                                               ; preds = %75
  %84 = load i64, ptr %12, align 8, !tbaa !8
  %85 = add nsw i64 %84, 1
  store i64 %85, ptr %12, align 8, !tbaa !8
  br label %98

86:                                               ; preds = %52
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %6, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %7, align 4
  br label %103

90:                                               ; preds = %61
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %6, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  br label %103

94:                                               ; preds = %65
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %6, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  br label %103

98:                                               ; preds = %83, %75
  br label %99

99:                                               ; preds = %98, %55
  br label %100

100:                                              ; preds = %99
  %101 = load i64, ptr %13, align 8, !tbaa !8
  %102 = add nsw i64 %101, 1
  store i64 %102, ptr %13, align 8, !tbaa !8
  br label %39, !llvm.loop !12

103:                                              ; preds = %94, %90, %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %403

104:                                              ; preds = %43
  br label %105

105:                                              ; preds = %397, %104
  %106 = load i64, ptr %4, align 8, !tbaa !8
  %107 = add nsw i64 %106, -1
  store i64 %107, ptr %4, align 8, !tbaa !8
  %108 = icmp ne i64 %106, 0
  br i1 %108, label %109, label %401

109:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #6
  %110 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %111 unwind label %177

111:                                              ; preds = %109
  %112 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) %110, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %113 unwind label %177

113:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #6
  %114 = load i64, ptr %16, align 8, !tbaa !8
  %115 = sub nsw i64 %114, 1
  %116 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %5, i64 noundef %115)
          to label %117 unwind label %181

117:                                              ; preds = %113
  %118 = load i8, ptr %116, align 1, !tbaa !5
  %119 = sext i8 %118 to i32
  %120 = load i8, ptr %2, align 1, !tbaa !5
  %121 = sext i8 %120 to i32
  %122 = icmp eq i32 %119, %121
  %123 = zext i1 %122 to i8
  store i8 %123, ptr %18, align 1, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #6
  %124 = load i8, ptr %17, align 1, !tbaa !5
  %125 = sext i8 %124 to i32
  %126 = load i8, ptr %2, align 1, !tbaa !5
  %127 = sext i8 %126 to i32
  %128 = icmp eq i32 %125, %127
  %129 = zext i1 %128 to i8
  store i8 %129, ptr %19, align 1, !tbaa !10
  %130 = load i8, ptr %17, align 1, !tbaa !5
  %131 = load i64, ptr %16, align 8, !tbaa !8
  %132 = sub nsw i64 %131, 1
  %133 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %5, i64 noundef %132)
          to label %134 unwind label %185

134:                                              ; preds = %117
  store i8 %130, ptr %133, align 1, !tbaa !5
  %135 = load i8, ptr %19, align 1, !tbaa !10, !range !14, !noundef !15
  %136 = trunc i8 %135 to i1
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #6
  %137 = load i64, ptr %16, align 8, !tbaa !8
  %138 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %8, i64 noundef %137)
          to label %139 unwind label %189

139:                                              ; preds = %134
  %140 = getelementptr inbounds { ptr, i64 }, ptr %20, i32 0, i32 0
  %141 = extractvalue { ptr, i64 } %138, 0
  store ptr %141, ptr %140, align 8
  %142 = getelementptr inbounds { ptr, i64 }, ptr %20, i32 0, i32 1
  %143 = extractvalue { ptr, i64 } %138, 1
  store i64 %143, ptr %142, align 8
  %144 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %20, i1 noundef zeroext %136) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #6
  %145 = load i8, ptr %18, align 1, !tbaa !10, !range !14, !noundef !15
  %146 = trunc i8 %145 to i1
  br i1 %146, label %147, label %276

147:                                              ; preds = %139
  %148 = load i8, ptr %19, align 1, !tbaa !10, !range !14, !noundef !15
  %149 = trunc i8 %148 to i1
  br i1 %149, label %276, label %150

150:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #6
  %151 = load i64, ptr %16, align 8, !tbaa !8
  %152 = sub nsw i64 %151, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #6
  %153 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %8, i64 noundef %152)
          to label %154 unwind label %193

154:                                              ; preds = %150
  %155 = getelementptr inbounds { ptr, i64 }, ptr %21, i32 0, i32 0
  %156 = extractvalue { ptr, i64 } %153, 0
  store ptr %156, ptr %155, align 8
  %157 = getelementptr inbounds { ptr, i64 }, ptr %21, i32 0, i32 1
  %158 = extractvalue { ptr, i64 } %153, 1
  store i64 %158, ptr %157, align 8
  %159 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %21) #6
  br i1 %159, label %160, label %170

160:                                              ; preds = %154
  %161 = load i64, ptr %16, align 8, !tbaa !8
  %162 = add nsw i64 %161, 1
  %163 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %8, i64 noundef %162)
          to label %164 unwind label %197

164:                                              ; preds = %160
  %165 = getelementptr inbounds { ptr, i64 }, ptr %22, i32 0, i32 0
  %166 = extractvalue { ptr, i64 } %163, 0
  store ptr %166, ptr %165, align 8
  %167 = getelementptr inbounds { ptr, i64 }, ptr %22, i32 0, i32 1
  %168 = extractvalue { ptr, i64 } %163, 1
  store i64 %168, ptr %167, align 8
  %169 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %22) #6
  br label %170

170:                                              ; preds = %164, %154
  %171 = phi i1 [ false, %154 ], [ %169, %164 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #6
  br i1 %171, label %172, label %202

172:                                              ; preds = %170
  %173 = load i64, ptr %11, align 8, !tbaa !8
  %174 = add nsw i64 %173, -1
  store i64 %174, ptr %11, align 8, !tbaa !8
  %175 = load i64, ptr %12, align 8, !tbaa !8
  %176 = add nsw i64 %175, 1
  store i64 %176, ptr %12, align 8, !tbaa !8
  br label %275

177:                                              ; preds = %111, %109
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %6, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %7, align 4
  br label %400

181:                                              ; preds = %113
  %182 = landingpad { ptr, i32 }
          cleanup
  %183 = extractvalue { ptr, i32 } %182, 0
  store ptr %183, ptr %6, align 8
  %184 = extractvalue { ptr, i32 } %182, 1
  store i32 %184, ptr %7, align 4
  br label %399

185:                                              ; preds = %392, %117
  %186 = landingpad { ptr, i32 }
          cleanup
  %187 = extractvalue { ptr, i32 } %186, 0
  store ptr %187, ptr %6, align 8
  %188 = extractvalue { ptr, i32 } %186, 1
  store i32 %188, ptr %7, align 4
  br label %398

189:                                              ; preds = %134
  %190 = landingpad { ptr, i32 }
          cleanup
  %191 = extractvalue { ptr, i32 } %190, 0
  store ptr %191, ptr %6, align 8
  %192 = extractvalue { ptr, i32 } %190, 1
  store i32 %192, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #6
  br label %398

193:                                              ; preds = %150
  %194 = landingpad { ptr, i32 }
          cleanup
  %195 = extractvalue { ptr, i32 } %194, 0
  store ptr %195, ptr %6, align 8
  %196 = extractvalue { ptr, i32 } %194, 1
  store i32 %196, ptr %7, align 4
  br label %201

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

201:                                              ; preds = %197, %193
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #6
  br label %398

202:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #6
  %203 = load i64, ptr %16, align 8, !tbaa !8
  %204 = sub nsw i64 %203, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #6
  %205 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %8, i64 noundef %204)
          to label %206 unwind label %227

206:                                              ; preds = %202
  %207 = getelementptr inbounds { ptr, i64 }, ptr %23, i32 0, i32 0
  %208 = extractvalue { ptr, i64 } %205, 0
  store ptr %208, ptr %207, align 8
  %209 = getelementptr inbounds { ptr, i64 }, ptr %23, i32 0, i32 1
  %210 = extractvalue { ptr, i64 } %205, 1
  store i64 %210, ptr %209, align 8
  %211 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %23) #6
  br i1 %211, label %222, label %212

212:                                              ; preds = %206
  %213 = load i64, ptr %16, align 8, !tbaa !8
  %214 = add nsw i64 %213, 1
  %215 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %8, i64 noundef %214)
          to label %216 unwind label %231

216:                                              ; preds = %212
  %217 = getelementptr inbounds { ptr, i64 }, ptr %24, i32 0, i32 0
  %218 = extractvalue { ptr, i64 } %215, 0
  store ptr %218, ptr %217, align 8
  %219 = getelementptr inbounds { ptr, i64 }, ptr %24, i32 0, i32 1
  %220 = extractvalue { ptr, i64 } %215, 1
  store i64 %220, ptr %219, align 8
  %221 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %24) #6
  br label %222

222:                                              ; preds = %216, %206
  %223 = phi i1 [ true, %206 ], [ %221, %216 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #6
  br i1 %223, label %224, label %236

224:                                              ; preds = %222
  %225 = load i64, ptr %11, align 8, !tbaa !8
  %226 = add nsw i64 %225, -1
  store i64 %226, ptr %11, align 8, !tbaa !8
  br label %274

227:                                              ; preds = %202
  %228 = landingpad { ptr, i32 }
          cleanup
  %229 = extractvalue { ptr, i32 } %228, 0
  store ptr %229, ptr %6, align 8
  %230 = extractvalue { ptr, i32 } %228, 1
  store i32 %230, ptr %7, align 4
  br label %235

231:                                              ; preds = %212
  %232 = landingpad { ptr, i32 }
          cleanup
  %233 = extractvalue { ptr, i32 } %232, 0
  store ptr %233, ptr %6, align 8
  %234 = extractvalue { ptr, i32 } %232, 1
  store i32 %234, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #6
  br label %235

235:                                              ; preds = %231, %227
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #6
  br label %398

236:                                              ; preds = %222
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #6
  %237 = load i64, ptr %16, align 8, !tbaa !8
  %238 = sub nsw i64 %237, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #6
  %239 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %8, i64 noundef %238)
          to label %240 unwind label %264

240:                                              ; preds = %236
  %241 = getelementptr inbounds { ptr, i64 }, ptr %25, i32 0, i32 0
  %242 = extractvalue { ptr, i64 } %239, 0
  store ptr %242, ptr %241, align 8
  %243 = getelementptr inbounds { ptr, i64 }, ptr %25, i32 0, i32 1
  %244 = extractvalue { ptr, i64 } %239, 1
  store i64 %244, ptr %243, align 8
  %245 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %25) #6
  br i1 %245, label %257, label %246

246:                                              ; preds = %240
  %247 = load i64, ptr %16, align 8, !tbaa !8
  %248 = add nsw i64 %247, 1
  %249 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %8, i64 noundef %248)
          to label %250 unwind label %268

250:                                              ; preds = %246
  %251 = getelementptr inbounds { ptr, i64 }, ptr %26, i32 0, i32 0
  %252 = extractvalue { ptr, i64 } %249, 0
  store ptr %252, ptr %251, align 8
  %253 = getelementptr inbounds { ptr, i64 }, ptr %26, i32 0, i32 1
  %254 = extractvalue { ptr, i64 } %249, 1
  store i64 %254, ptr %253, align 8
  %255 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %26) #6
  %256 = xor i1 %255, true
  br label %257

257:                                              ; preds = %250, %240
  %258 = phi i1 [ false, %240 ], [ %256, %250 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #6
  br i1 %258, label %259, label %273

259:                                              ; preds = %257
  %260 = load i64, ptr %11, align 8, !tbaa !8
  %261 = add nsw i64 %260, -1
  store i64 %261, ptr %11, align 8, !tbaa !8
  %262 = load i64, ptr %12, align 8, !tbaa !8
  %263 = add nsw i64 %262, -1
  store i64 %263, ptr %12, align 8, !tbaa !8
  br label %273

264:                                              ; preds = %236
  %265 = landingpad { ptr, i32 }
          cleanup
  %266 = extractvalue { ptr, i32 } %265, 0
  store ptr %266, ptr %6, align 8
  %267 = extractvalue { ptr, i32 } %265, 1
  store i32 %267, ptr %7, align 4
  br label %272

268:                                              ; preds = %246
  %269 = landingpad { ptr, i32 }
          cleanup
  %270 = extractvalue { ptr, i32 } %269, 0
  store ptr %270, ptr %6, align 8
  %271 = extractvalue { ptr, i32 } %269, 1
  store i32 %271, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #6
  br label %272

272:                                              ; preds = %268, %264
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #6
  br label %398

273:                                              ; preds = %259, %257
  br label %274

274:                                              ; preds = %273, %224
  br label %275

275:                                              ; preds = %274, %172
  br label %276

276:                                              ; preds = %275, %147, %139
  %277 = load i8, ptr %18, align 1, !tbaa !10, !range !14, !noundef !15
  %278 = trunc i8 %277 to i1
  br i1 %278, label %392, label %279

279:                                              ; preds = %276
  %280 = load i8, ptr %19, align 1, !tbaa !10, !range !14, !noundef !15
  %281 = trunc i8 %280 to i1
  br i1 %281, label %282, label %392

282:                                              ; preds = %279
  call void @llvm.lifetime.start.p0(i64 16, ptr %27) #6
  %283 = load i64, ptr %16, align 8, !tbaa !8
  %284 = sub nsw i64 %283, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #6
  %285 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %8, i64 noundef %284)
          to label %286 unwind label %309

286:                                              ; preds = %282
  %287 = getelementptr inbounds { ptr, i64 }, ptr %27, i32 0, i32 0
  %288 = extractvalue { ptr, i64 } %285, 0
  store ptr %288, ptr %287, align 8
  %289 = getelementptr inbounds { ptr, i64 }, ptr %27, i32 0, i32 1
  %290 = extractvalue { ptr, i64 } %285, 1
  store i64 %290, ptr %289, align 8
  %291 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %27) #6
  br i1 %291, label %292, label %302

292:                                              ; preds = %286
  %293 = load i64, ptr %16, align 8, !tbaa !8
  %294 = add nsw i64 %293, 1
  %295 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %8, i64 noundef %294)
          to label %296 unwind label %313

296:                                              ; preds = %292
  %297 = getelementptr inbounds { ptr, i64 }, ptr %28, i32 0, i32 0
  %298 = extractvalue { ptr, i64 } %295, 0
  store ptr %298, ptr %297, align 8
  %299 = getelementptr inbounds { ptr, i64 }, ptr %28, i32 0, i32 1
  %300 = extractvalue { ptr, i64 } %295, 1
  store i64 %300, ptr %299, align 8
  %301 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %28) #6
  br label %302

302:                                              ; preds = %296, %286
  %303 = phi i1 [ false, %286 ], [ %301, %296 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #6
  br i1 %303, label %304, label %318

304:                                              ; preds = %302
  %305 = load i64, ptr %11, align 8, !tbaa !8
  %306 = add nsw i64 %305, 1
  store i64 %306, ptr %11, align 8, !tbaa !8
  %307 = load i64, ptr %12, align 8, !tbaa !8
  %308 = add nsw i64 %307, -1
  store i64 %308, ptr %12, align 8, !tbaa !8
  br label %391

309:                                              ; preds = %282
  %310 = landingpad { ptr, i32 }
          cleanup
  %311 = extractvalue { ptr, i32 } %310, 0
  store ptr %311, ptr %6, align 8
  %312 = extractvalue { ptr, i32 } %310, 1
  store i32 %312, ptr %7, align 4
  br label %317

313:                                              ; preds = %292
  %314 = landingpad { ptr, i32 }
          cleanup
  %315 = extractvalue { ptr, i32 } %314, 0
  store ptr %315, ptr %6, align 8
  %316 = extractvalue { ptr, i32 } %314, 1
  store i32 %316, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #6
  br label %317

317:                                              ; preds = %313, %309
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #6
  br label %398

318:                                              ; preds = %302
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #6
  %319 = load i64, ptr %16, align 8, !tbaa !8
  %320 = sub nsw i64 %319, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #6
  %321 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %8, i64 noundef %320)
          to label %322 unwind label %343

322:                                              ; preds = %318
  %323 = getelementptr inbounds { ptr, i64 }, ptr %29, i32 0, i32 0
  %324 = extractvalue { ptr, i64 } %321, 0
  store ptr %324, ptr %323, align 8
  %325 = getelementptr inbounds { ptr, i64 }, ptr %29, i32 0, i32 1
  %326 = extractvalue { ptr, i64 } %321, 1
  store i64 %326, ptr %325, align 8
  %327 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %29) #6
  br i1 %327, label %338, label %328

328:                                              ; preds = %322
  %329 = load i64, ptr %16, align 8, !tbaa !8
  %330 = add nsw i64 %329, 1
  %331 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %8, i64 noundef %330)
          to label %332 unwind label %347

332:                                              ; preds = %328
  %333 = getelementptr inbounds { ptr, i64 }, ptr %30, i32 0, i32 0
  %334 = extractvalue { ptr, i64 } %331, 0
  store ptr %334, ptr %333, align 8
  %335 = getelementptr inbounds { ptr, i64 }, ptr %30, i32 0, i32 1
  %336 = extractvalue { ptr, i64 } %331, 1
  store i64 %336, ptr %335, align 8
  %337 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %30) #6
  br label %338

338:                                              ; preds = %332, %322
  %339 = phi i1 [ true, %322 ], [ %337, %332 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #6
  br i1 %339, label %340, label %352

340:                                              ; preds = %338
  %341 = load i64, ptr %11, align 8, !tbaa !8
  %342 = add nsw i64 %341, 1
  store i64 %342, ptr %11, align 8, !tbaa !8
  br label %390

343:                                              ; preds = %318
  %344 = landingpad { ptr, i32 }
          cleanup
  %345 = extractvalue { ptr, i32 } %344, 0
  store ptr %345, ptr %6, align 8
  %346 = extractvalue { ptr, i32 } %344, 1
  store i32 %346, ptr %7, align 4
  br label %351

347:                                              ; preds = %328
  %348 = landingpad { ptr, i32 }
          cleanup
  %349 = extractvalue { ptr, i32 } %348, 0
  store ptr %349, ptr %6, align 8
  %350 = extractvalue { ptr, i32 } %348, 1
  store i32 %350, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #6
  br label %351

351:                                              ; preds = %347, %343
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #6
  br label %398

352:                                              ; preds = %338
  call void @llvm.lifetime.start.p0(i64 16, ptr %31) #6
  %353 = load i64, ptr %16, align 8, !tbaa !8
  %354 = sub nsw i64 %353, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr %32) #6
  %355 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %8, i64 noundef %354)
          to label %356 unwind label %380

356:                                              ; preds = %352
  %357 = getelementptr inbounds { ptr, i64 }, ptr %31, i32 0, i32 0
  %358 = extractvalue { ptr, i64 } %355, 0
  store ptr %358, ptr %357, align 8
  %359 = getelementptr inbounds { ptr, i64 }, ptr %31, i32 0, i32 1
  %360 = extractvalue { ptr, i64 } %355, 1
  store i64 %360, ptr %359, align 8
  %361 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %31) #6
  br i1 %361, label %373, label %362

362:                                              ; preds = %356
  %363 = load i64, ptr %16, align 8, !tbaa !8
  %364 = add nsw i64 %363, 1
  %365 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %8, i64 noundef %364)
          to label %366 unwind label %384

366:                                              ; preds = %362
  %367 = getelementptr inbounds { ptr, i64 }, ptr %32, i32 0, i32 0
  %368 = extractvalue { ptr, i64 } %365, 0
  store ptr %368, ptr %367, align 8
  %369 = getelementptr inbounds { ptr, i64 }, ptr %32, i32 0, i32 1
  %370 = extractvalue { ptr, i64 } %365, 1
  store i64 %370, ptr %369, align 8
  %371 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %32) #6
  %372 = xor i1 %371, true
  br label %373

373:                                              ; preds = %366, %356
  %374 = phi i1 [ false, %356 ], [ %372, %366 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #6
  br i1 %374, label %375, label %389

375:                                              ; preds = %373
  %376 = load i64, ptr %11, align 8, !tbaa !8
  %377 = add nsw i64 %376, 1
  store i64 %377, ptr %11, align 8, !tbaa !8
  %378 = load i64, ptr %12, align 8, !tbaa !8
  %379 = add nsw i64 %378, 1
  store i64 %379, ptr %12, align 8, !tbaa !8
  br label %389

380:                                              ; preds = %352
  %381 = landingpad { ptr, i32 }
          cleanup
  %382 = extractvalue { ptr, i32 } %381, 0
  store ptr %382, ptr %6, align 8
  %383 = extractvalue { ptr, i32 } %381, 1
  store i32 %383, ptr %7, align 4
  br label %388

384:                                              ; preds = %362
  %385 = landingpad { ptr, i32 }
          cleanup
  %386 = extractvalue { ptr, i32 } %385, 0
  store ptr %386, ptr %6, align 8
  %387 = extractvalue { ptr, i32 } %385, 1
  store i32 %387, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #6
  br label %388

388:                                              ; preds = %384, %380
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #6
  br label %398

389:                                              ; preds = %375, %373
  br label %390

390:                                              ; preds = %389, %340
  br label %391

391:                                              ; preds = %390, %304
  br label %392

392:                                              ; preds = %391, %279, %276
  %393 = load i64, ptr %11, align 8, !tbaa !8
  %394 = load i64, ptr %12, align 8, !tbaa !8
  %395 = sub nsw i64 %393, %394
  %396 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %395)
          to label %397 unwind label %185

397:                                              ; preds = %392
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %105, !llvm.loop !16

398:                                              ; preds = %388, %351, %317, %272, %235, %201, %189, %185
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #6
  br label %399

399:                                              ; preds = %398, %181
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #6
  br label %400

400:                                              ; preds = %399, %177
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %403

401:                                              ; preds = %105
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %2) #6
  %402 = load i32, ptr %1, align 4
  ret i32 %402

403:                                              ; preds = %400, %103
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #6
  br label %404

404:                                              ; preds = %403, %48
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #6
  br label %405

405:                                              ; preds = %404, %44
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %2) #6
  br label %406

406:                                              ; preds = %405
  %407 = load ptr, ptr %6, align 8
  %408 = load i32, ptr %7, align 4
  %409 = insertvalue { ptr, i32 } poison, ptr %407, 0
  %410 = insertvalue { ptr, i32 } %409, i32 %408, 1
  resume { ptr, i32 } %410
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) 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: 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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40)) 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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"bool", !6, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = distinct !{!16, !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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::vector" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::allocator.3" = type { i8 }
%"struct.std::_Bit_reference" = type { ptr, i64 }

@.str = external hidden unnamed_addr constant [9 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.1 = external hidden unnamed_addr constant [5 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 i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca i8, align 1
  %6 = alloca %"class.std::allocator.3", align 1
  %7 = alloca %"struct.std::_Bit_reference", align 8
  %8 = alloca %"struct.std::_Bit_reference", align 8
  %9 = alloca i64, align 8
  %10 = alloca i8, align 1
  %11 = alloca %"struct.std::_Bit_reference", align 8
  %12 = alloca %"struct.std::_Bit_reference", align 8
  %13 = alloca %"struct.std::_Bit_reference", align 8
  %14 = alloca %"struct.std::_Bit_reference", align 8
  %15 = alloca %"struct.std::_Bit_reference", align 8
  %16 = alloca %"struct.std::_Bit_reference", align 8
  %17 = alloca %"struct.std::_Bit_reference", align 8
  %18 = alloca %"struct.std::_Bit_reference", align 8
  %19 = alloca %"struct.std::_Bit_reference", align 8
  %20 = alloca %"struct.std::_Bit_reference", align 8
  %21 = alloca %"struct.std::_Bit_reference", align 8
  %22 = alloca %"struct.std::_Bit_reference", align 8
  %23 = alloca %"struct.std::_Bit_reference", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  %25 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_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) %3)
          to label %26 unwind label %49

26:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #7
  %27 = load i64, ptr %1, align 8, !tbaa !5
  %28 = add nsw i64 %27, 2
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #7
  store i8 0, ptr %5, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #7
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %4, i64 noundef %28, ptr noundef nonnull align 1 dereferenceable(1) %5, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %29 unwind label %51

29:                                               ; preds = %26
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  %30 = load i64, ptr %1, align 8, !tbaa !5
  %31 = icmp sgt i64 %30, 0
  br i1 %31, label %.lr.ph, label %.preheader

.lr.ph:                                           ; preds = %29
  %32 = getelementptr inbounds i8, ptr %7, i64 8
  %33 = getelementptr inbounds i8, ptr %8, i64 8
  br label %53

.preheader:                                       ; preds = %75, %29
  %.045.lcssa = phi i64 [ 0, %29 ], [ %.146, %75 ]
  %.040.lcssa = phi i64 [ 0, %29 ], [ %.141, %75 ]
  %34 = load i64, ptr %2, align 8, !tbaa !5
  %35 = add nsw i64 %34, -1
  store i64 %35, ptr %2, align 8, !tbaa !5
  %.not96 = icmp eq i64 %34, 0
  br i1 %.not96, label %._crit_edge, label %.lr.ph99

.lr.ph99:                                         ; preds = %.preheader
  %36 = getelementptr inbounds i8, ptr %11, i64 8
  %37 = getelementptr inbounds i8, ptr %12, i64 8
  %38 = getelementptr inbounds i8, ptr %13, i64 8
  %39 = getelementptr inbounds i8, ptr %14, i64 8
  %40 = getelementptr inbounds i8, ptr %15, i64 8
  %41 = getelementptr inbounds i8, ptr %16, i64 8
  %42 = getelementptr inbounds i8, ptr %17, i64 8
  %43 = getelementptr inbounds i8, ptr %18, i64 8
  %44 = getelementptr inbounds i8, ptr %19, i64 8
  %45 = getelementptr inbounds i8, ptr %20, i64 8
  %46 = getelementptr inbounds i8, ptr %21, i64 8
  %47 = getelementptr inbounds i8, ptr %22, i64 8
  %48 = getelementptr inbounds i8, ptr %23, i64 8
  br label %78

49:                                               ; preds = %0
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %253

51:                                               ; preds = %26
  %52 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  br label %252

53:                                               ; preds = %.lr.ph, %75
  %.03994 = phi i64 [ 0, %.lr.ph ], [ %.pre-phi, %75 ]
  %.04093 = phi i64 [ 0, %.lr.ph ], [ %.141, %75 ]
  %.04592 = phi i64 [ 0, %.lr.ph ], [ %.146, %75 ]
  %54 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %.03994)
  %55 = load i8, ptr %54, align 1, !tbaa !11
  %56 = icmp eq i8 %55, 46
  br i1 %56, label %57, label %._crit_edge100

._crit_edge100:                                   ; preds = %53
  %.pre = add nuw nsw i64 %.03994, 1
  br label %75

57:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  %58 = add nuw nsw i64 %.03994, 1
  %59 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %4, i64 noundef %58)
          to label %60 unwind label %71

60:                                               ; preds = %57
  %61 = extractvalue { ptr, i64 } %59, 0
  store ptr %61, ptr %7, align 8
  %62 = extractvalue { ptr, i64 } %59, 1
  store i64 %62, ptr %32, align 8
  %63 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %7, i1 noundef zeroext true) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #7
  %64 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %4, i64 noundef %.03994)
          to label %65 unwind label %73

65:                                               ; preds = %60
  %66 = add nsw i64 %.04592, 1
  %67 = extractvalue { ptr, i64 } %64, 0
  store ptr %67, ptr %8, align 8
  %68 = extractvalue { ptr, i64 } %64, 1
  store i64 %68, ptr %33, align 8
  %69 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  %not. = xor i1 %69, true
  %70 = zext i1 %not. to i64
  %spec.select = add nsw i64 %.04093, %70
  br label %75

71:                                               ; preds = %57
  %72 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  br label %251

73:                                               ; preds = %60
  %74 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  br label %251

75:                                               ; preds = %._crit_edge100, %65
  %.pre-phi = phi i64 [ %.pre, %._crit_edge100 ], [ %58, %65 ]
  %.146 = phi i64 [ %.04592, %._crit_edge100 ], [ %66, %65 ]
  %.141 = phi i64 [ %.04093, %._crit_edge100 ], [ %spec.select, %65 ]
  %76 = load i64, ptr %1, align 8, !tbaa !5
  %77 = icmp slt i64 %.pre-phi, %76
  br i1 %77, label %53, label %.preheader, !llvm.loop !12

78:                                               ; preds = %.lr.ph99, %.thread
  %.24298 = phi i64 [ %.040.lcssa, %.lr.ph99 ], [ %.444, %.thread ]
  %.24797 = phi i64 [ %.045.lcssa, %.lr.ph99 ], [ %.449, %.thread ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #7
  %79 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %80 unwind label %118

80:                                               ; preds = %78
  %81 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) %79, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %82 unwind label %118

82:                                               ; preds = %80
  %83 = load i64, ptr %9, align 8, !tbaa !5
  %84 = add nsw i64 %83, -1
  %85 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %84)
  %86 = load i8, ptr %85, align 1, !tbaa !11
  %87 = icmp ne i8 %86, 46
  %88 = load i8, ptr %10, align 1, !tbaa !11
  %89 = icmp eq i8 %88, 46
  %90 = load i64, ptr %9, align 8, !tbaa !5
  %91 = add nsw i64 %90, -1
  %92 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %91)
  store i8 %88, ptr %92, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #7
  %93 = load i64, ptr %9, align 8, !tbaa !5
  %94 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %4, i64 noundef %93)
          to label %95 unwind label %120

95:                                               ; preds = %82
  %96 = extractvalue { ptr, i64 } %94, 0
  store ptr %96, ptr %11, align 8
  %97 = extractvalue { ptr, i64 } %94, 1
  store i64 %97, ptr %36, align 8
  %98 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %11, i1 noundef zeroext %89) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  %brmerge = select i1 %87, i1 true, i1 %89
  br i1 %brmerge, label %174, label %99

99:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #7
  %100 = load i64, ptr %9, align 8, !tbaa !5
  %101 = add nsw i64 %100, -1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #7
  %102 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %4, i64 noundef %101)
          to label %103 unwind label %122

103:                                              ; preds = %99
  %104 = extractvalue { ptr, i64 } %102, 0
  store ptr %104, ptr %12, align 8
  %105 = extractvalue { ptr, i64 } %102, 1
  store i64 %105, ptr %37, align 8
  %106 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %12) #7
  br i1 %106, label %107, label %.critedge

107:                                              ; preds = %103
  %108 = load i64, ptr %9, align 8, !tbaa !5
  %109 = add nsw i64 %108, 1
  %110 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %4, i64 noundef %109)
          to label %111 unwind label %124

111:                                              ; preds = %107
  %112 = extractvalue { ptr, i64 } %110, 0
  store ptr %112, ptr %13, align 8
  %113 = extractvalue { ptr, i64 } %110, 1
  store i64 %113, ptr %38, align 8
  %114 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %13) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #7
  br i1 %114, label %115, label %127

115:                                              ; preds = %111
  %116 = add nsw i64 %.24797, -1
  %117 = add nsw i64 %.24298, 1
  br label %.thread

118:                                              ; preds = %80, %78
  %119 = landingpad { ptr, i32 }
          cleanup
  br label %250

120:                                              ; preds = %82
  %121 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  br label %250

122:                                              ; preds = %99
  %123 = landingpad { ptr, i32 }
          cleanup
  br label %126

124:                                              ; preds = %107
  %125 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #7
  br label %126

126:                                              ; preds = %124, %122
  %.pn = phi { ptr, i32 } [ %125, %124 ], [ %123, %122 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #7
  br label %250

.critedge:                                        ; preds = %103
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #7
  br label %127

127:                                              ; preds = %.critedge, %111
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #7
  %128 = load i64, ptr %9, align 8, !tbaa !5
  %129 = add nsw i64 %128, -1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #7
  %130 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %4, i64 noundef %129)
          to label %131 unwind label %145

131:                                              ; preds = %127
  %132 = extractvalue { ptr, i64 } %130, 0
  store ptr %132, ptr %14, align 8
  %133 = extractvalue { ptr, i64 } %130, 1
  store i64 %133, ptr %39, align 8
  %134 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %14) #7
  br i1 %134, label %.critedge2, label %135

135:                                              ; preds = %131
  %136 = load i64, ptr %9, align 8, !tbaa !5
  %137 = add nsw i64 %136, 1
  %138 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %4, i64 noundef %137)
          to label %139 unwind label %147

139:                                              ; preds = %135
  %140 = extractvalue { ptr, i64 } %138, 0
  store ptr %140, ptr %15, align 8
  %141 = extractvalue { ptr, i64 } %138, 1
  store i64 %141, ptr %40, align 8
  %142 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %15) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #7
  br i1 %142, label %143, label %150

.critedge2:                                       ; preds = %131
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #7
  br label %143

143:                                              ; preds = %.critedge2, %139
  %144 = add nsw i64 %.24797, -1
  br label %.thread

145:                                              ; preds = %127
  %146 = landingpad { ptr, i32 }
          cleanup
  br label %149

147:                                              ; preds = %135
  %148 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #7
  br label %149

149:                                              ; preds = %147, %145
  %.pn63 = phi { ptr, i32 } [ %148, %147 ], [ %146, %145 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #7
  br label %250

150:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #7
  %151 = load i64, ptr %9, align 8, !tbaa !5
  %152 = add nsw i64 %151, -1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %17) #7
  %153 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %4, i64 noundef %152)
          to label %154 unwind label %169

154:                                              ; preds = %150
  %155 = extractvalue { ptr, i64 } %153, 0
  store ptr %155, ptr %16, align 8
  %156 = extractvalue { ptr, i64 } %153, 1
  store i64 %156, ptr %41, align 8
  %157 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %16) #7
  br i1 %157, label %.critedge4, label %158

158:                                              ; preds = %154
  %159 = load i64, ptr %9, align 8, !tbaa !5
  %160 = add nsw i64 %159, 1
  %161 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %4, i64 noundef %160)
          to label %162 unwind label %171

162:                                              ; preds = %158
  %163 = extractvalue { ptr, i64 } %161, 0
  store ptr %163, ptr %17, align 8
  %164 = extractvalue { ptr, i64 } %161, 1
  store i64 %164, ptr %42, align 8
  %165 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %17) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #7
  br i1 %165, label %.thread, label %166

166:                                              ; preds = %162
  %167 = add nsw i64 %.24797, -1
  %168 = add nsw i64 %.24298, -1
  br label %.thread

169:                                              ; preds = %150
  %170 = landingpad { ptr, i32 }
          cleanup
  br label %173

171:                                              ; preds = %158
  %172 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #7
  br label %173

173:                                              ; preds = %171, %169
  %.pn65 = phi { ptr, i32 } [ %172, %171 ], [ %170, %169 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #7
  br label %250

.critedge4:                                       ; preds = %154
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #7
  br label %.thread

174:                                              ; preds = %95
  %brmerge82.not = select i1 %87, i1 %89, i1 false
  br i1 %brmerge82.not, label %175, label %.thread

175:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %18) #7
  %176 = load i64, ptr %9, align 8, !tbaa !5
  %177 = add nsw i64 %176, -1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %19) #7
  %178 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %4, i64 noundef %177)
          to label %179 unwind label %194

179:                                              ; preds = %175
  %180 = extractvalue { ptr, i64 } %178, 0
  store ptr %180, ptr %18, align 8
  %181 = extractvalue { ptr, i64 } %178, 1
  store i64 %181, ptr %43, align 8
  %182 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %18) #7
  br i1 %182, label %183, label %.critedge6

183:                                              ; preds = %179
  %184 = load i64, ptr %9, align 8, !tbaa !5
  %185 = add nsw i64 %184, 1
  %186 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %4, i64 noundef %185)
          to label %187 unwind label %196

187:                                              ; preds = %183
  %188 = extractvalue { ptr, i64 } %186, 0
  store ptr %188, ptr %19, align 8
  %189 = extractvalue { ptr, i64 } %186, 1
  store i64 %189, ptr %44, align 8
  %190 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %19) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %19) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #7
  br i1 %190, label %191, label %199

191:                                              ; preds = %187
  %192 = add nsw i64 %.24797, 1
  %193 = add nsw i64 %.24298, -1
  br label %.thread

194:                                              ; preds = %175
  %195 = landingpad { ptr, i32 }
          cleanup
  br label %198

196:                                              ; preds = %183
  %197 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %19) #7
  br label %198

198:                                              ; preds = %196, %194
  %.pn67 = phi { ptr, i32 } [ %197, %196 ], [ %195, %194 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #7
  br label %250

.critedge6:                                       ; preds = %179
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %19) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #7
  br label %199

199:                                              ; preds = %.critedge6, %187
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %20) #7
  %200 = load i64, ptr %9, align 8, !tbaa !5
  %201 = add nsw i64 %200, -1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %21) #7
  %202 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %4, i64 noundef %201)
          to label %203 unwind label %217

203:                                              ; preds = %199
  %204 = extractvalue { ptr, i64 } %202, 0
  store ptr %204, ptr %20, align 8
  %205 = extractvalue { ptr, i64 } %202, 1
  store i64 %205, ptr %45, align 8
  %206 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %20) #7
  br i1 %206, label %.critedge8, label %207

207:                                              ; preds = %203
  %208 = load i64, ptr %9, align 8, !tbaa !5
  %209 = add nsw i64 %208, 1
  %210 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %4, i64 noundef %209)
          to label %211 unwind label %219

211:                                              ; preds = %207
  %212 = extractvalue { ptr, i64 } %210, 0
  store ptr %212, ptr %21, align 8
  %213 = extractvalue { ptr, i64 } %210, 1
  store i64 %213, ptr %46, align 8
  %214 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %21) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %21) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #7
  br i1 %214, label %215, label %222

.critedge8:                                       ; preds = %203
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %21) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #7
  br label %215

215:                                              ; preds = %.critedge8, %211
  %216 = add nsw i64 %.24797, 1
  br label %.thread

217:                                              ; preds = %199
  %218 = landingpad { ptr, i32 }
          cleanup
  br label %221

219:                                              ; preds = %207
  %220 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %21) #7
  br label %221

221:                                              ; preds = %219, %217
  %.pn69 = phi { ptr, i32 } [ %220, %219 ], [ %218, %217 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #7
  br label %250

222:                                              ; preds = %211
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %22) #7
  %223 = load i64, ptr %9, align 8, !tbaa !5
  %224 = add nsw i64 %223, -1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %23) #7
  %225 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %4, i64 noundef %224)
          to label %226 unwind label %241

226:                                              ; preds = %222
  %227 = extractvalue { ptr, i64 } %225, 0
  store ptr %227, ptr %22, align 8
  %228 = extractvalue { ptr, i64 } %225, 1
  store i64 %228, ptr %47, align 8
  %229 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %22) #7
  br i1 %229, label %.critedge10, label %230

230:                                              ; preds = %226
  %231 = load i64, ptr %9, align 8, !tbaa !5
  %232 = add nsw i64 %231, 1
  %233 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %4, i64 noundef %232)
          to label %234 unwind label %243

234:                                              ; preds = %230
  %235 = extractvalue { ptr, i64 } %233, 0
  store ptr %235, ptr %23, align 8
  %236 = extractvalue { ptr, i64 } %233, 1
  store i64 %236, ptr %48, align 8
  %237 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %23) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %23) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %22) #7
  br i1 %237, label %.thread, label %238

238:                                              ; preds = %234
  %239 = add nsw i64 %.24797, 1
  %240 = add nsw i64 %.24298, 1
  br label %.thread

241:                                              ; preds = %222
  %242 = landingpad { ptr, i32 }
          cleanup
  br label %245

243:                                              ; preds = %230
  %244 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %23) #7
  br label %245

245:                                              ; preds = %243, %241
  %.pn71 = phi { ptr, i32 } [ %244, %243 ], [ %242, %241 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %22) #7
  br label %250

.critedge10:                                      ; preds = %226
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %23) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %22) #7
  br label %.thread

.thread:                                          ; preds = %143, %.critedge4, %166, %162, %115, %174, %191, %234, %238, %.critedge10, %215
  %.449 = phi i64 [ %.24797, %174 ], [ %192, %191 ], [ %216, %215 ], [ %.24797, %.critedge10 ], [ %239, %238 ], [ %.24797, %234 ], [ %.24797, %162 ], [ %167, %166 ], [ %.24797, %.critedge4 ], [ %144, %143 ], [ %116, %115 ]
  %.444 = phi i64 [ %.24298, %174 ], [ %193, %191 ], [ %.24298, %215 ], [ %.24298, %.critedge10 ], [ %240, %238 ], [ %.24298, %234 ], [ %.24298, %162 ], [ %168, %166 ], [ %.24298, %.critedge4 ], [ %.24298, %143 ], [ %117, %115 ]
  %246 = sub nsw i64 %.449, %.444
  %247 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %246)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  %248 = load i64, ptr %2, align 8, !tbaa !5
  %249 = add nsw i64 %248, -1
  store i64 %249, ptr %2, align 8, !tbaa !5
  %.not = icmp eq i64 %248, 0
  br i1 %.not, label %._crit_edge, label %78, !llvm.loop !14

250:                                              ; preds = %120, %126, %149, %173, %198, %221, %245, %118
  %.pn71.pn.pn = phi { ptr, i32 } [ %119, %118 ], [ %.pn71, %245 ], [ %.pn69, %221 ], [ %.pn67, %198 ], [ %.pn65, %173 ], [ %.pn63, %149 ], [ %.pn, %126 ], [ %121, %120 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  br label %251

._crit_edge:                                      ; preds = %.thread, %.preheader
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0

251:                                              ; preds = %71, %73, %250
  %.pn75.pn = phi { ptr, i32 } [ %.pn71.pn.pn, %250 ], [ %74, %73 ], [ %72, %71 ]
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #7
  br label %252

252:                                              ; preds = %251, %51
  %.pn75.pn.pn = phi { ptr, i32 } [ %.pn75.pn, %251 ], [ %52, %51 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #7
  br label %253

253:                                              ; preds = %252, %49
  %.pn75.pn.pn.pn = phi { ptr, i32 } [ %.pn75.pn.pn, %252 ], [ %50, %49 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn75.pn.pn.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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) 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: 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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40)) 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

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

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

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


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