; LLVM IR from tangjz/acm-icpc :: TDL_training/2016-03-13 (I - Manhattan Project - tjz)

; 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
@dis = external dso_local global [16 x %"class.std::multiset"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca [4 x i32], align 16
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca %"class.std::reverse_iterator", align 8
  store i32 0, ptr %1, align 4
  br label %22

22:                                               ; preds = %210, %0
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  %24 = icmp eq i32 %23, 1
  br i1 %24, label %25, label %211

25:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %34, %25
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = icmp slt i32 %27, 16
  br i1 %28, label %30, label %29

29:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %37

30:                                               ; preds = %26
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [16 x %"class.std::multiset"], ptr @dis, i64 0, i64 %32
  call void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %33) #6
  br label %34

34:                                               ; preds = %30
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %2, align 4, !tbaa !5
  br label %26, !llvm.loop !9

37:                                               ; preds = %29
  br label %38

38:                                               ; preds = %209, %37
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = add nsw i32 %39, -1
  store i32 %40, ptr @n, align 4, !tbaa !5
  %41 = icmp ne i32 %39, 0
  br i1 %41, label %42, label %210

42:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #6
  %43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %54, %42
  %45 = load i32, ptr %5, align 4, !tbaa !5
  %46 = icmp slt i32 %45, 4
  br i1 %46, label %48, label %47

47:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %57

48:                                               ; preds = %44
  %49 = getelementptr inbounds [4 x i32], ptr %4, i64 0, i64 0
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds i32, ptr %49, i64 %51
  %53 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %52)
  br label %54

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

57:                                               ; preds = %47
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = icmp eq i32 %58, 1
  br i1 %59, label %60, label %104

60:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %100, %60
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = icmp slt i32 %62, 16
  br i1 %63, label %65, label %64

64:                                               ; preds = %61
  store i32 12, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %103

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

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

69:                                               ; preds = %66
  store i32 15, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %94

70:                                               ; preds = %66
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = load i32, ptr %9, align 4, !tbaa !5
  %73 = shl i32 1, %72
  %74 = and i32 %71, %73
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %76, label %82

76:                                               ; preds = %70
  %77 = load i32, ptr %9, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [4 x i32], ptr %4, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = sub nsw i32 0, %80
  br label %87

82:                                               ; preds = %70
  %83 = load i32, ptr %9, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [4 x i32], ptr %4, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %82, %76
  %88 = phi i32 [ %81, %76 ], [ %86, %82 ]
  %89 = load i32, ptr %8, align 4, !tbaa !5
  %90 = add nsw i32 %89, %88
  store i32 %90, ptr %8, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %87
  %92 = load i32, ptr %9, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %9, align 4, !tbaa !5
  br label %66, !llvm.loop !12

94:                                               ; preds = %69
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [16 x %"class.std::multiset"], ptr @dis, i64 0, i64 %96
  %98 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %97, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %99 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %10, i32 0, i32 0
  store ptr %98, ptr %99, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %100

100:                                              ; preds = %94
  %101 = load i32, ptr %6, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %6, align 4, !tbaa !5
  br label %61, !llvm.loop !13

103:                                              ; preds = %64
  br label %209

104:                                              ; preds = %57
  %105 = load i32, ptr %3, align 4, !tbaa !5
  %106 = icmp eq i32 %105, 2
  br i1 %106, label %107, label %158

107:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %154, %107
  %109 = load i32, ptr %11, align 4, !tbaa !5
  %110 = icmp slt i32 %109, 16
  br i1 %110, label %112, label %111

111:                                              ; preds = %108
  store i32 18, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %157

112:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %138, %112
  %114 = load i32, ptr %13, align 4, !tbaa !5
  %115 = icmp slt i32 %114, 4
  br i1 %115, label %117, label %116

116:                                              ; preds = %113
  store i32 21, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %141

117:                                              ; preds = %113
  %118 = load i32, ptr %11, align 4, !tbaa !5
  %119 = load i32, ptr %13, align 4, !tbaa !5
  %120 = shl i32 1, %119
  %121 = and i32 %118, %120
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %123, label %129

123:                                              ; preds = %117
  %124 = load i32, ptr %13, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [4 x i32], ptr %4, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = sub nsw i32 0, %127
  br label %134

