; LLVM IR from andreimaximov/algorithms :: codeforces/cards-sorting (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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::map" = type { %"class.std::_Rb_tree.0" }
%"class.std::_Rb_tree.0" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::set<int>>, std::_Select1st<std::pair<const int, std::set<int>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::set<int>>, std::_Select1st<std::pair<const int, std::set<int>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::set<int>, std::allocator<std::set<int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::set<int>, std::allocator<std::set<int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::set<int>, std::allocator<std::set<int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::set<int>, std::allocator<std::set<int>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::reverse_iterator" = type { %"struct.std::_Rb_tree_iterator" }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair.7" = type { i32, %"class.std::set" }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }

@N = external dso_local global i32, align 4
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z6updateii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5counti(i32 noundef) #0

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

; 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 noundef i32 @_Z5rangeii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::map", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca %"class.std::stack", align 8
  %9 = alloca %"class.std::reverse_iterator", align 8
  %10 = alloca %"class.std::reverse_iterator", align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  call void @llvm.lifetime.start.p0(i64 48, ptr %2) #7
  call void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %33, %0
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = load i32, ptr @N, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %21, label %20

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

21:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %22 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %23 unwind label %36

23:                                               ; preds = %21
  %24 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z6updateii(i32 noundef %24, i32 noundef 1)
  %25 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %26 unwind label %36

26:                                               ; preds = %23
  %27 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %25, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %28 unwind label %36

28:                                               ; preds = %26
  %29 = getelementptr inbounds { ptr, i8 }, ptr %7, i32 0, i32 0
  %30 = extractvalue { ptr, i8 } %27, 0
  store ptr %30, ptr %29, align 8
  %31 = getelementptr inbounds { ptr, i8 }, ptr %7, i32 0, i32 1
  %32 = extractvalue { ptr, i8 } %27, 1
  store i8 %32, ptr %31, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %33

33:                                               ; preds = %28
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %3, align 4, !tbaa !5
  br label %16, !llvm.loop !9

36:                                               ; preds = %26, %23, %21
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %5, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %140

40:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 80, ptr %8) #7
  invoke void @_ZNSt5stackISt3setIiSt4lessIiESaIiEESt5dequeIS4_SaIS4_EEEC2IS7_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %41 unwind label %46

41:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  call void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEE6rbeginEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %9, ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  br label %42

42:                                               ; preds = %61, %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  call void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEE4rendEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %10, ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  %43 = invoke noundef zeroext i1 @_ZStneISt17_Rb_tree_iteratorISt4pairIKiSt3setIiSt4lessIiESaIiEEEEEbRKSt16reverse_iteratorIT_ESE_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %44 unwind label %50

44:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br i1 %43, label %54, label %45

45:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %67

46:                                               ; preds = %40
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %5, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %6, align 4
  br label %139

50:                                               ; preds = %42
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %5, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %66

54:                                               ; preds = %44
  %55 = invoke noundef ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKiSt3setIiSt4lessIiESaIiEEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %56 unwind label %62

56:                                               ; preds = %54
  %57 = getelementptr inbounds %"struct.std::pair.7", ptr %55, i32 0, i32 1
  invoke void @_ZNSt5stackISt3setIiSt4lessIiESaIiEESt5dequeIS4_SaIS4_EEE4pushEOS4_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 8 dereferenceable(48) %57)
          to label %58 unwind label %62

58:                                               ; preds = %56
  br label %59

59:                                               ; preds = %58
  %60 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKiSt3setIiSt4lessIiESaIiEEEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %61 unwind label %62

61:                                               ; preds = %59
  br label %42, !llvm.loop !11

62:                                               ; preds = %59, %56, %54
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %5, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %6, align 4
  br label %66

66:                                               ; preds = %62, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %138

67:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store i64 0, ptr %12, align 8, !tbaa !12
  br label %68

68:                                               ; preds = %123, %67
  %69 = invoke noundef zeroext i1 @_ZNKSt5stackISt3setIiSt4lessIiESaIiEESt5dequeIS4_SaIS4_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %70 unwind label %84

70:                                               ; preds = %68
  %71 = xor i1 %69, true
  br i1 %71, label %72, label %130

72:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %73 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt5stackISt3setIiSt4lessIiESaIiEESt5dequeIS4_SaIS4_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %74 unwind label %88

74:                                               ; preds = %72
  store ptr %73, ptr %13, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %75 = load i32, ptr %11, align 4, !tbaa !5
  %76 = load ptr, ptr %13, align 8, !tbaa !14
  %77 = invoke noundef i32 @_Z11get_closestiRKSt3setIiSt4lessIiESaIiEE(i32 noundef %75, ptr noundef nonnull align 8 dereferenceable(48) %76)
          to label %78 unwind label %92

78:                                               ; preds = %74
  store i32 %77, ptr %14, align 4, !tbaa !5
  %79 = load ptr, ptr %13, align 8, !tbaa !14
  %80 = call noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %79) #7
  %81 = icmp eq i64 %80, 1
  br i1 %81, label %82, label %96

82:                                               ; preds = %78
  invoke void @_ZNSt5stackISt3setIiSt4lessIiESaIiEESt5dequeIS4_SaIS4_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %83 unwind label %92

83:                                               ; preds = %82
  br label %100

84:                                               ; preds = %133, %130, %68
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %5, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %6, align 4
  br label %137

88:                                               ; preds = %72
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %5, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %6, align 4
  br label %129

92:                                               ; preds = %96, %82, %74
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %5, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %129

96:                                               ; preds = %78
  %97 = load ptr, ptr %13, align 8, !tbaa !14
  %98 = invoke noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %97, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %99 unwind label %92

99:                                               ; preds = %96
  br label %100

100:                                              ; preds = %99, %83
  %101 = load i32, ptr %11, align 4, !tbaa !5
  %102 = load i32, ptr %14, align 4, !tbaa !5
  %103 = icmp sle i32 %101, %102
  br i1 %103, label %104, label %112

104:                                              ; preds = %100
  %105 = load i32, ptr %11, align 4, !tbaa !5
  %106 = load i32, ptr %14, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  %108 = call noundef i32 @_Z5rangeii(i32 noundef %105, i32 noundef %107)
  %109 = sext i32 %108 to i64
  %110 = load i64, ptr %12, align 8, !tbaa !12
  %111 = add nsw i64 %110, %109
  store i64 %111, ptr %12, align 8, !tbaa !12
  br label %123

112:                                              ; preds = %100
  %113 = load i32, ptr %14, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  %115 = call noundef i32 @_Z5counti(i32 noundef %114)
  %116 = load i32, ptr %11, align 4, !tbaa !5
  %117 = load i32, ptr @N, align 4, !tbaa !5
  %118 = call noundef i32 @_Z5rangeii(i32 noundef %116, i32 noundef %117)
  %119 = add nsw i32 %115, %118
  %120 = sext i32 %119 to i64
  %121 = load i64, ptr %12, align 8, !tbaa !12
  %122 = add nsw i64 %121, %120
  store i64 %122, ptr %12, align 8, !tbaa !12
  br label %123

123:                                              ; preds = %112, %104
  %124 = load i32, ptr %14, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  %126 = load i32, ptr @N, align 4, !tbaa !5
  %127 = srem i32 %125, %126
  store i32 %127, ptr %11, align 4, !tbaa !5
  %128 = load i32, ptr %14, align 4, !tbaa !5
  call void @_Z6updateii(i32 noundef %128, i32 noundef -1)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %68, !llvm.loop !16

129:                                              ; preds = %92, %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %137

130:                                              ; preds = %70
  %131 = load i64, ptr %12, align 8, !tbaa !12
  %132 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %131)
          to label %133 unwind label %84

133:                                              ; preds = %130
  %134 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %132, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %135 unwind label %84

135:                                              ; preds = %133
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @_ZNSt5stackISt3setIiSt4lessIiESaIiEESt5dequeIS4_SaIS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #7
  call void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %2) #7
  %136 = load i32, ptr %1, align 4
  ret i32 %136

137:                                              ; preds = %129, %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %138

138:                                              ; preds = %137, %66
  call void @_ZNSt5stackISt3setIiSt4lessIiESaIiEESt5dequeIS4_SaIS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #7
  br label %139

139:                                              ; preds = %138, %46
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #7
  br label %140

140:                                              ; preds = %139, %36
  call void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %2) #7
  br label %141

141:                                              ; preds = %140
  %142 = load ptr, ptr %5, align 8
  %143 = load i32, ptr %6, align 4
  %144 = insertvalue { ptr, i32 } poison, ptr %142, 0
  %145 = insertvalue { ptr, i32 } %144, i32 %143, 1
  resume { ptr, i32 } %145
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #5

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackISt3setIiSt4lessIiESaIiEESt5dequeIS4_SaIS4_EEEC2IS7_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #2 align 2

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackISt3setIiSt4lessIiESaIiEESt5dequeIS4_SaIS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEED2Ev(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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::map" = type { %"class.std::_Rb_tree.0" }
%"class.std::_Rb_tree.0" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::set<int>>, std::_Select1st<std::pair<const int, std::set<int>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::set<int>>, std::_Select1st<std::pair<const int, std::set<int>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::set<int>, std::allocator<std::set<int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::set<int>, std::allocator<std::set<int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::set<int>, std::allocator<std::set<int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::set<int>, std::allocator<std::set<int>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::reverse_iterator" = type { %"struct.std::_Rb_tree_iterator" }
%"struct.std::_Rb_tree_iterator" = type { ptr }

@N = external dso_local global i32, align 4
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z6updateii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5counti(i32 noundef) local_unnamed_addr #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: 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 noundef i32 @_Z5rangeii(i32 noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::map", align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::stack", align 8
  %5 = alloca %"class.std::reverse_iterator", align 8
  %6 = alloca %"class.std::reverse_iterator", align 8
  %7 = alloca i32, align 4
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %1) #7
  call void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  %9 = load i32, ptr @N, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %17, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %4) #7
  invoke void @_ZNSt5stackISt3setIiSt4lessIiESaIiEESt5dequeIS4_SaIS4_EEEC2IS7_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %24 unwind label %30

.lr.ph:                                           ; preds = %0, %17
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %11 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %12 unwind label %22

12:                                               ; preds = %.lr.ph
  %13 = load i32, ptr %2, align 4, !tbaa !5
  call void @_Z6updateii(i32 noundef %13, i32 noundef 1)
  %14 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %15 unwind label %22

15:                                               ; preds = %12
  %16 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %14, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %17 unwind label %22

17:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr %2, align 4, !tbaa !5
  %20 = load i32, ptr @N, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %.lr.ph, label %._crit_edge, !llvm.loop !9

22:                                               ; preds = %15, %12, %.lr.ph
  %23 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  br label %77

24:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  call void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEE6rbeginEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %5, ptr noundef nonnull align 8 dereferenceable(48) %1) #7
  br label %25

25:                                               ; preds = %38, %24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  call void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEE4rendEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %6, ptr noundef nonnull align 8 dereferenceable(48) %1) #7
  %26 = invoke noundef zeroext i1 @_ZStneISt17_Rb_tree_iteratorISt4pairIKiSt3setIiSt4lessIiESaIiEEEEEbRKSt16reverse_iteratorIT_ESE_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %27 unwind label %32

27:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br i1 %26, label %34, label %28

28:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %29 = call noundef zeroext i1 @_ZNKSt5stackISt3setIiSt4lessIiESaIiEESt5dequeIS4_SaIS4_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br i1 %29, label %._crit_edge35, label %.lr.ph34

30:                                               ; preds = %._crit_edge
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %76

32:                                               ; preds = %25
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %42

34:                                               ; preds = %27
  %35 = invoke noundef ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKiSt3setIiSt4lessIiESaIiEEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %36 unwind label %40

36:                                               ; preds = %34
  %37 = getelementptr inbounds i8, ptr %35, i64 8
  invoke void @_ZNSt5stackISt3setIiSt4lessIiESaIiEESt5dequeIS4_SaIS4_EEE4pushEOS4_(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 8 dereferenceable(48) %37)
          to label %38 unwind label %40

38:                                               ; preds = %36
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKiSt3setIiSt4lessIiESaIiEEEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  br label %25, !llvm.loop !11

40:                                               ; preds = %36, %34
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %42

42:                                               ; preds = %40, %32
  %.pn24 = phi { ptr, i32 } [ %41, %40 ], [ %33, %32 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %75

.lr.ph34:                                         ; preds = %28, %65
  %.032 = phi i64 [ %.1, %65 ], [ 0, %28 ]
  %.01231 = phi i32 [ %69, %65 ], [ 0, %28 ]
  %43 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt5stackISt3setIiSt4lessIiESaIiEESt5dequeIS4_SaIS4_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %44 = invoke noundef i32 @_Z11get_closestiRKSt3setIiSt4lessIiESaIiEE(i32 noundef %.01231, ptr noundef nonnull align 8 dereferenceable(48) %43)
          to label %45 unwind label %51

45:                                               ; preds = %.lr.ph34
  store i32 %44, ptr %7, align 4, !tbaa !5
  %46 = call noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %43) #7
  %47 = icmp eq i64 %46, 1
  br i1 %47, label %48, label %53

48:                                               ; preds = %45
  call void @_ZNSt5stackISt3setIiSt4lessIiESaIiEESt5dequeIS4_SaIS4_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br label %55

49:                                               ; preds = %72, %._crit_edge35
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %75

51:                                               ; preds = %53, %.lr.ph34
  %52 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  br label %75

53:                                               ; preds = %45
  %54 = invoke noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %43, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %55 unwind label %51

55:                                               ; preds = %53, %48
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %.not = icmp sgt i32 %.01231, %56
  %57 = add nsw i32 %56, 1
  br i1 %.not, label %60, label %58

58:                                               ; preds = %55
  %59 = call noundef i32 @_Z5rangeii(i32 noundef %.01231, i32 noundef %57)
  br label %65

60:                                               ; preds = %55
  %61 = call noundef i32 @_Z5counti(i32 noundef %57)
  %62 = load i32, ptr @N, align 4, !tbaa !5
  %63 = call noundef i32 @_Z5rangeii(i32 noundef %.01231, i32 noundef %62)
  %64 = add nsw i32 %63, %61
  br label %65

65:                                               ; preds = %60, %58
  %.pn23.in = phi i32 [ %59, %58 ], [ %64, %60 ]
  %.pn23 = sext i32 %.pn23.in to i64
  %.1 = add nsw i64 %.032, %.pn23
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  %68 = load i32, ptr @N, align 4, !tbaa !5
  %69 = srem i32 %67, %68
  call void @_Z6updateii(i32 noundef %66, i32 noundef -1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  %70 = call noundef zeroext i1 @_ZNKSt5stackISt3setIiSt4lessIiESaIiEESt5dequeIS4_SaIS4_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br i1 %70, label %._crit_edge35, label %.lr.ph34, !llvm.loop !12

._crit_edge35:                                    ; preds = %65, %28
  %.0.lcssa = phi i64 [ 0, %28 ], [ %.1, %65 ]
  %71 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.0.lcssa)
          to label %72 unwind label %49

72:                                               ; preds = %._crit_edge35
  %73 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %74 unwind label %49

74:                                               ; preds = %72
  call void @_ZNSt5stackISt3setIiSt4lessIiESaIiEESt5dequeIS4_SaIS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #7
  call void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #7
  ret i32 0

75:                                               ; preds = %49, %51, %42
  %.pn24.pn = phi { ptr, i32 } [ %.pn24, %42 ], [ %52, %51 ], [ %50, %49 ]
  call void @_ZNSt5stackISt3setIiSt4lessIiESaIiEESt5dequeIS4_SaIS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #7
  br label %76

76:                                               ; preds = %75, %30
  %.pn24.pn.pn = phi { ptr, i32 } [ %.pn24.pn, %75 ], [ %31, %30 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #7
  br label %77

77:                                               ; preds = %76, %22
  %.pn28 = phi { ptr, i32 } [ %23, %22 ], [ %.pn24.pn.pn, %76 ]
  call void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn28
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackISt3setIiSt4lessIiESaIiEESt5dequeIS4_SaIS4_EEEC2IS7_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZStneISt17_Rb_tree_iteratorISt4pairIKiSt3setIiSt4lessIiESaIiEEEEEbRKSt16reverse_iteratorIT_ESE_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackISt3setIiSt4lessIiESaIiEESt5dequeIS4_SaIS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEED2Ev(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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass