; LLVM IR from kazunetakahashi/atcoder :: 2017/0429_ARC073 (E2)

; 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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<long long, int>, std::pair<long long, int>, std::_Identity<std::pair<long long, int>>, std::less<std::pair<long long, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long long, int>, std::pair<long long, int>, std::_Identity<std::pair<long long, int>>, std::less<std::pair<long long, 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 }
%"struct.std::pair.0" = type <{ i64, i32, [4 x i8] }>
%"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
@x = external dso_local global [200010 x i64], align 16
@y = external dso_local global [200010 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::set", align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::pair.0", align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca %"struct.std::pair", align 8
  %21 = alloca %"struct.std::pair.0", align 8
  %22 = alloca i32, align 4
  %23 = alloca %"struct.std::pair", align 8
  %24 = alloca %"struct.std::pair.0", align 8
  %25 = alloca i32, align 4
  %26 = alloca %"struct.std::pair", align 8
  %27 = alloca i64, align 8
  %28 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %29 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %30 = alloca i64, align 8
  %31 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %32 = alloca i32, align 4
  %33 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %34 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %35 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %36 = alloca %"struct.std::pair.0", align 8
  %37 = alloca i32, align 4
  %38 = alloca %"struct.std::pair", align 8
  %39 = alloca i32, align 4
  %40 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %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) @N)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %73, %0
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = load i32, ptr @N, align 4, !tbaa !5
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %47, label %46

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

47:                                               ; preds = %42
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [200010 x i64], ptr @x, i64 0, i64 %49
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %50)
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [200010 x i64], ptr @y, i64 0, i64 %53
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %51, ptr noundef nonnull align 8 dereferenceable(8) %54)
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [200010 x i64], ptr @x, i64 0, i64 %57
  %59 = load i64, ptr %58, align 8, !tbaa !9
  %60 = load i32, ptr %2, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [200010 x i64], ptr @y, i64 0, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !9
  %64 = icmp slt i64 %59, %63
  br i1 %64, label %65, label %72

65:                                               ; preds = %47
  %66 = load i32, ptr %2, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [200010 x i64], ptr @x, i64 0, i64 %67
  %69 = load i32, ptr %2, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [200010 x i64], ptr @y, i64 0, i64 %70
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %68, ptr noundef nonnull align 8 dereferenceable(8) %71) #7
  br label %72

72:                                               ; preds = %65, %47
  br label %73

73:                                               ; preds = %72
  %74 = load i32, ptr %2, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %2, align 4, !tbaa !5
  br label %42, !llvm.loop !11

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

77:                                               ; preds = %109, %76
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = load i32, ptr @N, align 4, !tbaa !5
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %112

82:                                               ; preds = %77
  %83 = load i64, ptr %3, align 8, !tbaa !9
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [200010 x i64], ptr @x, i64 0, i64 %85
  %87 = load i64, ptr %86, align 8, !tbaa !9
  %88 = icmp slt i64 %83, %87
  br i1 %88, label %89, label %95

89:                                               ; preds = %82
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [200010 x i64], ptr @x, i64 0, i64 %91
  %93 = load i64, ptr %92, align 8, !tbaa !9
  store i64 %93, ptr %3, align 8, !tbaa !9
  %94 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %94, ptr %4, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %89, %82
  %96 = load i64, ptr %5, align 8, !tbaa !9
  %97 = load i32, ptr %7, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [200010 x i64], ptr @y, i64 0, i64 %98
  %100 = load i64, ptr %99, align 8, !tbaa !9
  %101 = icmp sgt i64 %96, %100
  br i1 %101, label %102, label %108

102:                                              ; preds = %95
  %103 = load i32, ptr %7, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [200010 x i64], ptr @y, i64 0, i64 %104
  %106 = load i64, ptr %105, align 8, !tbaa !9
  store i64 %106, ptr %5, align 8, !tbaa !9
  %107 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %107, ptr %6, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %102, %95
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %7, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %7, align 4, !tbaa !5
  br label %77, !llvm.loop !13

112:                                              ; preds = %81
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 1000000007, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 0, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %129, %112
  %114 = load i32, ptr %10, align 4, !tbaa !5
  %115 = load i32, ptr @N, align 4, !tbaa !5
  %116 = icmp slt i32 %114, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %132

118:                                              ; preds = %113
  %119 = load i32, ptr %10, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [200010 x i64], ptr @x, i64 0, i64 %120
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %121)
  %123 = load i64, ptr %122, align 8, !tbaa !9
  store i64 %123, ptr %8, align 8, !tbaa !9
  %124 = load i32, ptr %10, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [200010 x i64], ptr @y, i64 0, i64 %125
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %126)
  %128 = load i64, ptr %127, align 8, !tbaa !9
  store i64 %128, ptr %9, align 8, !tbaa !9
  br label %129

129:                                              ; preds = %118
  %130 = load i32, ptr %10, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %10, align 4, !tbaa !5
  br label %113, !llvm.loop !14

132:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %133 = load i64, ptr %3, align 8, !tbaa !9
  %134 = load i64, ptr %8, align 8, !tbaa !9
  %135 = sub nsw i64 %133, %134
  %136 = load i64, ptr %9, align 8, !tbaa !9
  %137 = load i64, ptr %5, align 8, !tbaa !9
  %138 = sub nsw i64 %136, %137
  %139 = mul nsw i64 %135, %138
  store i64 %139, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %160, %132
  %141 = load i32, ptr %12, align 4, !tbaa !5
  %142 = load i32, ptr @N, align 4, !tbaa !5
  %143 = icmp slt i32 %141, %142
  br i1 %143, label %145, label %144

144:                                              ; preds = %140
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %163

145:                                              ; preds = %140
  %146 = load i32, ptr %12, align 4, !tbaa !5
  %147 = load i32, ptr %4, align 4, !tbaa !5
  %148 = icmp eq i32 %146, %147
  br i1 %148, label %149, label %150

149:                                              ; preds = %145
  br label %160

150:                                              ; preds = %145
  %151 = load i64, ptr %5, align 8, !tbaa !9
  %152 = load i32, ptr %12, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [200010 x i64], ptr @y, i64 0, i64 %153
  %155 = load i64, ptr %154, align 8, !tbaa !9
  %156 = icmp eq i64 %151, %155
  br i1 %156, label %157, label %159

157:                                              ; preds = %150
  %158 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %158, ptr %6, align 4, !tbaa !5
  br label %159

159:                                              ; preds = %157, %150
  br label %160

160:                                              ; preds = %159, %149
  %161 = load i32, ptr %12, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %12, align 4, !tbaa !5
  br label %140, !llvm.loop !15

163:                                              ; preds = %144
  %164 = load i32, ptr %4, align 4, !tbaa !5
  %165 = load i32, ptr %6, align 4, !tbaa !5
  %166 = icmp ne i32 %164, %165
  br i1 %166, label %167, label %313

167:                                              ; preds = %163
  call void @llvm.lifetime.start.p0(i64 48, ptr %13) #7
  call void @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %168 = load i32, ptr %6, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [200010 x i64], ptr @x, i64 0, i64 %169
  %171 = load i64, ptr %170, align 8, !tbaa !9
  store i64 %171, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %172 = load i32, ptr %4, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [200010 x i64], ptr @y, i64 0, i64 %173
  %175 = load i64, ptr %174, align 8, !tbaa !9
  store i64 %175, ptr %15, align 8, !tbaa !9
  %176 = load i64, ptr %14, align 8, !tbaa !9
  %177 = load i64, ptr %15, align 8, !tbaa !9
  %178 = icmp slt i64 %176, %177
  br i1 %178, label %179, label %180

179:                                              ; preds = %167
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  br label %180

180:                                              ; preds = %179, %167
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %181

181:                                              ; preds = %210, %180
  %182 = load i32, ptr %16, align 4, !tbaa !5
  %183 = load i32, ptr @N, align 4, !tbaa !5
  %184 = icmp slt i32 %182, %183
  br i1 %184, label %186, label %185

185:                                              ; preds = %181
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %213

186:                                              ; preds = %181
  %187 = load i32, ptr %16, align 4, !tbaa !5
  %188 = load i32, ptr %4, align 4, !tbaa !5
  %189 = icmp ne i32 %187, %188
  br i1 %189, label %190, label %209

190:                                              ; preds = %186
  %191 = load i32, ptr %16, align 4, !tbaa !5
  %192 = load i32, ptr %6, align 4, !tbaa !5
  %193 = icmp ne i32 %191, %192
  br i1 %193, label %194, label %209

194:                                              ; preds = %190
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #7
  %195 = load i32, ptr %16, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [200010 x i64], ptr @y, i64 0, i64 %196
  invoke void @_ZNSt4pairIxiEC2IRxRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 8 dereferenceable(12) %17, ptr noundef nonnull align 8 dereferenceable(8) %197, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %198 unwind label %205

198:                                              ; preds = %194
  %199 = invoke { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(12) %17)
          to label %200 unwind label %205

200:                                              ; preds = %198
  %201 = getelementptr inbounds { ptr, i8 }, ptr %20, i32 0, i32 0
  %202 = extractvalue { ptr, i8 } %199, 0
  store ptr %202, ptr %201, align 8
  %203 = getelementptr inbounds { ptr, i8 }, ptr %20, i32 0, i32 1
  %204 = extractvalue { ptr, i8 } %199, 1
  store i8 %204, ptr %203, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #7
  br label %209

205:                                              ; preds = %198, %194
  %206 = landingpad { ptr, i32 }
          cleanup
  %207 = extractvalue { ptr, i32 } %206, 0
  store ptr %207, ptr %18, align 8
  %208 = extractvalue { ptr, i32 } %206, 1
  store i32 %208, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %312

209:                                              ; preds = %200, %190, %186
  br label %210

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

213:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  store i32 -1, ptr %22, align 4, !tbaa !5
  invoke void @_ZNSt4pairIxiEC2IRxiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(12) %21, ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %214 unwind label %271

214:                                              ; preds = %213
  %215 = invoke { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(12) %21)
          to label %216 unwind label %271

