; LLVM IR from eyangch/competitive-programming :: FacebookHackercup/2022/qual (b2)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::basic_istream" = type { ptr, i64, %"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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type { i64, i64 }

@dx = external dso_local global [4 x i64], align 16
@dy = external dso_local global [4 x i64], align 16
@T = external dso_local global i64, align 8
@R = external dso_local global i64, align 8
@C = external dso_local global i64, align 8
@_Z1SB5cxx11 = external dso_local global [3000 x %"class.std::__cxx11::basic_string"], align 16
@adj = external dso_local global [3000 x [3000 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #1 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::queue", align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca i8, align 1
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca %"struct.std::pair", align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %24 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %25 = getelementptr i8, ptr %24, i64 -24
  %26 = load i64, ptr %25, align 8
  %27 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %26
  %28 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %27, ptr noundef null)
  %29 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 1, ptr %2, align 8, !tbaa !8
  br label %31

31:                                               ; preds = %302, %0
  %32 = load i64, ptr %2, align 8, !tbaa !8
  %33 = load i64, ptr @T, align 8, !tbaa !8
  %34 = icmp sle i64 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %307

36:                                               ; preds = %31
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %38 = load i64, ptr %2, align 8, !tbaa !8
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %37, i64 noundef %38)
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef @.str.2)
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @R)
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %41, ptr noundef nonnull align 8 dereferenceable(8) @C)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store i64 0, ptr %4, align 8, !tbaa !8
  br label %43

43:                                               ; preds = %52, %36
  %44 = load i64, ptr %4, align 8, !tbaa !8
  %45 = load i64, ptr @R, align 8, !tbaa !8
  %46 = icmp slt i64 %44, %45
  br i1 %46, label %48, label %47

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

48:                                               ; preds = %43
  %49 = load i64, ptr %4, align 8, !tbaa !8
  %50 = getelementptr inbounds [3000 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %49
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %50)
  br label %52

52:                                               ; preds = %48
  %53 = load i64, ptr %4, align 8, !tbaa !8
  %54 = add nsw i64 %53, 1
  store i64 %54, ptr %4, align 8, !tbaa !8
  br label %43, !llvm.loop !11

55:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 80, ptr %5) #7
  call void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store i64 0, ptr %6, align 8, !tbaa !8
  br label %56

56:                                               ; preds = %133, %55
  %57 = load i64, ptr %6, align 8, !tbaa !8
  %58 = load i64, ptr @R, align 8, !tbaa !8
  %59 = icmp slt i64 %57, %58
  br i1 %59, label %61, label %60

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

61:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 0, ptr %7, align 8, !tbaa !8
  br label %62

62:                                               ; preds = %127, %61
  %63 = load i64, ptr %7, align 8, !tbaa !8
  %64 = load i64, ptr @C, align 8, !tbaa !8
  %65 = icmp slt i64 %63, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %62
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %132

67:                                               ; preds = %62
  %68 = load i64, ptr %6, align 8, !tbaa !8
  %69 = load i64, ptr %7, align 8, !tbaa !8
  %70 = invoke noundef zeroext i1 @_Z4goodxx(i64 noundef %68, i64 noundef %69)
          to label %71 unwind label %73

71:                                               ; preds = %67
  br i1 %70, label %77, label %72

72:                                               ; preds = %71
  br label %127

73:                                               ; preds = %67
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %8, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %9, align 4
  br label %131

77:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 0, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store i64 0, ptr %11, align 8, !tbaa !8
  br label %78

78:                                               ; preds = %108, %77
  %79 = load i64, ptr %11, align 8, !tbaa !8
  %80 = icmp slt i64 %79, 4
  br i1 %80, label %82, label %81

81:                                               ; preds = %78
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %111

82:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %83 = load i64, ptr %6, align 8, !tbaa !8
  %84 = load i64, ptr %11, align 8, !tbaa !8
  %85 = getelementptr inbounds [4 x i64], ptr @dx, i64 0, i64 %84
  %86 = load i64, ptr %85, align 8, !tbaa !8
  %87 = add nsw i64 %83, %86
  store i64 %87, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %88 = load i64, ptr %7, align 8, !tbaa !8
  %89 = load i64, ptr %11, align 8, !tbaa !8
  %90 = getelementptr inbounds [4 x i64], ptr @dy, i64 0, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !8
  %92 = add nsw i64 %88, %91
  store i64 %92, ptr %13, align 8, !tbaa !8
  %93 = load i64, ptr %12, align 8, !tbaa !8
  %94 = load i64, ptr %13, align 8, !tbaa !8
  %95 = invoke noundef zeroext i1 @_Z4goodxx(i64 noundef %93, i64 noundef %94)
          to label %96 unwind label %98

96:                                               ; preds = %82
  br i1 %95, label %102, label %97

97:                                               ; preds = %96
  store i32 16, ptr %3, align 4
  br label %105

98:                                               ; preds = %82
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %8, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %130

102:                                              ; preds = %96
  %103 = load i64, ptr %10, align 8, !tbaa !8
  %104 = add nsw i64 %103, 1
  store i64 %104, ptr %10, align 8, !tbaa !8
  store i32 0, ptr %3, align 4
  br label %105

105:                                              ; preds = %102, %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  %106 = load i32, ptr %3, align 4
  switch i32 %106, label %314 [
    i32 0, label %107
    i32 16, label %108
  ]

107:                                              ; preds = %105
  br label %108

108:                                              ; preds = %107, %105
  %109 = load i64, ptr %11, align 8, !tbaa !8
  %110 = add nsw i64 %109, 1
  store i64 %110, ptr %11, align 8, !tbaa !8
  br label %78, !llvm.loop !13

111:                                              ; preds = %81
  %112 = load i64, ptr %10, align 8, !tbaa !8
  %113 = load i64, ptr %6, align 8, !tbaa !8
  %114 = getelementptr inbounds [3000 x [3000 x i64]], ptr @adj, i64 0, i64 %113
  %115 = load i64, ptr %7, align 8, !tbaa !8
  %116 = getelementptr inbounds [3000 x i64], ptr %114, i64 0, i64 %115
  store i64 %112, ptr %116, align 8, !tbaa !8
  %117 = load i64, ptr %10, align 8, !tbaa !8
  %118 = icmp slt i64 %117, 2
  br i1 %118, label %119, label %126

119:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #7
  invoke void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %120 unwind label %122

120:                                              ; preds = %119
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %121 unwind label %122

121:                                              ; preds = %120
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #7
  br label %126

122:                                              ; preds = %120, %119
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %8, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #7
  br label %130

126:                                              ; preds = %121, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %127

127:                                              ; preds = %126, %72
  %128 = load i64, ptr %7, align 8, !tbaa !8
  %129 = add nsw i64 %128, 1
  store i64 %129, ptr %7, align 8, !tbaa !8
  br label %62, !llvm.loop !14

130:                                              ; preds = %122, %98
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %131

131:                                              ; preds = %130, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %306

132:                                              ; preds = %66
  br label %133

133:                                              ; preds = %132
  %134 = load i64, ptr %6, align 8, !tbaa !8
  %135 = add nsw i64 %134, 1
  store i64 %135, ptr %6, align 8, !tbaa !8
  br label %56, !llvm.loop !15

136:                                              ; preds = %60
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #7
  store i8 1, ptr %15, align 1, !tbaa !16
  br label %137

137:                                              ; preds = %228, %136
  %138 = invoke noundef zeroext i1 @_ZNKSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %139 unwind label %160

139:                                              ; preds = %137
  %140 = xor i1 %138, true
  br i1 %140, label %141, label %231

141:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %142 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %143 unwind label %164

143:                                              ; preds = %141
  %144 = getelementptr inbounds %"struct.std::pair", ptr %142, i32 0, i32 0
  %145 = load i64, ptr %144, align 8, !tbaa !18
  store i64 %145, ptr %16, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %146 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %147 unwind label %168

147:                                              ; preds = %143
  %148 = getelementptr inbounds %"struct.std::pair", ptr %146, i32 0, i32 1
  %149 = load i64, ptr %148, align 8, !tbaa !20
  store i64 %149, ptr %17, align 8, !tbaa !8
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %150 unwind label %168

150:                                              ; preds = %147
  %151 = load i64, ptr %16, align 8, !tbaa !8
  %152 = getelementptr inbounds [3000 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %151
  %153 = load i64, ptr %17, align 8, !tbaa !8
  %154 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %152, i64 noundef %153)
          to label %155 unwind label %168

155:                                              ; preds = %150
  %156 = load i8, ptr %154, align 1, !tbaa !21
  %157 = sext i8 %156 to i32
  %158 = icmp eq i32 %157, 94
  br i1 %158, label %159, label %172

159:                                              ; preds = %155
  store i8 0, ptr %15, align 1, !tbaa !16
  store i32 18, ptr %3, align 4
  br label %226

160:                                              ; preds = %241, %239, %236, %234, %137
  %161 = landingpad { ptr, i32 }
          cleanup
  %162 = extractvalue { ptr, i32 } %161, 0
  store ptr %162, ptr %8, align 8
  %163 = extractvalue { ptr, i32 } %161, 1
  store i32 %163, ptr %9, align 4
  br label %305

164:                                              ; preds = %141
  %165 = landingpad { ptr, i32 }
          cleanup
  %166 = extractvalue { ptr, i32 } %165, 0
  store ptr %166, ptr %8, align 8
  %167 = extractvalue { ptr, i32 } %165, 1
  store i32 %167, ptr %9, align 4
  br label %230

168:                                              ; preds = %150, %147, %143
  %169 = landingpad { ptr, i32 }
          cleanup
  %170 = extractvalue { ptr, i32 } %169, 0
  store ptr %170, ptr %8, align 8
  %171 = extractvalue { ptr, i32 } %169, 1
  store i32 %171, ptr %9, align 4
  br label %229

172:                                              ; preds = %155
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  store i64 0, ptr %18, align 8, !tbaa !8
  br label %173

173:                                              ; preds = %221, %172
  %174 = load i64, ptr %18, align 8, !tbaa !8
  %175 = icmp slt i64 %174, 4
  br i1 %175, label %177, label %176

176:                                              ; preds = %173
  store i32 19, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %225

177:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %178 = load i64, ptr %16, align 8, !tbaa !8
  %179 = load i64, ptr %18, align 8, !tbaa !8
  %180 = getelementptr inbounds [4 x i64], ptr @dx, i64 0, i64 %179
  %181 = load i64, ptr %180, align 8, !tbaa !8
  %182 = add nsw i64 %178, %181
  store i64 %182, ptr %19, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %183 = load i64, ptr %17, align 8, !tbaa !8
  %184 = load i64, ptr %18, align 8, !tbaa !8
  %185 = getelementptr inbounds [4 x i64], ptr @dy, i64 0, i64 %184
  %186 = load i64, ptr %185, align 8, !tbaa !8
  %187 = add nsw i64 %183, %186
  store i64 %187, ptr %20, align 8, !tbaa !8
  %188 = load i64, ptr %19, align 8, !tbaa !8
  %189 = load i64, ptr %20, align 8, !tbaa !8
  %190 = invoke noundef zeroext i1 @_Z4goodxx(i64 noundef %188, i64 noundef %189)
          to label %191 unwind label %193

191:                                              ; preds = %177
  br i1 %190, label %197, label %192

192:                                              ; preds = %191
  store i32 21, ptr %3, align 4
  br label %218

193:                                              ; preds = %177
  %194 = landingpad { ptr, i32 }
          cleanup
  %195 = extractvalue { ptr, i32 } %194, 0
  store ptr %195, ptr %8, align 8
  %196 = extractvalue { ptr, i32 } %194, 1
  store i32 %196, ptr %9, align 4
  br label %224

197:                                              ; preds = %191
  %198 = load i64, ptr %19, align 8, !tbaa !8
  %199 = getelementptr inbounds [3000 x [3000 x i64]], ptr @adj, i64 0, i64 %198
  %200 = load i64, ptr %20, align 8, !tbaa !8
  %201 = getelementptr inbounds [3000 x i64], ptr %199, i64 0, i64 %200
  %202 = load i64, ptr %201, align 8, !tbaa !8
  %203 = add nsw i64 %202, -1
  store i64 %203, ptr %201, align 8, !tbaa !8
  %204 = load i64, ptr %19, align 8, !tbaa !8
  %205 = getelementptr inbounds [3000 x [3000 x i64]], ptr @adj, i64 0, i64 %204
  %206 = load i64, ptr %20, align 8, !tbaa !8
  %207 = getelementptr inbounds [3000 x i64], ptr %205, i64 0, i64 %206
  %208 = load i64, ptr %207, align 8, !tbaa !8
  %209 = icmp eq i64 %208, 1
  br i1 %209, label %210, label %217

210:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #7
  invoke void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20)
          to label %211 unwind label %213

211:                                              ; preds = %210
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 8 dereferenceable(16) %21)
          to label %212 unwind label %213

212:                                              ; preds = %211
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #7
  br label %217

213:                                              ; preds = %211, %210
  %214 = landingpad { ptr, i32 }
          cleanup
  %215 = extractvalue { ptr, i32 } %214, 0
  store ptr %215, ptr %8, align 8
  %216 = extractvalue { ptr, i32 } %214, 1
  store i32 %216, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #7
  br label %224

217:                                              ; preds = %212, %197
  store i32 0, ptr %3, align 4
  br label %218

218:                                              ; preds = %217, %192
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  %219 = load i32, ptr %3, align 4
  switch i32 %219, label %314 [
    i32 0, label %220
    i32 21, label %221
  ]

220:                                              ; preds = %218
  br label %221

221:                                              ; preds = %220, %218
  %222 = load i64, ptr %18, align 8, !tbaa !8
  %223 = add nsw i64 %222, 1
  store i64 %223, ptr %18, align 8, !tbaa !8
  br label %173, !llvm.loop !22

224:                                              ; preds = %213, %193
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %229

225:                                              ; preds = %176
  store i32 0, ptr %3, align 4
  br label %226

226:                                              ; preds = %225, %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  %227 = load i32, ptr %3, align 4
  switch i32 %227, label %314 [
    i32 0, label %228
    i32 18, label %231
  ]

228:                                              ; preds = %226
  br label %137, !llvm.loop !23

229:                                              ; preds = %224, %168
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %230

230:                                              ; preds = %229, %164
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %305

231:                                              ; preds = %226, %139
  %232 = load i8, ptr %15, align 1, !tbaa !16, !range !24, !noundef !25
  %233 = trunc i8 %232 to i1
  br i1 %233, label %239, label %234

234:                                              ; preds = %231
  %235 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
          to label %236 unwind label %160

236:                                              ; preds = %234
  %237 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %235, i8 noundef signext 10)
          to label %238 unwind label %160

238:                                              ; preds = %236
  br label %301

239:                                              ; preds = %231
  %240 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.4)
          to label %241 unwind label %160

241:                                              ; preds = %239
  %242 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %240, i8 noundef signext 10)
          to label %243 unwind label %160

243:                                              ; preds = %241
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  store i64 0, ptr %22, align 8, !tbaa !8
  br label %244

244:                                              ; preds = %292, %243
  %245 = load i64, ptr %22, align 8, !tbaa !8
  %246 = load i64, ptr @R, align 8, !tbaa !8
  %247 = icmp slt i64 %245, %246
  br i1 %247, label %249, label %248

248:                                              ; preds = %244
  store i32 22, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %300

249:                                              ; preds = %244
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  store i64 0, ptr %23, align 8, !tbaa !8
  br label %250

250:                                              ; preds = %286, %249
  %251 = load i64, ptr %23, align 8, !tbaa !8
  %252 = load i64, ptr @C, align 8, !tbaa !8
  %253 = icmp slt i64 %251, %252
  br i1 %253, label %255, label %254

254:                                              ; preds = %250
  store i32 25, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %289

255:                                              ; preds = %250
  %256 = load i64, ptr %22, align 8, !tbaa !8
  %257 = getelementptr inbounds [3000 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %256
  %258 = load i64, ptr %23, align 8, !tbaa !8
  %259 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %257, i64 noundef %258)
          to label %260 unwind label %267

260:                                              ; preds = %255
  %261 = load i8, ptr %259, align 1, !tbaa !21
  %262 = sext i8 %261 to i32
  %263 = icmp eq i32 %262, 35
  br i1 %263, label %264, label %271

264:                                              ; preds = %260
  %265 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 35)
          to label %266 unwind label %267

266:                                              ; preds = %264
  br label %285

267:                                              ; preds = %281, %278, %264, %255
  %268 = landingpad { ptr, i32 }
          cleanup
  %269 = extractvalue { ptr, i32 } %268, 0
  store ptr %269, ptr %8, align 8
  %270 = extractvalue { ptr, i32 } %268, 1
  store i32 %270, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %299

271:                                              ; preds = %260
  %272 = load i64, ptr %22, align 8, !tbaa !8
  %273 = getelementptr inbounds [3000 x [3000 x i64]], ptr @adj, i64 0, i64 %272
  %274 = load i64, ptr %23, align 8, !tbaa !8
  %275 = getelementptr inbounds [3000 x i64], ptr %273, i64 0, i64 %274
  %276 = load i64, ptr %275, align 8, !tbaa !8
  %277 = icmp slt i64 %276, 2
  br i1 %277, label %278, label %281

278:                                              ; preds = %271
  %279 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 46)
          to label %280 unwind label %267

280:                                              ; preds = %278
  br label %284

281:                                              ; preds = %271
  %282 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 94)
          to label %283 unwind label %267

283:                                              ; preds = %281
  br label %284

284:                                              ; preds = %283, %280
  br label %285

285:                                              ; preds = %284, %266
  br label %286

286:                                              ; preds = %285
  %287 = load i64, ptr %23, align 8, !tbaa !8
  %288 = add nsw i64 %287, 1
  store i64 %288, ptr %23, align 8, !tbaa !8
  br label %250, !llvm.loop !26

289:                                              ; preds = %254
  %290 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
          to label %291 unwind label %295

291:                                              ; preds = %289
  br label %292

292:                                              ; preds = %291
  %293 = load i64, ptr %22, align 8, !tbaa !8
  %294 = add nsw i64 %293, 1
  store i64 %294, ptr %22, align 8, !tbaa !8
  br label %244, !llvm.loop !27

295:                                              ; preds = %289
  %296 = landingpad { ptr, i32 }
          cleanup
  %297 = extractvalue { ptr, i32 } %296, 0
  store ptr %297, ptr %8, align 8
  %298 = extractvalue { ptr, i32 } %296, 1
  store i32 %298, ptr %9, align 4
  br label %299

299:                                              ; preds = %295, %267
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %305

300:                                              ; preds = %248
  br label %301

301:                                              ; preds = %300, %238
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #7
  call void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %5) #7
  br label %302

302:                                              ; preds = %301
  %303 = load i64, ptr %2, align 8, !tbaa !8
  %304 = add nsw i64 %303, 1
  store i64 %304, ptr %2, align 8, !tbaa !8
  br label %31, !llvm.loop !28

305:                                              ; preds = %299, %230, %160
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #7
  br label %306

306:                                              ; preds = %305, %131
  call void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %309

307:                                              ; preds = %35
  %308 = load i32, ptr %1, align 4
  ret i32 %308

309:                                              ; preds = %306
  %310 = load ptr, ptr %8, align 8
  %311 = load i32, ptr %9, align 4
  %312 = insertvalue { ptr, i32 } poison, ptr %310, 0
  %313 = insertvalue { ptr, i32 } %312, i32 %311, 1
  resume { ptr, i32 } %313

314:                                              ; preds = %226, %218, %105
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #3

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

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueISt4pairIxxESt5dequeIS1_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 @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueISt4pairIxxESt5dequeIS1_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 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 #2 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = !{!17, !17, i64 0}
!17 = !{!"bool", !10, i64 0}
!18 = !{!19, !9, i64 0}
!19 = !{!"_ZTSSt4pairIxxE", !9, i64 0, !9, i64 8}
!20 = !{!19, !9, i64 8}
!21 = !{!10, !10, i64 0}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !12}


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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::basic_istream" = type { ptr, i64, %"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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type { i64, i64 }

@dx = external dso_local local_unnamed_addr global [4 x i64], align 16
@dy = external dso_local local_unnamed_addr global [4 x i64], align 16
@T = external dso_local global i64, align 8
@R = external dso_local global i64, align 8
@C = external dso_local global i64, align 8
@_Z1SB5cxx11 = external dso_local global [3000 x %"class.std::__cxx11::basic_string"], align 16
@adj = external dso_local local_unnamed_addr global [3000 x [3000 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::queue", align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %9 = getelementptr i8, ptr %8, i64 -24
  %10 = load i64, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %10
  %12 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %11, ptr noundef null)
  %13 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %14 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  %15 = load i64, ptr @T, align 8, !tbaa !8
  %.not91 = icmp slt i64 %15, 1
  br i1 %.not91, label %._crit_edge95, label %.lr.ph94

._crit_edge95:                                    ; preds = %.loopexit71, %0
  ret i32 0

.lr.ph94:                                         ; preds = %0, %.loopexit71
  %.03792 = phi i64 [ %206, %.loopexit71 ], [ 1, %0 ]
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %16, i64 noundef %.03792)
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull @.str.2)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @R)
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(8) @C)
  %21 = load i64, ptr @R, align 8, !tbaa !8
  %22 = icmp sgt i64 %21, 0
  br i1 %22, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph94
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %1) #7
  call void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  %23 = load i64, ptr @R, align 8, !tbaa !8
  %24 = icmp sgt i64 %23, 0
  %25 = load i64, ptr @C, align 8
  %26 = icmp sgt i64 %25, 0
  %or.cond = select i1 %24, i1 %26, i1 false
  br i1 %or.cond, label %.lr.ph81.split, label %._crit_edge82

.lr.ph:                                           ; preds = %.lr.ph94, %.lr.ph
  %.04073 = phi i64 [ %29, %.lr.ph ], [ 0, %.lr.ph94 ]
  %27 = getelementptr inbounds [3000 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %.04073
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %27)
  %29 = add nuw nsw i64 %.04073, 1
  %30 = load i64, ptr @R, align 8, !tbaa !8
  %31 = icmp slt i64 %29, %30
  br i1 %31, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge82:                                    ; preds = %._crit_edge79, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %32 = call noundef zeroext i1 @_ZNKSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %32, label %._crit_edge86, label %.lr.ph85

.lr.ph81.split:                                   ; preds = %._crit_edge, %._crit_edge79
  %33 = phi i64 [ %37, %._crit_edge79 ], [ %23, %._crit_edge ]
  %34 = phi i64 [ %40, %._crit_edge79 ], [ 0, %._crit_edge ]
  %35 = phi i64 [ %39, %._crit_edge79 ], [ %25, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  store i64 0, ptr %3, align 8, !tbaa !8
  %36 = icmp sgt i64 %35, 0
  br i1 %36, label %.lr.ph78, label %._crit_edge79

._crit_edge79.loopexit:                           ; preds = %89
  %.pre97 = load i64, ptr %2, align 8, !tbaa !8
  %.pre98 = load i64, ptr @R, align 8, !tbaa !8
  br label %._crit_edge79

._crit_edge79:                                    ; preds = %._crit_edge79.loopexit, %.lr.ph81.split
  %37 = phi i64 [ %.pre98, %._crit_edge79.loopexit ], [ %33, %.lr.ph81.split ]
  %38 = phi i64 [ %.pre97, %._crit_edge79.loopexit ], [ %34, %.lr.ph81.split ]
  %39 = phi i64 [ %92, %._crit_edge79.loopexit ], [ %35, %.lr.ph81.split ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %40 = add nsw i64 %38, 1
  store i64 %40, ptr %2, align 8, !tbaa !8
  %41 = icmp slt i64 %40, %37
  br i1 %41, label %.lr.ph81.split, label %._crit_edge82, !llvm.loop !13

.lr.ph78:                                         ; preds = %.lr.ph81.split, %89
  %storemerge5876 = phi i64 [ %91, %89 ], [ 0, %.lr.ph81.split ]
  %42 = load i64, ptr %2, align 8, !tbaa !8
  %43 = invoke noundef zeroext i1 @_Z4goodxx(i64 noundef %42, i64 noundef %storemerge5876)
          to label %44 unwind label %51

44:                                               ; preds = %.lr.ph78
  %.pre96 = load i64, ptr %3, align 8, !tbaa !8
  br i1 %43, label %.preheader.preheader, label %89

.preheader.preheader:                             ; preds = %44
  %45 = load i64, ptr %2, align 8, !tbaa !8
  %46 = load i64, ptr @dx, align 16, !tbaa !8
  %47 = add nsw i64 %46, %45
  %48 = load i64, ptr @dy, align 16, !tbaa !8
  %49 = add nsw i64 %48, %.pre96
  %50 = invoke noundef zeroext i1 @_Z4goodxx(i64 noundef %47, i64 noundef %49)
          to label %.preheader.1 unwind label %83

51:                                               ; preds = %.lr.ph78
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %94

.preheader.1:                                     ; preds = %.preheader.preheader
  %53 = load i64, ptr %2, align 8, !tbaa !8
  %54 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 8), align 8, !tbaa !8
  %55 = add nsw i64 %54, %53
  %56 = load i64, ptr %3, align 8, !tbaa !8
  %57 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 8), align 8, !tbaa !8
  %58 = add nsw i64 %57, %56
  %59 = invoke noundef zeroext i1 @_Z4goodxx(i64 noundef %55, i64 noundef %58)
          to label %.preheader.2 unwind label %83

.preheader.2:                                     ; preds = %.preheader.1
  %60 = load i64, ptr %2, align 8, !tbaa !8
  %61 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 16), align 16, !tbaa !8
  %62 = add nsw i64 %61, %60
  %63 = load i64, ptr %3, align 8, !tbaa !8
  %64 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 16), align 16, !tbaa !8
  %65 = add nsw i64 %64, %63
  %66 = invoke noundef zeroext i1 @_Z4goodxx(i64 noundef %62, i64 noundef %65)
          to label %.preheader.3 unwind label %83

.preheader.3:                                     ; preds = %.preheader.2
  %67 = load i64, ptr %2, align 8, !tbaa !8
  %68 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 24), align 8, !tbaa !8
  %69 = add nsw i64 %68, %67
  %70 = load i64, ptr %3, align 8, !tbaa !8
  %71 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 24), align 8, !tbaa !8
  %72 = add nsw i64 %71, %70
  %73 = invoke noundef zeroext i1 @_Z4goodxx(i64 noundef %69, i64 noundef %72)
          to label %74 unwind label %83

74:                                               ; preds = %.preheader.3
  %75 = zext i1 %50 to i64
  %76 = zext i1 %59 to i64
  %.146.1 = add nuw nsw i64 %75, %76
  %77 = zext i1 %66 to i64
  %.146.2 = add nuw nsw i64 %.146.1, %77
  %78 = zext i1 %73 to i64
  %.146.3 = add nuw nsw i64 %.146.2, %78
  %79 = load i64, ptr %2, align 8, !tbaa !8
  %80 = load i64, ptr %3, align 8, !tbaa !8
  %81 = getelementptr inbounds [3000 x [3000 x i64]], ptr @adj, i64 0, i64 %79, i64 %80
  store i64 %.146.3, ptr %81, align 8, !tbaa !8
  %82 = icmp ult i64 %.146.3, 2
  br i1 %82, label %85, label %89

83:                                               ; preds = %.preheader.3, %.preheader.2, %.preheader.1, %.preheader.preheader
  %84 = landingpad { ptr, i32 }
          cleanup
  br label %94

85:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %86 unwind label %87

86:                                               ; preds = %85
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  %.pre = load i64, ptr %3, align 8, !tbaa !8
  br label %89

87:                                               ; preds = %85
  %88 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  br label %94

89:                                               ; preds = %74, %86, %44
  %90 = phi i64 [ %80, %74 ], [ %.pre, %86 ], [ %.pre96, %44 ]
  %91 = add nsw i64 %90, 1
  store i64 %91, ptr %3, align 8, !tbaa !8
  %92 = load i64, ptr @C, align 8, !tbaa !8
  %93 = icmp slt i64 %91, %92
  br i1 %93, label %.lr.ph78, label %._crit_edge79.loopexit, !llvm.loop !15

94:                                               ; preds = %83, %87, %51
  %.pn59.pn = phi { ptr, i32 } [ %52, %51 ], [ %84, %83 ], [ %88, %87 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  br label %208

.lr.ph85:                                         ; preds = %._crit_edge82, %.loopexit
  %95 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %96 = load i64, ptr %95, align 8, !tbaa !16
  %97 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %98 = getelementptr inbounds i8, ptr %97, i64 8
  %99 = load i64, ptr %98, align 8, !tbaa !18
  call void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %100 = getelementptr inbounds [3000 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %96
  %101 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %100, i64 noundef %99)
  %102 = load i8, ptr %101, align 1, !tbaa !19
  %103 = icmp eq i8 %102, 94
  br i1 %103, label %.thread66, label %.preheader69.preheader

.preheader69.preheader:                           ; preds = %.lr.ph85
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %104 = load i64, ptr @dx, align 16, !tbaa !8
  %105 = add nsw i64 %104, %96
  store i64 %105, ptr %5, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %106 = load i64, ptr @dy, align 16, !tbaa !8
  %107 = add nsw i64 %106, %99
  store i64 %107, ptr %6, align 8, !tbaa !8
  %108 = invoke noundef zeroext i1 @_Z4goodxx(i64 noundef %105, i64 noundef %107)
          to label %111 unwind label %112

109:                                              ; preds = %176, %._crit_edge86, %173, %.thread66
  %110 = landingpad { ptr, i32 }
          cleanup
  br label %208

111:                                              ; preds = %.preheader69.preheader
  br i1 %108, label %114, label %.preheader69.1

112:                                              ; preds = %.preheader69.3, %.preheader69.2, %.preheader69.1, %.preheader69.preheader
  %113 = landingpad { ptr, i32 }
          cleanup
  br label %171

114:                                              ; preds = %111
  %115 = load i64, ptr %5, align 8, !tbaa !8
  %116 = load i64, ptr %6, align 8, !tbaa !8
  %117 = getelementptr inbounds [3000 x [3000 x i64]], ptr @adj, i64 0, i64 %115, i64 %116
  %118 = load i64, ptr %117, align 8, !tbaa !8
  %119 = add nsw i64 %118, -1
  store i64 %119, ptr %117, align 8, !tbaa !8
  %120 = icmp eq i64 %119, 1
  br i1 %120, label %121, label %.preheader69.1

121:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %122 unwind label %123

122:                                              ; preds = %121
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  br label %.preheader69.1

123:                                              ; preds = %168, %153, %138, %121
  %124 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  br label %171

.preheader69.1:                                   ; preds = %114, %122, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %125 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 8), align 8, !tbaa !8
  %126 = add nsw i64 %125, %96
  store i64 %126, ptr %5, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %127 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 8), align 8, !tbaa !8
  %128 = add nsw i64 %127, %99
  store i64 %128, ptr %6, align 8, !tbaa !8
  %129 = invoke noundef zeroext i1 @_Z4goodxx(i64 noundef %126, i64 noundef %128)
          to label %130 unwind label %112

130:                                              ; preds = %.preheader69.1
  br i1 %129, label %131, label %.preheader69.2

131:                                              ; preds = %130
  %132 = load i64, ptr %5, align 8, !tbaa !8
  %133 = load i64, ptr %6, align 8, !tbaa !8
  %134 = getelementptr inbounds [3000 x [3000 x i64]], ptr @adj, i64 0, i64 %132, i64 %133
  %135 = load i64, ptr %134, align 8, !tbaa !8
  %136 = add nsw i64 %135, -1
  store i64 %136, ptr %134, align 8, !tbaa !8
  %137 = icmp eq i64 %136, 1
  br i1 %137, label %138, label %.preheader69.2

138:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %139 unwind label %123

139:                                              ; preds = %138
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  br label %.preheader69.2

.preheader69.2:                                   ; preds = %139, %131, %130
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %140 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 16), align 16, !tbaa !8
  %141 = add nsw i64 %140, %96
  store i64 %141, ptr %5, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %142 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 16), align 16, !tbaa !8
  %143 = add nsw i64 %142, %99
  store i64 %143, ptr %6, align 8, !tbaa !8
  %144 = invoke noundef zeroext i1 @_Z4goodxx(i64 noundef %141, i64 noundef %143)
          to label %145 unwind label %112

145:                                              ; preds = %.preheader69.2
  br i1 %144, label %146, label %.preheader69.3

146:                                              ; preds = %145
  %147 = load i64, ptr %5, align 8, !tbaa !8
  %148 = load i64, ptr %6, align 8, !tbaa !8
  %149 = getelementptr inbounds [3000 x [3000 x i64]], ptr @adj, i64 0, i64 %147, i64 %148
  %150 = load i64, ptr %149, align 8, !tbaa !8
  %151 = add nsw i64 %150, -1
  store i64 %151, ptr %149, align 8, !tbaa !8
  %152 = icmp eq i64 %151, 1
  br i1 %152, label %153, label %.preheader69.3

153:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %154 unwind label %123

154:                                              ; preds = %153
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  br label %.preheader69.3

.preheader69.3:                                   ; preds = %154, %146, %145
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %155 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 24), align 8, !tbaa !8
  %156 = add nsw i64 %155, %96
  store i64 %156, ptr %5, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %157 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 24), align 8, !tbaa !8
  %158 = add nsw i64 %157, %99
  store i64 %158, ptr %6, align 8, !tbaa !8
  %159 = invoke noundef zeroext i1 @_Z4goodxx(i64 noundef %156, i64 noundef %158)
          to label %160 unwind label %112

160:                                              ; preds = %.preheader69.3
  br i1 %159, label %161, label %.loopexit

161:                                              ; preds = %160
  %162 = load i64, ptr %5, align 8, !tbaa !8
  %163 = load i64, ptr %6, align 8, !tbaa !8
  %164 = getelementptr inbounds [3000 x [3000 x i64]], ptr @adj, i64 0, i64 %162, i64 %163
  %165 = load i64, ptr %164, align 8, !tbaa !8
  %166 = add nsw i64 %165, -1
  store i64 %166, ptr %164, align 8, !tbaa !8
  %167 = icmp eq i64 %166, 1
  br i1 %167, label %168, label %.loopexit

168:                                              ; preds = %161
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %169 unwind label %123

169:                                              ; preds = %168
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  br label %.loopexit

.loopexit:                                        ; preds = %169, %161, %160
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %170 = call noundef zeroext i1 @_ZNKSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %170, label %._crit_edge86, label %.lr.ph85

171:                                              ; preds = %123, %112
  %.pn = phi { ptr, i32 } [ %124, %123 ], [ %113, %112 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %208

.thread66:                                        ; preds = %.lr.ph85
  %172 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.3)
          to label %173 unwind label %109

173:                                              ; preds = %.thread66
  %174 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %172, i8 noundef signext 10)
          to label %.loopexit71 unwind label %109

._crit_edge86:                                    ; preds = %.loopexit, %._crit_edge82
  %175 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.4)
          to label %176 unwind label %109

176:                                              ; preds = %._crit_edge86
  %177 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %175, i8 noundef signext 10)
          to label %.preheader70 unwind label %109

.preheader70:                                     ; preds = %176
  %178 = load i64, ptr @R, align 8, !tbaa !8
  %179 = icmp sgt i64 %178, 0
  br i1 %179, label %.preheader68, label %.loopexit71

.preheader68:                                     ; preds = %.preheader70, %200
  %.03590 = phi i64 [ %201, %200 ], [ 0, %.preheader70 ]
  %180 = load i64, ptr @C, align 8, !tbaa !8
  %181 = icmp sgt i64 %180, 0
  br i1 %181, label %.lr.ph88, label %._crit_edge89

.lr.ph88:                                         ; preds = %.preheader68
  %182 = getelementptr inbounds [3000 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %.03590
  br label %184

._crit_edge89:                                    ; preds = %196, %.preheader68
  %183 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
          to label %200 unwind label %204

184:                                              ; preds = %.lr.ph88, %196
  %.087 = phi i64 [ 0, %.lr.ph88 ], [ %197, %196 ]
  %185 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %182, i64 noundef %.087)
  %186 = load i8, ptr %185, align 1, !tbaa !19
  %187 = icmp eq i8 %186, 35
  br i1 %187, label %.invoke, label %190

188:                                              ; preds = %.invoke
  %189 = landingpad { ptr, i32 }
          cleanup
  br label %208

190:                                              ; preds = %184
  %191 = getelementptr inbounds [3000 x [3000 x i64]], ptr @adj, i64 0, i64 %.03590, i64 %.087
  %192 = load i64, ptr %191, align 8, !tbaa !8
  %193 = icmp slt i64 %192, 2
  %. = select i1 %193, i8 46, i8 94
  br label %.invoke

.invoke:                                          ; preds = %184, %190
  %194 = phi i8 [ %., %190 ], [ 35, %184 ]
  %195 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %194)
          to label %196 unwind label %188

196:                                              ; preds = %.invoke
  %197 = add nuw nsw i64 %.087, 1
  %198 = load i64, ptr @C, align 8, !tbaa !8
  %199 = icmp slt i64 %197, %198
  br i1 %199, label %184, label %._crit_edge89, !llvm.loop !20

200:                                              ; preds = %._crit_edge89
  %201 = add nuw nsw i64 %.03590, 1
  %202 = load i64, ptr @R, align 8, !tbaa !8
  %203 = icmp slt i64 %201, %202
  br i1 %203, label %.preheader68, label %.loopexit71, !llvm.loop !21

204:                                              ; preds = %._crit_edge89
  %205 = landingpad { ptr, i32 }
          cleanup
  br label %208

.loopexit71:                                      ; preds = %200, %.preheader70, %173
  call void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #7
  %206 = add nuw nsw i64 %.03792, 1
  %207 = load i64, ptr @T, align 8, !tbaa !8
  %.not.not = icmp slt i64 %.03792, %207
  br i1 %.not.not, label %.lr.ph94, label %._crit_edge95, !llvm.loop !22

208:                                              ; preds = %109, %171, %204, %188, %94
  %.pn59.pn.pn = phi { ptr, i32 } [ %.pn59.pn, %94 ], [ %110, %109 ], [ %.pn, %171 ], [ %189, %188 ], [ %205, %204 ]
  call void @_ZNSt5queueISt4pairIxxESt5dequeIS1_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 } %.pn59.pn.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #3

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

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueISt4pairIxxESt5dequeIS1_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 @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueISt4pairIxxESt5dequeIS1_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 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 #2 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12, !14}
!14 = !{!"llvm.loop.unswitch.partial.disable"}
!15 = distinct !{!15, !12}
!16 = !{!17, !9, i64 0}
!17 = !{!"_ZTSSt4pairIxxE", !9, i64 0, !9, i64 8}
!18 = !{!17, !9, i64 8}
!19 = !{!10, !10, i64 0}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}


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