; LLVM IR from eyangch/competitive-programming :: USACOcontests/silver/2020.01/wormsort.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"

%"struct.std::pair.0" = type { i32, %"struct.std::pair" }
%"struct.std::pair" = type { i32, i32 }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"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 }

@n = external dso_local global i32, align 4
@p = external dso_local global [100000 x i32], align 16
@wh = external dso_local global [100000 x %"struct.std::pair.0"], 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 ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::queue", align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = icmp slt i32 %22, 0
  br i1 %23, label %24, label %25

24:                                               ; preds = %1
  store i1 false, ptr %2, align 1
  br label %207

25:                                               ; preds = %1
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %27 = zext i32 %26 to i64
  %28 = call ptr @llvm.stacksave.p0()
  store ptr %28, ptr %4, align 8
  %29 = alloca %"class.std::vector", i64 %27, align 16
  store i64 %27, ptr %5, align 8
  %30 = icmp eq i64 %27, 0
  br i1 %30, label %37, label %31

31:                                               ; preds = %25
  %32 = getelementptr inbounds %"class.std::vector", ptr %29, i64 %27
  br label %33

33:                                               ; preds = %33, %31
  %34 = phi ptr [ %29, %31 ], [ %35, %33 ]
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %34) #6
  %35 = getelementptr inbounds %"class.std::vector", ptr %34, i64 1
  %36 = icmp eq ptr %35, %32
  br i1 %36, label %37, label %33

37:                                               ; preds = %33, %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %64, %37
  %39 = load i32, ptr %6, align 4, !tbaa !5
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %71

43:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100000 x %"struct.std::pair.0"], ptr @wh, i64 0, i64 %45
  %47 = getelementptr inbounds %"struct.std::pair.0", ptr %46, i32 0, i32 1
  %48 = getelementptr inbounds %"struct.std::pair", ptr %47, i32 0, i32 0
  %49 = load i32, ptr %48, align 4, !tbaa !9
  store i32 %49, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %50 = load i32, ptr %6, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100000 x %"struct.std::pair.0"], ptr @wh, i64 0, i64 %51
  %53 = getelementptr inbounds %"struct.std::pair.0", ptr %52, i32 0, i32 1
  %54 = getelementptr inbounds %"struct.std::pair", ptr %53, i32 0, i32 1
  %55 = load i32, ptr %54, align 4, !tbaa !12
  store i32 %55, ptr %8, align 4, !tbaa !5
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds %"class.std::vector", ptr %29, i64 %57
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %59 unwind label %67

59:                                               ; preds = %43
  %60 = load i32, ptr %8, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds %"class.std::vector", ptr %29, i64 %61
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %62, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %63 unwind label %67

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

64:                                               ; preds = %63
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %6, align 4, !tbaa !5
  br label %38, !llvm.loop !13

67:                                               ; preds = %59, %43
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %9, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %199

71:                                               ; preds = %42
  %72 = load i32, ptr @n, align 4, !tbaa !5
  %73 = zext i32 %72 to i64
  %74 = alloca i32, i64 %73, align 16
  store i64 %73, ptr %11, align 8
  %75 = load i32, ptr @n, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds i32, ptr %74, i64 %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 -1, ptr %12, align 4, !tbaa !5
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef %74, ptr noundef %77, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %78 unwind label %84

78:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %158, %78
  %80 = load i32, ptr %13, align 4, !tbaa !5
  %81 = load i32, ptr @n, align 4, !tbaa !5
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %88, label %83

83:                                               ; preds = %79
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %163

84:                                               ; preds = %71
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %9, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %199

88:                                               ; preds = %79
  %89 = load i32, ptr %13, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds i32, ptr %74, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = icmp ne i32 %92, -1
  br i1 %93, label %94, label %95

94:                                               ; preds = %88
  br label %158

95:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 80, ptr %15) #6
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %15)
          to label %96 unwind label %113

96:                                               ; preds = %95
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %15, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %97 unwind label %117

97:                                               ; preds = %96
  br label %98

98:                                               ; preds = %155, %153, %97
  %99 = invoke noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %15)
          to label %100 unwind label %117

100:                                              ; preds = %98
  %101 = xor i1 %99, true
  br i1 %101, label %102, label %157

102:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %103 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %15)
          to label %104 unwind label %121

104:                                              ; preds = %102
  %105 = load i32, ptr %103, align 4, !tbaa !5
  store i32 %105, ptr %16, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %15)
          to label %106 unwind label %121

106:                                              ; preds = %104
  %107 = load i32, ptr %16, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds i32, ptr %74, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = icmp ne i32 %110, -1
  br i1 %111, label %112, label %125

112:                                              ; preds = %106
  store i32 8, ptr %14, align 4
  br label %153, !llvm.loop !15

113:                                              ; preds = %95
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %9, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %10, align 4
  br label %162

117:                                              ; preds = %98, %96
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %9, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %10, align 4
  br label %161

121:                                              ; preds = %104, %102
  %122 = landingpad { ptr, i32 }
          cleanup
  %123 = extractvalue { ptr, i32 } %122, 0
  store ptr %123, ptr %9, align 8
  %124 = extractvalue { ptr, i32 } %122, 1
  store i32 %124, ptr %10, align 4
  br label %156

125:                                              ; preds = %106
  %126 = load i32, ptr %13, align 4, !tbaa !5
  %127 = load i32, ptr %16, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds i32, ptr %74, i64 %128
  store i32 %126, ptr %129, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %130 = load i32, ptr %16, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds %"class.std::vector", ptr %29, i64 %131
  store ptr %132, ptr %17, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %133 = load ptr, ptr %17, align 8, !tbaa !16
  %134 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %133) #6
  %135 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %134, ptr %135, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %136 = load ptr, ptr %17, align 8, !tbaa !16
  %137 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %136) #6
  %138 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %137, ptr %138, align 8
  br label %139

139:                                              ; preds = %146, %125
  %140 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #6
  br i1 %140, label %142, label %141

141:                                              ; preds = %139
  store i32 10, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %152

142:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %143 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #6
  %144 = load i32, ptr %143, align 4, !tbaa !5
  store i32 %144, ptr %20, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %15, ptr noundef nonnull align 4 dereferenceable(4) %20)
          to label %145 unwind label %148

145:                                              ; preds = %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %146

146:                                              ; preds = %145
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #6
  br label %139

148:                                              ; preds = %142
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %9, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %156

152:                                              ; preds = %141
  store i32 0, ptr %14, align 4
  br label %153

153:                                              ; preds = %152, %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  %154 = load i32, ptr %14, align 4
  switch i32 %154, label %214 [
    i32 0, label %155
    i32 8, label %98
  ]

155:                                              ; preds = %153
  br label %98, !llvm.loop !15

156:                                              ; preds = %148, %121
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %161

157:                                              ; preds = %100
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %15) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %15) #6
  br label %158

158:                                              ; preds = %157, %94
  %159 = load i32, ptr %13, align 4, !tbaa !5
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %13, align 4, !tbaa !5
  br label %79, !llvm.loop !18

161:                                              ; preds = %156, %117
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %15) #6
  br label %162

162:                                              ; preds = %161, %113
  call void @llvm.lifetime.end.p0(i64 80, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %199

163:                                              ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %164

164:                                              ; preds = %184, %163
  %165 = load i32, ptr %21, align 4, !tbaa !5
  %166 = load i32, ptr @n, align 4, !tbaa !5
  %167 = icmp slt i32 %165, %166
  br i1 %167, label %169, label %168

168:                                              ; preds = %164
  store i32 12, ptr %14, align 4
  br label %187

169:                                              ; preds = %164
  %170 = load i32, ptr %21, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [100000 x i32], ptr @p, i64 0, i64 %171
  %173 = load i32, ptr %172, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds i32, ptr %74, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !5
  %177 = load i32, ptr %21, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds i32, ptr %74, i64 %178
  %180 = load i32, ptr %179, align 4, !tbaa !5
  %181 = icmp ne i32 %176, %180
  br i1 %181, label %182, label %183

182:                                              ; preds = %169
  store i1 false, ptr %2, align 1
  store i32 1, ptr %14, align 4
  br label %187

183:                                              ; preds = %169
  br label %184

184:                                              ; preds = %183
  %185 = load i32, ptr %21, align 4, !tbaa !5
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %21, align 4, !tbaa !5
  br label %164, !llvm.loop !19

187:                                              ; preds = %182, %168
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  %188 = load i32, ptr %14, align 4
  switch i32 %188, label %190 [
    i32 12, label %189
  ]

189:                                              ; preds = %187
  store i1 true, ptr %2, align 1
  store i32 1, ptr %14, align 4
  br label %190

190:                                              ; preds = %189, %187
  %191 = getelementptr inbounds %"class.std::vector", ptr %29, i64 %27
  %192 = icmp eq ptr %29, %191
  br i1 %192, label %197, label %193

193:                                              ; preds = %193, %190
  %194 = phi ptr [ %191, %190 ], [ %195, %193 ]
  %195 = getelementptr inbounds %"class.std::vector", ptr %194, i64 -1
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %195) #6
  %196 = icmp eq ptr %195, %29
  br i1 %196, label %197, label %193

197:                                              ; preds = %193, %190
  %198 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %198)
  br label %207

199:                                              ; preds = %162, %84, %67
  %200 = getelementptr inbounds %"class.std::vector", ptr %29, i64 %27
  %201 = icmp eq ptr %29, %200
  br i1 %201, label %206, label %202

202:                                              ; preds = %202, %199
  %203 = phi ptr [ %200, %199 ], [ %204, %202 ]
  %204 = getelementptr inbounds %"class.std::vector", ptr %203, i64 -1
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %204) #6
  %205 = icmp eq ptr %204, %29
  br i1 %205, label %206, label %202

206:                                              ; preds = %202, %199
  br label %209

207:                                              ; preds = %197, %24
  %208 = load i1, ptr %2, align 1
  ret i1 %208

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

214:                                              ; preds = %153
  unreachable
}

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 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) #1

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


; 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"

%"struct.std::pair.0" = type { i32, %"struct.std::pair" }
%"struct.std::pair" = type { i32, i32 }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"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 }

@n = external dso_local local_unnamed_addr global i32, align 4
@p = external dso_local local_unnamed_addr global [100000 x i32], align 16
@wh = external dso_local local_unnamed_addr global [100000 x %"struct.std::pair.0"], 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 i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::queue", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca i32, align 4
  %10 = icmp slt i32 %0, 0
  br i1 %10, label %106, label %11

11:                                               ; preds = %1
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = zext i32 %12 to i64
  %14 = tail call ptr @llvm.stacksave.p0()
  %15 = alloca %"class.std::vector", i64 %13, align 16
  %16 = icmp eq i32 %12, 0
  br i1 %16, label %.loopexit43, label %17

17:                                               ; preds = %11
  %18 = getelementptr inbounds %"class.std::vector", ptr %15, i64 %13
  br label %19

19:                                               ; preds = %19, %17
  %20 = phi ptr [ %15, %17 ], [ %21, %19 ]
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #7
  %21 = getelementptr inbounds i8, ptr %20, i64 24
  %22 = icmp eq ptr %21, %18
  br i1 %22, label %.loopexit43, label %19

.loopexit43:                                      ; preds = %19, %11
  %.not65 = icmp eq i32 %0, 0
  br i1 %.not65, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.loopexit43
  %smax = call i32 @llvm.smax.i32(i32 %0, i32 1)
  %wide.trip.count = zext nneg i32 %smax to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %38, %.loopexit43
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = zext i32 %23 to i64
  %25 = alloca i32, i64 %24, align 16
  %26 = sext i32 %23 to i64
  %27 = getelementptr inbounds i32, ptr %25, i64 %26
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 -1, ptr %4, align 4, !tbaa !5
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull %25, ptr noundef nonnull %27, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %41 unwind label %50

.lr.ph:                                           ; preds = %.lr.ph.preheader, %38
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %38 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %28 = getelementptr inbounds [100000 x %"struct.std::pair.0"], ptr @wh, i64 0, i64 %indvars.iv, i32 1
  %29 = load i32, ptr %28, align 4, !tbaa !9
  store i32 %29, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %30 = getelementptr inbounds i8, ptr %28, i64 4
  %31 = load i32, ptr %30, align 4, !tbaa !12
  store i32 %31, ptr %3, align 4, !tbaa !5
  %32 = sext i32 %29 to i64
  %33 = getelementptr inbounds %"class.std::vector", ptr %15, i64 %32
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %33, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %34 unwind label %39

34:                                               ; preds = %.lr.ph
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds %"class.std::vector", ptr %15, i64 %36
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %37, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %38 unwind label %39

38:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !13

39:                                               ; preds = %34, %.lr.ph
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  br label %101

41:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %.lr.ph55, label %._crit_edge56.thread

._crit_edge56.thread:                             ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %.critedge

._crit_edge56:                                    ; preds = %83
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  %.not3357 = icmp slt i32 %84, 1
  br i1 %.not3357, label %.critedge, label %.lr.ph61.preheader

.lr.ph61.preheader:                               ; preds = %._crit_edge56
  %44 = zext nneg i32 %84 to i64
  %wide.trip.count70 = zext nneg i32 %84 to i64
  %45 = load i32, ptr @p, align 16, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %25, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = load i32, ptr %25, align 16, !tbaa !5
  %.not75 = icmp eq i32 %48, %49
  br i1 %.not75, label %.lr.ph77, label %.critedge

50:                                               ; preds = %._crit_edge
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  br label %101

.lr.ph55:                                         ; preds = %41, %83
  %52 = phi i32 [ %84, %83 ], [ %42, %41 ]
  %storemerge53 = phi i32 [ %86, %83 ], [ 0, %41 ]
  %53 = sext i32 %storemerge53 to i64
  %54 = getelementptr inbounds i32, ptr %25, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %.not34 = icmp eq i32 %55, -1
  br i1 %.not34, label %56, label %83

56:                                               ; preds = %.lr.ph55
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %6) #7
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %57 unwind label %64

57:                                               ; preds = %56
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %.preheader42 unwind label %66

.preheader42:                                     ; preds = %57
  %58 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  br i1 %58, label %._crit_edge52, label %.lr.ph51

.lr.ph51:                                         ; preds = %.preheader42, %81
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  %60 = load i32, ptr %59, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds i32, ptr %25, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %.not35 = icmp eq i32 %63, -1
  br i1 %.not35, label %68, label %81, !llvm.loop !15

64:                                               ; preds = %56
  %65 = landingpad { ptr, i32 }
          cleanup
  br label %89

66:                                               ; preds = %57
  %67 = landingpad { ptr, i32 }
          cleanup
  br label %88

68:                                               ; preds = %.lr.ph51
  %69 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %69, ptr %62, align 4, !tbaa !5
  %70 = getelementptr inbounds %"class.std::vector", ptr %15, i64 %61
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %71 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %70) #7
  store ptr %71, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %72 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %70) #7
  store ptr %72, ptr %8, align 8
  %73 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br i1 %73, label %.lr.ph49, label %._crit_edge50

._crit_edge50:                                    ; preds = %76, %68
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %81

.lr.ph49:                                         ; preds = %68, %76
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %75 = load i32, ptr %74, align 4, !tbaa !5
  store i32 %75, ptr %9, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %76 unwind label %79

76:                                               ; preds = %.lr.ph49
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %78 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br i1 %78, label %.lr.ph49, label %._crit_edge50

79:                                               ; preds = %.lr.ph49
  %80 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %88

81:                                               ; preds = %.lr.ph51, %._crit_edge50
  %82 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  br i1 %82, label %._crit_edge52, label %.lr.ph51

._crit_edge52:                                    ; preds = %81, %.preheader42
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #7
  %.pre = load i32, ptr %5, align 4, !tbaa !5
  %.pre72 = load i32, ptr @n, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %.lr.ph55, %._crit_edge52
  %84 = phi i32 [ %52, %.lr.ph55 ], [ %.pre72, %._crit_edge52 ]
  %85 = phi i32 [ %storemerge53, %.lr.ph55 ], [ %.pre, %._crit_edge52 ]
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %5, align 4, !tbaa !5
  %87 = icmp slt i32 %86, %84
  br i1 %87, label %.lr.ph55, label %._crit_edge56, !llvm.loop !16

88:                                               ; preds = %79, %66
  %.pn = phi { ptr, i32 } [ %80, %79 ], [ %67, %66 ]
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #7
  br label %89

89:                                               ; preds = %88, %64
  %.pn.pn = phi { ptr, i32 } [ %.pn, %88 ], [ %65, %64 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %101

.lr.ph77:                                         ; preds = %.lr.ph61.preheader, %.lr.ph61
  %indvars.iv6876 = phi i64 [ %indvars.iv.next69, %.lr.ph61 ], [ 0, %.lr.ph61.preheader ]
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv6876, 1
  %exitcond71 = icmp eq i64 %indvars.iv.next69, %wide.trip.count70
  br i1 %exitcond71, label %.critedge.loopexit, label %.lr.ph61, !llvm.loop !17

.lr.ph61:                                         ; preds = %.lr.ph77
  %90 = getelementptr inbounds [100000 x i32], ptr @p, i64 0, i64 %indvars.iv.next69
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds i32, ptr %25, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = getelementptr inbounds i32, ptr %25, i64 %indvars.iv.next69
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %.not = icmp eq i32 %94, %96
  br i1 %.not, label %.lr.ph77, label %.critedge.loopexit, !llvm.loop !17

.critedge.loopexit:                               ; preds = %.lr.ph61, %.lr.ph77
  %.not33.le = icmp uge i64 %indvars.iv.next69, %44
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.lr.ph61.preheader, %._crit_edge56.thread, %._crit_edge56
  %.not33.lcssa = phi i1 [ true, %._crit_edge56 ], [ true, %._crit_edge56.thread ], [ false, %.lr.ph61.preheader ], [ %.not33.le, %.critedge.loopexit ]
  br i1 %16, label %.loopexit41, label %.preheader40.preheader

.preheader40.preheader:                           ; preds = %.critedge
  %97 = getelementptr inbounds %"class.std::vector", ptr %15, i64 %13
  br label %.preheader40

.preheader40:                                     ; preds = %.preheader40.preheader, %.preheader40
  %98 = phi ptr [ %99, %.preheader40 ], [ %97, %.preheader40.preheader ]
  %99 = getelementptr inbounds i8, ptr %98, i64 -24
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %99) #7
  %100 = icmp eq ptr %99, %15
  br i1 %100, label %.loopexit41, label %.preheader40

.loopexit41:                                      ; preds = %.preheader40, %.critedge
  call void @llvm.stackrestore.p0(ptr %14)
  br label %106

101:                                              ; preds = %89, %50, %39
  %.pn38 = phi { ptr, i32 } [ %40, %39 ], [ %.pn.pn, %89 ], [ %51, %50 ]
  br i1 %16, label %.loopexit, label %.preheader.preheader

.preheader.preheader:                             ; preds = %101
  %102 = getelementptr inbounds %"class.std::vector", ptr %15, i64 %13
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %103 = phi ptr [ %104, %.preheader ], [ %102, %.preheader.preheader ]
  %104 = getelementptr inbounds i8, ptr %103, i64 -24
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %104) #7
  %105 = icmp eq ptr %104, %15
  br i1 %105, label %.loopexit, label %.preheader

106:                                              ; preds = %1, %.loopexit41
  %.2 = phi i1 [ %.not33.lcssa, %.loopexit41 ], [ false, %1 ]
  ret i1 %.2

.loopexit:                                        ; preds = %.preheader, %101
  resume { ptr, i32 } %.pn38
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 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 @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 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) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #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 }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 4}
!10 = !{!"_ZTSSt4pairIiS_IiiEE", !6, i64 0, !11, i64 4}
!11 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!12 = !{!10, !6, i64 8}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}


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