216:                                              ; preds = %214
  %217 = getelementptr inbounds { ptr, i8 }, ptr %23, i32 0, i32 0
  %218 = extractvalue { ptr, i8 } %215, 0
  store ptr %218, ptr %217, align 8
  %219 = getelementptr inbounds { ptr, i8 }, ptr %23, i32 0, i32 1
  %220 = extractvalue { ptr, i8 } %215, 1
  store i8 %220, ptr %219, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 -1, ptr %25, align 4, !tbaa !5
  invoke void @_ZNSt4pairIxiEC2IRxiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(12) %24, ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(4) %25)
          to label %221 unwind label %275

221:                                              ; preds = %216
  %222 = invoke { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(12) %24)
          to label %223 unwind label %275

223:                                              ; preds = %221
  %224 = getelementptr inbounds { ptr, i8 }, ptr %26, i32 0, i32 0
  %225 = extractvalue { ptr, i8 } %222, 0
  store ptr %225, ptr %224, align 8
  %226 = getelementptr inbounds { ptr, i8 }, ptr %26, i32 0, i32 1
  %227 = extractvalue { ptr, i8 } %222, 1
  store i8 %227, ptr %226, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  store i64 1000000007, ptr %27, align 8, !tbaa !9
  br label %228

228:                                              ; preds = %295, %223
  br label %229

229:                                              ; preds = %228
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %230 = call ptr @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #7
  %231 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %28, i32 0, i32 0
  store ptr %230, ptr %231, align 8
  %232 = call ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIxiEEmmEi(ptr noundef nonnull align 8 dereferenceable(8) %28, i32 noundef 0) #7
  %233 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %29, i32 0, i32 0
  store ptr %232, ptr %233, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  %234 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %28) #7
  %235 = getelementptr inbounds %"struct.std::pair.0", ptr %234, i32 0, i32 0
  %236 = load i64, ptr %235, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  %237 = call ptr @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #7
  %238 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %31, i32 0, i32 0
  store ptr %237, ptr %238, align 8
  %239 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %31) #7
  %240 = getelementptr inbounds %"struct.std::pair.0", ptr %239, i32 0, i32 0
  %241 = load i64, ptr %240, align 8, !tbaa !17
  %242 = sub nsw i64 %236, %241
  store i64 %242, ptr %30, align 8, !tbaa !9
  %243 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(8) %30)
          to label %244 unwind label %279

244:                                              ; preds = %229
  %245 = load i64, ptr %243, align 8, !tbaa !9
  store i64 %245, ptr %27, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #7
  %246 = call ptr @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #7
  %247 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %33, i32 0, i32 0
  store ptr %246, ptr %247, align 8
  %248 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %33) #7
  %249 = getelementptr inbounds %"struct.std::pair.0", ptr %248, i32 0, i32 1
  %250 = load i32, ptr %249, align 8, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  store i32 %250, ptr %32, align 4, !tbaa !5
  %251 = load i32, ptr %32, align 4, !tbaa !5
  %252 = icmp ne i32 %251, -1
  br i1 %252, label %253, label %291

253:                                              ; preds = %244
  %254 = call ptr @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #7
  %255 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %34, i32 0, i32 0
  store ptr %254, ptr %255, align 8
  %256 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %34, i32 0, i32 0
  %257 = load ptr, ptr %256, align 8
  %258 = invoke ptr @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS1_E(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr %257)
          to label %259 unwind label %283

259:                                              ; preds = %253
  %260 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %35, i32 0, i32 0
  store ptr %258, ptr %260, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %36) #7
  %261 = load i32, ptr %32, align 4, !tbaa !5
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds [200010 x i64], ptr @x, i64 0, i64 %262
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #7
  store i32 -1, ptr %37, align 4, !tbaa !5
  invoke void @_ZNSt4pairIxiEC2IRxiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(12) %36, ptr noundef nonnull align 8 dereferenceable(8) %263, ptr noundef nonnull align 4 dereferenceable(4) %37)
          to label %264 unwind label %287

264:                                              ; preds = %259
  %265 = invoke { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(12) %36)
          to label %266 unwind label %287

266:                                              ; preds = %264
  %267 = getelementptr inbounds { ptr, i8 }, ptr %38, i32 0, i32 0
  %268 = extractvalue { ptr, i8 } %265, 0
  store ptr %268, ptr %267, align 8
  %269 = getelementptr inbounds { ptr, i8 }, ptr %38, i32 0, i32 1
  %270 = extractvalue { ptr, i8 } %265, 1
  store i8 %270, ptr %269, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %36) #7
  br label %292

271:                                              ; preds = %214, %213
  %272 = landingpad { ptr, i32 }
          cleanup
  %273 = extractvalue { ptr, i32 } %272, 0
  store ptr %273, ptr %18, align 8
  %274 = extractvalue { ptr, i32 } %272, 1
  store i32 %274, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #7
  br label %312

275:                                              ; preds = %221, %216
  %276 = landingpad { ptr, i32 }
          cleanup
  %277 = extractvalue { ptr, i32 } %276, 0
  store ptr %277, ptr %18, align 8
  %278 = extractvalue { ptr, i32 } %276, 1
  store i32 %278, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #7
  br label %312

279:                                              ; preds = %229
  %280 = landingpad { ptr, i32 }
          cleanup
  %281 = extractvalue { ptr, i32 } %280, 0
  store ptr %281, ptr %18, align 8
  %282 = extractvalue { ptr, i32 } %280, 1
  store i32 %282, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  br label %297

283:                                              ; preds = %253
  %284 = landingpad { ptr, i32 }
          cleanup
  %285 = extractvalue { ptr, i32 } %284, 0
  store ptr %285, ptr %18, align 8
  %286 = extractvalue { ptr, i32 } %284, 1
  store i32 %286, ptr %19, align 4
  br label %296

287:                                              ; preds = %264, %259
  %288 = landingpad { ptr, i32 }
          cleanup
  %289 = extractvalue { ptr, i32 } %288, 0
  store ptr %289, ptr %18, align 8
  %290 = extractvalue { ptr, i32 } %288, 1
  store i32 %290, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %36) #7
  br label %296

291:                                              ; preds = %244
  store i32 18, ptr %39, align 4
  br label %293

292:                                              ; preds = %266
  store i32 0, ptr %39, align 4
  br label %293

293:                                              ; preds = %292, %291
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  %294 = load i32, ptr %39, align 4
  switch i32 %294, label %323 [
    i32 0, label %295
    i32 18, label %298
  ]

295:                                              ; preds = %293
  br label %228, !llvm.loop !20

296:                                              ; preds = %287, %283
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  br label %297

297:                                              ; preds = %296, %279
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  br label %311

298:                                              ; preds = %293
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #7
  %299 = load i64, ptr %27, align 8, !tbaa !9
  %300 = load i64, ptr %3, align 8, !tbaa !9
  %301 = load i64, ptr %5, align 8, !tbaa !9
  %302 = sub nsw i64 %300, %301
  %303 = mul nsw i64 %299, %302
  store i64 %303, ptr %40, align 8, !tbaa !9
  %304 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %40)
          to label %305 unwind label %307

305:                                              ; preds = %298
  %306 = load i64, ptr %304, align 8, !tbaa !9
  store i64 %306, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %13) #7
  br label %313

307:                                              ; preds = %298
  %308 = landingpad { ptr, i32 }
          cleanup
  %309 = extractvalue { ptr, i32 } %308, 0
  store ptr %309, ptr %18, align 8
  %310 = extractvalue { ptr, i32 } %308, 1
  store i32 %310, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #7
  br label %311

311:                                              ; preds = %307, %297
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %312

312:                                              ; preds = %311, %275, %271, %205
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %318

313:                                              ; preds = %305, %163
  %314 = load i64, ptr %11, align 8, !tbaa !9
  %315 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %314)
  %316 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %315, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  %317 = load i32, ptr %1, align 4
  ret i32 %317

318:                                              ; preds = %312
  %319 = load ptr, ptr %18, align 8
  %320 = load i32, ptr %19, align 4
  %321 = insertvalue { ptr, i32 } poison, ptr %319, 0
  %322 = insertvalue { ptr, i32 } %321, i32 %320, 1
  resume { ptr, i32 } %322

323:                                              ; preds = %293
  unreachable
}

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

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

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

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

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = !{!18, !10, i64 0}
!18 = !{!"_ZTSSt4pairIxiE", !10, i64 0, !6, i64 8}
!19 = !{!18, !6, i64 8}
!20 = distinct !{!20, !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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<long long, int>, std::pair<long long, int>, std::_Identity<std::pair<long long, int>>, std::less<std::pair<long long, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long long, int>, std::pair<long long, int>, std::_Identity<std::pair<long long, int>>, std::less<std::pair<long long, 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 }
%"struct.std::pair.0" = type <{ i64, i32, [4 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@N = external dso_local global i32, align 4
@x = external dso_local global [200010 x i64], align 16
@y = external dso_local global [200010 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"class.std::set", align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair.0", align 8
  %9 = alloca %"struct.std::pair.0", align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair.0", align 8
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %15 = alloca i64, align 8
  %16 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %17 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %18 = alloca %"struct.std::pair.0", align 8
  %19 = alloca i32, align 4
  %20 = alloca i64, align 8
  %21 = 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)
  %22 = load i32, ptr @N, align 4, !tbaa !5
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph, label %._crit_edge103.thread

.preheader:                                       ; preds = %34
  %24 = icmp sgt i32 %35, 0
  br i1 %24, label %.lr.ph89.preheader, label %._crit_edge103.thread

.lr.ph89.preheader:                               ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %35 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %25 = icmp eq i32 %35, 1
  br i1 %25, label %._crit_edge.unr-lcssa, label %.lr.ph89.preheader.new

.lr.ph89.preheader.new:                           ; preds = %.lr.ph89.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph89

.lr.ph:                                           ; preds = %0, %34
  %indvars.iv = phi i64 [ %indvars.iv.next, %34 ], [ 0, %0 ]
  %26 = getelementptr inbounds [200010 x i64], ptr @x, i64 0, i64 %indvars.iv
  %27 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %26)
  %28 = getelementptr inbounds [200010 x i64], ptr @y, i64 0, i64 %indvars.iv
  %29 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(8) %28)
  %30 = load i64, ptr %26, align 8, !tbaa !9
  %31 = load i64, ptr %28, align 8, !tbaa !9
  %32 = icmp slt i64 %30, %31
  br i1 %32, label %33, label %34

33:                                               ; preds = %.lr.ph
  tail call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %28) #8
  br label %34

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

