; LLVM IR from musetronstar/tagd :: tagd/src/rank.ll (ZN4tagd4rank4nextERS0_RKSt3setIS0_St4lessIS0_ESaIS0_EE)

; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%class.anon = type { ptr, ptr, ptr }
%"class.tagd::rank" = type { %"class.std::__cxx11::basic_string" }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [23 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1

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

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

declare noundef i32 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareEmmRKS4_(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(32)) #1

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

; Function Attrs: mustprogress uwtable
declare void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, i64 noundef) #3 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN4tagd4rank4nextERS0_RKSt3setIS0_St4lessIS0_ESaIS0_EE(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(48) %1) #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %class.anon, align 8
  %11 = alloca i64, align 8
  %12 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %13 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = call ptr @_ZNKSt3setIN4tagd4rankESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %18) #6
  %20 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %6, i32 0, i32 0
  store ptr %19, ptr %20, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = call ptr @_ZNKSt3setIN4tagd4rankESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %21) #6
  %23 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %7, i32 0, i32 0
  store ptr %22, ptr %23, align 8
  %24 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorIN4tagd4rankEES4_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br i1 %24, label %25, label %26

25:                                               ; preds = %2
  store i32 7, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %150

26:                                               ; preds = %2
  %27 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %28 = getelementptr inbounds %"class.tagd::rank", ptr %27, i32 0, i32 0
  %29 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %28) #6
  br i1 %29, label %30, label %33

30:                                               ; preds = %26
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str)
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 7, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %150

33:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %34 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %35 = call noundef i32 @_ZNK4tagd4rank4backEv(ptr noundef nonnull align 8 dereferenceable(32) %34)
  store i32 %35, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #6
  %36 = getelementptr inbounds %class.anon, ptr %10, i32 0, i32 0
  store ptr %6, ptr %36, align 8, !tbaa !5
  %37 = getelementptr inbounds %class.anon, ptr %10, i32 0, i32 1
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %38, ptr %37, align 8, !tbaa !5
  %39 = getelementptr inbounds %class.anon, ptr %10, i32 0, i32 2
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %40, ptr %39, align 8, !tbaa !5
  %41 = load i32, ptr %9, align 4, !tbaa !9
  %42 = icmp ugt i32 %41, 126
  br i1 %42, label %43, label %45

43:                                               ; preds = %33
  %44 = call noundef i32 @"_ZZN4tagd4rank4nextERS0_RKSt3setIS0_St4lessIS0_ESaIS0_EEENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(24) %10)
  store i32 %44, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %149

45:                                               ; preds = %33
  %46 = load i32, ptr %9, align 4, !tbaa !9
  %47 = icmp ne i32 %46, 1
  br i1 %47, label %48, label %56

48:                                               ; preds = %45
  %49 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN4tagd4rankaSERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %50, ptr noundef nonnull align 8 dereferenceable(32) %49)
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = call noundef i32 @_ZN4tagd4rank8pop_backEv(ptr noundef nonnull align 8 dereferenceable(32) %52)
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = call noundef i32 @_ZN4tagd4rank9push_backEj(ptr noundef nonnull align 8 dereferenceable(32) %54, i32 noundef 1)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %149

56:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %57 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %58 = call noundef i64 @_ZNK4tagd4rank4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %57)
  store i64 %58, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %6, i64 8, i1 false), !tbaa.struct !13
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIN4tagd4rankEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  br label %60

60:                                               ; preds = %141, %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = call ptr @_ZNKSt3setIN4tagd4rankESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %61) #6
  %63 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %13, i32 0, i32 0
  store ptr %62, ptr %63, align 8
  %64 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIN4tagd4rankEES4_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br i1 %64, label %65, label %142

65:                                               ; preds = %60
  %66 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %67 = call noundef i64 @_ZNK4tagd4rank4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %66)
  %68 = load i64, ptr %11, align 8, !tbaa !11
  %69 = icmp ne i64 %67, %68
  br i1 %69, label %70, label %72

