; LLVM IR from kazunetakahashi/atcoder :: 2019/0602_AGC034 (C)

; 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, long long, long long, long long>, std::allocator<std::tuple<long long, long long, long long, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::tuple<long long, long long, long long, long long>, std::allocator<std::tuple<long long, long long, long long, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::tuple<long long, long long, long long, long long>, std::allocator<std::tuple<long long, long long, long long, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::tuple<long long, long long, long long, long long>, std::allocator<std::tuple<long long, long long, long long, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::tuple.6" = type { %"struct.std::_Tuple_impl.7" }
%"struct.std::_Tuple_impl.7" = type { %"struct.std::_Tuple_impl.8", %"struct.std::_Head_base.14" }
%"struct.std::_Tuple_impl.8" = type { %"struct.std::_Tuple_impl.9", %"struct.std::_Head_base.13" }
%"struct.std::_Tuple_impl.9" = type { %"struct.std::_Tuple_impl.10", %"struct.std::_Head_base.12" }
%"struct.std::_Tuple_impl.10" = type { %"struct.std::_Head_base.11" }
%"struct.std::_Head_base.11" = type { ptr }
%"struct.std::_Head_base.12" = type { ptr }
%"struct.std::_Head_base.13" = type { ptr }
%"struct.std::_Head_base.14" = type { ptr }

@N = external dso_local global i32, align 4
@X = external dso_local global i64, align 8
@b = external dso_local global [100010 x i64], align 16
@l = external dso_local global [100010 x i64], align 16
@u = external dso_local global [100010 x i64], align 16
@maxi = external dso_local global i64, align 8
@now = external dso_local global i64, align 8
@ans = external dso_local global i64, align 8
@V = external dso_local global %"class.std::vector", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@_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 i64, align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca %"class.std::tuple.6", align 8
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca %"class.std::tuple.6", align 8
  %24 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %25 = 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)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 8 dereferenceable(8) @X)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %27

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

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

32:                                               ; preds = %27
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [100010 x i64], ptr @b, i64 0, i64 %34
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %35)
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100010 x i64], ptr @l, i64 0, i64 %38
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 8 dereferenceable(8) %39)
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [100010 x i64], ptr @u, i64 0, i64 %42
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %40, ptr noundef nonnull align 8 dereferenceable(8) %43)
  br label %45

45:                                               ; preds = %32
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %2, align 4, !tbaa !5
  br label %27, !llvm.loop !9

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

49:                                               ; preds = %66, %48
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = load i32, ptr @N, align 4, !tbaa !5
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %54, label %53

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

54:                                               ; preds = %49
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100010 x i64], ptr @b, i64 0, i64 %56
  %58 = load i64, ptr %57, align 8, !tbaa !11
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [100010 x i64], ptr @l, i64 0, i64 %60
  %62 = load i64, ptr %61, align 8, !tbaa !11
  %63 = mul nsw i64 %58, %62
  %64 = load i64, ptr @maxi, align 8, !tbaa !11
  %65 = add nsw i64 %64, %63
  store i64 %65, ptr @maxi, align 8, !tbaa !11
  br label %66

66:                                               ; preds = %54
  %67 = load i32, ptr %3, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %3, align 4, !tbaa !5
  br label %49, !llvm.loop !13

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

70:                                               ; preds = %107, %69
  %71 = load i32, ptr %4, align 4, !tbaa !5
  %72 = load i32, ptr @N, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %110

75:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [100010 x i64], ptr @l, i64 0, i64 %77
  %79 = load i64, ptr %78, align 8, !tbaa !11
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [100010 x i64], ptr @b, i64 0, i64 %81
  %83 = load i64, ptr %82, align 8, !tbaa !11
  %84 = mul nsw i64 %79, %83
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100010 x i64], ptr @u, i64 0, i64 %86
  %88 = load i64, ptr %87, align 8, !tbaa !11
  %89 = load i64, ptr @X, align 8, !tbaa !11
  %90 = load i32, ptr %4, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [100010 x i64], ptr @b, i64 0, i64 %91
  %93 = load i64, ptr %92, align 8, !tbaa !11
  %94 = sub nsw i64 %89, %93
  %95 = mul nsw i64 %88, %94
  %96 = add nsw i64 %84, %95
  store i64 %96, ptr %5, align 8, !tbaa !11
  %97 = load i32, ptr %4, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [100010 x i64], ptr @b, i64 0, i64 %98
  %100 = load i32, ptr %4, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100010 x i64], ptr @l, i64 0, i64 %101
  %103 = load i32, ptr %4, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [100010 x i64], ptr @u, i64 0, i64 %104
  %106 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorISt5tupleIJxxxxEESaIS1_EE12emplace_backIJRxS5_S5_S5_EEERS1_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) @V, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %99, ptr noundef nonnull align 8 dereferenceable(8) %102, ptr noundef nonnull align 8 dereferenceable(8) %105)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %107

107:                                              ; preds = %75
  %108 = load i32, ptr %4, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %4, align 4, !tbaa !5
  br label %70, !llvm.loop !14

110:                                              ; preds = %74
  %111 = call ptr @_ZNSt6vectorISt5tupleIJxxxxEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #7
  %112 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  store ptr %111, ptr %112, align 8
  %113 = call ptr @_ZNSt6vectorISt5tupleIJxxxxEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #7
  %114 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %113, ptr %114, align 8
  %115 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8
  %117 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  %118 = load ptr, ptr %117, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxxxxEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %116, ptr %118)
  %119 = call ptr @_ZNSt6vectorISt5tupleIJxxxxEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #7
  %120 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %119, ptr %120, align 8
  %121 = call ptr @_ZNSt6vectorISt5tupleIJxxxxEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #7
  %122 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %121, ptr %122, align 8
  %123 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %124 = load ptr, ptr %123, align 8
  %125 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  %126 = load ptr, ptr %125, align 8
  call void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxxxxEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %124, ptr %126)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %127

127:                                              ; preds = %147, %110
  br label %128

128:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %129 = load i32, ptr %10, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorISt5tupleIJxxxxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @V, i64 noundef %130) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #7
  call void @_ZSt3tieIJxxxxEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind writable sret(%"class.std::tuple.6") align 8 %15, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  %132 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt5tupleIJRxS0_S0_S0_EEaSIJxxxxEEENSt9enable_ifIXcl12__assignableIDpRKT_EEERS1_E4typeERKS_IJDpS4_EE(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef nonnull align 8 dereferenceable(32) %131) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #7
  %133 = load i64, ptr @now, align 8, !tbaa !11
  %134 = load i64, ptr %11, align 8, !tbaa !11
  %135 = add nsw i64 %133, %134
  %136 = load i64, ptr @maxi, align 8, !tbaa !11
  %137 = icmp sge i64 %135, %136
  br i1 %137, label %138, label %139

138:                                              ; preds = %128
  store i32 12, ptr %16, align 4
  br label %145

139:                                              ; preds = %128
  %140 = load i64, ptr %11, align 8, !tbaa !11
  %141 = load i64, ptr @now, align 8, !tbaa !11
  %142 = add nsw i64 %141, %140
  store i64 %142, ptr @now, align 8, !tbaa !11
  %143 = load i32, ptr %10, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %10, align 4, !tbaa !5
  store i32 0, ptr %16, align 4
  br label %145

145:                                              ; preds = %139, %138
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  %146 = load i32, ptr %16, align 4
  switch i32 %146, label %223 [
    i32 0, label %147
    i32 12, label %148
  ]

147:                                              ; preds = %145
  br label %127, !llvm.loop !15

148:                                              ; preds = %145
  %149 = load i64, ptr @X, align 8, !tbaa !11
  store i64 %149, ptr @ans, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %150 = load i64, ptr @maxi, align 8, !tbaa !11
  %151 = load i64, ptr @now, align 8, !tbaa !11
  %152 = sub nsw i64 %150, %151
  store i64 %152, ptr %17, align 8, !tbaa !11
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str)
  %154 = load i64, ptr @maxi, align 8, !tbaa !11
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %153, i64 noundef %154)
  %156 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %155, ptr noundef @.str.2)
  %157 = load i64, ptr @now, align 8, !tbaa !11
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %156, i64 noundef %157)
  %159 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %158, ptr noundef @.str.3)
  %160 = load i64, ptr %17, align 8, !tbaa !11
  %161 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %159, i64 noundef %160)
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %161, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %163 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %163, ptr %18, align 4, !tbaa !5
  br label %164

164:                                              ; preds = %210, %148
  %165 = load i32, ptr %18, align 4, !tbaa !5
  %166 = load i32, ptr @N, align 4, !tbaa !5
  %167 = icmp slt i32 %165, %166
  br i1 %167, label %169, label %168

168:                                              ; preds = %164
  store i32 13, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %213

169:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %170 = load i32, ptr %18, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorISt5tupleIJxxxxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @V, i64 noundef %171) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %23) #7
  call void @_ZSt3tieIJxxxxEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind writable sret(%"class.std::tuple.6") align 8 %23, ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22) #7
  %173 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt5tupleIJRxS0_S0_S0_EEaSIJxxxxEEENSt9enable_ifIXcl12__assignableIDpRKT_EEERS1_E4typeERKS_IJDpS4_EE(ptr noundef nonnull align 8 dereferenceable(32) %23, ptr noundef nonnull align 8 dereferenceable(32) %172) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  store i64 0, ptr %24, align 8, !tbaa !11
  %174 = load i64, ptr %19, align 8, !tbaa !11
  %175 = load i64, ptr %17, align 8, !tbaa !11
  %176 = icmp slt i64 %174, %175
  br i1 %176, label %177, label %178

177:                                              ; preds = %169
  store i32 15, ptr %16, align 4
  br label %207

178:                                              ; preds = %169
  %179 = load i64, ptr %17, align 8, !tbaa !11
  %180 = load i64, ptr %21, align 8, !tbaa !11
  %181 = load i64, ptr %20, align 8, !tbaa !11
  %182 = mul nsw i64 %180, %181
  %183 = icmp sge i64 %179, %182
  br i1 %183, label %184, label %197

184:                                              ; preds = %178
  %185 = load i64, ptr %20, align 8, !tbaa !11
  %186 = load i64, ptr %17, align 8, !tbaa !11
  %187 = load i64, ptr %21, align 8, !tbaa !11
  %188 = load i64, ptr %20, align 8, !tbaa !11
  %189 = mul nsw i64 %187, %188
  %190 = sub nsw i64 %186, %189
  %191 = load i64, ptr %22, align 8, !tbaa !11
  %192 = add nsw i64 %190, %191
  %193 = sub nsw i64 %192, 1
  %194 = load i64, ptr %22, align 8, !tbaa !11
  %195 = sdiv i64 %193, %194
  %196 = add nsw i64 %185, %195
  store i64 %196, ptr %24, align 8, !tbaa !11
  br label %204

197:                                              ; preds = %178
  %198 = load i64, ptr %17, align 8, !tbaa !11
  %199 = load i64, ptr %21, align 8, !tbaa !11
  %200 = add nsw i64 %198, %199
  %201 = sub nsw i64 %200, 1
  %202 = load i64, ptr %21, align 8, !tbaa !11
  %203 = sdiv i64 %201, %202
  store i64 %203, ptr %24, align 8, !tbaa !11
  br label %204

204:                                              ; preds = %197, %184
  %205 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) @ans)
  %206 = load i64, ptr %205, align 8, !tbaa !11
  store i64 %206, ptr @ans, align 8, !tbaa !11
  store i32 0, ptr %16, align 4
  br label %207

207:                                              ; preds = %204, %177
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  %208 = load i32, ptr %16, align 4
  switch i32 %208, label %223 [
    i32 0, label %209
    i32 15, label %210
  ]

209:                                              ; preds = %207
  br label %210

210:                                              ; preds = %209, %207
  %211 = load i32, ptr %18, align 4, !tbaa !5
  %212 = add nsw i32 %211, 1
  store i32 %212, ptr %18, align 4, !tbaa !5
  br label %164, !llvm.loop !16

213:                                              ; preds = %168
  %214 = load i64, ptr @ans, align 8, !tbaa !11
  %215 = load i64, ptr @X, align 8, !tbaa !11
  %216 = load i32, ptr %10, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = mul nsw i64 %215, %217
  %219 = add nsw i64 %214, %218
  %220 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %219)
  %221 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %220, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  %222 = load i32, ptr %1, align 4
  ret i32 %222

223:                                              ; preds = %207, %145
  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: 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)) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorISt5tupleIJxxxxEESaIS1_EE12emplace_backIJRxS5_S5_S5_EEERS1_DpOT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorISt5tupleIJxxxxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt3tieIJxxxxEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple.6") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

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

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

; Function Attrs: 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

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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress 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, long long, long long, long long>, std::allocator<std::tuple<long long, long long, long long, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::tuple<long long, long long, long long, long long>, std::allocator<std::tuple<long long, long long, long long, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::tuple<long long, long long, long long, long long>, std::allocator<std::tuple<long long, long long, long long, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::tuple<long long, long long, long long, long long>, std::allocator<std::tuple<long long, long long, long long, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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.6" = type { %"struct.std::_Tuple_impl.7" }
%"struct.std::_Tuple_impl.7" = type { %"struct.std::_Tuple_impl.8", %"struct.std::_Head_base.14" }
%"struct.std::_Tuple_impl.8" = type { %"struct.std::_Tuple_impl.9", %"struct.std::_Head_base.13" }
%"struct.std::_Tuple_impl.9" = type { %"struct.std::_Tuple_impl.10", %"struct.std::_Head_base.12" }
%"struct.std::_Tuple_impl.10" = type { %"struct.std::_Head_base.11" }
%"struct.std::_Head_base.11" = type { ptr }
%"struct.std::_Head_base.12" = type { ptr }
%"struct.std::_Head_base.13" = type { ptr }
%"struct.std::_Head_base.14" = type { ptr }

@N = external dso_local global i32, align 4
@X = external dso_local global i64, align 8
@b = external dso_local global [100010 x i64], align 16
@l = external dso_local global [100010 x i64], align 16
@u = external dso_local global [100010 x i64], align 16
@maxi = external dso_local local_unnamed_addr global i64, align 8
@now = external dso_local local_unnamed_addr global i64, align 8
@ans = external dso_local global i64, align 8
@V = external dso_local global %"class.std::vector", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@_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 i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca %"class.std::tuple.6", align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca %"class.std::tuple.6", align 8
  %12 = alloca i64, align 8
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %14 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) @X)
  %15 = load i32, ptr @N, align 4, !tbaa !5
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph, label %._crit_edge

.preheader48:                                     ; preds = %.lr.ph
  %17 = icmp sgt i32 %35, 0
  br i1 %17, label %.lr.ph52.preheader, label %._crit_edge

.lr.ph52.preheader:                               ; preds = %.preheader48
  %maxi.promoted = load i64, ptr @maxi, align 8, !tbaa !9
  %wide.trip.count = zext nneg i32 %35 to i64
  %min.iters.check = icmp ult i32 %35, 4
  br i1 %min.iters.check, label %.lr.ph52.preheader86, label %vector.ph

.lr.ph52.preheader86:                             ; preds = %middle.block, %.lr.ph52.preheader
  %indvars.iv63.ph = phi i64 [ 0, %.lr.ph52.preheader ], [ %n.vec, %middle.block ]
  %.ph = phi i64 [ %maxi.promoted, %.lr.ph52.preheader ], [ %28, %middle.block ]
  br label %.lr.ph52

vector.ph:                                        ; preds = %.lr.ph52.preheader
  %n.vec = and i64 %wide.trip.count, 2147483644
  %18 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %maxi.promoted, i64 0
  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> [ %18, %vector.ph ], [ %25, %vector.body ]
  %vec.phi81 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %26, %vector.body ]
  %19 = getelementptr inbounds [100010 x i64], ptr @b, i64 0, i64 %index
  %20 = getelementptr inbounds i8, ptr %19, i64 16
  %wide.load = load <2 x i64>, ptr %19, align 16, !tbaa !9
  %wide.load82 = load <2 x i64>, ptr %20, align 16, !tbaa !9
  %21 = getelementptr inbounds [100010 x i64], ptr @l, i64 0, i64 %index
  %22 = getelementptr inbounds i8, ptr %21, i64 16
  %wide.load83 = load <2 x i64>, ptr %21, align 16, !tbaa !9
  %wide.load84 = load <2 x i64>, ptr %22, align 16, !tbaa !9
  %23 = mul nsw <2 x i64> %wide.load83, %wide.load
  %24 = mul nsw <2 x i64> %wide.load84, %wide.load82
  %25 = add <2 x i64> %vec.phi, %23
  %26 = add <2 x i64> %vec.phi81, %24
  %index.next = add nuw i64 %index, 4
  %27 = icmp eq i64 %index.next, %n.vec
  br i1 %27, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %26, %25
  %28 = tail 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 %.preheader, label %.lr.ph52.preheader86

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %29 = getelementptr inbounds [100010 x i64], ptr @b, i64 0, i64 %indvars.iv
  %30 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %29)
  %31 = getelementptr inbounds [100010 x i64], ptr @l, i64 0, i64 %indvars.iv
  %32 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %30, ptr noundef nonnull align 8 dereferenceable(8) %31)
  %33 = getelementptr inbounds [100010 x i64], ptr @u, i64 0, i64 %indvars.iv
  %34 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 8 dereferenceable(8) %33)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %35 = load i32, ptr @N, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = icmp slt i64 %indvars.iv.next, %36
  br i1 %37, label %.lr.ph, label %.preheader48, !llvm.loop !15

.preheader:                                       ; preds = %.lr.ph52, %middle.block
  %.lcssa79 = phi i64 [ %28, %middle.block ], [ %44, %.lr.ph52 ]
  store i64 %.lcssa79, ptr @maxi, align 8, !tbaa !9
  br i1 %17, label %.lr.ph55, label %._crit_edge

.lr.ph52:                                         ; preds = %.lr.ph52.preheader86, %.lr.ph52
  %indvars.iv63 = phi i64 [ %indvars.iv.next64, %.lr.ph52 ], [ %indvars.iv63.ph, %.lr.ph52.preheader86 ]
  %38 = phi i64 [ %44, %.lr.ph52 ], [ %.ph, %.lr.ph52.preheader86 ]
  %39 = getelementptr inbounds [100010 x i64], ptr @b, i64 0, i64 %indvars.iv63
  %40 = load i64, ptr %39, align 8, !tbaa !9
  %41 = getelementptr inbounds [100010 x i64], ptr @l, i64 0, i64 %indvars.iv63
  %42 = load i64, ptr %41, align 8, !tbaa !9
  %43 = mul nsw i64 %42, %40
  %44 = add nsw i64 %38, %43
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next64, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.lr.ph52, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph55, %0, %.preheader48, %.preheader
  %45 = call ptr @_ZNSt6vectorISt5tupleIJxxxxEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #8
  %46 = call ptr @_ZNSt6vectorISt5tupleIJxxxxEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxxxxEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %45, ptr %46)
  %47 = call ptr @_ZNSt6vectorISt5tupleIJxxxxEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #8
  %48 = call ptr @_ZNSt6vectorISt5tupleIJxxxxEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #8
  call void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxxxxEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %47, ptr %48)
  br label %64

.lr.ph55:                                         ; preds = %.preheader, %.lr.ph55
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %.lr.ph55 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  %49 = getelementptr inbounds [100010 x i64], ptr @l, i64 0, i64 %indvars.iv66
  %50 = load i64, ptr %49, align 8, !tbaa !9
  %51 = getelementptr inbounds [100010 x i64], ptr @b, i64 0, i64 %indvars.iv66
  %52 = load i64, ptr %51, align 8, !tbaa !9
  %53 = mul nsw i64 %52, %50
  %54 = getelementptr inbounds [100010 x i64], ptr @u, i64 0, i64 %indvars.iv66
  %55 = load i64, ptr %54, align 8, !tbaa !9
  %56 = load i64, ptr @X, align 8, !tbaa !9
  %57 = sub nsw i64 %56, %52
  %58 = mul nsw i64 %57, %55
  %59 = add nsw i64 %58, %53
  store i64 %59, ptr %1, align 8, !tbaa !9
  %60 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorISt5tupleIJxxxxEESaIS1_EE12emplace_backIJRxS5_S5_S5_EEERS1_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) @V, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %51, ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef nonnull align 8 dereferenceable(8) %54)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %61 = load i32, ptr @N, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = icmp slt i64 %indvars.iv.next67, %62
  br i1 %63, label %.lr.ph55, label %._crit_edge, !llvm.loop !17

64:                                               ; preds = %71, %._crit_edge
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %71 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %65 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorISt5tupleIJxxxxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @V, i64 noundef %indvars.iv69) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #8
  call void @_ZSt3tieIJxxxxEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple.6") align 8 %6, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  %66 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt5tupleIJRxS0_S0_S0_EEaSIJxxxxEEENSt9enable_ifIXcl12__assignableIDpRKT_EEERS1_E4typeERKS_IJDpS4_EE(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(32) %65) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #8
  %67 = load i64, ptr @now, align 8, !tbaa !9
  %68 = load i64, ptr %2, align 8, !tbaa !9
  %69 = add nsw i64 %68, %67
  %70 = load i64, ptr @maxi, align 8, !tbaa !9
  %.not = icmp slt i64 %69, %70
  br i1 %.not, label %71, label %72

71:                                               ; preds = %64
  store i64 %69, ptr @now, align 8, !tbaa !9
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  br label %64

72:                                               ; preds = %64
  %73 = trunc nuw nsw i64 %indvars.iv69 to i32
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  %74 = load i64, ptr @X, align 8, !tbaa !9
  store i64 %74, ptr @ans, align 8, !tbaa !9
  %75 = sub nsw i64 %70, %67
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str)
  %77 = load i64, ptr @maxi, align 8, !tbaa !9
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %76, i64 noundef %77)
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %78, ptr noundef nonnull @.str.2)
  %80 = load i64, ptr @now, align 8, !tbaa !9
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %79, i64 noundef %80)
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %81, ptr noundef nonnull @.str.3)
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %82, i64 noundef %75)
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %83, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %85 = load i32, ptr @N, align 4, !tbaa !5
  %86 = icmp sgt i32 %85, %73
  br i1 %86, label %.lr.ph58, label %._crit_edge59

.lr.ph58:                                         ; preds = %72
  %87 = add i64 %75, -1
  br label %95

._crit_edge59:                                    ; preds = %117, %72
  %88 = load i64, ptr @ans, align 8, !tbaa !9
  %89 = load i64, ptr @X, align 8, !tbaa !9
  %90 = and i64 %indvars.iv69, 4294967295
  %91 = mul nsw i64 %89, %90
  %92 = add nsw i64 %91, %88
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %92)
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %93, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

95:                                               ; preds = %.lr.ph58, %117
  %indvars.iv72 = phi i64 [ %indvars.iv69, %.lr.ph58 ], [ %indvars.iv.next73, %117 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #8
  %96 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorISt5tupleIJxxxxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @V, i64 noundef %indvars.iv72) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #8
  call void @_ZSt3tieIJxxxxEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple.6") align 8 %11, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #8
  %97 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt5tupleIJRxS0_S0_S0_EEaSIJxxxxEEENSt9enable_ifIXcl12__assignableIDpRKT_EEERS1_E4typeERKS_IJDpS4_EE(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(32) %96) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #8
  %98 = load i64, ptr %7, align 8, !tbaa !9
  %99 = icmp slt i64 %98, %75
  br i1 %99, label %117, label %100

100:                                              ; preds = %95
  %101 = load i64, ptr %9, align 8, !tbaa !9
  %102 = load i64, ptr %8, align 8, !tbaa !9
  %103 = mul nsw i64 %102, %101
  %.not43 = icmp slt i64 %75, %103
  br i1 %.not43, label %111, label %104

104:                                              ; preds = %100
  %105 = load i64, ptr %10, align 8, !tbaa !9
  %106 = xor i64 %103, -1
  %107 = add i64 %75, %106
  %108 = add i64 %107, %105
  %109 = sdiv i64 %108, %105
  %110 = add nsw i64 %109, %102
  br label %114

111:                                              ; preds = %100
  %112 = add i64 %87, %101
  %113 = sdiv i64 %112, %101
  br label %114

114:                                              ; preds = %111, %104
  %storemerge = phi i64 [ %113, %111 ], [ %110, %104 ]
  store i64 %storemerge, ptr %12, align 8, !tbaa !9
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) @ans)
  %116 = load i64, ptr %115, align 8, !tbaa !9
  store i64 %116, ptr @ans, align 8, !tbaa !9
  br label %117

117:                                              ; preds = %95, %114
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %118 = load i32, ptr @N, align 4, !tbaa !5
  %119 = trunc nuw i64 %indvars.iv.next73 to i32
  %120 = icmp sgt i32 %118, %119
  br i1 %120, label %95, label %._crit_edge59, !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 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 #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorISt5tupleIJxxxxEESaIS1_EE12emplace_backIJRxS5_S5_S5_EEERS1_DpOT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt3tieIJxxxxEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple.6") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

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

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

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

; Function Attrs: 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: 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress 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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !14, !13}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


; 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