; LLVM IR from upupming/algorithm :: acwing/算法竞赛进阶指南/0x26-广搜变形/177. 噩梦.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.std::pair" = type { i32, i32 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@v = external dso_local global [2 x [810 x [810 x i32]]], align 16
@dx = external dso_local global [4 x i32], align 16
@dy = external dso_local global [4 x i32], align 16
@tt = external dso_local global i32, align 4
@boy = external dso_local global %"struct.std::pair", align 4
@girl = external dso_local global %"struct.std::pair", align 4
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3bfsv() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::queue", align 8
  %2 = alloca %"class.std::queue", align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair", align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair", align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"struct.std::pair", align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca %"struct.std::pair", align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  call void @llvm.memset.p0.i64(ptr align 16 @v, i8 0, i64 5248800, i1 false)
  call void @llvm.lifetime.start.p0(i64 80, ptr %1) #8
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  call void @llvm.lifetime.start.p0(i64 80, ptr %2) #8
  invoke void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
          to label %28 unwind label %64

28:                                               ; preds = %0
  invoke void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) @boy)
          to label %29 unwind label %68

29:                                               ; preds = %28
  invoke void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(8) @girl)
          to label %30 unwind label %68

30:                                               ; preds = %29
  %31 = load i32, ptr @boy, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %32
  %34 = load i32, ptr getelementptr inbounds (%"struct.std::pair", ptr @boy, i32 0, i32 1), align 4, !tbaa !10
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [810 x i32], ptr %33, i64 0, i64 %35
  store i32 1, ptr %36, align 4, !tbaa !11
  %37 = load i32, ptr @girl, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [810 x [810 x i32]], ptr getelementptr inbounds ([2 x [810 x [810 x i32]]], ptr @v, i64 0, i64 1), i64 0, i64 %38
  %40 = load i32, ptr getelementptr inbounds (%"struct.std::pair", ptr @girl, i32 0, i32 1), align 4, !tbaa !10
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [810 x i32], ptr %39, i64 0, i64 %41
  store i32 1, ptr %42, align 4, !tbaa !11
  store i32 0, ptr @tt, align 4, !tbaa !11
  br label %43

43:                                               ; preds = %424, %30
  %44 = invoke noundef i64 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
          to label %45 unwind label %68

45:                                               ; preds = %43
  %46 = icmp ne i64 %44, 0
  br i1 %46, label %51, label %47

47:                                               ; preds = %45
  %48 = invoke noundef i64 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
          to label %49 unwind label %68

49:                                               ; preds = %47
  %50 = icmp ne i64 %48, 0
  br label %51

51:                                               ; preds = %49, %45
  %52 = phi i1 [ true, %45 ], [ %50, %49 ]
  br i1 %52, label %53, label %427

53:                                               ; preds = %51
  %54 = load i32, ptr @tt, align 4, !tbaa !11
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr @tt, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  %56 = invoke noundef i64 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
          to label %57 unwind label %72

57:                                               ; preds = %53
  %58 = trunc i64 %56 to i32
  store i32 %58, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 0, ptr %6, align 4, !tbaa !11
  br label %59

59:                                               ; preds = %145, %57
  %60 = load i32, ptr %6, align 4, !tbaa !11
  %61 = load i32, ptr %5, align 4, !tbaa !11
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %76, label %63

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

64:                                               ; preds = %0
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %3, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %4, align 4
  br label %436

68:                                               ; preds = %429, %427, %47, %43, %29, %28
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %3, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %4, align 4
  br label %435

72:                                               ; preds = %231, %149, %53
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %3, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %4, align 4
  br label %426

76:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %77 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
          to label %78 unwind label %87

78:                                               ; preds = %76
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 %77, i64 8, i1 false)
  invoke void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
          to label %79 unwind label %87

79:                                               ; preds = %78
  %80 = getelementptr inbounds %"struct.std::pair", ptr %8, i32 0, i32 0
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = getelementptr inbounds %"struct.std::pair", ptr %8, i32 0, i32 1
  %83 = load i32, ptr %82, align 4, !tbaa !10
  %84 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %81, i32 noundef %83)
          to label %85 unwind label %87

85:                                               ; preds = %79
  br i1 %84, label %91, label %86

86:                                               ; preds = %85
  store i32 6, ptr %7, align 4
  br label %142

87:                                               ; preds = %79, %78, %76
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %3, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %4, align 4
  br label %148

91:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !11
  br label %92

92:                                               ; preds = %138, %91
  %93 = load i32, ptr %9, align 4, !tbaa !11
  %94 = icmp slt i32 %93, 4
  br i1 %94, label %96, label %95

95:                                               ; preds = %92
  store i32 7, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %141

96:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %97 = getelementptr inbounds %"struct.std::pair", ptr %8, i32 0, i32 0
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = load i32, ptr %9, align 4, !tbaa !11
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [4 x i32], ptr @dx, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !11
  %103 = add nsw i32 %98, %102
  store i32 %103, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  %104 = getelementptr inbounds %"struct.std::pair", ptr %8, i32 0, i32 1
  %105 = load i32, ptr %104, align 4, !tbaa !10
  %106 = load i32, ptr %9, align 4, !tbaa !11
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [4 x i32], ptr @dy, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !11
  %110 = add nsw i32 %105, %109
  store i32 %110, ptr %11, align 4, !tbaa !11
  %111 = load i32, ptr %10, align 4, !tbaa !11
  %112 = load i32, ptr %11, align 4, !tbaa !11
  %113 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %111, i32 noundef %112)
          to label %114 unwind label %133

114:                                              ; preds = %96
  br i1 %113, label %115, label %137

115:                                              ; preds = %114
  %116 = load i32, ptr %10, align 4, !tbaa !11
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %117
  %119 = load i32, ptr %11, align 4, !tbaa !11
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [810 x i32], ptr %118, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !11
  %123 = icmp ne i32 %122, 0
  br i1 %123, label %137, label %124

124:                                              ; preds = %115
  %125 = load i32, ptr %10, align 4, !tbaa !11
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %126
  %128 = load i32, ptr %11, align 4, !tbaa !11
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [810 x i32], ptr %127, i64 0, i64 %129
  store i32 1, ptr %130, align 4, !tbaa !11
  %131 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE7emplaceIJRiS7_EEEDcDpOT_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %132 unwind label %133

132:                                              ; preds = %124
  br label %137

133:                                              ; preds = %124, %96
  %134 = landingpad { ptr, i32 }
          cleanup
  %135 = extractvalue { ptr, i32 } %134, 0
  store ptr %135, ptr %3, align 8
  %136 = extractvalue { ptr, i32 } %134, 1
  store i32 %136, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %148

137:                                              ; preds = %132, %115, %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %9, align 4, !tbaa !11
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %9, align 4, !tbaa !11
  br label %92, !llvm.loop !12

141:                                              ; preds = %95
  store i32 0, ptr %7, align 4
  br label %142

142:                                              ; preds = %141, %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  %143 = load i32, ptr %7, align 4
  switch i32 %143, label %442 [
    i32 0, label %144
    i32 6, label %145
  ]

144:                                              ; preds = %142
  br label %145

145:                                              ; preds = %144, %142
  %146 = load i32, ptr %6, align 4, !tbaa !11
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %6, align 4, !tbaa !11
  br label %59, !llvm.loop !14