._crit_edge103.thread:                            ; preds = %.preheader, %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  store i64 1000000007, ptr %1, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  store i64 0, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  store i64 1000000014000000049, ptr %3, align 8, !tbaa !9
  br label %95

._crit_edge.unr-lcssa:                            ; preds = %.lr.ph89, %.lr.ph89.preheader
  %spec.select.lcssa.ph = phi i32 [ poison, %.lr.ph89.preheader ], [ %spec.select.1, %.lr.ph89 ]
  %spec.select78.lcssa.ph = phi i64 [ poison, %.lr.ph89.preheader ], [ %spec.select78.1, %.lr.ph89 ]
  %.160.lcssa.ph = phi i32 [ poison, %.lr.ph89.preheader ], [ %.160.1, %.lr.ph89 ]
  %.158.lcssa.ph = phi i64 [ poison, %.lr.ph89.preheader ], [ %.158.1, %.lr.ph89 ]
  %indvars.iv112.unr = phi i64 [ 0, %.lr.ph89.preheader ], [ %indvars.iv.next113.1, %.lr.ph89 ]
  %.05488.unr = phi i64 [ 0, %.lr.ph89.preheader ], [ %spec.select78.1, %.lr.ph89 ]
  %.05587.unr = phi i32 [ undef, %.lr.ph89.preheader ], [ %spec.select.1, %.lr.ph89 ]
  %.05786.unr = phi i64 [ 1000000007, %.lr.ph89.preheader ], [ %.158.1, %.lr.ph89 ]
  %.05985.unr = phi i32 [ undef, %.lr.ph89.preheader ], [ %.160.1, %.lr.ph89 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph89.epil

.lr.ph89.epil:                                    ; preds = %._crit_edge.unr-lcssa
  %38 = getelementptr inbounds [200010 x i64], ptr @x, i64 0, i64 %indvars.iv112.unr
  %39 = load i64, ptr %38, align 8, !tbaa !9
  %40 = icmp slt i64 %.05488.unr, %39
  %41 = trunc nuw nsw i64 %indvars.iv112.unr to i32
  %spec.select.epil = select i1 %40, i32 %41, i32 %.05587.unr
  %spec.select78.epil = tail call i64 @llvm.smax.i64(i64 %.05488.unr, i64 %39)
  %42 = getelementptr inbounds [200010 x i64], ptr @y, i64 0, i64 %indvars.iv112.unr
  %43 = load i64, ptr %42, align 8, !tbaa !9
  %44 = icmp sgt i64 %.05786.unr, %43
  %.160.epil = select i1 %44, i32 %41, i32 %.05985.unr
  %.158.epil = tail call i64 @llvm.smin.i64(i64 %.05786.unr, i64 %43)
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.unr-lcssa, %.lr.ph89.epil
  %spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %._crit_edge.unr-lcssa ], [ %spec.select.epil, %.lr.ph89.epil ]
  %spec.select78.lcssa = phi i64 [ %spec.select78.lcssa.ph, %._crit_edge.unr-lcssa ], [ %spec.select78.epil, %.lr.ph89.epil ]
  %.160.lcssa = phi i32 [ %.160.lcssa.ph, %._crit_edge.unr-lcssa ], [ %.160.epil, %.lr.ph89.epil ]
  %.158.lcssa = phi i64 [ %.158.lcssa.ph, %._crit_edge.unr-lcssa ], [ %.158.epil, %.lr.ph89.epil ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  store i64 1000000007, ptr %1, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  store i64 0, ptr %2, align 8, !tbaa !9
  br i1 %24, label %.lr.ph96, label %._crit_edge97

.lr.ph89:                                         ; preds = %.lr.ph89, %.lr.ph89.preheader.new
  %indvars.iv112 = phi i64 [ 0, %.lr.ph89.preheader.new ], [ %indvars.iv.next113.1, %.lr.ph89 ]
  %.05488 = phi i64 [ 0, %.lr.ph89.preheader.new ], [ %spec.select78.1, %.lr.ph89 ]
  %.05587 = phi i32 [ undef, %.lr.ph89.preheader.new ], [ %spec.select.1, %.lr.ph89 ]
  %.05786 = phi i64 [ 1000000007, %.lr.ph89.preheader.new ], [ %.158.1, %.lr.ph89 ]
  %.05985 = phi i32 [ undef, %.lr.ph89.preheader.new ], [ %.160.1, %.lr.ph89 ]
  %niter = phi i64 [ 0, %.lr.ph89.preheader.new ], [ %niter.next.1, %.lr.ph89 ]
  %45 = getelementptr inbounds [200010 x i64], ptr @x, i64 0, i64 %indvars.iv112
  %46 = load i64, ptr %45, align 16, !tbaa !9
  %47 = icmp slt i64 %.05488, %46
  %48 = trunc nuw nsw i64 %indvars.iv112 to i32
  %spec.select = select i1 %47, i32 %48, i32 %.05587
  %spec.select78 = tail call i64 @llvm.smax.i64(i64 %.05488, i64 %46)
  %49 = getelementptr inbounds [200010 x i64], ptr @y, i64 0, i64 %indvars.iv112
  %50 = load i64, ptr %49, align 16, !tbaa !9
  %51 = icmp sgt i64 %.05786, %50
  %.160 = select i1 %51, i32 %48, i32 %.05985
  %.158 = tail call i64 @llvm.smin.i64(i64 %.05786, i64 %50)
  %indvars.iv.next113 = or disjoint i64 %indvars.iv112, 1
  %52 = getelementptr inbounds [200010 x i64], ptr @x, i64 0, i64 %indvars.iv.next113
  %53 = load i64, ptr %52, align 8, !tbaa !9
  %54 = icmp slt i64 %spec.select78, %53
  %55 = trunc nuw nsw i64 %indvars.iv.next113 to i32
  %spec.select.1 = select i1 %54, i32 %55, i32 %spec.select
  %spec.select78.1 = tail call i64 @llvm.smax.i64(i64 %spec.select78, i64 %53)
  %56 = getelementptr inbounds [200010 x i64], ptr @y, i64 0, i64 %indvars.iv.next113
  %57 = load i64, ptr %56, align 8, !tbaa !9
  %58 = icmp sgt i64 %.158, %57
  %.160.1 = select i1 %58, i32 %55, i32 %.160
  %.158.1 = tail call i64 @llvm.smin.i64(i64 %.158, i64 %57)
  %indvars.iv.next113.1 = add nuw nsw i64 %indvars.iv112, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.unr-lcssa, label %.lr.ph89, !llvm.loop !13

._crit_edge97.loopexit:                           ; preds = %.lr.ph96
  %.pre = load i64, ptr %1, align 8, !tbaa !9
  br label %._crit_edge97

._crit_edge97:                                    ; preds = %._crit_edge97.loopexit, %._crit_edge
  %59 = phi i64 [ 0, %._crit_edge ], [ %72, %._crit_edge97.loopexit ]
  %60 = phi i64 [ 1000000007, %._crit_edge ], [ %.pre, %._crit_edge97.loopexit ]
  %.lcssa = phi i32 [ %35, %._crit_edge ], [ %73, %._crit_edge97.loopexit ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %61 = sub nsw i64 %spec.select78.lcssa, %60
  %62 = sub nsw i64 %59, %.158.lcssa
  %63 = mul nsw i64 %62, %61
  store i64 %63, ptr %3, align 8, !tbaa !9
  %64 = icmp sgt i32 %.lcssa, 0
  br i1 %64, label %.lr.ph102.preheader, label %._crit_edge103

.lr.ph102.preheader:                              ; preds = %._crit_edge97
  %65 = zext i32 %spec.select.lcssa to i64
  %wide.trip.count121 = zext nneg i32 %.lcssa to i64
  %xtraiter165 = and i64 %wide.trip.count121, 1
  %66 = icmp eq i32 %.lcssa, 1
  br i1 %66, label %._crit_edge103.loopexit.unr-lcssa, label %.lr.ph102.preheader.new

.lr.ph102.preheader.new:                          ; preds = %.lr.ph102.preheader
  %unroll_iter168 = and i64 %wide.trip.count121, 2147483646
  br label %.lr.ph102

.lr.ph96:                                         ; preds = %._crit_edge, %.lr.ph96
  %indvars.iv115 = phi i64 [ %indvars.iv.next116, %.lr.ph96 ], [ 0, %._crit_edge ]
  %67 = getelementptr inbounds [200010 x i64], ptr @x, i64 0, i64 %indvars.iv115
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %67)
  %69 = load i64, ptr %68, align 8, !tbaa !9
  store i64 %69, ptr %1, align 8, !tbaa !9
  %70 = getelementptr inbounds [200010 x i64], ptr @y, i64 0, i64 %indvars.iv115
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %70)
  %72 = load i64, ptr %71, align 8, !tbaa !9
  store i64 %72, ptr %2, align 8, !tbaa !9
  %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
  %73 = load i32, ptr @N, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = icmp slt i64 %indvars.iv.next116, %74
  br i1 %75, label %.lr.ph96, label %._crit_edge97.loopexit, !llvm.loop !14

._crit_edge103.loopexit.unr-lcssa:                ; preds = %94, %.lr.ph102.preheader
  %.3.lcssa.ph = phi i32 [ poison, %.lr.ph102.preheader ], [ %.3.1, %94 ]
  %indvars.iv118.unr = phi i64 [ 0, %.lr.ph102.preheader ], [ %indvars.iv.next119.1, %94 ]
  %.2100.unr = phi i32 [ %.160.lcssa, %.lr.ph102.preheader ], [ %.3.1, %94 ]
  %lcmp.mod166.not = icmp eq i64 %xtraiter165, 0
  br i1 %lcmp.mod166.not, label %._crit_edge103, label %.lr.ph102.epil

.lr.ph102.epil:                                   ; preds = %._crit_edge103.loopexit.unr-lcssa
  %76 = icmp eq i64 %indvars.iv118.unr, %65
  br i1 %76, label %._crit_edge103, label %77

77:                                               ; preds = %.lr.ph102.epil
  %78 = getelementptr inbounds [200010 x i64], ptr @y, i64 0, i64 %indvars.iv118.unr
  %79 = load i64, ptr %78, align 8, !tbaa !9
  %80 = icmp eq i64 %.158.lcssa, %79
  %81 = trunc nuw nsw i64 %indvars.iv118.unr to i32
  %spec.select79.epil = select i1 %80, i32 %81, i32 %.2100.unr
  br label %._crit_edge103

._crit_edge103:                                   ; preds = %._crit_edge103.loopexit.unr-lcssa, %77, %.lr.ph102.epil, %._crit_edge97
  %.2.lcssa = phi i32 [ %.160.lcssa, %._crit_edge97 ], [ %.3.lcssa.ph, %._crit_edge103.loopexit.unr-lcssa ], [ %.2100.unr, %.lr.ph102.epil ], [ %spec.select79.epil, %77 ]
  %.not = icmp eq i32 %spec.select.lcssa, %.2.lcssa
  br i1 %.not, label %163, label %95

.lr.ph102:                                        ; preds = %94, %.lr.ph102.preheader.new
  %indvars.iv118 = phi i64 [ 0, %.lr.ph102.preheader.new ], [ %indvars.iv.next119.1, %94 ]
  %.2100 = phi i32 [ %.160.lcssa, %.lr.ph102.preheader.new ], [ %.3.1, %94 ]
  %niter169 = phi i64 [ 0, %.lr.ph102.preheader.new ], [ %niter169.next.1, %94 ]
  %82 = icmp eq i64 %indvars.iv118, %65
  br i1 %82, label %.lr.ph102.1, label %83

83:                                               ; preds = %.lr.ph102
  %84 = getelementptr inbounds [200010 x i64], ptr @y, i64 0, i64 %indvars.iv118
  %85 = load i64, ptr %84, align 16, !tbaa !9
  %86 = icmp eq i64 %.158.lcssa, %85
  %87 = trunc nuw nsw i64 %indvars.iv118 to i32
  %spec.select79 = select i1 %86, i32 %87, i32 %.2100
  br label %.lr.ph102.1

.lr.ph102.1:                                      ; preds = %83, %.lr.ph102
  %.3 = phi i32 [ %.2100, %.lr.ph102 ], [ %spec.select79, %83 ]
  %indvars.iv.next119 = or disjoint i64 %indvars.iv118, 1
  %88 = icmp eq i64 %indvars.iv.next119, %65
  br i1 %88, label %94, label %89

89:                                               ; preds = %.lr.ph102.1
  %90 = getelementptr inbounds [200010 x i64], ptr @y, i64 0, i64 %indvars.iv.next119
  %91 = load i64, ptr %90, align 8, !tbaa !9
  %92 = icmp eq i64 %.158.lcssa, %91
  %93 = trunc nuw nsw i64 %indvars.iv.next119 to i32
  %spec.select79.1 = select i1 %92, i32 %93, i32 %.3
  br label %94

94:                                               ; preds = %89, %.lr.ph102.1
  %.3.1 = phi i32 [ %.3, %.lr.ph102.1 ], [ %spec.select79.1, %89 ]
  %indvars.iv.next119.1 = add nuw nsw i64 %indvars.iv118, 2
  %niter169.next.1 = add i64 %niter169, 2
  %niter169.ncmp.1 = icmp eq i64 %niter169.next.1, %unroll_iter168
  br i1 %niter169.ncmp.1, label %._crit_edge103.loopexit.unr-lcssa, label %.lr.ph102, !llvm.loop !15

95:                                               ; preds = %._crit_edge103.thread, %._crit_edge103
  %.2.lcssa151 = phi i32 [ undef, %._crit_edge103.thread ], [ %.2.lcssa, %._crit_edge103 ]
  %.054.lcssa134140150 = phi i64 [ 0, %._crit_edge103.thread ], [ %spec.select78.lcssa, %._crit_edge103 ]
  %.055.lcssa133141149 = phi i32 [ undef, %._crit_edge103.thread ], [ %spec.select.lcssa, %._crit_edge103 ]
  %.057.lcssa132142148 = phi i64 [ 1000000007, %._crit_edge103.thread ], [ %.158.lcssa, %._crit_edge103 ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #8
  call void @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %96 = sext i32 %.2.lcssa151 to i64
  %97 = getelementptr inbounds [200010 x i64], ptr @x, i64 0, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !9
  store i64 %98, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %99 = sext i32 %.055.lcssa133141149 to i64
  %100 = getelementptr inbounds [200010 x i64], ptr @y, i64 0, i64 %99
  %101 = load i64, ptr %100, align 8, !tbaa !9
  store i64 %101, ptr %6, align 8, !tbaa !9
  %102 = icmp slt i64 %98, %101
  br i1 %102, label %103, label %104

103:                                              ; preds = %95
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  br label %104

104:                                              ; preds = %103, %95
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  store i32 0, ptr %7, align 4, !tbaa !5
  %105 = load i32, ptr @N, align 4, !tbaa !5
  %106 = icmp sgt i32 %105, 0
  br i1 %106, label %.lr.ph107, label %._crit_edge108

._crit_edge108:                                   ; preds = %116, %104
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #8
  store i32 -1, ptr %10, align 4, !tbaa !5
  call void @_ZNSt4pairIxiEC2IRxiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(12) %9, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %107 = invoke { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(12) %9)
          to label %121 unwind label %146

.lr.ph107:                                        ; preds = %104, %116
  %108 = phi i32 [ %117, %116 ], [ %105, %104 ]
  %storemerge105 = phi i32 [ %119, %116 ], [ 0, %104 ]
  %.not74 = icmp eq i32 %storemerge105, %.055.lcssa133141149
  %.not75 = icmp eq i32 %storemerge105, %.2.lcssa151
  %or.cond = or i1 %.not74, %.not75
  br i1 %or.cond, label %116, label %109

109:                                              ; preds = %.lr.ph107
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #8
  %110 = sext i32 %storemerge105 to i64
  %111 = getelementptr inbounds [200010 x i64], ptr @y, i64 0, i64 %110
  call void @_ZNSt4pairIxiEC2IRxRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 8 dereferenceable(12) %8, ptr noundef nonnull align 8 dereferenceable(8) %111, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %112 = invoke { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(12) %8)
          to label %113 unwind label %114

113:                                              ; preds = %109
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #8
  %.pre123 = load i32, ptr %7, align 4, !tbaa !5
  %.pre124 = load i32, ptr @N, align 4, !tbaa !5
  br label %116

114:                                              ; preds = %109
  %115 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  br label %162

116:                                              ; preds = %.lr.ph107, %113
  %117 = phi i32 [ %108, %.lr.ph107 ], [ %.pre124, %113 ]
  %118 = phi i32 [ %storemerge105, %.lr.ph107 ], [ %.pre123, %113 ]
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %7, align 4, !tbaa !5
  %120 = icmp slt i32 %119, %117
  br i1 %120, label %.lr.ph107, label %._crit_edge108, !llvm.loop !16

121:                                              ; preds = %._crit_edge108
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #8
  store i32 -1, ptr %12, align 4, !tbaa !5
  call void @_ZNSt4pairIxiEC2IRxiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(12) %11, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %122 = invoke { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(12) %11)
          to label %123 unwind label %148

123:                                              ; preds = %121
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #8
  store i64 1000000007, ptr %13, align 8, !tbaa !9
  br label %124

124:                                              ; preds = %154, %123
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #8
  %125 = call ptr @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #8
  store ptr %125, ptr %14, align 8
  %126 = call ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIxiEEmmEi(ptr noundef nonnull align 8 dereferenceable(8) %14, i32 noundef 0) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #8
  %127 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  %128 = load i64, ptr %127, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #8
  %129 = call ptr @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #8
  store ptr %129, ptr %16, align 8
  %130 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #8
  %131 = load i64, ptr %130, align 8, !tbaa !17
  %132 = sub nsw i64 %128, %131
  store i64 %132, ptr %15, align 8, !tbaa !9
  %133 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %134 = load i64, ptr %133, align 8, !tbaa !9
  store i64 %134, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #8
  %135 = call ptr @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #8
  store ptr %135, ptr %17, align 8
  %136 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #8
  %137 = getelementptr inbounds i8, ptr %136, i64 8
  %138 = load i32, ptr %137, align 8, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #8
  %.not72 = icmp eq i32 %138, -1
  br i1 %.not72, label %156, label %139

139:                                              ; preds = %124
  %140 = call ptr @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #8
  %141 = invoke ptr @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS1_E(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr %140)
          to label %142 unwind label %150

142:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %18) #8
  %143 = sext i32 %138 to i64
  %144 = getelementptr inbounds [200010 x i64], ptr @x, i64 0, i64 %143
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %19) #8
  store i32 -1, ptr %19, align 4, !tbaa !5
  call void @_ZNSt4pairIxiEC2IRxiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(12) %18, ptr noundef nonnull align 8 dereferenceable(8) %144, ptr noundef nonnull align 4 dereferenceable(4) %19)
  %145 = invoke { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(12) %18)
          to label %154 unwind label %152

146:                                              ; preds = %._crit_edge108
  %147 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #8
  br label %162

148:                                              ; preds = %121
  %149 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #8
  br label %162

150:                                              ; preds = %139
  %151 = landingpad { ptr, i32 }
          cleanup
  br label %155

152:                                              ; preds = %142
  %153 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %19) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #8
  br label %155

154:                                              ; preds = %142
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %19) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #8
  br label %124

155:                                              ; preds = %152, %150
  %.pn = phi { ptr, i32 } [ %153, %152 ], [ %151, %150 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #8
  br label %162

156:                                              ; preds = %124
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #8
  %157 = load i64, ptr %13, align 8, !tbaa !9
  %158 = sub nsw i64 %.054.lcssa134140150, %.057.lcssa132142148
  %159 = mul nsw i64 %157, %158
  store i64 %159, ptr %20, align 8, !tbaa !9
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %20)
  %161 = load i64, ptr %160, align 8, !tbaa !9
  store i64 %161, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #8
  %.pre125 = load i64, ptr %3, align 8, !tbaa !9
  br label %163

162:                                              ; preds = %155, %148, %146, %114
  %.pn76 = phi { ptr, i32 } [ %115, %114 ], [ %.pn, %155 ], [ %149, %148 ], [ %147, %146 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn76

163:                                              ; preds = %156, %._crit_edge103
  %164 = phi i64 [ %.pre125, %156 ], [ %63, %._crit_edge103 ]
  %165 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %164)
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %165, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  ret i32 0
}

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

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

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

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #7

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #7

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

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

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


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