; LLVM IR from AdarshGaur/Competitive-Programming :: SPOJ/MSUBSTR - Mirror Strings .ll (Z5solvev)

; 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] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.0" = type { 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 [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca i64, align 8
  %9 = alloca %"class.std::allocator.0", align 1
  %10 = alloca %"class.std::vector", align 8
  %11 = alloca i64, align 8
  %12 = alloca %"class.std::allocator.0", align 1
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %1) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  %26 = 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) %1)
          to label %27 unwind label %38

27:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %28 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  store i64 %28, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i64 0, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 0, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #6
  %29 = load i64, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #6
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #6
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %29, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %30 unwind label %42

30:                                               ; preds = %27
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #6
  %31 = load i64, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i64 0, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #6
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %31, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %32 unwind label %46

32:                                               ; preds = %30
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store i64 0, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store i64 0, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 -1, ptr %15, align 8, !tbaa !5
  br label %33

33:                                               ; preds = %136, %32
  %34 = load i64, ptr %13, align 8, !tbaa !5
  %35 = load i64, ptr %4, align 8, !tbaa !5
  %36 = icmp slt i64 %34, %35
  br i1 %36, label %50, label %37

37:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %144

38:                                               ; preds = %0
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %2, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %3, align 4
  br label %299

42:                                               ; preds = %27
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %2, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %3, align 4
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %298

46:                                               ; preds = %30
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %2, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %3, align 4
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %297

50:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %51 = load i64, ptr %13, align 8, !tbaa !5
  %52 = load i64, ptr %15, align 8, !tbaa !5
  %53 = icmp sgt i64 %51, %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  br i1 %53, label %54, label %55

54:                                               ; preds = %50
  br label %68

55:                                               ; preds = %50
  %56 = load i64, ptr %14, align 8, !tbaa !5
  %57 = load i64, ptr %15, align 8, !tbaa !5
  %58 = load i64, ptr %13, align 8, !tbaa !5
  %59 = sub nsw i64 %57, %58
  %60 = add nsw i64 %56, %59
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %60) #6
  %62 = load i64, ptr %15, align 8, !tbaa !5
  %63 = load i64, ptr %13, align 8, !tbaa !5
  %64 = sub nsw i64 %62, %63
  store i64 %64, ptr %17, align 8, !tbaa !5
  %65 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %61, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %66 unwind label %102

66:                                               ; preds = %55
  %67 = load i64, ptr %65, align 8, !tbaa !5
  br label %68

68:                                               ; preds = %66, %54
  %69 = phi i64 [ 1, %54 ], [ %67, %66 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  store i64 %69, ptr %16, align 8, !tbaa !5
  br label %70

70:                                               ; preds = %99, %68
  %71 = load i64, ptr %13, align 8, !tbaa !5
  %72 = load i64, ptr %16, align 8, !tbaa !5
  %73 = add nsw i64 %71, %72
  %74 = load i64, ptr %4, align 8, !tbaa !5
  %75 = icmp slt i64 %73, %74
  br i1 %75, label %76, label %97

76:                                               ; preds = %70
  %77 = load i64, ptr %13, align 8, !tbaa !5
  %78 = load i64, ptr %16, align 8, !tbaa !5
  %79 = sub nsw i64 %77, %78
  %80 = icmp sge i64 %79, 0
  br i1 %80, label %81, label %97

81:                                               ; preds = %76
  %82 = load i64, ptr %13, align 8, !tbaa !5
  %83 = load i64, ptr %16, align 8, !tbaa !5
  %84 = add nsw i64 %82, %83
  %85 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %84)
          to label %86 unwind label %106

86:                                               ; preds = %81
  %87 = load i8, ptr %85, align 1, !tbaa !9
  %88 = sext i8 %87 to i32
  %89 = load i64, ptr %13, align 8, !tbaa !5
  %90 = load i64, ptr %16, align 8, !tbaa !5
  %91 = sub nsw i64 %89, %90
  %92 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %91)
          to label %93 unwind label %106

