; LLVM IR from eyangch/competitive-programming :: Codeforces/1689 (d)

; 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::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<long long, std::pair<long long, long long>>, std::allocator<std::pair<long long, std::pair<long long, long long>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, std::pair<long long, long long>>, std::allocator<std::pair<long long, std::pair<long long, long long>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, std::pair<long long, long long>>, std::allocator<std::pair<long long, std::pair<long long, long long>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, std::pair<long long, long long>>, std::allocator<std::pair<long long, std::pair<long long, long long>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i64, %"struct.std::pair.3" }
%"struct.std::pair.3" = type { i64, i64 }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@d = external dso_local global [1000 x [1000 x i64]], align 16
@_Z1bB5cxx11 = external dso_local global [1000 x %"class.std::__cxx11::basic_string"], align 16
@dx = external dso_local global [4 x i64], align 16
@dy = external dso_local global [4 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca %"class.std::priority_queue", align 8
  %13 = alloca %"struct.std::pair", align 8
  %14 = alloca %"struct.std::pair.3", align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::pair", align 8
  %20 = alloca %"struct.std::pair.3", align 8
  %21 = alloca i64, align 8
  %22 = alloca i32, align 4
  %23 = alloca %"struct.std::pair", align 8
  %24 = alloca %"struct.std::pair.3", align 8
  %25 = alloca i32, align 4
  %26 = alloca i64, align 8
  %27 = alloca %"struct.std::pair", align 8
  %28 = alloca %"struct.std::pair.3", align 8
  %29 = alloca i64, align 8
  %30 = alloca i64, align 8
  %31 = alloca i64, align 8
  %32 = alloca i64, align 8
  %33 = alloca i64, align 8
  %34 = alloca i64, align 8
  %35 = alloca i64, align 8
  %36 = alloca i64, align 8
  %37 = alloca %"struct.std::pair", align 8
  %38 = alloca i64, align 8
  %39 = alloca %"struct.std::pair.3", align 8
  %40 = alloca i64, align 8
  %41 = alloca i64, align 8
  %42 = alloca i64, align 8
  %43 = alloca i64, align 8
  %44 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %45 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %46 = getelementptr i8, ptr %45, i64 -24
  %47 = load i64, ptr %46, align 8
  %48 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %47
  %49 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %48, ptr noundef null)
  %50 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %51 = 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)
  br label %52

52:                                               ; preds = %375, %0
  %53 = load i64, ptr @T, align 8, !tbaa !8
  %54 = add nsw i64 %53, -1
  store i64 %54, ptr @T, align 8, !tbaa !8
  %55 = icmp ne i64 %53, 0
  br i1 %55, label %56, label %381

56:                                               ; preds = %52
  %57 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %58 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %57, ptr noundef nonnull align 8 dereferenceable(8) @M)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %59

59:                                               ; preds = %68, %56
  %60 = load i64, ptr %2, align 8, !tbaa !8
  %61 = load i64, ptr @N, align 8, !tbaa !8
  %62 = icmp slt i64 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %71

64:                                               ; preds = %59
  %65 = load i64, ptr %2, align 8, !tbaa !8
  %66 = getelementptr inbounds [1000 x %"class.std::__cxx11::basic_string"], ptr @_Z1bB5cxx11, i64 0, i64 %65
  %67 = 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) %66)
  br label %68

68:                                               ; preds = %64
  %69 = load i64, ptr %2, align 8, !tbaa !8
  %70 = add nsw i64 %69, 1
  store i64 %70, ptr %2, align 8, !tbaa !8
  br label %59, !llvm.loop !11

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

72:                                               ; preds = %92, %71
  %73 = load i64, ptr %3, align 8, !tbaa !8
  %74 = load i64, ptr @N, align 8, !tbaa !8
  %75 = icmp slt i64 %73, %74
  br i1 %75, label %77, label %76

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

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

78:                                               ; preds = %88, %77
  %79 = load i64, ptr %5, align 8, !tbaa !8
  %80 = load i64, ptr @M, align 8, !tbaa !8
  %81 = icmp slt i64 %79, %80
  br i1 %81, label %83, label %82

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

83:                                               ; preds = %78
  %84 = load i64, ptr %3, align 8, !tbaa !8
  %85 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %84
  %86 = load i64, ptr %5, align 8, !tbaa !8
  %87 = getelementptr inbounds [1000 x i64], ptr %85, i64 0, i64 %86
  store i64 -1, ptr %87, align 8, !tbaa !8
  br label %88

88:                                               ; preds = %83
  %89 = load i64, ptr %5, align 8, !tbaa !8
  %90 = add nsw i64 %89, 1
  store i64 %90, ptr %5, align 8, !tbaa !8
  br label %78, !llvm.loop !13

91:                                               ; preds = %82
  br label %92

92:                                               ; preds = %91
  %93 = load i64, ptr %3, align 8, !tbaa !8
  %94 = add nsw i64 %93, 1
  store i64 %94, ptr %3, align 8, !tbaa !8
  br label %72, !llvm.loop !14

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

96:                                               ; preds = %175, %95
  %97 = load i64, ptr %6, align 8, !tbaa !8
  %98 = load i64, ptr @N, align 8, !tbaa !8
  %99 = icmp slt i64 %97, %98
  br i1 %99, label %101, label %100

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

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

102:                                              ; preds = %171, %101
  %103 = load i64, ptr %7, align 8, !tbaa !8
  %104 = load i64, ptr @M, align 8, !tbaa !8
  %105 = icmp slt i64 %103, %104
  br i1 %105, label %107, label %106

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

107:                                              ; preds = %102
  %108 = load i64, ptr %6, align 8, !tbaa !8
  %109 = getelementptr inbounds [1000 x %"class.std::__cxx11::basic_string"], ptr @_Z1bB5cxx11, i64 0, i64 %108
  %110 = load i64, ptr %7, align 8, !tbaa !8
  %111 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %109, i64 noundef %110)
  %112 = load i8, ptr %111, align 1, !tbaa !15
  %113 = sext i8 %112 to i32
  %114 = icmp eq i32 %113, 87
  br i1 %114, label %115, label %116

115:                                              ; preds = %107
  br label %171

116:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %117 = load i64, ptr %6, align 8, !tbaa !8
  %118 = load i64, ptr %7, align 8, !tbaa !8
  %119 = call noundef i64 @_Z4distxxxx(i64 noundef 0, i64 noundef 0, i64 noundef %117, i64 noundef %118)
  store i64 %119, ptr %8, align 8, !tbaa !8
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @d, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %121 = load i64, ptr %120, align 8, !tbaa !8
  store i64 %121, ptr @d, align 16, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  %122 = load i64, ptr @N, align 8, !tbaa !8
  %123 = sub nsw i64 %122, 1
  %124 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %123
  %125 = getelementptr inbounds [1000 x i64], ptr %124, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %126 = load i64, ptr @N, align 8, !tbaa !8
  %127 = sub nsw i64 %126, 1
  %128 = load i64, ptr %6, align 8, !tbaa !8
  %129 = load i64, ptr %7, align 8, !tbaa !8
  %130 = call noundef i64 @_Z4distxxxx(i64 noundef %127, i64 noundef 0, i64 noundef %128, i64 noundef %129)
  store i64 %130, ptr %9, align 8, !tbaa !8
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %125, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %132 = load i64, ptr %131, align 8, !tbaa !8
  %133 = load i64, ptr @N, align 8, !tbaa !8
  %134 = sub nsw i64 %133, 1
  %135 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %134
  %136 = getelementptr inbounds [1000 x i64], ptr %135, i64 0, i64 0
  store i64 %132, ptr %136, align 16, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  %137 = load i64, ptr @M, align 8, !tbaa !8
  %138 = sub nsw i64 %137, 1
  %139 = getelementptr inbounds [1000 x i64], ptr @d, i64 0, i64 %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %140 = load i64, ptr @M, align 8, !tbaa !8
  %141 = sub nsw i64 %140, 1
  %142 = load i64, ptr %6, align 8, !tbaa !8
  %143 = load i64, ptr %7, align 8, !tbaa !8
  %144 = call noundef i64 @_Z4distxxxx(i64 noundef 0, i64 noundef %141, i64 noundef %142, i64 noundef %143)
  store i64 %144, ptr %10, align 8, !tbaa !8
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %139, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %146 = load i64, ptr %145, align 8, !tbaa !8
  %147 = load i64, ptr @M, align 8, !tbaa !8
  %148 = sub nsw i64 %147, 1
  %149 = getelementptr inbounds [1000 x i64], ptr @d, i64 0, i64 %148
  store i64 %146, ptr %149, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  %150 = load i64, ptr @N, align 8, !tbaa !8
  %151 = sub nsw i64 %150, 1
  %152 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %151
  %153 = load i64, ptr @M, align 8, !tbaa !8
  %154 = sub nsw i64 %153, 1
  %155 = getelementptr inbounds [1000 x i64], ptr %152, i64 0, i64 %154
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %156 = load i64, ptr @N, align 8, !tbaa !8
  %157 = sub nsw i64 %156, 1
  %158 = load i64, ptr @M, align 8, !tbaa !8
  %159 = sub nsw i64 %158, 1
  %160 = load i64, ptr %6, align 8, !tbaa !8
  %161 = load i64, ptr %7, align 8, !tbaa !8
  %162 = call noundef i64 @_Z4distxxxx(i64 noundef %157, i64 noundef %159, i64 noundef %160, i64 noundef %161)
  store i64 %162, ptr %11, align 8, !tbaa !8
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %155, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %164 = load i64, ptr %163, align 8, !tbaa !8
  %165 = load i64, ptr @N, align 8, !tbaa !8
  %166 = sub nsw i64 %165, 1
  %167 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %166
  %168 = load i64, ptr @M, align 8, !tbaa !8
  %169 = sub nsw i64 %168, 1
  %170 = getelementptr inbounds [1000 x i64], ptr %167, i64 0, i64 %169
  store i64 %164, ptr %170, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %171

171:                                              ; preds = %116, %115
  %172 = load i64, ptr %7, align 8, !tbaa !8
  %173 = add nsw i64 %172, 1
  store i64 %173, ptr %7, align 8, !tbaa !8
  br label %102, !llvm.loop !16

174:                                              ; preds = %106
  br label %175

175:                                              ; preds = %174
  %176 = load i64, ptr %6, align 8, !tbaa !8
  %177 = add nsw i64 %176, 1
  store i64 %177, ptr %6, align 8, !tbaa !8
  br label %96, !llvm.loop !17

178:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #7
  call void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %12)
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !18
  invoke void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %179 unwind label %236

179:                                              ; preds = %178
  invoke void @_ZNSt4pairIxS_IxxEEC2IxS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(8) @d, ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %180 unwind label %236

180:                                              ; preds = %179
  invoke void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %12, ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %181 unwind label %236

181:                                              ; preds = %180
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #7
  %182 = load i64, ptr @N, align 8, !tbaa !8
  %183 = sub nsw i64 %182, 1
  %184 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %183
  %185 = getelementptr inbounds [1000 x i64], ptr %184, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %186 = load i64, ptr @N, align 8, !tbaa !8
  %187 = sub nsw i64 %186, 1
  store i64 %187, ptr %21, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  store i32 0, ptr %22, align 4, !tbaa !18
  invoke void @_ZNSt4pairIxxEC2IxiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %188 unwind label %240

188:                                              ; preds = %181
  invoke void @_ZNSt4pairIxS_IxxEEC2IxS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(8) %185, ptr noundef nonnull align 8 dereferenceable(16) %20)
          to label %189 unwind label %240

189:                                              ; preds = %188
  invoke void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %12, ptr noundef nonnull align 8 dereferenceable(24) %19)
          to label %190 unwind label %240

190:                                              ; preds = %189
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #7
  %191 = load i64, ptr @M, align 8, !tbaa !8
  %192 = sub nsw i64 %191, 1
  %193 = getelementptr inbounds [1000 x i64], ptr @d, i64 0, i64 %192
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 0, ptr %25, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %194 = load i64, ptr @M, align 8, !tbaa !8
  %195 = sub nsw i64 %194, 1
  store i64 %195, ptr %26, align 8, !tbaa !8
  invoke void @_ZNSt4pairIxxEC2IixTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 8 dereferenceable(8) %26)
          to label %196 unwind label %244

196:                                              ; preds = %190
  invoke void @_ZNSt4pairIxS_IxxEEC2IxS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(8) %193, ptr noundef nonnull align 8 dereferenceable(16) %24)
          to label %197 unwind label %244

197:                                              ; preds = %196
  invoke void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %12, ptr noundef nonnull align 8 dereferenceable(24) %23)
          to label %198 unwind label %244

198:                                              ; preds = %197
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %27) #7
  %199 = load i64, ptr @N, align 8, !tbaa !8
  %200 = sub nsw i64 %199, 1
  %201 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %200
  %202 = load i64, ptr @M, align 8, !tbaa !8
  %203 = sub nsw i64 %202, 1
  %204 = getelementptr inbounds [1000 x i64], ptr %201, i64 0, i64 %203
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %205 = load i64, ptr @N, align 8, !tbaa !8
  %206 = sub nsw i64 %205, 1
  store i64 %206, ptr %29, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  %207 = load i64, ptr @M, align 8, !tbaa !8
  %208 = sub nsw i64 %207, 1
  store i64 %208, ptr %30, align 8, !tbaa !8
  invoke void @_ZNSt4pairIxxEC2IxxTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull align 8 dereferenceable(8) %30)
          to label %209 unwind label %248

209:                                              ; preds = %198
  invoke void @_ZNSt4pairIxS_IxxEEC2IxS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 8 dereferenceable(8) %204, ptr noundef nonnull align 8 dereferenceable(16) %28)
          to label %210 unwind label %248

210:                                              ; preds = %209
  invoke void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %12, ptr noundef nonnull align 8 dereferenceable(24) %27)
          to label %211 unwind label %248

211:                                              ; preds = %210
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #7
  br label %212

212:                                              ; preds = %323, %211
  %213 = invoke noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %12)
          to label %214 unwind label %252

214:                                              ; preds = %212
  %215 = xor i1 %213, true
  br i1 %215, label %216, label %327

216:                                              ; preds = %214
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  %217 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %12)
          to label %218 unwind label %256

218:                                              ; preds = %216
  %219 = getelementptr inbounds %"struct.std::pair", ptr %217, i32 0, i32 0
  %220 = load i64, ptr %219, align 8, !tbaa !20
  store i64 %220, ptr %31, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  %221 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %12)
          to label %222 unwind label %260

222:                                              ; preds = %218
  %223 = getelementptr inbounds %"struct.std::pair", ptr %221, i32 0, i32 1
  %224 = getelementptr inbounds %"struct.std::pair.3", ptr %223, i32 0, i32 0
  %225 = load i64, ptr %224, align 8, !tbaa !23
  store i64 %225, ptr %32, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #7
  %226 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %12)
          to label %227 unwind label %264

227:                                              ; preds = %222
  %228 = getelementptr inbounds %"struct.std::pair", ptr %226, i32 0, i32 1
  %229 = getelementptr inbounds %"struct.std::pair.3", ptr %228, i32 0, i32 1
  %230 = load i64, ptr %229, align 8, !tbaa !24
  store i64 %230, ptr %33, align 8, !tbaa !8
  invoke void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %12)
          to label %231 unwind label %264

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

232:                                              ; preds = %316, %231
  %233 = load i64, ptr %34, align 8, !tbaa !8
  %234 = icmp slt i64 %233, 4
  br i1 %234, label %268, label %235

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

236:                                              ; preds = %180, %179, %178
  %237 = landingpad { ptr, i32 }
          cleanup
  %238 = extractvalue { ptr, i32 } %237, 0
  store ptr %238, ptr %17, align 8
  %239 = extractvalue { ptr, i32 } %237, 1
  store i32 %239, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #7
  br label %380

240:                                              ; preds = %189, %188, %181
  %241 = landingpad { ptr, i32 }
          cleanup
  %242 = extractvalue { ptr, i32 } %241, 0
  store ptr %242, ptr %17, align 8
  %243 = extractvalue { ptr, i32 } %241, 1
  store i32 %243, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #7
  br label %380

244:                                              ; preds = %197, %196, %190
  %245 = landingpad { ptr, i32 }
          cleanup
  %246 = extractvalue { ptr, i32 } %245, 0
  store ptr %246, ptr %17, align 8
  %247 = extractvalue { ptr, i32 } %245, 1
  store i32 %247, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #7
  br label %380

248:                                              ; preds = %210, %209, %198
  %249 = landingpad { ptr, i32 }
          cleanup
  %250 = extractvalue { ptr, i32 } %249, 0
  store ptr %250, ptr %17, align 8
  %251 = extractvalue { ptr, i32 } %249, 1
  store i32 %251, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #7
  br label %380

252:                                              ; preds = %212
  %253 = landingpad { ptr, i32 }
          cleanup
  %254 = extractvalue { ptr, i32 } %253, 0
  store ptr %254, ptr %17, align 8
  %255 = extractvalue { ptr, i32 } %253, 1
  store i32 %255, ptr %18, align 4
  br label %380

256:                                              ; preds = %216
  %257 = landingpad { ptr, i32 }
          cleanup
  %258 = extractvalue { ptr, i32 } %257, 0
  store ptr %258, ptr %17, align 8
  %259 = extractvalue { ptr, i32 } %257, 1
  store i32 %259, ptr %18, align 4
  br label %326

260:                                              ; preds = %218
  %261 = landingpad { ptr, i32 }
          cleanup
  %262 = extractvalue { ptr, i32 } %261, 0
  store ptr %262, ptr %17, align 8
  %263 = extractvalue { ptr, i32 } %261, 1
  store i32 %263, ptr %18, align 4
  br label %325

264:                                              ; preds = %227, %222
  %265 = landingpad { ptr, i32 }
          cleanup
  %266 = extractvalue { ptr, i32 } %265, 0
  store ptr %266, ptr %17, align 8
  %267 = extractvalue { ptr, i32 } %265, 1
  store i32 %267, ptr %18, align 4
  br label %324

268:                                              ; preds = %232
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #7
  %269 = load i64, ptr %32, align 8, !tbaa !8
  %270 = load i64, ptr %34, align 8, !tbaa !8
  %271 = getelementptr inbounds [4 x i64], ptr @dx, i64 0, i64 %270
  %272 = load i64, ptr %271, align 8, !tbaa !8
  %273 = add nsw i64 %269, %272
  store i64 %273, ptr %35, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #7
  %274 = load i64, ptr %33, align 8, !tbaa !8
  %275 = load i64, ptr %34, align 8, !tbaa !8
  %276 = getelementptr inbounds [4 x i64], ptr @dy, i64 0, i64 %275
  %277 = load i64, ptr %276, align 8, !tbaa !8
  %278 = add nsw i64 %274, %277
  store i64 %278, ptr %36, align 8, !tbaa !8
  %279 = load i64, ptr %35, align 8, !tbaa !8
  %280 = icmp slt i64 %279, 0
  br i1 %280, label %292, label %281

281:                                              ; preds = %268
  %282 = load i64, ptr %36, align 8, !tbaa !8
  %283 = icmp slt i64 %282, 0
  br i1 %283, label %292, label %284

284:                                              ; preds = %281
  %285 = load i64, ptr %35, align 8, !tbaa !8
  %286 = load i64, ptr @N, align 8, !tbaa !8
  %287 = icmp sge i64 %285, %286
  br i1 %287, label %292, label %288

288:                                              ; preds = %284
  %289 = load i64, ptr %36, align 8, !tbaa !8
  %290 = load i64, ptr @M, align 8, !tbaa !8
  %291 = icmp sge i64 %289, %290
  br i1 %291, label %292, label %293

292:                                              ; preds = %288, %284, %281, %268
  store i32 23, ptr %4, align 4
  br label %313

293:                                              ; preds = %288
  %294 = load i64, ptr %35, align 8, !tbaa !8
  %295 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %294
  %296 = load i64, ptr %36, align 8, !tbaa !8
  %297 = getelementptr inbounds [1000 x i64], ptr %295, i64 0, i64 %296
  %298 = load i64, ptr %297, align 8, !tbaa !8
  %299 = icmp ne i64 %298, -1
  br i1 %299, label %300, label %301

300:                                              ; preds = %293
  store i32 23, ptr %4, align 4
  br label %313

301:                                              ; preds = %293
  %302 = load i64, ptr %31, align 8, !tbaa !8
  %303 = sub nsw i64 %302, 1
  %304 = load i64, ptr %35, align 8, !tbaa !8
  %305 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %304
  %306 = load i64, ptr %36, align 8, !tbaa !8
  %307 = getelementptr inbounds [1000 x i64], ptr %305, i64 0, i64 %306
  store i64 %303, ptr %307, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 24, ptr %37) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #7
  %308 = load i64, ptr %31, align 8, !tbaa !8
  %309 = sub nsw i64 %308, 1
  store i64 %309, ptr %38, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 16, ptr %39) #7
  invoke void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %39, ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef nonnull align 8 dereferenceable(8) %36)
          to label %310 unwind label %319

310:                                              ; preds = %301
  invoke void @_ZNSt4pairIxS_IxxEEC2IxS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %37, ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef nonnull align 8 dereferenceable(16) %39)
          to label %311 unwind label %319

311:                                              ; preds = %310
  invoke void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %12, ptr noundef nonnull align 8 dereferenceable(24) %37)
          to label %312 unwind label %319

312:                                              ; preds = %311
  call void @llvm.lifetime.end.p0(i64 16, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %37) #7
  store i32 0, ptr %4, align 4
  br label %313

313:                                              ; preds = %312, %300, %292
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #7
  %314 = load i32, ptr %4, align 4
  switch i32 %314, label %388 [
    i32 0, label %315
    i32 23, label %316
  ]

315:                                              ; preds = %313
  br label %316

316:                                              ; preds = %315, %313
  %317 = load i64, ptr %34, align 8, !tbaa !8
  %318 = add nsw i64 %317, 1
  store i64 %318, ptr %34, align 8, !tbaa !8
  br label %232, !llvm.loop !25

319:                                              ; preds = %311, %310, %301
  %320 = landingpad { ptr, i32 }
          cleanup
  %321 = extractvalue { ptr, i32 } %320, 0
  store ptr %321, ptr %17, align 8
  %322 = extractvalue { ptr, i32 } %320, 1
  store i32 %322, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #7
  br label %324

323:                                              ; preds = %235
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  br label %212, !llvm.loop !26

324:                                              ; preds = %319, %264
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  br label %325

325:                                              ; preds = %324, %260
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  br label %326

326:                                              ; preds = %325, %256
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  br label %380

327:                                              ; preds = %214
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #7
  store i64 9999999, ptr %40, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #7
  store i64 0, ptr %41, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #7
  store i64 0, ptr %42, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #7
  store i64 0, ptr %43, align 8, !tbaa !8
  br label %328

328:                                              ; preds = %360, %327
  %329 = load i64, ptr %43, align 8, !tbaa !8
  %330 = load i64, ptr @N, align 8, !tbaa !8
  %331 = icmp slt i64 %329, %330
  br i1 %331, label %333, label %332

332:                                              ; preds = %328
  store i32 24, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #7
  br label %363

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

334:                                              ; preds = %356, %333
  %335 = load i64, ptr %44, align 8, !tbaa !8
  %336 = load i64, ptr @M, align 8, !tbaa !8
  %337 = icmp slt i64 %335, %336
  br i1 %337, label %339, label %338

338:                                              ; preds = %334
  store i32 27, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #7
  br label %359

339:                                              ; preds = %334
  %340 = load i64, ptr %43, align 8, !tbaa !8
  %341 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %340
  %342 = load i64, ptr %44, align 8, !tbaa !8
  %343 = getelementptr inbounds [1000 x i64], ptr %341, i64 0, i64 %342
  %344 = load i64, ptr %343, align 8, !tbaa !8
  %345 = load i64, ptr %40, align 8, !tbaa !8
  %346 = icmp slt i64 %344, %345
  br i1 %346, label %347, label %355

347:                                              ; preds = %339
  %348 = load i64, ptr %43, align 8, !tbaa !8
  %349 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %348
  %350 = load i64, ptr %44, align 8, !tbaa !8
  %351 = getelementptr inbounds [1000 x i64], ptr %349, i64 0, i64 %350
  %352 = load i64, ptr %351, align 8, !tbaa !8
  store i64 %352, ptr %40, align 8, !tbaa !8
  %353 = load i64, ptr %43, align 8, !tbaa !8
  store i64 %353, ptr %41, align 8, !tbaa !8
  %354 = load i64, ptr %44, align 8, !tbaa !8
  store i64 %354, ptr %42, align 8, !tbaa !8
  br label %355

355:                                              ; preds = %347, %339
  br label %356

356:                                              ; preds = %355
  %357 = load i64, ptr %44, align 8, !tbaa !8
  %358 = add nsw i64 %357, 1
  store i64 %358, ptr %44, align 8, !tbaa !8
  br label %334, !llvm.loop !27

359:                                              ; preds = %338
  br label %360

360:                                              ; preds = %359
  %361 = load i64, ptr %43, align 8, !tbaa !8
  %362 = add nsw i64 %361, 1
  store i64 %362, ptr %43, align 8, !tbaa !8
  br label %328, !llvm.loop !28

363:                                              ; preds = %332
  %364 = load i64, ptr %41, align 8, !tbaa !8
  %365 = add nsw i64 %364, 1
  %366 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %365)
          to label %367 unwind label %376

367:                                              ; preds = %363
  %368 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %366, i8 noundef signext 32)
          to label %369 unwind label %376

369:                                              ; preds = %367
  %370 = load i64, ptr %42, align 8, !tbaa !8
  %371 = add nsw i64 %370, 1
  %372 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %368, i64 noundef %371)
          to label %373 unwind label %376

373:                                              ; preds = %369
  %374 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %372, i8 noundef signext 10)
          to label %375 unwind label %376

375:                                              ; preds = %373
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #7
  call void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %12) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  br label %52, !llvm.loop !29

376:                                              ; preds = %373, %369, %367, %363
  %377 = landingpad { ptr, i32 }
          cleanup
  %378 = extractvalue { ptr, i32 } %377, 0
  store ptr %378, ptr %17, align 8
  %379 = extractvalue { ptr, i32 } %377, 1
  store i32 %379, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #7
  br label %380

380:                                              ; preds = %376, %326, %252, %248, %244, %240, %236
  call void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %12) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  br label %383

381:                                              ; preds = %52
  %382 = load i32, ptr %1, align 4
  ret i32 %382

383:                                              ; preds = %380
  %384 = load ptr, ptr %17, align 8
  %385 = load i32, ptr %18, align 4
  %386 = insertvalue { ptr, i32 } poison, ptr %384, 0
  %387 = insertvalue { ptr, i32 } %386, i32 %385, 1
  resume { ptr, i32 } %387

388:                                              ; preds = %313
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 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

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 nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) #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 #2 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) #6

; 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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { 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 #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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = { 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 = !{!10, !10, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = !{!19, !19, i64 0}
!19 = !{!"int", !10, i64 0}
!20 = !{!21, !9, i64 0}
!21 = !{!"_ZTSSt4pairIxS_IxxEE", !9, i64 0, !22, i64 8}
!22 = !{!"_ZTSSt4pairIxxE", !9, i64 0, !9, i64 8}
!23 = !{!21, !9, i64 8}
!24 = !{!21, !9, i64 16}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !12}
!29 = distinct !{!29, !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::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<long long, std::pair<long long, long long>>, std::allocator<std::pair<long long, std::pair<long long, long long>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, std::pair<long long, long long>>, std::allocator<std::pair<long long, std::pair<long long, long long>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, std::pair<long long, long long>>, std::allocator<std::pair<long long, std::pair<long long, long long>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, std::pair<long long, long long>>, std::allocator<std::pair<long long, std::pair<long long, long long>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i64, %"struct.std::pair.3" }
%"struct.std::pair.3" = type { i64, i64 }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@d = external dso_local global [1000 x [1000 x i64]], align 16
@_Z1bB5cxx11 = external dso_local global [1000 x %"class.std::__cxx11::basic_string"], align 16
@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
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::priority_queue", align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"struct.std::pair.3", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca %"struct.std::pair.3", align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca %"struct.std::pair.3", align 8
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca %"struct.std::pair", align 8
  %19 = alloca %"struct.std::pair.3", align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca %"struct.std::pair", align 8
  %25 = alloca i64, align 8
  %26 = alloca %"struct.std::pair.3", align 8
  %27 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %28 = getelementptr i8, ptr %27, i64 -24
  %29 = load i64, ptr %28, align 8
  %30 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %29
  %31 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %30, ptr noundef null)
  %32 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %33 = 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)
  %34 = load i64, ptr @T, align 8, !tbaa !8
  %35 = add nsw i64 %34, -1
  store i64 %35, ptr @T, align 8, !tbaa !8
  %.not112 = icmp eq i64 %34, 0
  br i1 %.not112, label %._crit_edge115, label %.lr.ph114

.lr.ph114:                                        ; preds = %0, %231
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %38 = load i64, ptr @N, align 8, !tbaa !8
  %39 = icmp sgt i64 %38, 0
  br i1 %39, label %.lr.ph, label %._crit_edge91

.preheader83:                                     ; preds = %.lr.ph
  %40 = icmp sgt i64 %57, 0
  br i1 %40, label %.preheader80.lr.ph, label %._crit_edge91

.preheader80.lr.ph:                               ; preds = %.preheader83
  %41 = load i64, ptr @M, align 8, !tbaa !8
  %42 = icmp sgt i64 %41, 0
  br i1 %42, label %.preheader80.us.preheader, label %._crit_edge91

.preheader80.us.preheader:                        ; preds = %.preheader80.lr.ph
  %43 = shl nuw i64 %41, 3
  %xtraiter = and i64 %57, 7
  %44 = icmp ult i64 %57, 8
  br i1 %44, label %.preheader82.unr-lcssa, label %.preheader80.us.preheader.new

.preheader80.us.preheader.new:                    ; preds = %.preheader80.us.preheader
  %unroll_iter = and i64 %57, 9223372036854775800
  br label %.preheader80.us

.preheader80.us:                                  ; preds = %.preheader80.us, %.preheader80.us.preheader.new
  %.05787.us = phi i64 [ 0, %.preheader80.us.preheader.new ], [ %53, %.preheader80.us ]
  %niter = phi i64 [ 0, %.preheader80.us.preheader.new ], [ %niter.next.7, %.preheader80.us ]
  %45 = mul nuw nsw i64 %.05787.us, 8000
  %scevgep = getelementptr i8, ptr @d, i64 %45
  call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 -1, i64 %43, i1 false), !tbaa !8
  %46 = mul nuw i64 %.05787.us, 8000
  %gep = getelementptr i8, ptr getelementptr (i8, ptr @d, i64 8000), i64 %46
  call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 -1, i64 %43, i1 false), !tbaa !8
  %47 = mul nuw i64 %.05787.us, 8000
  %gep147 = getelementptr i8, ptr getelementptr (i8, ptr @d, i64 16000), i64 %47
  call void @llvm.memset.p0.i64(ptr align 16 %gep147, i8 -1, i64 %43, i1 false), !tbaa !8
  %48 = mul nuw i64 %.05787.us, 8000
  %gep148 = getelementptr i8, ptr getelementptr (i8, ptr @d, i64 24000), i64 %48
  call void @llvm.memset.p0.i64(ptr align 16 %gep148, i8 -1, i64 %43, i1 false), !tbaa !8
  %49 = mul nuw i64 %.05787.us, 8000
  %gep149 = getelementptr i8, ptr getelementptr (i8, ptr @d, i64 32000), i64 %49
  call void @llvm.memset.p0.i64(ptr align 16 %gep149, i8 -1, i64 %43, i1 false), !tbaa !8
  %50 = mul nuw i64 %.05787.us, 8000
  %gep150 = getelementptr i8, ptr getelementptr (i8, ptr @d, i64 40000), i64 %50
  call void @llvm.memset.p0.i64(ptr align 16 %gep150, i8 -1, i64 %43, i1 false), !tbaa !8
  %51 = mul nuw i64 %.05787.us, 8000
  %gep151 = getelementptr i8, ptr getelementptr (i8, ptr @d, i64 48000), i64 %51
  call void @llvm.memset.p0.i64(ptr align 16 %gep151, i8 -1, i64 %43, i1 false), !tbaa !8
  %52 = mul nuw i64 %.05787.us, 8000
  %gep152 = getelementptr i8, ptr getelementptr (i8, ptr @d, i64 56000), i64 %52
  call void @llvm.memset.p0.i64(ptr align 16 %gep152, i8 -1, i64 %43, i1 false), !tbaa !8
  %53 = add nuw nsw i64 %.05787.us, 8
  %niter.next.7 = add i64 %niter, 8
  %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %.preheader82.unr-lcssa, label %.preheader80.us, !llvm.loop !11

.lr.ph:                                           ; preds = %.lr.ph114, %.lr.ph
  %.05684 = phi i64 [ %56, %.lr.ph ], [ 0, %.lr.ph114 ]
  %54 = getelementptr inbounds [1000 x %"class.std::__cxx11::basic_string"], ptr @_Z1bB5cxx11, i64 0, i64 %.05684
  %55 = 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) %54)
  %56 = add nuw nsw i64 %.05684, 1
  %57 = load i64, ptr @N, align 8, !tbaa !8
  %58 = icmp slt i64 %56, %57
  br i1 %58, label %.lr.ph, label %.preheader83, !llvm.loop !13

.preheader82.unr-lcssa:                           ; preds = %.preheader80.us, %.preheader80.us.preheader
  %.05787.us.unr = phi i64 [ 0, %.preheader80.us.preheader ], [ %53, %.preheader80.us ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader82, label %.preheader80.us.epil

.preheader80.us.epil:                             ; preds = %.preheader82.unr-lcssa, %.preheader80.us.epil
  %.05787.us.epil = phi i64 [ %60, %.preheader80.us.epil ], [ %.05787.us.unr, %.preheader82.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader80.us.epil ], [ 0, %.preheader82.unr-lcssa ]
  %59 = mul nuw nsw i64 %.05787.us.epil, 8000
  %scevgep.epil = getelementptr i8, ptr @d, i64 %59
  call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 -1, i64 %43, i1 false), !tbaa !8
  %60 = add nuw nsw i64 %.05787.us.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader82, label %.preheader80.us.epil, !llvm.loop !14

.preheader82:                                     ; preds = %.preheader80.us.epil, %.preheader82.unr-lcssa
  %.pr = load i64, ptr @M, align 8
  %61 = icmp sgt i64 %.pr, 0
  %or.cond = select i1 %40, i1 %61, i1 false
  br i1 %or.cond, label %.preheader79, label %._crit_edge91

.preheader79:                                     ; preds = %.preheader82, %._crit_edge
  %62 = phi i64 [ %66, %._crit_edge ], [ %57, %.preheader82 ]
  %63 = phi i64 [ %67, %._crit_edge ], [ %.pr, %.preheader82 ]
  %.06390 = phi i64 [ %68, %._crit_edge ], [ 0, %.preheader82 ]
  %64 = icmp sgt i64 %63, 0
  br i1 %64, label %.lr.ph89, label %._crit_edge

.lr.ph89:                                         ; preds = %.preheader79
  %65 = getelementptr inbounds [1000 x %"class.std::__cxx11::basic_string"], ptr @_Z1bB5cxx11, i64 0, i64 %.06390
  br label %70

._crit_edge91:                                    ; preds = %._crit_edge, %.lr.ph114, %.preheader83, %.preheader80.lr.ph, %.preheader82
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #9
  call void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %5)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #9
  store i32 0, ptr %8, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #9
  store i32 0, ptr %9, align 4, !tbaa !16
  call void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @_ZNSt4pairIxS_IxxEEC2IxS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(8) @d, ptr noundef nonnull align 8 dereferenceable(16) %7)
  invoke void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %5, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %111 unwind label %162

._crit_edge.loopexit:                             ; preds = %107
  %.pre124 = load i64, ptr @N, align 8, !tbaa !8
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader79
  %66 = phi i64 [ %.pre124, %._crit_edge.loopexit ], [ %62, %.preheader79 ]
  %67 = phi i64 [ %108, %._crit_edge.loopexit ], [ %63, %.preheader79 ]
  %68 = add nuw nsw i64 %.06390, 1
  %69 = icmp slt i64 %68, %66
  br i1 %69, label %.preheader79, label %._crit_edge91, !llvm.loop !18

70:                                               ; preds = %.lr.ph89, %107
  %.06288 = phi i64 [ 0, %.lr.ph89 ], [ %109, %107 ]
  %71 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %65, i64 noundef %.06288)
  %72 = load i8, ptr %71, align 1, !tbaa !20
  %73 = icmp eq i8 %72, 87
  br i1 %73, label %._crit_edge123, label %74

._crit_edge123:                                   ; preds = %70
  %.pre = load i64, ptr @M, align 8, !tbaa !8
  br label %107

74:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #9
  %75 = call noundef i64 @_Z4distxxxx(i64 noundef 0, i64 noundef 0, i64 noundef %.06390, i64 noundef %.06288)
  store i64 %75, ptr %1, align 8, !tbaa !8
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @d, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %77 = load i64, ptr %76, align 8, !tbaa !8
  store i64 %77, ptr @d, align 16, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #9
  %78 = load i64, ptr @N, align 8, !tbaa !8
  %79 = add nsw i64 %78, -1
  %80 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %79
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #9
  %81 = call noundef i64 @_Z4distxxxx(i64 noundef %79, i64 noundef 0, i64 noundef %.06390, i64 noundef %.06288)
  store i64 %81, ptr %2, align 8, !tbaa !8
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %80, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %83 = load i64, ptr %82, align 8, !tbaa !8
  %84 = load i64, ptr @N, align 8, !tbaa !8
  %85 = add nsw i64 %84, -1
  %86 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %85
  store i64 %83, ptr %86, align 16, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  %87 = load i64, ptr @M, align 8, !tbaa !8
  %88 = add nsw i64 %87, -1
  %89 = getelementptr inbounds [1000 x i64], ptr @d, i64 0, i64 %88
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  %90 = call noundef i64 @_Z4distxxxx(i64 noundef 0, i64 noundef %88, i64 noundef %.06390, i64 noundef %.06288)
  store i64 %90, ptr %3, align 8, !tbaa !8
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %89, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %92 = load i64, ptr %91, align 8, !tbaa !8
  %93 = load i64, ptr @M, align 8, !tbaa !8
  %94 = add nsw i64 %93, -1
  %95 = getelementptr inbounds [1000 x i64], ptr @d, i64 0, i64 %94
  store i64 %92, ptr %95, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  %96 = load i64, ptr @N, align 8, !tbaa !8
  %97 = add nsw i64 %96, -1
  %98 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %97, i64 %94
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  %99 = call noundef i64 @_Z4distxxxx(i64 noundef %97, i64 noundef %94, i64 noundef %.06390, i64 noundef %.06288)
  store i64 %99, ptr %4, align 8, !tbaa !8
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %98, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %101 = load i64, ptr %100, align 8, !tbaa !8
  %102 = load i64, ptr @N, align 8, !tbaa !8
  %103 = add nsw i64 %102, -1
  %104 = load i64, ptr @M, align 8, !tbaa !8
  %105 = add nsw i64 %104, -1
  %106 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %103, i64 %105
  store i64 %101, ptr %106, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  br label %107

107:                                              ; preds = %._crit_edge123, %74
  %108 = phi i64 [ %.pre, %._crit_edge123 ], [ %104, %74 ]
  %109 = add nuw nsw i64 %.06288, 1
  %110 = icmp slt i64 %109, %108
  br i1 %110, label %70, label %._crit_edge.loopexit, !llvm.loop !21

111:                                              ; preds = %._crit_edge91
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #9
  %112 = load i64, ptr @N, align 8, !tbaa !8
  %113 = add nsw i64 %112, -1
  %114 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %113
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #9
  store i64 %113, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #9
  store i32 0, ptr %13, align 4, !tbaa !16
  call void @_ZNSt4pairIxxEC2IxiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
  call void @_ZNSt4pairIxS_IxxEEC2IxS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(8) %114, ptr noundef nonnull align 8 dereferenceable(16) %11)
  invoke void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %5, ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %115 unwind label %164

115:                                              ; preds = %111
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #9
  %116 = load i64, ptr @M, align 8, !tbaa !8
  %117 = add nsw i64 %116, -1
  %118 = getelementptr inbounds [1000 x i64], ptr @d, i64 0, i64 %117
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #9
  store i32 0, ptr %16, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #9
  store i64 %117, ptr %17, align 8, !tbaa !8
  call void @_ZNSt4pairIxxEC2IixTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 8 dereferenceable(8) %17)
  call void @_ZNSt4pairIxS_IxxEEC2IxS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(8) %118, ptr noundef nonnull align 8 dereferenceable(16) %15)
  invoke void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %5, ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %119 unwind label %166

119:                                              ; preds = %115
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %18) #9
  %120 = load i64, ptr @N, align 8, !tbaa !8
  %121 = add nsw i64 %120, -1
  %122 = load i64, ptr @M, align 8, !tbaa !8
  %123 = add nsw i64 %122, -1
  %124 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %121, i64 %123
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %19) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #9
  store i64 %121, ptr %20, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #9
  store i64 %123, ptr %21, align 8, !tbaa !8
  call void @_ZNSt4pairIxxEC2IxxTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21)
  call void @_ZNSt4pairIxS_IxxEEC2IxS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(8) %124, ptr noundef nonnull align 8 dereferenceable(16) %19)
  invoke void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %5, ptr noundef nonnull align 8 dereferenceable(24) %18)
          to label %125 unwind label %168

125:                                              ; preds = %119
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %19) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #9
  %126 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %5)
  br i1 %126, label %.preheader81, label %.lr.ph94

.preheader81:                                     ; preds = %.loopexit, %125
  %127 = load i64, ptr @N, align 8, !tbaa !8
  %128 = icmp sgt i64 %127, 0
  br i1 %128, label %.preheader.lr.ph, label %._crit_edge108

.preheader.lr.ph:                                 ; preds = %.preheader81
  %129 = load i64, ptr @M, align 8, !tbaa !8
  %130 = icmp sgt i64 %129, 0
  br i1 %130, label %.preheader.us.preheader, label %._crit_edge108

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %xtraiter136 = and i64 %129, 1
  %131 = icmp eq i64 %129, 1
  %unroll_iter142 = and i64 %129, 9223372036854775806
  %lcmp.mod138.not = icmp eq i64 %xtraiter136, 0
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge100.us
  %.047107.us = phi i64 [ %144, %._crit_edge100.us ], [ 0, %.preheader.us.preheader ]
  %.048106.us = phi i64 [ %.2.us.lcssa, %._crit_edge100.us ], [ 0, %.preheader.us.preheader ]
  %.049105.us = phi i64 [ %.251.us.lcssa, %._crit_edge100.us ], [ 0, %.preheader.us.preheader ]
  %.052104.us = phi i64 [ %.254.us.lcssa, %._crit_edge100.us ], [ 9999999, %.preheader.us.preheader ]
  br i1 %131, label %._crit_edge100.us.unr-lcssa, label %.preheader.us.new

.preheader.us.new:                                ; preds = %.preheader.us, %.preheader.us.new
  %.098.us = phi i64 [ %140, %.preheader.us.new ], [ 0, %.preheader.us ]
  %.197.us = phi i64 [ %.2.us.1, %.preheader.us.new ], [ %.048106.us, %.preheader.us ]
  %.15096.us = phi i64 [ %.251.us.1, %.preheader.us.new ], [ %.049105.us, %.preheader.us ]
  %.15395.us = phi i64 [ %.254.us.1, %.preheader.us.new ], [ %.052104.us, %.preheader.us ]
  %niter143 = phi i64 [ %niter143.next.1, %.preheader.us.new ], [ 0, %.preheader.us ]
  %132 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %.047107.us, i64 %.098.us
  %133 = load i64, ptr %132, align 16, !tbaa !8
  %134 = icmp slt i64 %133, %.15395.us
  %.254.us = call i64 @llvm.smin.i64(i64 %133, i64 %.15395.us)
  %.2.us = select i1 %134, i64 %.098.us, i64 %.197.us
  %135 = or disjoint i64 %.098.us, 1
  %136 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %.047107.us, i64 %135
  %137 = load i64, ptr %136, align 8, !tbaa !8
  %138 = icmp slt i64 %137, %.254.us
  %.254.us.1 = call i64 @llvm.smin.i64(i64 %137, i64 %.254.us)
  %139 = or i1 %138, %134
  %.251.us.1 = select i1 %139, i64 %.047107.us, i64 %.15096.us
  %.2.us.1 = select i1 %138, i64 %135, i64 %.2.us
  %140 = add nuw nsw i64 %.098.us, 2
  %niter143.next.1 = add i64 %niter143, 2
  %niter143.ncmp.1 = icmp eq i64 %niter143.next.1, %unroll_iter142
  br i1 %niter143.ncmp.1, label %._crit_edge100.us.unr-lcssa, label %.preheader.us.new, !llvm.loop !22

._crit_edge100.us.unr-lcssa:                      ; preds = %.preheader.us.new, %.preheader.us
  %.254.us.lcssa.ph = phi i64 [ poison, %.preheader.us ], [ %.254.us.1, %.preheader.us.new ]
  %.251.us.lcssa.ph = phi i64 [ poison, %.preheader.us ], [ %.251.us.1, %.preheader.us.new ]
  %.2.us.lcssa.ph = phi i64 [ poison, %.preheader.us ], [ %.2.us.1, %.preheader.us.new ]
  %.098.us.unr = phi i64 [ 0, %.preheader.us ], [ %140, %.preheader.us.new ]
  %.197.us.unr = phi i64 [ %.048106.us, %.preheader.us ], [ %.2.us.1, %.preheader.us.new ]
  %.15096.us.unr = phi i64 [ %.049105.us, %.preheader.us ], [ %.251.us.1, %.preheader.us.new ]
  %.15395.us.unr = phi i64 [ %.052104.us, %.preheader.us ], [ %.254.us.1, %.preheader.us.new ]
  br i1 %lcmp.mod138.not, label %._crit_edge100.us, label %._crit_edge100.us.epilog-lcssa

._crit_edge100.us.epilog-lcssa:                   ; preds = %._crit_edge100.us.unr-lcssa
  %141 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %.047107.us, i64 %.098.us.unr
  %142 = load i64, ptr %141, align 8, !tbaa !8
  %143 = icmp slt i64 %142, %.15395.us.unr
  %.254.us.epil = call i64 @llvm.smin.i64(i64 %142, i64 %.15395.us.unr)
  %.251.us.epil = select i1 %143, i64 %.047107.us, i64 %.15096.us.unr
  %.2.us.epil = select i1 %143, i64 %.098.us.unr, i64 %.197.us.unr
  br label %._crit_edge100.us

._crit_edge100.us:                                ; preds = %._crit_edge100.us.unr-lcssa, %._crit_edge100.us.epilog-lcssa
  %.254.us.lcssa = phi i64 [ %.254.us.lcssa.ph, %._crit_edge100.us.unr-lcssa ], [ %.254.us.epil, %._crit_edge100.us.epilog-lcssa ]
  %.251.us.lcssa = phi i64 [ %.251.us.lcssa.ph, %._crit_edge100.us.unr-lcssa ], [ %.251.us.epil, %._crit_edge100.us.epilog-lcssa ]
  %.2.us.lcssa = phi i64 [ %.2.us.lcssa.ph, %._crit_edge100.us.unr-lcssa ], [ %.2.us.epil, %._crit_edge100.us.epilog-lcssa ]
  %144 = add nuw nsw i64 %.047107.us, 1
  %exitcond122.not = icmp eq i64 %144, %127
  br i1 %exitcond122.not, label %._crit_edge108, label %.preheader.us, !llvm.loop !23

.lr.ph94:                                         ; preds = %125, %.loopexit
  %145 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %5)
  %146 = load i64, ptr %145, align 8, !tbaa !24
  %147 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %5)
  %148 = getelementptr inbounds i8, ptr %147, i64 8
  %149 = load i64, ptr %148, align 8, !tbaa !27
  %150 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %5)
  %151 = getelementptr inbounds i8, ptr %150, i64 16
  %152 = load i64, ptr %151, align 8, !tbaa !28
  invoke void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %5)
          to label %.preheader78 unwind label %170

.preheader78:                                     ; preds = %.lr.ph94
  %153 = add nsw i64 %146, -1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #9
  %154 = load i64, ptr @dx, align 16, !tbaa !8
  %155 = add nsw i64 %154, %149
  store i64 %155, ptr %22, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #9
  %156 = load i64, ptr @dy, align 16, !tbaa !8
  %157 = add nsw i64 %156, %152
  store i64 %157, ptr %23, align 8, !tbaa !8
  %158 = icmp sgt i64 %155, -1
  %159 = icmp sgt i64 %157, -1
  %or.cond.not77 = select i1 %158, i1 %159, i1 false
  %160 = load i64, ptr @N, align 8
  %.not68 = icmp slt i64 %155, %160
  %or.cond73 = select i1 %or.cond.not77, i1 %.not68, i1 false
  %161 = load i64, ptr @M, align 8
  %.not69 = icmp slt i64 %157, %161
  %or.cond74 = select i1 %or.cond73, i1 %.not69, i1 false
  br i1 %or.cond74, label %172, label %177

162:                                              ; preds = %._crit_edge91
  %163 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #9
  br label %236

164:                                              ; preds = %111
  %165 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #9
  br label %236

166:                                              ; preds = %115
  %167 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #9
  br label %236

168:                                              ; preds = %119
  %169 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %19) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #9
  br label %236

170:                                              ; preds = %.lr.ph94
  %171 = landingpad { ptr, i32 }
          cleanup
  br label %236

172:                                              ; preds = %.preheader78
  %173 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %155, i64 %157
  %174 = load i64, ptr %173, align 8, !tbaa !8
  %.not70 = icmp eq i64 %174, -1
  br i1 %.not70, label %175, label %177

175:                                              ; preds = %172
  store i64 %153, ptr %173, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %24) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %25) #9
  store i64 %153, ptr %25, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %26) #9
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23)
  call void @_ZNSt4pairIxS_IxxEEC2IxS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(16) %26)
  invoke void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %5, ptr noundef nonnull align 8 dereferenceable(24) %24)
          to label %176 unwind label %220

176:                                              ; preds = %175
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %26) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %25) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %24) #9
  %.pre125 = load i64, ptr @N, align 8
  %.pre126 = load i64, ptr @M, align 8
  br label %177

177:                                              ; preds = %172, %.preheader78, %176
  %178 = phi i64 [ %161, %172 ], [ %161, %.preheader78 ], [ %.pre126, %176 ]
  %179 = phi i64 [ %160, %172 ], [ %160, %.preheader78 ], [ %.pre125, %176 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #9
  %180 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 8), align 8, !tbaa !8
  %181 = add nsw i64 %180, %149
  store i64 %181, ptr %22, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #9
  %182 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 8), align 8, !tbaa !8
  %183 = add nsw i64 %182, %152
  store i64 %183, ptr %23, align 8, !tbaa !8
  %184 = icmp sgt i64 %181, -1
  %185 = icmp sgt i64 %183, -1
  %or.cond.not77.1 = select i1 %184, i1 %185, i1 false
  %.not68.1 = icmp slt i64 %181, %179
  %or.cond73.1 = select i1 %or.cond.not77.1, i1 %.not68.1, i1 false
  %.not69.1 = icmp slt i64 %183, %178
  %or.cond74.1 = select i1 %or.cond73.1, i1 %.not69.1, i1 false
  br i1 %or.cond74.1, label %186, label %191

186:                                              ; preds = %177
  %187 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %181, i64 %183
  %188 = load i64, ptr %187, align 8, !tbaa !8
  %.not70.1 = icmp eq i64 %188, -1
  br i1 %.not70.1, label %189, label %191

189:                                              ; preds = %186
  store i64 %153, ptr %187, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %24) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %25) #9
  store i64 %153, ptr %25, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %26) #9
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23)
  call void @_ZNSt4pairIxS_IxxEEC2IxS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(16) %26)
  invoke void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %5, ptr noundef nonnull align 8 dereferenceable(24) %24)
          to label %190 unwind label %220

190:                                              ; preds = %189
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %26) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %25) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %24) #9
  %.pre127 = load i64, ptr @N, align 8
  %.pre128 = load i64, ptr @M, align 8
  br label %191

191:                                              ; preds = %190, %186, %177
  %192 = phi i64 [ %.pre128, %190 ], [ %178, %186 ], [ %178, %177 ]
  %193 = phi i64 [ %.pre127, %190 ], [ %179, %186 ], [ %179, %177 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #9
  %194 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 16), align 16, !tbaa !8
  %195 = add nsw i64 %194, %149
  store i64 %195, ptr %22, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #9
  %196 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 16), align 16, !tbaa !8
  %197 = add nsw i64 %196, %152
  store i64 %197, ptr %23, align 8, !tbaa !8
  %198 = icmp sgt i64 %195, -1
  %199 = icmp sgt i64 %197, -1
  %or.cond.not77.2 = select i1 %198, i1 %199, i1 false
  %.not68.2 = icmp slt i64 %195, %193
  %or.cond73.2 = select i1 %or.cond.not77.2, i1 %.not68.2, i1 false
  %.not69.2 = icmp slt i64 %197, %192
  %or.cond74.2 = select i1 %or.cond73.2, i1 %.not69.2, i1 false
  br i1 %or.cond74.2, label %200, label %205

200:                                              ; preds = %191
  %201 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %195, i64 %197
  %202 = load i64, ptr %201, align 8, !tbaa !8
  %.not70.2 = icmp eq i64 %202, -1
  br i1 %.not70.2, label %203, label %205

203:                                              ; preds = %200
  store i64 %153, ptr %201, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %24) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %25) #9
  store i64 %153, ptr %25, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %26) #9
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23)
  call void @_ZNSt4pairIxS_IxxEEC2IxS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(16) %26)
  invoke void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %5, ptr noundef nonnull align 8 dereferenceable(24) %24)
          to label %204 unwind label %220

204:                                              ; preds = %203
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %26) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %25) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %24) #9
  %.pre129 = load i64, ptr @N, align 8
  %.pre130 = load i64, ptr @M, align 8
  br label %205

205:                                              ; preds = %204, %200, %191
  %206 = phi i64 [ %.pre130, %204 ], [ %192, %200 ], [ %192, %191 ]
  %207 = phi i64 [ %.pre129, %204 ], [ %193, %200 ], [ %193, %191 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #9
  %208 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 24), align 8, !tbaa !8
  %209 = add nsw i64 %208, %149
  store i64 %209, ptr %22, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #9
  %210 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 24), align 8, !tbaa !8
  %211 = add nsw i64 %210, %152
  store i64 %211, ptr %23, align 8, !tbaa !8
  %212 = icmp sgt i64 %209, -1
  %213 = icmp sgt i64 %211, -1
  %or.cond.not77.3 = select i1 %212, i1 %213, i1 false
  %.not68.3 = icmp slt i64 %209, %207
  %or.cond73.3 = select i1 %or.cond.not77.3, i1 %.not68.3, i1 false
  %.not69.3 = icmp slt i64 %211, %206
  %or.cond74.3 = select i1 %or.cond73.3, i1 %.not69.3, i1 false
  br i1 %or.cond74.3, label %214, label %.loopexit

214:                                              ; preds = %205
  %215 = getelementptr inbounds [1000 x [1000 x i64]], ptr @d, i64 0, i64 %209, i64 %211
  %216 = load i64, ptr %215, align 8, !tbaa !8
  %.not70.3 = icmp eq i64 %216, -1
  br i1 %.not70.3, label %217, label %.loopexit

217:                                              ; preds = %214
  store i64 %153, ptr %215, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %24) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %25) #9
  store i64 %153, ptr %25, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %26) #9
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23)
  call void @_ZNSt4pairIxS_IxxEEC2IxS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(16) %26)
  invoke void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %5, ptr noundef nonnull align 8 dereferenceable(24) %24)
          to label %218 unwind label %220

218:                                              ; preds = %217
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %26) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %25) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %24) #9
  br label %.loopexit

.loopexit:                                        ; preds = %218, %214, %205
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #9
  %219 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %5)
  br i1 %219, label %.preheader81, label %.lr.ph94, !llvm.loop !29

220:                                              ; preds = %217, %203, %189, %175
  %221 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %26) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %25) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %24) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #9
  br label %236

._crit_edge108:                                   ; preds = %._crit_edge100.us, %.preheader.lr.ph, %.preheader81
  %.049.lcssa = phi i64 [ 0, %.preheader81 ], [ 0, %.preheader.lr.ph ], [ %.251.us.lcssa, %._crit_edge100.us ]
  %.048.lcssa = phi i64 [ 0, %.preheader81 ], [ 0, %.preheader.lr.ph ], [ %.2.us.lcssa, %._crit_edge100.us ]
  %222 = add nsw i64 %.049.lcssa, 1
  %223 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %222)
          to label %224 unwind label %234

224:                                              ; preds = %._crit_edge108
  %225 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %223, i8 noundef signext 32)
          to label %226 unwind label %234

226:                                              ; preds = %224
  %227 = add nsw i64 %.048.lcssa, 1
  %228 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %225, i64 noundef %227)
          to label %229 unwind label %234

229:                                              ; preds = %226
  %230 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %228, i8 noundef signext 10)
          to label %231 unwind label %234

231:                                              ; preds = %229
  call void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %5) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #9
  %232 = load i64, ptr @T, align 8, !tbaa !8
  %233 = add nsw i64 %232, -1
  store i64 %233, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %232, 0
  br i1 %.not, label %._crit_edge115, label %.lr.ph114, !llvm.loop !30

234:                                              ; preds = %229, %226, %224, %._crit_edge108
  %235 = landingpad { ptr, i32 }
          cleanup
  br label %236

236:                                              ; preds = %170, %220, %234, %168, %166, %164, %162
  %.pn.pn = phi { ptr, i32 } [ %235, %234 ], [ %169, %168 ], [ %167, %166 ], [ %165, %164 ], [ %163, %162 ], [ %221, %220 ], [ %171, %170 ]
  call void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %5) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #9
  resume { ptr, i32 } %.pn.pn

._crit_edge115:                                   ; preds = %231, %0
  ret i32 0
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 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

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 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 #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxS0_IxxEESt6vectorIS2_SaIS2_EESt4lessIS2_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) 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 #2 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 #6

; 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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #7

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

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 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 #2 = { 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 #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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { 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, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !10, i64 0}
!18 = distinct !{!18, !12, !19}
!19 = !{!"llvm.loop.unswitch.partial.disable"}
!20 = !{!10, !10, i64 0}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = !{!25, !9, i64 0}
!25 = !{!"_ZTSSt4pairIxS_IxxEE", !9, i64 0, !26, i64 8}
!26 = !{!"_ZTSSt4pairIxxE", !9, i64 0, !9, i64 8}
!27 = !{!25, !9, i64 8}
!28 = !{!25, !9, i64 16}
!29 = distinct !{!29, !12}
!30 = distinct !{!30, !12}


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