; LLVM IR from DionysiosB/CodeForces :: 1799B-EqualizeByDivide (main)

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

%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<long, long>, std::pair<long, long>, std::_Identity<std::pair<long, long>>, std::less<std::pair<long, long>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long, long>, std::pair<long, long>, std::_Identity<std::pair<long, long>>, std::less<std::pair<long, long>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair.0" = type { i64, i64 }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.std::reverse_iterator" = type { %"struct.std::_Rb_tree_const_iterator" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<long, long>, std::allocator<std::pair<long, long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long, long>, std::allocator<std::pair<long, long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long, long>, std::allocator<std::pair<long, long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long, long>, std::allocator<std::pair<long, long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = 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 [9 x i8], align 1

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

31:                                               ; preds = %219, %217, %0
  %32 = load i64, ptr %2, align 8, !tbaa !5
  %33 = add nsw i64 %32, -1
  store i64 %33, ptr %2, align 8, !tbaa !5
  %34 = icmp ne i64 %32, 0
  br i1 %34, label %35, label %222

35:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 48, ptr %4) #5
  call void @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store i64 1, ptr %5, align 8, !tbaa !5
  br label %37

37:                                               ; preds = %57, %35
  %38 = load i64, ptr %5, align 8, !tbaa !5
  %39 = load i64, ptr %3, align 8, !tbaa !5
  %40 = icmp sle i64 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %69

42:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %43 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %6)
          to label %44 unwind label %60

44:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #5
  %45 = invoke { i64, i64 } @_ZSt9make_pairIRlS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %46 unwind label %64

46:                                               ; preds = %44
  %47 = getelementptr inbounds { i64, i64 }, ptr %9, i32 0, i32 0
  %48 = extractvalue { i64, i64 } %45, 0
  store i64 %48, ptr %47, align 8
  %49 = getelementptr inbounds { i64, i64 }, ptr %9, i32 0, i32 1
  %50 = extractvalue { i64, i64 } %45, 1
  store i64 %50, ptr %49, align 8
  %51 = invoke { ptr, i8 } @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %52 unwind label %64

52:                                               ; preds = %46
  %53 = getelementptr inbounds { ptr, i8 }, ptr %10, i32 0, i32 0
  %54 = extractvalue { ptr, i8 } %51, 0
  store ptr %54, ptr %53, align 8
  %55 = getelementptr inbounds { ptr, i8 }, ptr %10, i32 0, i32 1
  %56 = extractvalue { ptr, i8 } %51, 1
  store i8 %56, ptr %55, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %57

57:                                               ; preds = %52
  %58 = load i64, ptr %5, align 8, !tbaa !5
  %59 = add nsw i64 %58, 1
  store i64 %59, ptr %5, align 8, !tbaa !5
  br label %37, !llvm.loop !9

60:                                               ; preds = %42
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %7, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %8, align 4
  br label %68

64:                                               ; preds = %46, %44
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %7, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  br label %68

68:                                               ; preds = %64, %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %221

69:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %70 = call ptr @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  %71 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %11, i32 0, i32 0
  store ptr %70, ptr %71, align 8
  %72 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIllEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  %73 = getelementptr inbounds %"struct.std::pair.0", ptr %72, i32 0, i32 0
  %74 = load i64, ptr %73, align 8, !tbaa !11
  %75 = icmp sle i64 %74, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  br i1 %75, label %76, label %82

76:                                               ; preds = %69
  call void @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE6rbeginEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %12, ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  %77 = invoke noundef ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorISt4pairIllEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %78 unwind label %87

78:                                               ; preds = %76
  %79 = getelementptr inbounds %"struct.std::pair.0", ptr %77, i32 0, i32 0
  %80 = load i64, ptr %79, align 8, !tbaa !11
  %81 = icmp sgt i64 %80, 1
  br label %82

