; LLVM IR from upupming/algorithm :: acwing/算法竞赛进阶指南/0x25-广度优先搜索/172. 立体推箱子.ll (Z3bfsv)

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

@st = external dso_local global %struct.rec, align 4
@ed = external dso_local global %struct.rec, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@d = external dso_local global [510 x [510 x [3 x i32]]], align 16
@_ZL6next_x = external hidden constant [3 x [4 x i32]], align 16
@_ZL6next_y = external hidden constant [3 x [4 x i32]], align 16
@_ZL8next_lie = external hidden constant [3 x [4 x i32]], align 16

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z3bfsv() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %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 ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %struct.rec, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.rec, align 4
  %12 = alloca %struct.rec, align 4
  %13 = alloca { i64, i32 }, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %48, %0
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = icmp sle i32 %15, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %51

19:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %44, %19
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = load i32, ptr @m, align 4, !tbaa !5
  %23 = icmp sle i32 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %47

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

26:                                               ; preds = %40, %25
  %27 = load i32, ptr %5, align 4, !tbaa !5
  %28 = icmp slt i32 %27, 3
  br i1 %28, label %30, label %29

29:                                               ; preds = %26
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %43

30:                                               ; preds = %26
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [510 x [510 x [3 x i32]]], ptr @d, i64 0, i64 %32
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [510 x [3 x i32]], ptr %33, i64 0, i64 %35
  %37 = load i32, ptr %5, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [3 x i32], ptr %36, i64 0, i64 %38
  store i32 -1, ptr %39, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %30
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %5, align 4, !tbaa !5
  br label %26, !llvm.loop !9

43:                                               ; preds = %29
  br label %44

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

47:                                               ; preds = %24
  br label %48

48:                                               ; preds = %47
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %2, align 4, !tbaa !5
  br label %14, !llvm.loop !12

51:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 80, ptr %6) #5
  call void @_ZNSt5queueI3recSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  %52 = load i32, ptr @st, align 4, !tbaa !13
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [510 x [510 x [3 x i32]]], ptr @d, i64 0, i64 %53
  %55 = load i32, ptr getelementptr inbounds (%struct.rec, ptr @st, i32 0, i32 1), align 4, !tbaa !15
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [510 x [3 x i32]], ptr %54, i64 0, i64 %56
  %58 = load i32, ptr getelementptr inbounds (%struct.rec, ptr @st, i32 0, i32 2), align 4, !tbaa !16
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [3 x i32], ptr %57, i64 0, i64 %59
  store i32 0, ptr %60, align 4, !tbaa !5
  invoke void @_ZNSt5queueI3recSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 4 dereferenceable(12) @st)
          to label %61 unwind label %74

61:                                               ; preds = %51
  br label %62

62:                                               ; preds = %210, %61
  %63 = invoke noundef i64 @_ZNKSt5queueI3recSt5dequeIS0_SaIS0_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %64 unwind label %74

64:                                               ; preds = %62
  %65 = icmp ne i64 %63, 0
  br i1 %65, label %66, label %212

66:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #5
  %67 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueI3recSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %68 unwind label %78

68:                                               ; preds = %66
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %67, i64 12, i1 false), !tbaa.struct !17
  invoke void @_ZNSt5queueI3recSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %69 unwind label %78

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

70:                                               ; preds = %202, %69
  %71 = load i32, ptr %10, align 4, !tbaa !5
  %72 = icmp slt i32 %71, 4
  br i1 %72, label %82, label %73

73:                                               ; preds = %70
  store i32 13, ptr %3, align 4
  br label %205

74:                                               ; preds = %62, %51
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %7, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %8, align 4
  br label %215

78:                                               ; preds = %68, %66
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %7, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %8, align 4
  br label %211

82:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #5
  %83 = getelementptr inbounds %struct.rec, ptr %9, i32 0, i32 0
  %84 = load i32, ptr %83, align 4, !tbaa !13
  %85 = getelementptr inbounds %struct.rec, ptr %9, i32 0, i32 2
  %86 = load i32, ptr %85, align 4, !tbaa !16
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [3 x [4 x i32]], ptr @_ZL6next_x, i64 0, i64 %87
  %89 = load i32, ptr %10, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [4 x i32], ptr %88, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = add nsw i32 %84, %92
  %94 = getelementptr inbounds %struct.rec, ptr %11, i32 0, i32 0
  store i32 %93, ptr %94, align 4, !tbaa !13
  %95 = getelementptr inbounds %struct.rec, ptr %9, i32 0, i32 1
  %96 = load i32, ptr %95, align 4, !tbaa !15
  %97 = getelementptr inbounds %struct.rec, ptr %9, i32 0, i32 2
  %98 = load i32, ptr %97, align 4, !tbaa !16
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [3 x [4 x i32]], ptr @_ZL6next_y, i64 0, i64 %99
  %101 = load i32, ptr %10, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [4 x i32], ptr %100, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = add nsw i32 %96, %104
  %106 = getelementptr inbounds %struct.rec, ptr %11, i32 0, i32 1
  store i32 %105, ptr %106, align 4, !tbaa !15
  %107 = getelementptr inbounds %struct.rec, ptr %9, i32 0, i32 2
  %108 = load i32, ptr %107, align 4, !tbaa !16
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [3 x [4 x i32]], ptr @_ZL8next_lie, i64 0, i64 %109
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [4 x i32], ptr %110, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = getelementptr inbounds %struct.rec, ptr %11, i32 0, i32 2
  store i32 %114, ptr %115, align 4, !tbaa !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %11, i64 12, i1 false), !tbaa.struct !17
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %12, i64 12, i1 false)
  %116 = getelementptr inbounds { i64, i32 }, ptr %13, i32 0, i32 0
  %117 = load i64, ptr %116, align 4
  %118 = getelementptr inbounds { i64, i32 }, ptr %13, i32 0, i32 1
  %119 = load i32, ptr %118, align 4
  %120 = call noundef zeroext i1 @_Z5valid3rec(i64 %117, i32 %119)
  br i1 %120, label %122, label %121

121:                                              ; preds = %82
  store i32 15, ptr %3, align 4
  br label %199

122:                                              ; preds = %82
  %123 = getelementptr inbounds %struct.rec, ptr %11, i32 0, i32 0
  %124 = load i32, ptr %123, align 4, !tbaa !13
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [510 x [510 x [3 x i32]]], ptr @d, i64 0, i64 %125
  %127 = getelementptr inbounds %struct.rec, ptr %11, i32 0, i32 1
  %128 = load i32, ptr %127, align 4, !tbaa !15
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [510 x [3 x i32]], ptr %126, i64 0, i64 %129
  %131 = getelementptr inbounds %struct.rec, ptr %11, i32 0, i32 2
  %132 = load i32, ptr %131, align 4, !tbaa !16
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [3 x i32], ptr %130, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = icmp eq i32 %135, -1
  br i1 %136, label %137, label %198

137:                                              ; preds = %122
  %138 = getelementptr inbounds %struct.rec, ptr %9, i32 0, i32 0
  %139 = load i32, ptr %138, align 4, !tbaa !13
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [510 x [510 x [3 x i32]]], ptr @d, i64 0, i64 %140
  %142 = getelementptr inbounds %struct.rec, ptr %9, i32 0, i32 1
  %143 = load i32, ptr %142, align 4, !tbaa !15
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [510 x [3 x i32]], ptr %141, i64 0, i64 %144
  %146 = getelementptr inbounds %struct.rec, ptr %9, i32 0, i32 2
  %147 = load i32, ptr %146, align 4, !tbaa !16
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [3 x i32], ptr %145, i64 0, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  %152 = getelementptr inbounds %struct.rec, ptr %11, i32 0, i32 0
  %153 = load i32, ptr %152, align 4, !tbaa !13
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [510 x [510 x [3 x i32]]], ptr @d, i64 0, i64 %154
  %156 = getelementptr inbounds %struct.rec, ptr %11, i32 0, i32 1
  %157 = load i32, ptr %156, align 4, !tbaa !15
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [510 x [3 x i32]], ptr %155, i64 0, i64 %158
  %160 = getelementptr inbounds %struct.rec, ptr %11, i32 0, i32 2
  %161 = load i32, ptr %160, align 4, !tbaa !16
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [3 x i32], ptr %159, i64 0, i64 %162
  store i32 %151, ptr %163, align 4, !tbaa !5
  invoke void @_ZNSt5queueI3recSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 4 dereferenceable(12) %11)
          to label %164 unwind label %193

164:                                              ; preds = %137
  %165 = getelementptr inbounds %struct.rec, ptr %11, i32 0, i32 0
  %166 = load i32, ptr %165, align 4, !tbaa !13
  %167 = load i32, ptr @ed, align 4, !tbaa !13
  %168 = icmp eq i32 %166, %167
  br i1 %168, label %169, label %197

169:                                              ; preds = %164
  %170 = getelementptr inbounds %struct.rec, ptr %11, i32 0, i32 1
  %171 = load i32, ptr %170, align 4, !tbaa !15
  %172 = load i32, ptr getelementptr inbounds (%struct.rec, ptr @ed, i32 0, i32 1), align 4, !tbaa !15
  %173 = icmp eq i32 %171, %172
  br i1 %173, label %174, label %197

174:                                              ; preds = %169
  %175 = getelementptr inbounds %struct.rec, ptr %11, i32 0, i32 2
  %176 = load i32, ptr %175, align 4, !tbaa !16
  %177 = load i32, ptr getelementptr inbounds (%struct.rec, ptr @ed, i32 0, i32 2), align 4, !tbaa !16
  %178 = icmp eq i32 %176, %177
  br i1 %178, label %179, label %197

179:                                              ; preds = %174
  %180 = getelementptr inbounds %struct.rec, ptr %11, i32 0, i32 0
  %181 = load i32, ptr %180, align 4, !tbaa !13
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [510 x [510 x [3 x i32]]], ptr @d, i64 0, i64 %182
  %184 = getelementptr inbounds %struct.rec, ptr %11, i32 0, i32 1
  %185 = load i32, ptr %184, align 4, !tbaa !15
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [510 x [3 x i32]], ptr %183, i64 0, i64 %186
  %188 = getelementptr inbounds %struct.rec, ptr %11, i32 0, i32 2
  %189 = load i32, ptr %188, align 4, !tbaa !16
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [3 x i32], ptr %187, i64 0, i64 %190
  %192 = load i32, ptr %191, align 4, !tbaa !5
  store i32 %192, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %199

193:                                              ; preds = %137
  %194 = landingpad { ptr, i32 }
          cleanup
  %195 = extractvalue { ptr, i32 } %194, 0
  store ptr %195, ptr %7, align 8
  %196 = extractvalue { ptr, i32 } %194, 1
  store i32 %196, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %211

197:                                              ; preds = %174, %169, %164
  br label %198

198:                                              ; preds = %197, %122
  store i32 0, ptr %3, align 4
  br label %199

199:                                              ; preds = %198, %179, %121
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #5
  %200 = load i32, ptr %3, align 4
  switch i32 %200, label %205 [
    i32 0, label %201
    i32 15, label %202
  ]

201:                                              ; preds = %199
  br label %202

202:                                              ; preds = %201, %199
  %203 = load i32, ptr %10, align 4, !tbaa !5
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %10, align 4, !tbaa !5
  br label %70, !llvm.loop !18

205:                                              ; preds = %199, %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %206 = load i32, ptr %3, align 4
  switch i32 %206, label %208 [
    i32 13, label %207
  ]

207:                                              ; preds = %205
  store i32 0, ptr %3, align 4
  br label %208

208:                                              ; preds = %207, %205
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #5
  %209 = load i32, ptr %3, align 4
  switch i32 %209, label %213 [
    i32 0, label %210
  ]

210:                                              ; preds = %208
  br label %62, !llvm.loop !19

211:                                              ; preds = %193, %78
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #5
  br label %215

212:                                              ; preds = %64
  store i32 -1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %213

213:                                              ; preds = %212, %208
  call void @_ZNSt5queueI3recSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %6) #5
  %214 = load i32, ptr %1, align 4
  ret i32 %214

215:                                              ; preds = %211, %74
  call void @_ZNSt5queueI3recSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %6) #5
  br label %216

216:                                              ; preds = %215
  %217 = load ptr, ptr %7, align 8
  %218 = load i32, ptr %8, align 4
  %219 = insertvalue { ptr, i32 } poison, ptr %217, 0
  %220 = insertvalue { ptr, i32 } %219, i32 %218, 1
  resume { ptr, i32 } %220
}

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueI3recSt5dequeIS0_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 nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS3rec", !6, i64 0, !6, i64 4, !6, i64 8}
!15 = !{!14, !6, i64 4}
!16 = !{!14, !6, i64 8}
!17 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


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

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

@st = external dso_local global %struct.rec, align 4
@ed = external dso_local local_unnamed_addr global %struct.rec, align 4
@n = external dso_local local_unnamed_addr global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@d = external dso_local local_unnamed_addr global [510 x [510 x [3 x i32]]], align 16
@_ZL6next_x = external hidden local_unnamed_addr constant [3 x [4 x i32]], align 16
@_ZL6next_y = external hidden local_unnamed_addr constant [3 x [4 x i32]], align 16
@_ZL8next_lie = external hidden local_unnamed_addr constant [3 x [4 x i32]], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5valid3rec(i64, i32) 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 @_Z3bfsv() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::queue", align 8
  %2 = alloca %struct.rec, align 8
  %3 = load i32, ptr @n, align 4, !tbaa !5
  %.not57 = icmp slt i32 %3, 1
  br i1 %.not57, label %._crit_edge59, label %.preheader51.lr.ph

.preheader51.lr.ph:                               ; preds = %0
  %4 = load i32, ptr @m, align 4, !tbaa !5
  %.not4255 = icmp slt i32 %4, 1
  br i1 %.not4255, label %._crit_edge59, label %.preheader51.preheader

.preheader51.preheader:                           ; preds = %.preheader51.lr.ph
  %5 = zext nneg i32 %4 to i64
  %6 = mul nuw nsw i64 %5, 12
  %wide.trip.count = zext nneg i32 %3 to i64
  %xtraiter = and i64 %wide.trip.count, 7
  %7 = icmp ult i32 %3, 8
  br i1 %7, label %._crit_edge59.loopexit.unr-lcssa, label %.preheader51.preheader.new

.preheader51.preheader.new:                       ; preds = %.preheader51.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483640
  br label %.preheader51

.preheader51:                                     ; preds = %.preheader51, %.preheader51.preheader.new
  %indvar = phi i64 [ 0, %.preheader51.preheader.new ], [ %indvar.next.7, %.preheader51 ]
  %niter = phi i64 [ 0, %.preheader51.preheader.new ], [ %niter.next.7, %.preheader51 ]
  %8 = mul nuw nsw i64 %indvar, 6120
  %gep = getelementptr i8, ptr getelementptr inbounds (i8, ptr @d, i64 6132), i64 %8
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep, i8 -1, i64 %6, i1 false), !tbaa !5
  %9 = mul nuw i64 %indvar, 6120
  %gep71 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @d, i64 6132), i64 6120), i64 %9
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep71, i8 -1, i64 %6, i1 false), !tbaa !5
  %10 = mul nuw i64 %indvar, 6120
  %gep72 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @d, i64 6132), i64 12240), i64 %10
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep72, i8 -1, i64 %6, i1 false), !tbaa !5
  %11 = mul nuw i64 %indvar, 6120
  %gep73 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @d, i64 6132), i64 18360), i64 %11
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep73, i8 -1, i64 %6, i1 false), !tbaa !5
  %12 = mul nuw i64 %indvar, 6120
  %gep74 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @d, i64 6132), i64 24480), i64 %12
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep74, i8 -1, i64 %6, i1 false), !tbaa !5
  %13 = mul nuw i64 %indvar, 6120
  %gep75 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @d, i64 6132), i64 30600), i64 %13
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep75, i8 -1, i64 %6, i1 false), !tbaa !5
  %14 = mul nuw i64 %indvar, 6120
  %gep76 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @d, i64 6132), i64 36720), i64 %14
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep76, i8 -1, i64 %6, i1 false), !tbaa !5
  %15 = mul nuw i64 %indvar, 6120
  %gep77 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @d, i64 6132), i64 42840), i64 %15
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep77, i8 -1, i64 %6, i1 false), !tbaa !5
  %indvar.next.7 = add nuw nsw i64 %indvar, 8
  %niter.next.7 = add i64 %niter, 8
  %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %._crit_edge59.loopexit.unr-lcssa, label %.preheader51, !llvm.loop !9

._crit_edge59.loopexit.unr-lcssa:                 ; preds = %.preheader51, %.preheader51.preheader
  %indvar.unr = phi i64 [ 0, %.preheader51.preheader ], [ %indvar.next.7, %.preheader51 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge59, label %.preheader51.epil

.preheader51.epil:                                ; preds = %._crit_edge59.loopexit.unr-lcssa, %.preheader51.epil
  %indvar.epil = phi i64 [ %indvar.next.epil, %.preheader51.epil ], [ %indvar.unr, %._crit_edge59.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader51.epil ], [ 0, %._crit_edge59.loopexit.unr-lcssa ]
  %16 = mul nuw nsw i64 %indvar.epil, 6120
  %gep.epil = getelementptr i8, ptr getelementptr inbounds (i8, ptr @d, i64 6132), i64 %16
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep.epil, i8 -1, i64 %6, i1 false), !tbaa !5
  %indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge59, label %.preheader51.epil, !llvm.loop !11

._crit_edge59:                                    ; preds = %._crit_edge59.loopexit.unr-lcssa, %.preheader51.epil, %.preheader51.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %1) #5
  call void @_ZNSt5queueI3recSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %17 = load i32, ptr @st, align 4, !tbaa !13
  %18 = sext i32 %17 to i64
  %19 = load i32, ptr getelementptr inbounds (i8, ptr @st, i64 4), align 4, !tbaa !15
  %20 = sext i32 %19 to i64
  %21 = load i32, ptr getelementptr inbounds (i8, ptr @st, i64 8), align 4, !tbaa !16
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [510 x [510 x [3 x i32]]], ptr @d, i64 0, i64 %18, i64 %20, i64 %22
  store i32 0, ptr %23, align 4, !tbaa !5
  invoke void @_ZNSt5queueI3recSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(12) @st)
          to label %.preheader unwind label %42

.preheader:                                       ; preds = %._crit_edge59
  %24 = call noundef i64 @_ZNKSt5queueI3recSt5dequeIS0_SaIS0_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %.not3961 = icmp eq i64 %24, 0
  br i1 %.not3961, label %.loopexit49, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %25 = getelementptr inbounds i8, ptr %2, i64 4
  %26 = getelementptr inbounds i8, ptr %2, i64 8
  br label %27

27:                                               ; preds = %.lr.ph, %.loopexit
  %28 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueI3recSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %.sroa.08.0.copyload = load i32, ptr %28, align 4, !tbaa !5
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %28, i64 4
  %.sroa.6.0.copyload = load i32, ptr %.sroa.6.0..sroa_idx, align 4, !tbaa !5
  %.sroa.8.0..sroa_idx = getelementptr inbounds i8, ptr %28, i64 8
  %.sroa.8.0.copyload = load i32, ptr %.sroa.8.0..sroa_idx, align 4, !tbaa !5
  call void @_ZNSt5queueI3recSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %29 = sext i32 %.sroa.8.0.copyload to i64
  %30 = sext i32 %.sroa.08.0.copyload to i64
  %31 = sext i32 %.sroa.6.0.copyload to i64
  %32 = getelementptr inbounds [510 x [510 x [3 x i32]]], ptr @d, i64 0, i64 %30, i64 %31, i64 %29
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #5
  %33 = getelementptr inbounds [3 x [4 x i32]], ptr @_ZL6next_x, i64 0, i64 %29, i64 0
  %34 = load i32, ptr %33, align 16, !tbaa !5
  %35 = add nsw i32 %34, %.sroa.08.0.copyload
  store i32 %35, ptr %2, align 8, !tbaa !13
  %36 = getelementptr inbounds [3 x [4 x i32]], ptr @_ZL6next_y, i64 0, i64 %29, i64 0
  %37 = load i32, ptr %36, align 16, !tbaa !5
  %38 = add nsw i32 %37, %.sroa.6.0.copyload
  store i32 %38, ptr %25, align 4, !tbaa !15
  %39 = getelementptr inbounds [3 x [4 x i32]], ptr @_ZL8next_lie, i64 0, i64 %29, i64 0
  %40 = load i32, ptr %39, align 16, !tbaa !5
  store i32 %40, ptr %26, align 8, !tbaa !16
  %.sroa.02.0.copyload = load i64, ptr %2, align 8
  %41 = call noundef zeroext i1 @_Z5valid3rec(i64 %.sroa.02.0.copyload, i32 %40)
  br i1 %41, label %44, label %76

42:                                               ; preds = %._crit_edge59
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %182

44:                                               ; preds = %27
  %45 = load i32, ptr %2, align 8, !tbaa !13
  %46 = sext i32 %45 to i64
  %47 = load i32, ptr %25, align 4, !tbaa !15
  %48 = sext i32 %47 to i64
  %49 = load i32, ptr %26, align 8, !tbaa !16
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [510 x [510 x [3 x i32]]], ptr @d, i64 0, i64 %46, i64 %48, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = icmp eq i32 %52, -1
  br i1 %53, label %54, label %76

54:                                               ; preds = %44
  %55 = load i32, ptr %32, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %51, align 4, !tbaa !5
  invoke void @_ZNSt5queueI3recSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(12) %2)
          to label %57 unwind label %69

57:                                               ; preds = %54
  %58 = load i32, ptr %2, align 8, !tbaa !13
  %59 = load i32, ptr @ed, align 4, !tbaa !13
  %60 = icmp eq i32 %58, %59
  br i1 %60, label %61, label %76

61:                                               ; preds = %57
  %62 = load i32, ptr %25, align 4, !tbaa !15
  %63 = load i32, ptr getelementptr inbounds (i8, ptr @ed, i64 4), align 4, !tbaa !15
  %64 = icmp eq i32 %62, %63
  br i1 %64, label %65, label %76

65:                                               ; preds = %61
  %66 = load i32, ptr %26, align 8, !tbaa !16
  %67 = load i32, ptr getelementptr inbounds (i8, ptr @ed, i64 8), align 4, !tbaa !16
  %68 = icmp eq i32 %66, %67
  br i1 %68, label %.thread46, label %76

69:                                               ; preds = %166, %131, %96, %54
  %70 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #5
  br label %182

.thread46:                                        ; preds = %177, %142, %107, %65
  %.lcssa64 = phi i32 [ %66, %65 ], [ %108, %107 ], [ %143, %142 ], [ %178, %177 ]
  %.lcssa63 = phi i32 [ %62, %65 ], [ %104, %107 ], [ %139, %142 ], [ %174, %177 ]
  %.lcssa = phi i32 [ %58, %65 ], [ %100, %107 ], [ %135, %142 ], [ %170, %177 ]
  %71 = sext i32 %.lcssa to i64
  %72 = sext i32 %.lcssa63 to i64
  %73 = sext i32 %.lcssa64 to i64
  %74 = getelementptr inbounds [510 x [510 x [3 x i32]]], ptr @d, i64 0, i64 %71, i64 %72, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #5
  br label %.loopexit49

76:                                               ; preds = %27, %57, %61, %65, %44
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #5
  %77 = getelementptr inbounds [3 x [4 x i32]], ptr @_ZL6next_x, i64 0, i64 %29, i64 1
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = add nsw i32 %78, %.sroa.08.0.copyload
  store i32 %79, ptr %2, align 8, !tbaa !13
  %80 = getelementptr inbounds [3 x [4 x i32]], ptr @_ZL6next_y, i64 0, i64 %29, i64 1
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = add nsw i32 %81, %.sroa.6.0.copyload
  store i32 %82, ptr %25, align 4, !tbaa !15
  %83 = getelementptr inbounds [3 x [4 x i32]], ptr @_ZL8next_lie, i64 0, i64 %29, i64 1
  %84 = load i32, ptr %83, align 4, !tbaa !5
  store i32 %84, ptr %26, align 8, !tbaa !16
  %.sroa.02.0.copyload.1 = load i64, ptr %2, align 8
  %85 = call noundef zeroext i1 @_Z5valid3rec(i64 %.sroa.02.0.copyload.1, i32 %84)
  br i1 %85, label %86, label %111

86:                                               ; preds = %76
  %87 = load i32, ptr %2, align 8, !tbaa !13
  %88 = sext i32 %87 to i64
  %89 = load i32, ptr %25, align 4, !tbaa !15
  %90 = sext i32 %89 to i64
  %91 = load i32, ptr %26, align 8, !tbaa !16
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [510 x [510 x [3 x i32]]], ptr @d, i64 0, i64 %88, i64 %90, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = icmp eq i32 %94, -1
  br i1 %95, label %96, label %111

96:                                               ; preds = %86
  %97 = load i32, ptr %32, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %93, align 4, !tbaa !5
  invoke void @_ZNSt5queueI3recSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(12) %2)
          to label %99 unwind label %69

99:                                               ; preds = %96
  %100 = load i32, ptr %2, align 8, !tbaa !13
  %101 = load i32, ptr @ed, align 4, !tbaa !13
  %102 = icmp eq i32 %100, %101
  br i1 %102, label %103, label %111

103:                                              ; preds = %99
  %104 = load i32, ptr %25, align 4, !tbaa !15
  %105 = load i32, ptr getelementptr inbounds (i8, ptr @ed, i64 4), align 4, !tbaa !15
  %106 = icmp eq i32 %104, %105
  br i1 %106, label %107, label %111

107:                                              ; preds = %103
  %108 = load i32, ptr %26, align 8, !tbaa !16
  %109 = load i32, ptr getelementptr inbounds (i8, ptr @ed, i64 8), align 4, !tbaa !16
  %110 = icmp eq i32 %108, %109
  br i1 %110, label %.thread46, label %111

111:                                              ; preds = %107, %103, %99, %86, %76
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #5
  %112 = getelementptr inbounds [3 x [4 x i32]], ptr @_ZL6next_x, i64 0, i64 %29, i64 2
  %113 = load i32, ptr %112, align 8, !tbaa !5
  %114 = add nsw i32 %113, %.sroa.08.0.copyload
  store i32 %114, ptr %2, align 8, !tbaa !13
  %115 = getelementptr inbounds [3 x [4 x i32]], ptr @_ZL6next_y, i64 0, i64 %29, i64 2
  %116 = load i32, ptr %115, align 8, !tbaa !5
  %117 = add nsw i32 %116, %.sroa.6.0.copyload
  store i32 %117, ptr %25, align 4, !tbaa !15
  %118 = getelementptr inbounds [3 x [4 x i32]], ptr @_ZL8next_lie, i64 0, i64 %29, i64 2
  %119 = load i32, ptr %118, align 8, !tbaa !5
  store i32 %119, ptr %26, align 8, !tbaa !16
  %.sroa.02.0.copyload.2 = load i64, ptr %2, align 8
  %120 = call noundef zeroext i1 @_Z5valid3rec(i64 %.sroa.02.0.copyload.2, i32 %119)
  br i1 %120, label %121, label %146

121:                                              ; preds = %111
  %122 = load i32, ptr %2, align 8, !tbaa !13
  %123 = sext i32 %122 to i64
  %124 = load i32, ptr %25, align 4, !tbaa !15
  %125 = sext i32 %124 to i64
  %126 = load i32, ptr %26, align 8, !tbaa !16
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [510 x [510 x [3 x i32]]], ptr @d, i64 0, i64 %123, i64 %125, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = icmp eq i32 %129, -1
  br i1 %130, label %131, label %146

131:                                              ; preds = %121
  %132 = load i32, ptr %32, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %128, align 4, !tbaa !5
  invoke void @_ZNSt5queueI3recSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(12) %2)
          to label %134 unwind label %69

134:                                              ; preds = %131
  %135 = load i32, ptr %2, align 8, !tbaa !13
  %136 = load i32, ptr @ed, align 4, !tbaa !13
  %137 = icmp eq i32 %135, %136
  br i1 %137, label %138, label %146

138:                                              ; preds = %134
  %139 = load i32, ptr %25, align 4, !tbaa !15
  %140 = load i32, ptr getelementptr inbounds (i8, ptr @ed, i64 4), align 4, !tbaa !15
  %141 = icmp eq i32 %139, %140
  br i1 %141, label %142, label %146

142:                                              ; preds = %138
  %143 = load i32, ptr %26, align 8, !tbaa !16
  %144 = load i32, ptr getelementptr inbounds (i8, ptr @ed, i64 8), align 4, !tbaa !16
  %145 = icmp eq i32 %143, %144
  br i1 %145, label %.thread46, label %146

146:                                              ; preds = %142, %138, %134, %121, %111
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #5
  %147 = getelementptr inbounds [3 x [4 x i32]], ptr @_ZL6next_x, i64 0, i64 %29, i64 3
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = add nsw i32 %148, %.sroa.08.0.copyload
  store i32 %149, ptr %2, align 8, !tbaa !13
  %150 = getelementptr inbounds [3 x [4 x i32]], ptr @_ZL6next_y, i64 0, i64 %29, i64 3
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = add nsw i32 %151, %.sroa.6.0.copyload
  store i32 %152, ptr %25, align 4, !tbaa !15
  %153 = getelementptr inbounds [3 x [4 x i32]], ptr @_ZL8next_lie, i64 0, i64 %29, i64 3
  %154 = load i32, ptr %153, align 4, !tbaa !5
  store i32 %154, ptr %26, align 8, !tbaa !16
  %.sroa.02.0.copyload.3 = load i64, ptr %2, align 8
  %155 = call noundef zeroext i1 @_Z5valid3rec(i64 %.sroa.02.0.copyload.3, i32 %154)
  br i1 %155, label %156, label %.loopexit

156:                                              ; preds = %146
  %157 = load i32, ptr %2, align 8, !tbaa !13
  %158 = sext i32 %157 to i64
  %159 = load i32, ptr %25, align 4, !tbaa !15
  %160 = sext i32 %159 to i64
  %161 = load i32, ptr %26, align 8, !tbaa !16
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [510 x [510 x [3 x i32]]], ptr @d, i64 0, i64 %158, i64 %160, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = icmp eq i32 %164, -1
  br i1 %165, label %166, label %.loopexit

166:                                              ; preds = %156
  %167 = load i32, ptr %32, align 4, !tbaa !5
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %163, align 4, !tbaa !5
  invoke void @_ZNSt5queueI3recSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(12) %2)
          to label %169 unwind label %69

169:                                              ; preds = %166
  %170 = load i32, ptr %2, align 8, !tbaa !13
  %171 = load i32, ptr @ed, align 4, !tbaa !13
  %172 = icmp eq i32 %170, %171
  br i1 %172, label %173, label %.loopexit

173:                                              ; preds = %169
  %174 = load i32, ptr %25, align 4, !tbaa !15
  %175 = load i32, ptr getelementptr inbounds (i8, ptr @ed, i64 4), align 4, !tbaa !15
  %176 = icmp eq i32 %174, %175
  br i1 %176, label %177, label %.loopexit

177:                                              ; preds = %173
  %178 = load i32, ptr %26, align 8, !tbaa !16
  %179 = load i32, ptr getelementptr inbounds (i8, ptr @ed, i64 8), align 4, !tbaa !16
  %180 = icmp eq i32 %178, %179
  br i1 %180, label %.thread46, label %.loopexit

.loopexit:                                        ; preds = %177, %173, %169, %156, %146
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #5
  %181 = call noundef i64 @_ZNKSt5queueI3recSt5dequeIS0_SaIS0_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %.not39 = icmp eq i64 %181, 0
  br i1 %.not39, label %.loopexit49, label %27

.loopexit49:                                      ; preds = %.loopexit, %.preheader, %.thread46
  %.4 = phi i32 [ %75, %.thread46 ], [ -1, %.preheader ], [ -1, %.loopexit ]
  call void @_ZNSt5queueI3recSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #5
  ret i32 %.4

182:                                              ; preds = %69, %42
  %.pn = phi { ptr, i32 } [ %70, %69 ], [ %43, %42 ]
  call void @_ZNSt5queueI3recSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn
}

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt5queueI3recSt5dequeIS0_SaIS0_EEE4sizeEv(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(12) ptr @_ZNSt5queueI3recSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #0 align 2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

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

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


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