; LLVM IR from ncduy0303/Competitive-Programming :: Dynamic Programming/Deque Trick.ll (Z5solvev)

; 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::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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::array<long long, 2>, std::allocator<std::array<long long, 2>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::array<long long, 2>, std::allocator<std::array<long long, 2>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::array<long long, 2>, std::allocator<std::array<long long, 2>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::array<long long, 2>, std::allocator<std::array<long long, 2>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::array" = type { [2 x i64] }

@_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 uwtable
define dso_local void @_Z5solvev() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::deque", align 8
  %15 = alloca %"struct.std::array", align 8
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::array", align 8
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #8
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  %25 = sext i32 %24 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #8
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #8
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %25, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %26 unwind label %32

26:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %42, %26
  %28 = load i32, ptr %8, align 4, !tbaa !5
  %29 = load i32, ptr %1, align 4, !tbaa !5
  %30 = icmp sle i32 %28, %29
  br i1 %30, label %36, label %31

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

32:                                               ; preds = %0
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %6, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %7, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #8
  br label %221

36:                                               ; preds = %27
  %37 = load i32, ptr %8, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %38) #8
  %40 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %39)
          to label %41 unwind label %45

41:                                               ; preds = %36
  br label %42

42:                                               ; preds = %41
  %43 = load i32, ptr %8, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %8, align 4, !tbaa !5
  br label %27, !llvm.loop !9

45:                                               ; preds = %36
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %6, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %220

49:                                               ; preds = %31
  %50 = load i32, ptr %1, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  %52 = zext i32 %51 to i64
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  %55 = zext i32 %54 to i64
  %56 = call ptr @llvm.stacksave.p0()
  store ptr %56, ptr %9, align 8
  %57 = mul nuw i64 %52, %55
  %58 = alloca i64, i64 %57, align 16
  store i64 %52, ptr %10, align 8
  store i64 %55, ptr %11, align 8
  %59 = mul nuw i64 %52, %55
  %60 = mul nuw i64 8, %59
  call void @llvm.memset.p0.i64(ptr align 16 %58, i8 -63, i64 %60, i1 false)
  %61 = mul nsw i64 0, %55
  %62 = getelementptr inbounds i64, ptr %58, i64 %61
  %63 = getelementptr inbounds i64, ptr %62, i64 0
  store i64 0, ptr %63, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %177, %49
  %65 = load i32, ptr %12, align 4, !tbaa !5
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = icmp sle i32 %65, %66
  br i1 %67, label %69, label %68

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

69:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 80, ptr %14) #8
  invoke void @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %14)
          to label %70 unwind label %93

70:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #8
  %71 = getelementptr inbounds %"struct.std::array", ptr %15, i32 0, i32 0
  %72 = load i32, ptr %12, align 4, !tbaa !5
  %73 = sub nsw i32 %72, 1
  %74 = sext i32 %73 to i64
  store i64 %74, ptr %71, align 8, !tbaa !11
  %75 = getelementptr inbounds i64, ptr %71, i64 1
  %76 = load i32, ptr %12, align 4, !tbaa !5
  %77 = sub nsw i32 %76, 1
  %78 = sext i32 %77 to i64
  %79 = mul nsw i64 %78, %55
  %80 = getelementptr inbounds i64, ptr %58, i64 %79
  %81 = load i32, ptr %12, align 4, !tbaa !5
  %82 = sub nsw i32 %81, 1
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i64, ptr %80, i64 %83
  %85 = load i64, ptr %84, align 8, !tbaa !11
  store i64 %85, ptr %75, align 8, !tbaa !11
  invoke void @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %14, ptr noundef nonnull align 8 dereferenceable(16) %15)
          to label %86 unwind label %97

86:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %87 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %87, ptr %16, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %169, %86
  %89 = load i32, ptr %16, align 4, !tbaa !5
  %90 = load i32, ptr %1, align 4, !tbaa !5
  %91 = icmp sle i32 %89, %90
  br i1 %91, label %101, label %92

92:                                               ; preds = %88
  store i32 8, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %176

93:                                               ; preds = %69
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %6, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %7, align 4
  br label %181

97:                                               ; preds = %70
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %6, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #8
  br label %180

101:                                              ; preds = %88
  br label %102

102:                                              ; preds = %116, %101
  %103 = call noundef i64 @_ZNKSt5dequeISt5arrayIxLm2EESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %14) #8
  %104 = icmp ne i64 %103, 0
  br i1 %104, label %105, label %114

105:                                              ; preds = %102
  %106 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %14) #8
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIxLm2EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %106, i64 noundef 0) #8
  %108 = load i64, ptr %107, align 8, !tbaa !11
  %109 = load i32, ptr %16, align 4, !tbaa !5
  %110 = load i32, ptr %2, align 4, !tbaa !5
  %111 = sub nsw i32 %109, %110
  %112 = sext i32 %111 to i64
  %113 = icmp slt i64 %108, %112
  br label %114

114:                                              ; preds = %105, %102
  %115 = phi i1 [ false, %102 ], [ %113, %105 ]
  br i1 %115, label %116, label %117

116:                                              ; preds = %114
  call void @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %14) #8
  br label %102, !llvm.loop !13

117:                                              ; preds = %114
  %118 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %14) #8
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIxLm2EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %118, i64 noundef 1) #8
  %120 = load i64, ptr %119, align 8, !tbaa !11
  %121 = load i32, ptr %16, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %122) #8
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = add nsw i64 %120, %125
  %127 = load i32, ptr %16, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = mul nsw i64 %128, %55
  %130 = getelementptr inbounds i64, ptr %58, i64 %129
  %131 = load i32, ptr %12, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds i64, ptr %130, i64 %132
  store i64 %126, ptr %133, align 8, !tbaa !11
  br label %134

134:                                              ; preds = %153, %117
  %135 = call noundef i64 @_ZNKSt5dequeISt5arrayIxLm2EESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %14) #8
  %136 = icmp ne i64 %135, 0
  br i1 %136, label %137, label %151

137:                                              ; preds = %134
  %138 = load i32, ptr %16, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = mul nsw i64 %139, %55
  %141 = getelementptr inbounds i64, ptr %58, i64 %140
  %142 = load i32, ptr %12, align 4, !tbaa !5
  %143 = sub nsw i32 %142, 1
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds i64, ptr %141, i64 %144
  %146 = load i64, ptr %145, align 8, !tbaa !11
  %147 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(80) %14) #8
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIxLm2EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %147, i64 noundef 1) #8
  %149 = load i64, ptr %148, align 8, !tbaa !11
  %150 = icmp sge i64 %146, %149
  br label %151

151:                                              ; preds = %137, %134
  %152 = phi i1 [ false, %134 ], [ %150, %137 ]
  br i1 %152, label %153, label %154

153:                                              ; preds = %151
  call void @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(80) %14) #8
  br label %134, !llvm.loop !14

154:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #8
  %155 = getelementptr inbounds %"struct.std::array", ptr %17, i32 0, i32 0
  %156 = load i32, ptr %16, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  store i64 %157, ptr %155, align 8, !tbaa !11
  %158 = getelementptr inbounds i64, ptr %155, i64 1
  %159 = load i32, ptr %16, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = mul nsw i64 %160, %55
  %162 = getelementptr inbounds i64, ptr %58, i64 %161
  %163 = load i32, ptr %12, align 4, !tbaa !5
  %164 = sub nsw i32 %163, 1
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds i64, ptr %162, i64 %165
  %167 = load i64, ptr %166, align 8, !tbaa !11
  store i64 %167, ptr %158, align 8, !tbaa !11
  invoke void @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %14, ptr noundef nonnull align 8 dereferenceable(16) %17)
          to label %168 unwind label %172

168:                                              ; preds = %154
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #8
  br label %169

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

172:                                              ; preds = %154
  %173 = landingpad { ptr, i32 }
          cleanup
  %174 = extractvalue { ptr, i32 } %173, 0
  store ptr %174, ptr %6, align 8
  %175 = extractvalue { ptr, i32 } %173, 1
  store i32 %175, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %180

176:                                              ; preds = %92
  call void @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %14) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %14) #8
  br label %177

177:                                              ; preds = %176
  %178 = load i32, ptr %12, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %12, align 4, !tbaa !5
  br label %64, !llvm.loop !16

180:                                              ; preds = %172, %97
  call void @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %14) #8
  br label %181

181:                                              ; preds = %180, %93
  call void @llvm.lifetime.end.p0(i64 80, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %220

182:                                              ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  store i64 -1, ptr %18, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %183

183:                                              ; preds = %201, %182
  %184 = load i32, ptr %19, align 4, !tbaa !5
  %185 = load i32, ptr %2, align 4, !tbaa !5
  %186 = icmp slt i32 %184, %185
  br i1 %186, label %188, label %187

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

188:                                              ; preds = %183
  %189 = load i32, ptr %1, align 4, !tbaa !5
  %190 = load i32, ptr %19, align 4, !tbaa !5
  %191 = sub nsw i32 %189, %190
  %192 = sext i32 %191 to i64
  %193 = mul nsw i64 %192, %55
  %194 = getelementptr inbounds i64, ptr %58, i64 %193
  %195 = load i32, ptr %3, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds i64, ptr %194, i64 %196
  %198 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %197)
          to label %199 unwind label %204

199:                                              ; preds = %188
  %200 = load i64, ptr %198, align 8, !tbaa !11
  store i64 %200, ptr %18, align 8, !tbaa !11
  br label %201

201:                                              ; preds = %199
  %202 = load i32, ptr %19, align 4, !tbaa !5
  %203 = add nsw i32 %202, 1
  store i32 %203, ptr %19, align 4, !tbaa !5
  br label %183, !llvm.loop !17

204:                                              ; preds = %188
  %205 = landingpad { ptr, i32 }
          cleanup
  %206 = extractvalue { ptr, i32 } %205, 0
  store ptr %206, ptr %6, align 8
  %207 = extractvalue { ptr, i32 } %205, 1
  store i32 %207, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %219

208:                                              ; preds = %187
  %209 = load i64, ptr %18, align 8, !tbaa !11
  %210 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %209)
          to label %211 unwind label %215

211:                                              ; preds = %208
  %212 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %210, ptr noundef @.str)
          to label %213 unwind label %215

213:                                              ; preds = %211
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  %214 = load ptr, ptr %9, align 8
  call void @llvm.stackrestore.p0(ptr %214)
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #8
  ret void

215:                                              ; preds = %211, %208
  %216 = landingpad { ptr, i32 }
          cleanup
  %217 = extractvalue { ptr, i32 } %216, 0
  store ptr %217, ptr %6, align 8
  %218 = extractvalue { ptr, i32 } %216, 1
  store i32 %218, ptr %7, align 4
  br label %219

219:                                              ; preds = %215, %204
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %220

220:                                              ; preds = %219, %181, %45
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  br label %221

221:                                              ; preds = %220, %32
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #8
  br label %222

222:                                              ; preds = %221
  %223 = load ptr, ptr %6, align 8
  %224 = load i32, ptr %7, align 4
  %225 = insertvalue { ptr, i32 } poison, ptr %223, 0
  %226 = insertvalue { ptr, i32 } %225, i32 %224, 1
  resume { ptr, i32 } %226
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !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::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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::array<long long, 2>, std::allocator<std::array<long long, 2>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::array<long long, 2>, std::allocator<std::array<long long, 2>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::array<long long, 2>, std::allocator<std::array<long long, 2>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::array<long long, 2>, std::allocator<std::array<long long, 2>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::array" = type { [2 x i64] }

@_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 uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca %"class.std::deque", align 8
  %7 = alloca %"struct.std::array", align 8
  %8 = alloca %"struct.std::array", align 8
  %9 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #8
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = add nsw i32 %13, 1
  %15 = sext i32 %14 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #8
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #8
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %15, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %16 unwind label %30

16:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #8
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %.not47 = icmp slt i32 %17, 1
  br i1 %.not47, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %34, %16
  %.lcssa = phi i32 [ %17, %16 ], [ %35, %34 ]
  %18 = add nsw i32 %.lcssa, 1
  %19 = zext i32 %18 to i64
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = add nsw i32 %20, 1
  %22 = zext i32 %21 to i64
  %23 = call ptr @llvm.stacksave.p0()
  %24 = mul nuw i64 %22, %19
  %25 = alloca i64, i64 %24, align 16
  %26 = shl nuw i64 %24, 3
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %25, i8 -63, i64 %26, i1 false)
  store i64 0, ptr %25, align 16, !tbaa !9
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %.not3658 = icmp slt i32 %27, 1
  br i1 %.not3658, label %._crit_edge62, label %.lr.ph61

.lr.ph61:                                         ; preds = %._crit_edge
  %28 = getelementptr inbounds i8, ptr %7, i64 8
  %29 = getelementptr inbounds i8, ptr %8, i64 8
  br label %41

30:                                               ; preds = %0
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #8
  br label %113

.lr.ph:                                           ; preds = %16, %34
  %indvars.iv = phi i64 [ %indvars.iv.next, %34 ], [ 1, %16 ]
  %32 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv) #8
  %33 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %32)
          to label %34 unwind label %37

34:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %35 = load i32, ptr %1, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %.not.not = icmp slt i64 %indvars.iv, %36
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

37:                                               ; preds = %.lr.ph
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %112

._crit_edge62:                                    ; preds = %._crit_edge57, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #8
  store i64 -1, ptr %9, align 8, !tbaa !9
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = icmp sgt i32 %39, 0
  br i1 %40, label %.lr.ph65, label %._crit_edge66

41:                                               ; preds = %.lr.ph61, %._crit_edge57
  %indvars.iv69 = phi i64 [ 1, %.lr.ph61 ], [ %indvars.iv.next70, %._crit_edge57 ]
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %6) #8
  invoke void @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %42 unwind label %55

42:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #8
  %43 = add nsw i64 %indvars.iv69, -1
  store i64 %43, ptr %7, align 8, !tbaa !9
  %44 = mul nuw nsw i64 %43, %22
  %45 = getelementptr inbounds i64, ptr %25, i64 %44
  %46 = getelementptr inbounds i64, ptr %45, i64 %43
  %47 = load i64, ptr %46, align 8, !tbaa !9
  store i64 %47, ptr %28, align 8, !tbaa !9
  invoke void @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %48 unwind label %57

48:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #8
  %49 = load i32, ptr %1, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %.not3755 = icmp sgt i64 %indvars.iv69, %50
  br i1 %.not3755, label %._crit_edge57, label %.preheader

.preheader:                                       ; preds = %48, %85
  %indvars.iv71 = phi i64 [ %indvars.iv.next72, %85 ], [ %indvars.iv69, %48 ]
  %51 = call noundef i64 @_ZNKSt5dequeISt5arrayIxLm2EESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %6) #8
  %.not3849 = icmp eq i64 %51, 0
  br i1 %.not3849, label %.critedge, label %.lr.ph50.preheader

.lr.ph50.preheader:                               ; preds = %.preheader
  %52 = trunc nuw nsw i64 %indvars.iv71 to i32
  br label %.lr.ph50

._crit_edge57:                                    ; preds = %85, %48
  call void @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #8
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %.not36.not = icmp slt i64 %indvars.iv69, %54
  br i1 %.not36.not, label %41, label %._crit_edge62, !llvm.loop !13

55:                                               ; preds = %41
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %91

57:                                               ; preds = %42
  %58 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #8
  br label %90

.lr.ph50:                                         ; preds = %.lr.ph50.preheader, %66
  %59 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %6) #8
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIxLm2EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %59, i64 noundef 0) #8
  %61 = load i64, ptr %60, align 8, !tbaa !9
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = sub nsw i32 %52, %62
  %64 = sext i32 %63 to i64
  %65 = icmp slt i64 %61, %64
  br i1 %65, label %66, label %.critedge

66:                                               ; preds = %.lr.ph50
  call void @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %6) #8
  %67 = call noundef i64 @_ZNKSt5dequeISt5arrayIxLm2EESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %6) #8
  %.not38 = icmp eq i64 %67, 0
  br i1 %.not38, label %.critedge, label %.lr.ph50, !llvm.loop !14

.critedge:                                        ; preds = %.lr.ph50, %66, %.preheader
  %68 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %6) #8
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIxLm2EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %68, i64 noundef 1) #8
  %70 = load i64, ptr %69, align 8, !tbaa !9
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv71) #8
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = add nsw i64 %70, %73
  %75 = mul nuw nsw i64 %indvars.iv71, %22
  %76 = getelementptr inbounds i64, ptr %25, i64 %75
  %77 = getelementptr inbounds i64, ptr %76, i64 %indvars.iv69
  store i64 %74, ptr %77, align 8, !tbaa !9
  %78 = getelementptr inbounds i64, ptr %76, i64 %43
  %79 = call noundef i64 @_ZNKSt5dequeISt5arrayIxLm2EESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %6) #8
  %.not3952 = icmp eq i64 %79, 0
  %.pre75 = load i64, ptr %78, align 8, !tbaa !9
  br i1 %.not3952, label %.critedge2, label %.lr.ph53

.lr.ph53:                                         ; preds = %.critedge, %83
  %80 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(80) %6) #8
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIxLm2EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %80, i64 noundef 1) #8
  %82 = load i64, ptr %81, align 8, !tbaa !9
  %.not40 = icmp slt i64 %.pre75, %82
  br i1 %.not40, label %.critedge2, label %83

83:                                               ; preds = %.lr.ph53
  call void @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(80) %6) #8
  %84 = call noundef i64 @_ZNKSt5dequeISt5arrayIxLm2EESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %6) #8
  %.not39 = icmp eq i64 %84, 0
  br i1 %.not39, label %.critedge2, label %.lr.ph53, !llvm.loop !15

.critedge2:                                       ; preds = %.lr.ph53, %83, %.critedge
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #8
  store i64 %indvars.iv71, ptr %8, align 8, !tbaa !9
  store i64 %.pre75, ptr %29, align 8, !tbaa !9
  invoke void @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %85 unwind label %88

85:                                               ; preds = %.critedge2
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #8
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %86 = load i32, ptr %1, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %.not37.not = icmp slt i64 %indvars.iv71, %87
  br i1 %.not37.not, label %.preheader, label %._crit_edge57, !llvm.loop !16

88:                                               ; preds = %.critedge2
  %89 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #8
  br label %90

90:                                               ; preds = %88, %57
  %.pn = phi { ptr, i32 } [ %89, %88 ], [ %58, %57 ]
  call void @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #8
  br label %91

91:                                               ; preds = %90, %55
  %.pn.pn = phi { ptr, i32 } [ %.pn, %90 ], [ %56, %55 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #8
  br label %112

._crit_edge66:                                    ; preds = %.lr.ph65, %._crit_edge62
  %92 = phi i64 [ -1, %._crit_edge62 ], [ %103, %.lr.ph65 ]
  %93 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %92)
          to label %107 unwind label %110

.lr.ph65:                                         ; preds = %._crit_edge62, %.lr.ph65
  %.063 = phi i32 [ %104, %.lr.ph65 ], [ 0, %._crit_edge62 ]
  %94 = load i32, ptr %1, align 4, !tbaa !5
  %95 = sub nsw i32 %94, %.063
  %96 = sext i32 %95 to i64
  %97 = mul nsw i64 %96, %22
  %98 = getelementptr inbounds i64, ptr %25, i64 %97
  %99 = load i32, ptr %3, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i64, ptr %98, i64 %100
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %101)
  %103 = load i64, ptr %102, align 8, !tbaa !9
  store i64 %103, ptr %9, align 8, !tbaa !9
  %104 = add nuw nsw i32 %.063, 1
  %105 = load i32, ptr %2, align 4, !tbaa !5
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %.lr.ph65, label %._crit_edge66, !llvm.loop !17

107:                                              ; preds = %._crit_edge66
  %108 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %93, ptr noundef nonnull @.str)
          to label %109 unwind label %110

109:                                              ; preds = %107
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.stackrestore.p0(ptr %23)
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret void

110:                                              ; preds = %107, %._crit_edge66
  %111 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  br label %112

112:                                              ; preds = %110, %91, %37
  %.pn43 = phi { ptr, i32 } [ %38, %37 ], [ %.pn.pn, %91 ], [ %111, %110 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  br label %113

113:                                              ; preds = %112, %30
  %.pn43.pn = phi { ptr, i32 } [ %.pn43, %112 ], [ %31, %30 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn43.pn
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeISt5arrayIxLm2EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 #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}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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