82:                                               ; preds = %78, %69
  %83 = phi i1 [ false, %69 ], [ %81, %78 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br i1 %83, label %84, label %95

84:                                               ; preds = %82
  %85 = invoke i32 @puts(ptr noundef @.str.1)
          to label %86 unwind label %91

86:                                               ; preds = %84
  store i32 2, ptr %13, align 4
  br label %217, !llvm.loop !13

87:                                               ; preds = %76
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %7, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %221

91:                                               ; preds = %84
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %7, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %8, align 4
  br label %221

95:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #5
  call void @_ZNSt6vectorISt4pairIllESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 0, ptr %15, align 8, !tbaa !5
  br label %96

96:                                               ; preds = %166, %95
  %97 = load i64, ptr %15, align 8, !tbaa !5
  %98 = load i64, ptr %3, align 8, !tbaa !5
  %99 = mul nsw i64 30, %98
  %100 = icmp slt i64 %97, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %96
  store i32 7, ptr %13, align 4
  br label %184

102:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  call void @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE6rbeginEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %17, ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  %103 = invoke noundef ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorISt4pairIllEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %104 unwind label %125

104:                                              ; preds = %102
  %105 = getelementptr inbounds %"struct.std::pair.0", ptr %103, i32 0, i32 0
  %106 = load i64, ptr %105, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  store i64 %106, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  call void @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE6rbeginEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %19, ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  %107 = invoke noundef ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorISt4pairIllEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %19)
          to label %108 unwind label %129

108:                                              ; preds = %104
  %109 = getelementptr inbounds %"struct.std::pair.0", ptr %107, i32 0, i32 1
  %110 = load i64, ptr %109, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  store i64 %110, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %111 = call ptr @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  %112 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %21, i32 0, i32 0
  store ptr %111, ptr %112, align 8
  %113 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIllEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #5
  %114 = getelementptr inbounds %"struct.std::pair.0", ptr %113, i32 0, i32 0
  %115 = load i64, ptr %114, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  store i64 %115, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %116 = call ptr @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  %117 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %23, i32 0, i32 0
  store ptr %116, ptr %117, align 8
  %118 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIllEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #5
  %119 = getelementptr inbounds %"struct.std::pair.0", ptr %118, i32 0, i32 1
  %120 = load i64, ptr %119, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  store i64 %120, ptr %22, align 8, !tbaa !5
  %121 = load i64, ptr %16, align 8, !tbaa !5
  %122 = load i64, ptr %20, align 8, !tbaa !5
  %123 = icmp eq i64 %121, %122
  br i1 %123, label %124, label %133

124:                                              ; preds = %108
  store i32 7, ptr %13, align 4
  br label %163

125:                                              ; preds = %102
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %7, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %183

129:                                              ; preds = %104
  %130 = landingpad { ptr, i32 }
          cleanup
  %131 = extractvalue { ptr, i32 } %130, 0
  store ptr %131, ptr %7, align 8
  %132 = extractvalue { ptr, i32 } %130, 1
  store i32 %132, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %182

133:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #5
  %134 = invoke { i64, i64 } @_ZSt9make_pairIRlS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %22)
          to label %135 unwind label %169

135:                                              ; preds = %133
  %136 = getelementptr inbounds { i64, i64 }, ptr %24, i32 0, i32 0
  %137 = extractvalue { i64, i64 } %134, 0
  store i64 %137, ptr %136, align 8
  %138 = getelementptr inbounds { i64, i64 }, ptr %24, i32 0, i32 1
  %139 = extractvalue { i64, i64 } %134, 1
  store i64 %139, ptr %138, align 8
  invoke void @_ZNSt6vectorISt4pairIllESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(16) %24)
          to label %140 unwind label %169

140:                                              ; preds = %135
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  call void @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE6rbeginEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %25, ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  %141 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorISt4pairIllEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %25)
          to label %142 unwind label %173

142:                                              ; preds = %140
  %143 = invoke noundef i64 @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EE5eraseERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(16) %141)
          to label %144 unwind label %173

144:                                              ; preds = %142
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %145 = load i64, ptr %16, align 8, !tbaa !5
  %146 = load i64, ptr %20, align 8, !tbaa !5
  %147 = add nsw i64 %145, %146
  %148 = sub nsw i64 %147, 1
  %149 = load i64, ptr %20, align 8, !tbaa !5
  %150 = sdiv i64 %148, %149
  store i64 %150, ptr %27, align 8, !tbaa !5
  %151 = invoke { i64, i64 } @_ZSt9make_pairIlRlESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %152 unwind label %177

152:                                              ; preds = %144
  %153 = getelementptr inbounds { i64, i64 }, ptr %26, i32 0, i32 0
  %154 = extractvalue { i64, i64 } %151, 0
  store i64 %154, ptr %153, align 8
  %155 = getelementptr inbounds { i64, i64 }, ptr %26, i32 0, i32 1
  %156 = extractvalue { i64, i64 } %151, 1
  store i64 %156, ptr %155, align 8
  %157 = invoke { ptr, i8 } @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(16) %26)
          to label %158 unwind label %177

158:                                              ; preds = %152
  %159 = getelementptr inbounds { ptr, i8 }, ptr %28, i32 0, i32 0
  %160 = extractvalue { ptr, i8 } %157, 0
  store ptr %160, ptr %159, align 8
  %161 = getelementptr inbounds { ptr, i8 }, ptr %28, i32 0, i32 1
  %162 = extractvalue { ptr, i8 } %157, 1
  store i8 %162, ptr %161, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #5
  store i32 0, ptr %13, align 4
  br label %163

163:                                              ; preds = %158, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  %164 = load i32, ptr %13, align 4
  switch i32 %164, label %184 [
    i32 0, label %165
  ]

165:                                              ; preds = %163
  br label %166

166:                                              ; preds = %165
  %167 = load i64, ptr %15, align 8, !tbaa !5
  %168 = add nsw i64 %167, 1
  store i64 %168, ptr %15, align 8, !tbaa !5
  br label %96, !llvm.loop !15

169:                                              ; preds = %135, %133
  %170 = landingpad { ptr, i32 }
          cleanup
  %171 = extractvalue { ptr, i32 } %170, 0
  store ptr %171, ptr %7, align 8
  %172 = extractvalue { ptr, i32 } %170, 1
  store i32 %172, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #5
  br label %181

173:                                              ; preds = %142, %140
  %174 = landingpad { ptr, i32 }
          cleanup
  %175 = extractvalue { ptr, i32 } %174, 0
  store ptr %175, ptr %7, align 8
  %176 = extractvalue { ptr, i32 } %174, 1
  store i32 %176, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br label %181

177:                                              ; preds = %152, %144
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %7, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #5
  br label %181

181:                                              ; preds = %177, %173, %169
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %182

182:                                              ; preds = %181, %129
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %183

183:                                              ; preds = %182, %125
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %220

184:                                              ; preds = %163, %101
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %185

185:                                              ; preds = %184
  %186 = call noundef i64 @_ZNKSt6vectorISt4pairIllESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  %187 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %186)
          to label %188 unwind label %194

188:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  store i64 0, ptr %29, align 8, !tbaa !5
  br label %189

189:                                              ; preds = %209, %188
  %190 = load i64, ptr %29, align 8, !tbaa !5
  %191 = call noundef i64 @_ZNKSt6vectorISt4pairIllESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  %192 = icmp ult i64 %190, %191
  br i1 %192, label %198, label %193

193:                                              ; preds = %189
  store i32 10, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  br label %216

194:                                              ; preds = %185
  %195 = landingpad { ptr, i32 }
          cleanup
  %196 = extractvalue { ptr, i32 } %195, 0
  store ptr %196, ptr %7, align 8
  %197 = extractvalue { ptr, i32 } %195, 1
  store i32 %197, ptr %8, align 4
  br label %220

