; LLVM IR from tangjz/acm-icpc :: hdu (6326)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Info = type { i8, i64, i64 }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<Node, Node, std::_Identity<Node>, std::less<Node>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<Node, Node, std::_Identity<Node>, std::less<Node>>::_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.Node = type { i32 }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@fa = external dso_local global [100001 x i32], align 16
@dsu = external dso_local global [100001 x i32], align 16
@e = external dso_local global [100001 x %"class.std::vector"], align 16
@a = external dso_local global [100001 x %struct.Info], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsi(i32 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: 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 noundef i32 @_Z8dsu_findi(i32 noundef) #1

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

27:                                               ; preds = %252, %0
  %28 = load i32, ptr @t, align 4, !tbaa !5
  %29 = add nsw i32 %28, -1
  store i32 %29, ptr @t, align 4, !tbaa !5
  %30 = icmp ne i32 %28, 0
  br i1 %30, label %31, label %254

31:                                               ; preds = %27
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 48, ptr %2) #7
  call void @_ZNSt3setI4NodeSt4lessIS0_ESaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #7
  call void @llvm.memset.p0.i64(ptr align 8 %3, i8 0, i64 24, i1 false)
  %33 = getelementptr inbounds %struct.Info, ptr %3, i32 0, i32 0
  %34 = getelementptr inbounds %struct.Info, ptr %3, i32 0, i32 1
  %35 = getelementptr inbounds %struct.Info, ptr %3, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 getelementptr inbounds ([100001 x %struct.Info], ptr @a, i64 0, i64 1), ptr align 8 %3, i64 24, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 2, ptr %4, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %66, %31
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = load i32, ptr @n, align 4, !tbaa !5
  %39 = icmp sle i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %78

41:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %42 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %5, ptr noundef %6)
          to label %43 unwind label %69

43:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #7
  %44 = getelementptr inbounds %struct.Info, ptr %9, i32 0, i32 0
  %45 = load i32, ptr %5, align 4, !tbaa !5
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = icmp slt i32 %45, %46
  %48 = zext i1 %47 to i8
  store i8 %48, ptr %44, align 8, !tbaa !14
  %49 = getelementptr inbounds %struct.Info, ptr %9, i32 0, i32 1
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  store i64 %51, ptr %49, align 8, !tbaa !16
  %52 = getelementptr inbounds %struct.Info, ptr %9, i32 0, i32 2
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  store i64 %54, ptr %52, align 8, !tbaa !17
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100001 x %struct.Info], ptr @a, i64 0, i64 %56
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %57, ptr align 8 %9, i64 24, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %58 = getelementptr inbounds %struct.Node, ptr %10, i32 0, i32 0
  %59 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %59, ptr %58, align 4, !tbaa !18
  %60 = invoke { ptr, i8 } @_ZNSt3setI4NodeSt4lessIS0_ESaIS0_EE6insertEOS0_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %61 unwind label %73

61:                                               ; preds = %43
  %62 = getelementptr inbounds { ptr, i8 }, ptr %11, i32 0, i32 0
  %63 = extractvalue { ptr, i8 } %60, 0
  store ptr %63, ptr %62, align 8
  %64 = getelementptr inbounds { ptr, i8 }, ptr %11, i32 0, i32 1
  %65 = extractvalue { ptr, i8 } %60, 1
  store i8 %65, ptr %64, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %66

66:                                               ; preds = %61
  %67 = load i32, ptr %4, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %4, align 4, !tbaa !5
  br label %36, !llvm.loop !20

69:                                               ; preds = %41
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %7, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %8, align 4
  br label %77

73:                                               ; preds = %43
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %7, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %77

77:                                               ; preds = %73, %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %253

78:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %95, %78
  %80 = load i32, ptr %12, align 4, !tbaa !5
  %81 = load i32, ptr @n, align 4, !tbaa !5
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %84, label %83

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

84:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %85 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %13, ptr noundef %14)
          to label %86 unwind label %98

86:                                               ; preds = %84
  %87 = load i32, ptr %13, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %88
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %89, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %90 unwind label %98

