; LLVM IR from ritikbanger/Hacktoberfest2022-DSA :: 17. Graph/bfs_rotten_oranges.ll (Z10rotOrangesPA5_i)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z7isvalidii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z7isdelim3ele(i64) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z8checkallPA5_i(ptr noundef) #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z10rotOrangesPA5_i(ptr noundef %0) #2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::queue", align 8
  %4 = alloca %struct.ele, align 4
  %5 = alloca i32, align 4
  %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 i8, align 1
  %12 = alloca %struct.ele, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %3) #5
  call void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %13

13:                                               ; preds = %47, %1
  %14 = load i32, ptr %6, align 4, !tbaa !9
  %15 = icmp slt i32 %14, 3
  br i1 %15, label %17, label %16

16:                                               ; preds = %13
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %50

17:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %18

18:                                               ; preds = %43, %17
  %19 = load i32, ptr %8, align 4, !tbaa !9
  %20 = icmp slt i32 %19, 5
  br i1 %20, label %22, label %21

21:                                               ; preds = %18
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %46

22:                                               ; preds = %18
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = load i32, ptr %6, align 4, !tbaa !9
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [5 x i32], ptr %23, i64 %25
  %27 = load i32, ptr %8, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [5 x i32], ptr %26, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !9
  %31 = icmp eq i32 %30, 2
  br i1 %31, label %32, label %42

32:                                               ; preds = %22
  %33 = load i32, ptr %6, align 4, !tbaa !9
  %34 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 0
  store i32 %33, ptr %34, align 4, !tbaa !11
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 1
  store i32 %35, ptr %36, align 4, !tbaa !13
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(8) %4)
          to label %37 unwind label %38

37:                                               ; preds = %32
  br label %42

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

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

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

46:                                               ; preds = %21
  br label %47

47:                                               ; preds = %46
  %48 = load i32, ptr %6, align 4, !tbaa !9
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %6, align 4, !tbaa !9
  br label %13, !llvm.loop !16

50:                                               ; preds = %16
  %51 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 0
  store i32 -1, ptr %51, align 4, !tbaa !11
  %52 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 1
  store i32 -1, ptr %52, align 4, !tbaa !13
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(8) %4)
          to label %53 unwind label %93

53:                                               ; preds = %50
  br label %54

54:                                               ; preds = %258, %53
  %55 = invoke noundef zeroext i1 @_ZNKSt5queueI3eleSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %56 unwind label %93

56:                                               ; preds = %54
  %57 = xor i1 %55, true
  br i1 %57, label %58, label %259

58:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #5
  store i8 0, ptr %11, align 1, !tbaa !17
  br label %59

59:                                               ; preds = %249, %58
  %60 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %61 unwind label %97

61:                                               ; preds = %59
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %60, i64 8, i1 false), !tbaa.struct !19
  %62 = load i64, ptr %12, align 4
  %63 = call noundef zeroext i1 @_Z7isdelim3ele(i64 %62)
  %64 = xor i1 %63, true
  br i1 %64, label %65, label %250

65:                                               ; preds = %61
  %66 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %67 unwind label %97

67:                                               ; preds = %65
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %4, ptr align 4 %66, i64 8, i1 false), !tbaa.struct !19
  %68 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 0
  %69 = load i32, ptr %68, align 4, !tbaa !11
  %70 = add nsw i32 %69, 1
  %71 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 1
  %72 = load i32, ptr %71, align 4, !tbaa !13
  %73 = call noundef zeroext i1 @_Z7isvalidii(i32 noundef %70, i32 noundef %72)
  br i1 %73, label %74, label %119

74:                                               ; preds = %67
  %75 = load ptr, ptr %2, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 0
  %77 = load i32, ptr %76, align 4, !tbaa !11
  %78 = add nsw i32 %77, 1
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [5 x i32], ptr %75, i64 %79
  %81 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 1
  %82 = load i32, ptr %81, align 4, !tbaa !13
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [5 x i32], ptr %80, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !9
  %86 = icmp eq i32 %85, 1
  br i1 %86, label %87, label %119

87:                                               ; preds = %74
  %88 = load i8, ptr %11, align 1, !tbaa !17, !range !20, !noundef !21
  %89 = trunc i8 %88 to i1
  br i1 %89, label %101, label %90

90:                                               ; preds = %87
  %91 = load i32, ptr %5, align 4, !tbaa !9
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %5, align 4, !tbaa !9
  store i8 1, ptr %11, align 1, !tbaa !17
  br label %101

93:                                               ; preds = %54, %50
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %9, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %10, align 4
  br label %267

97:                                               ; preds = %254, %251, %250, %248, %233, %189, %145, %101, %65, %59
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %9, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  br label %267

101:                                              ; preds = %90, %87
  %102 = load ptr, ptr %2, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 0
  %104 = load i32, ptr %103, align 4, !tbaa !11
  %105 = add nsw i32 %104, 1
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [5 x i32], ptr %102, i64 %106
  %108 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 1
  %109 = load i32, ptr %108, align 4, !tbaa !13
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [5 x i32], ptr %107, i64 0, i64 %110
  store i32 2, ptr %111, align 4, !tbaa !9
  %112 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 0
  %113 = load i32, ptr %112, align 4, !tbaa !11
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %112, align 4, !tbaa !11
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(8) %4)
          to label %115 unwind label %97

115:                                              ; preds = %101
  %116 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 0
  %117 = load i32, ptr %116, align 4, !tbaa !11
  %118 = add nsw i32 %117, -1
  store i32 %118, ptr %116, align 4, !tbaa !11
  br label %119

119:                                              ; preds = %115, %74, %67
  %120 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 0
  %121 = load i32, ptr %120, align 4, !tbaa !11
  %122 = sub nsw i32 %121, 1
  %123 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 1
  %124 = load i32, ptr %123, align 4, !tbaa !13
  %125 = call noundef zeroext i1 @_Z7isvalidii(i32 noundef %122, i32 noundef %124)
  br i1 %125, label %126, label %163

126:                                              ; preds = %119
  %127 = load ptr, ptr %2, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 0
  %129 = load i32, ptr %128, align 4, !tbaa !11
  %130 = sub nsw i32 %129, 1
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [5 x i32], ptr %127, i64 %131
  %133 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 1
  %134 = load i32, ptr %133, align 4, !tbaa !13
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [5 x i32], ptr %132, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !9
  %138 = icmp eq i32 %137, 1
  br i1 %138, label %139, label %163

139:                                              ; preds = %126
  %140 = load i8, ptr %11, align 1, !tbaa !17, !range !20, !noundef !21
  %141 = trunc i8 %140 to i1
  br i1 %141, label %145, label %142

142:                                              ; preds = %139
  %143 = load i32, ptr %5, align 4, !tbaa !9
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %5, align 4, !tbaa !9
  store i8 1, ptr %11, align 1, !tbaa !17
  br label %145

145:                                              ; preds = %142, %139
  %146 = load ptr, ptr %2, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 0
  %148 = load i32, ptr %147, align 4, !tbaa !11
  %149 = sub nsw i32 %148, 1
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [5 x i32], ptr %146, i64 %150
  %152 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 1
  %153 = load i32, ptr %152, align 4, !tbaa !13
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [5 x i32], ptr %151, i64 0, i64 %154
  store i32 2, ptr %155, align 4, !tbaa !9
  %156 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 0
  %157 = load i32, ptr %156, align 4, !tbaa !11
  %158 = add nsw i32 %157, -1
  store i32 %158, ptr %156, align 4, !tbaa !11
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(8) %4)
          to label %159 unwind label %97

159:                                              ; preds = %145
  %160 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 0
  %161 = load i32, ptr %160, align 4, !tbaa !11
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %160, align 4, !tbaa !11
  br label %163

163:                                              ; preds = %159, %126, %119
  %164 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 0
  %165 = load i32, ptr %164, align 4, !tbaa !11
  %166 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 1
  %167 = load i32, ptr %166, align 4, !tbaa !13
  %168 = add nsw i32 %167, 1
  %169 = call noundef zeroext i1 @_Z7isvalidii(i32 noundef %165, i32 noundef %168)
  br i1 %169, label %170, label %207

170:                                              ; preds = %163
  %171 = load ptr, ptr %2, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 0
  %173 = load i32, ptr %172, align 4, !tbaa !11
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [5 x i32], ptr %171, i64 %174
  %176 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 1
  %177 = load i32, ptr %176, align 4, !tbaa !13
  %178 = add nsw i32 %177, 1
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [5 x i32], ptr %175, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !9
  %182 = icmp eq i32 %181, 1
  br i1 %182, label %183, label %207

183:                                              ; preds = %170
  %184 = load i8, ptr %11, align 1, !tbaa !17, !range !20, !noundef !21
  %185 = trunc i8 %184 to i1
  br i1 %185, label %189, label %186

186:                                              ; preds = %183
  %187 = load i32, ptr %5, align 4, !tbaa !9
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %5, align 4, !tbaa !9
  store i8 1, ptr %11, align 1, !tbaa !17
  br label %189

189:                                              ; preds = %186, %183
  %190 = load ptr, ptr %2, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 0
  %192 = load i32, ptr %191, align 4, !tbaa !11
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [5 x i32], ptr %190, i64 %193
  %195 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 1
  %196 = load i32, ptr %195, align 4, !tbaa !13
  %197 = add nsw i32 %196, 1
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [5 x i32], ptr %194, i64 0, i64 %198
  store i32 2, ptr %199, align 4, !tbaa !9
  %200 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 1
  %201 = load i32, ptr %200, align 4, !tbaa !13
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %200, align 4, !tbaa !13
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(8) %4)
          to label %203 unwind label %97

203:                                              ; preds = %189
  %204 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 1
  %205 = load i32, ptr %204, align 4, !tbaa !13
  %206 = add nsw i32 %205, -1
  store i32 %206, ptr %204, align 4, !tbaa !13
  br label %207

207:                                              ; preds = %203, %170, %163
  %208 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 0
  %209 = load i32, ptr %208, align 4, !tbaa !11
  %210 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 1
  %211 = load i32, ptr %210, align 4, !tbaa !13
  %212 = sub nsw i32 %211, 1
  %213 = call noundef zeroext i1 @_Z7isvalidii(i32 noundef %209, i32 noundef %212)
  br i1 %213, label %214, label %248

214:                                              ; preds = %207
  %215 = load ptr, ptr %2, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 0
  %217 = load i32, ptr %216, align 4, !tbaa !11
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [5 x i32], ptr %215, i64 %218
  %220 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 1
  %221 = load i32, ptr %220, align 4, !tbaa !13
  %222 = sub nsw i32 %221, 1
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [5 x i32], ptr %219, i64 0, i64 %223
  %225 = load i32, ptr %224, align 4, !tbaa !9
  %226 = icmp eq i32 %225, 1
  br i1 %226, label %227, label %248

227:                                              ; preds = %214
  %228 = load i8, ptr %11, align 1, !tbaa !17, !range !20, !noundef !21
  %229 = trunc i8 %228 to i1
  br i1 %229, label %233, label %230

230:                                              ; preds = %227
  %231 = load i32, ptr %5, align 4, !tbaa !9
  %232 = add nsw i32 %231, 1
  store i32 %232, ptr %5, align 4, !tbaa !9
  store i8 1, ptr %11, align 1, !tbaa !17
  br label %233

233:                                              ; preds = %230, %227
  %234 = load ptr, ptr %2, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 0
  %236 = load i32, ptr %235, align 4, !tbaa !11
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [5 x i32], ptr %234, i64 %237
  %239 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 1
  %240 = load i32, ptr %239, align 4, !tbaa !13
  %241 = sub nsw i32 %240, 1
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [5 x i32], ptr %238, i64 0, i64 %242
  store i32 2, ptr %243, align 4, !tbaa !9
  %244 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 1
  %245 = load i32, ptr %244, align 4, !tbaa !13
  %246 = add nsw i32 %245, -1
  store i32 %246, ptr %244, align 4, !tbaa !13
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(8) %4)
          to label %247 unwind label %97

247:                                              ; preds = %233
  br label %248

248:                                              ; preds = %247, %214, %207
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %249 unwind label %97

249:                                              ; preds = %248
  br label %59, !llvm.loop !22

250:                                              ; preds = %61
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %251 unwind label %97

251:                                              ; preds = %250
  %252 = invoke noundef zeroext i1 @_ZNKSt5queueI3eleSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %253 unwind label %97

253:                                              ; preds = %251
  br i1 %252, label %258, label %254

254:                                              ; preds = %253
  %255 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 0
  store i32 -1, ptr %255, align 4, !tbaa !11
  %256 = getelementptr inbounds %struct.ele, ptr %4, i32 0, i32 1
  store i32 -1, ptr %256, align 4, !tbaa !13
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(8) %4)
          to label %257 unwind label %97

257:                                              ; preds = %254
  br label %258

258:                                              ; preds = %257, %253
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  br label %54, !llvm.loop !23

259:                                              ; preds = %56
  %260 = load ptr, ptr %2, align 8, !tbaa !5
  %261 = call noundef zeroext i1 @_Z8checkallPA5_i(ptr noundef %260)
  br i1 %261, label %262, label %263

262:                                              ; preds = %259
  br label %265

263:                                              ; preds = %259
  %264 = load i32, ptr %5, align 4, !tbaa !9
  br label %265

265:                                              ; preds = %263, %262
  %266 = phi i32 [ -1, %262 ], [ %264, %263 ]
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %3) #5
  ret i32 %266

267:                                              ; preds = %97, %93, %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %3) #5
  br label %268

268:                                              ; preds = %267
  %269 = load ptr, ptr %9, align 8
  %270 = load i32, ptr %10, align 4
  %271 = insertvalue { ptr, i32 } poison, ptr %269, 0
  %272 = insertvalue { ptr, i32 } %271, i32 %270, 1
  resume { ptr, i32 } %272
}

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTS3ele", !10, i64 0, !10, i64 4}
!13 = !{!12, !10, i64 4}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = !{!18, !18, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{i64 0, i64 4, !9, i64 4, i64 4, !9}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = distinct !{!22, !15}
!23 = distinct !{!23, !15}


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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z7isvalidii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z7isdelim3ele(i64) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z8checkallPA5_i(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z10rotOrangesPA5_i(ptr noundef %0) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
.preheader53:
  %1 = alloca %"class.std::queue", align 8
  %2 = alloca %struct.ele, align 8
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %1) #4
  call void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  %3 = getelementptr inbounds i8, ptr %2, i64 4
  %4 = load i32, ptr %0, align 4, !tbaa !5
  %5 = icmp eq i32 %4, 2
  br i1 %5, label %7, label %10

.preheader52:                                     ; preds = %78
  %6 = call noundef zeroext i1 @_ZNKSt5queueI3eleSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %6, label %._crit_edge65, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader52
  %invariant.gep59 = getelementptr i8, ptr %0, i64 -20
  br label %.preheader

7:                                                ; preds = %.preheader53
  store i32 0, ptr %2, align 8, !tbaa !9
  store i32 0, ptr %3, align 4, !tbaa !11
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %10 unwind label %8

8:                                                ; preds = %77, %72, %67, %62, %57, %53, %48, %43, %38, %33, %29, %24, %19, %14, %7
  %9 = landingpad { ptr, i32 }
          cleanup
  br label %165

10:                                               ; preds = %.preheader53, %7
  %11 = getelementptr inbounds i8, ptr %0, i64 4
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = icmp eq i32 %12, 2
  br i1 %13, label %14, label %15

14:                                               ; preds = %10
  store i32 0, ptr %2, align 8, !tbaa !9
  store i32 1, ptr %3, align 4, !tbaa !11
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %15 unwind label %8

15:                                               ; preds = %14, %10
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = icmp eq i32 %17, 2
  br i1 %18, label %19, label %20

19:                                               ; preds = %15
  store i32 0, ptr %2, align 8, !tbaa !9
  store i32 2, ptr %3, align 4, !tbaa !11
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %20 unwind label %8

20:                                               ; preds = %19, %15
  %21 = getelementptr inbounds i8, ptr %0, i64 12
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = icmp eq i32 %22, 2
  br i1 %23, label %24, label %25

24:                                               ; preds = %20
  store i32 0, ptr %2, align 8, !tbaa !9
  store i32 3, ptr %3, align 4, !tbaa !11
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %25 unwind label %8

25:                                               ; preds = %24, %20
  %26 = getelementptr inbounds i8, ptr %0, i64 16
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = icmp eq i32 %27, 2
  br i1 %28, label %29, label %.preheader53.1

29:                                               ; preds = %25
  store i32 0, ptr %2, align 8, !tbaa !9
  store i32 4, ptr %3, align 4, !tbaa !11
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %.preheader53.1 unwind label %8

.preheader53.1:                                   ; preds = %29, %25
  %30 = getelementptr i8, ptr %0, i64 20
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = icmp eq i32 %31, 2
  br i1 %32, label %33, label %34

33:                                               ; preds = %.preheader53.1
  store i32 1, ptr %2, align 8, !tbaa !9
  store i32 0, ptr %3, align 4, !tbaa !11
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %34 unwind label %8

34:                                               ; preds = %33, %.preheader53.1
  %35 = getelementptr inbounds i8, ptr %0, i64 24
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = icmp eq i32 %36, 2
  br i1 %37, label %38, label %39

38:                                               ; preds = %34
  store i32 1, ptr %2, align 8, !tbaa !9
  store i32 1, ptr %3, align 4, !tbaa !11
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %39 unwind label %8

39:                                               ; preds = %38, %34
  %40 = getelementptr inbounds i8, ptr %0, i64 28
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = icmp eq i32 %41, 2
  br i1 %42, label %43, label %44

43:                                               ; preds = %39
  store i32 1, ptr %2, align 8, !tbaa !9
  store i32 2, ptr %3, align 4, !tbaa !11
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %44 unwind label %8

44:                                               ; preds = %43, %39
  %45 = getelementptr inbounds i8, ptr %0, i64 32
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = icmp eq i32 %46, 2
  br i1 %47, label %48, label %49

48:                                               ; preds = %44
  store i32 1, ptr %2, align 8, !tbaa !9
  store i32 3, ptr %3, align 4, !tbaa !11
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %49 unwind label %8

49:                                               ; preds = %48, %44
  %50 = getelementptr inbounds i8, ptr %0, i64 36
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = icmp eq i32 %51, 2
  br i1 %52, label %53, label %.preheader53.2

53:                                               ; preds = %49
  store i32 1, ptr %2, align 8, !tbaa !9
  store i32 4, ptr %3, align 4, !tbaa !11
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %.preheader53.2 unwind label %8

.preheader53.2:                                   ; preds = %53, %49
  %54 = getelementptr inbounds i8, ptr %0, i64 40
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = icmp eq i32 %55, 2
  br i1 %56, label %57, label %58

57:                                               ; preds = %.preheader53.2
  store i32 2, ptr %2, align 8, !tbaa !9
  store i32 0, ptr %3, align 4, !tbaa !11
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %58 unwind label %8

58:                                               ; preds = %57, %.preheader53.2
  %59 = getelementptr inbounds i8, ptr %0, i64 44
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = icmp eq i32 %60, 2
  br i1 %61, label %62, label %63

62:                                               ; preds = %58
  store i32 2, ptr %2, align 8, !tbaa !9
  store i32 1, ptr %3, align 4, !tbaa !11
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %63 unwind label %8

63:                                               ; preds = %62, %58
  %64 = getelementptr inbounds i8, ptr %0, i64 48
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = icmp eq i32 %65, 2
  br i1 %66, label %67, label %68

67:                                               ; preds = %63
  store i32 2, ptr %2, align 8, !tbaa !9
  store i32 2, ptr %3, align 4, !tbaa !11
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %68 unwind label %8

68:                                               ; preds = %67, %63
  %69 = getelementptr inbounds i8, ptr %0, i64 52
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = icmp eq i32 %70, 2
  br i1 %71, label %72, label %73

72:                                               ; preds = %68
  store i32 2, ptr %2, align 8, !tbaa !9
  store i32 3, ptr %3, align 4, !tbaa !11
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %73 unwind label %8

73:                                               ; preds = %72, %68
  %74 = getelementptr inbounds i8, ptr %0, i64 56
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = icmp eq i32 %75, 2
  br i1 %76, label %77, label %78

77:                                               ; preds = %73
  store i32 2, ptr %2, align 8, !tbaa !9
  store i32 4, ptr %3, align 4, !tbaa !11
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %78 unwind label %8

78:                                               ; preds = %77, %73
  store i32 -1, ptr %2, align 8, !tbaa !9
  store i32 -1, ptr %3, align 4, !tbaa !11
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %.preheader52 unwind label %96

.preheader:                                       ; preds = %.preheader.lr.ph, %161
  %.064 = phi i32 [ 0, %.preheader.lr.ph ], [ %.1.lcssa, %161 ]
  %79 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %.sroa.0.0.copyload61 = load i64, ptr %79, align 4
  %80 = call noundef zeroext i1 @_Z7isdelim3ele(i64 %.sroa.0.0.copyload61)
  br i1 %80, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %156
  %.163 = phi i32 [ %.9, %156 ], [ %.064, %.preheader ]
  %.02862 = phi i8 [ %.836, %156 ], [ 0, %.preheader ]
  %81 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %82 = load i64, ptr %81, align 4
  store i64 %82, ptr %2, align 8
  %83 = trunc i64 %82 to i32
  %84 = add nsw i32 %83, 1
  %85 = lshr i64 %82, 32
  %86 = trunc nuw i64 %85 to i32
  %87 = call noundef zeroext i1 @_Z7isvalidii(i32 noundef %84, i32 noundef %86)
  %.pre = load i32, ptr %2, align 8, !tbaa !9
  %.pre71 = load i32, ptr %3, align 4, !tbaa !11
  br i1 %87, label %88, label %103

88:                                               ; preds = %.lr.ph
  %89 = sext i32 %.pre to i64
  %90 = sext i32 %.pre71 to i64
  %91 = getelementptr nusw [5 x i32], ptr %30, i64 %89, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = icmp eq i32 %92, 1
  br i1 %93, label %94, label %103

94:                                               ; preds = %88
  store i32 2, ptr %91, align 4, !tbaa !5
  %95 = add nsw i32 %.pre, 1
  store i32 %95, ptr %2, align 8, !tbaa !9
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %98 unwind label %.loopexit

96:                                               ; preds = %78
  %97 = landingpad { ptr, i32 }
          cleanup
  br label %165

.loopexit:                                        ; preds = %94, %114, %133, %153
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %165

.loopexit.split-lp:                               ; preds = %160
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %165

98:                                               ; preds = %94
  %99 = trunc nuw i8 %.02862 to i1
  %not. = xor i1 %99, true
  %100 = zext i1 %not. to i32
  %spec.select42 = add nsw i32 %.163, %100
  %spec.select = select i1 %99, i8 %.02862, i8 1
  %101 = load i32, ptr %2, align 8, !tbaa !9
  %102 = add nsw i32 %101, -1
  store i32 %102, ptr %2, align 8, !tbaa !9
  %.pre70 = load i32, ptr %3, align 4, !tbaa !11
  br label %103

103:                                              ; preds = %98, %88, %.lr.ph
  %104 = phi i32 [ %.pre70, %98 ], [ %.pre71, %88 ], [ %.pre71, %.lr.ph ]
  %105 = phi i32 [ %102, %98 ], [ %.pre, %88 ], [ %.pre, %.lr.ph ]
  %.230 = phi i8 [ %spec.select, %98 ], [ %.02862, %88 ], [ %.02862, %.lr.ph ]
  %.3 = phi i32 [ %spec.select42, %98 ], [ %.163, %88 ], [ %.163, %.lr.ph ]
  %106 = add nsw i32 %105, -1
  %107 = call noundef zeroext i1 @_Z7isvalidii(i32 noundef %106, i32 noundef %104)
  %.pre72 = load i32, ptr %2, align 8, !tbaa !9
  %.pre74 = load i32, ptr %3, align 4, !tbaa !11
  br i1 %107, label %108, label %121

108:                                              ; preds = %103
  %109 = sext i32 %.pre72 to i64
  %110 = sext i32 %.pre74 to i64
  %111 = getelementptr nusw [5 x i32], ptr %invariant.gep59, i64 %109, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = icmp eq i32 %112, 1
  br i1 %113, label %114, label %121

114:                                              ; preds = %108
  store i32 2, ptr %111, align 4, !tbaa !5
  %115 = add nsw i32 %.pre72, -1
  store i32 %115, ptr %2, align 8, !tbaa !9
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %116 unwind label %.loopexit

116:                                              ; preds = %114
  %117 = trunc nuw i8 %.230 to i1
  %not.49 = xor i1 %117, true
  %118 = zext i1 %not.49 to i32
  %spec.select44 = add nsw i32 %.3, %118
  %spec.select43 = select i1 %117, i8 %.230, i8 1
  %119 = load i32, ptr %2, align 8, !tbaa !9
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %2, align 8, !tbaa !9
  %.pre73 = load i32, ptr %3, align 4, !tbaa !11
  br label %121

121:                                              ; preds = %116, %108, %103
  %122 = phi i32 [ %.pre73, %116 ], [ %.pre74, %108 ], [ %.pre74, %103 ]
  %123 = phi i32 [ %120, %116 ], [ %.pre72, %108 ], [ %.pre72, %103 ]
  %.432 = phi i8 [ %spec.select43, %116 ], [ %.230, %108 ], [ %.230, %103 ]
  %.5 = phi i32 [ %spec.select44, %116 ], [ %.3, %108 ], [ %.3, %103 ]
  %124 = add nsw i32 %122, 1
  %125 = call noundef zeroext i1 @_Z7isvalidii(i32 noundef %123, i32 noundef %124)
  %.pre76 = load i32, ptr %2, align 8, !tbaa !9
  %.pre77 = load i32, ptr %3, align 4, !tbaa !11
  br i1 %125, label %126, label %139

126:                                              ; preds = %121
  %127 = sext i32 %.pre76 to i64
  %128 = add nsw i32 %.pre77, 1
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [5 x i32], ptr %0, i64 %127, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = icmp eq i32 %131, 1
  br i1 %132, label %133, label %139

133:                                              ; preds = %126
  store i32 2, ptr %130, align 4, !tbaa !5
  store i32 %128, ptr %3, align 4, !tbaa !11
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %134 unwind label %.loopexit

134:                                              ; preds = %133
  %135 = trunc nuw i8 %.432 to i1
  %not.50 = xor i1 %135, true
  %136 = zext i1 %not.50 to i32
  %spec.select46 = add nsw i32 %.5, %136
  %spec.select45 = select i1 %135, i8 %.432, i8 1
  %137 = load i32, ptr %3, align 4, !tbaa !11
  %138 = add nsw i32 %137, -1
  store i32 %138, ptr %3, align 4, !tbaa !11
  %.pre75 = load i32, ptr %2, align 8, !tbaa !9
  br label %139

139:                                              ; preds = %134, %126, %121
  %140 = phi i32 [ %138, %134 ], [ %.pre77, %126 ], [ %.pre77, %121 ]
  %141 = phi i32 [ %.pre75, %134 ], [ %.pre76, %126 ], [ %.pre76, %121 ]
  %.634 = phi i8 [ %spec.select45, %134 ], [ %.432, %126 ], [ %.432, %121 ]
  %.7 = phi i32 [ %spec.select46, %134 ], [ %.5, %126 ], [ %.5, %121 ]
  %142 = add nsw i32 %140, -1
  %143 = call noundef zeroext i1 @_Z7isvalidii(i32 noundef %141, i32 noundef %142)
  br i1 %143, label %144, label %156

144:                                              ; preds = %139
  %145 = load i32, ptr %2, align 8, !tbaa !9
  %146 = sext i32 %145 to i64
  %147 = load i32, ptr %3, align 4, !tbaa !11
  %148 = add nsw i32 %147, -1
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [5 x i32], ptr %0, i64 %146, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = icmp eq i32 %151, 1
  br i1 %152, label %153, label %156

153:                                              ; preds = %144
  %154 = trunc nuw i8 %.634 to i1
  %spec.select47 = select i1 %154, i8 %.634, i8 1
  %not.51 = xor i1 %154, true
  %155 = zext i1 %not.51 to i32
  %spec.select48 = add nsw i32 %.7, %155
  store i32 2, ptr %150, align 4, !tbaa !5
  store i32 %148, ptr %3, align 4, !tbaa !11
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %156 unwind label %.loopexit

156:                                              ; preds = %153, %144, %139
  %.836 = phi i8 [ %spec.select47, %153 ], [ %.634, %144 ], [ %.634, %139 ]
  %.9 = phi i32 [ %spec.select48, %153 ], [ %.7, %144 ], [ %.7, %139 ]
  call void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %157 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %.sroa.0.0.copyload = load i64, ptr %157, align 4
  %158 = call noundef zeroext i1 @_Z7isdelim3ele(i64 %.sroa.0.0.copyload)
  br i1 %158, label %._crit_edge, label %.lr.ph, !llvm.loop !12

._crit_edge:                                      ; preds = %156, %.preheader
  %.1.lcssa = phi i32 [ %.064, %.preheader ], [ %.9, %156 ]
  call void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %159 = call noundef zeroext i1 @_ZNKSt5queueI3eleSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %159, label %161, label %160

160:                                              ; preds = %._crit_edge
  store i32 -1, ptr %2, align 8, !tbaa !9
  store i32 -1, ptr %3, align 4, !tbaa !11
  invoke void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %161 unwind label %.loopexit.split-lp

161:                                              ; preds = %160, %._crit_edge
  %162 = call noundef zeroext i1 @_ZNKSt5queueI3eleSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %162, label %._crit_edge65, label %.preheader, !llvm.loop !14

._crit_edge65:                                    ; preds = %161, %.preheader52
  %.0.lcssa = phi i32 [ 0, %.preheader52 ], [ %.1.lcssa, %161 ]
  %163 = call noundef zeroext i1 @_Z8checkallPA5_i(ptr noundef nonnull %0)
  %164 = select i1 %163, i32 -1, i32 %.0.lcssa
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  call void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #4
  ret i32 %164

165:                                              ; preds = %.loopexit, %.loopexit.split-lp, %96, %8
  %.pn = phi { ptr, i32 } [ %9, %8 ], [ %97, %96 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  call void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #4
  resume { ptr, i32 } %.pn
}

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueI3eleSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

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

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

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


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