; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/386 Division 2/Problem F (F)

; 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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, 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" }
%"struct.std::pair.0" = type { i32, i32 }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@w = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@a = external dso_local global [200100 x i32], align 16
@t = external dso_local global [200100 x i32], align 16
@t2 = external dso_local global [200100 x i32], align 16
@q = external dso_local global %"class.std::set", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@__FUNCTION__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 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 i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair.0", align 4
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca %"struct.std::pair.0", align 4
  %13 = alloca %"struct.std::pair.0", align 4
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca %"struct.std::pair.0", align 4
  %16 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %17 = alloca %"struct.std::pair.0", align 4
  store i32 0, ptr %1, align 4
  %18 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %19 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %20 = getelementptr i8, ptr %19, i64 -24
  %21 = load i64, ptr %20, align 8
  %22 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %21
  %23 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %22, ptr noundef null)
  %24 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %25 = getelementptr i8, ptr %24, i64 -24
  %26 = load i64, ptr %25, align 8
  %27 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %26
  %28 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %27, ptr noundef null)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef nonnull align 4 dereferenceable(4) @w)
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %30, ptr noundef nonnull align 4 dereferenceable(4) @k)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !8
  br label %32

32:                                               ; preds = %42, %0
  %33 = load i32, ptr %2, align 4, !tbaa !8
  %34 = load i32, ptr @n, align 4, !tbaa !8
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %37, label %36

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

37:                                               ; preds = %32
  %38 = load i32, ptr %2, align 4, !tbaa !8
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %39
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %40)
  br label %42

42:                                               ; preds = %37
  %43 = load i32, ptr %2, align 4, !tbaa !8
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %2, align 4, !tbaa !8
  br label %32, !llvm.loop !11

45:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 0, ptr %3, align 4, !tbaa !8
  br label %46

46:                                               ; preds = %65, %45
  %47 = load i32, ptr %3, align 4, !tbaa !8
  %48 = load i32, ptr @n, align 4, !tbaa !8
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %68

51:                                               ; preds = %46
  %52 = load i32, ptr %3, align 4, !tbaa !8
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [200100 x i32], ptr @t, i64 0, i64 %53
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %54)
  %56 = load i32, ptr %3, align 4, !tbaa !8
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [200100 x i32], ptr @t, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !8
  %60 = add nsw i32 %59, 1
  %61 = sdiv i32 %60, 2
  %62 = load i32, ptr %3, align 4, !tbaa !8
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %63
  store i32 %61, ptr %64, align 4, !tbaa !8
  br label %65

65:                                               ; preds = %51
  %66 = load i32, ptr %3, align 4, !tbaa !8
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %3, align 4, !tbaa !8
  br label %46, !llvm.loop !13

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

69:                                               ; preds = %82, %68
  %70 = load i32, ptr %5, align 4, !tbaa !8
  %71 = load i32, ptr @n, align 4, !tbaa !8
  %72 = icmp slt i32 %70, %71
  br i1 %72, label %73, label %80

73:                                               ; preds = %69
  %74 = load i32, ptr %5, align 4, !tbaa !8
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !8
  %78 = load i32, ptr @k, align 4, !tbaa !8
  %79 = icmp sgt i32 %77, %78
  br label %80

80:                                               ; preds = %73, %69
  %81 = phi i1 [ false, %69 ], [ %79, %73 ]
  br i1 %81, label %82, label %85

82:                                               ; preds = %80
  %83 = load i32, ptr %5, align 4, !tbaa !8
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %5, align 4, !tbaa !8
  br label %69, !llvm.loop !14

85:                                               ; preds = %80
  %86 = load i32, ptr %5, align 4, !tbaa !8
  %87 = load i32, ptr @n, align 4, !tbaa !8
  %88 = icmp eq i32 %86, %87
  br i1 %88, label %89, label %92

89:                                               ; preds = %85
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %90, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  br label %356

92:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 0, ptr %8, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  %93 = load i32, ptr %5, align 4, !tbaa !8
  store i32 %93, ptr %9, align 4, !tbaa !8
  %94 = load i32, ptr %5, align 4, !tbaa !8
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !8
  store i32 %97, ptr %7, align 4, !tbaa !8
  %98 = load i32, ptr %5, align 4, !tbaa !8
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !8
  store i32 %101, ptr %8, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %102 = load i32, ptr %5, align 4, !tbaa !8
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %103
  %105 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %104, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i64 %105, ptr %10, align 4
  %106 = call { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @q, ptr noundef nonnull align 4 dereferenceable(8) %10)
  %107 = getelementptr inbounds { ptr, i8 }, ptr %11, i32 0, i32 0
  %108 = extractvalue { ptr, i8 } %106, 0
  store ptr %108, ptr %107, align 8
  %109 = getelementptr inbounds { ptr, i8 }, ptr %11, i32 0, i32 1
  %110 = extractvalue { ptr, i8 } %106, 1
  store i8 %110, ptr %109, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  %111 = load i32, ptr %5, align 4, !tbaa !8
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %5, align 4, !tbaa !8
  %113 = load i32, ptr %8, align 4, !tbaa !8
  store i32 %113, ptr %4, align 4, !tbaa !8
  br label %114

114:                                              ; preds = %351, %342, %183, %92
  %115 = load i32, ptr %5, align 4, !tbaa !8
  %116 = load i32, ptr @n, align 4, !tbaa !8
  %117 = icmp slt i32 %115, %116
  br i1 %117, label %118, label %352

118:                                              ; preds = %114
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @__FUNCTION__.main)
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %119, i8 noundef signext 32)
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %120, i32 noundef 86)
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %121, ptr noundef @.str)
  call void @_Z5traceIRiJS0_S0_EEvPKcOT_DpOT0_(ptr noundef @.str.2, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %5)
  br label %123

123:                                              ; preds = %171, %118
  %124 = load i32, ptr %7, align 4, !tbaa !8
  %125 = load i32, ptr %5, align 4, !tbaa !8
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !8
  %129 = add nsw i32 %124, %128
  %130 = load i32, ptr @k, align 4, !tbaa !8
  %131 = icmp sgt i32 %129, %130
  br i1 %131, label %132, label %136

132:                                              ; preds = %123
  %133 = load i32, ptr %9, align 4, !tbaa !8
  %134 = load i32, ptr %5, align 4, !tbaa !8
  %135 = icmp slt i32 %133, %134
  br label %136

136:                                              ; preds = %132, %123
  %137 = phi i1 [ false, %123 ], [ %135, %132 ]
  br i1 %137, label %138, label %174

138:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %139 = load i32, ptr %9, align 4, !tbaa !8
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %140
  %142 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %141, ptr noundef nonnull align 4 dereferenceable(4) %9)
  store i64 %142, ptr %12, align 4
  %143 = call noundef i64 @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5countERKS1_(ptr noundef nonnull align 8 dereferenceable(48) @q, ptr noundef nonnull align 4 dereferenceable(8) %12)
  %144 = icmp ne i64 %143, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br i1 %144, label %145, label %158

145:                                              ; preds = %138
  %146 = load i32, ptr %9, align 4, !tbaa !8
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !8
  %150 = load i32, ptr %7, align 4, !tbaa !8
  %151 = sub nsw i32 %150, %149
  store i32 %151, ptr %7, align 4, !tbaa !8
  %152 = load i32, ptr %9, align 4, !tbaa !8
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !8
  %156 = load i32, ptr %8, align 4, !tbaa !8
  %157 = sub nsw i32 %156, %155
  store i32 %157, ptr %8, align 4, !tbaa !8
  br label %171

158:                                              ; preds = %138
  %159 = load i32, ptr %9, align 4, !tbaa !8
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [200100 x i32], ptr @t, i64 0, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !8
  %163 = load i32, ptr %7, align 4, !tbaa !8
  %164 = sub nsw i32 %163, %162
  store i32 %164, ptr %7, align 4, !tbaa !8
  %165 = load i32, ptr %9, align 4, !tbaa !8
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !8
  %169 = load i32, ptr %8, align 4, !tbaa !8
  %170 = sub nsw i32 %169, %168
  store i32 %170, ptr %8, align 4, !tbaa !8
  br label %171

171:                                              ; preds = %158, %145
  %172 = load i32, ptr %9, align 4, !tbaa !8
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %9, align 4, !tbaa !8
  br label %123, !llvm.loop !15

174:                                              ; preds = %136
  %175 = load i32, ptr %7, align 4, !tbaa !8
  %176 = load i32, ptr %5, align 4, !tbaa !8
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %177
  %179 = load i32, ptr %178, align 4, !tbaa !8
  %180 = add nsw i32 %175, %179
  %181 = load i32, ptr @k, align 4, !tbaa !8
  %182 = icmp sgt i32 %180, %181
  br i1 %182, label %183, label %186

183:                                              ; preds = %174
  %184 = load i32, ptr %5, align 4, !tbaa !8
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %5, align 4, !tbaa !8
  br label %114, !llvm.loop !16

186:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %187 = load i32, ptr %5, align 4, !tbaa !8
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %188
  %190 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %189, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i64 %190, ptr %13, align 4
  %191 = call { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @q, ptr noundef nonnull align 4 dereferenceable(8) %13)
  %192 = getelementptr inbounds { ptr, i8 }, ptr %14, i32 0, i32 0
  %193 = extractvalue { ptr, i8 } %191, 0
  store ptr %193, ptr %192, align 8
  %194 = getelementptr inbounds { ptr, i8 }, ptr %14, i32 0, i32 1
  %195 = extractvalue { ptr, i8 } %191, 1
  store i8 %195, ptr %194, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  %196 = load i32, ptr %5, align 4, !tbaa !8
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !8
  %200 = load i32, ptr %7, align 4, !tbaa !8
  %201 = add nsw i32 %200, %199
  store i32 %201, ptr %7, align 4, !tbaa !8
  %202 = load i32, ptr %5, align 4, !tbaa !8
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %203
  %205 = load i32, ptr %204, align 4, !tbaa !8
  %206 = load i32, ptr %8, align 4, !tbaa !8
  %207 = add nsw i32 %206, %205
  store i32 %207, ptr %8, align 4, !tbaa !8
  %208 = call noundef i64 @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @q) #8
  %209 = load i32, ptr @w, align 4, !tbaa !8
  %210 = sext i32 %209 to i64
  %211 = icmp ugt i64 %208, %210
  br i1 %211, label %212, label %345

212:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %213 = call ptr @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @q) #8
  %214 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %16, i32 0, i32 0
  store ptr %213, ptr %214, align 8
  %215 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIiiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %215, i64 8, i1 false)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  %216 = call noundef i64 @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5eraseERKS1_(ptr noundef nonnull align 8 dereferenceable(48) @q, ptr noundef nonnull align 4 dereferenceable(8) %15)
  %217 = getelementptr inbounds %"struct.std::pair.0", ptr %15, i32 0, i32 1
  %218 = load i32, ptr %217, align 4, !tbaa !17
  %219 = load i32, ptr %5, align 4, !tbaa !8
  %220 = icmp eq i32 %218, %219
  br i1 %220, label %221, label %314

221:                                              ; preds = %212
  %222 = load i32, ptr %5, align 4, !tbaa !8
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %223
  %225 = load i32, ptr %224, align 4, !tbaa !8
  %226 = load i32, ptr %7, align 4, !tbaa !8
  %227 = sub nsw i32 %226, %225
  store i32 %227, ptr %7, align 4, !tbaa !8
  %228 = load i32, ptr %5, align 4, !tbaa !8
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %229
  %231 = load i32, ptr %230, align 4, !tbaa !8
  %232 = load i32, ptr %8, align 4, !tbaa !8
  %233 = sub nsw i32 %232, %231
  store i32 %233, ptr %8, align 4, !tbaa !8
  br label %234

234:                                              ; preds = %282, %221
  %235 = load i32, ptr %9, align 4, !tbaa !8
  %236 = load i32, ptr %5, align 4, !tbaa !8
  %237 = icmp slt i32 %235, %236
  br i1 %237, label %238, label %247

238:                                              ; preds = %234
  %239 = load i32, ptr %7, align 4, !tbaa !8
  %240 = load i32, ptr %5, align 4, !tbaa !8
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [200100 x i32], ptr @t, i64 0, i64 %241
  %243 = load i32, ptr %242, align 4, !tbaa !8
  %244 = add nsw i32 %239, %243
  %245 = load i32, ptr @k, align 4, !tbaa !8
  %246 = icmp sgt i32 %244, %245
  br label %247

247:                                              ; preds = %238, %234
  %248 = phi i1 [ false, %234 ], [ %246, %238 ]
  br i1 %248, label %249, label %285

249:                                              ; preds = %247
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %250 = load i32, ptr %9, align 4, !tbaa !8
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %251
  %253 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %252, ptr noundef nonnull align 4 dereferenceable(4) %9)
  store i64 %253, ptr %17, align 4
  %254 = call noundef i64 @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5countERKS1_(ptr noundef nonnull align 8 dereferenceable(48) @q, ptr noundef nonnull align 4 dereferenceable(8) %17)
  %255 = icmp ne i64 %254, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br i1 %255, label %256, label %269

256:                                              ; preds = %249
  %257 = load i32, ptr %9, align 4, !tbaa !8
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %258
  %260 = load i32, ptr %259, align 4, !tbaa !8
  %261 = load i32, ptr %7, align 4, !tbaa !8
  %262 = sub nsw i32 %261, %260
  store i32 %262, ptr %7, align 4, !tbaa !8
  %263 = load i32, ptr %9, align 4, !tbaa !8
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %264
  %266 = load i32, ptr %265, align 4, !tbaa !8
  %267 = load i32, ptr %8, align 4, !tbaa !8
  %268 = sub nsw i32 %267, %266
  store i32 %268, ptr %8, align 4, !tbaa !8
  br label %282

269:                                              ; preds = %249
  %270 = load i32, ptr %9, align 4, !tbaa !8
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [200100 x i32], ptr @t, i64 0, i64 %271
  %273 = load i32, ptr %272, align 4, !tbaa !8
  %274 = load i32, ptr %7, align 4, !tbaa !8
  %275 = sub nsw i32 %274, %273
  store i32 %275, ptr %7, align 4, !tbaa !8
  %276 = load i32, ptr %9, align 4, !tbaa !8
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %277
  %279 = load i32, ptr %278, align 4, !tbaa !8
  %280 = load i32, ptr %8, align 4, !tbaa !8
  %281 = sub nsw i32 %280, %279
  store i32 %281, ptr %8, align 4, !tbaa !8
  br label %282

282:                                              ; preds = %269, %256
  %283 = load i32, ptr %9, align 4, !tbaa !8
  %284 = add nsw i32 %283, 1
  store i32 %284, ptr %9, align 4, !tbaa !8
  br label %234, !llvm.loop !19

285:                                              ; preds = %247
  %286 = load i32, ptr %7, align 4, !tbaa !8
  %287 = load i32, ptr %5, align 4, !tbaa !8
  %288 = sext i32 %287 to i64
  %289 = getelementptr inbounds [200100 x i32], ptr @t, i64 0, i64 %288
  %290 = load i32, ptr %289, align 4, !tbaa !8
  %291 = add nsw i32 %286, %290
  %292 = load i32, ptr @k, align 4, !tbaa !8
  %293 = icmp sgt i32 %291, %292
  br i1 %293, label %294, label %297

294:                                              ; preds = %285
  %295 = load i32, ptr %5, align 4, !tbaa !8
  %296 = add nsw i32 %295, 1
  store i32 %296, ptr %5, align 4, !tbaa !8
  store i32 10, ptr %6, align 4
  br label %342, !llvm.loop !16

297:                                              ; preds = %285
  %298 = load i32, ptr %5, align 4, !tbaa !8
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds [200100 x i32], ptr @t, i64 0, i64 %299
  %301 = load i32, ptr %300, align 4, !tbaa !8
  %302 = load i32, ptr %7, align 4, !tbaa !8
  %303 = add nsw i32 %302, %301
  store i32 %303, ptr %7, align 4, !tbaa !8
  %304 = load i32, ptr %5, align 4, !tbaa !8
  %305 = sext i32 %304 to i64
  %306 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %305
  %307 = load i32, ptr %306, align 4, !tbaa !8
  %308 = load i32, ptr %8, align 4, !tbaa !8
  %309 = add nsw i32 %308, %307
  store i32 %309, ptr %8, align 4, !tbaa !8
  %310 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %311 = load i32, ptr %310, align 4, !tbaa !8
  store i32 %311, ptr %4, align 4, !tbaa !8
  %312 = load i32, ptr %5, align 4, !tbaa !8
  %313 = add nsw i32 %312, 1
  store i32 %313, ptr %5, align 4, !tbaa !8
  store i32 10, ptr %6, align 4
  br label %342, !llvm.loop !16

314:                                              ; preds = %212
  %315 = getelementptr inbounds %"struct.std::pair.0", ptr %15, i32 0, i32 1
  %316 = load i32, ptr %315, align 4, !tbaa !17
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %317
  %319 = load i32, ptr %318, align 4, !tbaa !8
  %320 = load i32, ptr %7, align 4, !tbaa !8
  %321 = sub nsw i32 %320, %319
  store i32 %321, ptr %7, align 4, !tbaa !8
  %322 = getelementptr inbounds %"struct.std::pair.0", ptr %15, i32 0, i32 1
  %323 = load i32, ptr %322, align 4, !tbaa !17
  %324 = sext i32 %323 to i64
  %325 = getelementptr inbounds [200100 x i32], ptr @t, i64 0, i64 %324
  %326 = load i32, ptr %325, align 4, !tbaa !8
  %327 = load i32, ptr %7, align 4, !tbaa !8
  %328 = add nsw i32 %327, %326
  store i32 %328, ptr %7, align 4, !tbaa !8
  %329 = load i32, ptr %5, align 4, !tbaa !8
  %330 = sext i32 %329 to i64
  %331 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %330
  %332 = load i32, ptr %331, align 4, !tbaa !8
  %333 = load i32, ptr %7, align 4, !tbaa !8
  %334 = sub nsw i32 %333, %332
  store i32 %334, ptr %7, align 4, !tbaa !8
  %335 = load i32, ptr %5, align 4, !tbaa !8
  %336 = sext i32 %335 to i64
  %337 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %336
  %338 = load i32, ptr %337, align 4, !tbaa !8
  %339 = load i32, ptr %8, align 4, !tbaa !8
  %340 = sub nsw i32 %339, %338
  store i32 %340, ptr %8, align 4, !tbaa !8
  br label %341

341:                                              ; preds = %314
  store i32 0, ptr %6, align 4
  br label %342

342:                                              ; preds = %341, %297, %294
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  %343 = load i32, ptr %6, align 4
  switch i32 %343, label %358 [
    i32 0, label %344
    i32 10, label %114
  ]

344:                                              ; preds = %342
  br label %350

345:                                              ; preds = %186
  %346 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %347 = load i32, ptr %346, align 4, !tbaa !8
  store i32 %347, ptr %4, align 4, !tbaa !8
  %348 = load i32, ptr %5, align 4, !tbaa !8
  %349 = add nsw i32 %348, 1
  store i32 %349, ptr %5, align 4, !tbaa !8
  br label %350

350:                                              ; preds = %345, %344
  br label %351

351:                                              ; preds = %350
  br label %114, !llvm.loop !16

352:                                              ; preds = %114
  %353 = load i32, ptr %4, align 4, !tbaa !8
  %354 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %353)
  %355 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %354, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %356

356:                                              ; preds = %352, %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  %357 = load i32, ptr %1, align 4
  ret i32 %357

358:                                              ; preds = %342
  unreachable
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

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

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(8)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5countERKS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(8)) #4 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5eraseERKS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(8)) #4 align 2

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !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 = !{!18, !9, i64 4}
!18 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, 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" }
%"struct.std::pair.0" = type { i32, i32 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@w = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@a = external dso_local global [200100 x i32], align 16
@t = external dso_local global [200100 x i32], align 16
@t2 = external dso_local global [200100 x i32], align 16
@q = external dso_local global %"class.std::set", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@__FUNCTION__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair.0", align 8
  %7 = alloca %"struct.std::pair.0", align 8
  %8 = alloca %"struct.std::pair.0", align 8
  %9 = alloca %"struct.std::pair.0", align 8
  %10 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %11 = alloca %"struct.std::pair.0", align 8
  %12 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %13 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %14 = getelementptr i8, ptr %13, i64 -24
  %15 = load i64, ptr %14, align 8
  %16 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %15
  %17 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %16, ptr noundef null)
  %18 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %19 = getelementptr i8, ptr %18, i64 -24
  %20 = load i64, ptr %19, align 8
  %21 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %20
  %22 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %21, ptr noundef null)
  %23 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %24 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 4 dereferenceable(4) @w)
  %25 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 4 dereferenceable(4) @k)
  %26 = load i32, ptr @n, align 4, !tbaa !8
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph, label %._crit_edge.thread

.preheader:                                       ; preds = %.lr.ph
  %28 = icmp sgt i32 %31, 0
  br i1 %28, label %.lr.ph33, label %._crit_edge.thread

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %29 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %indvars.iv
  %30 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %29)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %31 = load i32, ptr @n, align 4, !tbaa !8
  %32 = sext i32 %31 to i64
  %33 = icmp slt i64 %indvars.iv.next, %32
  br i1 %33, label %.lr.ph, label %.preheader, !llvm.loop !11

._crit_edge.thread:                               ; preds = %.preheader, %0
  %.lcssa30.ph = phi i32 [ %31, %.preheader ], [ %26, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  br label %.critedge

._crit_edge:                                      ; preds = %.lr.ph33
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %34 = icmp sgt i32 %42, 0
  br i1 %34, label %.lr.ph37, label %.critedge

.lr.ph37:                                         ; preds = %._crit_edge
  %35 = load i32, ptr @k, align 4, !tbaa !8
  %wide.trip.count = zext nneg i32 %42 to i64
  br label %45

.lr.ph33:                                         ; preds = %.preheader, %.lr.ph33
  %indvars.iv63 = phi i64 [ %indvars.iv.next64, %.lr.ph33 ], [ 0, %.preheader ]
  %36 = getelementptr inbounds [200100 x i32], ptr @t, i64 0, i64 %indvars.iv63
  %37 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %36)
  %38 = load i32, ptr %36, align 4, !tbaa !8
  %39 = add nsw i32 %38, 1
  %40 = sdiv i32 %39, 2
  %41 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %indvars.iv63
  store i32 %40, ptr %41, align 4, !tbaa !8
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %42 = load i32, ptr @n, align 4, !tbaa !8
  %43 = sext i32 %42 to i64
  %44 = icmp slt i64 %indvars.iv.next64, %43
  br i1 %44, label %.lr.ph33, label %._crit_edge, !llvm.loop !13

45:                                               ; preds = %.lr.ph37, %49
  %indvars.iv66 = phi i64 [ 0, %.lr.ph37 ], [ %indvars.iv.next67, %49 ]
  %46 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %indvars.iv66
  %47 = load i32, ptr %46, align 4, !tbaa !8
  %48 = icmp sgt i32 %47, %35
  br i1 %48, label %49, label %.critedge.loopexit

49:                                               ; preds = %45
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next67, %wide.trip.count
  br i1 %exitcond.not, label %.critedge.thread, label %45, !llvm.loop !14

.critedge.loopexit:                               ; preds = %45
  %50 = trunc nuw nsw i64 %indvars.iv66 to i32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %._crit_edge.thread, %._crit_edge
  %.lcssa3073 = phi i32 [ %42, %._crit_edge ], [ %.lcssa30.ph, %._crit_edge.thread ], [ %42, %.critedge.loopexit ]
  %storemerge.lcssa34 = phi i32 [ 0, %._crit_edge ], [ 0, %._crit_edge.thread ], [ %50, %.critedge.loopexit ]
  store i32 %storemerge.lcssa34, ptr %2, align 4, !tbaa !8
  %51 = icmp eq i32 %storemerge.lcssa34, %.lcssa3073
  br i1 %51, label %.critedge.thread, label %54

.critedge.thread:                                 ; preds = %49, %.critedge
  %52 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %53 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %215

54:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store i32 %storemerge.lcssa34, ptr %5, align 4, !tbaa !8
  %55 = zext nneg i32 %storemerge.lcssa34 to i64
  %56 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !8
  store i32 %57, ptr %3, align 4, !tbaa !8
  %58 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %55
  %59 = load i32, ptr %58, align 4, !tbaa !8
  store i32 %59, ptr %4, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %60 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %56, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %60, ptr %6, align 8
  %61 = call { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @q, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  %62 = load i32, ptr %2, align 4, !tbaa !8
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %2, align 4, !tbaa !8
  store i32 %59, ptr %1, align 4, !tbaa !8
  %64 = load i32, ptr @n, align 4, !tbaa !8
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %.lr.ph56, label %._crit_edge57

.lr.ph56:                                         ; preds = %54
  %66 = getelementptr inbounds i8, ptr %9, i64 4
  br label %67

67:                                               ; preds = %.lr.ph56, %.backedge
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @__FUNCTION__.main)
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %68, i8 noundef signext 32)
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %69, i32 noundef 86)
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef nonnull @.str)
  call void @_Z5traceIRiJS0_S0_EEvPKcOT_DpOT0_(ptr noundef nonnull @.str.2, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %72 = load i32, ptr %3, align 4, !tbaa !8
  %73 = load i32, ptr %2, align 4
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !8
  %77 = add nsw i32 %76, %72
  %78 = load i32, ptr @k, align 4, !tbaa !8
  %79 = icmp sgt i32 %77, %78
  %80 = load i32, ptr %5, align 4
  %81 = icmp slt i32 %80, %73
  %82 = select i1 %79, i1 %81, i1 false
  br i1 %82, label %.lr.ph45, label %._crit_edge46

.lr.ph45:                                         ; preds = %67, %.lr.ph45
  %83 = phi i32 [ %98, %.lr.ph45 ], [ %80, %67 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %84
  %86 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %85, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i64 %86, ptr %7, align 8
  %87 = call noundef i64 @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5countERKS1_(ptr noundef nonnull align 8 dereferenceable(48) @q, ptr noundef nonnull align 4 dereferenceable(8) %7)
  %.not22 = icmp eq i64 %87, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  %88 = load i32, ptr %5, align 4, !tbaa !8
  %89 = sext i32 %88 to i64
  %90 = load i32, ptr %3, align 4, !tbaa !8
  %91 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %89
  %92 = load i32, ptr %91, align 4, !tbaa !8
  %93 = load i32, ptr %4, align 4, !tbaa !8
  %94 = sub nsw i32 %93, %92
  %t.t2 = select i1 %.not22, ptr @t, ptr @t2
  %95 = getelementptr inbounds [200100 x i32], ptr %t.t2, i64 0, i64 %89
  %96 = load i32, ptr %95, align 4, !tbaa !8
  %97 = sub nsw i32 %90, %96
  store i32 %97, ptr %3, align 4
  store i32 %94, ptr %4, align 4, !tbaa !8
  %98 = add nsw i32 %88, 1
  store i32 %98, ptr %5, align 4, !tbaa !8
  %99 = load i32, ptr %2, align 4
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !8
  %103 = add nsw i32 %102, %97
  %104 = load i32, ptr @k, align 4, !tbaa !8
  %105 = icmp sgt i32 %103, %104
  %106 = icmp slt i32 %98, %99
  %107 = select i1 %105, i1 %106, i1 false
  br i1 %107, label %.lr.ph45, label %._crit_edge46, !llvm.loop !15

._crit_edge46:                                    ; preds = %.lr.ph45, %67
  %.lcssa43 = phi i64 [ %74, %67 ], [ %100, %.lr.ph45 ]
  %.lcssa28 = phi i32 [ %73, %67 ], [ %99, %.lr.ph45 ]
  %.lcssa = phi i1 [ %79, %67 ], [ %105, %.lr.ph45 ]
  br i1 %.lcssa, label %108, label %113

108:                                              ; preds = %._crit_edge46
  %109 = add nsw i32 %.lcssa28, 1
  store i32 %109, ptr %2, align 4, !tbaa !8
  br label %.backedge

.backedge:                                        ; preds = %207, %.thread, %108, %206
  %110 = phi i32 [ %211, %207 ], [ %137, %.thread ], [ %109, %108 ], [ %storemerge26, %206 ]
  %111 = load i32, ptr @n, align 4, !tbaa !8
  %112 = icmp slt i32 %110, %111
  br i1 %112, label %67, label %._crit_edge57.loopexit, !llvm.loop !16

113:                                              ; preds = %._crit_edge46
  %114 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %.lcssa43
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %115 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %114, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %115, ptr %8, align 8
  %116 = call { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @q, ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  %117 = load i32, ptr %2, align 4, !tbaa !8
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !8
  %121 = load i32, ptr %3, align 4, !tbaa !8
  %122 = add nsw i32 %121, %120
  store i32 %122, ptr %3, align 4, !tbaa !8
  %123 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %118
  %124 = load i32, ptr %123, align 4, !tbaa !8
  %125 = load i32, ptr %4, align 4, !tbaa !8
  %126 = add nsw i32 %125, %124
  store i32 %126, ptr %4, align 4, !tbaa !8
  %127 = call noundef i64 @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @q) #7
  %128 = load i32, ptr @w, align 4, !tbaa !8
  %129 = sext i32 %128 to i64
  %130 = icmp ugt i64 %127, %129
  br i1 %130, label %131, label %207

131:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %132 = call ptr @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @q) #7
  store ptr %132, ptr %10, align 8
  %133 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIiiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %134 = load i64, ptr %133, align 4
  store i64 %134, ptr %9, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  %135 = call noundef i64 @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5eraseERKS1_(ptr noundef nonnull align 8 dereferenceable(48) @q, ptr noundef nonnull align 4 dereferenceable(8) %9)
  %136 = load i32, ptr %66, align 4, !tbaa !17
  %137 = load i32, ptr %2, align 4, !tbaa !8
  %138 = icmp eq i32 %136, %137
  %139 = sext i32 %136 to i64
  %140 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !8
  %142 = load i32, ptr %3, align 4, !tbaa !8
  %143 = sub nsw i32 %142, %141
  br i1 %138, label %144, label %.thread

144:                                              ; preds = %131
  store i32 %143, ptr %3, align 4, !tbaa !8
  %145 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %139
  %146 = load i32, ptr %145, align 4, !tbaa !8
  %147 = load i32, ptr %4, align 4, !tbaa !8
  %148 = sub nsw i32 %147, %146
  store i32 %148, ptr %4, align 4, !tbaa !8
  %149 = load i32, ptr %5, align 4, !tbaa !8
  %150 = icmp slt i32 %149, %136
  br i1 %150, label %.lr.ph51.preheader, label %.critedge2

.lr.ph51.preheader:                               ; preds = %144
  %151 = sext i32 %136 to i64
  %152 = getelementptr inbounds [200100 x i32], ptr @t, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !8
  %154 = add nsw i32 %153, %143
  %155 = load i32, ptr @k, align 4, !tbaa !8
  %156 = icmp sgt i32 %154, %155
  br i1 %156, label %.lr.ph113, label %.critedge2

.lr.ph51:                                         ; preds = %.lr.ph113
  %157 = getelementptr inbounds [200100 x i32], ptr @t, i64 0, i64 %180
  %158 = load i32, ptr %157, align 4, !tbaa !8
  %159 = add nsw i32 %158, %176
  %160 = load i32, ptr @k, align 4, !tbaa !8
  %161 = icmp sgt i32 %159, %160
  br i1 %161, label %.lr.ph113, label %.critedge2, !llvm.loop !19

.lr.ph113:                                        ; preds = %.lr.ph51.preheader, %.lr.ph51
  %162 = phi i32 [ %177, %.lr.ph51 ], [ %149, %.lr.ph51.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %163
  %165 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %164, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i64 %165, ptr %11, align 8
  %166 = call noundef i64 @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5countERKS1_(ptr noundef nonnull align 8 dereferenceable(48) @q, ptr noundef nonnull align 4 dereferenceable(8) %11)
  %.not = icmp eq i64 %166, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  %167 = load i32, ptr %5, align 4, !tbaa !8
  %168 = sext i32 %167 to i64
  %169 = load i32, ptr %3, align 4, !tbaa !8
  %170 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %168
  %171 = load i32, ptr %170, align 4, !tbaa !8
  %172 = load i32, ptr %4, align 4, !tbaa !8
  %173 = sub nsw i32 %172, %171
  %t.t295 = select i1 %.not, ptr @t, ptr @t2
  %174 = getelementptr inbounds [200100 x i32], ptr %t.t295, i64 0, i64 %168
  %175 = load i32, ptr %174, align 4, !tbaa !8
  %176 = sub nsw i32 %169, %175
  store i32 %176, ptr %3, align 4
  store i32 %173, ptr %4, align 4, !tbaa !8
  %177 = add nsw i32 %167, 1
  store i32 %177, ptr %5, align 4, !tbaa !8
  %178 = load i32, ptr %2, align 4, !tbaa !8
  %179 = icmp slt i32 %177, %178
  %180 = sext i32 %178 to i64
  br i1 %179, label %.lr.ph51, label %.critedge2, !llvm.loop !19

.critedge2:                                       ; preds = %.lr.ph51, %.lr.ph113, %.lr.ph51.preheader, %144
  %.pre-phi = phi i64 [ %139, %144 ], [ %151, %.lr.ph51.preheader ], [ %180, %.lr.ph113 ], [ %180, %.lr.ph51 ]
  %181 = phi i32 [ %148, %144 ], [ %148, %.lr.ph51.preheader ], [ %173, %.lr.ph113 ], [ %173, %.lr.ph51 ]
  %182 = phi i32 [ %143, %144 ], [ %143, %.lr.ph51.preheader ], [ %176, %.lr.ph113 ], [ %176, %.lr.ph51 ]
  %.lcssa29 = phi i32 [ %136, %144 ], [ %136, %.lr.ph51.preheader ], [ %178, %.lr.ph113 ], [ %178, %.lr.ph51 ]
  %183 = getelementptr inbounds [200100 x i32], ptr @t, i64 0, i64 %.pre-phi
  %184 = load i32, ptr %183, align 4, !tbaa !8
  %185 = add nsw i32 %184, %182
  %186 = load i32, ptr @k, align 4, !tbaa !8
  %187 = icmp sgt i32 %185, %186
  br i1 %187, label %206, label %188, !llvm.loop !16

188:                                              ; preds = %.critedge2
  store i32 %185, ptr %3, align 4, !tbaa !8
  %189 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %.pre-phi
  %190 = load i32, ptr %189, align 4, !tbaa !8
  %191 = add nsw i32 %181, %190
  store i32 %191, ptr %4, align 4, !tbaa !8
  %192 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %193 = load i32, ptr %192, align 4, !tbaa !8
  store i32 %193, ptr %1, align 4, !tbaa !8
  %194 = load i32, ptr %2, align 4, !tbaa !8
  br label %206, !llvm.loop !16

.thread:                                          ; preds = %131
  %195 = getelementptr inbounds [200100 x i32], ptr @t, i64 0, i64 %139
  %196 = load i32, ptr %195, align 4, !tbaa !8
  %197 = add nsw i32 %196, %143
  %198 = sext i32 %137 to i64
  %199 = getelementptr inbounds [200100 x i32], ptr @t2, i64 0, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !8
  %201 = sub nsw i32 %197, %200
  store i32 %201, ptr %3, align 4, !tbaa !8
  %202 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %198
  %203 = load i32, ptr %202, align 4, !tbaa !8
  %204 = load i32, ptr %4, align 4, !tbaa !8
  %205 = sub nsw i32 %204, %203
  store i32 %205, ptr %4, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  br label %.backedge

206:                                              ; preds = %.critedge2, %188
  %storemerge26.in = phi i32 [ %194, %188 ], [ %.lcssa29, %.critedge2 ]
  %storemerge26 = add nsw i32 %storemerge26.in, 1
  store i32 %storemerge26, ptr %2, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  br label %.backedge

207:                                              ; preds = %113
  %208 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %209 = load i32, ptr %208, align 4, !tbaa !8
  store i32 %209, ptr %1, align 4, !tbaa !8
  %210 = load i32, ptr %2, align 4, !tbaa !8
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %2, align 4, !tbaa !8
  br label %.backedge

._crit_edge57.loopexit:                           ; preds = %.backedge
  %.pre = load i32, ptr %1, align 4, !tbaa !8
  br label %._crit_edge57

._crit_edge57:                                    ; preds = %._crit_edge57.loopexit, %54
  %212 = phi i32 [ %.pre, %._crit_edge57.loopexit ], [ %59, %54 ]
  %213 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %212)
  %214 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %213, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br label %215

215:                                              ; preds = %._crit_edge57, %.critedge.thread
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 2

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

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) 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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #5

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5countERKS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5eraseERKS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4 align 2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !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 = !{!18, !9, i64 4}
!18 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!19 = distinct !{!19, !12}


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