; LLVM IR from kazunetakahashi/atcoder :: 2019/0120_ABC116 (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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::tuple<long long, int>, std::allocator<std::tuple<long long, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::tuple<long long, int>, std::allocator<std::tuple<long long, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::tuple<long long, int>, std::allocator<std::tuple<long long, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::tuple<long long, int>, std::allocator<std::tuple<long long, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::priority_queue" = type <{ %"class.std::vector", [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::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.1" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i32 }
%"struct.std::_Head_base.1" = type { i64 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@N = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@t = external dso_local global [100010 x i32], align 16
@d = external dso_local global [100010 x i64], align 16
@V = external dso_local global %"class.std::vector", align 8
@Q = external dso_local global %"class.std::priority_queue", align 8
@cnt = external dso_local global [100010 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::tuple", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  %22 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %23 = 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)
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 4 dereferenceable(4) @K)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %50, %0
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = load i32, ptr @N, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %30, label %29

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

30:                                               ; preds = %25
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [100010 x i32], ptr @t, i64 0, i64 %32
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %33)
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [100010 x i64], ptr @d, i64 0, i64 %36
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %34, ptr noundef nonnull align 8 dereferenceable(8) %37)
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [100010 x i32], ptr @t, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = add nsw i32 %42, -1
  store i32 %43, ptr %41, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #7
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100010 x i64], ptr @d, i64 0, i64 %45
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [100010 x i32], ptr @t, i64 0, i64 %48
  call void @_ZNSt5tupleIJxiEEC2IRxRiTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS5_T0_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull align 4 dereferenceable(4) %49) #7
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @V, ptr noundef nonnull align 8 dereferenceable(16) %3)
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #7
  br label %50

50:                                               ; preds = %30
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %2, align 4, !tbaa !5
  br label %25, !llvm.loop !9

53:                                               ; preds = %29
  %54 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #7
  %55 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  store ptr %54, ptr %55, align 8
  %56 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #7
  %57 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  store ptr %56, ptr %57, align 8
  %58 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8
  %60 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %59, ptr %61)
  %62 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #7
  %63 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  store ptr %62, ptr %63, align 8
  %64 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #7
  %65 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %64, ptr %65, align 8
  %66 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8
  %68 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  %69 = load ptr, ptr %68, align 8
  call void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %67, ptr %69)
  %70 = load i32, ptr @N, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds i32, ptr @cnt, i64 %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @cnt, ptr noundef %72, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 0, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 0, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %100, %53
  %74 = load i32, ptr %11, align 4, !tbaa !5
  %75 = load i32, ptr @K, align 4, !tbaa !5
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %103

78:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %79 = load i32, ptr %11, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @V, i64 noundef %80) #7
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %81) #7
  %83 = load i64, ptr %82, align 8, !tbaa !11
  store i64 %83, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %84 = load i32, ptr %11, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @V, i64 noundef %85) #7
  %87 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %86) #7
  %88 = load i32, ptr %87, align 4, !tbaa !5
  store i32 %88, ptr %13, align 4, !tbaa !5
  %89 = load i64, ptr %12, align 8, !tbaa !11
  %90 = load i64, ptr %10, align 8, !tbaa !11
  %91 = add nsw i64 %90, %89
  store i64 %91, ptr %10, align 8, !tbaa !11
  %92 = load i32, ptr %13, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [100010 x i32], ptr @cnt, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %94, align 4, !tbaa !5
  %97 = load i32, ptr %11, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @V, i64 noundef %98) #7
  call void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(16) %99)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %100

100:                                              ; preds = %78
  %101 = load i32, ptr %11, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %11, align 4, !tbaa !5
  br label %73, !llvm.loop !13

103:                                              ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store i64 0, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %119, %103
  %105 = load i32, ptr %15, align 4, !tbaa !5
  %106 = load i32, ptr @N, align 4, !tbaa !5
  %107 = icmp slt i32 %105, %106
  br i1 %107, label %109, label %108

108:                                              ; preds = %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %122

109:                                              ; preds = %104
  %110 = load i32, ptr %15, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [100010 x i32], ptr @cnt, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = icmp sgt i32 %113, 0
  br i1 %114, label %115, label %118

115:                                              ; preds = %109
  %116 = load i64, ptr %14, align 8, !tbaa !11
  %117 = add nsw i64 %116, 1
  store i64 %117, ptr %14, align 8, !tbaa !11
  br label %118

118:                                              ; preds = %115, %109
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %15, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %15, align 4, !tbaa !5
  br label %104, !llvm.loop !14

122:                                              ; preds = %108
  %123 = load i64, ptr %10, align 8, !tbaa !11
  %124 = load i64, ptr %14, align 8, !tbaa !11
  %125 = load i64, ptr %14, align 8, !tbaa !11
  %126 = mul nsw i64 %124, %125
  %127 = add nsw i64 %123, %126
  store i64 %127, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %128 = load i32, ptr @K, align 4, !tbaa !5
  store i32 %128, ptr %16, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %198, %122
  %130 = load i32, ptr %16, align 4, !tbaa !5
  %131 = load i32, ptr @N, align 4, !tbaa !5
  %132 = icmp slt i32 %130, %131
  br i1 %132, label %134, label %133

133:                                              ; preds = %129
  store i32 11, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %201

134:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %135 = load i32, ptr %16, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @V, i64 noundef %136) #7
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %137) #7
  %139 = load i64, ptr %138, align 8, !tbaa !11
  store i64 %139, ptr %18, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %140 = load i32, ptr %16, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @V, i64 noundef %141) #7
  %143 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %142) #7
  %144 = load i32, ptr %143, align 4, !tbaa !5
  store i32 %144, ptr %19, align 4, !tbaa !5
  %145 = load i32, ptr %19, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [100010 x i32], ptr @cnt, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = icmp eq i32 %148, 0
  br i1 %149, label %150, label %197

150:                                              ; preds = %134
  br label %151

151:                                              ; preds = %195, %150
  %152 = call noundef zeroext i1 @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %153 = xor i1 %152, true
  br i1 %153, label %154, label %196

154:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %155 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %156 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %155) #7
  %157 = load i64, ptr %156, align 8, !tbaa !11
  store i64 %157, ptr %20, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %158 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %159 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %158) #7
  %160 = load i32, ptr %159, align 4, !tbaa !5
  store i32 %160, ptr %21, align 4, !tbaa !5
  call void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %161 = load i32, ptr %21, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [100010 x i32], ptr @cnt, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = icmp sge i32 %164, 2
  br i1 %165, label %166, label %192

166:                                              ; preds = %154
  %167 = load i32, ptr %21, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [100010 x i32], ptr @cnt, i64 0, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = add nsw i32 %170, -1
  store i32 %171, ptr %169, align 4, !tbaa !5
  %172 = load i64, ptr %20, align 8, !tbaa !11
  %173 = load i64, ptr %10, align 8, !tbaa !11
  %174 = sub nsw i64 %173, %172
  store i64 %174, ptr %10, align 8, !tbaa !11
  %175 = load i32, ptr %19, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [100010 x i32], ptr @cnt, i64 0, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %177, align 4, !tbaa !5
  %180 = load i64, ptr %18, align 8, !tbaa !11
  %181 = load i64, ptr %10, align 8, !tbaa !11
  %182 = add nsw i64 %181, %180
  store i64 %182, ptr %10, align 8, !tbaa !11
  %183 = load i64, ptr %14, align 8, !tbaa !11
  %184 = add nsw i64 %183, 1
  store i64 %184, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %185 = load i64, ptr %10, align 8, !tbaa !11
  %186 = load i64, ptr %14, align 8, !tbaa !11
  %187 = load i64, ptr %14, align 8, !tbaa !11
  %188 = mul nsw i64 %186, %187
  %189 = add nsw i64 %185, %188
  store i64 %189, ptr %22, align 8, !tbaa !11
  %190 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %22)
  %191 = load i64, ptr %190, align 8, !tbaa !11
  store i64 %191, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  store i32 15, ptr %17, align 4
  br label %193

192:                                              ; preds = %154
  store i32 0, ptr %17, align 4
  br label %193

193:                                              ; preds = %192, %166
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  %194 = load i32, ptr %17, align 4
  switch i32 %194, label %206 [
    i32 0, label %195
    i32 15, label %196
  ]

195:                                              ; preds = %193
  br label %151, !llvm.loop !15

196:                                              ; preds = %193, %151
  br label %197

197:                                              ; preds = %196, %134
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %198

198:                                              ; preds = %197
  %199 = load i32, ptr %16, align 4, !tbaa !5
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %16, align 4, !tbaa !5
  br label %129, !llvm.loop !16

201:                                              ; preds = %133
  %202 = load i64, ptr %9, align 8, !tbaa !11
  %203 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %202)
  %204 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %203, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  %205 = load i32, ptr %1, align 4
  ret i32 %205

206:                                              ; preds = %193
  unreachable
}

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr, ptr) #5

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr, ptr) #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #4 align 2

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

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

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

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::tuple<long long, int>, std::allocator<std::tuple<long long, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::tuple<long long, int>, std::allocator<std::tuple<long long, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::tuple<long long, int>, std::allocator<std::tuple<long long, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::tuple<long long, int>, std::allocator<std::tuple<long long, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::priority_queue" = type <{ %"class.std::vector", [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::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.1" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i32 }
%"struct.std::_Head_base.1" = type { i64 }

@N = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@t = external dso_local global [100010 x i32], align 16
@d = external dso_local global [100010 x i64], align 16
@V = external dso_local global %"class.std::vector", align 8
@Q = external dso_local global %"class.std::priority_queue", align 8
@cnt = external dso_local global [100010 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %"class.std::tuple", align 8
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = 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)
  %6 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(4) @K)
  %7 = load i32, ptr @N, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %9 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #8
  %10 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %9, ptr %10)
  %11 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #8
  %12 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #8
  call void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %11, ptr %12)
  %13 = load i32, ptr @N, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds i32, ptr @cnt, i64 %14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @cnt, ptr noundef nonnull %15, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %16 = load i32, ptr @K, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph66, label %.preheader58

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %18 = getelementptr inbounds [100010 x i32], ptr @t, i64 0, i64 %indvars.iv
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %20 = getelementptr inbounds [100010 x i64], ptr @d, i64 0, i64 %indvars.iv
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(8) %20)
  %22 = load i32, ptr %18, align 4, !tbaa !5
  %23 = add nsw i32 %22, -1
  store i32 %23, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #8
  call void @_ZNSt5tupleIJxiEEC2IRxRiTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS5_T0_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 4 dereferenceable(4) %18) #8
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @V, ptr noundef nonnull align 8 dereferenceable(16) %1)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %24 = load i32, ptr @N, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = icmp slt i64 %indvars.iv.next, %25
  br i1 %26, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader58:                                     ; preds = %.lr.ph66, %._crit_edge
  %.043.lcssa = phi i64 [ 0, %._crit_edge ], [ %45, %.lr.ph66 ]
  %.lcssa61 = phi i32 [ %16, %._crit_edge ], [ %51, %.lr.ph66 ]
  %27 = load i32, ptr @N, align 4, !tbaa !5
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph70.preheader, label %._crit_edge71

.lr.ph70.preheader:                               ; preds = %.preheader58
  %wide.trip.count = zext nneg i32 %27 to i64
  %min.iters.check = icmp ult i32 %27, 4
  br i1 %min.iters.check, label %.lr.ph70.preheader107, label %vector.ph

.lr.ph70.preheader107:                            ; preds = %middle.block, %.lr.ph70.preheader
  %indvars.iv88.ph = phi i64 [ 0, %.lr.ph70.preheader ], [ %n.vec, %middle.block ]
  %.04569.ph = phi i64 [ 0, %.lr.ph70.preheader ], [ %38, %middle.block ]
  br label %.lr.ph70

vector.ph:                                        ; preds = %.lr.ph70.preheader
  %n.vec = and i64 %wide.trip.count, 2147483644
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %35, %vector.body ]
  %vec.phi103 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %36, %vector.body ]
  %29 = getelementptr inbounds [100010 x i32], ptr @cnt, i64 0, i64 %index
  %30 = getelementptr inbounds i8, ptr %29, i64 8
  %wide.load = load <2 x i32>, ptr %29, align 16, !tbaa !5
  %wide.load104 = load <2 x i32>, ptr %30, align 8, !tbaa !5
  %31 = icmp sgt <2 x i32> %wide.load, zeroinitializer
  %32 = icmp sgt <2 x i32> %wide.load104, zeroinitializer
  %33 = zext <2 x i1> %31 to <2 x i64>
  %34 = zext <2 x i1> %32 to <2 x i64>
  %35 = add <2 x i64> %vec.phi, %33
  %36 = add <2 x i64> %vec.phi103, %34
  %index.next = add nuw i64 %index, 4
  %37 = icmp eq i64 %index.next, %n.vec
  br i1 %37, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %36, %35
  %38 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge71, label %.lr.ph70.preheader107

.lr.ph66:                                         ; preds = %._crit_edge, %.lr.ph66
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %.lr.ph66 ], [ 0, %._crit_edge ]
  %.04364 = phi i64 [ %45, %.lr.ph66 ], [ 0, %._crit_edge ]
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @V, i64 noundef %indvars.iv85) #8
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %39) #8
  %41 = load i64, ptr %40, align 8, !tbaa !14
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @V, i64 noundef %indvars.iv85) #8
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %42) #8
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = add nsw i64 %41, %.04364
  %46 = sext i32 %44 to i64
  %47 = getelementptr inbounds [100010 x i32], ptr @cnt, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %47, align 4, !tbaa !5
  %50 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @V, i64 noundef %indvars.iv85) #8
  call void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(16) %50)
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %51 = load i32, ptr @K, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = icmp slt i64 %indvars.iv.next86, %52
  br i1 %53, label %.lr.ph66, label %.preheader58, !llvm.loop !16

._crit_edge71:                                    ; preds = %.lr.ph70, %middle.block, %.preheader58
  %.045.lcssa = phi i64 [ 0, %.preheader58 ], [ %38, %middle.block ], [ %spec.select, %.lr.ph70 ]
  %54 = mul nsw i64 %.045.lcssa, %.045.lcssa
  %55 = add nsw i64 %54, %.043.lcssa
  store i64 %55, ptr %3, align 8, !tbaa !14
  %56 = icmp slt i32 %.lcssa61, %27
  br i1 %56, label %.lr.ph78.preheader, label %._crit_edge79

.lr.ph78.preheader:                               ; preds = %._crit_edge71
  %57 = sext i32 %.lcssa61 to i64
  br label %.lr.ph78

.lr.ph70:                                         ; preds = %.lr.ph70.preheader107, %.lr.ph70
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %.lr.ph70 ], [ %indvars.iv88.ph, %.lr.ph70.preheader107 ]
  %.04569 = phi i64 [ %spec.select, %.lr.ph70 ], [ %.04569.ph, %.lr.ph70.preheader107 ]
  %58 = getelementptr inbounds [100010 x i32], ptr @cnt, i64 0, i64 %indvars.iv88
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = icmp sgt i32 %59, 0
  %61 = zext i1 %60 to i64
  %spec.select = add nuw nsw i64 %.04569, %61
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge71, label %.lr.ph70, !llvm.loop !17

._crit_edge79.loopexit:                           ; preds = %.loopexit
  %.pre = load i64, ptr %3, align 8, !tbaa !14
  br label %._crit_edge79

._crit_edge79:                                    ; preds = %._crit_edge79.loopexit, %._crit_edge71
  %62 = phi i64 [ %.pre, %._crit_edge79.loopexit ], [ %55, %._crit_edge71 ]
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %62)
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  ret i32 0

.lr.ph78:                                         ; preds = %.lr.ph78.preheader, %.loopexit
  %indvars.iv91 = phi i64 [ %57, %.lr.ph78.preheader ], [ %indvars.iv.next92, %.loopexit ]
  %.176 = phi i64 [ %.043.lcssa, %.lr.ph78.preheader ], [ %.4, %.loopexit ]
  %.24775 = phi i64 [ %.045.lcssa, %.lr.ph78.preheader ], [ %.5, %.loopexit ]
  %65 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @V, i64 noundef %indvars.iv91) #8
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %65) #8
  %67 = load i64, ptr %66, align 8, !tbaa !14
  %68 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @V, i64 noundef %indvars.iv91) #8
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %68) #8
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [100010 x i32], ptr @cnt, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = icmp eq i32 %73, 0
  br i1 %74, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %.lr.ph78, %76
  %75 = call noundef zeroext i1 @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %75, label %.loopexit, label %76

76:                                               ; preds = %.preheader
  %77 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %77) #8
  %79 = load i64, ptr %78, align 8, !tbaa !14
  %80 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %81 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %80) #8
  %82 = load i32, ptr %81, align 4, !tbaa !5
  call void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [100010 x i32], ptr @cnt, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = icmp sgt i32 %85, 1
  br i1 %86, label %.thread, label %.preheader

.thread:                                          ; preds = %76
  %87 = getelementptr inbounds [100010 x i32], ptr @cnt, i64 0, i64 %83
  %88 = add nsw i32 %85, -1
  store i32 %88, ptr %87, align 4, !tbaa !5
  %89 = sub nsw i64 %.176, %79
  %90 = load i32, ptr %72, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %72, align 4, !tbaa !5
  %92 = add nsw i64 %89, %67
  %93 = add nsw i64 %.24775, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %94 = mul nsw i64 %93, %93
  %95 = add nsw i64 %92, %94
  store i64 %95, ptr %4, align 8, !tbaa !14
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %97 = load i64, ptr %96, align 8, !tbaa !14
  store i64 %97, ptr %3, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader, %.thread, %.lr.ph78
  %.5 = phi i64 [ %.24775, %.lr.ph78 ], [ %93, %.thread ], [ %.24775, %.preheader ]
  %.4 = phi i64 [ %.176, %.lr.ph78 ], [ %92, %.thread ], [ %.176, %.preheader ]
  %indvars.iv.next92 = add nsw i64 %indvars.iv91, 1
  %98 = load i32, ptr @N, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = icmp slt i64 %indvars.iv.next92, %99
  br i1 %100, label %.lr.ph78, label %._crit_edge79.loopexit, !llvm.loop !18
}

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 #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr, ptr) local_unnamed_addr #5

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr, ptr) local_unnamed_addr #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #4 align 2

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

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

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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #7

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !13, !12}
!18 = distinct !{!18, !10}


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