; LLVM IR from eyangch/competitive-programming :: USACOcontests/gold/2014.03/fcount.ll (Z5worksi)

; 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.__gnu_cxx::__normal_iterator.0" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@N = external dso_local global i32, align 4
@a = external dso_local global [500 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z5worksi(i32 noundef %0) #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca i1, align 1
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"class.__gnu_cxx::__normal_iterator.0", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #4
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %43, %1
  %24 = load i32, ptr %5, align 4, !tbaa !5
  %25 = load i32, ptr @N, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  %27 = icmp slt i32 %24, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %46

29:                                               ; preds = %23
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = icmp ne i32 %30, %31
  br i1 %32, label %33, label %42

33:                                               ; preds = %29
  %34 = load i32, ptr %5, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [500 x i32], ptr @a, i64 0, i64 %35
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(4) %36)
          to label %37 unwind label %38

37:                                               ; preds = %33
  br label %42

38:                                               ; preds = %33
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %6, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %242

42:                                               ; preds = %37, %29
  br label %43

43:                                               ; preds = %42
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %5, align 4, !tbaa !5
  br label %23, !llvm.loop !9

46:                                               ; preds = %28
  %47 = load i32, ptr @N, align 4, !tbaa !5
  %48 = zext i32 %47 to i64
  %49 = call ptr @llvm.stacksave.p0()
  store ptr %49, ptr %8, align 8
  %50 = alloca %"class.std::vector", i64 %48, align 16
  store i64 %48, ptr %9, align 8
  %51 = icmp eq i64 %48, 0
  br i1 %51, label %58, label %52

52:                                               ; preds = %46
  %53 = getelementptr inbounds %"class.std::vector", ptr %50, i64 %48
  br label %54

54:                                               ; preds = %54, %52
  %55 = phi ptr [ %50, %52 ], [ %56, %54 ]
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %55) #4
  %56 = getelementptr inbounds %"class.std::vector", ptr %55, i64 1
  %57 = icmp eq ptr %56, %53
  br i1 %57, label %58, label %54

58:                                               ; preds = %54, %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %72, %58
  %60 = load i32, ptr %10, align 4, !tbaa !5
  %61 = load i32, ptr @N, align 4, !tbaa !5
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %64, label %63

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

64:                                               ; preds = %59
  %65 = load i32, ptr %10, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %66) #4
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds %"class.std::vector", ptr %50, i64 %69
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %70, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %71 unwind label %75

71:                                               ; preds = %64
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %10, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %10, align 4, !tbaa !5
  br label %59, !llvm.loop !11

75:                                               ; preds = %64
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %6, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %234

79:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %212, %79
  %81 = load i32, ptr %11, align 4, !tbaa !5
  %82 = load i32, ptr @N, align 4, !tbaa !5
  %83 = sub nsw i32 %82, 1
  %84 = icmp slt i32 %81, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %80
  store i32 8, ptr %12, align 4
  br label %216

86:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %88) #4
  %90 = load i32, ptr %89, align 4, !tbaa !5
  store i32 %90, ptr %13, align 4, !tbaa !5
  %91 = load i32, ptr %11, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %92) #4
  store i32 0, ptr %93, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %105, %86
  %95 = load i32, ptr %13, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds %"class.std::vector", ptr %50, i64 %96
  %98 = load i32, ptr %14, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %97, i64 noundef %99) #4
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = load i32, ptr %11, align 4, !tbaa !5
  %103 = icmp ne i32 %101, %102
  br i1 %103, label %104, label %108

104:                                              ; preds = %94
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %14, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %14, align 4, !tbaa !5
  br label %94, !llvm.loop !12

108:                                              ; preds = %94
  %109 = load i32, ptr %13, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds %"class.std::vector", ptr %50, i64 %110
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %112 = load i32, ptr %13, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds %"class.std::vector", ptr %50, i64 %113
  %115 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %114) #4
  %116 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %115, ptr %116, align 8
  %117 = load i32, ptr %14, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %17, i64 noundef %118) #4
  %120 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %119, ptr %120, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEC2IPivEERKNS0_IT_S5_EE(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %121 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.0", ptr %15, i32 0, i32 0
  %122 = load ptr, ptr %121, align 8
  %123 = invoke ptr @_ZNSt6vectorIiSaIiEE5eraseEN9__gnu_cxx17__normal_iteratorIPKiS1_EE(ptr noundef nonnull align 8 dereferenceable(24) %111, ptr %122)
          to label %124 unwind label %149

124:                                              ; preds = %108
  %125 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %123, ptr %125, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  %126 = getelementptr inbounds %"class.std::vector", ptr %50, i64 0
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %126, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %127 unwind label %153

127:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %128 = load i32, ptr @N, align 4, !tbaa !5
  %129 = sub nsw i32 %128, 1
  %130 = load i32, ptr %11, align 4, !tbaa !5
  %131 = sub nsw i32 %129, %130
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds %"class.std::vector", ptr %50, i64 %132
  %134 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %133) #4
  %135 = trunc i64 %134 to i32
  store i32 %135, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %136 = load i32, ptr @N, align 4, !tbaa !5
  %137 = sub nsw i32 %136, 1
  %138 = load i32, ptr %11, align 4, !tbaa !5
  %139 = sub nsw i32 %137, %138
  store i32 %139, ptr %20, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %201, %127
  %141 = load i32, ptr %20, align 4, !tbaa !5
  %142 = icmp sgt i32 %141, 0
  br i1 %142, label %143, label %146

143:                                              ; preds = %140
  %144 = load i32, ptr %13, align 4, !tbaa !5
  %145 = icmp sgt i32 %144, 0
  br label %146

146:                                              ; preds = %143, %140
  %147 = phi i1 [ false, %140 ], [ %145, %143 ]
  br i1 %147, label %157, label %148

148:                                              ; preds = %146
  store i32 14, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  br label %204

149:                                              ; preds = %108
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %6, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %215

153:                                              ; preds = %124
  %154 = landingpad { ptr, i32 }
          cleanup
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %6, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %7, align 4
  br label %215

157:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  %158 = load i32, ptr %20, align 4, !tbaa !5
  %159 = sub nsw i32 %158, 1
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds %"class.std::vector", ptr %50, i64 %160
  %162 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %161) #4
  %163 = trunc i64 %162 to i32
  store i32 %163, ptr %21, align 4, !tbaa !5
  br label %164

164:                                              ; preds = %187, %157
  %165 = load i32, ptr %19, align 4, !tbaa !5
  %166 = icmp sgt i32 %165, 0
  br i1 %166, label %167, label %170

167:                                              ; preds = %164
  %168 = load i32, ptr %13, align 4, !tbaa !5
  %169 = icmp sgt i32 %168, 0
  br label %170

170:                                              ; preds = %167, %164
  %171 = phi i1 [ false, %164 ], [ %169, %167 ]
  br i1 %171, label %172, label %199

172:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %173 = load i32, ptr %20, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds %"class.std::vector", ptr %50, i64 %174
  %176 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %175) #4
  %177 = load i32, ptr %176, align 4, !tbaa !5
  store i32 %177, ptr %22, align 4, !tbaa !5
  %178 = load i32, ptr %22, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %179) #4
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = add nsw i32 %181, -1
  store i32 %182, ptr %180, align 4, !tbaa !5
  %183 = load i32, ptr %20, align 4, !tbaa !5
  %184 = sub nsw i32 %183, 1
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds %"class.std::vector", ptr %50, i64 %185
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %186, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %187 unwind label %195

187:                                              ; preds = %172
  %188 = load i32, ptr %20, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds %"class.std::vector", ptr %50, i64 %189
  call void @_ZNSt6vectorIiSaIiEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %190) #4
  %191 = load i32, ptr %19, align 4, !tbaa !5
  %192 = add nsw i32 %191, -1
  store i32 %192, ptr %19, align 4, !tbaa !5
  %193 = load i32, ptr %13, align 4, !tbaa !5
  %194 = add nsw i32 %193, -1
  store i32 %194, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  br label %164, !llvm.loop !13

195:                                              ; preds = %172
  %196 = landingpad { ptr, i32 }
          cleanup
  %197 = extractvalue { ptr, i32 } %196, 0
  store ptr %197, ptr %6, align 8
  %198 = extractvalue { ptr, i32 } %196, 1
  store i32 %198, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  br label %215

199:                                              ; preds = %170
  %200 = load i32, ptr %21, align 4, !tbaa !5
  store i32 %200, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  br label %201

201:                                              ; preds = %199
  %202 = load i32, ptr %20, align 4, !tbaa !5
  %203 = add nsw i32 %202, -1
  store i32 %203, ptr %20, align 4, !tbaa !5
  br label %140, !llvm.loop !14

204:                                              ; preds = %148
  %205 = load i32, ptr %13, align 4, !tbaa !5
  %206 = icmp sgt i32 %205, 0
  br i1 %206, label %207, label %208

207:                                              ; preds = %204
  store i1 false, ptr %2, align 1
  store i32 1, ptr %12, align 4
  br label %209

208:                                              ; preds = %204
  store i32 0, ptr %12, align 4
  br label %209

209:                                              ; preds = %208, %207
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  %210 = load i32, ptr %12, align 4
  switch i32 %210, label %216 [
    i32 0, label %211
  ]

211:                                              ; preds = %209
  br label %212

212:                                              ; preds = %211
  %213 = load i32, ptr %11, align 4, !tbaa !5
  %214 = add nsw i32 %213, 1
  store i32 %214, ptr %11, align 4, !tbaa !5
  br label %80, !llvm.loop !15

215:                                              ; preds = %195, %153, %149
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %234

216:                                              ; preds = %209, %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  %217 = load i32, ptr %12, align 4
  switch i32 %217, label %224 [
    i32 8, label %218
  ]

218:                                              ; preds = %216
  %219 = getelementptr inbounds %"class.std::vector", ptr %50, i64 0
  %220 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %219) #4
  %221 = load i32, ptr @N, align 4, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = icmp eq i64 %220, %222
  store i1 %223, ptr %2, align 1
  store i32 1, ptr %12, align 4
  br label %224

224:                                              ; preds = %218, %216
  %225 = getelementptr inbounds %"class.std::vector", ptr %50, i64 %48
  %226 = icmp eq ptr %50, %225
  br i1 %226, label %231, label %227

227:                                              ; preds = %227, %224
  %228 = phi ptr [ %225, %224 ], [ %229, %227 ]
  %229 = getelementptr inbounds %"class.std::vector", ptr %228, i64 -1
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %229) #4
  %230 = icmp eq ptr %229, %50
  br i1 %230, label %231, label %227

231:                                              ; preds = %227, %224
  %232 = load ptr, ptr %8, align 8
  call void @llvm.stackrestore.p0(ptr %232)
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #4
  %233 = load i1, ptr %2, align 1
  ret i1 %233

234:                                              ; preds = %215, %75
  %235 = getelementptr inbounds %"class.std::vector", ptr %50, i64 %48
  %236 = icmp eq ptr %50, %235
  br i1 %236, label %241, label %237

237:                                              ; preds = %237, %234
  %238 = phi ptr [ %235, %234 ], [ %239, %237 ]
  %239 = getelementptr inbounds %"class.std::vector", ptr %238, i64 -1
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %239) #4
  %240 = icmp eq ptr %239, %50
  br i1 %240, label %241, label %237

241:                                              ; preds = %237, %234
  br label %242

242:                                              ; preds = %241, %38
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #4
  br label %243

243:                                              ; preds = %242
  %244 = load ptr, ptr %6, align 8
  %245 = load i32, ptr %7, align 4
  %246 = insertvalue { ptr, i32 } poison, ptr %244, 0
  %247 = insertvalue { ptr, i32 } %246, i32 %245, 1
  resume { ptr, i32 } %247
}

; 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 dso_local void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #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) #2 align 2

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

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

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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

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 = { nocallback nofree nosync nounwind willreturn }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::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.__gnu_cxx::__normal_iterator.0" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@N = external dso_local local_unnamed_addr global i32, align 4
@a = external dso_local global [500 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z5worksi(i32 noundef %0) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.0", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #4
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %9 = load i32, ptr @N, align 4, !tbaa !5
  %.not68 = icmp slt i32 %9, 0
  br i1 %.not68, label %._crit_edge.thread, label %.lr.ph.preheader

._crit_edge.thread:                               ; preds = %1
  %10 = zext i32 %9 to i64
  %11 = call ptr @llvm.stacksave.p0()
  %12 = alloca %"class.std::vector", i64 %10, align 16
  br label %26

.lr.ph.preheader:                                 ; preds = %1
  %13 = zext i32 %0 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %23
  %14 = zext i32 %24 to i64
  %15 = call ptr @llvm.stacksave.p0()
  %16 = alloca %"class.std::vector", i64 %14, align 16
  %17 = icmp eq i32 %24, 0
  br i1 %17, label %.loopexit61, label %26

.lr.ph:                                           ; preds = %.lr.ph.preheader, %23
  %18 = phi i32 [ %9, %.lr.ph.preheader ], [ %24, %23 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %23 ]
  %.not56 = icmp eq i64 %indvars.iv, %13
  br i1 %.not56, label %23, label %19

19:                                               ; preds = %.lr.ph
  %20 = getelementptr inbounds [500 x i32], ptr @a, i64 0, i64 %indvars.iv
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(4) %20)
          to label %._crit_edge102 unwind label %21

._crit_edge102:                                   ; preds = %19
  %.pre = load i32, ptr @N, align 4, !tbaa !5
  br label %23

21:                                               ; preds = %19
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

23:                                               ; preds = %._crit_edge102, %.lr.ph
  %24 = phi i32 [ %.pre, %._crit_edge102 ], [ %18, %.lr.ph ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %25 = sext i32 %24 to i64
  %.not.not = icmp slt i64 %indvars.iv, %25
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

26:                                               ; preds = %._crit_edge.thread, %._crit_edge
  %27 = phi ptr [ %12, %._crit_edge.thread ], [ %16, %._crit_edge ]
  %28 = phi ptr [ %11, %._crit_edge.thread ], [ %15, %._crit_edge ]
  %29 = phi i64 [ %10, %._crit_edge.thread ], [ %14, %._crit_edge ]
  %30 = getelementptr inbounds %"class.std::vector", ptr %27, i64 %29
  br label %31

31:                                               ; preds = %31, %26
  %32 = phi ptr [ %27, %26 ], [ %33, %31 ]
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %32) #4
  %33 = getelementptr inbounds i8, ptr %32, i64 24
  %34 = icmp eq ptr %33, %30
  br i1 %34, label %.loopexit61, label %31

.loopexit61:                                      ; preds = %31, %._crit_edge
  %35 = phi i1 [ true, %._crit_edge ], [ false, %31 ]
  %36 = phi ptr [ %16, %._crit_edge ], [ %27, %31 ]
  %37 = phi ptr [ %15, %._crit_edge ], [ %28, %31 ]
  %38 = phi i64 [ 0, %._crit_edge ], [ %29, %31 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  %39 = load i32, ptr @N, align 4, !tbaa !5
  %40 = icmp sgt i32 %39, 0
  br i1 %40, label %.lr.ph72, label %._crit_edge73.thread

._crit_edge73.thread:                             ; preds = %.loopexit61
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  br label %._crit_edge91

._crit_edge73:                                    ; preds = %47
  %41 = icmp sgt i32 %50, 1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  br i1 %41, label %.lr.ph90, label %._crit_edge91

.lr.ph72:                                         ; preds = %.loopexit61, %47
  %storemerge70 = phi i32 [ %49, %47 ], [ 0, %.loopexit61 ]
  %42 = sext i32 %storemerge70 to i64
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %42) #4
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds %"class.std::vector", ptr %36, i64 %45
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %46, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %47 unwind label %52

47:                                               ; preds = %.lr.ph72
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %3, align 4, !tbaa !5
  %50 = load i32, ptr @N, align 4, !tbaa !5
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %.lr.ph72, label %._crit_edge73, !llvm.loop !11

52:                                               ; preds = %.lr.ph72
  %53 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  br label %129

.lr.ph90:                                         ; preds = %._crit_edge73, %114
  %storemerge5088 = phi i32 [ %116, %114 ], [ 0, %._crit_edge73 ]
  %54 = sext i32 %storemerge5088 to i64
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %54) #4
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %58) #4
  store i32 0, ptr %59, align 4, !tbaa !5
  %60 = sext i32 %56 to i64
  %61 = getelementptr inbounds %"class.std::vector", ptr %36, i64 %60
  br label %62

62:                                               ; preds = %62, %.lr.ph90
  %indvars.iv96 = phi i64 [ %indvars.iv.next97, %62 ], [ 0, %.lr.ph90 ]
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %61, i64 noundef %indvars.iv96) #4
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %.not51 = icmp eq i32 %64, %65
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  br i1 %.not51, label %66, label %62, !llvm.loop !12

66:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %67 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %61) #4
  store ptr %67, ptr %7, align 8
  %68 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %7, i64 noundef %indvars.iv96) #4
  store ptr %68, ptr %6, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEC2IPivEERKNS0_IT_S5_EE(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %69 = load ptr, ptr %5, align 8
  %70 = invoke ptr @_ZNSt6vectorIiSaIiEE5eraseEN9__gnu_cxx17__normal_iteratorIPKiS1_EE(ptr noundef nonnull align 8 dereferenceable(24) %61, ptr %69)
          to label %71 unwind label %88

71:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %72 unwind label %90

72:                                               ; preds = %71
  %73 = load i32, ptr @N, align 4, !tbaa !5
  %74 = load i32, ptr %4, align 4, !tbaa !5
  %75 = xor i32 %74, -1
  %76 = add i32 %73, %75
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds %"class.std::vector", ptr %36, i64 %77
  %79 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %78) #4
  %80 = load i32, ptr @N, align 4, !tbaa !5
  %81 = load i32, ptr %4, align 4, !tbaa !5
  %82 = xor i32 %81, -1
  %83 = add i32 %80, %82
  %84 = icmp sgt i32 %83, 0
  %85 = icmp sgt i32 %56, 0
  %86 = select i1 %84, i1 %85, i1 false
  br i1 %86, label %.lr.ph84.preheader, label %._crit_edge85

.lr.ph84.preheader:                               ; preds = %72
  %87 = zext nneg i32 %83 to i64
  br label %.lr.ph84

88:                                               ; preds = %66
  %89 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br label %119

90:                                               ; preds = %71
  %91 = landingpad { ptr, i32 }
          cleanup
  br label %119

.lr.ph84:                                         ; preds = %.lr.ph84.preheader, %._crit_edge78
  %indvars.iv99 = phi i64 [ %87, %.lr.ph84.preheader ], [ %indvars.iv.next100, %._crit_edge78 ]
  %.031.in81 = phi i64 [ %79, %.lr.ph84.preheader ], [ %94, %._crit_edge78 ]
  %.03580 = phi i32 [ %56, %.lr.ph84.preheader ], [ %.136.lcssa, %._crit_edge78 ]
  %.031 = trunc i64 %.031.in81 to i32
  %92 = getelementptr %"class.std::vector", ptr %36, i64 %indvars.iv99
  %93 = getelementptr i8, ptr %92, i64 -24
  %94 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %93) #4
  %95 = icmp sgt i32 %.031, 0
  br i1 %95, label %.lr.ph77, label %._crit_edge78

.lr.ph77:                                         ; preds = %.lr.ph84, %102
  %.13275 = phi i32 [ %103, %102 ], [ %.031, %.lr.ph84 ]
  %.13674 = phi i32 [ %104, %102 ], [ %.03580, %.lr.ph84 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %92) #4
  %97 = load i32, ptr %96, align 4, !tbaa !5
  store i32 %97, ptr %8, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %98) #4
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = add nsw i32 %100, -1
  store i32 %101, ptr %99, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %93, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %102 unwind label %108

102:                                              ; preds = %.lr.ph77
  call void @_ZNSt6vectorIiSaIiEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %92) #4
  %103 = add nsw i32 %.13275, -1
  %104 = add nsw i32 %.13674, -1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  %105 = icmp sgt i32 %.13275, 1
  %106 = icmp ne i32 %104, 0
  %107 = select i1 %105, i1 %106, i1 false
  br i1 %107, label %.lr.ph77, label %._crit_edge78, !llvm.loop !13

108:                                              ; preds = %.lr.ph77
  %109 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  br label %119

._crit_edge78:                                    ; preds = %102, %.lr.ph84
  %.136.lcssa = phi i32 [ %.03580, %.lr.ph84 ], [ %104, %102 ]
  %indvars.iv.next100 = add nsw i64 %indvars.iv99, -1
  %110 = trunc nuw i64 %indvars.iv99 to i32
  %111 = icmp sgt i32 %110, 1
  %112 = icmp sgt i32 %.136.lcssa, 0
  %113 = select i1 %111, i1 %112, i1 false
  br i1 %113, label %.lr.ph84, label %._crit_edge85, !llvm.loop !14

._crit_edge85:                                    ; preds = %._crit_edge78, %72
  %.lcssa64 = phi i1 [ %85, %72 ], [ %112, %._crit_edge78 ]
  br i1 %.lcssa64, label %124, label %114

114:                                              ; preds = %._crit_edge85
  %115 = load i32, ptr %4, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %4, align 4, !tbaa !5
  %117 = load i32, ptr @N, align 4, !tbaa !5
  %118 = add nsw i32 %117, -1
  %.not52 = icmp slt i32 %116, %118
  br i1 %.not52, label %.lr.ph90, label %._crit_edge91, !llvm.loop !15

119:                                              ; preds = %108, %90, %88
  %.pn = phi { ptr, i32 } [ %109, %108 ], [ %91, %90 ], [ %89, %88 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  br label %129

._crit_edge91:                                    ; preds = %114, %._crit_edge73.thread, %._crit_edge73
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  %120 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #4
  %121 = load i32, ptr @N, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = icmp eq i64 %120, %122
  br i1 %35, label %.loopexit60, label %.preheader59.preheader

124:                                              ; preds = %._crit_edge85
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  br i1 %35, label %.loopexit60, label %.preheader59.preheader

.preheader59.preheader:                           ; preds = %._crit_edge91, %124
  %.3105 = phi i1 [ %123, %._crit_edge91 ], [ false, %124 ]
  %125 = getelementptr inbounds %"class.std::vector", ptr %36, i64 %38
  br label %.preheader59

.preheader59:                                     ; preds = %.preheader59.preheader, %.preheader59
  %126 = phi ptr [ %127, %.preheader59 ], [ %125, %.preheader59.preheader ]
  %127 = getelementptr inbounds i8, ptr %126, i64 -24
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %127) #4
  %128 = icmp eq ptr %127, %36
  br i1 %128, label %.loopexit60, label %.preheader59

.loopexit60:                                      ; preds = %.preheader59, %._crit_edge91, %124
  %.3106 = phi i1 [ %123, %._crit_edge91 ], [ false, %124 ], [ %.3105, %.preheader59 ]
  call void @llvm.stackrestore.p0(ptr %37)
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #4
  ret i1 %.3106

129:                                              ; preds = %119, %52
  %.pn54 = phi { ptr, i32 } [ %53, %52 ], [ %.pn, %119 ]
  br i1 %35, label %.loopexit, label %.preheader.preheader

.preheader.preheader:                             ; preds = %129
  %130 = getelementptr inbounds %"class.std::vector", ptr %36, i64 %38
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %131 = phi ptr [ %132, %.preheader ], [ %130, %.preheader.preheader ]
  %132 = getelementptr inbounds i8, ptr %131, i64 -24
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %132) #4
  %133 = icmp eq ptr %132, %36
  br i1 %133, label %.loopexit, label %.preheader

.loopexit:                                        ; preds = %.preheader, %129, %21
  %.pn57 = phi { ptr, i32 } [ %22, %21 ], [ %.pn54, %129 ], [ %.pn54, %.preheader ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #4
  resume { ptr, i32 } %.pn57
}

; 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 dso_local void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #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 #2 align 2

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

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 = { mustprogress nocallback nofree nosync nounwind willreturn }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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