93:                                               ; preds = %86
  %94 = load i8, ptr %92, align 1, !tbaa !9
  %95 = sext i8 %94 to i32
  %96 = icmp eq i32 %88, %95
  br label %97

97:                                               ; preds = %93, %76, %70
  %98 = phi i1 [ false, %76 ], [ false, %70 ], [ %96, %93 ]
  br i1 %98, label %99, label %110

99:                                               ; preds = %97
  %100 = load i64, ptr %16, align 8, !tbaa !5
  %101 = add nsw i64 %100, 1
  store i64 %101, ptr %16, align 8, !tbaa !5
  br label %70, !llvm.loop !10

102:                                              ; preds = %55
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %2, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %143

106:                                              ; preds = %86, %81
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %2, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %3, align 4
  br label %143

110:                                              ; preds = %97
  %111 = load i64, ptr %16, align 8, !tbaa !5
  %112 = add nsw i64 %111, -1
  store i64 %112, ptr %16, align 8, !tbaa !5
  %113 = load i64, ptr %13, align 8, !tbaa !5
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %113) #6
  store i64 %111, ptr %114, align 8, !tbaa !5
  %115 = load i64, ptr %13, align 8, !tbaa !5
  %116 = load i64, ptr %16, align 8, !tbaa !5
  %117 = add nsw i64 %115, %116
  %118 = load i64, ptr %15, align 8, !tbaa !5
  %119 = icmp sgt i64 %117, %118
  br i1 %119, label %120, label %127

120:                                              ; preds = %110
  %121 = load i64, ptr %13, align 8, !tbaa !5
  %122 = load i64, ptr %16, align 8, !tbaa !5
  %123 = sub nsw i64 %121, %122
  store i64 %123, ptr %14, align 8, !tbaa !5
  %124 = load i64, ptr %13, align 8, !tbaa !5
  %125 = load i64, ptr %16, align 8, !tbaa !5
  %126 = add nsw i64 %124, %125
  store i64 %126, ptr %15, align 8, !tbaa !5
  br label %127

127:                                              ; preds = %120, %110
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %128 = load i64, ptr %13, align 8, !tbaa !5
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %128) #6
  %130 = load i64, ptr %129, align 8, !tbaa !5
  %131 = mul nsw i64 %130, 2
  %132 = sub nsw i64 %131, 1
  store i64 %132, ptr %18, align 8, !tbaa !5
  %133 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %134 unwind label %139

134:                                              ; preds = %127
  %135 = load i64, ptr %133, align 8, !tbaa !5
  store i64 %135, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %136

136:                                              ; preds = %134
  %137 = load i64, ptr %13, align 8, !tbaa !5
  %138 = add nsw i64 %137, 1
  store i64 %138, ptr %13, align 8, !tbaa !5
  br label %33, !llvm.loop !12

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

143:                                              ; preds = %139, %106, %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %296

144:                                              ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store i64 0, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  store i64 0, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  store i64 -1, ptr %21, align 8, !tbaa !5
  br label %145

145:                                              ; preds = %242, %144
  %146 = load i64, ptr %19, align 8, !tbaa !5
  %147 = load i64, ptr %4, align 8, !tbaa !5
  %148 = icmp slt i64 %146, %147
  br i1 %148, label %150, label %149

149:                                              ; preds = %145
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %250

150:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %151 = load i64, ptr %19, align 8, !tbaa !5
  %152 = load i64, ptr %21, align 8, !tbaa !5
  %153 = icmp sgt i64 %151, %152
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  br i1 %153, label %154, label %155

154:                                              ; preds = %150
  br label %170

155:                                              ; preds = %150
  %156 = load i64, ptr %20, align 8, !tbaa !5
  %157 = load i64, ptr %21, align 8, !tbaa !5
  %158 = load i64, ptr %19, align 8, !tbaa !5
  %159 = sub nsw i64 %157, %158
  %160 = add nsw i64 %159, 1
  %161 = add nsw i64 %156, %160
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %161) #6
  %163 = load i64, ptr %21, align 8, !tbaa !5
  %164 = load i64, ptr %19, align 8, !tbaa !5
  %165 = sub nsw i64 %163, %164
  %166 = add nsw i64 %165, 1
  store i64 %166, ptr %23, align 8, !tbaa !5
  %167 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %162, ptr noundef nonnull align 8 dereferenceable(8) %23)
          to label %168 unwind label %207

168:                                              ; preds = %155
  %169 = load i64, ptr %167, align 8, !tbaa !5
  br label %170

170:                                              ; preds = %168, %154
  %171 = phi i64 [ 0, %154 ], [ %169, %168 ]
  %172 = add nsw i64 %171, 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  store i64 %172, ptr %22, align 8, !tbaa !5
  br label %173

173:                                              ; preds = %204, %170
  %174 = load i64, ptr %19, align 8, !tbaa !5
  %175 = load i64, ptr %22, align 8, !tbaa !5
  %176 = add nsw i64 %174, %175
  %177 = sub nsw i64 %176, 1
  %178 = load i64, ptr %4, align 8, !tbaa !5
  %179 = icmp slt i64 %177, %178
  br i1 %179, label %180, label %202

180:                                              ; preds = %173
  %181 = load i64, ptr %19, align 8, !tbaa !5
  %182 = load i64, ptr %22, align 8, !tbaa !5
  %183 = sub nsw i64 %181, %182
  %184 = icmp sge i64 %183, 0
  br i1 %184, label %185, label %202

185:                                              ; preds = %180
  %186 = load i64, ptr %19, align 8, !tbaa !5
  %187 = load i64, ptr %22, align 8, !tbaa !5
  %188 = add nsw i64 %186, %187
  %189 = sub nsw i64 %188, 1
  %190 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %189)
          to label %191 unwind label %211

191:                                              ; preds = %185
  %192 = load i8, ptr %190, align 1, !tbaa !9
  %193 = sext i8 %192 to i32
  %194 = load i64, ptr %19, align 8, !tbaa !5
  %195 = load i64, ptr %22, align 8, !tbaa !5
  %196 = sub nsw i64 %194, %195
  %197 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %196)
          to label %198 unwind label %211

198:                                              ; preds = %191
  %199 = load i8, ptr %197, align 1, !tbaa !9
  %200 = sext i8 %199 to i32
  %201 = icmp eq i32 %193, %200
  br label %202

202:                                              ; preds = %198, %180, %173
  %203 = phi i1 [ false, %180 ], [ false, %173 ], [ %201, %198 ]
  br i1 %203, label %204, label %215

204:                                              ; preds = %202
  %205 = load i64, ptr %22, align 8, !tbaa !5
  %206 = add nsw i64 %205, 1
  store i64 %206, ptr %22, align 8, !tbaa !5
  br label %173, !llvm.loop !13

207:                                              ; preds = %155
  %208 = landingpad { ptr, i32 }
          cleanup
  %209 = extractvalue { ptr, i32 } %208, 0
  store ptr %209, ptr %2, align 8
  %210 = extractvalue { ptr, i32 } %208, 1
  store i32 %210, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %249

211:                                              ; preds = %191, %185
  %212 = landingpad { ptr, i32 }
          cleanup
  %213 = extractvalue { ptr, i32 } %212, 0
  store ptr %213, ptr %2, align 8
  %214 = extractvalue { ptr, i32 } %212, 1
  store i32 %214, ptr %3, align 4
  br label %249

215:                                              ; preds = %202
  %216 = load i64, ptr %22, align 8, !tbaa !5
  %217 = add nsw i64 %216, -1
  store i64 %217, ptr %22, align 8, !tbaa !5
  %218 = load i64, ptr %19, align 8, !tbaa !5
  %219 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %218) #6
  store i64 %217, ptr %219, align 8, !tbaa !5
  %220 = load i64, ptr %19, align 8, !tbaa !5
  %221 = load i64, ptr %22, align 8, !tbaa !5
  %222 = add nsw i64 %220, %221
  %223 = sub nsw i64 %222, 1
  %224 = load i64, ptr %21, align 8, !tbaa !5
  %225 = icmp sgt i64 %223, %224
  br i1 %225, label %226, label %234

226:                                              ; preds = %215
  %227 = load i64, ptr %19, align 8, !tbaa !5
  %228 = load i64, ptr %22, align 8, !tbaa !5
  %229 = sub nsw i64 %227, %228
  store i64 %229, ptr %20, align 8, !tbaa !5
  %230 = load i64, ptr %19, align 8, !tbaa !5
  %231 = load i64, ptr %22, align 8, !tbaa !5
  %232 = add nsw i64 %230, %231
  %233 = sub nsw i64 %232, 1
  store i64 %233, ptr %21, align 8, !tbaa !5
  br label %234

234:                                              ; preds = %226, %215
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %235 = load i64, ptr %19, align 8, !tbaa !5
  %236 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %235) #6
  %237 = load i64, ptr %236, align 8, !tbaa !5
  %238 = mul nsw i64 %237, 2
  store i64 %238, ptr %24, align 8, !tbaa !5
  %239 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %24)
          to label %240 unwind label %245

240:                                              ; preds = %234
  %241 = load i64, ptr %239, align 8, !tbaa !5
  store i64 %241, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %242

242:                                              ; preds = %240
  %243 = load i64, ptr %19, align 8, !tbaa !5
  %244 = add nsw i64 %243, 1
  store i64 %244, ptr %19, align 8, !tbaa !5
  br label %145, !llvm.loop !14

245:                                              ; preds = %234
  %246 = landingpad { ptr, i32 }
          cleanup
  %247 = extractvalue { ptr, i32 } %246, 0
  store ptr %247, ptr %2, align 8
  %248 = extractvalue { ptr, i32 } %246, 1
  store i32 %248, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %249

249:                                              ; preds = %245, %211, %207
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %296

250:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  store i64 0, ptr %25, align 8, !tbaa !5
  br label %251

251:                                              ; preds = %278, %250
  %252 = load i64, ptr %25, align 8, !tbaa !5
  %253 = load i64, ptr %4, align 8, !tbaa !5
  %254 = icmp slt i64 %252, %253
  br i1 %254, label %256, label %255

255:                                              ; preds = %251
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %281

256:                                              ; preds = %251
  %257 = load i64, ptr %25, align 8, !tbaa !5
  %258 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %257) #6
  %259 = load i64, ptr %258, align 8, !tbaa !5
  %260 = mul nsw i64 %259, 2
  %261 = load i64, ptr %5, align 8, !tbaa !5
  %262 = icmp eq i64 %260, %261
  br i1 %262, label %263, label %266

263:                                              ; preds = %256
  %264 = load i64, ptr %6, align 8, !tbaa !5
  %265 = add nsw i64 %264, 1
  store i64 %265, ptr %6, align 8, !tbaa !5
  br label %266

266:                                              ; preds = %263, %256
  %267 = load i64, ptr %25, align 8, !tbaa !5
  %268 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %267) #6
  %269 = load i64, ptr %268, align 8, !tbaa !5
  %270 = mul nsw i64 %269, 2
  %271 = sub nsw i64 %270, 1
  %272 = load i64, ptr %5, align 8, !tbaa !5
  %273 = icmp eq i64 %271, %272
  br i1 %273, label %274, label %277

274:                                              ; preds = %266
  %275 = load i64, ptr %6, align 8, !tbaa !5
  %276 = add nsw i64 %275, 1
  store i64 %276, ptr %6, align 8, !tbaa !5
  br label %277

277:                                              ; preds = %274, %266
  br label %278

278:                                              ; preds = %277
  %279 = load i64, ptr %25, align 8, !tbaa !5
  %280 = add nsw i64 %279, 1
  store i64 %280, ptr %25, align 8, !tbaa !5
  br label %251, !llvm.loop !15

