; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/117 Division 2/Problem C/C.ll (Z7computev)

; 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::multiset" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<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::_Rb_tree_const_iterator" = type { ptr }
%"class.std::reverse_iterator" = type { %"struct.std::_Rb_tree_const_iterator" }

@n = external dso_local global i32, align 4
@len = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@a = external dso_local global [100100 x i32], align 16
@sum = external dso_local global i64, align 8
@mx = external dso_local global i64, align 8
@s1 = external dso_local global %"class.std::multiset", align 8
@s2 = external dso_local global %"class.std::multiset", align 8

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z7computev() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %6 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %10 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %14 = alloca i32, align 4
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %16 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %17 = alloca i32, align 4
  %18 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %19 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %20 = alloca i32, align 4
  %21 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %22 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %23 = alloca i32, align 4
  %24 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %25 = alloca %"class.std::reverse_iterator", align 8
  %26 = alloca %"class.std::reverse_iterator", align 8
  %27 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %28 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %29 = alloca %"class.std::reverse_iterator", align 8
  %30 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  store i64 0, ptr @sum, align 8, !tbaa !5
  call void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @s1) #4
  call void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @s2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  store i32 0, ptr %1, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %270, %0
  %32 = load i32, ptr %1, align 4, !tbaa !9
  %33 = load i32, ptr @n, align 4, !tbaa !9
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  br label %273

36:                                               ; preds = %31
  %37 = load i32, ptr %1, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !9
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %42, label %50

42:                                               ; preds = %36
  %43 = load i32, ptr %1, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = load i64, ptr @sum, align 8, !tbaa !5
  %49 = add nsw i64 %48, %47
  store i64 %49, ptr @sum, align 8, !tbaa !5
  br label %158

50:                                               ; preds = %36
  %51 = load i32, ptr %1, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !9
  %55 = icmp slt i32 %54, 0
  br i1 %55, label %56, label %157

56:                                               ; preds = %50
  %57 = load i32, ptr @k, align 4, !tbaa !9
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %59, label %74

59:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  %60 = load i32, ptr %1, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = sub nsw i32 0, %63
  store i32 %64, ptr %2, align 4, !tbaa !9
  %65 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) @s2, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %66 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %3, i32 0, i32 0
  store ptr %65, ptr %66, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %67 = load i32, ptr %1, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = load i64, ptr @sum, align 8, !tbaa !5
  %73 = add nsw i64 %72, %71
  store i64 %73, ptr @sum, align 8, !tbaa !5
  br label %156

74:                                               ; preds = %56
  %75 = call noundef i64 @_ZNKSt8multisetIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @s1) #4
  %76 = load i32, ptr @k, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = icmp ult i64 %75, %77
  br i1 %78, label %79, label %94

79:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %80 = load i32, ptr %1, align 4, !tbaa !9
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !9
  %84 = sub nsw i32 0, %83
  store i32 %84, ptr %4, align 4, !tbaa !9
  %85 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) @s1, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %86 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %5, i32 0, i32 0
  store ptr %85, ptr %86, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  %87 = load i32, ptr %1, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = load i64, ptr @sum, align 8, !tbaa !5
  %93 = sub nsw i64 %92, %91
  store i64 %93, ptr @sum, align 8, !tbaa !5
  br label %155

94:                                               ; preds = %74
  %95 = load i32, ptr %1, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !9
  %99 = sub nsw i32 0, %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %100 = call ptr @_ZNKSt8multisetIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @s1) #4
  %101 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %6, i32 0, i32 0
  store ptr %100, ptr %101, align 8
  %102 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %103 = load i32, ptr %102, align 4, !tbaa !9
  %104 = icmp sgt i32 %99, %103
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br i1 %104, label %105, label %139

105:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %106 = call ptr @_ZNKSt8multisetIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @s1) #4
  %107 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %7, i32 0, i32 0
  store ptr %106, ptr %107, align 8
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  %109 = load i32, ptr %108, align 4, !tbaa !9
  %110 = mul nsw i32 %109, 2
  %111 = sext i32 %110 to i64
  %112 = load i64, ptr @sum, align 8, !tbaa !5
  %113 = sub nsw i64 %112, %111
  store i64 %113, ptr @sum, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  %114 = load i32, ptr %1, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !9
  %118 = sext i32 %117 to i64
  %119 = load i64, ptr @sum, align 8, !tbaa !5
  %120 = sub nsw i64 %119, %118
  store i64 %120, ptr @sum, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %121 = call ptr @_ZNKSt8multisetIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @s1) #4
  %122 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %8, i32 0, i32 0
  store ptr %121, ptr %122, align 8
  %123 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  %124 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @s2, ptr noundef nonnull align 4 dereferenceable(4) %123)
  %125 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %9, i32 0, i32 0
  store ptr %124, ptr %125, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %126 = call ptr @_ZNKSt8multisetIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @s1) #4
  %127 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %10, i32 0, i32 0
  store ptr %126, ptr %127, align 8
  %128 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %10, i32 0, i32 0
  %129 = load ptr, ptr %128, align 8
  %130 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIiE(ptr noundef nonnull align 8 dereferenceable(48) @s1, ptr %129)
  %131 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %11, i32 0, i32 0
  store ptr %130, ptr %131, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %132 = load i32, ptr %1, align 4, !tbaa !9
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !9
  %136 = sub nsw i32 0, %135
  store i32 %136, ptr %12, align 4, !tbaa !9
  %137 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) @s1, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %138 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %13, i32 0, i32 0
  store ptr %137, ptr %138, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %154

139:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %140 = load i32, ptr %1, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !9
  %144 = sub nsw i32 0, %143
  store i32 %144, ptr %14, align 4, !tbaa !9
  %145 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) @s2, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %146 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %15, i32 0, i32 0
  store ptr %145, ptr %146, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  %147 = load i32, ptr %1, align 4, !tbaa !9
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = load i64, ptr @sum, align 8, !tbaa !5
  %153 = add nsw i64 %152, %151
  store i64 %153, ptr @sum, align 8, !tbaa !5
  br label %154

154:                                              ; preds = %139, %105
  br label %155

155:                                              ; preds = %154, %79
  br label %156

156:                                              ; preds = %155, %59
  br label %157

157:                                              ; preds = %156, %50
  br label %158

158:                                              ; preds = %157, %42
  %159 = load i32, ptr %1, align 4, !tbaa !9
  %160 = load i32, ptr @len, align 4, !tbaa !9
  %161 = icmp sge i32 %159, %160
  br i1 %161, label %162, label %261

162:                                              ; preds = %158
  %163 = load i32, ptr %1, align 4, !tbaa !9
  %164 = load i32, ptr @len, align 4, !tbaa !9
  %165 = sub nsw i32 %163, %164
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !9
  %169 = icmp sge i32 %168, 0
  br i1 %169, label %170, label %180

170:                                              ; preds = %162
  %171 = load i32, ptr %1, align 4, !tbaa !9
  %172 = load i32, ptr @len, align 4, !tbaa !9
  %173 = sub nsw i32 %171, %172
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !9
  %177 = sext i32 %176 to i64
  %178 = load i64, ptr @sum, align 8, !tbaa !5
  %179 = sub nsw i64 %178, %177
  store i64 %179, ptr @sum, align 8, !tbaa !5
  br label %260

180:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %181 = load i32, ptr %1, align 4, !tbaa !9
  %182 = load i32, ptr @len, align 4, !tbaa !9
  %183 = sub nsw i32 %181, %182
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %184
  %186 = load i32, ptr %185, align 4, !tbaa !9
  %187 = sub nsw i32 0, %186
  store i32 %187, ptr %17, align 4, !tbaa !9
  %188 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE4findERKi(ptr noundef nonnull align 8 dereferenceable(48) @s2, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %189 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %16, i32 0, i32 0
  store ptr %188, ptr %189, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %190 = call ptr @_ZNKSt8multisetIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @s2) #4
  %191 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %18, i32 0, i32 0
  store ptr %190, ptr %191, align 8
  %192 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br i1 %192, label %193, label %216

193:                                              ; preds = %180
  %194 = load i32, ptr %1, align 4, !tbaa !9
  %195 = load i32, ptr @len, align 4, !tbaa !9
  %196 = sub nsw i32 %194, %195
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !9
  %200 = sext i32 %199 to i64
  %201 = load i64, ptr @sum, align 8, !tbaa !5
  %202 = sub nsw i64 %201, %200
  store i64 %202, ptr @sum, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %203 = load i32, ptr %1, align 4, !tbaa !9
  %204 = load i32, ptr @len, align 4, !tbaa !9
  %205 = sub nsw i32 %203, %204
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %206
  %208 = load i32, ptr %207, align 4, !tbaa !9
  %209 = sub nsw i32 0, %208
  store i32 %209, ptr %20, align 4, !tbaa !9
  %210 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE4findERKi(ptr noundef nonnull align 8 dereferenceable(48) @s2, ptr noundef nonnull align 4 dereferenceable(4) %20)
  %211 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %19, i32 0, i32 0
  store ptr %210, ptr %211, align 8
  %212 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %19, i32 0, i32 0
  %213 = load ptr, ptr %212, align 8
  %214 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIiE(ptr noundef nonnull align 8 dereferenceable(48) @s2, ptr %213)
  %215 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %21, i32 0, i32 0
  store ptr %214, ptr %215, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  br label %259

216:                                              ; preds = %180
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  %217 = load i32, ptr %1, align 4, !tbaa !9
  %218 = load i32, ptr @len, align 4, !tbaa !9
  %219 = sub nsw i32 %217, %218
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %220
  %222 = load i32, ptr %221, align 4, !tbaa !9
  %223 = sub nsw i32 0, %222
  store i32 %223, ptr %23, align 4, !tbaa !9
  %224 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE4findERKi(ptr noundef nonnull align 8 dereferenceable(48) @s1, ptr noundef nonnull align 4 dereferenceable(4) %23)
  %225 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %22, i32 0, i32 0
  store ptr %224, ptr %225, align 8
  %226 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %22, i32 0, i32 0
  %227 = load ptr, ptr %226, align 8
  %228 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIiE(ptr noundef nonnull align 8 dereferenceable(48) @s1, ptr %227)
  %229 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %24, i32 0, i32 0
  store ptr %228, ptr %229, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  %230 = load i32, ptr %1, align 4, !tbaa !9
  %231 = load i32, ptr @len, align 4, !tbaa !9
  %232 = sub nsw i32 %230, %231
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %233
  %235 = load i32, ptr %234, align 4, !tbaa !9
  %236 = sext i32 %235 to i64
  %237 = load i64, ptr @sum, align 8, !tbaa !5
  %238 = add nsw i64 %237, %236
  store i64 %238, ptr @sum, align 8, !tbaa !5
  %239 = call noundef i64 @_ZNKSt8multisetIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @s2) #4
  %240 = icmp ugt i64 %239, 0
  br i1 %240, label %241, label %258

241:                                              ; preds = %216
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  call void @_ZNKSt8multisetIiSt4lessIiESaIiEE6rbeginEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %25, ptr noundef nonnull align 8 dereferenceable(48) @s2) #4
  %242 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorIiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %25)
  %243 = load i32, ptr %242, align 4, !tbaa !9
  %244 = mul nsw i32 2, %243
  %245 = sext i32 %244 to i64
  %246 = load i64, ptr @sum, align 8, !tbaa !5
  %247 = add nsw i64 %246, %245
  store i64 %247, ptr @sum, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  call void @_ZNKSt8multisetIiSt4lessIiESaIiEE6rbeginEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %26, ptr noundef nonnull align 8 dereferenceable(48) @s2) #4
  %248 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorIiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %26)
  %249 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @s1, ptr noundef nonnull align 4 dereferenceable(4) %248)
  %250 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %27, i32 0, i32 0
  store ptr %249, ptr %250, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #4
  call void @_ZNKSt8multisetIiSt4lessIiESaIiEE6rbeginEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %29, ptr noundef nonnull align 8 dereferenceable(48) @s2) #4
  %251 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorIiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %29)
  %252 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE4findERKi(ptr noundef nonnull align 8 dereferenceable(48) @s2, ptr noundef nonnull align 4 dereferenceable(4) %251)
  %253 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %28, i32 0, i32 0
  store ptr %252, ptr %253, align 8
  %254 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %28, i32 0, i32 0
  %255 = load ptr, ptr %254, align 8
  %256 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIiE(ptr noundef nonnull align 8 dereferenceable(48) @s2, ptr %255)
  %257 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %30, i32 0, i32 0
  store ptr %256, ptr %257, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  br label %258

258:                                              ; preds = %241, %216
  br label %259

259:                                              ; preds = %258, %193
  br label %260

260:                                              ; preds = %259, %170
  br label %261

261:                                              ; preds = %260, %158
  %262 = load i32, ptr %1, align 4, !tbaa !9
  %263 = load i32, ptr @len, align 4, !tbaa !9
  %264 = sub nsw i32 %263, 1
  %265 = icmp sge i32 %262, %264
  br i1 %265, label %266, label %269

266:                                              ; preds = %261
  %267 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @mx, ptr noundef nonnull align 8 dereferenceable(8) @sum)
  %268 = load i64, ptr %267, align 8, !tbaa !5
  store i64 %268, ptr @mx, align 8, !tbaa !5
  br label %269

269:                                              ; preds = %266, %261
  br label %270

270:                                              ; preds = %269
  %271 = load i32, ptr %1, align 4, !tbaa !9
  %272 = add nsw i32 %271, 1
  store i32 %272, ptr %1, align 4, !tbaa !9
  br label %31, !llvm.loop !11

273:                                              ; preds = %35
  unreachable
}

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

; 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 @_ZNSt8multisetIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

; 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 noundef i64 @_ZNKSt8multisetIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48)) #1 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNKSt8multisetIiSt4lessIiESaIiEE6rbeginEv(ptr dead_on_unwind noalias writable sret(%"class.std::reverse_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(48)) #1 align 2

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; 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::multiset" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<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::_Rb_tree_const_iterator" = type { ptr }
%"class.std::reverse_iterator" = type { %"struct.std::_Rb_tree_const_iterator" }

@n = external dso_local local_unnamed_addr global i32, align 4
@len = external dso_local local_unnamed_addr global i32, align 4
@k = external dso_local local_unnamed_addr global i32, align 4
@a = external dso_local local_unnamed_addr global [100100 x i32], align 16
@sum = external dso_local global i64, align 8
@mx = external dso_local global i64, align 8
@s1 = external dso_local global %"class.std::multiset", align 8
@s2 = external dso_local global %"class.std::multiset", align 8

; Function Attrs: mustprogress noreturn uwtable
define dso_local noundef i64 @_Z7computev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %4 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %5 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::reverse_iterator", align 8
  %14 = alloca %"class.std::reverse_iterator", align 8
  %15 = alloca %"class.std::reverse_iterator", align 8
  store i64 0, ptr @sum, align 8, !tbaa !5
  tail call void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @s1) #6
  tail call void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @s2) #6
  br label %16

16:                                               ; preds = %154, %0
  %indvars.iv = phi i64 [ %indvars.iv.next, %154 ], [ 0, %0 ]
  %17 = load i32, ptr @n, align 4, !tbaa !9
  %18 = sext i32 %17 to i64
  %19 = icmp slt i64 %indvars.iv, %18
  call void @llvm.assume(i1 %19)
  %20 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv
  %21 = load i32, ptr %20, align 4, !tbaa !9
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %23, label %27

23:                                               ; preds = %16
  %24 = zext nneg i32 %21 to i64
  %25 = load i64, ptr @sum, align 8, !tbaa !5
  %26 = add nsw i64 %25, %24
  store i64 %26, ptr @sum, align 8, !tbaa !5
  br label %86

27:                                               ; preds = %16
  %28 = icmp slt i32 %21, 0
  br i1 %28, label %29, label %86

29:                                               ; preds = %27
  %30 = load i32, ptr @k, align 4, !tbaa !9
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %32, label %39

32:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %33 = sub nsw i32 0, %21
  store i32 %33, ptr %1, align 4, !tbaa !9
  %34 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) @s2, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %35 = load i32, ptr %20, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = load i64, ptr @sum, align 8, !tbaa !5
  %38 = add nsw i64 %37, %36
  store i64 %38, ptr @sum, align 8, !tbaa !5
  br label %86

39:                                               ; preds = %29
  %40 = call noundef i64 @_ZNKSt8multisetIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @s1) #6
  %41 = load i32, ptr @k, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = icmp ult i64 %40, %42
  br i1 %43, label %44, label %52

44:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %45 = load i32, ptr %20, align 4, !tbaa !9
  %46 = sub nsw i32 0, %45
  store i32 %46, ptr %2, align 4, !tbaa !9
  %47 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) @s1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %48 = load i32, ptr %20, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = load i64, ptr @sum, align 8, !tbaa !5
  %51 = sub nsw i64 %50, %49
  store i64 %51, ptr @sum, align 8, !tbaa !5
  br label %86

52:                                               ; preds = %39
  %53 = load i32, ptr %20, align 4, !tbaa !9
  %54 = sub nsw i32 0, %53
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %55 = call ptr @_ZNKSt8multisetIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @s1) #6
  store ptr %55, ptr %3, align 8
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %57 = load i32, ptr %56, align 4, !tbaa !9
  %58 = icmp slt i32 %57, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br i1 %58, label %59, label %78

59:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %60 = call ptr @_ZNKSt8multisetIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @s1) #6
  store ptr %60, ptr %4, align 8
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %63 = shl nsw i32 %62, 1
  %64 = sext i32 %63 to i64
  %65 = load i64, ptr @sum, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %66 = load i32, ptr %20, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = add nsw i64 %64, %67
  %69 = sub i64 %65, %68
  store i64 %69, ptr @sum, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %70 = call ptr @_ZNKSt8multisetIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @s1) #6
  store ptr %70, ptr %5, align 8
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  %72 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @s2, ptr noundef nonnull align 4 dereferenceable(4) %71)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %73 = call ptr @_ZNKSt8multisetIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @s1) #6
  %74 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIiE(ptr noundef nonnull align 8 dereferenceable(48) @s1, ptr %73)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %75 = load i32, ptr %20, align 4, !tbaa !9
  %76 = sub nsw i32 0, %75
  store i32 %76, ptr %6, align 4, !tbaa !9
  %77 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) @s1, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  br label %86

78:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  %79 = load i32, ptr %20, align 4, !tbaa !9
  %80 = sub nsw i32 0, %79
  store i32 %80, ptr %7, align 4, !tbaa !9
  %81 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) @s2, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  %82 = load i32, ptr %20, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = load i64, ptr @sum, align 8, !tbaa !5
  %85 = add nsw i64 %84, %83
  store i64 %85, ptr @sum, align 8, !tbaa !5
  br label %86

86:                                               ; preds = %27, %44, %78, %59, %32, %23
  %87 = load i32, ptr @len, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %.not = icmp slt i64 %indvars.iv, %88
  br i1 %.not, label %147, label %89

89:                                               ; preds = %86
  %90 = trunc nuw nsw i64 %indvars.iv to i32
  %91 = sub nsw i32 %90, %87
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !9
  %95 = icmp sgt i32 %94, -1
  br i1 %95, label %96, label %100

96:                                               ; preds = %89
  %97 = zext nneg i32 %94 to i64
  %98 = load i64, ptr @sum, align 8, !tbaa !5
  %99 = sub nsw i64 %98, %97
  store i64 %99, ptr @sum, align 8, !tbaa !5
  br label %147

100:                                              ; preds = %89
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  %101 = sub nsw i32 0, %94
  store i32 %101, ptr %9, align 4, !tbaa !9
  %102 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE4findERKi(ptr noundef nonnull align 8 dereferenceable(48) @s2, ptr noundef nonnull align 4 dereferenceable(4) %9)
  store ptr %102, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %103 = call ptr @_ZNKSt8multisetIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @s2) #6
  store ptr %103, ptr %10, align 8
  %104 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br i1 %104, label %105, label %117

105:                                              ; preds = %100
  %106 = load i32, ptr @len, align 4, !tbaa !9
  %107 = sub nsw i32 %90, %106
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = load i64, ptr @sum, align 8, !tbaa !5
  %113 = sub nsw i64 %112, %111
  store i64 %113, ptr @sum, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  %114 = sub nsw i32 0, %110
  store i32 %114, ptr %11, align 4, !tbaa !9
  %115 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE4findERKi(ptr noundef nonnull align 8 dereferenceable(48) @s2, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %116 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIiE(ptr noundef nonnull align 8 dereferenceable(48) @s2, ptr %115)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  br label %147

117:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  %118 = load i32, ptr @len, align 4, !tbaa !9
  %119 = sub nsw i32 %90, %118
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !9
  %123 = sub nsw i32 0, %122
  store i32 %123, ptr %12, align 4, !tbaa !9
  %124 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE4findERKi(ptr noundef nonnull align 8 dereferenceable(48) @s1, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %125 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIiE(ptr noundef nonnull align 8 dereferenceable(48) @s1, ptr %124)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  %126 = load i32, ptr @len, align 4, !tbaa !9
  %127 = sub nsw i32 %90, %126
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !9
  %131 = sext i32 %130 to i64
  %132 = load i64, ptr @sum, align 8, !tbaa !5
  %133 = add nsw i64 %132, %131
  store i64 %133, ptr @sum, align 8, !tbaa !5
  %134 = call noundef i64 @_ZNKSt8multisetIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @s2) #6
  %.not40 = icmp eq i64 %134, 0
  br i1 %.not40, label %147, label %135

135:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  call void @_ZNKSt8multisetIiSt4lessIiESaIiEE6rbeginEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %13, ptr noundef nonnull align 8 dereferenceable(48) @s2) #6
  %136 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorIiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13)
  %137 = load i32, ptr %136, align 4, !tbaa !9
  %138 = shl nsw i32 %137, 1
  %139 = sext i32 %138 to i64
  %140 = load i64, ptr @sum, align 8, !tbaa !5
  %141 = add nsw i64 %140, %139
  store i64 %141, ptr @sum, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #6
  call void @_ZNKSt8multisetIiSt4lessIiESaIiEE6rbeginEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %14, ptr noundef nonnull align 8 dereferenceable(48) @s2) #6
  %142 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorIiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14)
  %143 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @s1, ptr noundef nonnull align 4 dereferenceable(4) %142)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #6
  call void @_ZNKSt8multisetIiSt4lessIiESaIiEE6rbeginEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %15, ptr noundef nonnull align 8 dereferenceable(48) @s2) #6
  %144 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorIiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
  %145 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE4findERKi(ptr noundef nonnull align 8 dereferenceable(48) @s2, ptr noundef nonnull align 4 dereferenceable(4) %144)
  %146 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIiE(ptr noundef nonnull align 8 dereferenceable(48) @s2, ptr %145)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  br label %147

147:                                              ; preds = %96, %117, %135, %105, %86
  %148 = load i32, ptr @len, align 4, !tbaa !9
  %149 = add nsw i32 %148, -1
  %150 = sext i32 %149 to i64
  %.not41 = icmp slt i64 %indvars.iv, %150
  br i1 %.not41, label %154, label %151

151:                                              ; preds = %147
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @mx, ptr noundef nonnull align 8 dereferenceable(8) @sum)
  %153 = load i64, ptr %152, align 8, !tbaa !5
  store i64 %153, ptr @mx, align 8, !tbaa !5
  br label %154

154:                                              ; preds = %147, %151
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br label %16, !llvm.loop !11
}

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

; 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 @_ZNSt8multisetIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

; 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 noundef i64 @_ZNKSt8multisetIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNKSt8multisetIiSt4lessIiESaIiEE6rbeginEv(ptr dead_on_unwind noalias writable sret(%"class.std::reverse_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #5

attributes #0 = { mustprogress noreturn uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #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 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass