; LLVM IR from sp-nitech/SPTK :: src/math/mode_accumulation.ll (ZNK4sptk16ModeAccumulation3RunEdPNS0_6BufferE)

; 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"

%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }
%"struct.std::pair.5" = type { i32, double }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%class.anon = type { double }
%"class.sptk::ModeAccumulation" = type <{ ptr, i32, i8, [3 x i8] }>
%"class.sptk::ModeAccumulation::Buffer" = type { ptr, %"class.std::unordered_map", %"class.std::multimap" }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.std::multimap" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, double>, std::_Select1st<std::pair<const int, double>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, double>, std::_Select1st<std::pair<const int, double>>, 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 { i32, double }

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

; 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 uwtable
define dso_local noundef zeroext i1 @_ZNK4sptk16ModeAccumulation3RunEdPNS0_6BufferE(ptr noundef nonnull align 8 dereferenceable(13) %0, double noundef %1, ptr noundef %2) #2 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %9 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair.5", align 8
  %12 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %13 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %14 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %15 = alloca %class.anon, align 8
  %16 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %17 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %18 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %19 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %20 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %21 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %22 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %23 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %24 = alloca %"struct.std::_Rb_tree_iterator", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store double %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  %25 = load ptr, ptr %5, align 8
  %26 = getelementptr inbounds %"class.sptk::ModeAccumulation", ptr %25, i32 0, i32 2
  %27 = load i8, ptr %26, align 4, !tbaa !11, !range !15, !noundef !16
  %28 = trunc i8 %27 to i1
  br i1 %28, label %29, label %32

29:                                               ; preds = %3
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = icmp eq ptr null, %30
  br i1 %31, label %32, label %33

32:                                               ; preds = %29, %3
  store i1 false, ptr %4, align 1
  br label %140

33:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds %"class.sptk::ModeAccumulation::Buffer", ptr %34, i32 0, i32 1
  %36 = call ptr @_ZNSt13unordered_mapIdiSt4hashIdESt8equal_toIdESaISt4pairIKdiEEE4findERS5_(ptr noundef nonnull align 8 dereferenceable(56) %35, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %37 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %8, i32 0, i32 0
  %38 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %37, i32 0, i32 0
  store ptr %36, ptr %38, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = getelementptr inbounds %"class.sptk::ModeAccumulation::Buffer", ptr %39, i32 0, i32 1
  %41 = call ptr @_ZNSt13unordered_mapIdiSt4hashIdESt8equal_toIdESaISt4pairIKdiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %40) #5
  %42 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %9, i32 0, i32 0
  %43 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %42, i32 0, i32 0
  store ptr %41, ptr %43, align 8
  %44 = call noundef zeroext i1 @_ZNSt8__detaileqERKNS_19_Node_iterator_baseISt4pairIKdiELb0EEES6_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br i1 %44, label %45, label %49

45:                                               ; preds = %33
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = getelementptr inbounds %"class.sptk::ModeAccumulation::Buffer", ptr %46, i32 0, i32 1
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIdiSt4hashIdESt8equal_toIdESaISt4pairIKdiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %47, ptr noundef nonnull align 8 dereferenceable(8) %6)
  store i32 1, ptr %48, align 4, !tbaa !17
  br label %55

49:                                               ; preds = %33
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = getelementptr inbounds %"class.sptk::ModeAccumulation::Buffer", ptr %50, i32 0, i32 1
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIdiSt4hashIdESt8equal_toIdESaISt4pairIKdiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %51, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %53 = load i32, ptr %52, align 4, !tbaa !17
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %52, align 4, !tbaa !17
  br label %55

55:                                               ; preds = %49, %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = getelementptr inbounds %"class.sptk::ModeAccumulation::Buffer", ptr %56, i32 0, i32 1
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIdiSt4hashIdESt8equal_toIdESaISt4pairIKdiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %57, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %59 = load i32, ptr %58, align 4, !tbaa !17
  store i32 %59, ptr %10, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #5
  %60 = call { i32, double } @_ZSt9make_pairIRKiRdESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %61 = getelementptr inbounds { i32, double }, ptr %11, i32 0, i32 0
  %62 = extractvalue { i32, double } %60, 0
  store i32 %62, ptr %61, align 8
  %63 = getelementptr inbounds { i32, double }, ptr %11, i32 0, i32 1
  %64 = extractvalue { i32, double } %60, 1
  store double %64, ptr %63, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds %"class.sptk::ModeAccumulation::Buffer", ptr %65, i32 0, i32 2
  %67 = call ptr @_ZNSt8multimapIidSt4lessIiESaISt4pairIKidEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %66) #5
  %68 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %13, i32 0, i32 0
  store ptr %67, ptr %68, align 8
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = getelementptr inbounds %"class.sptk::ModeAccumulation::Buffer", ptr %69, i32 0, i32 2
  %71 = call ptr @_ZNSt8multimapIidSt4lessIiESaISt4pairIKidEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %70) #5
  %72 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %14, i32 0, i32 0
  store ptr %71, ptr %72, align 8
  %73 = getelementptr inbounds %class.anon, ptr %15, i32 0, i32 0
  %74 = load double, ptr %6, align 8, !tbaa !9
  store double %74, ptr %73, align 8, !tbaa !18
  %75 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %13, i32 0, i32 0
  %76 = load ptr, ptr %75, align 8
  %77 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %14, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8
  %79 = getelementptr inbounds %class.anon, ptr %15, i32 0, i32 0
  %80 = load double, ptr %79, align 8
  %81 = call ptr @"_ZSt7find_ifISt17_Rb_tree_iteratorISt4pairIKidEEZNK4sptk16ModeAccumulation3RunEdPNS6_6BufferEE3$_0ET_SA_SA_T0_"(ptr %76, ptr %78, double %80)
  %82 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %12, i32 0, i32 0
  store ptr %81, ptr %82, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = getelementptr inbounds %"class.sptk::ModeAccumulation::Buffer", ptr %83, i32 0, i32 2
  %85 = call ptr @_ZNSt8multimapIidSt4lessIiESaISt4pairIKidEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %84) #5
  %86 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %16, i32 0, i32 0
  store ptr %85, ptr %86, align 8
  %87 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKidEES5_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br i1 %87, label %88, label %128

88:                                               ; preds = %55
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %"class.sptk::ModeAccumulation::Buffer", ptr %89, i32 0, i32 2
  %91 = call noundef i64 @_ZNKSt8multimapIidSt4lessIiESaISt4pairIKidEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %90) #5
  %92 = getelementptr inbounds %"class.sptk::ModeAccumulation", ptr %25, i32 0, i32 1
  %93 = load i32, ptr %92, align 8, !tbaa !20
  %94 = sext i32 %93 to i64
  %95 = icmp ult i64 %91, %94
  br i1 %95, label %96, label %101

96:                                               ; preds = %88
  %97 = load ptr, ptr %7, align 8, !tbaa !5
  %98 = getelementptr inbounds %"class.sptk::ModeAccumulation::Buffer", ptr %97, i32 0, i32 2
  %99 = call ptr @_ZNSt8multimapIidSt4lessIiESaISt4pairIKidEEE6insertIRKS2_IidEEENSt9enable_ifIXsr16is_constructibleIS4_T_EE5valueESt17_Rb_tree_iteratorIS4_EE4typeEOSC_(ptr noundef nonnull align 8 dereferenceable(48) %98, ptr noundef nonnull align 8 dereferenceable(16) %11)
  %100 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %17, i32 0, i32 0
  store ptr %99, ptr %100, align 8
  br label %127

101:                                              ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = getelementptr inbounds %"class.sptk::ModeAccumulation::Buffer", ptr %102, i32 0, i32 2
  %104 = call ptr @_ZNSt8multimapIidSt4lessIiESaISt4pairIKidEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %103) #5
  %105 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %18, i32 0, i32 0
  store ptr %104, ptr %105, align 8
  %106 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKidEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  %107 = getelementptr inbounds %"struct.std::pair", ptr %106, i32 0, i32 0
  %108 = load i32, ptr %107, align 8, !tbaa !21
  %109 = load i32, ptr %10, align 4, !tbaa !17
  %110 = icmp slt i32 %108, %109
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br i1 %110, label %111, label %126

111:                                              ; preds = %101
  %112 = load ptr, ptr %7, align 8, !tbaa !5
  %113 = getelementptr inbounds %"class.sptk::ModeAccumulation::Buffer", ptr %112, i32 0, i32 2
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  %115 = getelementptr inbounds %"class.sptk::ModeAccumulation::Buffer", ptr %114, i32 0, i32 2
  %116 = call ptr @_ZNSt8multimapIidSt4lessIiESaISt4pairIKidEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %115) #5
  %117 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %19, i32 0, i32 0
  store ptr %116, ptr %117, align 8
  %118 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %19, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8
  %120 = call ptr @_ZNSt8multimapIidSt4lessIiESaISt4pairIKidEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(48) %113, ptr %119)
  %121 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %20, i32 0, i32 0
  store ptr %120, ptr %121, align 8
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = getelementptr inbounds %"class.sptk::ModeAccumulation::Buffer", ptr %122, i32 0, i32 2
  %124 = call ptr @_ZNSt8multimapIidSt4lessIiESaISt4pairIKidEEE6insertIRKS2_IidEEENSt9enable_ifIXsr16is_constructibleIS4_T_EE5valueESt17_Rb_tree_iteratorIS4_EE4typeEOSC_(ptr noundef nonnull align 8 dereferenceable(48) %123, ptr noundef nonnull align 8 dereferenceable(16) %11)
  %125 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %21, i32 0, i32 0
  store ptr %124, ptr %125, align 8
  br label %126

126:                                              ; preds = %111, %101
  br label %127

127:                                              ; preds = %126, %96
  br label %139

128:                                              ; preds = %55
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = getelementptr inbounds %"class.sptk::ModeAccumulation::Buffer", ptr %129, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %22, ptr align 8 %12, i64 8, i1 false), !tbaa.struct !23
  %131 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %22, i32 0, i32 0
  %132 = load ptr, ptr %131, align 8
  %133 = call ptr @_ZNSt8multimapIidSt4lessIiESaISt4pairIKidEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(48) %130, ptr %132)
  %134 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %23, i32 0, i32 0
  store ptr %133, ptr %134, align 8
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  %136 = getelementptr inbounds %"class.sptk::ModeAccumulation::Buffer", ptr %135, i32 0, i32 2
  %137 = call ptr @_ZNSt8multimapIidSt4lessIiESaISt4pairIKidEEE6insertIRKS2_IidEEENSt9enable_ifIXsr16is_constructibleIS4_T_EE5valueESt17_Rb_tree_iteratorIS4_EE4typeEOSC_(ptr noundef nonnull align 8 dereferenceable(48) %136, ptr noundef nonnull align 8 dereferenceable(16) %11)
  %138 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %24, i32 0, i32 0
  store ptr %137, ptr %138, align 8
  br label %139

139:                                              ; preds = %128, %127
  store i1 true, ptr %4, align 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %140

140:                                              ; preds = %139, %32
  %141 = load i1, ptr %4, align 1
  ret i1 %141
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i32, double } @_ZSt9make_pairIRKiRdESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden ptr @"_ZSt7find_ifISt17_Rb_tree_iteratorISt4pairIKidEEZNK4sptk16ModeAccumulation3RunEdPNS6_6BufferEE3$_0ET_SA_SA_T0_"(ptr, ptr, double) #3

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

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

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

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

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

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

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !14, i64 12}
!12 = !{!"_ZTSN4sptk16ModeAccumulationE", !13, i64 8, !14, i64 12}
!13 = !{!"int", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!13, !13, i64 0}
!18 = !{!19, !10, i64 0}
!19 = !{!"_ZTSZNK4sptk16ModeAccumulation3RunEdPNS0_6BufferEE3$_0", !10, i64 0}
!20 = !{!12, !13, i64 8}
!21 = !{!22, !13, i64 0}
!22 = !{!"_ZTSSt4pairIKidE", !13, i64 0, !10, i64 8}
!23 = !{i64 0, i64 8, !5}


; 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"

%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }
%"struct.std::pair.5" = type { i32, double }
%"struct.std::_Rb_tree_iterator" = type { ptr }

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

; 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 uwtable
define dso_local noundef zeroext i1 @_ZNK4sptk16ModeAccumulation3RunEdPNS0_6BufferE(ptr nocapture noundef nonnull readonly align 8 dereferenceable(13) %0, double noundef %1, ptr noundef %2) local_unnamed_addr #2 align 2 {
  %4 = alloca double, align 8
  %5 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %6 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair.5", align 8
  %9 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %10 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_iterator", align 8
  store double %1, ptr %4, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 12
  %13 = load i8, ptr %12, align 4, !tbaa !9, !range !13, !noundef !14
  %14 = trunc nuw i8 %13 to i1
  %15 = icmp ne ptr %2, null
  %or.cond.not = and i1 %15, %14
  br i1 %or.cond.not, label %16, label %55

16:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %17 = getelementptr inbounds i8, ptr %2, i64 8
  %18 = call ptr @_ZNSt13unordered_mapIdiSt4hashIdESt8equal_toIdESaISt4pairIKdiEEE4findERS5_(ptr noundef nonnull align 8 dereferenceable(56) %17, ptr noundef nonnull align 8 dereferenceable(8) %4)
  store ptr %18, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %19 = call ptr @_ZNSt13unordered_mapIdiSt4hashIdESt8equal_toIdESaISt4pairIKdiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %17) #4
  store ptr %19, ptr %6, align 8
  %20 = call noundef zeroext i1 @_ZNSt8__detaileqERKNS_19_Node_iterator_baseISt4pairIKdiELb0EEES6_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  %21 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIdiSt4hashIdESt8equal_toIdESaISt4pairIKdiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %17, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %22 = load i32, ptr %21, align 4
  %23 = add nsw i32 %22, 1
  %.sink = select i1 %20, i32 1, i32 %23
  store i32 %.sink, ptr %21, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIdiSt4hashIdESt8equal_toIdESaISt4pairIKdiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %17, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %25 = load i32, ptr %24, align 4, !tbaa !15
  store i32 %25, ptr %7, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #4
  %26 = call { i32, double } @_ZSt9make_pairIRKiRdESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %27 = extractvalue { i32, double } %26, 0
  store i32 %27, ptr %8, align 8
  %28 = getelementptr inbounds i8, ptr %8, i64 8
  %29 = extractvalue { i32, double } %26, 1
  store double %29, ptr %28, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %30 = getelementptr inbounds i8, ptr %2, i64 64
  %31 = call ptr @_ZNSt8multimapIidSt4lessIiESaISt4pairIKidEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %30) #4
  %32 = call ptr @_ZNSt8multimapIidSt4lessIiESaISt4pairIKidEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %30) #4
  %33 = load double, ptr %4, align 8, !tbaa !5
  %34 = call ptr @"_ZSt7find_ifISt17_Rb_tree_iteratorISt4pairIKidEEZNK4sptk16ModeAccumulation3RunEdPNS6_6BufferEE3$_0ET_SA_SA_T0_"(ptr %31, ptr %32, double %33)
  store ptr %34, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  %35 = call ptr @_ZNSt8multimapIidSt4lessIiESaISt4pairIKidEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %30) #4
  store ptr %35, ptr %10, align 8
  %36 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKidEES5_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  br i1 %36, label %37, label %51

37:                                               ; preds = %16
  %38 = call noundef i64 @_ZNKSt8multimapIidSt4lessIiESaISt4pairIKidEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %30) #4
  %39 = getelementptr inbounds i8, ptr %0, i64 8
  %40 = load i32, ptr %39, align 8, !tbaa !16
  %41 = sext i32 %40 to i64
  %42 = icmp ult i64 %38, %41
  br i1 %42, label %.sink.split, label %43

43:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  %44 = call ptr @_ZNSt8multimapIidSt4lessIiESaISt4pairIKidEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %30) #4
  store ptr %44, ptr %11, align 8
  %45 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKidEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  %46 = load i32, ptr %45, align 8, !tbaa !17
  %47 = load i32, ptr %7, align 4, !tbaa !15
  %48 = icmp slt i32 %46, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  br i1 %48, label %49, label %54

49:                                               ; preds = %43
  %50 = call ptr @_ZNSt8multimapIidSt4lessIiESaISt4pairIKidEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %30) #4
  br label %.sink.split.sink.split

51:                                               ; preds = %16
  %.sroa.03.0.copyload = load ptr, ptr %9, align 8, !tbaa !19
  br label %.sink.split.sink.split

.sink.split.sink.split:                           ; preds = %49, %51
  %.sroa.03.0.copyload.sink = phi ptr [ %.sroa.03.0.copyload, %51 ], [ %50, %49 ]
  %52 = call ptr @_ZNSt8multimapIidSt4lessIiESaISt4pairIKidEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(48) %30, ptr %.sroa.03.0.copyload.sink)
  br label %.sink.split

.sink.split:                                      ; preds = %.sink.split.sink.split, %37
  %53 = call ptr @_ZNSt8multimapIidSt4lessIiESaISt4pairIKidEEE6insertIRKS2_IidEEENSt9enable_ifIXsr16is_constructibleIS4_T_EE5valueESt17_Rb_tree_iteratorIS4_EE4typeEOSC_(ptr noundef nonnull align 8 dereferenceable(48) %30, ptr noundef nonnull align 8 dereferenceable(16) %8)
  br label %54

54:                                               ; preds = %.sink.split, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  br label %55

55:                                               ; preds = %3, %54
  ret i1 %or.cond.not
}

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden ptr @"_ZSt7find_ifISt17_Rb_tree_iteratorISt4pairIKidEEZNK4sptk16ModeAccumulation3RunEdPNS6_6BufferEE3$_0ET_SA_SA_T0_"(ptr, ptr, double) local_unnamed_addr #3

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt8multimapIidSt4lessIiESaISt4pairIKidEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(48), ptr) local_unnamed_addr #2 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 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 12}
!10 = !{!"_ZTSN4sptk16ModeAccumulationE", !11, i64 8, !12, i64 12}
!11 = !{!"int", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!11, !11, i64 0}
!16 = !{!10, !11, i64 8}
!17 = !{!18, !11, i64 0}
!18 = !{!"_ZTSSt4pairIKidE", !11, i64 0, !6, i64 8}
!19 = !{!20, !20, i64 0}
!20 = !{!"any pointer", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass