; LLVM IR from ShahjalalShohag/code-library :: Strings (Number of Palindromes in Range)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@d1 = external dso_local global %"class.std::vector", align 8
@d2 = external dso_local global %"class.std::vector", align 8

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9manachersRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %0) #1 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::vector", align 8
  %14 = alloca %"class.std::allocator", align 1
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %20) #4
  %22 = trunc i64 %21 to i32
  store i32 %22, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #4
  %23 = load i32, ptr %3, align 4, !tbaa !9
  %24 = sext i32 %23 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #4
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #4
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %24, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %25 unwind label %32

25:                                               ; preds = %1
  %26 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @d1, ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 -1, ptr %10, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %109, %25
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = load i32, ptr %3, align 4, !tbaa !9
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %36, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %112

32:                                               ; preds = %1
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %6, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %7, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #4
  br label %208

36:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %37 = load i32, ptr %8, align 4, !tbaa !9
  %38 = load i32, ptr %10, align 4, !tbaa !9
  %39 = icmp sgt i32 %37, %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  br i1 %39, label %40, label %41

40:                                               ; preds = %36
  br label %54

41:                                               ; preds = %36
  %42 = load i32, ptr %9, align 4, !tbaa !9
  %43 = load i32, ptr %10, align 4, !tbaa !9
  %44 = add nsw i32 %42, %43
  %45 = load i32, ptr %8, align 4, !tbaa !9
  %46 = sub nsw i32 %44, %45
  %47 = sext i32 %46 to i64
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d1, i64 noundef %47) #4
  %49 = load i32, ptr %10, align 4, !tbaa !9
  %50 = load i32, ptr %8, align 4, !tbaa !9
  %51 = sub nsw i32 %49, %50
  store i32 %51, ptr %12, align 4, !tbaa !9
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %48, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %53 = load i32, ptr %52, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %41, %40
  %55 = phi i32 [ 1, %40 ], [ %53, %41 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  store i32 %55, ptr %11, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %87, %54
  %57 = load i32, ptr %8, align 4, !tbaa !9
  %58 = load i32, ptr %11, align 4, !tbaa !9
  %59 = sub nsw i32 %57, %58
  %60 = icmp sle i32 0, %59
  br i1 %60, label %61, label %85

61:                                               ; preds = %56
  %62 = load i32, ptr %8, align 4, !tbaa !9
  %63 = load i32, ptr %11, align 4, !tbaa !9
  %64 = add nsw i32 %62, %63
  %65 = load i32, ptr %3, align 4, !tbaa !9
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %67, label %85

67:                                               ; preds = %61
  %68 = load ptr, ptr %2, align 8, !tbaa !5
  %69 = load i32, ptr %8, align 4, !tbaa !9
  %70 = load i32, ptr %11, align 4, !tbaa !9
  %71 = sub nsw i32 %69, %70
  %72 = sext i32 %71 to i64
  %73 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %68, i64 noundef %72)
  %74 = load i8, ptr %73, align 1, !tbaa !11
  %75 = sext i8 %74 to i32
  %76 = load ptr, ptr %2, align 8, !tbaa !5
  %77 = load i32, ptr %8, align 4, !tbaa !9
  %78 = load i32, ptr %11, align 4, !tbaa !9
  %79 = add nsw i32 %77, %78
  %80 = sext i32 %79 to i64
  %81 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %76, i64 noundef %80)
  %82 = load i8, ptr %81, align 1, !tbaa !11
  %83 = sext i8 %82 to i32
  %84 = icmp eq i32 %75, %83
  br label %85

85:                                               ; preds = %67, %61, %56
  %86 = phi i1 [ false, %61 ], [ false, %56 ], [ %84, %67 ]
  br i1 %86, label %87, label %90

87:                                               ; preds = %85
  %88 = load i32, ptr %11, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %11, align 4, !tbaa !9
  br label %56, !llvm.loop !12

90:                                               ; preds = %85
  %91 = load i32, ptr %11, align 4, !tbaa !9
  %92 = add nsw i32 %91, -1
  store i32 %92, ptr %11, align 4, !tbaa !9
  %93 = load i32, ptr %8, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d1, i64 noundef %94) #4
  store i32 %91, ptr %95, align 4, !tbaa !9
  %96 = load i32, ptr %8, align 4, !tbaa !9
  %97 = load i32, ptr %11, align 4, !tbaa !9
  %98 = add nsw i32 %96, %97
  %99 = load i32, ptr %10, align 4, !tbaa !9
  %100 = icmp sgt i32 %98, %99
  br i1 %100, label %101, label %108

101:                                              ; preds = %90
  %102 = load i32, ptr %8, align 4, !tbaa !9
  %103 = load i32, ptr %11, align 4, !tbaa !9
  %104 = sub nsw i32 %102, %103
  store i32 %104, ptr %9, align 4, !tbaa !9
  %105 = load i32, ptr %8, align 4, !tbaa !9
  %106 = load i32, ptr %11, align 4, !tbaa !9
  %107 = add nsw i32 %105, %106
  store i32 %107, ptr %10, align 4, !tbaa !9
  br label %108

108:                                              ; preds = %101, %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %8, align 4, !tbaa !9
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %8, align 4, !tbaa !9
  br label %27, !llvm.loop !14

112:                                              ; preds = %31
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #4
  %113 = load i32, ptr %3, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #4
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #4
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %114, ptr noundef nonnull align 1 dereferenceable(1) %14)
          to label %115 unwind label %122

115:                                              ; preds = %112
  %116 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @d2, ptr noundef nonnull align 8 dereferenceable(24) %13) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 -1, ptr %17, align 4, !tbaa !9
  br label %117

117:                                              ; preds = %204, %115
  %118 = load i32, ptr %15, align 4, !tbaa !9
  %119 = load i32, ptr %3, align 4, !tbaa !9
  %120 = icmp slt i32 %118, %119
  br i1 %120, label %126, label %121

121:                                              ; preds = %117
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %207

122:                                              ; preds = %112
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %6, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %7, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #4
  br label %208

126:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %127 = load i32, ptr %15, align 4, !tbaa !9
  %128 = load i32, ptr %17, align 4, !tbaa !9
  %129 = icmp sgt i32 %127, %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  br i1 %129, label %130, label %131

130:                                              ; preds = %126
  br label %146

131:                                              ; preds = %126
  %132 = load i32, ptr %16, align 4, !tbaa !9
  %133 = load i32, ptr %17, align 4, !tbaa !9
  %134 = add nsw i32 %132, %133
  %135 = load i32, ptr %15, align 4, !tbaa !9
  %136 = sub nsw i32 %134, %135
  %137 = add nsw i32 %136, 1
  %138 = sext i32 %137 to i64
  %139 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d2, i64 noundef %138) #4
  %140 = load i32, ptr %17, align 4, !tbaa !9
  %141 = load i32, ptr %15, align 4, !tbaa !9
  %142 = sub nsw i32 %140, %141
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %19, align 4, !tbaa !9
  %144 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %139, ptr noundef nonnull align 4 dereferenceable(4) %19)
  %145 = load i32, ptr %144, align 4, !tbaa !9
  br label %146

146:                                              ; preds = %131, %130
  %147 = phi i32 [ 0, %130 ], [ %145, %131 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  store i32 %147, ptr %18, align 4, !tbaa !9
  br label %148

148:                                              ; preds = %181, %146
  %149 = load i32, ptr %15, align 4, !tbaa !9
  %150 = load i32, ptr %18, align 4, !tbaa !9
  %151 = sub nsw i32 %149, %150
  %152 = sub nsw i32 %151, 1
  %153 = icmp sle i32 0, %152
  br i1 %153, label %154, label %179

154:                                              ; preds = %148
  %155 = load i32, ptr %15, align 4, !tbaa !9
  %156 = load i32, ptr %18, align 4, !tbaa !9
  %157 = add nsw i32 %155, %156
  %158 = load i32, ptr %3, align 4, !tbaa !9
  %159 = icmp slt i32 %157, %158
  br i1 %159, label %160, label %179

160:                                              ; preds = %154
  %161 = load ptr, ptr %2, align 8, !tbaa !5
  %162 = load i32, ptr %15, align 4, !tbaa !9
  %163 = load i32, ptr %18, align 4, !tbaa !9
  %164 = sub nsw i32 %162, %163
  %165 = sub nsw i32 %164, 1
  %166 = sext i32 %165 to i64
  %167 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %161, i64 noundef %166)
  %168 = load i8, ptr %167, align 1, !tbaa !11
  %169 = sext i8 %168 to i32
  %170 = load ptr, ptr %2, align 8, !tbaa !5
  %171 = load i32, ptr %15, align 4, !tbaa !9
  %172 = load i32, ptr %18, align 4, !tbaa !9
  %173 = add nsw i32 %171, %172
  %174 = sext i32 %173 to i64
  %175 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %170, i64 noundef %174)
  %176 = load i8, ptr %175, align 1, !tbaa !11
  %177 = sext i8 %176 to i32
  %178 = icmp eq i32 %169, %177
  br label %179

179:                                              ; preds = %160, %154, %148
  %180 = phi i1 [ false, %154 ], [ false, %148 ], [ %178, %160 ]
  br i1 %180, label %181, label %184

181:                                              ; preds = %179
  %182 = load i32, ptr %18, align 4, !tbaa !9
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %18, align 4, !tbaa !9
  br label %148, !llvm.loop !15

184:                                              ; preds = %179
  %185 = load i32, ptr %18, align 4, !tbaa !9
  %186 = add nsw i32 %185, -1
  store i32 %186, ptr %18, align 4, !tbaa !9
  %187 = load i32, ptr %15, align 4, !tbaa !9
  %188 = sext i32 %187 to i64
  %189 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d2, i64 noundef %188) #4
  store i32 %185, ptr %189, align 4, !tbaa !9
  %190 = load i32, ptr %15, align 4, !tbaa !9
  %191 = load i32, ptr %18, align 4, !tbaa !9
  %192 = add nsw i32 %190, %191
  %193 = load i32, ptr %17, align 4, !tbaa !9
  %194 = icmp sgt i32 %192, %193
  br i1 %194, label %195, label %203

195:                                              ; preds = %184
  %196 = load i32, ptr %15, align 4, !tbaa !9
  %197 = load i32, ptr %18, align 4, !tbaa !9
  %198 = sub nsw i32 %196, %197
  %199 = sub nsw i32 %198, 1
  store i32 %199, ptr %16, align 4, !tbaa !9
  %200 = load i32, ptr %15, align 4, !tbaa !9
  %201 = load i32, ptr %18, align 4, !tbaa !9
  %202 = add nsw i32 %200, %201
  store i32 %202, ptr %17, align 4, !tbaa !9
  br label %203

203:                                              ; preds = %195, %184
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %204

204:                                              ; preds = %203
  %205 = load i32, ptr %15, align 4, !tbaa !9
  %206 = add nsw i32 %205, 1
  store i32 %206, ptr %15, align 4, !tbaa !9
  br label %117, !llvm.loop !16

207:                                              ; preds = %121
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  ret void

208:                                              ; preds = %122, %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %209

209:                                              ; preds = %208
  %210 = load ptr, ptr %6, align 8
  %211 = load i32, ptr %7, align 4
  %212 = insertvalue { ptr, i32 } poison, ptr %210, 0
  %213 = insertvalue { ptr, i32 } %212, i32 %211, 1
  resume { ptr, i32 } %213
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@d1 = external dso_local global %"class.std::vector", align 8
@d2 = external dso_local global %"class.std::vector", align 8

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9manachersRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %0) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca %"class.std::allocator", align 1
  %7 = alloca i32, align 4
  %8 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  %sext = shl i64 %8, 32
  %9 = ashr exact i64 %sext, 32
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #5
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %9, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %10 unwind label %15

10:                                               ; preds = %1
  %11 = trunc i64 %8 to i32
  %12 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @d1, ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  %13 = icmp sgt i32 %11, 0
  br i1 %13, label %.lr.ph100.preheader, label %._crit_edge

.lr.ph100.preheader:                              ; preds = %10
  %14 = and i64 %8, 2147483647
  %wide.trip.count = and i64 %8, 2147483647
  br label %.lr.ph100

._crit_edge:                                      ; preds = %.critedge, %10
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #5
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %9, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %52 unwind label %55

15:                                               ; preds = %1
  %16 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  br label %97

.lr.ph100:                                        ; preds = %.lr.ph100.preheader, %.critedge
  %indvars.iv119 = phi i64 [ 0, %.lr.ph100.preheader ], [ %indvars.iv.next120, %.critedge ]
  %indvars.iv116 = phi i32 [ 1, %.lr.ph100.preheader ], [ %indvars.iv.next117, %.critedge ]
  %.07399 = phi i32 [ -1, %.lr.ph100.preheader ], [ %spec.select89, %.critedge ]
  %.07598 = phi i32 [ 0, %.lr.ph100.preheader ], [ %spec.select, %.critedge ]
  %17 = sext i32 %.07399 to i64
  %18 = icmp sgt i64 %indvars.iv119, %17
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %.pre = trunc nuw nsw i64 %indvars.iv119 to i32
  br i1 %18, label %.lr.ph100._crit_edge, label %19

19:                                               ; preds = %.lr.ph100
  %20 = sub i32 %.07598, %.pre
  %21 = add i32 %20, %.07399
  %22 = sext i32 %21 to i64
  %23 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d1, i64 noundef %22) #5
  %24 = sub nsw i32 %.07399, %.pre
  store i32 %24, ptr %4, align 4, !tbaa !5
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %26 = load i32, ptr %25, align 4, !tbaa !5
  br label %.lr.ph100._crit_edge

.lr.ph100._crit_edge:                             ; preds = %.lr.ph100, %19
  %27 = phi i32 [ %26, %19 ], [ 1, %.lr.ph100 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  %28 = sub nsw i32 %.pre, %27
  %29 = icmp sgt i32 %28, -1
  br i1 %29, label %.lr.ph.preheader, label %.critedge

.lr.ph.preheader:                                 ; preds = %.lr.ph100._crit_edge
  %30 = sext i32 %27 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %41
  %indvars.iv = phi i64 [ %30, %.lr.ph.preheader ], [ %indvars.iv.next, %41 ]
  %31 = phi i32 [ %28, %.lr.ph.preheader ], [ %44, %41 ]
  %32 = add nsw i64 %indvars.iv, %indvars.iv119
  %33 = icmp slt i64 %32, %14
  br i1 %33, label %34, label %.critedge.loopexit.split.loop.exit

34:                                               ; preds = %.lr.ph
  %35 = zext nneg i32 %31 to i64
  %36 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %35)
  %37 = load i8, ptr %36, align 1, !tbaa !9
  %38 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %32)
  %39 = load i8, ptr %38, align 1, !tbaa !9
  %40 = icmp eq i8 %37, %39
  br i1 %40, label %41, label %.critedge.loopexit.split.loop.exit133

41:                                               ; preds = %34
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %42 = sub nsw i64 %indvars.iv119, %indvars.iv.next
  %43 = icmp sgt i64 %42, -1
  %44 = trunc nsw i64 %42 to i32
  br i1 %43, label %.lr.ph, label %.critedge, !llvm.loop !10

.critedge.loopexit.split.loop.exit:               ; preds = %.lr.ph
  %45 = trunc nsw i64 %indvars.iv to i32
  br label %.critedge

.critedge.loopexit.split.loop.exit133:            ; preds = %34
  %46 = trunc nsw i64 %indvars.iv to i32
  br label %.critedge

.critedge:                                        ; preds = %41, %.critedge.loopexit.split.loop.exit, %.critedge.loopexit.split.loop.exit133, %.lr.ph100._crit_edge
  %.072.lcssa = phi i32 [ %27, %.lr.ph100._crit_edge ], [ %45, %.critedge.loopexit.split.loop.exit ], [ %46, %.critedge.loopexit.split.loop.exit133 ], [ %indvars.iv116, %41 ]
  %47 = add nsw i32 %.072.lcssa, -1
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d1, i64 noundef %indvars.iv119) #5
  store i32 %.072.lcssa, ptr %48, align 4, !tbaa !5
  %49 = add nsw i32 %47, %.pre
  %50 = icmp sgt i32 %49, %.07399
  %51 = sub nsw i32 %.pre, %47
  %spec.select = select i1 %50, i32 %51, i32 %.07598
  %spec.select89 = call i32 @llvm.smax.i32(i32 %49, i32 %.07399)
  %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
  %indvars.iv.next117 = add nuw i32 %indvars.iv116, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next120, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph100, !llvm.loop !12

52:                                               ; preds = %._crit_edge
  %53 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @d2, ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br i1 %13, label %.lr.ph114.preheader, label %._crit_edge115

.lr.ph114.preheader:                              ; preds = %52
  %54 = and i64 %8, 2147483647
  %wide.trip.count129 = and i64 %8, 2147483647
  br label %.lr.ph114

._crit_edge115:                                   ; preds = %.critedge2, %52
  ret void

55:                                               ; preds = %._crit_edge
  %56 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br label %97

.lr.ph114:                                        ; preds = %.lr.ph114.preheader, %.critedge2
  %indvars.iv125 = phi i64 [ 0, %.lr.ph114.preheader ], [ %indvars.iv.next126, %.critedge2 ]
  %.071.neg112 = phi i32 [ 0, %.lr.ph114.preheader ], [ %96, %.critedge2 ]
  %.068111 = phi i32 [ -1, %.lr.ph114.preheader ], [ %spec.select91, %.critedge2 ]
  %.069110 = phi i32 [ 0, %.lr.ph114.preheader ], [ %spec.select90, %.critedge2 ]
  %57 = sext i32 %.068111 to i64
  %58 = icmp sgt i64 %indvars.iv125, %57
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  br i1 %58, label %68, label %59

59:                                               ; preds = %.lr.ph114
  %60 = add nsw i32 %.071.neg112, 1
  %61 = add i32 %60, %.069110
  %62 = add i32 %61, %.068111
  %63 = sext i32 %62 to i64
  %64 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d2, i64 noundef %63) #5
  %65 = add i32 %60, %.068111
  store i32 %65, ptr %7, align 4, !tbaa !5
  %66 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %64, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %67 = load i32, ptr %66, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %.lr.ph114, %59
  %69 = phi i32 [ %67, %59 ], [ 0, %.lr.ph114 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  %70 = xor i32 %69, -1
  %71 = trunc nuw nsw i64 %indvars.iv125 to i32
  %72 = add i32 %71, %70
  %73 = icmp sgt i32 %72, -1
  br i1 %73, label %.lr.ph103.preheader, label %.critedge2

.lr.ph103.preheader:                              ; preds = %68
  %74 = sext i32 %69 to i64
  br label %.lr.ph103

.lr.ph103:                                        ; preds = %.lr.ph103.preheader, %86
  %indvars.iv122 = phi i64 [ %74, %.lr.ph103.preheader ], [ %indvars.iv.next123, %86 ]
  %75 = phi i32 [ %72, %.lr.ph103.preheader ], [ %87, %86 ]
  %76 = add nsw i64 %indvars.iv122, %indvars.iv125
  %77 = icmp slt i64 %76, %54
  %78 = trunc nsw i64 %indvars.iv122 to i32
  br i1 %77, label %79, label %.critedge2

79:                                               ; preds = %.lr.ph103
  %80 = zext nneg i32 %75 to i64
  %81 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %80)
  %82 = load i8, ptr %81, align 1, !tbaa !9
  %83 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %76)
  %84 = load i8, ptr %83, align 1, !tbaa !9
  %85 = icmp eq i8 %82, %84
  br i1 %85, label %86, label %.critedge2

86:                                               ; preds = %79
  %indvars.iv.next123 = add nsw i64 %indvars.iv122, 1
  %reass.sub = sub i32 %71, %78
  %87 = add i32 %reass.sub, -2
  %88 = icmp sgt i32 %87, -1
  br i1 %88, label %.lr.ph103, label %.critedge2, !llvm.loop !13

.critedge2:                                       ; preds = %79, %86, %.lr.ph103, %68
  %.0.lcssa = phi i32 [ %69, %68 ], [ %78, %.lr.ph103 ], [ %71, %86 ], [ %78, %79 ]
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d2, i64 noundef %indvars.iv125) #5
  store i32 %.0.lcssa, ptr %89, align 4, !tbaa !5
  %90 = trunc i64 %indvars.iv125 to i32
  %91 = add i32 %90, -1
  %92 = add i32 %91, %.0.lcssa
  %93 = icmp sgt i32 %92, %.068111
  %94 = sub i32 %71, %.0.lcssa
  %spec.select90 = select i1 %93, i32 %94, i32 %.069110
  %spec.select91 = call i32 @llvm.smax.i32(i32 %92, i32 %.068111)
  %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1
  %95 = trunc i64 %indvars.iv125 to i32
  %96 = xor i32 %95, -1
  %exitcond130.not = icmp eq i64 %indvars.iv.next126, %wide.trip.count129
  br i1 %exitcond130.not, label %._crit_edge115, label %.lr.ph114, !llvm.loop !14

97:                                               ; preds = %55, %15
  %.pn = phi { ptr, i32 } [ %56, %55 ], [ %16, %15 ]
  resume { ptr, i32 } %.pn
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_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) #2

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

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

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

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

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

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


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