; LLVM IR from kazunetakahashi/atcoder :: 2018/0707_soundhound2018-summer-qual (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
@M = external dso_local global i32, align 4
@S = external dso_local global [2 x i32], align 4
@V = external dso_local global [2 x [100010 x %"class.std::vector"]], align 16
@Q = external dso_local global [2 x %"class.std::priority_queue"], align 16
@dist = external dso_local global [2 x [100010 x i64]], align 16
@ans = external dso_local global [100010 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::tuple", align 8
  %8 = alloca %"class.std::tuple", align 8
  %9 = alloca %"class.std::tuple", align 8
  %10 = alloca %"class.std::tuple", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::tuple", align 8
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"class.std::tuple", align 8
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  %24 = alloca %"class.std::tuple", align 8
  %25 = alloca i64, align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i64, align 8
  %29 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %30 = 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)
  %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) @M)
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 4 dereferenceable(4) @S)
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds ([2 x i32], ptr @S, i64 0, i64 1))
  %34 = load i32, ptr @S, align 4, !tbaa !5
  %35 = add nsw i32 %34, -1
  store i32 %35, ptr @S, align 4, !tbaa !5
  %36 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @S, i64 0, i64 1), align 4, !tbaa !5
  %37 = add nsw i32 %36, -1
  store i32 %37, ptr getelementptr inbounds ([2 x i32], ptr @S, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %64, %0
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = load i32, ptr @M, align 4, !tbaa !5
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %67

43:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %44, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %45, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %46, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = add nsw i32 %48, -1
  store i32 %49, ptr %3, align 4, !tbaa !5
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = add nsw i32 %50, -1
  store i32 %51, ptr %4, align 4, !tbaa !5
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %53
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #8
  call void @_ZNSt5tupleIJxiEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %4) #8
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %54, ptr noundef nonnull align 8 dereferenceable(16) %7)
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #8
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %56
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #8
  call void @_ZNSt5tupleIJxiEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %3) #8
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %57, ptr noundef nonnull align 8 dereferenceable(16) %8)
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #8
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [100010 x %"class.std::vector"], ptr getelementptr inbounds ([2 x [100010 x %"class.std::vector"]], ptr @V, i64 0, i64 1), i64 0, i64 %59
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #8
  call void @_ZNSt5tupleIJxiEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %3) #8
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %60, ptr noundef nonnull align 8 dereferenceable(16) %9)
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #8
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100010 x %"class.std::vector"], ptr getelementptr inbounds ([2 x [100010 x %"class.std::vector"]], ptr @V, i64 0, i64 1), i64 0, i64 %62
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #8
  call void @_ZNSt5tupleIJxiEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %4) #8
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %63, ptr noundef nonnull align 8 dereferenceable(16) %10)
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %64

64:                                               ; preds = %43
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %2, align 4, !tbaa !5
  br label %38, !llvm.loop !9

67:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 -1, ptr %11, align 4, !tbaa !5
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @dist, ptr noundef getelementptr inbounds (i64, ptr @dist, i64 200020), ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %159, %67
  %69 = load i32, ptr %12, align 4, !tbaa !5
  %70 = icmp slt i32 %69, 2
  br i1 %70, label %72, label %71

71:                                               ; preds = %68
  store i32 5, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %162

72:                                               ; preds = %68
  %73 = load i32, ptr %12, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [2 x %"class.std::priority_queue"], ptr @Q, i64 0, i64 %74
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !5
  %76 = load i32, ptr %12, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [2 x i32], ptr @S, i64 0, i64 %77
  call void @_ZNSt5tupleIJxiEEC2IiRiTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %78) #8
  call void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %75, ptr noundef nonnull align 8 dereferenceable(16) %14)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #8
  br label %79

79:                                               ; preds = %157, %72
  %80 = load i32, ptr %12, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [2 x %"class.std::priority_queue"], ptr @Q, i64 0, i64 %81
  %83 = call noundef zeroext i1 @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %82)
  %84 = xor i1 %83, true
  br i1 %84, label %85, label %158

85:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %86 = load i32, ptr %12, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [2 x %"class.std::priority_queue"], ptr @Q, i64 0, i64 %87
  %89 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %88)
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %89) #8
  %91 = load i64, ptr %90, align 8, !tbaa !11
  store i64 %91, ptr %16, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %92 = load i32, ptr %12, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [2 x %"class.std::priority_queue"], ptr @Q, i64 0, i64 %93
  %95 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %94)
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %95) #8
  %97 = load i32, ptr %96, align 4, !tbaa !5
  store i32 %97, ptr %17, align 4, !tbaa !5
  %98 = load i32, ptr %12, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [2 x %"class.std::priority_queue"], ptr @Q, i64 0, i64 %99
  call void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %100)
  %101 = load i32, ptr %12, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [2 x [100010 x i64]], ptr @dist, i64 0, i64 %102
  %104 = load i32, ptr %17, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [100010 x i64], ptr %103, i64 0, i64 %105
  %107 = load i64, ptr %106, align 8, !tbaa !11
  %108 = icmp eq i64 %107, -1
  br i1 %108, label %109, label %157

109:                                              ; preds = %85
  %110 = load i64, ptr %16, align 8, !tbaa !11
  %111 = load i32, ptr %12, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [2 x [100010 x i64]], ptr @dist, i64 0, i64 %112
  %114 = load i32, ptr %17, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [100010 x i64], ptr %113, i64 0, i64 %115
  store i64 %110, ptr %116, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %117 = load i32, ptr %12, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [2 x [100010 x %"class.std::vector"]], ptr @V, i64 0, i64 %118
  %120 = load i32, ptr %17, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [100010 x %"class.std::vector"], ptr %119, i64 0, i64 %121
  store ptr %122, ptr %18, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %123 = load ptr, ptr %18, align 8, !tbaa !13
  %124 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %123) #8
  %125 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %124, ptr %125, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %126 = load ptr, ptr %18, align 8, !tbaa !13
  %127 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %126) #8
  %128 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %127, ptr %128, align 8
  br label %129

129:                                              ; preds = %154, %109
  %130 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20) #8
  br i1 %130, label %132, label %131

131:                                              ; preds = %129
  store i32 10, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %156

132:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #8
  %133 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %133, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %21) #8
  %135 = load i64, ptr %134, align 8, !tbaa !11
  store i64 %135, ptr %22, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %136 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %21) #8
  %137 = load i32, ptr %136, align 4, !tbaa !5
  store i32 %137, ptr %23, align 4, !tbaa !5
  %138 = load i32, ptr %12, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [2 x [100010 x i64]], ptr @dist, i64 0, i64 %139
  %141 = load i32, ptr %23, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [100010 x i64], ptr %140, i64 0, i64 %142
  %144 = load i64, ptr %143, align 8, !tbaa !11
  %145 = icmp eq i64 %144, -1
  br i1 %145, label %146, label %153

146:                                              ; preds = %132
  %147 = load i32, ptr %12, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [2 x %"class.std::priority_queue"], ptr @Q, i64 0, i64 %148
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %150 = load i64, ptr %16, align 8, !tbaa !11
  %151 = load i64, ptr %22, align 8, !tbaa !11
  %152 = add nsw i64 %150, %151
  store i64 %152, ptr %25, align 8, !tbaa !11
  call void @_ZNSt5tupleIJxiEEC2IxRiTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 4 dereferenceable(4) %23) #8
  call void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %149, ptr noundef nonnull align 8 dereferenceable(16) %24)
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #8
  br label %153

153:                                              ; preds = %146, %132
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #8
  br label %154

154:                                              ; preds = %153
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #8
  br label %129

156:                                              ; preds = %131
  br label %157

157:                                              ; preds = %156, %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br label %79, !llvm.loop !15

158:                                              ; preds = %79
  br label %159

159:                                              ; preds = %158
  %160 = load i32, ptr %12, align 4, !tbaa !5
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %12, align 4, !tbaa !5
  br label %68, !llvm.loop !16

162:                                              ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %163

163:                                              ; preds = %181, %162
  %164 = load i32, ptr %26, align 4, !tbaa !5
  %165 = load i32, ptr @N, align 4, !tbaa !5
  %166 = icmp slt i32 %164, %165
  br i1 %166, label %168, label %167

167:                                              ; preds = %163
  store i32 12, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  br label %184

168:                                              ; preds = %163
  %169 = load i32, ptr %26, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [100010 x i64], ptr @dist, i64 0, i64 %170
  %172 = load i64, ptr %171, align 8, !tbaa !11
  %173 = load i32, ptr %26, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [100010 x i64], ptr getelementptr inbounds ([2 x [100010 x i64]], ptr @dist, i64 0, i64 1), i64 0, i64 %174
  %176 = load i64, ptr %175, align 8, !tbaa !11
  %177 = add nsw i64 %172, %176
  %178 = load i32, ptr %26, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %179
  store i64 %177, ptr %180, align 8, !tbaa !11
  br label %181

181:                                              ; preds = %168
  %182 = load i32, ptr %26, align 4, !tbaa !5
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %26, align 4, !tbaa !5
  br label %163, !llvm.loop !17

184:                                              ; preds = %167
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  %185 = load i32, ptr @N, align 4, !tbaa !5
  %186 = sub nsw i32 %185, 1
  store i32 %186, ptr %27, align 4, !tbaa !5
  br label %187

187:                                              ; preds = %205, %184
  %188 = load i32, ptr %27, align 4, !tbaa !5
  %189 = icmp sge i32 %188, 1
  br i1 %189, label %191, label %190

190:                                              ; preds = %187
  store i32 15, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %208

191:                                              ; preds = %187
  %192 = load i32, ptr %27, align 4, !tbaa !5
  %193 = sub nsw i32 %192, 1
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %194
  %196 = load i32, ptr %27, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %197
  %199 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %195, ptr noundef nonnull align 8 dereferenceable(8) %198)
  %200 = load i64, ptr %199, align 8, !tbaa !11
  %201 = load i32, ptr %27, align 4, !tbaa !5
  %202 = sub nsw i32 %201, 1
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %203
  store i64 %200, ptr %204, align 8, !tbaa !11
  br label %205

205:                                              ; preds = %191
  %206 = load i32, ptr %27, align 4, !tbaa !5
  %207 = add nsw i32 %206, -1
  store i32 %207, ptr %27, align 4, !tbaa !5
  br label %187, !llvm.loop !18

208:                                              ; preds = %190
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  store i64 1000000000000000, ptr %28, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  store i32 0, ptr %29, align 4, !tbaa !5
  br label %209

209:                                              ; preds = %223, %208
  %210 = load i32, ptr %29, align 4, !tbaa !5
  %211 = load i32, ptr @N, align 4, !tbaa !5
  %212 = icmp slt i32 %210, %211
  br i1 %212, label %214, label %213

213:                                              ; preds = %209
  store i32 18, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %226

214:                                              ; preds = %209
  %215 = load i64, ptr %28, align 8, !tbaa !11
  %216 = load i32, ptr %29, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %217
  %219 = load i64, ptr %218, align 8, !tbaa !11
  %220 = sub nsw i64 %215, %219
  %221 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %220)
  %222 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %221, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %223

223:                                              ; preds = %214
  %224 = load i32, ptr %29, align 4, !tbaa !5
  %225 = add nsw i32 %224, 1
  store i32 %225, ptr %29, align 4, !tbaa !5
  br label %209, !llvm.loop !19

226:                                              ; preds = %213
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  %227 = load i32, ptr %1, align 4
  ret i32 %227
}

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 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 @_ZNSt5tupleIJxiEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), 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 @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(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 void @_ZNSt5tupleIJxiEEC2IiRiTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #4 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: 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #6

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

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

; 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 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16)) #4

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !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 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@S = external dso_local global [2 x i32], align 4
@V = external dso_local global [2 x [100010 x %"class.std::vector"]], align 16
@Q = external dso_local global [2 x %"class.std::priority_queue"], align 16
@dist = external dso_local global [2 x [100010 x i64]], align 16
@ans = external dso_local global [100010 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::tuple", align 8
  %6 = alloca %"class.std::tuple", align 8
  %7 = alloca %"class.std::tuple", align 8
  %8 = alloca %"class.std::tuple", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.std::tuple", align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"class.std::tuple", align 8
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::tuple", align 8
  %17 = alloca i64, align 8
  %18 = 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)
  %19 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 4 dereferenceable(4) @M)
  %20 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(4) @S)
  %21 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @S, i64 4))
  %22 = load <2 x i32>, ptr @S, align 4, !tbaa !5
  %23 = add nsw <2 x i32> %22, <i32 -1, i32 -1>
  store <2 x i32> %23, ptr @S, align 4, !tbaa !5
  %24 = load i32, ptr @M, align 4, !tbaa !5
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  store i32 -1, ptr %9, align 4, !tbaa !5
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @dist, ptr noundef nonnull getelementptr inbounds (i8, ptr @dist, i64 1600160), ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #8
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @_ZNSt5tupleIJxiEEC2IiRiTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) @S) #8
  call void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(16) %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #8
  %26 = call noundef zeroext i1 @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %26, label %._crit_edge50, label %.lr.ph49

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.03744 = phi i32 [ %46, %.lr.ph ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %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) %4)
  %31 = load i32, ptr %1, align 4, !tbaa !5
  %32 = add nsw i32 %31, -1
  store i32 %32, ptr %1, align 4, !tbaa !5
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = add nsw i32 %33, -1
  store i32 %34, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %32 to i64
  %36 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %35
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #8
  call void @_ZNSt5tupleIJxiEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %2) #8
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %38
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #8
  call void @_ZNSt5tupleIJxiEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %1) #8
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %39, ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #8
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [100010 x %"class.std::vector"], ptr getelementptr inbounds (i8, ptr @V, i64 2400240), i64 0, i64 %41
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #8
  call void @_ZNSt5tupleIJxiEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %1) #8
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %42, ptr noundef nonnull align 8 dereferenceable(16) %7)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #8
  %43 = load i32, ptr %1, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100010 x %"class.std::vector"], ptr getelementptr inbounds (i8, ptr @V, i64 2400240), i64 0, i64 %44
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #8
  call void @_ZNSt5tupleIJxiEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %2) #8
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %45, ptr noundef nonnull align 8 dereferenceable(16) %8)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %46 = add nuw nsw i32 %.03744, 1
  %47 = load i32, ptr @M, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.lr.ph53.preheader:                               ; preds = %._crit_edge50.1
  %wide.trip.count = zext nneg i32 %121 to i64
  %min.iters.check = icmp ult i32 %121, 4
  br i1 %min.iters.check, label %.lr.ph53.preheader70, label %vector.ph

.lr.ph53.preheader70:                             ; preds = %middle.block, %.lr.ph53.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph53.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph53

vector.ph:                                        ; preds = %.lr.ph53.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 ]
  %49 = getelementptr inbounds [100010 x i64], ptr @dist, i64 0, i64 %index
  %50 = getelementptr inbounds i8, ptr %49, i64 16
  %wide.load = load <2 x i64>, ptr %49, align 16, !tbaa !11
  %wide.load67 = load <2 x i64>, ptr %50, align 16, !tbaa !11
  %51 = getelementptr inbounds [100010 x i64], ptr getelementptr inbounds (i8, ptr @dist, i64 800080), i64 0, i64 %index
  %52 = getelementptr inbounds i8, ptr %51, i64 16
  %wide.load68 = load <2 x i64>, ptr %51, align 16, !tbaa !11
  %wide.load69 = load <2 x i64>, ptr %52, align 16, !tbaa !11
  %53 = add nsw <2 x i64> %wide.load68, %wide.load
  %54 = add nsw <2 x i64> %wide.load69, %wide.load67
  %55 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %index
  %56 = getelementptr inbounds i8, ptr %55, i64 16
  store <2 x i64> %53, ptr %55, align 16, !tbaa !11
  store <2 x i64> %54, ptr %56, align 16, !tbaa !11
  %index.next = add nuw i64 %index, 4
  %57 = icmp eq i64 %index.next, %n.vec
  br i1 %57, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader42, label %.lr.ph53.preheader70

.lr.ph49:                                         ; preds = %._crit_edge, %87
  %58 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %58) #8
  %60 = load i64, ptr %59, align 8, !tbaa !11
  %61 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %61) #8
  %63 = load i32, ptr %62, align 4, !tbaa !5
  call void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [2 x [100010 x i64]], ptr @dist, i64 0, i64 0, i64 %64
  %66 = load i64, ptr %65, align 8, !tbaa !11
  %67 = icmp eq i64 %66, -1
  br i1 %67, label %68, label %87

68:                                               ; preds = %.lr.ph49
  store i64 %60, ptr %65, align 8, !tbaa !11
  %69 = getelementptr inbounds [2 x [100010 x %"class.std::vector"]], ptr @V, i64 0, i64 0, i64 %64
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #8
  %70 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %69) #8
  store ptr %70, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #8
  %71 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %69) #8
  store ptr %71, ptr %13, align 8
  %72 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #8
  br i1 %72, label %.lr.ph46, label %._crit_edge47

._crit_edge47:                                    ; preds = %84, %68
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  br label %87

.lr.ph46:                                         ; preds = %68, %84
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #8
  %73 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %73, i64 16, i1 false)
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %14) #8
  %75 = load i64, ptr %74, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #8
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %14) #8
  %77 = load i32, ptr %76, align 4, !tbaa !5
  store i32 %77, ptr %15, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [2 x [100010 x i64]], ptr @dist, i64 0, i64 0, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !11
  %81 = icmp eq i64 %80, -1
  br i1 %81, label %82, label %84

82:                                               ; preds = %.lr.ph46
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #8
  %83 = add nsw i64 %75, %60
  store i64 %83, ptr %17, align 8, !tbaa !11
  call void @_ZNSt5tupleIJxiEEC2IxRiTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(4) %15) #8
  call void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(16) %16)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #8
  br label %84

84:                                               ; preds = %82, %.lr.ph46
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #8
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #8
  %86 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #8
  br i1 %86, label %.lr.ph46, label %._crit_edge47

87:                                               ; preds = %._crit_edge47, %.lr.ph49
  %88 = call noundef zeroext i1 @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %88, label %._crit_edge50, label %.lr.ph49, !llvm.loop !16

._crit_edge50:                                    ; preds = %87, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #8
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @_ZNSt5tupleIJxiEEC2IiRiTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @S, i64 4)) #8
  call void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 32), ptr noundef nonnull align 8 dereferenceable(16) %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #8
  %89 = call noundef zeroext i1 @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 32))
  br i1 %89, label %._crit_edge50.1, label %.lr.ph49.1

.lr.ph49.1:                                       ; preds = %._crit_edge50, %119
  %90 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 32))
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %90) #8
  %92 = load i64, ptr %91, align 8, !tbaa !11
  %93 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 32))
  %94 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %93) #8
  %95 = load i32, ptr %94, align 4, !tbaa !5
  call void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 32))
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [2 x [100010 x i64]], ptr @dist, i64 0, i64 1, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !11
  %99 = icmp eq i64 %98, -1
  br i1 %99, label %100, label %119

100:                                              ; preds = %.lr.ph49.1
  store i64 %92, ptr %97, align 8, !tbaa !11
  %101 = getelementptr inbounds [2 x [100010 x %"class.std::vector"]], ptr @V, i64 0, i64 1, i64 %96
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #8
  %102 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %101) #8
  store ptr %102, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #8
  %103 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %101) #8
  store ptr %103, ptr %13, align 8
  %104 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #8
  br i1 %104, label %.lr.ph46.1, label %._crit_edge47.1

.lr.ph46.1:                                       ; preds = %100, %116
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #8
  %105 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %105, i64 16, i1 false)
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %14) #8
  %107 = load i64, ptr %106, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #8
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %14) #8
  %109 = load i32, ptr %108, align 4, !tbaa !5
  store i32 %109, ptr %15, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [2 x [100010 x i64]], ptr @dist, i64 0, i64 1, i64 %110
  %112 = load i64, ptr %111, align 8, !tbaa !11
  %113 = icmp eq i64 %112, -1
  br i1 %113, label %114, label %116

114:                                              ; preds = %.lr.ph46.1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #8
  %115 = add nsw i64 %107, %92
  store i64 %115, ptr %17, align 8, !tbaa !11
  call void @_ZNSt5tupleIJxiEEC2IxRiTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(4) %15) #8
  call void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 32), ptr noundef nonnull align 8 dereferenceable(16) %16)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #8
  br label %116

116:                                              ; preds = %114, %.lr.ph46.1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #8
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #8
  %118 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #8
  br i1 %118, label %.lr.ph46.1, label %._crit_edge47.1

._crit_edge47.1:                                  ; preds = %116, %100
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  br label %119

119:                                              ; preds = %._crit_edge47.1, %.lr.ph49.1
  %120 = call noundef zeroext i1 @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 32))
  br i1 %120, label %._crit_edge50.1, label %.lr.ph49.1, !llvm.loop !16

._crit_edge50.1:                                  ; preds = %119, %._crit_edge50
  %121 = load i32, ptr @N, align 4, !tbaa !5
  %122 = icmp sgt i32 %121, 0
  br i1 %122, label %.lr.ph53.preheader, label %._crit_edge58

.preheader42:                                     ; preds = %.lr.ph53, %middle.block
  %.not = icmp eq i32 %121, 1
  br i1 %.not, label %.lr.ph57.preheader, label %.lr.ph55.preheader

.lr.ph57.preheader:                               ; preds = %.preheader.loopexit, %.preheader42
  br label %.lr.ph57

.lr.ph55.preheader:                               ; preds = %.preheader42
  %123 = zext nneg i32 %121 to i64
  br label %.lr.ph55

.lr.ph53:                                         ; preds = %.lr.ph53.preheader70, %.lr.ph53
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph53 ], [ %indvars.iv.ph, %.lr.ph53.preheader70 ]
  %124 = getelementptr inbounds [100010 x i64], ptr @dist, i64 0, i64 %indvars.iv
  %125 = load i64, ptr %124, align 8, !tbaa !11
  %126 = getelementptr inbounds [100010 x i64], ptr getelementptr inbounds (i8, ptr @dist, i64 800080), i64 0, i64 %indvars.iv
  %127 = load i64, ptr %126, align 8, !tbaa !11
  %128 = add nsw i64 %127, %125
  %129 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %indvars.iv
  store i64 %128, ptr %129, align 8, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader42, label %.lr.ph53, !llvm.loop !17

.preheader.loopexit:                              ; preds = %.lr.ph55
  %.pre = load i32, ptr @N, align 4, !tbaa !5
  %130 = icmp sgt i32 %.pre, 0
  br i1 %130, label %.lr.ph57.preheader, label %._crit_edge58

.lr.ph55:                                         ; preds = %.lr.ph55.preheader, %.lr.ph55
  %indvars.iv61 = phi i64 [ %123, %.lr.ph55.preheader ], [ %indvars.iv.next62, %.lr.ph55 ]
  %indvars.iv.next62 = add nsw i64 %indvars.iv61, -1
  %131 = add nsw i64 %indvars.iv61, -2
  %132 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %131
  %133 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %indvars.iv.next62
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %132, ptr noundef nonnull align 8 dereferenceable(8) %133)
  %135 = load i64, ptr %134, align 8, !tbaa !11
  store i64 %135, ptr %132, align 8, !tbaa !11
  %136 = icmp ugt i64 %indvars.iv61, 2
  br i1 %136, label %.lr.ph55, label %.preheader.loopexit, !llvm.loop !18

._crit_edge58:                                    ; preds = %.lr.ph57, %._crit_edge50.1, %.preheader.loopexit
  ret i32 0

.lr.ph57:                                         ; preds = %.lr.ph57.preheader, %.lr.ph57
  %indvars.iv64 = phi i64 [ %indvars.iv.next65, %.lr.ph57 ], [ 0, %.lr.ph57.preheader ]
  %137 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %indvars.iv64
  %138 = load i64, ptr %137, align 8, !tbaa !11
  %139 = sub nsw i64 1000000000000000, %138
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %139)
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %140, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %142 = load i32, ptr @N, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = icmp slt i64 %indvars.iv.next65, %143
  br i1 %144, label %.lr.ph57, label %._crit_edge58, !llvm.loop !19
}

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 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 @_ZNSt5tupleIJxiEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), 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 @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(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 void @_ZNSt5tupleIJxiEEC2IiRiTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #4 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: 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6

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

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

; 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 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_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

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !15, !14}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


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