198:                                              ; preds = %189
  %199 = load i64, ptr %29, align 8, !tbaa !5
  %200 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %199) #5
  %201 = getelementptr inbounds %"struct.std::pair.0", ptr %200, i32 0, i32 0
  %202 = load i64, ptr %201, align 8, !tbaa !11
  %203 = load i64, ptr %29, align 8, !tbaa !5
  %204 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %203) #5
  %205 = getelementptr inbounds %"struct.std::pair.0", ptr %204, i32 0, i32 1
  %206 = load i64, ptr %205, align 8, !tbaa !14
  %207 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %202, i64 noundef %206)
          to label %208 unwind label %212

208:                                              ; preds = %198
  br label %209

209:                                              ; preds = %208
  %210 = load i64, ptr %29, align 8, !tbaa !5
  %211 = add nsw i64 %210, 1
  store i64 %211, ptr %29, align 8, !tbaa !5
  br label %189, !llvm.loop !16

212:                                              ; preds = %198
  %213 = landingpad { ptr, i32 }
          cleanup
  %214 = extractvalue { ptr, i32 } %213, 0
  store ptr %214, ptr %7, align 8
  %215 = extractvalue { ptr, i32 } %213, 1
  store i32 %215, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  br label %220

216:                                              ; preds = %193
  call void @_ZNSt6vectorISt4pairIllESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  store i32 0, ptr %13, align 4
  br label %217

217:                                              ; preds = %216, %86
  call void @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  %218 = load i32, ptr %13, align 4
  switch i32 %218, label %229 [
    i32 0, label %219
    i32 2, label %31
  ]

219:                                              ; preds = %217
  br label %31, !llvm.loop !13

220:                                              ; preds = %212, %194, %183
  call void @_ZNSt6vectorISt4pairIllESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  br label %221

221:                                              ; preds = %220, %91, %87, %68
  call void @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %224

222:                                              ; preds = %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %223 = load i32, ptr %1, align 4
  ret i32 %223

224:                                              ; preds = %221
  %225 = load ptr, ptr %7, align 8
  %226 = load i32, ptr %8, align 4
  %227 = insertvalue { ptr, i32 } poison, ptr %225, 0
  %228 = insertvalue { ptr, i32 } %227, i32 %226, 1
  resume { ptr, i32 } %228

229:                                              ; preds = %217
  unreachable
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIRlS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE6rbeginEv(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 uwtable
declare dso_local noundef ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorISt4pairIllEEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

declare i32 @puts(ptr noundef) #2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIlRlESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorISt4pairIllESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

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

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 #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 = { nounwind }

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

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

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = 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 [9 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::set", align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca %"struct.std::pair.0", align 8
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca %"class.std::reverse_iterator", align 8
  %9 = alloca %"class.std::vector", align 8
  %10 = alloca %"class.std::reverse_iterator", align 8
  %11 = alloca i64, align 8
  %12 = alloca %"class.std::reverse_iterator", align 8
  %13 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %14 = alloca i64, align 8
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %16 = alloca %"struct.std::pair.0", align 8
  %17 = alloca %"class.std::reverse_iterator", align 8
  %18 = alloca %"struct.std::pair.0", align 8
  %19 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %21 = load i64, ptr %1, align 8, !tbaa !5
  %22 = add nsw i64 %21, -1
  store i64 %22, ptr %1, align 8, !tbaa !5
  %.not42 = icmp eq i64 %21, 0
  br i1 %.not42, label %._crit_edge45, label %.lr.ph44

.lr.ph44:                                         ; preds = %0
  %23 = getelementptr inbounds i8, ptr %6, i64 8
  %24 = getelementptr inbounds i8, ptr %16, i64 8
  %25 = getelementptr inbounds i8, ptr %18, i64 8
  br label %26

26:                                               ; preds = %.lr.ph44, %118
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #5
  call void @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  store i64 1, ptr %4, align 8, !tbaa !5
  %28 = load i64, ptr %2, align 8, !tbaa !5
  %.not2534 = icmp slt i64 %28, 1
  br i1 %.not2534, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %39, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %29 = call ptr @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  store ptr %29, ptr %7, align 8
  %30 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIllEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  %31 = load i64, ptr %30, align 8, !tbaa !9
  %32 = icmp slt i64 %31, 2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  br i1 %32, label %45, label %.critedge

.lr.ph:                                           ; preds = %26, %39
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %5)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %34 = invoke { i64, i64 } @_ZSt9make_pairIRlS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %35 unwind label %43

35:                                               ; preds = %.lr.ph
  %36 = extractvalue { i64, i64 } %34, 0
  store i64 %36, ptr %6, align 8
  %37 = extractvalue { i64, i64 } %34, 1
  store i64 %37, ptr %23, align 8
  %38 = invoke { ptr, i8 } @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %39 unwind label %43

39:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  %40 = load i64, ptr %4, align 8, !tbaa !5
  %41 = add nsw i64 %40, 1
  store i64 %41, ptr %4, align 8, !tbaa !5
  %42 = load i64, ptr %2, align 8, !tbaa !5
  %.not25.not = icmp slt i64 %40, %42
  br i1 %.not25.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

43:                                               ; preds = %35, %.lr.ph
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %121

45:                                               ; preds = %._crit_edge
  call void @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE6rbeginEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %8, ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  %46 = invoke noundef ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorISt4pairIllEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %47 unwind label %52

47:                                               ; preds = %45
  %48 = load i64, ptr %46, align 8, !tbaa !9
  %49 = icmp sgt i64 %48, 1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br i1 %49, label %50, label %54

50:                                               ; preds = %47
  %51 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %118, !llvm.loop !13

52:                                               ; preds = %45
  %53 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br label %121

.critedge:                                        ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br label %54

54:                                               ; preds = %.critedge, %47
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #5
  call void @_ZNSt6vectorISt4pairIllESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %55 = load i64, ptr %2, align 8, !tbaa !5
  %56 = icmp sgt i64 %55, 0
  br i1 %56, label %.lr.ph37, label %.loopexit

.lr.ph37:                                         ; preds = %54, %92
  %.02235 = phi i64 [ %93, %92 ], [ 0, %54 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  call void @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE6rbeginEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %10, ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  %57 = invoke noundef ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorISt4pairIllEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %58 unwind label %71

58:                                               ; preds = %.lr.ph37
  %59 = load i64, ptr %57, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  call void @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE6rbeginEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %12, ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  %60 = invoke noundef ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorISt4pairIllEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %61 unwind label %73

61:                                               ; preds = %58
  %62 = getelementptr inbounds i8, ptr %60, i64 8
  %63 = load i64, ptr %62, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  store i64 %63, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  %64 = call ptr @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  store ptr %64, ptr %13, align 8
  %65 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIllEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  %66 = load i64, ptr %65, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %67 = call ptr @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  store ptr %67, ptr %15, align 8
  %68 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIllEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  %69 = getelementptr inbounds i8, ptr %68, i64 8
  %70 = load i64, ptr %69, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  store i64 %70, ptr %14, align 8, !tbaa !5
  %.not29 = icmp eq i64 %59, %66
  br i1 %.not29, label %.critedge33, label %75

71:                                               ; preds = %.lr.ph37
  %72 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  br label %105

73:                                               ; preds = %58
  %74 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  br label %104

75:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #5
  %76 = invoke { i64, i64 } @_ZSt9make_pairIRlS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %77 unwind label %97

77:                                               ; preds = %75
  %78 = extractvalue { i64, i64 } %76, 0
  store i64 %78, ptr %16, align 8
  %79 = extractvalue { i64, i64 } %76, 1
  store i64 %79, ptr %24, align 8
  invoke void @_ZNSt6vectorISt4pairIllESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %80 unwind label %97

80:                                               ; preds = %77
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #5
  call void @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE6rbeginEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %17, ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  %81 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorISt4pairIllEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17)
  %82 = invoke noundef i64 @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EE5eraseERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(16) %81)
          to label %83 unwind label %99

83:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #5
  %84 = add i64 %59, -1
  %85 = add i64 %84, %66
  %86 = sdiv i64 %85, %66
  store i64 %86, ptr %19, align 8, !tbaa !5
  %87 = invoke { i64, i64 } @_ZSt9make_pairIlRlESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %88 unwind label %101

88:                                               ; preds = %83
  %89 = extractvalue { i64, i64 } %87, 0
  store i64 %89, ptr %18, align 8
  %90 = extractvalue { i64, i64 } %87, 1
  store i64 %90, ptr %25, align 8
  %91 = invoke { ptr, i8 } @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(16) %18)
          to label %92 unwind label %101

92:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  %93 = add nuw nsw i64 %.02235, 1
  %94 = load i64, ptr %2, align 8, !tbaa !5
  %95 = mul nsw i64 %94, 30
  %96 = icmp slt i64 %93, %95
  br i1 %96, label %.lr.ph37, label %.loopexit, !llvm.loop !15

97:                                               ; preds = %77, %75
  %98 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #5
  br label %103

99:                                               ; preds = %80
  %100 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  br label %103

101:                                              ; preds = %88, %83
  %102 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #5
  br label %103

103:                                              ; preds = %101, %99, %97
  %.pn = phi { ptr, i32 } [ %102, %101 ], [ %100, %99 ], [ %98, %97 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  br label %104

104:                                              ; preds = %103, %73
  %.pn.pn = phi { ptr, i32 } [ %.pn, %103 ], [ %74, %73 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br label %105

105:                                              ; preds = %104, %71
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %104 ], [ %72, %71 ]
  call void @_ZNSt6vectorISt4pairIllESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  br label %121

.critedge33:                                      ; preds = %61
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br label %.loopexit

.loopexit:                                        ; preds = %92, %54, %.critedge33
  %106 = call noundef i64 @_ZNKSt6vectorISt4pairIllESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %107 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %106)
  %108 = call noundef i64 @_ZNKSt6vectorISt4pairIllESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %.not46 = icmp eq i64 %108, 0
  br i1 %.not46, label %._crit_edge41, label %.lr.ph40

._crit_edge41:                                    ; preds = %.lr.ph40, %.loopexit
  call void @_ZNSt6vectorISt4pairIllESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  br label %118

.lr.ph40:                                         ; preds = %.loopexit, %.lr.ph40
  %.038 = phi i64 [ %115, %.lr.ph40 ], [ 0, %.loopexit ]
  %109 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %.038) #5
  %110 = load i64, ptr %109, align 8, !tbaa !9
  %111 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %.038) #5
  %112 = getelementptr inbounds i8, ptr %111, i64 8
  %113 = load i64, ptr %112, align 8, !tbaa !14
  %114 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %110, i64 noundef %113)
  %115 = add nuw nsw i64 %.038, 1
  %116 = call noundef i64 @_ZNKSt6vectorISt4pairIllESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %117 = icmp ult i64 %115, %116
  br i1 %117, label %.lr.ph40, label %._crit_edge41, !llvm.loop !16

118:                                              ; preds = %._crit_edge41, %50
  call void @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  %119 = load i64, ptr %1, align 8, !tbaa !5
  %120 = add nsw i64 %119, -1
  store i64 %120, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %119, 0
  br i1 %.not, label %._crit_edge45, label %26

121:                                              ; preds = %105, %52, %43
  %.pn30 = phi { ptr, i32 } [ %44, %43 ], [ %.pn.pn.pn, %105 ], [ %53, %52 ]
  call void @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn30

._crit_edge45:                                    ; preds = %118, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 0
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIRlS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE6rbeginEv(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 uwtable
declare dso_local noundef ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorISt4pairIllEEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIlRlESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorISt4pairIllESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

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

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { nounwind }

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

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass