; LLVM IR from eyangch/competitive-programming :: Codeforces/1307 (d)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::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 }
%"struct.std::pair" = type { i32, i32 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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 void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #2 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca [200000 x %"class.std::vector"], align 16
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca [200000 x i32], align 16
  %17 = alloca [200000 x i32], align 16
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  %20 = alloca %"struct.std::pair", align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %26 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %27 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %28 = getelementptr i8, ptr %27, i64 -24
  %29 = load i64, ptr %28, align 8
  %30 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %29
  %31 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %30, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %33, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %35 = load i32, ptr %4, align 4, !tbaa !8
  %36 = zext i32 %35 to i64
  %37 = call ptr @llvm.stacksave.p0()
  store ptr %37, ptr %5, align 8
  %38 = alloca i32, i64 %36, align 16
  store i64 %36, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !8
  br label %39

39:                                               ; preds = %54, %0
  %40 = load i32, ptr %7, align 4, !tbaa !8
  %41 = load i32, ptr %4, align 4, !tbaa !8
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %57

44:                                               ; preds = %39
  %45 = load i32, ptr %7, align 4, !tbaa !8
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %38, i64 %46
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %47)
  %49 = load i32, ptr %7, align 4, !tbaa !8
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i32, ptr %38, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !8
  %53 = add nsw i32 %52, -1
  store i32 %53, ptr %51, align 4, !tbaa !8
  br label %54

54:                                               ; preds = %44
  %55 = load i32, ptr %7, align 4, !tbaa !8
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %7, align 4, !tbaa !8
  br label %39, !llvm.loop !11

57:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4800000, ptr %8) #8
  %58 = getelementptr inbounds [200000 x %"class.std::vector"], ptr %8, i32 0, i32 0
  %59 = getelementptr inbounds %"class.std::vector", ptr %58, i64 200000
  br label %60

60:                                               ; preds = %60, %57
  %61 = phi ptr [ %58, %57 ], [ %62, %60 ]
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %61) #8
  %62 = getelementptr inbounds %"class.std::vector", ptr %61, i64 1
  %63 = icmp eq ptr %62, %59
  br i1 %63, label %64, label %60

64:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !8
  br label %65

65:                                               ; preds = %89, %64
  %66 = load i32, ptr %9, align 4, !tbaa !8
  %67 = load i32, ptr %3, align 4, !tbaa !8
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %105

70:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  %71 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %72 unwind label %92

72:                                               ; preds = %70
  %73 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %71, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %74 unwind label %92

74:                                               ; preds = %72
  %75 = load i32, ptr %10, align 4, !tbaa !8
  %76 = sub nsw i32 %75, 1
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [200000 x %"class.std::vector"], ptr %8, i64 0, i64 %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %79 = load i32, ptr %11, align 4, !tbaa !8
  %80 = sub nsw i32 %79, 1
  store i32 %80, ptr %14, align 4, !tbaa !8
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %78, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %81 unwind label %96

81:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  %82 = load i32, ptr %11, align 4, !tbaa !8
  %83 = sub nsw i32 %82, 1
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [200000 x %"class.std::vector"], ptr %8, i64 0, i64 %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %86 = load i32, ptr %10, align 4, !tbaa !8
  %87 = sub nsw i32 %86, 1
  store i32 %87, ptr %15, align 4, !tbaa !8
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %85, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %88 unwind label %100

88:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %89

89:                                               ; preds = %88
  %90 = load i32, ptr %9, align 4, !tbaa !8
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %9, align 4, !tbaa !8
  br label %65, !llvm.loop !13

92:                                               ; preds = %72, %70
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %12, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %13, align 4
  br label %104

96:                                               ; preds = %74
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %12, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %104

100:                                              ; preds = %81
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %12, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %104

104:                                              ; preds = %100, %96, %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %246

105:                                              ; preds = %69
  call void @llvm.lifetime.start.p0(i64 800000, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 800000, ptr %17) #8
  %106 = load i32, ptr %2, align 4, !tbaa !8
  %107 = getelementptr inbounds [200000 x %"class.std::vector"], ptr %8, i64 0, i64 0
  invoke void @_Z3bfsiPSt6vectorIiSaIiEEiRA200000_i(i32 noundef %106, ptr noundef %107, i32 noundef 0, ptr noundef nonnull align 4 dereferenceable(800000) %16)
          to label %108 unwind label %131

108:                                              ; preds = %105
  %109 = load i32, ptr %2, align 4, !tbaa !8
  %110 = getelementptr inbounds [200000 x %"class.std::vector"], ptr %8, i64 0, i64 0
  %111 = load i32, ptr %2, align 4, !tbaa !8
  %112 = sub nsw i32 %111, 1
  invoke void @_Z3bfsiPSt6vectorIiSaIiEEiRA200000_i(i32 noundef %109, ptr noundef %110, i32 noundef %112, ptr noundef nonnull align 4 dereferenceable(800000) %17)
          to label %113 unwind label %131

113:                                              ; preds = %108
  %114 = load i32, ptr %4, align 4, !tbaa !8
  %115 = zext i32 %114 to i64
  %116 = alloca %"struct.std::pair", i64 %115, align 16
  store i64 %115, ptr %18, align 8
  %117 = icmp eq i64 %115, 0
  br i1 %117, label %125, label %118

118:                                              ; preds = %113
  %119 = getelementptr inbounds %"struct.std::pair", ptr %116, i64 %115
  br label %120

120:                                              ; preds = %122, %118
  %121 = phi ptr [ %116, %118 ], [ %123, %122 ]
  invoke void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %121)
          to label %122 unwind label %131

122:                                              ; preds = %120
  %123 = getelementptr inbounds %"struct.std::pair", ptr %121, i64 1
  %124 = icmp eq ptr %123, %119
  br i1 %124, label %125, label %120

125:                                              ; preds = %122, %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  store i32 0, ptr %19, align 4, !tbaa !8
  br label %126

126:                                              ; preds = %159, %125
  %127 = load i32, ptr %19, align 4, !tbaa !8
  %128 = load i32, ptr %4, align 4, !tbaa !8
  %129 = icmp slt i32 %127, %128
  br i1 %129, label %135, label %130

130:                                              ; preds = %126
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %166

131:                                              ; preds = %166, %120, %108, %105
  %132 = landingpad { ptr, i32 }
          cleanup
  %133 = extractvalue { ptr, i32 } %132, 0
  store ptr %133, ptr %12, align 8
  %134 = extractvalue { ptr, i32 } %132, 1
  store i32 %134, ptr %13, align 4
  br label %238

135:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %136 = load i32, ptr %19, align 4, !tbaa !8
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds i32, ptr %38, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !8
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [200000 x i32], ptr %16, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !8
  %143 = load i32, ptr %19, align 4, !tbaa !8
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds i32, ptr %38, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !8
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [200000 x i32], ptr %17, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !8
  %150 = sub nsw i32 %142, %149
  store i32 %150, ptr %21, align 4, !tbaa !8
  %151 = load i32, ptr %19, align 4, !tbaa !8
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds i32, ptr %38, i64 %152
  invoke void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %20, ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %153)
          to label %154 unwind label %162

154:                                              ; preds = %135
  %155 = load i32, ptr %19, align 4, !tbaa !8
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds %"struct.std::pair", ptr %116, i64 %156
  %158 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %157, ptr noundef nonnull align 4 dereferenceable(8) %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br label %159

159:                                              ; preds = %154
  %160 = load i32, ptr %19, align 4, !tbaa !8
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %19, align 4, !tbaa !8
  br label %126, !llvm.loop !14

162:                                              ; preds = %135
  %163 = landingpad { ptr, i32 }
          cleanup
  %164 = extractvalue { ptr, i32 } %163, 0
  store ptr %164, ptr %12, align 8
  %165 = extractvalue { ptr, i32 } %163, 1
  store i32 %165, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %238

166:                                              ; preds = %130
  %167 = load i32, ptr %4, align 4, !tbaa !8
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds %"struct.std::pair", ptr %116, i64 %168
  invoke void @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef %116, ptr noundef %169)
          to label %170 unwind label %131

170:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  store i32 0, ptr %22, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %171 = getelementptr inbounds %"struct.std::pair", ptr %116, i64 0
  %172 = getelementptr inbounds %"struct.std::pair", ptr %171, i32 0, i32 1
  %173 = load i32, ptr %172, align 4, !tbaa !15
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [200000 x i32], ptr %16, i64 0, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !8
  store i32 %176, ptr %23, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  store i32 1, ptr %24, align 4, !tbaa !8
  br label %177

177:                                              ; preds = %207, %170
  %178 = load i32, ptr %24, align 4, !tbaa !8
  %179 = load i32, ptr %4, align 4, !tbaa !8
  %180 = icmp slt i32 %178, %179
  br i1 %180, label %182, label %181

181:                                              ; preds = %177
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %219

182:                                              ; preds = %177
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  %183 = load i32, ptr %23, align 4, !tbaa !8
  %184 = load i32, ptr %24, align 4, !tbaa !8
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds %"struct.std::pair", ptr %116, i64 %185
  %187 = getelementptr inbounds %"struct.std::pair", ptr %186, i32 0, i32 1
  %188 = load i32, ptr %187, align 4, !tbaa !15
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [200000 x i32], ptr %17, i64 0, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !8
  %192 = add nsw i32 %183, %191
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %25, align 4, !tbaa !8
  %194 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %22, ptr noundef nonnull align 4 dereferenceable(4) %25)
          to label %195 unwind label %210

195:                                              ; preds = %182
  %196 = load i32, ptr %194, align 4, !tbaa !8
  store i32 %196, ptr %22, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  %197 = load i32, ptr %24, align 4, !tbaa !8
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds %"struct.std::pair", ptr %116, i64 %198
  %200 = getelementptr inbounds %"struct.std::pair", ptr %199, i32 0, i32 1
  %201 = load i32, ptr %200, align 4, !tbaa !15
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [200000 x i32], ptr %16, i64 0, i64 %202
  %204 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %203)
          to label %205 unwind label %214

205:                                              ; preds = %195
  %206 = load i32, ptr %204, align 4, !tbaa !8
  store i32 %206, ptr %23, align 4, !tbaa !8
  br label %207

207:                                              ; preds = %205
  %208 = load i32, ptr %24, align 4, !tbaa !8
  %209 = add nsw i32 %208, 1
  store i32 %209, ptr %24, align 4, !tbaa !8
  br label %177, !llvm.loop !17

210:                                              ; preds = %182
  %211 = landingpad { ptr, i32 }
          cleanup
  %212 = extractvalue { ptr, i32 } %211, 0
  store ptr %212, ptr %12, align 8
  %213 = extractvalue { ptr, i32 } %211, 1
  store i32 %213, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  br label %218

214:                                              ; preds = %195
  %215 = landingpad { ptr, i32 }
          cleanup
  %216 = extractvalue { ptr, i32 } %215, 0
  store ptr %216, ptr %12, align 8
  %217 = extractvalue { ptr, i32 } %215, 1
  store i32 %217, ptr %13, align 4
  br label %218

218:                                              ; preds = %214, %210
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %237

219:                                              ; preds = %181
  %220 = load i32, ptr %2, align 4, !tbaa !8
  %221 = sub nsw i32 %220, 1
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [200000 x i32], ptr %16, i64 0, i64 %222
  %224 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %22, ptr noundef nonnull align 4 dereferenceable(4) %223)
          to label %225 unwind label %233

225:                                              ; preds = %219
  %226 = load i32, ptr %224, align 4, !tbaa !8
  %227 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %226)
          to label %228 unwind label %233

228:                                              ; preds = %225
  %229 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %227, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %230 unwind label %233

230:                                              ; preds = %228
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 800000, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 800000, ptr %16) #8
  %231 = getelementptr inbounds [200000 x %"class.std::vector"], ptr %8, i32 0, i32 0
  %232 = getelementptr inbounds %"class.std::vector", ptr %231, i64 200000
  br label %239

233:                                              ; preds = %228, %225, %219
  %234 = landingpad { ptr, i32 }
          cleanup
  %235 = extractvalue { ptr, i32 } %234, 0
  store ptr %235, ptr %12, align 8
  %236 = extractvalue { ptr, i32 } %234, 1
  store i32 %236, ptr %13, align 4
  br label %237

237:                                              ; preds = %233, %218
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %238

238:                                              ; preds = %237, %162, %131
  call void @llvm.lifetime.end.p0(i64 800000, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 800000, ptr %16) #8
  br label %246

239:                                              ; preds = %239, %230
  %240 = phi ptr [ %232, %230 ], [ %241, %239 ]
  %241 = getelementptr inbounds %"class.std::vector", ptr %240, i64 -1
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %241) #8
  %242 = icmp eq ptr %241, %231
  br i1 %242, label %243, label %239

243:                                              ; preds = %239
  call void @llvm.lifetime.end.p0(i64 4800000, ptr %8) #8
  %244 = load ptr, ptr %5, align 8
  call void @llvm.stackrestore.p0(ptr %244)
  call void @llvm.lifetime.end.p0(i64 4, 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
  %245 = load i32, ptr %1, align 4
  ret i32 %245

246:                                              ; preds = %238, %104
  %247 = getelementptr inbounds [200000 x %"class.std::vector"], ptr %8, i32 0, i32 0
  %248 = getelementptr inbounds %"class.std::vector", ptr %247, i64 200000
  br label %249

249:                                              ; preds = %249, %246
  %250 = phi ptr [ %248, %246 ], [ %251, %249 ]
  %251 = getelementptr inbounds %"class.std::vector", ptr %250, i64 -1
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %251) #8
  %252 = icmp eq ptr %251, %247
  br i1 %252, label %253, label %249

253:                                              ; preds = %249
  call void @llvm.lifetime.end.p0(i64 4800000, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, 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
  br label %254

254:                                              ; preds = %253
  %255 = load ptr, ptr %12, align 8
  %256 = load i32, ptr %13, align 4
  %257 = insertvalue { ptr, i32 } poison, ptr %255, 0
  %258 = insertvalue { ptr, i32 } %257, i32 %256, 1
  resume { ptr, i32 } %258
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef, ptr noundef) #6

; 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

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

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

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

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

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

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 = { 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 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 #4 = { "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 = { nocallback nofree nosync nounwind willreturn }
attributes #6 = { 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 #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 = !{!16, !9, i64 4}
!16 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!17 = distinct !{!17, !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::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 }
%"struct.std::pair" = type { i32, i32 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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 void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #2 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca [200000 x %"class.std::vector"], align 16
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [200000 x i32], align 16
  %10 = alloca [200000 x i32], align 16
  %11 = alloca %"struct.std::pair", align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %17 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %18 = getelementptr i8, ptr %17, i64 -24
  %19 = load i64, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %19
  %21 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %20, ptr noundef null)
  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
  %22 = 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)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %25 = load i32, ptr %3, align 4, !tbaa !8
  %26 = zext i32 %25 to i64
  %27 = call ptr @llvm.stacksave.p0()
  %28 = alloca i32, i64 %26, align 16
  %29 = load i32, ptr %3, align 4, !tbaa !8
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 4800000, ptr nonnull %4) #8
  br label %38

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %31 = getelementptr inbounds i32, ptr %28, i64 %indvars.iv
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %31)
  %33 = load i32, ptr %31, align 4, !tbaa !8
  %34 = add nsw i32 %33, -1
  store i32 %34, ptr %31, align 4, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %35 = load i32, ptr %3, align 4, !tbaa !8
  %36 = sext i32 %35 to i64
  %37 = icmp slt i64 %indvars.iv.next, %36
  br i1 %37, label %.lr.ph, label %._crit_edge, !llvm.loop !11

38:                                               ; preds = %38, %._crit_edge
  %.idx = phi i64 [ 0, %._crit_edge ], [ %.add, %38 ]
  %.ptr = getelementptr inbounds i8, ptr %4, i64 %.idx
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr) #8
  %.add = add nuw nsw i64 %.idx, 24
  %39 = icmp eq i64 %.add, 4800000
  br i1 %39, label %.preheader, label %38

.preheader:                                       ; preds = %38
  %40 = getelementptr inbounds i8, ptr %4, i64 4800000
  %41 = load i32, ptr %2, align 4, !tbaa !8
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %.lr.ph38, label %._crit_edge39

._crit_edge39:                                    ; preds = %61, %.preheader
  call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %10) #8
  %43 = load i32, ptr %1, align 4, !tbaa !8
  invoke void @_Z3bfsiPSt6vectorIiSaIiEEiRA200000_i(i32 noundef %43, ptr noundef nonnull %4, i32 noundef 0, ptr noundef nonnull align 4 dereferenceable(800000) %9)
          to label %72 unwind label %89