90:                                               ; preds = %86
  %91 = load i32, ptr %14, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %92
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %93, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %94 unwind label %98

94:                                               ; preds = %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %95

95:                                               ; preds = %94
  %96 = load i32, ptr %12, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %12, align 4, !tbaa !5
  br label %79, !llvm.loop !22

98:                                               ; preds = %90, %86, %84
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %7, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %253

102:                                              ; preds = %83
  store i32 0, ptr getelementptr inbounds ([100001 x i32], ptr @fa, i64 0, i64 1), align 4, !tbaa !5
  invoke void @_Z3dfsi(i32 noundef 1)
          to label %103 unwind label %112

103:                                              ; preds = %102
  %104 = load i32, ptr @n, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = mul i64 %105, 4
  call void @llvm.memset.p0.i64(ptr align 4 getelementptr inbounds (i32, ptr @dsu, i64 1), i8 -1, i64 %106, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 1, ptr %15, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %231, %103
  %108 = load i32, ptr %15, align 4, !tbaa !5
  %109 = load i32, ptr @n, align 4, !tbaa !5
  %110 = icmp slt i32 %108, %109
  br i1 %110, label %116, label %111

111:                                              ; preds = %107
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %236

112:                                              ; preds = %236, %102
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %7, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %8, align 4
  br label %253

116:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %117 = call ptr @_ZNKSt3setI4NodeSt4lessIS0_ESaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  %118 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %17, i32 0, i32 0
  store ptr %117, ptr %118, align 8
  %119 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorI4NodeEptEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  %120 = getelementptr inbounds %struct.Node, ptr %119, i32 0, i32 0
  %121 = load i32, ptr %120, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  store i32 %121, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %122 = getelementptr inbounds %struct.Node, ptr %18, i32 0, i32 0
  %123 = load i32, ptr %16, align 4, !tbaa !5
  store i32 %123, ptr %122, align 4, !tbaa !18
  %124 = invoke noundef i64 @_ZNSt3setI4NodeSt4lessIS0_ESaIS0_EE5eraseERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %125 unwind label %139

125:                                              ; preds = %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %126 = load i32, ptr %16, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [100001 x i32], ptr @fa, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = invoke noundef i32 @_Z8dsu_findi(i32 noundef %129)
          to label %131 unwind label %143

131:                                              ; preds = %125
  store i32 %130, ptr %19, align 4, !tbaa !5
  %132 = load i32, ptr %19, align 4, !tbaa !5
  %133 = icmp sgt i32 %132, 1
  br i1 %133, label %134, label %151

134:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %135 = getelementptr inbounds %struct.Node, ptr %20, i32 0, i32 0
  %136 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %136, ptr %135, align 4, !tbaa !18
  %137 = invoke noundef i64 @_ZNSt3setI4NodeSt4lessIS0_ESaIS0_EE5eraseERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 4 dereferenceable(4) %20)
          to label %138 unwind label %147

138:                                              ; preds = %134
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %151

139:                                              ; preds = %116
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %7, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %235

143:                                              ; preds = %125
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %7, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %8, align 4
  br label %234

147:                                              ; preds = %134
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %7, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %234

151:                                              ; preds = %138, %131
  %152 = load i32, ptr %19, align 4, !tbaa !5
  %153 = load i32, ptr %16, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [100001 x i32], ptr @dsu, i64 0, i64 %154
  store i32 %152, ptr %155, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %156 = load i32, ptr %19, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [100001 x %struct.Info], ptr @a, i64 0, i64 %157
  %159 = getelementptr inbounds %struct.Info, ptr %158, i32 0, i32 2
  %160 = load i64, ptr %159, align 8, !tbaa !17
  %161 = load i32, ptr %16, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [100001 x %struct.Info], ptr @a, i64 0, i64 %162
  %164 = getelementptr inbounds %struct.Info, ptr %163, i32 0, i32 1
  %165 = load i64, ptr %164, align 8, !tbaa !16
  %166 = sub nsw i64 %160, %165
  store i64 %166, ptr %21, align 8, !tbaa !12
  %167 = load i64, ptr %21, align 8, !tbaa !12
  %168 = icmp slt i64 %167, 0
  br i1 %168, label %169, label %186

169:                                              ; preds = %151
  %170 = load i64, ptr %21, align 8, !tbaa !12
  %171 = load i32, ptr %19, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [100001 x %struct.Info], ptr @a, i64 0, i64 %172
  %174 = getelementptr inbounds %struct.Info, ptr %173, i32 0, i32 1
  %175 = load i64, ptr %174, align 8, !tbaa !16
  %176 = sub nsw i64 %175, %170
  store i64 %176, ptr %174, align 8, !tbaa !16
  %177 = load i32, ptr %16, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [100001 x %struct.Info], ptr @a, i64 0, i64 %178
  %180 = getelementptr inbounds %struct.Info, ptr %179, i32 0, i32 2
  %181 = load i64, ptr %180, align 8, !tbaa !17
  %182 = load i32, ptr %19, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [100001 x %struct.Info], ptr @a, i64 0, i64 %183
  %185 = getelementptr inbounds %struct.Info, ptr %184, i32 0, i32 2
  store i64 %181, ptr %185, align 8, !tbaa !17
  br label %198

186:                                              ; preds = %151
  %187 = load i64, ptr %21, align 8, !tbaa !12
  %188 = load i32, ptr %16, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [100001 x %struct.Info], ptr @a, i64 0, i64 %189
  %191 = getelementptr inbounds %struct.Info, ptr %190, i32 0, i32 2
  %192 = load i64, ptr %191, align 8, !tbaa !17
  %193 = add nsw i64 %187, %192
  %194 = load i32, ptr %19, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [100001 x %struct.Info], ptr @a, i64 0, i64 %195
  %197 = getelementptr inbounds %struct.Info, ptr %196, i32 0, i32 2
  store i64 %193, ptr %197, align 8, !tbaa !17
  br label %198

198:                                              ; preds = %186, %169
  %199 = load i32, ptr %19, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [100001 x %struct.Info], ptr @a, i64 0, i64 %200
  %202 = getelementptr inbounds %struct.Info, ptr %201, i32 0, i32 1
  %203 = load i64, ptr %202, align 8, !tbaa !16
  %204 = load i32, ptr %19, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [100001 x %struct.Info], ptr @a, i64 0, i64 %205
  %207 = getelementptr inbounds %struct.Info, ptr %206, i32 0, i32 2
  %208 = load i64, ptr %207, align 8, !tbaa !17
  %209 = icmp slt i64 %203, %208
  %210 = load i32, ptr %19, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [100001 x %struct.Info], ptr @a, i64 0, i64 %211
  %213 = getelementptr inbounds %struct.Info, ptr %212, i32 0, i32 0
  %214 = zext i1 %209 to i8
  store i8 %214, ptr %213, align 8, !tbaa !14
  %215 = load i32, ptr %19, align 4, !tbaa !5
  %216 = icmp sgt i32 %215, 1
  br i1 %216, label %217, label %230

217:                                              ; preds = %198
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %218 = getelementptr inbounds %struct.Node, ptr %22, i32 0, i32 0
  %219 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %219, ptr %218, align 4, !tbaa !18
  %220 = invoke { ptr, i8 } @_ZNSt3setI4NodeSt4lessIS0_ESaIS0_EE6insertEOS0_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %221 unwind label %226

221:                                              ; preds = %217
  %222 = getelementptr inbounds { ptr, i8 }, ptr %23, i32 0, i32 0
  %223 = extractvalue { ptr, i8 } %220, 0
  store ptr %223, ptr %222, align 8
  %224 = getelementptr inbounds { ptr, i8 }, ptr %23, i32 0, i32 1
  %225 = extractvalue { ptr, i8 } %220, 1
  store i8 %225, ptr %224, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %230

226:                                              ; preds = %217
  %227 = landingpad { ptr, i32 }
          cleanup
  %228 = extractvalue { ptr, i32 } %227, 0
  store ptr %228, ptr %7, align 8
  %229 = extractvalue { ptr, i32 } %227, 1
  store i32 %229, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %234

230:                                              ; preds = %221, %198
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %231

231:                                              ; preds = %230
  %232 = load i32, ptr %15, align 4, !tbaa !5
  %233 = add nsw i32 %232, 1
  store i32 %233, ptr %15, align 4, !tbaa !5
  br label %107, !llvm.loop !23

234:                                              ; preds = %226, %147, %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %235

235:                                              ; preds = %234, %139
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %253

236:                                              ; preds = %111
  %237 = load i64, ptr getelementptr inbounds (%struct.Info, ptr getelementptr inbounds ([100001 x %struct.Info], ptr @a, i64 0, i64 1), i32 0, i32 1), align 8, !tbaa !16
  %238 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %237)
          to label %239 unwind label %112

239:                                              ; preds = %236
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 1, ptr %24, align 4, !tbaa !5
  br label %240

240:                                              ; preds = %249, %239
  %241 = load i32, ptr %24, align 4, !tbaa !5
  %242 = load i32, ptr @n, align 4, !tbaa !5
  %243 = icmp sle i32 %241, %242
  br i1 %243, label %245, label %244

244:                                              ; preds = %240
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %252

245:                                              ; preds = %240
  call void @llvm.lifetime.start.p0(i64 24, ptr %25) #7
  call void @llvm.memset.p0.i64(ptr align 8 %25, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #7
  %246 = load i32, ptr %24, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %247
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 8 dereferenceable(24) %248) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #7
  br label %249

249:                                              ; preds = %245
  %250 = load i32, ptr %24, align 4, !tbaa !5
  %251 = add nsw i32 %250, 1
  store i32 %251, ptr %24, align 4, !tbaa !5
  br label %240, !llvm.loop !24

252:                                              ; preds = %244
  call void @_ZNSt3setI4NodeSt4lessIS0_ESaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %2) #7
  br label %27, !llvm.loop !25

253:                                              ; preds = %235, %112, %98, %77
  call void @_ZNSt3setI4NodeSt4lessIS0_ESaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %2) #7
  br label %255

254:                                              ; preds = %27
  ret i32 0

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

declare i32 @__isoc99_scanf(ptr noundef, ...) #4

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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


; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Info = type { i8, i64, i64 }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<Node, Node, std::_Identity<Node>, std::less<Node>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<Node, Node, std::_Identity<Node>, std::less<Node>>::_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.Node = type { i32 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@fa = external dso_local local_unnamed_addr global [100001 x i32], align 16
@dsu = external dso_local local_unnamed_addr global [100001 x i32], align 16
@e = external dso_local global [100001 x %"class.std::vector"], align 16
@a = external dso_local local_unnamed_addr global [100001 x %struct.Info], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsi(i32 noundef) 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 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 noundef i32 @_Z8dsu_findi(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::set", align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %struct.Node, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca %struct.Node, align 4
  %9 = alloca %struct.Node, align 4
  %10 = alloca %struct.Node, align 4
  %11 = alloca %"class.std::vector", align 8
  %12 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %13 = load i32, ptr @t, align 4, !tbaa !5
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr @t, align 4, !tbaa !5
  %.not67 = icmp eq i32 %13, 0
  br i1 %.not67, label %._crit_edge70, label %.lr.ph69

.lr.ph69:                                         ; preds = %0, %._crit_edge66
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %1) #6
  call void @_ZNSt3setI4NodeSt4lessIS0_ESaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @a, i64 24), i8 0, i64 24, i1 false)
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %.not4854 = icmp slt i32 %16, 2
  br i1 %.not4854, label %._crit_edge, label %.lr.ph

.preheader:                                       ; preds = %28
  %17 = icmp sgt i32 %29, 1
  br i1 %17, label %.lr.ph57, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph69, %28
  %indvars.iv = phi i64 [ %indvars.iv.next, %28 ], [ 2, %.lr.ph69 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  %22 = zext i1 %21 to i8
  %23 = sext i32 %19 to i64
  %24 = sext i32 %20 to i64
  %25 = getelementptr inbounds [100001 x %struct.Info], ptr @a, i64 0, i64 %indvars.iv
  store i8 %22, ptr %25, align 8, !tbaa !9
  %.sroa.431.0..sroa_idx = getelementptr inbounds i8, ptr %25, i64 8
  store i64 %23, ptr %.sroa.431.0..sroa_idx, align 8, !tbaa !11
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %25, i64 16
  store i64 %24, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %26 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %26, ptr %4, align 4, !tbaa !13
  %27 = invoke { ptr, i8 } @_ZNSt3setI4NodeSt4lessIS0_ESaIS0_EE6insertEOS0_(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %28 unwind label %31

28:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = load i32, ptr @n, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %.not48.not = icmp slt i64 %indvars.iv, %30
  br i1 %.not48.not, label %.lr.ph, label %.preheader, !llvm.loop !15

31:                                               ; preds = %.lr.ph
  %32 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  br label %116

._crit_edge:                                      ; preds = %41, %.lr.ph69, %.preheader
  store i32 0, ptr getelementptr inbounds (i8, ptr @fa, i64 4), align 4, !tbaa !5
  invoke void @_Z3dfsi(i32 noundef 1)
          to label %47 unwind label %55

.lr.ph57:                                         ; preds = %.preheader, %41
  %.04256 = phi i32 [ %42, %41 ], [ 1, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %5, ptr noundef nonnull %6)
  %34 = load i32, ptr %5, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %35
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %37 unwind label %45

37:                                               ; preds = %.lr.ph57
  %38 = load i32, ptr %6, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %39
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %41 unwind label %45

41:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %42 = add nuw nsw i32 %.04256, 1
  %43 = load i32, ptr @n, align 4, !tbaa !5
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %.lr.ph57, label %._crit_edge, !llvm.loop !17

45:                                               ; preds = %37, %.lr.ph57
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br label %116

47:                                               ; preds = %._crit_edge
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = shl nsw i64 %49, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @dsu, i64 4), i8 -1, i64 %50, i1 false)
  %51 = icmp sgt i32 %48, 1
  br i1 %51, label %.lr.ph60, label %._crit_edge61

._crit_edge61:                                    ; preds = %107, %47
  %52 = load i64, ptr getelementptr inbounds (i8, ptr @a, i64 32), align 16, !tbaa !18
  %53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %52)
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %.not4962 = icmp slt i32 %54, 1
  br i1 %.not4962, label %._crit_edge66, label %.lr.ph65

55:                                               ; preds = %._crit_edge
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %116

.lr.ph60:                                         ; preds = %47, %107
  %.04358 = phi i32 [ %108, %107 ], [ 1, %47 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %57 = call ptr @_ZNKSt3setI4NodeSt4lessIS0_ESaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #6
  store ptr %57, ptr %7, align 8
  %58 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorI4NodeEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %59 = load i32, ptr %58, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  store i32 %59, ptr %8, align 4, !tbaa !13
  %60 = invoke noundef i64 @_ZNSt3setI4NodeSt4lessIS0_ESaIS0_EE5eraseERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %61 unwind label %71

61:                                               ; preds = %.lr.ph60
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  %62 = sext i32 %59 to i64
  %63 = getelementptr inbounds [100001 x i32], ptr @fa, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = invoke noundef i32 @_Z8dsu_findi(i32 noundef %64)
          to label %66 unwind label %73

66:                                               ; preds = %61
  %67 = icmp sgt i32 %65, 1
  br i1 %67, label %68, label %77

68:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  store i32 %65, ptr %9, align 4, !tbaa !13
  %69 = invoke noundef i64 @_ZNSt3setI4NodeSt4lessIS0_ESaIS0_EE5eraseERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %70 unwind label %75

70:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  br label %77

71:                                               ; preds = %.lr.ph60
  %72 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  br label %116

73:                                               ; preds = %61
  %74 = landingpad { ptr, i32 }
          cleanup
  br label %116

75:                                               ; preds = %68
  %76 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  br label %116

77:                                               ; preds = %70, %66
  %78 = getelementptr inbounds [100001 x i32], ptr @dsu, i64 0, i64 %62
  store i32 %65, ptr %78, align 4, !tbaa !5
  %79 = sext i32 %65 to i64
  %80 = getelementptr inbounds [100001 x %struct.Info], ptr @a, i64 0, i64 %79
  %81 = getelementptr inbounds i8, ptr %80, i64 16
  %82 = load i64, ptr %81, align 8, !tbaa !20
  %83 = getelementptr inbounds [100001 x %struct.Info], ptr @a, i64 0, i64 %62
  %84 = getelementptr inbounds i8, ptr %83, i64 8
  %85 = load i64, ptr %84, align 8, !tbaa !18
  %86 = sub nsw i64 %82, %85
  %87 = icmp slt i64 %86, 0
  br i1 %87, label %88, label %94

88:                                               ; preds = %77
  %89 = getelementptr inbounds i8, ptr %80, i64 8
  %90 = load i64, ptr %89, align 8, !tbaa !18
  %91 = sub nsw i64 %90, %86
  store i64 %91, ptr %89, align 8, !tbaa !18
  %92 = getelementptr inbounds i8, ptr %83, i64 16
  %93 = load i64, ptr %92, align 8, !tbaa !20
  br label %98

94:                                               ; preds = %77
  %95 = getelementptr inbounds i8, ptr %83, i64 16
  %96 = load i64, ptr %95, align 8, !tbaa !20
  %97 = add nsw i64 %96, %86
  %.phi.trans.insert = getelementptr inbounds i8, ptr %80, i64 8
  %.pre = load i64, ptr %.phi.trans.insert, align 8, !tbaa !18
  br label %98

98:                                               ; preds = %94, %88
  %99 = phi i64 [ %.pre, %94 ], [ %91, %88 ]
  %storemerge = phi i64 [ %97, %94 ], [ %93, %88 ]
  store i64 %storemerge, ptr %81, align 8, !tbaa !20
  %100 = icmp slt i64 %99, %storemerge
  %101 = zext i1 %100 to i8
  store i8 %101, ptr %80, align 8, !tbaa !21
  br i1 %67, label %102, label %107

102:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #6
  store i32 %65, ptr %10, align 4, !tbaa !13
  %103 = invoke { ptr, i8 } @_ZNSt3setI4NodeSt4lessIS0_ESaIS0_EE6insertEOS0_(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %104 unwind label %105

104:                                              ; preds = %102
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  br label %107

105:                                              ; preds = %102
  %106 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  br label %116

107:                                              ; preds = %104, %98
  %108 = add nuw nsw i32 %.04358, 1
  %109 = load i32, ptr @n, align 4, !tbaa !5
  %110 = icmp slt i32 %108, %109
  br i1 %110, label %.lr.ph60, label %._crit_edge61, !llvm.loop !22

._crit_edge66:                                    ; preds = %.lr.ph65, %._crit_edge61
  call void @_ZNSt3setI4NodeSt4lessIS0_ESaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #6
  %111 = load i32, ptr @t, align 4, !tbaa !5
  %112 = add nsw i32 %111, -1
  store i32 %112, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %111, 0
  br i1 %.not, label %._crit_edge70, label %.lr.ph69, !llvm.loop !23

.lr.ph65:                                         ; preds = %._crit_edge61, %.lr.ph65
  %indvars.iv72 = phi i64 [ %indvars.iv.next73, %.lr.ph65 ], [ 1, %._crit_edge61 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %11, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  %113 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %indvars.iv72
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %113) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #6
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %114 = load i32, ptr @n, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %.not49.not = icmp slt i64 %indvars.iv72, %115
  br i1 %.not49.not, label %.lr.ph65, label %._crit_edge66, !llvm.loop !24

116:                                              ; preds = %71, %105, %75, %73, %55, %45, %31
  %.pn52 = phi { ptr, i32 } [ %32, %31 ], [ %46, %45 ], [ %56, %55 ], [ %72, %71 ], [ %106, %105 ], [ %76, %75 ], [ %74, %73 ]
  call void @_ZNSt3setI4NodeSt4lessIS0_ESaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn52

._crit_edge70:                                    ; preds = %._crit_edge66, %0
  ret i32 0
}

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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


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