281:                                              ; preds = %255
  %282 = load i64, ptr %5, align 8, !tbaa !5
  %283 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %282)
          to label %284 unwind label %292

284:                                              ; preds = %281
  %285 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %283, ptr noundef @.str)
          to label %286 unwind label %292

286:                                              ; preds = %284
  %287 = load i64, ptr %6, align 8, !tbaa !5
  %288 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) %285, i64 noundef %287)
          to label %289 unwind label %292

289:                                              ; preds = %286
  %290 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %288, ptr noundef @.str.1)
          to label %291 unwind label %292

291:                                              ; preds = %289
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %1) #6
  ret void

292:                                              ; preds = %289, %286, %284, %281
  %293 = landingpad { ptr, i32 }
          cleanup
  %294 = extractvalue { ptr, i32 } %293, 0
  store ptr %294, ptr %2, align 8
  %295 = extractvalue { ptr, i32 } %293, 1
  store i32 %295, ptr %3, align 4
  br label %296

296:                                              ; preds = %292, %249, %143
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  br label %297

297:                                              ; preds = %296, %46
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  br label %298

298:                                              ; preds = %297, %42
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %299

299:                                              ; preds = %298, %38
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %1) #6
  br label %300

300:                                              ; preds = %299
  %301 = load ptr, ptr %2, align 8
  %302 = load i32, ptr %3, align 4
  %303 = insertvalue { ptr, i32 } poison, ptr %301, 0
  %304 = insertvalue { ptr, i32 } %303, i32 %302, 1
  resume { ptr, i32 } %304
}

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

; Function Attrs: mustprogress nounwind uwtable
declare 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)) #3

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

; 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) #5

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

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

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

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

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


; 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] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.0" = type { 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 [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::allocator.0", align 1
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca i64, align 8
  %8 = alloca %"class.std::allocator.0", align 1
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  %13 = 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) %1)
          to label %14 unwind label %19

14:                                               ; preds = %0
  %15 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  store i64 0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  store i64 0, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #7
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %15, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %16 unwind label %21

16:                                               ; preds = %14
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  store i64 0, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #7
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %15, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %17 unwind label %23

17:                                               ; preds = %16
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  %18 = icmp sgt i64 %15, 0
  br i1 %18, label %.lr.ph116, label %.preheader.._crit_edge_crit_edge

.preheader107:                                    ; preds = %.critedge
  br i1 %18, label %.lr.ph120, label %.preheader.._crit_edge_crit_edge

19:                                               ; preds = %0
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %120

21:                                               ; preds = %14
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %119

23:                                               ; preds = %16
  %24 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %118

.lr.ph116:                                        ; preds = %17, %.critedge
  %.079115 = phi i64 [ %spec.select103, %.critedge ], [ -1, %17 ]
  %.081114 = phi i64 [ %spec.select, %.critedge ], [ 0, %17 ]
  %.083113 = phi i64 [ %60, %.critedge ], [ 0, %17 ]
  %25 = icmp sgt i64 %.083113, %.079115
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  br i1 %25, label %32, label %26

26:                                               ; preds = %.lr.ph116
  %27 = sub nsw i64 %.079115, %.083113
  %28 = add nsw i64 %27, %.081114
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %28) #7
  store i64 %27, ptr %9, align 8, !tbaa !5
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %31 = load i64, ptr %30, align 8, !tbaa !5
  br label %32

32:                                               ; preds = %.lr.ph116, %26
  %33 = phi i64 [ %31, %26 ], [ 1, %.lr.ph116 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  %34 = add nsw i64 %33, %.083113
  %35 = icmp slt i64 %34, %15
  br i1 %35, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %32, %45
  %36 = phi i64 [ %47, %45 ], [ %34, %32 ]
  %.078108 = phi i64 [ %46, %45 ], [ %33, %32 ]
  %37 = sub nsw i64 %.083113, %.078108
  %38 = icmp sgt i64 %37, -1
  br i1 %38, label %39, label %.critedge

39:                                               ; preds = %.lr.ph
  %40 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %36)
  %41 = load i8, ptr %40, align 1, !tbaa !9
  %42 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %37)
  %43 = load i8, ptr %42, align 1, !tbaa !9
  %44 = icmp eq i8 %41, %43
  br i1 %44, label %45, label %.critedge

45:                                               ; preds = %39
  %46 = add nsw i64 %.078108, 1
  %47 = add nsw i64 %46, %.083113
  %48 = icmp slt i64 %47, %15
  br i1 %48, label %.lr.ph, label %.critedge, !llvm.loop !10

.critedge:                                        ; preds = %39, %45, %.lr.ph, %32
  %.078.lcssa = phi i64 [ %33, %32 ], [ %.078108, %.lr.ph ], [ %46, %45 ], [ %.078108, %39 ]
  %49 = add nsw i64 %.078.lcssa, -1
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.083113) #7
  store i64 %.078.lcssa, ptr %50, align 8, !tbaa !5
  %51 = add nsw i64 %49, %.083113
  %52 = icmp sgt i64 %51, %.079115
  %53 = sub nsw i64 %.083113, %49
  %spec.select = select i1 %52, i64 %53, i64 %.081114
  %spec.select103 = call i64 @llvm.smax.i64(i64 %51, i64 %.079115)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.083113) #7
  %55 = load i64, ptr %54, align 8, !tbaa !5
  %56 = shl nsw i64 %55, 1
  %57 = add nsw i64 %56, -1
  store i64 %57, ptr %10, align 8, !tbaa !5
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %59 = load i64, ptr %58, align 8, !tbaa !5
  store i64 %59, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  %60 = add nuw nsw i64 %.083113, 1
  %exitcond.not = icmp eq i64 %60, %15
  br i1 %exitcond.not, label %.preheader107, label %.lr.ph116, !llvm.loop !12

.preheader:                                       ; preds = %.critedge2
  br i1 %18, label %.lr.ph123, label %.preheader.._crit_edge_crit_edge

.preheader.._crit_edge_crit_edge:                 ; preds = %17, %.preheader107, %.preheader
  %.pre = load i64, ptr %2, align 8, !tbaa !5
  br label %._crit_edge

.lr.ph120:                                        ; preds = %.preheader107, %.critedge2
  %.074119 = phi i64 [ %spec.select105, %.critedge2 ], [ -1, %.preheader107 ]
  %.075118 = phi i64 [ %spec.select104, %.critedge2 ], [ 0, %.preheader107 ]
  %.077117 = phi i64 [ %92, %.critedge2 ], [ 0, %.preheader107 ]
  %61 = icmp sgt i64 %.077117, %.074119
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  br i1 %61, label %69, label %62

62:                                               ; preds = %.lr.ph120
  %63 = sub nsw i64 %.074119, %.077117
  %64 = add nsw i64 %63, 1
  %65 = add nsw i64 %64, %.075118
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %65) #7
  store i64 %64, ptr %11, align 8, !tbaa !5
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %66, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %68 = load i64, ptr %67, align 8, !tbaa !5
  br label %69

69:                                               ; preds = %.lr.ph120, %62
  %70 = phi i64 [ %68, %62 ], [ 0, %.lr.ph120 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  br label %71

71:                                               ; preds = %77, %69
  %.073.in = phi i64 [ %70, %69 ], [ %.073, %77 ]
  %.073 = add nsw i64 %.073.in, 1
  %72 = add i64 %.073.in, %.077117
  %73 = icmp slt i64 %72, %15
  br i1 %73, label %74, label %.critedge2

74:                                               ; preds = %71
  %75 = sub nsw i64 %.077117, %.073
  %76 = icmp sgt i64 %75, -1
  br i1 %76, label %77, label %.critedge2

77:                                               ; preds = %74
  %78 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %72)
  %79 = load i8, ptr %78, align 1, !tbaa !9
  %80 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %75)
  %81 = load i8, ptr %80, align 1, !tbaa !9
  %82 = icmp eq i8 %79, %81
  br i1 %82, label %71, label %.critedge2, !llvm.loop !13

.critedge2:                                       ; preds = %74, %71, %77
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %.077117) #7
  store i64 %.073.in, ptr %83, align 8, !tbaa !5
  %84 = add nsw i64 %72, -1
  %85 = icmp sgt i64 %84, %.074119
  %86 = sub nsw i64 %.077117, %.073.in
  %spec.select104 = select i1 %85, i64 %86, i64 %.075118
  %spec.select105 = call i64 @llvm.smax.i64(i64 %84, i64 %.074119)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %.077117) #7
  %88 = load i64, ptr %87, align 8, !tbaa !5
  %89 = shl nsw i64 %88, 1
  store i64 %89, ptr %12, align 8, !tbaa !5
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %91 = load i64, ptr %90, align 8, !tbaa !5
  store i64 %91, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  %92 = add nuw nsw i64 %.077117, 1
  %exitcond125.not = icmp eq i64 %92, %15
  br i1 %exitcond125.not, label %.preheader, label %.lr.ph120, !llvm.loop !14

._crit_edge:                                      ; preds = %.lr.ph123, %.preheader.._crit_edge_crit_edge
  %93 = phi i64 [ %.pre, %.preheader.._crit_edge_crit_edge ], [ %105, %.lr.ph123 ]
  %.084.lcssa = phi i64 [ 0, %.preheader.._crit_edge_crit_edge ], [ %.2, %.lr.ph123 ]
  %94 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %93)
          to label %109 unwind label %116

.lr.ph123:                                        ; preds = %.preheader, %.lr.ph123
  %.0122 = phi i64 [ %108, %.lr.ph123 ], [ 0, %.preheader ]
  %.084121 = phi i64 [ %.2, %.lr.ph123 ], [ 0, %.preheader ]
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %.0122) #7
  %96 = load i64, ptr %95, align 8, !tbaa !5
  %97 = shl nsw i64 %96, 1
  %98 = load i64, ptr %2, align 8, !tbaa !5
  %99 = icmp eq i64 %97, %98
  %100 = zext i1 %99 to i64
  %spec.select106 = add nsw i64 %.084121, %100
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.0122) #7
  %102 = load i64, ptr %101, align 8, !tbaa !5
  %103 = shl nsw i64 %102, 1
  %104 = add nsw i64 %103, -1
  %105 = load i64, ptr %2, align 8, !tbaa !5
  %106 = icmp eq i64 %104, %105
  %107 = zext i1 %106 to i64
  %.2 = add nsw i64 %spec.select106, %107
  %108 = add nuw nsw i64 %.0122, 1
  %exitcond126.not = icmp eq i64 %108, %15
  br i1 %exitcond126.not, label %._crit_edge, label %.lr.ph123, !llvm.loop !15

109:                                              ; preds = %._crit_edge
  %110 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %94, ptr noundef nonnull @.str)
          to label %111 unwind label %116

111:                                              ; preds = %109
  %112 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) %110, i64 noundef %.084.lcssa)
          to label %113 unwind label %116

113:                                              ; preds = %111
  %114 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %112, ptr noundef nonnull @.str.1)
          to label %115 unwind label %116

115:                                              ; preds = %113
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #7
  ret void

116:                                              ; preds = %113, %111, %109, %._crit_edge
  %117 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  br label %118

118:                                              ; preds = %116, %23
  %.pn = phi { ptr, i32 } [ %117, %116 ], [ %24, %23 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  br label %119

119:                                              ; preds = %118, %21
  %.pn.pn = phi { ptr, i32 } [ %.pn, %118 ], [ %22, %21 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  br label %120

120:                                              ; preds = %119, %19
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %119 ], [ %20, %19 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #7
  resume { ptr, i32 } %.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: 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 #3

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

; 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 #5

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #6

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


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