148:                                              ; preds = %133, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %426

149:                                              ; preds = %63
  %150 = invoke noundef i64 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
          to label %151 unwind label %72

151:                                              ; preds = %149
  %152 = trunc i64 %150 to i32
  store i32 %152, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %153

153:                                              ; preds = %227, %151
  %154 = load i32, ptr %12, align 4, !tbaa !11
  %155 = load i32, ptr %5, align 4, !tbaa !11
  %156 = icmp slt i32 %154, %155
  br i1 %156, label %158, label %157

157:                                              ; preds = %153
  store i32 10, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %231

158:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %159 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
          to label %160 unwind label %169

160:                                              ; preds = %158
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %159, i64 8, i1 false)
  invoke void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
          to label %161 unwind label %169

161:                                              ; preds = %160
  %162 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 0
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %164 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 1
  %165 = load i32, ptr %164, align 4, !tbaa !10
  %166 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %163, i32 noundef %165)
          to label %167 unwind label %169

167:                                              ; preds = %161
  br i1 %166, label %173, label %168

168:                                              ; preds = %167
  store i32 12, ptr %7, align 4
  br label %224

169:                                              ; preds = %161, %160, %158
  %170 = landingpad { ptr, i32 }
          cleanup
  %171 = extractvalue { ptr, i32 } %170, 0
  store ptr %171, ptr %3, align 8
  %172 = extractvalue { ptr, i32 } %170, 1
  store i32 %172, ptr %4, align 4
  br label %230

173:                                              ; preds = %167
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %174

174:                                              ; preds = %220, %173
  %175 = load i32, ptr %14, align 4, !tbaa !11
  %176 = icmp slt i32 %175, 4
  br i1 %176, label %178, label %177

177:                                              ; preds = %174
  store i32 13, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %223

178:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %179 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 0
  %180 = load i32, ptr %179, align 4, !tbaa !5
  %181 = load i32, ptr %14, align 4, !tbaa !11
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [4 x i32], ptr @dx, i64 0, i64 %182
  %184 = load i32, ptr %183, align 4, !tbaa !11
  %185 = add nsw i32 %180, %184
  store i32 %185, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %186 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 1
  %187 = load i32, ptr %186, align 4, !tbaa !10
  %188 = load i32, ptr %14, align 4, !tbaa !11
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [4 x i32], ptr @dy, i64 0, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !11
  %192 = add nsw i32 %187, %191
  store i32 %192, ptr %16, align 4, !tbaa !11
  %193 = load i32, ptr %15, align 4, !tbaa !11
  %194 = load i32, ptr %16, align 4, !tbaa !11
  %195 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %193, i32 noundef %194)
          to label %196 unwind label %215

196:                                              ; preds = %178
  br i1 %195, label %197, label %219

197:                                              ; preds = %196
  %198 = load i32, ptr %15, align 4, !tbaa !11
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %199
  %201 = load i32, ptr %16, align 4, !tbaa !11
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [810 x i32], ptr %200, i64 0, i64 %202
  %204 = load i32, ptr %203, align 4, !tbaa !11
  %205 = icmp ne i32 %204, 0
  br i1 %205, label %219, label %206

206:                                              ; preds = %197
  %207 = load i32, ptr %15, align 4, !tbaa !11
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %208
  %210 = load i32, ptr %16, align 4, !tbaa !11
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [810 x i32], ptr %209, i64 0, i64 %211
  store i32 1, ptr %212, align 4, !tbaa !11
  %213 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE7emplaceIJRiS7_EEEDcDpOT_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %214 unwind label %215

214:                                              ; preds = %206
  br label %219

215:                                              ; preds = %206, %178
  %216 = landingpad { ptr, i32 }
          cleanup
  %217 = extractvalue { ptr, i32 } %216, 0
  store ptr %217, ptr %3, align 8
  %218 = extractvalue { ptr, i32 } %216, 1
  store i32 %218, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %230

219:                                              ; preds = %214, %197, %196
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %220

220:                                              ; preds = %219
  %221 = load i32, ptr %14, align 4, !tbaa !11
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %14, align 4, !tbaa !11
  br label %174, !llvm.loop !15

223:                                              ; preds = %177
  store i32 0, ptr %7, align 4
  br label %224

224:                                              ; preds = %223, %168
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  %225 = load i32, ptr %7, align 4
  switch i32 %225, label %442 [
    i32 0, label %226
    i32 12, label %227
  ]

226:                                              ; preds = %224
  br label %227

227:                                              ; preds = %226, %224
  %228 = load i32, ptr %12, align 4, !tbaa !11
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr %12, align 4, !tbaa !11
  br label %153, !llvm.loop !16

230:                                              ; preds = %215, %169
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %426

231:                                              ; preds = %157
  %232 = invoke noundef i64 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
          to label %233 unwind label %72

233:                                              ; preds = %231
  %234 = trunc i64 %232 to i32
  store i32 %234, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !11
  br label %235

235:                                              ; preds = %309, %233
  %236 = load i32, ptr %17, align 4, !tbaa !11
  %237 = load i32, ptr %5, align 4, !tbaa !11
  %238 = icmp slt i32 %236, %237
  br i1 %238, label %240, label %239

239:                                              ; preds = %235
  store i32 16, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %313

240:                                              ; preds = %235
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %241 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
          to label %242 unwind label %251

242:                                              ; preds = %240
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %241, i64 8, i1 false)
  invoke void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
          to label %243 unwind label %251

243:                                              ; preds = %242
  %244 = getelementptr inbounds %"struct.std::pair", ptr %18, i32 0, i32 0
  %245 = load i32, ptr %244, align 4, !tbaa !5
  %246 = getelementptr inbounds %"struct.std::pair", ptr %18, i32 0, i32 1
  %247 = load i32, ptr %246, align 4, !tbaa !10
  %248 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %245, i32 noundef %247)
          to label %249 unwind label %251

249:                                              ; preds = %243
  br i1 %248, label %255, label %250

250:                                              ; preds = %249
  store i32 18, ptr %7, align 4
  br label %306

251:                                              ; preds = %243, %242, %240
  %252 = landingpad { ptr, i32 }
          cleanup
  %253 = extractvalue { ptr, i32 } %252, 0
  store ptr %253, ptr %3, align 8
  %254 = extractvalue { ptr, i32 } %252, 1
  store i32 %254, ptr %4, align 4
  br label %312

255:                                              ; preds = %249
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  store i32 0, ptr %19, align 4, !tbaa !11
  br label %256

256:                                              ; preds = %302, %255
  %257 = load i32, ptr %19, align 4, !tbaa !11
  %258 = icmp slt i32 %257, 4
  br i1 %258, label %260, label %259

259:                                              ; preds = %256
  store i32 19, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %305

260:                                              ; preds = %256
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %261 = getelementptr inbounds %"struct.std::pair", ptr %18, i32 0, i32 0
  %262 = load i32, ptr %261, align 4, !tbaa !5
  %263 = load i32, ptr %19, align 4, !tbaa !11
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [4 x i32], ptr @dx, i64 0, i64 %264
  %266 = load i32, ptr %265, align 4, !tbaa !11
  %267 = add nsw i32 %262, %266
  store i32 %267, ptr %20, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %268 = getelementptr inbounds %"struct.std::pair", ptr %18, i32 0, i32 1
  %269 = load i32, ptr %268, align 4, !tbaa !10
  %270 = load i32, ptr %19, align 4, !tbaa !11
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [4 x i32], ptr @dy, i64 0, i64 %271
  %273 = load i32, ptr %272, align 4, !tbaa !11
  %274 = add nsw i32 %269, %273
  store i32 %274, ptr %21, align 4, !tbaa !11
  %275 = load i32, ptr %20, align 4, !tbaa !11
  %276 = load i32, ptr %21, align 4, !tbaa !11
  %277 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %275, i32 noundef %276)
          to label %278 unwind label %297

278:                                              ; preds = %260
  br i1 %277, label %279, label %301

279:                                              ; preds = %278
  %280 = load i32, ptr %20, align 4, !tbaa !11
  %281 = sext i32 %280 to i64
  %282 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %281
  %283 = load i32, ptr %21, align 4, !tbaa !11
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds [810 x i32], ptr %282, i64 0, i64 %284
  %286 = load i32, ptr %285, align 4, !tbaa !11
  %287 = icmp ne i32 %286, 0
  br i1 %287, label %301, label %288

288:                                              ; preds = %279
  %289 = load i32, ptr %20, align 4, !tbaa !11
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %290
  %292 = load i32, ptr %21, align 4, !tbaa !11
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds [810 x i32], ptr %291, i64 0, i64 %293
  store i32 1, ptr %294, align 4, !tbaa !11
  %295 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE7emplaceIJRiS7_EEEDcDpOT_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %21)
          to label %296 unwind label %297

296:                                              ; preds = %288
  br label %301

297:                                              ; preds = %288, %260
  %298 = landingpad { ptr, i32 }
          cleanup
  %299 = extractvalue { ptr, i32 } %298, 0
  store ptr %299, ptr %3, align 8
  %300 = extractvalue { ptr, i32 } %298, 1
  store i32 %300, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %312

301:                                              ; preds = %296, %279, %278
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %302

302:                                              ; preds = %301
  %303 = load i32, ptr %19, align 4, !tbaa !11
  %304 = add nsw i32 %303, 1
  store i32 %304, ptr %19, align 4, !tbaa !11
  br label %256, !llvm.loop !17

305:                                              ; preds = %259
  store i32 0, ptr %7, align 4
  br label %306

306:                                              ; preds = %305, %250
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  %307 = load i32, ptr %7, align 4
  switch i32 %307, label %442 [
    i32 0, label %308
    i32 18, label %309
  ]

308:                                              ; preds = %306
  br label %309

309:                                              ; preds = %308, %306
  %310 = load i32, ptr %17, align 4, !tbaa !11
  %311 = add nsw i32 %310, 1
  store i32 %311, ptr %17, align 4, !tbaa !11
  br label %235, !llvm.loop !18

312:                                              ; preds = %297, %251
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %426

313:                                              ; preds = %239
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %314 = invoke noundef i64 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
          to label %315 unwind label %322

315:                                              ; preds = %313
  %316 = trunc i64 %314 to i32
  store i32 %316, ptr %22, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  store i32 0, ptr %23, align 4, !tbaa !11
  br label %317

317:                                              ; preds = %415, %315
  %318 = load i32, ptr %23, align 4, !tbaa !11
  %319 = load i32, ptr %22, align 4, !tbaa !11
  %320 = icmp slt i32 %318, %319
  br i1 %320, label %326, label %321

321:                                              ; preds = %317
  store i32 22, ptr %7, align 4
  br label %419

322:                                              ; preds = %313
  %323 = landingpad { ptr, i32 }
          cleanup
  %324 = extractvalue { ptr, i32 } %323, 0
  store ptr %324, ptr %3, align 8
  %325 = extractvalue { ptr, i32 } %323, 1
  store i32 %325, ptr %4, align 4
  br label %425

326:                                              ; preds = %317
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %327 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
          to label %328 unwind label %337

328:                                              ; preds = %326
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 4 %327, i64 8, i1 false)
  invoke void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
          to label %329 unwind label %337

329:                                              ; preds = %328
  %330 = getelementptr inbounds %"struct.std::pair", ptr %24, i32 0, i32 0
  %331 = load i32, ptr %330, align 4, !tbaa !5
  %332 = getelementptr inbounds %"struct.std::pair", ptr %24, i32 0, i32 1
  %333 = load i32, ptr %332, align 4, !tbaa !10
  %334 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %331, i32 noundef %333)
          to label %335 unwind label %337

335:                                              ; preds = %329
  br i1 %334, label %341, label %336

336:                                              ; preds = %335
  store i32 24, ptr %7, align 4
  br label %412

337:                                              ; preds = %329, %328, %326
  %338 = landingpad { ptr, i32 }
          cleanup
  %339 = extractvalue { ptr, i32 } %338, 0
  store ptr %339, ptr %3, align 8
  %340 = extractvalue { ptr, i32 } %338, 1
  store i32 %340, ptr %4, align 4
  br label %418

341:                                              ; preds = %335
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  store i32 0, ptr %25, align 4, !tbaa !11
  br label %342

342:                                              ; preds = %406, %341
  %343 = load i32, ptr %25, align 4, !tbaa !11
  %344 = icmp slt i32 %343, 4
  br i1 %344, label %346, label %345

345:                                              ; preds = %342
  store i32 25, ptr %7, align 4
  br label %409

346:                                              ; preds = %342
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  %347 = getelementptr inbounds %"struct.std::pair", ptr %24, i32 0, i32 0
  %348 = load i32, ptr %347, align 4, !tbaa !5
  %349 = load i32, ptr %25, align 4, !tbaa !11
  %350 = sext i32 %349 to i64
  %351 = getelementptr inbounds [4 x i32], ptr @dx, i64 0, i64 %350
  %352 = load i32, ptr %351, align 4, !tbaa !11
  %353 = add nsw i32 %348, %352
  store i32 %353, ptr %26, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  %354 = getelementptr inbounds %"struct.std::pair", ptr %24, i32 0, i32 1
  %355 = load i32, ptr %354, align 4, !tbaa !10
  %356 = load i32, ptr %25, align 4, !tbaa !11
  %357 = sext i32 %356 to i64
  %358 = getelementptr inbounds [4 x i32], ptr @dy, i64 0, i64 %357
  %359 = load i32, ptr %358, align 4, !tbaa !11
  %360 = add nsw i32 %355, %359
  store i32 %360, ptr %27, align 4, !tbaa !11
  %361 = load i32, ptr %26, align 4, !tbaa !11
  %362 = load i32, ptr %27, align 4, !tbaa !11
  %363 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %361, i32 noundef %362)
          to label %364 unwind label %389

364:                                              ; preds = %346
  br i1 %363, label %365, label %402

365:                                              ; preds = %364
  %366 = load i32, ptr %26, align 4, !tbaa !11
  %367 = sext i32 %366 to i64
  %368 = getelementptr inbounds [810 x [810 x i32]], ptr getelementptr inbounds ([2 x [810 x [810 x i32]]], ptr @v, i64 0, i64 1), i64 0, i64 %367
  %369 = load i32, ptr %27, align 4, !tbaa !11
  %370 = sext i32 %369 to i64
  %371 = getelementptr inbounds [810 x i32], ptr %368, i64 0, i64 %370
  %372 = load i32, ptr %371, align 4, !tbaa !11
  %373 = icmp ne i32 %372, 0
  br i1 %373, label %402, label %374

374:                                              ; preds = %365
  %375 = load i32, ptr %26, align 4, !tbaa !11
  %376 = sext i32 %375 to i64
  %377 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %376
  %378 = load i32, ptr %27, align 4, !tbaa !11
  %379 = sext i32 %378 to i64
  %380 = getelementptr inbounds [810 x i32], ptr %377, i64 0, i64 %379
  %381 = load i32, ptr %380, align 4, !tbaa !11
  %382 = icmp ne i32 %381, 0
  br i1 %382, label %383, label %393

383:                                              ; preds = %374
  %384 = load i32, ptr @tt, align 4, !tbaa !11
  %385 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %384)
          to label %386 unwind label %389

386:                                              ; preds = %383
  %387 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %385, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %388 unwind label %389

388:                                              ; preds = %386
  store i32 1, ptr %7, align 4
  br label %403

389:                                              ; preds = %393, %386, %383, %346
  %390 = landingpad { ptr, i32 }
          cleanup
  %391 = extractvalue { ptr, i32 } %390, 0
  store ptr %391, ptr %3, align 8
  %392 = extractvalue { ptr, i32 } %390, 1
  store i32 %392, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  br label %418

393:                                              ; preds = %374
  %394 = load i32, ptr %26, align 4, !tbaa !11
  %395 = sext i32 %394 to i64
  %396 = getelementptr inbounds [810 x [810 x i32]], ptr getelementptr inbounds ([2 x [810 x [810 x i32]]], ptr @v, i64 0, i64 1), i64 0, i64 %395
  %397 = load i32, ptr %27, align 4, !tbaa !11
  %398 = sext i32 %397 to i64
  %399 = getelementptr inbounds [810 x i32], ptr %396, i64 0, i64 %398
  store i32 1, ptr %399, align 4, !tbaa !11
  %400 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE7emplaceIJRiS7_EEEDcDpOT_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(4) %26, ptr noundef nonnull align 4 dereferenceable(4) %27)
          to label %401 unwind label %389

401:                                              ; preds = %393
  br label %402

402:                                              ; preds = %401, %365, %364
  store i32 0, ptr %7, align 4
  br label %403

403:                                              ; preds = %402, %388
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  %404 = load i32, ptr %7, align 4
  switch i32 %404, label %409 [
    i32 0, label %405
  ]

405:                                              ; preds = %403
  br label %406

406:                                              ; preds = %405
  %407 = load i32, ptr %25, align 4, !tbaa !11
  %408 = add nsw i32 %407, 1
  store i32 %408, ptr %25, align 4, !tbaa !11
  br label %342, !llvm.loop !19

409:                                              ; preds = %403, %345
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  %410 = load i32, ptr %7, align 4
  switch i32 %410, label %412 [
    i32 25, label %411
  ]

411:                                              ; preds = %409
  store i32 0, ptr %7, align 4
  br label %412

412:                                              ; preds = %411, %409, %336
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  %413 = load i32, ptr %7, align 4
  switch i32 %413, label %419 [
    i32 0, label %414
    i32 24, label %415
  ]

414:                                              ; preds = %412
  br label %415

415:                                              ; preds = %414, %412
  %416 = load i32, ptr %23, align 4, !tbaa !11
  %417 = add nsw i32 %416, 1
  store i32 %417, ptr %23, align 4, !tbaa !11
  br label %317, !llvm.loop !20

418:                                              ; preds = %389, %337
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %425

419:                                              ; preds = %412, %321
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  %420 = load i32, ptr %7, align 4
  switch i32 %420, label %422 [
    i32 22, label %421
  ]

421:                                              ; preds = %419
  store i32 0, ptr %7, align 4
  br label %422

422:                                              ; preds = %421, %419
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  %423 = load i32, ptr %7, align 4
  switch i32 %423, label %432 [
    i32 0, label %424
  ]

424:                                              ; preds = %422
  br label %43, !llvm.loop !21

425:                                              ; preds = %418, %322
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %426

426:                                              ; preds = %425, %312, %230, %148, %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %435

427:                                              ; preds = %51
  %428 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
          to label %429 unwind label %68

429:                                              ; preds = %427
  %430 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %428, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %431 unwind label %68

431:                                              ; preds = %429
  store i32 0, ptr %7, align 4
  br label %432

432:                                              ; preds = %431, %422
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %2) #8
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %1) #8
  %433 = load i32, ptr %7, align 4
  switch i32 %433, label %442 [
    i32 0, label %434
    i32 1, label %434
  ]

434:                                              ; preds = %432, %432
  ret void

435:                                              ; preds = %426, %68
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #8
  br label %436

436:                                              ; preds = %435, %64
  call void @llvm.lifetime.end.p0(i64 80, ptr %2) #8
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %1) #8
  br label %437

437:                                              ; preds = %436
  %438 = load ptr, ptr %3, align 8
  %439 = load i32, ptr %4, align 4
  %440 = insertvalue { ptr, i32 } poison, ptr %438, 0
  %441 = insertvalue { ptr, i32 } %440, i32 %439, 1
  resume { ptr, i32 } %441

442:                                              ; preds = %432, %306, %224, %142
  unreachable
}

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #7 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: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 = { "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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { 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, !7, i64 0}
!6 = !{!"_ZTSSt4pairIiiE", !7, i64 0, !7, i64 4}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 4}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !13}
!21 = distinct !{!21, !13}


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

%"struct.std::pair" = type { i32, i32 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@v = external dso_local local_unnamed_addr global [2 x [810 x [810 x i32]]], align 16
@dx = external dso_local local_unnamed_addr global [4 x i32], align 16
@dy = external dso_local local_unnamed_addr global [4 x i32], align 16
@tt = external dso_local local_unnamed_addr global i32, align 4
@boy = external dso_local global %"struct.std::pair", align 4
@girl = external dso_local global %"struct.std::pair", align 4
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3bfsv() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::queue", align 8
  %2 = alloca %"class.std::queue", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(5248800) @v, i8 0, i64 5248800, i1 false)
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %1) #7
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #7
  invoke void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
          to label %11 unwind label %35

11:                                               ; preds = %0
  invoke void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(8) @boy)
          to label %12 unwind label %37

12:                                               ; preds = %11
  invoke void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(8) @girl)
          to label %13 unwind label %37

13:                                               ; preds = %12
  %14 = load i32, ptr @boy, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = load i32, ptr getelementptr inbounds (i8, ptr @boy, i64 4), align 4, !tbaa !10
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %15, i64 %17
  store i32 1, ptr %18, align 4, !tbaa !11
  %19 = load i32, ptr @girl, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = load i32, ptr getelementptr inbounds (i8, ptr @girl, i64 4), align 4, !tbaa !10
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [810 x [810 x i32]], ptr getelementptr inbounds (i8, ptr @v, i64 2624400), i64 0, i64 %20, i64 %22
  store i32 1, ptr %23, align 4, !tbaa !11
  store i32 0, ptr @tt, align 4, !tbaa !11
  br label %.loopexit100

.loopexit100:                                     ; preds = %.loopexit100.backedge, %13
  %24 = call noundef i64 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %.not = icmp eq i64 %24, 0
  br i1 %.not, label %25, label %.critedge

25:                                               ; preds = %.loopexit100
  %26 = call noundef i64 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %.not71 = icmp eq i64 %26, 0
  br i1 %.not71, label %333, label %.critedge

.critedge:                                        ; preds = %.loopexit100, %25
  %27 = load i32, ptr @tt, align 4, !tbaa !11
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr @tt, align 4, !tbaa !11
  %29 = call noundef i64 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %30 = trunc i64 %29 to i32
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.loopexit99, %.critedge
  %32 = call noundef i64 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %33 = trunc i64 %32 to i32
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %.lr.ph106, label %._crit_edge107

35:                                               ; preds = %0
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %339

37:                                               ; preds = %335, %333, %12, %11
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %338

.lr.ph:                                           ; preds = %.critedge, %.loopexit99
  %.062102 = phi i32 [ %106, %.loopexit99 ], [ 0, %.critedge ]
  %39 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %.sroa.037.0.copyload = load i32, ptr %39, align 4
  %.sroa.639.0..sroa_idx = getelementptr inbounds i8, ptr %39, i64 4
  %.sroa.639.0.copyload = load i32, ptr %.sroa.639.0..sroa_idx, align 4
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %40 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %.sroa.037.0.copyload, i32 noundef %.sroa.639.0.copyload)
          to label %41 unwind label %47

41:                                               ; preds = %.lr.ph
  br i1 %40, label %.preheader98.preheader, label %.loopexit99

.preheader98.preheader:                           ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %42 = load i32, ptr @dx, align 16, !tbaa !11
  %43 = add nsw i32 %42, %.sroa.037.0.copyload
  store i32 %43, ptr %3, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %44 = load i32, ptr @dy, align 16, !tbaa !11
  %45 = add nsw i32 %44, %.sroa.639.0.copyload
  store i32 %45, ptr %4, align 4, !tbaa !11
  %46 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %43, i32 noundef %45)
          to label %49 unwind label %59

47:                                               ; preds = %.lr.ph
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %338

49:                                               ; preds = %.preheader98.preheader
  br i1 %46, label %50, label %.preheader98.1

50:                                               ; preds = %49
  %51 = load i32, ptr %3, align 4, !tbaa !11
  %52 = sext i32 %51 to i64
  %53 = load i32, ptr %4, align 4, !tbaa !11
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %52, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !11
  %.not82 = icmp eq i32 %56, 0
  br i1 %.not82, label %57, label %.preheader98.1

57:                                               ; preds = %50
  store i32 1, ptr %55, align 4, !tbaa !11
  %58 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE7emplaceIJRiS7_EEEDcDpOT_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %.preheader98.1 unwind label %59

59:                                               ; preds = %104, %.preheader98.3, %89, %.preheader98.2, %74, %.preheader98.1, %57, %.preheader98.preheader
  %60 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br label %338

.preheader98.1:                                   ; preds = %57, %50, %49
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %61 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 4), align 4, !tbaa !11
  %62 = add nsw i32 %61, %.sroa.037.0.copyload
  store i32 %62, ptr %3, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %63 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 4), align 4, !tbaa !11
  %64 = add nsw i32 %63, %.sroa.639.0.copyload
  store i32 %64, ptr %4, align 4, !tbaa !11
  %65 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %62, i32 noundef %64)
          to label %66 unwind label %59

66:                                               ; preds = %.preheader98.1
  br i1 %65, label %67, label %.preheader98.2

67:                                               ; preds = %66
  %68 = load i32, ptr %3, align 4, !tbaa !11
  %69 = sext i32 %68 to i64
  %70 = load i32, ptr %4, align 4, !tbaa !11
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %69, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !11
  %.not82.1 = icmp eq i32 %73, 0
  br i1 %.not82.1, label %74, label %.preheader98.2

74:                                               ; preds = %67
  store i32 1, ptr %72, align 4, !tbaa !11
  %75 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE7emplaceIJRiS7_EEEDcDpOT_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %.preheader98.2 unwind label %59

.preheader98.2:                                   ; preds = %74, %67, %66
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %76 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 8), align 8, !tbaa !11
  %77 = add nsw i32 %76, %.sroa.037.0.copyload
  store i32 %77, ptr %3, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %78 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 8), align 8, !tbaa !11
  %79 = add nsw i32 %78, %.sroa.639.0.copyload
  store i32 %79, ptr %4, align 4, !tbaa !11
  %80 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %77, i32 noundef %79)
          to label %81 unwind label %59

81:                                               ; preds = %.preheader98.2
  br i1 %80, label %82, label %.preheader98.3

82:                                               ; preds = %81
  %83 = load i32, ptr %3, align 4, !tbaa !11
  %84 = sext i32 %83 to i64
  %85 = load i32, ptr %4, align 4, !tbaa !11
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %84, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !11
  %.not82.2 = icmp eq i32 %88, 0
  br i1 %.not82.2, label %89, label %.preheader98.3

89:                                               ; preds = %82
  store i32 1, ptr %87, align 4, !tbaa !11
  %90 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE7emplaceIJRiS7_EEEDcDpOT_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %.preheader98.3 unwind label %59

.preheader98.3:                                   ; preds = %89, %82, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %91 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 12), align 4, !tbaa !11
  %92 = add nsw i32 %91, %.sroa.037.0.copyload
  store i32 %92, ptr %3, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %93 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 12), align 4, !tbaa !11
  %94 = add nsw i32 %93, %.sroa.639.0.copyload
  store i32 %94, ptr %4, align 4, !tbaa !11
  %95 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %92, i32 noundef %94)
          to label %96 unwind label %59

96:                                               ; preds = %.preheader98.3
  br i1 %95, label %97, label %.loopexit99.loopexit

97:                                               ; preds = %96
  %98 = load i32, ptr %3, align 4, !tbaa !11
  %99 = sext i32 %98 to i64
  %100 = load i32, ptr %4, align 4, !tbaa !11
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %99, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !11
  %.not82.3 = icmp eq i32 %103, 0
  br i1 %.not82.3, label %104, label %.loopexit99.loopexit

104:                                              ; preds = %97
  store i32 1, ptr %102, align 4, !tbaa !11
  %105 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE7emplaceIJRiS7_EEEDcDpOT_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %.loopexit99.loopexit unwind label %59

.loopexit99.loopexit:                             ; preds = %104, %97, %96
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br label %.loopexit99

.loopexit99:                                      ; preds = %.loopexit99.loopexit, %41
  %106 = add nuw nsw i32 %.062102, 1
  %exitcond.not = icmp eq i32 %106, %30
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !12

._crit_edge107:                                   ; preds = %.loopexit97, %._crit_edge
  %107 = call noundef i64 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %108 = trunc i64 %107 to i32
  %109 = icmp sgt i32 %108, 0
  br i1 %109, label %.lr.ph111, label %._crit_edge112

.lr.ph106:                                        ; preds = %._crit_edge, %.loopexit97
  %.070104 = phi i32 [ %177, %.loopexit97 ], [ 0, %._crit_edge ]
  %110 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %.sroa.027.0.copyload = load i32, ptr %110, align 4
  %.sroa.629.0..sroa_idx = getelementptr inbounds i8, ptr %110, i64 4
  %.sroa.629.0.copyload = load i32, ptr %.sroa.629.0..sroa_idx, align 4
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %111 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %.sroa.027.0.copyload, i32 noundef %.sroa.629.0.copyload)
          to label %112 unwind label %118

112:                                              ; preds = %.lr.ph106
  br i1 %111, label %.preheader96.preheader, label %.loopexit97

.preheader96.preheader:                           ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %113 = load i32, ptr @dx, align 16, !tbaa !11
  %114 = add nsw i32 %113, %.sroa.027.0.copyload
  store i32 %114, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %115 = load i32, ptr @dy, align 16, !tbaa !11
  %116 = add nsw i32 %115, %.sroa.629.0.copyload
  store i32 %116, ptr %6, align 4, !tbaa !11
  %117 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %114, i32 noundef %116)
          to label %120 unwind label %130

118:                                              ; preds = %.lr.ph106
  %119 = landingpad { ptr, i32 }
          cleanup
  br label %338

120:                                              ; preds = %.preheader96.preheader
  br i1 %117, label %121, label %.preheader96.1

121:                                              ; preds = %120
  %122 = load i32, ptr %5, align 4, !tbaa !11
  %123 = sext i32 %122 to i64
  %124 = load i32, ptr %6, align 4, !tbaa !11
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %123, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !11
  %.not79 = icmp eq i32 %127, 0
  br i1 %.not79, label %128, label %.preheader96.1

128:                                              ; preds = %121
  store i32 1, ptr %126, align 4, !tbaa !11
  %129 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE7emplaceIJRiS7_EEEDcDpOT_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %.preheader96.1 unwind label %130

130:                                              ; preds = %175, %.preheader96.3, %160, %.preheader96.2, %145, %.preheader96.1, %128, %.preheader96.preheader
  %131 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %338

.preheader96.1:                                   ; preds = %128, %121, %120
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %132 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 4), align 4, !tbaa !11
  %133 = add nsw i32 %132, %.sroa.027.0.copyload
  store i32 %133, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %134 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 4), align 4, !tbaa !11
  %135 = add nsw i32 %134, %.sroa.629.0.copyload
  store i32 %135, ptr %6, align 4, !tbaa !11
  %136 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %133, i32 noundef %135)
          to label %137 unwind label %130

137:                                              ; preds = %.preheader96.1
  br i1 %136, label %138, label %.preheader96.2

138:                                              ; preds = %137
  %139 = load i32, ptr %5, align 4, !tbaa !11
  %140 = sext i32 %139 to i64
  %141 = load i32, ptr %6, align 4, !tbaa !11
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %140, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !11
  %.not79.1 = icmp eq i32 %144, 0
  br i1 %.not79.1, label %145, label %.preheader96.2

145:                                              ; preds = %138
  store i32 1, ptr %143, align 4, !tbaa !11
  %146 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE7emplaceIJRiS7_EEEDcDpOT_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %.preheader96.2 unwind label %130

.preheader96.2:                                   ; preds = %145, %138, %137
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %147 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 8), align 8, !tbaa !11
  %148 = add nsw i32 %147, %.sroa.027.0.copyload
  store i32 %148, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %149 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 8), align 8, !tbaa !11
  %150 = add nsw i32 %149, %.sroa.629.0.copyload
  store i32 %150, ptr %6, align 4, !tbaa !11
  %151 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %148, i32 noundef %150)
          to label %152 unwind label %130

152:                                              ; preds = %.preheader96.2
  br i1 %151, label %153, label %.preheader96.3

153:                                              ; preds = %152
  %154 = load i32, ptr %5, align 4, !tbaa !11
  %155 = sext i32 %154 to i64
  %156 = load i32, ptr %6, align 4, !tbaa !11
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %155, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !11
  %.not79.2 = icmp eq i32 %159, 0
  br i1 %.not79.2, label %160, label %.preheader96.3

160:                                              ; preds = %153
  store i32 1, ptr %158, align 4, !tbaa !11
  %161 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE7emplaceIJRiS7_EEEDcDpOT_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %.preheader96.3 unwind label %130

.preheader96.3:                                   ; preds = %160, %153, %152
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %162 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 12), align 4, !tbaa !11
  %163 = add nsw i32 %162, %.sroa.027.0.copyload
  store i32 %163, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %164 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 12), align 4, !tbaa !11
  %165 = add nsw i32 %164, %.sroa.629.0.copyload
  store i32 %165, ptr %6, align 4, !tbaa !11
  %166 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %163, i32 noundef %165)
          to label %167 unwind label %130

167:                                              ; preds = %.preheader96.3
  br i1 %166, label %168, label %.loopexit97.loopexit

168:                                              ; preds = %167
  %169 = load i32, ptr %5, align 4, !tbaa !11
  %170 = sext i32 %169 to i64
  %171 = load i32, ptr %6, align 4, !tbaa !11
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %170, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !11
  %.not79.3 = icmp eq i32 %174, 0
  br i1 %.not79.3, label %175, label %.loopexit97.loopexit

175:                                              ; preds = %168
  store i32 1, ptr %173, align 4, !tbaa !11
  %176 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE7emplaceIJRiS7_EEEDcDpOT_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %.loopexit97.loopexit unwind label %130

.loopexit97.loopexit:                             ; preds = %175, %168, %167
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %.loopexit97

.loopexit97:                                      ; preds = %.loopexit97.loopexit, %112
  %177 = add nuw nsw i32 %.070104, 1
  %exitcond120.not = icmp eq i32 %177, %33
  br i1 %exitcond120.not, label %._crit_edge107, label %.lr.ph106, !llvm.loop !14

._crit_edge112:                                   ; preds = %.loopexit95, %._crit_edge107
  %178 = call noundef i64 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %179 = trunc i64 %178 to i32
  %180 = icmp sgt i32 %179, 0
  br i1 %180, label %.lr.ph116, label %.loopexit100.backedge

.loopexit100.backedge:                            ; preds = %.loopexit, %._crit_edge112
  br label %.loopexit100

.lr.ph111:                                        ; preds = %._crit_edge107, %.loopexit95
  %.067109 = phi i32 [ %248, %.loopexit95 ], [ 0, %._crit_edge107 ]
  %181 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %.sroa.017.0.copyload = load i32, ptr %181, align 4
  %.sroa.619.0..sroa_idx = getelementptr inbounds i8, ptr %181, i64 4
  %.sroa.619.0.copyload = load i32, ptr %.sroa.619.0..sroa_idx, align 4
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %182 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %.sroa.017.0.copyload, i32 noundef %.sroa.619.0.copyload)
          to label %183 unwind label %189

183:                                              ; preds = %.lr.ph111
  br i1 %182, label %.preheader94.preheader, label %.loopexit95

.preheader94.preheader:                           ; preds = %183
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %184 = load i32, ptr @dx, align 16, !tbaa !11
  %185 = add nsw i32 %184, %.sroa.017.0.copyload
  store i32 %185, ptr %7, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  %186 = load i32, ptr @dy, align 16, !tbaa !11
  %187 = add nsw i32 %186, %.sroa.619.0.copyload
  store i32 %187, ptr %8, align 4, !tbaa !11
  %188 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %185, i32 noundef %187)
          to label %191 unwind label %201

189:                                              ; preds = %.lr.ph111
  %190 = landingpad { ptr, i32 }
          cleanup
  br label %338

191:                                              ; preds = %.preheader94.preheader
  br i1 %188, label %192, label %.preheader94.1

192:                                              ; preds = %191
  %193 = load i32, ptr %7, align 4, !tbaa !11
  %194 = sext i32 %193 to i64
  %195 = load i32, ptr %8, align 4, !tbaa !11
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %194, i64 %196
  %198 = load i32, ptr %197, align 4, !tbaa !11
  %.not76 = icmp eq i32 %198, 0
  br i1 %.not76, label %199, label %.preheader94.1

199:                                              ; preds = %192
  store i32 1, ptr %197, align 4, !tbaa !11
  %200 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE7emplaceIJRiS7_EEEDcDpOT_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %.preheader94.1 unwind label %201

201:                                              ; preds = %246, %.preheader94.3, %231, %.preheader94.2, %216, %.preheader94.1, %199, %.preheader94.preheader
  %202 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  br label %338

.preheader94.1:                                   ; preds = %199, %192, %191
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %203 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 4), align 4, !tbaa !11
  %204 = add nsw i32 %203, %.sroa.017.0.copyload
  store i32 %204, ptr %7, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  %205 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 4), align 4, !tbaa !11
  %206 = add nsw i32 %205, %.sroa.619.0.copyload
  store i32 %206, ptr %8, align 4, !tbaa !11
  %207 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %204, i32 noundef %206)
          to label %208 unwind label %201

208:                                              ; preds = %.preheader94.1
  br i1 %207, label %209, label %.preheader94.2

209:                                              ; preds = %208
  %210 = load i32, ptr %7, align 4, !tbaa !11
  %211 = sext i32 %210 to i64
  %212 = load i32, ptr %8, align 4, !tbaa !11
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %211, i64 %213
  %215 = load i32, ptr %214, align 4, !tbaa !11
  %.not76.1 = icmp eq i32 %215, 0
  br i1 %.not76.1, label %216, label %.preheader94.2

216:                                              ; preds = %209
  store i32 1, ptr %214, align 4, !tbaa !11
  %217 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE7emplaceIJRiS7_EEEDcDpOT_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %.preheader94.2 unwind label %201

.preheader94.2:                                   ; preds = %216, %209, %208
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %218 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 8), align 8, !tbaa !11
  %219 = add nsw i32 %218, %.sroa.017.0.copyload
  store i32 %219, ptr %7, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  %220 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 8), align 8, !tbaa !11
  %221 = add nsw i32 %220, %.sroa.619.0.copyload
  store i32 %221, ptr %8, align 4, !tbaa !11
  %222 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %219, i32 noundef %221)
          to label %223 unwind label %201

223:                                              ; preds = %.preheader94.2
  br i1 %222, label %224, label %.preheader94.3

224:                                              ; preds = %223
  %225 = load i32, ptr %7, align 4, !tbaa !11
  %226 = sext i32 %225 to i64
  %227 = load i32, ptr %8, align 4, !tbaa !11
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %226, i64 %228
  %230 = load i32, ptr %229, align 4, !tbaa !11
  %.not76.2 = icmp eq i32 %230, 0
  br i1 %.not76.2, label %231, label %.preheader94.3

231:                                              ; preds = %224
  store i32 1, ptr %229, align 4, !tbaa !11
  %232 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE7emplaceIJRiS7_EEEDcDpOT_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %.preheader94.3 unwind label %201

.preheader94.3:                                   ; preds = %231, %224, %223
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %233 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 12), align 4, !tbaa !11
  %234 = add nsw i32 %233, %.sroa.017.0.copyload
  store i32 %234, ptr %7, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  %235 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 12), align 4, !tbaa !11
  %236 = add nsw i32 %235, %.sroa.619.0.copyload
  store i32 %236, ptr %8, align 4, !tbaa !11
  %237 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %234, i32 noundef %236)
          to label %238 unwind label %201

238:                                              ; preds = %.preheader94.3
  br i1 %237, label %239, label %.loopexit95.loopexit

239:                                              ; preds = %238
  %240 = load i32, ptr %7, align 4, !tbaa !11
  %241 = sext i32 %240 to i64
  %242 = load i32, ptr %8, align 4, !tbaa !11
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %241, i64 %243
  %245 = load i32, ptr %244, align 4, !tbaa !11
  %.not76.3 = icmp eq i32 %245, 0
  br i1 %.not76.3, label %246, label %.loopexit95.loopexit

246:                                              ; preds = %239
  store i32 1, ptr %244, align 4, !tbaa !11
  %247 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE7emplaceIJRiS7_EEEDcDpOT_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %.loopexit95.loopexit unwind label %201

.loopexit95.loopexit:                             ; preds = %246, %239, %238
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  br label %.loopexit95

.loopexit95:                                      ; preds = %.loopexit95.loopexit, %183
  %248 = add nuw nsw i32 %.067109, 1
  %exitcond123.not = icmp eq i32 %248, %108
  br i1 %exitcond123.not, label %._crit_edge112, label %.lr.ph111, !llvm.loop !15

.lr.ph116:                                        ; preds = %._crit_edge112, %.loopexit
  %.060114 = phi i32 [ %332, %.loopexit ], [ 0, %._crit_edge112 ]
  %249 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %.sroa.0.0.copyload = load i32, ptr %249, align 4
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %249, i64 4
  %.sroa.6.0.copyload = load i32, ptr %.sroa.6.0..sroa_idx, align 4
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %250 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %.sroa.0.0.copyload, i32 noundef %.sroa.6.0.copyload)
          to label %251 unwind label %257

251:                                              ; preds = %.lr.ph116
  br i1 %250, label %.preheader.preheader, label %.loopexit

.preheader.preheader:                             ; preds = %251
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %252 = load i32, ptr @dx, align 16, !tbaa !11
  %253 = add nsw i32 %252, %.sroa.0.0.copyload
  store i32 %253, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  %254 = load i32, ptr @dy, align 16, !tbaa !11
  %255 = add nsw i32 %254, %.sroa.6.0.copyload
  store i32 %255, ptr %10, align 4, !tbaa !11
  %256 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %253, i32 noundef %255)
          to label %259 unwind label %.loopexit93

257:                                              ; preds = %.lr.ph116
  %258 = landingpad { ptr, i32 }
          cleanup
  br label %338

259:                                              ; preds = %.preheader.preheader
  br i1 %256, label %260, label %.preheader.1

260:                                              ; preds = %259
  %261 = load i32, ptr %9, align 4, !tbaa !11
  %262 = sext i32 %261 to i64
  %263 = load i32, ptr %10, align 4, !tbaa !11
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [810 x [810 x i32]], ptr getelementptr inbounds (i8, ptr @v, i64 2624400), i64 0, i64 %262, i64 %264
  %266 = load i32, ptr %265, align 4, !tbaa !11
  %.not72 = icmp eq i32 %266, 0
  br i1 %.not72, label %267, label %.preheader.1

267:                                              ; preds = %260
  %268 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %262, i64 %264
  %269 = load i32, ptr %268, align 4, !tbaa !11
  %.not73 = icmp eq i32 %269, 0
  br i1 %.not73, label %276, label %270

270:                                              ; preds = %327, %309, %291, %267
  %271 = load i32, ptr @tt, align 4, !tbaa !11
  %272 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %271)
          to label %273 unwind label %.loopexit.split-lp

273:                                              ; preds = %270
  %274 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %272, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %.thread91 unwind label %.loopexit.split-lp

.loopexit93:                                      ; preds = %330, %.preheader.3, %312, %.preheader.2, %294, %.preheader.1, %.preheader.preheader, %276
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %275

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

275:                                              ; preds = %.loopexit.split-lp, %.loopexit93
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit93 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  br label %338

276:                                              ; preds = %267
  store i32 1, ptr %265, align 4, !tbaa !11
  %277 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE7emplaceIJRiS7_EEEDcDpOT_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %.preheader.1 unwind label %.loopexit93

.preheader.1:                                     ; preds = %259, %260, %276
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %278 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 4), align 4, !tbaa !11
  %279 = add nsw i32 %278, %.sroa.0.0.copyload
  store i32 %279, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  %280 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 4), align 4, !tbaa !11
  %281 = add nsw i32 %280, %.sroa.6.0.copyload
  store i32 %281, ptr %10, align 4, !tbaa !11
  %282 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %279, i32 noundef %281)
          to label %283 unwind label %.loopexit93

283:                                              ; preds = %.preheader.1
  br i1 %282, label %284, label %.preheader.2

284:                                              ; preds = %283
  %285 = load i32, ptr %9, align 4, !tbaa !11
  %286 = sext i32 %285 to i64
  %287 = load i32, ptr %10, align 4, !tbaa !11
  %288 = sext i32 %287 to i64
  %289 = getelementptr inbounds [810 x [810 x i32]], ptr getelementptr inbounds (i8, ptr @v, i64 2624400), i64 0, i64 %286, i64 %288
  %290 = load i32, ptr %289, align 4, !tbaa !11
  %.not72.1 = icmp eq i32 %290, 0
  br i1 %.not72.1, label %291, label %.preheader.2

291:                                              ; preds = %284
  %292 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %286, i64 %288
  %293 = load i32, ptr %292, align 4, !tbaa !11
  %.not73.1 = icmp eq i32 %293, 0
  br i1 %.not73.1, label %294, label %270

294:                                              ; preds = %291
  store i32 1, ptr %289, align 4, !tbaa !11
  %295 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE7emplaceIJRiS7_EEEDcDpOT_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %.preheader.2 unwind label %.loopexit93

.preheader.2:                                     ; preds = %294, %284, %283
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %296 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 8), align 8, !tbaa !11
  %297 = add nsw i32 %296, %.sroa.0.0.copyload
  store i32 %297, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  %298 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 8), align 8, !tbaa !11
  %299 = add nsw i32 %298, %.sroa.6.0.copyload
  store i32 %299, ptr %10, align 4, !tbaa !11
  %300 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %297, i32 noundef %299)
          to label %301 unwind label %.loopexit93

301:                                              ; preds = %.preheader.2
  br i1 %300, label %302, label %.preheader.3

302:                                              ; preds = %301
  %303 = load i32, ptr %9, align 4, !tbaa !11
  %304 = sext i32 %303 to i64
  %305 = load i32, ptr %10, align 4, !tbaa !11
  %306 = sext i32 %305 to i64
  %307 = getelementptr inbounds [810 x [810 x i32]], ptr getelementptr inbounds (i8, ptr @v, i64 2624400), i64 0, i64 %304, i64 %306
  %308 = load i32, ptr %307, align 4, !tbaa !11
  %.not72.2 = icmp eq i32 %308, 0
  br i1 %.not72.2, label %309, label %.preheader.3

309:                                              ; preds = %302
  %310 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %304, i64 %306
  %311 = load i32, ptr %310, align 4, !tbaa !11
  %.not73.2 = icmp eq i32 %311, 0
  br i1 %.not73.2, label %312, label %270

312:                                              ; preds = %309
  store i32 1, ptr %307, align 4, !tbaa !11
  %313 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE7emplaceIJRiS7_EEEDcDpOT_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %.preheader.3 unwind label %.loopexit93

.preheader.3:                                     ; preds = %312, %302, %301
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %314 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 12), align 4, !tbaa !11
  %315 = add nsw i32 %314, %.sroa.0.0.copyload
  store i32 %315, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  %316 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 12), align 4, !tbaa !11
  %317 = add nsw i32 %316, %.sroa.6.0.copyload
  store i32 %317, ptr %10, align 4, !tbaa !11
  %318 = invoke noundef zeroext i1 @_Z5validii(i32 noundef %315, i32 noundef %317)
          to label %319 unwind label %.loopexit93

319:                                              ; preds = %.preheader.3
  br i1 %318, label %320, label %.loopexit.loopexit

320:                                              ; preds = %319
  %321 = load i32, ptr %9, align 4, !tbaa !11
  %322 = sext i32 %321 to i64
  %323 = load i32, ptr %10, align 4, !tbaa !11
  %324 = sext i32 %323 to i64
  %325 = getelementptr inbounds [810 x [810 x i32]], ptr getelementptr inbounds (i8, ptr @v, i64 2624400), i64 0, i64 %322, i64 %324
  %326 = load i32, ptr %325, align 4, !tbaa !11
  %.not72.3 = icmp eq i32 %326, 0
  br i1 %.not72.3, label %327, label %.loopexit.loopexit

327:                                              ; preds = %320
  %328 = getelementptr inbounds [810 x [810 x i32]], ptr @v, i64 0, i64 %322, i64 %324
  %329 = load i32, ptr %328, align 4, !tbaa !11
  %.not73.3 = icmp eq i32 %329, 0
  br i1 %.not73.3, label %330, label %270

330:                                              ; preds = %327
  store i32 1, ptr %325, align 4, !tbaa !11
  %331 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE7emplaceIJRiS7_EEEDcDpOT_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %.loopexit.loopexit unwind label %.loopexit93

.loopexit.loopexit:                               ; preds = %330, %320, %319
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  br label %.loopexit

.thread91:                                        ; preds = %273
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  br label %337

.loopexit:                                        ; preds = %.loopexit.loopexit, %251
  %332 = add nuw nsw i32 %.060114, 1
  %exitcond126.not = icmp eq i32 %332, %179
  br i1 %exitcond126.not, label %.loopexit100.backedge, label %.lr.ph116, !llvm.loop !16

333:                                              ; preds = %25
  %334 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
          to label %335 unwind label %37

335:                                              ; preds = %333
  %336 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %334, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %337 unwind label %37

337:                                              ; preds = %.thread91, %335
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #7
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #7
  ret void

338:                                              ; preds = %59, %47, %130, %118, %201, %189, %275, %257, %37
  %.pn83.pn.pn = phi { ptr, i32 } [ %38, %37 ], [ %60, %59 ], [ %48, %47 ], [ %131, %130 ], [ %119, %118 ], [ %202, %201 ], [ %190, %189 ], [ %lpad.phi, %275 ], [ %258, %257 ]
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #7
  br label %339

339:                                              ; preds = %338, %35
  %.pn83.pn.pn.pn = phi { ptr, i32 } [ %.pn83.pn.pn, %338 ], [ %36, %35 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #7
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn83.pn.pn.pn
}

; 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 @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #6 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress 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 = { 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 #7 = { nounwind }

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

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


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