; LLVM IR from kazunetakahashi/atcoder :: 2018/0804_mujin-pc-2018 (E)

; 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::tuple<long long, int, int>, std::allocator<std::tuple<long long, int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::tuple<long long, int, int>, std::allocator<std::tuple<long long, int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::tuple<long long, int, int>, std::allocator<std::tuple<long long, int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::tuple<long long, int, int>, std::allocator<std::tuple<long long, int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.3", %"struct.std::_Head_base.6" }
%"struct.std::_Tuple_impl.3" = type { %"struct.std::_Tuple_impl.4", %"struct.std::_Head_base.5" }
%"struct.std::_Tuple_impl.4" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i32 }
%"struct.std::_Head_base.5" = type { i32 }
%"struct.std::_Head_base.6" = type { i64 }

@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@_Z1DB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_Z1SB5cxx11 = external dso_local global [1010 x %"class.std::__cxx11::basic_string"], align 16
@dist = external dso_local global [300010 x [4 x i64]], align 16
@ans = external dso_local global [1010 x [1010 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZL2ds = external hidden constant [4 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZL2dx = external hidden constant [4 x i32], align 16
@_ZL2dy = external hidden constant [4 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"class.std::priority_queue", align 8
  %19 = alloca %"class.std::tuple", align 8
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i64, align 8
  %28 = alloca %"class.std::tuple", align 8
  store i32 0, ptr %1, align 4
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef nonnull align 4 dereferenceable(4) @M)
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %30, ptr noundef nonnull align 4 dereferenceable(4) @K)
  %32 = 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) @_Z1DB5cxx11)
  call void @llvm.lifetime.start.p0(i64 32, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #7
  call void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %3, ptr noundef nonnull align 8 dereferenceable(32) @_Z1DB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) @_Z1DB5cxx11)
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEOS8_RKS8_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %2, ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(32) @_Z1DB5cxx11)
          to label %33 unwind label %40

33:                                               ; preds = %0
  %34 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) @_Z1DB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %49, %33
  %36 = load i32, ptr %6, align 4, !tbaa !5
  %37 = load i32, ptr @N, align 4, !tbaa !5
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %44, label %39

39:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %52

40:                                               ; preds = %0
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %4, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %5, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %2) #7
  br label %339

44:                                               ; preds = %35
  %45 = load i32, ptr %6, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [1010 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %46
  %48 = 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) %47)
  br label %49

49:                                               ; preds = %44
  %50 = load i32, ptr %6, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %6, align 4, !tbaa !5
  br label %35, !llvm.loop !9

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

53:                                               ; preds = %65, %52
  %54 = load i32, ptr %7, align 4, !tbaa !5
  %55 = icmp slt i32 %54, 4
  br i1 %55, label %57, label %56

56:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %68

57:                                               ; preds = %53
  %58 = load i32, ptr @K, align 4, !tbaa !5
  %59 = mul nsw i32 3, %58
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [300010 x [4 x i64]], ptr @dist, i64 0, i64 %60
  %62 = load i32, ptr %7, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [4 x i64], ptr %61, i64 0, i64 %63
  store i64 10000000000007, ptr %64, align 8, !tbaa !11
  br label %65

65:                                               ; preds = %57
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %7, align 4, !tbaa !5
  br label %53, !llvm.loop !13

68:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %69 = load i32, ptr @K, align 4, !tbaa !5
  %70 = mul nsw i32 3, %69
  %71 = sub nsw i32 %70, 1
  store i32 %71, ptr %8, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %121, %68
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = icmp sge i32 %73, 0
  br i1 %74, label %76, label %75

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

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

77:                                               ; preds = %117, %76
  %78 = load i32, ptr %10, align 4, !tbaa !5
  %79 = icmp slt i32 %78, 4
  br i1 %79, label %81, label %80

80:                                               ; preds = %77
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %120

81:                                               ; preds = %77
  %82 = load i32, ptr %8, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1DB5cxx11, i64 noundef %83)
  %85 = load i8, ptr %84, align 1, !tbaa !14
  %86 = sext i8 %85 to i32
  %87 = load i32, ptr %10, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [4 x i8], ptr @_ZL2ds, i64 0, i64 %88
  %90 = load i8, ptr %89, align 1, !tbaa !14
  %91 = sext i8 %90 to i32
  %92 = icmp eq i32 %86, %91
  br i1 %92, label %93, label %100

93:                                               ; preds = %81
  %94 = load i32, ptr %8, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [300010 x [4 x i64]], ptr @dist, i64 0, i64 %95
  %97 = load i32, ptr %10, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [4 x i64], ptr %96, i64 0, i64 %98
  store i64 1, ptr %99, align 8, !tbaa !11
  br label %116

100:                                              ; preds = %81
  %101 = load i32, ptr %8, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [300010 x [4 x i64]], ptr @dist, i64 0, i64 %103
  %105 = load i32, ptr %10, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [4 x i64], ptr %104, i64 0, i64 %106
  %108 = load i64, ptr %107, align 8, !tbaa !11
  %109 = add nsw i64 %108, 1
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [300010 x [4 x i64]], ptr @dist, i64 0, i64 %111
  %113 = load i32, ptr %10, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [4 x i64], ptr %112, i64 0, i64 %114
  store i64 %109, ptr %115, align 8, !tbaa !11
  br label %116

116:                                              ; preds = %100, %93
  br label %117

117:                                              ; preds = %116
  %118 = load i32, ptr %10, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %10, align 4, !tbaa !5
  br label %77, !llvm.loop !15

120:                                              ; preds = %80
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %8, align 4, !tbaa !5
  %123 = add nsw i32 %122, -1
  store i32 %123, ptr %8, align 4, !tbaa !5
  br label %72, !llvm.loop !16

124:                                              ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 -1, ptr %15, align 4, !tbaa !5
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @ans, ptr noundef getelementptr inbounds (i64, ptr @ans, i64 1020100), ptr noundef nonnull align 4 dereferenceable(4) %15)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %168, %124
  %126 = load i32, ptr %16, align 4, !tbaa !5
  %127 = load i32, ptr @N, align 4, !tbaa !5
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %130, label %129

129:                                              ; preds = %125
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %171

130:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %131

131:                                              ; preds = %164, %130
  %132 = load i32, ptr %17, align 4, !tbaa !5
  %133 = load i32, ptr @M, align 4, !tbaa !5
  %134 = icmp slt i32 %132, %133
  br i1 %134, label %136, label %135

135:                                              ; preds = %131
  store i32 17, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %167

136:                                              ; preds = %131
  %137 = load i32, ptr %16, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [1010 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %138
  %140 = load i32, ptr %17, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %139, i64 noundef %141)
  %143 = load i8, ptr %142, align 1, !tbaa !14
  %144 = sext i8 %143 to i32
  %145 = icmp eq i32 %144, 83
  br i1 %145, label %146, label %149

146:                                              ; preds = %136
  %147 = load i32, ptr %16, align 4, !tbaa !5
  store i32 %147, ptr %11, align 4, !tbaa !5
  %148 = load i32, ptr %17, align 4, !tbaa !5
  store i32 %148, ptr %12, align 4, !tbaa !5
  br label %163

149:                                              ; preds = %136
  %150 = load i32, ptr %16, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [1010 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %151
  %153 = load i32, ptr %17, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %152, i64 noundef %154)
  %156 = load i8, ptr %155, align 1, !tbaa !14
  %157 = sext i8 %156 to i32
  %158 = icmp eq i32 %157, 71
  br i1 %158, label %159, label %162

159:                                              ; preds = %149
  %160 = load i32, ptr %16, align 4, !tbaa !5
  store i32 %160, ptr %13, align 4, !tbaa !5
  %161 = load i32, ptr %17, align 4, !tbaa !5
  store i32 %161, ptr %14, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %159, %149
  br label %163

163:                                              ; preds = %162, %146
  br label %164

164:                                              ; preds = %163
  %165 = load i32, ptr %17, align 4, !tbaa !5
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %17, align 4, !tbaa !5
  br label %131, !llvm.loop !17

167:                                              ; preds = %135
  br label %168

168:                                              ; preds = %167
  %169 = load i32, ptr %16, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %16, align 4, !tbaa !5
  br label %125, !llvm.loop !18

171:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #7
  call void @_ZNSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %18)
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 0, ptr %20, align 4, !tbaa !5
  call void @_ZNSt5tupleIJxiiEEC2IJiRiS2_ELb1ETnNSt9enable_ifIXclsr4_TCCIXT0_EEE29__is_implicitly_constructibleIDpT_EEEbE4typeELb1EEEDpOS4_(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12) #7
  invoke void @_ZNSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %18, ptr noundef nonnull align 8 dereferenceable(16) %19)
          to label %172 unwind label %220

172:                                              ; preds = %171
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #7
  br label %173

173:                                              ; preds = %325, %172
  %174 = invoke noundef zeroext i1 @_ZNKSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %18)
          to label %175 unwind label %224

175:                                              ; preds = %173
  %176 = xor i1 %174, true
  br i1 %176, label %177, label %329

177:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %178 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %18)
          to label %179 unwind label %228

179:                                              ; preds = %177
  %180 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %178) #7
  %181 = load i64, ptr %180, align 8, !tbaa !11
  store i64 %181, ptr %21, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %182 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %18)
          to label %183 unwind label %232

183:                                              ; preds = %179
  %184 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %182) #7
  %185 = load i32, ptr %184, align 4, !tbaa !5
  store i32 %185, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %186 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %18)
          to label %187 unwind label %236

187:                                              ; preds = %183
  %188 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm2EJxiiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %186) #7
  %189 = load i32, ptr %188, align 4, !tbaa !5
  store i32 %189, ptr %23, align 4, !tbaa !5
  invoke void @_ZNSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %18)
          to label %190 unwind label %236

190:                                              ; preds = %187
  %191 = load i32, ptr %22, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [1010 x [1010 x i64]], ptr @ans, i64 0, i64 %192
  %194 = load i32, ptr %23, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [1010 x i64], ptr %193, i64 0, i64 %195
  %197 = load i64, ptr %196, align 8, !tbaa !11
  %198 = icmp eq i64 %197, -1
  br i1 %198, label %199, label %322

199:                                              ; preds = %190
  %200 = load i64, ptr %21, align 8, !tbaa !11
  %201 = load i32, ptr %22, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [1010 x [1010 x i64]], ptr @ans, i64 0, i64 %202
  %204 = load i32, ptr %23, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [1010 x i64], ptr %203, i64 0, i64 %205
  store i64 %200, ptr %206, align 8, !tbaa !11
  %207 = load i32, ptr %22, align 4, !tbaa !5
  %208 = load i32, ptr %13, align 4, !tbaa !5
  %209 = icmp eq i32 %207, %208
  br i1 %209, label %210, label %240

210:                                              ; preds = %199
  %211 = load i32, ptr %23, align 4, !tbaa !5
  %212 = load i32, ptr %14, align 4, !tbaa !5
  %213 = icmp eq i32 %211, %212
  br i1 %213, label %214, label %240

214:                                              ; preds = %210
  %215 = load i64, ptr %21, align 8, !tbaa !11
  %216 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %215)
          to label %217 unwind label %236

217:                                              ; preds = %214
  %218 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %216, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %219 unwind label %236

219:                                              ; preds = %217
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  br label %323

220:                                              ; preds = %171
  %221 = landingpad { ptr, i32 }
          cleanup
  %222 = extractvalue { ptr, i32 } %221, 0
  store ptr %222, ptr %4, align 8
  %223 = extractvalue { ptr, i32 } %221, 1
  store i32 %223, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #7
  br label %338

224:                                              ; preds = %331, %329, %173
  %225 = landingpad { ptr, i32 }
          cleanup
  %226 = extractvalue { ptr, i32 } %225, 0
  store ptr %226, ptr %4, align 8
  %227 = extractvalue { ptr, i32 } %225, 1
  store i32 %227, ptr %5, align 4
  br label %338

228:                                              ; preds = %177
  %229 = landingpad { ptr, i32 }
          cleanup
  %230 = extractvalue { ptr, i32 } %229, 0
  store ptr %230, ptr %4, align 8
  %231 = extractvalue { ptr, i32 } %229, 1
  store i32 %231, ptr %5, align 4
  br label %328

232:                                              ; preds = %179
  %233 = landingpad { ptr, i32 }
          cleanup
  %234 = extractvalue { ptr, i32 } %233, 0
  store ptr %234, ptr %4, align 8
  %235 = extractvalue { ptr, i32 } %233, 1
  store i32 %235, ptr %5, align 4
  br label %327

236:                                              ; preds = %217, %214, %187, %183
  %237 = landingpad { ptr, i32 }
          cleanup
  %238 = extractvalue { ptr, i32 } %237, 0
  store ptr %238, ptr %4, align 8
  %239 = extractvalue { ptr, i32 } %237, 1
  store i32 %239, ptr %5, align 4
  br label %326

240:                                              ; preds = %210, %199
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %241

241:                                              ; preds = %317, %240
  %242 = load i32, ptr %24, align 4, !tbaa !5
  %243 = icmp slt i32 %242, 4
  br i1 %243, label %245, label %244

244:                                              ; preds = %241
  store i32 22, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %321

245:                                              ; preds = %241
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %246 = load i32, ptr %22, align 4, !tbaa !5
  %247 = load i32, ptr %24, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [4 x i32], ptr @_ZL2dx, i64 0, i64 %248
  %250 = load i32, ptr %249, align 4, !tbaa !5
  %251 = add nsw i32 %246, %250
  store i32 %251, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  %252 = load i32, ptr %23, align 4, !tbaa !5
  %253 = load i32, ptr %24, align 4, !tbaa !5
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [4 x i32], ptr @_ZL2dy, i64 0, i64 %254
  %256 = load i32, ptr %255, align 4, !tbaa !5
  %257 = add nsw i32 %252, %256
  store i32 %257, ptr %26, align 4, !tbaa !5
  %258 = load i32, ptr %25, align 4, !tbaa !5
  %259 = icmp sle i32 0, %258
  br i1 %259, label %260, label %316

260:                                              ; preds = %245
  %261 = load i32, ptr %25, align 4, !tbaa !5
  %262 = load i32, ptr @N, align 4, !tbaa !5
  %263 = icmp slt i32 %261, %262
  br i1 %263, label %264, label %316

264:                                              ; preds = %260
  %265 = load i32, ptr %26, align 4, !tbaa !5
  %266 = icmp sle i32 0, %265
  br i1 %266, label %267, label %316

267:                                              ; preds = %264
  %268 = load i32, ptr %26, align 4, !tbaa !5
  %269 = load i32, ptr @M, align 4, !tbaa !5
  %270 = icmp slt i32 %268, %269
  br i1 %270, label %271, label %316

271:                                              ; preds = %267
  %272 = load i32, ptr %25, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [1010 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %273
  %275 = load i32, ptr %26, align 4, !tbaa !5
  %276 = sext i32 %275 to i64
  %277 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %274, i64 noundef %276)
          to label %278 unwind label %307

278:                                              ; preds = %271
  %279 = load i8, ptr %277, align 1, !tbaa !14
  %280 = sext i8 %279 to i32
  %281 = icmp ne i32 %280, 35
  br i1 %281, label %282, label %316

282:                                              ; preds = %278
  %283 = load i32, ptr %25, align 4, !tbaa !5
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds [1010 x [1010 x i64]], ptr @ans, i64 0, i64 %284
  %286 = load i32, ptr %26, align 4, !tbaa !5
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [1010 x i64], ptr %285, i64 0, i64 %287
  %289 = load i64, ptr %288, align 8, !tbaa !11
  %290 = icmp eq i64 %289, -1
  br i1 %290, label %291, label %316

291:                                              ; preds = %282
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %292 = load i64, ptr %21, align 8, !tbaa !11
  %293 = load i64, ptr %21, align 8, !tbaa !11
  %294 = load i32, ptr @K, align 4, !tbaa !5
  %295 = sext i32 %294 to i64
  %296 = srem i64 %293, %295
  %297 = getelementptr inbounds [300010 x [4 x i64]], ptr @dist, i64 0, i64 %296
  %298 = load i32, ptr %24, align 4, !tbaa !5
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds [4 x i64], ptr %297, i64 0, i64 %299
  %301 = load i64, ptr %300, align 8, !tbaa !11
  %302 = add nsw i64 %292, %301
  store i64 %302, ptr %27, align 8, !tbaa !11
  %303 = load i64, ptr %27, align 8, !tbaa !11
  %304 = icmp slt i64 %303, 10000000000007
  br i1 %304, label %305, label %315

305:                                              ; preds = %291
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #7
  call void @_ZNSt5tupleIJxiiEEC2IJRxRiS3_ELb1ETnNSt9enable_ifIXclsr4_TCCIXT0_EEE29__is_implicitly_constructibleIDpT_EEEbE4typeELb1EEEDpOS5_(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %26) #7
  invoke void @_ZNSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %18, ptr noundef nonnull align 8 dereferenceable(16) %28)
          to label %306 unwind label %311

306:                                              ; preds = %305
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #7
  br label %315

307:                                              ; preds = %271
  %308 = landingpad { ptr, i32 }
          cleanup
  %309 = extractvalue { ptr, i32 } %308, 0
  store ptr %309, ptr %4, align 8
  %310 = extractvalue { ptr, i32 } %308, 1
  store i32 %310, ptr %5, align 4
  br label %320

311:                                              ; preds = %305
  %312 = landingpad { ptr, i32 }
          cleanup
  %313 = extractvalue { ptr, i32 } %312, 0
  store ptr %313, ptr %4, align 8
  %314 = extractvalue { ptr, i32 } %312, 1
  store i32 %314, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %320

315:                                              ; preds = %306, %291
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %316

316:                                              ; preds = %315, %282, %278, %267, %264, %260, %245
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %317

317:                                              ; preds = %316
  %318 = load i32, ptr %24, align 4, !tbaa !5
  %319 = add nsw i32 %318, 1
  store i32 %319, ptr %24, align 4, !tbaa !5
  br label %241, !llvm.loop !19

320:                                              ; preds = %311, %307
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %326

321:                                              ; preds = %244
  br label %322

322:                                              ; preds = %321, %190
  store i32 0, ptr %9, align 4
  br label %323

323:                                              ; preds = %322, %219
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  %324 = load i32, ptr %9, align 4
  switch i32 %324, label %334 [
    i32 0, label %325
  ]

325:                                              ; preds = %323
  br label %173, !llvm.loop !20

326:                                              ; preds = %320, %236
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %327

327:                                              ; preds = %326, %232
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %328

328:                                              ; preds = %327, %228
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %338

329:                                              ; preds = %175
  %330 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
          to label %331 unwind label %224

331:                                              ; preds = %329
  %332 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %330, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %333 unwind label %224

333:                                              ; preds = %331
  store i32 0, ptr %9, align 4
  br label %334

334:                                              ; preds = %333, %323
  call void @_ZNSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %18) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  %335 = load i32, ptr %9, align 4
  switch i32 %335, label %344 [
    i32 0, label %336
    i32 1, label %336
  ]

336:                                              ; preds = %334, %334
  %337 = load i32, ptr %1, align 4
  ret i32 %337

338:                                              ; preds = %328, %224, %220
  call void @_ZNSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %18) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %339

339:                                              ; preds = %338, %40
  %340 = load ptr, ptr %4, align 8
  %341 = load i32, ptr %5, align 4
  %342 = insertvalue { ptr, i32 } poison, ptr %340, 0
  %343 = insertvalue { ptr, i32 } %342, i32 %341, 1
  resume { ptr, i32 } %343

344:                                              ; preds = %334
  unreachable
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEOS8_RKS8_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #5

declare i32 @__gxx_personality_v0(...)

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

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

; 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) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #4

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(16)) #5 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16)) #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm2EJxiiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16)) #0

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

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

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

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

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

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

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

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

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

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


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

%"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::tuple<long long, int, int>, std::allocator<std::tuple<long long, int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::tuple<long long, int, int>, std::allocator<std::tuple<long long, int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::tuple<long long, int, int>, std::allocator<std::tuple<long long, int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::tuple<long long, int, int>, std::allocator<std::tuple<long long, int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.3", %"struct.std::_Head_base.6" }
%"struct.std::_Tuple_impl.3" = type { %"struct.std::_Tuple_impl.4", %"struct.std::_Head_base.5" }
%"struct.std::_Tuple_impl.4" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i32 }
%"struct.std::_Head_base.5" = type { i32 }
%"struct.std::_Head_base.6" = type { i64 }

@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@_Z1DB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_Z1SB5cxx11 = external dso_local global [1010 x %"class.std::__cxx11::basic_string"], align 16
@dist = external dso_local local_unnamed_addr global [300010 x [4 x i64]], align 16
@ans = external dso_local global [1010 x [1010 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZL2ds = external hidden local_unnamed_addr constant [4 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZL2dx = external hidden local_unnamed_addr constant [4 x i32], align 16
@_ZL2dy = external hidden local_unnamed_addr constant [4 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::priority_queue", align 8
  %7 = alloca %"class.std::tuple", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca %"class.std::tuple", align 8
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %14 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) @M)
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(4) @K)
  %16 = tail 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) @_Z1DB5cxx11)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #7
  call void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %2, ptr noundef nonnull align 8 dereferenceable(32) @_Z1DB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) @_Z1DB5cxx11)
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEOS8_RKS8_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %1, ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(32) @_Z1DB5cxx11)
          to label %17 unwind label %29

17:                                               ; preds = %0
  %18 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) @_Z1DB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #7
  %19 = load i32, ptr @N, align 4, !tbaa !5
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph, label %.preheader86

.preheader86:                                     ; preds = %.lr.ph, %17
  %21 = load i32, ptr @K, align 4, !tbaa !5
  %22 = mul i32 %21, 3
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [300010 x [4 x i64]], ptr @dist, i64 0, i64 %23, i64 0
  store i64 10000000000007, ptr %24, align 16, !tbaa !9
  %25 = getelementptr inbounds [300010 x [4 x i64]], ptr @dist, i64 0, i64 %23, i64 1
  store i64 10000000000007, ptr %25, align 8, !tbaa !9
  %26 = getelementptr inbounds [300010 x [4 x i64]], ptr @dist, i64 0, i64 %23, i64 2
  store i64 10000000000007, ptr %26, align 16, !tbaa !9
  %27 = getelementptr inbounds [300010 x [4 x i64]], ptr @dist, i64 0, i64 %23, i64 3
  store i64 10000000000007, ptr %27, align 8, !tbaa !9
  %28 = icmp sgt i32 %21, 0
  br i1 %28, label %.preheader84.preheader, label %._crit_edge

29:                                               ; preds = %0
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #7
  br label %286

.lr.ph:                                           ; preds = %17, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %17 ]
  %31 = getelementptr inbounds [1010 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %indvars.iv
  %32 = 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) %31)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %33 = load i32, ptr @N, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = icmp slt i64 %indvars.iv.next, %34
  br i1 %35, label %.lr.ph, label %.preheader86, !llvm.loop !11

.preheader84.preheader:                           ; preds = %.preheader86
  %36 = zext i32 %22 to i64
  %.pre = load i8, ptr @_ZL2ds, align 1, !tbaa !13
  %37 = load i8, ptr getelementptr inbounds (i8, ptr @_ZL2ds, i64 1), align 1
  %38 = load i8, ptr getelementptr inbounds (i8, ptr @_ZL2ds, i64 2), align 1
  %39 = load i8, ptr getelementptr inbounds (i8, ptr @_ZL2ds, i64 3), align 1
  br label %.preheader84

.preheader84:                                     ; preds = %.preheader84.preheader, %.loopexit85
  %indvars.iv123 = phi i64 [ %36, %.preheader84.preheader ], [ %indvars.iv.next124, %.loopexit85 ]
  %indvars.iv.next124 = add nsw i64 %indvars.iv123, -1
  %40 = and i64 %indvars.iv.next124, 4294967295
  %41 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1DB5cxx11, i64 noundef %40)
  %42 = load i8, ptr %41, align 1, !tbaa !13
  %43 = icmp eq i8 %42, %.pre
  br i1 %43, label %52, label %48

._crit_edge:                                      ; preds = %.loopexit85, %.preheader86
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store i32 -1, ptr %5, align 4, !tbaa !5
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @ans, ptr noundef nonnull getelementptr inbounds (i8, ptr @ans, i64 8160800), ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  %44 = load i32, ptr @N, align 4, !tbaa !5
  %45 = icmp sgt i32 %44, 0
  %46 = load i32, ptr @M, align 4
  %47 = icmp sgt i32 %46, 0
  %or.cond146 = select i1 %45, i1 %47, i1 false
  br i1 %or.cond146, label %.preheader83, label %._crit_edge104

48:                                               ; preds = %.preheader84
  %49 = getelementptr inbounds [300010 x [4 x i64]], ptr @dist, i64 0, i64 %indvars.iv123, i64 0
  %50 = load i64, ptr %49, align 16, !tbaa !9
  %51 = add nsw i64 %50, 1
  br label %52

52:                                               ; preds = %.preheader84, %48
  %.sink = phi i64 [ %51, %48 ], [ 1, %.preheader84 ]
  %53 = getelementptr inbounds [300010 x [4 x i64]], ptr @dist, i64 0, i64 %40, i64 0
  store i64 %.sink, ptr %53, align 16
  %54 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1DB5cxx11, i64 noundef %40)
  %55 = load i8, ptr %54, align 1, !tbaa !13
  %56 = icmp eq i8 %55, %37
  br i1 %56, label %61, label %57

57:                                               ; preds = %52
  %58 = getelementptr inbounds [300010 x [4 x i64]], ptr @dist, i64 0, i64 %indvars.iv123, i64 1
  %59 = load i64, ptr %58, align 8, !tbaa !9
  %60 = add nsw i64 %59, 1
  br label %61

61:                                               ; preds = %52, %57
  %.sink138 = phi i64 [ %60, %57 ], [ 1, %52 ]
  %62 = getelementptr inbounds [300010 x [4 x i64]], ptr @dist, i64 0, i64 %40, i64 1
  store i64 %.sink138, ptr %62, align 8
  %63 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1DB5cxx11, i64 noundef %40)
  %64 = load i8, ptr %63, align 1, !tbaa !13
  %65 = icmp eq i8 %64, %38
  br i1 %65, label %70, label %66

66:                                               ; preds = %61
  %67 = getelementptr inbounds [300010 x [4 x i64]], ptr @dist, i64 0, i64 %indvars.iv123, i64 2
  %68 = load i64, ptr %67, align 16, !tbaa !9
  %69 = add nsw i64 %68, 1
  br label %70

70:                                               ; preds = %61, %66
  %.sink139 = phi i64 [ %69, %66 ], [ 1, %61 ]
  %71 = getelementptr inbounds [300010 x [4 x i64]], ptr @dist, i64 0, i64 %40, i64 2
  store i64 %.sink139, ptr %71, align 16
  %72 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1DB5cxx11, i64 noundef %40)
  %73 = load i8, ptr %72, align 1, !tbaa !13
  %74 = icmp eq i8 %73, %39
  br i1 %74, label %.loopexit85, label %75

75:                                               ; preds = %70
  %76 = getelementptr inbounds [300010 x [4 x i64]], ptr @dist, i64 0, i64 %indvars.iv123, i64 3
  %77 = load i64, ptr %76, align 8, !tbaa !9
  %78 = add nsw i64 %77, 1
  br label %.loopexit85

.loopexit85:                                      ; preds = %70, %75
  %.sink140 = phi i64 [ %78, %75 ], [ 1, %70 ]
  %79 = getelementptr inbounds [300010 x [4 x i64]], ptr @dist, i64 0, i64 %40, i64 3
  store i64 %.sink140, ptr %79, align 8
  %80 = trunc nuw i64 %indvars.iv123 to i32
  %81 = icmp sgt i32 %80, 1
  br i1 %81, label %.preheader84, label %._crit_edge, !llvm.loop !14

.preheader83:                                     ; preds = %._crit_edge, %._crit_edge99
  %82 = phi i32 [ %88, %._crit_edge99 ], [ %44, %._crit_edge ]
  %83 = phi i32 [ %89, %._crit_edge99 ], [ %46, %._crit_edge ]
  %indvars.iv130 = phi i64 [ %indvars.iv.next131, %._crit_edge99 ], [ 0, %._crit_edge ]
  %.062102 = phi i32 [ %.163.lcssa, %._crit_edge99 ], [ undef, %._crit_edge ]
  %.065101 = phi i32 [ %.166.lcssa, %._crit_edge99 ], [ undef, %._crit_edge ]
  %84 = icmp sgt i32 %83, 0
  br i1 %84, label %.lr.ph98, label %._crit_edge99

.lr.ph98:                                         ; preds = %.preheader83
  %85 = getelementptr inbounds [1010 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %indvars.iv130
  %86 = trunc nuw nsw i64 %indvars.iv130 to i32
  %87 = trunc nuw nsw i64 %indvars.iv130 to i32
  br label %92

._crit_edge104:                                   ; preds = %._crit_edge99, %._crit_edge
  %.065.lcssa = phi i32 [ undef, %._crit_edge ], [ %.166.lcssa, %._crit_edge99 ]
  %.062.lcssa = phi i32 [ undef, %._crit_edge ], [ %.163.lcssa, %._crit_edge99 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #7
  call void @_ZNSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %6)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @_ZNSt5tupleIJxiiEEC2IJiRiS2_ELb1ETnNSt9enable_ifIXclsr4_TCCIXT0_EEE29__is_implicitly_constructibleIDpT_EEEbE4typeELb1EEEDpOS4_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #7
  invoke void @_ZNSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %6, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %107 unwind label %142

._crit_edge99.loopexit:                           ; preds = %103
  %.pre141 = load i32, ptr @N, align 4, !tbaa !5
  br label %._crit_edge99

._crit_edge99:                                    ; preds = %._crit_edge99.loopexit, %.preheader83
  %88 = phi i32 [ %82, %.preheader83 ], [ %.pre141, %._crit_edge99.loopexit ]
  %89 = phi i32 [ %83, %.preheader83 ], [ %104, %._crit_edge99.loopexit ]
  %.166.lcssa = phi i32 [ %.065101, %.preheader83 ], [ %.267, %._crit_edge99.loopexit ]
  %.163.lcssa = phi i32 [ %.062102, %.preheader83 ], [ %.264, %._crit_edge99.loopexit ]
  %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
  %90 = sext i32 %88 to i64
  %91 = icmp slt i64 %indvars.iv.next131, %90
  br i1 %91, label %.preheader83, label %._crit_edge104, !llvm.loop !15

92:                                               ; preds = %.lr.ph98, %103
  %indvars.iv126 = phi i64 [ 0, %.lr.ph98 ], [ %indvars.iv.next127, %103 ]
  %.16396 = phi i32 [ %.062102, %.lr.ph98 ], [ %.264, %103 ]
  %.16695 = phi i32 [ %.065101, %.lr.ph98 ], [ %.267, %103 ]
  %93 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %85, i64 noundef %indvars.iv126)
  %94 = load i8, ptr %93, align 1, !tbaa !13
  %95 = icmp eq i8 %94, 83
  br i1 %95, label %96, label %98

96:                                               ; preds = %92
  store i32 %87, ptr %3, align 4, !tbaa !5
  %97 = trunc nuw nsw i64 %indvars.iv126 to i32
  store i32 %97, ptr %4, align 4, !tbaa !5
  br label %103

98:                                               ; preds = %92
  %99 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %85, i64 noundef %indvars.iv126)
  %100 = load i8, ptr %99, align 1, !tbaa !13
  %101 = icmp eq i8 %100, 71
  %spec.select = select i1 %101, i32 %86, i32 %.16695
  %102 = trunc nuw nsw i64 %indvars.iv126 to i32
  %spec.select78 = select i1 %101, i32 %102, i32 %.16396
  br label %103

103:                                              ; preds = %98, %96
  %.267 = phi i32 [ %.16695, %96 ], [ %spec.select, %98 ]
  %.264 = phi i32 [ %.16396, %96 ], [ %spec.select78, %98 ]
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %104 = load i32, ptr @M, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = icmp slt i64 %indvars.iv.next127, %105
  br i1 %106, label %92, label %._crit_edge99.loopexit, !llvm.loop !17

107:                                              ; preds = %._crit_edge104
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  %108 = call noundef zeroext i1 @_ZNKSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %6)
  br i1 %108, label %._crit_edge111, label %.lr.ph110.preheader

.lr.ph110.preheader:                              ; preds = %107
  %109 = load i32, ptr @_ZL2dx, align 16
  %110 = load i32, ptr @_ZL2dy, align 16
  %111 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dx, i64 4), align 4
  %112 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dy, i64 4), align 4
  %113 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dx, i64 8), align 8
  %114 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dy, i64 8), align 8
  %115 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dx, i64 12), align 4
  %116 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dy, i64 12), align 4
  br label %.lr.ph110

.lr.ph110:                                        ; preds = %.lr.ph110.preheader, %.loopexit
  %117 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %6)
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %117) #7
  %119 = load i64, ptr %118, align 8, !tbaa !9
  %120 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %6)
  %121 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %120) #7
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %6)
  %124 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm2EJxiiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %123) #7
  %125 = load i32, ptr %124, align 4, !tbaa !5
  invoke void @_ZNSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %6)
          to label %126 unwind label %.loopexit82

126:                                              ; preds = %.lr.ph110
  %127 = sext i32 %122 to i64
  %128 = sext i32 %125 to i64
  %129 = getelementptr inbounds [1010 x [1010 x i64]], ptr @ans, i64 0, i64 %127, i64 %128
  %130 = load i64, ptr %129, align 8, !tbaa !9
  %131 = icmp eq i64 %130, -1
  br i1 %131, label %132, label %.loopexit

132:                                              ; preds = %126
  store i64 %119, ptr %129, align 8, !tbaa !9
  %133 = icmp eq i32 %122, %.065.lcssa
  %134 = icmp eq i32 %125, %.062.lcssa
  %or.cond79 = select i1 %133, i1 %134, i1 false
  br i1 %or.cond79, label %138, label %.preheader.preheader

.preheader.preheader:                             ; preds = %132
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %135 = add nsw i32 %109, %122
  store i32 %135, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  %136 = add nsw i32 %110, %125
  store i32 %136, ptr %10, align 4, !tbaa !5
  %137 = icmp sgt i32 %135, -1
  br i1 %137, label %146, label %.preheader.1

138:                                              ; preds = %132
  %139 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %119)
          to label %140 unwind label %.loopexit.split-lp

140:                                              ; preds = %138
  %141 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %139, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %.critedge unwind label %.loopexit.split-lp

142:                                              ; preds = %._crit_edge104
  %143 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  br label %285

144:                                              ; preds = %283, %._crit_edge111
  %145 = landingpad { ptr, i32 }
          cleanup
  br label %285

.loopexit82:                                      ; preds = %.lr.ph110
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %285

.loopexit.split-lp:                               ; preds = %138, %140
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %285

146:                                              ; preds = %.preheader.preheader
  %147 = load i32, ptr @N, align 4, !tbaa !5
  %148 = icmp slt i32 %135, %147
  %149 = icmp sgt i32 %136, -1
  %or.cond = select i1 %148, i1 %149, i1 false
  %150 = load i32, ptr @M, align 4
  %151 = icmp slt i32 %136, %150
  %or.cond81 = select i1 %or.cond, i1 %151, i1 false
  br i1 %or.cond81, label %152, label %.preheader.1

152:                                              ; preds = %146
  %153 = zext nneg i32 %135 to i64
  %154 = getelementptr inbounds [1010 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %153
  %155 = zext nneg i32 %136 to i64
  %156 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %154, i64 noundef %155)
  %157 = load i8, ptr %156, align 1, !tbaa !13
  %.not = icmp eq i8 %157, 35
  br i1 %.not, label %.preheader.1, label %158

158:                                              ; preds = %152
  %159 = load i32, ptr %9, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = load i32, ptr %10, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [1010 x [1010 x i64]], ptr @ans, i64 0, i64 %160, i64 %162
  %164 = load i64, ptr %163, align 8, !tbaa !9
  %165 = icmp eq i64 %164, -1
  br i1 %165, label %166, label %.preheader.1

166:                                              ; preds = %158
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %167 = load i32, ptr @K, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = srem i64 %119, %168
  %170 = getelementptr inbounds [300010 x [4 x i64]], ptr @dist, i64 0, i64 %169, i64 0
  %171 = load i64, ptr %170, align 16, !tbaa !9
  %172 = add nsw i64 %171, %119
  store i64 %172, ptr %11, align 8, !tbaa !9
  %173 = icmp slt i64 %172, 10000000000007
  br i1 %173, label %174, label %178

174:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #7
  call void @_ZNSt5tupleIJxiiEEC2IJRxRiS3_ELb1ETnNSt9enable_ifIXclsr4_TCCIXT0_EEE29__is_implicitly_constructibleIDpT_EEEbE4typeELb1EEEDpOS5_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10) #7
  invoke void @_ZNSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %6, ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %175 unwind label %176

175:                                              ; preds = %174
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #7
  br label %178

176:                                              ; preds = %278, %244, %210, %174
  %177 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  br label %285

178:                                              ; preds = %175, %166
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  br label %.preheader.1

.preheader.1:                                     ; preds = %178, %158, %152, %146, %.preheader.preheader
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %179 = add nsw i32 %111, %122
  store i32 %179, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  %180 = add nsw i32 %112, %125
  store i32 %180, ptr %10, align 4, !tbaa !5
  %181 = icmp sgt i32 %179, -1
  br i1 %181, label %182, label %.preheader.2

182:                                              ; preds = %.preheader.1
  %183 = load i32, ptr @N, align 4, !tbaa !5
  %184 = icmp slt i32 %179, %183
  %185 = icmp sgt i32 %180, -1
  %or.cond.1 = select i1 %184, i1 %185, i1 false
  %186 = load i32, ptr @M, align 4
  %187 = icmp slt i32 %180, %186
  %or.cond81.1 = select i1 %or.cond.1, i1 %187, i1 false
  br i1 %or.cond81.1, label %188, label %.preheader.2

188:                                              ; preds = %182
  %189 = zext nneg i32 %179 to i64
  %190 = getelementptr inbounds [1010 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %189
  %191 = zext nneg i32 %180 to i64
  %192 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %190, i64 noundef %191)
  %193 = load i8, ptr %192, align 1, !tbaa !13
  %.not.1 = icmp eq i8 %193, 35
  br i1 %.not.1, label %.preheader.2, label %194

194:                                              ; preds = %188
  %195 = load i32, ptr %9, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = load i32, ptr %10, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [1010 x [1010 x i64]], ptr @ans, i64 0, i64 %196, i64 %198
  %200 = load i64, ptr %199, align 8, !tbaa !9
  %201 = icmp eq i64 %200, -1
  br i1 %201, label %202, label %.preheader.2

202:                                              ; preds = %194
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %203 = load i32, ptr @K, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = srem i64 %119, %204
  %206 = getelementptr inbounds [300010 x [4 x i64]], ptr @dist, i64 0, i64 %205, i64 1
  %207 = load i64, ptr %206, align 8, !tbaa !9
  %208 = add nsw i64 %207, %119
  store i64 %208, ptr %11, align 8, !tbaa !9
  %209 = icmp slt i64 %208, 10000000000007
  br i1 %209, label %210, label %212

210:                                              ; preds = %202
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #7
  call void @_ZNSt5tupleIJxiiEEC2IJRxRiS3_ELb1ETnNSt9enable_ifIXclsr4_TCCIXT0_EEE29__is_implicitly_constructibleIDpT_EEEbE4typeELb1EEEDpOS5_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10) #7
  invoke void @_ZNSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %6, ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %211 unwind label %176

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

212:                                              ; preds = %211, %202
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  br label %.preheader.2

.preheader.2:                                     ; preds = %212, %194, %188, %182, %.preheader.1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %213 = add nsw i32 %113, %122
  store i32 %213, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  %214 = add nsw i32 %114, %125
  store i32 %214, ptr %10, align 4, !tbaa !5
  %215 = icmp sgt i32 %213, -1
  br i1 %215, label %216, label %.preheader.3

216:                                              ; preds = %.preheader.2
  %217 = load i32, ptr @N, align 4, !tbaa !5
  %218 = icmp slt i32 %213, %217
  %219 = icmp sgt i32 %214, -1
  %or.cond.2 = select i1 %218, i1 %219, i1 false
  %220 = load i32, ptr @M, align 4
  %221 = icmp slt i32 %214, %220
  %or.cond81.2 = select i1 %or.cond.2, i1 %221, i1 false
  br i1 %or.cond81.2, label %222, label %.preheader.3

222:                                              ; preds = %216
  %223 = zext nneg i32 %213 to i64
  %224 = getelementptr inbounds [1010 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %223
  %225 = zext nneg i32 %214 to i64
  %226 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %224, i64 noundef %225)
  %227 = load i8, ptr %226, align 1, !tbaa !13
  %.not.2 = icmp eq i8 %227, 35
  br i1 %.not.2, label %.preheader.3, label %228

228:                                              ; preds = %222
  %229 = load i32, ptr %9, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = load i32, ptr %10, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [1010 x [1010 x i64]], ptr @ans, i64 0, i64 %230, i64 %232
  %234 = load i64, ptr %233, align 8, !tbaa !9
  %235 = icmp eq i64 %234, -1
  br i1 %235, label %236, label %.preheader.3

236:                                              ; preds = %228
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %237 = load i32, ptr @K, align 4, !tbaa !5
  %238 = sext i32 %237 to i64
  %239 = srem i64 %119, %238
  %240 = getelementptr inbounds [300010 x [4 x i64]], ptr @dist, i64 0, i64 %239, i64 2
  %241 = load i64, ptr %240, align 16, !tbaa !9
  %242 = add nsw i64 %241, %119
  store i64 %242, ptr %11, align 8, !tbaa !9
  %243 = icmp slt i64 %242, 10000000000007
  br i1 %243, label %244, label %246

244:                                              ; preds = %236
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #7
  call void @_ZNSt5tupleIJxiiEEC2IJRxRiS3_ELb1ETnNSt9enable_ifIXclsr4_TCCIXT0_EEE29__is_implicitly_constructibleIDpT_EEEbE4typeELb1EEEDpOS5_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10) #7
  invoke void @_ZNSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %6, ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %245 unwind label %176

245:                                              ; preds = %244
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #7
  br label %246

246:                                              ; preds = %245, %236
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  br label %.preheader.3

.preheader.3:                                     ; preds = %246, %228, %222, %216, %.preheader.2
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %247 = add nsw i32 %115, %122
  store i32 %247, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  %248 = add nsw i32 %116, %125
  store i32 %248, ptr %10, align 4, !tbaa !5
  %249 = icmp sgt i32 %247, -1
  br i1 %249, label %250, label %.loopexit.loopexit

250:                                              ; preds = %.preheader.3
  %251 = load i32, ptr @N, align 4, !tbaa !5
  %252 = icmp slt i32 %247, %251
  %253 = icmp sgt i32 %248, -1
  %or.cond.3 = select i1 %252, i1 %253, i1 false
  %254 = load i32, ptr @M, align 4
  %255 = icmp slt i32 %248, %254
  %or.cond81.3 = select i1 %or.cond.3, i1 %255, i1 false
  br i1 %or.cond81.3, label %256, label %.loopexit.loopexit

256:                                              ; preds = %250
  %257 = zext nneg i32 %247 to i64
  %258 = getelementptr inbounds [1010 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %257
  %259 = zext nneg i32 %248 to i64
  %260 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %258, i64 noundef %259)
  %261 = load i8, ptr %260, align 1, !tbaa !13
  %.not.3 = icmp eq i8 %261, 35
  br i1 %.not.3, label %.loopexit.loopexit, label %262

262:                                              ; preds = %256
  %263 = load i32, ptr %9, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = load i32, ptr %10, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [1010 x [1010 x i64]], ptr @ans, i64 0, i64 %264, i64 %266
  %268 = load i64, ptr %267, align 8, !tbaa !9
  %269 = icmp eq i64 %268, -1
  br i1 %269, label %270, label %.loopexit.loopexit

270:                                              ; preds = %262
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %271 = load i32, ptr @K, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = srem i64 %119, %272
  %274 = getelementptr inbounds [300010 x [4 x i64]], ptr @dist, i64 0, i64 %273, i64 3
  %275 = load i64, ptr %274, align 8, !tbaa !9
  %276 = add nsw i64 %275, %119
  store i64 %276, ptr %11, align 8, !tbaa !9
  %277 = icmp slt i64 %276, 10000000000007
  br i1 %277, label %278, label %280

278:                                              ; preds = %270
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #7
  call void @_ZNSt5tupleIJxiiEEC2IJRxRiS3_ELb1ETnNSt9enable_ifIXclsr4_TCCIXT0_EEE29__is_implicitly_constructibleIDpT_EEEbE4typeELb1EEEDpOS5_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10) #7
  invoke void @_ZNSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %6, ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %279 unwind label %176

279:                                              ; preds = %278
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #7
  br label %280

280:                                              ; preds = %279, %270
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  br label %.loopexit.loopexit

.loopexit.loopexit:                               ; preds = %280, %262, %256, %250, %.preheader.3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %126
  %281 = call noundef zeroext i1 @_ZNKSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %6)
  br i1 %281, label %._crit_edge111, label %.lr.ph110, !llvm.loop !18

._crit_edge111:                                   ; preds = %.loopexit, %107
  %282 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
          to label %283 unwind label %144

283:                                              ; preds = %._crit_edge111
  %284 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %282, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %.critedge unwind label %144

.critedge:                                        ; preds = %140, %283
  call void @_ZNSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  ret i32 0

285:                                              ; preds = %.loopexit82, %.loopexit.split-lp, %176, %144, %142
  %.pn.pn = phi { ptr, i32 } [ %145, %144 ], [ %143, %142 ], [ %177, %176 ], [ %lpad.loopexit, %.loopexit82 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br label %286

286:                                              ; preds = %285, %29
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %285 ], [ %30, %29 ]
  resume { ptr, i32 } %.pn.pn.pn
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEOS8_RKS8_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm2EJxiiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt5tupleIJxiiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #5 align 2

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

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

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

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

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

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

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

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

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


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