129:                                              ; preds = %117
  %130 = load i32, ptr %13, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [4 x i32], ptr %4, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %129, %123
  %135 = phi i32 [ %128, %123 ], [ %133, %129 ]
  %136 = load i32, ptr %12, align 4, !tbaa !5
  %137 = add nsw i32 %136, %135
  store i32 %137, ptr %12, align 4, !tbaa !5
  br label %138

138:                                              ; preds = %134
  %139 = load i32, ptr %13, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %13, align 4, !tbaa !5
  br label %113, !llvm.loop !14

141:                                              ; preds = %116
  %142 = load i32, ptr %11, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [16 x %"class.std::multiset"], ptr @dis, i64 0, i64 %143
  %145 = load i32, ptr %11, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [16 x %"class.std::multiset"], ptr @dis, i64 0, i64 %146
  %148 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE4findERKi(ptr noundef nonnull align 8 dereferenceable(48) %147, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %149 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %14, i32 0, i32 0
  store ptr %148, ptr %149, align 8
  %150 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %14, i32 0, i32 0
  %151 = load ptr, ptr %150, align 8
  %152 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIiE(ptr noundef nonnull align 8 dereferenceable(48) %144, ptr %151)
  %153 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %15, i32 0, i32 0
  store ptr %152, ptr %153, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %154

154:                                              ; preds = %141
  %155 = load i32, ptr %11, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %11, align 4, !tbaa !5
  br label %108, !llvm.loop !15

157:                                              ; preds = %111
  br label %208

158:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 -1061109567, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %159

159:                                              ; preds = %202, %158
  %160 = load i32, ptr %17, align 4, !tbaa !5
  %161 = icmp slt i32 %160, 16
  br i1 %161, label %163, label %162

162:                                              ; preds = %159
  store i32 24, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %205

163:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %164

164:                                              ; preds = %189, %163
  %165 = load i32, ptr %19, align 4, !tbaa !5
  %166 = icmp slt i32 %165, 4
  br i1 %166, label %168, label %167

167:                                              ; preds = %164
  store i32 27, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %192

168:                                              ; preds = %164
  %169 = load i32, ptr %17, align 4, !tbaa !5
  %170 = load i32, ptr %19, align 4, !tbaa !5
  %171 = shl i32 1, %170
  %172 = and i32 %169, %171
  %173 = icmp ne i32 %172, 0
  br i1 %173, label %174, label %180

174:                                              ; preds = %168
  %175 = load i32, ptr %19, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [4 x i32], ptr %4, i64 0, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = sub nsw i32 0, %178
  br label %185

180:                                              ; preds = %168
  %181 = load i32, ptr %19, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [4 x i32], ptr %4, i64 0, i64 %182
  %184 = load i32, ptr %183, align 4, !tbaa !5
  br label %185

185:                                              ; preds = %180, %174
  %186 = phi i32 [ %179, %174 ], [ %184, %180 ]
  %187 = load i32, ptr %18, align 4, !tbaa !5
  %188 = add nsw i32 %187, %186
  store i32 %188, ptr %18, align 4, !tbaa !5
  br label %189

189:                                              ; preds = %185
  %190 = load i32, ptr %19, align 4, !tbaa !5
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %19, align 4, !tbaa !5
  br label %164, !llvm.loop !16

192:                                              ; preds = %167
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %193 = load i32, ptr %17, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [16 x %"class.std::multiset"], ptr @dis, i64 0, i64 %194
  call void @_ZNKSt8multisetIiSt4lessIiESaIiEE6rbeginEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %21, ptr noundef nonnull align 8 dereferenceable(48) %195) #6
  %196 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorIiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %21)
  %197 = load i32, ptr %196, align 4, !tbaa !5
  %198 = load i32, ptr %18, align 4, !tbaa !5
  %199 = sub nsw i32 %197, %198
  store i32 %199, ptr %20, align 4, !tbaa !5
  %200 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %20)
  %201 = load i32, ptr %200, align 4, !tbaa !5
  store i32 %201, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %202

202:                                              ; preds = %192
  %203 = load i32, ptr %17, align 4, !tbaa !5
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %17, align 4, !tbaa !5
  br label %159, !llvm.loop !17

205:                                              ; preds = %162
  %206 = load i32, ptr %16, align 4, !tbaa !5
  %207 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %206)
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %208

208:                                              ; preds = %205, %157
  br label %209

209:                                              ; preds = %208, %103
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %38, !llvm.loop !18

210:                                              ; preds = %38
  br label %22, !llvm.loop !19

211:                                              ; preds = %22
  ret i32 0
}

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 nounwind uwtable
declare dso_local void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48)) #3 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 uwtable
declare dso_local ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #4 align 2

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

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

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

; 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)) #3 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)) #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 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


; 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 }
%"class.std::reverse_iterator" = type { %"struct.std::_Rb_tree_const_iterator" }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@dis = external dso_local global [16 x %"class.std::multiset"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 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 [4 x i32], align 16
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::reverse_iterator", align 8
  %8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %9 = icmp eq i32 %8, 1
  br i1 %9, label %.preheader55.preheader, label %._crit_edge

.preheader55.preheader:                           ; preds = %0
  %10 = getelementptr inbounds i8, ptr %2, i64 4
  %11 = getelementptr inbounds i8, ptr %2, i64 8
  %12 = getelementptr inbounds i8, ptr %2, i64 12
  br label %.preheader55

.loopexit54:                                      ; preds = %.loopexit, %.preheader55
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %14 = icmp eq i32 %13, 1
  br i1 %14, label %.preheader55, label %._crit_edge, !llvm.loop !5

.preheader55:                                     ; preds = %.preheader55.preheader, %.loopexit54
  call void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @dis) #7
  call void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 48)) #7
  call void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 96)) #7
  call void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 144)) #7
  call void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 192)) #7
  call void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 240)) #7
  call void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 288)) #7
  call void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 336)) #7
  call void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 384)) #7
  call void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 432)) #7
  call void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 480)) #7
  call void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 528)) #7
  call void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 576)) #7
  call void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 624)) #7
  call void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 672)) #7
  call void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 720)) #7
  %15 = load i32, ptr @n, align 4, !tbaa !7
  %16 = add nsw i32 %15, -1
  store i32 %16, ptr @n, align 4, !tbaa !7
  %.not67 = icmp eq i32 %15, 0
  br i1 %.not67, label %.loopexit54, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader55, %.loopexit
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #7
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %10)
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %11)
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %12)
  %22 = load i32, ptr %1, align 4, !tbaa !7
  switch i32 %22, label %112 [
    i32 1, label %.preheader50
    i32 2, label %.preheader51
  ]

.preheader50:                                     ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %23 = load <4 x i32>, ptr %2, align 16
  %24 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %23)
  store i32 %24, ptr %3, align 4, !tbaa !7
  %25 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @dis, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %26 = load <4 x i32>, ptr %2, align 16
  %27 = sub nsw <4 x i32> <i32 0, i32 poison, i32 poison, i32 poison>, %26
  %28 = shufflevector <4 x i32> %27, <4 x i32> %26, <4 x i32> <i32 0, i32 5, i32 6, i32 7>
  %29 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %28)
  store i32 %29, ptr %3, align 4, !tbaa !7
  %30 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 48), ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %31 = load <4 x i32>, ptr %2, align 16
  %32 = sub nsw <4 x i32> <i32 poison, i32 0, i32 poison, i32 poison>, %31
  %33 = shufflevector <4 x i32> %31, <4 x i32> %32, <4 x i32> <i32 0, i32 5, i32 2, i32 3>
  %34 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %33)
  store i32 %34, ptr %3, align 4, !tbaa !7
  %35 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 96), ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %36 = load <4 x i32>, ptr %2, align 16
  %37 = sub nsw <4 x i32> <i32 0, i32 0, i32 poison, i32 poison>, %36
  %38 = shufflevector <4 x i32> %37, <4 x i32> %36, <4 x i32> <i32 0, i32 1, i32 6, i32 7>
  %39 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %38)
  store i32 %39, ptr %3, align 4, !tbaa !7
  %40 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 144), ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %41 = load <4 x i32>, ptr %2, align 16
  %42 = sub nsw <4 x i32> <i32 poison, i32 poison, i32 0, i32 poison>, %41
  %43 = shufflevector <4 x i32> %41, <4 x i32> %42, <4 x i32> <i32 0, i32 1, i32 6, i32 3>
  %44 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %43)
  store i32 %44, ptr %3, align 4, !tbaa !7
  %45 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 192), ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %46 = load <4 x i32>, ptr %2, align 16
  %47 = sub nsw <4 x i32> <i32 0, i32 poison, i32 0, i32 poison>, %46
  %48 = shufflevector <4 x i32> %47, <4 x i32> %46, <4 x i32> <i32 0, i32 5, i32 2, i32 7>
  %49 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %48)
  store i32 %49, ptr %3, align 4, !tbaa !7
  %50 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 240), ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %51 = load <4 x i32>, ptr %2, align 16
  %52 = sub nsw <4 x i32> <i32 poison, i32 0, i32 0, i32 poison>, %51
  %53 = shufflevector <4 x i32> %51, <4 x i32> %52, <4 x i32> <i32 0, i32 5, i32 6, i32 3>
  %54 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %53)
  store i32 %54, ptr %3, align 4, !tbaa !7
  %55 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 288), ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %56 = load <4 x i32>, ptr %2, align 16
  %57 = sub nsw <4 x i32> <i32 0, i32 0, i32 0, i32 poison>, %56
  %58 = shufflevector <4 x i32> %57, <4 x i32> %56, <4 x i32> <i32 0, i32 1, i32 2, i32 7>
  %59 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %58)
  store i32 %59, ptr %3, align 4, !tbaa !7
  %60 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 336), ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %61 = load <4 x i32>, ptr %2, align 16
  %62 = sub nsw <4 x i32> <i32 poison, i32 poison, i32 poison, i32 0>, %61
  %63 = shufflevector <4 x i32> %61, <4 x i32> %62, <4 x i32> <i32 0, i32 1, i32 2, i32 7>
  %64 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %63)
  store i32 %64, ptr %3, align 4, !tbaa !7
  %65 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 384), ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %66 = load <4 x i32>, ptr %2, align 16
  %67 = sub nsw <4 x i32> <i32 0, i32 poison, i32 poison, i32 0>, %66
  %68 = shufflevector <4 x i32> %67, <4 x i32> %66, <4 x i32> <i32 0, i32 5, i32 6, i32 3>
  %69 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %68)
  store i32 %69, ptr %3, align 4, !tbaa !7
  %70 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 432), ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %71 = load <4 x i32>, ptr %2, align 16
  %72 = sub nsw <4 x i32> <i32 poison, i32 0, i32 poison, i32 0>, %71
  %73 = shufflevector <4 x i32> %71, <4 x i32> %72, <4 x i32> <i32 0, i32 5, i32 2, i32 7>
  %74 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %73)
  store i32 %74, ptr %3, align 4, !tbaa !7
  %75 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 480), ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %76 = load <4 x i32>, ptr %2, align 16
  %77 = sub nsw <4 x i32> <i32 0, i32 0, i32 poison, i32 0>, %76
  %78 = shufflevector <4 x i32> %77, <4 x i32> %76, <4 x i32> <i32 0, i32 1, i32 6, i32 3>
  %79 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %78)
  store i32 %79, ptr %3, align 4, !tbaa !7
  %80 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 528), ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %81 = load <4 x i32>, ptr %2, align 16
  %82 = sub nsw <4 x i32> <i32 poison, i32 poison, i32 0, i32 0>, %81
  %83 = shufflevector <4 x i32> %81, <4 x i32> %82, <4 x i32> <i32 0, i32 1, i32 6, i32 7>
  %84 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %83)
  store i32 %84, ptr %3, align 4, !tbaa !7
  %85 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 576), ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %86 = load <4 x i32>, ptr %2, align 16
  %87 = sub nsw <4 x i32> <i32 0, i32 poison, i32 0, i32 0>, %86
  %88 = shufflevector <4 x i32> %87, <4 x i32> %86, <4 x i32> <i32 0, i32 5, i32 2, i32 3>
  %89 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %88)
  store i32 %89, ptr %3, align 4, !tbaa !7
  %90 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 624), ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %91 = load <4 x i32>, ptr %2, align 16
  %92 = sub nsw <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, %91
  %93 = shufflevector <4 x i32> %91, <4 x i32> %92, <4 x i32> <i32 0, i32 5, i32 6, i32 7>
  %94 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %93)
  store i32 %94, ptr %3, align 4, !tbaa !7
  %95 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 672), ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %96 = load <4 x i32>, ptr %2, align 16
  %97 = sub nsw <4 x i32> zeroinitializer, %96
  %98 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %97)
  store i32 %98, ptr %3, align 4, !tbaa !7
  %99 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @dis, i64 720), ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br label %.loopexit

.preheader51:                                     ; preds = %.lr.ph, %.preheader51
  %indvars.iv = phi i64 [ %indvars.iv.next, %.preheader51 ], [ 0, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %100 = trunc nuw nsw i64 %indvars.iv to i32
  %101 = insertelement <4 x i32> poison, i32 %100, i64 0
  %102 = shufflevector <4 x i32> %101, <4 x i32> poison, <4 x i32> zeroinitializer
  %103 = and <4 x i32> %102, <i32 1, i32 2, i32 4, i32 8>
  %104 = icmp eq <4 x i32> %103, zeroinitializer
  %105 = load <4 x i32>, ptr %2, align 16
  %106 = sub nsw <4 x i32> zeroinitializer, %105
  %107 = select <4 x i1> %104, <4 x i32> %105, <4 x i32> %106
  %108 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %107)
  store i32 %108, ptr %4, align 4, !tbaa !7
  %109 = getelementptr inbounds [16 x %"class.std::multiset"], ptr @dis, i64 0, i64 %indvars.iv
  %110 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE4findERKi(ptr noundef nonnull align 8 dereferenceable(48) %109, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %111 = call ptr @_ZNSt8multisetIiSt4lessIiESaIiEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIiE(ptr noundef nonnull align 8 dereferenceable(48) %109, ptr %110)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 16
  br i1 %exitcond.not, label %.loopexit, label %.preheader51, !llvm.loop !11

112:                                              ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store i32 -1061109567, ptr %5, align 4, !tbaa !7
  br label %.preheader

.preheader:                                       ; preds = %112, %.preheader
  %indvars.iv87 = phi i64 [ 0, %112 ], [ %indvars.iv.next88, %.preheader ]
  %113 = trunc nuw nsw i64 %indvars.iv87 to i32
  %114 = insertelement <4 x i32> poison, i32 %113, i64 0
  %115 = shufflevector <4 x i32> %114, <4 x i32> poison, <4 x i32> zeroinitializer
  %116 = and <4 x i32> %115, <i32 1, i32 2, i32 4, i32 8>
  %117 = icmp eq <4 x i32> %116, zeroinitializer
  %118 = load <4 x i32>, ptr %2, align 16
  %119 = sub nsw <4 x i32> zeroinitializer, %118
  %120 = select <4 x i1> %117, <4 x i32> %119, <4 x i32> %118
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %121 = getelementptr inbounds [16 x %"class.std::multiset"], ptr @dis, i64 0, i64 %indvars.iv87
  call void @_ZNKSt8multisetIiSt4lessIiESaIiEE6rbeginEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %7, ptr noundef nonnull align 8 dereferenceable(48) %121) #7
  %122 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorIiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %123 = load i32, ptr %122, align 4, !tbaa !7
  %124 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %120)
  %op.rdx = add i32 %124, %123
  store i32 %op.rdx, ptr %6, align 4, !tbaa !7
  %125 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %126 = load i32, ptr %125, align 4, !tbaa !7
  store i32 %126, ptr %5, align 4, !tbaa !7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %exitcond90.not = icmp eq i64 %indvars.iv.next88, 16
  br i1 %exitcond90.not, label %127, label %.preheader, !llvm.loop !12

127:                                              ; preds = %.preheader
  %128 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %126)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader51, %.preheader50, %127
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %129 = load i32, ptr @n, align 4, !tbaa !7
  %130 = add nsw i32 %129, -1
  store i32 %130, ptr @n, align 4, !tbaa !7
  %.not = icmp eq i32 %129, 0
  br i1 %.not, label %.loopexit54, label %.lr.ph, !llvm.loop !13

._crit_edge:                                      ; preds = %.loopexit54, %0
  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 nounwind uwtable
declare dso_local void @_ZNSt8multisetIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48)) 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 uwtable
declare dso_local ptr @_ZNSt8multisetIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4 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 #4 align 2

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

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

; 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 #3 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 #3 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6

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


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