70:                                               ; preds = %65
  %71 = call noundef i32 @"_ZZN4tagd4rank4nextERS0_RKSt3setIS0_St4lessIS0_ESaIS0_EEENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(24) %10)
  store i32 %71, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %148

72:                                               ; preds = %65
  %73 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %74 = getelementptr inbounds %"class.tagd::rank", ptr %73, i32 0, i32 0
  %75 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %74) #6
  br i1 %75, label %80, label %76

76:                                               ; preds = %72
  %77 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %78 = getelementptr inbounds %"class.tagd::rank", ptr %77, i32 0, i32 0
  %79 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %78) #6
  br i1 %79, label %80, label %83

80:                                               ; preds = %76, %72
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str)
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %81, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 7, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %148

83:                                               ; preds = %76
  %84 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %85 = getelementptr inbounds %"class.tagd::rank", ptr %84, i32 0, i32 0
  %86 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %85) #6
  %87 = icmp ugt i64 %86, 1
  br i1 %87, label %88, label %112

88:                                               ; preds = %83
  %89 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %90 = getelementptr inbounds %"class.tagd::rank", ptr %89, i32 0, i32 0
  %91 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %92 = getelementptr inbounds %"class.tagd::rank", ptr %91, i32 0, i32 0
  %93 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %92) #6
  %94 = sub i64 %93, 1
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #6
  %95 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %96 = getelementptr inbounds %"class.tagd::rank", ptr %95, i32 0, i32 0
  %97 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %98 = getelementptr inbounds %"class.tagd::rank", ptr %97, i32 0, i32 0
  %99 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %98) #6
  %100 = sub i64 %99, 1
  call void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %14, ptr noundef nonnull align 8 dereferenceable(32) %96, i64 noundef 0, i64 noundef %100)
  %101 = invoke noundef i32 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareEmmRKS4_(ptr noundef nonnull align 8 dereferenceable(32) %90, i64 noundef 0, i64 noundef %94, ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %102 unwind label %107

102:                                              ; preds = %88
  %103 = icmp ne i32 %101, 0
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  br i1 %103, label %104, label %111

104:                                              ; preds = %102
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.1)
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %105, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 6, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %148

107:                                              ; preds = %88
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %15, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %16, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %152

111:                                              ; preds = %102
  br label %112

112:                                              ; preds = %111, %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %113 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %114 = getelementptr inbounds %"class.tagd::rank", ptr %113, i32 0, i32 0
  %115 = load i64, ptr %11, align 8, !tbaa !11
  %116 = sub i64 %115, 1
  %117 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %114, i64 noundef %116) #6
  %118 = load i8, ptr %117, align 1, !tbaa !14
  %119 = zext i8 %118 to i32
  %120 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %121 = getelementptr inbounds %"class.tagd::rank", ptr %120, i32 0, i32 0
  %122 = load i64, ptr %11, align 8, !tbaa !11
  %123 = sub i64 %122, 1
  %124 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %121, i64 noundef %123) #6
  %125 = load i8, ptr %124, align 1, !tbaa !14
  %126 = zext i8 %125 to i32
  %127 = sub nsw i32 %119, %126
  store i32 %127, ptr %17, align 4, !tbaa !9
  %128 = load i32, ptr %17, align 4, !tbaa !9
  %129 = icmp sle i32 %128, 0
  br i1 %129, label %130, label %133

130:                                              ; preds = %112
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.2)
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %131, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 6, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %139

133:                                              ; preds = %112
  %134 = load i32, ptr %17, align 4, !tbaa !9
  %135 = icmp sgt i32 %134, 1
  br i1 %135, label %136, label %137

136:                                              ; preds = %133
  store i32 3, ptr %8, align 4
  br label %139

137:                                              ; preds = %133
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %6, i64 8, i1 false), !tbaa.struct !13
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIN4tagd4rankEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  store i32 0, ptr %8, align 4
  br label %139

139:                                              ; preds = %137, %136, %130
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  %140 = load i32, ptr %8, align 4
  switch i32 %140, label %148 [
    i32 0, label %141
    i32 3, label %142
  ]

141:                                              ; preds = %139
  br label %60, !llvm.loop !15

142:                                              ; preds = %139, %60
  %143 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN4tagd4rankaSERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %144, ptr noundef nonnull align 8 dereferenceable(32) %143)
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = call noundef i32 @_ZN4tagd4rank9incrementEv(ptr noundef nonnull align 8 dereferenceable(32) %146)
  store i32 %147, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %148

148:                                              ; preds = %142, %139, %104, %80, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %149

149:                                              ; preds = %148, %48, %43
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %150

150:                                              ; preds = %149, %30, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %151 = load i32, ptr %3, align 4
  ret i32 %151

152:                                              ; preds = %107
  %153 = load ptr, ptr %15, align 8
  %154 = load i32, ptr %16, align 4
  %155 = insertvalue { ptr, i32 } poison, ptr %153, 0
  %156 = insertvalue { ptr, i32 } %155, i32 %154, 1
  resume { ptr, i32 } %156
}

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 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)) #4

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i32 @"_ZZN4tagd4rank4nextERS0_RKSt3setIS0_St4lessIS0_ESaIS0_EEENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%class.anon = type { ptr, ptr, ptr }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [23 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1

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

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

declare noundef i32 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareEmmRKS4_(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, i64 noundef) local_unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN4tagd4rank4nextERS0_RKSt3setIS0_St4lessIS0_ESaIS0_EE(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(48) %1) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %4 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %5 = alloca %class.anon, align 8
  %6 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %9 = tail call ptr @_ZNKSt3setIN4tagd4rankESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  store ptr %9, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %10 = tail call ptr @_ZNKSt3setIN4tagd4rankESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  store ptr %10, ptr %4, align 8
  %11 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorIN4tagd4rankEES4_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br i1 %11, label %98, label %12

12:                                               ; preds = %2
  %13 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %14 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  br i1 %14, label %15, label %18

15:                                               ; preds = %12
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str)
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %98

18:                                               ; preds = %12
  %19 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %20 = call noundef i32 @_ZNK4tagd4rank4backEv(ptr noundef nonnull align 8 dereferenceable(32) %19)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  store ptr %3, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %5, i64 8
  store ptr %1, ptr %21, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %5, i64 16
  store ptr %0, ptr %22, align 8, !tbaa !5
  %23 = icmp ugt i32 %20, 126
  br i1 %23, label %24, label %26

24:                                               ; preds = %18
  %25 = call noundef i32 @"_ZZN4tagd4rank4nextERS0_RKSt3setIS0_St4lessIS0_ESaIS0_EEENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(24) %5)
  br label %97

26:                                               ; preds = %18
  %.not = icmp eq i32 %20, 1
  br i1 %.not, label %32, label %27

27:                                               ; preds = %26
  %28 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %29 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN4tagd4rankaSERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %28)
  %30 = call noundef i32 @_ZN4tagd4rank8pop_backEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %31 = call noundef i32 @_ZN4tagd4rank9push_backEj(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 1)
  br label %97

32:                                               ; preds = %26
  %33 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %34 = call noundef i64 @_ZNK4tagd4rank4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %33)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %35 = load i64, ptr %3, align 8, !tbaa !5
  store i64 %35, ptr %6, align 8, !tbaa !5
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIN4tagd4rankEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %37 = call ptr @_ZNKSt3setIN4tagd4rankESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  store ptr %37, ptr %7, align 8
  %38 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIN4tagd4rankEES4_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br i1 %38, label %.lr.ph, label %.thread28

.lr.ph:                                           ; preds = %32
  %39 = add i64 %34, -1
  br label %40

40:                                               ; preds = %.lr.ph, %88
  %41 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %42 = call noundef i64 @_ZNK4tagd4rank4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %41)
  %.not24 = icmp eq i64 %42, %34
  br i1 %.not24, label %45, label %43

43:                                               ; preds = %40
  %44 = call noundef i32 @"_ZZN4tagd4rank4nextERS0_RKSt3setIS0_St4lessIS0_ESaIS0_EEENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(24) %5)
  br label %96

45:                                               ; preds = %40
  %46 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %47 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %46) #5
  br i1 %47, label %51, label %48

48:                                               ; preds = %45
  %49 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %50 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %49) #5
  br i1 %50, label %51, label %54

51:                                               ; preds = %48, %45
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str)
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %96

54:                                               ; preds = %48
  %55 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %56 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %55) #5
  %57 = icmp ugt i64 %56, 1
  br i1 %57, label %58, label %74

58:                                               ; preds = %54
  %59 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %60 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %61 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %60) #5
  %62 = add i64 %61, -1
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #5
  %63 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %64 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %65 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %64) #5
  %66 = add i64 %65, -1
  call void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %8, ptr noundef nonnull align 8 dereferenceable(32) %63, i64 noundef 0, i64 noundef %66)
  %67 = invoke noundef i32 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareEmmRKS4_(ptr noundef nonnull align 8 dereferenceable(32) %59, i64 noundef 0, i64 noundef %62, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %68 unwind label %72

68:                                               ; preds = %58
  %.not25 = icmp eq i32 %67, 0
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  br i1 %.not25, label %74, label %69

69:                                               ; preds = %68
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.1)
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %96

72:                                               ; preds = %58
  %73 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  resume { ptr, i32 } %73

74:                                               ; preds = %68, %54
  %75 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %76 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %75, i64 noundef %39) #5
  %77 = load i8, ptr %76, align 1, !tbaa !9
  %78 = zext i8 %77 to i32
  %79 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %80 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %79, i64 noundef %39) #5
  %81 = load i8, ptr %80, align 1, !tbaa !9
  %82 = zext i8 %81 to i32
  %83 = sub nsw i32 %78, %82
  %84 = icmp slt i32 %83, 1
  br i1 %84, label %.thread, label %87

.thread:                                          ; preds = %74
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.2)
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %85, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %96

87:                                               ; preds = %74
  %.not26 = icmp eq i32 %83, 1
  br i1 %.not26, label %88, label %.thread28

88:                                               ; preds = %87
  %89 = load i64, ptr %3, align 8, !tbaa !5
  store i64 %89, ptr %6, align 8, !tbaa !5
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIN4tagd4rankEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %91 = call ptr @_ZNKSt3setIN4tagd4rankESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  store ptr %91, ptr %7, align 8
  %92 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIN4tagd4rankEES4_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br i1 %92, label %40, label %.thread28

.thread28:                                        ; preds = %88, %87, %32
  %93 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt23_Rb_tree_const_iteratorIN4tagd4rankEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %94 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN4tagd4rankaSERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %93)
  %95 = call noundef i32 @_ZN4tagd4rank9incrementEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  br label %96

96:                                               ; preds = %.thread, %.thread28, %69, %51, %43
  %.2 = phi i32 [ %44, %43 ], [ 7, %51 ], [ 6, %69 ], [ %95, %.thread28 ], [ 6, %.thread ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %97

97:                                               ; preds = %96, %27, %24
  %.3 = phi i32 [ %25, %24 ], [ 0, %27 ], [ %.2, %96 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br label %98

98:                                               ; preds = %2, %97, %15
  %.4 = phi i32 [ 7, %15 ], [ %.3, %97 ], [ 7, %2 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  ret i32 %.4
}

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

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

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

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

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

; 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 #3 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)) #4

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i32 @"_ZZN4tagd4rank4nextERS0_RKSt3setIS0_St4lessIS0_ESaIS0_EEENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}


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