; LLVM IR from sp-nitech/SPTK :: src/math/minmax_accumulation.ll (ZNK4sptk18MinMaxAccumulation3RunEdPNS0_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::pair.3" = type <{ double, i32, [4 x i8] }>
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"class.sptk::MinMaxAccumulation" = type <{ ptr, i32, i8, [3 x i8] }>
%"class.sptk::MinMaxAccumulation::Buffer" = type { ptr, i32, %"class.std::multimap", %"class.std::multimap.0" }
%"class.std::multimap" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<double, std::pair<const double, int>, std::_Select1st<std::pair<const double, int>>, std::greater<double>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<double, std::pair<const double, int>, std::_Select1st<std::pair<const double, int>>, std::greater<double>>::_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::multimap.0" = type { %"class.std::_Rb_tree.1" }
%"class.std::_Rb_tree.1" = type { %"struct.std::_Rb_tree<double, std::pair<const double, int>, std::_Select1st<std::pair<const double, int>>, std::less<double>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<double, std::pair<const double, int>, std::_Select1st<std::pair<const double, int>>, std::less<double>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::pair" = type <{ double, i32, [4 x i8] }>

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt8multimapIdiSt7greaterIdESaISt4pairIKdiEEE4sizeEv(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 nounwind uwtable
declare dso_local noundef i64 @_ZNKSt8multimapIdiSt4lessIdESaISt4pairIKdiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48)) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK4sptk18MinMaxAccumulation3RunEdPNS0_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::pair.3", align 8
  %9 = alloca { double, i32 }, align 8
  %10 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_iterator", 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 %"struct.std::_Rb_tree_iterator", 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
  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
  %20 = load ptr, ptr %5, align 8
  %21 = getelementptr inbounds %"class.sptk::MinMaxAccumulation", ptr %20, i32 0, i32 2
  %22 = load i8, ptr %21, align 4, !tbaa !11, !range !15, !noundef !16
  %23 = trunc i8 %22 to i1
  br i1 %23, label %24, label %27

24:                                               ; preds = %3
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = icmp eq ptr null, %25
  br i1 %26, label %27, label %28

27:                                               ; preds = %24, %3
  store i1 false, ptr %4, align 1
  br label %114

28:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #4
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = getelementptr inbounds %"class.sptk::MinMaxAccumulation::Buffer", ptr %29, i32 0, i32 1
  %31 = call { double, i32 } @_ZSt9make_pairIRdRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %30)
  store { double, i32 } %31, ptr %9, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 %9, i64 12, i1 false)
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = getelementptr inbounds %"class.sptk::MinMaxAccumulation::Buffer", ptr %32, i32 0, i32 2
  %34 = call noundef i64 @_ZNKSt8multimapIdiSt7greaterIdESaISt4pairIKdiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %33) #4
  %35 = getelementptr inbounds %"class.sptk::MinMaxAccumulation", ptr %20, i32 0, i32 1
  %36 = load i32, ptr %35, align 8, !tbaa !17
  %37 = sext i32 %36 to i64
  %38 = icmp ult i64 %34, %37
  br i1 %38, label %39, label %44

39:                                               ; preds = %28
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = getelementptr inbounds %"class.sptk::MinMaxAccumulation::Buffer", ptr %40, i32 0, i32 2
  %42 = call ptr @_ZNSt8multimapIdiSt7greaterIdESaISt4pairIKdiEEE6insertIRKS2_IdiEEENSt9enable_ifIXsr16is_constructibleIS4_T_EE5valueESt17_Rb_tree_iteratorIS4_EE4typeEOSC_(ptr noundef nonnull align 8 dereferenceable(48) %41, ptr noundef nonnull align 8 dereferenceable(12) %8)
  %43 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %10, i32 0, i32 0
  store ptr %42, ptr %43, align 8
  br label %70

44:                                               ; preds = %28
  %45 = load double, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = getelementptr inbounds %"class.sptk::MinMaxAccumulation::Buffer", ptr %46, i32 0, i32 2
  %48 = call ptr @_ZNSt8multimapIdiSt7greaterIdESaISt4pairIKdiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %47) #4
  %49 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %11, i32 0, i32 0
  store ptr %48, ptr %49, align 8
  %50 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKdiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  %51 = getelementptr inbounds %"struct.std::pair", ptr %50, i32 0, i32 0
  %52 = load double, ptr %51, align 8, !tbaa !18
  %53 = fcmp olt double %45, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br i1 %53, label %54, label %69

54:                                               ; preds = %44
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = getelementptr inbounds %"class.sptk::MinMaxAccumulation::Buffer", ptr %55, i32 0, i32 2
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = getelementptr inbounds %"class.sptk::MinMaxAccumulation::Buffer", ptr %57, i32 0, i32 2
  %59 = call ptr @_ZNSt8multimapIdiSt7greaterIdESaISt4pairIKdiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %58) #4
  %60 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %12, i32 0, i32 0
  store ptr %59, ptr %60, align 8
  %61 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %12, i32 0, i32 0
  %62 = load ptr, ptr %61, align 8
  %63 = call ptr @_ZNSt8multimapIdiSt7greaterIdESaISt4pairIKdiEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(48) %56, ptr %62)
  %64 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %13, i32 0, i32 0
  store ptr %63, ptr %64, align 8
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds %"class.sptk::MinMaxAccumulation::Buffer", ptr %65, i32 0, i32 2
  %67 = call ptr @_ZNSt8multimapIdiSt7greaterIdESaISt4pairIKdiEEE6insertIRKS2_IdiEEENSt9enable_ifIXsr16is_constructibleIS4_T_EE5valueESt17_Rb_tree_iteratorIS4_EE4typeEOSC_(ptr noundef nonnull align 8 dereferenceable(48) %66, ptr noundef nonnull align 8 dereferenceable(12) %8)
  %68 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %14, i32 0, i32 0
  store ptr %67, ptr %68, align 8
  br label %69

69:                                               ; preds = %54, %44
  br label %70

70:                                               ; preds = %69, %39
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = getelementptr inbounds %"class.sptk::MinMaxAccumulation::Buffer", ptr %71, i32 0, i32 3
  %73 = call noundef i64 @_ZNKSt8multimapIdiSt4lessIdESaISt4pairIKdiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %72) #4
  %74 = getelementptr inbounds %"class.sptk::MinMaxAccumulation", ptr %20, i32 0, i32 1
  %75 = load i32, ptr %74, align 8, !tbaa !17
  %76 = sext i32 %75 to i64
  %77 = icmp ult i64 %73, %76
  br i1 %77, label %78, label %83

78:                                               ; preds = %70
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = getelementptr inbounds %"class.sptk::MinMaxAccumulation::Buffer", ptr %79, i32 0, i32 3
  %81 = call ptr @_ZNSt8multimapIdiSt4lessIdESaISt4pairIKdiEEE6insertIRKS2_IdiEEENSt9enable_ifIXsr16is_constructibleIS4_T_EE5valueESt17_Rb_tree_iteratorIS4_EE4typeEOSC_(ptr noundef nonnull align 8 dereferenceable(48) %80, ptr noundef nonnull align 8 dereferenceable(12) %8)
  %82 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %15, i32 0, i32 0
  store ptr %81, ptr %82, align 8
  br label %109

83:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  %85 = getelementptr inbounds %"class.sptk::MinMaxAccumulation::Buffer", ptr %84, i32 0, i32 3
  %86 = call ptr @_ZNSt8multimapIdiSt4lessIdESaISt4pairIKdiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %85) #4
  %87 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %16, i32 0, i32 0
  store ptr %86, ptr %87, align 8
  %88 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKdiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %89 = getelementptr inbounds %"struct.std::pair", ptr %88, i32 0, i32 0
  %90 = load double, ptr %89, align 8, !tbaa !18
  %91 = load double, ptr %6, align 8, !tbaa !9
  %92 = fcmp olt double %90, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br i1 %92, label %93, label %108