.lr.ph38:                                         ; preds = %.preheader, %61
  %.02437 = phi i32 [ %62, %61 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  %44 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %45 unwind label %65

45:                                               ; preds = %.lr.ph38
  %46 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %44, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %47 unwind label %65

47:                                               ; preds = %45
  %48 = load i32, ptr %5, align 4, !tbaa !8
  %49 = add nsw i32 %48, -1
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [200000 x %"class.std::vector"], ptr %4, i64 0, i64 %50
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  %52 = load i32, ptr %6, align 4, !tbaa !8
  %53 = add nsw i32 %52, -1
  store i32 %53, ptr %7, align 4, !tbaa !8
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %51, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %54 unwind label %67

54:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  %55 = load i32, ptr %6, align 4, !tbaa !8
  %56 = add nsw i32 %55, -1
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [200000 x %"class.std::vector"], ptr %4, i64 0, i64 %57
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  %59 = load i32, ptr %5, align 4, !tbaa !8
  %60 = add nsw i32 %59, -1
  store i32 %60, ptr %8, align 4, !tbaa !8
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %61 unwind label %69

61:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  %62 = add nuw nsw i32 %.02437, 1
  %63 = load i32, ptr %2, align 4, !tbaa !8
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %.lr.ph38, label %._crit_edge39, !llvm.loop !13

65:                                               ; preds = %45, %.lr.ph38
  %66 = landingpad { ptr, i32 }
          cleanup
  br label %71

67:                                               ; preds = %47
  %68 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  br label %71

69:                                               ; preds = %54
  %70 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  br label %71

71:                                               ; preds = %69, %67, %65
  %.pn33 = phi { ptr, i32 } [ %70, %69 ], [ %68, %67 ], [ %66, %65 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  br label %148

72:                                               ; preds = %._crit_edge39
  %73 = load i32, ptr %1, align 4, !tbaa !8
  %74 = add nsw i32 %73, -1
  invoke void @_Z3bfsiPSt6vectorIiSaIiEEiRA200000_i(i32 noundef %73, ptr noundef nonnull %4, i32 noundef %74, ptr noundef nonnull align 4 dereferenceable(800000) %10)
          to label %75 unwind label %89

75:                                               ; preds = %72
  %76 = load i32, ptr %3, align 4, !tbaa !8
  %77 = zext i32 %76 to i64
  %78 = alloca %"struct.std::pair", i64 %77, align 16
  %79 = icmp eq i32 %76, 0
  br i1 %79, label %.loopexit.._crit_edge43_crit_edge, label %80

80:                                               ; preds = %75
  %81 = getelementptr inbounds %"struct.std::pair", ptr %78, i64 %77
  br label %82

82:                                               ; preds = %82, %80
  %83 = phi ptr [ %78, %80 ], [ %84, %82 ]
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %83)
  %84 = getelementptr inbounds i8, ptr %83, i64 8
  %85 = icmp eq ptr %84, %81
  br i1 %85, label %.loopexit, label %82

.loopexit:                                        ; preds = %82
  %.pre = load i32, ptr %3, align 4, !tbaa !8
  %86 = icmp sgt i32 %.pre, 0
  br i1 %86, label %.lr.ph42, label %.loopexit.._crit_edge43_crit_edge

.loopexit.._crit_edge43_crit_edge:                ; preds = %75, %.loopexit
  %87 = phi i32 [ %.pre, %.loopexit ], [ 0, %75 ]
  %.pre56 = sext i32 %87 to i64
  br label %._crit_edge43

._crit_edge43:                                    ; preds = %.lr.ph42, %.loopexit.._crit_edge43_crit_edge
  %.pre-phi = phi i64 [ %.pre56, %.loopexit.._crit_edge43_crit_edge ], [ %102, %.lr.ph42 ]
  %88 = getelementptr inbounds %"struct.std::pair", ptr %78, i64 %.pre-phi
  invoke void @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef nonnull %78, ptr noundef nonnull %88)
          to label %104 unwind label %89

89:                                               ; preds = %._crit_edge43, %72, %._crit_edge39
  %90 = landingpad { ptr, i32 }
          cleanup
  br label %142

.lr.ph42:                                         ; preds = %.loopexit, %.lr.ph42
  %indvars.iv50 = phi i64 [ %indvars.iv.next51, %.lr.ph42 ], [ 0, %.loopexit ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #8
  %91 = getelementptr inbounds i32, ptr %28, i64 %indvars.iv50
  %92 = load i32, ptr %91, align 4, !tbaa !8
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [200000 x i32], ptr %9, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !8
  %96 = getelementptr inbounds [200000 x i32], ptr %10, i64 0, i64 %93
  %97 = load i32, ptr %96, align 4, !tbaa !8
  %98 = sub nsw i32 %95, %97
  store i32 %98, ptr %12, align 4, !tbaa !8
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %91)
  %99 = getelementptr inbounds %"struct.std::pair", ptr %78, i64 %indvars.iv50
  %100 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %99, ptr noundef nonnull align 4 dereferenceable(8) %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
  %101 = load i32, ptr %3, align 4, !tbaa !8
  %102 = sext i32 %101 to i64
  %103 = icmp slt i64 %indvars.iv.next51, %102
  br i1 %103, label %.lr.ph42, label %._crit_edge43, !llvm.loop !14

104:                                              ; preds = %._crit_edge43
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #8
  store i32 0, ptr %13, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #8
  %105 = getelementptr inbounds i8, ptr %78, i64 4
  %106 = load i32, ptr %105, align 4, !tbaa !15
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [200000 x i32], ptr %9, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !8
  store i32 %109, ptr %14, align 4, !tbaa !8
  %110 = load i32, ptr %3, align 4, !tbaa !8
  %111 = icmp sgt i32 %110, 1
  br i1 %111, label %.lr.ph46, label %._crit_edge47

._crit_edge47:                                    ; preds = %.lr.ph46, %104
  %112 = load i32, ptr %1, align 4, !tbaa !8
  %113 = add nsw i32 %112, -1
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [200000 x i32], ptr %9, i64 0, i64 %114
  %116 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %115)
  %117 = load i32, ptr %116, align 4, !tbaa !8
  %118 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %117)
          to label %137 unwind label %140

.lr.ph46:                                         ; preds = %104, %.lr.ph46
  %119 = phi i32 [ %133, %.lr.ph46 ], [ %109, %104 ]
  %indvars.iv53 = phi i64 [ %indvars.iv.next54, %.lr.ph46 ], [ 1, %104 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #8
  %120 = getelementptr inbounds %"struct.std::pair", ptr %78, i64 %indvars.iv53, i32 1
  %121 = load i32, ptr %120, align 4, !tbaa !15
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [200000 x i32], ptr %10, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !8
  %125 = add i32 %119, 1
  %126 = add i32 %125, %124
  store i32 %126, ptr %15, align 4, !tbaa !8
  %127 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %128 = load i32, ptr %127, align 4, !tbaa !8
  store i32 %128, ptr %13, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #8
  %129 = load i32, ptr %120, align 4, !tbaa !15
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [200000 x i32], ptr %9, i64 0, i64 %130
  %132 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %131)
  %133 = load i32, ptr %132, align 4, !tbaa !8
  store i32 %133, ptr %14, align 4, !tbaa !8
  %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
  %134 = load i32, ptr %3, align 4, !tbaa !8
  %135 = sext i32 %134 to i64
  %136 = icmp slt i64 %indvars.iv.next54, %135
  br i1 %136, label %.lr.ph46, label %._crit_edge47, !llvm.loop !17

137:                                              ; preds = %._crit_edge47
  %138 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %118, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %139 unwind label %140

139:                                              ; preds = %137
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %9) #8
  br label %143

140:                                              ; preds = %137, %._crit_edge47
  %141 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #8
  br label %142

142:                                              ; preds = %140, %89
  %.pn = phi { ptr, i32 } [ %141, %140 ], [ %90, %89 ]
  call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %9) #8
  br label %148

143:                                              ; preds = %143, %139
  %144 = phi ptr [ %40, %139 ], [ %145, %143 ]
  %145 = getelementptr inbounds i8, ptr %144, i64 -24
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %145) #8
  %146 = icmp eq ptr %145, %4
  br i1 %146, label %147, label %143

147:                                              ; preds = %143
  call void @llvm.lifetime.end.p0(i64 4800000, ptr nonnull %4) #8
  call void @llvm.stackrestore.p0(ptr %27)
  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 i32 0

148:                                              ; preds = %142, %71
  %.pn33.pn = phi { ptr, i32 } [ %.pn33, %71 ], [ %.pn, %142 ]
  br label %149

149:                                              ; preds = %149, %148
  %150 = phi ptr [ %40, %148 ], [ %151, %149 ]
  %151 = getelementptr inbounds i8, ptr %150, i64 -24
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %151) #8
  %152 = icmp eq ptr %151, %4
  br i1 %152, label %153, label %149

153:                                              ; preds = %149
  call void @llvm.lifetime.end.p0(i64 4800000, 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 } %.pn33.pn
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef, ptr noundef) local_unnamed_addr #6

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

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

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

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

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

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

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 = { 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 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #6 = { 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 #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 = !{!16, !9, i64 4}
!16 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!17 = distinct !{!17, !12}


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