; LLVM IR from upupming/algorithm :: acwing/算法竞赛进阶指南/0x29-总结与练习/191. 天气预报.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"

%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<P, std::allocator<P>>::_Deque_impl" }
%"struct.std::_Deque_base<P, std::allocator<P>>::_Deque_impl" = type { %"struct.std::_Deque_base<P, std::allocator<P>>::_Deque_impl_data" }
%"struct.std::_Deque_base<P, std::allocator<P>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%struct.P = type { i32, i32, i32, i32, i32, i32, i32 }

@n = external dso_local global i32, align 4
@g = external dso_local global [400 x [4 x [4 x i32]]], align 16
@visited = external dso_local global [400 x [3 x [3 x [7 x [7 x [7 x [7 x i8]]]]]]], align 16
@dx = external dso_local global [5 x i32], align 16
@dy = external dso_local global [5 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z3bfsv() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::queue", align 8
  %3 = alloca %struct.P, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %struct.P, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %struct.P, align 4
  %18 = load i32, ptr getelementptr inbounds ([4 x i32], ptr getelementptr inbounds ([4 x [4 x i32]], ptr @g, i64 0, i64 1), i64 0, i64 1), align 4, !tbaa !5
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %29, label %20

20:                                               ; preds = %0
  %21 = load i32, ptr getelementptr inbounds ([4 x i32], ptr getelementptr inbounds ([4 x [4 x i32]], ptr @g, i64 0, i64 1), i64 0, i64 2), align 8, !tbaa !5
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %29, label %23

23:                                               ; preds = %20
  %24 = load i32, ptr getelementptr inbounds ([4 x i32], ptr getelementptr inbounds ([4 x [4 x i32]], ptr @g, i64 0, i64 2), i64 0, i64 1), align 4, !tbaa !5
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %29, label %26

26:                                               ; preds = %23
  %27 = load i32, ptr getelementptr inbounds ([4 x i32], ptr getelementptr inbounds ([4 x [4 x i32]], ptr @g, i64 0, i64 2), i64 0, i64 2), align 8, !tbaa !5
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %30

29:                                               ; preds = %26, %23, %20, %0
  store i32 0, ptr %1, align 4
  br label %306

30:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 80, ptr %2) #6
  call void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  call void @llvm.memset.p0.i64(ptr align 16 @visited, i8 0, i64 8643600, i1 false)
  call void @llvm.lifetime.start.p0(i64 28, ptr %3) #6
  %31 = getelementptr inbounds %struct.P, ptr %3, i32 0, i32 0
  store i32 1, ptr %31, align 4, !tbaa !9
  %32 = getelementptr inbounds %struct.P, ptr %3, i32 0, i32 1
  store i32 1, ptr %32, align 4, !tbaa !11
  %33 = getelementptr inbounds %struct.P, ptr %3, i32 0, i32 2
  store i32 1, ptr %33, align 4, !tbaa !12
  %34 = getelementptr inbounds %struct.P, ptr %3, i32 0, i32 3
  store i32 1, ptr %34, align 4, !tbaa !13
  %35 = getelementptr inbounds %struct.P, ptr %3, i32 0, i32 4
  store i32 1, ptr %35, align 4, !tbaa !14
  %36 = getelementptr inbounds %struct.P, ptr %3, i32 0, i32 5
  store i32 1, ptr %36, align 4, !tbaa !15
  %37 = getelementptr inbounds %struct.P, ptr %3, i32 0, i32 6
  store i32 1, ptr %37, align 4, !tbaa !16
  invoke void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(28) %3)
          to label %38 unwind label %52

38:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 28, ptr %3) #6
  store i8 1, ptr getelementptr inbounds ([7 x i8], ptr getelementptr inbounds ([7 x [7 x i8]], ptr getelementptr inbounds ([7 x [7 x [7 x i8]]], ptr getelementptr inbounds ([7 x [7 x [7 x [7 x i8]]]], ptr getelementptr inbounds ([3 x [7 x [7 x [7 x [7 x i8]]]]], ptr getelementptr inbounds ([3 x [3 x [7 x [7 x [7 x [7 x i8]]]]]], ptr getelementptr inbounds ([400 x [3 x [3 x [7 x [7 x [7 x [7 x i8]]]]]]], ptr @visited, i64 0, i64 1), i64 0, i64 1), i64 0, i64 1), i64 0, i64 1), i64 0, i64 1), i64 0, i64 1), i64 0, i64 1), align 1, !tbaa !17
  br label %39

39:                                               ; preds = %301, %38
  %40 = invoke noundef i64 @_ZNKSt5queueI1PSt5dequeIS0_SaIS0_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
          to label %41 unwind label %56

41:                                               ; preds = %39
  %42 = icmp ne i64 %40, 0
  br i1 %42, label %43, label %303

43:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 28, ptr %6) #6
  %44 = invoke noundef nonnull align 4 dereferenceable(28) ptr @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
          to label %45 unwind label %60

45:                                               ; preds = %43
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 4 %44, i64 28, i1 false), !tbaa.struct !19
  invoke void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
          to label %46 unwind label %60

46:                                               ; preds = %45
  %47 = getelementptr inbounds %struct.P, ptr %6, i32 0, i32 0
  %48 = load i32, ptr %47, align 4, !tbaa !9
  %49 = load i32, ptr @n, align 4, !tbaa !5
  %50 = icmp eq i32 %48, %49
  br i1 %50, label %51, label %64

51:                                               ; preds = %46
  store i32 1, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %299

52:                                               ; preds = %30
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %4, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 28, ptr %3) #6
  br label %305

56:                                               ; preds = %39
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %4, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %5, align 4
  br label %305

60:                                               ; preds = %45, %43
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %4, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %5, align 4
  br label %302

64:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %295, %64
  %66 = load i32, ptr %8, align 4, !tbaa !5
  %67 = icmp slt i32 %66, 5
  br i1 %67, label %69, label %68

68:                                               ; preds = %65
  store i32 4, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %298

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

70:                                               ; preds = %287, %69
  %71 = load i32, ptr %9, align 4, !tbaa !5
  %72 = icmp sle i32 %71, 2
  br i1 %72, label %74, label %73

73:                                               ; preds = %70
  store i32 7, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %294

74:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %75 = getelementptr inbounds %struct.P, ptr %6, i32 0, i32 1
  %76 = load i32, ptr %75, align 4, !tbaa !11
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [5 x i32], ptr @dx, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = load i32, ptr %9, align 4, !tbaa !5
  %82 = mul nsw i32 %80, %81
  %83 = add nsw i32 %76, %82
  store i32 %83, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %84 = getelementptr inbounds %struct.P, ptr %6, i32 0, i32 2
  %85 = load i32, ptr %84, align 4, !tbaa !12
  %86 = load i32, ptr %8, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [5 x i32], ptr @dy, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = load i32, ptr %9, align 4, !tbaa !5
  %91 = mul nsw i32 %89, %90
  %92 = add nsw i32 %85, %91
  store i32 %92, ptr %11, align 4, !tbaa !5
  %93 = load i32, ptr %10, align 4, !tbaa !5
  %94 = icmp slt i32 %93, 0
  br i1 %94, label %104, label %95

95:                                               ; preds = %74
  %96 = load i32, ptr %10, align 4, !tbaa !5
  %97 = icmp sge i32 %96, 3
  br i1 %97, label %104, label %98

98:                                               ; preds = %95
  %99 = load i32, ptr %11, align 4, !tbaa !5
  %100 = icmp slt i32 %99, 0
  br i1 %100, label %104, label %101

101:                                              ; preds = %98
  %102 = load i32, ptr %11, align 4, !tbaa !5
  %103 = icmp sge i32 %102, 3
  br i1 %103, label %104, label %105

104:                                              ; preds = %101, %98, %95, %74
  store i32 9, ptr %7, align 4
  br label %284

105:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %106 = getelementptr inbounds %struct.P, ptr %6, i32 0, i32 0
  %107 = load i32, ptr %106, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [400 x [4 x [4 x i32]]], ptr @g, i64 0, i64 %108
  store ptr %109, ptr %12, align 8, !tbaa !20
  %110 = load ptr, ptr %12, align 8, !tbaa !20
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [4 x [4 x i32]], ptr %110, i64 0, i64 %112
  %114 = load i32, ptr %11, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [4 x i32], ptr %113, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = icmp ne i32 %117, 0
  br i1 %118, label %153, label %119

119:                                              ; preds = %105
  %120 = load ptr, ptr %12, align 8, !tbaa !20
  %121 = load i32, ptr %10, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [4 x [4 x i32]], ptr %120, i64 0, i64 %122
  %124 = load i32, ptr %11, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [4 x i32], ptr %123, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = icmp ne i32 %128, 0
  br i1 %129, label %153, label %130

130:                                              ; preds = %119
  %131 = load ptr, ptr %12, align 8, !tbaa !20
  %132 = load i32, ptr %10, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [4 x [4 x i32]], ptr %131, i64 0, i64 %134
  %136 = load i32, ptr %11, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [4 x i32], ptr %135, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = icmp ne i32 %139, 0
  br i1 %140, label %153, label %141

141:                                              ; preds = %130
  %142 = load ptr, ptr %12, align 8, !tbaa !20
  %143 = load i32, ptr %10, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [4 x [4 x i32]], ptr %142, i64 0, i64 %145
  %147 = load i32, ptr %11, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [4 x i32], ptr %146, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = icmp ne i32 %151, 0
  br i1 %152, label %153, label %154

153:                                              ; preds = %141, %130, %119, %105
  store i32 9, ptr %7, align 4
  br label %283

154:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %155 = getelementptr inbounds %struct.P, ptr %6, i32 0, i32 3
  %156 = load i32, ptr %155, align 4, !tbaa !13
  store i32 %156, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %157 = getelementptr inbounds %struct.P, ptr %6, i32 0, i32 4
  %158 = load i32, ptr %157, align 4, !tbaa !14
  store i32 %158, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %159 = getelementptr inbounds %struct.P, ptr %6, i32 0, i32 5
  %160 = load i32, ptr %159, align 4, !tbaa !15
  store i32 %160, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %161 = getelementptr inbounds %struct.P, ptr %6, i32 0, i32 6
  %162 = load i32, ptr %161, align 4, !tbaa !16
  store i32 %162, ptr %16, align 4, !tbaa !5
  %163 = load i32, ptr %10, align 4, !tbaa !5
  %164 = icmp eq i32 %163, 0
  br i1 %164, label %165, label %169

165:                                              ; preds = %154
  %166 = load i32, ptr %11, align 4, !tbaa !5
  %167 = icmp eq i32 %166, 0
  br i1 %167, label %168, label %169

168:                                              ; preds = %165
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %175

169:                                              ; preds = %165, %154
  %170 = load i32, ptr %13, align 4, !tbaa !5
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %13, align 4, !tbaa !5
  %172 = icmp eq i32 %171, 7
  br i1 %172, label %173, label %174

173:                                              ; preds = %169
  store i32 9, ptr %7, align 4
  br label %282

174:                                              ; preds = %169
  br label %175

175:                                              ; preds = %174, %168
  %176 = load i32, ptr %10, align 4, !tbaa !5
  %177 = icmp eq i32 %176, 0
  br i1 %177, label %178, label %182

178:                                              ; preds = %175
  %179 = load i32, ptr %11, align 4, !tbaa !5
  %180 = icmp eq i32 %179, 2
  br i1 %180, label %181, label %182

181:                                              ; preds = %178
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %188

182:                                              ; preds = %178, %175
  %183 = load i32, ptr %14, align 4, !tbaa !5
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %14, align 4, !tbaa !5
  %185 = icmp eq i32 %184, 7
  br i1 %185, label %186, label %187

186:                                              ; preds = %182
  store i32 9, ptr %7, align 4
  br label %282

187:                                              ; preds = %182
  br label %188

188:                                              ; preds = %187, %181
  %189 = load i32, ptr %10, align 4, !tbaa !5
  %190 = icmp eq i32 %189, 2
  br i1 %190, label %191, label %195

191:                                              ; preds = %188
  %192 = load i32, ptr %11, align 4, !tbaa !5
  %193 = icmp eq i32 %192, 0
  br i1 %193, label %194, label %195

194:                                              ; preds = %191
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %201

195:                                              ; preds = %191, %188
  %196 = load i32, ptr %15, align 4, !tbaa !5
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %15, align 4, !tbaa !5
  %198 = icmp eq i32 %197, 7
  br i1 %198, label %199, label %200

199:                                              ; preds = %195
  store i32 9, ptr %7, align 4
  br label %282

200:                                              ; preds = %195
  br label %201

201:                                              ; preds = %200, %194
  %202 = load i32, ptr %10, align 4, !tbaa !5
  %203 = icmp eq i32 %202, 2
  br i1 %203, label %204, label %208

204:                                              ; preds = %201
  %205 = load i32, ptr %11, align 4, !tbaa !5
  %206 = icmp eq i32 %205, 2
  br i1 %206, label %207, label %208

207:                                              ; preds = %204
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %214

208:                                              ; preds = %204, %201
  %209 = load i32, ptr %16, align 4, !tbaa !5
  %210 = add nsw i32 %209, 1
  store i32 %210, ptr %16, align 4, !tbaa !5
  %211 = icmp eq i32 %210, 7
  br i1 %211, label %212, label %213

212:                                              ; preds = %208
  store i32 9, ptr %7, align 4
  br label %282

213:                                              ; preds = %208
  br label %214

214:                                              ; preds = %213, %207
  %215 = getelementptr inbounds %struct.P, ptr %6, i32 0, i32 0
  %216 = load i32, ptr %215, align 4, !tbaa !9
  %217 = add nsw i32 %216, 1
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [400 x [3 x [3 x [7 x [7 x [7 x [7 x i8]]]]]]], ptr @visited, i64 0, i64 %218
  %220 = load i32, ptr %10, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [3 x [3 x [7 x [7 x [7 x [7 x i8]]]]]], ptr %219, i64 0, i64 %221
  %223 = load i32, ptr %11, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [3 x [7 x [7 x [7 x [7 x i8]]]]], ptr %222, i64 0, i64 %224
  %226 = load i32, ptr %13, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [7 x [7 x [7 x [7 x i8]]]], ptr %225, i64 0, i64 %227
  %229 = load i32, ptr %14, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [7 x [7 x [7 x i8]]], ptr %228, i64 0, i64 %230
  %232 = load i32, ptr %15, align 4, !tbaa !5
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [7 x [7 x i8]], ptr %231, i64 0, i64 %233
  %235 = load i32, ptr %16, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [7 x i8], ptr %234, i64 0, i64 %236
  %238 = load i8, ptr %237, align 1, !tbaa !17, !range !22, !noundef !23
  %239 = trunc i8 %238 to i1
  br i1 %239, label %240, label %241

240:                                              ; preds = %214
  store i32 9, ptr %7, align 4
  br label %282

241:                                              ; preds = %214
  %242 = getelementptr inbounds %struct.P, ptr %6, i32 0, i32 0
  %243 = load i32, ptr %242, align 4, !tbaa !9
  %244 = add nsw i32 %243, 1
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [400 x [3 x [3 x [7 x [7 x [7 x [7 x i8]]]]]]], ptr @visited, i64 0, i64 %245
  %247 = load i32, ptr %10, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [3 x [3 x [7 x [7 x [7 x [7 x i8]]]]]], ptr %246, i64 0, i64 %248
  %250 = load i32, ptr %11, align 4, !tbaa !5
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds [3 x [7 x [7 x [7 x [7 x i8]]]]], ptr %249, i64 0, i64 %251
  %253 = load i32, ptr %13, align 4, !tbaa !5
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [7 x [7 x [7 x [7 x i8]]]], ptr %252, i64 0, i64 %254
  %256 = load i32, ptr %14, align 4, !tbaa !5
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds [7 x [7 x [7 x i8]]], ptr %255, i64 0, i64 %257
  %259 = load i32, ptr %15, align 4, !tbaa !5
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds [7 x [7 x i8]], ptr %258, i64 0, i64 %260
  %262 = load i32, ptr %16, align 4, !tbaa !5
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds [7 x i8], ptr %261, i64 0, i64 %263
  store i8 1, ptr %264, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 28, ptr %17) #6
  %265 = getelementptr inbounds %struct.P, ptr %17, i32 0, i32 0
  %266 = getelementptr inbounds %struct.P, ptr %6, i32 0, i32 0
  %267 = load i32, ptr %266, align 4, !tbaa !9
  %268 = add nsw i32 %267, 1
  store i32 %268, ptr %265, align 4, !tbaa !9
  %269 = getelementptr inbounds %struct.P, ptr %17, i32 0, i32 1
  %270 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %270, ptr %269, align 4, !tbaa !11
  %271 = getelementptr inbounds %struct.P, ptr %17, i32 0, i32 2
  %272 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %272, ptr %271, align 4, !tbaa !12
  %273 = getelementptr inbounds %struct.P, ptr %17, i32 0, i32 3
  %274 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %274, ptr %273, align 4, !tbaa !13
  %275 = getelementptr inbounds %struct.P, ptr %17, i32 0, i32 4
  %276 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %276, ptr %275, align 4, !tbaa !14
  %277 = getelementptr inbounds %struct.P, ptr %17, i32 0, i32 5
  %278 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %278, ptr %277, align 4, !tbaa !15
  %279 = getelementptr inbounds %struct.P, ptr %17, i32 0, i32 6
  %280 = load i32, ptr %16, align 4, !tbaa !5
  store i32 %280, ptr %279, align 4, !tbaa !16
  invoke void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(28) %17)
          to label %281 unwind label %290

281:                                              ; preds = %241
  call void @llvm.lifetime.end.p0(i64 28, ptr %17) #6
  store i32 0, ptr %7, align 4
  br label %282

282:                                              ; preds = %281, %240, %212, %199, %186, %173
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %283

283:                                              ; preds = %282, %153
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %284

284:                                              ; preds = %283, %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %285 = load i32, ptr %7, align 4
  switch i32 %285, label %313 [
    i32 0, label %286
    i32 9, label %287
  ]

286:                                              ; preds = %284
  br label %287

287:                                              ; preds = %286, %284
  %288 = load i32, ptr %9, align 4, !tbaa !5
  %289 = add nsw i32 %288, 1
  store i32 %289, ptr %9, align 4, !tbaa !5
  br label %70, !llvm.loop !24

290:                                              ; preds = %241
  %291 = landingpad { ptr, i32 }
          cleanup
  %292 = extractvalue { ptr, i32 } %291, 0
  store ptr %292, ptr %4, align 8
  %293 = extractvalue { ptr, i32 } %291, 1
  store i32 %293, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 28, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %302

294:                                              ; preds = %73
  br label %295

295:                                              ; preds = %294
  %296 = load i32, ptr %8, align 4, !tbaa !5
  %297 = add nsw i32 %296, 1
  store i32 %297, ptr %8, align 4, !tbaa !5
  br label %65, !llvm.loop !26

298:                                              ; preds = %68
  store i32 0, ptr %7, align 4
  br label %299

299:                                              ; preds = %298, %51
  call void @llvm.lifetime.end.p0(i64 28, ptr %6) #6
  %300 = load i32, ptr %7, align 4
  switch i32 %300, label %304 [
    i32 0, label %301
  ]

301:                                              ; preds = %299
  br label %39, !llvm.loop !27

302:                                              ; preds = %290, %60
  call void @llvm.lifetime.end.p0(i64 28, ptr %6) #6
  br label %305

303:                                              ; preds = %41
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %304

304:                                              ; preds = %303, %299
  call void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %2) #6
  br label %306

305:                                              ; preds = %302, %56, %52
  call void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %2) #6
  br label %308

306:                                              ; preds = %304, %29
  %307 = load i32, ptr %1, align 4
  ret i32 %307

308:                                              ; preds = %305
  %309 = load ptr, ptr %4, align 8
  %310 = load i32, ptr %5, align 4
  %311 = insertvalue { ptr, i32 } poison, ptr %309, 0
  %312 = insertvalue { ptr, i32 } %311, i32 %310, 1
  resume { ptr, i32 } %312

313:                                              ; preds = %284
  unreachable
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(28) ptr @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) #3 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) #4

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

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

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

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

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


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

@n = external dso_local local_unnamed_addr global i32, align 4
@g = external dso_local local_unnamed_addr global [400 x [4 x [4 x i32]]], align 16
@visited = external dso_local local_unnamed_addr global [400 x [3 x [3 x [7 x [7 x [7 x [7 x i8]]]]]]], align 16
@dx = external dso_local local_unnamed_addr global [5 x i32], align 16
@dy = external dso_local local_unnamed_addr global [5 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z3bfsv() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::queue", align 8
  %2 = alloca %struct.P, align 16
  %3 = alloca %struct.P, align 4
  %4 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @g, i64 20), align 4
  %5 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @g, i64 36), align 4
  %6 = shufflevector <4 x i32> %4, <4 x i32> %5, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
  %.fr = freeze <4 x i32> %6
  %7 = icmp ne <4 x i32> %.fr, zeroinitializer
  %8 = bitcast <4 x i1> %7 to i4
  %.not122 = icmp eq i4 %8, 0
  br i1 %.not122, label %9, label %140

9:                                                ; preds = %0
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %1) #5
  call void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8643600) @visited, i8 0, i64 8643600, i1 false)
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %2) #5
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %2, align 16, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %2, i64 16
  store i32 1, ptr %10, align 16, !tbaa !9
  %11 = getelementptr inbounds i8, ptr %2, i64 20
  store i32 1, ptr %11, align 4, !tbaa !11
  %12 = getelementptr inbounds i8, ptr %2, i64 24
  store i32 1, ptr %12, align 8, !tbaa !12
  invoke void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(28) %2)
          to label %13 unwind label %35

13:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %2) #5
  store i8 1, ptr getelementptr inbounds (i8, ptr @visited, i64 31613), align 1, !tbaa !13
  %14 = getelementptr inbounds i8, ptr %3, i64 4
  %15 = getelementptr inbounds i8, ptr %3, i64 8
  %16 = getelementptr inbounds i8, ptr %3, i64 12
  %17 = getelementptr inbounds i8, ptr %3, i64 16
  %18 = getelementptr inbounds i8, ptr %3, i64 20
  %19 = getelementptr inbounds i8, ptr %3, i64 24
  %20 = call noundef i64 @_ZNKSt5queueI1PSt5dequeIS0_SaIS0_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %.not119 = icmp eq i64 %20, 0
  br i1 %.not119, label %.critedge, label %.lr.ph

.loopexit:                                        ; preds = %136
  %21 = call noundef i64 @_ZNKSt5queueI1PSt5dequeIS0_SaIS0_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %.not = icmp eq i64 %21, 0
  br i1 %.not, label %.critedge, label %.lr.ph, !llvm.loop !15

.lr.ph:                                           ; preds = %13, %.loopexit
  %22 = call noundef nonnull align 4 dereferenceable(28) ptr @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %.sroa.0.0.copyload = load i32, ptr %22, align 4, !tbaa !5
  %.sroa.9.0..sroa_idx = getelementptr inbounds i8, ptr %22, i64 4
  %.sroa.9.0.copyload = load i32, ptr %.sroa.9.0..sroa_idx, align 4, !tbaa !5
  %.sroa.10.0..sroa_idx = getelementptr inbounds i8, ptr %22, i64 8
  %.sroa.10.0.copyload = load i32, ptr %.sroa.10.0..sroa_idx, align 4, !tbaa !5
  %.sroa.11.0..sroa_idx = getelementptr inbounds i8, ptr %22, i64 12
  %.sroa.11.0.copyload = load i32, ptr %.sroa.11.0..sroa_idx, align 4, !tbaa !5
  %.sroa.12.0..sroa_idx = getelementptr inbounds i8, ptr %22, i64 16
  %.sroa.12.0.copyload = load i32, ptr %.sroa.12.0..sroa_idx, align 4, !tbaa !5
  %.sroa.13.0..sroa_idx = getelementptr inbounds i8, ptr %22, i64 20
  %.sroa.13.0.copyload = load i32, ptr %.sroa.13.0..sroa_idx, align 4, !tbaa !5
  %.sroa.14.0..sroa_idx = getelementptr inbounds i8, ptr %22, i64 24
  %.sroa.14.0.copyload = load i32, ptr %.sroa.14.0..sroa_idx, align 4, !tbaa !5
  call void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %.not100 = icmp eq i32 %.sroa.0.0.copyload, %23
  br i1 %.not100, label %.critedge, label %.preheader113

.preheader113:                                    ; preds = %.lr.ph
  %24 = sext i32 %.sroa.0.0.copyload to i64
  %25 = add nsw i32 %.sroa.11.0.copyload, 1
  %26 = icmp eq i32 %25, 7
  %27 = add nsw i32 %.sroa.12.0.copyload, 1
  %28 = icmp eq i32 %27, 7
  %29 = add nsw i32 %.sroa.13.0.copyload, 1
  %30 = icmp eq i32 %29, 7
  %31 = add nsw i32 %.sroa.14.0.copyload, 1
  %32 = icmp ne i32 %31, 7
  %33 = add nsw i32 %.sroa.0.0.copyload, 1
  %34 = sext i32 %33 to i64
  br label %.preheader

35:                                               ; preds = %9
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %2) #5
  br label %139

.preheader:                                       ; preds = %.preheader113, %136
  %indvars.iv = phi i64 [ 0, %.preheader113 ], [ %indvars.iv.next, %136 ]
  %37 = getelementptr inbounds [5 x i32], ptr @dx, i64 0, i64 %indvars.iv
  %38 = getelementptr inbounds [5 x i32], ptr @dy, i64 0, i64 %indvars.iv
  %39 = load i32, ptr %37, align 4, !tbaa !5
  %40 = add nsw i32 %39, %.sroa.9.0.copyload
  %41 = load i32, ptr %38, align 4, !tbaa !5
  %42 = add nsw i32 %41, %.sroa.10.0.copyload
  %or.cond7 = icmp ugt i32 %40, 2
  %43 = icmp ugt i32 %42, 2
  %or.cond11 = select i1 %or.cond7, i1 true, i1 %43
  br i1 %or.cond11, label %86, label %44

44:                                               ; preds = %.preheader
  %45 = zext nneg i32 %40 to i64
  %46 = zext nneg i32 %42 to i64
  %47 = getelementptr inbounds [400 x [4 x [4 x i32]]], ptr @g, i64 0, i64 %24, i64 %45, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %.not95 = icmp eq i32 %48, 0
  br i1 %.not95, label %49, label %86

49:                                               ; preds = %44
  %50 = add nuw nsw i32 %42, 1
  %51 = zext nneg i32 %50 to i64
  %52 = getelementptr inbounds [400 x [4 x [4 x i32]]], ptr @g, i64 0, i64 %24, i64 %45, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %.not96 = icmp eq i32 %53, 0
  br i1 %.not96, label %54, label %86

54:                                               ; preds = %49
  %55 = add nuw nsw i32 %40, 1
  %56 = zext nneg i32 %55 to i64
  %57 = getelementptr inbounds [400 x [4 x [4 x i32]]], ptr @g, i64 0, i64 %24, i64 %56, i64 %46
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %.not97 = icmp eq i32 %58, 0
  br i1 %.not97, label %59, label %86

59:                                               ; preds = %54
  %60 = getelementptr inbounds [400 x [4 x [4 x i32]]], ptr @g, i64 0, i64 %24, i64 %56, i64 %51
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %.not98 = icmp eq i32 %61, 0
  br i1 %.not98, label %62, label %86

62:                                               ; preds = %59
  %63 = icmp eq i32 %40, 0
  %64 = icmp eq i32 %42, 0
  %or.cond13 = select i1 %63, i1 %64, i1 false
  br i1 %or.cond13, label %.thread, label %65

65:                                               ; preds = %62
  br i1 %26, label %86, label %66

66:                                               ; preds = %65
  %67 = icmp eq i32 %42, 2
  %or.cond15 = select i1 %63, i1 %67, i1 false
  br i1 %or.cond15, label %.thread105, label %.thread

.thread:                                          ; preds = %62, %66
  %68 = phi i1 [ %67, %66 ], [ false, %62 ]
  %.082103 = phi i32 [ %25, %66 ], [ 0, %62 ]
  br i1 %28, label %86, label %69

69:                                               ; preds = %.thread
  %70 = icmp eq i32 %40, 2
  %or.cond17 = select i1 %70, i1 %64, i1 false
  br i1 %or.cond17, label %73, label %.thread105

.thread105:                                       ; preds = %66, %69
  %71 = phi i1 [ %70, %69 ], [ false, %66 ]
  %.081111 = phi i32 [ %27, %69 ], [ 0, %66 ]
  %.082104109 = phi i32 [ %.082103, %69 ], [ %25, %66 ]
  %72 = phi i1 [ %68, %69 ], [ true, %66 ]
  br i1 %30, label %86, label %73

73:                                               ; preds = %69, %.thread105
  %74 = phi i1 [ %71, %.thread105 ], [ true, %69 ]
  %.081112 = phi i32 [ %.081111, %.thread105 ], [ %27, %69 ]
  %.082104110 = phi i32 [ %.082104109, %.thread105 ], [ %.082103, %69 ]
  %75 = phi i1 [ %72, %.thread105 ], [ %68, %69 ]
  %.080 = phi i32 [ %29, %.thread105 ], [ 0, %69 ]
  %or.cond19 = select i1 %74, i1 %75, i1 false
  %brmerge = select i1 %or.cond19, i1 true, i1 %32
  %.mux = select i1 %or.cond19, i32 0, i32 %31
  br i1 %brmerge, label %76, label %86

76:                                               ; preds = %73
  %77 = sext i32 %.082104110 to i64
  %78 = sext i32 %.081112 to i64
  %79 = sext i32 %.080 to i64
  %80 = sext i32 %.mux to i64
  %81 = getelementptr inbounds [400 x [3 x [3 x [7 x [7 x [7 x [7 x i8]]]]]]], ptr @visited, i64 0, i64 %34, i64 %45, i64 %46, i64 %77, i64 %78, i64 %79, i64 %80
  %82 = load i8, ptr %81, align 1, !tbaa !13, !range !17, !noundef !18
  %83 = trunc nuw i8 %82 to i1
  br i1 %83, label %86, label %84

84:                                               ; preds = %76
  store i8 1, ptr %81, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %3) #5
  store i32 %33, ptr %3, align 4, !tbaa !19
  store i32 %40, ptr %14, align 4, !tbaa !20
  store i32 %42, ptr %15, align 4, !tbaa !21
  store i32 %.082104110, ptr %16, align 4, !tbaa !22
  store i32 %.081112, ptr %17, align 4, !tbaa !9
  store i32 %.080, ptr %18, align 4, !tbaa !11
  store i32 %.mux, ptr %19, align 4, !tbaa !12
  invoke void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(28) %3)
          to label %85 unwind label %137

85:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %3) #5
  %.pre = load i32, ptr %37, align 4, !tbaa !5
  %.pre118 = load i32, ptr %38, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %73, %59, %54, %49, %44, %76, %.thread105, %.thread, %65, %85, %.preheader
  %87 = phi i32 [ %41, %73 ], [ %41, %59 ], [ %41, %54 ], [ %41, %49 ], [ %41, %44 ], [ %41, %76 ], [ %41, %.thread105 ], [ %41, %.thread ], [ %41, %65 ], [ %.pre118, %85 ], [ %41, %.preheader ]
  %88 = phi i32 [ %39, %73 ], [ %39, %59 ], [ %39, %54 ], [ %39, %49 ], [ %39, %44 ], [ %39, %76 ], [ %39, %.thread105 ], [ %39, %.thread ], [ %39, %65 ], [ %.pre, %85 ], [ %39, %.preheader ]
  %89 = shl nsw i32 %88, 1
  %90 = add nsw i32 %89, %.sroa.9.0.copyload
  %91 = shl nsw i32 %87, 1
  %92 = add nsw i32 %91, %.sroa.10.0.copyload
  %or.cond7.1 = icmp ugt i32 %90, 2
  %93 = icmp ugt i32 %92, 2
  %or.cond11.1 = select i1 %or.cond7.1, i1 true, i1 %93
  br i1 %or.cond11.1, label %136, label %94

94:                                               ; preds = %86
  %95 = zext nneg i32 %90 to i64
  %96 = zext nneg i32 %92 to i64
  %97 = getelementptr inbounds [400 x [4 x [4 x i32]]], ptr @g, i64 0, i64 %24, i64 %95, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %.not95.1 = icmp eq i32 %98, 0
  br i1 %.not95.1, label %99, label %136

99:                                               ; preds = %94
  %100 = add nuw nsw i32 %92, 1
  %101 = zext nneg i32 %100 to i64
  %102 = getelementptr inbounds [400 x [4 x [4 x i32]]], ptr @g, i64 0, i64 %24, i64 %95, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %.not96.1 = icmp eq i32 %103, 0
  br i1 %.not96.1, label %104, label %136

104:                                              ; preds = %99
  %105 = add nuw nsw i32 %90, 1
  %106 = zext nneg i32 %105 to i64
  %107 = getelementptr inbounds [400 x [4 x [4 x i32]]], ptr @g, i64 0, i64 %24, i64 %106, i64 %96
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %.not97.1 = icmp eq i32 %108, 0
  br i1 %.not97.1, label %109, label %136

109:                                              ; preds = %104
  %110 = getelementptr inbounds [400 x [4 x [4 x i32]]], ptr @g, i64 0, i64 %24, i64 %106, i64 %101
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %.not98.1 = icmp eq i32 %111, 0
  br i1 %.not98.1, label %112, label %136

112:                                              ; preds = %109
  %113 = icmp eq i32 %90, 0
  %114 = icmp eq i32 %92, 0
  %or.cond13.1 = select i1 %113, i1 %114, i1 false
  br i1 %or.cond13.1, label %.thread.1, label %115

115:                                              ; preds = %112
  br i1 %26, label %136, label %116

116:                                              ; preds = %115
  %117 = icmp eq i32 %92, 2
  %or.cond15.1 = select i1 %113, i1 %117, i1 false
  br i1 %or.cond15.1, label %.thread105.1, label %.thread.1

.thread.1:                                        ; preds = %116, %112
  %118 = phi i1 [ %117, %116 ], [ false, %112 ]
  %.082103.1 = phi i32 [ %25, %116 ], [ 0, %112 ]
  br i1 %28, label %136, label %119

119:                                              ; preds = %.thread.1
  %120 = icmp eq i32 %90, 2
  %or.cond17.1 = select i1 %120, i1 %114, i1 false
  br i1 %or.cond17.1, label %123, label %.thread105.1

.thread105.1:                                     ; preds = %119, %116
  %121 = phi i1 [ %120, %119 ], [ false, %116 ]
  %.081111.1 = phi i32 [ %27, %119 ], [ 0, %116 ]
  %.082104109.1 = phi i32 [ %.082103.1, %119 ], [ %25, %116 ]
  %122 = phi i1 [ %118, %119 ], [ true, %116 ]
  br i1 %30, label %136, label %123

123:                                              ; preds = %.thread105.1, %119
  %124 = phi i1 [ %121, %.thread105.1 ], [ true, %119 ]
  %.081112.1 = phi i32 [ %.081111.1, %.thread105.1 ], [ %27, %119 ]
  %.082104110.1 = phi i32 [ %.082104109.1, %.thread105.1 ], [ %.082103.1, %119 ]
  %125 = phi i1 [ %122, %.thread105.1 ], [ %118, %119 ]
  %.080.1 = phi i32 [ %29, %.thread105.1 ], [ 0, %119 ]
  %or.cond19.1 = select i1 %124, i1 %125, i1 false
  %brmerge.1 = select i1 %or.cond19.1, i1 true, i1 %32
  %.mux.1 = select i1 %or.cond19.1, i32 0, i32 %31
  br i1 %brmerge.1, label %126, label %136

126:                                              ; preds = %123
  %127 = sext i32 %.082104110.1 to i64
  %128 = sext i32 %.081112.1 to i64
  %129 = sext i32 %.080.1 to i64
  %130 = sext i32 %.mux.1 to i64
  %131 = getelementptr inbounds [400 x [3 x [3 x [7 x [7 x [7 x [7 x i8]]]]]]], ptr @visited, i64 0, i64 %34, i64 %95, i64 %96, i64 %127, i64 %128, i64 %129, i64 %130
  %132 = load i8, ptr %131, align 1, !tbaa !13, !range !17, !noundef !18
  %133 = trunc nuw i8 %132 to i1
  br i1 %133, label %136, label %134

134:                                              ; preds = %126
  store i8 1, ptr %131, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %3) #5
  store i32 %33, ptr %3, align 4, !tbaa !19
  store i32 %90, ptr %14, align 4, !tbaa !20
  store i32 %92, ptr %15, align 4, !tbaa !21
  store i32 %.082104110.1, ptr %16, align 4, !tbaa !22
  store i32 %.081112.1, ptr %17, align 4, !tbaa !9
  store i32 %.080.1, ptr %18, align 4, !tbaa !11
  store i32 %.mux.1, ptr %19, align 4, !tbaa !12
  invoke void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(28) %3)
          to label %135 unwind label %137

135:                                              ; preds = %134
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %3) #5
  br label %136

136:                                              ; preds = %135, %126, %123, %.thread105.1, %.thread.1, %115, %109, %104, %99, %94, %86
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 5
  br i1 %exitcond.not, label %.loopexit, label %.preheader, !llvm.loop !15

137:                                              ; preds = %134, %84
  %138 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %3) #5
  br label %139

.critedge:                                        ; preds = %.loopexit, %.lr.ph, %13
  %.2.ph = phi i32 [ 0, %13 ], [ 0, %.loopexit ], [ 1, %.lr.ph ]
  call void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #5
  br label %140

139:                                              ; preds = %137, %35
  %.pn = phi { ptr, i32 } [ %138, %137 ], [ %36, %35 ]
  call void @_ZNSt5queueI1PSt5dequeIS0_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

140:                                              ; preds = %0, %.critedge
  %.3 = phi i32 [ %.2.ph, %.critedge ], [ 0, %0 ]
  ret i32 %.3
}

; 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 uwtable
declare dso_local void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #0 align 2

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 = { 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 = !{!10, !6, i64 16}
!10 = !{!"_ZTS1P", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24}
!11 = !{!10, !6, i64 20}
!12 = !{!10, !6, i64 24}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!10, !6, i64 0}
!20 = !{!10, !6, i64 4}
!21 = !{!10, !6, i64 8}
!22 = !{!10, !6, i64 12}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,VectorCombinePass