93:                                               ; preds = %83
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = getelementptr inbounds %"class.sptk::MinMaxAccumulation::Buffer", ptr %94, i32 0, i32 3
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = getelementptr inbounds %"class.sptk::MinMaxAccumulation::Buffer", ptr %96, i32 0, i32 3
  %98 = call ptr @_ZNSt8multimapIdiSt4lessIdESaISt4pairIKdiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %97) #4
  %99 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %17, i32 0, i32 0
  store ptr %98, ptr %99, align 8
  %100 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %17, i32 0, i32 0
  %101 = load ptr, ptr %100, align 8
  %102 = call ptr @_ZNSt8multimapIdiSt4lessIdESaISt4pairIKdiEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(48) %95, ptr %101)
  %103 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %18, i32 0, i32 0
  store ptr %102, ptr %103, align 8
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = getelementptr inbounds %"class.sptk::MinMaxAccumulation::Buffer", ptr %104, i32 0, i32 3
  %106 = call ptr @_ZNSt8multimapIdiSt4lessIdESaISt4pairIKdiEEE6insertIRKS2_IdiEEENSt9enable_ifIXsr16is_constructibleIS4_T_EE5valueESt17_Rb_tree_iteratorIS4_EE4typeEOSC_(ptr noundef nonnull align 8 dereferenceable(48) %105, ptr noundef nonnull align 8 dereferenceable(12) %8)
  %107 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %19, i32 0, i32 0
  store ptr %106, ptr %107, align 8
  br label %108

108:                                              ; preds = %93, %83
  br label %109

109:                                              ; preds = %108, %78
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = getelementptr inbounds %"class.sptk::MinMaxAccumulation::Buffer", ptr %110, i32 0, i32 1
  %112 = load i32, ptr %111, align 8, !tbaa !20
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %111, align 8, !tbaa !20
  store i1 true, ptr %4, align 1
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #4
  br label %114

114:                                              ; preds = %109, %27
  %115 = load i1, ptr %4, align 1
  ret i1 %115
}

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt8multimapIdiSt4lessIdESaISt4pairIKdiEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(48), ptr) #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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"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 = !{!"_ZTSN4sptk18MinMaxAccumulationE", !13, i64 8, !14, i64 12}
!13 = !{!"int", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!12, !13, i64 8}
!18 = !{!19, !10, i64 0}
!19 = !{!"_ZTSSt4pairIKdiE", !10, i64 0, !13, i64 8}
!20 = !{!21, !13, i64 8}
!21 = !{!"_ZTSN4sptk18MinMaxAccumulation6BufferE", !13, i64 8, !22, i64 16, !31, i64 64}
!22 = !{!"_ZTSSt8multimapIdiSt7greaterIdESaISt4pairIKdiEEE", !23, i64 0}
!23 = !{!"_ZTSSt8_Rb_treeIdSt4pairIKdiESt10_Select1stIS2_ESt7greaterIdESaIS2_EE", !24, i64 0}
!24 = !{!"_ZTSNSt8_Rb_treeIdSt4pairIKdiESt10_Select1stIS2_ESt7greaterIdESaIS2_EE13_Rb_tree_implIS6_Lb1EEE", !25, i64 0, !27, i64 8}
!25 = !{!"_ZTSSt20_Rb_tree_key_compareISt7greaterIdEE", !26, i64 0}
!26 = !{!"_ZTSSt7greaterIdE"}
!27 = !{!"_ZTSSt15_Rb_tree_header", !28, i64 0, !30, i64 32}
!28 = !{!"_ZTSSt18_Rb_tree_node_base", !29, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!29 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!30 = !{!"long", !7, i64 0}
!31 = !{!"_ZTSSt8multimapIdiSt4lessIdESaISt4pairIKdiEEE", !32, i64 0}
!32 = !{!"_ZTSSt8_Rb_treeIdSt4pairIKdiESt10_Select1stIS2_ESt4lessIdESaIS2_EE", !33, i64 0}
!33 = !{!"_ZTSNSt8_Rb_treeIdSt4pairIKdiESt10_Select1stIS2_ESt4lessIdESaIS2_EE13_Rb_tree_implIS6_Lb1EEE", !34, i64 0, !27, i64 8}
!34 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIdEE", !35, i64 0}
!35 = !{!"_ZTSSt4lessIdE"}


; 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::pair.3" = type <{ double, i32, [4 x i8] }>
%"struct.std::_Rb_tree_iterator" = type { ptr }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt8multimapIdiSt7greaterIdESaISt4pairIKdiEEE4sizeEv(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 nounwind uwtable
declare dso_local noundef i64 @_ZNKSt8multimapIdiSt4lessIdESaISt4pairIKdiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK4sptk18MinMaxAccumulation3RunEdPNS0_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::pair.3", align 8
  %6 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %7 = alloca %"struct.std::_Rb_tree_iterator", align 8
  store double %1, ptr %4, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 12
  %9 = load i8, ptr %8, align 4, !tbaa !9, !range !13, !noundef !14
  %10 = trunc nuw i8 %9 to i1
  %11 = icmp ne ptr %2, null
  %or.cond.not = and i1 %11, %10
  br i1 %or.cond.not, label %12, label %50

12:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #3
  %13 = getelementptr inbounds i8, ptr %2, i64 8
  %14 = call { double, i32 } @_ZSt9make_pairIRdRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %.fca.0.extract = extractvalue { double, i32 } %14, 0
  %.fca.1.extract = extractvalue { double, i32 } %14, 1
  store double %.fca.0.extract, ptr %5, align 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  %15 = getelementptr inbounds i8, ptr %2, i64 16
  %16 = call noundef i64 @_ZNKSt8multimapIdiSt7greaterIdESaISt4pairIKdiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %15) #3
  %17 = getelementptr inbounds i8, ptr %0, i64 8
  %18 = load i32, ptr %17, align 8, !tbaa !15
  %19 = sext i32 %18 to i64
  %20 = icmp ult i64 %16, %19
  br i1 %20, label %.sink.split, label %21

21:                                               ; preds = %12
  %22 = load double, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  %23 = call ptr @_ZNSt8multimapIdiSt7greaterIdESaISt4pairIKdiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %15) #3
  store ptr %23, ptr %6, align 8
  %24 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKdiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #3
  %25 = load double, ptr %24, align 8, !tbaa !16
  %26 = fcmp olt double %22, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  br i1 %26, label %27, label %31

27:                                               ; preds = %21
  %28 = call ptr @_ZNSt8multimapIdiSt7greaterIdESaISt4pairIKdiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %15) #3
  %29 = call ptr @_ZNSt8multimapIdiSt7greaterIdESaISt4pairIKdiEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(48) %15, ptr %28)
  br label %.sink.split

.sink.split:                                      ; preds = %12, %27
  %30 = call ptr @_ZNSt8multimapIdiSt7greaterIdESaISt4pairIKdiEEE6insertIRKS2_IdiEEENSt9enable_ifIXsr16is_constructibleIS4_T_EE5valueESt17_Rb_tree_iteratorIS4_EE4typeEOSC_(ptr noundef nonnull align 8 dereferenceable(48) %15, ptr noundef nonnull align 8 dereferenceable(12) %5)
  br label %31

31:                                               ; preds = %.sink.split, %21
  %32 = getelementptr inbounds i8, ptr %2, i64 64
  %33 = call noundef i64 @_ZNKSt8multimapIdiSt4lessIdESaISt4pairIKdiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %32) #3
  %34 = load i32, ptr %17, align 8, !tbaa !15
  %35 = sext i32 %34 to i64
  %36 = icmp ult i64 %33, %35
  br i1 %36, label %.sink.split28, label %37

37:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  %38 = call ptr @_ZNSt8multimapIdiSt4lessIdESaISt4pairIKdiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %32) #3
  store ptr %38, ptr %7, align 8
  %39 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKdiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #3
  %40 = load double, ptr %39, align 8, !tbaa !16
  %41 = load double, ptr %4, align 8, !tbaa !5
  %42 = fcmp olt double %40, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  br i1 %42, label %43, label %47

43:                                               ; preds = %37
  %44 = call ptr @_ZNSt8multimapIdiSt4lessIdESaISt4pairIKdiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %32) #3
  %45 = call ptr @_ZNSt8multimapIdiSt4lessIdESaISt4pairIKdiEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(48) %32, ptr %44)
  br label %.sink.split28

.sink.split28:                                    ; preds = %31, %43
  %46 = call ptr @_ZNSt8multimapIdiSt4lessIdESaISt4pairIKdiEEE6insertIRKS2_IdiEEENSt9enable_ifIXsr16is_constructibleIS4_T_EE5valueESt17_Rb_tree_iteratorIS4_EE4typeEOSC_(ptr noundef nonnull align 8 dereferenceable(48) %32, ptr noundef nonnull align 8 dereferenceable(12) %5)
  br label %47

47:                                               ; preds = %.sink.split28, %37
  %48 = load i32, ptr %13, align 8, !tbaa !18
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %13, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  br label %50

50:                                               ; preds = %3, %47
  ret i1 %or.cond.not
}

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt8multimapIdiSt4lessIdESaISt4pairIKdiEEE5eraseB5cxx11ESt17_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 = { 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 = !{!"_ZTSN4sptk18MinMaxAccumulationE", !11, i64 8, !12, i64 12}
!11 = !{!"int", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!10, !11, i64 8}
!16 = !{!17, !6, i64 0}
!17 = !{!"_ZTSSt4pairIKdiE", !6, i64 0, !11, i64 8}
!18 = !{!19, !11, i64 8}
!19 = !{!"_ZTSN4sptk18MinMaxAccumulation6BufferE", !11, i64 8, !20, i64 16, !30, i64 64}
!20 = !{!"_ZTSSt8multimapIdiSt7greaterIdESaISt4pairIKdiEEE", !21, i64 0}
!21 = !{!"_ZTSSt8_Rb_treeIdSt4pairIKdiESt10_Select1stIS2_ESt7greaterIdESaIS2_EE", !22, i64 0}
!22 = !{!"_ZTSNSt8_Rb_treeIdSt4pairIKdiESt10_Select1stIS2_ESt7greaterIdESaIS2_EE13_Rb_tree_implIS6_Lb1EEE", !23, i64 0, !25, i64 8}
!23 = !{!"_ZTSSt20_Rb_tree_key_compareISt7greaterIdEE", !24, i64 0}
!24 = !{!"_ZTSSt7greaterIdE"}
!25 = !{!"_ZTSSt15_Rb_tree_header", !26, i64 0, !29, i64 32}
!26 = !{!"_ZTSSt18_Rb_tree_node_base", !27, i64 0, !28, i64 8, !28, i64 16, !28, i64 24}
!27 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!28 = !{!"any pointer", !7, i64 0}
!29 = !{!"long", !7, i64 0}
!30 = !{!"_ZTSSt8multimapIdiSt4lessIdESaISt4pairIKdiEEE", !31, i64 0}
!31 = !{!"_ZTSSt8_Rb_treeIdSt4pairIKdiESt10_Select1stIS2_ESt4lessIdESaIS2_EE", !32, i64 0}
!32 = !{!"_ZTSNSt8_Rb_treeIdSt4pairIKdiESt10_Select1stIS2_ESt4lessIdESaIS2_EE13_Rb_tree_implIS6_Lb1EEE", !33, i64 0, !25, i64 8}
!33 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIdEE", !34, i64 0}
!34 = !{!"_ZTSSt4lessIdE"}


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