; LLVM IR from tangjz/acm-icpc :: 51nod (1052)

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

%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<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
@m = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@L = external dso_local global [5001 x i32], align 16
@R = external dso_local global [5001 x i32], align 16
@a = external dso_local global [5001 x i64], align 16
@ans = external dso_local global i64, align 8
@sp = external dso_local global %"class.std::set", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::pair.0", align 8
  %4 = alloca i64, align 8
  %5 = alloca { i64, i32 }, align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"struct.std::pair.0", align 8
  %8 = alloca i64, align 8
  %9 = alloca { i64, i32 }, align 8
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %14 = alloca %"struct.std::pair.0", align 8
  %15 = alloca i64, align 8
  %16 = alloca { i64, i32 }, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::pair.0", align 8
  %20 = alloca i64, align 8
  %21 = alloca { i64, i32 }, align 8
  %22 = alloca i32, align 4
  %23 = alloca %"struct.std::pair.0", align 8
  %24 = alloca i64, align 8
  %25 = alloca { i64, i32 }, align 8
  %26 = alloca %"struct.std::pair.0", align 8
  %27 = alloca i64, align 8
  %28 = alloca { i64, i32 }, align 8
  %29 = alloca %"struct.std::pair", align 8
  store i32 0, ptr %1, align 4
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @tot, ptr noundef @m)
  br label %31

31:                                               ; preds = %80, %0
  %32 = load i32, ptr @tot, align 4, !tbaa !5
  %33 = add nsw i32 %32, -1
  store i32 %33, ptr @tot, align 4, !tbaa !5
  %34 = icmp ne i32 %32, 0
  br i1 %34, label %35, label %88

35:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %2)
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %39, label %45

39:                                               ; preds = %35
  %40 = load i32, ptr @n, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %41
  %43 = load i64, ptr %42, align 8, !tbaa !9
  %44 = icmp slt i64 %43, 0
  br i1 %44, label %54, label %45

45:                                               ; preds = %39, %35
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = icmp slt i32 %46, 0
  br i1 %47, label %48, label %80

48:                                               ; preds = %45
  %49 = load i32, ptr @n, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !9
  %53 = icmp sgt i64 %52, 0
  br i1 %53, label %54, label %80

54:                                               ; preds = %48, %39
  %55 = load i32, ptr @n, align 4, !tbaa !5
  %56 = sub nsw i32 %55, 1
  %57 = load i32, ptr @n, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %58
  store i32 %56, ptr %59, align 4, !tbaa !5
  %60 = load i32, ptr @n, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  %62 = load i32, ptr @n, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %63
  store i32 %61, ptr %64, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %65 = load i32, ptr @n, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %66
  %68 = load i64, ptr %67, align 8, !tbaa !9
  %69 = call noundef i64 @_ZSt3absx(i64 noundef %68)
  store i64 %69, ptr %4, align 8, !tbaa !9
  %70 = call { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) @n)
  store { i64, i32 } %70, ptr %5, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %3, ptr align 8 %5, i64 12, i1 false)
  %71 = call { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 8 dereferenceable(12) %3)
  %72 = getelementptr inbounds { ptr, i8 }, ptr %6, i32 0, i32 0
  %73 = extractvalue { ptr, i8 } %71, 0
  store ptr %73, ptr %72, align 8
  %74 = getelementptr inbounds { ptr, i8 }, ptr %6, i32 0, i32 1
  %75 = extractvalue { ptr, i8 } %71, 1
  store i8 %75, ptr %74, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #7
  %76 = load i32, ptr @n, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr @n, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %78
  store i64 0, ptr %79, align 8, !tbaa !9
  br label %80

80:                                               ; preds = %54, %48, %45
  %81 = load i32, ptr %2, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = load i32, ptr @n, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %84
  %86 = load i64, ptr %85, align 8, !tbaa !9
  %87 = add nsw i64 %86, %82
  store i64 %87, ptr %85, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %31, !llvm.loop !11

88:                                               ; preds = %31
  %89 = load i32, ptr @n, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %90
  %92 = load i64, ptr %91, align 8, !tbaa !9
  %93 = icmp ne i64 %92, 0
  br i1 %93, label %94, label %118

94:                                               ; preds = %88
  %95 = load i32, ptr @n, align 4, !tbaa !5
  %96 = sub nsw i32 %95, 1
  %97 = load i32, ptr @n, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %98
  store i32 %96, ptr %99, align 4, !tbaa !5
  %100 = load i32, ptr @n, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  %102 = load i32, ptr @n, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %103
  store i32 %101, ptr %104, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %105 = load i32, ptr @n, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %106
  %108 = load i64, ptr %107, align 8, !tbaa !9
  %109 = call noundef i64 @_ZSt3absx(i64 noundef %108)
  store i64 %109, ptr %8, align 8, !tbaa !9
  %110 = call { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) @n)
  store { i64, i32 } %110, ptr %9, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %9, i64 12, i1 false)
  %111 = call { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 8 dereferenceable(12) %7)
  %112 = getelementptr inbounds { ptr, i8 }, ptr %10, i32 0, i32 0
  %113 = extractvalue { ptr, i8 } %111, 0
  store ptr %113, ptr %112, align 8
  %114 = getelementptr inbounds { ptr, i8 }, ptr %10, i32 0, i32 1
  %115 = extractvalue { ptr, i8 } %111, 1
  store i8 %115, ptr %114, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #7
  %116 = load i32, ptr @n, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr @n, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %94, %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %140, %118
  %120 = load i32, ptr %11, align 4, !tbaa !5
  %121 = load i32, ptr @n, align 4, !tbaa !5
  %122 = icmp slt i32 %120, %121
  br i1 %122, label %124, label %123

123:                                              ; preds = %119
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %143

124:                                              ; preds = %119
  %125 = load i32, ptr %11, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %126
  %128 = load i64, ptr %127, align 8, !tbaa !9
  %129 = icmp sgt i64 %128, 0
  br i1 %129, label %130, label %139

130:                                              ; preds = %124
  %131 = load i32, ptr @m, align 4, !tbaa !5
  %132 = add nsw i32 %131, -1
  store i32 %132, ptr @m, align 4, !tbaa !5
  %133 = load i32, ptr %11, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %134
  %136 = load i64, ptr %135, align 8, !tbaa !9
  %137 = load i64, ptr @ans, align 8, !tbaa !9
  %138 = add nsw i64 %137, %136
  store i64 %138, ptr @ans, align 8, !tbaa !9
  br label %139

139:                                              ; preds = %130, %124
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %11, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %11, align 4, !tbaa !5
  br label %119, !llvm.loop !13

143:                                              ; preds = %123
  br label %144

144:                                              ; preds = %317, %315, %143
  %145 = load i32, ptr @m, align 4, !tbaa !5
  %146 = icmp slt i32 %145, 0
  br i1 %146, label %147, label %318

147:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %148 = call ptr @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @sp) #7
  %149 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %13, i32 0, i32 0
  store ptr %148, ptr %149, align 8
  %150 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  %151 = getelementptr inbounds %"struct.std::pair.0", ptr %150, i32 0, i32 1
  %152 = load i32, ptr %151, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  store i32 %152, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %153 = load i32, ptr %12, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %154
  %156 = load i64, ptr %155, align 8, !tbaa !9
  %157 = call noundef i64 @_ZSt3absx(i64 noundef %156)
  store i64 %157, ptr %15, align 8, !tbaa !9
  %158 = call { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(4) %12)
  store { i64, i32 } %158, ptr %16, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %16, i64 12, i1 false)
  %159 = call noundef i64 @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5eraseERKS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 8 dereferenceable(12) %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #7
  %160 = load i32, ptr %12, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %161
  %163 = load i64, ptr %162, align 8, !tbaa !9
  %164 = icmp sle i64 %163, 0
  br i1 %164, label %165, label %199

165:                                              ; preds = %147
  %166 = load i32, ptr %12, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = icmp slt i32 %169, 0
  br i1 %170, label %178, label %171

171:                                              ; preds = %165
  %172 = load i32, ptr %12, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %173
  %175 = load i32, ptr %174, align 4, !tbaa !5
  %176 = load i32, ptr @n, align 4, !tbaa !5
  %177 = icmp sge i32 %175, %176
  br i1 %177, label %178, label %199

178:                                              ; preds = %171, %165
  %179 = load i32, ptr %12, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %180
  %182 = load i32, ptr %181, align 4, !tbaa !5
  %183 = load i32, ptr %12, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %184
  %186 = load i32, ptr %185, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %187
  store i32 %182, ptr %188, align 4, !tbaa !5
  %189 = load i32, ptr %12, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %190
  %192 = load i32, ptr %191, align 4, !tbaa !5
  %193 = load i32, ptr %12, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %194
  %196 = load i32, ptr %195, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %197
  store i32 %192, ptr %198, align 4, !tbaa !5
  store i32 7, ptr %17, align 4
  br label %315, !llvm.loop !16

199:                                              ; preds = %171, %147
  %200 = load i32, ptr %12, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %201
  %203 = load i64, ptr %202, align 8, !tbaa !9
  %204 = call noundef i64 @_ZSt3absx(i64 noundef %203)
  %205 = load i64, ptr @ans, align 8, !tbaa !9
  %206 = sub nsw i64 %205, %204
  store i64 %206, ptr @ans, align 8, !tbaa !9
  %207 = load i32, ptr %12, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !5
  %211 = icmp sge i32 %210, 0
  br i1 %211, label %212, label %253

212:                                              ; preds = %199
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %213 = load i32, ptr %12, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %214
  %216 = load i32, ptr %215, align 4, !tbaa !5
  store i32 %216, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %217 = load i32, ptr %18, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %218
  %220 = load i64, ptr %219, align 8, !tbaa !9
  %221 = call noundef i64 @_ZSt3absx(i64 noundef %220)
  store i64 %221, ptr %20, align 8, !tbaa !9
  %222 = call { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 4 dereferenceable(4) %18)
  store { i64, i32 } %222, ptr %21, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %21, i64 12, i1 false)
  %223 = call noundef i64 @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5eraseERKS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 8 dereferenceable(12) %19)
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #7
  %224 = load i32, ptr %18, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %225
  %227 = load i32, ptr %226, align 4, !tbaa !5
  %228 = load i32, ptr %18, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %229
  %231 = load i32, ptr %230, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %232
  store i32 %227, ptr %233, align 4, !tbaa !5
  %234 = load i32, ptr %18, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %235
  %237 = load i32, ptr %236, align 4, !tbaa !5
  %238 = load i32, ptr %18, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %239
  %241 = load i32, ptr %240, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %242
  store i32 %237, ptr %243, align 4, !tbaa !5
  %244 = load i32, ptr %18, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %245
  %247 = load i64, ptr %246, align 8, !tbaa !9
  %248 = load i32, ptr %12, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %249
  %251 = load i64, ptr %250, align 8, !tbaa !9
  %252 = add nsw i64 %251, %247
  store i64 %252, ptr %250, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %253

253:                                              ; preds = %212, %199
  %254 = load i32, ptr %12, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %255
  %257 = load i32, ptr %256, align 4, !tbaa !5
  %258 = load i32, ptr @n, align 4, !tbaa !5
  %259 = icmp slt i32 %257, %258
  br i1 %259, label %260, label %301

260:                                              ; preds = %253
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %261 = load i32, ptr %12, align 4, !tbaa !5
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %262
  %264 = load i32, ptr %263, align 4, !tbaa !5
  store i32 %264, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %265 = load i32, ptr %22, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %266
  %268 = load i64, ptr %267, align 8, !tbaa !9
  %269 = call noundef i64 @_ZSt3absx(i64 noundef %268)
  store i64 %269, ptr %24, align 8, !tbaa !9
  %270 = call { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 4 dereferenceable(4) %22)
  store { i64, i32 } %270, ptr %25, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %23, ptr align 8 %25, i64 12, i1 false)
  %271 = call noundef i64 @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5eraseERKS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 8 dereferenceable(12) %23)
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #7
  %272 = load i32, ptr %22, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %273
  %275 = load i32, ptr %274, align 4, !tbaa !5
  %276 = load i32, ptr %22, align 4, !tbaa !5
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %277
  %279 = load i32, ptr %278, align 4, !tbaa !5
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %280
  store i32 %275, ptr %281, align 4, !tbaa !5
  %282 = load i32, ptr %22, align 4, !tbaa !5
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %283
  %285 = load i32, ptr %284, align 4, !tbaa !5
  %286 = load i32, ptr %22, align 4, !tbaa !5
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %287
  %289 = load i32, ptr %288, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %290
  store i32 %285, ptr %291, align 4, !tbaa !5
  %292 = load i32, ptr %22, align 4, !tbaa !5
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %293
  %295 = load i64, ptr %294, align 8, !tbaa !9
  %296 = load i32, ptr %12, align 4, !tbaa !5
  %297 = sext i32 %296 to i64
  %298 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %297
  %299 = load i64, ptr %298, align 8, !tbaa !9
  %300 = add nsw i64 %299, %295
  store i64 %300, ptr %298, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %301

301:                                              ; preds = %260, %253
  %302 = load i32, ptr @m, align 4, !tbaa !5
  %303 = add nsw i32 %302, 1
  store i32 %303, ptr @m, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %304 = load i32, ptr %12, align 4, !tbaa !5
  %305 = sext i32 %304 to i64
  %306 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %305
  %307 = load i64, ptr %306, align 8, !tbaa !9
  %308 = call noundef i64 @_ZSt3absx(i64 noundef %307)
  store i64 %308, ptr %27, align 8, !tbaa !9
  %309 = call { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 4 dereferenceable(4) %12)
  store { i64, i32 } %309, ptr %28, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %26, ptr align 8 %28, i64 12, i1 false)
  %310 = call { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 8 dereferenceable(12) %26)
  %311 = getelementptr inbounds { ptr, i8 }, ptr %29, i32 0, i32 0
  %312 = extractvalue { ptr, i8 } %310, 0
  store ptr %312, ptr %311, align 8
  %313 = getelementptr inbounds { ptr, i8 }, ptr %29, i32 0, i32 1
  %314 = extractvalue { ptr, i8 } %310, 1
  store i8 %314, ptr %313, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #7
  store i32 0, ptr %17, align 4
  br label %315

315:                                              ; preds = %301, %178
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  %316 = load i32, ptr %17, align 4
  switch i32 %316, label %321 [
    i32 0, label %317
    i32 7, label %144
  ]

317:                                              ; preds = %315
  br label %144, !llvm.loop !16

318:                                              ; preds = %144
  %319 = load i64, ptr @ans, align 8, !tbaa !9
  %320 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %319)
  ret i32 0

321:                                              ; preds = %315
  unreachable
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #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 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 uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3absx(i64 noundef) #4

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

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

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

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

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

declare i32 @printf(ptr noundef, ...) #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!15, !6, i64 8}
!15 = !{!"_ZTSSt4pairIxiE", !10, i64 0, !6, i64 8}
!16 = distinct !{!16, !12}


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

%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<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
@m = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@L = external dso_local local_unnamed_addr global [5001 x i32], align 16
@R = external dso_local local_unnamed_addr global [5001 x i32], align 16
@a = external dso_local local_unnamed_addr global [5001 x i64], align 16
@ans = external dso_local local_unnamed_addr global i64, align 8
@sp = external dso_local global %"class.std::set", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca %"struct.std::pair.0", align 8
  %3 = alloca i64, align 8
  %4 = alloca %"struct.std::pair.0", align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca %"struct.std::pair.0", align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair.0", align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair.0", align 8
  %15 = alloca i64, align 8
  %16 = alloca %"struct.std::pair.0", align 8
  %17 = alloca i64, align 8
  %18 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @tot, ptr noundef nonnull @m)
  %19 = load i32, ptr @tot, align 4, !tbaa !5
  %20 = add nsw i32 %19, -1
  store i32 %20, ptr @tot, align 4, !tbaa !5
  %.not31 = icmp eq i32 %19, 0
  br i1 %.not31, label %.._crit_edge_crit_edge, label %.lr.ph

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre41 = load i32, ptr @n, align 4, !tbaa !5
  %.phi.trans.insert42 = sext i32 %.pre41 to i64
  %.phi.trans.insert43 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %.phi.trans.insert42
  %.pre44 = load i64, ptr %.phi.trans.insert43, align 8, !tbaa !9
  br label %._crit_edge

.lr.ph:                                           ; preds = %0
  %.sroa.228.0..sroa_idx = getelementptr inbounds i8, ptr %2, i64 8
  br label %21

21:                                               ; preds = %.lr.ph, %.thread
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1)
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %25, label %31

25:                                               ; preds = %21
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %27
  %29 = load i64, ptr %28, align 8, !tbaa !9
  %30 = icmp slt i64 %29, 0
  br i1 %30, label %38, label %.thread

31:                                               ; preds = %21
  %32 = icmp slt i32 %23, 0
  %.pre38 = load i32, ptr @n, align 4, !tbaa !5
  %33 = sext i32 %.pre38 to i64
  %34 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %33
  %35 = load i64, ptr %34, align 8, !tbaa !9
  br i1 %32, label %36, label %.thread

36:                                               ; preds = %31
  %37 = icmp sgt i64 %35, 0
  br i1 %37, label %38, label %.thread

38:                                               ; preds = %36, %25
  %39 = phi i64 [ %35, %36 ], [ %29, %25 ]
  %.pre-phi = phi i64 [ %33, %36 ], [ %27, %25 ]
  %40 = phi i32 [ %.pre38, %36 ], [ %26, %25 ]
  %41 = add nsw i32 %40, -1
  %42 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %.pre-phi
  store i32 %41, ptr %42, align 4, !tbaa !5
  %43 = add nsw i32 %40, 1
  %44 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %.pre-phi
  store i32 %43, ptr %44, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %45 = call noundef i64 @_ZSt3absx(i64 noundef %39)
  store i64 %45, ptr %3, align 8, !tbaa !9
  %46 = call { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %.fca.0.extract25 = extractvalue { i64, i32 } %46, 0
  %.fca.1.extract26 = extractvalue { i64, i32 } %46, 1
  store i64 %.fca.0.extract25, ptr %2, align 8
  store i32 %.fca.1.extract26, ptr %.sroa.228.0..sroa_idx, align 8
  %47 = call { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 8 dereferenceable(12) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #6
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr @n, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %50
  store i64 0, ptr %51, align 8, !tbaa !9
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br label %.thread

.thread:                                          ; preds = %31, %25, %38, %36
  %.pre-phi55 = phi i64 [ %27, %25 ], [ %50, %38 ], [ %33, %36 ], [ %33, %31 ]
  %52 = phi i64 [ %29, %25 ], [ 0, %38 ], [ %35, %36 ], [ %35, %31 ]
  %53 = phi i32 [ %26, %25 ], [ %49, %38 ], [ %.pre38, %36 ], [ %.pre38, %31 ]
  %54 = phi i32 [ %23, %25 ], [ %.pre, %38 ], [ %23, %36 ], [ 0, %31 ]
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %.pre-phi55
  %57 = add nsw i64 %52, %55
  store i64 %57, ptr %56, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %58 = load i32, ptr @tot, align 4, !tbaa !5
  %59 = add nsw i32 %58, -1
  store i32 %59, ptr @tot, align 4, !tbaa !5
  %.not = icmp eq i32 %58, 0
  br i1 %.not, label %._crit_edge, label %21, !llvm.loop !11

._crit_edge:                                      ; preds = %.thread, %.._crit_edge_crit_edge
  %.pre-phi54 = phi i64 [ %.phi.trans.insert42, %.._crit_edge_crit_edge ], [ %.pre-phi55, %.thread ]
  %60 = phi i64 [ %.pre44, %.._crit_edge_crit_edge ], [ %57, %.thread ]
  %61 = phi i32 [ %.pre41, %.._crit_edge_crit_edge ], [ %53, %.thread ]
  %.not29 = icmp eq i64 %60, 0
  br i1 %.not29, label %72, label %62

62:                                               ; preds = %._crit_edge
  %63 = add nsw i32 %61, -1
  %64 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %.pre-phi54
  store i32 %63, ptr %64, align 4, !tbaa !5
  %65 = add nsw i32 %61, 1
  %66 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %.pre-phi54
  store i32 %65, ptr %66, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %67 = call noundef i64 @_ZSt3absx(i64 noundef %60)
  store i64 %67, ptr %5, align 8, !tbaa !9
  %68 = call { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %.fca.0.extract19 = extractvalue { i64, i32 } %68, 0
  %.fca.1.extract20 = extractvalue { i64, i32 } %68, 1
  store i64 %.fca.0.extract19, ptr %4, align 8
  %.sroa.222.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  store i32 %.fca.1.extract20, ptr %.sroa.222.0..sroa_idx, align 8
  %69 = call { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 8 dereferenceable(12) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  %70 = load i32, ptr @n, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr @n, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %62, %._crit_edge
  %73 = phi i32 [ %71, %62 ], [ %61, %._crit_edge ]
  %m.promoted = load i32, ptr @m, align 4, !tbaa !5
  %ans.promoted = load i64, ptr @ans, align 8, !tbaa !9
  %74 = icmp sgt i32 %73, 0
  br i1 %74, label %.lr.ph34.preheader, label %.preheader

.lr.ph34.preheader:                               ; preds = %72
  %wide.trip.count = zext nneg i32 %73 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %75 = icmp eq i32 %73, 1
  br i1 %75, label %.preheader.loopexit.unr-lcssa, label %.lr.ph34.preheader.new

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

.preheader.loopexit.unr-lcssa:                    ; preds = %101, %.lr.ph34.preheader
  %.lcssa62.ph = phi i64 [ poison, %.lr.ph34.preheader ], [ %102, %101 ]
  %.lcssa.ph = phi i32 [ poison, %.lr.ph34.preheader ], [ %103, %101 ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph34.preheader ], [ %indvars.iv.next.1, %101 ]
  %.unr = phi i32 [ %m.promoted, %.lr.ph34.preheader ], [ %103, %101 ]
  %.unr65 = phi i64 [ %ans.promoted, %.lr.ph34.preheader ], [ %102, %101 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.lr.ph34.epil

.lr.ph34.epil:                                    ; preds = %.preheader.loopexit.unr-lcssa
  %76 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %indvars.iv.unr
  %77 = load i64, ptr %76, align 8, !tbaa !9
  %78 = icmp sgt i64 %77, 0
  br i1 %78, label %79, label %.preheader

79:                                               ; preds = %.lr.ph34.epil
  %80 = add nsw i32 %.unr, -1
  store i32 %80, ptr @m, align 4, !tbaa !5
  %81 = add nsw i64 %.unr65, %77
  store i64 %81, ptr @ans, align 8, !tbaa !9
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit.unr-lcssa, %79, %.lr.ph34.epil, %72
  %82 = phi i64 [ %ans.promoted, %72 ], [ %.lcssa62.ph, %.preheader.loopexit.unr-lcssa ], [ %.unr65, %.lr.ph34.epil ], [ %81, %79 ]
  %83 = phi i32 [ %m.promoted, %72 ], [ %.lcssa.ph, %.preheader.loopexit.unr-lcssa ], [ %.unr, %.lr.ph34.epil ], [ %80, %79 ]
  %84 = icmp slt i32 %83, 0
  br i1 %84, label %.lr.ph35, label %._crit_edge36

.lr.ph35:                                         ; preds = %.preheader
  %.sroa.213.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 8
  %.sroa.29.0..sroa_idx = getelementptr inbounds i8, ptr %11, i64 8
  %.sroa.25.0..sroa_idx = getelementptr inbounds i8, ptr %14, i64 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %16, i64 8
  br label %104

.lr.ph34:                                         ; preds = %101, %.lr.ph34.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph34.preheader.new ], [ %indvars.iv.next.1, %101 ]
  %85 = phi i32 [ %m.promoted, %.lr.ph34.preheader.new ], [ %103, %101 ]
  %86 = phi i64 [ %ans.promoted, %.lr.ph34.preheader.new ], [ %102, %101 ]
  %niter = phi i64 [ 0, %.lr.ph34.preheader.new ], [ %niter.next.1, %101 ]
  %87 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %indvars.iv
  %88 = load i64, ptr %87, align 16, !tbaa !9
  %89 = icmp sgt i64 %88, 0
  br i1 %89, label %90, label %.lr.ph34.1

90:                                               ; preds = %.lr.ph34
  %91 = add nsw i32 %85, -1
  store i32 %91, ptr @m, align 4, !tbaa !5
  %92 = add nsw i64 %86, %88
  store i64 %92, ptr @ans, align 8, !tbaa !9
  br label %.lr.ph34.1

.lr.ph34.1:                                       ; preds = %.lr.ph34, %90
  %93 = phi i64 [ %86, %.lr.ph34 ], [ %92, %90 ]
  %94 = phi i32 [ %85, %.lr.ph34 ], [ %91, %90 ]
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %95 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %indvars.iv.next
  %96 = load i64, ptr %95, align 8, !tbaa !9
  %97 = icmp sgt i64 %96, 0
  br i1 %97, label %98, label %101

98:                                               ; preds = %.lr.ph34.1
  %99 = add nsw i32 %94, -1
  store i32 %99, ptr @m, align 4, !tbaa !5
  %100 = add nsw i64 %93, %96
  store i64 %100, ptr @ans, align 8, !tbaa !9
  br label %101

101:                                              ; preds = %98, %.lr.ph34.1
  %102 = phi i64 [ %93, %.lr.ph34.1 ], [ %100, %98 ]
  %103 = phi i32 [ %94, %.lr.ph34.1 ], [ %99, %98 ]
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 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 %.preheader.loopexit.unr-lcssa, label %.lr.ph34, !llvm.loop !13

104:                                              ; preds = %.lr.ph35, %199
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %105 = call ptr @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @sp) #6
  store ptr %105, ptr %7, align 8
  %106 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %107 = getelementptr inbounds i8, ptr %106, i64 8
  %108 = load i32, ptr %107, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  store i32 %108, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %109
  %111 = load i64, ptr %110, align 8, !tbaa !9
  %112 = call noundef i64 @_ZSt3absx(i64 noundef %111)
  store i64 %112, ptr %9, align 8, !tbaa !9
  %113 = call { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %.fca.0.extract10 = extractvalue { i64, i32 } %113, 0
  %.fca.1.extract11 = extractvalue { i64, i32 } %113, 1
  store i64 %.fca.0.extract10, ptr %8, align 8
  store i32 %.fca.1.extract11, ptr %.sroa.213.0..sroa_idx, align 8
  %114 = call noundef i64 @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5eraseERKS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 8 dereferenceable(12) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  %115 = load i32, ptr %6, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %116
  %118 = load i64, ptr %117, align 8, !tbaa !9
  %119 = icmp slt i64 %118, 1
  br i1 %119, label %120, label %130

120:                                              ; preds = %104
  %121 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %116
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = icmp sgt i32 %122, -1
  %.phi.trans.insert51 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %116
  %.pre52 = load i32, ptr %.phi.trans.insert51, align 4, !tbaa !5
  %124 = load i32, ptr @n, align 4
  %.not30 = icmp slt i32 %.pre52, %124
  %or.cond = select i1 %123, i1 %.not30, i1 false
  br i1 %or.cond, label %130, label %._crit_edge50

._crit_edge50:                                    ; preds = %120
  %125 = sext i32 %.pre52 to i64
  %126 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %125
  store i32 %122, ptr %126, align 4, !tbaa !5
  %127 = load i32, ptr %121, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %128
  store i32 %.pre52, ptr %129, align 4, !tbaa !5
  br label %199, !llvm.loop !16

130:                                              ; preds = %120, %104
  %131 = call noundef i64 @_ZSt3absx(i64 noundef %118)
  %132 = load i64, ptr @ans, align 8, !tbaa !9
  %133 = sub nsw i64 %132, %131
  store i64 %133, ptr @ans, align 8, !tbaa !9
  %134 = load i32, ptr %6, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = icmp sgt i32 %137, -1
  br i1 %138, label %139, label %163

139:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #6
  store i32 %137, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  %140 = zext nneg i32 %137 to i64
  %141 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %140
  %142 = load i64, ptr %141, align 8, !tbaa !9
  %143 = call noundef i64 @_ZSt3absx(i64 noundef %142)
  store i64 %143, ptr %12, align 8, !tbaa !9
  %144 = call { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %.fca.0.extract6 = extractvalue { i64, i32 } %144, 0
  %.fca.1.extract7 = extractvalue { i64, i32 } %144, 1
  store i64 %.fca.0.extract6, ptr %11, align 8
  store i32 %.fca.1.extract7, ptr %.sroa.29.0..sroa_idx, align 8
  %145 = call noundef i64 @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5eraseERKS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 8 dereferenceable(12) %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  %146 = load i32, ptr %10, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %147
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %152
  store i32 %149, ptr %153, align 4, !tbaa !5
  %154 = sext i32 %149 to i64
  %155 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %154
  store i32 %151, ptr %155, align 4, !tbaa !5
  %156 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %147
  %157 = load i64, ptr %156, align 8, !tbaa !9
  %158 = load i32, ptr %6, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %159
  %161 = load i64, ptr %160, align 8, !tbaa !9
  %162 = add nsw i64 %161, %157
  store i64 %162, ptr %160, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  br label %163

163:                                              ; preds = %139, %130
  %.pre-phi45 = phi i64 [ %159, %139 ], [ %135, %130 ]
  %164 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %.pre-phi45
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = load i32, ptr @n, align 4, !tbaa !5
  %167 = icmp slt i32 %165, %166
  br i1 %167, label %168, label %._crit_edge47

._crit_edge47:                                    ; preds = %163
  %.phi.trans.insert48 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %.pre-phi45
  %.pre49 = load i64, ptr %.phi.trans.insert48, align 8, !tbaa !9
  br label %192

168:                                              ; preds = %163
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #6
  store i32 %165, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #6
  %169 = sext i32 %165 to i64
  %170 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %169
  %171 = load i64, ptr %170, align 8, !tbaa !9
  %172 = call noundef i64 @_ZSt3absx(i64 noundef %171)
  store i64 %172, ptr %15, align 8, !tbaa !9
  %173 = call { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %.fca.0.extract2 = extractvalue { i64, i32 } %173, 0
  %.fca.1.extract3 = extractvalue { i64, i32 } %173, 1
  store i64 %.fca.0.extract2, ptr %14, align 8
  store i32 %.fca.1.extract3, ptr %.sroa.25.0..sroa_idx, align 8
  %174 = call noundef i64 @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5eraseERKS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 8 dereferenceable(12) %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #6
  %175 = load i32, ptr %13, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %176
  %180 = load i32, ptr %179, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [5001 x i32], ptr @L, i64 0, i64 %181
  store i32 %178, ptr %182, align 4, !tbaa !5
  %183 = sext i32 %178 to i64
  %184 = getelementptr inbounds [5001 x i32], ptr @R, i64 0, i64 %183
  store i32 %180, ptr %184, align 4, !tbaa !5
  %185 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %176
  %186 = load i64, ptr %185, align 8, !tbaa !9
  %187 = load i32, ptr %6, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [5001 x i64], ptr @a, i64 0, i64 %188
  %190 = load i64, ptr %189, align 8, !tbaa !9
  %191 = add nsw i64 %190, %186
  store i64 %191, ptr %189, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  br label %192

192:                                              ; preds = %._crit_edge47, %168
  %193 = phi i64 [ %191, %168 ], [ %.pre49, %._crit_edge47 ]
  %194 = load i32, ptr @m, align 4, !tbaa !5
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr @m, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #6
  %196 = call noundef i64 @_ZSt3absx(i64 noundef %193)
  store i64 %196, ptr %17, align 8, !tbaa !9
  %197 = call { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %.fca.0.extract = extractvalue { i64, i32 } %197, 0
  %.fca.1.extract = extractvalue { i64, i32 } %197, 1
  store i64 %.fca.0.extract, ptr %16, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  %198 = call { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 8 dereferenceable(12) %16)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #6
  br label %199

199:                                              ; preds = %192, %._crit_edge50
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  %200 = load i32, ptr @m, align 4, !tbaa !5
  %201 = icmp slt i32 %200, 0
  br i1 %201, label %104, label %._crit_edge36.loopexit

._crit_edge36.loopexit:                           ; preds = %199
  %.pre53 = load i64, ptr @ans, align 8, !tbaa !9
  br label %._crit_edge36

._crit_edge36:                                    ; preds = %._crit_edge36.loopexit, %.preheader
  %202 = phi i64 [ %.pre53, %._crit_edge36.loopexit ], [ %82, %.preheader ]
  %203 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %202)
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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 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 uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3absx(i64 noundef) 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: 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 nounwind uwtable
declare dso_local noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxiEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5 align 2

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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 = { nofree nounwind "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 = { 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 = !{!15, !6, i64 8}
!15 = !{!"_ZTSSt4pairIxiE", !10, i64 0, !6, i64 8}
!16 = distinct !{!16, !12}


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