; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/255 Division 1/Problem B (B)

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

@q1 = external dso_local global %"class.std::priority_queue", align 8
@q2 = external dso_local global %"class.std::priority_queue", align 8
@n = external dso_local global i64, align 8
@m = external dso_local global i64, align 8
@k = external dso_local global i64, align 8
@p = external dso_local global i64, align 8
@a = external dso_local global [1000 x [1000 x i64]], align 16
@c1 = external dso_local global [1000001 x i64], align 16
@c2 = external dso_local global [1000001 x i64], align 16
@ans = external dso_local global i64, align 8
@x = external dso_local global i64, align 8
@y = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; 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 i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @n)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) @m)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) @k)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(8) @p)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %44, %0
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = load i64, ptr @n, align 8, !tbaa !9
  %23 = icmp slt i64 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %19
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %47

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

26:                                               ; preds = %40, %25
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = load i64, ptr @m, align 8, !tbaa !9
  %30 = icmp slt i64 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %26
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %43

32:                                               ; preds = %26
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [1000 x [1000 x i64]], ptr @a, i64 0, i64 %34
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [1000 x i64], ptr %35, i64 0, i64 %37
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %38)
  br label %40

40:                                               ; preds = %32
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %4, align 4, !tbaa !5
  br label %26, !llvm.loop !11

43:                                               ; preds = %31
  br label %44

44:                                               ; preds = %43
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %2, align 4, !tbaa !5
  br label %19, !llvm.loop !13

47:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %75, %47
  %49 = load i32, ptr %6, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = load i64, ptr @n, align 8, !tbaa !9
  %52 = icmp slt i64 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %48
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %78

54:                                               ; preds = %48
  store i64 0, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %71, %54
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = load i64, ptr @m, align 8, !tbaa !9
  %59 = icmp slt i64 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %55
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %74

61:                                               ; preds = %55
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [1000 x [1000 x i64]], ptr @a, i64 0, i64 %63
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [1000 x i64], ptr %64, i64 0, i64 %66
  %68 = load i64, ptr %67, align 8, !tbaa !9
  %69 = load i64, ptr %5, align 8, !tbaa !9
  %70 = add nsw i64 %69, %68
  store i64 %70, ptr %5, align 8, !tbaa !9
  br label %71

71:                                               ; preds = %61
  %72 = load i32, ptr %7, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %7, align 4, !tbaa !5
  br label %55, !llvm.loop !14

74:                                               ; preds = %60
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(25) @q1, ptr noundef nonnull align 8 dereferenceable(8) %5)
  br label %75

75:                                               ; preds = %74
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %6, align 4, !tbaa !5
  br label %48, !llvm.loop !15

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

79:                                               ; preds = %106, %78
  %80 = load i32, ptr %8, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = load i64, ptr @m, align 8, !tbaa !9
  %83 = icmp slt i64 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %79
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %109

85:                                               ; preds = %79
  store i64 0, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %102, %85
  %87 = load i32, ptr %9, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = load i64, ptr @n, align 8, !tbaa !9
  %90 = icmp slt i64 %88, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %86
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %105

92:                                               ; preds = %86
  %93 = load i32, ptr %9, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [1000 x [1000 x i64]], ptr @a, i64 0, i64 %94
  %96 = load i32, ptr %8, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [1000 x i64], ptr %95, i64 0, i64 %97
  %99 = load i64, ptr %98, align 8, !tbaa !9
  %100 = load i64, ptr %5, align 8, !tbaa !9
  %101 = add nsw i64 %100, %99
  store i64 %101, ptr %5, align 8, !tbaa !9
  br label %102

102:                                              ; preds = %92
  %103 = load i32, ptr %9, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %9, align 4, !tbaa !5
  br label %86, !llvm.loop !16

105:                                              ; preds = %91
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(25) @q2, ptr noundef nonnull align 8 dereferenceable(8) %5)
  br label %106

106:                                              ; preds = %105
  %107 = load i32, ptr %8, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %8, align 4, !tbaa !5
  br label %79, !llvm.loop !17

109:                                              ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %151, %109
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = load i64, ptr @k, align 8, !tbaa !9
  %114 = icmp sle i64 %112, %113
  br i1 %114, label %116, label %115

115:                                              ; preds = %110
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %154

116:                                              ; preds = %110
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @q1)
  %118 = load i64, ptr %117, align 8, !tbaa !9
  store i64 %118, ptr @x, align 8, !tbaa !9
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @q1)
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @q2)
  %120 = load i64, ptr %119, align 8, !tbaa !9
  store i64 %120, ptr @y, align 8, !tbaa !9
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @q2)
  %121 = load i32, ptr %10, align 4, !tbaa !5
  %122 = sub nsw i32 %121, 1
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [1000001 x i64], ptr @c1, i64 0, i64 %123
  %125 = load i64, ptr %124, align 8, !tbaa !9
  %126 = load i64, ptr @x, align 8, !tbaa !9
  %127 = add nsw i64 %125, %126
  %128 = load i32, ptr %10, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [1000001 x i64], ptr @c1, i64 0, i64 %129
  store i64 %127, ptr %130, align 8, !tbaa !9
  %131 = load i32, ptr %10, align 4, !tbaa !5
  %132 = sub nsw i32 %131, 1
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [1000001 x i64], ptr @c2, i64 0, i64 %133
  %135 = load i64, ptr %134, align 8, !tbaa !9
  %136 = load i64, ptr @y, align 8, !tbaa !9
  %137 = add nsw i64 %135, %136
  %138 = load i32, ptr %10, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [1000001 x i64], ptr @c2, i64 0, i64 %139
  store i64 %137, ptr %140, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %141 = load i64, ptr @x, align 8, !tbaa !9
  %142 = load i64, ptr @m, align 8, !tbaa !9
  %143 = load i64, ptr @p, align 8, !tbaa !9
  %144 = mul nsw i64 %142, %143
  %145 = sub nsw i64 %141, %144
  store i64 %145, ptr %11, align 8, !tbaa !9
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushEOx(ptr noundef nonnull align 8 dereferenceable(25) @q1, ptr noundef nonnull align 8 dereferenceable(8) %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %146 = load i64, ptr @y, align 8, !tbaa !9
  %147 = load i64, ptr @n, align 8, !tbaa !9
  %148 = load i64, ptr @p, align 8, !tbaa !9
  %149 = mul nsw i64 %147, %148
  %150 = sub nsw i64 %146, %149
  store i64 %150, ptr %12, align 8, !tbaa !9
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushEOx(ptr noundef nonnull align 8 dereferenceable(25) @q2, ptr noundef nonnull align 8 dereferenceable(8) %12)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %151

151:                                              ; preds = %116
  %152 = load i32, ptr %10, align 4, !tbaa !5
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %10, align 4, !tbaa !5
  br label %110, !llvm.loop !18

154:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %155

155:                                              ; preds = %185, %154
  %156 = load i32, ptr %13, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = load i64, ptr @k, align 8, !tbaa !9
  %159 = icmp sle i64 %157, %158
  br i1 %159, label %161, label %160

160:                                              ; preds = %155
  store i32 23, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %188

161:                                              ; preds = %155
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %162 = load i32, ptr %13, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [1000001 x i64], ptr @c1, i64 0, i64 %163
  %165 = load i64, ptr %164, align 8, !tbaa !9
  %166 = load i64, ptr @k, align 8, !tbaa !9
  %167 = load i32, ptr %13, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = sub nsw i64 %166, %168
  %170 = getelementptr inbounds [1000001 x i64], ptr @c2, i64 0, i64 %169
  %171 = load i64, ptr %170, align 8, !tbaa !9
  %172 = add nsw i64 %165, %171
  %173 = load i32, ptr %13, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = load i64, ptr @k, align 8, !tbaa !9
  %176 = load i32, ptr %13, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = sub nsw i64 %175, %177
  %179 = mul nsw i64 %174, %178
  %180 = load i64, ptr @p, align 8, !tbaa !9
  %181 = mul nsw i64 %179, %180
  %182 = sub nsw i64 %172, %181
  store i64 %182, ptr %14, align 8, !tbaa !9
  %183 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @ans, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %184 = load i64, ptr %183, align 8, !tbaa !9
  store i64 %184, ptr @ans, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %185

185:                                              ; preds = %161
  %186 = load i32, ptr %13, align 4, !tbaa !5
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %13, align 4, !tbaa !5
  br label %155, !llvm.loop !19

188:                                              ; preds = %160
  %189 = load i64, ptr @ans, align 8, !tbaa !9
  %190 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %189)
  %191 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %190, ptr noundef @.str)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  %192 = load i32, ptr %1, align 4
  ret i32 %192
}

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

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

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

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

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

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

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

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

; 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) #5

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

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 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #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 = { nounwind }

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

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


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

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

@q1 = external dso_local global %"class.std::priority_queue", align 8
@q2 = external dso_local global %"class.std::priority_queue", align 8
@n = external dso_local global i64, align 8
@m = external dso_local global i64, align 8
@k = external dso_local global i64, align 8
@p = external dso_local global i64, align 8
@a = external dso_local global [1000 x [1000 x i64]], align 16
@c1 = external dso_local local_unnamed_addr global [1000001 x i64], align 16
@c2 = external dso_local local_unnamed_addr global [1000001 x i64], align 16
@ans = external dso_local global i64, align 8
@x = external dso_local local_unnamed_addr global i64, align 8
@y = external dso_local local_unnamed_addr global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; 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 = 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) @n)
  %6 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) @m)
  %7 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) @k)
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) @p)
  %9 = load i64, ptr @n, align 8, !tbaa !5
  %10 = icmp sgt i64 %9, 0
  br i1 %10, label %.preheader49.lr.ph, label %._crit_edge52.thread102

._crit_edge52.thread102:                          ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  br label %.preheader48

.preheader49.lr.ph:                               ; preds = %0
  %11 = load i64, ptr @m, align 8, !tbaa !5
  %12 = icmp sgt i64 %11, 0
  br i1 %12, label %.preheader49, label %._crit_edge52.thread

._crit_edge52.thread:                             ; preds = %.preheader49.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  br label %.lr.ph59.preheader

.preheader49:                                     ; preds = %.preheader49.lr.ph, %._crit_edge
  %13 = phi i64 [ %17, %._crit_edge ], [ %9, %.preheader49.lr.ph ]
  %14 = phi i64 [ %18, %._crit_edge ], [ %11, %.preheader49.lr.ph ]
  %indvars.iv79 = phi i64 [ %indvars.iv.next80, %._crit_edge ], [ 0, %.preheader49.lr.ph ]
  %15 = icmp sgt i64 %14, 0
  br i1 %15, label %.lr.ph, label %._crit_edge

._crit_edge52:                                    ; preds = %._crit_edge
  %16 = icmp sgt i64 %17, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  br i1 %16, label %.lr.ph59.preheader, label %.preheader48

.lr.ph59.preheader:                               ; preds = %._crit_edge52.thread, %._crit_edge52
  br label %.lr.ph59

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i64, ptr @n, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader49
  %17 = phi i64 [ %.pre, %._crit_edge.loopexit ], [ %13, %.preheader49 ]
  %18 = phi i64 [ %22, %._crit_edge.loopexit ], [ %14, %.preheader49 ]
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %19 = icmp sgt i64 %17, %indvars.iv.next80
  br i1 %19, label %.preheader49, label %._crit_edge52, !llvm.loop !9

.lr.ph:                                           ; preds = %.preheader49, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader49 ]
  %20 = getelementptr inbounds [1000 x [1000 x i64]], ptr @a, i64 0, i64 %indvars.iv79, i64 %indvars.iv
  %21 = 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) %20)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %22 = load i64, ptr @m, align 8, !tbaa !5
  %23 = icmp sgt i64 %22, %indvars.iv.next
  br i1 %23, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !12

.preheader48:                                     ; preds = %34, %._crit_edge52.thread102, %._crit_edge52
  %24 = load i64, ptr @m, align 8, !tbaa !5
  %25 = icmp sgt i64 %24, 0
  br i1 %25, label %.lr.ph67, label %.preheader47

.lr.ph59:                                         ; preds = %.lr.ph59.preheader, %34
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %34 ], [ 0, %.lr.ph59.preheader ]
  store i64 0, ptr %1, align 8, !tbaa !5
  %26 = load i64, ptr @m, align 8, !tbaa !5
  %27 = icmp sgt i64 %26, 0
  br i1 %27, label %.lr.ph55.preheader, label %34

.lr.ph55.preheader:                               ; preds = %.lr.ph59
  %min.iters.check = icmp ult i64 %26, 4
  br i1 %min.iters.check, label %.lr.ph55.preheader117, label %vector.ph

.lr.ph55.preheader117:                            ; preds = %middle.block, %.lr.ph55.preheader
  %indvars.iv82.ph = phi i64 [ 0, %.lr.ph55.preheader ], [ %n.vec, %middle.block ]
  %.ph = phi i64 [ 0, %.lr.ph55.preheader ], [ %33, %middle.block ]
  br label %.lr.ph55

vector.ph:                                        ; preds = %.lr.ph55.preheader
  %n.vec = and i64 %26, 9223372036854775804
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %30, %vector.body ]
  %vec.phi113 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %31, %vector.body ]
  %28 = getelementptr inbounds [1000 x [1000 x i64]], ptr @a, i64 0, i64 %indvars.iv85, i64 %index
  %29 = getelementptr inbounds i8, ptr %28, i64 16
  %wide.load = load <2 x i64>, ptr %28, align 16, !tbaa !5
  %wide.load114 = load <2 x i64>, ptr %29, align 16, !tbaa !5
  %30 = add <2 x i64> %vec.phi, %wide.load
  %31 = add <2 x i64> %vec.phi113, %wide.load114
  %index.next = add nuw i64 %index, 4
  %32 = icmp eq i64 %index.next, %n.vec
  br i1 %32, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %31, %30
  %33 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %26, %n.vec
  br i1 %cmp.n, label %._crit_edge56, label %.lr.ph55.preheader117

._crit_edge56:                                    ; preds = %.lr.ph55, %middle.block
  %.lcssa110 = phi i64 [ %33, %middle.block ], [ %40, %.lr.ph55 ]
  store i64 %.lcssa110, ptr %1, align 8, !tbaa !5
  br label %34

34:                                               ; preds = %._crit_edge56, %.lr.ph59
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(25) @q1, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %35 = load i64, ptr @n, align 8, !tbaa !5
  %36 = icmp sgt i64 %35, %indvars.iv.next86
  br i1 %36, label %.lr.ph59, label %.preheader48, !llvm.loop !16

.lr.ph55:                                         ; preds = %.lr.ph55.preheader117, %.lr.ph55
  %indvars.iv82 = phi i64 [ %indvars.iv.next83, %.lr.ph55 ], [ %indvars.iv82.ph, %.lr.ph55.preheader117 ]
  %37 = phi i64 [ %40, %.lr.ph55 ], [ %.ph, %.lr.ph55.preheader117 ]
  %38 = getelementptr inbounds [1000 x [1000 x i64]], ptr @a, i64 0, i64 %indvars.iv85, i64 %indvars.iv82
  %39 = load i64, ptr %38, align 8, !tbaa !5
  %40 = add nsw i64 %37, %39
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next83, %26
  br i1 %exitcond.not, label %._crit_edge56, label %.lr.ph55, !llvm.loop !17

.preheader47:                                     ; preds = %49, %.preheader48
  %41 = load i64, ptr @k, align 8, !tbaa !5
  %.not68 = icmp slt i64 %41, 1
  br i1 %.not68, label %.preheader, label %.lr.ph70

.lr.ph67:                                         ; preds = %.preheader48, %49
  %indvars.iv92 = phi i64 [ %indvars.iv.next93, %49 ], [ 0, %.preheader48 ]
  store i64 0, ptr %1, align 8, !tbaa !5
  %42 = load i64, ptr @n, align 8, !tbaa !5
  %43 = icmp sgt i64 %42, 0
  br i1 %43, label %.lr.ph63.preheader, label %49

.lr.ph63.preheader:                               ; preds = %.lr.ph67
  %xtraiter = and i64 %42, 3
  %44 = icmp ult i64 %42, 4
  br i1 %44, label %._crit_edge64.unr-lcssa, label %.lr.ph63.preheader.new

.lr.ph63.preheader.new:                           ; preds = %.lr.ph63.preheader
  %unroll_iter = and i64 %42, 9223372036854775804
  br label %.lr.ph63

._crit_edge64.unr-lcssa:                          ; preds = %.lr.ph63, %.lr.ph63.preheader
  %.lcssa116.ph = phi i64 [ poison, %.lr.ph63.preheader ], [ %64, %.lr.ph63 ]
  %indvars.iv88.unr = phi i64 [ 0, %.lr.ph63.preheader ], [ %indvars.iv.next89.3, %.lr.ph63 ]
  %.unr = phi i64 [ 0, %.lr.ph63.preheader ], [ %64, %.lr.ph63 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge64, label %.lr.ph63.epil

.lr.ph63.epil:                                    ; preds = %._crit_edge64.unr-lcssa, %.lr.ph63.epil
  %indvars.iv88.epil = phi i64 [ %indvars.iv.next89.epil, %.lr.ph63.epil ], [ %indvars.iv88.unr, %._crit_edge64.unr-lcssa ]
  %45 = phi i64 [ %48, %.lr.ph63.epil ], [ %.unr, %._crit_edge64.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph63.epil ], [ 0, %._crit_edge64.unr-lcssa ]
  %46 = getelementptr inbounds [1000 x [1000 x i64]], ptr @a, i64 0, i64 %indvars.iv88.epil, i64 %indvars.iv92
  %47 = load i64, ptr %46, align 8, !tbaa !5
  %48 = add nsw i64 %45, %47
  %indvars.iv.next89.epil = add nuw nsw i64 %indvars.iv88.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge64, label %.lr.ph63.epil, !llvm.loop !18

._crit_edge64:                                    ; preds = %.lr.ph63.epil, %._crit_edge64.unr-lcssa
  %.lcssa116 = phi i64 [ %.lcssa116.ph, %._crit_edge64.unr-lcssa ], [ %48, %.lr.ph63.epil ]
  store i64 %.lcssa116, ptr %1, align 8, !tbaa !5
  br label %49

49:                                               ; preds = %._crit_edge64, %.lr.ph67
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(25) @q2, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %50 = load i64, ptr @m, align 8, !tbaa !5
  %51 = icmp sgt i64 %50, %indvars.iv.next93
  br i1 %51, label %.lr.ph67, label %.preheader47, !llvm.loop !20

.lr.ph63:                                         ; preds = %.lr.ph63, %.lr.ph63.preheader.new
  %indvars.iv88 = phi i64 [ 0, %.lr.ph63.preheader.new ], [ %indvars.iv.next89.3, %.lr.ph63 ]
  %52 = phi i64 [ 0, %.lr.ph63.preheader.new ], [ %64, %.lr.ph63 ]
  %niter = phi i64 [ 0, %.lr.ph63.preheader.new ], [ %niter.next.3, %.lr.ph63 ]
  %53 = getelementptr inbounds [1000 x [1000 x i64]], ptr @a, i64 0, i64 %indvars.iv88, i64 %indvars.iv92
  %54 = load i64, ptr %53, align 8, !tbaa !5
  %55 = add nsw i64 %52, %54
  %indvars.iv.next89 = or disjoint i64 %indvars.iv88, 1
  %56 = getelementptr inbounds [1000 x [1000 x i64]], ptr @a, i64 0, i64 %indvars.iv.next89, i64 %indvars.iv92
  %57 = load i64, ptr %56, align 8, !tbaa !5
  %58 = add nsw i64 %55, %57
  %indvars.iv.next89.1 = or disjoint i64 %indvars.iv88, 2
  %59 = getelementptr inbounds [1000 x [1000 x i64]], ptr @a, i64 0, i64 %indvars.iv.next89.1, i64 %indvars.iv92
  %60 = load i64, ptr %59, align 8, !tbaa !5
  %61 = add nsw i64 %58, %60
  %indvars.iv.next89.2 = or disjoint i64 %indvars.iv88, 3
  %62 = getelementptr inbounds [1000 x [1000 x i64]], ptr @a, i64 0, i64 %indvars.iv.next89.2, i64 %indvars.iv92
  %63 = load i64, ptr %62, align 8, !tbaa !5
  %64 = add nsw i64 %61, %63
  %indvars.iv.next89.3 = add nuw nsw i64 %indvars.iv88, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge64.unr-lcssa, label %.lr.ph63, !llvm.loop !21

.preheader:                                       ; preds = %.lr.ph70, %.preheader47
  %65 = phi i64 [ %41, %.preheader47 ], [ %90, %.lr.ph70 ]
  %.not4671 = icmp slt i64 %65, 0
  br i1 %.not4671, label %.preheader.._crit_edge74_crit_edge, label %.lr.ph73

.preheader.._crit_edge74_crit_edge:               ; preds = %.preheader
  %.pre101 = load i64, ptr @ans, align 8, !tbaa !5
  br label %._crit_edge74

.lr.ph70:                                         ; preds = %.preheader47, %.lr.ph70
  %indvars.iv95 = phi i64 [ %indvars.iv.next96, %.lr.ph70 ], [ 1, %.preheader47 ]
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @q1)
  %67 = load i64, ptr %66, align 8, !tbaa !5
  store i64 %67, ptr @x, align 8, !tbaa !5
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @q1)
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @q2)
  %69 = load i64, ptr %68, align 8, !tbaa !5
  store i64 %69, ptr @y, align 8, !tbaa !5
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @q2)
  %70 = add nsw i64 %indvars.iv95, -1
  %71 = getelementptr inbounds [1000001 x i64], ptr @c1, i64 0, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !5
  %73 = load i64, ptr @x, align 8, !tbaa !5
  %74 = add nsw i64 %73, %72
  %75 = getelementptr inbounds [1000001 x i64], ptr @c1, i64 0, i64 %indvars.iv95
  store i64 %74, ptr %75, align 8, !tbaa !5
  %76 = getelementptr inbounds [1000001 x i64], ptr @c2, i64 0, i64 %70
  %77 = load i64, ptr %76, align 8, !tbaa !5
  %78 = load i64, ptr @y, align 8, !tbaa !5
  %79 = add nsw i64 %78, %77
  %80 = getelementptr inbounds [1000001 x i64], ptr @c2, i64 0, i64 %indvars.iv95
  store i64 %79, ptr %80, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %81 = load i64, ptr @m, align 8, !tbaa !5
  %82 = load i64, ptr @p, align 8, !tbaa !5
  %83 = mul nsw i64 %82, %81
  %84 = sub nsw i64 %73, %83
  store i64 %84, ptr %2, align 8, !tbaa !5
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushEOx(ptr noundef nonnull align 8 dereferenceable(25) @q1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %85 = load i64, ptr @y, align 8, !tbaa !5
  %86 = load i64, ptr @n, align 8, !tbaa !5
  %87 = load i64, ptr @p, align 8, !tbaa !5
  %88 = mul nsw i64 %87, %86
  %89 = sub nsw i64 %85, %88
  store i64 %89, ptr %3, align 8, !tbaa !5
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushEOx(ptr noundef nonnull align 8 dereferenceable(25) @q2, ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %90 = load i64, ptr @k, align 8, !tbaa !5
  %.not.not = icmp sgt i64 %90, %indvars.iv95
  br i1 %.not.not, label %.lr.ph70, label %.preheader, !llvm.loop !22

._crit_edge74:                                    ; preds = %.lr.ph73, %.preheader.._crit_edge74_crit_edge
  %91 = phi i64 [ %.pre101, %.preheader.._crit_edge74_crit_edge ], [ %106, %.lr.ph73 ]
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %91)
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %92, ptr noundef nonnull @.str)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0

.lr.ph73:                                         ; preds = %.preheader, %.lr.ph73
  %indvars.iv98 = phi i64 [ %indvars.iv.next99, %.lr.ph73 ], [ 0, %.preheader ]
  %94 = phi i64 [ %107, %.lr.ph73 ], [ %65, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %95 = getelementptr inbounds [1000001 x i64], ptr @c1, i64 0, i64 %indvars.iv98
  %96 = load i64, ptr %95, align 8, !tbaa !5
  %97 = sub nsw i64 %94, %indvars.iv98
  %98 = getelementptr inbounds [1000001 x i64], ptr @c2, i64 0, i64 %97
  %99 = load i64, ptr %98, align 8, !tbaa !5
  %100 = add nsw i64 %99, %96
  %101 = mul nsw i64 %97, %indvars.iv98
  %102 = load i64, ptr @p, align 8, !tbaa !5
  %103 = mul nsw i64 %101, %102
  %104 = sub i64 %100, %103
  store i64 %104, ptr %4, align 8, !tbaa !5
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @ans, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %106 = load i64, ptr %105, align 8, !tbaa !5
  store i64 %106, ptr @ans, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %107 = load i64, ptr @k, align 8, !tbaa !5
  %.not46.not = icmp sgt i64 %107, %indvars.iv98
  br i1 %.not46.not, label %.lr.ph73, label %._crit_edge74, !llvm.loop !23
}

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

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

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

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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = distinct !{!12, !10}
!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, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}


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